* { box-sizing: border-box; }
body { margin: 0; background: #EEF0F4; color: #0D1257; font-family: 'Poppins', system-ui, sans-serif; }
.demo-banner { padding: 12px 24px; color: #805414; background: #FFF4D8; border-bottom: 1px solid #EFD9A5; text-align: center; font-size: 12px; line-height: 1.6; }
[hidden] { display: none !important; }
header { background: white; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #E5E7EB; }
header img { width: 180px; }
nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
button, input, select, .actions a { font: inherit; font-size: 13px; border-radius: 6px; }
button, .actions a { padding: 10px 16px; background: white; border: 1px solid #D1D5DB; color: #0D1257; cursor: pointer; text-decoration: none; }
button:hover, button[aria-pressed="true"] { border-color: #2B62F0; background: #EFF6FF; }
button:disabled { opacity: .5; cursor: wait; }
a { color: #2459D9; }
:focus-visible { outline: 3px solid #93B4FF; outline-offset: 3px; }
.intro, .actions, .panel, #message { max-width: 1320px; margin: 24px auto; }
.intro { margin-top: 44px; }
.intro p { color: #6B7280; font-size: 13px; }
h1 { font-size: clamp(26px, 4vw, 36px); margin: 8px 0; letter-spacing: -.035em; }
h2 { margin: 0 0 20px; font-size: 19px; }
.actions .primary { background: #2B62F0; color: white; border-color: #2B62F0; }
.panel { padding: 26px; background: white; border: 1px solid #E5E7EB; border-radius: 10px; }
#filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: #4B5563; }
input, select { border: 1px solid #D1D5DB; padding: 10px; min-height: 40px; background: white; color: #0D1257; }
.muted { color: #6B7280; font-size: 12px; line-height: 1.6; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: left; }
th { padding: 14px 10px; color: #6B7280; font-size: 11px; background: #F7F8FA; font-weight: 600; }
td { padding: 18px 10px; border-bottom: 1px solid #EEF0F4; line-height: 1.7; }
td:last-child { min-width: 200px; }
.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { border-radius: 20px; padding: 4px 8px; font-size: 11px; white-space: nowrap; background: #F3F4F6; }
.DRAFT { color: #92400E; background: #FFFBEB; }.SENT { color: #1D4ED8; background: #EFF6FF; }.SIGNED { color: #047857; background: #ECFDF5; }
.warning { color: #92400E; font-size: 11px; }.danger { color: #B91C1C; border-color: #FECACA; }
.empty { padding: 40px 0; color: #6B7280; text-align: center; }
#message { color: #92400E; min-height: 20px; }
#stats { margin: 24px 0; padding-bottom: 16px; border-bottom: 1px solid #E5E7EB; }
@media(max-width: 1380px) { .intro, .actions, .panel, #message { margin-left: 24px; margin-right: 24px; } }
@media(max-width: 600px) { header { padding: 16px; gap: 16px; flex-wrap: wrap; } .intro, .actions, .panel, #message { margin-left: 12px; margin-right: 12px; } .panel { padding: 16px; } .actions { align-items: stretch; flex-direction: column; } }

/* Commercial dashboard: the existing TopStation palette, with distinct chart colours. */
.monitoring-panel { background: #F7F9FC; padding: 26px; }
.monitoring-panel #filters { padding-bottom: 4px; }
.monitoring-panel #stats { border: 0; margin-top: 28px; }
.dashboard { --dash-text: #15234A; --dash-muted: #67758C; color: var(--dash-text); }
.dash-heading { display: flex; gap: 24px; align-items: center; justify-content: space-between; padding: 10px 0 25px; }
.dash-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #3976DA; }
.dash-heading h3 { font-size: clamp(23px, 3vw, 32px); letter-spacing: -.045em; margin: 10px 0; font-weight: 650; }
.dash-heading p { font-size: 12px; color: var(--dash-muted); margin: 0; max-width: 540px; line-height: 1.7; }
.dash-live { flex: none; color: var(--dash-muted); font-size: 11px; }
.live-dot { width: 6px; height: 6px; display: inline-block; margin-right: 7px; border-radius: 50%; background: #179B79; }
.dash-live label { display: flex; flex-direction: row; align-items: center; gap: 7px; font-size: 10px; margin-top: 10px; }
.dash-live input { min-height: auto; margin: 0; accent-color: #3777ED; }
.dash-toolbar, .dash-period { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.dash-toolbar { padding: 16px 0; border-top: 1px solid #E4EAF2; }
.dash-toolbar button, .dash-card-title button, .pipeline-lost button, .dash-list-heading button { font-size: 11px; padding: 8px 11px; }
.range-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.range-buttons button { background: transparent; border-color: #E0E6EF; }
.dash-period { margin: 0 0 20px; font-size: 11px; color: var(--dash-muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { position: relative; border: 1px solid #E1E7F0; border-radius: 10px; padding: 20px; background: white; min-width: 0; }
.kpi-title { font-size: 11px; color: var(--dash-muted); margin: 0 0 15px; font-weight: 550; }
.kpi > strong { display: block; font-size: clamp(25px, 2.7vw, 34px); letter-spacing: -.045em; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-caption { font-size: 10px; color: var(--dash-muted); line-height: 1.6; margin: 8px 0 14px; min-height: 16px; }
.kpi-change { display: block; font-size: 10px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.kpi-change span { color: var(--dash-muted); }.kpi-change.up { color: #147E65; }.kpi-change.down { color: #BA614C; }.kpi-change.neutral { color: var(--dash-muted); }
.kpi-featured { background: #14254F; border-color: #14254F; color: white; }
.kpi-featured .kpi-title, .kpi-featured .kpi-caption, .kpi-featured .kpi-change, .kpi-featured .kpi-change span { color: #CBD8ED; }
.kpi-featured .kpi-change.up { color: #9AE2CE; }.kpi-featured .kpi-change.down { color: #FFBAA7; }
.kpi-warning { border-top: 3px solid #D8A345; padding-top: 18px; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.span-4 { grid-column: span 4; }.span-5 { grid-column: span 5; }.span-7 { grid-column: span 7; }.span-8 { grid-column: span 8; }.span-12 { grid-column: span 12; }
.dash-card { min-width: 0; background: white; border: 1px solid #E1E7F0; border-radius: 10px; padding: 22px; }
.dash-card-title { display: flex; gap: 14px; align-items: start; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; }
.dash-card h4, .dash-list-heading h4 { font-size: 14px; margin: 0 0 7px; font-weight: 650; letter-spacing: -.015em; }
.dash-card-title p, .dash-list-heading p { color: var(--dash-muted); font-size: 10px; line-height: 1.65; margin: 0; }
.metric-toggle { display: flex; flex: none; background: #F2F5FA; border-radius: 6px; padding: 3px; }
.metric-toggle button { padding: 6px 8px; font-size: 10px; border: 0; background: transparent; color: #63738C; }
.metric-toggle button[aria-pressed="true"] { background: white; color: #225FC6; box-shadow: 0 1px 4px #12214414; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 13px; font-size: 9px; color: var(--dash-muted); margin-bottom: 18px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }.chart-legend i { width: 7px; height: 7px; border-radius: 2px; }
.trend-chart { display: block; width: 100%; height: auto; min-height: 170px; font-family: inherit; }
.chart-data { margin-top: 10px; font-size: 10px; color: var(--dash-muted); }.chart-data summary, .dash-method summary { cursor: pointer; padding: 6px 0; }
.chart-data th, .chart-data td { font-size: 10px; padding: 10px 7px; }
.status-donut-wrap { display: grid; justify-items: center; gap: 22px; }
.status-donut { background: var(--ring); width: 170px; height: 170px; padding: 22px; border-radius: 50%; }
.status-donut > div { background: white; width: 100%; height: 100%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.status-donut strong { font-size: 19px; letter-spacing: -.04em; }.status-donut span { font-size: 10px; color: var(--dash-muted); margin-top: 7px; }
.donut-legend { width: 100%; }.legend-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border: none; width: 100%; text-align: left; font-size: 10px; background: transparent; color: var(--dash-muted); }
.legend-row:hover { background: #F7F9FC; }.legend-row strong { color: var(--dash-text); font-weight: 650; }
.legend-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; flex: none; margin-right: 5px; }
.dash-note { font-size: 10px; color: var(--dash-muted); line-height: 1.7; margin: 18px 0 0; }
.pipeline { display: grid; grid-template-columns: 1fr 26px 1fr 26px 1fr; align-items: center; gap: 10px; }
.pipeline-stage { display: flex; flex-direction: column; align-items: start; gap: 8px; padding: 18px; border: 1px solid #E4EAF2; background: #FAFBFD; font-size: 11px; text-align: left; }
.pipeline-stage:hover { background: #F3F7FF; }.pipeline-stage strong { font-size: 29px; letter-spacing: -.04em; }.pipeline-stage b { font-size: 12px; font-weight: 550; }
.stage-number { display: inline-grid; place-items: center; height: 20px; width: 20px; border-radius: 5px; background: #E7EDF6; font-size: 10px; color: #52627D; }
.stage-SIGNED { background: #F1FAF7; border-color: #D6EDE5; }.stage-SIGNED .stage-number { background: #D6EEE6; color: #147E65; }.stage-SIGNED strong { color: #147E65; }
.stage-SENT .stage-number { background: #DFEBFF; color: #2966CA; }.stage-SENT strong { color: #2966CA; }
.pipeline-arrow { color: #9DAAC0; text-align: center; font-size: 22px; }
.pipeline-lost { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 11px; margin-top: 14px; border: 1px dashed #E6D7D2; padding: 10px 14px; border-radius: 6px; color: #80675F; }.pipeline-lost button { margin-left: auto; border: 0; background: transparent; color: #9F5C49; }
.alert-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.alert-tile { display: flex; align-items: start; flex-direction: column; gap: 10px; padding: 16px; font-size: 11px; background: white; border-color: #E3E8F0; text-align: left; }
.alert-tile strong { font-size: 28px; font-weight: 600; letter-spacing: -.04em; }.alert-tile small { color: var(--dash-muted); font-size: 10px; line-height: 1.6; }.alert-action { font-size: 10px; margin-top: 5px; }
.alert-tile.amber strong, .alert-tile.amber .alert-action { color: #9E7022; }.alert-tile.red strong, .alert-tile.red .alert-action { color: #BA614C; }.alert-tile.blue strong, .alert-tile.blue .alert-action { color: #2966CA; }
.alert-tile[aria-pressed="true"] { background: #F3F7FF; border-color: #3777ED; }
.age-row { margin-bottom: 19px; }.age-row > div:first-child { display: flex; gap: 10px; justify-content: space-between; font-size: 10px; color: var(--dash-muted); margin-bottom: 9px; }.age-row b { font-size: 10px; font-weight: 550; color: var(--dash-text); }
.age-track, .rank-track { height: 6px; border-radius: 4px; background: #F0F3F8; overflow: hidden; }.age-track i, .rank-track i { display: block; height: 100%; border-radius: inherit; }
.client-ranking th, .client-ranking td { font-size: 10px; padding: 14px 7px; }.client-ranking td:last-child { min-width: 0; white-space: nowrap; }.client-ranking td:first-child { min-width: 180px; }.client-ranking button { border: 0; padding: 0; display: flex; gap: 9px; text-align: left; align-items: center; font-size: 10px; line-height: 1.6; background: transparent; }
.rank-number { display: inline-grid; flex: none; place-items: center; width: 23px; height: 23px; border-radius: 5px; background: #F0F4FA; color: #7C8AA1; font-size: 10px; }
.brand-strip { display: flex; width: 100%; height: 17px; border-radius: 5px; overflow: hidden; margin-bottom: 25px; }.brand-strip span { height: 100%; }
.brand-row { display: flex; gap: 8px; align-items: center; padding: 13px 0; border-bottom: 1px solid #F0F3F8; font-size: 11px; }.brand-row > span:nth-child(2) { flex: 1; }.brand-row small { display: block; font-size: 10px; color: var(--dash-muted); margin-top: 7px; }.brand-row b { font-weight: 600; white-space: nowrap; }
.rank-item { margin-bottom: 19px; }.rank-item > div:first-child { display: flex; gap: 12px; justify-content: space-between; font-size: 10px; margin-bottom: 8px; line-height: 1.6; }.rank-item strong { white-space: nowrap; font-weight: 600; }.rank-item small { display: block; color: var(--dash-muted); font-size: 9px; margin-top: 5px; }
.dash-grid > .span-12 table th, .dash-grid > .span-12 table td { font-size: 11px; }.dash-grid > .span-12 table td:last-child { min-width: 0; }
.dash-method { color: var(--dash-muted); font-size: 11px; margin: 22px 0; line-height: 1.8; }.dash-method p { max-width: 950px; }
.dash-list-heading { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 23px; border-top: 1px solid #E1E7F0; }
.dash-empty { color: var(--dash-muted); font-size: 12px; padding: 36px 15px; text-align: center; line-height: 1.8; }
.scope-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: #EEF4FF; color: #2966CA; border-radius: 6px; padding: 12px; font-size: 12px; }.scope-notice button { background: transparent; border: 0; font-size: 11px; color: #2966CA; padding: 0; text-decoration: underline; }
#orders { scroll-margin-top: 20px; }.monitoring-panel #orders > .table-scroll { border: 1px solid #E1E7F0; border-radius: 8px; background: white; }.selected { border-color: #3777ED; background: #EEF4FF; }
@media(min-width: 1500px) { .kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }.kpi > strong { font-size: 26px; }.intro, .actions, .panel, #message { max-width: 1440px; } }
@media(max-width: 1000px) { .span-8, .span-7, .span-5 { grid-column: span 12; }.span-4 { grid-column: span 12; }.status-donut-wrap { grid-template-columns: 170px 1fr; align-items: center; }.dash-heading { align-items: start; }.alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width: 650px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.kpi { padding: 15px; }.kpi-warning { padding-top: 13px; }.kpi > strong { font-size: 25px; }.dash-heading { flex-direction: column; gap: 15px; }.dash-live { font-size: 10px; }.monitoring-panel { padding: 14px; }.dash-card { padding: 17px; }.dash-card-title { margin-bottom: 18px; }.pipeline { gap: 5px; grid-template-columns: 1fr 14px 1fr 14px 1fr; }.pipeline-stage { padding: 10px; font-size: 9px; }.pipeline-stage strong { font-size: 25px; }.pipeline-stage b { font-size: 9px; }.pipeline-arrow { font-size: 16px; }.dash-period { font-size: 10px; }.trend-chart { min-height: 140px; }.status-donut-wrap { grid-template-columns: 130px 1fr; gap: 14px; }.status-donut { width: 130px; height: 130px; padding: 17px; }.status-donut strong { font-size: 15px; }.legend-row { font-size: 9px; }.dash-heading h3 { font-size: 27px; } }
@media(max-width: 380px) { .kpi-grid, .alert-grid { grid-template-columns: 1fr; }.status-donut-wrap { grid-template-columns: 1fr; } }
@media(prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.department-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr); gap: 24px; align-items: start; margin: 20px 0; }
.department-layout figure { background: #f7f9fc; border-radius: 10px; padding: 14px; margin: 0; text-align: center; }
.department-layout svg { width: 100%; max-height: 420px; }
.department-layout svg path { cursor: pointer; stroke: white; stroke-width: 1.2; stroke-linejoin: round; }
.department-layout svg path:hover, .department-layout svg path.selected { fill: #183980; }
.department-layout figcaption { font-size: 11px; color: #525c70; }
.department-layout h3 { margin: 0 0 10px; font-size: 16px; }
.department-list { display: grid; gap: 5px; max-height: 420px; overflow: auto; padding: 4px; }
.department-list button { display: flex; justify-content: space-between; gap: 12px; text-align: left; }
@media(max-width: 680px) { .department-layout { grid-template-columns: 1fr; } .department-list { max-height: 210px; } }

.cabinet-map { margin: 20px 0; }
.cabinet-map-heading, .cabinet-pins { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cabinet-map-heading { justify-content: space-between; margin-bottom: 12px; }
.cabinet-map-heading h3 { margin: 0; }
.cabinet-map-body figure > svg { display: block; width: 100%; height: clamp(280px, 51vh, 550px); background: #f7f9fc; border-radius: 10px; }
.department-outline { fill: #e2eafb; stroke: #8ca3cf; stroke-width: 1.4; }
.cabinet-map [data-pin] { cursor: pointer; }
.cabinet-map circle { fill: #2459d9; stroke: white; stroke-width: 1.5; }
.cabinet-map g:is(:hover,:focus,[aria-pressed="true"]) circle { fill: #0d1257; }
.cabinet-map svg text { fill: white; font: bold 10px system-ui; }
.cabinet-pins, .cabinet-map details { margin-bottom: 12px; }
.cabinet-map small { color: #525c70; }

.cabinet-atlas { display:grid; grid-template-columns:minmax(0, 1.65fr) minmax(255px, 1fr); overflow:hidden; border:1px solid #d6e0e8; border-radius:12px; margin-bottom:12px; }
.cabinet-atlas figure { margin:0; background:#f0f5f5; display:grid; align-content:center; }
.cabinet-atlas figure > svg { height:clamp(245px, 37vh, 390px); background:transparent; }
.cabinet-atlas figcaption { color:#435968; font-size:11px; padding:8px 16px 14px; }
.cabinet-atlas .department-outline { fill:#fafcf9; stroke:#839a9e; }
.cabinet-atlas .settlements circle { fill:#bac8c6; stroke:none; }
.cabinet-atlas aside { min-width:0; padding:16px; max-height:430px; overflow:auto; background:white; }
.cabinet-atlas h4 { display:flex; align-items:center; justify-content:space-between; margin:0 0 12px; }
.cabinet-atlas h4 span { font-variant-numeric:tabular-nums; color:#51677d; }
.cabinet-location { border-top:1px solid #e1e6ed; padding:6px 0; }
.cabinet-location button { width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px; text-align:left; }
.cabinet-location button strong { white-space:nowrap; }
.cabinet-details { list-style:none; margin:0; padding:0 8px; }
.cabinet-details > li { padding:10px 0; font-size:13px; overflow-wrap:anywhere; }
.cabinet-orders { list-style:none; display:grid; gap:4px; padding:6px 0 0; }
.cabinet-orders a { display:inline-block; padding:3px 0; }
@media(max-width:750px) { .cabinet-atlas { grid-template-columns:1fr; } .cabinet-atlas aside { max-height:350px; } }

.department-road-map { width:100%; height:clamp(300px, 42vh, 470px); min-width:0; isolation:isolate; }
.cabinet-atlas figure.with-roads { display:block; min-width:0; }
.with-roads > svg, .with-roads .road-note { display:none !important; }
.with-roads.road-unavailable > svg { display:block !important; }
.with-roads.road-unavailable .road-note { display:inline !important; }
.road-unavailable .department-road-map { display:none; }
.road-pin { display:grid; place-items:center; background:#2459d9; color:white; border:2px solid white; border-radius:50%; font:bold 13px system-ui; box-shadow:0 1px 5px #263a5f80; }
.road-pin.current { background:#0d2363; }
