/* Functional management workspace, charcoal / restrained gold. */
body:has(#role option[value="director"]:checked) main,body:has(#role option[value="admin"]:checked) main{max-width:1900px;padding:30px 32px}body:has(#role option[value="director"]:checked) h1,body:has(#role option[value="admin"]:checked) h1{font-size:27px;font-weight:600;letter-spacing:-.7px}.dash-filters{border:1px solid var(--line);background:#1a1d19;padding:20px;border-radius:6px}.filter-dates,.filter-dimensions{display:flex;gap:16px;align-items:end;flex-wrap:wrap}.dash-filters label{flex:1;min-width:145px;margin:0;font-size:11px;color:#b8bfb2}.dash-filters select,.dash-filters input{width:100%;font-size:12px;padding:10px;min-height:42px}.filter-dates label:nth-child(3){flex:1.4}.filter-shortcuts{display:flex;gap:8px;margin:12px 0 20px}.filter-shortcuts .chip{padding:7px 12px;font-size:11px}.filter-dimensions{border-top:1px solid var(--line);padding-top:18px}.analysis-caption{font-size:12px;color:#e5e7df;padding:20px 0}.analysis-caption span{color:var(--muted);margin-left:12px}.dash-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--line);background:#1c1f1b;border-radius:6px;margin-bottom:24px}.dash-kpi{padding:19px 22px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}.dash-kpi:nth-child(3n){border-right:none}.dash-kpi:nth-last-child(-n+3){border-bottom:none}.dash-kpi>span{color:#b2baaa;font-size:11px}.dash-kpi strong{display:block;font-family:Manrope,sans-serif;font-size:29px;font-weight:600;letter-spacing:-1px;margin:9px 0}.dash-kpi small{color:#9fa895;font-size:10px}.delta{display:inline-block;font-size:11px;white-space:nowrap;padding:3px 6px;border-radius:3px}.delta.down{color:#e4a29a;background:#352522}.delta.up{color:#a9c9b4;background:#21352c}.delta.neutral{color:#a9b0a4;background:#2a2e27}.dash-chart-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:20px}.dash-chart-grid>.panel{min-width:0}.panel{padding:22px}.panel h2{font-size:17px;font-weight:600;letter-spacing:-.2px}.block-head{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:20px}.block-head p{margin:6px 0 0;font-size:11px}.block-head>span{font-size:10px;color:var(--muted)}.block-head label{font-size:10px}.block-head select{display:block;font-size:10px;max-width:170px;margin-top:6px;padding:7px}.chart-legend{display:flex;gap:22px;font-size:10px;margin:8px 0 12px;color:#b9c0b3}.key:before{content:'';display:inline-block;width:15px;height:3px;vertical-align:middle;background:#cfb57a;margin-right:7px}.key.prior:before{background:#758694}.trend-svg{width:100%;min-height:180px;display:block;overflow:visible}.trend-svg text{fill:#9ca797;font:11px sans-serif}details{color:var(--muted);font-size:10px}summary{cursor:pointer;padding:8px 0}.rank-row{border:0;border-top:1px solid #343a30;background:transparent;display:grid;grid-template-columns:20px 1fr 30px;align-items:center;gap:12px;width:100%;padding:17px 0;color:#dce0d6;text-align:left;font-size:11px}.rank-index{color:#8e9985}.rank-row i{display:block;height:4px;background:#baa574;margin-top:12px}.rank-row b{text-align:right}.rank-row:hover{color:var(--gold)}.plain-link{padding:0;border:0;background:none;color:#d5bf8c;text-align:left;font-size:12px;cursor:pointer}.family-row{display:grid;grid-template-columns:1fr auto;gap:10px;margin:25px 0;font-size:12px}.family-row .bar{grid-column:1/-1}.family-row b{font-weight:400;color:#c9d0c1}.panel-note{border-top:1px solid var(--line);padding-top:20px;margin-top:30px}.panel-note b{font-size:12px;color:#d5bd84}.coverage{display:inline-block;border-radius:3px;padding:5px 8px;background:#262a24;color:#8f9a85;font-size:10px}.coverage.bought{background:#283c2d;color:#b9d3b7}.coverage.stopped{background:#3a2922;color:#e4b59d}.signal{border-top:1px solid var(--line);padding:15px 0;display:flex;flex-direction:column;gap:7px;font-size:12px}.signal span{font-size:11px;color:var(--muted);line-height:1.6}.signal .plain-link{font-size:11px}.quick-actions{display:flex;flex-direction:column}.quick-actions a{border-bottom:1px solid var(--line);padding:18px 0;font-size:12px;color:#d4c093}.admin-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}.admin-kpis .dash-kpi{border-bottom:0;border-right:1px solid var(--line)}.admin-kpis .dash-kpi:last-child{border:0}.nav-icon{font:10px Manrope;color:#777f71}td{padding:15px 16px}.footnote{line-height:1.7}.table-wrap{max-width:100%}input[type="date"]{color-scheme:dark}body:has(#role option[value="director"]:checked) .side-bottom p,body:has(#role option[value="admin"]:checked) .side-bottom p{display:none}
@media(min-width:1600px){.dash-kpis:not(.admin-kpis){grid-template-columns:repeat(6,minmax(0,1fr))}.dash-kpi{border-bottom:0}.dash-kpi:nth-child(3n){border-right:1px solid var(--line)}.dash-kpi:last-child{border-right:0}}
@media(max-width:1180px){.dash-chart-grid{grid-template-columns:1fr}.dash-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.admin-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-kpis .dash-kpi{border-bottom:1px solid var(--line)}}
@media(max-width:760px){body:has(#role option[value="director"]:checked) main,body:has(#role option[value="admin"]:checked) main{padding:24px 16px}.page-top{flex-wrap:wrap}.filter-dates,.filter-dimensions{gap:12px}.dash-filters{padding:15px}.dash-filters label{min-width:120px}.filter-shortcuts{flex-wrap:wrap}.dash-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dash-kpi{padding:15px;border-right:1px solid var(--line)!important;border-bottom:1px solid var(--line)!important}.dash-kpi:nth-child(2n){border-right:0!important}.dash-kpi:nth-last-child(-n+2){border-bottom:0!important}.dash-kpi strong{font-size:25px}.panel{padding:17px}.block-head{flex-wrap:wrap}.analysis-caption span{display:block;margin:6px 0 0}.trend-svg{min-height:150px}.chart-legend{gap:10px}}
.chart-controls{display:flex;gap:10px}.chart-controls label{min-width:80px}.side-bottom>a{display:block;margin-top:10px}.side-bottom{right:20px;line-height:1.6}
@media(min-width:1280px){.dash-kpis:not(.admin-kpis){grid-template-columns:repeat(6,minmax(0,1fr))}.dash-kpis:not(.admin-kpis) .dash-kpi{border-bottom:0;border-right:1px solid var(--line);padding:16px}.dash-kpis:not(.admin-kpis) .dash-kpi:last-child{border-right:0}.dash-kpis:not(.admin-kpis) .dash-kpi strong{font-size:26px}.dash-kpi>div{line-height:1.7}.dash-kpi small{display:block}.dash-filters{padding:16px}.filter-shortcuts{margin:8px 0 12px}.filter-dimensions{padding-top:13px}.page-top{margin-bottom:22px}.analysis-caption{padding:15px 0}}
.portal-start{display:grid;grid-template-columns:1.6fr 1fr;gap:30px;padding:30px;background:#21241e;border:1px solid #4a4b3e;border-radius:6px}.portal-start h2{font-size:24px}.portal-start p{max-width:540px}.portal-status{display:flex;flex-direction:column;gap:16px;justify-content:center;border-left:1px solid var(--line);padding-left:30px}.portal-status span{font-size:11px;color:var(--muted)}.portal-status b{font-size:20px}.quick-strip{display:flex;gap:25px;flex-wrap:wrap;padding:22px 0;border-bottom:1px solid var(--line)}.quick-strip a{color:#d5bf8c;font-size:12px}@media(max-width:760px){.portal-start{grid-template-columns:1fr;padding:22px}.portal-status{border-left:0;border-top:1px solid var(--line);padding:20px 0 0}.quick-strip{gap:18px}}

.commitment-equipment progress{width:100px;accent-color:#cfb57a}.commitment-equipment td{vertical-align:middle}

.alert-picker { min-width: 0; border: 1px solid var(--line, #494942); border-radius: .5rem; padding: .6rem .75rem; }
.alert-picker summary { cursor: pointer; }
.alert-options { max-height: 12rem; overflow: auto; padding: .4rem 0; display: grid; gap: .25rem; }
.alert-options label { display: flex; align-items: baseline; gap: .55rem; margin: 0; }
.alert-options input[type=checkbox] { width: auto; }

.analysis-order-detail summary{cursor:pointer;color:var(--gold);white-space:nowrap}
.analysis-order-detail ul{margin:8px 0 0;padding-left:18px;min-width:12rem}
.analysis-order-detail li+li{margin-top:4px}

.commitment-outlook{display:grid;gap:8px;min-width:0;overflow-wrap:anywhere}
.commitment-outlook p{margin:0}
.commitment-risk {
  padding: 8px 12px;
  border-inline-start: 3px solid currentColor;
  border-radius: 4px;
}
.commitment-risk-moderate { color: #ffbf83; background: #352318; }
.commitment-risk-high { color: #ffaaaa; background: #3b2025; }
.minimum-chart-row{display:grid;gap:4px;padding:8px 0;border-bottom:1px solid var(--line)}
.minimum-chart-label{display:flex;justify-content:space-between;align-items:center;gap:10px}
.minimum-chart-label button{padding:3px 8px;text-align:left}
.minimum-chart-row progress{display:block;width:100%;height:10px;appearance:none;border:0;border-radius:6px;overflow:hidden;background:#52564e;accent-color:var(--gold)}
.minimum-chart-row progress::-webkit-progress-bar{background:#52564e}
.minimum-chart-row progress::-webkit-progress-value{background:var(--gold)}
.minimum-chart-row progress::-moz-progress-bar{background:var(--gold)}
.minimum-chart-legend{display:flex;gap:15px;flex-wrap:wrap}
.minimum-chart-legend span::before{content:'';display:inline-block;width:10px;height:10px;margin-right:6px;border-radius:2px;background:var(--gold)}
.minimum-chart-legend span+span::before{background:#52564e}
.minimum-chart summary,.minimum-fleet summary{cursor:pointer;padding:8px 0}
.minimum-detail-table :is(th,td) small{display:block;color:var(--muted)}


.fleet-ranking{list-style:none;padding:0;margin:12px 0}
.fleet-ranking li{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:10px;padding:12px 0;border-bottom:1px solid var(--line)}
.fleet-position{font-weight:700;color:var(--gold)}
.fleet-result{overflow-wrap:anywhere}
.fleet-score{text-align:right}
.fleet-result small,.fleet-score small{display:block;margin-top:3px;color:var(--muted)}
@media(max-width:480px){
  .fleet-ranking li{grid-template-columns:auto minmax(0,1fr);gap:6px 10px}
  .fleet-score{grid-column:2;text-align:left}
  .fleet-score small{display:inline;margin-left:5px}
}

.commercial-dashboard { min-width: 0; }
.commercial-dashboard h2 { margin: 0; font-size: clamp(17px, 2vw, 23px); }
.panel.purchase-comparator {
  margin: 0 0 14px;
  padding: 0 14px;
  border-color: #88734d;
  background: #24251e;
}
.purchase-comparator[open] { padding-bottom: 14px; }
.purchase-comparator.fold-panel > summary { font-size: clamp(16px, 2vw, 19px); }
.purchase-comparator.fold-panel > summary small {
  display: block;
  margin: 3px 0 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.commercial-dashboard .fold-panel > summary,
.purchase-comparator.fold-panel > summary {
  min-height: 44px;
  padding-block: 8px;
  align-content: center;
}
.commercial-indicators[open] > summary { margin-bottom: 0; }
.dash-kpis.commercial-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.commercial-kpis > .dash-kpi:nth-child(n) {
  padding: 6px 12px;
  border-bottom: 0 !important;
  border-right: 1px solid var(--line) !important;
}
.commercial-kpis > .dash-kpi:first-child { padding-left: 0; }
.commercial-kpis > .dash-kpi:last-child { border-right: 0 !important; }
.commercial-kpis .dash-kpi strong {
  font-size: clamp(15px, 2.5vw, 25px);
  overflow-wrap: anywhere;
}
.commercial-kpis .dash-kpi > span { overflow-wrap: anywhere; }
.commercial-kpis .dash-kpi small { display: block; }

.commercial-overview {
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.commercial-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 4vw, 28px);
}
.distributor-share { min-width: 0; }
.distributor-share.fold-panel[open] > summary { margin-bottom: 4px; }
.distributor-share-pie {
  display: grid;
  place-items: center;
  width: min(100%, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  margin-inline: auto;
}
.distributor-share-pie > span {
  display: grid;
  place-items: center;
  width: 76%;
  white-space: nowrap;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg);
  font-size: clamp(12px, 2vw, 19px);
  font-weight: 700;
}
.commercial-share-key,
.distributor-share-legend { list-style: none; padding: 0; margin: 0; }
.commercial-share-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  color: var(--muted);
}
.commercial-share-key li { display: flex; align-items: baseline; gap: 6px; overflow-wrap: anywhere; }
.distributor-share-swatch { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.distributor-share-breakdown > summary { font-size: 12px; }
.distributor-share-legend li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.distributor-share-value { margin-left: auto; text-align: right; }
.distributor-share-value small { display: block; color: var(--muted); }
.commercial-overview > .footnote { margin: 6px 0 0; }


.commercial-detail { margin-top: 12px; }
.commercial-detail-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
}
.commercial-detail-row { border-top: 1px solid var(--line); min-width: 0; }
.commercial-detail-row > summary { font-size: 15px; }
.commercial-detail-row .panel {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  margin: 0;
  padding: 0 0 0 12px;
}
.commercial-detail-row .panel[open] { padding-bottom: 12px; }
.commercial-detail-row .dash-chart-grid { display: block; margin: 0; }
@media (max-width: 760px) {
  .commercial-kpis > .dash-kpi:nth-child(n) { padding-inline: 6px; }
  .commercial-kpis > .dash-kpi:first-child { padding-left: 0; }
  .commercial-detail-row .chart-controls { flex-wrap: wrap; }
}

#modal[open]:has(.commercial-print) { width: min(820px, calc(100vw - 28px)); max-width: none; }
.commercial-print > header { position: static; display: block; padding: 0; border: 0; background: transparent; }
.commercial-print > header span { color: var(--gold); }
.commercial-print h2 { margin: 3px 0 12px; }
.commercial-print h3 { margin: 0 0 6px; }
.commercial-print dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 12px; margin: 12px 0; }
.commercial-print dt { font-size: .9em; color: var(--muted); }
.commercial-print dd { margin: 0; overflow-wrap: anywhere; }
.commercial-print-actions { margin: 14px 0; }
.commercial-print-figure { margin: 18px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.commercial-print-figure p { margin: 0 0 8px; }
.commercial-print-share { display: grid; grid-template-columns: minmax(68px,110px) minmax(0,1fr); gap: 12px; align-items: center; }
.commercial-print-share > svg { width: 100%; }
.commercial-print-share :is(th,td) { padding: 5px 4px; white-space: normal; overflow-wrap: anywhere; }
.commercial-print-minimum { margin: 9px 0; }
.commercial-print-minimum > svg { display: block; width: 100%; height: 8px; margin-block: 4px; }
.commercial-print-footnote { font-size: .9em; }
@media print {
  body:has(#modal[open] .commercial-print) { background: white; }
  body:has(#modal[open] .commercial-print) > :not(#modal) { display: none !important; }
  #modal[open]:has(.commercial-print) {
    display: block !important; position: static !important; width: auto !important;
    max-width: none !important; height: auto !important; max-height: none !important;
    margin: 0 !important; padding: 0 !important; overflow: visible !important;
    border: 0; box-shadow: none; background: white; color: #222;
  }
  #modal[open]:has(.commercial-print)::backdrop,
  #modal[open]:has(.commercial-print) .close,
  .commercial-print-actions,
  .commercial-print-trend details { display: none !important; }
  .commercial-print { font-size: 10pt; line-height: 1.35; --gold: #74551d; --muted: #454545; --line: #aaa; }
  .commercial-print :is(h2,h3,p,b,strong,td,th,dd) { color: #222; }
  .commercial-print h3 { break-after: avoid; }
  .commercial-print .trend-plot { background: white; overflow: visible; border: 0; }
  .commercial-print .trend-svg { width: 100%; min-width: 0; }
  .commercial-print .trend-svg text { fill: #333; }
  .commercial-print .trend-svg line { stroke: #c4c4c4; }
  .commercial-print svg { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .commercial-print-share, .commercial-print-trend, .commercial-print-minimum { break-inside: avoid; }
  .commercial-print table { min-width: 0; background: white; }
  .commercial-print :is(th,td) { border-color: #bbb; background: white; }
}

.distributor-share-pie > span.distributor-share-euros { font-size: clamp(.87rem, 2.4vw, 1.25rem); font-variant-numeric: tabular-nums; }

.commercial-share-key small { color: var(--muted); }
@media(max-width: 550px) { .commercial-overview-grid { grid-template-columns: minmax(0,1fr); } }

.distributor-share-bar { flex: 0 0 100%; height: 4px; background: var(--line); border-radius: 3px; }
.distributor-share-bar i { display: block; height: 100%; border-radius: inherit; }
.distributor-share-swatch { border: 1px solid #fff7; }

.trend-plot-orders { overflow-x: auto; }
.trend-plot-orders .trend-svg { min-width: 620px; }
.trend-svg .order-point-value { fill: #f3dfaa; font-size: 16px; font-weight: 700; }
.trend-svg .order-point-prior { fill: #aabecb; }
@media print {
  .commercial-print .trend-plot-orders .trend-svg { min-width: 0; }
  .commercial-print .trend-svg .order-point-value { fill: #382b12; }
  .commercial-print .trend-svg .order-point-prior { fill: #4d6574; }
}

.trend-hit { fill: transparent; cursor: pointer; }
.trend-hit:focus-visible, .trend-hit.is-selected { outline: none; stroke: var(--gold); stroke-width: 2; }
.trend-point-detail { min-height: 1.4em; margin: .45rem 0 .7rem; color: var(--muted); font-weight: 600; }
@media print { .trend-point-detail { display: none; } }

.chart-filters {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.5;
}
.chart-filters ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
}
.chart-filters li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chart-filters b { margin-inline-end: 3px; }
@media print {
  .commercial-print .chart-filters { break-inside: avoid; }
}

/* Fit distributor purchase tracking to the available panel width. */
.distributor-purchases table{width:100%;min-width:0!important;table-layout:fixed}
.distributor-purchases th,.distributor-purchases td{white-space:normal!important;overflow-wrap:anywhere;padding:10px 6px}
.distributor-purchases th:first-child{width:24%}
.distributor-purchases th:last-child{width:90px}
.distributor-purchases .btn{white-space:normal;padding:8px}
@media(max-width:1050px){
.distributor-purchases table,.distributor-purchases tbody{display:block}
.distributor-purchases thead{display:none}
.distributor-purchases tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:12px 0;border-bottom:1px solid #7775}
.distributor-purchases td{display:block;border:0!important}
.distributor-purchases td::before{content:attr(data-label);display:block;font-size:12px;opacity:.75;margin-bottom:4px}
.distributor-purchases td:first-child{grid-column:1/-1}
}
