/* ======================================================================
   Sigma Global Trend IA — Area clienti
   Design direction: refined editorial, European institutional gravitas.
   Palette: warm cream + deep navy + warm gold accent.
   ====================================================================== */

:root {
  /* Surfaces */
  --bg:          #f7f3ec;
  --bg-elev:    #fbf8f2;
  --surface:    #ffffff;
  --surface-alt:#faf6ee;

  /* Ink */
  --ink:        #1a2332;
  --ink-2:      #2c3a50;
  --ink-muted:  #66748a;
  --ink-faint:  #9ba5b4;

  /* Lines */
  --line:       #e4dccb;
  --line-strong:#c9bea6;
  --hairline:   #ede5d3;

  /* Brand / accents */
  --gold:       #b8965a;
  --gold-dark:  #8f6f3d;
  --gold-soft:  #e8d9b5;

  /* Semantic */
  --pos:        #2d7a4f;
  --pos-soft:   #d8ead9;
  --neg:        #b94244;
  --neg-soft:   #f4d9d6;
  --warn:       #8f6f3d;
  --warn-soft:  #e8d9b5;
  --neu:        #8693a7;

  /* Sector palette (matches report) */
  --sec-healthcare:    #2d9a6e;
  --sec-biotech:       #1f8f7a;
  --sec-financials:    #4db8a8;
  --sec-banks:         #2f6fb2;
  --sec-insurance:     #5fa3d3;
  --sec-defense:       #d44a4a;
  --sec-aerospace:     #a13d63;
  --sec-semi:          #8b6fb5;
  --sec-software:      #6f63d9;
  --sec-energy:        #e68a3c;
  --sec-tech:          #4a85c4;
  --sec-cash:          #a8b3c4;
  --sec-consumer:      #c9a05c;
  --sec-staples:       #b7a14a;
  --sec-industrial:    #5e8a6b;
  --sec-materials:     #9b7b5d;
  --sec-utilities:     #7a8fb0;
  --sec-realestate:    #b8854a;
  --sec-telecom:       #6a95a5;

  /* Chart colors */
  --chart-ptf:   #1a4d7a;
  --chart-ptf-soft: rgba(26, 77, 122, 0.12);
  --chart-bench: #b94244;
  --chart-dd:    #b94244;
  --chart-rti:   #8f6f3d;

  /* Type scale */
  --font-display: 'Instrument Serif', 'Playfair Display', Georgia, serif;
  --font-ui:      'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Layout */
  --container: 1280px;
  --radius-sm: 2px;
  --radius:    4px;
  --shadow-sm: 0 1px 2px rgba(26, 35, 50, 0.04), 0 0 0 1px var(--line);
  --shadow:    0 2px 8px rgba(26, 35, 50, 0.06), 0 0 0 1px var(--line);
  --perf-top-min-h: 420px;
  --perf-dd-h:  240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' on, 'cv11' on;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' on, 'zero' on;
  letter-spacing: -0.01em;
}
.muted { color: var(--ink-muted); font-weight: 400; }
.neg   { color: var(--neg); }
.pos   { color: var(--pos); }
.hidden { display: none !important; }

/* ===== Login gate ===== */
.login-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at top right, rgba(184, 150, 90, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 100%);
}
.login-shell {
  width: 100%;
  max-width: 460px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 34px 32px;
}
.login-card__brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 8px;
}
.login-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
}
.login-card__lead {
  margin: 14px 0 0;
  color: var(--ink-muted);
}
.login-form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}
.login-form__field {
  display: grid;
  gap: 7px;
}
.login-form__field span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.login-form__field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--ink);
  font: inherit;
}
.login-form__field input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.login-form__error {
  padding: 10px 12px;
  border: 1px solid rgba(185, 66, 68, 0.18);
  background: var(--neg-soft);
  color: var(--neg);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.login-form__submit {
  justify-content: center;
  width: 100%;
}
.ia-trigger {
  display: inline-block;
}

/* ===== Admin modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 50, 0.48);
  backdrop-filter: blur(2px);
}
.modal__dialog {
  position: relative;
  width: min(100%, 520px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(26, 35, 50, 0.18);
  padding: 24px;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal__title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.modal__lead {
  margin: 12px 0 0;
  color: var(--ink-muted);
}
.modal-form {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}
.modal__message {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink);
}
.modal__message--error {
  border-color: rgba(185, 66, 68, 0.18);
  background: var(--neg-soft);
  color: var(--neg);
}
.modal__message--success {
  border-color: rgba(45, 122, 79, 0.18);
  background: var(--pos-soft);
  color: var(--pos);
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 32px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.topbar__band {
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 60%, var(--gold) 100%);
}
.brand__issuer {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 2px;
}
.brand__strategy {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.topbar__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar__printdate {
  display: none;
  font-size: 12px;
  color: var(--ink-muted);
  padding-right: 8px;
}
.datepick {
  display: flex;
  align-items: center;
}
.datepick__input {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: var(--radius-sm);
  min-width: 160px;
  cursor: pointer;
}
.datepick__input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn--primary {
  background: var(--ink);
  color: var(--bg-elev);
  border-color: var(--ink);
}
.btn--primary:hover {
  background: var(--ink-2);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--ink);
}
.btn__icon {
  font-size: 16px;
  line-height: 1;
}

/* ===== Loader ===== */
.loader {
  max-width: var(--container);
  margin: 0 auto;
  padding: 120px 32px;
  text-align: center;
  color: var(--ink-muted);
}
.loader__spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 16px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader__text {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== App layout ===== */
.app {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px;
}

/* ===== KPI strip ===== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 40px;
}
.kpi {
  padding: 20px 24px;
  border-right: 1px solid var(--hairline);
}
.kpi:last-child { border-right: none; }
.kpi__label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.kpi__value {
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* ===== Sections ===== */
.section {
  margin-bottom: 48px;
}
.section--muted {
  background: var(--surface-alt);
  padding: 32px;
  border: 1px solid var(--line);
  margin-left: -32px;
  margin-right: -32px;
  padding-left: 32px;
  padding-right: 32px;
}
.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gold);
  border-bottom-width: 1px;
}
.section__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.section__note {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* ===== Panels & grids ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px 24px;
  border-radius: var(--radius);
}
.panel__title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 14px;
}
.panel--chart { padding: 20px 20px 14px; }
.panel--table { padding: 0; overflow: hidden; }
.panel--rolling .panel__title {
  margin: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.panel--heatmap { padding: 24px; }
.panel--ops { margin-top: 16px; }
.panel__tablehead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 18px 20px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid--2   { grid-template-columns: 1fr 1fr; }
.grid--2-1 { grid-template-columns: 2fr 1fr; }
.grid--3-2 { grid-template-columns: 3fr 2fr; }
.grid--1-2 { grid-template-columns: 1fr 2fr; }

.perf-top { align-items: stretch; }
.perf-top > .panel,
.perf-top > .stats-card { min-height: var(--perf-top-min-h); }
.perf-top .panel--chart,
.perf-dd {
  display: flex;
  flex-direction: column;
}
.perf-top .panel--chart canvas,
.perf-dd canvas {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.perf-dd {
  height: var(--perf-dd-h);
  margin-top: 16px;
}

.panel--chart-tight { padding: 12px; }

.stats-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stats-card__header {
  background: #0b1d36;
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 14px 12px;
}
.stats-card__body {
  padding: 10px 12px 12px;
  overflow: visible;
}
.stats-card__section {
  font-family: var(--font-display);
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
  padding: 6px 0 8px;
  position: relative;
}
.stats-card__section::before,
.stats-card__section::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 34%;
  height: 1px;
  background: var(--line);
}
.stats-card__section::before { left: 0; }
.stats-card__section::after { right: 0; }

.stats--card { margin: 0 0 8px; }
.stats--card .stats__row {
  padding: 11px 10px;
  border-bottom: 0;
  background: transparent;
}
.stats--card .stats__row:nth-child(odd) { background: #eef6ff; }
.stats--card dt {
  font-size: 12px;
  color: var(--ink-2);
}
.stats--card dd {
  font-size: 13px;
  font-weight: 700;
}
.stats--card dd.pos { color: var(--pos); }
.stats--card dd.neg { color: var(--neg); }

/* ===== Stats list ===== */
.stats { margin: 0; }
.stats__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px dotted var(--line);
}
.stats__row:last-child { border-bottom: none; }
.stats__row dt {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 400;
}
.stats__row dd {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}

/* ===== Tables ===== */
.ptf-table,
.rebal-table,
.rolling-table,
.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ptf-table th,
.rebal-table th,
.rolling-table th,
.ops-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}
.ptf-table td,
.rebal-table td,
.rolling-table td,
.ops-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.ptf-table tr:last-child td,
.rebal-table tr:last-child td,
.rolling-table tr:last-child td,
.ops-table tr:last-child td { border-bottom: none; }
.ptf-table tr:hover td,
.rebal-table tr:hover td,
.ops-table tr:hover td { background: var(--surface-alt); }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.ptf-table .ticker { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.ptf-table .isin   { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }
.ptf-table .weight { font-family: var(--font-mono); font-weight: 600; }
.ops-table .ticker { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }

.ops-empty {
  padding: 18px 20px;
  color: var(--ink-muted);
  font-size: 13px;
  background: var(--surface);
}

.ops-action {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ops-action--enter,
.ops-action--up {
  background: var(--pos-soft);
  color: var(--pos);
}
.ops-action--exit {
  background: var(--neg-soft);
  color: var(--neg);
}
.ops-action--down {
  background: var(--warn-soft);
  color: var(--warn);
}

/* Sector chips */
.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #ffffff;
  white-space: nowrap;
}
.chip--cash        { background: var(--sec-cash); color: var(--ink); }
.chip--healthcare  { background: var(--sec-healthcare); }
.chip--biotech     { background: var(--sec-biotech); }
.chip--financials  { background: var(--sec-financials); }
.chip--banks       { background: var(--sec-banks); }
.chip--insurance   { background: var(--sec-insurance); }
.chip--defense     { background: var(--sec-defense); }
.chip--aerospace   { background: var(--sec-aerospace); }
.chip--semi        { background: var(--sec-semi); }
.chip--software    { background: var(--sec-software); }
.chip--energy      { background: var(--sec-energy); }
.chip--tech        { background: var(--sec-tech); }
.chip--consumer    { background: var(--sec-consumer); }
.chip--staples     { background: var(--sec-staples); }
.chip--industrial  { background: var(--sec-industrial); }
.chip--materials   { background: var(--sec-materials); }
.chip--utilities   { background: var(--sec-utilities); }
.chip--realestate  { background: var(--sec-realestate); }
.chip--telecom     { background: var(--sec-telecom); }
.chip--other       { background: var(--neu); }

/* Trigger chip (rebal history) */
.trigger-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}
.trigger-chip--riskoff {
  background: var(--neg-soft);
  color: var(--neg);
}
.source-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}
.source-badge--live       { background: var(--pos-soft); color: var(--pos); }
.source-badge--simulation { background: var(--hairline); color: var(--ink-muted); }

/* ===== Donut + RTI ===== */
.panel--split { padding: 0; overflow: hidden; }
.panel__subsection {
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline);
}
.panel__subsection:last-child { border-bottom: none; }
.donut-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.donut-center__pct {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--gold-dark);
  line-height: 1;
}
.donut-center__label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 4px;
}

.rti-gauge-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.rti-value {
  display: none;
}
.rti-components {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.rti-cmp {
  text-align: center;
  padding: 6px 4px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}
.rti-cmp__label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 2px;
}
.rti-cmp__value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.rti-components--empty {
  font-size: 12px;
  color: var(--ink-faint);
  font-style: italic;
  padding: 12px;
  text-align: center;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

/* ===== Heatmap ===== */
.heatmap {
  display: grid;
  grid-template-columns: 60px repeat(12, 1fr) 80px;
  gap: 3px;
  font-size: 12px;
}
.heatmap .hm-h {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  padding: 8px 4px;
  font-weight: 600;
}
.heatmap .hm-y {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 0 8px;
}
.heatmap .hm-c {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-alt);
}
.heatmap .hm-c.hi      { background: #2d7a4f; color: #ffffff; }
.heatmap .hm-c.mid     { background: #7bb395; color: #1a2332; }
.heatmap .hm-c.lo-pos  { background: #d4e8d9; color: #1a2332; }
.heatmap .hm-c.lo-neg  { background: #f4d9d6; color: #1a2332; }
.heatmap .hm-c.neg     { background: #b94244; color: #ffffff; }
.heatmap .hm-c.empty   { background: transparent; color: var(--ink-faint); }
.heatmap .hm-year-total {
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
  padding: 10px 4px;
  background: var(--ink);
  color: var(--bg-elev);
  border-radius: var(--radius-sm);
}
.heatmap-legend {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.hm-swatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hm-swatch::before {
  content: '';
  width: 14px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.hm-swatch.hm-hi::before     { background: #2d7a4f; }
.hm-swatch.hm-mid::before    { background: #7bb395; }
.hm-swatch.hm-lo-pos::before { background: #d4e8d9; }
.hm-swatch.hm-lo-neg::before { background: #f4d9d6; }
.hm-swatch.hm-neg::before    { background: #b94244; }

/* ===== Glossary ===== */
.glossary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 32px;
  margin: 0;
}
.glossary > div {
  display: flex;
  gap: 12px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line);
}
.glossary dt {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--gold-dark);
  min-width: 110px;
  font-size: 12px;
}
.glossary dd {
  margin: 0;
  color: var(--ink-2);
}

/* ===== Legal footer ===== */
.legal {
  margin-top: 48px;
  padding: 24px 28px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.6;
}
.legal p { margin: 0 0 8px; }
.legal strong { color: var(--ink-2); letter-spacing: 0.04em; }
.legal__meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-right: none; border-bottom: 1px solid var(--hairline); }
  .grid--2, .grid--2-1, .grid--3-2, .grid--1-2 { grid-template-columns: 1fr; }
  .perf-top > .panel,
  .perf-top > .stats-card { min-height: 0; }
  .perf-top .panel--chart,
  .perf-dd { display: block; height: auto; }
  .perf-top .panel--chart canvas,
  .perf-dd canvas { flex: initial; height: auto !important; }
  .topbar__inner { padding: 14px 18px; gap: 14px; }
  .brand__strategy { font-size: 26px; }
  .app { padding: 20px 18px; }
  .login-gate { padding: 18px; }
  .login-card { padding: 28px 22px 24px; }
  .login-card__title { font-size: 31px; }
  .modal { padding: 16px; }
  .modal__dialog { padding: 20px; }
  .modal__actions { flex-direction: column-reverse; }
  .modal__actions .btn { width: 100%; justify-content: center; }
  .section__header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .glossary { grid-template-columns: 1fr; }
  .heatmap { font-size: 10px; grid-template-columns: 40px repeat(12, 1fr) 50px; }
  .heatmap .hm-c { padding: 6px 2px; }
}

@media print {
  html, body { background: var(--surface); }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .topbar { position: static; }
  .topbar__inner { padding: 12px 0; }
  .topbar__controls { display: flex; }
  .topbar__printdate { display: inline-block; }
  #btnExportPdf { display: none !important; }
  .datepick { display: none !important; }
  .modal { display: none !important; }

  .app { max-width: none; padding: 0; }
  .panel { box-shadow: none; }

  .print-break-after { break-after: page; page-break-after: always; }
  section, .panel, .panel--table, table { break-inside: avoid; page-break-inside: avoid; }
}
