:root {
  --bg-0: #050608;
  --bg-1: #0b0f15;
  --bg-2: #11171f;
  --line: rgba(212, 167, 75, 0.18);
  --line-strong: rgba(212, 167, 75, 0.45);
  --gold: hsl(40, 80%, 55%);
  --gold-soft: hsla(40, 85%, 65%, 0.08);
  --text: #e9e6df;
  --muted: #8e8a82;
  --danger: #e8615a;
  --good: #56c08d;
  --warn: #e2b150;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background:
    radial-gradient(ellipse at top, hsl(200, 30%, 10%) 0%, var(--bg-0) 60%, #000 100%);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, "SF Pro Text", "Inter", sans-serif;
  font-size: 14px;
  min-height: 100vh;
  letter-spacing: 0.01em;
}

a { color: var(--gold); text-decoration: none; }
a:hover { filter: brightness(1.15); }
code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ── Login ──────────────────────────────────────────────────────── */
.page-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-wrap { width: 100%; display: flex; justify-content: center; }
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(20, 26, 35, 0.95) 0%, rgba(10, 14, 20, 0.95) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: var(--shadow), 0 0 60px hsla(40, 80%, 55%, 0.18);
  backdrop-filter: blur(18px);
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--gold) 0%, hsl(40,70%,40%) 100%);
  color: #1a1408;
  font-weight: 900; font-size: 30px;
  display: grid; place-items: center;
  border-radius: 16px;
  box-shadow: 0 0 30px hsla(40, 80%, 55%, 0.5);
}
.login-title {
  text-align: center; margin: 6px 0 2px;
  font-size: 22px; letter-spacing: 0.4em;
  color: var(--gold);
  text-shadow: 0 0 20px hsla(40, 80%, 55%, 0.4);
}
.login-sub { text-align: center; color: var(--muted); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 22px; }
.login-hint { color: var(--muted); font-size: 11px; text-align: center; margin-top: 16px; }

/* ── Shell layout ─────────────────────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; } }

.sidebar {
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.96), rgba(7, 9, 13, 0.96));
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 12px; border-bottom: 1px dashed var(--line); }
.brand-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), hsl(40,70%,40%));
  color: #1a1408; font-weight: 900; font-size: 20px;
  border-radius: 10px;
  display: grid; place-items: center;
  box-shadow: 0 0 18px hsla(40, 80%, 55%, 0.5);
}
.brand-title { font-weight: 700; letter-spacing: 0.3em; color: var(--gold); }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  color: rgba(233, 230, 223, 0.78);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-item.active {
  background: hsla(40, 80%, 55%, 0.12);
  color: var(--gold);
  border-color: var(--line-strong);
  box-shadow: inset 0 0 24px hsla(40, 80%, 55%, 0.05);
}
.nav-ico { width: 18px; text-align: center; opacity: 0.8; }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); }
.who { font-size: 11px; color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 8px; }
.logout-btn {
  display: block; text-align: center; padding: 8px 12px;
  background: rgba(232, 97, 90, 0.1); color: var(--danger);
  border: 1px solid rgba(232, 97, 90, 0.35);
  border-radius: 8px; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase;
}
.logout-btn:hover { background: rgba(232, 97, 90, 0.18); }

.main { padding: 28px 32px 60px; max-width: 1200px; }
@media (max-width: 760px) { .main { padding: 22px 18px 40px; } }

/* ── Page chrome ──────────────────────────────────────────────────── */
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: 0.04em; }
.page-sub { color: var(--muted); margin: 0; max-width: 720px; line-height: 1.55; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.55; }
.muted { color: var(--muted); }

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(20, 26, 35, 0.7), rgba(13, 17, 23, 0.7));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.card h2 { margin: 0 0 12px; font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: linear-gradient(180deg, rgba(22, 29, 40, 0.85), rgba(12, 16, 22, 0.85));
  border: 1px solid var(--line);
  border-radius: 14px; padding: 16px;
}
.stat-label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 700; margin: 6px 0 4px; color: var(--gold); text-shadow: 0 0 18px hsla(40, 80%, 55%, 0.18); }
.stat-foot  { color: var(--muted); font-size: 12px; }

/* Quick links */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.quick {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--text);
}
.quick:hover { border-color: var(--line-strong); background: hsla(40, 80%, 55%, 0.04); }
.quick strong { color: var(--gold); letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.quick span { color: var(--muted); font-size: 12px; line-height: 1.55; }

/* ── Forms ────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.field > span small { font-weight: 400; opacity: 0.8; text-transform: none; letter-spacing: 0.05em; }
.field input[type=text],
.field input[type=email],
.field input[type=url],
.field input[type=password],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px hsla(40, 80%, 55%, 0.15);
}
.field textarea { resize: vertical; min-height: 80px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.field output { color: var(--gold); font-size: 12px; letter-spacing: 0.15em; text-align: right; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.align-end { align-items: end; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text); font-size: 13px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

.actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.btn-primary, .btn-secondary, .btn-danger, .btn-tiny {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, hsl(40, 70%, 45%) 100%);
  color: #1a1408;
  box-shadow: 0 6px 20px hsla(40, 80%, 55%, 0.28);
  border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--line);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-strong); }
.btn-danger {
  background: rgba(232, 97, 90, 0.12);
  color: var(--danger);
  border-color: rgba(232, 97, 90, 0.45);
}
.btn-danger:hover { background: rgba(232, 97, 90, 0.22); }
.btn-tiny {
  font-size: 11px; padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  border-color: var(--line); cursor: pointer;
  display: inline-block;
}
.btn-tiny:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-strong); }

button:active { transform: scale(0.97); }

/* ── Form rows (users page) ───────────────────────────────────────── */
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-row input, .form-row select {
  flex: 1; min-width: 120px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px; color: var(--text); font: inherit;
}
.form-row input:focus, .form-row select:focus { border-color: var(--line-strong); }

/* ── Tables ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.users-table th {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  font-weight: 600;
}
.users-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.ta-right { text-align: right; }
.expired { color: var(--danger); }
.badge-bad {
  display: inline-block;
  background: rgba(232, 97, 90, 0.15);
  color: var(--danger);
  border: 1px solid rgba(232, 97, 90, 0.35);
  border-radius: 999px;
  padding: 2px 8px; font-size: 10px; letter-spacing: 0.15em;
}

.row-actions summary { list-style: none; cursor: pointer; }
.row-actions summary::-webkit-details-marker { display: none; }
.row-action-pop {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left; min-width: 280px;
}
.row-form { display: flex; flex-direction: column; gap: 6px; }
.row-form label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.row-form input, .row-form select {
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--text); font: inherit;
}
.row-form details summary { color: var(--gold); cursor: pointer; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; padding: 4px 0; }

/* ── Flashes ──────────────────────────────────────────────────────── */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid;
}
.flash-success { background: rgba(86, 192, 141, 0.1); color: var(--good);   border-color: rgba(86, 192, 141, 0.35); }
.flash-error   { background: rgba(232, 97, 90, 0.1);  color: var(--danger); border-color: rgba(232, 97, 90, 0.35); }
.flash-info    { background: rgba(226, 177, 80, 0.1); color: var(--warn);   border-color: rgba(226, 177, 80, 0.35); }

/* ── Dashboard hero (Admin / Notifications) ───────────────────────── */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 26px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(22, 29, 40, 0.85), rgba(8, 12, 18, 0.92));
  color: var(--text);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 80% -10%, hsla(40, 80%, 55%, 0.18), transparent 60%);
  opacity: 0.7;
}
.hero-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow), 0 0 60px hsla(40, 80%, 55%, 0.22);
}
.hero-classic::after {
  background: radial-gradient(circle at 80% -10%, hsla(200, 70%, 50%, 0.20), transparent 60%);
}
.hero-broadcast::after {
  background: radial-gradient(circle at 80% -10%, hsla(40, 90%, 55%, 0.28), transparent 60%);
}
.hero-ico {
  font-size: 32px;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), hsl(40, 70%, 40%));
  color: #1a1408;
  box-shadow: 0 0 24px hsla(40, 80%, 55%, 0.35);
}
.hero-classic .hero-ico {
  background: linear-gradient(135deg, hsl(200, 70%, 60%), hsl(200, 70%, 35%));
  color: #fff;
  box-shadow: 0 0 24px hsla(200, 70%, 50%, 0.35);
}
.hero-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 6px;
  color: var(--text);
}
.hero-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 460px;
}
.hero-cta {
  margin-top: auto;
  align-self: flex-start;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  padding-top: 14px;
}
.hero-classic .hero-cta { color: hsl(200, 70%, 65%); }
