/* Business KPI Dashboard - offline single-page app */
:root{
  --bg:#0b0f17;
  --card:#121a27;
  --text:#e9eef8;
  --muted:#a7b3c9;
  --border:#22314a;
  --primary:#4da3ff;
  --danger:#ff4d6d;
  --shadow: 0 8px 20px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% -10%, rgba(77,163,255,.25), transparent 60%),
              radial-gradient(900px 600px at 80% 10%, rgba(255,77,109,.18), transparent 55%),
              var(--bg);
  color:var(--text);
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  background: rgba(11,15,23,.85);
  backdrop-filter: blur(10px);
  z-index:10;
}

.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:40px;height:40px;border-radius:12px;
  background: linear-gradient(135deg, rgba(77,163,255,.95), rgba(255,77,109,.9));
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
  box-shadow: var(--shadow);
}
.title{ font-weight:800; letter-spacing:.2px; }
.subtitle{ font-size:12px; color: var(--muted); margin-top:2px; }
.top-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:650;
}
.btn:hover{ border-color: rgba(77,163,255,.55); }
.btn-primary{ background: rgba(77,163,255,.18); border-color: rgba(77,163,255,.45); }
.btn-secondary{ background: rgba(255,255,255,.02); }
.btn-danger{ background: rgba(255,77,109,.15); border-color: rgba(255,77,109,.45); }
.btn-danger:hover{ border-color: rgba(255,77,109,.7); }

.grid{
  padding:18px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:16px;
  max-width: 1280px;
  margin:0 auto;
}

.card{
  background: rgba(18,26,39,.88);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow: var(--shadow);
}
.card-header h2{ margin:0 0 6px 0; font-size:16px; }
.muted{ color: var(--muted); }
.small{ font-size:12px; }

.span-2{ grid-column: span 2; }
.span-3{ grid-column: span 3; }

.row{ display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.row-between{ display:flex; justify-content:space-between; gap:12px; align-items:flex-start; flex-wrap:wrap; }

.field{ display:flex; flex-direction:column; gap:6px; min-width: 180px; }
.field.grow{ flex:1; min-width: 240px; }

input, select, textarea{
  width:100%;
  background: rgba(255,255,255,.03);
  color: var(--text);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 10px;
  outline:none;
}
input:focus, select:focus, textarea:focus{ border-color: rgba(77,163,255,.6); }
label{ font-size:12px; color: var(--muted); }

.tabs{ display:flex; gap:10px; margin: 10px 0 12px 0; }
.tab{
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  color: var(--text);
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
}
.tab.active{ border-color: rgba(77,163,255,.6); background: rgba(77,163,255,.14); }
.panel{ display:none; }
.panel.active{ display:block; }

.kpis{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
}
.kpi{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background: rgba(255,255,255,.02);
}
.kpi-label{ color: var(--muted); font-size:12px; }
.kpi-value{ font-size:20px; font-weight:850; margin-top:6px; }

.table-wrap{ overflow:auto; border-radius:12px; border:1px solid var(--border); }
.table{ width:100%; border-collapse:collapse; min-width: 760px; }
.table th, .table td{
  border-bottom:1px solid rgba(34,49,74,.65);
  padding:10px 10px;
  font-size:13px;
  vertical-align:top;
}
.table th{ text-align:left; color: var(--muted); font-size:12px; background: rgba(255,255,255,.02); position:sticky; top:0; }
.table tr:hover td{ background: rgba(77,163,255,.05); }
.right{ text-align:right; }
.linklike{
  color: var(--primary);
  cursor:pointer;
  text-decoration: underline;
  border: none;
  background: transparent;
  padding:0;
  font-weight:700;
}
.pill{
  display:flex; align-items:center; gap:8px;
  border:1px solid var(--border);
  border-radius:999px;
  padding:8px 10px;
  background: rgba(255,255,255,.02);
  color: var(--muted);
  font-size:12px;
}
.pill select{ padding:6px 8px; border-radius:10px; }

.notes{
  width:100%;
  min-height: 140px;
  margin-top: 8px;
  resize: vertical;
}

.legend{ margin-top:10px; color: var(--muted); font-size:12px; display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; margin-right:6px; border:1px solid rgba(255,255,255,.2); }
.dot.rev{ background: rgba(77,163,255,.8); }
.dot.exp{ background: rgba(255,77,109,.75); }
.dot.prf{ background: rgba(154,255,154,.55); }

.footer{
  max-width:1280px;
  margin: 0 auto;
  padding: 18px;
  color: var(--muted);
  font-size:12px;
  opacity:.9;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
  .span-2, .span-3{ grid-column: span 1; }
  .table{ min-width: 680px; }
}
