/* Ajustes exclusivos do projeto TOA. O visual base continua sendo o CSS original do DOMINIUM. */
/* Evita recalcular todo o painel em cada quadro ao recolher o menu lateral. */
.app-header,
.app-shell { transition: none; }
.profile-tabs button small{margin-left:7px;opacity:.65;font-size:10px}.toa-simple-workspace{padding:24px clamp(18px,2.3vw,34px) 42px;min-width:0}.toa-upload-card{display:flex;align-items:center;gap:16px;padding:18px 20px;border:1px solid var(--line);background:var(--surface);border-radius:10px;margin-bottom:16px}.toa-upload-card>div:nth-child(2){flex:1}.toa-upload-card strong{display:block;font-size:15px}.toa-upload-card p{margin:5px 0 0;color:var(--muted);font-size:12px}.toa-file-list{display:grid;gap:8px;padding-top:10px}.toa-file-list article{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:8px;padding:11px 12px;background:var(--surface-soft)}.toa-file-list article svg{width:17px;height:17px;color:var(--success)}.toa-file-list article.error svg{color:var(--danger)}.toa-file-list article div{display:grid;gap:2px}.toa-file-list article strong{font-size:12px}.toa-file-list article small{font-size:10px;color:var(--muted)}.toa-tech-kpis{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:15px}.toast-stack{position:fixed;right:20px;bottom:20px;z-index:99999;display:grid;gap:8px;max-width:min(420px,calc(100vw - 40px))}.toast{background:var(--surface-elevated,#15171b);border:1px solid var(--line);box-shadow:0 14px 36px rgba(0,0,0,.25);padding:12px 14px;border-radius:8px;font-size:12px}.toast.success{border-color:rgba(36,181,125,.45)}.toast.error{border-color:rgba(235,72,88,.55)}.side-nav-assurance{font-size:10px}.side-nav-assurance svg{width:14px}.connection.connected .status-dot{background:#24b57d;box-shadow:0 0 0 4px rgba(36,181,125,.12)}.monitor-source-card .danger{color:var(--danger)}.monitor-tabs button span{font-size:10px;opacity:.65;margin-left:4px}.sidebar-collapsed .side-nav{width:72px}.sidebar-collapsed .side-nav .side-nav-label,.sidebar-collapsed .side-nav .side-nav-item span,.sidebar-collapsed .side-nav .side-nav-footer{display:none}.sidebar-collapsed .side-nav-item{justify-content:center}.sidebar-collapsed .app-shell{grid-template-columns:72px minmax(0,1fr)}
@media(max-width:900px){.toa-tech-kpis{grid-template-columns:1fr}.toa-upload-card{align-items:flex-start;flex-wrap:wrap}.sidebar-collapsed .app-shell{grid-template-columns:1fr}}

/* Camada visual TOA: paleta consistente, tema claro real e ajustes responsivos. */
:root {
  --toa-accent: #e32636;
  --toa-accent-dark: #b91625;
  --toa-blue: #1677b8;
  --toa-blue-dark: #0d4f83;
}

.profile-tabs .profile-tab {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 100px;
  white-space: nowrap;
}
.profile-tabs {
  box-sizing: border-box;
  justify-self: stretch;
  max-width: 100%;
  width: 100%;
}
.profile-tabs .profile-tab[data-profile="natal"] { min-width: 145px; }
.profile-tabs .profile-tab-all { min-width: 76px; }

.monitor-heading { align-items: flex-start; }
.monitor-actions { justify-content: flex-end; }
.monitor-actions .monitor-csv-button {
  background: linear-gradient(135deg, var(--toa-accent), var(--toa-accent-dark));
  border-color: #f0525f;
  box-shadow: 0 6px 20px rgba(227, 38, 54, .2);
}
.monitor-actions .monitor-csv-button:hover {
  border-color: #ff7b85;
  box-shadow: 0 8px 24px rgba(227, 38, 54, .3);
}
.monitor-actions .monitor-tv-button {
  background: linear-gradient(135deg, var(--toa-blue), var(--toa-blue-dark));
  border-color: #3c9bd4;
  box-shadow: 0 6px 20px rgba(22, 119, 184, .22);
}
.monitor-actions .monitor-tv-button:hover {
  border-color: #6bc0ee;
  box-shadow: 0 8px 24px rgba(22, 119, 184, .32);
}

.monitor-source-card,
.monitor-attention-stage,
.monitor-kpis article,
.monitor-tabs,
.monitor-panel { border-radius: 10px; }
.monitor-source-card { grid-template-columns: auto minmax(0, 1fr); }

.monitor-tv {
  box-sizing: border-box;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100dvh;
  width: 100%;
}
.monitor-tv-main {
  background: transparent;
  height: auto;
  overflow: hidden;
  padding: 0;
}
.monitor-tv-focus { --tv-focus: 227, 38, 54; }
.monitor-tv-now > header span { color: var(--toa-accent); }
.monitor-tv-now > header strong,
.monitor-tv-technicians strong { color: #eef3f8; }
.monitor-tv-open .toast-stack { display: none; }

/* O antigo tema claro invertia a tela inteira, distorcendo cores e imagens. */
html[data-theme="light"] {
  --ink: #17212b;
  --muted: #647386;
  --line: #d7e0e9;
  --soft: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-raised: #eef3f8;
  --surface-hover: #e8eef5;
  --navy: #ffffff;
  --blue: #126fae;
  --bg-page: #f3f6fa;
  --bg-surface: #ffffff;
  --bg-elevated: #eef3f8;
  --border-default: #d7e0e9;
  --border-strong: #bdcad8;
  --text-primary: #17212b;
  --text-secondary: #46566a;
  --text-muted: #718096;
  color-scheme: light;
  filter: none;
  background: #f3f6fa;
}

html[data-theme="light"] .brand-asset,
html[data-theme="light"] img,
html[data-theme="light"] video,
html[data-theme="light"] .monitor-tv,
html[data-theme="light"] .monitor-tv:fullscreen { filter: none; }

html[data-theme="light"] body,
html[data-theme="light"] main { background: #f3f6fa; color: #17212b; }
html[data-theme="light"] .app-header,
html[data-theme="light"] .side-nav { background: #ffffff; border-color: #d7e0e9; }
html[data-theme="light"] .app-header { box-shadow: 0 1px 0 rgba(23, 33, 43, .06); }
html[data-theme="light"] .side-nav-item { color: #536274; }
html[data-theme="light"] .side-nav-item:hover { background: #f1f5f9; color: #17212b; }
html[data-theme="light"] .side-nav-item.active {
  background: #fff1f2;
  color: #a81724;
  box-shadow: inset 0 0 0 1px rgba(227, 38, 54, .1);
}
html[data-theme="light"] .side-nav-item.active::before { background: var(--toa-accent); }
html[data-theme="light"] .profile-tabs,
html[data-theme="light"] .connection,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .header-toa-button { background: #f7f9fc; border-color: #d4dee8; color: #253345; }
html[data-theme="light"] .profile-tab { color: #536274; }
html[data-theme="light"] .profile-tab:hover { background: #e9eff6; color: #17212b; }
html[data-theme="light"] .profile-tab.active {
  background: linear-gradient(135deg, #d92232, #b91625);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(185, 22, 37, .18);
}

html[data-theme="light"] .monitor-source-card {
  background: linear-gradient(110deg, #e8f5ff, #f6fbff);
  border-color: #9acced;
  box-shadow: 0 5px 18px rgba(34, 117, 170, .08);
}
html[data-theme="light"] .monitor-source-copy strong { color: #0d6ca8; }
html[data-theme="light"] .monitor-source-copy span { color: #17212b; }

/* Monitoramento Técnico: histórico protegido de deslocamento do TOA. */
.technician-monitor-workspace { min-width: 0; padding-bottom: 24px; }
.technician-monitor-heading { align-items: flex-end; }
.technician-monitor-heading > div:first-child > p:last-child { margin: 6px 0 0; color: var(--text-secondary); }
.technician-monitor-controls { display: flex; align-items: flex-end; gap: 8px; }
.technician-monitor-controls label { display: grid; gap: 5px; color: var(--text-muted); font-size: .66rem; font-weight: 750; text-transform: uppercase; }
.technician-monitor-controls input,
.technician-monitor-controls button,
.technician-route-toolbar select,
.technician-history-access button {
  min-height: 36px;
  padding: 0 11px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 5px;
}
.technician-monitor-controls button { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.technician-monitor-controls button svg { width: 15px; }
.technician-history-access { margin: 0 0 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: color-mix(in srgb, var(--state-info) 10%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--state-info) 55%, var(--border-default)); border-radius: 6px; }
.technician-history-access.hidden { display: none; }
.technician-history-access span { flex: 1; color: var(--text-secondary); font-size: .72rem; }
.technician-history-access button { cursor: pointer; font-weight: 750; }
.technician-monitor-status { margin: 0 0 12px; color: var(--text-muted); font-size: .7rem; }
.technician-monitor-status.online { color: var(--state-success); }
.technician-monitor-status.warning { color: var(--state-warning); }
.technician-monitor-status.error { color: var(--state-danger); }
.technician-service-marker-shell { background: transparent; border: 0; }
.technician-service-marker { width: 28px; height: 28px; display: grid; place-items: center; color: #07111d; background: #70bdff; border: 2px solid #0a4f91; border-radius: 50% 50% 50% 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .38); font-size: .76rem; font-weight: 900; transform: rotate(-45deg); }
.technician-service-marker { line-height: 1; }
.technician-service-marker > b { display: block; font-weight: 900; transform: rotate(45deg); }
.technician-service-marker-shell.is-warning .technician-service-marker { color: #241500; background: #ffd13b; border-color: #a76500; }
.technician-service-marker-shell.is-square .technician-service-marker { border-radius: 4px; transform: none; }
.technician-service-marker-shell.is-square .technician-service-marker > b { transform: none; }
.technician-service-popup { min-width: 190px; display: grid; gap: 7px; color: #111827; }
.technician-service-popup > strong { display: flex; align-items: center; gap: 7px; font-size: .86rem; }
.technician-service-popup > strong i { width: 22px; height: 22px; display: grid; place-items: center; color: #07111d; background: #70bdff; border: 1px solid #0a4f91; border-radius: 50%; font-style: normal; }
.technician-service-popup span { display: grid; grid-template-columns: 62px 1fr; gap: 8px; font-size: .72rem; }
.technician-service-popup b { color: #64748b; font-weight: 700; }
.technician-monitor-kpis { margin-bottom: 12px; display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 8px; }
.technician-monitor-kpis article { min-width: 0; padding: 12px; display: grid; gap: 6px; background: var(--bg-surface); border: 1px solid var(--border-default); border-top: 3px solid var(--state-info); border-radius: 6px; }
.technician-monitor-kpis span { color: var(--text-muted); font-size: .61rem; text-transform: uppercase; }
.technician-monitor-kpis strong { overflow: hidden; color: var(--text-primary); font-size: 1.12rem; text-overflow: ellipsis; white-space: nowrap; }
.technician-route-card,
.technician-summary-card { margin-bottom: 12px; min-width: 0; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 7px; overflow: hidden; }
.technician-route-toolbar,
.technician-summary-card > div:first-child { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border-default); }
.technician-summary-heading { flex-wrap: wrap; }
.technician-summary-search { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--text-muted); font-size: .62rem; }
.technician-summary-search input { width: min(310px, 52vw); min-height: 34px; padding: 7px 10px; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 5px; outline: none; }
.technician-summary-search input:focus { border-color: var(--toa-blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--toa-blue) 18%, transparent); }
.technician-route-toolbar h3,
.technician-summary-card h3 { margin: 0; color: var(--text-primary); font-size: .9rem; }
.technician-route-toolbar p,
.technician-summary-card p { margin: 4px 0 0; color: var(--text-muted); font-size: .64rem; }
.technician-route-toolbar select { width: min(360px, 42vw); }
.technician-route-map { min-height: 440px; background: #d8e2e8; }
.technician-route-map .leaflet-control-attribution { font-size: 9px; }
.technician-summary-card .table-scroll { max-height: 360px; }
.technician-summary-card table { width: 100%; border-collapse: collapse; }
.technician-summary-card th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; color: var(--text-muted); background: var(--bg-elevated); border-bottom: 1px solid var(--border-default); font-size: .58rem; text-align: left; text-transform: uppercase; }
.technician-summary-card td { padding: 10px 12px; color: var(--text-secondary); border-bottom: 1px solid var(--border-default); font-size: .67rem; }
.technician-summary-card tbody tr[data-technician-key] { cursor: pointer; }
.technician-summary-card tbody tr[data-technician-key]:hover { background: var(--bg-elevated); }
.technician-summary-card td strong { display: block; color: var(--text-primary); }
.technician-summary-card td small { margin-top: 3px; display: block; color: var(--text-muted); }
.technician-summary-card .empty-table { padding: 28px; color: var(--text-muted); text-align: center; }

@media (max-width: 1180px) {
  .technician-monitor-kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}

@media (max-width: 760px) {
  .technician-monitor-controls,
  .technician-route-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
  .technician-monitor-kpis { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .technician-route-toolbar select { width: 100%; }
  .technician-route-map { min-height: 360px; }
}
html[data-theme="light"] .monitor-source-copy small { color: #60758a; }
html[data-theme="light"] .monitor-source-card .button.secondary { background: #ffffff; }

html[data-theme="light"] .monitor-attention-stage {
  background: linear-gradient(115deg, rgba(var(--attention-rgb), .14), #ffffff 58%);
  box-shadow: 0 8px 24px rgba(31, 45, 61, .07);
}
html[data-theme="light"] .monitor-attention-copy h3 { color: #17212b; }
html[data-theme="light"] .monitor-attention-copy > p,
html[data-theme="light"] .monitor-attention-count { color: #536274; }
html[data-theme="light"] .monitor-attention-meta span { background: rgba(23, 33, 43, .06); color: #334155; }

html[data-theme="light"] .monitor-kpis article {
  background: #ffffff;
  border-color: #d7e0e9;
  box-shadow: 0 4px 14px rgba(31, 45, 61, .045);
}
html[data-theme="light"] .monitor-kpis strong { color: #17212b; }
html[data-theme="light"] .monitor-kpis span,
html[data-theme="light"] .monitor-kpis small { color: #66768a; }
html[data-theme="light"] .monitor-tabs { background: #e9eff5; border-color: #d2dce6; }
html[data-theme="light"] .monitor-tabs button { color: #536274; }
html[data-theme="light"] .monitor-tabs button:hover { background: #ffffff; color: #17212b; }
html[data-theme="light"] .monitor-tabs button.active { background: #d92232; color: #ffffff; }
html[data-theme="light"] .monitor-tab-count { background: #d8e1ea; color: #46566a; }

html[data-theme="light"] .monitor-panel,
html[data-theme="light"] .route-timeline-card,
html[data-theme="light"] .route-detail { background: #ffffff; border-color: #d7e0e9; }
html[data-theme="light"] .monitor-panel-head { border-color: #d7e0e9; }
html[data-theme="light"] .monitor-panel-head h3,
html[data-theme="light"] .route-detail-head h4 { color: #17212b; }
html[data-theme="light"] .monitor-panel-head p,
html[data-theme="light"] .route-detail-head p { color: #66768a; }
html[data-theme="light"] .monitor-search,
html[data-theme="light"] .monitor-search input,
html[data-theme="light"] .monitor-toolbar select {
  background: #f7f9fc;
  border-color: #cfd9e4;
  color: #253345;
}
html[data-theme="light"] .monitor-table th { background: #eef3f8; color: #5d6c7e; }
html[data-theme="light"] .monitor-table th,
html[data-theme="light"] .monitor-table td { border-color: #e1e7ee; }
html[data-theme="light"] .monitor-table td { color: #46566a; }
html[data-theme="light"] .monitor-table td strong { color: #17212b; }
html[data-theme="light"] .monitor-table tbody tr:hover { background: #f4f8fb; }

html[data-theme="light"] .route-console { background: #f4f7fa; }
html[data-theme="light"] .route-legend span { color: #536274; }
html[data-theme="light"] .route-live-chip { background: #eaf8f0; border-color: #abd8be; color: #187347; }
html[data-theme="light"] .route-resource-title,
html[data-theme="light"] .route-technician,
html[data-theme="light"] .route-hours { background-color: #eef3f7; border-color: #d7e0e9; }
html[data-theme="light"] .route-hours { background-image: linear-gradient(to right, #d3dde7 1px, transparent 1px); }
html[data-theme="light"] .route-lane { background-color: #ffffff; background-image: linear-gradient(to right, #e1e7ee 1px, transparent 1px); }
html[data-theme="light"] .route-technician-row,
html[data-theme="light"] .route-hours-row { border-color: #d7e0e9; }
html[data-theme="light"] .route-technician-avatar { background: #e6edf4; border-color: #ccd7e2; color: #334155; }
html[data-theme="light"] .route-technician strong { color: #253345; }
html[data-theme="light"] .route-technician small,
html[data-theme="light"] .route-hours span,
html[data-theme="light"] .route-resource-title { color: #647386; }
html[data-theme="light"] .route-detail-facts div { border-color: #e1e7ee; }
html[data-theme="light"] .route-detail-facts dt { color: #647386; }
html[data-theme="light"] .route-detail-facts dd { color: #253345; }

html[data-theme="light"] .monitor-tv,
html[data-theme="light"] .monitor-tv:fullscreen {
  --tv-border: rgba(51, 65, 85, .17);
  color-scheme: light;
  color: #17212b;
  background:
    radial-gradient(circle at 12% 0%, rgba(38, 105, 170, .13), transparent 30%),
    radial-gradient(circle at 90% 100%, rgba(227, 38, 54, .08), transparent 34%),
    #eef3f8;
}
html[data-theme="light"] .monitor-tv-main { background: transparent; }
html[data-theme="light"] .monitor-tv-brand strong,
html[data-theme="light"] .monitor-tv-time strong,
html[data-theme="light"] .monitor-tv-now > header strong,
html[data-theme="light"] .monitor-tv-technicians strong { color: #17212b; }
html[data-theme="light"] .monitor-tv-brand small,
html[data-theme="light"] .monitor-tv-time span { color: #647386; }
html[data-theme="light"] .monitor-tv-context > span {
  background: rgba(255, 255, 255, .7);
  border-color: #cbd6e1;
  color: #536274;
}
html[data-theme="light"] .monitor-tv-context strong.live {
  background: #e8f7ef;
  border-color: #a8d8bd;
  color: #187347;
}
html[data-theme="light"] .monitor-tv-context b.api {
  background: #fff0f2;
  border-color: #efb6bd;
  color: #b91625;
}
html[data-theme="light"] .monitor-tv-header-actions button {
  background: #ffffff;
  border-color: #cbd6e1;
  color: #46566a;
  box-shadow: 0 2px 8px rgba(31, 45, 61, .05);
}
html[data-theme="light"] .monitor-tv-header-actions button:hover {
  background: #f7f9fc;
  border-color: #8fa1b5;
  color: #17212b;
}
html[data-theme="light"] .monitor-tv-header-actions button.active {
  background: #e8f7ef;
  border-color: #9bcfb3;
  color: #187347;
}
html[data-theme="light"] .monitor-tv-kpis article {
  background: rgba(255, 255, 255, .92);
  border-color: #d2dce6;
  box-shadow: 0 4px 14px rgba(31, 45, 61, .055);
}
html[data-theme="light"] .monitor-tv-kpis article.red {
  background: #fff1f2;
  border-color: #efc0c5;
  border-top-color: #e32636;
}
html[data-theme="light"] .monitor-tv-kpis span { color: #65758a; }
html[data-theme="light"] .monitor-tv-kpis strong { color: #17212b; }
html[data-theme="light"] .monitor-tv-focus {
  background:
    radial-gradient(circle at 5% 5%, rgba(var(--tv-focus), .12), transparent 34%),
    linear-gradient(125deg, #ffffff, #f7f9fc 72%);
  box-shadow: 0 8px 24px rgba(31, 45, 61, .07);
}
html[data-theme="light"] .monitor-tv-focus h1 { color: #17212b; }
html[data-theme="light"] .monitor-tv-focus-grid > span {
  background: rgba(238, 243, 248, .72);
  border-color: #d9e2eb;
}
html[data-theme="light"] .monitor-tv-focus-grid small,
html[data-theme="light"] .monitor-tv-focus-head small,
html[data-theme="light"] .monitor-tv-focus > footer span { color: #647386; }
html[data-theme="light"] .monitor-tv-focus-grid strong { color: #253345; }
html[data-theme="light"] .monitor-tv-focus > footer { border-color: #dbe3eb; }
html[data-theme="light"] .monitor-tv-focus > footer b { color: #b91625; }
html[data-theme="light"] .monitor-tv-status.late { background: #fff0f2; color: #c51f2f; }
html[data-theme="light"] .monitor-tv-status.risk { background: #fff7df; color: #9a6800; }
html[data-theme="light"] .monitor-tv-status.safe { background: #e8f7ef; color: #187347; }
html[data-theme="light"] .monitor-tv-status.unknown { background: #e9eff5; color: #536274; }
html[data-theme="light"] .monitor-tv-now {
  background: rgba(255, 255, 255, .94);
  border-color: #d2dce6;
  box-shadow: 0 8px 24px rgba(31, 45, 61, .06);
}
html[data-theme="light"] .monitor-tv-now > header { border-color: #d9e2eb; }
html[data-theme="light"] .monitor-tv-now > header span { color: var(--toa-accent); }
html[data-theme="light"] .monitor-tv-technicians article {
  background: #f7f9fc;
  border-color: #d8e1ea;
}
html[data-theme="light"] .monitor-tv-technicians .avatar {
  background: #e8f7ef;
  border-color: #acd8bf;
  color: #187347;
}
html[data-theme="light"] .monitor-tv-technicians small { color: #647386; }
html[data-theme="light"] .monitor-tv-technicians b { color: #187347; }
html[data-theme="light"] .monitor-tv-empty { color: #647386; }
html[data-theme="light"] .monitor-tv-footer {
  background: rgba(255, 255, 255, .9);
  border-color: #d2dce6;
}
html[data-theme="light"] .monitor-tv-live { color: #187347; }
html[data-theme="light"] .monitor-tv-ticker { color: #46566a; }
html[data-theme="light"] .monitor-tv-footer > strong { color: #647386; }

.monitor-tv-technicians article { animation: monitor-tv-card-in .32s ease both; }
.monitor-tv-technicians article:nth-child(2) { animation-delay: .04s; }
.monitor-tv-technicians article:nth-child(3) { animation-delay: .08s; }
.monitor-tv-technicians article:nth-child(4) { animation-delay: .12s; }
@keyframes monitor-tv-card-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1400px) {
  .monitor-heading { align-items: stretch; flex-direction: column; }
  .monitor-actions { justify-content: flex-start; width: 100%; }
}

@media (max-width: 1450px), (max-height: 850px) {
  .monitor-tv-technicians article:nth-child(n+3) { display: grid; }
}

@media (max-width: 900px) {
  .monitor-tv { overflow-y: auto; }
  .monitor-tv-header { grid-template-columns: minmax(0, 1fr) auto auto; }
  .monitor-tv-context { display: none; }
  .monitor-tv-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .monitor-tv-main { grid-template-columns: 1fr; }
  .monitor-tv-now { min-height: 220px; }
}

@media (max-width: 640px) {
  .monitor-source-card { grid-template-columns: auto minmax(0, 1fr); }
  .monitor-source-card .button { width: 100%; }
  .monitor-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-tv-header { grid-template-columns: 1fr auto; }
  .monitor-tv-time { display: none; }
  .monitor-tv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-tv-focus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-tv-footer { grid-template-columns: 1fr auto; }
  .monitor-tv-ticker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .monitor-tv-technicians article { animation: none; }
}

/* Hierarquia da leitura TV: dados operacionais primeiro, metadados depois. */
.monitor-tv-focus-details {
  display: grid;
  gap: 7px;
}
.monitor-tv-focus-primary {
  background: linear-gradient(110deg, #e32636, #b91625);
  border: 1px solid #f05a66;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(185, 22, 37, .22);
  gap: 0;
  overflow: hidden;
  padding: 4px;
}
.monitor-tv-focus-primary > span {
  background: transparent;
  border: 0;
  border-radius: 0;
  min-height: 45px;
  padding: 8px 12px;
}
.monitor-tv-focus-primary > span + span {
  border-left: 1px solid rgba(255, 255, 255, .2);
}
.monitor-tv-focus-primary small,
html[data-theme="light"] .monitor-tv-focus-primary small {
  color: rgba(255, 255, 255, .72);
  font-weight: 900;
}
.monitor-tv-focus-primary strong,
html[data-theme="light"] .monitor-tv-focus-primary strong {
  color: #ffffff;
  font-size: clamp(10px, .78vw, 14px);
  font-weight: 950;
}
.monitor-tv-focus-secondary > span {
  opacity: .86;
}
html[data-theme="light"] .monitor-tv-focus-primary > span {
  background: transparent;
  border-color: rgba(255, 255, 255, .2);
}

@media (max-width: 760px) {
  .monitor-tv-focus-primary,
  .monitor-tv-focus-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-tv-focus-primary > span:nth-child(3) { border-left: 0; }
  .monitor-tv-focus-primary > span:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .2); }
}

/* Modo TV: duas prioridades por aviso, aproveitando toda a área central. */
.monitor-tv-focus-board {
  gap: 10px;
  padding: 12px;
}
.monitor-tv-focus-board-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}
.monitor-tv-focus-board-head > div {
  display: grid;
  gap: 3px;
}
.monitor-tv-focus-board-head small {
  color: #718091;
  font-size: clamp(8px, .55vw, 10px);
}
.monitor-tv-focus-board-head > strong {
  background: rgba(227, 38, 54, .1);
  border: 1px solid rgba(227, 38, 54, .32);
  border-radius: 999px;
  color: #ff6975;
  font-size: clamp(8px, .58vw, 11px);
  padding: 6px 10px;
  text-transform: uppercase;
}
.monitor-tv-focus-cards {
  display: grid;
  flex: 1;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
}
.monitor-tv-focus-board.single .monitor-tv-focus-cards {
  grid-template-columns: minmax(0, 1fr);
}
.monitor-tv-focus-card {
  background:
    radial-gradient(circle at 5% 3%, rgba(227, 38, 54, .14), transparent 36%),
    linear-gradient(145deg, rgba(24, 17, 21, .96), rgba(12, 17, 23, .96));
  border: 1px solid rgba(227, 38, 54, .42);
  border-radius: 10px;
  box-shadow: inset 0 3px 0 rgba(227, 38, 54, .9), 0 8px 22px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: clamp(12px, 1.1vw, 18px);
}
.monitor-tv-focus-card.risk {
  background:
    radial-gradient(circle at 5% 3%, rgba(255, 212, 0, .17), transparent 36%),
    linear-gradient(145deg, rgba(26, 22, 14, .96), rgba(12, 17, 23, .96));
  border-color: rgba(255, 212, 0, .72);
  box-shadow: inset 0 3px 0 #ffd400, 0 8px 22px rgba(0, 0, 0, .12);
}
.monitor-tv-focus-card.safe {
  border-color: rgba(62, 207, 127, .4);
  box-shadow: inset 0 3px 0 rgba(62, 207, 127, .86), 0 8px 22px rgba(0, 0, 0, .12);
}
.monitor-tv-focus-card-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}
.monitor-tv-focus-card-head > span:first-child {
  color: #8995a3;
  font-size: clamp(8px, .56vw, 10px);
  font-weight: 900;
  letter-spacing: .11em;
}
.monitor-tv-focus-card .monitor-tv-tec1-value {
  font-size: clamp(34px, 3.25vw, 62px);
  margin: clamp(10px, 1.4vh, 17px) 0 3px;
}
.monitor-tv-focus-card h1 {
  font-size: clamp(14px, 1.05vw, 21px);
  margin-bottom: clamp(12px, 1.6vh, 20px);
}
.monitor-tv-focus-card .monitor-tv-focus-details {
  gap: 8px;
}
.monitor-tv-focus-card .monitor-tv-focus-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.monitor-tv-focus-card .monitor-tv-focus-primary > span,
.monitor-tv-focus-card .monitor-tv-focus-secondary > span {
  min-height: 47px;
}
.monitor-tv-focus-card .monitor-tv-focus-primary > span:nth-child(3) {
  border-left: 0;
}
.monitor-tv-focus-card .monitor-tv-focus-primary > span:nth-child(n+3) {
  border-top: 1px solid rgba(255, 255, 255, .2);
}
.monitor-tv-focus-card .monitor-tv-focus-secondary {
  gap: 6px;
}
.monitor-tv-focus-board > footer {
  margin-top: 0;
}
html[data-theme="light"] .monitor-tv-focus-card {
  background:
    radial-gradient(circle at 5% 3%, rgba(227, 38, 54, .11), transparent 38%),
    linear-gradient(145deg, #ffffff, #f6f8fb);
  border-color: rgba(227, 38, 54, .36);
  box-shadow: inset 0 3px 0 #e32636, 0 7px 18px rgba(31, 45, 61, .08);
}
html[data-theme="light"] .monitor-tv-focus-card.risk {
  background:
    radial-gradient(circle at 5% 3%, rgba(255, 212, 0, .19), transparent 38%),
    linear-gradient(145deg, #ffffff, #fffde9);
  border-color: rgba(255, 204, 0, .82);
  box-shadow: inset 0 3px 0 #ffd400, 0 7px 18px rgba(31, 45, 61, .08);
}
html[data-theme="light"] .monitor-tv-focus-card .monitor-tv-status.risk {
  background: #fff7b8;
  border-color: #f2c900;
  color: #6f5400;
}
html[data-theme="light"] .monitor-tv-focus-card.safe {
  border-color: rgba(24, 115, 71, .3);
  box-shadow: inset 0 3px 0 #24945d, 0 7px 18px rgba(31, 45, 61, .08);
}
html[data-theme="light"] .monitor-tv-focus-board-head > strong {
  background: #fff0f2;
  border-color: #efb6bd;
  color: #b91625;
}
html[data-theme="light"] .monitor-tv-focus-card-head > span:first-child {
  color: #647386;
}

@media (max-width: 980px) {
  .monitor-tv-focus-cards { grid-template-columns: minmax(0, 1fr); }
  .monitor-tv-focus-cards .monitor-tv-focus-card:nth-child(2) { display: none; }
}

.firebase-access-gate {
  align-items: center;
  background: radial-gradient(circle at top, rgba(227, 38, 54, .16), transparent 34%), #080b0f;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.firebase-access-card {
  background: #11161c;
  border: 1px solid #28313b;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
  color: #f3f6f8;
  max-width: 520px;
  padding: 36px;
  text-align: center;
  width: 100%;
}
.firebase-access-card img { height: 52px; width: 52px; }
.firebase-access-eyebrow {
  color: #e32636;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  margin: 18px 0 8px;
}
.firebase-access-card h1 { font-size: 26px; margin: 0 0 12px; }
.firebase-access-card > p:not(.firebase-access-eyebrow) { color: #9ca8b5; line-height: 1.55; }
.firebase-access-card dl {
  background: #0b0f14;
  border: 1px solid #242d37;
  border-radius: 10px;
  margin: 22px 0;
  padding: 4px 16px;
  text-align: left;
}
.firebase-access-card dl div { border-bottom: 1px solid #202831; padding: 12px 0; }
.firebase-access-card dl div:last-child { border-bottom: 0; }
.firebase-access-card dt { color: #788594; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.firebase-access-card dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.firebase-access-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.firebase-access-actions button {
  background: #e32636;
  border: 1px solid #e32636;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  padding: 0 18px;
}
.firebase-access-actions button.secondary { background: transparent; border-color: #3b4652; }
.firebase-access-actions button:disabled { cursor: wait; opacity: .55; }
.firebase-access-error { color: #ff7c86 !important; font-size: 13px; min-height: 20px; }

/* O novo símbolo preserva o quadrado branco original nos dois temas. */
.brand-primary-logo,
html[data-theme="light"] .brand-primary-logo {
  background: #ffffff !important;
  border-radius: 4px;
  filter: none !important;
  object-fit: contain;
}
.brand-mark,
html[data-theme="light"] .brand-mark {
  background: #ffffff !important;
  border: 0 !important;
  box-shadow: none !important;
}
.profile-tab-all { border-style: dashed !important; }

/* Escalonamento visual quando faltam 15 minutos para completar 1h de atraso. */
.monitor-tv-focus-card.urgent-close {
  border-color: #ff2f40;
  box-shadow: inset 0 3px 0 #ff2f40, 0 0 26px rgba(255, 47, 64, .2);
}
.monitor-tv-urgent {
  align-items: center;
  background: linear-gradient(90deg, rgba(25, 91, 222, .2), rgba(228, 37, 51, .24));
  border: 1px solid rgba(255, 73, 87, .65);
  border-radius: 9px;
  display: none;
  gap: 12px;
  margin-top: auto;
  min-height: 70px;
  padding: 10px 12px;
}
.monitor-tv-urgent.active { display: flex; }
.monitor-tv-urgent > div { display: grid; gap: 4px; min-width: 0; }
.monitor-tv-urgent strong {
  color: #ff616d;
  font-size: clamp(10px, .8vw, 15px);
  font-weight: 950;
  letter-spacing: .04em;
}
.monitor-tv-urgent small { color: #d6dde6; font-size: clamp(9px, .63vw, 12px); }
.monitor-tv-siren {
  align-items: center;
  animation: monitor-tv-siren-flash .72s steps(2, end) infinite;
  background: linear-gradient(90deg, #155de0 0 50%, #e42533 50% 100%);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: -7px 0 18px rgba(21, 93, 224, .5), 7px 0 18px rgba(228, 37, 51, .55);
  color: #ffffff;
  display: flex;
  flex: 0 0 auto;
  height: 48px;
  justify-content: center;
  width: 48px;
}
.monitor-tv-siren svg { height: 25px; width: 25px; }
@keyframes monitor-tv-siren-flash {
  0%, 49% { filter: brightness(1.7); transform: rotate(-3deg) scale(1.03); }
  50%, 100% { filter: brightness(.82); transform: rotate(3deg); }
}
html[data-theme="light"] .monitor-tv-urgent {
  background: linear-gradient(90deg, #e8f0ff, #fff0f2);
  border-color: #e83b49;
}
html[data-theme="light"] .monitor-tv-urgent small { color: #39485a; }

/* Console dedicado: lista somente os contratos que estão gerando alertas. */
body.alert-console-open { overflow: hidden; }
.alert-console-screen {
  background: #090d12;
  color: #eef3f8;
  display: grid;
  grid-template-rows: minmax(90px, auto) minmax(0, 1fr);
  inset: 0;
  padding: clamp(18px, 2vw, 32px);
  position: fixed;
  z-index: 100000;
}
.alert-console-header {
  align-items: center;
  background: #090d12;
  border-bottom: 1px solid #27313c;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding-bottom: 18px;
  position: relative;
  z-index: 10;
}
.alert-console-header > div:first-child { display: grid; gap: 5px; }
.alert-console-header > div:first-child > span {
  color: #ff4857;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .15em;
}
.alert-console-header h2 { font-size: clamp(22px, 2vw, 34px); margin: 0; }
.alert-console-header p { color: #8d99a7; font-size: 12px; margin: 0; }
.alert-console-summary { align-items: center; display: flex; gap: 9px; }
.alert-console-summary strong { color: #ff4857; font-size: 30px; }
.alert-console-summary span { color: #9ba7b4; font-size: 12px; }
.alert-console-summary button {
  align-items: center;
  background: #171d24;
  border: 1px solid #39434e;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  height: 42px;
  justify-content: center;
  margin-left: 12px;
  width: 42px;
}
.alert-console-summary button:hover { background: #252d36; border-color: #697786; }
.alert-console-summary svg { height: 19px; width: 19px; }
.alert-console-table-wrap {
  isolation: isolate;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-top: 0;
  position: relative;
}
.alert-console-table { border-collapse: separate; border-spacing: 0; min-width: 1200px; width: 100%; }
.alert-console-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}
.alert-console-table th {
  background: #151b22;
  border-bottom: 1px solid #36414c;
  color: #8996a5;
  font-size: 10px;
  letter-spacing: .07em;
  padding: 12px 14px;
  position: static;
  text-align: left;
  text-transform: uppercase;
}
.alert-console-table td {
  border-bottom: 1px solid #222b34;
  color: #d5dce4;
  font-size: 12px;
  padding: 13px 14px;
  white-space: nowrap;
}
.alert-console-table tr.late td:first-child { box-shadow: inset 4px 0 #ef3340; }
.alert-console-table tr.risk td:first-child { box-shadow: inset 4px 0 #f0bd3f; }
.alert-console-table tbody tr:hover td { background: #121820; }
html[data-theme="light"] .alert-console-screen { background: #f3f6fa; color: #17212b; }
html[data-theme="light"] .alert-console-header { background: #f3f6fa; border-color: #d2dce6; }
html[data-theme="light"] .alert-console-header p { color: #647386; }
html[data-theme="light"] .alert-console-summary button { background: #ffffff; border-color: #cbd6e1; color: #17212b; }
html[data-theme="light"] .alert-console-table th { background: #e8eef5; border-color: #cbd6e1; color: #536274; }
html[data-theme="light"] .alert-console-table td { border-color: #dce4ec; color: #334155; }
html[data-theme="light"] .alert-console-table tbody tr:hover td { background: #ffffff; }

@media (max-width: 700px) {
  .alert-console-header { align-items: flex-start; flex-direction: column; }
  .alert-console-summary { width: 100%; }
  .alert-console-summary button { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .monitor-tv-siren { animation: none; }
}


/* Modo TV interativo: drill-down sem sair do painel. */
.monitor-tv-clickable {
  cursor: pointer;
  outline: none;
  position: relative;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, filter .16s ease;
}
.monitor-tv-clickable:hover,
.monitor-tv-clickable:focus-visible {
  filter: brightness(1.06);
  transform: translateY(-2px);
}
.monitor-tv-clickable:focus-visible {
  box-shadow: 0 0 0 3px rgba(227, 38, 54, .28), 0 10px 26px rgba(0, 0, 0, .18) !important;
}
.monitor-tv-click-hint {
  color: #748292;
  font-size: clamp(6px, .43vw, 8px);
  font-weight: 800;
  letter-spacing: .08em;
  bottom: 6px;
  opacity: 0;
  position: absolute;
  right: 9px;
  text-transform: uppercase;
  transition: opacity .16s ease;
}
.monitor-tv-kpis article:hover .monitor-tv-click-hint,
.monitor-tv-kpis article:focus-visible .monitor-tv-click-hint { opacity: 1; }
.monitor-tv-technicians article.monitor-tv-clickable {
  grid-template-columns: 37px minmax(0, 1fr) 18px;
}
.monitor-tv-card-open {
  color: #718091;
  display: grid;
  place-items: center;
}
.monitor-tv-card-open svg { height: 15px; width: 15px; }
.monitor-tv-focus-card.monitor-tv-clickable:hover { border-color: rgba(255, 255, 255, .42); }
.monitor-tv-ticker.monitor-tv-clickable { border-radius: 6px; padding: 3px 8px; }

.monitor-tv-drilldown {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(4, 7, 10, .72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: clamp(14px, 2vw, 34px);
  position: absolute;
  z-index: 80;
}
.monitor-tv-drill-panel {
  background: linear-gradient(150deg, rgba(18, 24, 31, .99), rgba(8, 12, 17, .99));
  border: 1px solid #35414e;
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: min(88vh, 900px);
  max-width: 1400px;
  overflow: hidden;
  width: min(94vw, 1400px);
}
.monitor-tv-drill-panel.detail {
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-width: 1040px;
}
.monitor-tv-drill-panel > header {
  align-items: center;
  border-bottom: 1px solid #29333d;
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
}
.monitor-tv-drill-panel > header > div { display: grid; gap: 3px; }
.monitor-tv-drill-panel > header span {
  color: #ff5c69;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .13em;
}
.monitor-tv-drill-panel > header h2 { font-size: clamp(18px, 1.5vw, 28px); margin: 0; }
.monitor-tv-drill-panel > header small { color: #8794a3; }
.monitor-tv-drill-panel > header button {
  align-items: center;
  background: #171d25;
  border: 1px solid #35414e;
  border-radius: 8px;
  color: #d8e0e8;
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}
.monitor-tv-drill-panel > header button svg { height: 16px; width: 16px; }

.monitor-tv-drill-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 16px;
}
.monitor-tv-drill-toolbar label {
  align-items: center;
  background: #0d1218;
  border: 1px solid #2d3742;
  border-radius: 9px;
  display: flex;
  flex: 1;
  gap: 8px;
  max-width: 620px;
  padding: 0 12px;
}
.monitor-tv-drill-toolbar label svg { color: #7f8b98; height: 15px; width: 15px; }
.monitor-tv-drill-toolbar input {
  background: transparent;
  border: 0;
  color: #eef3f7;
  font: inherit;
  min-width: 0;
  outline: none;
  padding: 11px 0;
  width: 100%;
}
.monitor-tv-drill-toolbar > strong {
  color: #98a5b3;
  font-size: 11px;
}
.monitor-tv-drill-list {
  display: grid;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}
.monitor-tv-drill-row {
  align-items: center;
  background: #11171e;
  border: 1px solid #27323d;
  border-radius: 9px;
  color: #eaf0f5;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(200px, 1.5fr) minmax(100px, .8fr) minmax(160px, 1.1fr) minmax(95px, .7fr) minmax(95px, .7fr) minmax(100px, .75fr) 18px;
  padding: 11px 13px;
  text-align: left;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.monitor-tv-drill-row:hover,
.monitor-tv-drill-row:focus-visible {
  background: #171f28;
  border-color: #59697a;
  outline: none;
  transform: translateY(-1px);
}
.monitor-tv-drill-row > span { display: grid; gap: 2px; min-width: 0; }
.monitor-tv-drill-row small { color: #758394; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.monitor-tv-drill-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-tv-drill-row-main strong { color: #ff6672; font-size: 13px; }
.monitor-tv-drill-row-main small { color: #b3bec9; font-size: 10px; text-transform: none; }
.monitor-tv-drill-row > svg { color: #768494; height: 16px; width: 16px; }
.monitor-tv-drill-empty { color: #83909e; padding: 50px 20px; text-align: center; }

.monitor-tv-order-detail-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: auto;
  padding: 18px 20px;
}
.monitor-tv-order-detail-grid > span {
  background: #10161d;
  border: 1px solid #29343f;
  border-radius: 9px;
  display: grid;
  gap: 5px;
  min-height: 68px;
  padding: 12px;
}
.monitor-tv-order-detail-grid small {
  color: #778596;
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}
.monitor-tv-order-detail-grid strong {
  color: #eef3f7;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.monitor-tv-drill-panel > footer {
  align-items: center;
  border-top: 1px solid #29333d;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
}
.monitor-tv-drill-panel > footer > span {
  color: #788594;
  font-size: 10px;
  margin-right: auto;
}
.monitor-tv-drill-panel > footer button {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-size: 10px;
  font-weight: 850;
  gap: 7px;
  padding: 9px 12px;
}
.monitor-tv-drill-panel > footer button svg { height: 14px; width: 14px; }
.monitor-tv-drill-panel > footer button.secondary {
  background: #151b22;
  border: 1px solid #34404c;
  color: #d9e1e8;
}
.monitor-tv-drill-panel > footer button.primary {
  background: #d91f31;
  border: 1px solid #f04a59;
  color: #fff;
}
html[data-theme="light"] .monitor-tv-drilldown { background: rgba(226, 232, 238, .72); }
html[data-theme="light"] .monitor-tv-drill-panel {
  background: linear-gradient(150deg, #ffffff, #f4f7fa);
  border-color: #cbd6e0;
  box-shadow: 0 24px 70px rgba(31, 45, 61, .2);
  color: #17212b;
}
html[data-theme="light"] .monitor-tv-drill-panel > header,
html[data-theme="light"] .monitor-tv-drill-panel > footer { border-color: #d6e0e8; }
html[data-theme="light"] .monitor-tv-drill-panel > header button,
html[data-theme="light"] .monitor-tv-drill-toolbar label,
html[data-theme="light"] .monitor-tv-drill-row,
html[data-theme="light"] .monitor-tv-order-detail-grid > span {
  background: #f7f9fc;
  border-color: #d5dfe8;
  color: #1f2d3c;
}
html[data-theme="light"] .monitor-tv-drill-toolbar input { color: #17212b; }
html[data-theme="light"] .monitor-tv-drill-row:hover { background: #eef3f7; border-color: #9eacba; }
html[data-theme="light"] .monitor-tv-order-detail-grid strong { color: #253345; }

@media (max-width: 1100px) {
  .monitor-tv-drilldown { padding: 10px; }
  .monitor-tv-drill-panel { width: 98vw; }
  .monitor-tv-drill-row {
    grid-template-columns: minmax(180px, 1.4fr) minmax(90px, .7fr) minmax(140px, 1fr) minmax(90px, .7fr) 18px;
  }
  .monitor-tv-drill-row > span:nth-child(4),
  .monitor-tv-drill-row > span:nth-child(6) { display: none; }
  .monitor-tv-order-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .monitor-tv-drill-panel > header { padding: 13px; }
  .monitor-tv-drill-toolbar { align-items: stretch; flex-direction: column; padding: 10px 12px; }
  .monitor-tv-drill-toolbar label { max-width: none; }
  .monitor-tv-drill-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(80px, .7fr) 16px; }
  .monitor-tv-drill-row > span:nth-child(2),
  .monitor-tv-drill-row > span:nth-child(4),
  .monitor-tv-drill-row > span:nth-child(6) { display: none; }
  .monitor-tv-order-detail-grid { grid-template-columns: 1fr; padding: 12px; }
  .monitor-tv-drill-panel > footer { flex-wrap: wrap; }
  .monitor-tv-drill-panel > footer > span { flex-basis: 100%; }
}

/* TEC1 em duas fases: fim da janela -> tolerancia operacional -> TEC1. */
.monitor-tv-countdown-caption {
  color: #82909f;
  font-size: clamp(7px, .5vw, 9px);
  font-weight: 900;
  letter-spacing: .1em;
  margin-top: 9px;
  text-transform: uppercase;
}
.monitor-tv-focus-card.phase-grace {
  border-color: #ff8a24;
  box-shadow: inset 0 3px 0 #ff8a24, 0 0 25px rgba(255, 138, 36, .15);
}
.monitor-tv-focus-card.phase-late {
  border-color: #ff2f40;
  box-shadow: inset 0 3px 0 #ff2f40, 0 0 30px rgba(255, 47, 64, .24);
}
.monitor-tv-urgent.window-warning {
  background: rgba(255, 196, 0, .12);
  border-color: rgba(255, 196, 0, .72);
}
.monitor-tv-urgent.window-warning strong { color: #ffd84d; }
.monitor-tv-urgent.window-warning .monitor-tv-siren {
  animation: none;
  background: #d99d00;
  box-shadow: 0 0 18px rgba(255, 196, 0, .32);
}

.monitor-tv-urgent.window-breached {
  background: linear-gradient(90deg, rgba(255, 138, 36, .17), rgba(228, 37, 51, .2));
  border-color: #ff8a24;
}
.monitor-tv-urgent.window-breached strong { color: #ffab5c; }
.monitor-tv-urgent.tec1-late {
  background: rgba(228, 37, 51, .2);
  border-color: #ff3545;
}
.monitor-tv-urgent.tec1-late strong { color: #ff5361; }
html[data-theme="light"] .monitor-tv-countdown-caption { color: #68788a; }
html[data-theme="light"] .monitor-tv-urgent.window-warning {
  background: #fff8d9;
  border-color: #d7aa00;
}
html[data-theme="light"] .monitor-tv-urgent.window-warning strong { color: #8a6700; }
html[data-theme="light"] .monitor-tv-urgent.window-breached {
  background: #fff2e7;
  border-color: #ed7814;
}
html[data-theme="light"] .monitor-tv-urgent.window-breached strong { color: #b34d00; }
html[data-theme="light"] .monitor-tv-urgent.tec1-late {
  background: #fff0f2;
  border-color: #e32636;
}
html[data-theme="light"] .monitor-tv-urgent.tec1-late strong { color: #bd1827; }


/* Modo TV: navegacao manual entre avisos prioritarios. */
.monitor-tv-focus-nav { align-items: center; display: flex; gap: 7px; }
.monitor-tv-focus-nav > strong { background: rgba(227, 38, 54, .1); border: 1px solid rgba(227, 38, 54, .32); border-radius: 999px; color: #ff6975; font-size: clamp(8px, .58vw, 11px); padding: 6px 10px; text-transform: uppercase; white-space: nowrap; }
.monitor-tv-focus-nav button { align-items: center; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #dce4ec; cursor: pointer; display: inline-flex; font-size: clamp(8px, .58vw, 11px); font-weight: 850; gap: 4px; padding: 6px 9px; text-transform: uppercase; transition: .16s ease; }
.monitor-tv-focus-nav button:hover:not(:disabled) { background: rgba(227,38,54,.18); border-color: rgba(227,38,54,.55); color: #fff; transform: translateY(-1px); }
.monitor-tv-focus-nav button:disabled { cursor: default; opacity: .3; }
.monitor-tv-focus-nav button svg { height: 13px; width: 13px; }
html[data-theme="light"] .monitor-tv-focus-nav > strong { background: #fff0f2; border-color: #efb6bd; color: #b91625; }
html[data-theme="light"] .monitor-tv-focus-nav button { background: #fff; border-color: #ccd4dd; color: #354254; }
@media (max-width: 980px) { .monitor-tv-focus-nav button span { display: none; } }
