/* ═════════════════════════════════════════════════════════════════════════
 * Supplier Risk Tracker — design system v2
 * Warm light theme (Oracle Redwood-inspired), glass topbar, layered shadows,
 * Inter typography with stylistic alternates, refined Redwood accent.
 * Every existing class name is preserved so EJS templates work unchanged.
 * ═════════════════════════════════════════════════════════════════════════ */

:root {
  /* Surface stack - warm off-whites */
  --bg: #fbf8f4;
  --bg-pattern:
    radial-gradient(120% 80% at 100% 0%, rgba(199, 70, 52, 0.045), transparent 55%),
    radial-gradient(80% 60% at 0% 100%, rgba(20, 38, 96, 0.025), transparent 55%);
  --surface:    #ffffff;
  --surface-2:  #faf7f2;
  --surface-3:  #f3eee7;

  /* Ink (text) */
  --ink:        #161d2b;
  --ink-2:      #2d3548;
  --ink-soft:   #6b7589;
  --muted:      #94a0b4;

  /* Borders */
  --border:        rgba(20, 28, 45, 0.09);
  --border-soft:   rgba(20, 28, 45, 0.05);
  --border-strong: rgba(20, 28, 45, 0.16);

  /* Brand - Oracle Redwood signature red */
  --brand:       #c74634;
  --brand-2:     #a83a2a;
  --brand-3:     #8a2f21;
  --brand-soft:  #fdeeeb;
  --brand-glow:  rgba(199, 70, 52, 0.2);

  /* Semantic */
  --green:       #16a34a;
  --green-soft:  #dcfce7;
  --amber:       #d97706;
  --amber-soft:  #fef3c7;
  --red:         #dc2626;
  --red-soft:    #fee2e2;
  --blue:        #2563eb;
  --blue-soft:   #dbeafe;
  --gray:        #94a0b4;

  /* Shadows - layered for depth */
  --shadow-sm: 0 1px 2px rgba(20, 28, 45, 0.04);
  --shadow:    0 1px 3px rgba(20, 28, 45, 0.05), 0 4px 12px rgba(20, 28, 45, 0.04);
  --shadow-md: 0 2px 6px rgba(20, 28, 45, 0.05), 0 8px 24px rgba(20, 28, 45, 0.06);
  --shadow-lg: 0 4px 12px rgba(20, 28, 45, 0.06), 0 16px 40px rgba(20, 28, 45, 0.08);
  --shadow-glow: 0 0 0 4px var(--brand-glow);
  --ring-focus:  0 0 0 3px var(--brand-glow);

  /* Border radius scale */
  --r-sm: 4px;
  --r:    6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;

  /* Motion */
  --t-fast: 0.12s ease;
  --t:      0.18s ease;
  --t-slow: 0.28s ease;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-pattern);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
}

h1, h2, h3, h4 { letter-spacing: -0.014em; color: var(--ink); }
h1 { font-weight: 700; }
h2, h3, h4 { font-weight: 600; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1.5px; }

code {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  background: var(--surface-3);
  padding: 0.1em 0.45em;
  border-radius: var(--r-sm);
  font-size: 0.88em;
}
.mono {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}
.muted { color: var(--ink-soft); }

/* ─── Top bar (glass) ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.4em;
  padding: 0.7em 1.6em;
  background: rgba(255, 253, 250, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  color: var(--ink);
  font-weight: 600;
  transition: opacity var(--t-fast);
}
.brand a:hover { opacity: 0.85; text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 0.85em;
  letter-spacing: 0.04em;
  box-shadow:
    0 1px 2px rgba(199, 70, 52, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-name {
  font-size: 1.02em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topnav {
  display: flex;
  gap: 0.2em;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.3em;
}
.topnav a {
  color: var(--ink-soft);
  padding: 0.45em 0.85em;
  border-radius: var(--r-md);
  font-size: 0.9em;
  font-weight: 500;
  transition: color var(--t-fast), background var(--t-fast);
}
.topnav a:hover {
  color: var(--ink);
  background: rgba(20, 28, 45, 0.05);
  text-decoration: none;
}
.topnav a.active {
  color: var(--brand);
  background: var(--brand-soft);
}

/* Dropdown menu (glass) */
.dropdown { position: relative; }
.dropdown-toggle { cursor: pointer; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 240px;
  background: rgba(255, 253, 250, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.35em;
  z-index: 100;
}
.dropdown-menu a {
  display: block;
  padding: 0.55em 0.85em;
  color: var(--ink);
  border-radius: var(--r);
  font-size: 0.9em;
  font-weight: 500;
}
.dropdown-menu a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.dropdown:hover .dropdown-menu { display: block; }

.user-block {
  display: flex;
  gap: 1em;
  align-items: center;
  color: var(--ink-soft);
  padding-left: 1em;
  border-left: 1px solid var(--border);
}
.user-block .account-link { color: var(--ink); font-weight: 500; }
.user-block .account-link:hover { color: var(--brand); text-decoration: none; }
.user-block button.link {
  background: none;
  border: 0;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-weight: 500;
}
.user-block button.link:hover { color: var(--brand-2); }
.account-link { color: var(--ink-soft); }

/* ─── Page ─── */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2em 1.6em 4em;
}
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 1.4em;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 1.75em;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.022em;
}
.page-head .muted { margin: 0.3em 0 0; }

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.4em 1.6em;
  margin: 1em 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.card h2 {
  margin: 0 0 1em;
  font-size: 1.05em;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card h3 {
  margin: 1.2em 0 0.6em;
  font-size: 0.95em;
  font-weight: 600;
}

/* ─── Buttons ─── */
button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.55em 1.1em;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9em;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform 0.05s;
}
button:hover, .btn:hover { background: var(--surface-2); border-color: rgba(20, 28, 45, 0.22); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }

button.primary, .btn.primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  border-color: var(--brand-2);
  box-shadow:
    0 1px 2px rgba(199, 70, 52, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
button.primary:hover, .btn.primary:hover {
  background: linear-gradient(180deg, var(--brand-2) 0%, var(--brand-3) 100%);
  box-shadow:
    0 2px 6px rgba(199, 70, 52, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

button.link {
  background: none;
  border: 0;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-weight: 500;
}
button.link:hover { text-decoration: underline; }

.actions {
  display: flex;
  gap: 0.6em;
  margin-top: 1.2em;
  align-items: center;
}

/* ─── KPIs (legacy block, refined) ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1em;
  margin: 0.6em 0 1.5em;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.2em 1.4em;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-val {
  font-size: 1.9em;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
}
.kpi-lbl {
  font-size: 0.74em;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-top: 0.4em;
}
.kpi.danger .kpi-val { color: var(--red); }

/* ─── Tables ─── */
table.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
}
table.grid th {
  text-align: left;
  padding: 0.7em 0.9em;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--surface-2);
}
table.grid th.num, table.grid td.num { text-align: right; }
table.grid td {
  padding: 0.7em 0.9em;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
table.grid tr:last-child td { border-bottom: none; }
table.grid tr:hover td { background: var(--surface-2); }
table.grid.compact td, table.grid.compact th { padding: 0.42em 0.6em; font-size: 0.88em; }
table.grid th a { color: var(--ink-soft); text-decoration: none; display: block; }
table.grid th a:hover { color: var(--brand); }

/* KV table on detail pages */
table.kv { border-collapse: collapse; }
table.kv th {
  text-align: left;
  padding: 0.5em 1em 0.5em 0;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.88em;
  width: 200px;
  vertical-align: top;
}
table.kv td { padding: 0.5em 0; color: var(--ink); }

/* Sev / band cells in heatmaps */
.sev-cell-critical { background: rgba(220, 38, 38, 0.15); color: var(--red); font-weight: 600; }
.sev-cell-high     { background: rgba(220, 38, 38, 0.08); color: var(--red); }
.sev-cell-medium   { background: rgba(217, 119, 6, 0.10); color: var(--amber); }
.sev-cell-low      { background: rgba(22, 163, 74, 0.10); color: var(--green); }
.sev-cell-positive { background: rgba(37, 99, 235, 0.10); color: var(--blue); }

/* ─── Badges + tiers (pill style, refined) ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22em 0.7em;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 600;
  color: white;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.4;
}
.tier-green { background: var(--green); }
.tier-amber { background: var(--amber); }
.tier-red   { background: var(--red); }
.tier-na    { background: var(--gray); }
.band-strong   { background: var(--green); }
.band-monitor  { background: #fbbf24; color: #78350f; }
.band-elevated { background: var(--amber); }
.band-high-risk { background: var(--red); }
.band-no-score { background: var(--gray); }
.sev-low      { background: var(--green); }
.sev-medium   { background: var(--amber); }
.sev-high     { background: var(--red); }
.sev-critical { background: #991b1b; }
.attn-watch    { background: #fbbf24; color: #78350f; }
.attn-elevated { background: var(--amber); }
.attn-material { background: var(--red); }

/* Tier bar */
.tier-bar {
  display: flex;
  height: 28px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
}
.tier-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85em;
  min-width: 24px;
}

/* ─── Forms ─── */
.row { margin: 0.6em 0; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
form.card.stack label {
  display: block;
  margin: 0.8em 0;
  font-size: 0.86em;
  font-weight: 500;
  color: var(--ink-2);
}
form.card.stack label > input,
form.card.stack label > select,
form.card.stack label > textarea,
.login-card input,
.filters input,
.filters select {
  display: block;
  width: 100%;
  margin-top: 0.4em;
  padding: 0.65em 0.85em;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.95em;
  color: var(--ink);
  background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  font-variant-numeric: tabular-nums;
}
form.card.stack label > input:focus,
form.card.stack label > select:focus,
form.card.stack label > textarea:focus,
.login-card input:focus,
.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring-focus);
}
form.card.stack label > select { cursor: pointer; appearance: menulist; }
form.card.stack label .muted { display: block; font-size: 0.82em; margin-top: 0.3em; }
.filters { display: flex; gap: 0.5em; align-items: center; margin-bottom: 1em; flex-wrap: wrap; }
.filters input, .filters select { width: auto; margin-top: 0; padding: 0.5em 0.7em; }

/* ─── Notices ─── */
.err {
  background: var(--red-soft);
  color: #991b1b;
  padding: 0.8em 1em;
  border-radius: var(--r-md);
  border: 1px solid #fca5a5;
  border-left: 4px solid var(--red);
  margin: 0.8em 0;
  font-size: 0.92em;
}
.ok {
  background: var(--green-soft);
  color: #166534;
  padding: 0.8em 1em;
  border-radius: var(--r-md);
  border: 1px solid #86efac;
  border-left: 4px solid var(--green);
  margin: 0.8em 0;
  font-size: 0.92em;
}

/* Footer */
.foot {
  padding: 2em 1em 1em;
  text-align: center;
  color: var(--muted);
  font-size: 0.85em;
}

/* ─── Login page ─── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-pattern);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.5em 2.5em;
  width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand-row {
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-weight: 600;
  margin-bottom: 1.8em;
  font-size: 1.05em;
}
.login-card label {
  display: block;
  margin: 1em 0;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--ink-2);
}
.login-card button {
  width: 100%;
  margin-top: 1.2em;
  padding: 0.8em;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  border-color: var(--brand-2);
  font-weight: 600;
  font-size: 0.95em;
  border-radius: var(--r-md);
  box-shadow:
    0 1px 2px rgba(199, 70, 52, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.login-card button:hover {
  background: linear-gradient(180deg, var(--brand-2) 0%, var(--brand-3) 100%);
  box-shadow:
    0 2px 6px rgba(199, 70, 52, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ─── Admin / lookups ─── */
.lookups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1em;
  margin: 0.5em 0;
}
.lookup-card ul { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; }
.lookup-card li {
  padding: 0.35em 0;
  border-bottom: 1px dotted var(--border);
  font-size: 0.92em;
}

/* ─── Filter chips ─── */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  align-items: center;
  margin: 0.4em 0 1em;
}
.filter-label {
  font-size: 0.82em;
  color: var(--ink-soft);
  margin-left: 0.6em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-label:first-child { margin-left: 0; }
.chip {
  display: inline-block;
  padding: 0.28em 0.85em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.82em;
  color: var(--ink);
  background: var(--surface);
  font-weight: 500;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chip:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip-active { background: var(--brand); color: white; border-color: var(--brand); }
.chip-active:hover { background: var(--brand-2); color: white; }
.chip-clear { color: var(--red); font-size: 0.82em; padding: 0.2em 0.5em; }

/* ─── Two-col widget grid ─── */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; margin: 0.4em 0; }
@media (max-width: 1000px) { .grid-2col { grid-template-columns: 1fr; } }

/* ─── Misc ─── */
.row-archived td { opacity: 0.5; font-style: italic; }
.req { color: var(--red); font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }

/* ─── Scorecard ─── */
.scorecard-head { display: flex; gap: 2em; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1em; }
.scorecard-head .kpi-val { font-size: 1.7em; font-weight: 700; }
.scorecard-head .kpi-lbl { font-size: 0.78em; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.progress-mini { background: var(--border-soft); height: 5px; border-radius: 3px; overflow: hidden; margin-top: 4px; max-width: 120px; margin-left: auto; }
.progress-mini > div {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  height: 100%;
  border-radius: 3px;
}
.category-card h2 { color: var(--brand); }
.scorecard-grid select, .scorecard-grid input {
  padding: 0.4em 0.5em;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  font-size: 0.88em;
  font-family: inherit;
  background: var(--surface);
  max-width: 100%;
}
.scorecard-grid select.score-select { font-weight: 600; }
.scorecard-grid input.inline-sm { width: 110px; margin-right: 0.3em; margin-bottom: 0.2em; }
.scorecard-grid input.inline-md { width: 220px; }
.scorecard-grid tr:hover td { background: transparent; cursor: default; }
.sticky-save {
  position: sticky;
  bottom: 0;
  background: rgba(255, 253, 250, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.9em 1.2em;
  box-shadow: 0 -4px 16px rgba(20, 28, 45, 0.06);
  display: flex;
  align-items: center;
  gap: 1em;
  z-index: 50;
  margin-top: 1.4em;
}

/* ─── Import summary ─── */
.import-summary { display: flex; gap: 2.5em; margin: 0.8em 0; }
.import-summary div { display: flex; flex-direction: column; align-items: flex-start; }
.import-summary .num {
  font-size: 1.9em;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.import-summary .lbl {
  font-size: 0.78em;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.import-form { border-top: 1px solid var(--border); padding: 1em 0; }
.import-form h3 { margin: 0 0 0.5em; }
.import-form input[type=file] { margin-right: 0.6em; }
.action-list { list-style: none; padding: 0; }
.action-list li { padding: 0.4em 0; }

/* ─── Attachments ─── */
.upload-form {
  margin-top: 1em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.8em;
  flex-wrap: wrap;
}

/* ═════════════════════════════════════════════════════════════════════════
 * EXECUTIVE DASHBOARD - Redwood polish
 * ═════════════════════════════════════════════════════════════════════════ */

.exec-doc {
  background: var(--surface);
  padding: 2.4em 2.8em 3em;
  border-radius: var(--r-2xl);
  border: 1px solid var(--border);
  max-width: 1440px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.exec-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.6em;
  margin-bottom: 2em;
}
.exec-header .exec-title {
  font-size: 1.8em;
  font-weight: 700;
  letter-spacing: -0.024em;
  color: var(--ink);
  margin: 0;
}
.exec-header .exec-subtitle {
  font-size: 0.96em;
  color: var(--ink-soft);
  margin: 0.4em 0 1.2em;
}
.exec-meta-row { display: flex; gap: 3em; margin-top: 0.8em; }
.exec-meta-row div { display: flex; flex-direction: column; }
.exec-meta-row .lbl {
  font-size: 0.7em;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}
.exec-meta-row .val {
  font-size: 1.18em;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.012em;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15em;
}

/* Section bands - refined from solid blue */
.exec-section-band {
  font-size: 0.72em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand);
  padding: 0;
  background: transparent;
  margin: 2.2em 0 1em;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8em;
}
.exec-section-band:after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--brand-glow), var(--border) 30%);
}
.exec-section { margin: 2em 0; }

/* Summary band */
.exec-summary-band {
  background:
    linear-gradient(135deg, rgba(199, 70, 52, 0.05) 0%, rgba(199, 70, 52, 0.01) 60%),
    var(--surface);
  border: 1px solid rgba(199, 70, 52, 0.16);
  border-radius: var(--r-lg);
  padding: 1.3em 1.6em;
  margin-bottom: 1.6em;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.exec-summary-band .summary-tag {
  font-size: 0.68em;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 0.7em;
  display: inline-block;
  background: var(--brand-soft);
  padding: 0.3em 0.7em;
  border-radius: var(--r-sm);
}
.exec-summary-band .summary-sentence {
  margin: 0.3em 0;
  font-size: 1.05em;
  color: var(--ink);
  line-height: 1.6;
}

/* This Week's #1 callout */
.exec-callout {
  background:
    linear-gradient(135deg, #fff7ed 0%, #ffe4cc 100%);
  border: 1px solid #fdba74;
  border-radius: var(--r-lg);
  padding: 1.5em 1.7em 1.5em 2em;
  margin-bottom: 1.6em;
  box-shadow:
    0 2px 8px rgba(234, 88, 12, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
}
.exec-callout:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%);
}
.exec-callout .callout-label {
  font-size: 0.68em;
  color: #c2410c;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 0.5em;
  display: inline-block;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.3em 0.7em;
  border-radius: var(--r-sm);
}
.exec-callout .callout-name {
  font-size: 1.6em;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.5em;
  color: var(--ink);
  line-height: 1.15;
}
.exec-callout .callout-name a {
  color: var(--ink);
  border-bottom: 2px solid #ea580c;
  padding-bottom: 2px;
  transition: color var(--t-fast);
}
.exec-callout .callout-name a:hover { color: var(--brand); text-decoration: none; }
.exec-callout .callout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3em;
  align-items: center;
  font-size: 0.92em;
  color: var(--ink-2);
}
.exec-callout .callout-meta span { white-space: nowrap; }
.exec-callout .callout-meta strong { color: var(--ink); font-weight: 700; }

/* Hero tiles (top of dashboard) */
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1em;
  margin-bottom: 1.2em;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.4em 1.6em;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.hero-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hero-tile:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
}
.hero-tile.danger:before { background: linear-gradient(180deg, var(--red) 0%, #991b1b 100%); }
.hero-tile .tile-num {
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.hero-tile .tile-num-sub {
  font-size: 0.42em;
  font-weight: 500;
  color: var(--ink-soft);
  margin-left: 0.3em;
  letter-spacing: 0;
}
.hero-tile .tile-lbl {
  font-size: 0.74em;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  margin: 0.8em 0 0.3em;
}
.hero-tile .tile-foot {
  font-size: 0.84em;
  color: var(--ink-soft);
  line-height: 1.55;
}
.hero-tile .lx-caveat {
  display: inline-block;
  background: var(--amber-soft);
  color: #92400e;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 600;
  margin-left: 0.4em;
}

/* Health strip */
.health-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.7em;
  margin-top: 0.5em;
}
@media (max-width: 1100px) { .health-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .health-strip { grid-template-columns: repeat(2, 1fr); } }
.strip-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.85em 1em;
  box-shadow: var(--shadow-sm);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.strip-tile:hover { background: var(--surface-2); border-color: var(--border-strong); }
.strip-tile.strip-danger { background: var(--red-soft); border-color: #fca5a5; }
.strip-tile.strip-warn { background: var(--amber-soft); border-color: #fde047; }
.strip-num {
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.012em;
  font-variant-numeric: tabular-nums;
}
.strip-num.green-text { color: var(--green); }
.strip-num.red-text { color: var(--red); }
.strip-lbl {
  font-size: 0.7em;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-top: 0.3em;
}

/* Ribbon */
.exec-ribbon { margin: 0 0 1.5em 0; padding: 0; }
.ribbon-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  padding: 0.9em 1.2em;
  border-radius: var(--r-md);
  margin-bottom: 0.5em;
  background: var(--surface);
  font-size: 0.92em;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.ribbon-item strong { color: var(--ink); font-weight: 700; }
.ribbon-item.ribbon-warn {
  background: linear-gradient(90deg, var(--amber-soft) 0%, var(--surface) 70%);
  border-color: #fde68a;
  border-left-color: #d97706;
  color: #78350f;
}
.ribbon-item.ribbon-info {
  background: linear-gradient(90deg, var(--blue-soft) 0%, var(--surface) 70%);
  border-color: #bfdbfe;
  border-left-color: var(--blue);
  color: #1e3a8a;
}

/* Trend annotation */
.trend-annotation {
  margin: 0 0 1em;
  font-size: 0.95em;
  color: var(--ink);
  background: var(--surface-2);
  border-left: 3px solid var(--ink);
  padding: 0.7em 1.1em;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-weight: 500;
}

/* Watchlist polish */
.watchlist-grid { background: var(--surface); border-radius: var(--r-md); overflow: hidden; }
.watchlist-grid tr.wl-row { cursor: pointer; transition: background var(--t-fast); }
.watchlist-grid tr.wl-row:hover .wl-arrow { color: var(--brand); transform: translateX(3px); }
.watchlist-grid .vp-focus { color: var(--ink); font-weight: 500; }
.watchlist-grid .wl-arrow {
  color: var(--ink-soft);
  text-align: right;
  font-size: 1.15em;
  transition: transform var(--t), color var(--t-fast);
  width: 1.5em;
}
.delta-down { color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; }
.delta-up   { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ─── Legacy exec briefing layout (some pages still use it) ─── */
.exec-section-title {
  color: var(--brand);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5em;
  font-size: 1.1em;
  font-weight: 600;
}
.exec-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9em;
}
.exec-kpi {
  padding: 1em 1.2em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.exec-kpi .num {
  font-size: 1.8em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.exec-kpi .num.green { color: var(--green); }
.exec-kpi .num.amber { color: var(--amber); }
.exec-kpi .num.red { color: var(--red); }
.exec-kpi .lbl {
  font-size: 0.78em;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-top: 0.3em;
}
.exec-footer {
  margin-top: 2.5em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.85em;
  text-align: center;
}
.mover-up { color: var(--green); font-weight: 600; }
.mover-down { color: var(--red); font-weight: 600; }
.page-break { page-break-before: always; }

/* Legacy health grid (older pages) */
.health-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.9em;
}
@media (max-width: 1100px) { .health-grid { grid-template-columns: repeat(3, 1fr); } }
.health-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.1em 1.2em;
  border-left: 4px solid var(--brand);
  box-shadow: var(--shadow-sm);
}
.health-tile .tile-num {
  font-size: 1.7em;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
}
.health-tile .tile-num.green { color: var(--green); }
.health-tile .tile-num.red { color: var(--red); }
.health-tile .tile-lbl {
  font-size: 0.74em;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin: 0.5em 0 0.2em;
}
.health-tile .tile-foot { font-size: 0.78em; color: var(--ink-soft); }

/* ─── Tablet/small viewport ─── */
@media (max-width: 1024px) {
  .watchlist-grid .wl-collapse { display: none; }
  .exec-doc { padding: 1.6em 1.3em; }
  .exec-callout .callout-meta { gap: 0.7em 0.9em; font-size: 0.86em; }
  .page { padding: 1.4em 1em 3em; }
}
@media (max-width: 768px) {
  header.topbar { flex-direction: column; align-items: stretch; gap: 0.5em; padding: 0.6em 1em; }
  header.topbar .topnav { justify-content: flex-start; }
  .user-block { padding-left: 0; border-left: none; border-top: 1px solid var(--border); padding-top: 0.5em; }
  .row.two { grid-template-columns: 1fr; }
  .exec-header .exec-title { font-size: 1.4em; }
}

/* ─── Print ─── */
@media print {
  body { background: white; }
  .topbar, .no-print, .foot { display: none !important; }
  .page { padding: 0; max-width: 100%; }
  .exec-doc { border: 0; padding: 0; box-shadow: none; }
  .card { box-shadow: none; }
}
