:root {
  --bg: #f3f5f8; --surface: #fff; --surface-2: #f8fafc; --surface-3: #eef2f6; --border: #e2e8f0; --border-2: #cbd5e1;
  --text: #0f172a; --text-2: #475569; --text-3: #8492a6;
  --brand: #0d9488; --brand-h: #0f766e; --brand-soft: #e3f7f4; --on-brand: #fff;
  --ok: #16a34a; --ok-s: #e4f6ea; --warn: #d97706; --warn-s: #fdf1dd; --bad: #e11d48; --bad-s: #fde7ec; --info: #2563eb; --info-s: #e5edfd;
  --r: 12px; --shadow: 0 1px 3px rgba(15,23,42,.08); --shadow-lg: 0 18px 40px -12px rgba(15,23,42,.25);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a0e13; --surface: #121821; --surface-2: #161d28; --surface-3: #1d2633; --border: #242f3f; --border-2: #34425a;
    --text: #e9eef5; --text-2: #a7b4c6; --text-3: #6b7b91; --brand: #14b8a6; --brand-h: #2dd4bf; --brand-soft: #0f2e2c; --on-brand: #03211d;
    --ok: #34d399; --ok-s: #0f2b21; --warn: #fbbf24; --warn-s: #2f2410; --bad: #fb7185; --bad-s: #34141c; --info: #60a5fa; --info-s: #14233f; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 'Inter', 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; } h2 { font-size: 16px; margin: 0; } h3 { font-size: 14px; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--text-3); } .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 0% 0%, rgba(45,212,191,.25), transparent 60%), radial-gradient(800px 500px at 100% 100%, rgba(15,118,110,.25), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 30px; box-shadow: var(--shadow-lg); }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo i { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-style: normal; background: linear-gradient(135deg, #14b8a6, #0f766e); box-shadow: 0 6px 16px -6px rgba(13,148,136,.7); }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 4px 10px 18px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; cursor: pointer; }
.nav a:hover { background: var(--surface-3); color: var(--text); } .nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); font-size: 12.5px; }
.main { padding: 26px 30px 60px; max-width: 1280px; width: 100%; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .side .logo { padding-bottom: 4px; width: 100%; } .nav { display: flex; flex-wrap: wrap; gap: 2px; } .side-foot { display: none; } .main { padding: 16px; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card-b { padding: 18px; } .card-h { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid { display: grid; gap: 14px; } .g4 { grid-template-columns: repeat(4, 1fr); } .g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 640px) { .g4, .g2 { grid-template-columns: 1fr; } }
.stat { padding: 16px 18px; } .stat .l { color: var(--text-2); font-weight: 600; font-size: 12.5px; } .stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; } .stat .s { color: var(--text-3); font-size: 12.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-3); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.96); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.p { background: var(--brand); color: var(--on-brand); } .btn.o { background: var(--surface); border-color: var(--border-2); } .btn.d { background: var(--bad-s); color: var(--bad); } .btn.s { height: 30px; padding: 0 10px; font-size: 13px; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,148,136,.25); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; } .field > label { font-size: 12px; font-weight: 650; color: var(--text-2); }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; } .chk input { width: 18px; height: 18px; accent-color: var(--brand); }

.tbl-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: separate; border-spacing: 0; } th { text-align: left; font-size: 12px; color: var(--text-2); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; } tr:last-child td { border-bottom: 0; } tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: var(--surface-2); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.b-ok { background: var(--ok-s); color: var(--ok); } .b-warn { background: var(--warn-s); color: var(--warn); } .b-bad { background: var(--bad-s); color: var(--bad); } .b-info { background: var(--info-s); color: var(--info); } .b-brand { background: var(--brand-soft); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); display: inline-block; } .dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.empty { padding: 44px 20px; text-align: center; color: var(--text-3); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; } .tabs button { height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; cursor: pointer; } .tabs button.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.overlay { position: fixed; inset: 0; background: rgba(2,6,12,.55); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.modal-h { padding: 18px 22px 8px; display: flex; justify-content: space-between; align-items: center; } .modal-b { padding: 8px 22px 18px; } .modal-f { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 10px; justify-content: flex-end; border-radius: 0 0 20px 20px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: 10px; padding: 11px 14px; box-shadow: var(--shadow-lg); max-width: 360px; }
.toast.ok { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--bad); }
.drop { border: 2px dashed var(--border-2); border-radius: 14px; padding: 26px; text-align: center; color: var(--text-2); cursor: pointer; } .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.copy { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: 10px; }
