:root {
  --bg: #08131f;
  --panel: #0e1e2e;
  --panel-2: #132638;
  --line: #1c3648;
  --text: #e6eef7;
  --muted: #8ca6ba;
  --mint: #5eead4;
  --mint-2: #2dd4bf;
  --amber: #fbbf24;
  --red: #fb7185;
  --blue: #60a5fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 15% 0%, #0f2c3a 0, var(--bg) 45%); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--mint); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); background: linear-gradient(160deg, #11283a, #0c1a28); border: 1px solid var(--line); border-radius: 22px; padding: 34px; box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--mint), #38bdf8); color: #06212b; font-weight: 900; letter-spacing: -1px; margin-bottom: 20px; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 11px; margin: 0; font-size: 13px; }
.eyebrow { margin: 0 0 7px; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 28px; }
h2 { font-size: 25px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); line-height: 1.55; font-size: 14px; }
label { display: grid; gap: 7px; margin-top: 18px; color: #c8d7e5; font-size: 12px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #294559; background: #091824; color: var(--text); border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, select:focus { border-color: var(--mint-2); box-shadow: 0 0 0 3px rgba(45,212,191,.12); }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font-weight: 800; font-size: 13px; }
.btn.primary { background: linear-gradient(135deg, var(--mint), #38bdf8); color: #04212a; }
.btn.ghost { background: transparent; border-color: var(--line); color: #c9d8e6; }
.btn:hover { filter: brightness(1.06); }
.login-card .btn { width: 100%; margin-top: 20px; padding: 12px; }
.error { color: var(--red); font-size: 12px; min-height: 16px; margin: 10px 0 0; }
.fine { color: #6f899d; font-size: 11px; margin: 16px 0 0; }

.app-shell { display: grid; grid-template-columns: 238px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); background: rgba(8,19,31,.86); padding: 24px 16px; display: flex; flex-direction: column; gap: 26px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong { display: block; font-size: 14px; }
.brand span { display: block; color: var(--muted); font-size: 11px; }
nav { display: grid; gap: 5px; }
.nav-item { text-align: left; border: 0; background: transparent; color: #9fb4c6; padding: 10px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.nav-item:hover { background: #102638; color: var(--text); }
.nav-item.active { background: #123341; color: var(--mint); box-shadow: inset 2px 0 0 var(--mint); }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: .06em; background: #153445; color: #9adfd7; width: max-content; }
.badge.success { background: #123b34; color: #6ee7b7; }
.badge.warn { background: #3a2d12; color: var(--amber); }
.badge.danger { background: #3c1623; color: var(--red); }
.subtle-link { color: #7893a7; font-size: 11px; text-decoration: none; }
.main { padding: 28px 34px 50px; max-width: 1400px; width: 100%; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 11px; color: var(--muted); }
.pill.ok { color: var(--mint); border-color: #1f5a53; }
.user-chip { display: grid; text-align: right; }
.user-chip span { font-size: 12px; font-weight: 800; }
.user-chip small { color: var(--muted); font-size: 10px; }
.hero { display: flex; justify-content: space-between; gap: 20px; align-items: start; background: linear-gradient(120deg, #0f2c3a, #0c2231); border: 1px solid #1d4153; border-radius: 18px; padding: 24px; margin-bottom: 18px; }
.hero h2 { font-size: 28px; margin-bottom: 8px; }
.hero p:not(.eyebrow) { color: var(--muted); max-width: 680px; line-height: 1.55; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 6px; }
.card span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.card strong { font-size: 32px; letter-spacing: -.04em; }
.card small { color: #6f899d; font-size: 11px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
mini-list { display: grid; }
.mini-list { display: grid; gap: 2px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #162f40; }
.mini-row:first-child { border-top: 0; }
.mini-row strong { display: block; font-size: 13px; }
.mini-row small { color: var(--muted); font-size: 11px; }
.empty { color: var(--muted); font-size: 13px; padding: 28px 10px; text-align: center; border: 1px dashed #234458; border-radius: 10px; }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { text-align: left; padding: 12px 16px; color: #7f9bb0; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; background: #0b1a28; border-bottom: 1px solid var(--line); }
td { padding: 13px 16px; border-bottom: 1px solid #152c3c; font-size: 12px; color: #c9d7e4; }
td strong { display: block; color: var(--text); font-size: 12px; }
td small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
tr:last-child td { border-bottom: 0; }
.form-panel { margin-bottom: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px 14px; }
.grid-form label { margin: 0; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.form-actions .error { grid-column: 1 / -1; }
.footer-note { color: #577286; font-size: 10px; text-align: right; margin-top: 20px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; gap: 12px; }
  nav { display: flex; overflow-x: auto; }
  .sidebar-foot { display: none; }
  .main { padding: 20px 16px 40px; }
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-form { grid-template-columns: 1fr; }
  .topbar { align-items: start; }
  .user-chip { display: none; }
}
