:root {
  color-scheme: light;
  --dor-bg: #f2f3ef;
  --dor-surface: #ffffff;
  --dor-surface-soft: #f7f8f5;
  --dor-line: #d9ded6;
  --dor-line-strong: #bcc6bc;
  --dor-text: #17221b;
  --dor-muted: #667069;
  --dor-green-950: #0e3525;
  --dor-green-800: #165038;
  --dor-green-650: #2f7046;
  --dor-teal: #147a73;
  --dor-gold: #c69635;
  --dor-danger: #9d3d35;
  --dor-neutral-map: #d9ddd7;
  --dor-shadow: 0 8px 26px rgba(18, 45, 30, 0.07);
  --dor-radius: 10px;
}

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--dor-bg);
  color: var(--dor-text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
h1, h2, p { margin: 0; }

.dor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  padding: 17px clamp(18px, 3vw, 46px);
  border-bottom: 1px solid var(--dor-line);
  background: rgba(255, 255, 255, 0.97);
}

.dor-brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.dor-brand img { width: 104px; height: auto; flex: 0 0 auto; }
.dor-title-block { padding-left: 18px; border-left: 1px solid var(--dor-line); }
.dor-title-block h1 { color: var(--dor-green-950); font-size: clamp(25px, 2.7vw, 39px); line-height: 1.08; letter-spacing: -0.035em; }
.dor-title-block p { margin-top: 5px; color: var(--dor-muted); font-size: clamp(13px, 1.2vw, 16px); }

.dor-header-meta { display: grid; justify-items: end; gap: 6px; text-align: right; }
.dor-method { color: var(--dor-muted); font-size: 11px; }
.dor-header-meta a { color: var(--dor-green-800); font-size: 12px; font-weight: 750; text-decoration: none; }
.dor-status { color: var(--dor-teal); font-size: 11px; font-weight: 700; }
.dor-status.is-error { color: var(--dor-danger); }

.dor-dashboard { width: min(1780px, 100%); margin: 0 auto; padding: 16px clamp(14px, 2vw, 30px) 30px; }

.dor-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--dor-line);
  border-radius: var(--dor-radius);
  background: var(--dor-surface);
  box-shadow: var(--dor-shadow);
}

.dor-kpis article { position: relative; min-width: 0; padding: 16px 17px; }
.dor-kpis article + article::before { content: ""; position: absolute; inset: 14px auto 14px 0; width: 1px; background: var(--dor-line); }
.dor-kpis span, .dor-kpis small { display: block; color: var(--dor-muted); }
.dor-kpis span { margin-bottom: 5px; font-size: 11px; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.dor-kpis strong { display: block; overflow: hidden; color: var(--dor-green-950); font-size: clamp(19px, 1.65vw, 27px); line-height: 1.12; text-overflow: ellipsis; white-space: nowrap; }
.dor-kpis small { margin-top: 5px; font-size: 10px; }

.dor-territory { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(300px, .78fr); gap: 14px; align-items: stretch; }
.dor-map-panel, .dor-detail-panel, .dor-chart-panel, .dor-quality { border: 1px solid var(--dor-line); border-radius: var(--dor-radius); background: var(--dor-surface); box-shadow: var(--dor-shadow); }
.dor-map-panel { min-width: 0; padding: 14px; }

.dor-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; margin-bottom: 10px; }
.dor-section-head h2 { font-size: 15px; line-height: 1.2; letter-spacing: .01em; text-transform: uppercase; }
.dor-section-head p { margin-top: 3px; color: var(--dor-muted); font-size: 11px; }
.dor-section-head button { min-height: 34px; border: 1px solid var(--dor-line-strong); border-radius: 6px; background: #fff; color: var(--dor-green-800); padding: 0 12px; font-size: 11px; font-weight: 800; cursor: pointer; }
.dor-section-head button:hover, .dor-section-head button:focus-visible { border-color: var(--dor-green-650); outline: none; }

.dor-map-stage { position: relative; min-height: 590px; }
.dor-leaflet-map { height: 590px; min-height: 500px; border: 1px solid var(--dor-line-strong); border-radius: 7px; background: #e6ebe8; overflow: hidden; }
.dor-layer-control, .dor-map-legend { position: absolute; z-index: 650; border: 1px solid rgba(23, 34, 27, .18); border-radius: 6px; background: rgba(255, 255, 255, .96); box-shadow: 0 6px 18px rgba(18, 45, 30, .13); }
.dor-layer-control { top: 11px; right: 11px; display: grid; gap: 6px; min-width: 170px; padding: 9px 10px; }
.dor-layer-control strong { padding-bottom: 5px; border-bottom: 1px solid var(--dor-line); font-size: 12px; text-transform: uppercase; }
.dor-layer-control label { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.dor-layer-control input { margin: 0; accent-color: var(--dor-green-650); }
.dor-map-legend { bottom: 12px; left: 12px; display: grid; gap: 6px; width: 224px; max-width: calc(100% - 24px); padding: 10px; color: var(--dor-muted); font-size: 10px; }
.dor-map-legend strong { color: var(--dor-text); font-size: 11px; text-transform: uppercase; }
.dor-map-legend span { display: flex; align-items: center; gap: 7px; }
.dor-map-legend i { width: 18px; height: 11px; flex: 0 0 auto; border: 1px solid rgba(23, 34, 27, .18); border-radius: 2px; }

.dor-detail-panel { min-width: 0; overflow: hidden; }
.dor-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 15px; background: var(--dor-green-950); color: #fff; }
.dor-detail-head span { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.dor-detail-head strong { font-size: 12px; }
.dor-detail-body { display: grid; align-content: start; gap: 24px; min-height: 602px; padding: 22px 18px; }
.dor-detail-kicker { color: var(--dor-teal); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.dor-detail-body h2 { margin-top: 4px; color: var(--dor-green-950); font-size: clamp(24px, 2.1vw, 34px); line-height: 1.08; }
.dor-detail-code { margin-top: 8px; color: var(--dor-muted); font-size: 12px; }
.dor-detail-metrics { display: grid; gap: 0; margin: 0; }
.dor-detail-metrics div { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--dor-line); }
.dor-detail-metrics dt { color: var(--dor-muted); font-size: 11px; }
.dor-detail-metrics dd { margin: 0; color: var(--dor-green-950); font-size: 14px; font-weight: 800; text-align: right; }
.dor-detail-note { align-self: end; padding: 12px; border-left: 3px solid var(--dor-gold); background: #faf6ea; color: #61563e; font-size: 11px; }

.dor-map-tooltip strong { display: block; margin-bottom: 3px; color: var(--dor-green-950); }
.dor-leaflet-map .leaflet-tooltip { border-color: var(--dor-line-strong); border-radius: 6px; box-shadow: 0 6px 18px rgba(18, 45, 30, .15); color: var(--dor-text); line-height: 1.45; }
.dor-seat-symbol, .dor-seat-legend { position: relative; display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border: 1px solid #101b14; border-radius: 50%; background: #fff; }
.dor-seat-symbol::after, .dor-seat-legend::after { content: ""; position: absolute; top: 50%; left: 50%; width: 3px; height: 3px; border-radius: 50%; background: #101b14; transform: translate(-50%, -50%); }
.dor-seat-icon { z-index: 700 !important; border: 0; background: transparent; }

.dor-charts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.dor-chart-panel { min-width: 0; grid-column: span 2; padding: 14px; }
.dor-chart-wide { grid-column: span 2; }
.dor-chart { width: 100%; height: 300px; min-height: 260px; }

.dor-quality { margin-top: 14px; overflow: hidden; }
.dor-quality summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; cursor: pointer; list-style: none; }
.dor-quality summary::-webkit-details-marker { display: none; }
.dor-quality summary span:first-child { display: flex; align-items: baseline; gap: 10px; }
.dor-quality summary strong { color: var(--dor-green-950); font-size: 13px; text-transform: uppercase; }
.dor-quality summary small, #dor-quality-summary { color: var(--dor-muted); font-size: 10px; }
.dor-quality-grid { display: grid; grid-template-columns: .75fr .75fr 2fr; border-top: 1px solid var(--dor-line); }
.dor-quality-grid article { min-width: 0; padding: 16px 18px; }
.dor-quality-grid article + article { border-left: 1px solid var(--dor-line); }
.dor-quality-grid span, .dor-quality-grid small { display: block; color: var(--dor-muted); }
.dor-quality-grid span { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.dor-quality-grid strong { display: block; margin: 5px 0 3px; color: var(--dor-green-950); font-size: 22px; }
.dor-quality-grid small, .dor-quality-method p { font-size: 11px; }
.dor-quality-method p { margin-top: 7px; color: var(--dor-muted); }

@media (max-width: 1220px) {
  .dor-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dor-kpis article:nth-child(4)::before { display: none; }
  .dor-territory { grid-template-columns: minmax(0, 2fr) minmax(280px, .85fr); }
  .dor-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dor-chart-panel,
  .dor-chart-wide { grid-column: span 1; }
}

@media (max-width: 860px) {
  .dor-header { align-items: flex-start; flex-direction: column; }
  .dor-header-meta { justify-items: start; text-align: left; }
  .dor-territory { grid-template-columns: 1fr; }
  .dor-detail-body { min-height: auto; }
  .dor-quality-grid { grid-template-columns: 1fr; }
  .dor-quality-grid article + article { border-top: 1px solid var(--dor-line); border-left: 0; }
}

@media (max-width: 620px) {
  .dor-header { min-height: auto; padding-block: 14px; }
  .dor-brand { align-items: flex-start; gap: 11px; }
  .dor-brand img { width: 78px; }
  .dor-title-block { padding-left: 11px; }
  .dor-title-block h1 { font-size: 25px; }
  .dor-method { max-width: 280px; }
  .dor-dashboard { padding-top: 10px; }
  .dor-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dor-kpis article:nth-child(odd)::before { display: none; }
  .dor-kpis article:nth-child(4)::before { display: block; }
  .dor-kpis strong { font-size: 19px; }
  .dor-map-panel { padding: 10px; }
  .dor-map-stage { min-height: 510px; }
  .dor-leaflet-map { height: 510px; min-height: 440px; }
  .dor-layer-control { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; min-width: 0; margin-bottom: 8px; }
  .dor-layer-control strong { grid-column: 1 / -1; }
  .dor-layer-control label { align-items: flex-start; font-size: 10px; }
  .dor-map-legend { bottom: 9px; left: 9px; width: 205px; }
  .dor-charts { grid-template-columns: 1fr; }
  .dor-chart { height: 290px; }
  .dor-quality summary span:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
