/* traveler-overview-redesign · review shell chrome + Odia app-frame tokens */

:root {
  /* Review-shell chrome (outside the simulated app) */
  --page: #f4f1fb;
  --surface: #ffffff;
  --ink: #151326;
  --muted: #6e698b;
  --border: #ded9ee;
  --brand: #5935e9;
  --brand-soft: #eee9ff;
  --navy: #0e092d;
  --success: #08775b;
  --shadow: 0 18px 50px rgba(29, 22, 62, 0.1);

  /* Odia app tokens — apps/web/src/assets/styles/globals.css + colors.css (light theme) */
  --od-background: #f3effa;
  --od-foreground: #121021;
  --od-card: #ffffff;
  --od-primary: #06041f;
  --od-primary-foreground: #ffffff;
  --od-secondary: #e8e5f0;
  --od-accent-interactive: #5935e9;
  --od-accent-soft: #e9e5f9;
  --od-accent-soft-hover: #ddd6f3;
  --od-muted: #e8e5f0;
  --od-muted-foreground: #6e6a8b;
  --od-destructive: #e62b0f;
  --od-success: #0cc078;
  --od-warning-subtle: #fef3dc;
  --od-warning-strong: #b45309;
  --od-border: #d4c5e6;
  --od-sidebar: #ffffff;

  /* Pastel metric-tile tokens — apps/web/src/assets/styles/colors.css:95-106 */
  --pastel-purple: #c9b1ff;
  --pastel-purple-text: #5a3a8a;
  --pastel-blue: #a8d8ea;
  --pastel-blue-text: #2a5a6e;
  --pastel-mint: #a8e6d0;
  --pastel-mint-text: #1d5a45;
  --pastel-lavender: #ddc2ff;
  --pastel-lavender-text: #5a3a75;

  font-family: 'Manrope', Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 720px; background: var(--page); }
button, select, input { font: inherit; }
button, select { color: inherit; }
a { color: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(89, 53, 233, 0.32);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------- */
/* Review-shell chrome                                                     */
/* ---------------------------------------------------------------------- */

.review-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}
.review-brand { display: grid; gap: 3px; }
.review-brand strong { font-size: 16px; }
.review-kicker { color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.review-controls { display: flex; align-items: end; gap: 10px; }
.review-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.review-controls select, .quiet-button { min-height: 36px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 0 13px; }
.notes-toggle { grid-auto-flow: column; align-items: center; min-height: 36px; border: 1px solid var(--border); border-radius: 999px; padding: 0 12px; }
.notes-toggle input { accent-color: var(--brand); }
.quiet-button { cursor: pointer; }

.state-pills { display: flex; gap: 8px; overflow-x: auto; padding: 12px 24px 0; }
.state-pill { white-space: nowrap; cursor: pointer; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 8px 12px; font-size: 12px; font-weight: 700; }
.state-pill.active { border-color: var(--navy); background: var(--navy); color: white; }

.prototype-layout { display: grid; grid-template-columns: minmax(760px, 1fr) 360px; gap: 18px; align-items: start; padding: 18px 24px 48px; }
.prototype-stage { min-width: 0; }

.review-notes { position: sticky; top: 90px; display: grid; gap: 15px; max-height: calc(100vh - 110px); overflow-y: auto; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); padding: 20px; box-shadow: var(--shadow); }
.review-notes[hidden] { display: none; }
.note-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-group, .score-target { border-radius: 999px; padding: 5px 8px; font-size: 9px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.note-group { background: var(--brand-soft); color: var(--brand); }
.score-target { background: #d8faec; color: var(--success); }
.review-notes h2 { margin: 0; font-size: 21px; }
.review-notes section { border-top: 1px solid var(--border); padding-top: 13px; }
.review-notes h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.review-notes p, .review-notes li { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.review-notes ul { display: grid; gap: 5px; margin: 0; padding-left: 18px; }
.question-card { border: 0 !important; border-radius: 16px; background: var(--navy); padding: 14px !important; }
.question-card h3, .question-card p { color: white; }

@media (max-width: 1150px) {
  .review-toolbar { align-items: flex-start; flex-direction: column; }
  .prototype-layout { grid-template-columns: 1fr; }
  .review-notes { position: static; max-height: none; }
}

/* ---------------------------------------------------------------------- */
/* Odia app frame — sidebar + breadcrumb header shell                      */
/* ---------------------------------------------------------------------- */

.odia-app-frame {
  position: relative;
  min-height: 780px;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--shadow);
  background: var(--od-background);
  transition: max-width 200ms ease;
  /* Container queries below key off this element's own width, not the browser
     viewport — so the "responsive-overview" state's forced max-width (below)
     genuinely reflows the grid, and so the grid also reflows correctly if the
     app-frame is embedded in a narrower WorkspaceShell content lane. */
  container-type: inline-size;
  container-name: odia-frame;
}
.odia-app-frame.force-narrow { max-width: 900px; }
.odia-shell { display: flex; min-height: 780px; }

.odia-sidebar {
  width: 190px;
  flex-shrink: 0;
  background: var(--od-primary);
  color: #d9d6f2;
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.odia-sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 18px; font-size: 13px; color: white; }
.odia-logo-mark { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 9px; background: var(--od-accent-interactive); color: white; font-size: 9px; font-weight: 900; }
.odia-sidebar-nav { display: grid; gap: 2px; padding: 0 10px; overflow-y: auto; }
.odia-sidebar-item { display: block; padding: 8px 12px; border-radius: 999px; font-size: 12.5px; color: #b9b4dc; }
.odia-sidebar-item.active { background: rgba(255, 255, 255, 0.1); color: white; font-weight: 700; }

.odia-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--od-background); }
.odia-site-header {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: var(--od-sidebar);
}
.odia-breadcrumb { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 500; color: var(--od-muted-foreground); }
.odia-breadcrumb .crumb-sep { margin: 0 6px; }
.odia-breadcrumb .crumb-current { color: var(--od-foreground); font-weight: 600; }
.odia-header-icons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--od-muted); color: var(--od-muted-foreground); font-size: 13px; }
.header-icon-btn--brand { background: var(--od-accent-soft); color: var(--od-accent-interactive); }

.screen-root { flex: 1; overflow-y: auto; padding: 24px 24px 32px; }

.oi { width: 15px; height: 15px; flex-shrink: 0; }
.oi-inline { width: 12px; height: 12px; margin: 0 4px; vertical-align: -1px; }

/* ---------------------------------------------------------------------- */
/* BASELINE — exact current-source styling. Do not "improve" these; they   */
/* exist to faithfully reproduce today's screen, including its flaws.      */
/* ---------------------------------------------------------------------- */

.detail-header-card { background: var(--od-card); border-radius: 24px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(18, 16, 33, 0.04); }
.detail-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-header-identity { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.detail-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #6d8bff, #9457e8);
  color: white;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(89, 53, 233, 0.22);
}
.detail-header-text { min-width: 0; }
.detail-header-text h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--od-foreground); word-break: break-word; }
.detail-header-subtitle { font-size: 13px; color: var(--od-muted-foreground); }
.header-link, .org-pill { display: inline-flex; align-items: center; gap: 5px; color: #7c3aed; text-decoration: none; }
.header-link:hover, .org-pill:hover { color: #6d28d9; text-decoration: underline; }
.org-pill { border-radius: 999px; background: rgba(232, 229, 240, 0.6); padding: 3px 12px; color: var(--od-muted-foreground); }
.org-pill:hover { background: var(--od-muted); color: var(--od-foreground); text-decoration: none; }
.detail-header-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 11.5px; color: var(--od-muted-foreground); }
.icon-only-button { border: none; background: var(--od-muted); color: var(--od-muted-foreground); border-radius: 999px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.icon-only-button:hover { background: var(--od-accent-soft-hover); color: var(--od-accent-interactive); }
.muted { color: var(--od-muted-foreground); }

.baseline-overview-plain { padding: 24px; }
.baseline-overview-plain h3 { margin: 0 0 16px; font-size: 17px; font-weight: 600; color: var(--od-foreground); }
.baseline-stack { display: grid; gap: 16px; }
.field-label { margin: 0; font-size: 13px; color: var(--od-muted-foreground); }
.field-value { margin: 2px 0 0; font-weight: 500; color: var(--od-foreground); }
.baseline-link { color: var(--od-primary); text-decoration: underline; }

.baseline-overview-cards { padding: 16px; display: grid; gap: 16px; }
.baseline-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.baseline-card { min-width: 0; }
.baseline-card-title { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--od-muted-foreground); }
.baseline-kv { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; padding: 3px 0; font-size: 13.5px; }
.baseline-org-box { border: 1px solid var(--od-border); border-radius: 12px; padding: 12px; }
.baseline-org-box h4 { margin: 0; font-size: 14px; font-weight: 600; }
.notes-text { white-space: pre-wrap; font-size: 13.5px; }
@container odia-frame (max-width: 920px) { .baseline-row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* NEW header — borderless identity row with an avatar halo. Used by every */
/* proposal/edge state. The one genuinely new component in this revision.  */
/* ---------------------------------------------------------------------- */

.profile-header { display: flex; align-items: flex-start; gap: 18px; padding: 8px 4px 20px; }
.profile-avatar-wrap { position: relative; flex-shrink: 0; width: 68px; height: 68px; }
.profile-avatar-halo {
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(109, 139, 255, 0.35), rgba(148, 87, 232, 0.18) 70%, transparent);
}
.profile-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6d8bff, #9457e8);
  color: white;
  font-size: 21px;
  font-weight: 800;
}
.profile-identity { flex: 1; min-width: 0; }
.profile-kicker { margin: 0 0 2px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--od-accent-interactive); }
.profile-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.profile-name-row h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--od-foreground); letter-spacing: -0.01em; }
.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: var(--od-card);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--od-muted-foreground);
  text-decoration: none;
}
.identity-chip:hover { background: var(--od-accent-soft-hover); color: var(--od-accent-interactive); }
.profile-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--od-muted-foreground); }
.meta-link { display: inline-flex; align-items: center; color: var(--od-muted-foreground); text-decoration: none; }
.meta-link:hover { color: var(--od-accent-interactive); }
.meta-plain { color: var(--od-muted-foreground); }
.meta-dot { color: var(--od-border); }
.edit-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: var(--od-muted);
  color: var(--od-foreground);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.edit-pill:hover { background: var(--od-accent-soft-hover); color: var(--od-accent-interactive); }

/* ---------------------------------------------------------------------- */
/* Metrics bar — PerformanceMetricsGrid.tsx equivalent (unchanged from the */
/* first redesign pass; only the header above changed in this revision).   */
/* ---------------------------------------------------------------------- */

.metrics-card { background: var(--od-card); border-radius: 24px; padding: 14px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(18, 16, 33, 0.04); }
.metrics-grid { display: grid; gap: 10px; }
.metrics-grid--2col { grid-template-columns: repeat(2, 1fr); }
.metrics-grid--4col { grid-template-columns: repeat(4, 1fr); }
@container odia-frame (max-width: 920px) { .metrics-grid--4col { grid-template-columns: repeat(2, 1fr); } }

.metric-tile { border-radius: 16px; padding: 12px 14px; }
.metric-value { margin: 0; font-size: 18px; font-weight: 700; color: var(--od-foreground); line-height: 1.2; }
.metric-label { margin: 3px 0 0; font-size: 12px; color: var(--od-foreground); }
.metric-caveat { margin: 2px 0 0; font-size: 10.5px; font-weight: 600; color: inherit; opacity: 0.75; }
.tile-blue { background: var(--pastel-blue); color: var(--pastel-blue-text); }
.tile-green { background: var(--pastel-mint); color: var(--pastel-mint-text); }
.tile-purple { background: var(--pastel-lavender); color: var(--pastel-lavender-text); }
.tile-default { background: var(--pastel-purple); color: var(--pastel-purple-text); }
.tile-muted { background: var(--od-muted); color: var(--od-muted-foreground); }

/* ---------------------------------------------------------------------- */
/* Tabs card — hand-rolled bottom-border tab bar equivalent                */
/* ---------------------------------------------------------------------- */

.tabs-card { background: var(--od-card); border-radius: 24px; overflow: hidden; box-shadow: 0 1px 2px rgba(18, 16, 33, 0.04); }
.tabs-bar { display: flex; height: 52px; align-items: stretch; overflow-x: auto; border-bottom: 1px solid rgba(232, 229, 240, 0.6); padding: 0 4px; }
.detail-tab { border: none; border-bottom: 2px solid transparent; background: transparent; padding: 0 16px; font-size: 13.5px; font-weight: 600; color: var(--od-muted-foreground); cursor: default; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.detail-tab.active { border-bottom-color: var(--od-accent-interactive); color: var(--od-accent-interactive); }
.tab-count-badge { background: var(--od-secondary); color: var(--od-muted-foreground); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.detail-tab.active .tab-count-badge { background: var(--od-accent-soft); color: var(--od-accent-interactive); }
.tabs-body { padding: 0; }

/* ---------------------------------------------------------------------- */
/* Redesigned Overview grid — shared card system for both entity kinds     */
/* ---------------------------------------------------------------------- */

.overview-grid { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ov-col { display: grid; gap: 16px; align-content: start; }
.ov-card { background: var(--od-background); border-radius: 20px; padding: 16px 18px; min-width: 0; }
.ov-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ov-card-icon { color: var(--od-accent-interactive); flex-shrink: 0; }
.ov-card-title { font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--od-muted-foreground); }
.ov-card-body { display: grid; gap: 8px; }

.ov-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; font-size: 13.5px; }
.ov-row-icon { color: var(--od-muted-foreground); width: 16px; height: 16px; }
.ov-row-label { color: var(--od-muted-foreground); }
.ov-row-value { color: var(--od-foreground); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-empty { color: var(--od-muted-foreground); font-weight: 400; }
.ov-link { color: var(--od-accent-interactive); text-decoration: none; }
.ov-link:hover { text-decoration: underline; }
.ov-empty-text { margin: 0; font-size: 13px; color: var(--od-muted-foreground); }
.ov-notes-text { margin: 0; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; color: var(--od-foreground); }

/* Custom fields: one filled block per field (label above value) instead of a
   shared label/value row — a fill-based separator between fields, per
   DESIGN.md's "quiet state styling" rather than a border/divider stack. */
.ov-field-list { display: grid; gap: 8px; }
.ov-field-block { background: var(--od-card); border-radius: 14px; padding: 10px 14px; }
.ov-field-label { margin: 0 0 3px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--od-muted-foreground); }
.ov-field-value { margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.5; color: var(--od-foreground); overflow-wrap: anywhere; }

.ov-relation-chip { display: grid; gap: 2px; border-radius: 14px; background: var(--od-card); padding: 10px 14px; margin-bottom: 8px; }
.ov-relation-chip:last-child { margin-bottom: 0; }
.ov-relation-chip-kicker { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--od-muted-foreground); }

.ov-address { display: grid; gap: 2px; font-style: normal; font-size: 13.5px; color: var(--od-foreground); }

@container odia-frame (max-width: 920px) { .overview-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* Inline error banner + retry — Confirmed Journeys fetch failure          */
/* ---------------------------------------------------------------------- */

.inline-error-banner { display: flex; align-items: flex-start; gap: 12px; margin: 16px; padding: 14px 16px; border-radius: 16px; background: rgba(230, 43, 15, 0.08); color: var(--od-destructive); }
.inline-error-copy { display: grid; gap: 2px; flex: 1; }
.inline-error-copy strong { font-size: 13.5px; }
.inline-error-copy span { font-size: 12.5px; color: var(--od-foreground); opacity: 0.85; }
.retry-button { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 999px; background: var(--od-destructive); color: white; padding: 7px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.retry-button:hover { opacity: 0.9; }

.itinerary-list { padding: 8px 16px 16px; display: grid; gap: 4px; }
.itinerary-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-radius: 12px; font-size: 13.5px; }
.itinerary-row:hover { background: var(--od-accent-soft-hover); }

@media (prefers-reduced-motion: no-preference) {
  .state-pill, button, a { transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease; }
}
