:root {
  color-scheme: dark;
  --bg: #070706;
  --panel: rgba(19, 19, 16, 0.92);
  --panel-strong: #11110f;
  --line: rgba(224, 180, 54, 0.18);
  --gold: #e0b436;
  --gold-2: #ffd86a;
  --text: #f7f3df;
  --muted: #aaa28d;
  --danger: #ff5f5f;
  --green: #24d65a;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(224, 180, 54, 0.18), transparent 28rem),
    linear-gradient(145deg, #080806 0%, #11100b 44%, #030303 100%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

button, input, select, textarea { font: inherit; }

.shell {
  width: min(1420px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar, .hero, .card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 24px;
  position: sticky;
  top: 14px;
  z-index: 10;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2.5rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.8rem, 4vw, 4.6rem); line-height: 0.96; letter-spacing: -0.07em; max-width: 850px; }
h3 { font-size: 1.05rem; }

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  margin-bottom: 7px;
}

.hero {
  margin: 20px 0;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 5vw, 54px);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(224, 180, 54, 0.18), transparent 36%),
    var(--panel);
}

.hero p:not(.eyebrow) {
  color: var(--muted);
  margin-top: 16px;
  max-width: 620px;
  line-height: 1.6;
}

.status-card {
  min-width: 210px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(36, 214, 90, 0.22);
  background: rgba(36, 214, 90, 0.07);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 20px rgba(36, 214, 90, 0.8);
  margin-right: 8px;
}

.status-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.card {
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.session-pill {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
}

.grid-form.compact { grid-template-columns: repeat(3, minmax(180px, 1fr)); }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(224, 180, 54, 0.18);
  border-radius: 14px;
  background: #070707;
  color: var(--text);
  outline: none;
  padding: 12px 13px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(224, 180, 54, 0.11);
}

textarea { resize: vertical; }

.span-2 { grid-column: span 2; }

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

button:hover { transform: translateY(-1px); filter: brightness(1.05); }

.primary {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #090907;
}

.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.danger {
  background: rgba(255, 95, 95, 0.13);
  color: #ffd1d1;
  border: 1px solid rgba(255, 95, 95, 0.28);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.search { min-width: 220px; }

.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.06); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 13px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); text-align: left; vertical-align: middle; }
th { color: var(--gold); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; background: rgba(224, 180, 54, 0.06); }
td { color: #e9e4ce; }

.user-name { font-weight: 900; color: var(--text); }
.user-email { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: rgba(224, 180, 54, 0.1); color: var(--gold-2); font-weight: 900; font-size: 0.78rem; }
.badge.green { background: rgba(36, 214, 90, 0.11); color: #8fffaa; }
.badge.red { background: rgba(255, 95, 95, 0.11); color: #ffbbbb; }
.badge.gray { background: rgba(255, 255, 255, 0.08); color: #d6d0bf; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions button { padding: 8px 10px; border-radius: 10px; font-size: 0.78rem; }

.hint {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.notif-editor-wrap {
  display: grid;
  gap: 12px;
}

.notif-label {
  display: grid;
  gap: 9px;
}

.notif-label textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.55;
}

.notif-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.notif-meta-row .hint {
  margin-top: 0;
}

.notif-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.notif-status.success {
  color: #8fffaa;
}

.notif-status.error {
  color: #ffbbbb;
}

.setting-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 16px;
  align-items: end;
}

.setting-summary {
  display: grid;
  gap: 6px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid rgba(224, 180, 54, 0.14);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.setting-summary strong {
  color: var(--gold-2);
  font-size: 0.9rem;
}

code {
  color: var(--gold-2);
  background: rgba(224, 180, 54, 0.08);
  padding: 2px 6px;
  border-radius: 7px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 16px;
  border-radius: 16px;
  background: #151511;
  color: var(--text);
  border: 1px solid var(--line);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: 0.2s ease;
  box-shadow: var(--shadow);
}

.toast.show { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .hero, .topbar, .card-head { align-items: flex-start; flex-direction: column; }
  .grid-form, .grid-form.compact { grid-template-columns: 1fr; }
  .setting-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .actions { justify-content: flex-start; width: 100%; }
  .search { min-width: 100%; }
}
