/*
@CODE-LABEL v1
id: title-renamer-ui-style
parent: title-renamer-ui
scope: module
name: Review page styles
does: Light/dark tokens, drop zone, progress bar, dense review table with flagged-row highlighting, sticky export footer.
for: Visual changes to the review page.
stack: css
reuse: Colours are tokens on :root with a prefers-color-scheme dark override.
tags: frontend, css, theming
updated: 2026-10-15
@END-LABEL
*/
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --line: #dfe3e8;
  --accent: #0f6e6e;
  --accent-ink: #ffffff;
  --ok: #1d7a3e;
  --ok-bg: #e5f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --warn-line: #e3a72f;
  --bad: #a32020;
  --ai: #3c4fb8;
  --ai-bg: #e9ecfb;
  --input-bg: #ffffff;
  --row-flag: #fffaf0;
  --row-excl: #f1f2f4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --panel: #1a1d21;
    --text: #e6e8eb;
    --muted: #9aa3ae;
    --line: #2d3238;
    --accent: #3fb0a8;
    --accent-ink: #08201f;
    --ok: #63c787;
    --ok-bg: #18301f;
    --warn: #f0c060;
    --warn-bg: #3a2d10;
    --warn-line: #b8862a;
    --bad: #ff7b7b;
    --ai: #a9b5ff;
    --ai-bg: #22284a;
    --input-bg: #121417;
    --row-flag: #241f14;
    --row-excl: #16181b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 80px;
}
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.muted { color: var(--muted); }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.org { color: var(--muted); font-size: 13px; }
.ai-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--muted);
  white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis;
}
.ai-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.ai-pill.on .dot { background: var(--ok); }
.ai-pill.down .dot { background: var(--bad); }
.ai-pill.on { color: var(--text); }

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

.drop {
  border: 2px dashed var(--line); border-radius: 10px; background: var(--panel);
  padding: 40px 16px; text-align: center; transition: border-color .15s, background .15s;
}
.drop.compact { padding: 14px 16px; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.drop-inner { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.drop strong { font-size: 16px; }
.drop.compact strong { font-size: 14px; }
.drop small { color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }

.progress { margin: 16px 0 4px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.progress-text { margin-top: 6px; color: var(--muted); font-size: 13px; }

.toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 18px 0 10px;
}
.filters { display: flex; gap: 4px; flex-wrap: wrap; }
.filters button {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 5px 12px; border-radius: 6px;
}
.filters button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filters span { opacity: .75; margin-left: 2px; }
.ai-stats { color: var(--muted); font-size: 12.5px; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 1100px; }
th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 1;
}
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.flagged td { background: var(--row-flag); }
tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--warn-line); }
tr.excluded td { background: var(--row-excl); color: var(--muted); }
tr.excluded input { text-decoration: line-through; }
tr.hidden { display: none; }
.c-n { width: 40px; color: var(--muted); }
.c-orig { width: 20%; }
.c-date { width: 120px; }
.c-legal { width: 145px; }
.c-status { width: 24%; }
.c-act { width: 110px; }
.orig { word-break: break-all; }
.meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

input.cell {
  width: 100%; font: inherit; color: var(--text); background: var(--input-bg);
  border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px;
}
input.cell:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
input.cell.manual { border-color: var(--accent); }
input.cell.invalid { border-color: var(--bad); }
input.cell:disabled { background: transparent; border-color: transparent; }
.cell-err { color: var(--bad); font-size: 12px; margin-top: 3px; }

.badges { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .02em; white-space: nowrap;
}
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-flag { background: var(--warn-bg); color: var(--warn); }
.b-excl { background: var(--line); color: var(--muted); }
.b-pending { background: var(--line); color: var(--muted); }
.b-ai { background: var(--ai-bg); color: var(--ai); }
.b-ai-bad { background: var(--warn-bg); color: var(--warn); }
.b-ai-off { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.reasons { margin: 5px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--warn); }
tr.excluded .reasons { color: var(--muted); }
.compare { margin-top: 6px; display: grid; gap: 4px; font-size: 12.5px; }
.compare .pair { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.compare .k { color: var(--muted); min-width: 34px; }
.pick {
  border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 4px;
  padding: 1px 7px; font-size: 12px;
}
.pick:hover { border-color: var(--accent); }
.pick .src { color: var(--muted); margin-right: 4px; }
.actions { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.actions button {
  background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 5px;
  padding: 3px 8px; font-size: 12.5px;
}
.actions button.accept { border-color: var(--ok); color: var(--ok); }

.footer {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel);
  border-top: 1px solid var(--line); flex-wrap: wrap;
}
.footer-info { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.footer-actions { display: flex; gap: 8px; }
.primary {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 9px 18px;
  font-weight: 600;
}
.secondary {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 14px;
}
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); background: var(--text);
  color: var(--bg); padding: 9px 16px; border-radius: 6px; font-size: 13px; max-width: 90vw;
}

@media (max-width: 700px) {
  .top, main, .footer { padding-left: 16px; padding-right: 16px; }
  .ai-pill { max-width: 100%; }
  .top { flex-wrap: wrap; }
}

/* login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 28px 24px; margin: 0;
}
.login-card h1 { margin: 0; font-size: 20px; }
.login-card .org { margin: 2px 0 20px; }
.login-card form { display: grid; gap: 6px; }
.login-card label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.login-card .primary { margin-top: 16px; }
.user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.user-box button { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 10px; }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
