@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #0f1216;
  --panel: #171b21;
  --panel-2: #1d222a;
  --border: #262c35;
  --text: #e8e6e1;
  --text-dim: #9aa0aa;
  --accent: #d9a441;
  --accent-soft: #d9a44122;
  --teal: #4fd1c5;
  --danger: #e2574c;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; margin: 0 0 .3em; letter-spacing: -0.01em; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

button, .btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: .55em 1.1em;
  transition: border-color .15s ease, background .15s ease;
}
button:hover, .btn:hover { border-color: var(--accent); }
button:focus-visible, .btn:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #14110a; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-ghost { background: transparent; }

input, textarea {
  font: inherit;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .6em .8em;
  width: 100%;
}
label { display: block; font-size: .85em; color: var(--text-dim); margin: 1em 0 .35em; }

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.auth-card .kicker { color: var(--accent); font-size: .8em; margin-bottom: .5em; }
.auth-card p.sub { color: var(--text-dim); margin-top: 0; }
.auth-toggle { display: flex; gap: 8px; margin-top: 1.5em; }
.auth-toggle button { flex: 1; }
.auth-toggle button.active { border-color: var(--accent); color: var(--accent); }
.msg { margin-top: 1em; font-size: .9em; padding: .7em .9em; border-radius: 8px; display: none; }
.msg.show { display: block; }
.msg.err { background: #e2574c1a; color: #f18a82; border: 1px solid #e2574c44; }
.msg.ok { background: #4fd1c51a; color: #79e3d9; border: 1px solid #4fd1c544; }

/* ---- App shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar .brand { font-family: 'Fraunces', serif; font-size: 1.15em; margin-bottom: 28px; padding: 0 8px; }
.sidebar .brand .dot { color: var(--accent); }
.nav-link {
  display: block;
  padding: .6em .8em;
  border-radius: 8px;
  color: var(--text-dim);
  margin-bottom: 2px;
  font-weight: 500;
}
.nav-link:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.sidebar .spacer { flex: 1; }
.role-badge {
  display: inline-block;
  font-size: .72em;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .25em .6em;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  text-transform: capitalize;
}
.main { flex: 1; padding: 32px 40px; max-width: 1000px; }
.main-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.section-sub { color: var(--text-dim); margin-bottom: 28px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}
.card h3 { font-size: 1.02em; margin-bottom: 6px; }
.card p { color: var(--text-dim); font-size: .88em; margin: 0 0 10px; }
.card .meta { font-size: .78em; color: var(--text-dim); margin-bottom: 10px; }
.card .row { display: flex; gap: 8px; }
.card .row button, .card .row a.btn { font-size: .82em; padding: .4em .8em; }

.empty { color: var(--text-dim); padding: 40px 0; text-align: center; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.list-row .who { font-weight: 500; }
.list-row .when { color: var(--text-dim); font-size: .82em; }
.list-row .actions { display: flex; gap: 8px; }

dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 420px;
}
dialog::backdrop { background: #000a; }

video { width: 100%; border-radius: 8px; background: #000; }

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; }
  .sidebar .brand { margin: 0 12px 0 0; }
  .sidebar .spacer { display: none; }
  .main { padding: 20px; }
}
