:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
}

body {
    background-color: #f3f4f6;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

/* Insignias de estado de una empresa (panel de Super Admin) - pastel, sin
 * saturacion, igual criterio visual que el resto de las pantallas del
 * panel de plataforma. */
.badge-estado-activa {
    background-color: #dcfce7;
    color: #15803d;
}
.badge-estado-prueba {
    background-color: #fef3c7;
    color: #b45309;
}
.badge-estado-vencida {
    background-color: #fee2e2;
    color: #b91c1c;
}
.badge-estado-suspendida {
    background-color: #cbd5e1;
    color: #1e293b;
}

.table-plataforma thead th {
    background-color: #f1f5f9;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    font-weight: 600;
    border-bottom: none;
}

.sidebar {
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    color: #e5e7eb;
    width: 230px;
}

.sidebar .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    padding: 0.75rem;
    border-bottom: 1px solid #1f2937;
}

/* El logo tiene letras oscuras: va sobre un recuadro blanco para que se lea en el menu oscuro. */
.sidebar .brand-logo {
    background: #fff;
    border-radius: 10px;
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.sidebar .brand-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.sidebar .brand-empresa {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar a {
    color: #d1d5db;
    text-decoration: none;
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin: 2px 8px;
}

.sidebar a:hover,
.sidebar a.active {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.sidebar .submenu-link {
    color: #9ca3af;
    text-decoration: none;
    display: block;
    padding: 0.45rem 1rem 0.45rem 2.4rem;
    font-size: 0.85rem;
    border-radius: 6px;
    margin: 1px 8px;
}

.sidebar .submenu-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.sidebar .section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #6b7280;
    padding: 0.8rem 1rem 0.2rem;
    letter-spacing: 0.05em;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-body {
    padding: 1.5rem 2rem;
}

.topbar {
    /* Fija arriba: la barra se queda a la vista al bajar en cualquier pantalla del sistema. */
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 2rem;
    min-height: 72px;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.topbar-brand {
    min-width: 0;
    max-width: 55vw;
    white-space: nowrap;
}

.topbar-logo {
    height: 34px;
    width: auto;
    flex-shrink: 0;
}

.topbar-empresa {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--primary-dark);
}

/* En el punto de venta la barra lleva el logo al lado, asi que el nombre va mas discreto. */
.topbar-logo + .topbar-empresa {
    font-size: 1.15rem;
    padding-left: 0.75rem;
    border-left: 1px solid #e5e7eb;
}

.topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    white-space: nowrap;
}

.topbar-bell {
    position: relative;
    background: transparent;
    border: 0;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.topbar-bell-icon {
    font-size: 1.7rem;
}

.topbar-bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.topbar-soporte {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1.1rem;
    border: 1.5px solid #84cc16;
    border-radius: 999px;
    color: #3f6212;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-soporte .bi {
    color: #111827;
    font-size: 1.15rem;
}

.topbar-soporte:hover {
    background: #f7fee7;
    color: #3f6212;
}

.topbar-avatar {
    position: relative;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

.topbar-avatar-dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

.topbar-menu-btn {
    display: none;
    align-items: center;
    background: transparent;
    border: 0;
    padding: 0 0.25rem;
    font-size: 2rem;
    line-height: 1;
    color: #111827;
}

.sidebar-backdrop {
    display: none;
}

.main-content {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .topbar-menu-btn {
        display: inline-flex;
    }
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        min-height: 0;
        height: 100vh;
        overflow-y: auto;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    body.menu-abierto .sidebar {
        transform: translateX(0);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.45);
    }
    body.menu-abierto .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1040;
    }
    .main-content {
        width: 100%;
    }
}

.page-titulo {
    font-size: 1.9rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 1.25rem;
}

@media (max-width: 991.98px) {
    .topbar-logo + .topbar-empresa {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 576px) {
    .topbar {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    .topbar-brand {
        max-width: 48vw;
    }
    .topbar-empresa {
        font-size: 1.15rem;
    }
    .topbar-logo {
        height: 26px;
    }
    .topbar-pill {
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
    }
    .topbar-soporte span {
        display: none;
    }
    .topbar-soporte {
        padding: 0.4rem 0.6rem;
    }
    .page-titulo {
        font-size: 1.4rem;
    }
    .page-body {
        padding: 0.75rem 1rem;
    }
}

.stat-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.stat-card > .d-flex {
    gap: 0.5rem;
}

.stat-card > .d-flex > div:first-child {
    min-width: 0;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    word-break: break-word;
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.badge-stock-bajo {
    background-color: var(--danger);
}

.table thead {
    background-color: #f9fafb;
}

.card {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* ===== Punto de venta ===== */
.page-body:has(.pos-workspace) {
    padding: 0.5rem;
}

.pos-workspace {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: calc(100vh - 6rem);
}

@media (min-width: 992px) {
    .pos-workspace {
        flex-direction: row;
        height: calc(100vh - 6rem);
        min-height: 0;
    }
}

.pos-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0.75rem;
    min-height: 0;
}

.pos-right {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.pos-right-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

@media (min-width: 992px) {
    .pos-right {
        width: 24rem;
        flex-shrink: 0;
    }
}

.pos-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.pos-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.pos-search-input {
    display: flex;
    flex: 1;
    min-width: 220px;
    gap: 0.5rem;
}

.pos-input {
    display: block;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #0f172a;
    background: #fff;
}

.pos-input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: var(--primary);
}

.pos-input:disabled {
    background: #f1f5f9;
    color: #64748b;
}

.pos-select-auto {
    width: auto;
}

.pos-btn-brand,
.pos-btn-secondary,
.pos-btn-success,
.pos-btn-warning,
.pos-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}

.pos-btn-brand { background: var(--primary); color: #fff; }
.pos-btn-brand:hover { background: var(--primary-dark); color: #fff; }
.pos-btn-secondary { background: #fff; color: #334155; border-color: #cbd5e1; }
.pos-btn-secondary:hover { background: #f1f5f9; color: #0f172a; }
.pos-btn-success { background: #16a34a; color: #fff; }
.pos-btn-success:hover { background: #15803d; color: #fff; }
.pos-btn-warning { background: #f97316; color: #fff; }
.pos-btn-warning:hover { background: #ea580c; color: #fff; }
.pos-btn-danger { background: #dc2626; color: #fff; }
.pos-btn-danger:hover { background: #b91c1c; color: #fff; }

.pos-btn:disabled,
.pos-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.pos-btn-plus {
    padding: 0 0.75rem;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pos-btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.pos-btn-block {
    width: 100%;
    padding: 0.65rem 1rem;
}

.pos-grid-card {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .pos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
    .pos-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pos-product-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    height: 100%;
    padding: 0.75rem;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
}

.pos-product-card:hover:not(:disabled) {
    border-color: var(--primary);
}

.pos-product-card:disabled,
.pos-product-card.pos-product-agotado {
    cursor: not-allowed;
    opacity: 0.5;
}

.pos-product-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 4rem;
    overflow: hidden;
    border-radius: 0.25rem;
    background: #f1f5f9;
    color: #cbd5e1;
}

.pos-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-product-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.875rem;
    color: #1e293b;
}

.pos-product-price {
    font-weight: 600;
    color: #0f172a;
}

.pos-product-stock {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #64748b;
}

.pos-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}
.pos-dot-green { background: #22c55e; }
.pos-dot-amber { background: #f59e0b; }
.pos-dot-red { background: #ef4444; }

.pos-cart-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 24rem;
    overflow: hidden;
}

@media (min-width: 992px) {
    .pos-cart-card { min-height: 0; }
}

.pos-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.pos-cart-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.pos-head-links {
    display: flex;
    gap: 0.25rem;
}

.pos-client-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.pos-client-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-icon-btn {
    border: none;
    border-radius: 0.25rem;
    padding: 0.3rem 0.45rem;
    color: #fff;
    line-height: 1;
    cursor: pointer;
}
.pos-icon-green { background: #16a34a; }
.pos-icon-green:hover { background: #15803d; }
.pos-icon-brand { background: var(--primary); }
.pos-icon-brand:hover { background: var(--primary-dark); }

.pos-cart-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pos-cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

.pos-cart-empty strong { margin-top: 0.5rem; color: #64748b; font-size: 1rem; }
.pos-cart-empty-icon { font-size: 1.9rem; }

.pos-cart-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #f1f5f9;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.pos-cart-line-info {
    flex: 1;
    min-width: 0;
}

.pos-cart-line-info strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-cart-line-info span {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
}

.pos-price-edit {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: #64748b;
}

.pos-price-input {
    width: 6.5rem;
    padding: 0.125rem 0.375rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
}

.pos-price-input.pos-price-modificado {
    border-color: #f59e0b;
    background: #fffbeb;
}

.pos-qty {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pos-qty button {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background: #fff;
    color: #475569;
    line-height: 1;
    padding: 0;
}

.pos-qty button:disabled { opacity: 0.4; }
.pos-qty b { min-width: 1.5rem; text-align: center; }

.pos-line-total {
    min-width: 5rem;
    text-align: right;
}

.pos-line-remove {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
}
.pos-line-remove:hover { color: #dc2626; }

.pos-qty-line {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.pos-totals {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.pos-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
    color: #475569;
}

.pos-totals-check { cursor: pointer; color: #0f172a; }

.pos-link-btn {
    border: none;
    background: none;
    padding: 0;
    color: var(--primary-dark);
    font-size: 0.875rem;
}
.pos-link-btn:hover { text-decoration: underline; }

.pos-total-final {
    margin-bottom: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}

.pos-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.375rem;
    margin-top: 0.5rem;
}

@media (min-width: 576px) {
    .pos-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.pos-actions .pos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.pos-actions .pos-btn:disabled,
.pos-actions .pos-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.pos-btn-success { background: #16a34a; color: #fff; }
.pos-btn-secondary { background: #fff; color: #334155; border-color: #cbd5e1; }
.pos-btn-warning { background: #f97316; color: #fff; }
.pos-btn-danger { background: #dc2626; color: #fff; }
.pos-btn-brand { background: var(--primary); color: #fff; }

/* Modal de pago y ventanas auxiliares */
.pos-modal-pago { max-width: 36rem; }

.pos-pago-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--primary);
    border-radius: 0.5rem 0.5rem 0 0;
}

.pos-pago-header h2 { margin: 0; font-size: 1.125rem; font-weight: 600; color: #fff; }

.pos-pago-close {
    border: none;
    background: none;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
}
.pos-pago-close:hover { color: #fff; }

.pos-pago-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
}

.pos-pago-grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.pos-pago-grid3 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .pos-pago-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.pos-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.pos-money {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.pos-money span { font-size: 0.875rem; color: #64748b; }

.pos-help {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.pos-pago-resumen {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.pos-pago-resumen p {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
}

.pos-pago-resumen b { color: #0f172a; }
.pos-pago-resumen .pos-brand-text { color: var(--primary-dark); }
.pos-text-red { color: #b91c1c; font-weight: 700; }
.pos-text-green { color: #15803d; font-weight: 700; }

.pos-pago-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pos-pago-tamano { width: 12rem; }
.pos-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }

.pos-error {
    margin: 0;
    font-size: 0.8rem;
    color: #b91c1c;
}

.pos-modal-title {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.pos-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pos-lista-clientes {
    max-height: 15rem;
    margin-top: 0.5rem;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
}

.pos-lista-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    text-align: left;
    font-size: 0.875rem;
}
.pos-lista-item:last-child { border-bottom: none; }
button.pos-lista-item:hover { background: #f8fafc; }

.pos-lista-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-tier-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.pos-tier-btn {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
}

.pos-tier-btn.activo {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary-dark);
}

.cart-table td, .cart-table th {
    vertical-align: middle;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #0f172a);
}

.login-card {
    width: 100%;
    max-width: 380px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.login-logo {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    margin: 0 auto 0.5rem;
}

@media print {
    .no-print {
        display: none !important;
    }
}

/* Reporte contable (mismos colores que el Excel de referencia) */
.rc-barra {
    background: #1f4e78;
    color: #fff;
    font-weight: 700;
    padding: 0.4rem 0.75rem;
}

.rc-tabla {
    margin-bottom: 0;
    border-color: #000;
}

.rc-tabla th,
.rc-tabla td {
    border: 1px solid #000;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
}

.rc-tabla thead th {
    background: #d9e1f2;
    font-weight: 700;
}

.rc-tabla tr.rc-total td {
    background: #fff2cc;
    font-weight: 700;
}

/* Punto de venta en celular/tablet: lista de productos acotada y barra fija para ir al pedido */
.pos-cart-fab {
    display: none;
}

@media (max-width: 991.98px) {
    .pos-grid-card {
        flex: none;
        max-height: 60vh;
    }
    .page-body:has(.pos-workspace) {
        padding-bottom: 5rem;
    }
    .pos-cart-fab {
        display: flex;
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        z-index: 1025;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 0.85rem 1rem;
        border: 0;
        border-radius: 12px;
        background: var(--primary);
        color: #fff;
        font-weight: 600;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }
    .pos-cart-fab[hidden] {
        display: none;
    }
}

/* ===== Configuración general (pestañas, filas y vista previa de factura) ===== */
.cfg-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.35rem;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}

.cfg-tabs a {
    flex: none;
    padding: 0.55rem 0.9rem;
    border-radius: 7px;
    color: #475569;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.cfg-tabs a:hover {
    background: #f8fafc;
}

.cfg-tabs a.activa {
    background: #f2f5fa;
    color: #364b6d;
    font-weight: 600;
}

.cfg-tarjeta {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.cfg-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.cfg-fila-columna {
    flex-direction: column;
    align-items: flex-start;
}

.cfg-fila-titulo {
    font-weight: 600;
    color: #0f172a;
}

.cfg-ayuda {
    font-size: 0.82rem;
    color: #64748b;
}

.cfg-seccion {
    padding: 0.55rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.cfg-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fcfcfd;
}

.cfg-segmentado {
    display: inline-flex;
    flex: none;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}

.cfg-segmentado label {
    margin: 0;
    padding: 0.4rem 0.95rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
    background: #fff;
}

.cfg-segmentado label + input + label {
    border-left: 1px solid #cbd5e1;
}

.cfg-segmentado .btn-check:checked + label {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.cfg-vista-previa {
    position: sticky;
    top: 88px;
    padding: 1rem;
}

.cfg-papel {
    margin: 0 auto;
    padding: 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fff;
    transition: max-width 0.15s ease;
}

.cfg-logo-vacio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
}

.cfg-qr-ejemplo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 2px solid #0f172a;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .cfg-fila {
        flex-direction: column;
        align-items: flex-start;
    }
    .cfg-vista-previa {
        position: static;
    }
}

/* Punto de venta tipo Touch: botones y productos más grandes para dedo */
.pos-touch .pos-product-card {
    padding: 1.1rem;
}

.pos-touch .pos-btn,
.pos-touch .pos-input,
.pos-touch .pos-icon-btn {
    min-height: 3.2rem;
    font-size: 1.05rem;
}

.pos-touch .pos-qty button {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.3rem;
}

.pos-alerta-balance {
    margin: 0.5rem 0.75rem 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.85rem;
}

.pos-alerta-balance[hidden] {
    display: none;
}

@media (min-width: 768px) {
    .cfg-tabs {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* Paleta de colores del nombre de la empresa (Personalizar factura) */
.cfg-colores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.cfg-color {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.cfg-color:hover {
    transform: scale(1.08);
}

.cfg-color.activo {
    border-color: #111827;
}

.cfg-color.activo::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}
