/* Dashboard styling. Follows the viewer's colour scheme — this gets opened on a
   phone at night as often as on a desktop. No framework, no CDN: one file the
   container serves itself. */

:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --text: #14171a;
  --muted: #6b7280;
  --line: #e2e5ea;
  --accent: #c4302b;          /* YouTube red, used sparingly */
  --accent-soft: #fdecec;
  --ok: #17803d;
  --ok-soft: #e7f6ec;
  --warn: #a15c07;
  --warn-soft: #fdf3e2;
  --err: #b42318;
  --err-soft: #fdeceb;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --panel: #171a1f;
    --panel-2: #1f242b;
    --text: #e6e8eb;
    --muted: #949aa4;
    --line: #2a3037;
    --accent: #ff4a45;
    --accent-soft: #2a1614;
    --ok: #4ade80;
    --ok-soft: #10241a;
    --warn: #fbbf24;
    --warn-soft: #2a2010;
    --err: #f87171;
    --err-soft: #2a1414;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

a { color: inherit; }
a:hover { color: var(--accent); }

/* --- layout --------------------------------------------------------------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
nav.tabs a {
  padding: 5px 11px;
  border-radius: 99px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}
nav.tabs a:hover { background: var(--panel-2); color: var(--text); }
nav.tabs a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.spacer { flex: 1 1 auto; }

main { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* --- panels & stats ------------------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.stat {
  flex: 1 1 130px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat b { display: block; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.stat small { color: var(--muted); font-size: 12px; }

/* --- bars ----------------------------------------------------------------- */
.bar {
  height: 6px;
  background: var(--panel-2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar > i.ok { background: var(--ok); }
.bar > i.warn { background: var(--warn); }

/* --- pills ---------------------------------------------------------------- */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--panel-2);
  color: var(--muted);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* --- video grid ----------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.12s, transform 0.12s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .dur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}

.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  /* Two lines then ellipsis: titles are meeting names and can run long. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { color: var(--muted); font-size: 12px; }
.card-pills { display: flex; flex-wrap: wrap; gap: 4px; }

/* --- forms & buttons ------------------------------------------------------ */
input[type="text"], input[type="password"], input[type="time"], input[type="number"], select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn {
  display: inline-block;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* --- tables --------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: var(--panel-2); }
.scroll-x { overflow-x: auto; }

/* --- detail page ---------------------------------------------------------- */
.detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

.transcript {
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 13.5px;
  white-space: pre-wrap;
  line-height: 1.6;
}
.transcript mark { background: var(--warn-soft); color: var(--warn); }

.summary { font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; }

.muted { color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* --- login ---------------------------------------------------------------- */
.login-wrap { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: 100%; max-width: 330px; }
