/* Pinnacl portal — on-brand styling.
   Brand: wordmark near-black #1b2430, brand blue #2f6fed, dark square #0f1626.
   Clean, clinical, calm. No framework; single stylesheet. */

:root {
  color-scheme: light;
  --brand-blue: #2f6fed;
  --brand-blue-press: #245bd0;
  --ink: #1b2430;
  --ink-soft: #5b6675;
  --ink-faint: #8b95a3;
  --line: #dbe2ec;
  --bg: #eef2f8;
  --bg-grad-top: #f4f7fc;
  --card: #ffffff;
  --error: #c2334a;
  --ok: #1f8a4c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(27,36,48,.05), 0 8px 24px rgba(27,36,48,.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-grad-top) 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; color: var(--ink-soft); }

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
  appearance: none; border: 0; border-radius: 10px;
  background: var(--brand-blue); color: #fff;
  font-size: 15px; font-weight: 600; padding: 11px 22px; cursor: pointer;
  transition: background .15s, opacity .15s; width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-blue-press); }
.btn-primary:disabled { opacity: .45; cursor: default; }

.btn-tonal {
  appearance: none; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 500;
  padding: 9px 16px; cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-tonal:hover { border-color: var(--brand-blue); background: #f6f9ff; }

/* Icon-only action buttons (review worklist row). The title + aria-label carry
   the meaning; the SVG is the affordance. Placed after btn-primary/btn-tonal so
   the fixed square size overrides btn-primary's width:100%. */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-width: 36px; padding: 0; flex: 0 0 auto;
}
.btn-icon svg { width: 18px; height: 18px; display: block; }
.btn-icon:disabled, .btn-icon[disabled] { opacity: .4; cursor: not-allowed; }
.btn-icon:disabled:hover, .btn-icon[disabled]:hover { border-color: var(--line); background: #fff; }
.btn-icon.is-busy { opacity: .55; pointer-events: none; }
.rev-reject.btn-icon:hover { border-color: #e2483d; color: #e2483d; }
.review-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

.btn-text {
  appearance: none; border: 0; background: transparent; color: var(--ink-soft);
  font-size: 13px; font-weight: 500; padding: 6px 10px; cursor: pointer; border-radius: 8px;
}
.btn-text:hover { background: rgba(47,111,237,.08); color: var(--brand-blue); }

/* ── Login ───────────────────────────────────────────── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh; padding: 2rem;
}
.login-card {
  width: 360px; max-width: 100%; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 36px 32px; text-align: center;
}
.login-logo { display: block; margin: 0 auto 6px; height: 68px; width: auto; }
.login-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 22px; }
.login-label {
  display: block; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--ink-soft); margin: 10px 0 5px;
}
.login-field {
  width: 100%; padding: 11px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: #fbfcfe; color: var(--ink);
  font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.login-field:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(47,111,237,.15); }
.login-mfa { text-align: center; font-size: 24px; letter-spacing: 8px; font-family: ui-monospace, Menlo, monospace; }
.login-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-soft); margin: 12px 0 4px; }
.login-error { font-size: 12px; color: var(--error); min-height: 17px; margin: 8px 0 2px; text-align: left; }
.login-card .btn-primary { margin-top: 8px; }
.login-foot { margin-top: 22px; font-size: 11px; color: var(--ink-faint); }

/* ── Pinnacl product bits (OR teaser on the dashboard + the OR page) ── */
/* Product wordmark "pinnacl.3D" / "pinnacl.OR" — rendered as the SVG files
   brand/logo-3d.svg / logo-or.svg (NOT HTML text) so they match brand/logo.svg
   EXACTLY: same font, same vector boldness, .3D/.OR in the brand blue. */
.wm-img { display: inline-block; width: auto; vertical-align: middle; }
.p-accent { color: var(--brand-blue); }
.product-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px; font-weight: 700; font-size: 16px;
  flex: none;
}
.product-or-badge { background: #eef2f7; color: var(--ink-soft); }
.coming-soon {
  display: inline-block; padding: 3px 11px; border-radius: 99px;
  background: #fff4e0; color: #b26a00; font-size: 12px; font-weight: 600;
}

/* Pinnacl OR placeholder box on the dashboard */
.or-teaser { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.or-teaser:hover { border-color: var(--brand-blue); box-shadow: 0 6px 22px rgba(47,111,237,.12); }
.or-teaser-row { display: flex; align-items: center; gap: 16px; }
.or-teaser-text { flex: 1; }
.or-teaser-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.or-teaser-desc { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }

/* Pinnacl OR coming-soon page */
.or-page { text-align: center; padding: 52px 32px; }
.or-page .product-badge { width: 58px; height: 58px; border-radius: 14px; font-size: 21px; margin: 0 auto 18px; }
.or-page h1 { font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.or-page > p { color: var(--ink-soft); margin: 0 0 16px; font-size: 14px; }
.or-page .coming-soon { font-size: 13px; }
.or-page-note { max-width: 460px; margin: 18px auto 0; font-size: 13px; line-height: 1.55; color: var(--ink-faint); }

/* The wordmark links back to the dashboard. */
#app-brand { cursor: pointer; }

/* ══ Reusable motion primitives ══════════════════════════════════════
   A horizontal panel "carousel", sequenced by ui/anim.js. Reusable for any
   list↔detail surface.

   .stage holds a track of two panels: the dashboard (content width) and the
   queue panel (a comfortable fixed width) sitting to its right with a GAP equal
   to the 3D↔OR card gap. Opening pans the track left by (gap + queue width): the
   dashboard slides left and clips + fades at the WINDOW's left edge (the stage
   bleeds into the left margin so the fade sits at the window edge, not the
   content edge) but STAYS partly visible — it doesn't fly off — and the queue
   panel slides in on the right. .reveal-body / .is-open then unfolds it. */
:root {
  --ease-smooth: cubic-bezier(.22, .61, .36, 1);
  --t-slide: .46s;
  --t-grow: .34s;
  --queue-w: 640px;          /* the queue panel's width */
  --stage-gap: 20px;         /* === the 3D↔OR card gap (.worklist-panel margin-bottom) */
}

/* The stage bleeds LEFT to the window edge (negative margin) but keeps its right
   at the content edge, so the pushed-aside dashboard fades at the window's left
   edge. Overflow-clipped so the off-track queue panel is hidden until it pans in;
   vertical padding keeps the cards' drop shadows. */
.stage {
  position: relative; overflow: hidden; padding: 4px 0 32px;
  --content-w: min(1060px, 100vw - 40px);
  --side-pad: calc((100vw - var(--content-w)) / 2);
  margin-left: calc(-1 * var(--side-pad));
}

/* The sliding track: [pad = left margin] [dashboard] [gap] [queue panel]. The
   left pad keeps the dashboard in the content area when closed; panning left by
   (gap + queue width) reveals the queue while leaving the dashboard's right
   portion on screen (now reaching the window's left edge). */
.stage-track {
  display: flex; align-items: flex-start; gap: var(--stage-gap);
  padding-left: var(--side-pad);
  transform: translateX(0);
  transition: transform var(--t-slide) var(--ease-smooth);
  will-change: transform;
}
.stage.is-split > .stage-track {
  transform: translateX(calc(-1 * (var(--stage-gap) + var(--queue-w))));
}
.stage-main   { flex: 0 0 var(--content-w); min-width: 0; }  /* dashboard — content width */
.stage-detail { flex: 0 0 var(--queue-w); min-width: 0; }    /* queue panel — fixed width */

/* The fade where the dashboard clips, now at the WINDOW's left edge. A page-
   coloured overlay faded IN on open (a real opacity transition, never snaps) —
   clear of the queue panel on the right. */
.stage::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 104px; z-index: 4;
  pointer-events: none; opacity: 0; transition: opacity var(--t-slide) var(--ease-smooth);
  background: linear-gradient(to right, var(--bg) 0%, var(--bg) 8%, rgba(238,242,248,0) 100%);
}
.stage.is-split::before { opacity: 1; }

/* 2 — headline→full reveal. The always-visible headline sits OUTSIDE
   .reveal-body; the body grows beneath it. */
.reveal-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-grow) var(--ease-smooth); }
.reveal-body > .reveal-inner { overflow: hidden; min-height: 0; opacity: 0; transition: opacity .26s ease; }
.reveal-body.is-open { grid-template-rows: 1fr; }
.reveal-body.is-open > .reveal-inner { opacity: 1; transition: opacity .3s ease .12s; }

/* The queue card fills its panel. */
.stage-detail .upload-panel { max-width: none; margin: 0; }

/* Queue panel header — the "headline" the body grows from. */
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head .panel-title { margin: 0; }
.panel-close {
  appearance: none; border: 0; background: transparent; cursor: pointer; flex: none;
  width: 30px; height: 30px; border-radius: 8px; color: var(--ink-faint);
  font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.panel-close:hover { background: rgba(47,111,237,.08); color: var(--brand-blue); }
.panel-head + .reveal-body .reveal-inner { padding-top: 6px; }

/* The toggle reflects the open state. */
#worklist-upload-toggle.is-active { border-color: var(--brand-blue); background: #f6f9ff; color: var(--brand-blue); }

/* Honour reduced-motion: snap, don't animate. anim.js resolves its waits
   immediately too, so the sequence still applies — just without the tweening. */
@media (prefers-reduced-motion: reduce) {
  .stage-track, .stage::before, .reveal-body, .reveal-body > .reveal-inner { transition: none !important; }
}

/* ── App shell ───────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.caller-email { font-size: 13px; color: var(--ink-soft); }

.content { max-width: 1100px; margin: 40px auto; padding: 0 20px; }
/* The upload form is single-column — keep it comfortably narrow + centred even
   though the worklist/review tables use the full content width. */
.upload-panel { max-width: 720px; margin-left: auto; margin-right: auto; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.panel-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.panel-help { font-size: 14px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 22px; }

.field { margin-bottom: 20px; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field-label .optional { font-weight: 400; color: var(--ink-faint); }
.text-field {
  width: 100%; padding: 11px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: #fbfcfe; color: var(--ink);
  font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.text-field:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(47,111,237,.15); }

.picker { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.picker-summary { font-size: 13px; color: var(--ink-soft); }
.picker-summary.has-files { color: var(--ink); font-weight: 500; }

.actions { margin-top: 4px; }
.actions .btn-primary { width: auto; min-width: 180px; }

.status { margin-top: 16px; font-size: 14px; min-height: 20px; color: var(--ink-soft); }
.status.ok { color: var(--ok); font-weight: 600; }
.status.err { color: var(--error); font-weight: 600; }
.status.busy { color: var(--brand-blue); }

.progress { margin-top: 12px; height: 6px; border-radius: 99px; background: #e6ecf4; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--brand-blue); border-radius: 99px; transition: width .2s ease; }

.appfoot { text-align: center; font-size: 11px; color: var(--ink-faint); padding: 24px 0 40px; }

/* ── Toast (shared-portal showNotification target) ───── */
#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: none; flex-direction: column; gap: 8px; z-index: 200; align-items: center;
}
.toast {
  padding: 10px 18px; border-radius: 10px; font-size: 14px; color: #fff;
  background: #1b2430; box-shadow: var(--shadow); max-width: 90vw;
}
.toast--success { background: var(--ok); }
.toast--error { background: var(--error); }
.toast--warning { background: #b26a00; }
.toast--info { background: #1b2430; }

/* ── Session banner ──────────────────────────────────── */
#session-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 210;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 10px 16px; background: #fff4e0; color: #7a4a00; font-size: 14px;
  border-bottom: 1px solid #f0d9a8;
}
