:root {
  --bg: #0b1220; --bg2: #0f172a; --card: #131c2e; --card2: #1a2538;
  --line: #233046; --txt: #e2e8f0; --muted: #94a3b8; --muted2: #64748b;
  --accent: #10b981; --accent2: #0ea5e9; --danger: #ef4444; --warn: #f59e0b;
  --radius: 12px; --shadow: 0 8px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--txt); line-height: 1.5; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.center { text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--card2); color: var(--txt); padding: .55rem .9rem; border-radius: 9px; cursor: pointer; font-size: .9rem; transition: .15s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04140d; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--danger); color: #fecaca; }
.btn.sm { padding: .35rem .6rem; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Inputs */
input, select, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--txt); padding: .55rem .7rem; border-radius: 9px; font-size: .9rem; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent2); }
label { display: block; font-size: .82rem; color: var(--muted); margin: .6rem 0 .25rem; }
.field { margin-bottom: .5rem; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card h2 { font-size: 1.05rem; }

/* Badges */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; border: 1px solid var(--line); }
.badge.ok { background: rgba(16,185,129,.12); color: #6ee7b7; border-color: rgba(16,185,129,.3); }
.badge.warn { background: rgba(245,158,11,.12); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.badge.err { background: rgba(239,68,68,.12); color: #fca5a5; border-color: rgba(239,68,68,.3); }
.badge.muted { color: var(--muted); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: var(--card2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: .9rem; }
.stat .v { font-size: 1.5rem; font-weight: 700; }
.stat .k { color: var(--muted); font-size: .8rem; }

/* App shell */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 800; font-size: 1.3rem; padding: .3rem .5rem 1rem; }
.brand .dot { color: var(--accent); }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 8px; color: var(--muted); margin-bottom: 2px; cursor: pointer; }
.nav a:hover { background: var(--card2); color: var(--txt); text-decoration: none; }
.nav a.active { background: var(--card2); color: var(--txt); border-left: 3px solid var(--accent); }

/* Monochrome green icons (inherit currentColor → forced green) */
.i { width: 18px; height: 18px; flex: 0 0 auto; stroke: var(--accent); color: var(--accent); vertical-align: -.18em; }
.feat .ic .i { width: 30px; height: 30px; }
.main { padding: 1.5rem 2rem; max-width: 1100px; }
.topbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.topbar h1 { font-size: 1.4rem; margin: 0; }

/* Auth */
.auth-wrap { max-width: 420px; margin: 8vh auto; padding: 1rem; }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tabs button { flex: 1; background: transparent; border: none; color: var(--muted); padding: .6rem; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--txt); border-bottom-color: var(--accent); }

/* Toast */
#toast { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 50; }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: .7rem 1rem; border-radius: 9px; box-shadow: var(--shadow); max-width: 360px; animation: slideIn .2s; }
.toast.err { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }

/* Landing */
.landing { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }
.lnav { display: flex; align-items: center; padding: 1.25rem 0; }
.hero { text-align: center; padding: 5rem 0 3rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.02em; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 1rem auto 2rem; }
.pill { display: inline-block; background: rgba(16,185,129,.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); padding: .3rem .8rem; border-radius: 999px; font-size: .82rem; margin-bottom: 1.25rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; padding: 2rem 0 4rem; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.feat .ic { font-size: 1.6rem; }
.feat h3 { font-size: 1.05rem; margin-top: .5rem; }
.lfoot { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted2); font-size: .85rem; display: flex; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 1rem; }
}
