:root {
    --bg:       #f7f7f8;
    --surface:  #ffffff;
    --surface2: #f3f4f6;
    --surface3: #eaecf0;
    --border:   #e2e5ea;
    --border2:  #d0d5de;

    --text:     #0d0f14;
    --text2:    #4a5568;
    --text3:    #94a3b8;
    --text4:    #c9d4e0;

    --indigo:      #4f46e5;
    --indigo-mid:  #6366f1;
    --indigo-lt:   #eef2ff;
    --indigo-lt2:  #e0e7ff;
    --indigo-dark: #3730a3;

    --emerald:     #059669;
    --emerald-lt:  #ecfdf5;
    --emerald-lt2: #d1fae5;

    --amber:       #d97706;
    --amber-lt:    #fffbeb;
    --amber-lt2:   #fde68a;

    --rose:        #e11d48;
    --rose-lt:     #fff1f2;
    --rose-lt2:    #fecdd3;

    --sky:         #0284c7;
    --sky-lt:      #f0f9ff;
    --sky-lt2:     #bae6fd;

    --violet:      #7c3aed;
    --violet-lt:   #f5f3ff;

    --slate:       #64748b;

    --radius:    12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 4px 6px rgba(0,0,0,.04), 0 2px 4px rgba(0,0,0,.04);
    --shadow-md: 0 10px 15px rgba(0,0,0,.05), 0 4px 6px rgba(0,0,0,.04);
    --shadow-lg: 0 20px 25px rgba(0,0,0,.06), 0 8px 10px rgba(0,0,0,.04);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Geist', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-size: 13.5px;
    -webkit-font-smoothing: antialiased;
  }

  /* ── SIDEBAR ─────────────────────────────── */
  .sidebar {
    width: 232px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
  }

  .sidebar-logo {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .logo-mark {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-mid) 100%);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(79,70,229,.35);
    flex-shrink: 0;
  }

  .logo-text { flex: 1; }
  .logo-name {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--text);
    letter-spacing: -.3px;
    line-height: 1.2;
  }
  .logo-sub {
    font-size: 10.5px;
    color: var(--text3);
    letter-spacing: .4px;
    font-family: 'Geist Mono', monospace;
    font-weight: 400;
  }

  nav { padding: 10px 8px; flex: 1; overflow-y: auto; }

  .nav-section { margin-bottom: 18px; }

  .nav-section-label {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text3);
    padding: 0 8px;
    margin-bottom: 4px;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--text2);
    font-size: 13px;
    font-weight: 500;
    transition: background .12s, color .12s;
    position: relative;
    user-select: none;
  }

  .nav-item:hover { background: var(--surface2); color: var(--text); }

  .nav-item.active {
    background: var(--indigo-lt);
    color: var(--indigo);
    font-weight: 600;
  }

  .nav-item .icon {
    width: 28px; height: 28px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    background: var(--surface2);
    flex-shrink: 0;
    transition: background .12s;
  }

  .nav-item.active .icon {
    background: var(--indigo-lt2);
  }

  .nav-badge {
    margin-left: auto;
    background: var(--rose);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1.5px 5.5px;
    border-radius: 20px;
    font-family: 'Geist Mono', monospace;
    min-width: 18px;
    text-align: center;
  }

  .sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
  }

  .biz-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .biz-avatar {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, #f0fdf4, #d1fae5);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    border: 1px solid var(--emerald-lt2);
  }

  .biz-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
  .biz-date { font-size: 10px; color: var(--text3); font-family: 'Geist Mono', monospace; margin-top: 1px; }

  /* ── MAIN ─────────────────────────────────── */
  .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

  .topbar {
    height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
  }

  .topbar-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--text3);
  }

  .topbar-breadcrumb span:last-child {
    color: var(--text);
    font-weight: 600;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 14px;
  }

  .breadcrumb-sep { color: var(--text4); }

  .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

  .topbar-dot {
    width: 7px; height: 7px;
    background: var(--emerald);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--emerald-lt2);
  }

  .topbar-status { font-size: 11.5px; color: var(--text3); font-family: 'Geist Mono', monospace; }

  /* ── CONTENT ──────────────────────────────── */
  .page { flex: 1; overflow-y: auto; padding: 20px; display: none; }
  .page.active { display: block; }

  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 6px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text4); }

  /* ── GRID ─────────────────────────────────── */
  .grid { display: grid; gap: 14px; }
  .cols-2 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(3, 1fr); }
  .cols-4 { grid-template-columns: repeat(4, 1fr); }

  /* ── CARD ─────────────────────────────────── */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
  }

  .card-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
  }

  .card-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    display: flex; align-items: center; gap: 7px;
  }

  .card-body { padding: 16px; }

  /* ── KPI CARDS ───────────────────────────── */
  .kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
  }

  .kpi::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .kpi.k-indigo::after { background: linear-gradient(90deg, var(--indigo), var(--indigo-mid)); }
  .kpi.k-emerald::after { background: linear-gradient(90deg, #059669, #10b981); }
  .kpi.k-rose::after { background: linear-gradient(90deg, var(--rose), #fb7185); }
  .kpi.k-amber::after { background: linear-gradient(90deg, var(--amber), #f59e0b); }
  .kpi.k-sky::after { background: linear-gradient(90deg, var(--sky), #38bdf8); }
  .kpi.k-violet::after { background: linear-gradient(90deg, var(--violet), #a78bfa); }

  .kpi-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    margin-bottom: 12px;
  }
  .k-indigo .kpi-icon  { background: var(--indigo-lt);   }
  .k-emerald .kpi-icon { background: var(--emerald-lt); }
  .k-rose .kpi-icon    { background: var(--rose-lt);    }
  .k-amber .kpi-icon   { background: var(--amber-lt);   }
  .k-sky .kpi-icon     { background: var(--sky-lt);     }
  .k-violet .kpi-icon  { background: var(--violet-lt);  }

  .kpi-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 5px;
  }

  .kpi-value {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.5px;
    line-height: 1;
    margin-bottom: 5px;
  }

  .kpi-sub { font-size: 11.5px; color: var(--text3); }
  .kpi-sub.up   { color: var(--emerald); }
  .kpi-sub.down { color: var(--rose);    }

  /* ── BUTTONS ─────────────────────────────── */
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px;
    border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 500;
    cursor: pointer; border: none;
    font-family: 'Geist', sans-serif;
    transition: all .14s;
    white-space: nowrap;
  }

  .btn-primary {
    background: var(--indigo);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79,70,229,.3), inset 0 1px 0 rgba(255,255,255,.1);
  }
  .btn-primary:hover { background: var(--indigo-dark); box-shadow: 0 2px 8px rgba(79,70,229,.4); }

  .btn-ghost {
    background: var(--surface);
    color: var(--text2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
  }
  .btn-ghost:hover { background: var(--surface2); color: var(--text); }

  .btn-danger {
    background: var(--rose-lt);
    color: var(--rose);
    border: 1px solid var(--rose-lt2);
  }
  .btn-danger:hover { background: var(--rose); color: #fff; }

  .btn-success {
    background: var(--emerald-lt);
    color: var(--emerald);
    border: 1px solid var(--emerald-lt2);
  }
  .btn-success:hover { background: var(--emerald); color: #fff; }

  .btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
  .btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
  .btn-icon { padding: 7px; }

  /* ── INPUTS ──────────────────────────────── */
  .field { margin-bottom: 14px; }
  .field-label {
    display: block;
    font-size: 12px; font-weight: 500;
    color: var(--text2); margin-bottom: 5px;
  }

  input, select, textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 8px 11px;
    color: var(--text);
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color .14s, box-shadow .14s;
    box-shadow: var(--shadow-xs);
  }
  input::placeholder, textarea::placeholder { color: var(--text3); }
  input:focus, select:focus, textarea:focus {
    border-color: var(--indigo-mid);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  }
  select option { background: var(--surface); }

  /* ── BADGES / TAGS ───────────────────────── */
  .tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2.5px 8px;
    border-radius: 20px;
    font-size: 11.5px; font-weight: 600;
    font-family: 'Geist Mono', monospace;
    letter-spacing: .2px;
  }

  .tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; display: inline-block; }

  .tag-emerald { background: var(--emerald-lt); color: var(--emerald); border: 1px solid var(--emerald-lt2); }
  .tag-emerald::before { background: var(--emerald); }
  .tag-rose    { background: var(--rose-lt);    color: var(--rose);    border: 1px solid var(--rose-lt2);    }
  .tag-rose::before { background: var(--rose); }
  .tag-amber   { background: var(--amber-lt);   color: var(--amber);   border: 1px solid #fcd34d;            }
  .tag-amber::before { background: var(--amber); }
  .tag-sky     { background: var(--sky-lt);     color: var(--sky);     border: 1px solid var(--sky-lt2);     }
  .tag-sky::before { background: var(--sky); }
  .tag-indigo  { background: var(--indigo-lt);  color: var(--indigo);  border: 1px solid var(--indigo-lt2);  }
  .tag-indigo::before { background: var(--indigo); }
  .tag-violet  { background: var(--violet-lt);  color: var(--violet);  border: 1px solid #ddd6fe;            }
  .tag-violet::before { background: var(--violet); }
  .tag-slate   { background: var(--surface2);   color: var(--slate);   border: 1px solid var(--border);      }
  .tag-slate::before { background: var(--slate); }

  /* ── TABLES ──────────────────────────────── */
  .data-table { width: 100%; border-collapse: collapse; }
  .data-table th {
    text-align: left;
    font-size: 11px; font-weight: 600;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--text3);
    padding: 8px 16px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
  }
  .data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text2);
  }
  .data-table tr:last-child td { border-bottom: none; }
  .data-table tbody tr { transition: background .1s; }
  .data-table tbody tr:hover td { background: var(--surface2); color: var(--text); }
  .data-table td strong { color: var(--text); font-weight: 500; }

  /* ── MODAL ───────────────────────────────── */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,20,35,.25);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: none; align-items: center; justify-content: center;
  }
  .modal-overlay.open { display: flex; }

  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    width: 480px; max-width: 95vw; max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn .18s cubic-bezier(.16,1,.3,1);
  }
  .modal.wide { width: 680px; }

  @keyframes modalIn {
    from { opacity: 0; transform: scale(.97) translateY(10px); }
    to   { opacity: 1; transform: none; }
  }

  .modal-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
  }

  .modal-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 16px; font-weight: 700;
    color: var(--text);
  }

  .modal-close {
    width: 28px; height: 28px;
    border-radius: 7px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text3); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: all .12s;
  }
  .modal-close:hover { background: var(--rose-lt); color: var(--rose); border-color: var(--rose-lt2); }

  .modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border);
  }

  /* ── SEARCH ──────────────────────────────── */
  .search-wrap { position: relative; }
  .search-wrap input { padding-left: 32px; }
  .search-icon {
    position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--text3); font-size: 13px; pointer-events: none;
  }

  /* ── ALERTS ──────────────────────────────── */
  .alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    margin-bottom: 8px;
    border-width: 1px; border-style: solid;
  }
  .alert-icon { font-size: 13px; margin-top: 1px; flex-shrink: 0; }
  .alert-rose    { background: var(--rose-lt);    color: #9f1239; border-color: var(--rose-lt2);   }
  .alert-amber   { background: var(--amber-lt);   color: #92400e; border-color: #fcd34d;           }
  .alert-emerald { background: var(--emerald-lt); color: #065f46; border-color: var(--emerald-lt2);}
  .alert-sky     { background: var(--sky-lt);     color: #0c4a6e; border-color: var(--sky-lt2);    }

  /* ── POS LAYOUT ──────────────────────────── */
  .pos-shell {
    display: grid;
    grid-template-columns: 1fr 356px;
    gap: 14px;
    height: calc(100vh - 52px);
    overflow: hidden;
    padding: 14px;
  }

  .pos-left { display: flex; flex-direction: column; gap: 10px; overflow: hidden; min-width: 0; }

  .pos-toolbar {
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0;
  }

  .cat-pills { display: flex; gap: 5px; flex-wrap: wrap; flex-shrink: 0; }

  .cat-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    box-shadow: var(--shadow-xs);
    transition: all .12s;
  }
  .cat-pill:hover { border-color: var(--indigo-mid); color: var(--indigo); }
  .cat-pill.active {
    background: var(--indigo);
    border-color: var(--indigo);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79,70,229,.25);
  }

  .prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 8px; overflow-y: auto;
    align-content: start;
    flex: 1;
    padding-right: 2px;
  }

  .prod-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 11px;
    cursor: pointer;
    transition: all .14s;
    box-shadow: var(--shadow-xs);
    position: relative;
    user-select: none;
  }
  .prod-tile:hover {
    border-color: var(--indigo-mid);
    box-shadow: 0 0 0 3px rgba(99,102,241,.1), var(--shadow-sm);
    transform: translateY(-1px);
  }
  .prod-tile:active { transform: scale(.97); }
  .prod-tile.out-of-stock { opacity: .45; pointer-events: none; }

  .prod-emoji { font-size: 24px; margin-bottom: 7px; }
  .prod-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
  .prod-price {
    font-family: 'Geist Mono', monospace;
    font-size: 13px; font-weight: 500;
    color: var(--indigo);
  }
  .prod-stock { font-size: 10.5px; color: var(--text3); margin-top: 2px; }
  .prod-stock.low { color: var(--amber); }
  .prod-stock.out { color: var(--rose); }

  .stock-dot {
    position: absolute;
    top: 8px; right: 8px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--emerald);
  }
  .stock-dot.low { background: var(--amber); }
  .stock-dot.out { background: var(--rose); }

  /* ── CART ────────────────────────────────── */
  .cart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .cart-head {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface);
  }

  .cart-head-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; gap: 7px;
  }

  .cart-count {
    background: var(--indigo);
    color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1.5px 6px;
    border-radius: 20px;
    font-family: 'Geist Mono', monospace;
  }

  .cart-items-list { flex: 1; overflow-y: auto; padding: 8px; }

  .cart-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 140px;
    color: var(--text3);
  }
  .cart-empty-icon { font-size: 32px; margin-bottom: 8px; opacity: .4; }
  .cart-empty-text { font-size: 12.5px; }

  .cart-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg);
    margin-bottom: 5px;
    transition: border-color .12s;
  }
  .cart-row:hover { border-color: var(--indigo-mid); }

  .cart-row-emoji { font-size: 17px; flex-shrink: 0; }

  .cart-row-name { flex: 1; font-size: 12px; font-weight: 500; color: var(--text); min-width: 0; }
  .cart-row-name small { display: block; font-size: 10.5px; color: var(--text3); font-weight: 400; }

  .qty-ctrl { display: flex; align-items: center; gap: 4px; }
  .qty-btn {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 300;
    transition: all .1s; line-height: 1;
  }
  .qty-btn:hover { background: var(--indigo); color: #fff; border-color: var(--indigo); }
  .qty-val {
    font-family: 'Geist Mono', monospace;
    font-size: 13px; min-width: 22px; text-align: center; color: var(--text);
  }

  .cart-row-total {
    font-family: 'Geist Mono', monospace;
    font-size: 12.5px; font-weight: 500;
    color: var(--indigo); min-width: 64px; text-align: right;
  }

  .cart-rm {
    width: 18px; height: 18px; border-radius: 4px;
    background: transparent; border: none; color: var(--text4);
    cursor: pointer; font-size: 12px; display: flex;
    align-items: center; justify-content: center;
    transition: color .1s;
  }
  .cart-rm:hover { color: var(--rose); }

  .cart-foot {
    padding: 13px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
  }

  .totals-table { margin-bottom: 10px; }
  .total-line {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12.5px; color: var(--text2);
    padding: 3px 0;
  }
  .total-line.grand {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 19px; font-weight: 800;
    color: var(--text);
    border-top: 1px solid var(--border);
    padding-top: 9px; margin-top: 5px;
  }
  .total-line.grand span:last-child { color: var(--indigo); }

  .pay-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 5px; margin-bottom: 10px;
  }

  .pay-opt {
    padding: 7px 4px;
    border-radius: var(--radius-xs);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text2); cursor: pointer;
    font-size: 11.5px; font-weight: 500;
    text-align: center; transition: all .12s;
  }
  .pay-opt:hover { border-color: var(--indigo-mid); color: var(--indigo); background: var(--indigo-lt); }
  .pay-opt.sel {
    border-color: var(--indigo);
    background: var(--indigo);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79,70,229,.28);
  }

  .efvo-row {
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 8px;
  }
  .efvo-row input { flex: 1; }
  .cambio-label { font-size: 11.5px; color: var(--text3); white-space: nowrap; }
  .cambio-val { font-family: 'Geist Mono', monospace; font-size: 12.5px; color: var(--emerald); font-weight: 600; }

  .btn-cobrar {
    width: 100%; padding: 12px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-mid) 100%);
    color: #fff; border: none; cursor: pointer;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 15px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 3px 10px rgba(79,70,229,.3), inset 0 1px 0 rgba(255,255,255,.1);
    transition: all .14s;
    letter-spacing: -.2px;
  }
  .btn-cobrar:hover { box-shadow: 0 5px 18px rgba(79,70,229,.4); transform: translateY(-1px); }
  .btn-cobrar:active { transform: none; }
  .btn-cobrar-total { font-family: 'Geist Mono', monospace; font-size: 14px; opacity: .85; }

  /* ── TABS ────────────────────────────────── */
  .tabs-bar {
    display: inline-flex; gap: 2px;
    background: var(--surface2);
    padding: 3px; border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid var(--border);
  }
  .tab-btn {
    padding: 6px 14px; border-radius: 7px;
    font-size: 12.5px; font-weight: 500;
    cursor: pointer; color: var(--text2);
    border: none; background: transparent; transition: all .12s;
  }
  .tab-btn.active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
  }

  /* ── DIVIDER ─────────────────────────────── */
  .divider { height: 1px; background: var(--border); margin: 12px 0; }

  /* ── PROGRESS ────────────────────────────── */
  .bar-track { height: 5px; background: var(--surface2); border-radius: 5px; overflow: hidden; }
  .bar-fill  { height: 100%; border-radius: 5px; transition: width .4s; }

  /* ── CHART BARS ──────────────────────────── */
  .mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
  .mini-bar {
    flex: 1; border-radius: 4px 4px 0 0;
    background: var(--indigo-lt2);
    cursor: pointer; transition: background .14s;
    min-height: 3px; position: relative;
  }
  .mini-bar:hover { background: var(--indigo); }

  /* ── SUPPLIER CARD ───────────────────────── */
  .supplier-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    margin-bottom: 7px;
    transition: box-shadow .12s;
    box-shadow: var(--shadow-xs);
  }
  .supplier-row:hover { box-shadow: var(--shadow-sm); }
  .sup-avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--indigo-lt);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
    border: 1px solid var(--indigo-lt2);
  }

  /* ── RECEIPT ─────────────────────────────── */
  .receipt {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 20px;
    max-width: 300px; margin: 0 auto;
    font-family: 'Geist Mono', monospace;
    font-size: 11.5px;
    color: #111;
  }
  .receipt h2 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 16px; text-align: center; margin-bottom: 2px; }
  .receipt .r-sub { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 12px; }
  .receipt hr { border: none; border-top: 1px dashed #d1d5db; margin: 8px 0; }
  .receipt .r-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
  .receipt .r-total { font-size: 14px; font-weight: 700; border-top: 1.5px solid #111; padding-top: 6px; margin-top: 5px; }
  .receipt .r-footer { text-align: center; color: #9ca3af; font-size: 9.5px; margin-top: 10px; }

  /* ── NOTIFICATIONS ───────────────────────── */
  .notif-stack { position: fixed; top: 14px; right: 14px; z-index: 9999; display: flex; flex-direction: column; gap: 7px; }

  .notif {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    min-width: 260px;
    box-shadow: var(--shadow-md);
    animation: notifIn .2s cubic-bezier(.16,1,.3,1);
    font-size: 13px;
  }
  @keyframes notifIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

  .notif-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .notif.ok   .notif-dot { background: var(--emerald); }
  .notif.err  .notif-dot { background: var(--rose);    }
  .notif.warn .notif-dot { background: var(--amber);   }

  .notif-msg { flex: 1; color: var(--text); }
  .notif-close {
    color: var(--text3); cursor: pointer; font-size: 12px;
    transition: color .1s; background: none; border: none;
  }
  .notif-close:hover { color: var(--rose); }

  /* ── EMPTY ───────────────────────────────── */
  .empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
  .empty-state-icon { font-size: 34px; margin-bottom: 10px; opacity: .3; }
  .empty-state-text { font-size: 13px; }

  /* ── SECTION HEADING ─────────────────────── */
  .section-label {
    font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--text3); margin-bottom: 8px;
  }

  /* ── PAGE HEADER ─────────────────────────── */
  .page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
  }
  .page-header h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 20px; font-weight: 800;
    color: var(--text); letter-spacing: -.4px;
  }
  .page-header p { font-size: 12.5px; color: var(--text3); margin-top: 1px; }
/* ══════════════════════════════════════════
   ADMINISTRACIÓN — Estilos específicos
══════════════════════════════════════════ */

/* Hero banner */
.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--indigo) 0%, #6366f1 60%, #818cf8 100%);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(79,70,229,.25);
}
.admin-hero-left { display: flex; align-items: center; gap: 14px; }
.admin-hero-icon { font-size: 32px; }
.admin-hero-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px; font-weight: 800;
  color: #fff; letter-spacing: -.3px;
}
.admin-hero-sub { font-size: 12.5px; color: rgba(255,255,255,.75); margin-top: 2px; }
.admin-hero .btn-primary {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  backdrop-filter: blur(4px);
}
.admin-hero .btn-primary:hover {
  background: rgba(255,255,255,.25);
  box-shadow: none;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  padding-bottom: 0;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text3);
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  transition: all .14s;
}
.admin-tab:hover { color: var(--text); background: var(--surface2); }
.admin-tab.active {
  color: var(--indigo);
  font-weight: 700;
  border-bottom-color: var(--indigo);
  background: var(--indigo-lt);
}
.admin-tab-icon { font-size: 15px; }
.admin-tab-label { font-size: 13px; }

/* Admin panels */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* 2-column admin layout */
.admin-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Section title within admin */
.admin-section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Info banners */
.admin-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 16px;
  border-width: 1px; border-style: solid;
  line-height: 1.55;
}
.admin-info-banner .info-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.info-sky    { background: var(--sky-lt);   color: #0c4a6e; border-color: var(--sky-lt2);   }
.info-amber  { background: var(--amber-lt); color: #92400e; border-color: #fcd34d;          }
.info-indigo { background: var(--indigo-lt);color: var(--indigo-dark); border-color: var(--indigo-lt2); }

/* Logo drop zone */
.logo-drop-zone {
  width: 100%; height: 150px;
  border: 2px dashed var(--border2);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; cursor: pointer;
  transition: all .15s;
  background: var(--surface2);
  overflow: hidden;
  position: relative;
}
.logo-drop-zone:hover {
  border-color: var(--indigo-mid);
  background: var(--indigo-lt);
}
.logo-drop-icon { font-size: 28px; opacity: .35; }
.logo-drop-text { font-size: 12.5px; color: var(--text3); font-weight: 500; text-align: center; }
.logo-drop-hint { font-size: 11px; color: var(--text4); }

/* Emoji picker */
.emoji-picker { display: flex; flex-wrap: wrap; gap: 5px; }
.emoji-opt {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer; font-size: 19px;
  transition: all .12s;
}
.emoji-opt:hover { background: var(--indigo-lt); border-color: var(--indigo-mid); transform: scale(1.1); }

/* Moneda preview */
.moneda-preview-box {
  background: linear-gradient(135deg, var(--indigo-lt) 0%, var(--indigo-lt2) 100%);
  border: 1px solid var(--indigo-lt2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.moneda-preview-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px;
}
.moneda-preview-value {
  font-family: 'Geist Mono', monospace;
  font-size: 26px; font-weight: 700;
  color: var(--indigo); line-height: 1;
  margin-bottom: 8px;
}
.moneda-preview-examples {
  display: flex; gap: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px; color: var(--text3);
}

/* NCF grid */
.ncf-grid { display: grid; gap: 8px; }

.ncf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: border-color .12s;
}
.ncf-card:hover { border-color: var(--indigo-lt2); }
.ncf-card.inactive { background: var(--surface2); opacity: .7; }

.ncf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ncf-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 14px; font-weight: 800;
  color: var(--indigo);
  background: var(--indigo-lt);
  border: 1px solid var(--indigo-lt2);
  border-radius: 6px;
  padding: 3px 10px;
  letter-spacing: .5px;
}
.ncf-card-fields {
  display: grid;
  grid-template-columns: 1fr 130px 130px 100px 80px 40px;
  gap: 8px;
  align-items: center;
}
.ncf-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .7px; color: var(--text3); margin-bottom: 3px;
}
.ncf-progress {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ncf-progress-track { flex: 1; height: 5px; background: var(--surface3); border-radius: 5px; overflow: hidden; }
.ncf-progress-fill  { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--indigo), var(--indigo-mid)); transition: width .4s; }
.ncf-progress-label { font-size: 11px; color: var(--text3); font-family: 'Geist Mono', monospace; white-space: nowrap; }

/* NCF preview cards */
.ncf-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.ncf-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 200px;
  box-shadow: var(--shadow-xs);
}
.ncf-preview-tipo  { font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; }
.ncf-preview-num   { font-family: 'Geist Mono', monospace; font-size: 17px; font-weight: 800; color: var(--indigo); }
.ncf-preview-desc  { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* Impuestos */
.imp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--surface);
  transition: border-color .12s;
}
.imp-row:hover { border-color: var(--indigo-lt2); }
.imp-row.inactive { background: var(--surface2); opacity: .65; }
.imp-name-input {
  flex: 1; border: none; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text);
  padding: 0; box-shadow: none;
}
.imp-name-input:focus { box-shadow: none; border-bottom: 1px solid var(--indigo-mid); }
.imp-pct-wrap { display: flex; align-items: center; gap: 5px; }
.imp-pct-input {
  width: 60px; font-family: 'Geist Mono', monospace; font-size: 15px;
  font-weight: 700; text-align: center; padding: 5px 6px;
  color: var(--indigo);
}
.imp-active-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); cursor: pointer; white-space: nowrap; }

/* Employee cards */
.emp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.emp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: box-shadow .14s;
}
.emp-card:hover { box-shadow: var(--shadow-md); border-color: var(--indigo-lt2); }
.emp-card.inactive { opacity: .55; }

.emp-card-avatar {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
  border-width: 1px; border-style: solid;
}
.emp-card-name { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.emp-card-rol  { font-size: 12px; color: var(--text3); text-transform: capitalize; margin-bottom: 8px; }
.emp-card-meta { font-size: 11.5px; color: var(--text3); }
.emp-card-meta span { display: block; margin-bottom: 2px; }
.emp-card-actions { display: flex; gap: 5px; margin-top: 10px; }
.emp-card-status {
  position: absolute; top: 12px; right: 12px;
  width: 8px; height: 8px; border-radius: 50%;
}
.emp-card-status.active   { background: var(--emerald); box-shadow: 0 0 0 2px var(--emerald-lt2); }
.emp-card-status.inactive { background: var(--text4); }

/* Employee modal */
.emp-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.emp-modal-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Permisos */
.permisos-note {
  font-size: 12px; color: var(--text3);
  margin-bottom: 12px; line-height: 1.5;
}
.permisos-list { display: grid; gap: 6px; }
.perm-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.perm-row:hover { border-color: var(--indigo-mid); background: var(--indigo-lt); }
.perm-chk { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--indigo); flex-shrink: 0; cursor: pointer; }
.perm-info { flex: 1; }
.perm-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.perm-desc { font-size: 11px; color: var(--text3); margin-top: 1px; }
.perm-admin { border-color: var(--indigo-lt2); background: var(--indigo-lt); }
.perm-admin:hover { background: var(--indigo-lt2); }

/* Role colors for emp cards */
.rol-cajero    { background: var(--sky-lt);    border-color: var(--sky-lt2);     }
.rol-supervisor{ background: var(--amber-lt);  border-color: var(--amber-lt2);   }
.rol-almacen   { background: var(--emerald-lt);border-color: var(--emerald-lt2); }
.rol-admin     { background: var(--rose-lt);   border-color: var(--rose-lt2);    }
.rol-gerente   { background: var(--violet-lt); border-color: #ddd6fe;            }

/* ════════════════════════════════════════════════
   CART META — Cliente & Comprobante
   ════════════════════════════════════════════════ */
.cart-meta {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface2);
}
.cart-meta-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.cart-meta-label {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; flex-shrink: 0;
}
.cart-meta-right {
  display: flex; align-items: center; gap: 5px; flex: 1; justify-content: flex-end; min-width: 0;
}

/* Client display button */
.cart-cli-display {
  display: flex; flex-direction: column; align-items: flex-end;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  transition: all .12s; min-width: 0; max-width: 180px;
}
.cart-cli-display:hover { border-color: var(--indigo-mid); background: var(--indigo-lt); }
.cart-cli-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 164px;
}
.cart-cli-rnc {
  font-size: 10px; color: var(--text3); font-family: 'Geist Mono', monospace;
}
.cart-cli-display.has-client { border-color: var(--indigo-mid); background: var(--indigo-lt); }
.cart-cli-display.has-client .cart-cli-name { color: var(--indigo); }

.cart-meta-clear {
  width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0;
  background: var(--rose-lt); border: 1px solid var(--rose-lt2);
  color: var(--rose); font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.cart-meta-clear:hover { background: var(--rose); color: #fff; }

/* NCF select */
.cart-ncf-select {
  font-size: 12px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: 'Geist Mono', monospace;
  cursor: pointer; max-width: 200px; box-shadow: none;
  transition: border-color .12s;
}
.cart-ncf-select:focus { border-color: var(--indigo-mid); box-shadow: 0 0 0 2px rgba(99,102,241,.1); }
.cart-ncf-select.active { border-color: var(--indigo-mid); background: var(--indigo-lt); color: var(--indigo); font-weight: 600; }

/* Client picker row */
.cli-pick-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .12s; background: var(--surface);
}
.cli-pick-row:hover { border-color: var(--indigo-mid); background: var(--indigo-lt); }
.cli-pick-row.selected { border-color: var(--indigo); background: var(--indigo-lt); }
.cli-pick-avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.cli-pick-avatar.generic  { background: var(--surface3); border: 1px solid var(--border); }
.cli-pick-avatar.regular  { background: var(--sky-lt);    border: 1px solid var(--sky-lt2);    color: var(--sky); }
.cli-pick-avatar.vip      { background: var(--amber-lt);  border: 1px solid var(--amber-lt2);  color: var(--amber); }
.cli-pick-avatar.negocio  { background: var(--violet-lt); border: 1px solid var(--violet-lt2); color: var(--violet); }
.cli-pick-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.cli-pick-sub   { font-size: 11px; color: var(--text3); font-family: 'Geist Mono', monospace; margin-top: 1px; }
.cli-pick-badge { margin-left: auto; flex-shrink: 0; }

/* ════════════════════════════════════════════════
   QR DGII — Recibo imprimible
   ════════════════════════════════════════════════ */
.receipt-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 12px 0 6px;
  gap: 6px;
}
.receipt-qr-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6b7280;
  font-weight: 700;
  text-align: center;
}
.receipt-qr-box {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px;
  background: #fff;
}
.receipt-qr-box canvas,
.receipt-qr-box img {
  width: 108px !important;
  height: 108px !important;
}
.receipt-qr-url {
  font-size: 7.5px;
  color: #9ca3af;
  text-align: center;
  word-break: break-all;
  max-width: 280px;
  line-height: 1.4;
}
.receipt-qr-cdf {
  font-family: 'Courier New', monospace;
  font-size: 8px;
  color: #374151;
  text-align: center;
  letter-spacing: .5px;
}
.receipt-qr-pending {
  width: 120px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  gap: 5px;
}
.receipt-qr-pending-icon { font-size: 22px; opacity: .5; }
.receipt-qr-pending-text { font-size: 9px; color: #9ca3af; text-align: center; line-height: 1.4; }

/* ── PRINT ────────────────────────────────────── */
@media print {
  body > *:not(#printTarget) { display: none !important; }
  #printTarget {
    display: block !important;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
  }
  .modal-overlay,
  .modal,
  .modal-head,
  .modal-foot { all: unset; display: block; }
  .modal-overlay { position: static !important; background: none !important; }
  .modal         { box-shadow: none !important; border: none !important; padding: 0 !important; }
  .modal-head,
  .modal-foot    { display: none !important; }
  .receipt       { border: none; padding: 0; }
}

/* ════════════════════════════════════════════════
   LOGIN SCREEN
   ════════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0; z-index: 10000;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Geist', sans-serif;
}
.login-screen.hidden { display: none; }

.login-card {
  background: #fff; border-radius: 18px;
  padding: 36px 32px 28px;
  width: 380px; max-width: 95vw;
  box-shadow: 0 32px 64px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08);
  animation: loginIn .3s cubic-bezier(.16,1,.3,1);
}
@keyframes loginIn {
  from { opacity:0; transform: translateY(24px) scale(.97); }
  to   { opacity:1; transform: none; }
}

/* Logo block */
.login-logo {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 28px; gap: 6px;
}
.login-logo-mark {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-mid) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; box-shadow: 0 8px 24px rgba(79,70,229,.4);
  margin-bottom: 4px;
}
.login-logo-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -.5px;
}
.login-logo-sub {
  font-size: 12px; color: var(--text3);
  font-family: 'Geist Mono', monospace; letter-spacing: .3px;
}

/* Fields */
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-label { font-size: 12px; font-weight: 600; color: var(--text2); }
.login-input-wrap {
  position: relative; display: flex; align-items: center;
}
.login-input-icon {
  position: absolute; left: 11px; font-size: 14px; pointer-events: none;
}
.login-input {
  width: 100%; padding: 10px 11px 10px 36px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'Geist', sans-serif;
  color: var(--text); background: var(--bg); outline: none;
  transition: border-color .14s, box-shadow .14s; box-shadow: var(--shadow-xs);
}
.login-input:focus {
  border-color: var(--indigo-mid);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: #fff;
}
.login-input::placeholder { color: var(--text4); }
.login-eye {
  position: absolute; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text3); padding: 4px;
  transition: color .12s;
}
.login-eye:hover { color: var(--indigo); }

/* Error */
.login-error {
  display: flex; align-items: center; gap: 7px;
  background: var(--rose-lt); border: 1px solid var(--rose-lt2);
  border-radius: var(--radius-xs); padding: 8px 12px;
  font-size: 12.5px; color: #9f1239;
  animation: loginShake .3s;
}
@keyframes loginShake {
  0%,100%{transform:translateX(0)}
  20%    {transform:translateX(-6px)}
  40%    {transform:translateX(6px)}
  60%    {transform:translateX(-4px)}
  80%    {transform:translateX(4px)}
}

/* Button */
.login-btn {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-mid) 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(79,70,229,.35), inset 0 1px 0 rgba(255,255,255,.1);
  transition: all .14s; letter-spacing: -.2px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-btn:hover  { box-shadow: 0 6px 20px rgba(79,70,229,.45); transform: translateY(-1px); }
.login-btn:active { transform: none; }
.login-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Login footer credit */
.login-footer-credit {
  text-align: center; margin-top: 22px;
  font-size: 11.5px; color: var(--text3);
}
.login-footer-credit a {
  color: var(--indigo); font-weight: 600; text-decoration: none;
  transition: color .12s;
}
.login-footer-credit a:hover { color: var(--indigo-dark); text-decoration: underline; }

/* ════════════════════════════════════════════════
   TOPBAR USER SESSION
   ════════════════════════════════════════════════ */
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  margin-left: 8px;
}
.topbar-user-avatar {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--indigo-lt); border: 1px solid var(--indigo-lt2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.topbar-user-info {
  display: flex; flex-direction: column; gap: 0;
}
.topbar-user-name {
  font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2;
}
.topbar-user-rol {
  font-size: 10px; color: var(--text3);
  text-transform: capitalize; font-family: 'Geist Mono', monospace;
}
.topbar-logout {
  width: 26px; height: 26px; border-radius: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; margin-left: 2px;
}
.topbar-logout:hover {
  background: var(--rose-lt); color: var(--rose);
}

/* ════════════════════════════════════════════════
   APP FOOTER
   ════════════════════════════════════════════════ */
.app-footer {
  height: 28px; flex-shrink: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 11px; color: var(--text3);
  font-family: 'Geist', sans-serif;
}
.footer-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--indigo); font-weight: 600; text-decoration: none;
  transition: color .12s;
}
.footer-link:hover { color: var(--indigo-dark); text-decoration: underline; }
.footer-logo-icon { font-size: 11px; }
.footer-sep { color: var(--text4); }

/* ── Body layout adjustment for footer ─────── */
body {
  flex-direction: column;
}
#appShell {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: row;
}

/* ════════════════════════════════════════════════
   RESPONSIVE — Clátsua POS
   Breakpoints: tablet 1024px · mobile 768px · xs 480px
   ════════════════════════════════════════════════ */

/* ── Sidebar hamburger toggle (mobile) ──────── */
.sidebar-toggle {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 500;
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--indigo); color: #fff; border: none;
  font-size: 17px; cursor: pointer; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(79,70,229,.35);
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,.4); backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ─── TABLET (≤1024px) ──────────────────────── */
@media (max-width: 1024px) {
  /* Sidebar collapses to icon-only */
  .sidebar { width: 64px; }
  .logo-text, .nav-section-label, .nav-item span:not(.icon),
  .nav-badge, .biz-name, .biz-date, .biz-avatar ~ div { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .icon { width: 34px; height: 34px; font-size: 16px; }
  .sidebar-logo { justify-content: center; padding: 14px 0; }
  .sidebar-footer { padding: 8px; }
  .biz-card { justify-content: center; padding: 8px; }

  /* POS grid tighter */
  .pos-shell { grid-template-columns: 1fr 320px; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

  /* KPI grids */
  .cols-4 { grid-template-columns: repeat(2, 1fr); }

  /* Tables — hide less important cols */
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) { display: none; }
}

/* ─── MOBILE (≤768px) ───────────────────────── */
@media (max-width: 768px) {
  /* Sidebar slides in as drawer */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: 240px; transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.16,1,.3,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  /* Restore sidebar content when open */
  .sidebar.open .logo-text,
  .sidebar.open .nav-section-label,
  .sidebar.open .nav-badge,
  .sidebar.open .biz-name,
  .sidebar.open .biz-date,
  .sidebar.open .biz-avatar ~ div { display: block; }
  .sidebar.open .nav-item { justify-content: flex-start; padding: 8px 10px; }
  .sidebar.open .sidebar-logo { justify-content: flex-start; padding: 18px 16px 14px; }
  .sidebar.open .biz-card { justify-content: flex-start; }
  .sidebar.open .nav-item .icon { width: 28px; height: 28px; font-size: 14px; }

  .sidebar-toggle { display: flex; }
  .main { padding-top: 0; }

  /* Topbar adjustments */
  .topbar { padding: 0 12px 0 56px; }
  .topbar-breadcrumb span:first-child { display: none; }
  .breadcrumb-sep { display: none; }
  .topbar-user-info { display: none; }
  .topbar-status { display: none; }

  /* POS: stack vertically */
  .pos-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    overflow: visible;
    padding: 10px;
    gap: 10px;
  }
  .pos-left { height: 55vh; min-height: 300px; }
  .cart-panel {
    max-height: 50vh;
    overflow-y: auto;
  }
  #page-pos {
    height: auto !important;
    overflow-y: auto !important;
    padding: 0 !important;
  }

  /* Prod grid bigger tiles on mobile */
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 7px; }

  /* Grids → single col */
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }

  /* Page padding */
  .page { padding: 12px; }

  /* Page header stack */
  .page-header { flex-direction: column; gap: 10px; }
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child > * { flex: 1; }

  /* Hide table cols on mobile */
  .data-table th:nth-child(n+4),
  .data-table td:nth-child(n+4) { display: none; }

  /* Cards */
  .card-body { padding: 12px; }

  /* Footer */
  .app-footer { font-size: 10px; gap: 4px; }

  /* Login card */
  .login-card { padding: 28px 20px 22px; }

  /* Modal */
  .modal.wide, .modal.xwide { width: 96vw; }
  .modal { padding: 18px; }

  /* Cart meta */
  .cart-meta { padding: 8px; }
  .cart-meta-label { font-size: 10px; }
}

/* ─── XS (≤480px) ──────────────────────────── */
@media (max-width: 480px) {
  .prod-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .prod-tile { padding: 10px 8px; }
  .prod-emoji { font-size: 20px; margin-bottom: 5px; }
  .prod-name  { font-size: 11px; }
  .prod-price { font-size: 12px; }
  .kpi-value  { font-size: 20px; }
  .btn-cobrar { font-size: 14px; padding: 11px; }

  /* POS stacked tighter */
  .pos-left { height: 45vh; }
  .cart-panel { max-height: 55vh; }

  /* Data table: show only 2 cols */
  .data-table th:nth-child(n+3),
  .data-table td:nth-child(n+3) { display: none; }

  .tabs-bar { flex-wrap: wrap; }
  .tab-btn  { font-size: 11.5px; padding: 6px 10px; }
}

/* ════════════════════════════════════════════════
   APERTURA / CIERRE DE CAJA POS
   ════════════════════════════════════════════════ */
.caja-bloqueada {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 40px 20px; text-align: center; gap: 16px;
  background: var(--bg);
}
.caja-bloqueada-icon { font-size: 56px; opacity: .7; }
.caja-bloqueada-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.4px;
}
.caja-bloqueada-sub  { font-size: 13px; color: var(--text3); max-width: 320px; }
.caja-status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; box-shadow: var(--shadow-xs);
  margin-bottom: 2px;
}
.caja-status-bar.abierta { border-color: var(--emerald-lt2); background: var(--emerald-lt); color: var(--emerald); }
.caja-status-bar.cerrada { border-color: var(--rose-lt2);   background: var(--rose-lt);   color: var(--rose); }
.caja-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.caja-status-bar.abierta .caja-status-dot { background: var(--emerald); }
.caja-status-bar.cerrada .caja-status-dot { background: var(--rose); }

/* Cierre summary card */
.cierre-summary {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  display: flex; flex-direction: column; gap: 8px; margin: 10px 0;
}
.cierre-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); }
.cierre-row.total {
  font-weight: 700; color: var(--text);
  border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px;
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 16px;
}
