:root {
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-alt: #F1F5F9;
    --navy: #0F172A;
    --navy-light: #1E293B;
    --text: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --primary: #059669;
    --primary-hover: #047857;
    --primary-soft: #ECFDF5;
    --amber: #D97706;
    --amber-soft: #FFFBEB;
    --danger: #DC2626;
    --danger-soft: #FEF2F2;
    --blue: #2563EB;
    --blue-soft: #EFF6FF;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  }

  [data-theme="dark"] {
    --bg: #0B1120;
    --surface: #111827;
    --surface-alt: #1E293B;
    --navy: #020617;
    --navy-light: #1E293B;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --border: #334155;
    --primary: #10B981;
    --primary-hover: #059669;
    --primary-soft: rgba(16, 185, 129, 0.16);
    --amber: #F59E0B;
    --amber-soft: rgba(245, 158, 11, 0.16);
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.16);
    --blue: #60A5FA;
    --blue-soft: rgba(59, 130, 246, 0.18);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  }
  [data-theme="dark"] .login-wrap { background: linear-gradient(135deg, #020617 0%, #0F172A 100%); }
  [data-theme="dark"] .form-group label,
  [data-theme="dark"] .tab-btn,
  [data-theme="dark"] table.data-table th,
  [data-theme="dark"] .quick-pill,
  [data-theme="dark"] .badge-neutral { color: #CBD5E1; }
  [data-theme="dark"] table.data-table tbody tr:hover { background: rgba(30, 41, 59, 0.65); }
  [data-theme="dark"] .sum-line.total { color: var(--text); }
  [data-theme="dark"] .btn-outline:hover:not(:disabled) { border-color: #475569; }
  [data-theme="dark"] input[type="date"],
  [data-theme="dark"] input[type="month"],
  [data-theme="dark"] input[type="datetime-local"],
  [data-theme="dark"] input[type="time"] {
    color-scheme: dark;
  }
  [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
  [data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
  [data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
  [data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 0.95;
    cursor: pointer;
  }
  [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
  [data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
  }

  * { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0; max-width: 100%; overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg); color: var(--text);
    font-size: clamp(13px, 3.2vw, 14px); line-height: 1.45;
    -webkit-font-smoothing: antialiased;
  }

  .hidden { display: none !important; }
  .mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
  .num { font-variant-numeric: tabular-nums; }
  .text-muted { color: var(--text-muted); }
  .text-right { text-align: right; }
  .text-center { text-align: center; }

  /* BUTTONS & INPUTS */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px; border-radius: 8px; border: 1px solid transparent;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.18s ease; text-decoration: none; white-space: nowrap;
  }
  .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  .btn:disabled { opacity: 0.55; cursor: not-allowed; }
  .btn-primary { background: var(--primary); color: #fff; }
  .btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
  .btn-navy { background: var(--navy); color: #fff; }
  .btn-navy:hover:not(:disabled) { background: var(--navy-light); }
  .btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
  .btn-outline:hover:not(:disabled) { background: var(--surface-alt); border-color: #CBD5E1; }
  .btn-danger { background: var(--danger); color: #fff; }
  .btn-danger:hover:not(:disabled) { background: #B91C1C; }
  .btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; }
  .btn-block { width: 100%; }

  .btn-icon {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    padding: 7px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all 0.18s ease;
  }
  .btn-icon:hover { background: var(--surface-alt); }
  .btn-icon-danger {
    color: var(--danger); border-color: rgba(220, 38, 38, 0.35); background: var(--danger-soft);
  }
  .btn-icon-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
  .mnav-logout { color: var(--danger) !important; }
  .btn-icon-only {
    background: transparent; border: none; font-size: 22px; line-height: 1;
    color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: 6px;
  }
  .btn-icon-only:hover { background: var(--surface-alt); color: var(--text); }

  .form-group { margin-bottom: 12px; }
  .form-group label { display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 5px; }
  .form-control {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text); font-size: 13.5px; font-family: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14); }
  .input-pwd-wrap { position: relative; display: flex; align-items: center; }
  .input-pwd-wrap .form-control { padding-right: 40px; }
  .btn-eye-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; color: var(--text-muted);
    width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; padding: 0;
  }
  .btn-eye-toggle:hover { color: var(--text); background: var(--surface-alt); }
  .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

  /* LOGIN */
  .login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
  }
  [data-theme="dark"] .login-wrap {
    background: linear-gradient(135deg, #0B1120 0%, #1E293B 100%);
  }
  .login-card {
    width: 100%; max-width: 410px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px;
    padding: 28px 24px 20px; box-shadow: var(--shadow-md);
  }
  .login-brand {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 10px; margin-bottom: 22px;
  }
  .login-logo-box {
    width: 82px; height: 82px; border-radius: 18px;
    background: var(--navy); color: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
  }
  .login-logo-box.has-img { background: var(--surface-alt); }
  .login-logo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .brand-logo {
    width: 46px; height: 46px; border-radius: 11px;
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
  }
  .brand-logo.sm { width: 34px; height: 34px; border-radius: 8px; }
  .brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .login-brand h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
  .login-brand p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); }
  .login-watermark {
    margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
    text-align: center; font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
    color: var(--text-muted); user-select: none; pointer-events: none;
  }

  .login-quick-box {
    margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border);
  }
  .quick-title { font-size: 11.5px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
  .quick-pills { display: flex; flex-wrap: wrap; gap: 6px; }
  .quick-pill {
    background: var(--surface-alt); border: 1px solid var(--border); color: #334155;
    padding: 5px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; cursor: pointer;
    transition: all 0.15s ease;
  }
  .quick-pill:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

  /* APP SHELL */
  .app-shell { display: flex; min-height: 100vh; }
  .sidebar {
    width: 244px; background: var(--navy); color: #E2E8F0;
    display: flex; flex-direction: column; flex-shrink: 0;
    position: sticky; top: 0; height: 100vh;
  }
  .sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .sidebar-title { font-size: 16px; font-weight: 700; color: #fff; }
  .role-badge {
    display: inline-block; margin-top: 2px; padding: 1px 7px; border-radius: 99px;
    font-size: 10.5px; font-weight: 600; background: rgba(5, 150, 105, 0.22); color: #6EE7B7;
  }
  .sidebar-nav { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 3px; }
  .nav-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border-radius: 8px; border: none; background: transparent;
    color: #94A3B8; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
    transition: all 0.16s ease;
  }
  .nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
  .nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
  .sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
  .btn-sidebar-logout {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12);
    background: transparent; color: #FCA5A5; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.16s ease;
  }
  .btn-sidebar-logout:hover { background: rgba(220, 38, 38, 0.15); }

  .main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .topbar {
    position: sticky; top: 0; z-index: 20;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: max(8px, env(safe-area-inset-top)) clamp(10px, 3vw, 18px) 9px;
    display: flex; align-items: center; justify-content: space-between;
    gap: clamp(6px, 1.8vw, 12px); flex-wrap: wrap;
  }
  .topbar-left {
    display: flex; align-items: center; gap: 8px;
    flex: 1 1 auto; min-width: max-content; max-width: 100%;
  }
  .page-title {
    margin: 0; font-size: clamp(14.5px, 4vw, 16px); font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar-right {
    display: flex; align-items: center; justify-content: flex-end;
    gap: clamp(4px, 1.5vw, 8px); flex: 999 1 auto; flex-wrap: wrap;
    min-width: 0; max-width: 100%;
  }
  .topbar-right .btn-icon { flex-shrink: 0; padding: clamp(5px, 1.4vw, 7px) clamp(7px, 2vw, 11px); }
  .branch-select {
    padding: clamp(5px, 1.3vw, 6px) clamp(7px, 2vw, 10px);
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface-alt); font-size: clamp(11.5px, 3vw, 12.5px);
    font-weight: 600; color: var(--text);
    flex: 0 1 auto; min-width: 0; max-width: 100%;
  }
  .conn-badge {
    font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; flex-shrink: 0;
  }
  .conn-badge.online { background: var(--primary-soft); color: var(--primary); }
  .conn-badge.offline { background: var(--danger-soft); color: var(--danger); }
  .btn-sync {
    background: var(--amber-soft); color: var(--amber); border: 1px solid #FDE68A;
    padding: 4px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; cursor: pointer; flex-shrink: 0;
  }
  .user-chip {
    background: var(--surface-alt); border: 1px solid var(--border);
    padding: clamp(4px, 1.1vw, 5px) clamp(8px, 2vw, 10px);
    border-radius: 99px; font-size: clamp(11px, 2.9vw, 12px); font-weight: 600;
    white-space: nowrap; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
  }

  .page-content { flex: 1; padding: clamp(10px, 2.8vw, 16px) clamp(10px, 3vw, 18px) 28px; min-width: 0; }

  /* CARDS & METRICS (GRID 2-3 KOLOM) */
  .card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
  }
  .card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; margin-bottom: 12px;
  }
  .card-title { margin: 0; font-size: 14.5px; font-weight: 700; }

  .metrics-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(140px, 40vw, 220px), 1fr)); gap: clamp(8px, 2.2vw, 12px); margin-bottom: 14px;
  }
  .metrics-grid-4 {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(140px, 40vw, 195px), 1fr)); gap: clamp(8px, 2.2vw, 12px); margin-bottom: 14px;
  }
  .metric-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .metric-card:hover { box-shadow: var(--shadow-md); }
  .metric-card.clickable { cursor: pointer; }
  .metric-card.clickable:hover { border-color: var(--primary); }
  .metric-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .metric-value { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
  .metric-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }
  .metric-card.emerald .metric-value { color: var(--primary); }
  .metric-card.amber .metric-value { color: var(--amber); }
  .metric-card.danger .metric-value { color: var(--danger); }

  /* DASHBOARD LIVE HEADER & INTERACTIVE PANELS */
  .dash-live-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
  }
  .dash-live-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .live-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
    background: var(--primary-soft); color: var(--primary); font-size: 11.5px; font-weight: 700;
  }
  .live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
  }
  .dash-quick-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .chart-summary-pills {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 12px; color: var(--text-muted); margin-bottom: 8px;
  }
  .chart-pill {
    background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px;
    padding: 4px 10px; font-weight: 600; color: var(--text);
  }
  .progress-track {
    width: 100%; height: 6px; background: var(--surface-alt); border-radius: 99px; overflow: hidden; margin-top: 4px;
  }
  .progress-fill {
    height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.3s ease;
  }
  .dash-row-click { cursor: pointer; }
  .dash-row-click:hover td { background: var(--primary-soft) !important; }

  /* BADGES */
  .badge {
    display: inline-block; padding: 2px 8px; border-radius: 99px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
  }
  .badge-success { background: var(--primary-soft); color: var(--primary); }
  .badge-warning { background: var(--amber-soft); color: var(--amber); }
  .badge-danger { background: var(--danger-soft); color: var(--danger); }
  .badge-info { background: var(--blue-soft); color: var(--blue); }
  .badge-neutral { background: var(--surface-alt); color: #475569; }

  /* FLUID TABLES (NO ELLIPSIS CUTOFF, READABLE WRAP) */
  .table-wrap { width: 100%; overflow-x: auto; }
  table.data-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
  table.data-table th {
    text-align: left; padding: 9px 10px; background: var(--surface-alt);
    color: #475569; font-weight: 600; font-size: 11.5px; border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  table.data-table td {
    padding: 9px 10px; border-bottom: 1px solid var(--border);
    vertical-align: middle; word-break: break-word;
  }
  table.data-table tbody tr:hover { background: #F8FAFC; }

  /* TOOLBAR & PAGINATION */
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
  .toolbar .search-input { flex: 1 1 160px; min-width: 0; max-width: 100%; }
  .pagination-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; font-size: 12.5px; color: var(--text-muted);
  }
  .tab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
  .tab-btn {
    padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); color: #475569; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all 0.16s ease;
  }
  .tab-btn:hover { background: var(--surface-alt); }
  .tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

  /* POS LAYOUT */
  .pos-layout { display: grid; grid-template-columns: 1fr 370px; gap: 14px; align-items: start; }
  .pos-catalog { min-width: 0; }
  .pos-products-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(132px, 40vw, 165px), 1fr)); gap: clamp(8px, 2vw, 10px);
  }
  .prod-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 11px; cursor: pointer; transition: all 0.16s ease;
    display: flex; flex-direction: column; justify-content: space-between; min-height: 108px;
  }
  .prod-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
  .prod-card.out { opacity: 0.55; }
  .prod-name { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 2px; }
  .prod-var { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
  .prod-bottom { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 6px; }
  .prod-price { font-weight: 700; color: var(--primary); font-size: 13px; }
  .prod-stock { font-size: 10.5px; color: var(--text-muted); }
  .btn-add-dos {
    margin-top: 6px; width: 100%; padding: 4px 6px; font-size: 11px; font-weight: 600;
    border: 1px dashed var(--primary); background: var(--primary-soft); color: var(--primary);
    border-radius: 6px; cursor: pointer; text-align: center;
  }
  .btn-add-dos:hover { background: var(--primary); color: #fff; }
  .unit-pill-btn {
    border: 1px solid var(--border); background: var(--surface-alt); color: var(--text);
    border-radius: 5px; padding: 2px 6px; font-size: 10.5px; font-weight: 600; cursor: pointer;
  }
  .unit-pill-btn.active-dos {
    background: var(--primary-soft); color: var(--primary); border-color: var(--primary);
  }

  .pos-cart {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; position: sticky; top: 68px; box-shadow: var(--shadow-sm);
  }
  .cart-items { max-height: 260px; overflow-y: auto; margin: 10px 0; border-top: 1px solid var(--border); }
  .cart-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 0; border-bottom: 1px solid var(--border);
  }
  .cart-qty-ctrl { display: inline-flex; align-items: center; gap: 5px; }
  .qty-btn {
    width: 25px; height: 25px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface-alt); font-weight: 700; cursor: pointer;
  }
  .cart-summary { border-top: 1px dashed var(--border); padding-top: 10px; font-size: 12.8px; }
  .sum-line { display: flex; justify-content: space-between; margin-bottom: 4px; }
  .sum-line.total { font-size: 16px; font-weight: 700; color: var(--navy); padding-top: 6px; border-top: 1px solid var(--border); margin-top: 6px; }

  /* KITCHEN KANBAN */
  .kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
  .kitchen-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 13px; box-shadow: var(--shadow-sm);
  }

  /* SVG CHART */
  .chart-wrap { width: 100%; overflow-x: auto; padding-top: 6px; }
  .chart-svg { width: 100%; min-width: 480px; height: 220px; display: block; }

  /* MODAL & TOAST */
  .modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.72);
    display: flex; align-items: center; justify-content: center;
    padding: max(10px, env(safe-area-inset-top)) clamp(8px, 3vw, 14px) max(10px, env(safe-area-inset-bottom));
    z-index: 80;
  }
  .modal-box {
    width: 100%; max-width: 540px; max-height: calc(100dvh - 20px); overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-md);
  }
  .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; background: var(--surface);
  }
  body.modal-open .mobile-nav { display: none !important; }
  .kat-combo-wrap { position: relative; }
  .kat-input-row { display: flex; align-items: stretch; gap: 6px; }
  .kat-input-row .form-control { flex: 1; min-width: 0; }
  .kat-combo-btn {
    flex-shrink: 0; min-width: 40px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface-alt); color: var(--text); font-size: 14px; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  }
  .kat-combo-btn[aria-expanded="true"] {
    border-color: var(--primary); color: var(--primary); background: var(--primary-soft);
  }
  .kat-combo-menu {
    margin-top: 6px; max-height: 185px; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--surface); border: 1px solid var(--primary); border-radius: 9px;
    box-shadow: var(--shadow-md); padding: 4px;
  }
  .kat-combo-item {
    width: 100%; min-height: 40px; padding: 8px 10px; border: none; border-radius: 7px;
    background: transparent; color: var(--text); font-size: 13px; font-weight: 600;
    text-align: left; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  }
  .kat-combo-item:hover, .kat-combo-item:active {
    background: var(--primary-soft); color: var(--primary);
  }
  .kat-combo-badge {
    font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
    background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); flex-shrink: 0;
  }
  .kat-combo-empty {
    padding: 9px 10px; font-size: 12px; color: var(--text-muted); text-align: center;
  }
  .modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

  .toast-container { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; left: 12px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 24px)); margin-left: auto; }
  .toast {
    padding: 11px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
    color: #fff; background: var(--navy); box-shadow: var(--shadow-md);
    animation: slideIn 0.2s ease;
  }
  .toast.success { background: var(--primary); }
  .toast.error { background: var(--danger); }
  .toast.warning { background: var(--amber); }
  .low-stock-alert-card {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF2F2 100%);
    border: 1px solid #F59E0B; border-left: 4px solid #D97706;
    border-radius: 10px; padding: 13px 15px; margin-bottom: 14px;
  }
  .low-stock-alert-card.has-habis { border-color: #EF4444; border-left-color: #DC2626; }
  [data-theme="dark"] .low-stock-alert-card {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.14) 0%, rgba(220, 38, 38, 0.12) 100%);
    border-color: rgba(245, 158, 11, 0.55); border-left-color: #F59E0B;
  }
  [data-theme="dark"] .low-stock-alert-card.has-habis {
    border-color: rgba(239, 68, 68, 0.6); border-left-color: #EF4444;
  }
  @keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

  /* MOBILE NAV & DRAWER */
  .mobile-nav { display: none; }
  .drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 45; }
  .mobile-drawer {
    position: fixed; right: 0; top: 0; bottom: 0; width: 270px; max-width: 82vw;
    background: var(--surface); z-index: 50; display: flex; flex-direction: column;
    box-shadow: -4px 0 20px rgba(15, 23, 42, 0.15);
  }
  .drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .drawer-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
  .drawer-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px;
    border-radius: 8px; border: none; background: transparent; color: var(--text);
    font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer;
  }
  .drawer-item.active { background: var(--primary-soft); color: var(--primary); }
  .drawer-footer { padding: 12px; border-top: 1px solid var(--border); }

  /* RECEIPT PREVIEW & THERMAL PRINT */
  .receipt-paper {
    width: 100%; max-width: 300px; margin: 0 auto; padding: 12px;
    border: 1px dashed #CBD5E1; background: #fff; font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px; color: #000;
  }
  .print-area { display: none; }

  @media (max-width: 960px) {
    .sidebar { display: none; }
    .hide-sm { display: none; }
    .page-content { padding: clamp(10px, 2.5vw, 14px) clamp(10px, 3vw, 14px) calc(74px + env(safe-area-inset-bottom)); }
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { position: static; }
    .metric-value { font-size: clamp(14.5px, 4vw, 16.5px); }
    .form-grid-2, .form-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
    table.data-table { font-size: 11.2px; }
    table.data-table th, table.data-table td { padding: 7px 6px; }
    .mobile-nav {
      display: flex; position: fixed; bottom: 0; left: 0; right: 0;
      min-height: 58px; padding-bottom: env(safe-area-inset-bottom);
      background: var(--surface); border-top: 1px solid var(--border); z-index: 35;
      justify-content: space-around; align-items: center;
    }
    .mnav-btn {
      flex: 1; height: 100%; border: none; background: transparent;
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
      font-size: 10.5px; font-weight: 600; color: var(--text-muted); cursor: pointer;
    }
    .mnav-btn.active { color: var(--primary); }
  }

  @media print {
    body * { visibility: hidden !important; }
    #printArea, #printArea * { visibility: visible !important; }
    #printArea {
      display: block !important; position: absolute; left: 0; top: 0;
      width: 58mm; padding: 2mm; margin: 0; background: #fff; color: #000;
    }
    #printArea.print-80 { width: 80mm; }
    .receipt-paper { border: none; max-width: 100%; padding: 0; font-size: 10px; }
  }
  .prod-stock.low { color: #B45309; background: rgba(245, 158, 11, 0.16); padding: 1px 6px; border-radius: 99px; font-weight: 700; }

/* --- SAAS MULTI-TENANT & SUBSCRIPTION ADDITIONS --- */
.saas-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(5, 150, 105, 0.25);
}
.saas-mode-pill.demo {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FCD34D;
}
body[data-theme="dark"] .saas-mode-pill.demo {
  background: rgba(217, 119, 6, 0.18);
  color: #FCD34D;
  border-color: rgba(217, 119, 6, 0.4);
}
.sub-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(5,150,105,0.08), rgba(16,185,129,0.03));
  margin-bottom: 14px;
}
.sub-status-banner.warning {
  background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(245,158,11,0.04));
  border-color: rgba(217,119,6,0.35);
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
  color: var(--text-muted);
  font-size: 11.5px;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .pkg-grid { grid-template-columns: 1fr; }
}
.pkg-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.pkg-card.active {
  border-color: var(--primary);
  background: rgba(5, 150, 105, 0.08);
}
.bank-jago-box {
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.09), rgba(236, 72, 153, 0.04));
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.bank-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.bank-pill {
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.bank-pill.active {
  border-color: var(--primary);
  background: rgba(5, 150, 105, 0.12);
  color: var(--primary);
}
.qris-preview-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.qris-img-frame {
  width: 156px;
  height: 156px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qris-img-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.app-update-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  width: min(540px, calc(100vw - 24px));
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}