#app-view {
  --control-ink: #172436;
  --control-muted: #526174;
  --control-border: #dce4ee;
  --control-surface: #fff;
  --control-page: #f3f6fa;
}

#app-view .workspace { background: var(--control-page); color: var(--control-ink); }
#app-view .topbar { border-color: #e0e6ee; }
#app-view .topbar h1 { color: #172436; }
#app-view .topbar-account-role,
#app-view .topbar-account-info strong { color: #26364a; }

#overview-dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "hero hero hero hero hero hero hero hero hero hero hero hero"
    "control control control control control control control control control control control control"
    "stats stats stats stats stats stats stats stats stats stats stats stats"
    "catalog catalog catalog catalog catalog catalog catalog catalog catalog catalog catalog catalog"
    "performance performance performance performance performance performance performance performance performance performance performance performance"
    "network network network network network network network network network network network network"
    "storage storage storage storage storage storage storage storage storage storage storage storage"
    "health health health health health health health health health health health health"
    "sessions sessions sessions sessions sessions sessions sessions sessions sessions sessions sessions sessions"
    "tv tv tv tv tv tv tv tv tv tv tv tv"
    "alerts alerts alerts alerts alerts alerts alerts alerts alerts alerts alerts alerts"
    "recent recent recent recent recent recent recent recent recent recent recent recent";
  align-content: start;
  gap: 14px;
  width: 100%;
  margin: 0 auto;
}
#overview-dashboard > * { min-width: 0; margin: 0; }
#overview-dashboard .dashboard-cinema-hero { grid-area: hero; }
#overview-dashboard > #dashboard-control-summary { grid-area: control; }
#overview-dashboard > #stats { grid-area: stats; }
#overview-dashboard > #reseller-stats { grid-area: stats; }
#overview-dashboard > #overview-hero { grid-area: catalog; }
#overview-dashboard > .dashboard-performance-grid { grid-area: performance; }
#overview-dashboard > #dashboard-network-panel { grid-area: network; }
#overview-dashboard > #dashboard-storage-panel { grid-area: storage; }
#overview-dashboard > .dashboard-health-panel { grid-area: health; }
#overview-dashboard > .dashboard-live-sessions { grid-area: sessions; }
#overview-dashboard > .dashboard-tv-monitoring { grid-area: tv; }
#overview-dashboard > #dashboard-alerts-panel { grid-area: alerts; }
#overview-dashboard > .dashboard-recent-panel { grid-area: recent; }

#overview-dashboard .dashboard-cinema-hero {
  min-height: 120px;
  border-color: #d7e2ee;
  background: linear-gradient(120deg, #fff, #f7faff);
  box-shadow: 0 5px 18px #24364b0b;
}
#overview-dashboard .dashboard-cinema-copy .eyebrow { color: #3569a5; }
#overview-dashboard .dashboard-cinema-copy .dashboard-title,
#overview-dashboard .dashboard-cinema-copy > p:last-child { color: #172436; text-shadow: none; }
#overview-dashboard .dashboard-cinema-copy .dashboard-brand-subtitle { color: #53647a; }
#overview-dashboard .dashboard-hero-side {
  border-color: #dce5ef;
  background: #f4f8fc;
  box-shadow: none;
}
#overview-dashboard .dashboard-clock-date,
#overview-dashboard .dashboard-clock-time { color: #26364a; text-shadow: none; }

#overview-dashboard > #stats {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
}
#overview-dashboard > #stats .stat-card,
#overview-dashboard .dashboard-catalog-summary-card {
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: var(--control-surface);
  box-shadow: 0 3px 12px #24364b08;
  text-align: left;
}
#overview-dashboard > #stats .stat-label,
#overview-dashboard .dashboard-catalog-summary-label-text { color: var(--control-muted); }
#overview-dashboard > #stats .stat-number,
#overview-dashboard .dashboard-catalog-summary-value { margin-top: 6px; color: #172436; font-size: 22px; }
#overview-dashboard > #stats .stat-detail { color: #657487; }
#overview-dashboard .dashboard-catalog-summary { display: grid; min-width: 0; }
#overview-dashboard .dashboard-catalog-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
#overview-dashboard .dashboard-catalog-summary-label { margin-bottom: 5px; }
#overview-dashboard .dashboard-catalog-summary-label-text {
  color: #526174;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#overview-dashboard .panel,
#overview-dashboard .stat-card {
  border-color: var(--control-border);
  background: var(--control-surface);
  color: var(--control-ink);
  box-shadow: 0 4px 16px #24364b0a;
}
#overview-dashboard .panel-heading h3,
#overview-dashboard .panel-heading strong,
#overview-dashboard .panel-value,
#overview-dashboard .dashboard-health-card > span,
#overview-dashboard .dashboard-health-card small,
#overview-dashboard .resource-metric-heading,
#overview-dashboard .resource-summary,
#overview-dashboard .traffic-stats strong { color: var(--control-ink); }
#overview-dashboard .eyebrow { color: #61728a; }
#overview-dashboard .resource-updated,
#overview-dashboard .footnote,
#overview-dashboard .dashboard-data-note { color: #58697e; }
#overview-dashboard .dashboard-performance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}
#overview-dashboard .dashboard-performance-grid > .panel { min-width: 0; }
#overview-dashboard .resource-track,
#overview-dashboard .progress-track { background: #e7edf4; }
#overview-dashboard .resource-summary { border-color: #e6ebf1; }
#overview-dashboard .resource-summary strong { color: #25364a; }
#overview-dashboard .resource-chart-heading,
#overview-dashboard .traffic-chart-heading { color: #35465c; }
#overview-dashboard .resource-chart-heading > span:last-child,
#overview-dashboard .traffic-chart-heading > span:last-child { color: #66778d; }
#overview-dashboard .resource-gridline,
#overview-dashboard .chart-gridline { stroke: #e8edf3; }
#overview-dashboard .resource-line-cpu { stroke: #3174c2; }
#overview-dashboard .resource-line-memory { stroke: #1a9b70; }
#overview-dashboard .chart-line { stroke: #356fbe; }
#overview-dashboard .chart-area { fill: #356fbe1b; }
#overview-dashboard .traffic-live-indicator,
#overview-dashboard .traffic-live-indicator section {
  border-color: #e1e7ef;
  background: #f7f9fc;
}
#overview-dashboard .traffic-live-indicator-title,
#overview-dashboard .traffic-live-indicator small,
#overview-dashboard .traffic-current span,
#overview-dashboard .traffic-stats span { color: #5b6b80; }
#overview-dashboard .traffic-live-indicator strong,
#overview-dashboard .traffic-current strong { color: #182b44; }
#overview-dashboard .traffic-stats { border-color: #e6ebf1; }
#overview-dashboard .traffic-panel .footnote { line-height: 1.55; }

.dashboard-control-summary,
.dashboard-network-panel,
.dashboard-storage-panel,
.dashboard-health-panel,
.dashboard-alerts-panel {
  min-width: 0;
  padding: clamp(14px, 1.6vw, 22px);
  border: 1px solid var(--control-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px #24364b0a;
}
.dashboard-section-heading,
.dashboard-directory-heading,
.dashboard-health-actions,
.dashboard-diagnostic-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.dashboard-section-heading { margin-bottom: 12px; }
.dashboard-section-heading h2 { margin: 0; color: #16263a; font-size: clamp(19px, 2vw, 25px); }
.dashboard-section-heading .eyebrow { margin-bottom: 5px; color: #366ca8; }
.dashboard-monitor-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-monitor-controls label {
  display: grid;
  gap: 4px;
  color: #526174;
  font-size: 10px;
  font-weight: 700;
}
.dashboard-monitor-controls select {
  min-width: 145px;
  height: 36px;
  border-color: #d6e0ea;
  background: #fff;
  color: #1d2b3d;
}
.dashboard-control-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}
.control-summary-card {
  min-width: 0;
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dfe6ee;
  border-left: 4px solid #94a3b8;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 8px #273c5508;
}
.control-summary-card > span { color: #526174; font-size: 10px; font-weight: 700; }
.control-summary-card > strong { color: #1a293c; font-size: clamp(17px, 1.45vw, 22px); line-height: 1.16; overflow-wrap: anywhere; }
.control-summary-card > small { color: #596a7e; font-size: 10px; line-height: 1.4; }
.control-summary-card[data-state="healthy"] { border-left-color: #15803d; }
.control-summary-card[data-state="notice"] { border-left-color: #ca8a04; }
.control-summary-card[data-state="warning"] { border-left-color: #ea580c; }
.control-summary-card[data-state="critical"] { border-left-color: #dc2626; background: #fff8f7; }

.dashboard-network-kpis,
.dashboard-storage-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.dashboard-network-kpis > div,
.dashboard-storage-kpis > div,
.dashboard-network-periods > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid #e0e7ef;
  border-radius: 10px;
  background: #f8fafc;
}
.dashboard-network-kpis span,
.dashboard-storage-kpis span,
.dashboard-network-periods span { color: #526174; font-size: 10px; font-weight: 690; }
.dashboard-network-kpis strong,
.dashboard-storage-kpis strong,
.dashboard-network-periods strong { color: #172a42; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.dashboard-network-kpis small { color: #627286; font-size: 10px; line-height: 1.45; }
.dashboard-network-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 9px;
}
.dashboard-network-periods strong { font-size: 12px; }
.dashboard-network-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.dashboard-network-charts > section {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.dashboard-network-charts svg,
#dashboard-storage-chart { display: block; width: 100%; height: 126px; }
.dashboard-chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #27394f; font-size: 11px; }
.dashboard-chart-heading span { color: #69798c; font-size: 10px; }
.control-chart-grid { stroke: #e8edf3; stroke-width: 1; }
.control-chart-line { fill: none; stroke: #2471bd; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.control-chart-point { fill: #2471bd; stroke: #fff; stroke-width: 2; }
.control-chart-empty { fill: #65758a; font-size: 12px; }
.dashboard-network-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 11px;
  margin-top: 9px;
  border-top: 1px solid #e5eaf0;
  color: #5a6a7e;
  font-size: 10px;
}
.dashboard-network-footer strong { color: #25374d; }
.dashboard-data-note { margin: 9px 0 0; color: #64748b; font-size: 11px; line-height: 1.5; }

.dashboard-storage-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dashboard-storage-bar {
  height: 12px;
  overflow: hidden;
  margin: 13px 0;
  border-radius: 99px;
  background: #e8edf3;
}
.dashboard-storage-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: #16a34a; transition: width .3s ease; }
.dashboard-storage-bar[data-state="notice"] span { background: #ca8a04; }
.dashboard-storage-bar[data-state="warning"] span { background: #ea580c; }
.dashboard-storage-bar[data-state="critical"] span { background: #dc2626; }
.dashboard-directory-heading { padding-top: 8px; }
.dashboard-directory-heading strong,
.dashboard-directory-heading small { display: block; color: #24364b; }
.dashboard-directory-heading small { margin-top: 4px; color: #637287; font-size: 10px; }
.dashboard-directory-usage { display: grid; gap: 5px; margin-top: 8px; }
.dashboard-directory-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 9px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #fafbfd;
  color: #43546a;
  font-size: 11px;
}
.dashboard-directory-row strong { flex: 0 0 auto; color: #192b42; }
.dashboard-partitions { max-height: 100px; overflow: auto; margin-top: 9px; color: #65758a; font-size: 10px; overflow-wrap: anywhere; }

.dashboard-health-status {
  border-color: #dce5ed;
  background: #f7f9fb;
}
.dashboard-health-status span { color: #526174; }
.dashboard-health-status strong { color: #172a42; }
.dashboard-health-status.is-healthy { border-color: #a7d7b6; background: #f0faf3; }
.dashboard-health-status.is-warning { border-color: #f3d28a; background: #fffbeb; }
.dashboard-health-status.is-critical { border-color: #f5b5b5; background: #fff4f3; }
.dashboard-health-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dashboard-health-card { border-color: #e1e7ee; background: #f8fafc; }
.dashboard-health-card > span,
.dashboard-health-card small { color: #526174; }
.dashboard-health-value.is-healthy { color: #15803d; }
.dashboard-health-value.is-warning { color: #b45309; }
.dashboard-health-value.is-critical { color: #b91c1c; }
.dashboard-health-value.is-neutral { color: #475569; }
.dashboard-bandwidth-limit-form label { color: #526174; }
.dashboard-bandwidth-limit-form input { border-color: #ced8e3; background: #fff; color: #172436; }
.dashboard-health-actions { justify-content: flex-end; }
.dashboard-health-actions .resource-updated { margin-right: auto; }
.dashboard-apk-error-row { border-color: #f1c6c6; background: #fff8f7; }
.dashboard-apk-error-row strong { color: #24364b; }
.dashboard-apk-error-row span,
.dashboard-apk-error-row small,
.dashboard-apk-errors-heading { color: #58697e; }
.dashboard-apk-error-diagnostics { color: #526174 !important; }
.dashboard-apk-errors-empty { color: #64748b; }

.dashboard-service-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 740;
}
.dashboard-service-badge.is-healthy { border-color: #a7d7b6; background: #f0faf3; color: #166534; }
.dashboard-service-badge.is-notice { border-color: #f3d28a; background: #fffbeb; color: #854d0e; }
.dashboard-service-badge.is-warning { border-color: #fdba74; background: #fff7ed; color: #c2410c; }
.dashboard-service-badge.is-critical { border-color: #f5b5b5; background: #fff4f3; color: #b91c1c; }
.dashboard-service-badge.is-neutral { border-color: #cbd5e1; background: #f8fafc; color: #526174; }
.dashboard-alerts-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.dashboard-alert-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce4ec;
  border-left: 4px solid #ca8a04;
  border-radius: 10px;
  background: #fff;
}
.dashboard-alert-card.is-notice { border-left-color: #ca8a04; background: #fffcf2; }
.dashboard-alert-card.is-warning { border-left-color: #ea580c; background: #fff9f3; }
.dashboard-alert-card.is-critical,
.dashboard-alert-card.is-emergency { border-color: #f4cccc; border-left-color: #dc2626; background: #fff7f6; }
.dashboard-alert-severity { display: block; margin-bottom: 5px; color: #8a5a00; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.dashboard-alert-card.is-warning .dashboard-alert-severity { color: #c2410c; }
.dashboard-alert-card.is-critical .dashboard-alert-severity,
.dashboard-alert-card.is-emergency .dashboard-alert-severity { color: #b91c1c; }
.dashboard-alert-card > strong { display: block; color: #192b42; font-size: 13px; }
.dashboard-alert-service { display: block; margin: 4px 0 7px; color: #596a7f; font-size: 10px; }
.dashboard-alert-card p { margin: 5px 0 0; color: #43546a; font-size: 10px; line-height: 1.5; }
.dashboard-diagnostic-report { padding-top: 13px; margin-top: 13px; border-top: 1px solid #e2e8f0; }
.dashboard-diagnostic-heading strong { color: #1d2b3d; }
.dashboard-diagnostic-heading span { color: #637287; font-size: 10px; }
.dashboard-diagnostic-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 10px 0; }
.dashboard-diagnostic-service {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 5px;
  padding: 9px;
  border: 1px solid #e0e7ef;
  border-radius: 9px;
  background: #f8fafc;
}
.dashboard-diagnostic-service strong { color: #293b50; font-size: 10px; }
.dashboard-diagnostic-service > span { color: #475569; font-size: 9px; font-weight: 750; }
.dashboard-diagnostic-service small { grid-column: 1 / -1; color: #64748b; font-size: 9px; line-height: 1.4; }
.dashboard-diagnostic-service.is-healthy { border-left: 3px solid #16a34a; }
.dashboard-diagnostic-service.is-warning { border-left: 3px solid #ea580c; }
.dashboard-diagnostic-service.is-critical { border-left: 3px solid #dc2626; }
.dashboard-diagnostic-report details { margin-top: 9px; color: #35465b; font-size: 11px; }
.dashboard-diagnostic-report summary { cursor: pointer; font-weight: 700; }
.dashboard-diagnostic-report pre {
  max-height: 280px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #f7f9fc;
  color: #293b50;
  font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.dashboard-diagnostic-report ul { padding-left: 18px; color: #58697e; font-size: 10px; line-height: 1.5; }

#overview-dashboard .dashboard-live-sessions .table-scroll { max-height: 340px; overflow: auto; }
#overview-dashboard .dashboard-live-sessions th { position: sticky; top: 0; background: #f6f8fb; color: #526174; }
#overview-dashboard .dashboard-live-sessions td { border-color: #e8edf3; color: #43546a; }
#overview-dashboard .dashboard-live-sessions td strong { color: #1c2d42; }
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-summary-item { border-color: #dce4ed; background: #f8fafc; }
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-summary-item span { color: #526174; }
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-summary-item strong { color: #192b42; }
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-source-card,
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-session-card { border-color: #dfe6ee; background: #fff; color: #24364b; }
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-source-card h4,
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-session-card strong { color: #1c2d42; }
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-source-card p,
#overview-dashboard .dashboard-tv-monitoring .dashboard-tv-session-card span { color: #58697e; }

#app-view .tv-live-source-panel {
  border-color: #dce4ec;
  background: #fff;
  color: #172436;
}
#app-view .tv-live-section .tv-live-source-panel .panel-heading h3,
#app-view .tv-live-section .tv-live-source-panel .eyebrow,
#app-view .tv-live-section .tv-live-source-panel .footnote,
#app-view .tv-live-section .tv-live-source-panel label { color: #35465b; }
#app-view .tv-live-section .tv-live-source-panel input,
#app-view .tv-live-section .tv-live-source-panel select,
#app-view .tv-live-section .tv-live-source-panel textarea {
  border-color: #cbd5e1;
  background: #fff;
  color: #172436;
}
#app-view .tv-live-source-panel .sim-source-create-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}
#app-view .tv-live-source-panel .sim-source-create-form > label,
#app-view .tv-live-form-grid > label { min-width: 0; align-self: end; }
#app-view .tv-live-source-panel .sim-source-create-form > .tv-live-form-wide { grid-column: 1 / -1; }
#app-view .tv-live-source-panel .sim-source-create-form > .button,
#app-view .tv-live-form-grid > .button { min-height: 40px; }
#app-view .tv-live-source-panel details { border-color: #e2e8f0; }

@media (max-width: 1100px) {
  .dashboard-control-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-storage-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-health-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #overview-dashboard { gap: 10px; }
  #overview-dashboard .dashboard-performance-grid,
  .dashboard-network-charts { grid-template-columns: minmax(0, 1fr); }
  .dashboard-control-cards,
  .dashboard-network-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-health-grid,
  .dashboard-diagnostic-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-network-periods { grid-template-columns: minmax(0, 1fr); }
  .dashboard-alerts-list { grid-template-columns: minmax(0, 1fr); }
  #app-view .tv-live-source-panel .sim-source-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .dashboard-control-cards,
  .dashboard-network-kpis,
  .dashboard-storage-kpis,
  .dashboard-health-grid,
  .dashboard-diagnostic-services,
  .dashboard-monitor-controls { grid-template-columns: minmax(0, 1fr); }
  .dashboard-monitor-controls { display: grid; }
  .dashboard-monitor-controls select { width: 100%; }
  .dashboard-health-actions { align-items: stretch; flex-direction: column; }
  #app-view .tv-live-source-panel .sim-source-create-form,
  #app-view .tv-live-source-panel .tv-live-form-grid { grid-template-columns: minmax(0, 1fr); }
  #app-view .tv-live-source-panel .sim-source-create-form > .tv-live-form-wide,
  #app-view .tv-live-source-panel .sim-source-create-form > .button,
  #app-view .tv-live-source-panel .tv-live-form-grid > .tv-live-form-wide,
  #app-view .tv-live-source-panel .tv-live-form-grid > .button { grid-column: auto; width: 100%; }
}
