  :root {
    --navy: #0B1F4B;
    --orange: #FF5C00;
    --orange-light: rgba(255,92,0,0.1);
    --bg: #F0F2F7;
    --card: #FFFFFF;
    --text: #1A1A2E;
    --muted: #64748B;
    --border: #E2E8F0;
    --green: #16A34A;
    --red: #DC2626;
    --yellow: #D97706;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
  body { background: var(--bg); color: var(--text); min-height: 100vh; }

  /* AUTH */
  #auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--navy); }
  .auth-card { background: white; border-radius: 20px; padding: 40px; width: 380px; text-align: center; }
  .auth-logo-img { height: 40px; margin: 0 auto 12px; display: block; }
  .auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
  .auth-input { width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; outline: none; margin-bottom: 12px; transition: border-color 0.2s; }
  .auth-input:focus { border-color: var(--orange); }
  .auth-btn { width: 100%; padding: 14px; background: var(--orange); color: white; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity 0.2s; }
  .auth-btn:hover { opacity: 0.9; }
  .auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .auth-error { color: var(--red); font-size: 13px; margin-top: 8px; }

  /* LAYOUT */
  #app { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; background: var(--navy); padding: 24px 0 0; z-index: 100; display: flex; flex-direction: column; }
  .sidebar-logo { padding: 0 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); flex-shrink: 0; }
  .sidebar-logo-img { height: 26px; display: block; }
  .sidebar-logo-sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 6px; }
  #nav-items { flex: 1 1 auto; overflow-y: auto; padding-bottom: 8px; }
  .nav-section { padding: 16px 12px 8px; font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3); letter-spacing: 1.5px; }
  .nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,0.6); cursor: pointer; border-radius: 8px; margin: 2px 8px; transition: all 0.2s; font-size: 14px; font-weight: 500; }
  .nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
  .nav-item.active { background: var(--orange); color: white; }
  .nav-icon { font-size: 18px; width: 24px; text-align: center; }
  .nav-footer { flex-shrink: 0; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
  .nav-user { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 8px; }
  .nav-user b { color: white; display: block; font-size: 13px; }
  .main { margin-left: 240px; padding: 24px; min-height: 100vh; }
  .topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
  .page-title { font-size: 22px; font-weight: 800; color: var(--navy); }
  .topbar-right { display: flex; align-items: center; gap: 12px; }
  .refresh-btn { padding: 8px 16px; background: white; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
  .refresh-btn:hover { border-color: var(--orange); color: var(--orange); }
  .logout-btn { padding: 8px 16px; background: var(--navy); color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
  .last-updated { font-size: 12px; color: var(--muted); }

  /* CARDS */
  .kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
  .kpi-card { background: var(--card); border-radius: 14px; padding: 20px; border: 1px solid var(--border); }
  .kpi-icon { font-size: 28px; margin-bottom: 12px; }
  .kpi-value { font-size: 28px; font-weight: 800; color: var(--navy); }
  .kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

  /* GRID */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
  .card { background: var(--card); border-radius: 14px; padding: 20px; border: 1px solid var(--border); }
  .card-title { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
  .card-title .badge { font-size: 11px; background: var(--orange-light); color: var(--orange); padding: 2px 8px; border-radius: 20px; font-weight: 700; }

  /* TABLE */
  .table-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); letter-spacing: 0.5px; }
  td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: #F8F9FF; }

  /* STATUS BADGES */
  .badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
  .badge-green { background: #DCFCE7; color: #16A34A; }
  .badge-orange { background: #FEF3C7; color: #D97706; }
  .badge-red { background: #FEE2E2; color: #DC2626; }
  .badge-blue { background: #DBEAFE; color: #2563EB; }
  .badge-gray { background: #F1F5F9; color: #64748B; }
  .badge-navy { background: #EFF6FF; color: #0B1F4B; }

  /* STAT ROW */
  .stat-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .stat-row:last-child { border-bottom: none; }
  .stat-label { font-size: 13px; color: var(--muted); }
  .stat-value { font-size: 14px; font-weight: 700; color: var(--navy); }

  /* FILTERS */
  .filter-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
  .filter-select { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; background: white; cursor: pointer; outline: none; }
  .filter-select:focus { border-color: var(--orange); }
  .search-input { padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; min-width: 200px; }
  .search-input:focus { border-color: var(--orange); }

  /* BUTTONS */
  .btn { padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; border: none; }
  .btn-approve { background: #DCFCE7; color: #16A34A; }
  .btn-approve:hover { background: #16A34A; color: white; }
  .btn-reject { background: #FEE2E2; color: #DC2626; }
  .btn-reject:hover { background: #DC2626; color: white; }
  .btn-ghost { background: white; border: 1.5px solid var(--border); color: var(--muted); }
  .btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
  .btn-primary { background: var(--orange); color: white; }
  .btn-primary:hover { opacity: 0.9; }
  .btn-sm { padding: 5px 10px; font-size: 11px; }
  .doc-thumb { display: inline-block; width: 70px; height: 70px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; margin: 4px; background: #F1F5F9; }
  .doc-grid { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
  .doc-label { font-size: 10px; color: var(--muted); text-align: center; display: block; width: 70px; margin: 2px 4px; }

  /* LOADING */
  .loading { text-align: center; padding: 40px; color: var(--muted); }
  .spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .empty-state { text-align: center; padding: 40px; color: var(--muted); }
  .no-access { text-align: center; padding: 60px 20px; color: var(--muted); }

  /* CHART CONTAINER */
  .chart-container { position: relative; height: 200px; }

  /* FUNNEL */
  .funnel-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .funnel-step:last-child { border-bottom: none; }
  .funnel-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
  .funnel-fill { height: 100%; background: var(--orange); border-radius: 4px; transition: width 0.8s ease; }
  .funnel-label { font-size: 12px; color: var(--muted); width: 140px; }
  .funnel-count { font-size: 13px; font-weight: 700; color: var(--navy); width: 50px; text-align: right; }

  /* MODAL */
  .modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(11,31,75,0.5); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
  .modal-backdrop.active { display: flex; }
  .modal { background: white; border-radius: 16px; padding: 28px; width: 100%; max-width: 600px; max-height: 85vh; overflow-y: auto; }
  .modal-title { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
  .modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
  .modal-close { float: right; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
  textarea.auth-input { resize: vertical; min-height: 70px; font-family: inherit; }

  /* PAGE VISIBILITY */
  .page { display: none; }
  .page.active { display: block; }

  @media (max-width: 1024px) {
    .sidebar { width: 200px; }
    .main { margin-left: 200px; }
    .grid-2 { grid-template-columns: 1fr; }
  }
