:root {
  --bg: #080808;
  --surface: #111;
  --surface2: #171717;
  --line: rgba(201, 169, 110, 0.18);
  --line2: rgba(201, 169, 110, 0.35);
  --gold: #c9a96e;
  --text: #fff8ea;
  --muted: rgba(255, 255, 255, 0.56);
  --green: #68d89b;
  --red: #ff7777;
}

body.admin {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, rgba(201, 169, 110, 0.12), transparent 32%), var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] { display: none !important; }

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  background: rgba(8, 8, 8, 0.9);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.brand-box {
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(201, 169, 110, 0.1), rgba(255,255,255,0.02));
}

.brand-box strong,
.login-card h1,
.topbar h1,
.snapshot h2,
.section-title h2 {
  font-family: Georgia, "Times New Roman", serif;
}

.brand-box strong {
  display: block;
  font-size: 30px;
  letter-spacing: 0.04em;
}

.brand-box span,
.login-card span,
.brand-box small,
.eyebrow {
  color: var(--gold);
}

.brand-box small,
.eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin: 18px 0;
}

.side-nav a,
.logout {
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  transition: 160ms ease;
}

.side-nav a:hover,
.side-nav a.active,
.logout:hover {
  color: var(--gold);
  background: rgba(201, 169, 110, 0.08);
  border-color: var(--line);
}

.logout {
  width: 100%;
  cursor: pointer;
}

.main {
  min-width: 0;
  padding: 22px clamp(18px, 3vw, 34px) 44px;
}

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

.topbar h1 {
  margin: 6px 0 0;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live i,
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(104, 216, 155, 0.12);
}

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

input,
select {
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--gold);
  background: rgba(201, 169, 110, 0.06);
  border: 1px solid var(--line2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.admin-btn.primary {
  color: #080808;
  background: var(--gold);
  border-color: var(--gold);
}

.dashboard-section { display: none; }
.dashboard-section.active { display: block; animation: fadeUp 280ms ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

.snapshot {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(201,169,110,0.12), rgba(255,255,255,0.02)), var(--surface);
  border: 1px solid var(--line);
}

.snapshot h2 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.snapshot-live {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 22px;
  background: var(--surface2);
  border: 1px solid var(--line2);
}

.snapshot-live span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.snapshot-live strong { color: var(--gold); font-size: 42px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi,
.panel,
.status-card {
  background: rgba(17, 17, 17, 0.88);
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(0,0,0,0.22);
}

.kpi {
  min-height: 126px;
  padding: 16px;
}

.kpi .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kpi .value {
  display: block;
  margin: 14px 0 8px;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 950;
}

.kpi .delta {
  color: var(--green);
  font-size: 12px;
}

.spark { display: none; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.wide { grid-column: 1 / -1; }

.panel h3,
.panel-head h3 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.panel-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head span,
.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 8px;
  height: 230px;
  align-items: end;
  padding-top: 16px;
}

.bar {
  position: relative;
  min-height: 6px;
  background: linear-gradient(180deg, #e7c982, #816136);
  animation: grow 500ms ease both;
}

@keyframes grow { from { height: 4% !important; opacity: 0.35; } }

.bar span {
  position: absolute;
  left: 50%;
  bottom: -23px;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.38);
  font-size: 10px;
}

.mini-list,
.funnel-visual {
  display: grid;
  gap: 9px;
}

.mini-row,
.feed-item,
.insight,
.funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.72);
}

.mini-row strong,
.feed-item strong,
.insight strong {
  color: var(--text);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: rgba(255,255,255,0.035);
  border: 1px dashed rgba(201,169,110,0.24);
  line-height: 1.6;
}

.funnel-step {
  display: grid;
  grid-template-columns: 120px 1fr 86px;
}

.funnel-track {
  height: 12px;
  background: rgba(255,255,255,0.07);
}

.funnel-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), rgba(201,169,110,0.18));
}

.section-title {
  margin: 4px 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.status-card {
  padding: 14px;
}

.status-card span {
  color: var(--muted);
  font-size: 12px;
}

.status-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.table-wrap { overflow: auto; }
table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td { color: rgba(255,255,255,0.74); }
.status-select { min-width: 128px; }

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line2);
}

.login-card h1 {
  margin: 10px 0;
  font-size: 42px;
}

.login-card p {
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 14px;
}

.status-line {
  min-height: 22px;
  color: var(--gold);
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
  .topbar, .snapshot { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .toolbar { justify-content: flex-start; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .main { padding: 14px; }
  .kpi-grid, .status-grid, .side-nav { grid-template-columns: 1fr; }
  .toolbar > * { width: 100%; }
  .funnel-step { grid-template-columns: 1fr; }
}
