/* Redliner console — sidebar app shell + analytics components (on style.css tokens). */
:root { --rl-sidebar: 232px; }
body { background: var(--bg); }

/* ---- app shell: fixed sidebar + scrolling main ---- */
.shell { display: grid; grid-template-columns: var(--rl-sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: inherit; }
.sidebar .brand-name { font-weight: 800; letter-spacing: -.01em; }
.sidebar .brand-sub { display: block; font-size: 11.5px; color: var(--muted); }
.snav { padding: 6px 10px; overflow-y: auto; flex: 1; }
.snav .group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); margin: 14px 12px 5px; }
.snav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; color: var(--ink-2);
  font-size: 14px; font-weight: 550; text-decoration: none; margin: 1px 0; }
.snav a .ic { width: 18px; text-align: center; opacity: .8; }
.snav a:hover { background: var(--surface-2); color: var(--ink); }
.snav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-badge { margin-left: auto; background: var(--sev-high); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; text-align: center; border-radius: 999px; padding: 1px 6px; }
.sidebar .who { border-top: 1px solid var(--border); padding: 12px 16px; font-size: 13px; color: var(--muted); }
.sidebar .who b { color: var(--ink); }
.main { min-width: 0; display: flex; flex-direction: column; }
.appbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 26px;
  border-bottom: 1px solid var(--border); background: var(--bar-bg); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.appbar .crumb { color: var(--muted); font-size: 13px; }
.content { padding: 22px 26px 60px; max-width: 1240px; }
@media (max-width: 720px){ .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .snav { display: flex; flex-wrap: wrap; } .snav .group, .sidebar .who { display: none; } }

.page-head { margin: 2px 0 18px; }
.page-head h1 { font-size: 23px; margin: 0 0 2px; letter-spacing: -.015em; }
.page-head .sub { color: var(--muted); font-size: 14px; }

/* ---- KPI tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 14px 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 15px 17px; box-shadow: var(--shadow-sm); }
.tile .label { color: var(--muted); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.tile .value { font-size: 27px; font-weight: 760; line-height: 1.05; margin-top: 5px; }
.tile .value small { font-size: 14px; font-weight: 500; color: var(--muted); }
.tile .delta { font-size: 12px; margin-top: 3px; color: var(--muted); }
.tile.accent { border-left: 3px solid var(--brand); }
.tile.good { border-left: 3px solid #16a34a; } .tile.warn { border-left: 3px solid var(--sev-high); }
.tile.bad { border-left: 3px solid var(--sev-critical); }
.tile .spark { margin-top: 8px; }

/* ---- chart cards ---- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.charts.three { grid-template-columns: 2fr 2fr 1fr; }
@media (max-width: 820px){ .charts, .charts.three { grid-template-columns: 1fr; } }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.chart-card h3 { margin: 0 0 2px; font-size: 14px; }
.chart-card .cap { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.chart-card .big { font-size: 26px; font-weight: 750; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }

/* ---- status pills ---- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.pill-done { background: #dcfce7; color: #166534; } .pill-error { background: #fee2e2; color: #991b1b; }
.pill-awaiting_approval,.pill-insufficient_credits { background: #fef3c7; color: #92400e; }
.pill-reviewing,.pill-queued_review,.pill-rendering,.pill-queued,.pill-ingesting,.pill-writing { background: #dbeafe; color: #1e40af; }
:root[data-theme="dark"] .pill-done{background:#11301f;color:#5fd99a}
:root[data-theme="dark"] .pill-error{background:#3a191b;color:#f3a6a9}
:root[data-theme="dark"] .pill-awaiting_approval,:root[data-theme="dark"] .pill-insufficient_credits{background:#38290f;color:#f0c069}
:root[data-theme="dark"] .pill-reviewing,:root[data-theme="dark"] .pill-queued_review,:root[data-theme="dark"] .pill-rendering,:root[data-theme="dark"] .pill-queued,:root[data-theme="dark"] .pill-ingesting,:root[data-theme="dark"] .pill-writing{background:#16243f;color:#9cc1ff}

.rv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rv-table th { text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.rv-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.rv-table tr:hover td { background: var(--surface-2); }
.section-title { font-size: 15px; font-weight: 700; margin: 24px 0 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px; border: 1px dashed var(--border); border-radius: 12px; }

/* ---- polished form controls (kills the raw native select/input look) ---- */
.content input:not([type=checkbox]):not([type=radio]):not([type=file]),
.content select, .content textarea,
.login-field input, .login-field select, .login-field textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px;
  width: 100%; box-sizing: border-box; line-height: 1.3;
  transition: border-color .12s ease, box-shadow .12s ease; }
.content input:hover, .content select:hover, .content textarea:hover { border-color: var(--muted); }
.content input:focus, .content select:focus, .content textarea:focus,
.login-field input:focus, .login-field select:focus, .login-field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.content select, .login-field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5l4 4 4-4' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.content label > span, .login-field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.content textarea { min-height: 64px; resize: vertical; }

/* ---- review presets (quick-start chips on the new-review form) ---- */
.presets-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.presets-label { font-size: 12.5px; color: var(--muted); }
.preset-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 6px 3px 12px; font-size: 13px; }
.preset-chip.on { border-color: var(--brand); background: var(--brand-soft); }
.preset-chip a { text-decoration: none; color: var(--ink); font-weight: 550; }
.preset-x { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 12px; padding: 0 2px; line-height: 1; }
.preset-x:hover { color: var(--bad-fg, #b91c1c); }

/* ---- review list filter bar ---- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.filter-bar input, .filter-bar select { width: auto; }
.filter-bar .active-filter { border-color: var(--sev-high); color: var(--sev-high); }

/* ---- notifications: appbar bell + feed ---- */
.bell { position: relative; text-decoration: none; font-size: 17px; padding: 4px 6px; border-radius: 9px; line-height: 1; }
.bell:hover { background: var(--surface-2); }
.bell-dot { position: absolute; top: -2px; right: -3px; background: var(--sev-high); color: #fff; font-size: 10px; font-weight: 700; min-width: 15px; text-align: center; border-radius: 999px; padding: 0 4px; }
.feed { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.feed-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--ink); }
.feed-row:last-child { border-bottom: none; }
.feed-row:hover { background: var(--surface-2); }
.feed-ic { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%; font-size: 12px; flex: none; }
.feed-body { flex: 1; min-width: 0; }
.feed-title { display: block; font-weight: 600; font-size: 14px; }
.feed-meta { display: block; font-size: 12.5px; color: var(--muted); }
.feed-when { font-size: 12px; white-space: nowrap; }
