:root {
  --bg: #0b1020;
  --bg-soft: #111832;
  --bg-card: #151d3b;
  --line: #24305a;
  --text: #e8ecff;
  --muted: #93a0c8;
  --brand: #5b8cff;
  --brand-2: #8f6bff;
  --ok: #2fbf71;
  --warn: #f4a13c;
  --danger: #f4586c;
  --radius: 14px;
  --shadow: 0 18px 44px rgba(4, 8, 24, 0.55);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(91, 140, 255, 0.22), transparent 60%),
    radial-gradient(1000px 520px at 92% 0%, rgba(143, 107, 255, 0.18), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 28px 20px 64px; }
.wrap.narrow { width: min(720px, 100%); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 33, 0.72); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 40;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 0.3px; }
.topbar .brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-size: 18px;
}
.topbar nav { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }

.card {
  background: linear-gradient(180deg, rgba(24, 33, 66, 0.92), rgba(17, 24, 50, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--muted); font-weight: 600; }
.card .hint { color: var(--muted); font-size: 13px; line-height: 1.7; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.stat { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat.ok .value { color: var(--ok); }
.stat.warn .value { color: var(--warn); }
.stat.brand .value { color: var(--brand); }

label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input, select, textarea, button {
  font: inherit; color: var(--text);
  background: rgba(9, 13, 30, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.16); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

button {
  cursor: pointer; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none; font-weight: 600; width: auto; padding: 10px 18px;
}
button:hover { filter: brightness(1.06); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.ghost:hover { border-color: var(--brand); }
button.danger { background: linear-gradient(135deg, #f4586c, #c2273d); }
button.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
button.block { width: 100%; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 160px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(36, 48, 90, 0.7); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tbody tr:hover { background: rgba(91, 140, 255, 0.06); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; border: 1px solid transparent; }
.badge.available, .badge.active, .badge.ok { background: rgba(47, 191, 113, 0.14); color: #5ee39b; border-color: rgba(47, 191, 113, 0.35); }
.badge.rented, .badge.warn { background: rgba(244, 161, 60, 0.14); color: #ffc478; border-color: rgba(244, 161, 60, 0.35); }
.badge.maintenance { background: rgba(91, 140, 255, 0.14); color: #9db9ff; border-color: rgba(91, 140, 255, 0.35); }
.badge.disabled, .badge.revoked, .badge.expired, .badge.bad { background: rgba(244, 88, 108, 0.14); color: #ff96a5; border-color: rgba(244, 88, 108, 0.35); }
.badge.completed { background: rgba(147, 160, 200, 0.16); color: #c3cbe8; border-color: rgba(147, 160, 200, 0.3); }

.code-box {
  font-family: ui-monospace, Consolas, monospace;
  background: rgba(5, 8, 20, 0.8);
  border: 1px dashed var(--line);
  border-radius: 12px; padding: 14px; font-size: 15px; word-break: break-all;
}
.code-box.big { font-size: 30px; letter-spacing: 6px; text-align: center; color: #7ef0ad; font-weight: 700; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  background: var(--bg-card); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-size: 14px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--danger); }

.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.countdown.danger { color: var(--danger); }

.sms-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(9, 13, 30, 0.55); }
.sms-item + .sms-item { margin-top: 10px; }
.sms-item .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 6px; gap: 10px; }
.sms-item .body { font-size: 13px; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.sms-item .code { font-size: 22px; font-weight: 700; letter-spacing: 4px; color: #7ef0ad; margin: 6px 0; }
.sms-item.verified { border-color: rgba(47, 191, 113, 0.45); }
.sms-item.flash { animation: flash 0.9s ease; }
@keyframes flash { from { background: rgba(47, 191, 113, 0.22); } to { background: rgba(9, 13, 30, 0.55); } }

.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-tabs button { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 13px; }
.pill-tabs button.active { background: rgba(91, 140, 255, 0.16); border-color: var(--brand); color: var(--text); }

.modal-back {
  position: fixed; inset: 0; background: rgba(4, 7, 18, 0.72); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 80; padding: 20px;
}
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow);
}
.modal h2 { margin-top: 0; }

.hero { text-align: center; padding: 56px 20px 24px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 14px; line-height: 1.25; }
.hero p { color: var(--muted); font-size: 15px; line-height: 1.8; margin: 0 auto; max-width: 620px; }
.hero .cta { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .cta a {
  display: inline-block; padding: 12px 22px; border-radius: 12px; font-weight: 600;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; text-decoration: none;
}
.hero .cta a.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }

.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 22px; }
.step { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: rgba(9, 13, 30, 0.5); }
.step .n { width: 26px; height: 26px; border-radius: 8px; background: rgba(91, 140, 255, 0.2); color: #9db9ff; display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.step b { display: block; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); }

footer.site { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 16px 40px; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .hide-sm { display: none; }
  th, td { padding: 8px 9px; font-size: 13px; }
}
