*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,Arial,sans-serif;background:#f4f7fa;color:#10243e}
body{min-height:100vh}
a{color:#1e40af;text-decoration:none}

.shell{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:100vh;align-items:start}
.sidebar{background:#0a2540;color:#fff;padding:24px 18px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;min-height:0;overflow:hidden;z-index:20}
.brand,.sidebar-brand{font-size:21px;margin-bottom:28px;flex-shrink:0}
.sidebar-nav,nav{display:grid;gap:8px;align-content:start;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:4px;scrollbar-width:thin;scrollbar-color:#315777 transparent}
.sidebar-nav::-webkit-scrollbar{width:6px}
.sidebar-nav::-webkit-scrollbar-thumb{background:#315777;border-radius:999px}
.sidebar-nav a,nav a{color:#dbeafe;padding:12px;border-radius:9px;display:flex;align-items:center;gap:8px;line-height:1.25}
.sidebar-nav a:hover,nav a:hover{background:#163a5f;color:#fff}
.aside-foot,.sidebar-footer{margin-top:14px;padding-top:14px;border-top:1px solid rgba(255,255,255,.14);display:flex;justify-content:space-between;align-items:center;gap:12px;flex-shrink:0;min-height:58px}
.sidebar-user{min-width:0;display:grid;gap:3px}
.sidebar-user small{color:#93aeca;font-size:11px;text-transform:uppercase;letter-spacing:.04em}
.sidebar-user strong{display:block;max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:#fff}
.logout-link,.aside-foot a{color:#86efac;font-weight:700;padding:8px 9px;border-radius:8px;flex-shrink:0}
.logout-link:hover,.aside-foot a:hover{background:rgba(134,239,172,.12);color:#bbf7d0}

.main-area,main{min-width:0;width:100%;min-height:100vh}
header{height:64px;background:white;border-bottom:1px solid #e2e8f0;display:flex;justify-content:space-between;align-items:center;padding:0 28px;position:sticky;top:0;z-index:10}
.live{color:#047857}.content{padding:28px}h1{margin:0 0 5px}.muted{color:#64748b}
.cards{display:grid;grid-template-columns:repeat(5,minmax(130px,1fr));gap:14px;margin:24px 0}
.card,.panel,.plant{background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 4px 18px #0a25400a}
.card{padding:18px}.card span{display:block;color:#64748b}.card b{font-size:28px}.card.good{border-left:4px solid #10b981}.card.bad{border-left:4px solid #dc2626}.card.warn{border-left:4px solid #f59e0b}
.panel{padding:20px;margin:18px 0}.panel-head{display:flex;justify-content:space-between;align-items:center}.plant-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}.plant{padding:16px}.plant small,.plant b{display:block}
.status,.pill{display:inline-block;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:700;background:#e2e8f0}.status.operating,.status.online{background:#d1fae5;color:#047857}.status.warning,.pill.high{background:#fef3c7;color:#92400e}.status.fault,.pill.critical{background:#fee2e2;color:#b91c1c}.status.offline{background:#e2e8f0;color:#475569}
.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:12px;border-bottom:1px solid #e2e8f0;white-space:nowrap}td small{display:block;color:#64748b}
.btn,button{background:#1e40af;color:white;border:0;border-radius:9px;padding:11px 16px;cursor:pointer}.inline-form,.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}label{display:grid;gap:6px;margin:12px 0}input,select{width:100%;padding:11px;border:1px solid #cbd5e1;border-radius:8px}
.auth-bg{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#071b30,#0a2540 60%,#0f766e)}.auth-card{width:min(470px,92vw);background:#fff;padding:32px;border-radius:18px;box-shadow:0 20px 60px #0004}.auth-card .brand{color:#0a2540}.danger,.success{padding:12px;border-radius:8px;margin:12px 0}.danger{background:#fee2e2;color:#991b1b}.success{background:#d1fae5;color:#065f46}
.sim-actions{display:flex;gap:6px;flex-wrap:wrap}.sim-actions button:nth-of-type(2){background:#d97706}.sim-actions button:nth-of-type(3){background:#dc2626}.sim-actions button:nth-of-type(4){background:#475569}footer{padding:20px 28px;color:#64748b}

@media(max-width:1100px){.cards{grid-template-columns:repeat(3,minmax(130px,1fr))}}
@media(max-width:900px){
    .shell{grid-template-columns:1fr;display:block}
    .sidebar{position:relative;top:auto;height:auto;min-height:auto;overflow:visible;padding:18px}
    .brand,.sidebar-brand{margin-bottom:14px}
    .sidebar-nav,nav{grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;flex:none;padding-right:0}
    .sidebar-nav a,nav a{justify-content:flex-start}
    .aside-foot,.sidebar-footer{margin-top:14px;min-height:auto}
    .sidebar-user strong{max-width:65vw}
    header{display:none}
    .content{padding:18px}
    .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:520px){
    .sidebar-nav,nav{grid-template-columns:1fr}
    .cards{grid-template-columns:1fr}
    .content{padding:14px}
    .panel{padding:16px}
}

/* SmartEnergy 0.3.1 — estrutura operacional corrigida */
.brand{color:#fff;text-decoration:none}
.side-nav{
    display:block;
    flex:1;
    min-height:0;
    overflow-y:auto;
    padding-right:5px
}
.nav-group{display:grid;gap:5px;margin-bottom:20px}
.nav-label{
    padding:0 12px 5px;
    color:#7f9ab4;
    font-size:10px;
    font-weight:800;
    letter-spacing:.12em;
    text-transform:uppercase
}
.side-nav a{
    display:block;
    color:#dbeafe;
    padding:10px 12px;
    border-radius:9px
}
.side-nav a:hover{background:#163a5f;color:#fff}
.aside-foot{
    margin-top:12px;
    padding-top:14px;
    border-top:1px solid rgba(255,255,255,.12);
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-shrink:0
}
.user-identity{min-width:0}
.user-identity small,.user-identity strong{display:block}
.user-identity small{
    color:#8ca5bc;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.08em
}
.user-identity strong{
    max-width:135px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:12px
}
.logout-link{color:#86efac;font-weight:700;white-space:nowrap}
.header-actions{display:flex;align-items:center;gap:20px}
.header-actions>a{font-size:13px}
.page-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px
}
.form-grid label{align-content:start}
.form-grid textarea{
    width:100%;
    padding:11px;
    border:1px solid #cbd5e1;
    border-radius:8px;
    font:inherit;
    resize:vertical
}
.field-wide{grid-column:1/-1}
.form-action{display:flex;align-items:end;margin:12px 0}
.integration-intro{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:25px
}
.integration-intro p{margin-bottom:0;color:#64748b}
.connector-badges{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end
}
.connector-badges span{
    padding:7px 10px;
    border-radius:999px;
    background:#eaf2ff;
    color:#1e40af;
    font-size:12px;
    font-weight:750
}
.status.pending,
.status.not_configured,
.status.waiting_credentials{
    background:#e0e7ff;
    color:#3730a3
}
.status.simulator{background:#fef3c7;color:#92400e}
.status.api,
.status.gateway,
.status.manual{
    background:#e2e8f0;
    color:#475569
}
@media(max-width:900px){
    .side-nav{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        overflow:visible;
        flex:none
    }
    .nav-group{margin-bottom:0}
    .integration-intro{display:grid}
    .connector-badges{justify-content:flex-start}
    .header-actions{display:none}
}
@media(max-width:600px){
    .side-nav{grid-template-columns:1fr}
    .field-wide{grid-column:auto}
}

/* SMARTENERGY MENU DEFINITIVO 0.3.2 - INICIO */

:root{
    --se-sidebar-width:286px;
    --se-sidebar-bg:#071b30;
    --se-sidebar-bg-2:#0a2540;
    --se-sidebar-text:#dbeafe;
    --se-sidebar-muted:#86a0b8;
    --se-sidebar-hover:#123b60;
    --se-sidebar-active:#164e7a;
    --se-sidebar-border:rgba(255,255,255,.10);
    --se-sidebar-accent:#4ade80;
}

/* Estrutura geral */
html,
body{
    min-height:100%;
}

body{
    overflow-x:hidden;
}

.shell{
    min-height:100vh !important;
    display:grid !important;
    grid-template-columns:var(--se-sidebar-width) minmax(0,1fr) !important;
    background:#f3f6f9 !important;
}

/* Menu lateral */
.shell > aside{
    position:sticky !important;
    top:0 !important;
    left:0 !important;
    width:var(--se-sidebar-width) !important;
    height:100vh !important;
    min-height:100vh !important;
    padding:20px 14px 14px !important;
    display:flex !important;
    flex-direction:column !important;
    overflow:hidden !important;
    background:
        linear-gradient(180deg,var(--se-sidebar-bg-2) 0%,var(--se-sidebar-bg) 100%) !important;
    color:var(--se-sidebar-text) !important;
    border-right:1px solid #102d49 !important;
    box-shadow:8px 0 26px rgba(7,27,48,.10) !important;
    z-index:30 !important;
}

/* Marca */
.shell > aside .brand{
    display:flex !important;
    align-items:center !important;
    min-height:46px !important;
    margin:0 2px 15px !important;
    padding:0 9px !important;
    color:#ffffff !important;
    font-size:21px !important;
    font-weight:800 !important;
    text-decoration:none !important;
    letter-spacing:-.35px !important;
    flex-shrink:0 !important;
}

.shell > aside .brand,
.shell > aside .brand b{
    color:#ffffff !important;
}

.shell > aside .brand:first-letter{
    color:#f59e0b !important;
}

/* Navegação com rolagem própria */
.shell > aside .side-nav,
.shell > aside nav{
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    padding:2px 4px 10px 0 !important;
    margin:0 !important;
    scrollbar-width:thin !important;
    scrollbar-color:#315777 transparent !important;
}

.shell > aside .side-nav::-webkit-scrollbar,
.shell > aside nav::-webkit-scrollbar{
    width:5px !important;
}

.shell > aside .side-nav::-webkit-scrollbar-thumb,
.shell > aside nav::-webkit-scrollbar-thumb{
    background:#315777 !important;
    border-radius:10px !important;
}

/* Grupos */
.shell > aside .nav-group{
    display:grid !important;
    gap:4px !important;
    margin:0 0 18px !important;
}

.shell > aside .nav-label{
    display:block !important;
    padding:0 12px 5px !important;
    color:var(--se-sidebar-muted) !important;
    font-size:10px !important;
    font-weight:800 !important;
    line-height:1.3 !important;
    letter-spacing:.12em !important;
    text-transform:uppercase !important;
}

/* Links */
.shell > aside nav a,
.shell > aside .side-nav a{
    display:flex !important;
    align-items:center !important;
    min-height:42px !important;
    padding:10px 12px !important;
    border-radius:9px !important;
    color:var(--se-sidebar-text) !important;
    background:transparent !important;
    font-size:14px !important;
    font-weight:600 !important;
    line-height:1.2 !important;
    text-decoration:none !important;
    opacity:1 !important;
    transition:background .16s ease,color .16s ease,transform .16s ease !important;
}

.shell > aside nav a:visited,
.shell > aside .side-nav a:visited{
    color:var(--se-sidebar-text) !important;
}

.shell > aside nav a:hover,
.shell > aside .side-nav a:hover{
    color:#ffffff !important;
    background:var(--se-sidebar-hover) !important;
    transform:translateX(2px) !important;
}

/* Rodapé fixo do menu */
.shell > aside .aside-foot{
    position:relative !important;
    inset:auto !important;
    margin:10px 0 0 !important;
    padding:14px 8px 2px !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:center !important;
    gap:12px !important;
    flex:0 0 auto !important;
    background:transparent !important;
    border-top:1px solid var(--se-sidebar-border) !important;
    color:var(--se-sidebar-text) !important;
}

.shell > aside .user-identity{
    min-width:0 !important;
    overflow:hidden !important;
}

.shell > aside .user-identity small{
    display:block !important;
    margin-bottom:2px !important;
    color:var(--se-sidebar-muted) !important;
    font-size:9px !important;
    font-weight:750 !important;
    letter-spacing:.08em !important;
    text-transform:uppercase !important;
}

.shell > aside .user-identity strong{
    display:block !important;
    max-width:175px !important;
    overflow:hidden !important;
    color:#ffffff !important;
    font-size:12px !important;
    font-weight:750 !important;
    line-height:1.3 !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
}

.shell > aside .aside-foot > small{
    display:block !important;
    max-width:175px !important;
    overflow:hidden !important;
    color:#ffffff !important;
    font-size:12px !important;
    font-weight:700 !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
}

.shell > aside .logout-link,
.shell > aside .aside-foot > a{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:34px !important;
    padding:7px 10px !important;
    border-radius:8px !important;
    color:var(--se-sidebar-accent) !important;
    background:rgba(74,222,128,.08) !important;
    font-size:13px !important;
    font-weight:800 !important;
    text-decoration:none !important;
    white-space:nowrap !important;
}

.shell > aside .logout-link:hover,
.shell > aside .aside-foot > a:hover{
    color:#ffffff !important;
    background:rgba(74,222,128,.20) !important;
}

/* Área principal */
.shell > main{
    width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    background:#f3f6f9 !important;
}

.shell > main > header{
    position:sticky !important;
    top:0 !important;
    z-index:20 !important;
    min-height:72px !important;
    background:#ffffff !important;
    border-bottom:1px solid #dce5ee !important;
}

.shell > main .content{
    width:100% !important;
    min-width:0 !important;
}

/* Tablets e celulares */
@media (max-width:900px){
    .shell{
        display:block !important;
    }

    .shell > aside{
        position:relative !important;
        width:100% !important;
        height:auto !important;
        min-height:auto !important;
        padding:14px !important;
    }

    .shell > aside .side-nav,
    .shell > aside nav{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        max-height:none !important;
        overflow:visible !important;
        padding-right:0 !important;
    }

    .shell > aside .aside-foot{
        margin-top:6px !important;
    }
}

@media (max-width:560px){
    .shell > aside .side-nav,
    .shell > aside nav{
        grid-template-columns:1fr !important;
    }
}

/* SMARTENERGY MENU DEFINITIVO 0.3.2 - FIM */

/* SMARTENERGY LOGOMARCA 0.3.3 - INICIO */

.shell > aside .smartenergy-brand{
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
    min-height:66px !important;
    margin:0 2px 18px !important;
    padding:6px 8px !important;
    text-decoration:none !important;
    color:#ffffff !important;
    border-radius:12px !important;
    background:rgba(255,255,255,.03) !important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.04) !important;
}

.shell > aside .smartenergy-brand:hover{
    background:rgba(255,255,255,.05) !important;
    transform:none !important;
}

.shell > aside .brand-mark{
    flex:0 0 46px !important;
    width:46px !important;
    height:46px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:14px !important;
    background:linear-gradient(180deg,rgba(255,179,71,.14) 0%, rgba(249,115,22,.10) 100%) !important;
    box-shadow:
        0 0 0 1px rgba(255,179,71,.18),
        0 10px 20px rgba(0,0,0,.16) !important;
}

.shell > aside .brand-mark svg{
    width:34px !important;
    height:34px !important;
    display:block !important;
}

.shell > aside .brand-copy{
    display:flex !important;
    flex-direction:column !important;
    min-width:0 !important;
    gap:2px !important;
}

.shell > aside .brand-title{
    display:block !important;
    color:#ffffff !important;
    font-size:18px !important;
    font-weight:800 !important;
    line-height:1.05 !important;
    letter-spacing:-.02em !important;
    white-space:nowrap !important;
}

.shell > aside .brand-subtitle{
    display:block !important;
    color:#93abc4 !important;
    font-size:11px !important;
    font-weight:700 !important;
    line-height:1.2 !important;
    letter-spacing:.06em !important;
    text-transform:uppercase !important;
    white-space:nowrap !important;
}

@media (max-width:900px){
    .shell > aside .smartenergy-brand{
        margin-bottom:14px !important;
    }
}

/* SMARTENERGY LOGOMARCA 0.3.3 - FIM */

/* SMARTENERGY LOGO OFICIAL 0.3.4 - INICIO */

.shell > aside .official-brand{
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
    min-height:78px !important;
    margin:0 2px 16px !important;
    padding:7px 8px !important;
    border-radius:13px !important;
    background:rgba(255,255,255,.04) !important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.055) !important;
    color:#ffffff !important;
    text-decoration:none !important;
}

.shell > aside .official-brand:hover{
    background:rgba(255,255,255,.06) !important;
    transform:none !important;
}

.shell > aside .official-logo-wrap{
    flex:0 0 58px !important;
    width:58px !important;
    height:58px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:hidden !important;
    border-radius:13px !important;
    background:#ffffff !important;
    box-shadow:0 0 0 1px rgba(255,255,255,.25),0 9px 22px rgba(0,0,0,.22) !important;
}

.shell > aside .official-logo{
    width:58px !important;
    height:58px !important;
    display:block !important;
    object-fit:cover !important;
    object-position:center 53% !important;
    transform:scale(1.76) !important;
    transform-origin:center !important;
}

.shell > aside .official-brand .brand-copy{
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
    min-width:0 !important;
    gap:3px !important;
}

.shell > aside .official-brand .brand-title{
    display:block !important;
    color:#ffffff !important;
    font-size:19px !important;
    font-weight:850 !important;
    line-height:1.05 !important;
    letter-spacing:-.025em !important;
    white-space:nowrap !important;
}

.shell > aside .official-brand .brand-subtitle{
    display:block !important;
    color:#96aec5 !important;
    font-size:9.5px !important;
    font-weight:750 !important;
    line-height:1.25 !important;
    letter-spacing:.055em !important;
    text-transform:uppercase !important;
    white-space:nowrap !important;
}

/* SMARTENERGY LOGO OFICIAL 0.3.4 - FIM */

/* SMARTENERGY 0.6.0 — CARTEIRA, TELA CHEIA E MODO TV */
.se-dashboard-actions,
.se-service-links{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}
.se-dashboard-actions form{margin:0}
.se-secondary-btn{background:#0a2540}
.se-tv-btn{background:#0f766e}
.se-summary-cards{grid-template-columns:repeat(6,minmax(130px,1fr))}
.se-summary-cards .card strong{
    display:block;
    margin-top:6px;
    font-size:22px;
}
.se-portfolio-filter{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.se-portfolio-filter input{min-width:300px}
.se-plant-cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(310px,1fr));
    gap:16px;
    margin-top:18px;
}
.se-plant-card{
    overflow:hidden;
    border:1px solid #dbe4ee;
    border-radius:16px;
    background:#fff;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}
.se-plant-card:hover{
    transform:translateY(-3px);
    border-color:#9fb6d1;
    box-shadow:0 16px 34px rgba(10,37,64,.11);
}
.se-plant-card-link{
    display:block;
    padding:18px;
    color:#10243e;
}
.se-plant-card-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
}
.se-provider{
    display:block;
    margin-bottom:5px;
    color:#1e40af;
    font-size:11px;
    font-weight:850;
    letter-spacing:.07em;
    text-transform:uppercase;
}
.se-plant-card h3{
    margin:0;
    font-size:20px;
}
.se-plant-card p{
    margin:5px 0 0;
    color:#64748b;
}
.se-plant-card-kpis{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    margin-top:18px;
}
.se-plant-card-kpis>div{
    padding:11px 12px;
    border:1px solid #e2e8f0;
    border-radius:11px;
    background:#f8fafc;
}
.se-plant-card-kpis small{
    display:block;
    color:#64748b;
}
.se-plant-card-kpis b{
    display:block;
    margin-top:3px;
}
.se-plant-card-foot{
    display:grid;
    grid-template-columns:1fr;
    gap:5px;
    margin-top:16px;
    padding-top:14px;
    border-top:1px solid #e2e8f0;
    color:#64748b;
    font-size:12px;
}
.se-plant-card-foot>strong{
    margin-top:5px;
    color:#1e40af;
}
.se-text-danger{color:#b91c1c}
.se-empty-state{
    padding:28px;
    border:1px dashed #cbd5e1;
    border-radius:14px;
    background:#f8fafc;
    text-align:center;
    color:#64748b;
}
.se-back-link{
    display:inline-block;
    margin-bottom:8px;
    font-weight:700;
}
body.se-fullscreen .shell,
body.se-focus-mode .shell,
body.se-tv-mode .shell{
    grid-template-columns:1fr!important;
}
body.se-fullscreen aside,
body.se-focus-mode aside,
body.se-tv-mode aside{
    display:none!important;
}
body.se-fullscreen main,
body.se-focus-mode main,
body.se-tv-mode main{
    width:100%!important;
}
body.se-fullscreen .content,
body.se-focus-mode .content,
body.se-tv-mode .content{
    padding:22px!important;
}
body.se-tv-mode header{
    height:48px;
}
body.se-tv-mode .se-dashboard-actions form,
body.se-tv-mode .se-service-summary{
    display:none;
}
body.se-tv-mode .se-plant-cards{
    grid-template-columns:repeat(auto-fit,minmax(360px,1fr));
}
.status.new,
.status.notified{
    background:#fee2e2;
    color:#991b1b;
}
.status.acknowledged,
.status.assigned{
    background:#fef3c7;
    color:#92400e;
}
.status.in_route,
.status.in_service{
    background:#dbeafe;
    color:#1e40af;
}
.status.normalized,
.status.closed{
    background:#d1fae5;
    color:#047857;
}
@media(max-width:1280px){
    .se-summary-cards{
        grid-template-columns:repeat(3,minmax(150px,1fr));
    }
}
@media(max-width:760px){
    .se-dashboard-head{
        display:grid;
    }
    .se-summary-cards{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .se-portfolio-filter{
        width:100%;
    }
    .se-portfolio-filter input{
        min-width:0;
    }
}
@media(max-width:520px){
    .se-summary-cards{
        grid-template-columns:1fr;
    }
    .se-plant-cards{
        grid-template-columns:1fr;
    }
}
/* SMARTENERGY 0.6.1 — GRADE DE USINAS */

/*
 * Tela cheia real:
 * oculta completamente a barra lateral e transforma
 * o conteúdo principal em coluna única.
 */
html:fullscreen .shell,
body.se-fullscreen .shell,
body.se-focus-mode .shell,
body.se-tv-mode .shell{
    display:block!important;
    grid-template-columns:1fr!important;
    width:100%!important;
    min-height:100vh!important;
}

html:fullscreen .shell > aside,
body.se-fullscreen .shell > aside,
body.se-focus-mode .shell > aside,
body.se-tv-mode .shell > aside{
    display:none!important;
    visibility:hidden!important;
    width:0!important;
    min-width:0!important;
    max-width:0!important;
    overflow:hidden!important;
    position:absolute!important;
    left:-9999px!important;
}

html:fullscreen .shell > main,
body.se-fullscreen .shell > main,
body.se-focus-mode .shell > main,
body.se-tv-mode .shell > main{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
}

html:fullscreen .shell > main .content,
body.se-fullscreen .shell > main .content,
body.se-focus-mode .shell > main .content,
body.se-tv-mode .shell > main .content{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:24px 30px!important;
}

/*
 * Área das usinas:
 * três cards por linha em monitores grandes.
 * Conforme novas usinas forem cadastradas,
 * novas linhas serão abertas para baixo.
 */
.se-portfolio-panel{
    display:block!important;
    width:100%!important;
    overflow:visible!important;
}

.se-plant-cards{
    display:grid!important;
    grid-template-columns:
        repeat(3,minmax(0,1fr))!important;
    gap:20px!important;
    width:100%!important;
    margin-top:22px!important;
    align-items:stretch!important;
    overflow:visible!important;
}

.se-plant-card{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    min-height:275px!important;
    margin:0!important;
    overflow:hidden!important;
    border:1px solid #cbd8e6!important;
    border-radius:16px!important;
    background:#ffffff!important;
    box-shadow:
        0 4px 14px rgba(15,38,63,.06)!important;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease!important;
}

.se-plant-card:hover{
    transform:translateY(-3px)!important;
    border-color:#7f9cbc!important;
    box-shadow:
        0 15px 34px rgba(15,38,63,.13)!important;
}

.se-plant-card[hidden]{
    display:none!important;
}

.se-plant-card-link{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-height:275px!important;
    padding:20px!important;
    color:#10243e!important;
    text-decoration:none!important;
}

.se-plant-card-link,
.se-plant-card-link:visited,
.se-plant-card-link:hover,
.se-plant-card-link:active{
    color:#10243e!important;
    text-decoration:none!important;
}

.se-plant-card-head{
    display:flex!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:14px!important;
}

.se-plant-card h3{
    margin:4px 0 0!important;
    color:#10243e!important;
    font-size:21px!important;
    line-height:1.25!important;
}

.se-plant-card p{
    margin:6px 0 0!important;
    color:#64748b!important;
}

.se-provider{
    color:#1e40af!important;
    font-size:11px!important;
    font-weight:800!important;
    letter-spacing:.08em!important;
    text-transform:uppercase!important;
}

.se-plant-card-kpis{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    margin-top:18px!important;
}

.se-plant-card-kpis > div{
    min-width:0!important;
    padding:12px!important;
    border:1px solid #e0e8f1!important;
    border-radius:11px!important;
    background:#f7f9fc!important;
}

.se-plant-card-kpis small{
    display:block!important;
    margin-bottom:4px!important;
    color:#64748b!important;
    font-size:12px!important;
}

.se-plant-card-kpis b{
    display:block!important;
    color:#10243e!important;
    font-size:16px!important;
}

.se-plant-card-foot{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
    margin-top:auto!important;
    padding-top:15px!important;
    border-top:1px solid #e0e8f1!important;
    color:#64748b!important;
    font-size:12px!important;
}

.se-plant-card-foot strong{
    margin-top:5px!important;
    color:#1e40af!important;
    font-size:14px!important;
}

.se-portfolio-filter{
    display:grid!important;
    grid-template-columns:minmax(250px,410px)!important;
    gap:8px!important;
    align-items:start!important;
}

.se-portfolio-filter input,
.se-portfolio-filter select{
    width:100%!important;
    min-width:0!important;
}

/*
 * Não limita a altura da área.
 * A página cresce e utiliza a rolagem normal do navegador.
 */
.se-portfolio-panel,
.se-plant-cards,
.se-plant-card{
    max-height:none!important;
}

@media(max-width:1180px){
    .se-plant-cards{
        grid-template-columns:
            repeat(2,minmax(0,1fr))!important;
    }
}

@media(max-width:760px){
    .se-plant-cards{
        grid-template-columns:
            1fr!important;
    }

    .se-portfolio-filter{
        grid-template-columns:1fr!important;
        width:100%!important;
    }

    .se-plant-card,
    .se-plant-card-link{
        min-height:auto!important;
    }

    html:fullscreen .shell > main .content,
    body.se-fullscreen .shell > main .content,
    body.se-focus-mode .shell > main .content,
    body.se-tv-mode .shell > main .content{
        padding:16px!important;
    }
}
/* SMARTENERGY 0.7.0 — NÚCLEO SAAS */
.se70-integrator-form{
    grid-template-columns:repeat(3,minmax(0,1fr));
}
.se70-wide{
    grid-column:1/-1;
}
.se70-modules{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    padding:18px;
    border:1px solid #dbe4ee;
    border-radius:14px;
    background:#f8fafc;
}
.se70-modules legend{
    padding:0 8px;
    font-weight:800;
    color:#10243e;
}
.se70-module-option{
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:13px;
    border:1px solid #dbe4ee;
    border-radius:11px;
    background:#fff;
    cursor:pointer;
}
.se70-module-option input{
    width:auto;
    margin-top:3px;
}
.se70-module-option span{
    display:block;
}
.se70-module-option b{
    display:block;
    margin-bottom:3px;
}
.se70-module-option small{
    display:block;
    color:#64748b;
    line-height:1.35;
}
.se70-credentials{
    border-color:#86efac;
    background:#f0fdf4;
}
.se70-credential-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-top:14px;
}
.se70-credential-grid>div{
    padding:14px;
    border:1px solid #bbf7d0;
    border-radius:12px;
    background:#fff;
}
.se70-credential-grid small{
    display:block;
    color:#64748b;
}
.se70-credential-grid strong{
    display:block;
    margin-top:5px;
    font-size:18px;
    word-break:break-word;
}
.status.trial{
    background:#dbeafe;
    color:#1d4ed8;
}
.status.suspended{
    background:#fee2e2;
    color:#991b1b;
}
.status.cancelled{
    background:#e5e7eb;
    color:#374151;
}
@media(max-width:980px){
    .se70-integrator-form{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}
@media(max-width:680px){
    .se70-integrator-form,
    .se70-modules,
    .se70-credential-grid{
        grid-template-columns:1fr;
    }
}
/* SMARTENERGY 0.7.2 — PERFIS E PERMISSÕES */
.se72-readonly-catalog{
    border-left:4px solid #1e40af;
    background:#f8fafc;
}
.se72-readonly-catalog strong{
    display:block;
    margin-bottom:5px;
}
/* SMARTENERGY 0.7.4 — ATRIBUIÇÃO DE USINAS */
.se74-assignment-form{
    grid-template-columns:repeat(2,minmax(0,1fr));
}
.se74-wide{
    grid-column:1/-1;
}
@media(max-width:720px){
    .se74-assignment-form{
        grid-template-columns:1fr;
    }
}
/* SMARTENERGY 0.7.6 — CENTRAL GLOBAL E SUPORTE */
.se76-head-actions{
    display:flex;
    gap:10px;
    align-items:center;
}
.se76-summary{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
    margin:18px 0;
}
.se76-summary-card{
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:18px;
    border:1px solid #dbe4ee;
    border-radius:14px;
    background:#fff;
    color:inherit;
    text-decoration:none;
}
.se76-summary-card strong{
    font-size:30px;
}
.se76-summary-card.warning{
    border-color:#fbbf24;
    background:#fffbeb;
}
.se76-summary-card.success-card{
    border-color:#86efac;
    background:#f0fdf4;
}
.se76-summary-card.active{
    box-shadow:0 0 0 3px rgba(30,64,175,.12);
}
.se76-pending-alert{
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:center;
    margin:18px 0;
    padding:18px;
    border:1px solid #fbbf24;
    border-radius:14px;
    background:#fffbeb;
}
.se76-pending-alert p{
    margin:5px 0 0;
    color:#78350f;
}
.se76-pending-alert a{
    flex:none;
    font-weight:700;
}
.se76-plant-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
}
.se76-plant-card{
    display:flex;
    flex-direction:column;
    gap:16px;
    padding:18px;
    border:1px solid #dbe4ee;
    border-radius:15px;
    background:#fff;
}
.se76-plant-card.unassigned{
    border-color:#fbbf24;
    background:#fffdf5;
}
.se76-card-top{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
}
.se76-card-top h3{
    margin:8px 0 0;
}
.se76-badge{
    display:inline-flex;
    padding:5px 8px;
    border-radius:999px;
    font-size:11px;
    font-weight:800;
}
.se76-badge.warning{
    background:#fef3c7;
    color:#92400e;
}
.se76-badge.ok{
    background:#d1fae5;
    color:#065f46;
}
.se76-integration-status{
    font-size:12px;
    font-weight:700;
    color:#475569;
}
.se76-details{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin:0;
}
.se76-details div{
    min-width:0;
}
.se76-details dt{
    font-size:12px;
    color:#64748b;
}
.se76-details dd{
    margin:4px 0 0;
    font-weight:700;
    overflow-wrap:anywhere;
}
.se76-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:auto;
}
.se76-empty{
    grid-column:1/-1;
    padding:30px;
    text-align:center;
    color:#64748b;
}
.se76-support-banner{
    position:sticky;
    top:0;
    z-index:10000;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    padding:10px 18px;
    background:#172554;
    color:#fff;
}
.se76-support-banner div{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}
.se76-support-banner span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.se76-support-banner a{
    color:#fff;
    font-weight:700;
    white-space:nowrap;
}
@media(max-width:1100px){
    .se76-plant-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}
@media(max-width:720px){
    .se76-summary,
    .se76-plant-grid{
        grid-template-columns:1fr;
    }
    .se76-pending-alert,
    .se76-support-banner,
    .se76-support-banner div{
        align-items:flex-start;
        flex-direction:column;
    }
}
/* SMARTENERGY 0.8.0 — TELA CHEIA CONSOLIDADA */
html.se-app-fullscreen-root,
html.se-app-fullscreen-root body{
    width:100%;
    min-height:100%;
    overflow:auto;
    background:#f3f6f9;
}

body.se-app-fullscreen{
    overflow:auto!important;
}

body.se-app-fullscreen .shell > aside,
body.se-app-fullscreen .shell > main > header,
body.se-app-fullscreen .se76-support-banner{
    display:none!important;
}

body.se-app-fullscreen .shell{
    display:block!important;
    width:100%!important;
    min-height:100vh!important;
}

body.se-app-fullscreen .shell > main{
    width:100%!important;
    max-width:none!important;
    min-height:100vh!important;
    margin:0!important;
    padding:0!important;
}

body.se-app-fullscreen .shell > main > .content{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:20px!important;
}

body.se-app-fullscreen #sePlantScreen{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
}

body.se-app-fullscreen #seFullscreenButton{
    position:fixed!important;
    top:14px!important;
    right:14px!important;
    z-index:999999!important;
    box-shadow:0 10px 30px rgba(15,23,42,.25)!important;
}

body.se-app-fullscreen footer{
    display:none!important;
}

.se-period-error{
    padding:14px;
    border:1px solid #fecaca;
    border-radius:10px;
    background:#fef2f2;
    color:#991b1b;
}
/* SMARTENERGY 0.8.1 — CLIENTES */
.se-customer-summary{
    grid-template-columns:repeat(3,minmax(0,1fr));
}
.se-plant-check-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin:14px 0 20px;
}
.se-plant-check-card{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:16px;
    border:1px solid #dbe4ee;
    border-radius:12px;
    background:#fff;
    cursor:pointer;
}
.se-plant-check-card:hover{
    border-color:#93c5fd;
    background:#f8fbff;
}
.se-plant-check-card input{
    margin-top:3px;
}
.se-plant-check-card span{
    display:flex;
    flex-direction:column;
    gap:4px;
}
.se-fieldset{
    min-width:0;
    padding:16px;
    border:1px solid #dbe4ee;
    border-radius:12px;
}
.se-fieldset legend{
    padding:0 8px;
    font-weight:700;
}
.se-switch-line{
    display:flex!important;
    flex-direction:row!important;
    align-items:center;
    gap:8px;
    margin:8px 0;
}
.se-switch-line input{
    width:auto!important;
}
.se-module-note{
    margin-top:14px;
}
.se-customer-plant-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
}
.se-customer-plant-card{
    display:block;
    padding:18px;
    border:1px solid #dbe4ee;
    border-radius:14px;
    background:#fff;
    color:inherit;
    text-decoration:none;
    transition:.18s ease;
}
.se-customer-plant-card:hover{
    transform:translateY(-2px);
    border-color:#93c5fd;
    box-shadow:0 14px 34px rgba(15,23,42,.08);
}
.se-customer-plant-head{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
}
.se-customer-plant-head div{
    display:flex;
    flex-direction:column;
    gap:4px;
}
.se-customer-plant-metrics{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin-top:18px;
}
.se-customer-plant-metrics span{
    display:flex;
    flex-direction:column;
    gap:4px;
}
@media(max-width:850px){
    .se-customer-summary,
    .se-plant-check-grid,
    .se-customer-plant-grid,
    .se-customer-plant-metrics{
        grid-template-columns:1fr;
    }
}
/* SMARTENERGY 0.8.2 — VINCULO CLIENTE USINA */
.se-plant-check-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:14px!important;
    margin:18px 0 22px!important;
}
.se-plant-check-card{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    gap:14px!important;
    min-height:92px!important;
    padding:18px!important;
    border:2px solid #dbe4ee!important;
    border-radius:14px!important;
    background:#fff!important;
    cursor:pointer!important;
    user-select:none!important;
}
.se-plant-check-card:hover{
    border-color:#60a5fa!important;
    background:#f8fbff!important;
}
.se-plant-check-card.is-selected{
    border-color:#2563eb!important;
    background:#eff6ff!important;
}
.se-plant-check-control{
    position:relative!important;
    flex:0 0 28px!important;
    width:28px!important;
    height:28px!important;
}
.se-plant-check-control input{
    position:absolute!important;
    inset:0!important;
    width:28px!important;
    height:28px!important;
    margin:0!important;
    opacity:0!important;
    z-index:2!important;
    cursor:pointer!important;
}
.se-plant-check-box{
    position:absolute!important;
    inset:0!important;
    width:28px!important;
    height:28px!important;
    border:2px solid #94a3b8!important;
    border-radius:7px!important;
    background:#fff!important;
}
.se-plant-check-control input:checked + .se-plant-check-box{
    border-color:#2563eb!important;
    background:#2563eb!important;
}
.se-plant-check-control input:checked + .se-plant-check-box:after{
    content:""!important;
    position:absolute!important;
    left:8px!important;
    top:3px!important;
    width:7px!important;
    height:14px!important;
    border:solid #fff!important;
    border-width:0 3px 3px 0!important;
    transform:rotate(45deg)!important;
}
.se-plant-check-content{
    display:flex!important;
    flex-direction:column!important;
    gap:5px!important;
    min-width:0!important;
}
.se-plant-check-content strong{
    font-size:17px!important;
}
.se-plant-check-status{
    margin-top:4px!important;
    font-size:12px!important;
    font-weight:700!important;
    color:#475569!important;
}
.se-plant-check-card.is-selected .se-plant-check-status{
    color:#1d4ed8!important;
}
@media(max-width:850px){
    .se-plant-check-grid{
        grid-template-columns:1fr!important;
    }
}
/* SMARTENERGY 0.8.5 — AUTO SYNC */
.se-auto-sync-status{
    display:flex;
    align-items:center;
    gap:9px;
    margin:0 0 16px;
    padding:10px 13px;
    border:1px solid #dbe4ee;
    border-radius:10px;
    background:#fff;
    color:#475569;
    font-size:13px;
}
.se-auto-sync-dot{
    width:9px;
    height:9px;
    flex:0 0 9px;
    border-radius:50%;
    background:#64748b;
}
.se-auto-sync-status.is-running .se-auto-sync-dot{
    background:#f59e0b;
    animation:seAutoSyncPulse 1s infinite;
}
.se-auto-sync-status.is-success{
    border-color:#a7f3d0;
    background:#ecfdf5;
    color:#065f46;
}
.se-auto-sync-status.is-success .se-auto-sync-dot{
    background:#10b981;
}
.se-auto-sync-status.is-error{
    border-color:#fecaca;
    background:#fef2f2;
    color:#991b1b;
}
.se-auto-sync-status.is-error .se-auto-sync-dot{
    background:#ef4444;
}
@keyframes seAutoSyncPulse{
    0%,100%{opacity:1;transform:scale(1)}
    50%{opacity:.45;transform:scale(.8)}
}
/* SMARTENERGY 0.8.7 — OPERAÇÃO DE ALARMES */
.se-incident-list{
    display:grid;
    gap:16px;
}
.se-incident-card{
    padding:18px;
    border:1px solid #dbe4ee;
    border-radius:14px;
    background:#fff;
}
.se-incident-card h3{
    margin:14px 0 6px;
}
.se-incident-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}
.se-incident-assignment{
    display:grid;
    grid-template-columns:minmax(220px,1fr) auto;
    gap:12px;
    align-items:end;
    margin:16px 0;
}
.se-incident-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:14px 0;
}
.se-incident-actions input{
    min-width:240px;
    flex:1 1 260px;
}
.se-incident-history{
    margin-top:14px;
    border-top:1px solid #e2e8f0;
    padding-top:12px;
}
.se-incident-history summary{
    cursor:pointer;
    font-weight:700;
}
.se-timeline{
    display:grid;
    gap:10px;
    margin-top:12px;
}
.se-timeline-item{
    display:grid;
    gap:3px;
    padding-left:14px;
    border-left:3px solid #bfdbfe;
}
.se-timeline-item small{
    color:#64748b;
}
@media(max-width:800px){
    .se-incident-head,
    .se-incident-assignment{
        grid-template-columns:1fr;
        flex-direction:column;
        align-items:stretch;
    }
}
/* SMARTENERGY 0.8.8 — TESTE DE ALARMES */
.se-test-warning{
    display:flex;
    flex-direction:column;
    gap:4px;
    margin-bottom:18px;
    padding:14px 16px;
    border:1px solid #fde68a;
    border-radius:10px;
    background:#fffbeb;
    color:#92400e;
}
.se-test-badge{
    display:inline-flex;
    align-items:center;
    margin-right:6px;
    padding:3px 7px;
    border-radius:999px;
    background:#ede9fe;
    color:#6d28d9;
    font-size:11px;
    font-weight:800;
}
.se-form-wide{
    grid-column:1/-1;
}
.se-table-actions{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
}
.se-table-actions form{
    margin:0;
}