.dt-dashboard {
  --dt-bg: #f3f6f4;
  --dt-surface: #ffffff;
  --dt-ink: #17231d;
  --dt-muted: #53635b;
  --dt-line: #d8e0db;
  --dt-primary: #176b4d;
  --dt-primary-dark: #0e4d36;
  --dt-accent: #d7a72b;
  --dt-danger: #a93d34;
  box-sizing: border-box;
  min-height: 100%;
  padding: 24px;
  overflow-x: hidden;
  background: var(--dt-bg);
  color: var(--dt-ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

.dt-dashboard *, .dt-dashboard *::before, .dt-dashboard *::after { box-sizing: border-box; }
.dt-dashboard h2, .dt-dashboard h3, .dt-dashboard p { margin-top: 0; }
.dt-dashboard h2 { margin-bottom: 0; font-size: 1.35rem; }
.dt-dashboard h3 { margin-bottom: 14px; font-size: 1rem; }
.dt-muted, .dt-updated { color: var(--dt-muted); }
.dt-eyebrow { margin-bottom: 4px; color: var(--dt-primary-dark); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.dt-section-title, .dt-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dt-section-title { justify-content: space-between; margin-bottom: 14px; }

.dt-button {
  min-height: 42px;
  padding: 9px 16px;
  border: 2px solid var(--dt-primary);
  border-radius: 9px;
  background: var(--dt-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.dt-button--secondary { background: #fff; color: var(--dt-primary-dark); }
.dt-button:hover { background: var(--dt-primary-dark); }
.dt-button--secondary:hover { color: #fff; }
.dt-button:disabled { border-color: #9aa79f; background: #e0e5e2; color: #59655e; cursor: not-allowed; }
.dt-button:focus-visible, .dt-dashboard select:focus-visible, .dt-dashboard input:focus-visible, .dt-alert__action:focus-visible, .dt-detail:focus-visible { outline: 3px solid #0b5fff; outline-offset: 3px; }

.dt-status { margin-bottom: 16px; padding: 11px 14px; border-left: 5px solid var(--dt-primary); border-radius: 6px; background: #e8f2ed; }
.dt-status[data-state="error"] { border-color: var(--dt-danger); background: #fbecea; }
.dt-status[data-state="partial"], .dt-status[data-state="stale"] { border-color: var(--dt-accent); background: #fff5d9; }
.dt-status[data-state="ready"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.dt-filters { margin-bottom: 20px; padding: 14px; border: 1px solid var(--dt-line); border-radius: 12px; background: var(--dt-surface); flex-wrap: wrap; align-items: end; }
.dt-filters label { display: grid; gap: 5px; min-width: 150px; color: var(--dt-muted); font-size: .78rem; font-weight: 700; }
.dt-filter-period { flex: 1 1 210px; }
.dt-filter-date { flex: 0 1 155px; }
.dt-filter-scope { flex: 0 1 260px; }
.dt-filters select, .dt-filters input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #84938a; border-radius: 8px; background: #fff; color: var(--dt-ink); font: inherit; }
.dt-filter-footer { display: flex; flex: 1 0 100%; align-items: center; justify-content: space-between; gap: 12px; padding-top: 2px; }
.dt-filter-help { margin: 0; color: var(--dt-muted); font-size: .82rem; }
.dt-updated { flex: 0 0 auto; font-size: .8rem; }

.dt-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); gap: 20px; align-items: start; }
.dt-panorama, .dt-myday { min-width: 0; }
.dt-myday-help { margin: -5px 0 12px; color: var(--dt-muted); font-size: .8rem; }
.dt-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.dt-card, .dt-panel, .dt-alert-group { border: 1px solid var(--dt-line); border-radius: 14px; background: var(--dt-surface); box-shadow: 0 5px 18px rgba(23,35,29,.055); }
.dt-card { min-width: 0; padding: 16px; }
.dt-card__label { margin-bottom: 7px; color: var(--dt-muted); font-size: .78rem; font-weight: 700; }
.dt-card__value { display: block; overflow-wrap: anywhere; font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.dt-card__note { margin: 5px 0 0; color: var(--dt-muted); font-size: .76rem; }
.dt-pill { padding: 4px 9px; border-radius: 999px; background: #e8f2ed; color: var(--dt-primary-dark); font-size: .72rem; font-weight: 700; }

.dt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dt-panel { min-width: 0; padding: 16px; }
.dt-panel__title, .dt-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dt-panel__title h3, .dt-modal__header h2 { margin-bottom: 0; }
.dt-panel__title { margin-bottom: 14px; }
.dt-detail { min-height: 36px; padding: 5px 10px; border: 1px solid var(--dt-primary); border-radius: 7px; background: #fff; color: var(--dt-primary-dark); font-weight: 700; cursor: pointer; }
.dt-detail:hover { background: var(--dt-primary-dark); color: #fff; }
.dt-panel--wide { grid-column: 1 / -1; }
.dt-chart { position: relative; min-height: 230px; }
.dt-chart--tall { min-height: 310px; }
.dt-table-alt { margin-top: 12px; overflow-x: auto; }
.dt-table-alt details summary { color: var(--dt-primary-dark); font-weight: 700; cursor: pointer; }
.dt-table-alt table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .82rem; }
.dt-table-alt th, .dt-table-alt td { padding: 7px; border-bottom: 1px solid var(--dt-line); text-align: left; }
.dt-table-alt td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.dt-alerts { display: grid; gap: 12px; }
.dt-alert-group { overflow: hidden; }
.dt-alert-group h3 { margin: 0; padding: 13px 15px; border-bottom: 1px solid var(--dt-line); background: #f8faf8; }
.dt-alert-list { margin: 0; padding: 0; list-style: none; }
.dt-alert { padding: 13px 15px; border-bottom: 1px solid var(--dt-line); }
.dt-alert:last-child { border-bottom: 0; }
.dt-alert__title { margin-bottom: 4px; font-weight: 700; }
.dt-alert__meta { margin-bottom: 9px; color: var(--dt-muted); font-size: .8rem; }
.dt-alert__action { padding: 0; border: 0; background: transparent; color: var(--dt-primary-dark); font-weight: 700; text-decoration: underline; cursor: pointer; }
.dt-empty { padding: 14px 15px; color: var(--dt-muted); }

.dt-modal { position: fixed; z-index: 10000; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(13, 26, 19, .58); }
.dt-modal[hidden] { display: none; }
.dt-modal__panel { width: min(920px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 20px; border-radius: 14px; background: var(--dt-surface); box-shadow: 0 18px 48px rgba(0,0,0,.28); }
.dt-chart--modal { min-height: 430px; }

@media (max-width: 1120px) {
  .dt-layout { grid-template-columns: 1fr; }
  .dt-alerts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .dt-dashboard { padding: 16px; }
  .dt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-grid { grid-template-columns: 1fr; }
  .dt-panel--wide { grid-column: auto; }
  .dt-alerts { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .dt-dashboard { padding: 12px; }
  .dt-cards { grid-template-columns: 1fr; }
  .dt-filters label { flex-basis: 100%; min-width: 0; }
  .dt-filter-footer { align-items: flex-start; flex-direction: column; }
  .dt-button { width: 100%; }
  .dt-modal { padding: 8px; }
  .dt-modal__panel { max-height: calc(100vh - 16px); padding: 14px; }
  .dt-chart--modal { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  .dt-dashboard *, .dt-dashboard *::before, .dt-dashboard *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
