:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --ink: #15201b;
  --muted: #65706a;
  --faint: #98a29c;
  --line: #e2e7e2;
  --accent: #0e7a58;
  --accent-ink: #ffffff;
  --accent-soft: #e2f3ec;
  --side: #10241c;
  --side-ink: #cfe0d8;
  --side-active: #1d3b2f;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --trial: #2459d6;      --trial-soft: #e8efff;
  --licensed: #0e7a58;   --licensed-soft: #e2f3ec;
  --expired: #a85a00;    --expired-soft: #fff2df;
  --blocked: #c62828;    --blocked-soft: #fdecec;
  --shadow: 0 1px 2px rgba(16, 36, 28, .05), 0 4px 16px rgba(16, 36, 28, .05);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1311;
    --surface: #151d19;
    --surface-2: #19231f;
    --ink: #e6ece8;
    --muted: #9ba7a0;
    --faint: #6d7973;
    --line: #26322c;
    --accent: #34c08e;
    --accent-ink: #062218;
    --accent-soft: #163a2c;
    --side: #0a100d;
    --side-ink: #b9cbc2;
    --side-active: #17271f;
    --danger: #ff6b6b;
    --danger-soft: #3a1717;
    --trial: #7aa2ff;      --trial-soft: #18264a;
    --licensed: #34c08e;   --licensed-soft: #133426;
    --expired: #f0a64a;    --expired-soft: #3a2a12;
    --blocked: #ff6b6b;    --blocked-soft: #3a1717;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: block; flex: none;
}
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand span { font-size: 11.5px; color: #8fb3a3; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--side-ink); font-weight: 500;
}
.nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.nav a.on { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #2fbf8c; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 14px 10px 0; font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot form { display: inline; }
.side-foot button, .side-foot a {
  background: none; border: 0; padding: 0; color: #8fb3a3; font: inherit; cursor: pointer;
}
.side-foot button:hover, .side-foot a:hover { color: #fff; text-decoration: underline; }

.main { padding: 22px clamp(16px, 3vw, 36px) 48px; max-width: 1240px; width: 100%; }
.topbar { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; }
.search { flex: 1 1 320px; max-width: 460px; position: relative; }
.search input { width: 100%; padding-left: 38px !important; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- карталар ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .muted { font-size: 13px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.stack > * + * { margin-top: 16px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: block; color: var(--ink); position: relative; overflow: hidden;
}
.stat:hover { text-decoration: none; border-color: var(--faint); }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c, var(--accent)); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.stat .hint { font-size: 12px; color: var(--faint); }
.stat.trial { --c: var(--trial); }
.stat.licensed { --c: var(--licensed); }
.stat.expired { --c: var(--expired); }
.stat.blocked { --c: var(--blocked); }

/* ---------- жадвал ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-2); }
td .sub { display: block; font-size: 12.5px; color: var(--muted); }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 20px; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

/* ---------- белгилар ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.trial { background: var(--trial-soft); color: var(--trial); }
.badge.licensed { background: var(--licensed-soft); color: var(--licensed); }
.badge.expired { background: var(--expired-soft); color: var(--expired); }
.badge.blocked { background: var(--blocked-soft); color: var(--blocked); }
.badge.lg { font-size: 14px; padding: 5px 14px; }

.code-chip {
  font-family: var(--mono); font-weight: 650; font-size: 13.5px; letter-spacing: .06em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; color: var(--ink); white-space: nowrap;
}
.code-big { font-family: var(--mono); font-size: 30px; font-weight: 750; letter-spacing: .08em; }

/* ---------- таблар ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-weight: 550; font-size: 13.5px;
}
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tabs a .n { opacity: .65; margin-left: 4px; font-weight: 500; }

/* ---------- формалар ---------- */
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], input[type=tel],
select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--faint); margin-top: 4px; }
.field .err, .errorlist { color: var(--danger); font-size: 12.5px; margin: 5px 0 0; padding: 0; list-style: none; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.terms { display: flex; flex-wrap: wrap; gap: 8px; }
.terms > div { display: contents; }
.terms label { margin: 0; }
.terms input { position: absolute; opacity: 0; pointer-events: none; }
.terms label span, .terms label {
  cursor: pointer;
}
.terms .opt {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); font-weight: 550; font-size: 13.5px; user-select: none;
}
.terms input:checked + .opt { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.terms input:focus-visible + .opt { box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.inline { display: inline; }

.alert { border-radius: 12px; padding: 11px 16px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.alert.success { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.alert.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* ---------- маълумот рўйхати ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero .until { font-size: 15px; margin-top: 6px; }

.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.seg { display: flex; gap: 6px; margin-bottom: 14px; background: var(--surface-2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.seg button {
  flex: 1; font: inherit; font-weight: 600; border: 0; background: none; padding: 7px; border-radius: 9px;
  color: var(--muted); cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.timeline .meta { font-size: 12px; color: var(--faint); }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- кириш ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, rgba(47,191,140,.18), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, rgba(14,122,88,.16), transparent 60%), var(--bg); }
.login { width: 100%; max-width: 380px; }
.login .brand { color: var(--ink); justify-content: center; padding-bottom: 18px; }
.login .brand span { color: var(--muted); }
.login .card { padding: 26px; }
.login h1 { font-size: 20px; margin-bottom: 4px; }
.login p.muted { margin: 0 0 18px; }

/* ---------- мослашувчан ---------- */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3-2, .cols-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center;
    padding: 10px 14px; gap: 6px; overflow-x: auto;
  }
  .brand { padding: 0 8px 0 0; }
  .brand > div { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav a.on { box-shadow: inset 0 -2px 0 #2fbf8c; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; white-space: nowrap; }
  .side-foot .who, .side-foot .pw { display: none; }
  .code-big { font-size: 24px; }
}
@media (max-width: 520px) {
  .nav a span { display: none; }
  .stat .value { font-size: 26px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}

[hidden] { display: none !important; }
