:root {
  --bg: #f3f1ec;
  --ink: #1c1916;
  --muted: #6a635b;
  --line: #ddd6cc;
  --panel: #fffdf8;
  --accent: #1b4332;
  --accent-hover: #16382a;
  --danger: #8a2f1f;
  --selected: #e7efe9;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Figtree, "Segoe UI", sans-serif;
}

.kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

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

.login-card {
  width: min(420px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-card h1 { margin-bottom: 8px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

input:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #f6f3ec;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--accent-hover); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: #ece7de; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #732618; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.error { margin: 0; color: var(--danger); font-size: 14px; }

#dash-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.split {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 1fr);
  min-height: 0;
}

.list-pane, .detail-pane {
  min-height: 0;
  overflow: auto;
}

.list-pane { border-right: 1px solid var(--line); }

.table-wrap { padding: 8px 0 40px; }

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

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

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

tbody tr { cursor: pointer; }
tbody tr:hover { background: #efeae2; }
tbody tr.active { background: var(--selected); }

.name { font-weight: 600; }
.sub { color: var(--muted); font-size: 12px; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e3eee8;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.pill.missing {
  background: #f3e6e2;
  color: var(--danger);
}

.empty, .placeholder {
  padding: 28px 24px;
  color: var(--muted);
}

.detail-pane { padding: 24px; background: var(--panel); }

.detail-pane h2 {
  margin: 0 0 4px;
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  font-weight: 500;
}

.meta { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  margin: 0 0 24px;
  font-size: 14px;
}

dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }
dd a { color: var(--accent); }

.video-box video {
  width: 100%;
  max-height: 360px;
  background: #111;
  border-radius: 10px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .list-pane { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
}
