@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  --bg:#0b1120; --surface:#1e293b; --surface-2:#0f172a;
  --border:#1f2b3f; --ink:#e2e8f0; --muted:#94a3b8; --muted-2:#64748b;
  --accent:#f59e0b; --accent-ink:#0b1120;
  --blue:#3b82f6; --emerald:#10b981; --amber:#f59e0b; --slate:#64748b; --red:#ef4444;
}
*{box-sizing:border-box;}
html,body{height:100%;}
body{margin:0; background:var(--bg); color:var(--ink); font-family:'Inter',system-ui,sans-serif; line-height:1.5;}
code,.mono{font-family:'IBM Plex Mono',ui-monospace,monospace;}
a{color:var(--accent);}
::selection{background:rgba(245,158,11,.25);}

.shell{display:flex; min-height:100vh;}
.side{width:64px; flex-shrink:0; background:var(--surface-2); border-right:1px solid var(--border);
  display:flex; flex-direction:column; align-items:center; padding:16px 0; gap:20px;}
.side .logo{width:34px; height:34px; border-radius:9px; background:var(--accent); color:var(--accent-ink);
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px;}
.side nav{display:flex; flex-direction:column; gap:10px;}
.side nav a{width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  color:var(--muted); text-decoration:none; font-size:16px; border:1px solid transparent;}
.side nav a.active{background:rgba(245,158,11,.1); color:var(--accent); border-color:rgba(245,158,11,.3);}
.side nav a:hover{background:#1e293b; color:var(--ink);}

main{flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{background:var(--surface-2); border-bottom:1px solid var(--border); padding:12px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;}
.topbar h1{font-size:16px; font-weight:700; color:#fff; margin:0;}
.topbar .sub{font-size:11px; color:var(--muted-2); display:flex; align-items:center; gap:5px; margin-top:2px;}
.userchip{display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--muted);}
.userchip img{width:24px; height:24px; border-radius:50%;}
.userchip a{color:var(--muted-2); font-size:12px;}

.filters{background:rgba(30,41,59,.5); border-bottom:1px solid var(--border); padding:14px 24px;
  display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:14px;}
.filters form{display:contents;}
.field{display:flex; flex-direction:column; gap:4px;}
.field label{font-size:10px; font-weight:700; color:var(--muted-2); text-transform:uppercase; letter-spacing:.04em;}
.field select,.field input{background:var(--surface-2); border:1px solid var(--border); border-radius:8px;
  padding:7px 9px; font-size:12.5px; color:var(--ink);}
.field select:focus,.field input:focus{outline:none; border-color:var(--accent);}

.tabs{display:flex; gap:4px; padding:0 24px; border-bottom:1px solid var(--border); background:var(--surface-2);}
.tabs a{padding:10px 14px; font-size:12.5px; font-weight:600; color:var(--muted); text-decoration:none; border-bottom:2px solid transparent;}
.tabs a.active{color:var(--accent); border-color:var(--accent);}

.content{flex:1; overflow-y:auto; padding:24px; display:flex; flex-direction:column; gap:24px;}

.kpi-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px;}
.kpi{background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:16px; position:relative;}
.kpi .label{font-size:11.5px; color:var(--muted); font-weight:600; margin-bottom:4px;}
.kpi .value{font-size:28px; font-weight:800; color:#fff;}
.kpi .value.blue{color:var(--blue);} .kpi .value.emerald{color:var(--emerald);} .kpi .value.amber{color:var(--amber);}
.kpi .bar{width:100%; height:5px; background:var(--surface-2); border-radius:4px; margin-top:10px; overflow:hidden;}
.kpi .bar > div{height:100%; background:var(--blue); border-radius:4px;}

.card{background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:18px;}
.card h3{font-size:13.5px; font-weight:700; color:#fff; margin:0 0 14px;}

.charts-row{display:grid; grid-template-columns:2fr 1fr; gap:16px;}
@media (max-width:900px){.charts-row{grid-template-columns:1fr;}}

.hbar-row{display:flex; align-items:center; gap:10px; margin-bottom:10px; font-size:12px;}
.hbar-row .name{width:130px; flex-shrink:0; color:var(--muted); text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.hbar-row .track{flex:1; background:var(--surface-2); border-radius:5px; height:16px; position:relative; overflow:hidden;}
.hbar-row .fill{height:100%; background:var(--blue); border-radius:5px; display:flex; align-items:center; justify-content:flex-end; padding-right:6px;}
.hbar-row .fill span{font-size:10px; font-weight:700; color:#fff;}

.dist-bar{display:flex; height:22px; border-radius:6px; overflow:hidden; margin-bottom:12px;}
.dist-bar div{height:100%;}
.dist-legend{display:flex; flex-wrap:wrap; gap:10px; font-size:11.5px; color:var(--muted);}
.dist-legend span{display:inline-flex; align-items:center; gap:5px;}
.dist-legend i{width:9px; height:9px; border-radius:3px; display:inline-block;}

table{width:100%; border-collapse:collapse; font-size:12.5px;}
th{text-align:left; padding:10px 12px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em;
  color:var(--muted-2); border-bottom:1px solid var(--border); background:rgba(15,23,42,.4);}
td{padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:top;}
tr:hover td{background:rgba(148,163,184,.04);}
.tbl-wrap{overflow-x:auto; border-radius:12px; border:1px solid var(--border);}
.tbl-wrap table{border:none;}

.pill{display:inline-flex; align-items:center; padding:2px 8px; border-radius:100px; font-size:10.5px; font-weight:700; border:1px solid transparent; white-space:nowrap;}
.pill-done{background:rgba(16,185,129,.1); color:var(--emerald); border-color:rgba(16,185,129,.3);}
.pill-progress{background:rgba(245,158,11,.1); color:var(--amber); border-color:rgba(245,158,11,.3);}
.pill-todo{background:rgba(100,116,139,.15); color:#cbd5e1; border-color:#334155;}
.dep-badge{display:inline-flex; padding:2px 6px; border-radius:5px; font-size:9.5px; font-weight:700; border:1px solid;
  background:rgba(139,92,246,.15); color:#c4b5fd; border-color:rgba(139,92,246,.35);}

.progress-mini{display:flex; align-items:center; gap:8px; width:110px;}
.progress-mini .track{flex:1; background:var(--surface-2); height:6px; border-radius:4px; overflow:hidden;}
.progress-mini .fill{height:100%; border-radius:4px; background:var(--blue);}
.progress-mini .fill.done{background:var(--emerald);}
.progress-mini .pct{font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--muted);}

.explorer-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:14px;}
.explorer-card{background:var(--surface); border:1px solid var(--border); border-radius:12px; overflow:hidden;}
.explorer-card summary{list-style:none; cursor:pointer; padding:16px; display:flex; flex-direction:column; gap:10px;}
.explorer-card summary::-webkit-details-marker{display:none;}
.explorer-card[open]{border-color:var(--blue);}
.explorer-card .head-row{display:flex; justify-content:space-between; align-items:flex-start;}
.explorer-card .head-row h4{font-size:13.5px; font-weight:700; color:#fff; margin:0;}
.explorer-card .foot-row{display:flex; justify-content:space-between; align-items:flex-end;}
.explorer-card .tag{font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:600; color:var(--amber);
  background:rgba(245,158,11,.1); border:1px solid rgba(245,158,11,.2); padding:2px 8px; border-radius:6px;}
.explorer-body{background:var(--surface-2); padding:14px 16px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:8px;}
.explorer-task{background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:10px 12px; font-size:12px;}
.explorer-task .row1{display:flex; justify-content:space-between; gap:8px; margin-bottom:6px;}
.explorer-task .row2{display:flex; justify-content:space-between; font-size:10.5px; color:var(--muted);}

.empty{padding:48px; text-align:center; color:var(--muted-2); border:1px dashed var(--border); border-radius:12px; font-size:13px;}

.login-page{min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg);}
.login-card{max-width:380px; width:100%; background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:36px 32px; text-align:center;}
.login-card .logo{width:52px; height:52px; border-radius:14px; background:var(--accent); color:var(--accent-ink);
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:18px; margin:0 auto 18px;}
.login-card h1{font-size:18px; color:#fff; margin:0 0 8px;}
.login-card p{font-size:13px; color:var(--muted); margin:0 0 24px;}
.google-btn{display:inline-flex; align-items:center; gap:10px; background:#fff; color:#1f2937; font-weight:600;
  font-size:13.5px; padding:10px 20px; border-radius:8px; text-decoration:none; border:1px solid #e5e7eb;}
.google-btn:hover{background:#f3f4f6;}
.error-box{background:rgba(239,68,68,.1); border:1px solid rgba(239,68,68,.3); color:#fca5a5; border-radius:10px; padding:14px 16px; font-size:13px;}
.cache-note{font-size:10.5px; color:var(--muted-2); display:flex; align-items:center; gap:5px;}
