/* =========================================================================
   Transcribe — Bauer Media Group internal tool
   Colours matched to ToneWatch. Fine-tune the --brand-* values if the live
   ToneWatch gradient differs, and drop the shared Bauer logo into
   static/logo.png (white version, as used on ToneWatch/StreamWatch).
   ========================================================================= */
:root {
  --brand-start:  #4a2a8f;   /* header gradient, left  (deep violet) */
  --brand-mid:    #7c2cc4;   /* header gradient, middle */
  --brand-end:    #a621d0;   /* header gradient, right (bright purple) */
  --brand-accent: #7c3aed;   /* solid action buttons, links */
  --accent-teal:  #14b8a6;   /* stat-card top strip end, accents */
  --pos-green:    #16a34a;

  --bg:     #f4f4f7;
  --card:   #ffffff;
  --line:   #e7e4f0;
  --ink:    #17162f;         /* headings / big numbers */
  --text:   #1f1d38;
  --muted:  #7d7898;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(23,22,47,.06), 0 10px 30px rgba(23,22,47,.05);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* --- Header --------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 34px;
  background: linear-gradient(100deg, var(--brand-start) 0%, var(--brand-mid) 55%, var(--brand-end) 100%);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: #fff; }
.brand-logo { height: 44px; width: auto; display: block; filter: brightness(0) invert(1); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.brand-sub { font-weight: 500; font-size: 11px; opacity: .78; text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }

.btn-outline-light {
  display: inline-block; text-decoration: none;
  color: #fff; font-weight: 600; font-size: 14px;
  padding: 9px 20px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.55); background: transparent;
}
.btn-outline-light:hover { background: rgba(255,255,255,.12); }

.wrap { max-width: 1080px; margin: 30px auto; padding: 0 24px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 34px 0; }

/* --- Buttons / links ------------------------------------------------------ */
.btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--brand-accent); color: #fff;
  font-weight: 600; font-size: 15px; font-family: inherit;
  padding: 11px 22px; border-radius: 10px; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn.small { padding: 8px 15px; font-size: 14px; }
.btn.ghost { background: #fff; color: var(--brand-accent); border: 1px solid var(--line); }
.link { color: var(--brand-accent); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.back { display: inline-block; margin-bottom: 6px; font-size: 14px; }

/* --- Flash / errors ------------------------------------------------------- */
.flash { background: #fff4e5; border: 1px solid #ffd8a8; color: #8a5300; padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; }
.flash p { margin: 0; }
.error-box { background: #fff0f0; border: 1px solid #ffc9c9; color: #a12626; padding: 14px 16px; border-radius: 10px; margin: 18px 0; }

/* --- Login ---------------------------------------------------------------- */
.login-card { max-width: 380px; margin: 70px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; color: var(--ink); }
.login-card input { width: 100%; padding: 12px; margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 15px; }
.login-card .btn { width: 100%; }

/* --- Upload panel --------------------------------------------------------- */
.upload-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; margin-bottom: 24px; }
.upload-panel h2 { margin: 0 0 18px; font-size: 18px; color: var(--ink); }
.upload-form .field { display: block; margin-bottom: 16px; }
.upload-form .field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.upload-form input[type=file] { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 14px; background: #faf9fc; }
.hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* --- Stat cards (ToneWatch style) ---------------------------------------- */
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.statcard {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px;
}
.statcard::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand-accent), var(--accent-teal));
}
.statlabel { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 12px; }
.statnum { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.statnum .unit { font-size: 20px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.statdesc { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* --- Jobs table ----------------------------------------------------------- */
.jobs { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.jobs-head { padding: 22px 24px 6px; }
.jobs-head h2 { margin: 0; font-size: 18px; color: var(--ink); }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 14px 24px; border-bottom: 1px solid var(--line); }
tbody td { padding: 14px 24px; border-bottom: 1px solid var(--line); font-size: 14px; }
tbody tr:last-child td { border-bottom: none; }
.filecell { font-weight: 500; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; color: var(--muted); }
.muted { color: var(--muted); }
.center { text-align: center; }

/* --- Status pills --------------------------------------------------------- */
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.pill-pending    { background: #eef0f5; color: #5a5670; }
.pill-processing { background: #ece4fb; color: #6d28d9; }
.pill-done       { background: #e4f7ec; color: var(--pos-green); }
.pill-error      { background: #ffe9e9; color: #c53030; }

/* --- Job detail ----------------------------------------------------------- */
.job-head h2 { margin: 4px 0; font-size: 20px; color: var(--ink); word-break: break-word; }
.job-meta { display: flex; gap: 28px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 16px 0; }
.job-meta > div { display: flex; flex-direction: column; gap: 4px; }
.job-meta .k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.working { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 16px 0; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand-accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.downloads { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }

.transcript { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; }
.transcript .seg { margin: 0 0 10px; display: flex; gap: 14px; align-items: baseline; }
.transcript .seg .t { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; min-width: 44px; }

@media (max-width: 820px) {
  .statgrid { grid-template-columns: repeat(2, 1fr); }
  .filecell { max-width: 200px; }
  .topbar { padding: 16px 20px; }
  .brand-sub { display: none; }
}
