:root{
    --bg:#0f172a;
    --panel:#111827;
    --panel-2:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --accent:#38bdf8;
    --ok:#22c55e;
    --warn:#f59e0b;
    --bad:#ef4444;
    --border:rgba(255,255,255,0.08);
    --radius:14px;
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
    --gap: 16px;
    --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  }
  
  *{box-sizing:border-box}
  body{
    margin:0;
    font-family:var(--font);
    background:linear-gradient(160deg, var(--bg), #05070f 60%);
    color:var(--text);
  }
  
  .app{
    display:grid;
    grid-template-columns: 260px 1fr;
    min-height:100vh;
  }
  
  .sidebar{
    background:linear-gradient(180deg, var(--panel), var(--panel-2));
    border-right:1px solid var(--border);
    padding:24px 18px;
  }
  
  .brand{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:rgba(255,255,255,0.03);
  }
  
  .brand-badge{
    width:28px; height:28px;
    border-radius:9px;
    background:linear-gradient(135deg, var(--accent), #60a5fa);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  }
  
  .nav{
    margin-top:22px;
    display:flex;
    flex-direction:column;
    gap:6px;
  }
  
  .nav a{
    text-decoration:none;
    color:var(--text);
    padding:10px 12px;
    border-radius:10px;
    border:1px solid transparent;
    opacity:.9;
  }
  
  .nav a:hover{
    background:rgba(255,255,255,0.04);
    border-color:var(--border);
  }
  
  .nav a.active{
    background:rgba(56,189,248,0.12);
    border-color:rgba(56,189,248,0.35);
  }
  
  .main{
    padding:28px;
  }
  
  .topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:var(--gap);
    margin-bottom:22px;
  }
  
  .page-title{
    font-size:22px;
    font-weight:650;
    letter-spacing:.2px;
  }
  
  .badge{
    font-size:12px;
    color:var(--muted);
    padding:4px 8px;
    border:1px solid var(--border);
    border-radius:999px;
  }
  
  .grid{
    display:grid;
    gap:var(--gap);
  }
  
  .grid-3{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .card{
    background:rgba(255,255,255,0.03);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:18px;
  }
  
  .card h3{
    margin:0 0 10px 0;
    font-size:14px;
    color:var(--muted);
    font-weight:500;
  }
  
  .metric{
    display:flex;
    align-items:flex-end;
    gap:10px;
  }
  
  .metric-value{
    font-size:28px;
    font-weight:700;
  }
  
  .metric-sub{
    font-size:12px;
    color:var(--muted);
    margin-top:6px;
  }
  
  .metric.ok .metric-value{color:var(--ok)}
  .metric.warn .metric-value{color:var(--warn)}
  .metric.bad .metric-value{color:var(--bad)}
  
  .toolbar{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin: 14px 0 18px 0;
  }
  
  .input, select{
    background:rgba(255,255,255,0.04);
    border:1px solid var(--border);
    color:var(--text);
    padding:10px 12px;
    border-radius:10px;
    outline:none;
    min-width:160px;
  }
  
  .input::placeholder{color:rgba(229,231,235,0.45)}
  
  .btn{
    background:rgba(56,189,248,0.18);
    border:1px solid rgba(56,189,248,0.45);
    color:var(--text);
    padding:10px 14px;
    border-radius:10px;
    cursor:pointer;
    font-weight:600;
  }
  
  .btn.secondary{
    background:rgba(255,255,255,0.04);
    border-color:var(--border);
    font-weight:500;
  }
  
  .table{
    width:100%;
    border-collapse:separate;
    border-spacing:0 8px;
  }
  
  .table th{
    text-align:left;
    font-size:12px;
    color:var(--muted);
    padding:0 10px 6px 10px;
    font-weight:500;
  }
  
  .table td{
    background:rgba(255,255,255,0.03);
    border-top:1px solid var(--border);
    border-bottom:1px solid var(--border);
    padding:12px 10px;
  }
  
  .table tr td:first-child{
    border-left:1px solid var(--border);
    border-top-left-radius:10px;
    border-bottom-left-radius:10px;
  }
  
  .table tr td:last-child{
    border-right:1px solid var(--border);
    border-top-right-radius:10px;
    border-bottom-right-radius:10px;
  }
  
  .kv{
    font-size:12px;
    color:var(--muted);
  }

  /* --- Onboarding (MVP) --- */
.onb-backdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  z-index: 9998;
}

.onb-highlight{
  position: relative;
  z-index: 9999;
  outline: 2px solid rgba(100,181,255,0.65);
  border-radius: 10px;
  box-shadow: 0 0 0 6px rgba(100,181,255,0.12);
}

.onb-pop{
  position: fixed;
  max-width: 320px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 14px 14px 12px 14px;
  z-index: 10000;
}

.onb-title{
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.onb-text{
  font-size: 12.5px;
  opacity: 0.8;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.onb-actions{
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.onb-btn{
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #e5e7eb;
  cursor: pointer;
}

.onb-btn.primary{
  border-color: rgba(100,181,255,0.45);
  background: rgba(100,181,255,0.14);
}

/* --- Micro tooltips --- */
.tip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;height:16px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  margin-left:6px;
  cursor: help;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #9aa3b2;
  position: relative;
}

.tip:hover{
  color:#e5e7eb;
  border-color: rgba(100,181,255,0.45);
}

/* bubble */
.tip-bubble{
  position: absolute;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 11px;
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.35;
  color: #e5e7eb;
  background: rgba(10,16,34,0.98);
  border:1px solid rgba(255,255,255,0.10);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  z-index: 50;
  transform: translateY(6px);
  opacity: 0;
  pointer-events: none;
  transition: 140ms ease;
}

/* position default (top-right) */
.tip .tip-bubble{
  bottom: 22px;
  left: 50%;
  transform: translate(-30%, 6px);
}

/* show */
.tip.show .tip-bubble,
.tip:hover .tip-bubble{
  opacity: 1;
  pointer-events: auto;
  transform: translate(-30%, 0);
}
/* --- First-run checklist --- */
.checklist-card{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.checklist-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom: 12px;
}

.checklist-title{
  font-size: 18px;
  font-weight: 800;
}

.checklist-sub{
  font-size: 11.5px;
  opacity: 0.75;
  margin-top: 2px;
}

.checklist-progress{
  display:flex;
  align-items:center;
  gap:8px;
}

.checklist-bar{
  width: 160px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.checklist-bar span{
  display:block;
  height:100%;
  background: rgba(100,181,255,0.55);
}

.checklist-pct{
  font-size: 11px;
  opacity: 0.8;
}

.checklist-items{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.checklist-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
}

.checklist-item.done{
  opacity: 0.7;
}

.checklist-left{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.check-dot{
  width: 20px;
  height: 20px;
  border-radius: 8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
}

.check-title{
  font-size: 13.5px;
  font-weight: 700;
}

.check-desc{
  font-size: 11.5px;
  opacity: 0.7;
  margin-top: 2px;
}

.checklist-right{
  display:flex;
  align-items:center;
  gap:8px;
}

.check-badge{
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(124,243,194,0.35);
  background: rgba(124,243,194,0.12);
}

.btn.small{
  padding: 6px 9px;
  font-size: 11px;
}

.checklist-foot{
  margin-top: 10px;
  font-size: 11px;
  opacity: 0.7;
}

.achievement-badge{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124,243,194,0.35);
  background: rgba(124,243,194,0.10);
  margin: 8px 0 14px 0;
}

.ach-icon{
  font-size: 18px;
}

.ach-title{
  font-size: 12.5px;
  font-weight: 800;
}

.ach-sub{
  font-size: 11px;
  opacity: 0.75;
  margin-top: 1px;
}
.usage-bar{
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.usage-fill{
  height: 100%;
  background: rgba(100,181,255,0.55);
}

.doc-badge{
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
}
.doc-badge.badge-in{
  border-color: rgba(124,243,194,0.35);
  background: rgba(255, 100, 128, 0.422);
}
.doc-badge.badge-out{
  border-color: rgba(100,181,255,0.35);
  background: rgba(124,243,194,0.12);
}

  @media (max-width: 1100px){
    .grid-3{grid-template-columns:1fr}
  }
  
  @media (max-width: 860px){
    .app{grid-template-columns: 1fr}
    .sidebar{position:sticky; top:0; z-index:5}
  }
  