:root {
  --bg: #030405;
  --panel: #0a0b0d;
  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.18);
  --text: #f4f6f8;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --teal: #5eead4;
  --indigo: #818cf8;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #fb7185;
  --font: "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mesh { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(800px 500px at 0% -10%, rgba(45,212,191,.08), transparent 60%), radial-gradient(700px 450px at 100% 0%, rgba(129,140,248,.06), transparent 60%); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; }
.brand em { font-style: normal; font-size: 9px; letter-spacing: .14em; color: var(--teal); border: 1px solid rgba(94,234,212,.25); border-radius: 5px; padding: 2px 5px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #04100f; background: linear-gradient(135deg, var(--teal), #7dd3fc 55%, var(--indigo)); }
.brand-mark svg { width: 19px; height: 19px; stroke-width: 2.1; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; }
.login-card { width: min(390px, 100%); padding: 32px; background: rgba(10,11,13,.92); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.login-card h1 { font-size: 25px; letter-spacing: -.03em; margin: 26px 0 4px; }
.login-card p { color: var(--muted); font-size: 12px; margin: 0 0 22px; }
label { display: block; font-size: 11px; color: var(--muted); margin: 14px 0 6px; }
input, select { width: 100%; background: #050607; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, select:focus { border-color: rgba(94,234,212,.45); }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn.primary { background: linear-gradient(135deg, var(--teal), #67e8f9); color: #04100f; }
.btn.ghost { background: rgba(148,163,184,.06); color: var(--text); border-color: var(--border); }
.login-card .btn { width: 100%; margin-top: 20px; }
.login-error { color: var(--red); font-size: 11px; min-height: 18px; margin-top: 10px; }

.layout { min-height: 100vh; display: flex; position: relative; }
.sidebar { width: 230px; flex: none; border-right: 1px solid var(--border); padding: 24px 18px; display: flex; flex-direction: column; background: rgba(6,7,9,.7); position: sticky; top: 0; height: 100vh; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; margin-top: 34px; }
.sidebar nav button { text-align: left; background: transparent; border: 1px solid transparent; color: var(--muted); padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.sidebar nav button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.sidebar nav button.active { color: var(--text); background: rgba(94,234,212,.08); border-color: rgba(94,234,212,.16); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 16px; font-size: 12px; }
.sidebar-bottom .link { background: none; border: none; color: var(--muted-2); padding: 8px 0 0; cursor: pointer; font-size: 11px; }
main { flex: 1; min-width: 0; padding: 28px 34px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.card { background: rgba(10,11,13,.76); border: 1px solid var(--border); border-radius: 16px; padding: 22px; margin-bottom: 16px; }
.card h2 { margin: 0 0 16px; font-size: 15px; letter-spacing: -.02em; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { padding: 18px; background: rgba(10,11,13,.76); border: 1px solid var(--border); border-radius: 14px; }
.metric span { display: block; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.metric strong { display: block; font-size: 25px; letter-spacing: -.04em; margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: var(--muted-2); font-weight: 600; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; padding: 9px 7px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 7px; border-bottom: 1px solid rgba(255,255,255,.05); color: #d6dae0; white-space: nowrap; }
td.code, .mono { font-family: var(--mono); font-size: 10.5px; }
tr:last-child td { border-bottom: none; }
.chip { display: inline-block; font-size: 9px; font-weight: 700; padding: 3px 6px; border-radius: 5px; background: rgba(148,163,184,.1); color: var(--muted); }
.chip.pro { background: rgba(94,234,212,.1); color: var(--teal); }
.chip.team { background: rgba(129,140,248,.1); color: var(--indigo); }
.chip.green { background: rgba(52,211,153,.1); color: var(--green); }
.chip.amber { background: rgba(251,191,36,.1); color: var(--amber); }
.chip.red { background: rgba(251,113,133,.1); color: var(--red); }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions select { width: 90px; padding: 5px 6px; font-size: 10px; }
.row-actions button { padding: 6px 8px; font-size: 10px; }
.search { width: min(300px, 100%); }
.link { background: none; border: none; color: var(--teal); padding: 0; cursor: pointer; font-family: var(--mono); font-size: 10.5px; }
.muted { color: var(--muted); font-size: 12px; }
.license-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.license-form label { margin: 0; min-width: 90px; }
.license-form input, .license-form select { margin-top: 5px; }
.new-license { margin-top: 16px; padding: 12px; border: 1px solid rgba(94,234,212,.2); background: rgba(94,234,212,.05); border-radius: 10px; font-family: var(--mono); font-size: 12px; color: var(--teal); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kv div { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.kv span { display: block; font-size: 9px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; }
.kv strong { display: block; font-size: 12px; margin-top: 3px; }
.toast { position: fixed; right: 20px; bottom: 20px; padding: 11px 14px; background: #0a0b0d; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 12px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; max-width: 380px; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: rgba(251,113,133,.35); }
@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: relative; flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; overflow-x: auto; }
  .sidebar nav { flex-direction: row; margin: 0; }
  .sidebar-bottom { display: none; }
  .brand span:not(.brand-mark) { display: none; }
  main { padding: 20px 16px 50px; }
  .kv { grid-template-columns: 1fr; }
}
