/* ============================================================
   MASTER STYLESHEET (COMPILED FULL CSS DARI INDEX.HTML)
   ============================================================ */


  :root{
    --navy-950:#0A1428; --navy-900:#0D1C38; --navy-800:#152A4E; --navy-700:#1E3A63;
    --blue-600:#2F6FED; --blue-500:#4C85F5; --blue-100:#E8F0FE;
    --bg:#F3F5FA; --card:#FFFFFF; --text-900:#0F1B2D; --text-600:#4A5568; --text-400:#8A94A6;
    --border:#E6E9F0;
    --green-600:#0FA968; --green-100:#DDF7EA;
    --amber-600:#E08A00; --amber-100:#FDF0D5;
    --red-600:#E4483A; --red-100:#FCE4E1;
    --radius:16px; --shadow: 0 1px 2px rgba(15,27,45,.04), 0 8px 24px rgba(15,27,45,.06);
    font-family: -apple-system, "Segoe UI", "Plus Jakarta Sans", Arial, sans-serif;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;background:var(--bg);color:var(--text-900);}
  body{display:flex;min-height:100vh;}
  a{color:inherit;text-decoration:none;}
  .modal-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(10,20,40,.65);z-index:99999;align-items:center;justify-content:center;backdrop-filter:blur(4px);display:none;}

  .sidebar{width:250px;flex:0 0 250px;background:linear-gradient(185deg,var(--navy-950),var(--navy-800) 130%);color:#fff;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;}
  .brand{padding:22px 20px 14px;display:flex;align-items:center;gap:10px;border-bottom:1px solid rgba(255,255,255,.08);}
  .brand-mark{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--blue-500),var(--blue-600));display:flex;align-items:center;justify-content:center;font-weight:800;font-size:15px;}
  .brand-name{font-weight:700;font-size:15px;line-height:1.2;}
  .brand-sub{font-size:10.5px;color:rgba(255,255,255,.5);letter-spacing:.06em;text-transform:uppercase;margin-top:1px;}
  .nav-scroll{flex:1;overflow-y:auto;padding:14px 12px 10px;}
  .nav-group-label{font-size:10.5px;letter-spacing:.09em;color:rgba(255,255,255,.35);text-transform:uppercase;padding:14px 10px 6px;}
  .nav-item{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:10px;color:rgba(255,255,255,.72);font-size:13.5px;font-weight:500;cursor:pointer;margin-bottom:2px;transition:.15s;}
  .nav-item .ic{width:18px;height:18px;flex:0 0 18px;display:flex;align-items:center;justify-content:center;}
  .nav-item:hover{background:rgba(255,255,255,.06);color:#fff;}
  .nav-item.active{background:var(--blue-600);color:#fff;box-shadow:0 4px 14px rgba(47,111,237,.4);}
  .nav-badge{margin-left:auto;font-size:9.5px;font-weight:700;background:rgba(255,255,255,.14);padding:2px 6px;border-radius:20px;}
  .sidebar-footer{padding:14px;border-top:1px solid rgba(255,255,255,.08);}
  .user-chip{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:10px;background:rgba(255,255,255,.05);margin-bottom:8px;}
  .avatar-sm{width:30px;height:30px;border-radius:9px;background:var(--blue-600);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;flex:0 0 30px;}
  .user-name{font-size:12.5px;font-weight:600;}
  .user-role{font-size:10.5px;color:rgba(255,255,255,.45);}
  .logout{display:flex;align-items:center;justify-content:center;gap:6px;font-size:12.5px;color:rgba(255,255,255,.55);padding:8px;border-radius:9px;cursor:pointer;}
  .logout:hover{background:rgba(255,255,255,.06);color:#fff;}

  .main{flex:1;min-width:0;padding:26px 30px 60px;}
  .page{display:none;}
  .page.active{display:block;animation:fade .25s ease;}
  @keyframes fade{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:none;}}

  .topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px;flex-wrap:wrap;}
  .topbar-title{display:flex;gap:14px;align-items:flex-start;}
  .title-ic{width:44px;height:44px;border-radius:13px;background:var(--blue-100);color:var(--blue-600);display:flex;align-items:center;justify-content:center;flex:0 0 44px;}
  .topbar h1{font-size:21px;margin:0 0 3px;font-weight:800;}
  .topbar p{margin:0;font-size:13px;color:var(--text-600);max-width:520px;line-height:1.5;}
  .selects{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
  select, .btn-select{appearance:none;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:9px 32px 9px 13px;font-size:12.5px;font-weight:600;color:var(--text-900);cursor:pointer;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%234A5568'/></svg>");background-repeat:no-repeat;background-position:right 12px center;box-shadow:var(--shadow);}
  .mode-toggle{display:flex;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:3px;box-shadow:var(--shadow);}
  .mode-toggle button{border:none;background:transparent;padding:7px 14px;font-size:12.5px;font-weight:700;border-radius:8px;color:var(--text-600);cursor:pointer;}
  .mode-toggle button.active{background:var(--navy-900);color:#fff;}

  .btn{border:none;border-radius:10px;padding:9px 15px;font-size:12.5px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;gap:6px;}
  .btn-primary{background:var(--blue-600);color:#fff;}
  .btn-primary:hover{background:#255ede;}
  .btn-ghost{background:var(--blue-100);color:var(--blue-600);}
  .btn-ghost:hover{background:#dbe8fe;}
  .btn-danger{background:var(--red-100);color:var(--red-600);}
  .btn-danger:hover{background:#fbd4d0;}
  .btn-outline{background:var(--card);color:var(--text-600);border:1px solid var(--border);}
  .btn-outline:hover{border-color:var(--blue-500);color:var(--blue-600);}
  .btn-sm{padding:6px 10px;font-size:11.5px;border-radius:8px;}

  .stats-row{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px;}
  .stat-card{background:var(--card);border-radius:var(--radius);padding:18px 18px 16px;box-shadow:var(--shadow);border:1px solid var(--border);}
  .stat-top{display:flex;align-items:center;gap:9px;margin-bottom:12px;}
  .stat-ic{width:30px;height:30px;border-radius:9px;display:flex;align-items:center;justify-content:center;flex:0 0 30px;}
  .stat-label{font-size:11.5px;color:var(--text-400);font-weight:700;letter-spacing:.03em;text-transform:uppercase;}
  .stat-value{font-size:26px;font-weight:800;letter-spacing:-.01em;}
  .stat-sub{font-size:11.5px;color:var(--text-400);margin-top:3px;}
  .ic-blue{background:var(--blue-100);color:var(--blue-600);}
  .ic-green{background:var(--green-100);color:var(--green-600);}
  .ic-amber{background:var(--amber-100);color:var(--amber-600);}
  .ic-red{background:var(--red-100);color:var(--red-600);}

  .wf-row{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:22px;}
  .wf-card{background:var(--card);border-radius:14px;padding:16px;border:1px solid var(--border);box-shadow:var(--shadow);cursor:pointer;transition:.15s;}
  .wf-card:hover{transform:translateY(-2px);border-color:var(--blue-500);}
  .wf-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;}
  .wf-eyebrow{font-size:9.5px;font-weight:800;letter-spacing:.07em;color:var(--text-400);text-transform:uppercase;}
  .wf-open{font-size:9.5px;font-weight:800;color:var(--blue-600);letter-spacing:.05em;}
  .wf-title{font-size:14px;font-weight:700;margin-bottom:4px;}
  .wf-desc{font-size:11.5px;color:var(--text-600);line-height:1.5;}

  .panel{background:var(--card);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);padding:20px 20px 8px;margin-bottom:20px;}
  .panel-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:14px;flex-wrap:wrap;gap:10px;}
  .panel-head h2{font-size:15.5px;margin:0 0 3px;font-weight:800;}
  .panel-head p{margin:0;font-size:12px;color:var(--text-600);}
  .link-btn{font-size:12px;font-weight:700;color:var(--blue-600);background:var(--blue-100);padding:8px 14px;border-radius:9px;cursor:pointer;white-space:nowrap;}
  .link-btn:hover{background:#dbe8fe;}

  .two-col{display:grid;grid-template-columns:1.3fr 1fr;gap:18px;}
  @media (max-width:1180px){ .two-col{grid-template-columns:1fr;} .stats-row{grid-template-columns:repeat(2,1fr);} .wf-row{grid-template-columns:repeat(2,1fr);} }

  table{width:100%;border-collapse:collapse;font-size:12.5px;table-layout:auto;}
  thead th{text-align:left;font-size:10.5px;letter-spacing:.05em;text-transform:uppercase;color:var(--text-400);font-weight:800;padding:10px 12px;border-bottom:1px solid var(--border);white-space:normal;overflow-wrap:anywhere;}
  tbody td{padding:10px 12px;border-bottom:1px solid var(--border);vertical-align:middle;white-space:normal;overflow-wrap:anywhere;word-break:break-word;}
  tbody tr:last-child td{border-bottom:none;}
  tbody tr:hover{background:#FAFBFF;}
  .person{display:flex;align-items:center;gap:9px;}
  .initials{width:30px;height:30px;border-radius:9px;background:var(--navy-800);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:0 0 30px;}
  .p-name{font-weight:700;font-size:12.5px;}
  .p-role{font-size:11px;color:var(--text-400);}
  .kpi-name{font-weight:600;}
  .kpi-account{font-size:11px;color:var(--text-400);}
  .badge{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;padding:4px 10px;border-radius:20px;white-space:nowrap;}
  .badge.ok{background:var(--green-100);color:var(--green-600);}
  .badge.warn{background:var(--amber-100);color:var(--amber-600);}
  .badge.bad{background:var(--red-100);color:var(--red-600);}
  .badge.muted{background:#EEF1F6;color:var(--text-400);}
  .badge-dot{width:6px;height:6px;border-radius:50%;background:currentColor;}
  .prog-wrap{display:flex;align-items:center;gap:8px;min-width:110px;}
  .prog-bar{flex:1;height:7px;border-radius:20px;background:#EEF1F6;overflow:hidden;}
  .prog-fill{height:100%;border-radius:20px;}
  .prog-pct{font-size:12px;font-weight:800;width:42px;text-align:right;}

  .chip{font-size:11px;font-weight:700;padding:3px 9px;border-radius:8px;background:var(--blue-100);color:var(--blue-600);}
  .footer-note{font-size:11px;color:var(--text-400);text-align:center;padding:18px 0 4px;}

  /* editable inputs inside tables */
  .cell-input{width:76px;padding:6px 7px;border:1px solid var(--border);border-radius:7px;font-size:12px;font-weight:600;color:var(--text-900);background:#FAFBFF;}
  .cell-input:focus{outline:none;border-color:var(--blue-500);background:#fff;}
  .cell-input.wide{width:96px;}
  .cell-input.narrow{width:85px;}
  .assign-kpi-table{min-width:1200px;table-layout:fixed;border-collapse:separate;border-spacing:0;}
  .assign-kpi-table thead th,.assign-kpi-table tbody td{white-space:normal;word-break:break-word;overflow-wrap:anywhere;vertical-align:top;}
  .assign-kpi-table thead th:nth-child(1), .assign-kpi-table tbody td:nth-child(1){width:240px;min-width:240px;}
  .assign-kpi-table thead th:nth-child(2), .assign-kpi-table tbody td:nth-child(2){width:90px;min-width:90px;}
  .assign-kpi-table thead th:nth-child(3), .assign-kpi-table tbody td:nth-child(3){width:120px;min-width:120px;}
  .assign-kpi-table thead th:nth-child(4), .assign-kpi-table tbody td:nth-child(4){width:120px;min-width:120px;}
  .assign-kpi-table thead th:nth-child(5), .assign-kpi-table tbody td:nth-child(5){width:100px;min-width:100px;}
  .assign-kpi-table thead th:nth-child(n+6):nth-child(-n+10), .assign-kpi-table tbody td:nth-child(n+6):nth-child(-n+10){width:110px;min-width:110px;}
  .assign-kpi-table thead th:nth-child(11), .assign-kpi-table tbody td:nth-child(11){width:120px;min-width:120px;}
  .assign-kpi-table .cell-input.wide{width:100%;min-width:120px;max-width:180px;}
  .assign-kpi-table .cell-input.narrow{width:100%;min-width:76px;}
  .assign-kpi-table .cell-input{width:100%;min-width:76px;}
  select.cell-input{width:auto;padding-right:24px;}
  .w-group{display:flex;flex-direction:column;gap:3px;}
  .w-group .wlab{font-size:9px;color:var(--text-400);font-weight:700;text-transform:uppercase;}
  .empty-flag{font-size:9.5px;color:var(--amber-600);font-weight:700;}

  /* CRUD forms */
  .toolbar{display:flex;gap:8px;flex-wrap:wrap;}
  .add-form{background:#FAFBFF;border:1px dashed var(--blue-500);border-radius:12px;padding:14px 16px;margin:6px 0 16px;display:none;}
  .add-form.show{display:block;}
  .add-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin-bottom:10px;}
  .field{display:flex;flex-direction:column;gap:4px;}
  .field label{font-size:10.5px;font-weight:700;color:var(--text-600);}
  .field input, .field select{padding:8px 10px;border:1px solid var(--border);border-radius:8px;font-size:12.5px;background:#fff;}
  .member-block{border:1px solid var(--border);border-radius:14px;margin-bottom:14px;overflow:hidden;}
  .member-block-head{display:flex;justify-content:space-between;align-items:center;padding:13px 16px;background:#FAFBFF;border-bottom:1px solid var(--border);}
  .member-block-body{padding:6px 16px 14px;}

  .role-group{margin-bottom:24px;}
  .role-group-title{font-size:12.5px;font-weight:800;color:var(--text-600);text-transform:uppercase;letter-spacing:.04em;padding:2px 2px 10px;border-bottom:2px solid var(--border);margin-bottom:12px;display:flex;align-items:center;gap:8px;}
  .field textarea{padding:8px 10px;border:1px solid var(--border);border-radius:8px;font-size:12.5px;background:#fff;font-family:inherit;resize:vertical;min-height:56px;}
  .status-pill{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:700;padding:3px 9px;border-radius:20px;white-space:nowrap;}
  .status-pill.ok{background:var(--green-100);color:var(--green-600);}
  .status-pill.bad{background:var(--red-100);color:var(--red-600);}
  .status-pill.muted{background:#EEF1F6;color:var(--text-400);}

  .rank-cards{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px;}
  .rank-card{background:var(--card);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);padding:16px 18px;}
  .rank-card h3{font-size:13px;margin:0 0 12px;font-weight:800;display:flex;align-items:center;gap:7px;}
  .rank-list{display:flex;flex-direction:column;gap:10px;}
  .rank-row{display:flex;align-items:center;gap:10px;}
  .rank-num{width:22px;height:22px;border-radius:7px;background:#F0F2F7;color:var(--text-600);font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;flex:0 0 22px;}
  .rank-info{flex:1;min-width:0;}
  .rank-pct{font-size:14px;font-weight:800;}

  .legend-row{display:flex;gap:16px;font-size:11.5px;color:var(--text-600);margin-top:6px;flex-wrap:wrap;}
  .legend-item{display:flex;align-items:center;gap:6px;}
  .legend-dot{width:9px;height:9px;border-radius:50%;}

  .week-pill-row{display:flex;gap:6px;flex-wrap:wrap;}
  .week-pill{font-size:11px;font-weight:700;padding:6px 11px;border-radius:9px;border:1px solid var(--border);background:var(--card);cursor:pointer;color:var(--text-600);}
  .week-pill.active{background:var(--navy-900);color:#fff;border-color:var(--navy-900);}

  ::-webkit-scrollbar{width:8px;height:8px;}
  ::-webkit-scrollbar-thumb{background:#D3D9E3;border-radius:20px;}

  @media (max-width:820px){
    body{flex-direction:column;}
    .sidebar{width:100%;flex:none;height:auto;position:relative;flex-direction:row;overflow-x:auto;}
    .nav-scroll{display:flex;padding:10px;}
    .nav-group-label{display:none;}
    .nav-item{white-space:nowrap;}
    .sidebar-footer{display:none;}
    .main{padding:18px;}
    .stats-row{grid-template-columns:1fr 1fr;}
    .wf-row{grid-template-columns:1fr 1fr;}
    .rank-cards{grid-template-columns:1fr;}
  }

  /* TIMELINE & OVERVIEW CSS */
  .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; width: 100%; box-sizing: border-box; border: 1px solid #EEF1F6; border-radius: 8px; overflow: hidden; background:#F8FAFC; }
  .cal-head { text-align: center; padding: 12px; font-weight: 600; color: #64748b; background: #fff; font-size:14px; border-bottom: 1px solid #EEF1F6; }
  .cal-cell { background: #fff; min-height: 120px; height: 100%; padding: 6px; display: flex; flex-direction: column; gap: 4px; border: 1px solid #F1F5F9; box-sizing: border-box; overflow: visible; min-width: 0; }
  .cal-daynum { font-size: 12px; color: #94a3b8; font-weight: 600; margin-bottom: 4px; text-align:right; }
  .cal-chip { font-size: 11px; padding: 4px 6px; border-radius: 4px; color: #fff; cursor: pointer; width: 100%; box-sizing: border-box; white-space: normal; word-break: break-word; overflow-wrap: anywhere; }

  /* TIMELINE VERTICAL (MEMANJANG KE BAWAH) */
  .tl-vertical-feed { display: flex; flex-direction: column; gap: 10px; width: 100%; }
  .tl-day-row { display: flex; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); transition: all 0.2s ease; overflow: hidden; }
  .tl-day-row:hover { border-color: #cbd5e1; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
  .tl-day-row.is-today { border: 2px solid #3b82f6; background: #f8faff; }
  .tl-day-left { width: 135px; min-width: 135px; background: #f8fafc; border-right: 1px solid #e2e8f0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 3px; }
  .tl-day-row.is-today .tl-day-left { background: #eff6ff; border-right-color: #bfdbfe; }
  .tl-day-num { font-size: 24px; font-weight: 800; line-height: 1; color: #1e293b; }
  .tl-day-row.is-today .tl-day-num { color: #2563eb; }
  .tl-day-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; }
  .tl-day-date-str { font-size: 11px; color: #94a3b8; white-space: nowrap; }
  .tl-badge-today { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: #2563eb; color: #ffffff; margin-top: 4px; text-transform: uppercase; }
  .tl-badge-cnt { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: #e2e8f0; color: #475569; margin-top: auto; }
  .tl-badge-cnt.active { background: #dbeafe; color: #1d4ed8; }
  .tl-day-content { flex: 1; min-width: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
  .tl-day-row.is-empty { opacity: 0.82; }
  .tl-day-row.is-empty .tl-day-left { padding: 8px 14px; }
  .tl-day-row.is-empty .tl-day-num { font-size: 18px; color: #94a3b8; }
  .tl-day-row.is-empty .tl-day-content { padding: 8px 14px; min-height: auto; }
  .tl-empty-text { font-size: 12px; color: #94a3b8; font-style: italic; }
  .tl-card-item { display: flex; align-items: center; justify-content: space-between; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 9px 12px; gap: 12px; cursor: pointer; transition: all 0.15s ease; position: relative; overflow: hidden; }
  .tl-card-item:hover { transform: translateX(3px); border-color: #94a3b8; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
  .tl-card-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
  .tl-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-left: 6px; }
  .tl-card-title { font-size: 13.5px; font-weight: 600; color: #0f172a; line-height: 1.35; word-break: break-word; }
  .tl-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .tl-tag { display: inline-flex; align-items: center; font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #f1f5f9; color: #475569; font-weight: 500; }
  .tl-status-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
  .tl-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
  @media (max-width: 768px) {
    .tl-day-row { flex-direction: column; }
    .tl-day-left { width: 100%; min-width: 100%; flex-direction: row; align-items: center; border-right: none; border-bottom: 1px solid #e2e8f0; gap: 10px; }
    .tl-badge-cnt { margin-top: 0; margin-left: auto; }
    .tl-card-item { flex-direction: column; align-items: flex-start; }
  }
  .ai-panel { background: linear-gradient(135deg, #f8fafc, #f1f5f9); border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-bottom: 24px; display: flex; gap: 16px; align-items:flex-start; }
  .ai-panel .ai-icon { font-size: 24px; }
  .ai-panel .ai-text { color: #334155; font-size: 14px; line-height: 1.5; }
  .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
  .kpi-card { background: #fff; border: 1px solid #EEF1F6; border-radius: 12px; padding: 16px; }
  .kpi-card .k-label { font-size: 13px; color: #64748b; margin-bottom: 8px; font-weight:600; }
  .kpi-card .k-val { font-size: 24px; font-weight: bold; color: #0f172a; margin-bottom: 4px; }
  .kpi-card .k-sub { font-size: 12px; color: #94a3b8; }

  
    /* ACCORDION FIXES */
    .nav-group-label.accordion-label {
        display: flex;
        align-items: center;
        cursor: pointer;
    }
    .nav-group-content {
        display: block;
    }
    @media (max-width:1180px) {
        .nav-group-label.accordion-label { display: none !important; }
        .nav-group-content { display: flex !important; flex-direction: row; }
    }
    
    /* BUDGET TAB CSS */
    .g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .sc { background: var(--bg-surface); padding: 16px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
    .sl { font-size: 11px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; }
    .sv { font-size: 24px; font-weight: 900; color: var(--text-primary); }
    .sv.b { color: var(--brand); }
    .sv.a { color: #f59e0b; }
    .sv.g { color: #10b981; }
    .sd { font-size: 10px; color: var(--text-secondary); margin-top: 4px; }
    .bitem { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-color); position: relative; }
    .bcat { font-size: 10px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; }
    .bnm { font-size: 14px; font-weight: 800; color: var(--text-primary); cursor: pointer; }
    .bnm:hover { text-decoration: underline; color: var(--brand); }
    .bnt { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
    .pg { height: 8px; background: rgba(0,0,0,0.05); border-radius: 4px; overflow: hidden; }
    .pgf { height: 100%; border-radius: 4px; transition: width 0.3s; }
    .pgf.g { background: #10b981; }
    .bst { font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 4px; }
    .bamt { font-size: 16px; font-weight: 800; color: var(--text-primary); }
    .ibtn { background: none; border: none; cursor: pointer; color: #ef4444; font-size: 14px; padding: 4px; }
    @media (max-width: 768px) {
      .g3 { grid-template-columns: 1fr; }
    }
    .bud-step-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    }
    @media (max-width: 992px) {
      .bud-pipeline-grid { grid-template-columns: repeat(2, 1fr) !important; }
    }
    @media (max-width: 600px) {
      .bud-pipeline-grid { grid-template-columns: 1fr !important; }
    }
    


  body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
  }
  .sidebar {
    display: none !important;
  }
  .main {
    width: 100% !important;
    flex: 1 !important;
    padding: 20px 32px 32px !important;
    box-sizing: border-box !important;
  }
  @media (max-width: 820px) {
    .main {
      padding: 16px !important;
    }
  }
  /* Dropdown hover & focus behavior */
  .has-dropdown {
    position: relative;
  }
  .has-dropdown .dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 10000;
  }
  /* Invisible hover bridge to eliminate gap between button and dropdown */
  .has-dropdown .dropdown-panel::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -15px;
    right: -15px;
    height: 16px;
    background: transparent;
  }
  .has-dropdown:hover .dropdown-panel,
  .has-dropdown.open .dropdown-panel,
  .has-dropdown:focus-within .dropdown-panel {
    display: block;
  }
  .has-dropdown:hover > .v3-btn,
  .has-dropdown.open > .v3-btn {
    background: #1E293B;
    color: #FFFFFF;
    border-color: #334155;
  }
  .has-dropdown:hover > .v3-btn svg,
  .has-dropdown.open > .v3-btn svg {
    transform: rotate(180deg);
    opacity: 1;
  }
  .has-dropdown > .v3-btn svg {
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  /* Floating Island Navbar (Ref 3 Solid High-Contrast) */
  .v3-wrap {
    position: sticky;
    top: 10px;
    z-index: 9990;
    padding: 0 16px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .top-navbar-v3 {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    background: #0B132B;
    border: 1px solid #1E293B;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    box-sizing: border-box;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .v3-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }
  .v3-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #F1F5F9;
    cursor: pointer;
    transition: 0.15s;
    border: 1px solid transparent;
    background: #111C38;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .v3-btn:hover {
    background: #1E293B;
    color: #FFFFFF;
    border-color: #334155;
  }
  .v3-btn.active, .v3-btn.child-active {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #3B82F6;
  }
  .v3-dropdown {
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 6px;
    min-width: 210px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.45);
  }
  .v3-dropdown .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #E2E8F0;
    cursor: pointer;
    margin-bottom: 2px;
    transition: 0.12s;
  }
  .v3-dropdown .nav-item:hover {
    background: #1E293B;
    color: #FFFFFF;
  }
  .v3-dropdown .nav-item.active {
    background: #2563EB;
    color: #FFFFFF;
  }
  .user-chip, .user-chip * {
    white-space: nowrap !important;
  }
  .logout {
    white-space: nowrap !important;
  }
  @media (max-width: 1200px) {
    .v3-wrap { padding: 0 10px; top: 6px; }
    .top-navbar-v3 { padding: 0 10px; gap: 6px; }
    .v3-links { gap: 3px; }
    .v3-btn { padding: 5px 8px; font-size: 11.5px; }
    .brand-name { font-size: 12px !important; }
  }
  @media (max-width: 1040px) {
    .v3-wrap { padding: 0 8px; top: 6px; }
    .top-navbar-v3 { height: auto; min-height: 54px; padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
    .v3-links { overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
    .v3-links::-webkit-scrollbar { display: none; }
  }

  /* ============================================================
     GCI RECONCILIATION STYLES
     ============================================================ */
  .gci-dropzone {
    background: #FAFBFF;
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 16px 18px;
    position: relative;
    transition: all 0.15s ease;
    cursor: pointer;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .gci-dropzone:hover {
    border-color: var(--blue-500, #3B82F6);
    background: #F0F4FF;
  }
  .gci-dropzone.has-file {
    border-style: solid;
    border-color: var(--blue-600, #2563EB);
    background: #EFF6FF;
  }
  .gci-dropzone.drag {
    border-color: var(--blue-600, #2563EB);
    background: #DBEAFE;
  }
  .gci-dropzone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 3;
  }
  .gci-dropzone .gci-drop-label,
  .gci-dropzone .hint,
  .gci-dropzone .filename {
    pointer-events: none;
    position: relative;
    z-index: 1;
  }
  .gci-dropzone button,
  .gci-dropzone #btnUseInternalLeads {
    position: relative;
    z-index: 10 !important;
    pointer-events: auto !important;
  }
  .gci-drop-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-900, #0F1B2D);
    margin-bottom: 4px;
  }
  .gci-drop-tag {
    font-size: 10px;
    font-weight: 800;
    background: #E2E8F0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
  }
  .gci-dropzone .hint {
    margin: 0;
    font-size: 11.5px;
    color: var(--text-400, #8A94A6);
  }
  .gci-dropzone .filename {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--blue-600, #2563EB);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gci-bar-track {
    background: #EEF2F6;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
  }
  .gci-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #2563EB);
    border-radius: 6px;
    transition: width 0.3s ease;
  }
  .gci-status-row {
    display: grid;
    grid-template-columns: 140px 1fr 50px;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
  }
  .gci-status-row .s-name {
    font-weight: 700;
    color: var(--text-900, #0F1B2D);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gci-status-row .s-count {
    font-weight: 700;
    text-align: right;
    color: var(--text-600, #4A5568);
  }
  .filter-chip {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #E2E8F0;
    background: #FFF;
    color: #64748B;
    transition: all 0.15s ease;
    user-select: none;
  }
  .filter-chip:hover {
    border-color: #94A3B8;
    color: #1E293B;
  }
  .filter-chip.active {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFF;
  }
  @media (max-width: 900px) {
    .gci-upload-grid {
      grid-template-columns: 1fr !important;
    }
  }

  @keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
