/* ============================================================
   TROCALOR Dashboard — Estilos V7.6.0
   Multi-Equipamento + Usuários + Responsividade Total
   ============================================================ */

:root {
    --bg-dark: #061020;
    --bg-card: #0e2a4a;
    --bg-card-2: #0a1f38;
    --border-blue: #1a4f7a;
    --border-light: #2a6fa8;
    --cyan: #28d6e8;
    --cyan-bright: #4ee6f5;
    --text: #e8f4f8;
    --text-soft: #a8c5d6;
    --text-muted: #6b8ba3;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #facc15;
    --orange: #f59e0b;
    --purple: #a855f7;
    --blue-info: #3b82f6;
    --gold: #ffb400;
    --radius: 10px;
    --radius-sm: 6px;
    --header-h: 64px;
    --footer-h: 44px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, #061020 0%, #0a1628 100%);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body.page-history,
body.page-alarms,
body.hub-body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: var(--border-blue); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; }
a { -webkit-tap-highlight-color: transparent; }

.app {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-rows: var(--header-h) 1fr var(--footer-h);
    overflow: hidden;
}

/* ============================================================
   TOPBAR + NAV
   ============================================================ */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: linear-gradient(90deg, #0d2242 0%, #13315a 50%, #0d2242 100%);
    border-bottom: 2px solid #1e5a8f;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand-logo {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: .08em;
    color: #fff;
    text-shadow: 0 0 20px rgba(78,230,245,0.3);
    white-space: nowrap;
}

.brand-logo-img {
    max-height: 44px;
    max-width: 180px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(78, 230, 245, 0.2));
    transition: transform 0.2s;
    display: block;
}

.brand-logo-img:hover { transform: scale(1.03); }

.brand-logo-fallback {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: .1em;
    color: #fff;
    text-shadow: 0 0 20px rgba(78, 230, 245, 0.4);
    align-items: center;
    display: none;
}

.brand-logo-fallback span { color: var(--gold); }

.brand-divider {
    width: 2px; height: 30px;
    background: linear-gradient(180deg, transparent, #4ee6f5, transparent);
    opacity: 0.6;
    flex-shrink: 0;
}

.brand-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .18em;
    color: #cfe8f5;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-soft);
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(40,214,232,0.08);
    color: var(--cyan-bright);
}

.nav-item.active {
    background: rgba(40,214,232,0.15);
    color: var(--cyan-bright);
    border-color: rgba(40,214,232,0.4);
    box-shadow: 0 0 12px rgba(40,214,232,0.15);
}

.nav-item i { font-size: 14px; }

.nav-config {
    background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(124,58,237,0.15)) !important;
    color: #c084fc !important;
    border-color: rgba(168,85,247,0.4) !important;
}

.nav-config:hover {
    background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(124,58,237,0.3)) !important;
    color: #e9d5ff !important;
    box-shadow: 0 0 12px rgba(168,85,247,0.3);
}

.nav-config.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.8);
    pointer-events: none;
    background: rgba(0,0,0,0.2) !important;
    color: var(--text-muted) !important;
    border-color: rgba(107,139,163,0.2) !important;
}

.status-area { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-blue);
    border-radius: 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-soft);
    transition: all 0.3s;
}

.status-badge .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.status-badge.online {
    color: var(--green);
    border-color: rgba(34,197,94,0.5);
    background: rgba(34,197,94,0.08);
}
.status-badge.online .dot {
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
    animation: pulse 2s ease-in-out infinite;
}
.status-badge.offline {
    color: var(--red);
    border-color: rgba(239,68,68,0.5);
    background: rgba(239,68,68,0.08);
}
.status-badge.offline .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }
.status-badge.warning {
    color: var(--yellow);
    border-color: rgba(250,204,21,0.5);
    background: rgba(250,204,21,0.08);
}
.status-badge.warning .dot { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(40, 214, 232, 0.08);
    border: 1px solid rgba(40, 214, 232, 0.3);
    border-radius: 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--cyan-bright);
    text-transform: uppercase;
    white-space: nowrap;
}

.user-level {
    background: rgba(255,180,0,0.15);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    letter-spacing: 0.08em;
    margin-left: 4px;
    border: 1px solid rgba(255,180,0,0.3);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(180deg, #ef4444, #dc2626);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-logout:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.clock {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .06em;
    color: #cfe8f5;
    border-left: 2px solid #1e5a8f;
    padding-left: 14px;
    white-space: nowrap;
}

/* ============================================================
   MAIN — LAYOUT 3 COLUNAS
   ============================================================ */

.main-content {
    display: grid;
    gap: 14px;
    padding: 14px;
    overflow: hidden;
    min-height: 0;
}

.main-3col {
    grid-template-columns: 320px 1fr 340px;
}

.col-left,
.col-center,
.col-right-new {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    min-height: 0;
    overflow-x: hidden;
}

/* ============================================================
   PANEL
   ============================================================ */

.panel {
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    overflow: hidden;
    flex-shrink: 0;
}

.panel-header {
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(40,214,232,0.12) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-blue);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .12em;
    color: var(--cyan-bright);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header .count {
    margin-left: auto;
    background: rgba(40,214,232,0.15);
    color: var(--cyan);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.panel-body { padding: 12px 16px; }

/* ============================================================
   FOTO DO EQUIPAMENTO
   ============================================================ */

.equip-photo {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #0e2a4a 0%, #081c33 100%);
    min-height: 200px;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 320px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.equip-photo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 8px 20px rgba(40,214,232,0.25));
    transition: transform 0.3s ease;
}

.equip-photo img:hover { transform: scale(1.02); }

/* ============================================================
   STATUS BADGE
   ============================================================ */

.status-badge.off,
.status-badge.on {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 28px);
    margin: 0 14px 14px;
    padding: 14px 16px;
    min-height: 52px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    line-height: 1;
    white-space: nowrap;
}

.status-badge.off {
    background: linear-gradient(180deg, #ef4444, #b91c1c);
    box-shadow:
        0 4px 14px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: #fff;
    animation: pulseRed 2s ease-in-out infinite;
}

.status-badge.on {
    background: linear-gradient(180deg, #22c55e, #15803d);
    box-shadow:
        0 4px 14px rgba(34, 197, 94, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #fff;
    animation: pulseGreen 2s ease-in-out infinite;
}

@keyframes pulseRed {
    0%, 100% {
        box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4),
                    inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
    50% {
        box-shadow: 0 4px 24px rgba(239, 68, 68, 0.7),
                    inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 4px 24px rgba(34, 197, 94, 0.7),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* ============================================================
   CONTROLES
   ============================================================ */

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-control {
    padding: 14px 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-control:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-control:active { transform: translateY(0); }
.btn-control svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-on { background: linear-gradient(180deg, #22c55e, #16a34a); box-shadow: 0 4px 14px rgba(34,197,94,0.35); }
.btn-off { background: linear-gradient(180deg, #ef4444, #dc2626); box-shadow: 0 4px 14px rgba(239,68,68,0.35); }
.btn-reset { background: linear-gradient(180deg, #f59e0b, #d97706); box-shadow: 0 4px 14px rgba(245,158,11,0.35); }

/* ============================================================
   SETPOINT
   ============================================================ */

.sp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sp-header .sp-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.sp-header .sp-atual { display: flex; align-items: baseline; gap: 3px; }
.sp-header .sp-atual .v { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 22px; color: var(--cyan-bright); }
.sp-header .sp-atual .u { font-size: 12px; color: var(--text-muted); }

.sp-controls { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }

.sp-btn {
    flex: 0 0 42px;
    height: 42px;
    border-radius: 6px;
    background: linear-gradient(180deg, #334155, #1e293b);
    border: 1px solid #475569;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sp-btn:hover { background: linear-gradient(180deg, #475569, #334155); }

.sp-input {
    flex: 1;
    height: 42px;
    background: #020c14;
    border: 1.5px solid #1a7a86;
    border-radius: 6px;
    color: var(--cyan-bright);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 20px;
    text-align: center;
    padding: 0 8px;
    min-width: 0;
}

.sp-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(40,214,232,0.3);
}

.sp-input.editando {
    border-color: var(--purple);
    box-shadow: 0 0 12px rgba(168,85,247,0.4);
}

.sp-apply {
    width: 100%;
    height: 44px;
    border-radius: 6px;
    background: linear-gradient(180deg, #a855f7, #7c3aed);
    border: none;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .12em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(168,85,247,0.4);
    transition: all 0.2s;
}

.sp-apply:hover { transform: translateY(-1px); filter: brightness(1.1); }

.sp-status {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    min-height: 14px;
    margin-top: 6px;
}

/* ============================================================
   SISTEMA
   ============================================================ */

.sys-list { display: flex; flex-direction: column; gap: 6px; }

.sys-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-soft);
    padding: 4px 0;
    border-bottom: 1px solid rgba(42,111,168,0.12);
    gap: 8px;
}

.sys-row:last-child { border-bottom: none; }

.sys-row .val {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--cyan-bright);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   PROCESSO
   ============================================================ */

.processo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.processo-card {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(42,111,168,0.3);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.processo-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--cyan);
    opacity: 0.7;
}

.processo-card.success::before { background: var(--green); }
.processo-card.warning::before { background: var(--yellow); }
.processo-card.danger::before  { background: var(--red); }

.processo-card:hover { border-color: var(--border-light); transform: translateY(-2px); }

.processo-card .label {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.processo-card .value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: var(--cyan-bright);
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.processo-card .value .unit { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.processo-card.warning .value { color: var(--yellow); }
.processo-card.danger .value  { color: var(--red); }

/* ============================================================
   DIGITAIS
   ============================================================ */

.digitais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.digital-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(42,111,168,0.25);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.digital-card.on {
    border-color: rgba(34,197,94,0.5);
    background: rgba(34,197,94,0.05);
}

.digital-card .led {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #374151;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.digital-card.on .led {
    background: radial-gradient(circle at 30% 30%, #86efac, #16a34a);
    box-shadow: 0 0 0 2px rgba(34,197,94,0.2), 0 0 12px rgba(34,197,94,0.8), inset 0 0 4px rgba(255,255,255,0.3);
}

.digital-card.off .led {
    background: radial-gradient(circle at 30% 30%, #9ca3af, #4b5563);
}

.digital-card .info { flex: 1; min-width: 0; }

.digital-card .info .label {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.digital-card .info .status {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 1px;
}

.digital-card.on .info .status { color: var(--green); }
.digital-card.off .info .status { color: #94a3b8; }

/* ============================================================
   STATUS DE ALARMES
   ============================================================ */

.status-alarmes-panel {
    border-color: rgba(239,68,68,0.4);
    background: linear-gradient(180deg, rgba(127,29,29,0.15) 0%, rgba(10,31,56,1) 100%);
}

.status-alarmes-panel .panel-header {
    background: linear-gradient(90deg, rgba(239,68,68,0.15) 0%, transparent 100%);
    color: #fca5a5;
}

.status-alarmes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.status-alarme-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(42,111,168,0.25);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.status-alarme-card.normal {
    border-color: rgba(34,197,94,0.3);
    background: rgba(34,197,94,0.04);
}

.status-alarme-card.ativo {
    border-color: rgba(239,68,68,0.6);
    background: rgba(239,68,68,0.1);
    animation: alarmPulse 1.5s ease-in-out infinite;
}

@keyframes alarmPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50%     { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

.status-alarme-card .sa-led {
    width: 16px; height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-alarme-card.normal .sa-led {
    background: radial-gradient(circle at 30% 30%, #86efac, #16a34a);
    box-shadow: 0 0 0 2px rgba(34,197,94,0.2), 0 0 10px rgba(34,197,94,0.6);
}

.status-alarme-card.ativo .sa-led {
    background: radial-gradient(circle at 30% 30%, #fca5a5, #dc2626);
    box-shadow: 0 0 0 2px rgba(239,68,68,0.3), 0 0 14px rgba(239,68,68,0.9);
    animation: ledBlink 0.8s ease-in-out infinite;
}

@keyframes ledBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.status-alarme-card .sa-info { flex: 1; min-width: 0; }

.status-alarme-card .sa-label {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-alarme-card .sa-status {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: 1px;
}

.status-alarme-card.normal .sa-status { color: var(--green); }
.status-alarme-card.ativo .sa-status  { color: #fca5a5; }

/* ============================================================
   RESUMO DA PLANTA
   ============================================================ */

.resumo-panel { border-color: rgba(40,214,232,0.4); }

.resumo-panel .panel-header {
    background: linear-gradient(90deg, rgba(40,214,232,0.15) 0%, transparent 100%);
    color: var(--cyan-bright);
}

.summary-list { display: flex; flex-direction: column; }

.summary-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 6px;
    border-bottom: 1px solid rgba(42,111,168,0.15);
}

.summary-row:last-child { border-bottom: none; }

.summary-led {
    width: 28px; height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.summary-led.green {
    background: radial-gradient(circle at 30% 30%, #86efac, #16a34a);
    box-shadow: 0 0 18px rgba(34,197,94,0.6), inset 0 0 8px rgba(255,255,255,0.3);
}

.summary-led.yellow {
    background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b);
    box-shadow: 0 0 18px rgba(245,158,11,0.6), inset 0 0 8px rgba(255,255,255,0.3);
}

.summary-led.red {
    background: radial-gradient(circle at 30% 30%, #fca5a5, #dc2626);
    box-shadow: 0 0 18px rgba(239,68,68,0.6), inset 0 0 8px rgba(255,255,255,0.3);
}

.summary-led.blue {
    background: radial-gradient(circle at 30% 30%, #7dd3fc, #0284c7);
    box-shadow: 0 0 18px rgba(56,189,248,0.6), inset 0 0 8px rgba(255,255,255,0.3);
}

.summary-label {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .08em;
    color: #cfe1e8;
    text-transform: uppercase;
}

.summary-value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #ffffff;
    min-width: 40px;
    text-align: right;
}

/* ============================================================
   IA — EFICIÊNCIA
   ============================================================ */

.ai-panel {
    border-color: rgba(168,85,247,0.4);
    background: linear-gradient(180deg, rgba(76,29,149,0.2) 0%, rgba(10,31,56,1) 100%);
}

.ai-panel .panel-header {
    color: #c084fc;
    border-bottom-color: rgba(168,85,247,0.3);
    background: linear-gradient(90deg, rgba(168,85,247,0.15) 0%, transparent 100%);
}

.ai-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px !important;
}

.ai-kpi {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(168,85,247,0.15);
    border-radius: 8px;
}

.ai-kpi .info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.ai-kpi .info .label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    color: #a8c5d6;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
}

.ai-kpi .info .sub {
    font-size: 10px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-kpi .value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #c084fc;
    text-shadow: 0 0 12px rgba(168,85,247,0.4);
    white-space: nowrap;
}

.ai-kpi .value.green { color: var(--green); text-shadow: 0 0 12px rgba(34,197,94,0.4); }
.ai-kpi .value.yellow { color: var(--yellow); text-shadow: 0 0 12px rgba(250,204,21,0.4); }
.ai-kpi .value.red { color: var(--red); text-shadow: 0 0 12px rgba(239,68,68,0.4); }
.ai-kpi .unit { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-left: 2px; }

.ai-performance-bar {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.4);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
    grid-column: 1 / -1;
}

.ai-performance-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease, background 0.5s ease;
}

.ai-recommendation {
    font-size: 11px;
    color: #c084fc;
    padding: 8px 10px;
    background: rgba(168,85,247,0.08);
    border-left: 3px solid #a855f7;
    border-radius: 4px;
    line-height: 1.4;
}

/* ============================================================
   CARGA TÉRMICA
   ============================================================ */

.carga-panel { border-color: rgba(245,158,11,0.4); }

.carga-panel .panel-header {
    color: #fcd34d;
    background: linear-gradient(90deg, rgba(245,158,11,0.15) 0%, transparent 100%);
}

.carga-body {
    text-align: center;
    padding: 14px 12px !important;
}

.carga-valor {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 42px;
    color: #22c55e;
    line-height: 1;
    text-shadow: 0 0 24px rgba(34,197,94,0.35);
}

.carga-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    letter-spacing: .22em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.carga-extra {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(42,111,168,0.15);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.carga-extra-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-soft);
}

.carga-extra-row .val {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--cyan-bright);
}

/* ============================================================
   PARTIDAS DE COMPRESSORES
   ============================================================ */

.comp-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
}

.comp-stat {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(42,111,168,0.2);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.comp-stat .label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
}

.comp-stat .value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--orange);
    line-height: 1.1;
    margin-top: 2px;
    text-shadow: 0 0 12px rgba(245,158,11,0.3);
}

.comp-stat .sub { font-size: 9px; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   CONSUMO
   ============================================================ */

.data-panel { border-color: rgba(34,197,94,0.35); }

.data-panel .panel-header {
    color: #86efac;
    background: linear-gradient(90deg, rgba(34,197,94,0.15) 0%, transparent 100%);
}

.data-body {
    padding: 10px 12px !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.data-item {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.data-item .label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 600;
}

.data-item .value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #86efac;
    line-height: 1.1;
    margin-top: 2px;
    text-shadow: 0 0 12px rgba(34,197,94,0.3);
}

.data-item .value .unit { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.data-item .sub { font-size: 9px; color: var(--text-muted); margin-top: 2px; }

.data-extra {
    padding-top: 8px;
    border-top: 1px solid rgba(34,197,94,0.15);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-soft);
}

.data-row .val {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #86efac;
}

.data-actions {
    display: flex;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(34,197,94,0.15);
}

.data-actions button {
    flex: 1;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid rgba(34,197,94,0.4);
    background: rgba(34,197,94,0.08);
    color: #86efac;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: .08em;
    transition: all 0.2s;
}

.data-actions button:hover { background: rgba(34,197,94,0.2); }

/* ============================================================
   MÉDIAS DE PROCESSO
   ============================================================ */

.medias-panel { border-color: rgba(78,230,245,0.35); }

.medias-panel .panel-header {
    color: #4ee6f5;
    background: linear-gradient(90deg, rgba(78,230,245,0.15) 0%, transparent 100%);
}

.measure-list { display: flex; flex-direction: column; }

.measure-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 2px;
    border-bottom: 1px solid rgba(42,111,168,0.12);
}

.measure-row:last-child { border-bottom: none; }

.measure-label {
    font-size: 12px;
    color: #cfe1e8;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.measure-value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--cyan-bright);
    display: flex;
    align-items: baseline;
    gap: 3px;
    white-space: nowrap;
}

.measure-value .unit {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.medias-actions {
    display: flex;
    gap: 6px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid rgba(78,230,245,0.15);
}

.medias-actions button {
    flex: 1;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid rgba(78,230,245,0.4);
    background: rgba(78,230,245,0.08);
    color: #4ee6f5;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: all 0.2s;
}

.medias-actions button:hover { background: rgba(78,230,245,0.2); }

/* ============================================================
   GRÁFICO
   ============================================================ */

.chart-panel { min-height: 320px; display: flex; flex-direction: column; }

.chart-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(42,111,168,0.15);
    flex-shrink: 0;
}

.chart-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-soft);
    cursor: pointer;
    user-select: none;
}

.chart-toggle input { width: 14px; height: 14px; accent-color: var(--cyan); cursor: pointer; }

.btn-clear {
    margin-left: auto;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.4);
    color: #fca5a5;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: .08em;
    transition: all 0.2s;
}

.btn-clear:hover { background: rgba(239,68,68,0.2); }

.chart-container {
    position: relative;
    height: 260px;
    padding: 10px 12px;
}

/* ============================================================
   ALARMES ATIVOS
   ============================================================ */

.alarms-panel {
    background: linear-gradient(180deg, rgba(127,29,29,0.35) 0%, rgba(10,31,56,1) 100%);
    border-color: var(--red);
    animation: alarmGlow 2s ease-in-out infinite;
    max-height: 200px;
    overflow-y: auto;
}

.alarms-panel .panel-header {
    color: #fca5a5;
    position: sticky;
    top: 0;
    z-index: 2;
}

@keyframes alarmGlow {
    0%,100% { box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 4px 24px rgba(239,68,68,0.4); }
}

.alarm-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 2px;
    border-bottom: 1px solid rgba(239,68,68,0.15);
    font-size: 12px;
}

.alarm-item:last-child { border-bottom: none; }
.alarm-item .icon { font-size: 14px; flex-shrink: 0; }
.alarm-item .desc { color: #fecaca; font-weight: 600; }

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 0 24px;
    background: linear-gradient(180deg, #0d2242 0%, #061020 100%);
    border-top: 2px solid #1e5a8f;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--text-soft);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.4);
    text-transform: uppercase;
}

.footer span span { color: var(--cyan-bright); font-weight: 700; }

/* ============================================================
   TOAST
   ============================================================ */

.toast {
    position: fixed;
    bottom: 70px;
    right: 24px;
    background: linear-gradient(135deg, #0e2a4a, #0a1f38);
    border: 1.5px solid var(--cyan);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    color: var(--cyan-bright);
    font-weight: 600;
    z-index: 1100;
    box-shadow: 0 8px 30px rgba(40,214,232,0.3);
    font-size: 13px;
    display: none;
    max-width: calc(100vw - 48px);
}

.toast.show { display: block; }

/* ============================================================
   PÁGINAS DE HISTÓRICO E ALARMES
   ============================================================ */

.history-app {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 24px 100px;
}

.history-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(90deg, #0d2242 0%, #13315a 50%, #0d2242 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border-blue);
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.history-topbar.alarms-header {
    background: linear-gradient(90deg, #2a0d1a 0%, #5a132a 50%, #2a0d1a 100%);
    border-color: rgba(239,68,68,0.4);
}

.history-topbar .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.history-topbar .title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.1em;
    color: #ffffff;
}

.history-topbar .subtitle { font-size: 13px; color: var(--text-soft); }
.history-topbar .header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: #fff;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
}

.btn-action:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-back { background: #475569; }
.btn-export { background: linear-gradient(135deg, #22c55e, #16a34a); }

.filters-card {
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 20px;
}

.filters-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--cyan-bright);
    text-transform: uppercase;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-item { display: flex; flex-direction: column; gap: 6px; }

.filter-item label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-item label i { color: var(--cyan); }

.filter-item input,
.filter-item select {
    padding: 10px 12px;
    background: #020c14;
    border: 1px solid var(--border-blue);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    width: 100%;
}

.filter-item input[type="color"] {
    padding: 4px;
    height: 40px;
    cursor: pointer;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(40,214,232,0.2);
}

.filter-buttons { display: flex; gap: 8px; }

.btn-filter {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-filter:hover { transform: translateY(-1px); filter: brightness(1.1); }

.btn-apply { background: linear-gradient(135deg, #0066ff, #00a3ff); }

.btn-quick {
    background: rgba(40,214,232,0.1);
    border: 1px solid var(--border-blue);
    color: var(--cyan);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .08em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-quick:hover { background: rgba(40,214,232,0.2); }
.btn-quick.active { background: rgba(40,214,232,0.25); border-color: var(--cyan); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.blue { background: linear-gradient(135deg, #0066ff, #00a3ff); }
.stat-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }

.stat-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.stat-value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--cyan-bright);
    line-height: 1.1;
}

.stat-value .unit { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.chart-card {
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.12em;
    color: var(--cyan-bright);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.table-card {
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-header {
    padding: 14px 18px;
    background: linear-gradient(90deg, rgba(40,214,232,0.12) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.table-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: var(--cyan-bright);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-count {
    background: rgba(40,214,232,0.15);
    color: var(--cyan);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.table-wrapper { max-height: 400px; overflow-y: auto; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }

table thead th {
    position: sticky;
    top: 0;
    background: #0a1f38;
    padding: 10px 12px;
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-blue);
    font-weight: 700;
    z-index: 1;
}

table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(42,111,168,0.1);
    color: #cfe1e8;
}

table tbody tr:hover { background: rgba(40,214,232,0.04); }

.badge-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-status.ok { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-status.warn { background: rgba(245,158,11,0.15); color: var(--orange); }
.badge-status.err { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-status.resolved { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-status.active { background: rgba(239,68,68,0.15); color: var(--red); animation: pulse 1.5s infinite; }

.badge-crit {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    margin-left: 6px;
}

.badge-crit.alta { background: rgba(239,68,68,0.2); color: var(--red); }
.badge-crit.media { background: rgba(245,158,11,0.2); color: var(--orange); }
.badge-crit.baixa { background: rgba(34,197,94,0.2); color: var(--green); }

.empty-row {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.badge-level {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.badge-level.admin {
    background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(124,58,237,0.25));
    color: #c084fc;
    border: 1px solid rgba(168,85,247,0.5);
}

.badge-level.operador {
    background: linear-gradient(135deg, rgba(40,214,232,0.2), rgba(0,153,204,0.2));
    color: #4ee6f5;
    border: 1px solid rgba(40,214,232,0.5);
}

.badge-level.manutencao {
    background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(217,119,6,0.2));
    color: #fcd34d;
    border: 1px solid rgba(245,158,11,0.5);
}

.badge-role {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(40,214,232,0.12);
    color: var(--cyan-bright);
    border: 1px solid rgba(40,214,232,0.3);
}

.btn-delete {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.4);
    color: #fca5a5;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(239,68,68,0.3);
    transform: scale(1.05);
}

/* ============================================================
   HUB — LISTA DE EQUIPAMENTOS
   ============================================================ */

.hub-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #061020 0%, #0a1628 100%);
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

.hub-app {
    display: grid;
    grid-template-rows: var(--header-h) 1fr;
    min-height: 100vh;
}

.hub-main {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    padding: 28px 24px 80px;
}

.hub-hero { margin-bottom: 28px; }

.hub-hero h1 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #4ee6f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hub-hero p {
    color: var(--text-soft);
    font-size: 15px;
    max-width: 720px;
    line-height: 1.5;
}

.hub-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.hub-metric {
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s;
}

.hub-metric:hover {
    border-color: var(--cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(40,214,232,0.15);
}

.hub-metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.hub-metric-icon.blue { background: linear-gradient(135deg, #0066ff, #00a3ff); }
.hub-metric-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.hub-metric-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.hub-metric-icon.purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }

.hub-metric-info { display: flex; flex-direction: column; gap: 2px; }

.hub-metric-value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 26px;
    color: var(--cyan-bright);
    line-height: 1;
}

.hub-metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

.hub-card {
    position: relative;
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: 16px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hub-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cyan-bright), transparent);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.hub-card:hover {
    transform: translateY(-4px);
    border-color: var(--cyan);
    box-shadow: 0 20px 40px rgba(40,214,232,0.2);
}

.hub-card:hover::before { opacity: 1; }

.hub-card-glow {
    position: absolute;
    top: -50%; right: -50%;
    width: 200px; height: 200px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.3s;
}

.hub-card:hover .hub-card-glow { opacity: 0.35; }

.hub-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.hub-card-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.hub-card-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 19px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-card-client {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hub-card-client i { color: var(--cyan); font-size: 11px; }

/* ============================================================
   STATUS DO CARD — MODBUS + LED
   ============================================================ */

.hub-card-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hub-card-modbus {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.3);
    border: 1.5px solid rgba(107,139,163,0.3);
    color: var(--text-muted);
    position: relative;
    flex-shrink: 0;
}

.hub-card-modbus i {
    position: relative;
    z-index: 1;
}

.hub-card-modbus.online {
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(16,185,129,0.2));
    border-color: rgba(34,197,94,0.6);
    color: #4ade80;
    box-shadow: 0 0 12px rgba(34,197,94,0.3);
    animation: wifiPulse 2s ease-in-out infinite;
}

.hub-card-modbus.online::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    background: radial-gradient(circle, rgba(34,197,94,0.4) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
    animation: wifiGlow 2s ease-in-out infinite;
}

@keyframes wifiPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

@keyframes wifiGlow {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 0.7; }
}

.hub-card-modbus.warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(217,119,6,0.2));
    border-color: rgba(245,158,11,0.6);
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(245,158,11,0.3);
}

.hub-card-modbus.offline {
    background: rgba(0,0,0,0.3);
    border-color: rgba(107,139,163,0.3);
    color: var(--text-muted);
    opacity: 0.6;
}

.hub-card-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s;
}

.hub-card-dot.online {
    background: radial-gradient(circle at 30% 30%, #86efac, #16a34a);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.2), 0 0 16px rgba(34,197,94,0.8);
    animation: pulse 2s ease-in-out infinite;
}

.hub-card-dot.offline {
    background: radial-gradient(circle at 30% 30%, #9ca3af, #4b5563);
}

.hub-card-dot.idle {
    background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.2), 0 0 12px rgba(245,158,11,0.6);
    animation: idlePulse 3s ease-in-out infinite;
}

@keyframes idlePulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* ============================================================
   BORDA DO CARD POR STATUS
   ============================================================ */

.hub-card.card-online {
    border-color: rgba(34,197,94,0.6);
    box-shadow:
        0 4px 16px rgba(0,0,0,0.3),
        0 0 20px rgba(34,197,94,0.15);
}

.hub-card.card-online::before {
    background: linear-gradient(90deg, transparent, #22c55e, transparent);
    opacity: 0.8;
}

.hub-card.card-warning {
    border-color: rgba(245,158,11,0.5);
    box-shadow:
        0 4px 16px rgba(0,0,0,0.3),
        0 0 20px rgba(245,158,11,0.15);
}

.hub-card.card-warning::before {
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
    opacity: 0.8;
}

.hub-card.card-offline {
    border-color: rgba(239,68,68,0.5);
    box-shadow:
        0 4px 16px rgba(0,0,0,0.3),
        0 0 20px rgba(239,68,68,0.15);
}

.hub-card.card-offline::before {
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    opacity: 0.8;
}

.hub-card.card-online:hover {
    border-color: rgba(34,197,94,1);
    box-shadow:
        0 20px 40px rgba(34,197,94,0.25),
        0 0 30px rgba(34,197,94,0.2);
}

.hub-card.card-offline:hover {
    border-color: rgba(239,68,68,0.9);
    box-shadow:
        0 20px 40px rgba(239,68,68,0.2),
        0 0 30px rgba(239,68,68,0.15);
}

/* ============================================================
   MÉTRICAS DO CARD
   ============================================================ */

.hub-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.hub-card-metric {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(42,111,168,0.25);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hub-card-metric .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hub-card-metric .value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--cyan-bright);
    line-height: 1.1;
}

.hub-card-metric .value .unit {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    margin-left: 2px;
}

.hub-card-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.35);
    border-left: 3px solid var(--red);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    animation: alarmPulse 1.5s ease-in-out infinite;
}

.hub-card-alert i { color: var(--red); }

.hub-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(42,111,168,0.15);
    position: relative;
    z-index: 1;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.hub-card-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.hub-card-topic {
    font-family: 'Courier New', monospace;
    color: var(--cyan);
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(40,214,232,0.08);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(40,214,232,0.2);
    font-size: 10px;
    white-space: nowrap;
}

.hub-card-serie {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
}

/* ============================================================
   BADGE OPERANDO / OFFLINE
   ============================================================ */

.hub-card-operacao {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid;
    line-height: 1;
    height: 24px;
    flex-shrink: 0;
}

.hub-card-operacao i {
    font-size: 7px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hub-card-operacao.on {
    background: rgba(34,197,94,0.18);
    color: #4ade80;
    border-color: rgba(34,197,94,0.6);
    box-shadow: 0 0 12px rgba(34,197,94,0.4);
    animation: badgePulseGreen 1.5s ease-in-out infinite;
}

.hub-card-operacao.on i {
    color: #22c55e;
    animation: dotPulse 1.2s ease-in-out infinite;
}

@keyframes badgePulseGreen {
    0%, 100% {
        box-shadow: 0 0 10px rgba(34,197,94,0.3),
                    inset 0 0 4px rgba(34,197,94,0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(34,197,94,0.7),
                    inset 0 0 8px rgba(34,197,94,0.2);
    }
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.75); }
}

.hub-card-operacao.offline {
    background: rgba(107,139,163,0.12);
    color: #64748b;
    border-color: rgba(107,139,163,0.3);
    box-shadow: none;
    opacity: 0.7;
}

.hub-card-operacao.offline i {
    font-size: 11px;
    color: #64748b;
    opacity: 0.7;
}

/* Card como link */
a.hub-card,
a.hub-card-link {
    text-decoration: none;
    color: inherit;
}

a.hub-card:hover,
a.hub-card-link:hover {
    text-decoration: none;
    color: inherit;
}

a.hub-card *,
a.hub-card-link * {
    text-decoration: none;
}

a.hub-card .hub-card-metrics,
a.hub-card .hub-card-metric,
a.hub-card .hub-card-header,
a.hub-card .hub-card-title,
a.hub-card .hub-card-footer,
a.hub-card .hub-card-client,
a.hub-card .hub-card-name,
a.hub-card .hub-card-topic,
a.hub-card .hub-card-serie,
a.hub-card-link .hub-card-metrics,
a.hub-card-link .hub-card-metric,
a.hub-card-link .hub-card-header,
a.hub-card-link .hub-card-title,
a.hub-card-link .hub-card-footer,
a.hub-card-link .hub-card-client,
a.hub-card-link .hub-card-name,
a.hub-card-link .hub-card-topic,
a.hub-card-link .hub-card-serie {
    pointer-events: none;
}

.hub-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: 16px;
}

.hub-empty i {
    font-size: 64px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #00a3ff, #4ee6f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.hub-empty h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 22px;
    color: var(--text);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hub-empty p {
    font-size: 14px;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================================================
   ADMIN — ABAS
   ============================================================ */

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    background: linear-gradient(180deg, #0e2a4a 0%, #0a1f38 100%);
    border: 1.5px solid var(--border-blue);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-soft);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    min-width: 150px;
}

.admin-tab:hover {
    background: rgba(40,214,232,0.08);
    color: var(--cyan-bright);
}

.admin-tab.active {
    background: linear-gradient(135deg, rgba(40,214,232,0.2), rgba(0,153,204,0.2));
    color: var(--cyan-bright);
    box-shadow: inset 0 0 12px rgba(40,214,232,0.15);
    border: 1px solid rgba(40,214,232,0.4);
}

.admin-tab i { font-size: 15px; }

.admin-aba { display: none; animation: abaFadeIn 0.3s ease; }
.admin-aba.active { display: block; }

@keyframes abaFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.equip-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-top: 8px;
    padding: 14px;
    background: rgba(0,0,0,0.25);
    border: 1.5px solid var(--border-blue);
    border-radius: var(--radius-sm);
    max-height: 320px;
    overflow-y: auto;
}

.equip-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.2);
    border: 1.5px solid rgba(42,111,168,0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.equip-checkbox:hover {
    border-color: var(--cyan);
    background: rgba(40,214,232,0.05);
}

.equip-checkbox input[type="checkbox"] { display: none; }

.equip-checkbox .check-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(42,111,168,0.5);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.equip-checkbox .check-box::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.equip-checkbox input:checked + .check-box {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border-color: #00d4ff;
    box-shadow: 0 0 12px rgba(40,214,232,0.4);
}

.equip-checkbox input:checked + .check-box::after {
    opacity: 1;
    transform: scale(1);
}

.equip-checkbox .check-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.equip-checkbox .check-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equip-checkbox .check-client {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   LOGIN SPLIT-SCREEN
   ============================================================ */

.login-split-body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #0a1628;
    font-family: 'Inter', sans-serif;
}

.login-split {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.login-split-left {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    background: linear-gradient(135deg, #061020 0%, #0a1e3a 100%);
    isolation: isolate;
}

.login-split-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.login-split-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: saturate(0.9) brightness(0.75);
    transform: scale(1.05);
    animation: splitBgZoom 30s ease-in-out infinite alternate;
}

@keyframes splitBgZoom {
    0%   { transform: scale(1.05) translate(0, 0); }
    100% { transform: scale(1.12) translate(-1%, -1%); }
}

.login-split-bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            rgba(6, 16, 32, 0.85) 0%,
            rgba(6, 16, 32, 0.65) 40%,
            rgba(6, 16, 32, 0.90) 100%);
}

.login-split-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(40, 214, 232, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(40, 214, 232, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at 30% 50%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 30% 50%, #000 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.login-split-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    padding: 48px 56px;
    color: #fff;
}

.login-logo-3d {
    display: inline-flex;
    align-items: center;
    perspective: 800px;
}

.login-logo-3d-wrap {
    display: inline-flex;
    align-items: center;
    transform-style: preserve-3d;
    transform: rotateX(6deg) rotateY(-6deg);
    animation: logo3dFloat 6s ease-in-out infinite;
    filter:
        drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6))
        drop-shadow(0 0 30px rgba(40, 214, 232, 0.35))
        drop-shadow(0 0 60px rgba(255, 180, 0, 0.15));
}

@keyframes logo3dFloat {
    0%, 100% { transform: rotateX(6deg) rotateY(-6deg) translateY(0); }
    50%      { transform: rotateX(6deg) rotateY(-6deg) translateY(-6px); }
}

.login-logo-3d-img {
    max-height: 90px;
    max-width: 280px;
    object-fit: contain;
    display: block;
}

.login-logo-3d-fallback {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 48px;
    letter-spacing: .08em;
    align-items: center;
    display: flex;
}

.trocalor-3d-troca { color: #ffb400; }
.trocalor-3d-lor { color: #ffffff; }

.login-hero-text {
    max-width: 560px;
    animation: heroFadeUp 0.9s ease 0.2s both;
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-hero-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.login-hero-highlight {
    background: linear-gradient(135deg, #4ee6f5 0%, #00a3ff 50%, #ffb400 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(78, 230, 245, 0.4));
}

.login-hero-desc {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(232, 244, 248, 0.85);
    margin-bottom: 32px;
    max-width: 500px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.login-hero-bullets {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.login-hero-bullet {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #cfe8f5;
}

.bullet-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ee6f5, #00a3ff);
    box-shadow: 0 0 12px rgba(78, 230, 245, 0.8);
    flex-shrink: 0;
}

.login-split-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: rgba(168, 197, 214, 0.7);
    letter-spacing: .06em;
}

.login-split-footer strong {
    color: #4ee6f5;
    font-weight: 700;
}

.login-split-right {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: linear-gradient(180deg, #f0f4fa 0%, #e8edf5 100%);
    overflow-y: auto;
    overflow-x: hidden;
}

.login-card-split {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(10, 22, 40, 0.12),
        0 4px 12px rgba(10, 22, 40, 0.06);
    padding: 44px 40px 36px;
    position: relative;
    overflow: hidden;
}

.login-card-split::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, #00a3ff 0%, #4ee6f5 50%, #ffb400 100%);
}

.login-card-split-header { margin-bottom: 28px; }

.login-card-split-header h2 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 30px;
    letter-spacing: -0.02em;
    color: #0a1628;
    margin-bottom: 6px;
    line-height: 1.1;
}

.login-card-split-header p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

.form-group-split {
    margin-bottom: 20px;
    position: relative;
}

.form-group-split label {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #334155;
    margin-bottom: 8px;
}

.input-wrap-split { position: relative; }

.input-wrap-split > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
}

.form-group-split input {
    width: 100%;
    height: 52px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 16px 0 46px;
    color: #0a1628;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.25s;
    outline: none;
}

.form-group-split input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.form-group-split input:focus {
    border-color: #00a3ff;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 163, 255, 0.12);
}

.form-group-split input:focus + i,
.form-group-split input:not(:placeholder-shown) + i {
    color: #00a3ff;
}

.btn-toggle-senha {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-senha:hover {
    background: #e2e8f0;
    color: #0a1628;
}

.btn-login-split {
    width: 100%;
    height: 54px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0a1e3a 0%, #1e3a8a 100%);
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(10, 30, 58, 0.25);
    transition: all 0.25s;
}

.btn-login-split:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(10, 30, 58, 0.35);
    background: linear-gradient(135deg, #0a1e3a 0%, #2563eb 100%);
}

.erro-box-split {
    margin-top: 18px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 3px solid #ef4444;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-card-split-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.login-card-split-footer i {
    color: #00a3ff;
    font-size: 13px;
}

.login-split-version {
    margin-top: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.version-num {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: .08em;
}

.version-brand {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    color: #64748b;
    letter-spacing: .04em;
}

.version-brand strong {
    font-weight: 700;
    color: #0a1628;
}

/* ============================================================
   RESPONSIVIDADE COMPLETA — V7.6.0
   ============================================================ */

/* ============================================================
   ≥ 1920px — Monitores 4K / Full HD+
   ============================================================ */
@media (min-width: 1920px) {
    .main-3col {
        grid-template-columns: 380px 1fr 400px;
        gap: 18px;
        padding: 18px;
    }
    .equip-photo { min-height: 260px; max-height: 400px; }
    .hub-grid { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 22px; }
    .hub-main { max-width: 1900px; padding: 32px 32px 100px; }
    .hub-card { padding: 26px; }
    .hub-card-name { font-size: 22px; }
    .hub-card-metric .value { font-size: 22px; }
    .processo-card .value { font-size: 38px; }
    .history-app { max-width: 1900px; }
}

/* ============================================================
   1440px – 1920px — Desktop grande
   ============================================================ */
@media (min-width: 1440px) and (max-width: 1919px) {
    .main-3col { grid-template-columns: 340px 1fr 360px; }
    .equip-photo { min-height: 220px; max-height: 340px; }
}

/* ============================================================
   1200px – 1440px — Desktop padrão
   ============================================================ */
@media (max-width: 1440px) and (min-width: 1201px) {
    .main-3col { grid-template-columns: 300px 1fr 320px; }
}

/* ============================================================
   1000px – 1200px — Notebook pequeno
   ============================================================ */
@media (max-width: 1200px) and (min-width: 1001px) {
    .main-3col { grid-template-columns: 280px 1fr 300px; }
    .nav-menu { gap: 4px; }
    .nav-item { padding: 6px 10px; font-size: 11px; }
    .brand-title { display: none; }
    .equip-photo { min-height: 180px; max-height: 280px; }
    .status-badge.off, .status-badge.on { font-size: 20px; min-height: 48px; }
    .hub-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ============================================================
   768px – 1000px — Tablet paisagem
   ============================================================ */
@media (max-width: 1000px) and (min-width: 769px) {
    html, body { overflow: auto; height: auto; min-height: 100vh; }
    .app { height: auto; min-height: 100vh; }
    .main-3col {
        grid-template-columns: 1fr 1fr;
        overflow: visible;
        height: auto;
        padding: 12px;
        gap: 12px;
    }
    .col-left { grid-column: 1; }
    .col-right-new { grid-column: 2; }
    .col-center { grid-column: 1 / 3; }
    .col-left, .col-center, .col-right-new { overflow: visible; }
    .tables-grid { grid-template-columns: 1fr; }
    .equip-photo { min-height: 200px; max-height: 320px; aspect-ratio: 4 / 3; }
    .status-badge.off, .status-badge.on { font-size: 22px; min-height: 52px; padding: 14px 16px; }
    .footer {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px;
        height: auto;
        min-height: var(--footer-h);
    }
    .hub-metrics { grid-template-columns: repeat(2, 1fr); }
    .hub-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

    .login-split { grid-template-columns: 1fr 1fr; }
    .login-logo-3d-img { max-height: 70px; max-width: 200px; }
    .login-hero-title { font-size: clamp(26px, 4vw, 36px); }
    .login-hero-desc { font-size: 14px; }
    .login-split-content { padding: 36px 40px; }
}

/* ============================================================
   600px – 768px — Tablet retrato / Celular grande
   ============================================================ */
@media (max-width: 768px) {
    :root { --header-h: 56px; }

    .topbar {
        flex-wrap: wrap;
        padding: 8px 12px;
        height: auto;
        min-height: var(--header-h);
        gap: 8px;
    }
    .brand { flex: 1; min-width: 0; }
    .brand-logo-img { max-height: 32px; max-width: 120px; }
    .brand-divider { display: none; }
    .brand-title { display: none; }
    .brand-logo-fallback { font-size: 18px; }
    .user-chip { display: none; }

    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        flex-wrap: nowrap;
        scrollbar-width: thin;
    }
    .nav-menu::-webkit-scrollbar { height: 3px; }
    .nav-item {
        padding: 6px 12px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .nav-item i { font-size: 12px; }

    .status-area { gap: 8px; flex: 1; justify-content: flex-end; flex-wrap: nowrap; }
    .status-badge { padding: 4px 10px; font-size: 10px; }
    .status-badge .label { display: none; }
    .status-badge .dot { width: 12px; height: 12px; }
    .clock { font-size: 11px; padding-left: 10px; border-left-width: 1px; }

    .main-3col {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 10px;
        overflow: visible;
        height: auto;
    }
    .col-left, .col-center, .col-right-new {
        grid-column: 1 !important;
        overflow: visible;
    }

    .panel-header { font-size: 12px; padding: 8px 12px; }
    .panel-body { padding: 10px 12px; }

    .equip-photo {
        min-height: 180px;
        max-height: 280px;
        aspect-ratio: auto;
    }
    .status-badge.off, .status-badge.on {
        font-size: 18px;
        min-height: 46px;
        padding: 12px 14px;
        letter-spacing: .1em;
    }

    .btn-control { font-size: 12px; padding: 12px 8px; }
    .sp-btn { flex: 0 0 38px; height: 38px; font-size: 20px; }
    .sp-input { height: 38px; font-size: 18px; }

    .processo-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .processo-card { padding: 10px 12px; }
    .processo-card .value { font-size: 24px; }
    .processo-card .value .unit { font-size: 12px; }

    .digitais-grid { grid-template-columns: 1fr; }
    .status-alarmes-grid { grid-template-columns: 1fr; }

    .chart-controls { gap: 8px; padding: 6px 12px; }
    .chart-toggle { font-size: 10px; }
    .chart-container { height: 200px; padding: 6px 8px; }

    .carga-valor { font-size: 34px; }

    .footer {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
        height: auto;
        min-height: var(--footer-h);
        font-size: 9px;
    }
    .footer span { white-space: nowrap; }

    .toast { bottom: 20px; right: 12px; left: 12px; max-width: none; }

    .hub-main { padding: 20px 14px 80px; }
    .hub-hero h1 { font-size: 24px; }
    .hub-hero p { font-size: 13px; }
    .hub-metrics { grid-template-columns: 1fr; gap: 10px; }
    .hub-metric { padding: 12px 14px; }
    .hub-metric-value { font-size: 22px; }
    .hub-grid { grid-template-columns: 1fr; gap: 12px; }
    .hub-card { padding: 16px; gap: 12px; border-radius: 12px; }
    .hub-card-name { font-size: 17px; }
    .hub-card-metric .value { font-size: 16px; }
    .hub-card-metric .label { font-size: 9px; }
    .hub-card-modbus { width: 28px; height: 28px; font-size: 13px; }

    .history-app { padding: 12px 12px 90px; }
    .history-topbar {
        padding: 12px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .history-topbar .title { font-size: 18px; }
    .history-topbar .subtitle { font-size: 12px; }
    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    .btn-action { width: 100%; justify-content: center; padding: 10px 14px; font-size: 12px; }
    .admin-tabs { flex-direction: column; padding: 4px; }
    .admin-tab { padding: 10px 16px; font-size: 12px; min-width: auto; }
    .admin-form-grid { grid-template-columns: 1fr; gap: 10px; }
    .filters-card { padding: 14px 16px; }
    .filters-title { font-size: 12px; }
    .filters-row { grid-template-columns: 1fr; }
    .filter-item label { font-size: 10px; }
    .filter-item input,
    .filter-item select { padding: 9px 10px; font-size: 12px; }
    .btn-filter { padding: 9px 14px; font-size: 11px; }
    .equip-checkbox-grid { grid-template-columns: 1fr; max-height: 400px; }
    .equip-checkbox { padding: 9px 12px; }
    .equip-checkbox .check-name { font-size: 13px; }
    .equip-checkbox .check-client { font-size: 10px; }
    .btn-delete { padding: 5px 10px; font-size: 11px; }

    .table-card { border-radius: 8px; }
    .table-header { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
    .table-title { font-size: 12px; }
    .table-count { font-size: 10px; }
    .table-wrapper { max-height: 320px; }
    table { font-size: 11px; }
    table thead th { padding: 8px 10px; font-size: 9px; }
    table tbody td { padding: 7px 10px; font-size: 10px; }
    .badge-status { font-size: 9px; padding: 2px 8px; }
    .badge-crit { font-size: 8px; padding: 1px 6px; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 12px 14px; }
    .stat-icon { width: 38px; height: 38px; font-size: 16px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 9px; }

    .chart-card { padding: 14px 16px; }
    .chart-title { font-size: 12px; }
    .chart-header { flex-direction: column; align-items: flex-start; gap: 8px; }

    .login-split {
        grid-template-columns: 1fr;
        grid-template-rows: 40vh 1fr;
        height: auto;
        min-height: 100vh;
    }
    .login-split-body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    .login-split-left { min-height: 40vh; }
    .login-split-content { padding: 24px 28px; }
    .login-logo-3d-img { max-height: 50px; max-width: 160px; }
    .login-logo-3d-fallback { font-size: 32px; }
    .login-hero-title { font-size: 22px; margin-bottom: 10px; }
    .login-hero-desc { font-size: 12px; margin-bottom: 14px; }
    .login-hero-bullets { gap: 14px; }
    .login-hero-bullet { font-size: 11px; }
    .login-split-footer { font-size: 10px; margin-top: 14px; }
    .login-split-right { padding: 24px 20px; }
    .login-card-split { padding: 28px 22px 24px; border-radius: 14px; }
    .login-card-split-header h2 { font-size: 24px; }
    .login-card-split-header p { font-size: 12px; }
    .form-group-split { margin-bottom: 14px; }
    .form-group-split label { font-size: 11px; }
    .form-group-split input { height: 46px; font-size: 14px; }
    .btn-login-split { height: 48px; font-size: 13px; }
    .login-card-split-footer { font-size: 11px; }
}

/* ============================================================
   480px – 600px — Celular médio
   ============================================================ */
@media (max-width: 600px) {
    .hub-hero h1 { font-size: 22px; }
    .hub-hero p { font-size: 12px; }
    .hub-card { padding: 14px; }
    .hub-card-name { font-size: 16px; }
    .hub-card-metric .value { font-size: 15px; }
    .hub-card-modbus { width: 26px; height: 26px; font-size: 12px; }
    .hub-card-dot { width: 12px; height: 12px; }
    .hub-card-topic { font-size: 9px; padding: 3px 8px; }
    .hub-card-serie { font-size: 9px; }
    .hub-card-operacao { font-size: 10px; padding: 4px 9px; height: 22px; }

    .processo-grid { grid-template-columns: 1fr 1fr; }
    .processo-card .value { font-size: 22px; }
    .processo-card .label { font-size: 10px; }

    .digitais-grid { grid-template-columns: 1fr; }
    .status-alarmes-grid { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 10px 12px; }

    .login-split { grid-template-rows: 32vh 1fr; }
    .login-split-content { padding: 20px 22px; }
    .login-logo-3d-img { max-height: 42px; max-width: 140px; }
    .login-logo-3d-fallback { font-size: 26px; }
    .login-hero-title { font-size: 20px; }
    .login-hero-desc { font-size: 11px; margin-bottom: 10px; }
    .login-hero-bullets { gap: 10px; flex-wrap: wrap; }
    .login-hero-bullet { font-size: 10px; }
    .bullet-dot { width: 6px; height: 6px; }
    .login-split-footer { font-size: 9px; gap: 6px; }
    .login-card-split { padding: 24px 18px 20px; }
    .login-card-split-header h2 { font-size: 22px; }
    .form-group-split input { height: 44px; font-size: 13px; }
    .btn-login-split { height: 46px; font-size: 12px; }

    table thead th:nth-child(n+5),
    table tbody td:nth-child(n+5) {
        display: none;
    }
}

/* ============================================================
   ≤ 480px — Celular pequeno
   ============================================================ */
@media (max-width: 480px) {
    :root { --header-h: 52px; --footer-h: 40px; }

    .topbar { padding: 6px 10px; gap: 6px; }
    .brand-logo-img { max-height: 26px; max-width: 100px; }
    .brand-logo-fallback { font-size: 16px; }
    .status-badge { padding: 3px 8px; }
    .clock { font-size: 10px; border-left: none; padding-left: 0; }

    .nav-item { padding: 5px 10px; font-size: 10px; gap: 5px; }
    .nav-item i { font-size: 11px; }

    .main-3col { padding: 8px; gap: 8px; }

    .panel-header { font-size: 11px; padding: 7px 10px; letter-spacing: .08em; }
    .panel-body { padding: 8px 10px; }

    .equip-photo { min-height: 130px; max-height: 200px; padding: 8px; }
    .status-badge.off, .status-badge.on {
        font-size: 15px;
        min-height: 40px;
        padding: 10px 12px;
        letter-spacing: .08em;
    }

    .control-grid { gap: 5px; }
    .btn-control { font-size: 10px; padding: 10px 6px; gap: 4px; letter-spacing: .08em; }
    .btn-control svg { width: 12px; height: 12px; }

    .sp-btn { flex: 0 0 32px; height: 32px; font-size: 16px; }
    .sp-input { height: 32px; font-size: 15px; }
    .sp-apply { height: 36px; font-size: 11px; letter-spacing: .08em; }
    .sp-header .sp-atual .v { font-size: 18px; }

    .sys-row { font-size: 11px; padding: 3px 0; }
    .sys-row .val { font-size: 12px; }

    .processo-grid { grid-template-columns: 1fr; gap: 6px; }
    .processo-card { padding: 8px 10px; }
    .processo-card .value { font-size: 20px; }
    .processo-card .label { font-size: 9px; margin-bottom: 4px; }

    .digital-card { padding: 8px 10px; gap: 8px; }
    .digital-card .info .label { font-size: 11px; }
    .digital-card .info .status { font-size: 10px; }
    .digital-card .led { width: 14px; height: 14px; }

    .status-alarme-card { padding: 8px 10px; gap: 8px; }
    .status-alarme-card .sa-label { font-size: 11px; }
    .status-alarme-card .sa-status { font-size: 10px; }

    .summary-row { padding: 8px 4px; gap: 8px; }
    .summary-led { width: 20px; height: 20px; }
    .summary-label { font-size: 11px; }
    .summary-value { font-size: 18px; min-width: 30px; }

    .ai-body { padding: 8px 10px !important; gap: 8px; }
    .ai-kpi { padding: 6px 8px; gap: 6px; }
    .ai-kpi .info .label { font-size: 9px; }
    .ai-kpi .info .sub { font-size: 9px; }
    .ai-kpi .value { font-size: 18px; }
    .ai-kpi .unit { font-size: 10px; }
    .ai-recommendation { font-size: 10px; padding: 6px 8px; }

    .carga-body { padding: 10px 8px !important; }
    .carga-valor { font-size: 26px; }
    .carga-label { font-size: 9px; letter-spacing: .16em; }
    .carga-extra-row { font-size: 11px; }
    .carga-extra-row .val { font-size: 13px; }

    .comp-stats { padding: 8px 10px; gap: 6px; }
    .comp-stat { padding: 6px 8px; }
    .comp-stat .label { font-size: 8px; }
    .comp-stat .value { font-size: 18px; }
    .comp-stat .sub { font-size: 8px; }

    .data-body { padding: 8px 10px !important; gap: 8px; }
    .data-main { gap: 6px; }
    .data-item { padding: 6px 8px; }
    .data-item .label { font-size: 8px; }
    .data-item .value { font-size: 16px; }
    .data-item .sub { font-size: 8px; }
    .data-row { font-size: 10px; }
    .data-row .val { font-size: 11px; }
    .data-actions button { padding: 4px 6px; font-size: 9px; }

    .measure-row { padding: 6px 2px; gap: 6px; }
    .measure-label { font-size: 11px; }
    .measure-value { font-size: 15px; }
    .measure-value .unit { font-size: 10px; }
    .medias-actions button { padding: 5px 6px; font-size: 9px; }

    .chart-container { height: 170px; padding: 4px 6px; }
    .chart-controls { flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 10px; }
    .chart-toggle { font-size: 10px; }
    .btn-clear { margin-left: 0; width: 100%; padding: 5px 10px; }

    .footer {
        font-size: 8px;
        gap: 6px;
        padding: 6px 8px;
        flex-wrap: wrap;
    }
    .footer span { white-space: nowrap; }

    .hub-main { padding: 16px 10px 70px; }
    .hub-hero { margin-bottom: 18px; }
    .hub-hero h1 { font-size: 20px; }
    .hub-hero p { font-size: 11px; }
    .hub-metrics { gap: 8px; margin-bottom: 18px; }
    .hub-metric { padding: 10px 12px; gap: 10px; }
    .hub-metric-icon { width: 38px; height: 38px; font-size: 16px; }
    .hub-metric-value { font-size: 20px; }
    .hub-metric-label { font-size: 9px; }
    .hub-grid { gap: 10px; }
    .hub-card { padding: 12px; border-radius: 10px; gap: 10px; }
    .hub-card-name { font-size: 15px; }
    .hub-card-client { font-size: 10px; }
    .hub-card-metric { padding: 8px 10px; }
    .hub-card-metric .label { font-size: 8px; }
    .hub-card-metric .value { font-size: 14px; }
    .hub-card-alert { padding: 6px 10px; font-size: 11px; }
    .hub-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding-top: 8px;
    }
    .hub-card-footer-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        width: 100%;
    }
    .hub-card-topic { font-size: 9px; padding: 3px 8px; }
    .hub-card-serie { font-size: 9px; }
    .hub-card-operacao { font-size: 9px; padding: 3px 8px; height: 20px; }

    .history-app { padding: 8px 8px 80px; }
    .history-topbar { padding: 10px 12px; gap: 8px; }
    .history-topbar .title { font-size: 16px; }
    .history-topbar .subtitle { font-size: 11px; }
    .btn-action { padding: 8px 12px; font-size: 11px; }
    .admin-tab { padding: 8px 12px; font-size: 11px; }
    .admin-tab i { font-size: 12px; }
    .filters-card { padding: 12px 14px; }
    .filters-title { font-size: 11px; margin-bottom: 10px; }
    .filter-item label { font-size: 9px; }
    .filter-item input,
    .filter-item select { padding: 8px 10px; font-size: 11px; }
    .btn-filter { padding: 8px 12px; font-size: 10px; }
    .btn-quick { padding: 8px 10px; font-size: 10px; }
    .equip-checkbox { padding: 8px 10px; gap: 10px; }
    .equip-checkbox .check-box { width: 18px; height: 18px; }
    .equip-checkbox .check-name { font-size: 12px; }
    .equip-checkbox .check-client { font-size: 9px; }
    .btn-delete { padding: 4px 8px; font-size: 10px; }

    table { font-size: 10px; }
    table thead th { padding: 6px 8px; font-size: 8px; }
    table tbody td { padding: 6px 8px; font-size: 10px; }
    table thead th:nth-child(n+4),
    table tbody td:nth-child(n+4) {
        display: none;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 10px 12px; gap: 10px; }
    .stat-icon { width: 34px; height: 34px; font-size: 14px; }
    .stat-value { font-size: 16px; }
    .stat-label { font-size: 8px; }

    .chart-card { padding: 12px 14px; }
    .chart-title { font-size: 11px; }
    .chart-header { gap: 6px; }

    .login-split { grid-template-rows: 28vh 1fr; }
    .login-split-content { padding: 16px 18px; }
    .login-logo-3d-img { max-height: 36px; max-width: 120px; }
    .login-logo-3d-fallback { font-size: 22px; }
    .login-hero-title { font-size: 18px; }
    .login-hero-desc { display: none; }
    .login-hero-bullets { gap: 8px; }
    .login-hero-bullet { font-size: 9px; }
    .bullet-dot { width: 5px; height: 5px; }
    .login-split-footer { font-size: 8px; margin-top: 10px; gap: 4px; }
    .login-split-right { padding: 20px 16px; }
    .login-card-split { padding: 22px 18px 20px; border-radius: 12px; }
    .login-card-split-header h2 { font-size: 20px; }
    .login-card-split-header p { font-size: 11px; }
    .form-group-split { margin-bottom: 12px; }
    .form-group-split label { font-size: 10px; margin-bottom: 6px; }
    .form-group-split input { height: 42px; font-size: 12px; padding: 0 14px 0 40px; }
    .input-wrap-split > i { left: 14px; font-size: 13px; }
    .btn-login-split { height: 44px; font-size: 11px; gap: 8px; }
    .login-card-split-footer { font-size: 10px; padding-top: 14px; margin-top: 18px; }
    .login-split-version { margin-top: 20px; }
    .version-num { font-size: 9px; }
    .version-brand { font-size: 11px; }
}

/* ============================================================
   ≤ 360px — Celular muito pequeno
   ============================================================ */
@media (max-width: 360px) {
    .status-badge.off, .status-badge.on {
        font-size: 13px;
        min-height: 36px;
        padding: 8px 10px;
    }
    .btn-control { font-size: 9px; padding: 8px 4px; }
    .processo-card .value { font-size: 18px; }
    .carga-valor { font-size: 22px; }
    .stats-grid { grid-template-columns: 1fr; }
    .hub-card-name { font-size: 14px; }
    .hub-card-metric .value { font-size: 13px; }
    .chart-container { height: 150px; }
    .login-hero-title { font-size: 16px; }
    .login-card-split-header h2 { font-size: 18px; }
    .form-group-split input { height: 40px; font-size: 11px; }
    .btn-login-split { height: 40px; font-size: 10px; }
    .footer { font-size: 7px; gap: 4px; }
}

/* ============================================================
   Paisagem em celular (altura ≤ 500px)
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    :root { --header-h: 48px; --footer-h: 36px; }

    .topbar {
        padding: 4px 10px;
        min-height: var(--header-h);
    }
    .brand-logo-img { max-height: 24px; max-width: 90px; }

    .main-3col {
        grid-template-columns: 260px 1fr 280px;
        padding: 8px;
        gap: 8px;
    }

    .equip-photo {
        min-height: 110px;
        max-height: 150px;
        aspect-ratio: auto;
    }
    .status-badge.off, .status-badge.on {
        font-size: 15px;
        min-height: 38px;
        padding: 8px 10px;
    }

    .panel-header { padding: 6px 12px; font-size: 12px; }
    .panel-body { padding: 8px 12px; }

    .chart-container { height: 140px; }
    .processo-card .value { font-size: 22px; }
    .carga-valor { font-size: 30px; }
    .sys-row { padding: 2px 0; font-size: 11px; }
    .summary-row { padding: 8px 4px; }
    .ai-body { padding: 8px 10px !important; gap: 8px; }
    .ai-kpi { padding: 6px 8px; }

    .hub-main { padding: 16px 16px 60px; }
    .hub-hero { margin-bottom: 16px; }
    .hub-metrics { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }

    .login-split {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
        height: 100vh;
    }
    .login-logo-3d-img { max-height: 40px; max-width: 130px; }
    .login-hero-title { font-size: 18px; }
    .login-hero-desc { display: none; }
    .login-split-content { padding: 16px 24px; }
    .login-card-split { padding: 20px 20px 18px; max-width: 340px; }
    .login-card-split-header { margin-bottom: 16px; }
    .login-card-split-header h2 { font-size: 20px; }
    .form-group-split { margin-bottom: 10px; }
    .form-group-split input { height: 40px; font-size: 12px; }
    .btn-login-split { height: 42px; font-size: 12px; }
    .login-card-split-footer { margin-top: 14px; padding-top: 12px; }
}

/* ============================================================
   Reduz animações se o usuário preferir
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .login-split-bg-img,
    .login-logo-3d-wrap {
        animation: none;
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   Impressão
   ============================================================ */
@media print {
    .topbar, .footer, .nav-menu, .status-area, .btn-logout,
    .btn-action, .admin-tabs, .data-actions, .medias-actions {
        display: none !important;
    }
    .main-3col { grid-template-columns: 1fr; overflow: visible; height: auto; }
    body { background: white; color: black; overflow: visible; height: auto; }
}
/* ============================================================
   CORREÇÕES MOBILE — V7.7.0
   Resolve sobreposição de cards em telas pequenas
   ============================================================ */

@media (max-width: 480px) {
    /* ---------- LAYOUT GERAL ---------- */
    html, body {
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh !important;
    }

    .app {
        height: auto !important;
        min-height: 100vh !important;
        display: block !important;
    }

    .main-content {
        display: block !important;
        padding: 8px !important;
        overflow: visible !important;
        height: auto !important;
    }

    .main-3col {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        grid-template-columns: none !important;
        padding: 0 !important;
    }

    .col-left,
    .col-center,
    .col-right-new {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        overflow: visible !important;
        grid-column: auto !important;
    }

    /* ---------- TOPBAR ---------- */
    .topbar {
        padding: 6px 10px !important;
        gap: 6px !important;
        min-height: 52px !important;
        flex-wrap: wrap !important;
    }

    .brand-logo-img {
        max-height: 24px !important;
        max-width: 90px !important;
    }

    .status-area {
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .status-badge {
        padding: 3px 8px !important;
        font-size: 9px !important;
    }

    .status-badge .label {
        display: none !important;
    }

    .user-chip {
        display: none !important;
    }

    .clock {
        font-size: 9px !important;
        border-left: none !important;
        padding-left: 0 !important;
    }

    .nav-menu {
        order: 3 !important;
        width: 100% !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        padding-bottom: 4px !important;
        gap: 4px !important;
    }

    .nav-item {
        padding: 5px 10px !important;
        font-size: 10px !important;
        flex-shrink: 0 !important;
    }

    /* ---------- PAINÉIS ---------- */
    .panel {
        width: 100% !important;
        overflow: visible !important;
    }

    .panel-header {
        padding: 8px 12px !important;
        font-size: 11px !important;
        letter-spacing: .08em !important;
    }

    .panel-body {
        padding: 10px 12px !important;
    }

    /* ---------- FOTO ---------- */
    .equip-photo {
        min-height: 140px !important;
        max-height: 180px !important;
        aspect-ratio: auto !important;
        padding: 8px !important;
    }

    /* ---------- STATUS BADGE ---------- */
    .status-badge.off,
    .status-badge.on {
        font-size: 15px !important;
        min-height: 40px !important;
        padding: 10px 12px !important;
        margin: 0 12px 12px !important;
        width: calc(100% - 24px) !important;
    }

    /* ---------- PROCESSO — CORREÇÃO DA SOBREPOSIÇÃO ---------- */
    .processo-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .processo-card {
        padding: 10px 12px !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }

    .processo-card .label {
        font-size: 10px !important;
        margin-bottom: 4px !important;
        white-space: normal !important;
        line-height: 1.2 !important;
    }

    .processo-card .value {
        font-size: 20px !important;
        line-height: 1.1 !important;
        flex-wrap: wrap !important;
    }

    .processo-card .value .unit {
        font-size: 11px !important;
    }

    /* ---------- DIGITAIS ---------- */
    .digitais-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
    }

    .digital-card {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .digital-card .info .label {
        font-size: 11px !important;
        white-space: normal !important;
        line-height: 1.2 !important;
    }

    .digital-card .info .status {
        font-size: 10px !important;
    }

    .digital-card .led {
        width: 14px !important;
        height: 14px !important;
    }

    /* ---------- STATUS DE ALARMES ---------- */
    .status-alarmes-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
    }

    .status-alarme-card {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .status-alarme-card .sa-label {
        font-size: 11px !important;
        white-space: normal !important;
        line-height: 1.2 !important;
    }

    .status-alarme-card .sa-status {
        font-size: 10px !important;
    }

    /* ---------- RESUMO DA PLANTA ---------- */
    .resumo-panel {
        width: 100% !important;
    }

    .summary-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .summary-row {
        padding: 10px 6px !important;
        gap: 10px !important;
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
    }

    .summary-led {
        width: 22px !important;
        height: 22px !important;
    }

    .summary-label {
        font-size: 12px !important;
        white-space: nowrap !important;
    }

    .summary-value {
        font-size: 20px !important;
        min-width: 28px !important;
        text-align: right !important;
    }

    /* ---------- IA ---------- */
    .ai-body {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .ai-kpi {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .ai-kpi .info .label {
        font-size: 9px !important;
    }

    .ai-kpi .info .sub {
        font-size: 9px !important;
    }

    .ai-kpi .value {
        font-size: 18px !important;
    }

    .ai-kpi .unit {
        font-size: 10px !important;
    }

    .ai-recommendation {
        font-size: 10px !important;
        padding: 8px 10px !important;
        line-height: 1.3 !important;
    }

    /* ---------- CARGA TÉRMICA ---------- */
    .carga-body {
        padding: 12px 10px !important;
    }

    .carga-valor {
        font-size: 28px !important;
    }

    .carga-label {
        font-size: 9px !important;
    }

    .carga-extra-row {
        font-size: 11px !important;
    }

    .carga-extra-row .val {
        font-size: 13px !important;
    }

    /* ---------- COMPRESSORES ---------- */
    .comp-stats {
        padding: 8px 10px !important;
        gap: 6px !important;
    }

    .comp-stat {
        padding: 8px 10px !important;
    }

    .comp-stat .label {
        font-size: 8px !important;
    }

    .comp-stat .value {
        font-size: 18px !important;
    }

    .comp-stat .sub {
        font-size: 8px !important;
    }

    /* ---------- CONSUMO ---------- */
    .data-body {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .data-main {
        gap: 6px !important;
    }

    .data-item {
        padding: 8px 10px !important;
    }

    .data-item .label {
        font-size: 8px !important;
    }

    .data-item .value {
        font-size: 16px !important;
    }

    .data-item .sub {
        font-size: 8px !important;
    }

    .data-row {
        font-size: 10px !important;
    }

    .data-row .val {
        font-size: 11px !important;
    }

    .data-actions button {
        padding: 5px 8px !important;
        font-size: 9px !important;
    }

    /* ---------- MÉDIAS ---------- */
    .measure-row {
        padding: 8px 2px !important;
        gap: 8px !important;
        grid-template-columns: 1fr auto !important;
    }

    .measure-label {
        font-size: 11px !important;
        white-space: normal !important;
        line-height: 1.2 !important;
    }

    .measure-value {
        font-size: 15px !important;
    }

    .measure-value .unit {
        font-size: 10px !important;
    }

    .medias-actions button {
        padding: 6px 8px !important;
        font-size: 9px !important;
    }

    /* ---------- GRÁFICO ---------- */
    .chart-panel {
        min-height: auto !important;
    }

    .chart-controls {
        padding: 8px 12px !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .chart-toggle {
        font-size: 10px !important;
    }

    .chart-container {
        height: 200px !important;
        padding: 8px !important;
    }

    .btn-clear {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

    /* ---------- FOOTER ---------- */
    .footer {
        position: relative !important;
        padding: 10px 12px !important;
        flex-wrap: wrap !important;
        gap: 6px 12px !important;
        font-size: 9px !important;
        height: auto !important;
        min-height: auto !important;
    }

    /* ---------- TOAST ---------- */
    .toast {
        bottom: 12px !important;
        right: 8px !important;
        left: 8px !important;
        padding: 10px 14px !important;
        font-size: 12px !important;
    }
}

/* ============================================================
   Ajuste também para iPhone SE / telas 360-390px
   ============================================================ */
@media (max-width: 400px) {
    .processo-card .value {
        font-size: 18px !important;
    }

    .processo-card .value .unit {
        font-size: 10px !important;
    }

    .summary-value {
        font-size: 18px !important;
        min-width: 26px !important;
    }

    .summary-label {
        font-size: 11px !important;
    }

    .ai-kpi .value {
        font-size: 16px !important;
    }

    .carga-valor {
        font-size: 26px !important;
    }

    .chart-container {
        height: 180px !important;
    }
}

/* ============================================================
   Ajuste para tablet pequeno / celular grande (480-600px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 600px) {
    .processo-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .processo-card .value {
        font-size: 22px !important;
    }

    .summary-value {
        font-size: 20px !important;
    }
}
/* ============================================================
   ALARMES — CARDS ATIVOS (V7.8.0)
   ============================================================ */

/* Seção de cards ativos */
.alarms-cards-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.section-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.08em;
    color: #fca5a5;
    text-transform: uppercase;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--red);
}

.section-count {
    background: rgba(239,68,68,0.2);
    color: #fca5a5;
    padding: 2px 12px;
    border-radius: 12px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid rgba(239,68,68,0.4);
}

/* Grid de cards */
.alarms-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

/* Card vazio */
.alarm-card-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    background: rgba(34,197,94,0.05);
    border: 1.5px solid rgba(34,197,94,0.3);
    border-radius: var(--radius);
    color: #4ade80;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.05em;
}

.alarm-card-empty i {
    font-size: 28px;
    color: var(--green);
}

/* Card de alarme */
.alarm-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(239,68,68,0.15) 0%, rgba(127,29,29,0.1) 100%);
    border: 1.5px solid rgba(239,68,68,0.5);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    animation: alarmCardPulse 2s ease-in-out infinite;
}

.alarm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--red);
}

.alarm-card.crit-alta {
    border-color: rgba(239,68,68,0.6);
    background: linear-gradient(180deg, rgba(239,68,68,0.18) 0%, rgba(127,29,29,0.12) 100%);
}

.alarm-card.crit-alta::before {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239,68,68,0.8);
}

.alarm-card.crit-media {
    border-color: rgba(245,158,11,0.6);
    background: linear-gradient(180deg, rgba(245,158,11,0.15) 0%, rgba(217,119,6,0.1) 100%);
}

.alarm-card.crit-media::before {
    background: #f59e0b;
    box-shadow: 0 0 12px rgba(245,158,11,0.8);
}

.alarm-card.crit-baixa {
    border-color: rgba(250,204,21,0.5);
    background: linear-gradient(180deg, rgba(250,204,21,0.12) 0%, rgba(202,138,4,0.08) 100%);
}

.alarm-card.crit-baixa::before {
    background: #facc15;
}

@keyframes alarmCardPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239,68,68,0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239,68,68,0);
    }
}

.alarm-card:hover {
    transform: translateY(-3px);
    border-color: rgba(239,68,68,0.9);
    box-shadow: 0 12px 32px rgba(239,68,68,0.25);
}

/* Ícone */
.alarm-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(239,68,68,0.4);
}

.alarm-card.crit-media .alarm-card-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 14px rgba(245,158,11,0.4);
}

.alarm-card.crit-baixa .alarm-card-icon {
    background: linear-gradient(135deg, #facc15, #ca8a04);
    box-shadow: 0 4px 14px rgba(250,204,21,0.4);
}

/* Corpo */
.alarm-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alarm-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.alarm-card-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 11px;
    color: #fca5a5;
    letter-spacing: 0.05em;
    background: rgba(239,68,68,0.15);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(239,68,68,0.3);
}

.alarm-card-desc {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    line-height: 1.2;
    word-break: break-word;
}

.alarm-card-cat {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.alarm-card-cat i {
    color: var(--cyan);
    font-size: 9px;
}

/* Status */
.alarm-card-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #fca5a5;
    flex-shrink: 0;
}

.alarm-card-status i {
    font-size: 8px;
    color: #ef4444;
    animation: alarmStatusBlink 1s ease-in-out infinite;
}

@keyframes alarmStatusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Badge de criticidade dentro do card */
.alarm-card-badge {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.alarm-card-badge.badge-alta {
    background: rgba(239,68,68,0.25);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.5);
}

.alarm-card-badge.badge-media {
    background: rgba(245,158,11,0.25);
    color: #fcd34d;
    border: 1px solid rgba(245,158,11,0.5);
}

.alarm-card-badge.badge-baixa {
    background: rgba(250,204,21,0.25);
    color: #fde68a;
    border: 1px solid rgba(250,204,21,0.5);
}

/* Código inline na tabela */
.alarm-code-inline {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.05em;
}

/* Responsivo */
@media (max-width: 768px) {
    .alarms-cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .alarm-card {
        padding: 12px 14px;
        gap: 10px;
    }

    .alarm-card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 10px;
    }

    .alarm-card-desc {
        font-size: 13px;
    }

    .alarm-card-code {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .section-title { font-size: 15px; }

    .alarm-card {
        padding: 10px 12px;
        gap: 8px;
    }

    .alarm-card-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .alarm-card-desc { font-size: 12px; }
    .alarm-card-status { font-size: 9px; }
    .alarm-card-badge { font-size: 8px; padding: 1px 6px; }
}
/* ============================================================
   CORREÇÃO DE SCROLL — TELAS DE ALARMES E HISTÓRICO
   ============================================================ */

/* Garante scroll em páginas internas */
body.page-alarms,
body.page-history {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    position: relative !important;
}

html:has(body.page-alarms),
html:has(body.page-history) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
}

/* Container principal libera scroll */
body.page-alarms .app,
body.page-history .app {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    display: block !important;
}

/* Área principal libera scroll */
body.page-alarms .main-content,
body.page-history .main-content {
    height: auto !important;
    overflow: visible !important;
}

body.page-alarms .history-app,
body.page-history .history-app {
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 120px !important;
}

/* Corrige também o padding-bottom em mobile */
@media (max-width: 768px) {
    body.page-alarms .history-app,
    body.page-history .history-app {
        padding-bottom: 140px !important;
    }
}