/* ============================================================================
   Limitless — design tokens & component styles
   Plain CSS by design: no Tailwind/PostCSS dependency. Imported directly by
   the static preview, and by the real React app once npm install can run.

   Brand identity: strong, capable, simple, established, easy to trust. Built
   for blue-collar owners, managers, and supervisors — not Silicon Valley
   software. Deep navy + white/light gray, warm gold used sparingly, large
   clean type, generous spacing, obvious simple navigation. No gradients, no
   AI-gimmick visuals, no crowded dashboards.
   ========================================================================== */

:root {
  /* Palette — navy + white/light gray canvas, gold used sparingly as accent */
  --canvas: #F5F6F8;
  --panel: #FFFFFF;
  --panel-sunken: #EEF0F3;
  --ink: #16233B;
  --ink-soft: #4B5768;
  --ink-faint: #5E6B7F;
  --line: #E2E5EA;
  --line-strong: #CBD1DA;

  /* Brand: deep navy chrome, warm gold accent — used sparingly, never as a
     wash of color across the UI */
  --navy: #132A4C;
  --navy-ink: #0C1D38;
  --gold: #B8862E;
  --gold-soft: #F3E9D6;

  /* Kept distinct from brand chrome so severity stays legible at a glance */
  --critical: #B3392A;
  --critical-bg: #FBECE9;
  --needs-attention: #A6650C;
  --needs-attention-bg: #FBF1E1;
  --watch: #4A5568;
  --watch-bg: #EEF0F2;
  --good: #2F7A4F;
  --good-bg: #EAF5EE;

  /* Legacy alias so any not-yet-updated component still resolves. */
  --brand: var(--navy);
  --brand-ink: var(--navy-ink);
  --brand-bg: var(--gold-soft);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Arial, sans-serif;
  /* "Inter" is listed first for when a real build pipeline can self-host it
     (e.g. @fontsource/inter via npm, once this environment has registry
     access — see NEXT-SESSION-HANDOFF.md) or when a deployed copy of this
     app has normal internet access to load it from Google Fonts. It's
     deliberately NOT loaded via a <link> here: a failed font request (no
     network, offline, a restrictive network policy) surfaces as a
     browser-level console error that can't be suppressed from JS, even
     wrapped in try/catch — verified directly in this sandbox. Until Inter
     can be reliably self-hosted, the system-font stack below it — real
     native UI fonts on every actual device (San Francisco on Mac/iOS,
     Segoe UI on Windows, Roboto on Android) — is both zero-risk and
     genuinely in the same "modern operational software" visual family the
     brief asked for. */
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgba(19, 42, 76, 0.05), 0 1px 1px rgba(19, 42, 76, 0.04);
  --shadow-panel: -12px 0 40px rgba(19, 42, 76, 0.16);
  --shadow-float: 0 4px 20px rgba(19, 42, 76, 0.12);

  --tabbar-h: 66px;
}

* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font-family: inherit; }

.limitless-app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- header */

.op-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--navy);
  flex-shrink: 0;
}

.op-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.op-brand-logo {
  height: 26px;
  width: auto;
  max-width: 40px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.op-brand-mark {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.op-brand-company {
  font-size: 12.5px;
  color: #C7D0DE;
  padding-left: 11px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-header-meta {
  font-size: 12px;
  color: #C7D0DE;
  text-align: right;
  flex-shrink: 0;
}

/* Short mobile form ("Updated 7:30 AM") is the default in markup order but
   hidden by default; the full weekday/date form is shown by default and
   swapped below the desktop breakpoint. This guarantees the header never
   truncates — the two never render at the same time. */
.op-header-meta-short { display: none; }

/* Mobile: drop the company name and long date/time so the header never
   truncates. Company/location context still appears in the app (see the
   Overview greeting), just not competing for space in the fixed header. */
@media (max-width: 759px) {
  .op-brand-company { display: none; }
  .op-header-meta-full { display: none; }
  .op-header-meta-short { display: inline; }
}

/* --------------------------------------------------------------- tab nav */

/* Desktop: horizontal tab row under the header */
.op-tabs-desktop {
  display: none;
}

.op-tabs-mobile {
  display: none;
}

@media (min-width: 760px) {
  .op-tabs-desktop {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }
  .op-tabs-mobile { display: none; }
}

.op-tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink-soft);
  cursor: pointer;
}

.op-tab-btn:hover { color: var(--ink); }

.op-tab-btn.active {
  color: var(--brand-ink);
  border-bottom-color: var(--brand);
}

.op-tab-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--panel-sunken);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 17px;
  text-align: center;
}

.op-tab-btn.active .op-tab-count {
  background: var(--brand-bg);
  color: var(--brand-ink);
}

/* Mobile: fixed bottom tab bar (only below the desktop breakpoint —
   kept inside this query so it can never outrank the rule above that
   hides it on desktop, regardless of source order). */
@media (max-width: 759px) {
  .op-tabs-mobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(26, 28, 31, 0.05);
  }

  .op-tabs-mobile .op-tab-btn {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 7px 2px 8px;
    font-size: 11.5px;
    font-weight: 600;
    border-bottom: none;
    position: relative;
    min-height: 52px;
    color: var(--ink-faint);
  }

  .op-tabs-mobile .op-tab-btn .op-tab-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 26px;
    border-radius: 10px;
  }

  .op-tabs-mobile .op-tab-btn .op-tab-icon {
    display: flex;
    line-height: 1;
  }

  /* Strong active-tab emphasis: a filled pill behind the icon plus bolder
     navy text, so the current section is unmistakable at a glance. */
  .op-tabs-mobile .op-tab-btn.active { color: var(--navy); font-weight: 650; }
  .op-tabs-mobile .op-tab-btn.active .op-tab-icon-wrap {
    background: var(--gold-soft);
    color: var(--gold);
  }

  .op-tabs-mobile .op-tab-count {
    position: absolute;
    top: 2px;
    right: calc(50% - 22px);
    font-size: 10px;
    padding: 0 4px;
    min-width: 14px;
  }
}

/* ---------------------------------------------------------------- main */

.op-main {
  flex: 1;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 28px 20px 44px;
}

@media (max-width: 759px) {
  .op-main { padding: 22px 18px calc(var(--tabbar-h) + 26px); }
}

.op-section-gap { margin-bottom: 30px; }
.op-section-gap:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- Today tab */

.op-greeting {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 2px 0 6px;
}

.op-greeting-sub {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 20px;
}

/* Deterministic manager-briefing sentence at the top of Overview (Priority 1) */
.op-briefing {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0 0 20px;
  line-height: 1.5;
  max-width: 46ch;
}

/* Short "N job/material-related issues need review." sentence on Jobs/Materials */
.op-area-summary {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin: -10px 0 22px;
}

/* "Also needs attention" — clearly secondary to the page heading but still
   a real heading, not a database-style all-caps label. */
.op-subsection-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 26px 0 12px;
}

.op-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.op-status-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--panel-sunken);
  border-radius: 999px;
  padding: 6px 12px;
}

.op-status-chip .n {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.op-status-chip.chip-critical { background: var(--critical-bg); color: var(--critical); }
.op-status-chip.chip-critical .n { color: var(--critical); }
.op-status-chip.chip-attention { background: var(--needs-attention-bg); color: var(--needs-attention); }
.op-status-chip.chip-attention .n { color: var(--needs-attention); }

.op-allcaught {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--good-bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
}

.op-allcaught .icon { font-size: 22px; }
.op-allcaught .title { font-weight: 700; font-size: 15px; color: var(--good); margin: 0 0 2px; }
.op-allcaught .sub { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

.op-view-all-link {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  margin-top: 4px;
}

.op-view-all-link:hover { border-color: var(--line-strong); color: var(--ink); }

/* ------------------------------------------------------------ section hd */

.op-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.op-section-heading h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0;
}

.op-section-heading .count {
  font-size: 12.5px;
  color: var(--ink-faint);
}

.op-empty-note {
  font-size: 13px;
  color: var(--ink-faint);
  padding: 4px 0;
}

/* -------------------------------------------------------------- issue card */

.op-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: border-color 0.12s ease;
  font-family: inherit;
}

.op-card:hover { border-color: var(--line-strong); }

.op-card-toprow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.op-sev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.op-sev-dot.critical { background: var(--critical); }
.op-sev-dot.high, .op-sev-dot.needs-attention { background: var(--needs-attention); }
.op-sev-dot.medium, .op-sev-dot.watch { background: var(--watch); }
.op-sev-dot.low { background: var(--ink-faint); }

.op-sev-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.op-sev-label.critical { color: var(--critical); }
.op-sev-label.high { color: var(--needs-attention); }
.op-sev-label.medium { color: var(--watch); }
.op-sev-label.low { color: var(--ink-faint); }

.op-card-type {
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* Session-only "have I opened this yet" indicator (Priority 9) — subtle by
   design, never turns into an inbox/unread-count product. */
.op-new-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 2px 7px;
}

.op-card-dollar {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.op-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.4;
}

.op-card-summary {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

/* Secondary IDs/type/related-record detail intentionally does not live on
   the main card — see .op-related-row / .op-id-chip in the Review panel
   (.op-panel-section) instead. Cards stay scannable in a few seconds. */
.op-id-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--panel-sunken);
  border-radius: 5px;
  padding: 2px 6px;
}

.op-card-review-btn {
  margin-top: 12px;
}

/* -------------------------------------------------------------- Handle first card */

.op-handlefirst {
  background: var(--panel);
  border: 1.5px solid var(--critical);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.op-handlefirst-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--critical);
  margin-bottom: 10px;
}

.op-handlefirst-title {
  font-size: 19px;
  font-weight: 650;
  color: var(--ink);
  margin: 8px 0 6px;
  line-height: 1.35;
}

.op-handlefirst-summary {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.55;
}

.op-handlefirst-dollar {
  margin-bottom: 14px;
}
.op-handlefirst-dollar .label,
.op-handlefirst-next .label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.op-handlefirst-dollar { font-size: 20px; font-weight: 650; color: var(--ink); }

.op-handlefirst-next {
  background: var(--ink);
  color: #FAFAF8;
  border-radius: var(--radius);
  padding: 14px 15px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.op-handlefirst-next .label { color: #9FD3A0; }

.op-handlefirst-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------- quick actions */

.op-quick-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.op-quick-btn {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-soft);
  background: var(--panel-sunken);
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  min-height: 44px;
  cursor: pointer;
}
.op-quick-btn:hover { background: var(--line); color: var(--ink); }
.op-quick-btn.primary { background: var(--brand-bg); color: var(--brand-ink); }
.op-quick-btn.primary:hover { background: #E2DFFB; }

/* -------------------------------------------------------------- reconciliation card */

.op-recon-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  margin-bottom: 10px;
}

.op-recon-card.unreflected { border-color: var(--needs-attention-bg); background: #FFFDFA; }

.op-recon-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.op-recon-channel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.op-recon-date { font-size: 11.5px; color: var(--ink-faint); margin-left: auto; }

.op-recon-subject {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.4;
}

.op-recon-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--line);
  padding-left: 12px;
  margin-left: 3px;
}

.op-recon-step {
  position: relative;
  padding: 7px 0 7px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.op-recon-step::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.op-recon-step .src {
  display: block;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

.op-recon-value {
  display: block;
  color: var(--ink-soft);
}

.op-recon-step.flag::before { background: var(--needs-attention); }
.op-recon-step.flag .op-recon-value { color: var(--needs-attention); font-weight: 600; }
.op-recon-step.ok::before { background: var(--good); }

.op-recon-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  margin-top: 10px;
}
.op-recon-badge.unreflected { color: var(--needs-attention); background: var(--needs-attention-bg); }
.op-recon-badge.reflected { color: var(--good); background: var(--good-bg); }

/* ---------------------------------------------------------------- ask view */

.op-ask-view {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 58px);
}

@media (min-width: 760px) {
  .op-ask-view { min-height: calc(100dvh - 106px); }
}

.op-ask-intro {
  padding: 4px 0 4px;
}

.op-ask-intro h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.op-ask-intro p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.op-suggest-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.op-suggest-chip {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.op-suggest-chip:hover { border-color: var(--brand); color: var(--brand-ink); }

.op-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 18px;
}

.op-thread-item { display: flex; flex-direction: column; gap: 8px; }

.op-q-bubble {
  align-self: flex-end;
  max-width: 88%;
  background: var(--brand);
  color: #fff;
  border-radius: 14px 14px 3px 14px;
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.4;
}

.op-a-card {
  align-self: flex-start;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px 14px 14px 14px;
  padding: 13px 14px;
}

.op-a-text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  margin: 0;
}

.op-a-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.op-a-section-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.op-a-section-text {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.op-a-source .op-related-row { margin-top: 2px; }

.op-ask-compose {
  padding-top: 10px;
}

.op-ask-compose-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow-float);
}

.op-ask-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.4;
  font-family: inherit;
  padding: 8px 0;
  max-height: 120px;
}

.op-ask-textarea::placeholder { color: var(--ink-faint); }

.op-ask-send {
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.op-ask-send:disabled { background: var(--line-strong); cursor: default; }
.op-ask-send:not(:disabled):hover { background: var(--brand-ink); }

/* First-class Ask entry point (floating on Today/other tabs) */
.op-ask-fab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  margin-bottom: 22px;
}
.op-ask-fab:hover { background: #000; }

/* -------------------------------------------------------------- detail panel */

.op-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 28, 31, 0.32);
  display: flex;
  justify-content: flex-end;
  z-index: 50;
}

.op-panel {
  width: 100%;
  max-width: 440px;
  height: 100%;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  overflow-y: auto;
  padding: 20px 20px 40px;
}

.op-panel-close {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 14px;
}
.op-panel-close:hover { color: var(--ink); }

.op-panel-sev { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.op-panel-type { font-size: 11.5px; color: var(--ink-faint); }

.op-panel-title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.op-panel-summary {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

.op-panel-section { margin-bottom: 20px; }

.op-panel-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: 0 0 8px;
  font-weight: 700;
}

/* Evidence/confidence/related-IDs are kept available (trust matters) but
   ordered after the decision and visually quieter — smaller, muted, and
   separated by a divider — so a manager reads the decision first. */
.op-panel-divider {
  border-top: 1px solid var(--line);
  margin: 8px 0 20px;
}

.op-panel-forensic h3 { color: var(--ink-faint); }
.op-panel-forensic { opacity: 0.92; }

.op-related-row { display: flex; flex-wrap: wrap; gap: 6px; }

.op-evidence-item {
  display: flex;
  gap: 8px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.op-evidence-item.fact { background: var(--panel-sunken); }
.op-evidence-item.assumption { background: #FBF6EA; }

.op-evidence-kind {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  padding-top: 1px;
  width: 62px;
}
.op-evidence-item.assumption .op-evidence-kind { color: #96751E; }

.op-evidence-text { color: var(--ink); flex: 1; }
.op-evidence-source {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}

.op-confidence-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
  background: var(--watch-bg);
  color: var(--watch);
}
.op-confidence-pill.high { background: var(--good-bg); color: var(--good); }

.op-dollar-box {
  background: var(--panel-sunken);
  border-radius: var(--radius);
  padding: 14px 15px;
}
.op-dollar-amount { font-size: 22px; font-weight: 700; color: var(--ink); }
.op-dollar-basis { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.45; }

.op-action-box {
  background: var(--ink);
  color: #FAFAF8;
  border-radius: var(--radius);
  padding: 15px;
  font-size: 14px;
  line-height: 1.5;
}

.op-btn-outline {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  min-height: 44px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.op-btn-outline:hover { border-color: var(--ink-soft); }

.op-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.op-panel-actions .op-btn-outline { text-align: left; }

/* ---------------------------------------------------------------- misc */

.id-mono { font-family: var(--font-mono); }

@media (max-width: 759px) {
  .op-panel { max-width: 100%; }
}

/* ==================================================================
   Data page — upload, connect-existing-system, import wizard, health
   ================================================================== */

.op-data-section {
  margin-bottom: 32px;
}

/* ---- Upload dropzone ---- */

/* ---- Upload panel: a real, obvious button is the primary action; drag-
   and-drop on the same panel is a secondary, desktop-only convenience. ---- */

.op-upload-panel {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 32px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.op-upload-panel.dragover {
  border-color: var(--brand);
  background: var(--brand-bg);
}

.op-upload-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--navy);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius);
  padding: 15px 28px;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  min-height: 52px;
  width: 100%;
  max-width: 320px;
}
.op-upload-btn-primary:hover { background: var(--navy-ink); }

.op-upload-or {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin: 14px 0 4px;
}

.op-upload-formats {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0;
}

.op-dropzone-formats {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 10px 0 0;
  line-height: 1.55;
}

/* ---- Selected files (staged, not yet analyzed) ---- */

.op-staged-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.op-staged-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.op-staged-info { flex: 1 1 auto; min-width: 0; }

.op-staged-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.op-staged-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.op-staged-type::after,
.op-staged-size::after {
  content: "\00b7";
  margin-left: 8px;
  color: var(--line-strong);
}

.op-staged-status { font-weight: 700; color: var(--good); }
.op-staged-status.unsupported { color: var(--critical); }

.op-staged-remove {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.op-staged-remove:hover { background: var(--panel-sunken); color: var(--critical); }

.op-analyze-btn { width: 100%; min-height: 48px; }

.op-source-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.op-source-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.op-source-info {
  flex: 1 1 auto;
  min-width: 0;
}

.op-source-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.op-source-status {
  font-size: 12.5px;
  font-weight: 600;
}
.op-source-status.parsing { color: var(--ink-faint); }
.op-source-status.failed { color: var(--critical); }
.op-source-status.needs-review { color: var(--needs-attention); }

.op-source-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.op-source-updated::after,
.op-source-count::after {
  content: "\00b7";
  margin-left: 8px;
  color: var(--line-strong);
}

.op-source-health {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 2px 9px;
}
.op-source-health.good { color: var(--good); background: var(--good-bg); }
.op-source-health.warn { color: var(--needs-attention); background: var(--needs-attention-bg); }
.op-source-health.stale { color: var(--ink-faint); background: var(--panel-sunken); }

.op-source-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.op-source-actions .op-quick-btn,
.op-source-actions .op-btn-outline {
  white-space: nowrap;
}

/* ---- Connect existing system ---- */

.op-connect-intro {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.55;
  max-width: 60ch;
}

.op-connect-group { margin-bottom: 18px; }

.op-connect-group-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}
.op-connect-group-label.available { color: var(--good); }
.op-connect-group-label.future { color: var(--ink-faint); }

.op-connect-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .op-connect-grid { grid-template-columns: 1fr 1fr; }
}

.op-connect-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.op-connect-card.available {
  border-color: var(--good);
  background: #F2FAF3;
}

.op-connect-card-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 3px;
}

.op-connect-card-examples {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 8px;
  line-height: 1.4;
}

.op-connect-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  background: var(--panel-sunken);
  border-radius: 999px;
  padding: 3px 9px;
}
.op-connect-badge.available { color: var(--good); background: #DEF2E0; }

/* ---- Data health ---- */

.op-data-usage-banner {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--panel-sunken);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.op-data-usage-banner.imported {
  color: var(--brand-ink);
  background: var(--brand-bg);
  font-weight: 600;
}

.op-health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.op-health-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.op-health-stat .value { font-size: 20px; font-weight: 650; color: var(--ink); }
.op-health-stat .label { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

.op-health-lastsync {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

.op-health-flags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.op-health-flag {
  font-size: 12.5px;
  color: var(--needs-attention);
  background: #FBF1E2;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  line-height: 1.45;
}

/* ---- Import wizard ---- */

.op-wizard { padding-bottom: 8px; }

.op-wizard-steps {
  display: flex;
  gap: 4px;
  margin: 14px 0 22px;
}

.op-wizard-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.op-wizard-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--panel-sunken);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.op-wizard-step.active .op-wizard-step-num { background: var(--brand); color: #fff; }
.op-wizard-step.done .op-wizard-step-num { background: var(--good); color: #fff; }

.op-wizard-step-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-faint);
}
.op-wizard-step.active .op-wizard-step-label { color: var(--ink); }

.op-wizard-title {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.25;
  margin: 0 0 4px;
}

.op-wizard-sub {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.op-import-summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 14px;
  margin-bottom: 18px;
}

.op-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.op-summary-row:last-child { border-bottom: none; }
.op-summary-row .label { color: var(--ink-faint); }
.op-summary-row .value { font-weight: 650; color: var(--ink); }

.op-wizard-nav {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.op-wizard-nav .op-quick-btn,
.op-wizard-nav .op-btn-outline { flex: 1; text-align: center; }

.op-wizard-next { width: 100%; margin-top: 4px; }

.op-recordtype-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.op-recordtype-choice {
  background: var(--panel);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-soft);
  cursor: pointer;
}
.op-recordtype-choice.active {
  border-color: var(--brand);
  background: var(--brand-bg);
  color: var(--brand-ink);
}

/* ---- Field mapping table ---- */

.op-mapping-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.op-mapping-header-row {
  display: none;
}
@media (min-width: 640px) {
  .op-mapping-header-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-faint);
    padding: 0 4px 4px;
  }
}

.op-mapping-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  flex-wrap: wrap;
}

.op-mapping-source {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 650;
  flex: 1 1 40%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-mapping-arrow {
  color: var(--ink-faint);
  flex-shrink: 0;
}

.op-mapping-select {
  flex: 1 1 45%;
  min-width: 140px;
  font-size: 13px;
  color: var(--ink);
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
}

.op-mapping-flag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--needs-attention);
  background: #FBF1E2;
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.op-mapping-warning {
  font-size: 12.5px;
  color: var(--critical);
  background: #FCEBEA;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

/* ---- Preview step ---- */

.op-preview-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.op-preview-stat {
  flex: 1;
  min-width: 100px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.op-preview-stat .num { font-size: 22px; font-weight: 650; color: var(--ink); }
.op-preview-stat .label { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.op-preview-stat.good .num { color: var(--good); }
.op-preview-stat.warn .num { color: var(--needs-attention); }

.op-preview-flags {
  margin-bottom: 18px;
}
.op-preview-flags h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
.op-preview-flag-item {
  font-size: 12.5px;
  color: var(--needs-attention);
  background: #FBF1E2;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.op-preview-sample { margin-bottom: 18px; }
.op-preview-sample h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
.op-preview-record {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.op-preview-field {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.op-preview-field .label { color: var(--ink-faint); font-weight: 600; }

.op-wizard-finish { width: auto; }
