:root {
  --bg: #0f0c0a;
  --bg-elevated: #171210;
  --panel: rgba(24, 19, 16, 0.92);
  --panel-solid: #1d1714;
  --panel-soft: #271f1b;
  --panel-softest: #2d241f;
  --line: rgba(214, 177, 76, 0.16);
  --line-strong: rgba(214, 177, 76, 0.32);
  --gold: #d6b14c;
  --gold-soft: #f0ddb0;
  --text: #f7f2e8;
  --muted: #bea98c;
  --muted-strong: #d6c6ab;
  --success: #7ab67b;
  --danger: #ba5858;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 177, 76, 0.1), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(160deg, #0f0c0a 0%, #15110f 42%, #0d0a09 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 92%);
}

h1,
h2,
h3,
.eyebrow {
  font-family: "Cormorant Garamond", serif;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--gold);
  font-size: 0.78rem;
}

.subtext,
.admin-meta span,
.table td,
.table th,
label span,
input,
textarea,
select,
.hint,
.empty-state p {
  color: var(--muted);
}

.login-shell,
.app-shell {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card,
.card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(30, 24, 20, 0.96), rgba(20, 16, 13, 0.95));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card {
  width: min(470px, 100%);
  padding: 34px;
}

.login-card h1 {
  font-size: 3rem;
  line-height: 0.95;
  margin-bottom: 8px;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

input,
textarea,
select,
button {
  font: inherit;
  border-radius: 15px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-soft);
  padding: 14px 16px;
  transition: border-color 120ms ease, background 120ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--line-strong);
  background: var(--panel-softest);
}

button {
  border: 0;
  background: linear-gradient(135deg, #efcb6a 0%, #b98920 100%);
  color: #1b140d;
  padding: 14px 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  box-shadow: 0 12px 28px rgba(185, 137, 32, 0.18);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(185, 137, 32, 0.22);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

button.ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.error {
  color: #ffb7b7;
  min-height: 1.2rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(14, 11, 9, 0.96), rgba(10, 8, 7, 0.9)),
    radial-gradient(circle at top, rgba(214, 177, 76, 0.08), transparent 36%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar h1 {
  margin-bottom: 0;
  font-size: 2.4rem;
  line-height: 0.88;
}

.nav {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.nav button {
  background: transparent;
  color: var(--text);
  text-align: left;
  border: 1px solid transparent;
  padding: 15px 16px;
  box-shadow: none;
}

.nav button.active {
  background: linear-gradient(180deg, rgba(214, 177, 76, 0.16), rgba(214, 177, 76, 0.08));
  border-color: var(--line-strong);
}

.admin-meta {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-meta p {
  margin-bottom: 4px;
  font-weight: 700;
}

.admin-meta span {
  display: block;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.admin-meta a {
  color: var(--gold-soft);
  text-decoration: none;
  font-weight: 700;
}

.content {
  padding: 28px;
}

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

.content-header h2 {
  margin-bottom: 0;
  font-size: 2.55rem;
  line-height: 0.95;
}

#panel-root {
  display: grid;
  gap: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.card {
  padding: 22px;
}

.card h3 {
  margin-bottom: 12px;
  font-size: 1.8rem;
}

.stat {
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(214, 177, 76, 0.16), transparent 70%);
}

.stat strong {
  display: block;
  font-size: 2.4rem;
  color: var(--gold-soft);
  margin-bottom: 6px;
}

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted-strong);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--gold-soft);
  background: rgba(214, 177, 76, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
}

.pill.success {
  border-color: rgba(122, 182, 123, 0.32);
  color: #bfe3bf;
  background: rgba(122, 182, 123, 0.08);
}

.pill.danger {
  border-color: rgba(186, 88, 88, 0.32);
  color: #f1c0c0;
  background: rgba(186, 88, 88, 0.08);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions button.small {
  padding: 9px 12px;
  border-radius: 11px;
}

.danger {
  background: linear-gradient(135deg, #c86e6e, #9f3f3f);
  color: #fff;
}

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

.toolbar input {
  max-width: 280px;
}

.empty-state {
  padding: 24px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.metric {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.025);
}

.metric b {
  color: var(--text);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(21, 17, 14, 0.96);
  box-shadow: var(--shadow);
}

.toast.error {
  border-color: rgba(186, 88, 88, 0.42);
}

.loading-sheen {
  position: relative;
  overflow: hidden;
}

.loading-sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: sweep 1.2s infinite;
}

@keyframes sweep {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 24px;
  }

  .layout-2 {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 18px;
  }

  .content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .toast {
    left: 18px;
    right: 18px;
    bottom: 18px;
    max-width: none;
  }
}
