:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: rgba(15, 29, 27, 0.92);
  --panel-2: #132a27;
  --line: rgba(122, 211, 191, 0.18);
  --text: #effffb;
  --muted: #9bb8b1;
  --accent: #38d6b0;
  --accent-2: #16a085;
  --danger: #ff6b72;
  --warning: #ffcc66;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(56, 214, 176, 0.15), transparent 30rem),
    linear-gradient(145deg, #06100e 0%, #0a1715 55%, #07100f 100%);
}
button, input, select { font: inherit; }
button {
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  color: #05211b;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: wait; }
.secondary, .ghost { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.danger { color: #fff; background: #8c3038; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 70px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 46px); margin-bottom: 8px; }
h2 { margin-bottom: 8px; }
p { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
}
.login-panel, .create-panel { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px; align-items: end; }
.login-form, .create-grid, .filters { display: grid; gap: 14px; }
.create-grid { grid-template-columns: repeat(3, 1fr); }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select {
  width: 100%;
  padding: 12px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #081513;
  color: var(--text);
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,214,176,.1); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.stat strong { display: block; margin-top: 7px; font-size: 28px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 0; }
.filters { grid-template-columns: 1fr 180px auto; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 13px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.badge-active { color: #bfffee; background: rgba(56,214,176,.16); }
.badge-disabled, .badge-expired { color: #ffd2d5; background: rgba(255,107,114,.16); }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.actions button { padding: 7px 9px; font-size: 12px; }
pre { white-space: pre-wrap; color: #c9fff2; background: #07110f; border: 1px dashed var(--line); border-radius: 12px; padding: 16px; }
.audit-list { display: grid; gap: 8px; }
.audit-item { display: grid; grid-template-columns: 170px 180px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 26px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 420px; padding: 13px 17px; border-radius: 10px; background: #d9fff5; color: #08231d; box-shadow: 0 12px 40px rgba(0,0,0,.35); font-weight: 700; }
.toast.error { color: white; background: #9c333c; }
.hidden { display: none !important; }
@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 20px; }
  .login-panel, .create-panel { grid-template-columns: 1fr; }
  .create-grid, .filters { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .audit-item { grid-template-columns: 1fr; gap: 3px; }
}
