:root {
  --bg: #0b1220;
  --bg2: #111a2e;
  --card: #162036;
  --line: #24324d;
  --text: #e8eefc;
  --muted: #9aa8c7;
  --accent: #3dd6c6;
  --accent2: #5b8cff;
  --danger: #ff6b7a;
  --warn: #f5c15c;
  --ok: #4ade80;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body, #root { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2a4a 0%, var(--bg) 45%);
  color: var(--text);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

.app-shell { max-width: 1100px; margin: 0 auto; padding: 16px 14px 88px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.3px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center; color: #041018; font-weight: 900;
}
.muted { color: var(--muted); }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi b { font-size: 22px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer;
  background: var(--accent2); color: white; font-weight: 700;
}
.btn.ghost { background: #22314d; }
.btn.ok { background: #12856f; }
.btn.warn { background: #8a6a18; }
.btn.danger { background: #8b2b38; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.input, select, textarea {
  width: 100%; background: #0f182b; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 12px; outline: none;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 12px; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px;
  font-size: 12px; background: #22314d; color: var(--muted);
}
.badge.ok { background: #143528; color: var(--ok); }
.badge.warn { background: #3a2d10; color: var(--warn); }
.badge.danger { background: #3a1520; color: var(--danger); }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(11,18,32,0.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
}
.nav button {
  background: none; border: 0; color: var(--muted); padding: 10px 4px 14px; font-size: 12px;
}
.nav button.on { color: var(--accent); font-weight: 800; }
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.login .card { width: min(420px, 100%); }
.h1 { font-size: 22px; margin: 0 0 4px; }
.error { background: #3a1520; color: #ffc1c8; padding: 10px 12px; border-radius: 10px; margin: 8px 0; }
.okmsg { background: #143528; color: #b8f5cc; padding: 10px 12px; border-radius: 10px; margin: 8px 0; }
.cover { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; background: #0f182b; }
.handle { font-size: 22px; font-weight: 800; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bar {
  flex: 1; min-width: 10px; background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 6px 6px 2px 2px;
}
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: grid; place-items: end;
}
.modal { width: 100%; max-width: 560px; margin: 0 auto; border-radius: 20px 20px 0 0; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .app-shell { padding-bottom: 28px; }
  .nav { position: static; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; }
  .modal-bg { place-items: center; }
  .modal { border-radius: 16px; }
}
