.dashboard-page {
  --dash-blue: #2563eb;
  --dash-violet: #7c3aed;
  --dash-orange: #ea580c;
  --dash-cyan: #0891b2;
  --dash-red: #dc2626;
  --dash-amber: #ca8a04;
  --dash-surface: #ffffff;
  --dash-canvas: #f4f7fb;
  --dash-border: #dfe7f1;
  --dash-text: #10213d;
  --dash-muted: #64748b;
  margin: -26px -30px;
  padding: 26px 30px 36px;
  color: var(--dash-text);
  background:
    radial-gradient(circle at 96% 0%, rgba(37, 99, 235, .08), transparent 25rem),
    var(--dash-canvas);
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.dashboard-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--dash-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.dashboard-heading h1 {
  margin: 0;
  color: #0f1f38;
  font-size: clamp(24px, 1.9vw, 28px);
  line-height: 1.2;
  letter-spacing: -.04em;
}

.dashboard-heading p,
.dashboard-panel header p {
  margin: 6px 0 0;
  color: var(--dash-muted);
}

.dashboard-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.dashboard-date-picker { position: relative; }
.dashboard-date-trigger { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid #bcd0ef; border-radius: 9px; color: #20314b; background: #fff; box-shadow: 0 3px 10px rgba(37,99,235,.06); font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.dashboard-date-trigger i:first-child { color: var(--dash-blue); }
.dashboard-date-trigger i:last-child { margin-left: 3px; color: #75859a; font-size: 8px; transition: transform .16s ease; }
.dashboard-date-trigger[aria-expanded="true"] i:last-child { transform: rotate(180deg); }
.dashboard-date-popover { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(620px,calc(100vw - 40px)); display: grid; grid-template-columns: 150px minmax(0,1fr); overflow: hidden; border: 1px solid #d8e2ef; border-radius: 13px; background: #fff; box-shadow: 0 20px 50px rgba(15,42,83,.2); }
.dashboard-date-presets { display: grid; align-content: start; gap: 3px; padding: 12px; border-right: 1px solid #e4eaf2; background: #f8faff; }
.dashboard-date-presets button { min-height: 34px; padding: 7px 10px; border: 0; border-radius: 7px; color: #53647a; background: transparent; font-size: 10.5px; font-weight: 650; text-align: left; }
.dashboard-date-presets button:hover,.dashboard-date-presets button.active { color: #1f64d6; background: #eaf2ff; }
.dashboard-date-popover form { display: grid; grid-template-columns:1fr auto 1fr; align-items: end; gap: 10px; padding: 18px; }
.dashboard-date-popover label { color: #68788e; font-size: 9.5px; font-weight: 700; }
.dashboard-date-popover input { width: 100%; min-height: 39px; margin-top: 5px; padding: 7px 9px; border: 1px solid #d5dfeb; border-radius: 8px; font-size: 10.5px; }
.dashboard-date-popover form>span { padding-bottom: 11px; color: #8a98aa; }
.dashboard-date-popover form>div { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 7px; padding-top: 8px; border-top: 1px solid #e7ecf3; }

.dashboard-heading-actions .primary {
  background: var(--dash-blue);
  border-color: var(--dash-blue);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .2);
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-kpi {
  position: relative;
  min-width: 0;
  min-height: 120px;
  overflow: hidden;
  padding: 9px 14px;
  text-align: left;
  color: var(--dash-text);
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(30, 64, 175, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dashboard-kpi::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: currentColor;
  opacity: .06;
}

.dashboard-kpi:hover,
.dashboard-kpi:focus-visible {
  z-index: 1;
  transform: translateY(-3px);
  border-color: currentColor;
  box-shadow: 0 14px 30px rgba(30, 64, 175, .12);
}

.dashboard-kpi--blue { color: var(--dash-blue); }
.dashboard-kpi--violet { color: var(--dash-violet); }
.dashboard-kpi--orange { color: var(--dash-orange); }
.dashboard-kpi--cyan { color: var(--dash-cyan); }
.dashboard-kpi--red { color: var(--dash-red); }
.dashboard-kpi--amber { color: var(--dash-amber); }

.dashboard-kpi-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-kpi-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: currentColor;
  box-shadow: inset 0 0 0 28px rgba(255,255,255,.88);
}

.dashboard-kpi-icon svg { width: 18px; height: 18px; }

.dashboard-kpi-label {
  color: #52627a;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

.dashboard-kpi-value {
  display: block;
  margin-top: 5px;
  color: #101b33;
  font-size: clamp(24px, 1.8vw, 29px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.045em;
}

.dashboard-kpi-footer {
  position: relative;
  z-index: 2;
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  padding-right: 68px;
}

.dashboard-kpi-meta {
  display: block;
  margin-top: 0;
  color: #697990;
  font-size: 10.5px;
  line-height: 1.45;
}

.dashboard-kpi-trend {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard-kpi-trend--up {
  color: #07803e;
  background: #e8f8ee;
}

.dashboard-kpi-trend--down {
  color: #dc2626;
  background: #fef0f0;
}

.dashboard-kpi-sparkline {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 112px;
  height: 32px;
  color: inherit;
  opacity: .55;
  pointer-events: none;
}

.dashboard-kpi-sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-grid--charts { grid-template-columns: minmax(0, 2.25fr) minmax(350px, .95fr); }
.dashboard-grid--operations { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.dashboard-panel {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 31, 56, .055);
}

.dashboard-panel > header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--dash-border);
}

.dashboard-panel h2 {
  margin: 0;
  color: var(--dash-text);
  font-size: 16px;
  letter-spacing: -.015em;
}

.dashboard-panel header p { font-size: 11px; }

.dashboard-panel > .funnel {
  padding: 14px 20px 18px;
}

.dashboard-panel > .funnel .funnel-row {
  grid-template-columns: minmax(110px, 130px) minmax(0, 1fr) 24px;
}

.dashboard-panel > .funnel .funnel-row > b {
  font-variant-numeric: tabular-nums;
}

.dashboard-panel-chip,
.dashboard-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.dashboard-count-badge {
  min-width: 30px;
  justify-content: center;
  color: #b45309;
  background: #fff7ed;
  border-color: #fed7aa;
}

.dashboard-chart-scroll {
  overflow-x: auto;
  min-height: 348px;
  display: flex;
  align-items: center;
  padding: 18px 20px 12px;
}

.dashboard-line-chart {
  width: 100%;
  min-width: 680px;
  display: block;
  color: var(--dash-blue);
}

.dashboard-chart-grid line { stroke: #e7edf5; stroke-dasharray: 4 5; }
.dashboard-chart-grid text,
.dashboard-chart-point text { fill: #7888a0; font-size: 10px; }
.dashboard-chart-area { fill: url(#dashboardRevenueArea); }
.dashboard-chart-line { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-chart-point circle { fill: #fff; stroke: currentColor; stroke-width: 3; }
.dashboard-chart-point:focus { outline: none; }
.dashboard-chart-point:focus circle { fill: #dbeafe; stroke-width: 5; }

.dashboard-donut-layout {
  min-height: 348px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 18px;
  padding: 20px 24px 24px;
}

.dashboard-donut { width: 100%; max-width: 242px; margin: auto; transform: rotate(-90deg); }
.dashboard-donut-track,
.dashboard-donut-segment { fill: none; stroke-width: 18; }
.dashboard-donut-track { stroke: #eef2f7; }
.dashboard-donut-segment { transition: opacity .18s ease; }
.dashboard-donut-segment--0 { stroke: var(--dash-blue); }
.dashboard-donut-segment--1 { stroke: var(--dash-orange); }
.dashboard-donut-segment--2 { stroke: var(--dash-violet); }
.dashboard-donut-segment--3 { stroke: var(--dash-cyan); }
.dashboard-donut-segment--4 { stroke: var(--dash-red); }
.dashboard-donut text { fill: var(--dash-text); font-size: 23px; font-weight: 800; transform: rotate(90deg); transform-origin: 72px 72px; }
.dashboard-donut .dashboard-donut-caption { fill: var(--dash-muted); font-size: 9px; font-weight: 600; }

.dashboard-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.dashboard-legend > div { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 8px; color: var(--dash-muted); font-size: 11px; }
.dashboard-legend b { color: var(--dash-text); font-variant-numeric: tabular-nums; }
.dashboard-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.dashboard-legend-dot--0 { background: var(--dash-blue); }
.dashboard-legend-dot--1 { background: var(--dash-orange); }
.dashboard-legend-dot--2 { background: var(--dash-violet); }
.dashboard-legend-dot--3 { background: var(--dash-cyan); }
.dashboard-legend-dot--4 { background: var(--dash-red); }

.dashboard-panel--tours { margin-bottom: 18px; }
.dashboard-tour-list { display: grid; }
.dashboard-tour-row {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(110px, .65fr) minmax(180px, 1fr) minmax(120px, .75fr) minmax(110px, auto);
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  transition: background .15s ease;
}
.dashboard-tour-row:last-child { border-bottom: 0; }
.dashboard-tour-row:hover,
.dashboard-tour-row:focus-visible { background: #f8faff; }
.dashboard-tour-main b { display: block; color: #1d4ed8; }
.dashboard-tour-main small,
.dashboard-tour-date small,
.dashboard-tour-owner small { display: block; color: var(--dash-muted); font-size: 10px; }
.dashboard-tour-main small { margin-top: 3px; overflow-wrap: anywhere; }
.dashboard-tour-date b,
.dashboard-tour-owner b { display: block; margin-top: 3px; color: var(--dash-text); font-size: 11px; }
.dashboard-tour-progress { display: flex; align-items: center; gap: 9px; }
.dashboard-tour-progress > span { height: 7px; flex: 1; overflow: hidden; background: #e7edf5; border-radius: 20px; }
.dashboard-tour-progress i { width: var(--progress); height: 100%; display: block; background: linear-gradient(90deg, #2563eb, #06b6d4); border-radius: inherit; }
.dashboard-tour-progress b { min-width: 34px; font-size: 10px; font-variant-numeric: tabular-nums; }
.dashboard-tour-risk { justify-self: end; padding: 6px 9px; border-radius: 20px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.dashboard-tour-risk.is-warning { color: #b45309; background: #fff7ed; }
.dashboard-tour-risk.is-ready { color: #047857; background: #ecfdf5; }

.dashboard-alert-list,
.dashboard-ranking,
.dashboard-activity-list { min-height: 260px; }
.dashboard-alert-list { display: grid; align-content: start; }
.dashboard-alert {
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: var(--dash-text);
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #edf1f6;
}
.dashboard-alert:hover,
.dashboard-alert:focus-visible { background: #f8faff; }
.dashboard-alert-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.dashboard-alert-icon svg { width: 17px; height: 17px; }
.dashboard-alert--red .dashboard-alert-icon { color: #dc2626; background: #fef2f2; }
.dashboard-alert--orange .dashboard-alert-icon { color: #ea580c; background: #fff7ed; }
.dashboard-alert--violet .dashboard-alert-icon { color: #7c3aed; background: #f5f3ff; }
.dashboard-alert b,
.dashboard-activity-list b { display: block; font-size: 10.5px; line-height: 1.45; }
.dashboard-alert small,
.dashboard-activity-list small { display: block; margin-top: 2px; color: var(--dash-muted); font-size: 9.5px; }

.dashboard-ranking { display: grid; align-content: start; gap: 18px; padding: 20px; }
.dashboard-ranking-row { display: grid; grid-template-columns: 28px minmax(90px,.7fr) minmax(100px,1fr); align-items: center; gap: 10px; }
.dashboard-rank { width: 27px; height: 27px; display: grid; place-items: center; color: #1d4ed8; background: #eff6ff; border-radius: 8px; font-size: 10px; font-weight: 800; }
.dashboard-ranking-name { color: var(--dash-text); font-size: 10.5px; font-weight: 700; }
.dashboard-ranking-name small { display: block; margin-top: 2px; color: var(--dash-muted); font-weight: 550; }
.dashboard-ranking-bar { height: 9px; overflow: hidden; background: #eef2f7; border-radius: 20px; }
.dashboard-ranking-bar i { width: var(--bar-size); height: 100%; display: block; background: linear-gradient(90deg, #7c3aed, #2563eb); border-radius: inherit; }

.dashboard-activity-list { position: relative; margin: 0; padding: 16px 18px; list-style: none; }
.dashboard-activity-list::before { content: ""; position: absolute; top: 29px; bottom: 29px; left: 34px; width: 1px; background: #dce4ef; }
.dashboard-activity-list li { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 11px; align-items: start; padding: 6px 0 11px; }
.dashboard-activity-icon { width: 34px; height: 34px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; border: 3px solid #fff; border-radius: 50%; z-index: 1; }
.dashboard-activity-icon svg { width: 15px; height: 15px; }
.dashboard-activity-icon--1 { color: #7c3aed; background: #f5f3ff; }
.dashboard-activity-icon--2 { color: #ea580c; background: #fff7ed; }
.dashboard-activity-icon--3 { color: #0891b2; background: #ecfeff; }

.dashboard-health {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  background: linear-gradient(105deg, #172554, #1e3a8a 60%, #155e75);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(23, 37, 84, .18);
}
.dashboard-health > div { min-width: 0; padding: 18px 20px; border-right: 1px solid rgba(255,255,255,.14); }
.dashboard-health > div:last-child { border-right: 0; }
.dashboard-health span,
.dashboard-health small { display: block; color: #bfdbfe; font-size: 9.5px; }
.dashboard-health b { display: block; margin: 6px 0 3px; color: #fff; font-size: 20px; font-variant-numeric: tabular-nums; }

.dashboard-empty { min-height: 180px; display: grid; place-items: center; padding: 24px; color: var(--dash-muted); text-align: center; }
.dashboard-empty--success { color: #047857; }

@media (max-width: 1380px) {
  .dashboard-grid--operations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid--operations > :last-child { grid-column: 1 / -1; }
  .dashboard-health { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .dashboard-page { margin: -22px; padding: 22px; }
  .dashboard-grid--charts { grid-template-columns: 1fr; }
  .dashboard-tour-row { grid-template-columns: minmax(200px,1.5fr) minmax(105px,.7fr) minmax(160px,1fr) minmax(105px,.7fr); }
  .dashboard-tour-risk { display: none; }
}

@media (max-width: 760px) {
  .dashboard-page { margin: -16px; padding: 18px 14px 28px; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-heading-actions { width: 100%; flex-wrap: wrap; }
  .dashboard-date-picker { width: 100%; }
  .dashboard-date-trigger { width: 100%; justify-content: center; }
  .dashboard-date-popover { position: fixed; top: 82px; right: 14px; left: 14px; width: auto; grid-template-columns: 1fr; }
  .dashboard-date-presets { grid-template-columns: 1fr 1fr; border-right: 0; border-bottom: 1px solid #e4eaf2; }
  .dashboard-heading-actions .btn { flex: 1; min-height: 44px; }
  .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dashboard-kpi { min-height: 130px; padding: 11px 13px; }
  .dashboard-grid--operations { grid-template-columns: 1fr; }
  .dashboard-grid--operations > :last-child { grid-column: auto; }
  .dashboard-tour-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px 14px; padding: 14px 16px; }
  .dashboard-tour-progress { grid-column: 1 / -1; }
  .dashboard-tour-owner { display: none; }
  .dashboard-health { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-health > div { border-bottom: 1px solid rgba(255,255,255,.14); }
}

@media (max-width: 430px) {
  .dashboard-date-popover form { grid-template-columns: 1fr; }
  .dashboard-date-popover form>span { display: none; }
  .dashboard-kpi-grid { grid-template-columns: 1fr; }
  .dashboard-kpi { min-height: 126px; }
  .dashboard-donut-layout { grid-template-columns: 1fr; }
  .dashboard-donut { max-width: 210px; }
  .dashboard-legend { grid-template-columns: 1fr; }
  .dashboard-panel > header { align-items: flex-start; }
  .dashboard-panel-chip { display: none; }
  .dashboard-health { grid-template-columns: 1fr; }
  .dashboard-health > div { border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-kpi,
  .dashboard-donut-segment { transition: none; }
  .dashboard-kpi:hover,
  .dashboard-kpi:focus-visible { transform: none; }
}
