/* =====================================================
   TENNANT OPERATIONS CENTER - STYLE.CSS OFICIAL LIMPO
   Versão: Dashboard v1.0
   Arquivo limpo, sem blocos duplicados
===================================================== */

:root {
    --bg: #071521;
    --primary: #0b2f4a;
    --secondary: #0a2940;
    --accent: #14a3d6;
    --text: #ffffff;
    --text-soft: #c7d4df;
    --muted: #9fb0bf;
    --border: rgba(20, 163, 214, 0.24);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.30);

    --theme-bg-1: #06111b;
    --theme-bg-2: #071521;
    --theme-card-1: #0b2f4a;
    --theme-card-2: #0a2940;
    --theme-line: #14a3d6;
    --theme-accent: #14a3d6;
    --theme-contrast: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(20, 163, 214, 0.12), transparent 32%),
        linear-gradient(90deg, #06111b 0%, #071521 45%, #091c2c 100%);
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: #071521;
}

body::-webkit-scrollbar-thumb {
    background: rgba(20, 163, 214, 0.45);
    border-radius: 20px;
}

/* =====================================================
   TEMAS
===================================================== */

body.theme-tennant {
    --theme-bg-1: #06111b;
    --theme-bg-2: #071521;
    --theme-card-1: #0b2f4a;
    --theme-card-2: #0a2940;
    --theme-line: #14a3d6;
    --theme-accent: #14a3d6;
    --theme-contrast: #ffffff;
}

body.theme-tennant .header-card::after {
    content: "Tennant";
}

body.theme-natal {
    --theme-bg-1: #06150f;
    --theme-bg-2: #0b2418;
    --theme-card-1: #0f3a28;
    --theme-card-2: #0b2c1e;
    --theme-line: #d62828;
    --theme-accent: #2ecc71;
    --theme-contrast: #ffffff;
}

body.theme-natal .header-card::after {
    content: "🎄 Natal";
}

body.theme-ano-novo {
    --theme-bg-1: #090d18;
    --theme-bg-2: #101820;
    --theme-card-1: #1b2f4d;
    --theme-card-2: #111c2e;
    --theme-line: #ffd700;
    --theme-accent: #ffd700;
    --theme-contrast: #ffffff;
}

body.theme-ano-novo .header-card::after {
    content: "✨ Ano Novo";
}

body.theme-outubro-rosa {
    --theme-bg-1: #17091a;
    --theme-bg-2: #251126;
    --theme-card-1: #3a163c;
    --theme-card-2: #28102d;
    --theme-line: #ff5bbd;
    --theme-accent: #ff5bbd;
    --theme-contrast: #ffffff;
}

body.theme-outubro-rosa .header-card::after {
    content: "🎀 Outubro Rosa";
}

body.theme-setembro-amarelo {
    --theme-bg-1: #151200;
    --theme-bg-2: #231f05;
    --theme-card-1: #3a3108;
    --theme-card-2: #2a2304;
    --theme-line: #ffd100;
    --theme-accent: #ffd100;
    --theme-contrast: #ffffff;
}

body.theme-setembro-amarelo .header-card::after {
    content: "💛 Setembro Amarelo";
}

body.theme-criancas {
    --theme-bg-1: #061827;
    --theme-bg-2: #0b2438;
    --theme-card-1: #0d4b73;
    --theme-card-2: #083a59;
    --theme-line: #ff6b35;
    --theme-accent: #ffd100;
    --theme-contrast: #ffffff;
}

body.theme-criancas .header-card::after {
    content: "🎈 Dia das Crianças";
}

body.theme-seguranca {
    --theme-bg-1: #03130b;
    --theme-bg-2: #082015;
    --theme-card-1: #0b3a25;
    --theme-card-2: #062618;
    --theme-line: #00c853;
    --theme-accent: #00e676;
    --theme-contrast: #ffffff;
}

body.theme-seguranca .header-card::after {
    content: "🦺 Segurança";
}

body.theme-inventario {
    --theme-bg-1: #111820;
    --theme-bg-2: #1b252d;
    --theme-card-1: #263238;
    --theme-card-2: #172126;
    --theme-line: #b0bec5;
    --theme-accent: #eceff1;
    --theme-contrast: #ffffff;
}

body.theme-inventario .header-card::after {
    content: "📋 Inventário";
}

body.theme-black-friday {
    --theme-bg-1: #000000;
    --theme-bg-2: #090909;
    --theme-card-1: #171717;
    --theme-card-2: #050505;
    --theme-line: #ffb300;
    --theme-accent: #ffca28;
    --theme-contrast: #ffffff;
}

body.theme-black-friday .header-card::after {
    content: "🛒 Black Friday";
}

body.theme-brasil {
    --theme-bg-1: #04150b;
    --theme-bg-2: #082d17;
    --theme-card-1: #064d24;
    --theme-card-2: #043319;
    --theme-line: #ffd100;
    --theme-accent: #ffd100;
    --theme-contrast: #ffffff;
}

body.theme-brasil .header-card::after {
    content: "🇧🇷 Brasil";
}

body[class*="theme-"] {
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--theme-line) 18%, transparent), transparent 32%),
        linear-gradient(90deg, var(--theme-bg-1) 0%, var(--theme-bg-2) 45%, #071521 100%) !important;
}

body[class*="theme-"] .header-card,
body[class*="theme-"] .kpi-card,
body[class*="theme-"] .summary-card,
body[class*="theme-"] .chart-box,
body[class*="theme-"] .status-panel,
body[class*="theme-"] .filters,
body[class*="theme-"] .alert-item,
body[class*="theme-"] .order-card,
body[class*="theme-"] .menu-box {
    background: linear-gradient(180deg, var(--theme-card-1) 0%, var(--theme-card-2) 100%) !important;
    border-color: color-mix(in srgb, var(--theme-line) 45%, transparent) !important;
}

body[class*="theme-"] .sidebar {
    background: linear-gradient(180deg, var(--theme-card-1) 0%, var(--theme-bg-1) 100%) !important;
    border-right-color: color-mix(in srgb, var(--theme-line) 35%, transparent) !important;
}

body[class*="theme-"] .kpi-card strong,
body[class*="theme-"] .month-kpi strong,
body[class*="theme-"] .alert-item strong,
body[class*="theme-"] .customer-name,
body[class*="theme-"] .tempo-aberto strong,
body[class*="theme-"] #lastUpdate,
body[class*="theme-"] .summary-top strong,
body[class*="theme-"] .system-version {
    color: var(--theme-accent) !important;
}

body[class*="theme-"] .kpi-selected {
    border-color: var(--theme-line) !important;
    box-shadow: 0 0 18px color-mix(in srgb, var(--theme-line) 45%, transparent) !important;
}

body[class*="theme-"] .card-status {
    background: linear-gradient(90deg, var(--theme-line) 0%, color-mix(in srgb, var(--theme-line) 75%, #000000) 100%) !important;
}

body[class*="theme-"] .priority-button {
    background: color-mix(in srgb, var(--theme-line) 24%, transparent) !important;
    border-color: color-mix(in srgb, var(--theme-line) 55%, transparent) !important;
}

body[class*="theme-"] .summary-bar-fill,
body[class*="theme-"] .chart-bar,
body[class*="theme-"] .month-bar-fill.incluidos {
    background: var(--theme-line) !important;
}

body[class*="theme-"] .month-bar-fill.finalizados {
    background: #7a8088 !important;
}

body[class*="theme-"] #exportButton {
    background: linear-gradient(90deg, var(--theme-line) 0%, color-mix(in srgb, var(--theme-line) 75%, #000000) 100%) !important;
}

body[class*="theme-"] .header-card {
    position: relative !important;
}

body[class*="theme-"] .header-card::after {
    position: absolute;
    top: 16px;
    right: 22px;
    padding: 7px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-line) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--theme-line) 38%, transparent);
    color: var(--theme-contrast);
    font-size: 13px;
    font-weight: 900;
}

/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
    width: 220px;
    min-height: 100vh;
    background: linear-gradient(180deg, #08233a 0%, #071a2c 100%);
    border-right: 1px solid var(--border);
    padding: 20px;
    position: fixed;
    left: 0;
    top: 0;
}

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand img {
    max-width: 120px;
    background: white;
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.brand h2 {
    margin: 0;
    color: white;
    font-size: 22px;
}

.brand p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.menu-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(20, 163, 214, 0.20);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
}

.menu-box label {
    display: block;
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 8px;
}

.menu-box select {
    width: 100%;
    background: rgba(255, 255, 255, 0.10);
    color: white;
    border: 1px solid rgba(20, 163, 214, 0.28);
    border-radius: 10px;
    padding: 9px;
}

.menu-box .small {
    margin: 0 0 6px;
    color: var(--text-soft);
    font-size: 12px;
}

.menu-box strong {
    color: var(--accent);
    font-size: 16px;
}

/* =====================================================
   MAIN / HEADER
===================================================== */

.main {
    margin-left: 220px;
    padding: 14px;
}

.header-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(180deg, #0b2f4a 0%, #0a2940 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 24px;
    box-shadow: var(--shadow-soft);
}

.header-logo-box {
    width: 120px;
    min-width: 120px;
    height: 70px;
    padding: 8px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo {
    width: 95px;
    height: 45px;
    object-fit: contain;
    display: block;
}

.header-card h1 {
    margin: 0 0 6px;
    font-size: 34px;
    color: white;
    letter-spacing: 0.2px;
}

.header-card p {
    margin: 0;
    color: var(--text-soft);
}

#lastUpdate {
    display: inline-block;
    margin-top: 10px;
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
}

.system-version {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
}

/* =====================================================
   KPIs
===================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin: 14px 0;
}

.kpi-card {
    background: rgba(10, 45, 74, 0.92);
    border: 1px solid rgba(0, 191, 255, 0.35);
    border-radius: 16px;
    padding: 14px 12px;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 12px rgba(0, 180, 255, 0.08);
    transition: 0.2s ease;
    text-align: center;
    cursor: pointer;
}

.kpi-card span {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f4f8fb;
    line-height: 1.15;
    margin-bottom: 2px;
}

.kpi-card small {
    font-size: 0.95rem;
    font-weight: 500;
    color: #b8d7ea;
    line-height: 1.1;
    margin-bottom: 8px;
}

.kpi-card strong {
    font-size: 2.7rem;
    font-weight: 800;
    color: #19b5f1;
    line-height: 1;
    letter-spacing: 0.5px;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(0, 191, 255, 0.16);
}

.kpi-selected,
.kpi-card:first-child {
    border-color: #1ec8ff;
    box-shadow:
        0 0 10px rgba(0, 200, 255, 0.22),
        0 0 20px rgba(0, 200, 255, 0.10);
}

/* =====================================================
   ALERTAS
===================================================== */

.operational-alerts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0 0 14px;
}

.alert-item {
    background: linear-gradient(180deg, #0b2f4a 0%, #0a2940 100%);
    border: 1px solid rgba(20, 163, 214, 0.28);
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
}

.alert-item span {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 800;
}

.alert-item strong {
    color: var(--accent);
    font-size: 30px;
    font-weight: 900;
}

.alert-item.alerta-ok {
    border-color: rgba(20, 163, 214, 0.28) !important;
    box-shadow: var(--shadow-soft) !important;
}

.alert-item.alerta-ok strong {
    color: var(--accent) !important;
    animation: none !important;
}

.alert-item.alerta-prioridade-ativa {
    border-color: rgba(20, 163, 214, 0.70) !important;
    box-shadow:
        0 0 0 1px rgba(20, 163, 214, 0.35),
        0 0 18px rgba(20, 163, 214, 0.35) !important;
}

.alert-item.alerta-prioridade-ativa strong {
    animation: alertaPrioridadePulse 1.4s infinite ease-in-out !important;
}

.alert-item.alerta-atencao {
    border-color: rgba(255, 209, 0, 0.75) !important;
    box-shadow:
        0 0 0 1px rgba(255, 209, 0, 0.30),
        0 0 18px rgba(255, 209, 0, 0.24) !important;
}

.alert-item.alerta-atencao strong {
    color: #ffd100 !important;
    animation: alertaAtencaoPulse 1.4s infinite ease-in-out !important;
}

.alert-item.alerta-critico {
    border-color: rgba(255, 255, 255, 0.85) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 0 22px rgba(255, 255, 255, 0.38) !important;
}

.alert-item.alerta-critico strong {
    color: #ffffff !important;
    animation: alertaCriticoPulse 1s infinite ease-in-out !important;
}

@keyframes alertaPrioridadePulse {
    0%, 100% {
        text-shadow: 0 0 0 rgba(20, 163, 214, 0);
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 12px rgba(20, 163, 214, 0.80);
        transform: scale(1.08);
    }
}

@keyframes alertaAtencaoPulse {
    0%, 100% {
        text-shadow: 0 0 0 rgba(255, 209, 0, 0);
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 12px rgba(255, 209, 0, 0.85);
        transform: scale(1.08);
    }
}

@keyframes alertaCriticoPulse {
    0%, 100% {
        text-shadow: 0 0 0 rgba(255, 255, 255, 0);
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 16px rgba(255, 255, 255, 0.95);
        transform: scale(1.12);
    }
}

/* =====================================================
   FILTROS
===================================================== */

.filters {
    display: grid;
    grid-template-columns: 1fr 220px 200px;
    gap: 12px;
    padding: 12px;
    margin: 14px 0;
    background: linear-gradient(180deg, #0b2f4a 0%, #0a2940 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.filters input,
.filters select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(20, 163, 214, 0.25);
    color: white;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}

.filters input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.filters select option {
    color: #111;
}

#exportButton {
    background: linear-gradient(90deg, #14a3d6 0%, #108ab8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* =====================================================
   RESUMO / GRÁFICOS
===================================================== */

.tv-summary {
    display: grid;
    grid-template-columns: 1fr;
    margin: 14px 0;
}

.summary-card,
.chart-box,
.status-panel {
    background: linear-gradient(180deg, #0b2f4a 0%, #0a2940 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.summary-card {
    padding: 16px 20px;
}

.summary-card h3,
.chart-box h3 {
    margin: 0 0 14px;
    color: white;
    font-size: 18px;
}

#statusSummary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.summary-top {
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 13px;
    margin-bottom: 8px;
}

.summary-top span {
    font-weight: 800;
}

.summary-top strong {
    color: var(--accent);
    font-weight: 900;
}

.summary-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.summary-bar-fill {
    height: 100%;
    border-radius: 999px;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 14px 0 18px;
    align-items: stretch;
}

.chart-box {
    padding: 18px 20px;
    min-height: 300px;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-box h3 {
    font-size: 17px;
    margin-bottom: 10px;
}

.mini-chart,
#graficoStatus {
    flex: 1;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 18px;
    padding: 0 10px 18px;
}

.chart-column {
    height: 220px;
    min-height: 220px;
    flex: 1;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.chart-bar {
    width: 46px;
    min-height: 8px;
    border-radius: 12px 12px 5px 5px;
    background: var(--accent) !important;
    margin-bottom: 8px;
}

.chart-value {
    color: white;
    font-weight: 900;
    font-size: 16px;
    margin-bottom: 4px;
}

.chart-label {
    color: var(--text-soft);
    font-size: 12px;
    text-align: center;
    line-height: 1.1;
}

/* =====================================================
   MOVIMENTAÇÃO DO MÊS
===================================================== */

.month-movement-box {
    height: 300px;
    min-height: 300px;
    max-height: 300px;
    overflow: hidden;
}

.month-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 4px 0 8px;
}

.month-kpi {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(20, 163, 214, 0.20);
    border-radius: 12px;
    padding: 7px 10px;
    min-height: 58px;
}

.month-kpi span {
    display: block;
    color: var(--text-soft);
    font-size: 11px;
    margin-bottom: 3px;
}

.month-kpi strong {
    color: var(--accent);
    font-size: 23px;
    font-weight: 900;
}

.month-chart,
#graficoMovimentoMes {
    height: 170px;
    max-height: 170px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.month-row {
    min-height: 62px;
    height: 62px;
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 8px;
    align-items: center;
}

.month-row-hoje {
    background: rgba(20, 163, 214, 0.10);
    border: 1px solid rgba(20, 163, 214, 0.28);
    border-radius: 10px;
    padding: 4px 6px;
}

.month-date {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    font-size: 11px;
    min-width: 76px;
    color: var(--text-soft);
    font-weight: 700;
    white-space: nowrap;
}

.today-badge {
    display: inline-block;
    width: fit-content;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(20, 163, 214, 0.22);
    border: 1px solid rgba(20, 163, 214, 0.45);
    color: #14a3d6;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: 0.4px;
}

.month-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.month-bar-group {
    display: grid;
    grid-template-columns: 72px 1fr 34px;
    gap: 6px;
    align-items: center;
}

.month-bar-label {
    font-size: 10px;
    color: #d9e6f2;
}

.month-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    overflow: hidden;
}

.month-bar-fill {
    height: 100%;
    border-radius: 20px;
    background: var(--accent) !important;
}

.month-bar-fill.incluidos {
    background: #14a3d6 !important;
}

.month-bar-fill.finalizados {
    background: #7a8088 !important;
}

.month-bar-value {
    font-size: 10px;
    color: white;
    font-weight: 800;
    text-align: right;
}

.processing-info {
    margin: -8px 0 14px 4px;
    font-size: 12px;
    color: var(--text-soft);
}

/* =====================================================
   STATUS / CARDS
===================================================== */

.status-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

.status-panel div {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 12px;
}

.status-label {
    display: block;
    color: var(--text-soft);
    font-size: 11px;
    margin-bottom: 5px;
}

.status-panel strong {
    color: white;
    font-size: 16px;
}

.section-title {
    margin: 10px 0 12px;
    font-size: 24px;
    color: white;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: stretch;
}

.order-card {
    background: linear-gradient(180deg, #0b3760 0%, #0a2f52 100%);
    border: 1px solid rgba(20, 163, 214, 0.28);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    position: relative;
    min-height: 230px;
    padding: 0 14px 14px;
    transition: 0.2s ease;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.card-status {
    margin: 0 -14px 14px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.4px;
    color: white;
    background: linear-gradient(90deg, #14a3d6 0%, #0f8abb 100%) !important;
}

.priority-button {
    position: absolute;
    top: 54px;
    right: 14px;
    width: 42px;
    height: 30px;
    border-radius: 12px;
    border: 1px solid rgba(20, 163, 214, 0.40);
    background: rgba(20, 163, 214, 0.18);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s ease;
}

.order-card h3 {
    font-size: 20px;
    margin: 4px 0 10px;
    color: white;
    padding-right: 48px;
}

.customer-name {
    color: var(--accent);
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    line-height: 1.25;
    padding-right: 8px;
}

.tempo-aberto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(20, 163, 214, 0.24);
    font-size: 12px;
    color: white;
    font-weight: 800;
}

.tempo-aberto.tempo-normal {
    border-left: 4px solid #14a3d6 !important;
    background: rgba(20, 163, 214, 0.16) !important;
}

.tempo-aberto.tempo-normal strong {
    color: #14a3d6 !important;
}

.tempo-aberto.tempo-alerta {
    border-left: 4px solid #ffd100 !important;
    background: rgba(255, 209, 0, 0.16) !important;
    box-shadow: 0 0 10px rgba(255, 209, 0, 0.18) !important;
}

.tempo-aberto.tempo-alerta strong {
    color: #ffd100 !important;
}

.tempo-aberto.tempo-critico {
    border-left: 4px solid #ff6b35 !important;
    background: rgba(255, 107, 53, 0.18) !important;
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.28) !important;
    animation: tempoCriticoPulse 1.4s infinite ease-in-out !important;
}

.tempo-aberto.tempo-critico strong {
    color: #ffb199 !important;
}

@keyframes tempoCriticoPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 107, 53, 0.18);
    }

    50% {
        box-shadow: 0 0 18px rgba(255, 107, 53, 0.45);
    }
}

.card-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.card-info-grid div {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(20, 163, 214, 0.14);
    border-radius: 10px;
    padding: 8px 10px;
    min-height: 48px;
}

.card-info-grid span {
    display: block;
    color: var(--text-soft);
    font-size: 10px;
    margin-bottom: 4px;
}

.card-info-grid strong {
    color: white;
    font-size: 13px;
    line-height: 1.2;
    word-break: break-word;
}

.order-card.priority-card {
    border: 2px solid var(--accent) !important;
    box-shadow:
        0 0 0 1px rgba(20, 163, 214, 0.42),
        0 0 18px rgba(20, 163, 214, 0.34),
        0 0 35px rgba(20, 163, 214, 0.18) !important;
    animation: pulseTennant 1.5s infinite ease-in-out;
    z-index: 1;
}

.order-card.priority-card .card-status {
    background: linear-gradient(90deg, #14a3d6 0%, #0e8fbd 100%) !important;
    color: white !important;
}

@keyframes pulseTennant {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
    }
}

.page-indicator {
    display: inline-block;
    margin: 0 0 10px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(20, 163, 214, 0.16);
    border: 1px solid rgba(20, 163, 214, 0.28);
    color: white;
    font-size: 12px;
    font-weight: 800;
}

.empty-state {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    color: var(--text-soft);
    text-align: center;
    font-weight: 700;
}

.bottom-grid {
    display: none !important;
}

/* =====================================================
   MODO TV OFICIAL
===================================================== */

body.tv-mode {
    overflow: auto !important;
}

body.tv-mode .sidebar,
body.tv-mode .filters,
body.tv-mode .status-panel,
body.tv-mode #exportButton,
body.tv-mode #quickFilter,
body.tv-mode #searchInput {
    display: none !important;
}

body.tv-mode .main {
    display: grid !important;
    grid-template-columns: 1.45fr 1fr !important;
    gap: 10px !important;
    margin-left: 0 !important;
    padding: 8px !important;
    transform: none !important;
    width: auto !important;
    min-height: auto !important;
}

body.tv-mode .header-card,
body.tv-mode .kpi-grid,
body.tv-mode .operational-alerts {
    grid-column: 1 / -1 !important;
}

body.tv-mode .header-card {
    min-height: 100px;
    padding: 16px 26px;
    margin-bottom: 12px;
}

body.tv-mode .header-card h1 {
    font-size: 36px;
}

body.tv-mode .system-version {
    font-size: 11px !important;
}

body.tv-mode .kpi-grid {
    gap: 12px !important;
    margin-top: 12px !important;
    margin-bottom: 12px !important;
}

body.tv-mode .kpi-card {
    min-height: 98px !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
}

body.tv-mode .kpi-card span {
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
}

body.tv-mode .kpi-card small {
    font-size: 12px !important;
    margin-top: 3px !important;
    margin-bottom: 8px !important;
}

body.tv-mode .kpi-card strong {
    font-size: 34px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
}

body.tv-mode .operational-alerts {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
}

body.tv-mode .alert-item {
    min-height: 58px !important;
    padding: 10px 14px !important;
}

body.tv-mode .alert-item span {
    font-size: 13px !important;
}

body.tv-mode .alert-item strong {
    font-size: 24px !important;
}

body.tv-mode .main > section:last-of-type {
    grid-column: 1 / 2 !important;
    grid-row: 4 / span 3 !important;
}

body.tv-mode .section-title {
    font-size: 18px !important;
    margin: 0 0 6px !important;
}

body.tv-mode #pageIndicator {
    font-size: 11px !important;
    padding: 4px 9px !important;
    margin-bottom: 8px !important;
}

body.tv-mode .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: start !important;
}

body.tv-mode .order-card {
    height: 205px !important;
    min-height: 205px !important;
    max-height: 205px !important;
    padding: 0 10px 10px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

body.tv-mode .card-status {
    margin: 0 -10px 8px !important;
    padding: 6px 10px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center !important;
}

body.tv-mode .order-card h3 {
    font-size: 16px !important;
    line-height: 1.15 !important;
    margin: 4px 0 6px !important;
    padding-right: 36px !important;
    font-weight: 900 !important;
}

body.tv-mode .customer-name {
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    margin-bottom: 8px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

body.tv-mode .tempo-aberto {
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 5px 8px !important;
    margin: 0 0 8px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    max-width: 165px !important;
}

body.tv-mode .tempo-aberto strong {
    font-size: 12px !important;
    font-weight: 900 !important;
}

body.tv-mode .card-info-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-top: auto !important;
}

body.tv-mode .card-info-grid div {
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 6px 8px !important;
    border-radius: 9px !important;
    overflow: hidden !important;
}

body.tv-mode .card-info-grid span {
    font-size: 8px !important;
    margin-bottom: 3px !important;
}

body.tv-mode .card-info-grid strong {
    font-size: 12px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.tv-mode .priority-button {
    top: 39px !important;
    right: 10px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
}

body.tv-mode .order-card.priority-card {
    border: 2px solid #ffd100 !important;
    box-shadow:
        0 0 0 1px rgba(255, 209, 0, 0.45),
        0 0 18px rgba(255, 209, 0, 0.35),
        0 0 35px rgba(255, 209, 0, 0.18) !important;
    animation: prioridadeFixaTV 1.4s infinite ease-in-out !important;
}

body.tv-mode .order-card.priority-card .card-status {
    background: linear-gradient(90deg, #ffd100 0%, #c99700 100%) !important;
    color: #071521 !important;
    font-weight: 950 !important;
}

body.tv-mode .order-card.priority-card .customer-name {
    color: #ffd100 !important;
}

@keyframes prioridadeFixaTV {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(255, 209, 0, 0.30),
            0 0 10px rgba(255, 209, 0, 0.22),
            0 0 18px rgba(255, 209, 0, 0.12);
    }

    50% {
        box-shadow:
            0 0 0 1px rgba(255, 209, 0, 0.70),
            0 0 20px rgba(255, 209, 0, 0.55),
            0 0 38px rgba(255, 209, 0, 0.28);
    }
}

body.tv-mode .tv-summary {
    grid-column: 2 / 3 !important;
    grid-row: 4 !important;
    margin: 0 !important;
}

body.tv-mode .dashboard-charts {
    grid-column: 2 / 3 !important;
    grid-row: 5 / span 2 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin: 0 !important;
}

body.tv-mode .summary-card {
    height: 165px !important;
    min-height: 165px !important;
    max-height: 165px !important;
    padding: 10px 12px !important;
    overflow: hidden !important;
}

body.tv-mode .summary-card h3 {
    font-size: 13px !important;
    margin: 0 0 8px !important;
    line-height: 1.1 !important;
}

body.tv-mode #statusSummary {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
}

body.tv-mode .summary-row {
    margin: 0 !important;
}

body.tv-mode .summary-top {
    font-size: 10px !important;
    margin-bottom: 3px !important;
    line-height: 1 !important;
}

body.tv-mode .summary-bar-bg {
    height: 7px !important;
    border-radius: 999px !important;
}

body.tv-mode .dashboard-charts .chart-box:first-child {
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    padding: 10px 12px !important;
    overflow: hidden !important;
}

body.tv-mode #graficoStatus {
    height: 165px !important;
    min-height: 165px !important;
    padding-bottom: 8px !important;
}

body.tv-mode #graficoStatus .chart-column {
    height: 165px !important;
    min-height: 165px !important;
}

body.tv-mode #graficoStatus .chart-bar {
    width: 34px !important;
}

body.tv-mode #graficoStatus .chart-value {
    font-size: 12px !important;
}

body.tv-mode #graficoStatus .chart-label {
    font-size: 10px !important;
}

body.tv-mode .month-movement-box {
    height: 255px !important;
    min-height: 255px !important;
    max-height: 255px !important;
    padding: 10px 12px !important;
    overflow: hidden !important;
}

body.tv-mode .month-kpis {
    margin: 4px 0 10px !important;
    gap: 8px !important;
}

body.tv-mode .month-kpi {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding: 7px 9px !important;
}

body.tv-mode .month-kpi span {
    font-size: 9px !important;
    margin-bottom: 2px !important;
}

body.tv-mode .month-kpi strong {
    font-size: 20px !important;
}

body.tv-mode .month-chart,
body.tv-mode #graficoMovimentoMes {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

body.tv-mode .month-row {
    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
    grid-template-columns: 74px 1fr !important;
    gap: 8px !important;
}

body.tv-mode .month-row-hoje {
    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
    padding: 4px 6px !important;
    border-radius: 9px !important;
}

body.tv-mode .month-date {
    font-size: 9px !important;
    min-width: 70px !important;
}

body.tv-mode .today-badge {
    font-size: 7px !important;
    padding: 1px 5px !important;
    margin-top: 2px !important;
}

body.tv-mode .month-bars {
    gap: 5px !important;
}

body.tv-mode .month-bar-group {
    grid-template-columns: 64px 1fr 28px !important;
    gap: 5px !important;
}

body.tv-mode .month-bar-label,
body.tv-mode .month-bar-value {
    font-size: 8px !important;
}

body.tv-mode .month-bar-bg {
    height: 7px !important;
}

body.tv-mode .processing-info {
    display: none !important;
}

/* =====================================================
   RESPONSIVO
===================================================== */

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    #statusSummary {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .status-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .operational-alerts {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .kpi-grid,
    .cards-grid,
    #statusSummary,
    .status-panel,
    .operational-alerts {
        grid-template-columns: 1fr;
    }

    .header-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-card h1 {
        font-size: 26px;
    }
}

/* =====================================================
   AJUSTE FINO - CARDS MODO TV
===================================================== */

body.tv-mode .order-card {
    height: 190px !important;
    min-height: 190px !important;
    max-height: 190px !important;
    padding: 0 10px 9px 10px !important;
}

body.tv-mode .card-status {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 0 -10px 7px -10px !important;
    padding: 5px 10px !important;
}

body.tv-mode .order-card h3 {
    font-size: 15px !important;
    margin: 3px 0 6px 0 !important;
}

body.tv-mode .customer-name {
    font-size: 11px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    margin-bottom: 8px !important;
}

body.tv-mode .tempo-aberto {
    min-height: 28px !important;
    max-height: 28px !important;
    height: 28px !important;
    margin: 0 0 8px 0 !important;
    padding: 5px 8px !important;
    font-size: 10px !important;
}

body.tv-mode .tempo-aberto strong {
    font-size: 11px !important;
}

body.tv-mode .card-info-grid {
    margin-top: 0 !important;
    gap: 6px !important;
}

body.tv-mode .card-info-grid div {
    min-height: 36px !important;
    max-height: 36px !important;
    height: 36px !important;
    padding: 5px 8px !important;
}

body.tv-mode .card-info-grid span {
    font-size: 7px !important;
    margin-bottom: 2px !important;
}

body.tv-mode .card-info-grid strong {
    font-size: 11px !important;
}

body.tv-mode .priority-button {
    top: 36px !important;
}

/* =====================================================
   MODO TV-LITE V5 - PHILIPS
   Preenche a tela inteira e aumenta a leitura
===================================================== */

body.tv-lite-mode {
    background: #061521 !important;
    color: #ffffff !important;
    overflow: hidden !important;
}

body.tv-lite-mode .sidebar,
body.tv-lite-mode .filters,
body.tv-lite-mode .status-panel,
body.tv-lite-mode .processing-info,
body.tv-lite-mode #exportButton,
body.tv-lite-mode #quickFilter,
body.tv-lite-mode #searchInput,
body.tv-lite-mode .system-version {
    display: none !important;
}

/* Estrutura ocupa 100% da altura da TV */
body.tv-lite-mode .main {
    margin-left: 0 !important;
    padding: 8px !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;

    display: grid !important;
    grid-template-columns: 72% 28% !important;
    grid-template-rows: 9vh 12vh 8vh 1fr !important;
    gap: 7px !important;
}

/* Cabeçalho */
body.tv-lite-mode .header-card {
    grid-column: 1 / 3 !important;
    grid-row: 1 !important;

    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px 14px !important;

    display: flex !important;
    align-items: center !important;
    gap: 12px !important;

    background: #0b2f4a !important;
    border: 2px solid #14a3d6 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

body.tv-lite-mode .header-card::after {
    display: none !important;
}

body.tv-lite-mode .header-logo-box {
    width: 92px !important;
    min-width: 92px !important;
    height: 56px !important;
    padding: 5px !important;
    border-radius: 7px !important;
}

body.tv-lite-mode .header-logo {
    width: 80px !important;
    height: 42px !important;
}

body.tv-lite-mode .header-card h1 {
    margin: 0 0 4px !important;
    font-size: 30px !important;
    line-height: 1 !important;
}

body.tv-lite-mode .header-card p {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

body.tv-lite-mode #lastUpdate {
    display: block !important;
    margin-top: 5px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    color: #1cc8ff !important;
}

/* KPIs */
body.tv-lite-mode .kpi-grid {
    grid-column: 1 / 3 !important;
    grid-row: 2 !important;

    display: flex !important;
    gap: 7px !important;
    margin: 0 !important;
    height: 100% !important;
}

body.tv-lite-mode .kpi-card {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 7px 5px !important;

    background: #0b2f4a !important;
    border: 2px solid #14a3d6 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

body.tv-lite-mode .kpi-card span {
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
}

body.tv-lite-mode .kpi-card small {
    margin: 4px 0 !important;
    font-size: 10px !important;
    line-height: 1 !important;
}

body.tv-lite-mode .kpi-card strong {
    font-size: 34px !important;
    line-height: 1 !important;
    color: #1cc8ff !important;
}

/* Alertas */
body.tv-lite-mode .operational-alerts {
    grid-column: 1 / 3 !important;
    grid-row: 3 !important;

    display: flex !important;
    gap: 7px !important;
    margin: 0 !important;
    height: 100% !important;
}

body.tv-lite-mode .alert-item {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 8px 12px !important;

    background: #0b2f4a !important;
    border: 2px solid #14a3d6 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

body.tv-lite-mode .alert-item span {
    font-size: 13px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
}

body.tv-lite-mode .alert-item strong {
    font-size: 26px !important;
    line-height: 1 !important;
    color: #1cc8ff !important;
    animation: none !important;
}

/* Pedidos */
body.tv-lite-mode .orders-section {
    grid-column: 1 / 2 !important;
    grid-row: 4 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
}

body.tv-lite-mode .section-title {
    margin: 0 0 5px !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

body.tv-lite-mode #pageIndicator {
    display: inline-block !important;
    margin: 0 0 6px !important;
    padding: 4px 9px !important;
    border-radius: 14px !important;

    background: #0b2f4a !important;
    border: 1px solid #14a3d6 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    line-height: 1 !important;
}

/* 9 cards ocupando toda a altura restante */
body.tv-lite-mode .cards-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    height: calc(100% - 48px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

body.tv-lite-mode .order-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 9px 8px !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;

    background: #0b2f4a !important;
    border: 2px solid #14a3d6 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    animation: none !important;
    overflow: hidden !important;
}

body.tv-lite-mode .card-status {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    margin: 0 -9px 6px !important;
    padding: 6px 9px !important;

    display: flex !important;
    align-items: center !important;

    background: #159cca !important;
    color: #ffffff !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
}

body.tv-lite-mode .order-card h3 {
    margin: 2px 0 5px !important;
    padding-right: 34px !important;
    font-size: 17px !important;
    line-height: 1 !important;
}

body.tv-lite-mode .customer-name {
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    margin: 0 0 6px !important;
    padding: 0 !important;

    display: block !important;
    color: #1cc8ff !important;
    font-size: 13px !important;
    line-height: 22px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.tv-lite-mode .tempo-aberto {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    max-width: 190px !important;
    margin: 0 0 6px !important;
    padding: 7px 9px !important;

    background: #123f63 !important;
    border: 1px solid #235c82 !important;
    border-left: 4px solid #ffd100 !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    animation: none !important;

    color: #ffffff !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

body.tv-lite-mode .tempo-aberto strong {
    color: #ffd100 !important;
    font-size: 13px !important;
}

body.tv-lite-mode .card-info-grid {
    display: flex !important;
    gap: 6px !important;
    margin-top: auto !important;
}

body.tv-lite-mode .card-info-grid div {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 43px !important;
    min-height: 43px !important;
    max-height: 43px !important;
    padding: 6px 7px !important;

    background: #173f5e !important;
    border: 1px solid #245a7d !important;
    border-radius: 7px !important;
    overflow: hidden !important;
}

body.tv-lite-mode .card-info-grid span {
    display: block !important;
    margin: 0 0 3px !important;
    font-size: 9px !important;
    line-height: 1 !important;
}

body.tv-lite-mode .card-info-grid strong {
    display: block !important;
    font-size: 12px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.tv-lite-mode .priority-button {
    top: 36px !important;
    right: 9px !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;

    border-radius: 7px !important;
    background: #123f63 !important;
    border: 1px solid #14a3d6 !important;
    color: #ffffff !important;
    font-size: 12px !important;
}

body.tv-lite-mode .order-card.priority-card {
    border: 3px solid #ffd100 !important;
    background: #123f63 !important;
    box-shadow: none !important;
    animation: none !important;
}

body.tv-lite-mode .order-card.priority-card .card-status {
    background: #ffd100 !important;
    color: #061521 !important;
}

body.tv-lite-mode .order-card.priority-card .customer-name {
    color: #ffd100 !important;
}

/* Coluna direita inteira */
body.tv-lite-mode .tv-summary {
    grid-column: 2 / 3 !important;
    grid-row: 4 !important;
    align-self: start !important;
    margin: 0 !important;
    min-width: 0 !important;
}

body.tv-lite-mode .summary-card {
    height: 22vh !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 10px 12px !important;

    background: #0b2f4a !important;
    border: 2px solid #14a3d6 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

body.tv-lite-mode .summary-card h3 {
    margin: 0 0 8px !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

body.tv-lite-mode #statusSummary {
    display: block !important;
}

body.tv-lite-mode .summary-row {
    margin-bottom: 7px !important;
}

body.tv-lite-mode .summary-top {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 4px !important;
    font-size: 11px !important;
    line-height: 1 !important;
}

body.tv-lite-mode .summary-bar-bg {
    height: 7px !important;
    background: #24445c !important;
    border-radius: 7px !important;
}

/* Gráficos dividindo toda a altura restante */
body.tv-lite-mode .dashboard-charts {
    grid-column: 2 / 3 !important;
    grid-row: 4 !important;
    align-self: stretch !important;

    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    margin: calc(22vh + 7px) 0 0 !important;
    min-width: 0 !important;
    height: calc(100% - 22vh - 7px) !important;
    overflow: hidden !important;
}

body.tv-lite-mode .chart-box,
body.tv-lite-mode .month-movement-box {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 10px 12px !important;

    background: #0b2f4a !important;
    border: 2px solid #14a3d6 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

body.tv-lite-mode .chart-box h3 {
    margin: 0 0 7px !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

body.tv-lite-mode #graficoStatus {
    height: calc(100% - 24px) !important;
    min-height: 0 !important;
    padding: 0 4px 7px !important;
    gap: 5px !important;
}

body.tv-lite-mode #graficoStatus .chart-column {
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
}

body.tv-lite-mode #graficoStatus .chart-bar {
    width: 30px !important;
    margin-bottom: 5px !important;
    border-radius: 7px 7px 3px 3px !important;
}

body.tv-lite-mode #graficoStatus .chart-value {
    margin-bottom: 3px !important;
    font-size: 12px !important;
}

body.tv-lite-mode #graficoStatus .chart-label {
    font-size: 9px !important;
    line-height: 1 !important;
}

body.tv-lite-mode .month-kpis {
    display: flex !important;
    gap: 6px !important;
    margin: 3px 0 7px !important;
}

body.tv-lite-mode .month-kpi {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 7px 8px !important;
    border-radius: 7px !important;
}

body.tv-lite-mode .month-kpi span {
    margin-bottom: 3px !important;
    font-size: 9px !important;
}

body.tv-lite-mode .month-kpi strong {
    font-size: 20px !important;
}

body.tv-lite-mode .month-chart,
body.tv-lite-mode #graficoMovimentoMes {
    height: calc(100% - 76px) !important;
    min-height: 0 !important;
    max-height: none !important;
    gap: 6px !important;
    overflow: hidden !important;
}

body.tv-lite-mode .month-row,
body.tv-lite-mode .month-row-hoje {
    height: calc(50% - 3px) !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-template-columns: 70px 1fr !important;
    gap: 6px !important;
    padding: 5px !important;
}

body.tv-lite-mode .month-date {
    min-width: 64px !important;
    font-size: 9px !important;
}

body.tv-lite-mode .today-badge {
    padding: 2px 5px !important;
    font-size: 7px !important;
}

body.tv-lite-mode .month-bars {
    gap: 5px !important;
}

body.tv-lite-mode .month-bar-group {
    grid-template-columns: 58px 1fr 28px !important;
    gap: 5px !important;
}

body.tv-lite-mode .month-bar-label,
body.tv-lite-mode .month-bar-value {
    font-size: 8px !important;
}

body.tv-lite-mode .month-bar-bg {
    height: 7px !important;
}

/* Remove efeitos pesados */
body.tv-lite-mode *,
body.tv-lite-mode *::before,
body.tv-lite-mode *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
    text-shadow: none !important;
}

/* Ajuste extra para TV 1280x720 */
@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .main {
        grid-template-columns: 71% 29% !important;
        grid-template-rows: 8vh 11vh 7vh 1fr !important;
    }

    body.tv-lite-mode .header-card h1 {
        font-size: 24px !important;
    }

    body.tv-lite-mode .kpi-card span {
        font-size: 13px !important;
    }

    body.tv-lite-mode .kpi-card strong {
        font-size: 28px !important;
    }

    body.tv-lite-mode .alert-item span {
        font-size: 10px !important;
    }

    body.tv-lite-mode .alert-item strong {
        font-size: 20px !important;
    }

    body.tv-lite-mode .section-title {
        font-size: 16px !important;
    }

    body.tv-lite-mode .order-card h3 {
        font-size: 14px !important;
    }

    body.tv-lite-mode .customer-name {
        font-size: 10px !important;
    }

    body.tv-lite-mode .tempo-aberto {
        font-size: 10px !important;
    }

    body.tv-lite-mode .card-info-grid strong {
        font-size: 10px !important;
    }

    body.tv-lite-mode .summary-card {
        height: 20vh !important;
    }

    body.tv-lite-mode .dashboard-charts {
        margin-top: calc(20vh + 7px) !important;
        height: calc(100% - 20vh - 7px) !important;
    }
}



/* =====================================================
   MODO TV-LITE V6 - AJUSTE DE LEITURA E APROVEITAMENTO
===================================================== */

/* Fundo totalmente escuro para eliminar áreas claras */
html,
body.tv-lite-mode {
    background: #061521 !important;
}

body.tv-lite-mode .main {
    background: #061521 !important;
    padding: 5px !important;
    gap: 5px !important;
    grid-template-columns: 74% 26% !important;
    grid-template-rows: 8vh 11vh 7vh 1fr !important;
}

/* Cabeçalho mais baixo e mais útil */
body.tv-lite-mode .header-card {
    padding: 6px 10px !important;
    border-width: 1px !important;
}

body.tv-lite-mode .header-logo-box {
    width: 82px !important;
    min-width: 82px !important;
    height: 48px !important;
}

body.tv-lite-mode .header-logo {
    width: 72px !important;
    height: 36px !important;
}

body.tv-lite-mode .header-card h1 {
    font-size: 27px !important;
}

body.tv-lite-mode .header-card p {
    font-size: 12px !important;
}

body.tv-lite-mode #lastUpdate {
    font-size: 10px !important;
}

/* KPIs mais legíveis, sem aumentar a altura */
body.tv-lite-mode .kpi-card {
    padding: 5px 4px !important;
    border-width: 1px !important;
}

body.tv-lite-mode .kpi-card span {
    font-size: 15px !important;
}

body.tv-lite-mode .kpi-card small {
    font-size: 9px !important;
    margin: 3px 0 !important;
}

body.tv-lite-mode .kpi-card strong {
    font-size: 31px !important;
}

/* Alertas maiores */
body.tv-lite-mode .alert-item {
    padding: 6px 9px !important;
    border-width: 1px !important;
}

body.tv-lite-mode .alert-item span {
    font-size: 12px !important;
}

body.tv-lite-mode .alert-item strong {
    font-size: 23px !important;
}

/* Área dos pedidos um pouco maior */
body.tv-lite-mode .section-title {
    font-size: 18px !important;
    margin-bottom: 4px !important;
}

body.tv-lite-mode #pageIndicator {
    font-size: 10px !important;
    margin-bottom: 4px !important;
}

/* Cards com menos margem interna e fontes maiores */
body.tv-lite-mode .cards-grid {
    gap: 5px !important;
    height: calc(100% - 44px) !important;
}

body.tv-lite-mode .order-card {
    padding: 0 7px 6px !important;
    border-width: 1px !important;
    border-radius: 8px !important;
}

body.tv-lite-mode .card-status {
    height: 25px !important;
    min-height: 25px !important;
    max-height: 25px !important;
    margin: 0 -7px 5px !important;
    padding: 5px 7px !important;
    font-size: 11px !important;
}

body.tv-lite-mode .order-card h3 {
    font-size: 16px !important;
    margin: 1px 0 4px !important;
}

body.tv-lite-mode .customer-name {
    font-size: 12px !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    line-height: 20px !important;
    margin-bottom: 5px !important;
}

body.tv-lite-mode .tempo-aberto {
    height: 29px !important;
    min-height: 29px !important;
    max-height: 29px !important;
    margin-bottom: 5px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
}

body.tv-lite-mode .tempo-aberto strong {
    font-size: 12px !important;
}

body.tv-lite-mode .card-info-grid {
    gap: 5px !important;
}

body.tv-lite-mode .card-info-grid div {
    height: 39px !important;
    min-height: 39px !important;
    max-height: 39px !important;
    padding: 5px 6px !important;
}

body.tv-lite-mode .card-info-grid span {
    font-size: 8px !important;
}

body.tv-lite-mode .card-info-grid strong {
    font-size: 11px !important;
}

body.tv-lite-mode .priority-button {
    top: 32px !important;
    right: 7px !important;
    width: 25px !important;
    height: 25px !important;
}

/* Coluna direita mais compacta, mas ainda legível */
body.tv-lite-mode .summary-card {
    height: 19vh !important;
    padding: 8px 9px !important;
    border-width: 1px !important;
}

body.tv-lite-mode .summary-card h3 {
    font-size: 12px !important;
    margin-bottom: 6px !important;
}

body.tv-lite-mode .summary-top {
    font-size: 9px !important;
}

body.tv-lite-mode .summary-row {
    margin-bottom: 5px !important;
}

body.tv-lite-mode .summary-bar-bg {
    height: 6px !important;
}

body.tv-lite-mode .dashboard-charts {
    margin-top: calc(19vh + 5px) !important;
    height: calc(100% - 19vh - 5px) !important;
    gap: 5px !important;
}

body.tv-lite-mode .chart-box,
body.tv-lite-mode .month-movement-box {
    padding: 8px 9px !important;
    border-width: 1px !important;
}

body.tv-lite-mode .chart-box h3 {
    font-size: 12px !important;
    margin-bottom: 5px !important;
}

body.tv-lite-mode #graficoStatus .chart-bar {
    width: 26px !important;
}

body.tv-lite-mode #graficoStatus .chart-value {
    font-size: 10px !important;
}

body.tv-lite-mode #graficoStatus .chart-label {
    font-size: 8px !important;
}

body.tv-lite-mode .month-kpi {
    height: 44px !important;
    min-height: 44px !important;
    padding: 6px 7px !important;
}

body.tv-lite-mode .month-kpi span {
    font-size: 8px !important;
}

body.tv-lite-mode .month-kpi strong {
    font-size: 17px !important;
}

body.tv-lite-mode .month-date {
    font-size: 8px !important;
}

body.tv-lite-mode .month-bar-label,
body.tv-lite-mode .month-bar-value {
    font-size: 7px !important;
}


/* =====================================================
   MODO TV-LITE V7 - VISUAL COLORIDO E LEGÍVEL
   KPIs por cor, cards centralizados e gráficos maiores
===================================================== */

/* Cabeçalho */
body.tv-lite-mode .header-card h1 {
    font-size: 28px !important;
    letter-spacing: 0.2px !important;
}

body.tv-lite-mode #lastUpdate {
    font-size: 11px !important;
    font-weight: 900 !important;
}

/* KPIs coloridos */
body.tv-lite-mode .kpi-card {
    position: relative !important;
    overflow: hidden !important;
    background: #081c2c !important;
}

body.tv-lite-mode .kpi-card:nth-child(1) {
    border-color: #ff3b3b !important;
}

body.tv-lite-mode .kpi-card:nth-child(2) {
    border-color: #1aa8ff !important;
}

body.tv-lite-mode .kpi-card:nth-child(3) {
    border-color: #ffd100 !important;
}

body.tv-lite-mode .kpi-card:nth-child(4) {
    border-color: #a8b3bf !important;
}

body.tv-lite-mode .kpi-card:nth-child(5) {
    border-color: #00b7ff !important;
}

body.tv-lite-mode .kpi-card:nth-child(1) strong {
    color: #ff3b3b !important;
}

body.tv-lite-mode .kpi-card:nth-child(2) strong {
    color: #1aa8ff !important;
}

body.tv-lite-mode .kpi-card:nth-child(3) strong {
    color: #ffd100 !important;
}

body.tv-lite-mode .kpi-card:nth-child(4) strong {
    color: #b7c0c9 !important;
}

body.tv-lite-mode .kpi-card:nth-child(5) strong {
    color: #00b7ff !important;
}

body.tv-lite-mode .kpi-card span {
    font-size: 14px !important;
    font-weight: 900 !important;
    text-align: center !important;
    white-space: normal !important;
}

body.tv-lite-mode .kpi-card small {
    font-size: 9px !important;
    text-align: center !important;
    color: #d4e0ea !important;
}

body.tv-lite-mode .kpi-card strong {
    font-size: 33px !important;
    font-weight: 950 !important;
}

/* Alertas coloridos */
body.tv-lite-mode .alert-item:nth-child(1) {
    border-color: #ff3b3b !important;
}

body.tv-lite-mode .alert-item:nth-child(2) {
    border-color: #ffd100 !important;
}

body.tv-lite-mode .alert-item:nth-child(3) {
    border-color: #ff8a00 !important;
}

body.tv-lite-mode .alert-item:nth-child(4) {
    border-color: #ff3b3b !important;
}

body.tv-lite-mode .alert-item:nth-child(1) strong,
body.tv-lite-mode .alert-item:nth-child(4) strong {
    color: #ff3b3b !important;
}

body.tv-lite-mode .alert-item:nth-child(2) strong {
    color: #ffd100 !important;
}

body.tv-lite-mode .alert-item:nth-child(3) strong {
    color: #ff8a00 !important;
}

body.tv-lite-mode .alert-item span {
    font-size: 11px !important;
    font-weight: 900 !important;
}

/* Cards centralizados */
body.tv-lite-mode .order-card {
    text-align: center !important;
    justify-content: flex-start !important;
    background: #081d2f !important;
}

body.tv-lite-mode .order-card h3 {
    text-align: center !important;
    padding-right: 0 !important;
    margin: 4px 0 !important;
    font-size: 15px !important;
}

body.tv-lite-mode .customer-name {
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 950 !important;
    color: #1cc8ff !important;
    margin-bottom: 5px !important;
}

body.tv-lite-mode .tempo-aberto {
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    min-width: 125px !important;
    font-size: 10px !important;
}

body.tv-lite-mode .tempo-aberto strong {
    font-size: 11px !important;
}

body.tv-lite-mode .card-info-grid {
    margin-top: auto !important;
}

body.tv-lite-mode .card-info-grid div {
    text-align: left !important;
}

body.tv-lite-mode .card-info-grid span {
    font-size: 7px !important;
}

body.tv-lite-mode .card-info-grid strong {
    font-size: 10px !important;
}

body.tv-lite-mode .priority-button {
    top: 31px !important;
    right: 7px !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 10px !important;
}

body.tv-lite-mode .card-status {
    justify-content: center !important;
    font-size: 10px !important;
}

/* Resumo visual */
body.tv-lite-mode .summary-card,
body.tv-lite-mode .chart-box,
body.tv-lite-mode .month-movement-box {
    background: #081d2f !important;
}

body.tv-lite-mode .summary-card h3,
body.tv-lite-mode .chart-box h3 {
    font-size: 12px !important;
}

body.tv-lite-mode .summary-top {
    font-size: 9px !important;
}

body.tv-lite-mode .summary-top strong {
    font-size: 10px !important;
}

body.tv-lite-mode .summary-bar-bg {
    height: 7px !important;
}

/* Gráfico de distribuição maior */
body.tv-lite-mode #graficoStatus {
    height: 170px !important;
    min-height: 170px !important;
    align-items: flex-end !important;
}

body.tv-lite-mode #graficoStatus .chart-column {
    height: 165px !important;
    min-height: 165px !important;
}

body.tv-lite-mode #graficoStatus .chart-bar {
    width: 28px !important;
}

body.tv-lite-mode #graficoStatus .chart-value {
    font-size: 10px !important;
    font-weight: 950 !important;
}

body.tv-lite-mode #graficoStatus .chart-label {
    font-size: 7px !important;
    color: #ffffff !important;
}

/* Movimentação do mês */
body.tv-lite-mode .month-kpi {
    background: #0f2e47 !important;
}

body.tv-lite-mode .month-kpi span {
    font-size: 8px !important;
    color: #d8e4ed !important;
}

body.tv-lite-mode .month-kpi strong {
    font-size: 18px !important;
}

body.tv-lite-mode #totalIncluidosMes {
    color: #1aa8ff !important;
}

body.tv-lite-mode #totalFinalizadosMes {
    color: #00d95f !important;
}

body.tv-lite-mode .month-date {
    font-size: 7px !important;
    color: #ffffff !important;
}

body.tv-lite-mode .month-bar-label,
body.tv-lite-mode .month-bar-value {
    font-size: 7px !important;
    color: #ffffff !important;
}

body.tv-lite-mode .month-bar-fill.incluidos {
    background: #1aa8ff !important;
}

body.tv-lite-mode .month-bar-fill.finalizados {
    background: #00d95f !important;
}

/* Ajuste para zoom 150% */
@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .main {
        grid-template-columns: 73% 27% !important;
        gap: 4px !important;
        padding: 4px !important;
    }

    body.tv-lite-mode .kpi-card span {
        font-size: 12px !important;
    }

    body.tv-lite-mode .kpi-card strong {
        font-size: 28px !important;
    }

    body.tv-lite-mode .alert-item span {
        font-size: 9px !important;
    }

    body.tv-lite-mode .alert-item strong {
        font-size: 19px !important;
    }

    body.tv-lite-mode .order-card h3 {
        font-size: 13px !important;
    }

    body.tv-lite-mode .customer-name {
        font-size: 10px !important;
    }

    body.tv-lite-mode .tempo-aberto {
        font-size: 9px !important;
    }

    body.tv-lite-mode .card-info-grid strong {
        font-size: 9px !important;
    }

    body.tv-lite-mode .summary-top {
        font-size: 8px !important;
    }

    body.tv-lite-mode .chart-box h3 {
        font-size: 10px !important;
    }

    body.tv-lite-mode #graficoStatus .chart-label {
        font-size: 6px !important;
    }
}


/* =====================================================
   MODO TV-LITE V8 - AJUSTE FINAL
   Última atualização na lateral e nomes dos gráficos visíveis
===================================================== */

/* Última atualização posicionada à direita do cabeçalho */
body.tv-lite-mode .header-card {
    position: relative !important;
}

body.tv-lite-mode .header-text {
    width: 100% !important;
    min-width: 0 !important;
    padding-right: 230px !important;
}

body.tv-lite-mode #lastUpdate {
    position: absolute !important;
    top: 50% !important;
    right: 18px !important;
    transform: translateY(-50%) !important;

    width: 210px !important;
    margin: 0 !important;
    padding: 8px 10px !important;

    text-align: right !important;
    white-space: normal !important;
    line-height: 1.25 !important;

    color: #1cc8ff !important;
    background: #071826 !important;
    border: 1px solid #14a3d6 !important;
    border-radius: 8px !important;

    font-size: 10px !important;
    font-weight: 900 !important;
}

/* Dá espaço real para os nomes abaixo das barras */
body.tv-lite-mode #graficoStatus {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    padding: 0 2px 4px !important;
    overflow: visible !important;
    align-items: flex-end !important;
}

body.tv-lite-mode #graficoStatus .chart-column {
    height: 145px !important;
    min-height: 145px !important;
    max-height: 145px !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;

    overflow: visible !important;
}

/* Limita a barra para sobrar espaço para número e nome */
body.tv-lite-mode #graficoStatus .chart-bar {
    max-height: 105px !important;
    min-height: 6px !important;
    width: 26px !important;
    flex-shrink: 1 !important;
}

/* Número acima do nome */
body.tv-lite-mode #graficoStatus .chart-value {
    display: block !important;
    min-height: 14px !important;
    margin: 2px 0 2px !important;

    color: #ffffff !important;
    font-size: 9px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
}

/* Nome completo abaixo da barra */
body.tv-lite-mode #graficoStatus .chart-label {
    display: block !important;
    min-height: 22px !important;
    max-height: 22px !important;
    width: 100% !important;

    color: #ffffff !important;
    font-size: 7px !important;
    font-weight: 700 !important;
    line-height: 1.05 !important;
    text-align: center !important;

    white-space: normal !important;
    overflow: visible !important;
    word-break: normal !important;
}

/* Evita que a caixa corte os textos inferiores */
body.tv-lite-mode .dashboard-charts .chart-box:first-child {
    overflow: visible !important;
}

body.tv-lite-mode .dashboard-charts {
    overflow: visible !important;
}

/* Ajuste para zoom de 150% / navegador Philips */
@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .header-text {
        padding-right: 185px !important;
    }

    body.tv-lite-mode #lastUpdate {
        right: 10px !important;
        width: 170px !important;
        padding: 6px 8px !important;
        font-size: 8px !important;
    }

    body.tv-lite-mode .header-card h1 {
        font-size: 23px !important;
    }

    body.tv-lite-mode .header-card p {
        font-size: 10px !important;
    }

    body.tv-lite-mode #graficoStatus {
        height: 142px !important;
        min-height: 142px !important;
        max-height: 142px !important;
    }

    body.tv-lite-mode #graficoStatus .chart-column {
        height: 138px !important;
        min-height: 138px !important;
        max-height: 138px !important;
    }

    body.tv-lite-mode #graficoStatus .chart-bar {
        max-height: 96px !important;
        width: 23px !important;
    }

    body.tv-lite-mode #graficoStatus .chart-label {
        min-height: 21px !important;
        max-height: 21px !important;
        font-size: 6px !important;
    }
}


/* =====================================================
   MODO TV-LITE V10 - VISUAL LIMPO
   Cards azuis, prioridade vermelha e ícones substituídos por bolinhas
===================================================== */

/* =====================================================
   CARDS: TODOS AZUIS
===================================================== */

body.tv-lite-mode .order-card {
    background: #081d2f !important;
    border: 2px solid #14a3d6 !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Mantém todos os cards normais no mesmo padrão azul */
body.tv-lite-mode .order-card .card-status {
    background: #159cca !important;
    color: #ffffff !important;
}

/* Cliente e tempo no padrão azul */
body.tv-lite-mode .order-card .customer-name {
    color: #1cc8ff !important;
}

body.tv-lite-mode .order-card .tempo-aberto strong {
    color: #1cc8ff !important;
}

/* Remove as cores amarelas/vermelhas aplicadas pelo tempo */
body.tv-lite-mode .order-card .tempo-aberto.tempo-normal,
body.tv-lite-mode .order-card .tempo-aberto.tempo-alerta,
body.tv-lite-mode .order-card .tempo-aberto.tempo-critico {
    background: #123f63 !important;
    border: 1px solid #235c82 !important;
    border-left: 4px solid #14a3d6 !important;
    box-shadow: none !important;
    animation: none !important;
}

body.tv-lite-mode .order-card .tempo-aberto.tempo-normal strong,
body.tv-lite-mode .order-card .tempo-aberto.tempo-alerta strong,
body.tv-lite-mode .order-card .tempo-aberto.tempo-critico strong {
    color: #1cc8ff !important;
}

/* =====================================================
   PRIORIDADE: CARD INTEIRO VERMELHO
===================================================== */

body.tv-lite-mode .order-card.priority-card {
    background:
        linear-gradient(180deg, rgba(255, 23, 68, 0.25) 0%, #2b0710 45%, #12070a 100%) !important;
    border: 3px solid #ff1744 !important;
    box-shadow: none !important;
    animation: none !important;
}

body.tv-lite-mode .order-card.priority-card .card-status {
    background: #ff1744 !important;
    color: #ffffff !important;
}

body.tv-lite-mode .order-card.priority-card .customer-name,
body.tv-lite-mode .order-card.priority-card .tempo-aberto strong {
    color: #ff738c !important;
}

body.tv-lite-mode .order-card.priority-card .tempo-aberto {
    background: #40101a !important;
    border: 1px solid #ff5b76 !important;
    border-left: 4px solid #ff1744 !important;
}

body.tv-lite-mode .order-card.priority-card .card-info-grid div {
    background: #35101a !important;
    border-color: rgba(255, 23, 68, 0.65) !important;
}

/* =====================================================
   BOTÃO DE PRIORIDADE COMO BOLINHA
   Verde = sem prioridade | Vermelha = prioridade
===================================================== */

body.tv-lite-mode .priority-button {
    top: 32px !important;
    right: 8px !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    padding: 0 !important;
    border-radius: 50% !important;

    background: #55b929 !important;
    border: 2px solid #8ee35f !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

body.tv-lite-mode .priority-card .priority-button {
    background: #ff1744 !important;
    border-color: #ff738c !important;
}

/* =====================================================
   STATUS DOS CARDS: REMOVE EMOJI E MOSTRA BOLINHA
===================================================== */

/* Esconde somente o primeiro caractere/emoji quando suportado */
body.tv-lite-mode .card-status::first-letter {
    font-size: 0 !important;
}

/* Bolinha padrão verde antes do texto */
body.tv-lite-mode .card-status::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    min-width: 9px;
    margin-right: 6px;
    border-radius: 50%;
    background: #55b929;
    vertical-align: middle;
}

/* Prioridade usa bolinha vermelha */
body.tv-lite-mode .priority-card .card-status::before {
    background: #ffffff;
}

/* =====================================================
   ALERTAS: REMOVE ÍCONES E USA BOLINHAS
===================================================== */

body.tv-lite-mode .alert-item span::first-letter {
    font-size: 0 !important;
}

body.tv-lite-mode .alert-item span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    min-width: 10px;
    margin-right: 7px;
    border-radius: 50%;
    background: #55b929;
    vertical-align: middle;
}

/* Prioridades ativas: verde sem prioridade, vermelho quando existir */
body.tv-lite-mode .alert-item:first-child span::before {
    background: #55b929;
}

body.tv-lite-mode .alert-item.alerta-prioridade-ativa:first-child span::before {
    background: #ff1744;
}

/* Remove animações dos alertas */
body.tv-lite-mode .alert-item strong,
body.tv-lite-mode .alert-item {
    animation: none !important;
}

/* =====================================================
   KPIs: SEM ÍCONES DE CAIXA
===================================================== */

/* O HTML atual já não possui ícones nos KPIs.
   Este bloco evita pseudoícones de versões anteriores. */
body.tv-lite-mode .kpi-card::before,
body.tv-lite-mode .kpi-card::after {
    content: none !important;
    display: none !important;
}

/* =====================================================
   CORREÇÃO DO ÚLTIMO CARD CORTADO
===================================================== */

body.tv-lite-mode .orders-section {
    padding-bottom: 6px !important;
    overflow: visible !important;
}

body.tv-lite-mode .cards-grid {
    height: calc(100% - 54px) !important;
    padding-bottom: 8px !important;
    overflow: visible !important;
}

body.tv-lite-mode .order-card {
    min-height: 0 !important;
}

/* No zoom de 150%, reduz levemente a altura útil para não cortar a borda */
@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .cards-grid {
        height: calc(100% - 58px) !important;
        padding-bottom: 10px !important;
    }

    body.tv-lite-mode .priority-button {
        top: 29px !important;
        right: 7px !important;
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
    }

    body.tv-lite-mode .card-status::before {
        width: 8px;
        height: 8px;
        min-width: 8px;
        margin-right: 5px;
    }
}


/* =====================================================
   MODO TV-LITE V11 - SEM BOLINHAS NOS CARDS
   Mantém cards azuis e prioridade vermelha.
===================================================== */

/* Remove a bolinha do botão de prioridade e esconde o botão visualmente */
body.tv-lite-mode .priority-button {
    display: none !important;
}

/* Remove bolinhas e pseudo-elementos do status dos cards */
body.tv-lite-mode .card-status::before,
body.tv-lite-mode .card-status::after {
    content: none !important;
    display: none !important;
}

/* Garante que o texto do status fique limpo */
body.tv-lite-mode .card-status {
    justify-content: center !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Remove qualquer bolinha restante em títulos ou áreas internas dos cards */
body.tv-lite-mode .order-card h3::before,
body.tv-lite-mode .order-card h3::after,
body.tv-lite-mode .customer-name::before,
body.tv-lite-mode .customer-name::after,
body.tv-lite-mode .tempo-aberto::before,
body.tv-lite-mode .tempo-aberto::after,
body.tv-lite-mode .card-info-grid::before,
body.tv-lite-mode .card-info-grid::after {
    content: none !important;
    display: none !important;
}

/* Mantém os cards normais azuis */
body.tv-lite-mode .order-card {
    background: #081d2f !important;
    border: 2px solid #14a3d6 !important;
}

/* Mantém prioridade em vermelho */
body.tv-lite-mode .order-card.priority-card {
    background:
        linear-gradient(180deg, rgba(255, 23, 68, 0.25) 0%, #2b0710 45%, #12070a 100%) !important;
    border: 3px solid #ff1744 !important;
}

/* Ajusta o título para ocupar o espaço liberado */
body.tv-lite-mode .order-card h3 {
    padding-right: 0 !important;
    text-align: center !important;
}

/* Remove bolinhas dos alertas superiores */
body.tv-lite-mode .alert-item span::before,
body.tv-lite-mode .alert-item span::after {
    content: none !important;
    display: none !important;
}

/* Evita qualquer pseudoícone herdado de versões anteriores */
body.tv-lite-mode .order-card::before,
body.tv-lite-mode .order-card::after {
    content: none !important;
    display: none !important;
}


/* =====================================================
   MODO TV-LITE V12 - KPIs AZUIS E GRÁFICO COLORIDO
===================================================== */

/* =====================================================
   KPIs: TODOS COM FUNDO AZUL E NÚMEROS AZUIS
===================================================== */

body.tv-lite-mode .kpi-card,
body.tv-lite-mode .kpi-card:nth-child(1),
body.tv-lite-mode .kpi-card:nth-child(2),
body.tv-lite-mode .kpi-card:nth-child(3),
body.tv-lite-mode .kpi-card:nth-child(4),
body.tv-lite-mode .kpi-card:nth-child(5) {
    background: linear-gradient(180deg, #0b3760 0%, #082b4a 100%) !important;
    border-color: #14a3d6 !important;
    color: #ffffff !important;
}

body.tv-lite-mode .kpi-card span,
body.tv-lite-mode .kpi-card small {
    color: #ffffff !important;
}

body.tv-lite-mode .kpi-card strong,
body.tv-lite-mode .kpi-card:nth-child(1) strong,
body.tv-lite-mode .kpi-card:nth-child(2) strong,
body.tv-lite-mode .kpi-card:nth-child(3) strong,
body.tv-lite-mode .kpi-card:nth-child(4) strong,
body.tv-lite-mode .kpi-card:nth-child(5) strong {
    color: #168ff0 !important;
}

/* Garante que Aguardando Impressão não fique branco */
body.tv-lite-mode .kpi-card:nth-child(4) {
    background: linear-gradient(180deg, #0b3760 0%, #082b4a 100%) !important;
}

body.tv-lite-mode .kpi-card:nth-child(4) span,
body.tv-lite-mode .kpi-card:nth-child(4) small {
    color: #ffffff !important;
}

body.tv-lite-mode .kpi-card:nth-child(4) strong {
    color: #168ff0 !important;
}

/* =====================================================
   GRÁFICO DE DISTRIBUIÇÃO: CORES POR STATUS
===================================================== */

/* Em Aberto */
body.tv-lite-mode #graficoStatus .chart-column:nth-child(1) .chart-bar {
    background: #ff3344 !important;
}

/* Faturamento */
body.tv-lite-mode #graficoStatus .chart-column:nth-child(2) .chart-bar {
    background: #168ff0 !important;
}

/* Aguardando Peças */
body.tv-lite-mode #graficoStatus .chart-column:nth-child(3) .chart-bar {
    background: #ffd100 !important;
}

/* Impressão */
body.tv-lite-mode #graficoStatus .chart-column:nth-child(4) .chart-bar {
    background: #ffffff !important;
}

/* Remove a altura mínima geral que deixava 24 parecido com 0 */
body.tv-lite-mode #graficoStatus .chart-bar {
    min-height: 1px !important;
}

/* O valor 0 da impressão vira apenas uma pequena linha */
body.tv-lite-mode #graficoStatus .chart-column:nth-child(4) .chart-bar {
    height: 2px !important;
    min-height: 2px !important;
    max-height: 2px !important;
}

/* Faturamento mantém altura proporcional e claramente maior que zero */
body.tv-lite-mode #graficoStatus .chart-column:nth-child(2) .chart-bar {
    min-height: 8px !important;
}

/* Melhora a leitura dos nomes e valores */
body.tv-lite-mode #graficoStatus .chart-value {
    color: #ffffff !important;
    font-weight: 950 !important;
}

body.tv-lite-mode #graficoStatus .chart-label {
    color: #ffffff !important;
    font-weight: 800 !important;
}

/* =====================================================
   RESUMO VISUAL: CORES IGUAIS AO GRÁFICO
===================================================== */

body.tv-lite-mode #statusSummary .summary-row:nth-child(1) .summary-bar-fill {
    background: #ff3344 !important;
}

body.tv-lite-mode #statusSummary .summary-row:nth-child(2) .summary-bar-fill {
    background: #168ff0 !important;
}

body.tv-lite-mode #statusSummary .summary-row:nth-child(3) .summary-bar-fill {
    background: #ffd100 !important;
}

body.tv-lite-mode #statusSummary .summary-row:nth-child(4) .summary-bar-fill {
    background: #ffffff !important;
}


/* =====================================================
   MODO TV-LITE V13 - AJUSTE FINAL PARA TV PHILIPS
   Remove ícones incompatíveis e centraliza os cards no zoom de 150%
===================================================== */

/* =====================================================
   REMOVE EMOJIS / ÍCONES INCOMPATÍVEIS
===================================================== */

/* Títulos das seções */
body.tv-lite-mode .section-title::first-letter,
body.tv-lite-mode .summary-card h3::first-letter,
body.tv-lite-mode .chart-box h3::first-letter {
    font-size: 0 !important;
}

/* Mantém os títulos alinhados após remover o primeiro caractere */
body.tv-lite-mode .section-title,
body.tv-lite-mode .summary-card h3,
body.tv-lite-mode .chart-box h3 {
    text-indent: 0 !important;
}

/* Remove pseudoícones antigos */
body.tv-lite-mode .section-title::before,
body.tv-lite-mode .section-title::after,
body.tv-lite-mode .summary-card h3::before,
body.tv-lite-mode .summary-card h3::after,
body.tv-lite-mode .chart-box h3::before,
body.tv-lite-mode .chart-box h3::after,
body.tv-lite-mode .month-movement-box h3::before,
body.tv-lite-mode .month-movement-box h3::after {
    content: none !important;
    display: none !important;
}

/* Remove emojis do tempo aberto */
body.tv-lite-mode .tempo-aberto::first-letter {
    font-size: 0 !important;
}

/* Remove bolinhas e ícones do status dos cards */
body.tv-lite-mode .card-status::before,
body.tv-lite-mode .card-status::after {
    content: none !important;
    display: none !important;
}

/* Remove qualquer ícone do botão de prioridade */
body.tv-lite-mode .priority-button {
    display: none !important;
}

/* Remove ícones dos alertas */
body.tv-lite-mode .alert-item span::first-letter {
    font-size: 0 !important;
}

body.tv-lite-mode .alert-item span::before,
body.tv-lite-mode .alert-item span::after {
    content: none !important;
    display: none !important;
}

/* =====================================================
   CENTRALIZAÇÃO DOS CARDS
===================================================== */

body.tv-lite-mode .orders-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

body.tv-lite-mode .section-title {
    text-align: center !important;
}

body.tv-lite-mode #pageIndicator {
    align-self: center !important;
    text-align: center !important;
}

/* Grade centralizada dentro da área esquerda */
body.tv-lite-mode .cards-grid {
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    align-content: center !important;
}

/* Conteúdo interno dos cards centralizado */
body.tv-lite-mode .order-card {
    text-align: center !important;
    justify-content: flex-start !important;
}

body.tv-lite-mode .card-status {
    justify-content: center !important;
    text-align: center !important;
}

body.tv-lite-mode .order-card h3 {
    text-align: center !important;
    padding-right: 0 !important;
}

body.tv-lite-mode .customer-name {
    text-align: center !important;
}

body.tv-lite-mode .tempo-aberto {
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
}

/* Mantém os dois campos inferiores organizados */
body.tv-lite-mode .card-info-grid {
    width: 100% !important;
    margin-top: auto !important;
}

body.tv-lite-mode .card-info-grid div {
    text-align: left !important;
}

/* =====================================================
   AJUSTE ESPECÍFICO PARA ZOOM DE 150%
===================================================== */

@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .cards-grid {
        width: 98% !important;
        gap: 5px !important;
        align-content: center !important;
    }

    body.tv-lite-mode .order-card {
        width: 100% !important;
        margin: 0 auto !important;
    }

    body.tv-lite-mode .section-title {
        margin-top: 2px !important;
        margin-bottom: 4px !important;
    }

    body.tv-lite-mode #pageIndicator {
        margin-bottom: 5px !important;
    }

    body.tv-lite-mode .card-status {
        text-align: center !important;
    }

    body.tv-lite-mode .order-card h3 {
        text-align: center !important;
    }

    body.tv-lite-mode .customer-name {
        text-align: center !important;
    }
}


/* =====================================================
   MODO TV-LITE V14 - AJUSTE FINAL DOS CARDS
   Remove a bolinha restante e alinha Status / Incluído por
===================================================== */

/* Remove qualquer bolinha, ponto, emoji ou pseudo-elemento do status */
body.tv-lite-mode .card-status::before,
body.tv-lite-mode .card-status::after,
body.tv-lite-mode .card-status span::before,
body.tv-lite-mode .card-status span::after {
    content: none !important;
    display: none !important;
}

body.tv-lite-mode .card-status {
    text-align: center !important;
    justify-content: center !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Garante que o texto EM ABERTO fique limpo */
body.tv-lite-mode .card-status {
    font-size: 11px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
}

/* Alinha e evita corte nos campos inferiores */
body.tv-lite-mode .card-info-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
    margin-top: auto !important;
    align-items: stretch !important;
}

body.tv-lite-mode .card-info-grid div {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;

    min-height: 42px !important;
    height: 42px !important;
    max-height: 42px !important;

    padding: 6px 8px !important;
    overflow: hidden !important;
}

body.tv-lite-mode .card-info-grid span {
    display: block !important;
    width: 100% !important;
    margin: 0 0 3px !important;

    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.tv-lite-mode .card-info-grid strong {
    display: block !important;
    width: 100% !important;

    font-size: 11px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Dá um pouco mais de respiro na base do card */
body.tv-lite-mode .order-card {
    padding-bottom: 8px !important;
}

body.tv-lite-mode .cards-grid {
    padding-bottom: 10px !important;
}

/* Ajuste específico para o zoom de 150% */
@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .card-info-grid {
        gap: 5px !important;
    }

    body.tv-lite-mode .card-info-grid div {
        min-height: 38px !important;
        height: 38px !important;
        max-height: 38px !important;
        padding: 5px 6px !important;
    }

    body.tv-lite-mode .card-info-grid span {
        font-size: 7px !important;
        margin-bottom: 2px !important;
    }

    body.tv-lite-mode .card-info-grid strong {
        font-size: 10px !important;
    }

    body.tv-lite-mode .order-card {
        padding-bottom: 7px !important;
    }
}


/* =====================================================
   MODO TV-LITE V15 - CENTRALIZAÇÃO DA GRADE
   Corrige bordas cortadas no zoom de 150% e overscan da TV
===================================================== */

/* Moldura de segurança para a TV Philips */
body.tv-lite-mode {
    padding: 6px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

body.tv-lite-mode .main {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    margin: 0 auto !important;
    padding: 4px !important;
    box-sizing: border-box !important;
}

/* Centraliza toda a área dos pedidos */
body.tv-lite-mode .orders-section {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 6px 8px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* Grade com margem real nas laterais */
body.tv-lite-mode .cards-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;

    width: calc(100% - 18px) !important;
    max-width: calc(100% - 18px) !important;

    margin-left: auto !important;
    margin-right: auto !important;

    padding: 0 4px 12px !important;
    box-sizing: border-box !important;

    justify-content: center !important;
    align-content: center !important;
    overflow: visible !important;
}

/* Garante que cada card respeite o espaço da coluna */
body.tv-lite-mode .order-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    margin: 0 auto !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Ajusta a última linha para não cortar a borda inferior */
body.tv-lite-mode .cards-grid .order-card:nth-last-child(-n + 3) {
    margin-bottom: 4px !important;
}

/* Mantém os campos inferiores centralizados dentro do card */
body.tv-lite-mode .card-info-grid {
    width: calc(100% - 2px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ajuste específico para o zoom de 150% */
@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode {
        padding: 5px !important;
    }

    body.tv-lite-mode .main {
        width: calc(100vw - 10px) !important;
        max-width: calc(100vw - 10px) !important;
        padding: 3px !important;
    }

    body.tv-lite-mode .orders-section {
        padding-left: 5px !important;
        padding-right: 5px !important;
        padding-bottom: 8px !important;
    }

    body.tv-lite-mode .cards-grid {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        gap: 5px !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
        padding-bottom: 12px !important;
    }

    body.tv-lite-mode .order-card {
        width: 100% !important;
        margin: 0 auto !important;
    }
}


/* =====================================================
   MODO TV-LITE V16 - PAGINAÇÃO E PRIORIDADES SEPARADAS
===================================================== */

body.tv-lite-mode #pageIndicator {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;

    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto 6px !important;
    padding: 0 !important;

    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;

    color: #ffffff !important;
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

body.tv-lite-mode #pageIndicator .page-number {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 4px 9px !important;
    border-radius: 999px !important;
    background: #0b2f4a !important;
    border: 1px solid #14a3d6 !important;

    color: #ffffff !important;
    font-weight: 900 !important;
}

body.tv-lite-mode #pageIndicator .page-priority {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 4px 9px !important;
    border-radius: 999px !important;
    background: #3a0711 !important;
    border: 1px solid #ff1744 !important;

    color: #ff8ca1 !important;
    font-weight: 900 !important;
}

@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode #pageIndicator {
        gap: 4px !important;
        font-size: 8px !important;
        margin-bottom: 5px !important;
    }

    body.tv-lite-mode #pageIndicator .page-number,
    body.tv-lite-mode #pageIndicator .page-priority {
        padding: 3px 7px !important;
    }
}


/* =====================================================
   MODO TV-LITE V17 - AJUSTE 100% E 150% DE ZOOM
   Evita corte dos cards e mantém 9 cards completos.
===================================================== */

/* A área de pedidos precisa poder encolher dentro da grade */
body.tv-lite-mode .orders-section {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    padding-bottom: 4px !important;
}

/* Título e paginação ocupam somente o espaço necessário */
body.tv-lite-mode .section-title {
    flex: 0 0 auto !important;
    margin: 0 0 3px !important;
}

body.tv-lite-mode #pageIndicator {
    flex: 0 0 auto !important;
    margin-bottom: 4px !important;
}

/* Grade sempre dividida em três linhas iguais */
body.tv-lite-mode .cards-grid {
    flex: 1 1 auto !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(0, 1fr) !important;

    width: calc(100% - 12px) !important;
    max-width: calc(100% - 12px) !important;
    height: calc(100% - 44px) !important;
    min-height: 0 !important;

    margin: 0 auto !important;
    padding: 0 3px 8px !important;
    gap: 5px !important;

    box-sizing: border-box !important;
    align-content: stretch !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* Card usa exatamente a altura da célula */
body.tv-lite-mode .order-card {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 7px 6px !important;

    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Faixa superior um pouco mais compacta */
body.tv-lite-mode .card-status {
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    margin: 0 -7px 4px !important;
    padding: 5px 7px !important;
    font-size: 10px !important;
}

/* Conteúdo central */
body.tv-lite-mode .order-card h3 {
    margin: 1px 0 3px !important;
    font-size: 14px !important;
    line-height: 1.05 !important;
}

body.tv-lite-mode .customer-name {
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    margin-bottom: 4px !important;
    font-size: 10px !important;
    line-height: 18px !important;
}

body.tv-lite-mode .tempo-aberto {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin-bottom: 4px !important;
    padding: 5px 7px !important;
    font-size: 9px !important;
}

body.tv-lite-mode .tempo-aberto strong {
    font-size: 10px !important;
}

/* Campos inferiores sempre visíveis */
body.tv-lite-mode .card-info-grid {
    width: 100% !important;
    margin-top: auto !important;
    gap: 5px !important;
}

body.tv-lite-mode .card-info-grid div {
    min-height: 35px !important;
    height: 35px !important;
    max-height: 35px !important;
    padding: 4px 6px !important;
}

body.tv-lite-mode .card-info-grid span {
    margin-bottom: 2px !important;
    font-size: 7px !important;
}

body.tv-lite-mode .card-info-grid strong {
    font-size: 9px !important;
    line-height: 1.05 !important;
}

/* Última linha não encosta na borda da TV */
body.tv-lite-mode .cards-grid .order-card:nth-last-child(-n + 3) {
    margin-bottom: 0 !important;
}

/* =====================================================
   AJUSTE ESPECÍFICO PARA ZOOM 150% / VIEWPORT MENOR
===================================================== */

@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .main {
        padding: 3px !important;
        gap: 4px !important;
    }

    body.tv-lite-mode .orders-section {
        padding-left: 3px !important;
        padding-right: 3px !important;
        padding-bottom: 3px !important;
    }

    body.tv-lite-mode .section-title {
        font-size: 15px !important;
        margin-bottom: 2px !important;
    }

    body.tv-lite-mode #pageIndicator {
        margin-bottom: 3px !important;
        font-size: 7px !important;
        gap: 3px !important;
    }

    body.tv-lite-mode #pageIndicator .page-number,
    body.tv-lite-mode #pageIndicator .page-priority {
        padding: 3px 6px !important;
    }

    body.tv-lite-mode .cards-grid {
        width: calc(100% - 10px) !important;
        max-width: calc(100% - 10px) !important;
        height: calc(100% - 38px) !important;
        gap: 4px !important;
        padding: 0 2px 6px !important;
    }

    body.tv-lite-mode .order-card {
        padding: 0 5px 4px !important;
        border-width: 2px !important;
    }

    body.tv-lite-mode .card-status {
        height: 20px !important;
        min-height: 20px !important;
        max-height: 20px !important;
        margin: 0 -5px 2px !important;
        padding: 4px 5px !important;
        font-size: 8px !important;
    }

    body.tv-lite-mode .order-card h3 {
        margin: 1px 0 2px !important;
        font-size: 11px !important;
    }

    body.tv-lite-mode .customer-name {
        height: 14px !important;
        min-height: 14px !important;
        max-height: 14px !important;
        margin-bottom: 2px !important;
        font-size: 8px !important;
        line-height: 14px !important;
    }

    body.tv-lite-mode .tempo-aberto {
        height: 21px !important;
        min-height: 21px !important;
        max-height: 21px !important;
        margin-bottom: 2px !important;
        padding: 4px 5px !important;
        font-size: 7px !important;
    }

    body.tv-lite-mode .tempo-aberto strong {
        font-size: 8px !important;
    }

    body.tv-lite-mode .card-info-grid {
        gap: 3px !important;
    }

    body.tv-lite-mode .card-info-grid div {
        min-height: 29px !important;
        height: 29px !important;
        max-height: 29px !important;
        padding: 3px 4px !important;
    }

    body.tv-lite-mode .card-info-grid span {
        margin-bottom: 1px !important;
        font-size: 5px !important;
    }

    body.tv-lite-mode .card-info-grid strong {
        font-size: 7px !important;
    }
}

/* =====================================================
   AJUSTE EXTRA PARA VIEWPORT MUITO BAIXO
===================================================== */

@media (max-height: 620px) {
    body.tv-lite-mode .section-title {
        font-size: 13px !important;
    }

    body.tv-lite-mode .cards-grid {
        height: calc(100% - 34px) !important;
        gap: 3px !important;
    }

    body.tv-lite-mode .card-status {
        height: 18px !important;
        min-height: 18px !important;
        max-height: 18px !important;
        font-size: 7px !important;
    }

    body.tv-lite-mode .order-card h3 {
        font-size: 10px !important;
    }

    body.tv-lite-mode .customer-name {
        font-size: 7px !important;
    }

    body.tv-lite-mode .tempo-aberto {
        height: 19px !important;
        min-height: 19px !important;
        max-height: 19px !important;
        font-size: 6px !important;
    }

    body.tv-lite-mode .card-info-grid div {
        min-height: 26px !important;
        height: 26px !important;
        max-height: 26px !important;
    }

    body.tv-lite-mode .card-info-grid strong {
        font-size: 6px !important;
    }
}


/* =====================================================
   MODO TV-LITE V18 - PAGINAÇÃO FINAL
   Texto curto e espaço seguro acima dos cards
===================================================== */

body.tv-lite-mode .section-title {
    margin: 0 0 4px !important;
    line-height: 1.1 !important;
}

body.tv-lite-mode #pageIndicator {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;

    min-height: 24px !important;
    margin: 0 auto 9px !important;
    padding: 0 !important;

    background: transparent !important;
    border: none !important;
}

body.tv-lite-mode #pageIndicator .page-number,
body.tv-lite-mode #pageIndicator .page-priority {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-height: 22px !important;
    padding: 3px 9px !important;
    border-radius: 999px !important;

    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

body.tv-lite-mode #pageIndicator .page-number {
    color: #ffffff !important;
    background: #0b2f4a !important;
    border: 1px solid #14a3d6 !important;
}

body.tv-lite-mode #pageIndicator .page-priority {
    color: #ffffff !important;
    background: #8f0e2e !important;
    border: 1px solid #ff1744 !important;
}

/* Reserva espaço suficiente para título + paginação */
body.tv-lite-mode .cards-grid {
    height: calc(100% - 56px) !important;
}

@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .section-title {
        margin-bottom: 3px !important;
    }

    body.tv-lite-mode #pageIndicator {
        gap: 4px !important;
        min-height: 20px !important;
        margin-bottom: 7px !important;
    }

    body.tv-lite-mode #pageIndicator .page-number,
    body.tv-lite-mode #pageIndicator .page-priority {
        min-height: 19px !important;
        padding: 2px 7px !important;
        font-size: 8px !important;
    }

    body.tv-lite-mode .cards-grid {
        height: calc(100% - 49px) !important;
    }
}

@media (max-height: 620px) {
    body.tv-lite-mode #pageIndicator {
        margin-bottom: 5px !important;
    }

    body.tv-lite-mode #pageIndicator .page-number,
    body.tv-lite-mode #pageIndicator .page-priority {
        min-height: 17px !important;
        padding: 2px 6px !important;
        font-size: 7px !important;
    }

    body.tv-lite-mode .cards-grid {
        height: calc(100% - 43px) !important;
    }
}


/* =====================================================
   MODO TV-LITE V21 - AJUSTE FINAL
   Remove ícones dos cards e sobe os gráficos no zoom de 150%
===================================================== */

/* Remove o símbolo antes de PRIORIDADE FIXA */
body.tv-lite-mode .priority-card .card-status::first-letter {
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Remove o símbolo antes de "Aberto há" */
body.tv-lite-mode .tempo-aberto::first-letter {
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Garante que não apareçam pseudoícones antigos */
body.tv-lite-mode .priority-card .card-status::before,
body.tv-lite-mode .priority-card .card-status::after,
body.tv-lite-mode .tempo-aberto::before,
body.tv-lite-mode .tempo-aberto::after {
    content: none !important;
    display: none !important;
}

/* Reorganiza os textos depois da retirada dos ícones */
body.tv-lite-mode .priority-card .card-status {
    justify-content: center !important;
    text-align: center !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
}

body.tv-lite-mode .tempo-aberto {
    justify-content: center !important;
    text-align: center !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Sobe a área dos gráficos e reduz a distribuição */
body.tv-lite-mode .dashboard-charts {
    margin-top: calc(18vh + 4px) !important;
    height: calc(100% - 18vh - 4px) !important;
    gap: 4px !important;
    grid-template-rows: 47% 53% !important;
}

body.tv-lite-mode .summary-card {
    height: 18vh !important;
}

body.tv-lite-mode .dashboard-charts .chart-box:first-child {
    min-height: 0 !important;
    height: auto !important;
    padding-bottom: 5px !important;
}

body.tv-lite-mode #graficoStatus {
    height: calc(100% - 20px) !important;
    min-height: 0 !important;
    max-height: none !important;
}

body.tv-lite-mode #graficoStatus .chart-column {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

body.tv-lite-mode #graficoStatus .chart-bar {
    max-height: 78% !important;
}

/* Movimentação do mês ganha mais espaço e sobe */
body.tv-lite-mode .month-movement-box {
    min-height: 0 !important;
    height: auto !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
}

body.tv-lite-mode .month-kpis {
    margin-top: 2px !important;
    margin-bottom: 4px !important;
}

body.tv-lite-mode .month-chart,
body.tv-lite-mode #graficoMovimentoMes {
    height: calc(100% - 65px) !important;
    min-height: 0 !important;
    max-height: none !important;
}

/* Ajuste específico para zoom 150% / viewport menor */
@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .summary-card {
        height: 16vh !important;
    }

    body.tv-lite-mode .dashboard-charts {
        margin-top: calc(16vh + 3px) !important;
        height: calc(100% - 16vh - 3px) !important;
        gap: 3px !important;
        grid-template-rows: 44% 56% !important;
    }

    body.tv-lite-mode .dashboard-charts .chart-box:first-child {
        padding-top: 5px !important;
        padding-bottom: 3px !important;
    }

    body.tv-lite-mode #graficoStatus {
        height: calc(100% - 17px) !important;
    }

    body.tv-lite-mode #graficoStatus .chart-bar {
        max-height: 72% !important;
    }

    body.tv-lite-mode .month-movement-box {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    body.tv-lite-mode .month-kpi {
        height: 37px !important;
        min-height: 37px !important;
        max-height: 37px !important;
        padding: 5px 6px !important;
    }

    body.tv-lite-mode .month-kpi strong {
        font-size: 15px !important;
    }

    body.tv-lite-mode .month-chart,
    body.tv-lite-mode #graficoMovimentoMes {
        height: calc(100% - 56px) !important;
    }
}


/* =====================================================
   MODO TV-LITE V23 - ALINHAMENTO INFERIOR FINAL
   Faz a Movimentação do Mês terminar na mesma linha dos cards
===================================================== */

/* A área principal da última linha precisa ter altura controlada */
body.tv-lite-mode .orders-section,
body.tv-lite-mode .tv-summary,
body.tv-lite-mode .dashboard-charts {
    min-height: 0 !important;
    box-sizing: border-box !important;
}

/* Coluna direita ocupa exatamente a mesma altura da área dos pedidos */
body.tv-lite-mode .dashboard-charts {
    align-self: stretch !important;
    overflow: hidden !important;

    margin-top: calc(16vh + 4px) !important;
    height: calc(100% - 16vh - 4px) !important;

    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 44%) minmax(0, 56%) !important;
    gap: 4px !important;

    padding-bottom: 4px !important;
}

/* Resumo visual mais compacto para liberar espaço vertical */
body.tv-lite-mode .summary-card {
    height: 16vh !important;
    min-height: 0 !important;
    max-height: 16vh !important;
}

/* Distribuição um pouco menor */
body.tv-lite-mode .dashboard-charts .chart-box:first-child {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    padding-bottom: 5px !important;
}

body.tv-lite-mode #graficoStatus {
    height: calc(100% - 22px) !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
}

body.tv-lite-mode #graficoStatus .chart-column {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

body.tv-lite-mode #graficoStatus .chart-bar {
    max-height: 74% !important;
}

/* Movimentação usa todo o espaço restante e fecha alinhada */
body.tv-lite-mode .month-movement-box {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;

    display: flex !important;
    flex-direction: column !important;

    margin: 0 !important;
    padding: 7px 8px 6px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

body.tv-lite-mode .month-kpis {
    flex: 0 0 auto !important;
    margin: 2px 0 4px !important;
}

body.tv-lite-mode .month-chart,
body.tv-lite-mode #graficoMovimentoMes {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
}

/* A última linha dos cards e o gráfico terminam na mesma altura */
body.tv-lite-mode .orders-section {
    padding-bottom: 4px !important;
}

body.tv-lite-mode .cards-grid {
    padding-bottom: 4px !important;
}

/* Ajuste específico para zoom de 150% */
@media (max-width: 1366px), (max-height: 768px) {
    body.tv-lite-mode .summary-card {
        height: 14.5vh !important;
        max-height: 14.5vh !important;
    }

    body.tv-lite-mode .dashboard-charts {
        margin-top: calc(14.5vh + 3px) !important;
        height: calc(100% - 14.5vh - 3px) !important;
        grid-template-rows: minmax(0, 41%) minmax(0, 59%) !important;
        gap: 3px !important;
        padding-bottom: 3px !important;
    }

    body.tv-lite-mode .dashboard-charts .chart-box:first-child {
        padding-top: 5px !important;
        padding-bottom: 3px !important;
    }

    body.tv-lite-mode #graficoStatus {
        height: calc(100% - 18px) !important;
    }

    body.tv-lite-mode #graficoStatus .chart-bar {
        max-height: 68% !important;
    }

    body.tv-lite-mode .month-movement-box {
        padding: 5px 7px 4px !important;
    }

    body.tv-lite-mode .month-kpi {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        padding: 4px 6px !important;
    }

    body.tv-lite-mode .month-kpi strong {
        font-size: 15px !important;
    }

    body.tv-lite-mode .orders-section,
    body.tv-lite-mode .cards-grid {
        padding-bottom: 3px !important;
    }
}


/* =====================================================
   MENU DE MÓDULOS - INTEGRAÇÃO PERFORMANCE V24
   Aplicado apenas ao modo normal.
===================================================== */

.module-menu {
    display: grid;
    gap: 9px;
    margin: 0 0 16px;
}

.module-link {
    display: block;
    padding: 11px 12px;
    border: 1px solid rgba(20, 163, 214, 0.20);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
    color: #ffffff;
    text-decoration: none;
    transition: 0.18s ease;
}

.module-link:hover {
    transform: translateX(2px);
    border-color: rgba(20, 163, 214, 0.50);
    background: rgba(20, 163, 214, 0.12);
}

.module-link.active {
    border-color: var(--theme-line, #14a3d6);
    background: color-mix(in srgb, var(--theme-line, #14a3d6) 18%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--theme-line, #14a3d6) 18%, transparent);
}

.module-link-title {
    display: block;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

.module-link small {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 10px;
    line-height: 1.2;
}

.module-link.disabled {
    opacity: 0.42;
    cursor: default;
}

/* Preserva integralmente a visualização usada nas TVs. */
body.tv-mode .module-menu,
body.tv-lite-mode .module-menu {
    display: none !important;
}


/* =====================================================
   MENU UNIFICADO EM PÁGINA ÚNICA - V28
===================================================== */

.module-view {
    display: none;
}

.module-view.active {
    display: block;
}

.embedded-module-view {
    min-height: calc(100vh - 28px);
}

.embedded-module-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 14px 18px;
    border: 1px solid rgba(0, 166, 214, 0.42);
    border-radius: 16px;
    background: linear-gradient(180deg, #0d3855 0%, #0a2b43 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.embedded-module-label {
    display: block;
    margin-bottom: 4px;
    color: #bcd0dd;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#embeddedModuleTitle {
    color: #ffffff;
    font-size: 18px;
}

#btnVoltarDashboard {
    padding: 10px 14px;
    border: 1px solid rgba(0, 166, 214, 0.52);
    border-radius: 10px;
    color: #ffffff;
    background: rgba(0, 166, 214, 0.16);
    font-weight: 800;
    cursor: pointer;
}

#btnVoltarDashboard:hover {
    background: rgba(0, 166, 214, 0.28);
}

#moduleFrame {
    display: block;
    width: 100%;
    height: calc(100vh - 105px);
    min-height: 720px;
    border: 1px solid rgba(0, 166, 214, 0.35);
    border-radius: 18px;
    background: #071521;
}

body.tv-mode .embedded-module-view,
body.tv-lite-mode .embedded-module-view {
    display: none !important;
}

@media (max-width: 760px) {
    .embedded-module-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    #moduleFrame {
        height: 900px;
    }
}
