﻿:root {
    --primary:       #1aacb1;
    --primary-dark:  #148a8e;
    --primary-light: #22c9ce;
    --primary-muted: #d4f4f5;
    --success:       #4CAF50;
    --success-dark:  #3d8b40;
    --bg:            #f0f2f5;
    --ink:           #3A4656;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    font-size: 0.875rem;
}

.pos-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    background: var(--bg);
}

/* ─── HEADER ─────────────────────────────────────── */
.pos-header {
    background: linear-gradient(135deg, var(--ink) 0%, var(--primary-dark) 55%, var(--primary) 100%);
    color: white;
    padding: 0.45rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
    flex-shrink: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.15rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .5px;
}

.brand-sub {
    font-size: .6rem;
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #7dd8db;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.header-user {
    text-align: right;
}

.header-user .label {
    font-size: .62rem;
    color: #7dd8db;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.header-user .name {
    font-size: .85rem;
    font-weight: 600;
}

/* ─── NAV ────────────────────────────────────────── */
.pos-nav {
    background: var(--primary);
    display: flex;
    align-items: stretch;
    padding: 0 .25rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    overflow-x: auto;
}

.pos-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .3rem;
    color: rgba(255,255,255,.8);
    padding: .5rem .85rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-size: .78rem;
    font-weight: 500;
    transition: all .15s;
    text-decoration: none;
    user-select: none;
}

.nav-item:hover {
    color: white;
    background: rgba(255,255,255,.1);
    border-bottom-color: #7dd8db;
}

.nav-item.active {
    color: white;
    background: rgba(255,255,255,.15);
    border-bottom-color: white;
    font-weight: 700;
}

.nav-item .kbdx {
    font-size: .6rem;
    background: rgba(255,255,255,.18);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: monospace;
}

.nav-spacer {
    flex: 1;
}

.nav-exit {
    color: #fca5a5 !important;
}

.nav-exit:hover {
    background: rgba(239,68,68,.25) !important;
    border-bottom-color: #ef4444 !important;
    color: white !important;
}

/* ─── CONTENT ────────────────────────────────────── */
.pos-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: .6rem .75rem;
    gap: .45rem;
}

/* ─── TICKET BANNER ──────────────────────────────── */
.ticket-banner {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
    color: white;
    padding: .45rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .5px;
    box-shadow: 0 3px 10px rgba(26,172,177,.3);
    flex-shrink: 0;
}

/* ─── INPUT ROW ──────────────────────────────────── */
.input-row {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.code-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: white;
    border: 2px solid #b5e8ea;
    border-radius: 10px;
    padding: 0 .85rem;
    transition: border-color .15s, box-shadow .15s;
}

.code-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,172,177,.15);
}

.code-input-wrap label {
    color: #6b7280;
    white-space: nowrap;
    font-size: .8rem;
    font-weight: 500;
    margin: 0;
}

.code-input-wrap input {
    border: none;
    outline: none;
    flex: 1;
    font-size: .9rem;
    padding: .6rem 0;
    background: transparent;
}

.btn-add {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    border: none;
    border-radius: 10px;
    padding: .55rem 1.25rem;
    font-weight: 700;
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(76,175,80,.35);
    transition: all .15s;
    white-space: nowrap;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(76,175,80,.45);
}

.kbdx-inline {
    background: rgba(255,255,255,.22);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: .68rem;
    font-family: monospace;
}

/* ─── ACTION BUTTONS ─────────────────────────────── */
.action-row {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.abtn {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .38rem .7rem;
    border-radius: 8px;
    font-size: .74rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .15s;
    white-space: nowrap;
    user-select: none;
}

.abtn .k {
    font-size: .62rem;
    opacity: .7;
    font-family: monospace;
    background: rgba(0,0,0,.08);
    border-radius: 3px;
    padding: 1px 4px;
}

.abtn-purple {
    background: #ede9fe;
    color: #6d28d9;
}

.abtn-purple:hover {
    background: #ddd6fe;
}

.abtn-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.abtn-blue:hover {
    background: #bfdbfe;
}

.abtn-amber {
    background: #fef3c7;
    color: #b45309;
}

.abtn-amber:hover {
    background: #fde68a;
}

.abtn-teal {
    background: #ccfbf1;
    color: #0f766e;
}

.abtn-teal:hover {
    background: #99f6e4;
}

.abtn-green {
    background: #d1fae5;
    color: #047857;
}

.abtn-green:hover {
    background: #a7f3d0;
}

.abtn-rose {
    background: #fee2e2;
    color: #b91c1c;
}

    .abtn-rose:hover {
        background: #fecaca;
    }

.abtn-red {
    background: #fce7f3;
    color: #9d174d;
}

.abtn-red:hover {
    background: #fbcfe8;
}

.abtn-sky {
    background: #e0f2fe;
    color: #0369a1;
}

.abtn-sky:hover {
    background: #bae6fd;
}

/* ─── TABS + ACTION ROW ──────────────────────────── */
.tabs-action-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem;
    flex-shrink: 0;
}

.ticket-tabs {
    display: flex;
    align-items: flex-end;
    gap: .2rem;
    flex-shrink: 0;
}

.ttab {
    background: #e0e7ff;
    color: var(--primary);
    padding: .3rem .9rem;
    border-radius: 8px 8px 0 0;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.ttab.active {
    background: white;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.tab-add {
    width: 26px;
    height: 26px;
    background: transparent;
    border: 2px dashed #7dd8db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    font-size: .75rem;
    transition: all .15s;
    align-self: center;
    margin-bottom: .1rem;
}

.tab-add:hover {
    background: #e0e7ff;
    border-style: solid;
}

.ttab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: .6rem;
    font-weight: 700;
    line-height: 1;
}

.ttab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: .8rem;
    line-height: 1;
    opacity: .55;
    transition: opacity .12s, background .12s;
    cursor: pointer;
    margin-left: .1rem;
}
.ttab-close:hover {
    opacity: 1;
    background: rgba(239,68,68,.18);
    color: #ef4444;
}

/* ─── BUSCAR MODAL (F10) ────────────────────────── */
.buscar-modal {
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    width: min(760px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.buscar-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem 1rem;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.buscar-section-header {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .07em;
    color: white;
    background: linear-gradient(90deg, #0891b2, #06b6d4);
    padding: .5rem 1.25rem;
    flex-shrink: 0;
}

.buscar-hint {
    font-size: .78rem;
    color: var(--text-muted);
    padding: .4rem 1.25rem .1rem;
    flex-shrink: 0;
}

.buscar-search-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.buscar-search-wrap i { color: #6366f1; font-size: 1rem; }
.buscar-search-wrap input { flex: 1; font-size: .95rem; }

.buscar-table-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.buscar-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .875rem;
}

.buscar-table {
    width: 100%;
    border-collapse: collapse;
}
.buscar-table thead tr { background: #f8fafc; position: sticky; top: 0; z-index: 1; }
.buscar-table th {
    padding: .5rem .9rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.buscar-table td {
    padding: .45rem .9rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .85rem;
}
.buscar-row { cursor: pointer; }
.buscar-row:hover { background: #f0f4ff; }
.buscar-row-selected { background: #e0e7ff !important; }
.buscar-num { text-align: right !important; }
.buscar-price { font-weight: 700; color: var(--primary); }
.buscar-prod-name { font-weight: 500; color: var(--text-primary); }
.buscar-prod-code { font-size: .7rem; color: var(--text-muted); font-family: monospace; }
.buscar-stock-low { color: #ef4444 !important; font-weight: 600; }

.buscar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    gap: .75rem;
    flex-shrink: 0;
}
.buscar-footer-count {
    font-size: .78rem;
    color: var(--text-muted);
}
.buscar-footer-btns {
    display: flex;
    gap: .5rem;
}

/* ─── VARIOS MODAL ──────────────────────────────── */
.varios-modal {
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    min-width: 480px;
    max-width: 560px;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.varios-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem 1rem;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.varios-close {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.varios-close:hover { background: #dc2626; }

.varios-body {
    display: flex;
    gap: 0;
}

.varios-form {
    flex: 1;
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    border-right: 1px solid var(--border-color);
}

.varios-section-header {
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .06em;
    color: white;
    background: linear-gradient(90deg, #0891b2, #06b6d4);
    padding: .45rem 1rem;
    border-radius: 6px;
    margin-bottom: .15rem;
}

.varios-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.varios-field label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.varios-input-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.varios-input-wrap i { color: #6366f1; flex-shrink: 0; }
.varios-input-wrap input { flex: 1; }

.varios-qty-input {
    width: 140px;
    text-align: right;
    font-size: 1.05rem;
    font-weight: 600;
}

.varios-error {
    font-size: .78rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: .4rem .7rem;
}

.varios-actions {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1rem 1.25rem;
    justify-content: flex-start;
    min-width: 130px;
}

.varios-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border: none;
    border-radius: 7px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.varios-btn:disabled { opacity: .55; cursor: not-allowed; }
.varios-btn-accept {
    background: #10b981;
    color: white;
}
.varios-btn-accept:hover:not(:disabled) { background: #059669; }
.varios-btn-cancel {
    background: #ef4444;
    color: white;
}
.varios-btn-cancel:hover { background: #dc2626; }

/* ─── SWITCH TICKET MODAL ────────────────────────── */
.ventas-switch-modal {
    background: white;
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.25rem;
    min-width: 320px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vsm-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.vsm-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.vsm-item:hover {
    border-color: var(--primary);
    background: rgba(99,102,241,.04);
}
.vsm-item.vsm-active {
    border-color: var(--primary);
    background: rgba(99,102,241,.08);
}

.vsm-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #e0e7ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.vsm-item-info {
    flex: 1;
    min-width: 0;
}
.vsm-item-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-primary);
}
.vsm-item-meta {
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vsm-badge {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
}

/* ─── TABLE AREA ─────────────────────────────────── */
.table-card {
    flex: 1;
    background: white;
    border-radius: 0 10px 10px 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pos-table {
    width: 100%;
    border-collapse: collapse;
}

.pos-table thead th {
    background: #f8faff;
    color: #374151;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .55rem .75rem;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.pos-table tbody td {
    padding: .55rem .75rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: .81rem;
    color: #374151;
}

.pos-table tbody tr:hover {
    background: #e8f8f9;
}

.col-barcode {
    width: 130px;
}

.col-price, .col-amount {
    width: 105px;
    text-align: right;
}

.col-qty {
    width: 70px;
    text-align: center;
}

.col-stock {
    width: 85px;
    text-align: center;
}

.amt-cell {
    background: #f0fdf4;
    color: #15803d;
    font-weight: 700;
}

.tbody-scroll {
    overflow-y: auto;
    flex: 1;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    gap: .5rem;
    padding: 2rem;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
}

.empty-state p {
    margin: 0;
    font-size: .82rem;
}

.empty-state .hint {
    font-size: .73rem;
}

/* ─── BOTTOM BAR ─────────────────────────────────── */
.pos-bottom {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    padding: .5rem .75rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,.07);
}

.count-badge {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .85rem;
    flex-shrink: 0;
}

.count-text {
    color: #6b7280;
    font-size: .79rem;
    flex: 1;
    white-space: nowrap;
}

.bottom-btns {
    display: flex;
    gap: .3rem;
}

.bbtn {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .38rem .7rem;
    border-radius: 8px;
    font-size: .73rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .15s;
    white-space: nowrap;
    user-select: none;
}

.bbtn-amber {
    background: #fef3c7;
    color: #92400e;
}

.bbtn-amber:hover {
    background: #fde68a;
}

.bbtn-sky {
    background: #e0f2fe;
    color: #0369a1;
}

.bbtn-sky:hover {
    background: #bae6fd;
}

.bbtn-rose {
    background: #fee2e2;
    color: #dc2626;
}

.bbtn-rose:hover {
    background: #fecaca;
}

.bbtn-green {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.bbtn-green:hover {
    background: #dcfce7;
}

.totals-area {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
}

.side-btn {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .38rem .65rem;
    border-radius: 8px;
    font-size: .7rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    transition: all .15s;
    white-space: nowrap;
}

.side-btn:hover {
    background: #f3f4f6;
}

.total-display {
    background: linear-gradient(135deg, var(--ink), #0e6568);
    color: white;
    border-radius: 12px;
    padding: .45rem 1rem;
    text-align: right;
    min-width: 120px;
}

.total-display .amount {
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1;
    color: #7dd8db;
}

.total-display .sublabel {
    font-size: .65rem;
    color: rgba(255,255,255,.55);
}

.checkout-btn {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    border: none;
    border-radius: 12px;
    padding: .55rem 1.4rem;
    font-size: .9rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22,163,74,.4);
    transition: all .15s;
}

.checkout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(22,163,74,.5);
}

.checkout-btn .kbdx-inline {
    background: rgba(255,255,255,.22);
}

/* ─── SECTION PLACEHOLDER ────────────────────────── */
.section-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    gap: .75rem;
    text-align: center;
}

.section-placeholder i {
    font-size: 3.5rem;
    color: #b5e8ea;
}

.section-placeholder h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #6b7280;
}

.section-placeholder p {
    margin: 0;
    font-size: .82rem;
    color: #d1d5db;
}

/* ─── CLIENTES MODULE ────────────────────────────── */
.clientes-header {
    flex-shrink: 0;
}

.clientes-header-title {
    font-size: .9rem;
    font-weight: 800;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .1rem;
}

.clientes-header-sub {
    font-size: .72rem;
    color: #6b7280;
}

.clientes-body {
    flex: 1;
    display: flex;
    gap: .5rem;
    min-height: 0;
}

.clientes-list-panel {
    width: 300px;
    flex-shrink: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.clientes-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .6rem;
    border-bottom: 1px solid #e5e7eb;
}

.clientes-search i { color: #9ca3af; font-size: .8rem; }

.clientes-search input {
    border: none;
    outline: none;
    font-size: .8rem;
    flex: 1;
    background: transparent;
}

.clientes-list-head {
    display: grid;
    grid-template-columns: 44px 44px 1fr;
    padding: .3rem .6rem;
    background: #f8faff;
    border-bottom: 2px solid #e5e7eb;
    font-size: .68rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.clientes-list {
    flex: 1;
    overflow-y: auto;
}

.clientes-row {
    display: grid;
    grid-template-columns: 44px 44px 1fr;
    align-items: center;
    padding: .4rem .6rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
    color: #374151;
}

.clientes-row:hover { background: #e8f8f9; }

.clientes-row.active {
    background: #3d5166;
    color: white;
}

.clientes-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
    color: white;
}

.clientes-folio {
    font-size: .78rem;
    font-weight: 500;
}

.clientes-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.clientes-name {
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clientes-sub {
    font-size: .65rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clientes-row.active .clientes-sub { color: rgba(255,255,255,.65); }

.clientes-list-footer {
    padding: .4rem .6rem;
    border-top: 1px solid #e5e7eb;
}

.clientes-form-panel {
    flex: 1;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.clientes-toolbar {
    display: flex;
    gap: .4rem;
    padding: .45rem .75rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.clientes-form-header {
    padding: .7rem 1.5rem .3rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.clientes-form-body {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 1.5rem;
}

.clientes-form-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 .65rem;
}

.clientes-field-hint {
    font-size: .7rem;
    font-weight: 400;
    color: #9ca3af;
    margin-left: .25rem;
}

.cr-balance-owed {
    color: #dc2626;
    font-weight: 700;
}

.clientes-field {
    display: grid;
    grid-template-columns: 165px 1fr;
    align-items: center;
    gap: .4rem;
    margin-bottom: .38rem;
}

.clientes-field label {
    font-size: .78rem;
    color: #374151;
    text-align: right;
    font-weight: 500;
}

.clientes-field input,
.clientes-field select,
.clientes-field textarea {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: .28rem .5rem;
    font-size: .78rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    background: white;
}

.clientes-field input:focus,
.clientes-field select:focus,
.clientes-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,172,177,.12);
}

.clientes-field textarea { resize: vertical; min-height: 64px; }

.clientes-field-row {
    display: flex;
    gap: .35rem;
}

.clientes-field-row select { flex: 1; }

.clientes-input-short { max-width: 120px !important; }

.clientes-field-textarea { align-items: flex-start; }
.clientes-field-textarea label { padding-top: .3rem; }

.clientes-section {
    font-size: .8rem;
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: .2rem;
    margin: .65rem 0 .45rem;
}

.clientes-check-row {
    display: grid;
    grid-template-columns: 165px 1fr;
    margin-bottom: .45rem;
}

.clientes-check-row label {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: #374151;
    cursor: pointer;
}

.clientes-check-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ─── MODAL DE CONFIRMACIÓN ─────────────────────── */
.clientes-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.clientes-modal {
    background: white;
    border-radius: 14px;
    padding: 2rem 2.25rem;
    width: 380px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    text-align: center;
}

.clientes-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    font-size: 1.4rem;
}

.clientes-modal-title {
    font-size: .95rem;
    font-weight: 800;
    color: var(--ink);
}

.clientes-modal-body {
    font-size: .8rem;
    color: #6b7280;
    line-height: 1.5;
}

.clientes-modal-actions {
    display: flex;
    gap: .6rem;
    margin-top: .25rem;
}

/* ─── READ-ONLY FIELDS ───────────────────────────── */
.clientes-readonly-value {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    padding: 0 .6rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: .35rem;
    font-size: .82rem;
    color: #475569;
    font-weight: 600;
}

/* ─── VALIDATION ────────────────────────────────── */
.required-star {
    color: #dc2626;
    font-weight: 700;
}

.input-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220,38,38,.12) !important;
}

.clientes-info-card {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: .45rem;
    padding: .55rem .85rem;
    font-size: .78rem;
    margin-bottom: .75rem;
}

/* ─── PRODUCTOS MODULE ───────────────────────────── */
.productos-header {
    padding: .9rem 1.4rem .5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.productos-header-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--primary);
    text-transform: uppercase;
}

.productos-header-sub {
    font-size: .75rem;
    color: #64748b;
    margin-top: .15rem;
}

.productos-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.productos-list-panel {
    width: 310px;
    min-width: 310px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.productos-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.productos-search i { color: #94a3b8; font-size: .8rem; }

.productos-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: .8rem;
    background: transparent;
    color: var(--ink);
}

.productos-list-head {
    display: grid;
    grid-template-columns: 2rem 2.5rem 1fr auto;
    gap: .4rem;
    padding: .35rem .8rem;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #94a3b8;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.productos-list {
    flex: 1;
    overflow-y: auto;
}

.productos-row {
    display: grid;
    grid-template-columns: 2rem 2.5rem 1fr auto;
    align-items: center;
    gap: .4rem;
    padding: .5rem .8rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}

.productos-row:hover { background: #f0f4ff; }
.productos-row.active { background: #e0e7ff; }

.productos-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.productos-folio {
    font-size: .68rem;
    color: #94a3b8;
    font-weight: 600;
}

.productos-info { min-width: 0; }

.productos-name {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.productos-sub {
    display: block;
    font-size: .68rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.productos-price {
    font-size: .75rem;
    font-weight: 700;
    color: var(--success-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.productos-list-footer {
    padding: .6rem .8rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.productos-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.productos-toolbar {
    display: flex;
    gap: .5rem;
    padding: .6rem .9rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.productos-form-header {
    padding: .7rem 1rem .3rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.productos-form-body {
    flex: 1;
    overflow-y: auto;
    padding: .8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.productos-form-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: .25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.productos-section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary);
    border-bottom: 1px solid #e0e7ff;
    padding-bottom: .25rem;
    margin-top: .35rem;
}

.productos-field {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
}

.productos-field label {
    color: #475569;
    font-weight: 500;
    font-size: .78rem;
}

.productos-field input,
.productos-field select,
.productos-field textarea {
    width: 100%;
    padding: .32rem .55rem;
    border: 1px solid #cbd5e1;
    border-radius: .35rem;
    font-size: .8rem;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}

.productos-field input:focus,
.productos-field select:focus,
.productos-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,172,177,.1);
}

.productos-field-textarea {
    align-items: flex-start;
}

.productos-field-textarea textarea {
    min-height: 4.5rem;
    resize: vertical;
}

.productos-check-row {
    font-size: .8rem;
    color: #475569;
    padding-left: 134px;
}

.productos-check-row label {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
}

/* ─── STATUS BAR ─────────────────────────────────── */
.pos-statusbar {
    background: #1e1b4b;
    color: rgba(255,255,255,.45);
    font-size: .65rem;
    padding: .22rem 1rem;
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
}

/* ─── VENTAS MODULE ──────────────────────────────── */

/* Selected row in cart table */
.pos-table tbody tr.row-selected td {
    background: #e0f5f5;
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

/* Inline quantity input */
.qty-input {
    width: 62px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: .2rem .3rem;
    font-size: .8rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.qty-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,172,177,.12);
}

/* Hide number spinners on qty-input */
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-input { -moz-appearance: textfield; }

/* Multi-line totals panel */
.total-lines {
    background: linear-gradient(135deg, var(--ink), #0e6568);
    border-radius: 10px;
    padding: .45rem 1rem;
    min-width: 148px;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
}

.total-line-label {
    font-size: .65rem;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.total-line-value {
    font-size: .82rem;
    font-weight: 700;
    color: #7dd8db;
}

.total-line-main {
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: .15rem;
    padding-top: .15rem;
}

.total-line-main .total-line-label {
    font-size: .72rem;
    color: rgba(255,255,255,.7);
}

.total-line-main .total-line-value {
    font-size: 1.22rem;
    font-weight: 900;
    color: white;
}

/* Disabled states */
.checkout-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.bbtn:disabled,
.abtn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ── Checkout modal ── */
.ventas-checkout-modal {
    background: white;
    border-radius: 14px;
    padding: 1.5rem 2rem;
    width: 440px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
    text-align: center;
}

.ventas-checkout-total {
    width: 100%;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: .5rem 1rem;
    font-size: .88rem;
    color: #166534;
}

.ventas-pm-label {
    align-self: flex-start;
    font-size: .68rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.ventas-pm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    width: 100%;
    justify-content: center;
}

.pm-btn {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .95rem;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.pm-btn:hover {
    border-color: #7dd8db;
    background: #e8f8f9;
    color: var(--primary);
}

.pm-btn.active {
    border-color: var(--primary);
    background: #e0f5f5;
    color: var(--primary);
    font-weight: 700;
}

.ventas-field-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
}

.ventas-field-row label {
    font-size: .78rem;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 500;
    min-width: 70px;
    text-align: right;
}

.ventas-amount-input {
    flex: 1;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    padding: .35rem .6rem;
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
}

.ventas-amount-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,172,177,.12);
}

.ventas-change-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: .4rem .85rem;
    font-size: .8rem;
    color: #92400e;
}

.ventas-change-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: #b45309;
}

/* ── Client modal ── */
.ventas-client-modal {
    background: white;
    border-radius: 14px;
    padding: 1.5rem;
    width: 480px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
}

.ventas-client-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: .35rem .7rem;
    width: 100%;
    transition: border-color .15s;
}

.ventas-client-search:focus-within {
    border-color: var(--primary);
}

.ventas-client-search i { color: #9ca3af; font-size: .8rem; }

.ventas-client-search input {
    border: none;
    outline: none;
    flex: 1;
    font-size: .82rem;
    background: transparent;
    font-family: inherit;
}

.ventas-client-list {
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.ventas-client-row {
    display: flex;
    flex-direction: column;
    padding: .5rem .75rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background .12s;
}

.ventas-client-row:hover { background: #e8f8f9; }
.ventas-client-row:last-child { border-bottom: none; }

.ventas-client-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink);
}

.ventas-client-email {
    font-size: .72rem;
    color: #9ca3af;
}

.ventas-client-empty {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
    font-size: .8rem;
}

/* ─── CORTE MODULE ───────────────────────────────── */
.corte-header {
    flex-shrink: 0;
}

.corte-header-title {
    font-size: .9rem;
    font-weight: 800;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .1rem;
}

.corte-header-sub {
    font-size: .72rem;
    color: #6b7280;
}

.corte-body {
    flex: 1;
    display: flex;
    gap: .5rem;
    min-height: 0;
}

/* ── Left: history list ── */
.corte-list-panel {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.corte-list-head {
    display: grid;
    grid-template-columns: 1fr 48px 80px;
    padding: .35rem .7rem;
    background: #f8faff;
    border-bottom: 2px solid #e5e7eb;
    font-size: .68rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.corte-list {
    flex: 1;
    overflow-y: auto;
}

.corte-row {
    display: grid;
    grid-template-columns: 1fr 48px 80px;
    align-items: center;
    padding: .45rem .7rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}

.corte-row:hover { background: #e8f8f9; }
.corte-row.active { background: #e0f5f5; }

.corte-date { font-size: .76rem; font-weight: 500; color: #374151; }

.corte-sales-count {
    font-size: .75rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
}

.corte-diff-badge {
    font-size: .74rem;
    font-weight: 700;
    text-align: right;
}

.corte-diff-badge.neg { color: #dc2626; }
.corte-diff-badge.pos { color: #059669; }

/* ── Right: main panel ── */
.corte-main-panel {
    flex: 1;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    min-width: 0;
}

.corte-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: #9ca3af;
    font-size: .85rem;
}

/* ── Historic cut detail ── */
.corte-detail-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.corte-detail-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: .45rem;
}

.corte-kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.corte-kpi {
    background: #f8faff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .5rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .12rem;
    min-width: 130px;
}

.corte-kpi-neg { background: #fff1f2; border-color: #fecaca; }
.corte-kpi-pos { background: #f0fdf4; border-color: #bbf7d0; }
.corte-kpi-ok  { background: #f0fdf4; border-color: #bbf7d0; }

.corte-kpi-label {
    font-size: .65rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.corte-kpi-val {
    font-size: .9rem;
    font-weight: 700;
    color: var(--ink);
}

.corte-kpi-val.small { font-size: .72rem; font-weight: 500; }

.corte-kpi-neg .corte-kpi-val { color: #dc2626; }
.corte-kpi-pos .corte-kpi-val { color: #059669; }

.corte-notes-display {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: .4rem .75rem;
    font-size: .78rem;
    color: #92400e;
}

/* ── New cut card ── */
.corte-new-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.corte-period-banner {
    background: linear-gradient(90deg, #e0f5f5, #e8f8f9);
    border: 1px solid #b5e8ea;
    border-radius: 8px;
    padding: .55rem .9rem;
    font-size: .8rem;
    color: #148a8e;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
}

.corte-section-label {
    font-size: .68rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid #e0e7ff;
    padding-bottom: .2rem;
}

.corte-pm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.corte-pm-table thead th {
    background: #f8faff;
    padding: .35rem .65rem;
    font-size: .68rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
}

.corte-pm-table tbody td {
    padding: .4rem .65rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.corte-pm-table tbody tr.row-cash {
    background: #f0fdf4;
    font-weight: 600;
}

.corte-pm-table tbody tr.row-cash td { color: #166534; }

.corte-empty-period {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: .5rem .85rem;
    font-size: .78rem;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ── Fields ── */
.corte-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem .9rem;
}

.corte-field {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.corte-field label {
    font-size: .75rem;
    font-weight: 600;
    color: #374151;
}

.corte-field-hint {
    font-size: .68rem;
    color: #9ca3af;
}

.corte-field-full {
    grid-column: 1 / -1;
}

.corte-field textarea {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: .35rem .55rem;
    font-size: .8rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: border-color .15s;
}

.corte-field textarea:focus { border-color: var(--primary); }

.corte-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color .15s;
}

.corte-input-wrap:focus-within { border-color: var(--primary); }

.corte-currency {
    background: #f3f4f6;
    padding: .3rem .55rem;
    font-size: .82rem;
    color: #6b7280;
    font-weight: 600;
    border-right: 1px solid #e5e7eb;
}

.corte-input-wrap input {
    border: none;
    outline: none;
    padding: .3rem .55rem;
    font-size: .88rem;
    font-weight: 700;
    flex: 1;
    background: white;
    text-align: right;
    font-family: inherit;
}

.corte-readonly-box {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: .35rem .65rem;
    background: #f8faff;
    font-size: .88rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: .5rem;
}

.corte-diff-box {
    border-radius: 6px;
    padding: .35rem .75rem;
    font-size: .95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.corte-diff-box span { font-size: .72rem; font-weight: 500; }
.diff-ok  { background: #f0fdf4; color: #059669; border: 1px solid #bbf7d0; }
.diff-pos { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.diff-neg { background: #fff1f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Actions ── */
.corte-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding-top: .35rem;
    border-top: 1px solid #f3f4f6;
}

.corte-confirm-btn {
    background: linear-gradient(135deg, #1e1b4b, var(--primary));
    color: white;
    border: none;
    border-radius: 10px;
    padding: .55rem 1.4rem;
    font-size: .88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26,172,177,.35);
    transition: all .15s;
}

.corte-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,172,177,.45);
}

.corte-confirm-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Options column in cart table */
.col-options {
    width: 44px;
    text-align: center;
}

.row-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    font-size: .8rem;
    padding: .2rem .35rem;
    border-radius: 4px;
    transition: color .15s, background .15s;
    line-height: 1;
}

.row-delete-btn:hover {
    color: #dc2626;
    background: #fee2e2;
}

/* Credit payment button in checkout modal */
.pm-btn-credit {
    border-color: #d97706;
    color: #92400e;
}

.pm-btn-credit:hover {
    background: #fffbeb;
    border-color: #b45309;
}

.pm-btn-credit.active-credit {
    background: #fef3c7;
    border-color: #d97706;
    color: #78350f;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(217,119,6,.2);
}

.ventas-credit-banner {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: .65rem .9rem;
    font-size: .82rem;
    color: #78350f;
    margin-top: .5rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.ventas-credit-banner-danger {
    background: #fff1f2;
    border-color: #fecaca;
    color: #991b1b;
}

.vcb-limits {
    display: flex;
    gap: 1rem;
    font-size: .78rem;
    flex-wrap: wrap;
}

.vcb-ok   { color: #16a34a; font-weight: 600; }
.vcb-over { color: #dc2626; font-weight: 700; }

.vcb-warning {
    font-size: .78rem;
    font-weight: 600;
    color: #dc2626;
}

/* ================================================================
   INVENTARIO MODULE
   ================================================================ */

.inventario-header {
    padding: .9rem 1.2rem .5rem;
    border-bottom: 1px solid #e5e7eb;
}

.inventario-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .04em;
}

.inventario-header-sub {
    font-size: .75rem;
    color: #6b7280;
    margin-top: .15rem;
}

.inventario-body {
    display: flex;
    gap: 0;
    height: calc(100% - 60px);
    overflow: hidden;
}

/* ── Left panel: history ── */
.inventario-list-panel {
    width: 420px;
    min-width: 340px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inv-history-search-wrap {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .8rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.inv-history-search-wrap i.fa-search {
    color: #9ca3af;
    font-size: .8rem;
    flex-shrink: 0;
}

.inv-history-search-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: .82rem;
    color: #1e293b;
    background: transparent;
}

.inv-history-search-wrap input::placeholder {
    color: #9ca3af;
}

.inv-history-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: .75rem;
    padding: .15rem .3rem;
    border-radius: 4px;
    line-height: 1;
    transition: color .15s;
}

.inv-history-clear-btn:hover {
    color: #6b7280;
}

.inventario-list-head {
    display: grid;
    grid-template-columns: 90px 1fr 72px 80px;
    padding: .45rem .9rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: .7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.inventario-list {
    overflow-y: auto;
    flex: 1;
}

.inventario-row {
    display: grid;
    grid-template-columns: 90px 1fr 72px 80px;
    padding: .5rem .9rem;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    font-size: .8rem;
    transition: background .12s;
}

.inventario-row:hover {
    background: #f8fafc;
}

.mv-date {
    color: #6b7280;
    font-size: .72rem;
}

.mv-product {
    color: #1e293b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: .5rem;
}

.mv-stock-after {
    color: #374151;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Movement type badges */
.mv-type-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .4rem;
    border-radius: 4px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.mv-in {
    background: #dcfce7;
    color: #16a34a;
}

.mv-out {
    background: #fee2e2;
    color: #dc2626;
}

.mv-adjust {
    background: #fef9c3;
    color: #854d0e;
}

/* ── Right panel: form ── */
.inventario-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inventario-form-header {
    padding: .65rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.inventario-form-title {
    font-size: .85rem;
    font-weight: 700;
    color: #374151;
}

.inventario-form-body {
    padding: .9rem 1.1rem;
    overflow-y: auto;
    flex: 1;
}

.inventario-section {
    font-size: .68rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .45rem;
}

/* Product search */
.inv-search-row {
    margin-bottom: .4rem;
}

.inv-search-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: .45rem .7rem;
    transition: border-color .15s;
}

.inv-search-wrap:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.inv-search-wrap i {
    color: #9ca3af;
    font-size: .85rem;
}

.inv-search-wrap input {
    border: none;
    outline: none;
    flex: 1;
    font-size: .85rem;
    color: #1e293b;
    background: transparent;
}

.inv-search-results {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    margin-top: .25rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.inv-search-result-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .8rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}

.inv-search-result-row:last-child {
    border-bottom: none;
}

.inv-search-result-row:hover {
    background: #f0f9ff;
}

.inv-res-name {
    flex: 1;
    font-size: .82rem;
    color: #1e293b;
    font-weight: 500;
}

.inv-res-barcode {
    font-size: .72rem;
    color: #9ca3af;
    font-family: monospace;
}

.inv-res-stock {
    font-size: .75rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Selected product card */
.inv-product-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: .7rem .9rem;
    margin-bottom: .6rem;
}

.inv-product-name {
    font-size: .9rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: .3rem;
}

.inv-product-meta {
    display: flex;
    gap: 1rem;
    font-size: .75rem;
    color: #15803d;
    flex-wrap: wrap;
}

.inv-clear-btn {
    margin-top: .5rem;
    background: none;
    border: 1px solid #86efac;
    color: #16a34a;
    border-radius: 5px;
    padding: .25rem .6rem;
    font-size: .72rem;
    cursor: pointer;
    transition: background .15s;
}

.inv-clear-btn:hover {
    background: #dcfce7;
}

/* Movement type selector */
.mv-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-bottom: .6rem;
}

.mv-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: .6rem .4rem;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: .8rem;
    color: #6b7280;
    transition: all .15s;
}

.mv-type-btn i {
    font-size: 1.1rem;
}

.mv-type-btn small {
    font-size: .65rem;
    color: #9ca3af;
}

.mv-type-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.mv-type-btn.active-in {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}

.mv-type-btn.active-in i {
    color: #16a34a;
}

.mv-type-btn.active-out {
    border-color: #dc2626;
    background: #fff1f2;
    color: #991b1b;
}

.mv-type-btn.active-out i {
    color: #dc2626;
}

.mv-type-btn.active-adj {
    border-color: #d97706;
    background: #fffbeb;
    color: #92400e;
}

.mv-type-btn.active-adj i {
    color: #d97706;
}

/* Quantity row */
.inv-qty-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .6rem;
}

.inv-qty-wrap {
    flex: 0 0 160px;
}

.inv-qty-wrap input {
    width: 100%;
    padding: .45rem .7rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: .9rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
}

.inv-qty-wrap input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* Adjust delta preview */
.inv-adjust-preview {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 700;
    padding: .35rem .7rem;
    border-radius: 6px;
}

.inv-adjust-preview span {
    font-size: .72rem;
    font-weight: 400;
}

.adj-pos {
    background: #dcfce7;
    color: #16a34a;
}

.adj-neg {
    background: #fee2e2;
    color: #dc2626;
}

.adj-ok {
    background: #f1f5f9;
    color: #6b7280;
}

/* Reason + Reference row */
.inv-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-bottom: .7rem;
}

.inv-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.inv-field label {
    font-size: .72rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.inv-field input {
    padding: .42rem .65rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: .82rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
}

.inv-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* Actions */
.inv-actions {
    display: flex;
    gap: .6rem;
    align-items: center;
    margin-top: .4rem;
}

.inv-confirm-btn {
    flex: 1;
    background: #1aacb1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26,172,177,.35);
    transition: all .15s;
}

.inv-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,172,177,.45);
}

.inv-confirm-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ================================================================
   CONFIGURACION MODULE
   ================================================================ */

.config-header {
    padding: .9rem 1.2rem .5rem;
    border-bottom: 1px solid #e5e7eb;
}

.config-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .04em;
}

.config-header-sub {
    font-size: .75rem;
    color: #6b7280;
    margin-top: .15rem;
}

.config-body {
    padding: 1rem 1.2rem;
    overflow-y: auto;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.config-card-title {
    padding: .6rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: .8rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.config-rows {
    display: flex;
    flex-direction: column;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 280px;
    align-items: center;
    padding: .65rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 1rem;
    transition: background .12s;
}

.config-row:last-child { border-bottom: none; }
.config-row:hover { background: #fafafa; }

.config-row-dirty {
    background: #fffbeb !important;
    border-left: 3px solid #f59e0b;
}

.config-row-label {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.config-key-label {
    font-size: .85rem;
    font-weight: 600;
    color: #1e293b;
}

.config-key-desc {
    font-size: .72rem;
    color: #9ca3af;
}

.config-row-input {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.config-input {
    width: 100%;
    padding: .42rem .65rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: .84rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
}

.config-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* Toggle switch */
.config-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.config-toggle input { opacity: 0; width: 0; height: 0; }

.config-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s;
}

.config-toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.config-toggle input:checked + .config-toggle-slider {
    background: #1aacb1;
}

.config-toggle input:checked + .config-toggle-slider::before {
    transform: translateX(18px);
}

.config-toggle-label {
    font-size: .78rem;
    color: #6b7280;
    min-width: 70px;
}

/* Actions bar */
.config-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    justify-content: flex-end;
    padding-top: .25rem;
}

.config-dirty-hint {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .76rem;
    color: #92400e;
    margin-right: auto;
}

.config-save-btn {
    background: #1aacb1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26,172,177,.3);
    transition: all .15s;
}

.config-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,172,177,.4);
}

.config-save-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ================================================================
   CREDITOS MODULE
   ================================================================ */

.creditos-header {
    padding: .9rem 1.2rem .5rem;
    border-bottom: 1px solid #e5e7eb;
}

.creditos-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .04em;
}

.creditos-header-sub {
    font-size: .75rem;
    color: #6b7280;
    margin-top: .15rem;
}

.creditos-body {
    display: flex;
    height: calc(100% - 60px);
    overflow: hidden;
}

/* ── Left panel ── */
.creditos-list-panel {
    width: 380px;
    min-width: 300px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.creditos-list-toolbar {
    padding: .5rem .7rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.creditos-search-wrap {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: .38rem .65rem;
}

.creditos-search-wrap i {
    color: #9ca3af;
    font-size: .8rem;
}

.creditos-search-wrap input {
    border: none;
    outline: none;
    flex: 1;
    font-size: .82rem;
    background: transparent;
    color: #1e293b;
}

.creditos-tabs {
    display: flex;
    gap: .35rem;
}

.ctab {
    flex: 1;
    padding: .28rem 0;
    font-size: .72rem;
    font-weight: 600;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    cursor: pointer;
    color: #6b7280;
    transition: all .15s;
}

.ctab-active {
    background: #1aacb1;
    color: #fff;
    border-color: #1aacb1;
}

.creditos-list {
    flex: 1;
    overflow-y: auto;
}

.creditos-row {
    padding: .65rem .8rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .12s;
}

.creditos-row:hover { background: #f8fafc; }

.creditos-row-active {
    background: #e0f5f5 !important;
    border-left: 3px solid #1aacb1;
}

.creditos-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .2rem;
}

.cr-client {
    font-size: .85rem;
    font-weight: 600;
    color: #1e293b;
}

.cr-badge {
    font-size: .62rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cr-overdue { background: #fee2e2; color: #dc2626; }
.cr-paid    { background: #dcfce7; color: #16a34a; }

.creditos-row-amounts {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    margin-bottom: .25rem;
}

.cr-balance {
    font-size: .8rem;
    color: #1e293b;
}

.cr-original {
    font-size: .72rem;
    color: #9ca3af;
}

.cr-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: .2rem;
}

.cr-progress-fill {
    height: 100%;
    background: #1aacb1;
    border-radius: 2px;
    transition: width .3s;
}

.cr-fill-overdue { background: #dc2626; }

.cr-duedate {
    font-size: .7rem;
    color: #9ca3af;
}

.cr-duedate-overdue { color: #dc2626; font-weight: 600; }

.creditos-list-footer {
    padding: .6rem .8rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

/* ── Right panel ── */
.creditos-detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cr-empty-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    gap: .6rem;
    text-align: center;
}

.cr-empty-detail i {
    font-size: 2.5rem;
    opacity: .4;
}

.cr-empty-detail p {
    font-size: .85rem;
    line-height: 1.5;
}

.creditos-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.creditos-form-title {
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
}

.cr-cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: .85rem;
    padding: .25rem .4rem;
    border-radius: 4px;
    transition: color .15s;
}

.cr-cancel-btn:hover { color: #dc2626; }

.creditos-form-body {
    padding: .9rem 1.1rem;
    overflow-y: auto;
    flex: 1;
}

.creditos-section {
    font-size: .68rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .45rem;
}

/* New credit: client search */
.cr-client-search-wrap {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: .42rem .7rem;
    margin-bottom: .3rem;
    transition: border-color .15s;
}

.cr-client-search-wrap:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.cr-client-search-wrap i { color: #9ca3af; }

.cr-client-search-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: .84rem;
    background: transparent;
    color: #1e293b;
}

.cr-client-results {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    margin-bottom: .4rem;
}

.cr-client-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem .8rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}

.cr-client-result-row:last-child { border-bottom: none; }
.cr-client-result-row:hover { background: #f0f9ff; }

.cr-res-name { font-size: .83rem; font-weight: 500; color: #1e293b; }
.cr-res-phone { font-size: .75rem; color: #6b7280; }

.cr-selected-client-card {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #e0f5f5;
    border: 1px solid #b5e8ea;
    border-radius: 7px;
    padding: .45rem .8rem;
    font-size: .85rem;
    font-weight: 600;
    color: #148a8e;
    margin-bottom: .4rem;
}

.cr-clear-client {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #818cf8;
    font-size: .8rem;
    transition: color .15s;
}

.cr-clear-client:hover { color: #dc2626; }

/* Fields */
.cr-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.cr-field {
    display: flex;
    flex-direction: column;
    gap: .28rem;
}

.cr-field label {
    font-size: .72rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cr-field input, .cr-field select {
    padding: .42rem .65rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: .84rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
}

.cr-field input:focus, .cr-field select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* KPI cards */
.cr-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-bottom: .7rem;
}

.cr-kpi {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .55rem .7rem;
    text-align: center;
}

.cr-kpi-highlight {
    background: #e0f5f5;
    border-color: #b5e8ea;
}

.cr-kpi-overdue-hl {
    background: #fff1f2;
    border-color: #fecaca;
}

.cr-kpi-label {
    font-size: .67rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .2rem;
}

.cr-kpi-value {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
}

.cr-kpi-paid { color: #16a34a; }

/* Due date banner */
.cr-duedate-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    padding: .45rem .8rem;
    font-size: .8rem;
    color: #15803d;
    margin-bottom: .5rem;
}

.cr-duedate-banner-overdue {
    background: #fff1f2;
    border-color: #fecaca;
    color: #dc2626;
}

.cr-notes-box {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: .4rem .7rem;
    font-size: .78rem;
    color: #78350f;
    margin-bottom: .5rem;
}

/* Payment history */
.cr-empty-payments {
    font-size: .8rem;
    color: #9ca3af;
    padding: .4rem 0;
    margin-bottom: .5rem;
}

.cr-payments-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: .8rem;
}

.cr-payment-row {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
    padding: .45rem .8rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .8rem;
    gap: .5rem;
}

.cr-payment-row:last-child { border-bottom: none; }

.cr-pay-date   { color: #6b7280; }
.cr-pay-method { color: #374151; }
.cr-pay-amount { font-weight: 700; color: #16a34a; text-align: right; }
.cr-pay-notes  { grid-column: 1 / -1; font-size: .72rem; color: #9ca3af; }

/* Payment form */
.cr-payment-form { background: #f8fafc; border-radius: 10px; padding: .8rem; }

.cr-pm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .7rem;
}

.cr-pm-btn {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: .78rem;
    color: #374151;
    transition: all .15s;
}

.cr-pm-active {
    border-color: #1aacb1;
    background: #e0f5f5;
    color: #148a8e;
    font-weight: 600;
}

.cr-pay-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-bottom: .7rem;
}

.cr-amount-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
    transition: border-color .15s;
}

.cr-amount-wrap:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.cr-currency {
    padding: 0 .5rem;
    color: #6b7280;
    font-size: .85rem;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.cr-amount-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: .42rem .5rem;
    font-size: .84rem;
    color: #1e293b;
    min-width: 0;
}

.cr-full-btn {
    background: none;
    border: none;
    border-left: 1px solid #e5e7eb;
    padding: 0 .6rem;
    font-size: .7rem;
    cursor: pointer;
    color: #6366f1;
    font-weight: 600;
    align-self: stretch;
    transition: background .15s;
    white-space: nowrap;
}

.cr-full-btn:hover { background: #e0f5f5; }

/* Confirm button (shared by both forms) */
.cr-form-actions {
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
    margin-top: .4rem;
}

.cr-confirm-btn {
    background: #1aacb1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26,172,177,.3);
    transition: all .15s;
}

.cr-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,172,177,.4);
}

.cr-confirm-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ─── PROVEEDORES MODULE ─────────────────────────── */
.prov-header { flex-shrink: 0; }

.prov-header-title {
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #1e293b;
    text-transform: uppercase;
}

.prov-header-sub {
    font-size: .75rem;
    color: #64748b;
    margin-top: .15rem;
}

.prov-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Left panel */
.prov-list-panel {
    width: 320px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
}

.prov-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.prov-search i { color: #94a3b8; font-size: .85rem; }

.prov-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: .82rem;
    outline: none;
    color: #1e293b;
}

.prov-list-head {
    display: grid;
    grid-template-columns: 36px 48px 1fr;
    padding: .4rem .8rem;
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.prov-list {
    flex: 1;
    overflow-y: auto;
}

.prov-row {
    display: grid;
    grid-template-columns: 36px 48px 1fr;
    align-items: center;
    gap: .5rem;
    padding: .55rem .8rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .12s;
}

.prov-row:hover { background: #f8fafc; }

.prov-row.active {
    background: #e0f5f5;
    border-left: 3px solid #1aacb1;
}

.prov-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.prov-folio {
    font-size: .72rem;
    color: #64748b;
    font-weight: 600;
}

.prov-info { overflow: hidden; }

.prov-name {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prov-sub {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prov-inactive-badge {
    font-size: .6rem;
    font-weight: 700;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 4px;
    padding: 0 .35rem;
}

.prov-list-footer {
    padding: .6rem .8rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
}

/* Right panel */
.prov-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #fff;
}

.prov-toolbar {
    display: flex;
    gap: .5rem;
    padding: .7rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.prov-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.prov-form-title {
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
}

.prov-info-card {
    font-size: .72rem;
    color: #64748b;
}

.prov-form-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.prov-field {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: .5rem;
}

.prov-field label {
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
    text-align: right;
}

.prov-field input,
.prov-field select {
    padding: .38rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .82rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
    background: #fff;
}

.prov-field input:focus,
.prov-field select:focus { border-color: #1aacb1; }

.prov-field-textarea {
    align-items: flex-start;
}

.prov-field-textarea label { padding-top: .35rem; }

.prov-field textarea {
    width: 100%;
    min-height: 80px;
    padding: .38rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .82rem;
    color: #1e293b;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.prov-field textarea:focus { border-color: #1aacb1; }

.prov-check-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-left: 210px;
}

.prov-check-row label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: #475569;
    cursor: pointer;
}

/* Modal */
.prov-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.prov-modal {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    width: 360px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.prov-modal-icon {
    font-size: 2rem;
    color: #ef4444;
    margin-bottom: .75rem;
}

.prov-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .5rem;
}

.prov-modal-body {
    font-size: .82rem;
    color: #475569;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.prov-modal-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
}

/* ─── COMPRAS MODULE ─────────────────────────────── */
.compras-header { flex-shrink: 0; }

.compras-header-title {
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #1e293b;
    text-transform: uppercase;
}

.compras-header-sub {
    font-size: .75rem;
    color: #64748b;
    margin-top: .15rem;
}

.compras-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left panel */
.compras-list-panel {
    width: 300px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
}

.compras-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.compras-list {
    flex: 1;
    overflow-y: auto;
}

.compras-row {
    padding: .6rem .8rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .12s;
}

.compras-row:hover { background: #f8fafc; }

.compras-row.active {
    background: #e0f5f5;
    border-left: 3px solid #1aacb1;
}

.compras-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .25rem;
}

.compras-row-supplier {
    font-size: .82rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.compras-row-bot {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    color: #64748b;
}

.compras-row-total {
    margin-left: auto;
    font-weight: 700;
    color: #1e293b;
}

.compras-row-inv { color: #94a3b8; }

.compras-status-badge {
    font-size: .6rem;
    font-weight: 700;
    border-radius: 4px;
    padding: .15rem .45rem;
    white-space: nowrap;
}

.badge-pending {
    background: #fef9c3;
    color: #92400e;
}

.badge-confirmed {
    background: #dcfce7;
    color: #15803d;
}

.compras-list-footer {
    padding: .6rem .8rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Right panel */
.compras-detail-panel {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.compras-form-wrap {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.compras-form-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.compras-section-label {
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    padding-bottom: .25rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Form grid */
.compras-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem .9rem;
}

.compras-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.compras-field label {
    font-size: .74rem;
    font-weight: 600;
    color: #475569;
}

.compras-field input,
.compras-field select,
.compras-field textarea {
    padding: .38rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .82rem;
    color: #1e293b;
    outline: none;
    font-family: inherit;
}

.compras-field input:focus,
.compras-field select:focus,
.compras-field textarea:focus { border-color: #1aacb1; }

.compras-field-full { grid-column: 1 / -1; }

/* Product search */
.compras-product-search-wrap {
    position: relative;
}

.compras-product-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .7rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.compras-product-search i { color: #94a3b8; font-size: .85rem; }

.compras-product-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: .82rem;
    outline: none;
    color: #1e293b;
}

.compras-product-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 100;
    overflow: hidden;
}

.compras-product-option {
    display: flex;
    flex-direction: column;
    padding: .5rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}

.compras-product-option:last-child { border-bottom: none; }
.compras-product-option:hover { background: #f1f5f9; }

.cpd-name { font-size: .82rem; font-weight: 600; color: #1e293b; }
.cpd-meta { font-size: .7rem; color: #64748b; }

/* Lines table */
.compras-lines-table {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.compras-lines-head {
    display: grid;
    grid-template-columns: 1fr 100px 110px 100px 36px;
    background: #f8fafc;
    padding: .4rem .6rem;
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e2e8f0;
}

.compras-line-row {
    display: grid;
    grid-template-columns: 1fr 100px 110px 100px 36px;
    align-items: center;
    padding: .45rem .6rem;
    border-bottom: 1px solid #f1f5f9;
    gap: .4rem;
}

.compras-line-row:last-child { border-bottom: none; }

.compras-line-readonly { background: #fafafa; }

.compras-line-name {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    overflow: hidden;
}

.compras-line-name span:first-child {
    font-size: .82rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compras-line-barcode {
    font-size: .68rem;
    color: #94a3b8;
}

.compras-line-input {
    width: 100%;
    padding: .25rem .4rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: .8rem;
    text-align: right;
    outline: none;
}

.compras-line-input:focus { border-color: #1aacb1; }

.compras-line-val {
    font-size: .82rem;
    color: #1e293b;
    text-align: right;
}

.compras-line-subtotal {
    font-size: .82rem;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

.compras-line-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: .8rem;
    padding: .2rem;
    border-radius: 4px;
    transition: background .1s;
}

.compras-line-remove:hover { background: #fee2e2; }

.compras-lines-empty {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem;
    color: #94a3b8;
    font-size: .8rem;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
}

/* Totals */
.compras-totals {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .6rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-self: flex-end;
    min-width: 280px;
}

.compras-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .82rem;
    color: #475569;
}

.compras-total-final {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    border-top: 1px solid #e2e8f0;
    padding-top: .35rem;
    margin-top: .1rem;
}

.compras-tax-input-wrap {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .82rem;
    color: #475569;
}

.compras-tax-input-wrap input {
    width: 90px;
    padding: .2rem .4rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: .8rem;
    text-align: right;
    outline: none;
}

.compras-tax-input-wrap input:focus { border-color: #1aacb1; }

/* Actions */
.compras-form-actions {
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
    padding-top: .4rem;
}

.compras-save-btn {
    background: #1aacb1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .5rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.compras-save-btn:hover { background: #4338ca; }

.compras-save-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* View mode */
.compras-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compras-view-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem .9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .75rem 1rem;
}

.compras-view-meta > div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.compras-view-meta > div > span:first-child {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
}

.compras-view-meta > div > strong {
    font-size: .82rem;
    color: #1e293b;
}

.compras-view-notes { grid-column: 1 / -1; }

.compras-view-notes span:last-child {
    font-size: .8rem;
    color: #475569;
    white-space: pre-wrap;
}

/* Confirm / confirmed banners */
.compras-confirm-banner {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .8rem;
    color: #92400e;
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    line-height: 1.5;
}

.compras-confirmed-banner {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .8rem;
    color: #15803d;
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    line-height: 1.5;
}

.compras-confirm-btn {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.4rem;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(22,163,74,.3);
    transition: all .15s;
}

.compras-confirm-btn:hover {
    background: #15803d;
    box-shadow: 0 6px 16px rgba(22,163,74,.4);
}

.compras-confirm-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── VentasModule: stock error banner ── */
.ventas-stock-error-banner {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    text-align: left;
}

.vseb-title {
    font-weight: 600;
    color: #dc2626;
    margin-bottom: .4rem;
    font-size: .82rem;
}

.vseb-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: .78rem;
    color: #991b1b;
    line-height: 1.6;
}

/* ── Acceso denegado ── */
.acceso-denegado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: .75rem;
    color: #94a3b8;
}

.acceso-denegado i {
    font-size: 3rem;
    color: #cbd5e1;
}

.acceso-denegado p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
}

.acceso-denegado span {
    font-size: .82rem;
    color: #94a3b8;
}

/* ── Header store dropdown ── */
.store-dropdown-wrapper {
    position: relative;
}

.store-dropdown-trigger {
    background: none;
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: 8px;
    color: #7dd8db;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: .3rem .75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: background .15s, border-color .15s;
}

.store-dropdown-trigger:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.6);
}

.store-dropdown-chevron {
    font-size: .65rem;
    transition: transform .2s;
}

.store-dropdown-chevron.open {
    transform: rotate(180deg);
}

.store-dropdown-menu {
    position: absolute;
    top: calc(100% + .4rem);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    min-width: 200px;
    z-index: 1100;
    overflow: hidden;
    padding: .3rem 0;
}

.store-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: .55rem 1rem;
    background: none;
    border: none;
    color: var(--ink);
    font-size: .82rem;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}

.store-dropdown-item:hover {
    background: var(--primary-muted);
    color: var(--primary-dark);
}

.store-dropdown-item.active {
    color: var(--primary-dark);
    font-weight: 700;
    background: var(--primary-muted);
}

.store-dropdown-item i {
    color: var(--primary);
    font-size: .75rem;
}

.store-dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 1099;
}

/* ── Login store picker ── */
.login-store-picker {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .5rem 0;
}

.login-store-picker-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .25rem;
    text-align: center;
}

.login-store-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: .7rem 1rem;
    background: var(--primary-muted);
    border: 1.5px solid transparent;
    border-radius: 8px;
    color: var(--primary-dark);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.login-store-btn:hover {
    background: #b2ecee;
    border-color: var(--primary);
}

.login-store-btn i {
    color: var(--primary);
}

.login-store-back {
    margin-top: .25rem;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: .78rem;
    cursor: pointer;
    text-align: center;
    padding: .3rem;
    transition: color .15s;
}

.login-store-back:hover {
    color: var(--ink);
}

/* ================================================================
   OPERADORES MODULE
   ================================================================ */

.op-header {
    padding: 1.25rem 1.5rem .75rem;
    border-bottom: 1px solid #e2e8f0;
}
.op-header-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--primary);
    text-transform: uppercase;
}
.op-header-sub {
    font-size: .82rem;
    color: #64748b;
    margin-top: .2rem;
}

/* toolbar */
.op-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.op-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: .35rem .7rem;
    flex: 1;
    min-width: 200px;
}
.op-search i { color: #94a3b8; font-size: .85rem; }
.op-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: .85rem;
    width: 100%;
    color: var(--ink);
}

/* list container */
.op-list-container {
    padding: 1rem 1.5rem;
    overflow-x: auto;
}

/* ─── PAGINATION BAR ─────────────────────────────── */
.pg-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .25rem;
    padding: .6rem 1.5rem .9rem;
    flex-wrap: wrap;
}

.pg-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 .45rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, border-color .12s, color .12s;
    user-select: none;
}

.pg-btn:hover:not(:disabled) {
    background: #f0fdfc;
    border-color: var(--primary);
    color: var(--primary);
}

.pg-btn:disabled {
    opacity: .4;
    cursor: default;
}

.pg-btn.pg-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}

.pg-ellipsis {
    min-width: 22px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: .78rem;
    user-select: none;
}

/* table */
.op-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.op-table th {
    text-align: left;
    padding: .55rem .75rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}
.op-table td {
    padding: .65rem .75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--ink);
}
.op-table tr:last-child td { border-bottom: none; }
.op-table tr:hover td { background: #f8fafc; }
.op-row-inactive td { opacity: .55; }

/* name cell */
.op-name-cell {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 500;
}
.op-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.op-email { color: #64748b; font-size: .82rem; }

/* role badge */
.op-role-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}
.op-role-admin      { background: #fef3c7; color: #92400e; }
.op-role-supervisor { background: #dbeafe; color: #1e40af; }
.op-role-cashier    { background: #dcfce7; color: #166534; }

/* status badge */
.op-status-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}
.op-status-active   { background: #dcfce7; color: #166534; }
.op-status-inactive { background: #fee2e2; color: #991b1b; }

/* actions cell */
.op-actions-cell {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}
.abtn-sm {
    padding: .25rem .6rem !important;
    font-size: .75rem !important;
}

/* modal */
.op-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.op-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
}
.op-modal-header {
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.op-modal-body {
    padding: 1.25rem 1.5rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.op-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.op-field label {
    font-size: .8rem;
    font-weight: 600;
    color: #475569;
}
.op-field input,
.op-field select {
    padding: .45rem .7rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: .875rem;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.op-field input:focus,
.op-field select:focus { border-color: var(--primary); }
.op-field input:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.op-field-hint {
    font-size: .73rem;
    font-weight: 400;
    color: #94a3b8;
    margin-left: .3rem;
}
.input-invalid { border-color: #ef4444 !important; }

.op-modal-error {
    margin: .5rem 1.5rem 0;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.op-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: 1rem 1.5rem 1.25rem;
}

/* ================================================================
   SUCURSALES MODULE
   ================================================================ */

.suc-header { padding: 1.25rem 1.5rem .75rem; border-bottom: 1px solid #e2e8f0; }
.suc-header-title {
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    color: var(--primary); text-transform: uppercase;
}
.suc-header-sub { font-size: .82rem; color: #64748b; margin-top: .2rem; }

.suc-toolbar {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1.5rem; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap;
}
.suc-search {
    display: flex; align-items: center; gap: .4rem;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: .35rem .7rem; flex: 1; min-width: 200px;
}
.suc-search i { color: #94a3b8; font-size: .85rem; }
.suc-search input {
    border: none; background: transparent; outline: none;
    font-size: .85rem; width: 100%; color: var(--ink);
}

.suc-list-container { padding: 1rem 1.5rem; overflow-x: auto; }

.suc-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.suc-table th {
    text-align: left; padding: .55rem .75rem;
    font-size: .72rem; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: #64748b;
    background: #f8fafc; border-bottom: 2px solid #e2e8f0;
}
.suc-table td {
    padding: .65rem .75rem; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle; color: var(--ink);
}
.suc-table tr:last-child td { border-bottom: none; }
.suc-table tr:hover td { background: #f8fafc; }
.suc-row-inactive td { opacity: .55; }
.suc-muted { color: #64748b; font-size: .82rem; }

.suc-name-cell { display: flex; align-items: center; gap: .6rem; }
.suc-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.suc-name { font-weight: 500; }
.suc-current-badge {
    display: inline-block; font-size: .68rem; font-weight: 600;
    background: #dbeafe; color: #1e40af;
    border-radius: 999px; padding: .1rem .45rem; margin-top: .15rem;
}

.suc-status-badge {
    display: inline-block; padding: .2rem .55rem;
    border-radius: 999px; font-size: .72rem; font-weight: 600;
}
.suc-status-active   { background: #dcfce7; color: #166534; }
.suc-status-inactive { background: #fee2e2; color: #991b1b; }

.suc-actions-cell { display: flex; gap: .4rem; flex-wrap: wrap; }

/* modal */
.suc-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.suc-modal {
    background: #fff; border-radius: 10px; width: 100%; max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden;
}
.suc-modal-header {
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; gap: .6rem;
}
.suc-modal-body {
    padding: 1.25rem 1.5rem .5rem;
    display: flex; flex-direction: column; gap: .9rem;
}
.suc-field { display: flex; flex-direction: column; gap: .3rem; }
.suc-field label { font-size: .8rem; font-weight: 600; color: #475569; }
.suc-field input {
    padding: .45rem .7rem; border: 1px solid #cbd5e1; border-radius: 6px;
    font-size: .875rem; color: var(--ink); outline: none; transition: border-color .15s;
}
.suc-field input:focus { border-color: var(--primary); }
.suc-field-row { display: flex; gap: .75rem; }
.suc-field-row .suc-field { flex: 1; }

.suc-modal-error {
    margin: .5rem 1.5rem 0; background: #fee2e2; color: #991b1b;
    border-radius: 6px; padding: .5rem .75rem; font-size: .8rem;
    display: flex; align-items: center; gap: .4rem;
}
.suc-modal-actions {
    display: flex; justify-content: flex-end;
    gap: .6rem; padding: 1rem 1.5rem 1.25rem;
}

/* ─── REPORTES MODULE ────────────────────────────────── */
.rep-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.rep-filter-group {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.rep-filter-group label {
    font-size: .7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.rep-date-input {
    padding: .38rem .6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: .85rem;
    color: var(--ink);
    outline: none;
}
.rep-date-input:focus { border-color: var(--primary); }
.rep-filter-shortcuts {
    display: flex;
    gap: .35rem;
    align-items: flex-end;
    padding-bottom: .02rem;
}
.rep-shortcut {
    padding: .35rem .65rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: .76rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all .15s;
}
.rep-shortcut:hover { background: var(--primary-muted); border-color: var(--primary); color: var(--primary-dark); }

.rep-tabs {
    display: flex;
    gap: 0;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    padding: .5rem .75rem 0;
}
.rep-tab {
    padding: .5rem 1.1rem;
    border: none;
    border-radius: 7px 7px 0 0;
    background: transparent;
    font-size: .82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    border-bottom: 2px solid transparent;
    transition: color .15s, background .15s;
}
.rep-tab:hover { color: var(--primary); background: rgba(26,172,177,.07); }
.rep-tab.active { color: var(--primary-dark); background: #fff; border-bottom-color: var(--primary); }

.rep-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.25rem;
}
.rep-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 700px) { .rep-kpi-row { grid-template-columns: 1fr; } }
.rep-kpi {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.rep-kpi-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.rep-kpi-label { font-size: .74rem; color: #64748b; font-weight: 500; }
.rep-kpi-value { font-size: 1.3rem; font-weight: 800; color: #1e293b; margin-top: .1rem; }

.rep-section-title {
    font-size: .88rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .75rem;
}
.rep-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2.5rem;
    font-size: .875rem;
}
.rep-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    font-size: .84rem;
}
.rep-table thead tr { background: #f8fafc; }
.rep-table th {
    padding: .65rem .9rem;
    font-size: .72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.rep-table td {
    padding: .6rem .9rem;
    color: var(--ink);
    border-bottom: 1px solid #f1f5f9;
}
.rep-table tbody tr:last-child td { border-bottom: none; }
.rep-table tbody tr:hover { background: #f8fafc; }
.rep-num { text-align: right !important; }
.rep-bold { font-weight: 700; }

.rep-pct-bar-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: flex-end;
}
.rep-pct-bar {
    height: 6px;
    border-radius: 3px;
    background: #6366f1;
    min-width: 2px;
    transition: width .3s;
}
.rep-pct-bar-green  { background: #22c55e; }
.rep-pct-bar-purple { background: #a855f7; }

.rep-rank { width: 40px; }
.rep-medal { font-size: 1.1rem; }
.rep-medal.gold   { color: #f59e0b; }
.rep-medal.silver { color: #94a3b8; }
.rep-medal.bronze { color: #b45309; }
.rep-rank-num { font-size: .8rem; color: #94a3b8; font-weight: 600; padding-left: .25rem; }

.rep-op-name {
    display: flex; align-items: center; gap: .6rem;
}
.rep-op-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary-muted);
    color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ─── BILLING ALERT BANNER ──────────────────────────── */
.billing-alert {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .45rem 1.25rem;
    font-size: .8rem;
    font-weight: 500;
    flex-shrink: 0;
    z-index: 9;
}
.billing-alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #fde68a;
}
.billing-alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-bottom: 1px solid #fca5a5;
}
.billing-alert .fa-exclamation-triangle {
    flex-shrink: 0;
    font-size: .9rem;
}
.billing-alert-btn {
    margin-left: auto;
    padding: .25rem .75rem;
    border-radius: 5px;
    font-size: .76rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(0,0,0,.1);
    color: inherit;
    transition: background .15s;
}
.billing-alert-btn:hover {
    background: rgba(0,0,0,.2);
    color: inherit;
}

/* ─── PÁGINA /PAGAR ──────────────────────────────────── */
.pagar-price-box {
    text-align: center;
    padding: 1rem 0 .5rem;
}
.pagar-price-label {
    font-size: .8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.pagar-price-amount {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary-dark, #148a8e);
    line-height: 1.1;
    margin: .15rem 0;
}
.pagar-price-currency {
    font-size: .75rem;
    color: #9ca3af;
}
.pagar-divider {
    border: none;
    border-top: 1px dashed #e5e7eb;
    margin: 1rem 0;
}
.pagar-section-title {
    font-size: .85rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .6rem;
}
.pagar-data-grid {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.pagar-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: .85rem;
}
.pagar-data-label {
    color: #6b7280;
    font-weight: 500;
}
.pagar-data-value {
    font-weight: 600;
    color: #111827;
}
.pagar-highlight {
    font-family: 'Courier New', monospace;
    font-size: .92rem;
    color: var(--primary-dark, #148a8e);
    letter-spacing: .04em;
}
.pagar-hint {
    font-size: .8rem;
    color: #6b7280;
    margin-bottom: .25rem;
}
.pagar-wsp-btn {
    font-size: .9rem;
    font-weight: 600;
    padding: .65rem 1.25rem;
}

/* ─── TICKET DIGITAL MODAL (VentasModule) ───────────── */
.tr-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000;
}
.tr-modal {
    background: #fff;
    width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 6px;
    padding: 1.25rem 1.5rem 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: .82rem;
    color: #111;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.tr-store {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: .2rem;
}
.tr-meta {
    display: flex;
    justify-content: space-between;
    font-size: .74rem;
    color: #555;
    margin-bottom: .2rem;
}
.tr-folio {
    font-weight: 700;
    color: var(--primary-dark);
}
.tr-client {
    font-size: .78rem;
    color: #444;
    margin-bottom: .25rem;
}
.tr-divider {
    border-top: 1px dashed #999;
    margin: .5rem 0;
}
.tr-items {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}
.tr-items th {
    border-bottom: 1px solid #ccc;
    padding: .15rem .25rem;
    text-align: left;
    font-weight: 600;
}
.tr-items td {
    padding: .15rem .25rem;
    vertical-align: top;
}
.tr-num {
    text-align: right !important;
    white-space: nowrap;
}
.tr-totals {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.tr-total-row {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
}
.tr-total-main {
    font-size: .95rem;
    font-weight: 700;
    border-top: 1px solid #111;
    padding-top: .2rem;
    margin-top: .1rem;
}
.tr-credit-badge {
    text-align: center;
    margin-top: .35rem;
    background: #d1fae5;
    color: #065f46;
    border-radius: 4px;
    padding: .25rem .5rem;
    font-size: .78rem;
    font-weight: 600;
}
.tr-footer-text {
    text-align: center;
    font-size: .76rem;
    color: #555;
    margin-top: .1rem;
}
.tr-actions {
    display: flex;
    gap: .6rem;
    justify-content: center;
    margin-top: 1rem;
}

@media print {
    body * { visibility: hidden; }
    .tr-modal, .tr-modal * { visibility: visible; }
    .tr-overlay {
        position: static !important;
        background: none !important;
    }
    .tr-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 72mm !important;
        max-height: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 4mm !important;
        overflow: visible !important;
    }
    .no-print { display: none !important; }
}

/* ─── FONDO COMPARTIDO (Login / Crear cuenta) ────────── */
.lp-page-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f4c5c 100%) !important;
    position: relative;
}
.lp-page-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 60%, rgba(26,172,177,.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 35% at 80% 30%, rgba(99,102,241,.12) 0%, transparent 70%);
    pointer-events: none;
}

/* ─── LANDING PAGE ───────────────────────────────────── */

/* Hero */
.lp-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f4c5c 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    position: relative;
    overflow: hidden;
}
.lp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 60%, rgba(26,172,177,.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 35% at 80% 30%, rgba(99,102,241,.12) 0%, transparent 70%);
    pointer-events: none;
}
.lp-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(26,172,177,.15);
    border: 1px solid rgba(26,172,177,.35);
    color: #5eead4;
    border-radius: 999px;
    padding: .3rem .9rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: 1.5rem;
}
.lp-hero-title {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.12;
    margin-bottom: 1.2rem;
    position: relative;
}
.lp-hero-title span {
    background: linear-gradient(90deg, #1aacb1, #5eead4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.lp-hero-sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #94a3b8;
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
}
.lp-hero-actions {
    display: flex;
    gap: .9rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}
.lp-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(135deg, #1aacb1, #148a8e);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .75rem 1.75rem;
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(26,172,177,.4);
    transition: transform .15s, box-shadow .15s;
}
.lp-btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(26,172,177,.55);
}
.lp-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.07);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    padding: .75rem 1.75rem;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, transform .15s;
}
.lp-btn-ghost:hover {
    color: #fff;
    background: rgba(255,255,255,.13);
    transform: translateY(-2px);
}
.lp-hero-stats {
    display: flex;
    gap: 2.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3.5rem;
    position: relative;
}
.lp-stat {
    text-align: center;
}
.lp-stat-num {
    font-size: 1.9rem;
    font-weight: 800;
    color: #1aacb1;
    line-height: 1;
}
.lp-stat-label {
    font-size: .75rem;
    color: #64748b;
    margin-top: .25rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Features */
.lp-section {
    padding: 5rem 1.5rem;
}
.lp-section-dark {
    background: #f8fafc;
}
.lp-section-title {
    text-align: center;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .6rem;
}
.lp-section-sub {
    text-align: center;
    color: #64748b;
    font-size: .95rem;
    max-width: 520px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}
.lp-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.lp-feature-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    transition: box-shadow .2s, transform .2s;
}
.lp-feature-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,.09);
    transform: translateY(-3px);
}
.lp-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}
.lp-feature-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .4rem;
}
.lp-feature-desc {
    font-size: .83rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Why */
.lp-why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}
.lp-why-item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}
.lp-why-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #d1fae5;
    color: #065f46;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.lp-why-text strong {
    display: block;
    font-size: .88rem;
    color: #1e293b;
    font-weight: 700;
}
.lp-why-text span {
    font-size: .8rem;
    color: #64748b;
}

/* Pricing */
.lp-pricing-card {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    overflow: hidden;
}
.lp-pricing-header {
    background: linear-gradient(135deg, #1aacb1, #148a8e);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    color: #fff;
}
.lp-pricing-label {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .85;
    margin-bottom: .5rem;
}
.lp-pricing-amount {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}
.lp-pricing-period {
    font-size: .85rem;
    opacity: .8;
    margin-top: .3rem;
}
.lp-pricing-body {
    padding: 1.75rem 2rem 2rem;
}
.lp-pricing-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem 0;
    font-size: .88rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}
.lp-pricing-item:last-child { border-bottom: none; }
.lp-pricing-item i { color: #1aacb1; font-size: .8rem; }
.lp-trial-badge {
    text-align: center;
    background: #ecfdf5;
    color: #065f46;
    border-radius: 8px;
    padding: .55rem .75rem;
    font-size: .82rem;
    font-weight: 600;
    margin-top: 1.25rem;
}

/* CTA bottom */
.lp-cta {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 5rem 1.5rem;
    text-align: center;
}
.lp-cta-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: .75rem;
}
.lp-cta-sub {
    color: #94a3b8;
    font-size: .95rem;
    margin-bottom: 2rem;
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .lp-hero-stats { gap: 1.5rem; }
    .lp-pricing-amount { font-size: 2.4rem; }
}

/* ─── FOOTER ─────────────────────────────────────────── */
.lp-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 3.5rem 1.5rem 0;
    font-size: .85rem;
}
.lp-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 3rem;
}
@media (max-width: 768px) {
    .lp-footer-grid { grid-template-columns: 1fr 1fr; }
    .lp-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .lp-footer-grid { grid-template-columns: 1fr; }
}
.lp-footer-logo {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .85rem;
    text-decoration: none;
}
.lp-footer-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1aacb1, #148a8e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}
.lp-footer-logo-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -.01em;
}
.lp-footer-tagline {
    color: #64748b;
    line-height: 1.65;
    max-width: 280px;
    margin-bottom: 1.25rem;
}
.lp-footer-social {
    display: flex;
    gap: .6rem;
}
.lp-footer-social-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    font-size: .85rem;
    transition: background .15s, color .15s;
}
.lp-footer-social-btn:hover {
    background: rgba(26,172,177,.2);
    color: #5eead4;
    border-color: rgba(26,172,177,.3);
}
.lp-footer-col-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 1rem;
}
.lp-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.lp-footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color .15s;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.lp-footer-links a:hover { color: #5eead4; }
.lp-footer-links a i { font-size: .7rem; color: #475569; }
.lp-footer-contact-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .7rem;
    color: #94a3b8;
    text-decoration: none;
    transition: color .15s;
}
.lp-footer-contact-item:hover { color: #5eead4; }
.lp-footer-contact-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .8rem;
}
.lp-footer-bar {
    border-top: 1px solid rgba(255,255,255,.07);
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .78rem;
    color: #475569;
}
.lp-footer-bar a {
    color: #475569;
    text-decoration: none;
    transition: color .15s;
}

/* ══════════════════════════════════════════════════
   DEVOLUCIONES MODULE  (dev-*)
══════════════════════════════════════════════════ */
.dev-layout {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 160px);
    overflow: hidden;
}

/* ── Left panel (history) ── */
.dev-left {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    overflow-y: auto;
    gap: .5rem;
}
.dev-left-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .25rem;
}
.dev-history-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.dev-history-card {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: .6rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.dev-hcard-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dev-ticket-tag {
    font-size: .72rem;
    font-weight: 700;
    background: rgba(99,102,241,.12);
    color: #6366f1;
    padding: .12rem .4rem;
    border-radius: 4px;
}
.dev-hcard-date {
    font-size: .7rem;
    color: var(--text-muted);
}
.dev-hcard-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dev-hcard-items {
    font-size: .75rem;
    color: var(--text-secondary);
}
.dev-hcard-total {
    font-size: .82rem;
    font-weight: 700;
    color: #ef4444;
}
.dev-hcard-reason {
    font-size: .7rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Right panel (form) ── */
.dev-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem;
    overflow-y: auto;
    gap: 1rem;
}
.dev-search-header {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.dev-search-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.dev-search-bar {
    display: flex;
    gap: .5rem;
}
.dev-ticket-input {
    flex: 1;
}
.dev-search-error {
    color: #ef4444;
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* ── Found sale info ── */
.dev-sale-info {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: .75rem 1rem;
    display: flex;
    gap: 1.5rem;
    font-size: .85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

/* ── Items selection ── */
.dev-items-header {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}
.dev-items-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    overflow-y: auto;
    max-height: 300px;
}
.dev-item-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    transition: border-color .15s, background .15s;
}
.dev-item-row.selected {
    border-color: #6366f1;
    background: rgba(99,102,241,.05);
}
.dev-item-check {
    width: 1rem;
    height: 1rem;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}
.dev-item-name {
    flex: 1;
    font-size: .875rem;
    color: var(--text-primary);
}
.dev-item-qty-wrap {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.dev-item-qty-input {
    width: 64px;
    text-align: center;
}
.dev-item-max {
    font-size: .72rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.dev-item-subtotal {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 72px;
    text-align: right;
}

/* ── Reason & confirm ── */
.dev-reason-row {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.dev-reason-row label {
    font-size: .82rem;
    color: var(--text-secondary);
}
.dev-reason-input {
    width: 100%;
}
.dev-confirm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--sidebar-bg);
    border-radius: 8px;
    margin-top: auto;
}
.dev-return-total {
    font-size: .95rem;
    color: var(--text-primary);
}
.dev-return-count {
    font-size: .78rem;
    color: var(--text-muted);
    margin-left: .4rem;
}
.lp-footer-bar a:hover { color: #94a3b8; }

/* ─── REPORTES — TICKETS TAB ─────────────────────── */
.rep-tickets-table tbody tr { cursor: pointer; }
.rep-ticket-row:hover { background: #f0f4ff !important; }

.rep-ticket-num {
    font-family: monospace;
    font-size: .82rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(99,102,241,.08);
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
}

.rep-credit-badge {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: .4rem;
}

/* ── Promo modal ── */
.promo-modal {
    background: #fff;
    border-radius: 14px;
    width: 720px;
    max-width: 96vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
}

.promo-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
}

.promo-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.promo-empty {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
    font-size: .9rem;
}

.promo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.promo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color .15s, box-shadow .15s;
}

.promo-row:hover {
    border-color: #7c3aed;
    box-shadow: 0 3px 10px rgba(124,58,237,.12);
}

.promo-row-icon {
    font-size: 1.3rem;
    color: #7c3aed;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.promo-row-info {
    flex: 1;
    min-width: 0;
}

.promo-row-name {
    font-weight: 700;
    font-size: .9rem;
    color: #111827;
}

.promo-row-desc {
    font-size: .75rem;
    color: #6b7280;
    margin-top: 1px;
}

.promo-row-components {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.promo-row-components span {
    display: inline-block;
    background: #f3f4f6;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: .71rem;
    color: #6b7280;
}

.promo-row-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.promo-row-price {
    background: #f3e8ff;
    color: #7c3aed;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 6px;
    padding: 3px 12px;
    white-space: nowrap;
}

.promo-row-btn {
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.promo-row-btn:hover { background: #6d28d9; }

/* ── Combo rows in cart ── */
.combo-row td { background: #fdf4ff !important; }
.combo-row:hover td { background: #f5e8ff !important; }

.combo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #7c3aed;
    color: #fff;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.combo-components-line {
    font-size: .7rem;
    color: #7c3aed;
    margin-top: 3px;
    opacity: .85;
    line-height: 1.5;
}

/* ── PromocionesModule ── */
.promo-add-component-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .75rem;
}

.promo-comp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 100;
    overflow: hidden;
}

.promo-comp-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s;
}

.promo-comp-option:last-child { border-bottom: none; }
.promo-comp-option:hover { background: #f0fdf4; }

.promo-comp-name {
    font-size: .8rem;
    color: var(--ink);
    font-weight: 500;
}

.promo-comp-price {
    font-size: .78rem;
    color: #6b7280;
    font-family: monospace;
}

.promo-comp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: .5rem;
}

.promo-comp-table th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    padding: .35rem .5rem;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
}

.promo-comp-table td {
    padding: .4rem .5rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: .82rem;
    color: var(--ink);
}

.promo-comp-qty-col {
    width: 90px;
    text-align: right;
}

.promo-no-components {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #9ca3af;
    font-size: .82rem;
    padding: .75rem 0;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    justify-content: center;
    margin-bottom: .75rem;
}

/* ── Nav dropdown groups ─────────────────────────── */
.nav-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.nav-group-trigger {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .9rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255,255,255,.8);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, background .15s, border-color .15s;
    user-select: none;
}

.nav-group-trigger:hover,
.nav-group.open .nav-group-trigger {
    color: #fff;
    background: rgba(255,255,255,.1);
    border-bottom-color: #7dd8db;
}

.nav-group-trigger.has-active {
    color: #fff;
    background: rgba(255,255,255,.15);
    border-bottom-color: #fff;
    font-weight: 700;
}

.nav-chevron {
    font-size: .58rem;
    margin-left: 1px;
    transition: transform .2s ease;
}

.nav-group.open .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: fixed;
    min-width: 196px;
    background: #0a4448;
    border-radius: 0 4px 8px 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,.35);
    z-index: 1050;
    padding: 5px 0;
    animation: nav-drop-in .13s ease;
}

@keyframes nav-drop-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: rgba(255,255,255,.78);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background .12s, color .12s, border-color .12s;
}

.nav-dropdown-item:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-left-color: rgba(255,255,255,.35);
}

.nav-dropdown-item.active {
    background: rgba(255,255,255,.15);
    border-left-color: #fff;
    color: #fff;
    font-weight: 700;
}

.nav-drop-icon {
    width: 15px;
    text-align: center;
    font-size: .78rem;
    opacity: .72;
    flex-shrink: 0;
}

.nav-dropdown-item:hover .nav-drop-icon,
.nav-dropdown-item.active .nav-drop-icon {
    opacity: 1;
}

.nav-drop-kbd {
    margin-left: auto;
    font-size: .6rem;
    font-family: monospace;
    background: rgba(255,255,255,.18);
    border-radius: 3px;
    padding: 1px 5px;
    color: rgba(255,255,255,.85);
}

.nav-dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: transparent;
}

/* ══════════════════════════════════════════════
   CLIENTES MODULE — cli-*
══════════════════════════════════════════════ */

/* Stats row */
.cli-stats-row {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem 0;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.cli-stat-card {
    background: rgba(26,172,177,.07);
    border: 1px solid rgba(26,172,177,.25);
    border-radius: 10px;
    padding: .75rem 1.25rem;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.cli-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.cli-stat-label {
    font-size: .72rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Credit badge */
.cli-credit-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 99px;
}
.cli-credit-yes {
    background: rgba(52,211,153,.15);
    color: #34d399;
    border: 1px solid rgba(52,211,153,.3);
}
.cli-credit-no {
    background: rgba(107,114,128,.12);
    color: #9ca3af;
    border: 1px solid rgba(107,114,128,.25);
}

/* Modal container */
.cli-modal {
    background: #0d2f32;
    border: 1px solid #1a4a4e;
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.cli-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #1a4a4e;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}
.cli-modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 .25rem;
    line-height: 1;
    transition: color .15s;
}
.cli-modal-close:hover { color: #ef4444; }

.cli-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Two-column grid inside modal */
.cli-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem 1rem;
}
@media (max-width: 520px) {
    .cli-modal-grid { grid-template-columns: 1fr; }
}

/* Section divider label */
.cli-modal-section {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    padding-top: .5rem;
    border-top: 1px solid #1a4a4e;
}

/* Field */
.cli-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.cli-field label {
    font-size: .76rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.cli-field input[type="text"],
.cli-field input[type="email"],
.cli-field input[type="number"],
.cli-field textarea {
    background: #0a2326;
    border: 1px solid #1a4a4e;
    border-radius: 7px;
    color: #e2e8f0;
    font-size: .85rem;
    padding: .5rem .75rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.cli-field input:focus,
.cli-field textarea:focus {
    outline: none;
    border-color: #1aacb1;
}
.cli-field input.input-invalid {
    border-color: #ef4444;
}
.cli-field textarea { resize: vertical; }

/* Full-width field */
.cli-field-full {
    grid-column: 1 / -1;
}

/* Checkbox label */
.cli-check-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: .5rem;
    font-size: .85rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #e2e8f0 !important;
    cursor: pointer;
    margin-top: .75rem;
}
.cli-check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1aacb1;
    cursor: pointer;
}

/* Read-only balance display */
.cli-readonly {
    display: inline-block;
    padding: .4rem .75rem;
    background: #0a2326;
    border: 1px solid #1a4a4e;
    border-radius: 7px;
    font-size: .85rem;
    color: #9ca3af;
}
.cli-readonly.cli-balance-owed { color: #f87171; border-color: rgba(248,113,113,.35); }

/* Hint text */
.cli-hint {
    font-size: .68rem;
    color: #6b7280;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* Footer */
.cli-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: .9rem 1.25rem;
    border-top: 1px solid #1a4a4e;
}

/* Required star */
.required-star { color: #f87171; margin-left: .1rem; }

/* Stat card variant — alert (deudores) */
.cli-stat-card-alert {
    border-color: rgba(239,68,68,.25);
    background: rgba(239,68,68,.06);
}
.cli-stat-value-alert { color: #ef4444; }

/* Toolbar left column (search + chips stacked) */
.cli-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    flex: 1;
    min-width: 0;
}

/* Filter chips row */
.cli-filter-chips {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}
.cli-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .75rem;
    border-radius: 99px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #6b7280;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.cli-filter-chip:hover {
    border-color: var(--primary);
    background: rgba(26,172,177,.08);
    color: var(--primary);
}
.cli-filter-chip.active {
    background: rgba(248,113,113,.1);
    border-color: rgba(248,113,113,.4);
    color: #ef4444;
}

/* Debt cell in table */
.cli-debt-cell {
    display: inline-block;
    font-size: .82rem;
    font-weight: 600;
}
.cli-debt-owed { color: #f87171; }
.cli-debt-clear { color: #6b7280; font-weight: 400; }
