:root{--bg:#f4f7fb;--card:#fff;--ink:#172033;--muted:#667085;--line:#e5e9f0;--nav:#0f172a;--accent:#2563eb;--good:#16a34a;--bad:#dc2626;--warn:#d97706;--shadow:0 10px 30px rgba(15,23,42,.08)}*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink)}button,input,select,textarea{font:inherit}.hidden{display:none!important}.auth-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 20%,#dbeafe,transparent 35%),linear-gradient(135deg,#0f172a,#1e293b)}.auth-card{width:min(430px,100%);background:#fff;border-radius:24px;padding:32px;box-shadow:0 24px 70px rgba(0,0,0,.28)}.brand-mark{width:60px;height:60px;border-radius:18px;background:linear-gradient(135deg,#2563eb,#0ea5e9);color:#fff;display:grid;place-items:center;font-weight:800;font-size:22px;box-shadow:0 10px 28px rgba(37,99,235,.28)}.brand-mark.small{width:42px;height:42px;border-radius:13px;font-size:16px}.auth-card h1{margin:20px 0 6px}.muted{color:var(--muted)}.stack{display:grid;gap:14px;margin-top:24px}label{display:grid;gap:7px;font-size:13px;font-weight:600;color:#344054}input,select,textarea{width:100%;border:1px solid #d0d5dd;border-radius:10px;padding:10px 12px;background:#fff;color:#101828;outline:none}input:focus,select:focus,textarea:focus{border-color:#84adff;box-shadow:0 0 0 3px #eff4ff}textarea{min-height:90px;resize:vertical}.btn{border:0;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer}.btn.primary{background:var(--accent);color:#fff}.btn.primary:hover{filter:brightness(.96)}.btn.ghost{background:#eef2f7;color:#344054}.btn.full{width:100%;margin-top:10px}.auth-message{min-height:20px;font-size:13px;color:var(--muted)}.app{display:grid;grid-template-columns:250px 1fr;min-height:100vh}.sidebar{background:var(--nav);color:#fff;padding:22px 16px;display:flex;flex-direction:column;gap:24px;position:sticky;top:0;height:100vh}.sidebar-brand{display:flex;align-items:center;gap:12px;padding:4px 8px}.sidebar-brand strong,.sidebar-brand span{display:block}.sidebar-brand span{font-size:12px;color:#94a3b8;margin-top:2px}.sidebar nav{display:grid;gap:6px}.nav-item{border:0;background:transparent;color:#cbd5e1;text-align:left;padding:11px 12px;border-radius:10px;cursor:pointer;font-weight:650;display:flex;gap:10px}.nav-item:hover,.nav-item.active{background:#1e293b;color:#fff}.sidebar-footer{margin-top:auto}.user-email{font-size:12px;color:#94a3b8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.main{min-width:0}.topbar{height:86px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:5}.topbar h2{margin:0;font-size:22px}.topbar p{margin:4px 0 0;color:var(--muted);font-size:13px}.mobile-menu{display:none;border:0;background:#eef2f7;border-radius:8px;padding:8px 10px}.view{display:none;padding:28px}.active-view{display:block}.cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.metric{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:var(--shadow)}.metric span,.metric small{display:block;color:var(--muted)}.metric strong{display:block;font-size:34px;margin:8px 0}.metric.good strong{color:var(--good)}.metric.bad strong{color:var(--bad)}.metric.warn strong{color:var(--warn)}.panel-grid{display:grid;grid-template-columns:1.4fr 1fr;gap:16px;margin-top:16px}.panel{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}.panel-head{display:flex;align-items:center;justify-content:space-between;padding:18px;border-bottom:1px solid var(--line)}.panel-head h3{margin:0}.link-btn{border:0;background:none;color:var(--accent);font-weight:700;cursor:pointer}.list{padding:8px 18px}.list-row{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid #eef2f7}.list-row:last-child{border-bottom:0}.list-row b{display:block}.list-row span{font-size:12px;color:var(--muted)}.status-summary{padding:18px;display:grid;gap:12px}.status-line{display:flex;justify-content:space-between;align-items:center}.dot{width:10px;height:10px;border-radius:50%;display:inline-block;margin-right:8px;background:#94a3b8}.dot.online{background:var(--good)}.dot.offline{background:var(--bad)}.dot.atencao{background:var(--warn)}.section-toolbar{display:flex;justify-content:space-between;gap:12px;margin-bottom:14px}.search{max-width:360px;background:#fff}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:760px}th,td{text-align:left;padding:13px 16px;border-bottom:1px solid #eef2f7;font-size:13px}th{color:#667085;background:#fafbfc;font-size:12px;text-transform:uppercase;letter-spacing:.03em}tbody tr:hover{background:#fbfdff}.badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:750;background:#eef2f7}.badge.online{color:#166534;background:#dcfce7}.badge.offline{color:#991b1b;background:#fee2e2}.badge.atencao{color:#92400e;background:#fef3c7}.badge.nao_monitorado{color:#475569;background:#e2e8f0}.actions{display:flex;gap:6px}.icon-btn,.danger-btn{border:0;background:#eef2f7;border-radius:8px;padding:7px 9px;cursor:pointer}.danger-btn{color:#b42318;background:#fef3f2}dialog{border:0;padding:0;border-radius:18px;box-shadow:0 24px 80px rgba(15,23,42,.25);width:min(760px,calc(100vw - 32px))}dialog::backdrop{background:rgba(15,23,42,.55)}.modal-form{padding:0}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--line)}.modal-head h3{margin:0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:20px}.form-grid .wide{grid-column:1/-1}.modal-actions{display:flex;justify-content:flex-end;gap:10px;padding:16px 20px;border-top:1px solid var(--line)}.toast{position:fixed;right:20px;top:20px;z-index:1000;background:#101828;color:#fff;padding:12px 16px;border-radius:10px;box-shadow:var(--shadow);opacity:0;pointer-events:none;transform:translateY(-8px);transition:.2s}.toast.show{opacity:1;transform:translateY(0)}.empty{color:var(--muted);padding:18px;text-align:center}.nowrap{white-space:nowrap}@media(max-width:1100px){.cards{grid-template-columns:repeat(3,1fr)}.panel-grid{grid-template-columns:1fr}}@media(max-width:760px){.app{grid-template-columns:1fr}.sidebar{position:fixed;z-index:20;left:-270px;width:250px;transition:.2s}.sidebar.open{left:0}.mobile-menu{display:block}.view{padding:18px}.topbar{padding:0 18px}.cards{grid-template-columns:1fr 1fr}.form-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}.section-toolbar{align-items:stretch;flex-direction:column}.search{max-width:none}}@media(max-width:460px){.cards{grid-template-columns:1fr}.auth-card{padding:24px}}
.client-hero{display:grid;grid-template-columns:1fr;gap:18px;margin-bottom:16px}
.back-link{border:0;background:transparent;color:var(--accent);padding:0;margin-bottom:10px;font-weight:700;cursor:pointer}
.client-title-row{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
.client-title-row h2{margin:0;font-size:28px}
.client-title-row p{margin:5px 0 0}
.client-actions{display:flex;gap:10px;flex-wrap:wrap}
.client-health{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.health-chip{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 16px;box-shadow:var(--shadow)}
.health-chip span{display:block;color:var(--muted);font-size:12px}
.health-chip strong{display:block;font-size:22px;margin-top:6px}
.health-chip.good strong{color:var(--good)}.health-chip.bad strong{color:var(--bad)}.health-chip.warn strong{color:var(--warn)}
.client-tabs{display:flex;gap:8px;overflow:auto;padding:4px 0 12px;margin-bottom:6px}
.client-tab{white-space:nowrap;border:1px solid var(--line);background:#fff;color:#475467;padding:9px 12px;border-radius:999px;font-weight:700;cursor:pointer}
.client-tab.active{background:#172033;color:#fff;border-color:#172033}
.client-tab-content{min-height:340px}
.detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.detail-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:var(--shadow)}
.detail-card h3{margin:0 0 12px;font-size:16px}
.kv{display:grid;grid-template-columns:130px 1fr;gap:8px 12px;font-size:13px}
.kv dt{color:var(--muted)}.kv dd{margin:0;font-weight:650}
.mini-table{width:100%;border-collapse:collapse;min-width:0}
.mini-table th,.mini-table td{padding:10px 8px;font-size:12px}
.network-map{display:flex;align-items:center;gap:12px;overflow:auto;padding:22px 8px}
.node{min-width:150px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px;box-shadow:var(--shadow);text-align:center}
.node strong{display:block}.node small{display:block;color:var(--muted);margin-top:4px}
.node.online{border-color:#bbf7d0}.node.offline{border-color:#fecaca}.node.atencao{border-color:#fde68a}
.connector{font-size:26px;color:#94a3b8}
.category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.category-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px}
.category-card h4{margin:0 0 10px}
.client-click{cursor:pointer}.client-click:hover strong{color:var(--accent);text-decoration:underline}
.inline-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:1000px){.client-health{grid-template-columns:repeat(3,1fr)}.detail-grid{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.client-title-row{align-items:flex-start;flex-direction:column}.client-health{grid-template-columns:1fr 1fr}.detail-grid,.category-grid{grid-template-columns:1fr}.kv{grid-template-columns:110px 1fr}}

.client-context-action{display:flex;justify-content:flex-end;margin:-4px 0 12px}.client-context-action:empty{display:none}

.monitor-time{color:var(--muted);font-size:10px;white-space:nowrap}
.badge.nao_monitorado{background:#eef2f6;color:#667085}

.live-status{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.live-status strong{font-size:12px;color:#344054}
.live-status small{display:block;width:100%;color:var(--muted);font-size:10px;margin-top:2px}

.monitor-dashboard-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:16px;margin-top:16px}
.live-monitor-list,.event-list{padding:8px 18px}
.live-monitor-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid #eef2f7}
.live-monitor-row:last-child{border-bottom:0}
.live-monitor-main{display:flex;align-items:center;gap:12px;min-width:0}
.live-monitor-main strong,.live-monitor-main small{display:block}
.live-monitor-main small{color:var(--muted);font-size:11px;margin-top:3px}
.live-monitor-metrics{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.live-monitor-metrics strong{font-size:12px}
.live-monitor-metrics small{color:var(--muted);font-size:10px;width:100%;text-align:right}
.live-dot{width:12px;height:12px;border-radius:50%;background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.12)}
.live-dot.online{background:var(--good);box-shadow:0 0 0 4px rgba(22,163,74,.12)}
.live-dot.offline{background:var(--bad);box-shadow:0 0 0 4px rgba(220,38,38,.12)}
.event-row{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid #eef2f7}
.event-row:last-child{border-bottom:0}
.event-icon{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;font-weight:900;background:#eef2f7}
.event-icon.offline{background:#fee2e2;color:#b91c1c}
.event-icon.online{background:#dcfce7;color:#15803d}
.event-main strong,.event-main small{display:block}
.event-main small{color:var(--muted);font-size:11px;margin-top:3px}
.event-side{text-align:right}
.event-side span,.event-side small{display:block}
.event-side span{font-weight:700;font-size:12px}
.event-side small{color:var(--muted);font-size:10px;margin-top:2px}
@media(max-width:1000px){.monitor-dashboard-grid{grid-template-columns:1fr}}

.event-client{display:block;color:#344054;font-size:11px;font-weight:700;margin-top:2px}

.event-duration{display:inline-block;margin-top:5px;padding:4px 7px;border-radius:7px;background:#fff7ed;color:#9a3412;font-size:10px;font-weight:700}

.outage-card{padding:14px 0;border-bottom:1px solid #eef2f7}
.outage-card:last-child{border-bottom:0}
.outage-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.outage-head strong,.outage-head span{display:block}
.outage-head span{font-size:11px;color:var(--muted);margin-top:2px}
.outage-meta{font-size:11px;color:var(--muted);margin:5px 0 10px}
.outage-times{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.outage-times div{background:#f8fafc;border-radius:10px;padding:8px}
.outage-times small,.outage-times strong{display:block}
.outage-times small{color:var(--muted);font-size:10px}
.outage-times strong{font-size:11px;margin-top:3px}
@media(max-width:700px){.outage-times{grid-template-columns:1fr}}

.history-cards{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:16px}
.history-toolbar{padding:16px;margin-bottom:16px}
.history-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.offline-alert-overlay{position:fixed;inset:0;z-index:2000;background:rgba(127,29,29,.28);display:grid;place-items:start center;padding-top:24px;pointer-events:none}
.offline-alert-overlay.hidden{display:none}
.offline-alert-card{pointer-events:auto;display:grid;grid-template-columns:48px 1fr auto;gap:14px;align-items:center;width:min(680px,calc(100vw - 32px));background:#fff;border:2px solid #ef4444;border-radius:16px;padding:14px 16px;box-shadow:0 24px 70px rgba(127,29,29,.28)}
.offline-alert-icon{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#fee2e2;color:#b91c1c;font-size:28px;font-weight:900}
.offline-alert-card strong,.offline-alert-card span{display:block}
.offline-alert-card strong{color:#991b1b;font-size:18px}
.offline-alert-card span{color:#475569;font-size:12px;margin-top:3px}
@media(max-width:900px){.history-cards{grid-template-columns:1fr 1fr}.history-filters{grid-template-columns:1fr}}
@media(max-width:560px){.history-cards{grid-template-columns:1fr}.offline-alert-card{grid-template-columns:42px 1fr}.offline-alert-card .btn{grid-column:1/-1}}

/* Dashboard Pro v11 */
.dashboard-pro{background:#07111f!important;color:#e8eef8;border-radius:0;margin:-26px;padding:26px;min-height:calc(100vh - 78px)}
.dashboard-pro .hidden{display:none!important}
.dash-pro-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:18px}
.dash-live-title{display:flex;align-items:center;gap:10px}.dash-live-title h2{margin:0;color:#fff;font-size:26px}
.dash-pro-header p{margin:5px 0 0;color:#9eacc1}
.pulse-dot{width:11px;height:11px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 5px rgba(34,197,94,.12),0 0 18px #22c55e}
.dash-pro-clock{text-align:right}.dash-pro-clock strong{display:block;color:#fff;font-size:18px}.dash-pro-clock span{display:block;color:#72e6a0;font-size:11px;margin-top:4px}
.dash-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:16px}
.dash-kpi{display:flex;gap:12px;align-items:center;background:#0d1a2b;border:1px solid #1e3047;border-radius:12px;padding:15px;min-height:82px}
.kpi-icon{width:42px;height:42px;border-radius:11px;display:grid;place-items:center;background:#0d3b70;color:#56a8ff;font-size:24px;font-weight:800}
.dash-kpi.good .kpi-icon{background:#073c2a;color:#37e889}.dash-kpi.bad .kpi-icon{background:#4a1b22;color:#ff5b66}.dash-kpi.warn .kpi-icon{background:#4a390a;color:#ffd034}.dash-kpi.ping .kpi-icon{background:#302052;color:#b08cff}
.dash-kpi span,.dash-kpi small{display:block}.dash-kpi span{color:#afbdd0;font-size:11px}.dash-kpi strong{display:block;color:#fff;font-size:25px;margin:2px 0}.dash-kpi small{color:#728198;font-size:10px}
.monitor-toolbar-pro{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#0d1a2b;border:1px solid #1e3047;border-radius:12px;padding:11px;margin-bottom:14px}
.monitor-filter-tabs{display:flex;gap:7px;flex-wrap:wrap}.monitor-filter{border:1px solid #293b54;background:#0a1626;color:#c3cfdf;border-radius:8px;padding:9px 11px;font-weight:700;cursor:pointer}.monitor-filter.active{background:#1769e8;color:#fff;border-color:#3180f5}.monitor-filter b{font-size:10px;margin-left:4px;opacity:.75}
.status-mini{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px}.status-mini.online{background:#22c55e}.status-mini.offline{background:#ef4444}.status-mini.atencao{background:#f59e0b}
.monitor-tools{display:flex;gap:8px;flex:1;justify-content:flex-end}.monitor-search{display:flex;align-items:center;gap:7px;min-width:310px;background:#07111f;border:1px solid #293b54;border-radius:8px;padding:0 10px;color:#8fa2ba}.monitor-search input{border:0;background:transparent;color:#fff;outline:0;width:100%;height:38px}.monitor-search input::placeholder{color:#74849a}.monitor-tools select{background:#07111f;color:#dbe6f5;border:1px solid #293b54;border-radius:8px;padding:0 10px}
.dash-monitor-layout{display:grid;grid-template-columns:minmax(0,1fr) 385px;gap:14px}
.client-monitor-groups{display:flex;flex-direction:column;gap:14px}
.client-monitor-group{background:#0d1a2b;border:1px solid #1e3047;border-radius:12px;padding:12px}
.client-monitor-head{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:3px 4px 12px}.client-group-title{display:flex;align-items:center;gap:9px;color:#fff}.client-building{color:#3b82f6;font-size:22px}.client-online-pill{font-size:10px;font-weight:800;border-radius:999px;padding:5px 8px}.client-online-pill.online{background:#073c2a;color:#45e58c}.client-online-pill.offline{background:#4a1b22;color:#ff737c}.client-online-pill.atencao{background:#4a390a;color:#ffd034}.client-location{color:#718299;font-size:10px}
.monitor-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.monitor-device-card{position:relative;background:#0a1626;border:1px solid #27415d;border-radius:11px;padding:14px;min-height:180px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.015)}
.monitor-device-card.online{border-color:#1d7a45}.monitor-device-card.offline{border-color:#a6313a;background:#1a1119}.monitor-device-card.atencao{border-color:#8b6817;background:#17150d}
.device-card-top{display:flex;justify-content:space-between;align-items:center}.device-status-dot{width:11px;height:11px;border-radius:50%;background:#94a3b8}.device-status-dot.online{background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.13)}.device-status-dot.offline{background:#ef4444;box-shadow:0 0 0 4px rgba(239,68,68,.12)}.device-status-dot.atencao{background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.12)}
.device-category{font-size:10px;padding:4px 7px;border-radius:6px;background:#12335d;color:#70afff}.monitor-device-card h4{margin:15px 0 4px;color:#fff;font-size:15px}.device-client{font-size:10px;color:#9caac0}.device-ip{font-size:11px;color:#c7d3e3;margin-top:8px}
.device-card-bottom{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px;border-top:1px solid #25364c;margin-top:18px;padding-top:12px}.device-card-bottom strong,.device-card-bottom small{display:block}.device-card-bottom strong{color:#fff;font-size:17px}.device-card-bottom small{color:#6f8199;font-size:9px;margin-top:3px}.device-state.online{color:#32e47d}.device-state.offline{color:#ff5d68}.device-state.atencao{color:#f7c948}.device-updated{text-align:right}.device-updated strong{font-size:11px}
.panel-dark{background:#0d1a2b;border:1px solid #1e3047;border-radius:12px;overflow:hidden}.panel-dark-head{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;padding:14px;border-bottom:1px solid #1e3047}.panel-dark-head h3{margin:0;color:#fff;font-size:15px}.panel-dark-head small{color:#74869d;font-size:10px}.link-btn-dark{border:0;background:transparent;color:#56a8ff;font-size:10px;cursor:pointer}
.occurrence-list{padding:4px 14px}.occurrence-row{display:grid;grid-template-columns:30px 1fr auto;gap:8px;align-items:center;padding:11px 0;border-bottom:1px solid #1b2b40}.occurrence-row:last-child{border:0}.occurrence-icon{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-weight:900}.occurrence-icon.online{background:#073c2a;color:#38e282}.occurrence-icon.offline{background:#4a1b22;color:#ff636d}.occurrence-main strong,.occurrence-main span,.occurrence-main small{display:block}.occurrence-main strong{color:#e8eef8;font-size:11px}.occurrence-main span{color:#718299;font-size:9px;margin-top:2px}.occurrence-main small{font-size:9px;margin-top:3px}.occurrence-main small.online{color:#35d77b}.occurrence-main small.offline{color:#ff616b}.occurrence-row time{color:#8091a8;font-size:9px}
.dash-legend{display:flex;align-items:center;gap:24px;flex-wrap:wrap;background:#0d1a2b;border:1px solid #1e3047;border-radius:10px;margin-top:14px;padding:10px 14px;color:#7d8fa7;font-size:9px}.dash-legend b{color:#dbe6f5;margin-right:5px}.legend-rule{margin-left:auto}.dark-empty{color:#7c8ca2!important;background:transparent!important}
@media(max-width:1250px){.dash-kpis{grid-template-columns:repeat(3,1fr)}.dash-monitor-layout{grid-template-columns:1fr}.monitor-card-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:850px){.dashboard-pro{margin:-18px;padding:18px}.dash-kpis{grid-template-columns:1fr 1fr}.monitor-toolbar-pro{align-items:stretch;flex-direction:column}.monitor-tools{justify-content:stretch}.monitor-search{min-width:0;flex:1}.monitor-card-grid{grid-template-columns:1fr}.dash-pro-header{flex-direction:column}.dash-pro-clock{text-align:left}}
@media(max-width:520px){.dash-kpis{grid-template-columns:1fr}.monitor-tools{flex-direction:column}.dash-legend{gap:10px}.legend-rule{margin-left:0}}

/* v13 - correção de overflow horizontal */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.app,
.main,
main,
.view,
.dashboard-pro {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden;
}

.dashboard-pro {
  width: auto !important;
  box-sizing: border-box;
}

.dash-pro-header,
.dash-kpis,
.monitor-toolbar-pro,
.dash-monitor-layout,
.client-monitor-groups,
.client-monitor-group,
.monitor-card-grid,
.panel-dark,
.dash-legend {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.monitor-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.monitor-tools {
  min-width: 0 !important;
  flex-wrap: wrap;
}

.monitor-search {
  min-width: 220px !important;
  max-width: 100% !important;
  flex: 1 1 280px;
}

.monitor-tools select {
  min-width: 170px;
  max-width: 100%;
  flex: 0 1 220px;
}

.dash-monitor-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 385px);
}

.client-monitor-head,
.client-group-title,
.device-card-bottom {
  min-width: 0;
}

.device-client,
.device-ip,
.client-location,
.occurrence-main strong,
.occurrence-main span {
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .dash-monitor-layout {
    grid-template-columns: 1fr !important;
  }

  .monitor-toolbar-pro {
    flex-direction: column;
    align-items: stretch;
  }

  .monitor-tools {
    width: 100%;
  }
}

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

  .dash-kpis {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 520px) {
  .dash-kpis {
    grid-template-columns: 1fr !important;
  }
}

.dash-pro-actions{margin-left:auto;display:flex;align-items:center}
.sound-toggle{border:1px solid #2b405c;background:#0c1a2c;color:#d8e5f6;border-radius:8px;padding:8px 11px;font-weight:800;cursor:pointer;white-space:nowrap}
.sound-toggle.on{border-color:#16794a;background:#0a2a1d;color:#49e892}
.sound-toggle.off{border-color:#485a73;color:#a9b8cb}
.offline-alert-overlay{z-index:99999!important}
.offline-alert-card{animation:offlinePulse .9s ease-in-out infinite alternate}
@keyframes offlinePulse{
  from{box-shadow:0 18px 55px rgba(239,68,68,.25)}
  to{box-shadow:0 22px 80px rgba(239,68,68,.55)}
}

/* v15 - menu lateral retrátil */
.sidebar-collapse-btn{
  width:40px;
  height:40px;
  border:1px solid #d7dfeb;
  border-radius:10px;
  background:#fff;
  color:#172033;
  font-size:20px;
  font-weight:800;
  cursor:pointer;
  display:grid;
  place-items:center;
  flex:0 0 auto;
}

.sidebar-collapse-btn:hover{
  background:#f3f6fa;
}

.sidebar-restore-btn{
  display:none;
  position:fixed;
  left:10px;
  top:14px;
  z-index:1001;
  width:42px;
  height:42px;
  border:1px solid #24405f;
  border-radius:11px;
  background:#0d1a2b;
  color:#fff;
  font-size:21px;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}

body.sidebar-collapsed .sidebar{
  transform:translateX(-100%);
  width:0!important;
  min-width:0!important;
  overflow:hidden;
  opacity:0;
  pointer-events:none;
}

body.sidebar-collapsed .sidebar-restore-btn{
  display:grid;
  place-items:center;
  pointer-events:auto;
  opacity:1;
}

body.sidebar-collapsed .app,
body.sidebar-collapsed .main,
body.sidebar-collapsed main{
  margin-left:0!important;
  width:100%!important;
  max-width:100%!important;
}

body.sidebar-collapsed .topbar{
  left:0!important;
  width:100%!important;
}

.sidebar,
.main,
.topbar{
  transition:all .22s ease;
}

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

  .sidebar-restore-btn{
    display:none!important;
  }
}

/* v16 - Dashboard compacto para reduzir rolagem vertical */
.dashboard-pro{
  padding-top:10px!important;
  padding-bottom:8px!important;
}
.dash-pro-header{
  margin-bottom:10px!important;
}
.dash-pro-header h2{
  margin-top:0!important;
  margin-bottom:3px!important;
  line-height:1.1!important;
}
.dash-pro-header p{
  margin:0!important;
}
.dash-kpis{
  gap:10px!important;
  margin-bottom:10px!important;
}
.dash-kpi{
  min-height:82px!important;
  padding:12px 14px!important;
}
.monitor-toolbar-pro{
  padding:9px 11px!important;
  margin-bottom:10px!important;
}
.dash-monitor-layout{
  gap:10px!important;
}
.client-monitor-group,
.occurrences-panel{
  padding:12px!important;
}
.client-monitor-head{
  margin-bottom:10px!important;
}
.monitor-card-grid{
  gap:10px!important;
}
.monitor-device-card{
  min-height:174px!important;
  padding:13px!important;
}
.monitor-device-card h4{
  margin:10px 0 5px!important;
}
.monitor-device-card .device-client,
.monitor-device-card .device-ip{
  line-height:1.2!important;
}
.device-card-bottom{
  margin-top:12px!important;
  padding-top:10px!important;
}
.occurrence-item{
  padding:10px 0!important;
}
.dash-legend{
  margin-top:10px!important;
  padding:7px 10px!important;
}

/* Em monitores desktop mais baixos, compacta mais um pouco */
@media (min-width:1000px) and (max-height:850px){
  .dashboard-pro{padding-top:6px!important}
  .dash-kpi{min-height:72px!important;padding:9px 12px!important}
  .monitor-device-card{min-height:155px!important;padding:11px!important}
  .monitor-device-card h4{margin:7px 0 4px!important}
  .device-card-bottom{margin-top:8px!important;padding-top:8px!important}
  .occurrence-item{padding:7px 0!important}
  .dash-legend{margin-top:7px!important}
}

/* v17 - correção definitiva de alinhamento do Dashboard */
#dashboard.dashboard-pro{
  margin: 0 !important;
  padding: 14px 14px 10px !important;
  width: 100% !important;
  min-height: auto !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  box-sizing: border-box !important;
  border-radius: 0 !important;
}

.main,
main{
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.topbar{
  position: relative;
  z-index: 50;
}

#dashboard .dash-pro-header{
  margin-top: 0 !important;
  padding-top: 0 !important;
  min-height: 48px;
}

#dashboard .dash-live-title h2{
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

#dashboard .dash-pro-header p{
  margin: 4px 0 0 !important;
}

/* Neutraliza os margins negativos antigos também nos breakpoints */
@media(max-width:850px){
  #dashboard.dashboard-pro{
    margin:0 !important;
    padding:12px !important;
  }
}

@media(min-width:1000px) and (max-height:850px){
  #dashboard.dashboard-pro{
    margin:0 !important;
    padding:10px 12px 8px !important;
  }
}

/* Garante que nenhum card invada o cabeçalho */
#dashboard .dash-kpis,
#dashboard .monitor-toolbar-pro,
#dashboard .dash-monitor-layout{
  position: relative;
  top: auto !important;
  transform: none !important;
}

/* v19 - menu retrátil e lateral 100% da altura */
.app{
  display:block!important;
  min-height:100vh!important;
  background:#f3f6fb;
}

.sidebar{
  position:fixed!important;
  left:0!important;
  top:0!important;
  bottom:0!important;
  width:250px!important;
  height:100dvh!important;
  min-height:100vh!important;
  box-sizing:border-box!important;
  background:var(--nav)!important;
  z-index:100!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}

.main{
  margin-left:250px!important;
  width:calc(100% - 250px)!important;
  min-height:100vh!important;
  box-sizing:border-box!important;
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.sidebar-collapse-btn{
  display:grid!important;
  place-items:center!important;
  width:40px!important;
  height:40px!important;
  flex:0 0 40px!important;
}

body.sidebar-collapsed .sidebar{
  transform:translateX(-100%)!important;
  opacity:0!important;
  pointer-events:none!important;
}

body.sidebar-collapsed .main{
  margin-left:0!important;
  width:100%!important;
}

body.sidebar-collapsed .sidebar-restore-btn{
  display:grid!important;
  place-items:center!important;
}

.sidebar-restore-btn{
  position:fixed!important;
  left:12px!important;
  top:18px!important;
  z-index:1000!important;
}

@media(max-width:850px){
  .app{display:block!important}
  .sidebar{
    left:-270px!important;
    width:250px!important;
    transform:none!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
  .sidebar.open{left:0!important}
  .main{margin-left:0!important;width:100%!important}
  .sidebar-collapse-btn{display:none!important}
  .sidebar-restore-btn{display:none!important}
}

/* v20 - cabeçalho superior escuro */
.topbar{
  background:#07111f!important;
  border-bottom:1px solid #1d2d42!important;
  color:#fff!important;
  box-shadow:none!important;
}

.topbar h2,
.topbar #pageTitle{
  color:#fff!important;
}

.topbar p,
.topbar #pageSubtitle{
  color:#8ea0b7!important;
}

.sidebar-collapse-btn{
  background:#0d1a2b!important;
  color:#fff!important;
  border:1px solid #2a3d56!important;
  box-shadow:none!important;
}

.sidebar-collapse-btn:hover{
  background:#13243a!important;
}

.topbar-left{
  min-height:64px;
}

@media(max-width:850px){
  .topbar{
    background:#07111f!important;
  }
}

/* v21 - topo mais intuitivo */
.topbar{
  min-height:82px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:18px!important;
  padding:10px 18px!important;
}
.topbar-page-info{
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.topbar-breadcrumb{
  display:flex;
  align-items:center;
  gap:7px;
  margin-bottom:2px;
  font-size:11px;
  color:#71849c;
  text-transform:uppercase;
  letter-spacing:.45px;
  font-weight:700;
}
.topbar-breadcrumb span:last-child{
  color:#37a3ff;
}
.topbar-page-info h2{
  margin:0!important;
  line-height:1.15!important;
}
.topbar-page-info p{
  margin:3px 0 0!important;
}
.topbar-system-state{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border:1px solid #21364e;
  background:#0b1929;
  border-radius:12px;
  min-width:164px;
}
.topbar-system-state > div{
  display:flex;
  flex-direction:column;
  line-height:1.15;
}
.topbar-system-state strong{
  color:#eaf4ff;
  font-size:12px;
}
.topbar-system-state small{
  color:#7f93aa;
  font-size:10px;
  margin-top:3px;
}
.topbar-live-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 4px rgba(34,197,94,.12),0 0 12px rgba(34,197,94,.5);
  flex:0 0 auto;
}
@media(max-width:700px){
  .topbar-system-state{display:none}
  .topbar{min-height:72px!important;padding:8px 12px!important}
}

/* v22 - monitoramento resumido para visualizar vários clientes */
#dashboard.monitor-resumido .client-monitor-groups{gap:8px!important}
#dashboard.monitor-resumido .client-monitor-group{
  padding:8px 10px!important;
  border-radius:10px!important;
}
#dashboard.monitor-resumido .client-monitor-head{
  padding:0 2px 7px!important;
}
#dashboard.monitor-resumido .client-building{font-size:17px!important}
#dashboard.monitor-resumido .client-group-title strong{font-size:13px!important}
#dashboard.monitor-resumido .client-online-pill{
  padding:3px 6px!important;
  font-size:9px!important;
}
#dashboard.monitor-resumido .monitor-card-grid{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
}
#dashboard.monitor-resumido .monitor-device-card{
  min-height:0!important;
  width:auto!important;
  flex:1 1 155px!important;
  max-width:235px!important;
  padding:8px 9px!important;
  border-radius:8px!important;
}
#dashboard.monitor-resumido .device-card-top{
  justify-content:flex-start!important;
  gap:6px!important;
}
#dashboard.monitor-resumido .device-status-dot{
  width:8px!important;height:8px!important;
  box-shadow:none!important;
}
#dashboard.monitor-resumido .device-category{
  margin-left:auto!important;
  padding:2px 5px!important;
  font-size:8px!important;
}
#dashboard.monitor-resumido .monitor-device-card h4{
  margin:6px 0 2px!important;
  font-size:11px!important;
  line-height:1.15!important;
}
#dashboard.monitor-resumido .device-client{display:none!important}
#dashboard.monitor-resumido .device-ip{
  margin-top:3px!important;
  font-size:9px!important;
}
#dashboard.monitor-resumido .device-card-bottom{
  grid-template-columns:auto auto!important;
  justify-content:space-between!important;
  gap:8px!important;
  margin-top:6px!important;
  padding-top:6px!important;
}
#dashboard.monitor-resumido .device-card-bottom > div:first-child small,
#dashboard.monitor-resumido .device-card-bottom > div:nth-child(2) small{
  display:none!important;
}
#dashboard.monitor-resumido .device-card-bottom strong{
  font-size:11px!important;
}
#dashboard.monitor-resumido .device-state{font-size:10px!important}
#dashboard.monitor-resumido .device-updated{display:none!important}

/* Mais espaço para a lista de clientes, ocorrências um pouco mais estreitas */
#dashboard.monitor-resumido .dash-monitor-layout{
  grid-template-columns:minmax(0,1fr) 330px!important;
  gap:10px!important;
}
#dashboard.monitor-resumido .occurrence-row{padding:8px 0!important}
#dashboard.monitor-resumido .panel-dark-head{padding:10px 12px!important}
#dashboard.monitor-resumido .occurrence-list{padding:3px 12px!important}

#monitorViewMode{min-width:135px}

@media(max-width:1250px){
  #dashboard.monitor-resumido .dash-monitor-layout{grid-template-columns:1fr!important}
  #dashboard.monitor-resumido .monitor-device-card{max-width:none!important}
}

/* v23 - evita flash branco e mostra carregamento elegante */
html{
  background:#07111f!important;
}
body{
  background:#07111f!important;
}
.app-loading{
  position:fixed;
  inset:0;
  z-index:999999;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at 50% 42%, rgba(22,105,232,.13), transparent 32%),
    #07111f;
  opacity:1;
  transition:opacity .2s ease, visibility .2s ease;
}
.app-loading.done{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
.app-loading-card{
  display:grid;
  grid-template-columns:58px minmax(180px,1fr) 30px;
  gap:14px;
  align-items:center;
  width:min(430px,calc(100vw - 36px));
  padding:17px 18px;
  border:1px solid #1e334d;
  border-radius:16px;
  background:#0d1a2b;
  box-shadow:0 22px 70px rgba(0,0,0,.28);
}
.app-loading-logo{
  width:54px;
  height:54px;
  border-radius:14px;
  display:grid;
  place-items:center;
  color:white;
  font-size:20px;
  font-weight:900;
  background:linear-gradient(145deg,#2563eb,#0ea5e9);
  box-shadow:0 8px 28px rgba(37,99,235,.25);
}
.app-loading-copy strong,
.app-loading-copy span{
  display:block;
}
.app-loading-copy strong{
  color:#f4f8ff;
  font-size:15px;
}
.app-loading-copy span{
  color:#8ea0b8;
  margin-top:4px;
  font-size:11px;
}
.app-loading-spinner{
  width:25px;
  height:25px;
  border-radius:50%;
  border:3px solid #223a57;
  border-top-color:#31d57c;
  animation:jpluzSpin .7s linear infinite;
}
@keyframes jpluzSpin{to{transform:rotate(360deg)}}

/* Evita faixa branca durante a montagem do conteúdo */
.main,
.app,
.view{
  background-color:inherit;
}

/* v25 — navegação superior e dashboard com área útil máxima */
:root{--topnav-h:58px}

/* A antiga sidebar vira uma barra superior horizontal */
.sidebar{
  position:fixed!important;
  top:0!important;
  left:0!important;
  right:0!important;
  bottom:auto!important;
  width:100%!important;
  height:var(--topnav-h)!important;
  min-height:var(--topnav-h)!important;
  z-index:10000!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:10px!important;
  padding:6px 14px!important;
  overflow:visible!important;
  border-right:0!important;
  border-bottom:1px solid #1e334d!important;
  background:#0b1728!important;
}
.sidebar .brand{
  flex:0 0 auto!important;
  min-width:150px!important;
  padding:0 12px 0 0!important;
  margin:0!important;
}
.sidebar .brand-subtitle{display:none!important}
.sidebar nav,
.sidebar .nav{
  flex:1 1 auto!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:4px!important;
  margin:0!important;
  padding:0!important;
  overflow-x:auto!important;
  scrollbar-width:none!important;
}
.sidebar nav::-webkit-scrollbar,
.sidebar .nav::-webkit-scrollbar{display:none!important}
.sidebar nav a,
.sidebar .nav a,
.sidebar .nav-item{
  flex:0 0 auto!important;
  min-height:38px!important;
  padding:9px 12px!important;
  margin:0!important;
  border-radius:9px!important;
  white-space:nowrap!important;
}
.sidebar .sidebar-footer,
.sidebar .user-footer{
  position:static!important;
  flex:0 0 auto!important;
  margin:0!important;
  padding:0!important;
}
.sidebar .sidebar-footer .email,
.sidebar .user-footer .email{display:none!important}
.sidebar .sidebar-footer button,
.sidebar .user-footer button{
  width:auto!important;
  min-width:70px!important;
  padding:8px 14px!important;
}

/* Conteúdo ocupa toda a largura e começa abaixo da navegação */
.main,
.main-content,
.app-main{
  margin-left:0!important;
  width:100%!important;
  max-width:none!important;
  padding-top:var(--topnav-h)!important;
}
.topbar,
.header{
  left:0!important;
}

/* Dashboard mais compacto verticalmente */
#dashboard .monitor-hero{
  padding-top:10px!important;
  padding-bottom:6px!important;
}
#dashboard .monitor-summary{
  gap:8px!important;
  margin-top:6px!important;
}
#dashboard .summary-card{
  min-height:72px!important;
  padding:9px 12px!important;
}
#dashboard .monitor-tools{
  margin-top:6px!important;
  padding:7px!important;
  gap:6px!important;
}
#dashboard .dash-monitor-layout{margin-top:8px!important}

/* Em telas menores, mantém a barra rolável em vez de roubar espaço lateral */
@media(max-width:1050px){
  .sidebar{gap:6px!important;padding-inline:8px!important}
  .sidebar .brand{min-width:auto!important}
  .sidebar .brand span:not(:first-child){display:none!important}
  .sidebar nav a,.sidebar .nav a,.sidebar .nav-item{padding:8px 9px!important;font-size:12px!important}
}
@media(max-width:720px){
  :root{--topnav-h:54px}
  .sidebar .brand{display:none!important}
  .sidebar .sidebar-footer,.sidebar .user-footer{display:none!important}
}

/* Se o menu estiver no modo recolhido, não volta a criar coluna lateral */
body.sidebar-collapsed .sidebar,
body.menu-collapsed .sidebar{
  width:100%!important;
  transform:none!important;
}
body.sidebar-collapsed .main,
body.menu-collapsed .main,
body.sidebar-collapsed .main-content,
body.menu-collapsed .main-content{
  margin-left:0!important;
  width:100%!important;
}

/* v26 — topo único, limpo e profissional */
:root{--topnav-h:62px}

/* navegação superior */
.sidebar{
  height:var(--topnav-h)!important;
  min-height:var(--topnav-h)!important;
  padding:7px 12px!important;
  gap:8px!important;
}
.sidebar .brand{
  min-width:145px!important;
  margin-right:4px!important;
}
.sidebar nav,
.sidebar .nav{
  flex:1 1 auto!important;
  gap:3px!important;
}
.sidebar nav a,
.sidebar .nav a,
.sidebar .nav-item{
  min-height:38px!important;
  padding:8px 10px!important;
  font-size:13px!important;
}

/* remove o segundo cabeçalho duplicado */
.topbar{
  display:none!important;
}
.sidebar-collapse-btn,
.sidebar-restore-btn{
  display:none!important;
}

/* área principal começa logo abaixo do menu */
.main,
.main-content,
.app-main{
  padding-top:var(--topnav-h)!important;
}

/* controles à direita */
.topnav-right{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex:0 0 auto!important;
  margin-left:auto!important;
}
.topnav-sound{
  border:1px solid #1f7a4c;
  background:#0a2a1d;
  color:#49e892;
  border-radius:9px;
  height:38px;
  padding:0 11px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.topnav-sound.off{
  border-color:#3b4a5f;
  background:#101b2b;
  color:#aab7c8;
}
.topnav-system{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:132px;
  padding:6px 9px;
  border:1px solid #20344c;
  background:#0c1929;
  border-radius:9px;
}
.topnav-system > div{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}
.topnav-system strong{
  color:#eef6ff;
  font-size:10px;
}
.topnav-system small{
  color:#7e90a7;
  font-size:8px;
  margin-top:2px;
}
.topnav-live-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 4px rgba(34,197,94,.10);
}
.topnav-clock{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  min-width:72px;
  line-height:1.05;
}
.topnav-clock strong{
  color:#fff;
  font-size:13px;
}
.topnav-clock small{
  color:#74869d;
  font-size:8px;
  margin-top:2px;
}

/* esconder controles duplicados do corpo */
#soundToggleBtn,
.dash-pro-clock,
.dash-pro-actions{
  display:none!important;
}

/* monitoramento sobe e fica mais enxuto */
.dashboard-pro{
  padding-top:8px!important;
}
.dash-pro-header{
  margin-bottom:8px!important;
}
.dash-live-title h2{
  font-size:22px!important;
}
.dash-pro-header p{
  font-size:11px!important;
}
.dash-kpis{
  gap:8px!important;
  margin-bottom:8px!important;
}
.dash-kpi{
  min-height:70px!important;
  padding:9px 11px!important;
}
.dash-kpi .kpi-icon{
  width:36px!important;
  height:36px!important;
  font-size:19px!important;
}
.dash-kpi strong{
  font-size:21px!important;
}
.monitor-toolbar-pro{
  padding:7px 8px!important;
  margin-bottom:8px!important;
}
.client-monitor-group{
  padding:8px!important;
}
.dash-legend{
  margin-top:7px!important;
}

/* footer/user no topo: mostra apenas sair de forma compacta */
.sidebar .sidebar-footer,
.sidebar .user-footer{
  margin-left:0!important;
}
.sidebar .sidebar-footer .email,
.sidebar .user-footer .email{
  display:none!important;
}
.sidebar .sidebar-footer button,
.sidebar .user-footer button{
  height:38px!important;
  min-width:58px!important;
  padding:0 11px!important;
  border-radius:9px!important;
}

/* telas menores: simplifica sem reintroduzir a lateral */
@media(max-width:1200px){
  .topnav-system{display:none!important}
  .sidebar .brand{min-width:105px!important}
}
@media(max-width:950px){
  .topnav-clock{display:none!important}
  .topnav-sound{padding:0 8px!important}
  .sidebar nav a,
  .sidebar .nav a,
  .sidebar .nav-item{
    font-size:12px!important;
    padding:8px 8px!important;
  }
}
@media(max-width:720px){
  .topnav-right{display:none!important}
}

/* v30 - Scanner de Rede */
.scanner-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:12px}
.scanner-head h2{margin:0;font-size:22px}.scanner-head p{margin:4px 0 0;color:#64748b;font-size:12px}
.scanner-live{display:flex;align-items:center;gap:9px;border:1px solid #dbe4ee;background:#fff;border-radius:10px;padding:8px 11px}
.scanner-live>span{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 4px #22c55e1c}
.scanner-live strong,.scanner-live small{display:block}.scanner-live strong{font-size:11px}.scanner-live small{font-size:9px;color:#64748b;margin-top:2px}
.scanner-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-bottom:10px}
.scanner-kpis article{background:#fff;border:1px solid #dce4ee;border-radius:11px;padding:11px 14px}.scanner-kpis span{display:block;color:#64748b;font-size:10px}.scanner-kpis strong{display:block;font-size:24px;margin-top:3px;color:#0f172a}
.scanner-kpis .ok strong{color:#16a34a}.scanner-kpis .known strong{color:#2563eb}.scanner-kpis .new strong{color:#d97706}
.scanner-toolbar{display:grid;grid-template-columns:220px minmax(260px,1fr) 180px auto;gap:8px;margin-bottom:9px}.scanner-toolbar input,.scanner-toolbar select{height:40px;border:1px solid #d6e0eb;border-radius:8px;padding:0 10px;background:#fff}
.scanner-info{background:#eaf4ff;border:1px solid #bfdbfe;color:#31506e;padding:9px 12px;border-radius:9px;font-size:10px;margin-bottom:9px}
.scanner-table-wrap{padding:0!important}.scanner-table th{font-size:10px}.scanner-table td{font-size:11px}.scan-ip{font-family:ui-monospace,Consolas,monospace;font-size:12px}
.scan-status{display:inline-flex;align-items:center;gap:5px;font-size:9px;font-weight:900}.scan-status i{width:7px;height:7px;border-radius:50%}.scan-status.online{color:#15803d}.scan-status.online i{background:#22c55e}.scan-status.offline{color:#b91c1c}.scan-status.offline i{background:#ef4444}
.scan-known{color:#2563eb;font-size:9px;font-weight:800}.scan-new{color:#d97706;font-size:9px;font-weight:800}
@media(max-width:900px){.scanner-kpis{grid-template-columns:1fr 1fr}.scanner-toolbar{grid-template-columns:1fr 1fr}.scanner-head{align-items:flex-start;flex-direction:column}}

.scan-network{display:inline-flex;align-items:center;padding:3px 6px;border-radius:999px;background:#eef5ff;color:#1d4ed8;font-size:9px;font-weight:800;white-space:nowrap}

/* v32 - Scanner validado */
.scan-evidence{display:inline-flex;align-items:center;padding:3px 6px;border-radius:999px;background:#ecfdf5;color:#15803d;font-size:9px;font-weight:800;white-space:nowrap}
.scan-add-btn{border:1px solid #2563eb;background:#2563eb;color:#fff;border-radius:7px;padding:6px 8px;font-size:9px;font-weight:800;cursor:pointer;white-space:nowrap}
.scan-add-btn:hover{background:#1d4ed8}
.scanner-toolbar{grid-template-columns:210px 175px minmax(260px,1fr) 170px auto!important}
@media(max-width:1050px){.scanner-toolbar{grid-template-columns:1fr 1fr!important}}

.scan-monitor-btn{
  border:1px solid #2563eb;background:#2563eb;color:#fff;border-radius:7px;
  padding:6px 8px;font-size:9px;font-weight:800;cursor:pointer;white-space:nowrap
}
.scan-monitor-btn:hover{background:#1d4ed8}
#scannerEquipModal .modal-head small{display:block;color:#64748b;margin-top:3px;font-size:10px}
#scannerEquipModal input[readonly]{background:#f3f6fa;color:#475569}

.scan-name{display:block;font-weight:800;color:#0f172a}
.scan-name-source{display:block;margin-top:2px;color:#64748b;font-size:8px}
.scan-name-source.host{color:#15803d}

/* v36 - Scanner: IP ao lado da ação + destaque da linha */
.scan-table tbody tr{
  transition:background-color .14s ease, box-shadow .14s ease;
}
.scan-table tbody tr:hover{
  background:#eaf3ff !important;
  box-shadow:inset 3px 0 0 #2563eb;
}
.scan-table tbody tr:hover td{
  background:#eaf3ff !important;
}
.scan-table tbody tr:hover td:nth-last-child(2) strong{
  color:#0b57d0;
}

/* v37 - PWA / celular */
@media (display-mode: standalone){
  body{
    padding-top:env(safe-area-inset-top);
    padding-bottom:env(safe-area-inset-bottom);
  }
}
@media(max-width:720px){
  html,body{overscroll-behavior-y:none}
  .sidebar{
    padding-left:max(8px,env(safe-area-inset-left))!important;
    padding-right:max(8px,env(safe-area-inset-right))!important;
  }
  button,input,select,textarea{font-size:16px}
}

/* v39 - layout mobile real */
@media(max-width:720px){
  body{
    overflow-x:hidden!important;
  }

  /* topo */
  .sidebar{
    position:sticky!important;
    top:0!important;
    height:auto!important;
    min-height:58px!important;
    width:100%!important;
    padding:7px 8px!important;
    gap:6px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    border-bottom:1px solid #1e334d!important;
  }
  .sidebar .brand{
    min-width:118px!important;
    display:flex!important;
    flex:0 0 auto!important;
  }
  .sidebar .brand-subtitle{
    display:none!important;
  }
  .sidebar nav,
  .sidebar .nav{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    gap:4px!important;
    overflow-x:auto!important;
    flex:1 0 auto!important;
  }
  .sidebar nav a,
  .sidebar .nav a,
  .sidebar .nav-item{
    min-height:38px!important;
    padding:8px 10px!important;
    font-size:12px!important;
    border-radius:8px!important;
    flex:0 0 auto!important;
  }
  .topnav-right{
    display:none!important;
  }

  .main,
  .main-content,
  .app-main{
    margin-left:0!important;
    width:100%!important;
    padding-top:0!important;
  }

  /* título */
  .dashboard-pro{
    padding:12px!important;
  }
  .dash-pro-header{
    display:block!important;
    margin-bottom:10px!important;
  }
  .dash-live-title h2{
    font-size:22px!important;
    line-height:1.1!important;
  }
  .dash-pro-header p{
    font-size:11px!important;
    margin-top:5px!important;
  }

  /* KPIs: duas colunas */
  .dash-kpis{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }
  .dash-kpi{
    min-height:92px!important;
    padding:10px!important;
    border-radius:12px!important;
  }
  .dash-kpi .kpi-icon{
    width:34px!important;
    height:34px!important;
    font-size:17px!important;
  }
  .dash-kpi strong{
    font-size:21px!important;
  }
  .dash-kpi span,
  .dash-kpi small{
    font-size:9px!important;
  }

  /* último card ocupa a linha toda */
  .dash-kpi:last-child{
    grid-column:1 / -1!important;
  }

  /* filtros */
  .monitor-toolbar-pro{
    display:block!important;
    padding:8px!important;
    border-radius:12px!important;
  }
  .monitor-filter-tabs{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:6px!important;
    width:100%!important;
  }
  .monitor-filter-tabs button{
    width:100%!important;
    min-width:0!important;
    padding:9px 8px!important;
    font-size:12px!important;
  }
  .monitor-tools{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    margin-top:8px!important;
    width:100%!important;
  }
  .monitor-tools select,
  .monitor-search{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:42px!important;
  }
  .monitor-search input{
    width:100%!important;
    height:42px!important;
  }

  /* conteúdo do monitor */
  .dash-monitor-layout{
    display:block!important;
  }
  .client-monitor-groups{
    width:100%!important;
  }
  .client-monitor-group{
    padding:9px!important;
  }
  .client-monitor-head{
    gap:6px!important;
    align-items:flex-start!important;
  }
  .client-group-title strong{
    font-size:13px!important;
  }
  .client-location{
    font-size:9px!important;
  }

  /* cards de equipamentos */
  .monitor-card-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
  }
  .monitor-device-card{
    max-width:none!important;
    width:100%!important;
    min-height:0!important;
    padding:10px!important;
  }
  .monitor-device-card h4{
    font-size:13px!important;
  }
  .device-card-bottom{
    display:grid!important;
    grid-template-columns:1fr 1fr auto!important;
    align-items:end!important;
  }

  /* ocorrências abaixo */
  .occurrences-panel,
  .panel-dark{
    margin-top:10px!important;
    width:100%!important;
    max-width:none!important;
  }

  /* scanner */
  .scanner-head{
    display:block!important;
  }
  .scanner-live{
    margin-top:8px!important;
    width:100%!important;
  }
  .scanner-kpis{
    grid-template-columns:1fr 1fr!important;
  }
  .scanner-toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
  }
  .scanner-toolbar input,
  .scanner-toolbar select,
  .scanner-toolbar button{
    width:100%!important;
    height:42px!important;
  }

  .scanner-table-wrap{
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  .scanner-table{
    min-width:980px!important;
  }

  /* modais */
  dialog{
    width:calc(100vw - 20px)!important;
    max-width:none!important;
    max-height:90vh!important;
    overflow:auto!important;
    border-radius:14px!important;
  }
  .form-grid{
    grid-template-columns:1fr!important;
  }
  .form-grid .wide{
    grid-column:auto!important;
  }
  .modal-actions{
    position:sticky;
    bottom:0;
    background:#fff;
    padding-top:10px;
  }

  /* evita inputs gigantes */
  input,select,textarea,button{
    max-width:100%!important;
  }
}

/* telas muito estreitas */
@media(max-width:430px){
  .dash-kpis{
    grid-template-columns:1fr 1fr!important;
  }
  .dash-live-title h2{
    font-size:20px!important;
  }
  .sidebar .brand{
    min-width:96px!important;
  }
  .sidebar nav a,
  .sidebar .nav a,
  .sidebar .nav-item{
    font-size:11px!important;
    padding:8px 8px!important;
  }
}

/* v40 - corrige rolagem vertical no celular */
@media(max-width:720px){
  html{
    height:auto!important;
    min-height:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }

  body{
    height:auto!important;
    min-height:100vh!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    position:static!important;
    overscroll-behavior-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  #app,
  .app,
  #appView,
  .main,
  .main-content,
  .app-main,
  .view,
  #dashboard{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    position:relative!important;
  }

  /* topo continua visível, mas não prende a página */
  .sidebar{
    position:sticky!important;
    top:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }

  /* apenas áreas que realmente precisam podem rolar horizontalmente */
  .scanner-table-wrap,
  .table-wrap{
    overflow-x:auto!important;
    overflow-y:visible!important;
    -webkit-overflow-scrolling:touch!important;
  }

  /* remove qualquer trava antiga de viewport */
  .dashboard-pro,
  .dash-monitor-layout,
  .client-monitor-groups,
  .client-monitor-group{
    max-height:none!important;
    overflow:visible!important;
  }
}

/* v41 - menu mobile estilo aplicativo */
.mobile-bottom-nav,
.mobile-more-menu,
.mobile-menu-backdrop{
  display:none;
}

@media(max-width:720px){
  /* Esconde o menu desktop no celular */
  .sidebar{
    display:none!important;
  }

  .main,
  .main-content,
  .app-main{
    padding-top:0!important;
    padding-bottom:calc(76px + env(safe-area-inset-bottom))!important;
  }

  .mobile-bottom-nav{
    position:fixed;
    z-index:5000;
    left:8px;
    right:8px;
    bottom:max(8px,env(safe-area-inset-bottom));
    height:64px;
    display:grid;
    grid-template-columns:repeat(5,1fr);
    align-items:center;
    padding:5px 6px;
    gap:2px;
    border:1px solid #263a54;
    border-radius:18px;
    background:rgba(8,20,35,.97);
    box-shadow:0 14px 40px rgba(0,0,0,.38);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }

  .mobile-nav-btn{
    height:52px;
    min-width:0;
    border:0;
    background:transparent;
    color:#8395ac;
    border-radius:13px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    padding:3px 2px!important;
    font-weight:700;
  }

  .mobile-nav-btn.active{
    color:#fff;
    background:#172a41;
  }

  .mobile-nav-icon{
    display:grid;
    place-items:center;
    height:22px;
    min-width:22px;
    font-size:20px;
    line-height:1;
    color:inherit;
  }

  .mobile-nav-btn small{
    font-size:9px;
    line-height:1;
    white-space:nowrap;
    color:inherit;
  }

  .mobile-menu-backdrop{
    position:fixed;
    inset:0;
    z-index:5100;
    background:rgba(0,0,0,.55);
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
  }
  .mobile-menu-backdrop.open{
    display:block;
    opacity:1;
    pointer-events:auto;
  }

  .mobile-more-menu{
    display:block;
    position:fixed;
    z-index:5200;
    left:8px;
    right:8px;
    bottom:calc(8px + env(safe-area-inset-bottom));
    padding:8px 12px 14px;
    border:1px solid #273c57;
    border-radius:22px;
    background:#0c1a2c;
    box-shadow:0 20px 70px rgba(0,0,0,.5);
    transform:translateY(calc(100% + 20px));
    opacity:0;
    pointer-events:none;
    transition:transform .22s ease,opacity .22s ease;
  }
  .mobile-more-menu.open{
    transform:translateY(0);
    opacity:1;
    pointer-events:auto;
  }

  .mobile-more-handle{
    width:38px;
    height:4px;
    border-radius:99px;
    background:#40536b;
    margin:1px auto 10px;
  }

  .mobile-more-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:0 2px 10px;
  }
  .mobile-more-head strong{
    display:block;
    color:#fff;
    font-size:14px;
  }
  .mobile-more-head small{
    display:block;
    color:#8092a8;
    font-size:10px;
    margin-top:2px;
  }
  #mobileMoreClose{
    width:36px!important;
    height:36px!important;
    padding:0!important;
    border:1px solid #2a3f5a;
    border-radius:10px;
    background:#122238;
    color:#fff;
    font-size:22px;
  }

  .mobile-more-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .mobile-more-grid button{
    min-height:70px;
    border:1px solid #223750;
    border-radius:13px;
    background:#101f33;
    color:#f1f6fb;
    display:flex;
    align-items:center;
    gap:9px;
    padding:11px!important;
    text-align:left;
  }
  .mobile-more-grid button span{
    width:30px;
    height:30px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:#17304f;
    font-size:16px;
  }
  .mobile-more-grid button b{
    font-size:11px;
  }

  .mobile-more-actions{
    display:grid;
    grid-template-columns:1fr auto;
    gap:8px;
    margin-top:10px;
  }
  .mobile-more-actions button{
    min-height:44px;
    border:1px solid #25415f;
    border-radius:11px;
    background:#10233a;
    color:#fff;
    font-size:11px!important;
    font-weight:800;
    padding:9px 12px!important;
  }
  .mobile-more-actions button:first-child{
    text-align:left;
  }
  .mobile-more-actions .danger{
    background:#3b1720;
    border-color:#6b2734;
    color:#ffbdc7;
  }

  /* deixa o topo do conteúdo mais limpo como app */
  .dashboard-pro{
    padding-top:14px!important;
  }
}

/* celulares muito estreitos */
@media(max-width:380px){
  .mobile-bottom-nav{
    left:5px;
    right:5px;
  }
  .mobile-nav-btn small{
    font-size:8px;
  }
}

/* v43 - puxar para atualizar no celular */
.pull-refresh-indicator{
  display:none;
}

@media(max-width:720px){
  .pull-refresh-indicator{
    position:fixed;
    top:0;
    left:50%;
    z-index:9000;
    display:flex;
    align-items:center;
    gap:8px;
    transform:translate(-50%,-70px);
    opacity:0;
    pointer-events:none;
    padding:8px 13px;
    border:1px solid #28405e;
    border-radius:999px;
    background:#0d1d31;
    color:#dce9f7;
    box-shadow:0 8px 30px rgba(0,0,0,.35);
    transition:transform .12s ease,opacity .12s ease;
    font-size:11px;
    font-weight:800;
  }
  .pull-refresh-indicator.visible{
    opacity:1;
  }
  .pull-refresh-circle{
    width:28px;
    height:28px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#17375c;
    color:#58a8ff;
    font-size:18px;
    font-weight:900;
    transition:transform .12s ease,background .12s ease,color .12s ease;
  }
  .pull-refresh-indicator.ready .pull-refresh-circle{
    transform:rotate(180deg);
    background:#0f5132;
    color:#55e698;
  }
  .pull-refresh-indicator.refreshing .pull-refresh-circle{
    animation:jpluzPullSpin .7s linear infinite;
  }
  @keyframes jpluzPullSpin{
    to{transform:rotate(360deg)}
  }
}

/* v44 - garante toque no menu mobile */
@media(max-width:720px){
  .mobile-bottom-nav{
    z-index:999999!important;
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }
  .mobile-bottom-nav *{
    pointer-events:auto!important;
  }
  .mobile-nav-btn{
    pointer-events:auto!important;
    touch-action:manipulation!important;
    position:relative!important;
    z-index:2!important;
  }
  .mobile-more-menu{
    z-index:1000000!important;
    pointer-events:auto!important;
  }
  .mobile-menu-backdrop{
    z-index:999998!important;
  }
}

/* v45 - painel Mais garantidamente interativo */
@media(max-width:720px){
  #mobileMoreBtn{
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }

  .mobile-menu-backdrop{
    display:block!important;
    visibility:hidden;
    opacity:0;
    pointer-events:none!important;
  }
  .mobile-menu-backdrop.open{
    visibility:visible;
    opacity:1!important;
    pointer-events:auto!important;
  }

  .mobile-more-menu{
    visibility:hidden;
    pointer-events:none!important;
  }
  .mobile-more-menu.open{
    visibility:visible;
    pointer-events:auto!important;
  }
  .mobile-more-menu.open *{
    pointer-events:auto!important;
  }

  body.mobile-menu-open{
    overflow:hidden!important;
  }
}

/* v47 - categorias gerenciáveis */
.category-select-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 42px;
  gap:7px;
  align-items:center;
}
.category-manage-btn{
  height:42px;
  width:42px;
  padding:0!important;
  border:1px solid #cbd5e1;
  background:#f8fafc;
  color:#334155;
  border-radius:9px;
  font-size:17px;
  cursor:pointer;
}
.category-manage-btn:hover{background:#eaf2ff;color:#1d4ed8}

.category-manager-modal{
  width:min(560px,calc(100vw - 24px))!important;
}
.category-manager-modal .modal-form{padding:0}
.category-manager-modal .modal-head{padding:18px 18px 13px}
.category-manager-modal .modal-head small{display:block;margin-top:3px;color:#64748b;font-size:10px}
.category-add-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  padding:0 18px 14px;
}
.category-add-row input{
  height:42px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  padding:0 11px;
}
.category-list{
  max-height:390px;
  overflow-y:auto;
  border-top:1px solid #e2e8f0;
  border-bottom:1px solid #e2e8f0;
}
.category-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 18px;
  border-bottom:1px solid #edf2f7;
}
.category-row:last-child{border-bottom:0}
.category-row-name strong{display:block;font-size:12px;color:#0f172a}
.category-row-name small{display:block;margin-top:2px;font-size:9px;color:#64748b}
.category-delete-btn{
  border:1px solid #fecaca;
  background:#fff1f2;
  color:#dc2626;
  border-radius:8px;
  padding:7px 9px;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.category-delete-btn.disabled,
.category-delete-btn:disabled{
  opacity:.42;
  cursor:not-allowed;
}
.category-manager-note{
  padding:11px 18px 15px;
  color:#64748b;
  font-size:9px;
  line-height:1.4;
}
@media(max-width:720px){
  .category-add-row{grid-template-columns:1fr}
  .category-add-row .btn{width:100%!important}
  .category-manager-modal{max-height:85vh!important}
  .category-list{max-height:42vh}
}
\n/* v48 - edição */\n.edit-btn,.category-edit-btn{border:1px solid #bfdbfe;background:#eff6ff;color:#2563eb;border-radius:8px;padding:7px 10px;font-size:10px;font-weight:800;cursor:pointer}.edit-btn:hover,.category-edit-btn:hover{background:#dbeafe}.category-row-actions{display:flex;gap:6px;align-items:center}.category-edit-btn:disabled{opacity:.4;cursor:not-allowed}\n
/* v49 - login profissional + acesso restrito */
body.auth-mode{
  background:#07111f!important;
}
body.auth-mode #appView,
body.auth-mode .mobile-bottom-nav,
body.auth-mode .mobile-more-menu{
  display:none!important;
}
.auth-shell{
  min-height:100dvh!important;
  padding:0!important;
  background:#07111f!important;
  display:grid!important;
  place-items:stretch!important;
}
.auth-layout{
  min-height:100dvh;
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(420px,.85fr);
  background:
    radial-gradient(circle at 18% 28%,rgba(37,99,235,.22),transparent 30%),
    linear-gradient(135deg,#07111f,#0c1b2f 52%,#132238);
}
.auth-showcase{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:42px 6vw;
  color:#fff;
  overflow:hidden;
}
.auth-showcase:after{
  content:"";
  position:absolute;
  width:420px;height:420px;border-radius:50%;
  right:-150px;bottom:-180px;
  border:1px solid rgba(86,157,255,.16);
  box-shadow:0 0 0 70px rgba(70,128,210,.035),0 0 0 140px rgba(70,128,210,.025);
}
.auth-showcase-brand{
  display:flex;align-items:center;gap:12px;position:relative;z-index:1;
}
.auth-logo{width:50px!important;height:50px!important;border-radius:14px!important}
.auth-showcase-brand strong{display:block;font-size:17px}
.auth-showcase-brand span{display:block;color:#93a5bb;font-size:11px;margin-top:2px}
.auth-showcase-copy{max-width:620px;position:relative;z-index:1}
.auth-security-pill,.auth-mobile-restricted{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 9px;border-radius:999px;
  border:1px solid rgba(77,218,139,.28);
  background:rgba(14,92,57,.22);
  color:#67e6a0;font-size:10px;font-weight:900;letter-spacing:.4px;
}
.auth-showcase-copy h1{
  margin:18px 0 12px;font-size:clamp(38px,4.3vw,66px);line-height:1.02;max-width:650px;
}
.auth-showcase-copy>p{color:#9fb0c5;font-size:15px;line-height:1.55;max-width:560px}
.auth-features{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}
.auth-features div{
  display:flex;align-items:center;gap:7px;padding:9px 11px;
  border:1px solid #213751;border-radius:10px;background:rgba(11,27,46,.62);
  color:#c9d7e7;font-size:11px
}
.auth-features i{color:#26d979;font-style:normal}
.auth-showcase-footer{color:#61768f;position:relative;z-index:1}

.auth-login-panel{
  display:grid;place-items:center;padding:30px;
  background:rgba(4,12,22,.28);
  border-left:1px solid rgba(48,69,94,.48);
}
.auth-card{
  width:min(430px,100%)!important;
  max-width:none!important;
  padding:34px!important;
  border:1px solid #d9e2ec!important;
  border-radius:20px!important;
  box-shadow:0 30px 90px rgba(0,0,0,.35)!important;
}
.auth-card-logo{width:54px!important;height:54px!important;border-radius:15px!important;margin-bottom:18px}
.auth-card h2{font-size:27px;margin:0 0 5px;color:#0f172a}
.auth-card>.muted{margin:0 0 24px;line-height:1.45}
.auth-login-form label{font-size:11px;font-weight:800;color:#334155}
.auth-input-wrap{
  margin-top:6px;display:grid;grid-template-columns:38px 1fr;align-items:center;
  border:1px solid #cad5e2;border-radius:10px;background:#f8fafc;overflow:hidden;
}
.auth-input-wrap span{display:grid;place-items:center;color:#718096;font-size:12px}
.auth-input-wrap input{
  border:0!important;background:transparent!important;height:44px!important;padding:0 10px 0 0!important;outline:0!important;
}
.auth-input-wrap:focus-within{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.auth-enter-btn{height:46px!important;margin-top:4px;font-size:13px!important}
.auth-locked-note{
  margin-top:16px;padding:11px 12px;display:flex;gap:10px;align-items:flex-start;
  background:#f1f5f9;border:1px solid #dce5ef;border-radius:10px;
}
.auth-locked-note strong{display:block;font-size:10px;color:#334155}
.auth-locked-note small{display:block;margin-top:2px;font-size:9px;color:#64748b;line-height:1.35}
.auth-message{min-height:18px;color:#dc2626;font-size:10px;margin:10px 0 0}
.auth-mobile-restricted{display:none}

/* usuários */
.users-page-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:12px}
.users-page-head h2{margin:0;font-size:22px}.users-page-head p{margin:3px 0 0;color:#64748b;font-size:11px}
.users-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:10px}
.users-summary article{background:#fff;border:1px solid #dbe4ee;border-radius:11px;padding:12px 14px}
.users-summary span{display:block;color:#64748b;font-size:10px}.users-summary strong{display:block;font-size:24px;margin-top:3px}
.users-summary .ok strong{color:#16a34a}.users-summary .admin strong{color:#2563eb}
.users-security-note{display:flex;gap:9px;align-items:center;padding:9px 11px;margin-bottom:10px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:9px}
.users-security-note strong,.users-security-note small{display:block}.users-security-note strong{font-size:10px;color:#1e3a5f}.users-security-note small{font-size:9px;color:#5c7591;margin-top:2px}
.user-cell{display:flex;align-items:center;gap:9px}.user-avatar{width:30px;height:30px;border-radius:9px;background:#e7f0ff;color:#2563eb;display:grid;place-items:center;font-weight:900}
.user-cell strong,.user-cell small{display:block}.user-cell small{font-size:8px;color:#64748b;margin-top:2px}
.user-role,.user-access{display:inline-flex;padding:4px 7px;border-radius:999px;font-size:9px;font-weight:800}
.user-role.admin{background:#e8efff;color:#1d4ed8}.user-role.operador{background:#f1f5f9;color:#475569}
.user-access.active{background:#e9faef;color:#15803d}.user-access.blocked{background:#fff0f1;color:#b91c1c}
.user-actions{display:flex;gap:5px;flex-wrap:wrap}.user-action-btn{border:1px solid #d6e0eb;background:#fff;border-radius:7px;padding:6px 7px;font-size:9px;font-weight:800;cursor:pointer}
.user-action-btn.danger{border-color:#fecaca;background:#fff1f2;color:#dc2626}.user-action-btn:disabled{opacity:.35;cursor:not-allowed}
.user-role-help{padding:9px 11px;margin:0 18px 4px;background:#f8fafc;border-radius:8px;color:#64748b;font-size:9px;line-height:1.4}

@media(max-width:800px){
  .auth-layout{grid-template-columns:1fr}
  .auth-showcase{display:none}
  .auth-login-panel{padding:18px;background:#07111f;border:0}
  .auth-card{padding:26px!important;border-radius:18px!important}
  .auth-mobile-restricted{display:inline-flex;margin-bottom:14px}
  .users-summary{grid-template-columns:1fr 1fr}
  .users-summary article:last-child{grid-column:1/-1}
  .users-page-head{align-items:flex-start;flex-direction:column}
  .users-page-head .btn{width:100%!important}
  .users-table{min-width:850px}
}


/* v52 - CORREÇÃO DEFINITIVA: login e app nunca aparecem juntos
   A regra .auth-shell da v49 usa display:grid!important e estava
   sobrescrevendo .hidden após o login. */
#authView.hidden,
.auth-shell.hidden{
  display:none!important;
}

#appView.hidden{
  display:none!important;
}

/* Estado autenticado: login sempre fora da tela */
body:not(.auth-mode) #authView{
  display:none!important;
}

/* Estado deslogado: aplicação sempre fora da tela */
body.auth-mode #appView{
  display:none!important;
}

/* v53 - login por nome de usuário */
#loginUsername{
  text-transform:lowercase;
}
.users-table td:nth-child(2) strong{
  color:#2563eb;
  font-size:10px;
}

/* v54 - Hierarquia Super ADM / ADM / Operador */
.hidden{display:none!important}
.user-email strong,.user-email small{display:block}
.user-email small{font-size:9px;color:#7f94ad;margin-top:2px}
.user-role.super_admin{background:#f3e8ff;color:#7e22ce;border:1px solid #e9d5ff}
.user-role.admin{background:#e8efff;color:#1d4ed8}
.user-role.operador{background:#ecfdf5;color:#047857}
.users-summary-4{grid-template-columns:repeat(4,1fr)}
.users-summary .super strong{color:#7e22ce}
.users-summary .operator strong{color:#047857}
.user-companies{display:block;max-width:260px;font-size:9px;line-height:1.35;color:#475569}
.field-help{display:block;margin-top:4px;font-size:9px;color:#64748b}
#newUserClients{min-height:112px;padding:6px}
.user-client-checks{padding:4px 18px 16px;display:grid;gap:7px;max-height:55vh;overflow:auto}
.user-client-check{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid #dbe4ee;border-radius:10px;background:#f8fafc;cursor:pointer}
.user-client-check input{width:18px;height:18px}
.user-client-check span strong,.user-client-check span small{display:block}
.user-client-check span strong{font-size:11px;color:#0f172a}
.user-client-check span small{font-size:9px;color:#64748b;margin-top:2px}
.hierarchy-note b{color:#1e3a5f}

.occurrence-row.treated{opacity:.82}
.treated-label{display:block;margin-top:3px;color:#56d98c;font-size:9px;font-style:normal}
.occurrence-actions{display:flex;flex-direction:column;align-items:flex-end;gap:5px}
.treat-event-btn{border:1px solid #28547d;background:#102941;color:#7cc2ff;border-radius:7px;padding:5px 7px;font-size:9px;font-weight:800;cursor:pointer}
.treat-event-btn:hover{background:#153653}

/* operador: interface limpa, somente monitoramento e histórico */
body.role-operador .config-only,
body.role-operador .managers-only,
body.role-operador #newClient,
body.role-operador #newEquip,
body.role-operador [data-category-manager]{
  display:none!important;
}
body.role-operador .dashboard-pro .dash-pro-header p:after{
  content:" • Perfil Operador";
  color:#55e698;
}
@media(max-width:800px){
  .users-summary-4{grid-template-columns:1fr 1fr}
  .user-companies{max-width:180px}
}

/* v55 - novo cadastro de usuário e convite por e-mail */
.invite-security-card{
  display:flex;
  gap:11px;
  align-items:center;
  padding:12px 13px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  border-radius:11px;
}
.invite-security-icon{
  width:36px;height:36px;display:grid;place-items:center;border-radius:10px;
  background:#dbeafe;font-size:17px;flex:0 0 auto;
}
.invite-security-card strong,.invite-security-card small{display:block}
.invite-security-card strong{font-size:10px;color:#1e3a5f}
.invite-security-card small{font-size:9px;color:#5b718d;margin-top:3px;line-height:1.4}

.role-permission-preview{
  align-self:end;
  min-height:42px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  background:#ecfdf5;
  border:1px solid #bbf7d0;
  border-radius:9px;
}
.role-permission-preview.admin{background:#eff6ff;border-color:#bfdbfe}
.role-preview-icon{font-size:16px}
.role-permission-preview strong,.role-permission-preview small{display:block}
.role-permission-preview strong{font-size:9px;color:#0f5132}
.role-permission-preview.admin strong{color:#1d4ed8}
.role-permission-preview small{font-size:8px;color:#64748b;margin-top:2px;line-height:1.3}

.user-company-picker{
  border:1px solid #dbe4ee;
  border-radius:11px;
  overflow:hidden;
}
.company-picker-head{
  display:flex;justify-content:space-between;align-items:center;gap:10px;
  padding:10px 12px;background:#f8fafc;border-bottom:1px solid #e5edf5;
}
.company-picker-head strong,.company-picker-head small{display:block}
.company-picker-head strong{font-size:10px;color:#334155}
.company-picker-head small{font-size:8px;color:#64748b;margin-top:2px}
.mini-link-btn{
  border:0;background:transparent;color:#2563eb;font-size:9px;font-weight:900;cursor:pointer;padding:5px!important;
}
.new-user-client-checks{
  max-height:180px;overflow-y:auto;padding:8px;display:grid;grid-template-columns:1fr 1fr;gap:7px;
}
.new-user-client-item{
  position:relative;display:flex;align-items:center;gap:8px;
  padding:9px 10px;border:1px solid #dbe4ee;border-radius:9px;background:#fff;cursor:pointer;
}
.new-user-client-item input{position:absolute;opacity:0;pointer-events:none}
.client-check-mark{
  width:23px;height:23px;display:grid;place-items:center;border-radius:7px;
  border:1px solid #cbd5e1;background:#f8fafc;color:transparent;font-weight:900;flex:0 0 auto;
}
.new-user-client-item:has(input:checked){
  border-color:#60a5fa;background:#eff6ff;
}
.new-user-client-item input:checked + .client-check-mark{
  background:#2563eb;border-color:#2563eb;color:#fff;
}
.client-check-info strong,.client-check-info small{display:block}
.client-check-info strong{font-size:9px;color:#1e293b}
.client-check-info small{font-size:8px;color:#64748b;margin-top:2px}

/* definir senha por convite/recuperação */
.set-password-modal{
  width:min(430px,calc(100vw - 24px))!important;
  border:0!important;background:transparent!important;padding:0!important;
}
.password-setup-card{
  padding:28px!important;border-radius:18px!important;background:#fff!important;
  box-shadow:0 25px 90px rgba(0,0,0,.35);
}
.password-setup-icon{
  width:52px;height:52px;display:grid;place-items:center;border-radius:14px;
  background:#eaf2ff;font-size:22px;margin-bottom:14px;
}
.password-setup-card h3{font-size:22px;margin:0 0 6px;color:#0f172a}
.password-setup-card>p{font-size:10px;color:#64748b;line-height:1.45;margin:0 0 18px}
.password-setup-card label{display:block;font-size:10px;font-weight:800;color:#334155;margin-top:10px}
.password-setup-card input{
  width:100%;height:43px;margin-top:5px;border:1px solid #cbd5e1;border-radius:9px;padding:0 10px;
}
.password-setup-card .btn{width:100%!important;height:44px!important;margin-top:16px}
.password-setup-message{display:block;min-height:16px;margin-top:8px;color:#dc2626;font-size:9px}

@media(max-width:720px){
  .new-user-client-checks{grid-template-columns:1fr}
  .role-permission-preview{grid-column:1/-1}
  .company-picker-head{align-items:flex-start}
}

/* v56 - cabeçalho e página de usuários */
.legacy-logout-hidden{display:none!important}
.header-user-info{display:none!important}

.header-profile-wrap{
  position:relative;
  flex:0 0 auto;
  margin-left:4px;
  z-index:300;
}
.header-profile-btn{
  height:42px!important;
  min-width:190px;
  max-width:235px;
  display:flex!important;
  align-items:center;
  gap:9px;
  padding:5px 9px!important;
  border:1px solid #203752!important;
  border-radius:11px!important;
  background:#0d1c2f!important;
  color:#fff!important;
  cursor:pointer;
}
.header-profile-btn:hover{background:#12263d!important;border-color:#315173!important}
.header-avatar{
  width:31px;height:31px;display:grid;place-items:center;flex:0 0 auto;
  border-radius:9px;background:linear-gradient(145deg,#2877ee,#119be4);
  font-size:10px;font-weight:900;color:white;
}
.header-profile-text{min-width:0;text-align:left;line-height:1.1;flex:1}
.header-profile-text strong,.header-profile-text small{
  display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.header-profile-text strong{font-size:9px;color:#f8fafc}
.header-profile-text small{font-size:7px;color:#8fa7c2;margin-top:3px;text-transform:uppercase;letter-spacing:.35px}
.header-profile-chevron{font-size:12px;color:#7f98b4}

.header-profile-menu{
  position:absolute;right:0;top:48px;width:215px;padding:7px;
  background:#fff;border:1px solid #dbe4ee;border-radius:12px;
  box-shadow:0 18px 55px rgba(0,0,0,.28);color:#0f172a;
}
.header-profile-menu[hidden]{display:none!important}
.profile-menu-head{padding:9px 10px;border-bottom:1px solid #edf1f5;margin-bottom:5px}
.profile-menu-head strong,.profile-menu-head small{display:block}
.profile-menu-head strong{font-size:10px}
.profile-menu-head small{font-size:8px;color:#64748b;margin-top:3px}
.header-profile-menu button{
  width:100%;border:0;background:transparent;padding:9px 10px!important;
  border-radius:8px;text-align:left;font-size:9px;font-weight:800;color:#334155;cursor:pointer;
}
.header-profile-menu button:hover{background:#f1f5f9}

/* Evita que relógio/status/usuário se sobreponham */
.topbar,.app-header,header{
  min-width:0;
}
.topbar-right,.header-right,.top-actions{
  display:flex;align-items:center;gap:8px;min-width:max-content;
}
.clock,.header-clock{flex:0 0 auto}

/* Modal de usuário mais limpo */
#userModal .modal-form{max-height:min(720px,calc(100vh - 34px));overflow:hidden}
#userModal .modal-body{overflow-y:auto}
#userModal .new-user-client-checks{
  grid-template-columns:repeat(2,minmax(0,1fr));
  overflow-x:hidden!important;
}
#userModal .new-user-client-item{min-width:0}
#userModal .client-check-info{min-width:0}
#userModal .client-check-info strong{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* Cards da página Usuários mais compactos */
#usersPage .stat-card,
.users-page .stat-card{
  min-height:66px!important;padding:11px 14px!important;
}
#usersPage .stats-grid,
.users-page .stats-grid{gap:8px!important}

@media(max-width:1200px){
  .header-profile-btn{min-width:155px;max-width:180px}
  .header-profile-text strong{font-size:8px}
}
@media(max-width:900px){
  .header-profile-btn{min-width:auto;width:42px;padding:5px!important;justify-content:center}
  .header-profile-text,.header-profile-chevron{display:none}
  .header-profile-menu{right:0}
}
@media(max-width:720px){
  #userModal .new-user-client-checks{grid-template-columns:1fr}
}

/* v57 - foto de perfil */
.header-avatar{
  overflow:hidden;
  position:relative;
  user-select:none;
}
.header-avatar.has-photo{
  background:#0b1727;
}
.header-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.header-avatar.has-photo:hover:after{
  content:"⤢";
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background:rgba(0,0,0,.28);
  color:white;
  font-size:13px;
}
.profile-remove-photo{
  color:#b91c1c!important;
}
.profile-remove-photo:hover{
  background:#fff1f2!important;
}

.avatar-preview-modal{
  width:min(620px,calc(100vw - 24px))!important;
  max-width:none!important;
  border:0!important;
  border-radius:20px!important;
  padding:0!important;
  overflow:hidden!important;
  background:#07111f!important;
  box-shadow:0 30px 100px rgba(0,0,0,.55)!important;
}
.avatar-preview-modal::backdrop{
  background:rgba(2,8,18,.78);
  backdrop-filter:blur(5px);
}
.avatar-preview-body{
  min-height:360px;
  display:grid;
  place-items:center;
  padding:22px;
  position:relative;
}
.avatar-preview-body img{
  max-width:100%;
  max-height:min(72vh,620px);
  border-radius:16px;
  object-fit:contain;
  box-shadow:0 14px 55px rgba(0,0,0,.35);
}
.avatar-preview-name{
  position:absolute;
  left:18px;
  bottom:14px;
  padding:7px 10px;
  border-radius:9px;
  background:rgba(4,15,27,.78);
  color:#fff;
  font-size:10px;
  font-weight:800;
  backdrop-filter:blur(6px);
}
.avatar-preview-close{
  position:absolute;
  z-index:3;
  top:12px;
  right:12px;
  width:38px!important;
  height:38px!important;
  border:1px solid rgba(255,255,255,.2)!important;
  border-radius:11px!important;
  background:rgba(4,15,27,.78)!important;
  color:white!important;
  font-size:22px!important;
  line-height:1!important;
  cursor:pointer;
}
.avatar-preview-close:hover{
  background:rgba(17,35,55,.95)!important;
}

@media(max-width:720px){
  .avatar-preview-modal{
    width:calc(100vw - 16px)!important;
    border-radius:16px!important;
  }
  .avatar-preview-body{
    min-height:55vh;
    padding:14px;
  }
  .avatar-preview-body img{
    max-height:74vh;
  }
}

/* v58 - mais espaço para identificação do usuário no cabeçalho */
.header-profile-wrap{
  margin-left:10px!important;
  margin-right:8px!important;
}
.header-profile-btn{
  min-width:230px!important;
  max-width:270px!important;
  height:48px!important;
  padding:6px 11px!important;
  gap:10px!important;
  border-radius:12px!important;
}
.header-avatar{
  width:35px!important;
  height:35px!important;
  border-radius:10px!important;
  flex:0 0 35px!important;
  font-size:11px!important;
}
.header-profile-text{
  min-width:0!important;
  flex:1!important;
  padding-right:3px!important;
}
.header-profile-text strong{
  font-size:10px!important;
  line-height:1.2!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.header-profile-text small{
  font-size:8px!important;
  margin-top:4px!important;
}
.header-profile-chevron{
  flex:0 0 auto!important;
}

/* O nome antigo acima do novo cartão não deve aparecer */
body > header .user-name:not(.header-profile-text *),
body > header .user-role:not(.header-profile-text *),
.topbar .current-user-label,
.header-right > .current-user,
.top-actions > .current-user{
  display:none!important;
}

/* Reserva espaço suficiente no lado direito */
.topbar-right,.header-right,.top-actions{
  gap:10px!important;
  padding-right:6px!important;
}

/* Em telas intermediárias reduz primeiro o perfil, sem esmagar o nome */
@media (max-width:1450px) and (min-width:901px){
  .header-profile-btn{
    min-width:205px!important;
    max-width:225px!important;
  }
}
@media(max-width:900px){
  .header-profile-btn{
    min-width:44px!important;
    width:44px!important;
    height:44px!important;
    padding:4px!important;
  }
}

/* v60 - menu superior auto-oculto no desktop */
@media(min-width:901px){
  /* área sensível no topo para revelar o menu */
  body::before{
    content:"";
    position:fixed;
    z-index:9997;
    top:0;
    left:0;
    right:0;
    height:10px;
    background:linear-gradient(to bottom,rgba(35,110,210,.50),rgba(35,110,210,0));
    opacity:.38;
    pointer-events:auto;
  }

  /* suporta os nomes de container usados nas versões anteriores */
  .topbar,
  .app-header,
  body > header{
    position:fixed!important;
    z-index:9998!important;
    top:0!important;
    left:0!important;
    right:0!important;
    transform:translateY(calc(-100% + 9px));
    transition:transform .22s ease, box-shadow .22s ease!important;
    box-shadow:none!important;
  }

  /* revela quando o mouse chega na faixa, no próprio menu ou via teclado */
  body:has(> .topbar:hover) .topbar,
  body:has(> .app-header:hover) .app-header,
  body:has(> header:hover) > header,
  body:has(.topbar:focus-within) .topbar,
  body:has(.app-header:focus-within) .app-header,
  body:has(> header:focus-within) > header,
  body:hover::before{
    opacity:.55;
  }

  /* uma zona invisível maior no topo facilita abrir sem precisão */
  .topbar::before,
  .app-header::before,
  body > header::before{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:-18px;
    height:18px;
    pointer-events:auto;
  }

  .topbar:hover,
  .app-header:hover,
  body > header:hover,
  .topbar:focus-within,
  .app-header:focus-within,
  body > header:focus-within{
    transform:translateY(0)!important;
    box-shadow:0 10px 32px rgba(0,0,0,.30)!important;
  }

  /* pequena indicação central enquanto escondido */
  .topbar::after,
  .app-header::after,
  body > header::after{
    content:"⌄";
    position:absolute;
    left:50%;
    bottom:-14px;
    transform:translateX(-50%);
    width:42px;
    height:14px;
    display:grid;
    place-items:center;
    border-radius:0 0 9px 9px;
    background:#122842;
    border:1px solid #29435f;
    border-top:0;
    color:#7fa7cf;
    font-size:11px;
    line-height:1;
    pointer-events:none;
  }

  /* conteúdo passa a aproveitar o espaço liberado */
  .main,
  .main-content,
  .app-main{
    padding-top:10px!important;
  }
}

/* em celular/tablet touch mantém menu normal */
@media(max-width:900px){
  .topbar,
  .app-header,
  body > header{
    transform:none!important;
    position:relative!important;
  }
  body::before{
    content:none!important;
  }
}

/* v61 - menu superior controlado por timer */
@media(min-width:901px){
  .desktop-top-menu-trigger{
    position:fixed;
    z-index:10001;
    top:0;
    left:0;
    right:0;
    height:12px;
    background:transparent;
  }

  .topbar,
  .app-header,
  body > header{
    transform:translateY(calc(-100% + 8px))!important;
    transition:transform .24s ease,box-shadow .24s ease!important;
  }

  /* cancela o hover permanente da v60 */
  .topbar:hover,
  .app-header:hover,
  body > header:hover,
  .topbar:focus-within,
  .app-header:focus-within,
  body > header:focus-within{
    transform:translateY(calc(-100% + 8px))!important;
    box-shadow:none!important;
  }

  .topbar.desktop-header-visible,
  .app-header.desktop-header-visible,
  body > header.desktop-header-visible{
    transform:translateY(0)!important;
    box-shadow:0 10px 32px rgba(0,0,0,.32)!important;
  }

  /* aba discreta quando fechado */
  .topbar::after,
  .app-header::after,
  body > header::after{
    content:"MENU  ⌄"!important;
    width:62px!important;
    height:15px!important;
    bottom:-15px!important;
    font-size:8px!important;
    letter-spacing:.45px;
    font-weight:800;
    background:#10233a!important;
    color:#79a8d4!important;
  }

  .topbar.desktop-header-visible::after,
  .app-header.desktop-header-visible::after,
  body > header.desktop-header-visible::after{
    opacity:.28;
  }

  /* dashboard ganha o espaço do menu quando recolhido */
  .main,
  .main-content,
  .app-main{
    padding-top:12px!important;
  }
}

@media(max-width:900px){
  .desktop-top-menu-trigger{display:none!important}
}

/* ============================================================
   v62 - MENU REAL (.sidebar) auto-oculto + cabeçalho compacto
   ============================================================ */
@media(min-width:901px){
  :root{
    --v62-nav-height:56px;
    --v62-hidden-peek:6px;
  }

  .desktop-nav-trigger{
    position:fixed;
    z-index:20050;
    left:0;
    right:0;
    top:0;
    height:10px;
    background:transparent;
  }

  /* A barra que realmente contém Dashboard / Clientes / etc. */
  #appView .sidebar{
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    height:var(--v62-nav-height)!important;
    min-height:var(--v62-nav-height)!important;
    z-index:20040!important;

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

    padding:5px 8px!important;
    gap:5px!important;

    transform:translateY(calc(-100% + var(--v62-hidden-peek)))!important;
    transition:transform .24s ease,box-shadow .24s ease!important;

    background:#0b1728!important;
    border-bottom:1px solid #1d3249!important;
    box-shadow:none!important;
    overflow:visible!important;
  }

  #appView .sidebar.desktop-nav-visible{
    transform:translateY(0)!important;
    box-shadow:0 9px 28px rgba(0,0,0,.32)!important;
  }

  /* pequena aba quando recolhido */
  #appView .sidebar::after{
    content:"MENU  ⌄";
    position:absolute;
    left:50%;
    bottom:-15px;
    transform:translateX(-50%);
    width:66px;
    height:15px;
    display:grid;
    place-items:center;
    border:1px solid #29435f;
    border-top:0;
    border-radius:0 0 9px 9px;
    background:#10233a;
    color:#78a6d2;
    font-size:8px;
    font-weight:900;
    letter-spacing:.5px;
    pointer-events:none;
    opacity:.9;
  }

  #appView .sidebar.desktop-nav-visible::after{
    opacity:.24;
  }

  /* logo compacto */
  #appView .sidebar-brand{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:145px!important;
    padding:0 5px!important;
    gap:8px!important;
  }

  #appView .sidebar-brand .brand-mark.small{
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    border-radius:11px!important;
    font-size:15px!important;
  }

  #appView .sidebar-brand strong{
    font-size:13px!important;
    line-height:1!important;
  }

  #appView .sidebar-brand span{
    font-size:9px!important;
    margin-top:3px!important;
  }

  /* navegação usa o espaço disponível sem folgas excessivas */
  #appView .sidebar nav{
    flex:1 1 auto!important;
    min-width:0!important;
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    gap:2px!important;
    padding:0!important;
    margin:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:none!important;
  }

  #appView .sidebar nav::-webkit-scrollbar{
    display:none!important;
  }

  #appView .sidebar .nav-item{
    flex:0 0 auto!important;
    min-height:38px!important;
    height:38px!important;
    padding:0 9px!important;
    gap:6px!important;
    border-radius:9px!important;
    font-size:11px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }

  #appView .sidebar .nav-item span{
    font-size:11px!important;
  }

  /* lado direito */
  #appView .topnav-right{
    flex:0 0 auto!important;
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    margin-left:3px!important;
  }

  #appView .topnav-sound{
    height:36px!important;
    padding:0 10px!important;
    border-radius:9px!important;
    font-size:11px!important;
    white-space:nowrap!important;
  }

  #appView .topnav-system{
    height:36px!important;
    min-width:118px!important;
    padding:5px 8px!important;
    border-radius:9px!important;
  }

  #appView .topnav-system strong{
    font-size:8px!important;
  }

  #appView .topnav-system small{
    font-size:6px!important;
  }

  #appView .topnav-clock{
    min-width:62px!important;
    padding:0 4px!important;
    text-align:center!important;
  }

  #appView .topnav-clock strong{
    font-size:11px!important;
  }

  #appView .topnav-clock small{
    font-size:6px!important;
  }

  /* Perfil: sem nome duplicado acima */
  #appView #userEmail{
    display:none!important;
  }

  #appView .sidebar-footer{
    flex:0 0 auto!important;
    margin:0!important;
    padding:0!important;
  }

  #appView .header-profile-wrap{
    margin:0!important;
  }

  #appView .header-profile-btn{
    height:40px!important;
    min-width:178px!important;
    max-width:195px!important;
    padding:4px 7px!important;
    gap:7px!important;
    border-radius:10px!important;
  }

  #appView .header-avatar{
    width:31px!important;
    height:31px!important;
    min-width:31px!important;
    flex-basis:31px!important;
    border-radius:9px!important;
  }

  #appView .header-profile-text strong{
    font-size:8px!important;
  }

  #appView .header-profile-text small{
    font-size:6px!important;
    margin-top:3px!important;
  }

  #appView .header-profile-chevron{
    font-size:10px!important;
  }

  /* Menu é overlay: dashboard aproveita toda a altura */
  #appView .main{
    margin-left:0!important;
    width:100%!important;
    padding-top:8px!important;
  }

  /* cancela as tentativas antigas de animar .topbar */
  #appView .topbar{
    transform:none!important;
    position:relative!important;
    top:auto!important;
    box-shadow:none!important;
  }

  /* se a topbar antiga estiver ocultada pelo layout, não reserva espaço */
  #appView .topbar[style*="display: none"],
  #appView .topbar.hidden{
    height:0!important;
    min-height:0!important;
    padding:0!important;
    border:0!important;
  }
}

/* telas desktop menores: ganha mais espaço ainda */
@media(min-width:901px) and (max-width:1450px){
  #appView .sidebar-brand{
    min-width:118px!important;
  }

  #appView .sidebar-brand span{
    display:none!important;
  }

  #appView .sidebar .nav-item{
    padding:0 7px!important;
    gap:4px!important;
    font-size:10px!important;
  }

  #appView .sidebar .nav-item span{
    font-size:10px!important;
  }

  #appView .topnav-system{
    display:none!important;
  }

  #appView .header-profile-btn{
    min-width:155px!important;
    max-width:170px!important;
  }
}

@media(max-width:900px){
  .desktop-nav-trigger{
    display:none!important;
  }

  #appView .sidebar{
    transform:none!important;
  }
}

/* ============================================================
   v63 - menu nunca cobre o conteúdo das páginas
   ============================================================ */
@media(min-width:901px){
  :root{
    --v63-nav-space:62px;
  }

  /* Base: menu recolhido, conteúdo usa o topo */
  #appView .main,
  #appView .main-content,
  #appView .app-main,
  #appView > main{
    padding-top:10px!important;
    transition:padding-top .24s ease!important;
  }

  /* Menu aberto: empurra TODAS as páginas para baixo */
  body.desktop-nav-open #appView .main,
  body.desktop-nav-open #appView .main-content,
  body.desktop-nav-open #appView .app-main,
  body.desktop-nav-open #appView > main,
  #appView.desktop-nav-open .main,
  #appView.desktop-nav-open .main-content,
  #appView.desktop-nav-open .app-main,
  #appView.desktop-nav-open > main{
    padding-top:var(--v63-nav-space)!important;
  }

  /* Views não podem ter posicionamento que ignore o recuo */
  #appView .view{
    scroll-margin-top:var(--v63-nav-space)!important;
  }

  /* Títulos e cabeçalhos internos nunca sobem por baixo do menu */
  body.desktop-nav-open #appView .view > :first-child,
  body.desktop-nav-open #appView .dashboard-pro,
  body.desktop-nav-open #appView .page-head,
  body.desktop-nav-open #appView .users-page-head{
    position:relative!important;
    z-index:1!important;
  }

  /* Se uma tela antiga tiver margin/padding negativo no topo, neutraliza */
  body.desktop-nav-open #appView .view{
    margin-top:0!important;
  }

  /* A aba MENU fica fora da área útil e não cobre o título */
  #appView .sidebar::after{
    z-index:20041!important;
  }
}

/* Mobile permanece igual, sem deslocamento especial */
@media(max-width:900px){
  body.desktop-nav-open #appView .main,
  body.desktop-nav-open #appView .main-content,
  body.desktop-nav-open #appView .app-main,
  body.desktop-nav-open #appView > main{
    padding-top:0!important;
  }
}

/* ============================================================
   v64 - Dashboard executivo por empresa
   ============================================================ */
.company-overview-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  padding:4px 2px 10px;
}
.company-overview-head h3{
  margin:0;
  font-size:15px;
  color:#f7fbff;
}
.company-overview-head p{
  margin:3px 0 0;
  color:#7f9ab6;
  font-size:9px;
}
.company-overview-legend{
  display:flex;
  align-items:center;
  gap:12px;
  color:#8ea4bb;
  font-size:8px;
  white-space:nowrap;
}
.company-overview-legend span{
  display:flex;
  align-items:center;
  gap:5px;
}
.company-dot{
  width:7px;height:7px;border-radius:50%;
}
.company-dot.online{background:#2bd977}
.company-dot.atencao{background:#f7aa14}
.company-dot.offline{background:#ff4d58}

.company-dashboard-layout{
  grid-template-columns:minmax(0,1fr) 330px!important;
  align-items:start!important;
}
.company-status-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  min-width:0;
}
.company-status-card{
  appearance:none;
  width:100%;
  min-width:0;
  border:1px solid #213750;
  background:#0c1b2d;
  border-radius:13px;
  padding:13px;
  color:#eef6ff;
  text-align:left;
  cursor:pointer;
  box-shadow:none;
  transition:transform .15s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease;
}
.company-status-card:hover{
  transform:translateY(-2px);
  border-color:#3d648b;
  background:#102238;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
}
.company-status-card.online{border-color:#17623d}
.company-status-card.atencao{border-color:#795c13}
.company-status-card.offline{
  border-color:#8f2630;
  background:linear-gradient(145deg,#151b2b,#221521);
}
.company-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.company-card-identity{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
}
.company-card-icon{
  width:31px;height:31px;display:grid;place-items:center;flex:0 0 auto;
  border-radius:9px;background:#132d49;color:#53a4ef;font-size:14px;
}
.company-card-identity>div{min-width:0}
.company-card-identity h4{
  margin:0;
  font-size:11px;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.company-card-identity small{
  display:block;margin-top:3px;color:#708aa4;font-size:7px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.company-health-badge{
  flex:0 0 auto;
  padding:4px 7px;
  border-radius:999px;
  font-size:7px;
  font-weight:900;
  letter-spacing:.25px;
}
.company-health-badge.online{background:#073d27;color:#56e99b}
.company-health-badge.atencao{background:#4c3907;color:#ffd161}
.company-health-badge.offline{background:#541b22;color:#ff8790}

.company-health-message{
  margin:12px 0 10px;
  min-height:47px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 9px;
  border-radius:9px;
}
.company-health-message.online{background:rgba(13,99,59,.14)}
.company-health-message.atencao{background:rgba(143,104,13,.14)}
.company-health-message.offline{background:rgba(137,31,43,.16)}
.company-health-symbol{
  width:25px;height:25px;display:grid;place-items:center;flex:0 0 auto;
  border-radius:50%;font-weight:900;font-size:11px;
}
.company-health-message.online .company-health-symbol{background:#0a5031;color:#58ec9d}
.company-health-message.atencao .company-health-symbol{background:#674d08;color:#ffd363}
.company-health-message.offline .company-health-symbol{background:#6b2028;color:#ff8790}
.company-health-message strong,.company-health-message small{display:block}
.company-health-message strong{font-size:8px;line-height:1.25}
.company-health-message small{font-size:7px;color:#7d94ad;margin-top:2px}

.company-card-metrics{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:5px;
}
.company-card-metrics>div{
  padding:7px 5px;
  border-radius:8px;
  background:#091522;
  border:1px solid #172c43;
}
.company-card-metrics strong,.company-card-metrics span{display:block}
.company-card-metrics strong{font-size:14px;color:#fff}
.company-card-metrics span{font-size:6px;color:#70869c;margin-top:2px}
.company-card-metrics .good strong{color:#38df83}
.company-card-metrics .warn strong{color:#f7b623}
.company-card-metrics .bad strong{color:#ff5965}

.company-card-footer{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:9px;
  color:#70869c;
  font-size:7px;
  white-space:nowrap;
}
.company-card-footer .company-open-label{
  margin-left:auto;
  color:#5eb5ff;
  font-weight:800;
}

.company-dashboard-footer{
  margin-top:9px!important;
}

/* popup da empresa */
.company-monitor-modal{
  width:min(1120px,calc(100vw - 28px))!important;
  max-width:none!important;
  max-height:88vh!important;
  border:0!important;
  border-radius:17px!important;
  padding:0!important;
  overflow:hidden!important;
  background:#091725!important;
  color:#edf6ff!important;
  box-shadow:0 28px 100px rgba(0,0,0,.55)!important;
}
.company-monitor-modal::backdrop{
  background:rgba(2,8,18,.74);
  backdrop-filter:blur(4px);
}
.company-monitor-dialog{
  display:flex;
  flex-direction:column;
  max-height:88vh;
}
.company-monitor-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:15px;
  padding:18px 20px 13px;
  border-bottom:1px solid #1c3249;
}
.company-modal-eyebrow{
  color:#4ca9ff;
  font-size:7px;
  font-weight:900;
  letter-spacing:.7px;
}
.company-monitor-modal-head h3{
  margin:4px 0 0;
  font-size:21px;
  color:#fff;
}
.company-monitor-modal-head p{
  margin:4px 0 0;
  color:#7890a9;
  font-size:9px;
}
.company-monitor-close{
  width:37px!important;height:37px!important;
  border:1px solid #27425d!important;
  background:#10243a!important;color:#fff!important;
  border-radius:10px!important;font-size:20px!important;cursor:pointer;
}

.company-modal-stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  padding:12px 20px 0;
}
.company-modal-stats article{
  background:#0d1e31;
  border:1px solid #20374f;
  border-radius:10px;
  padding:9px 11px;
}
.company-modal-stats span,.company-modal-stats strong{display:block}
.company-modal-stats span{font-size:7px;color:#7f95aa}
.company-modal-stats strong{font-size:20px;margin-top:2px;color:#fff}
.company-modal-stats .online strong{color:#37df82}
.company-modal-stats .atencao strong{color:#f4b522}
.company-modal-stats .offline strong{color:#ff5964}

.company-modal-toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) 180px;
  gap:8px;
  padding:10px 20px;
}
.company-modal-search{
  display:grid;
  grid-template-columns:34px 1fr;
  align-items:center;
  border:1px solid #294059;
  background:#071421;
  border-radius:9px;
}
.company-modal-search span{display:grid;place-items:center;color:#6e8eab}
.company-modal-search input,
.company-modal-toolbar select{
  height:39px;
  border:0;
  outline:0;
  background:transparent;
  color:#eaf5ff;
  font-size:9px;
}
.company-modal-toolbar select{
  border:1px solid #294059;
  border-radius:9px;
  background:#071421;
  padding:0 9px;
}
.company-modal-toolbar option{background:#0b1a2b;color:#fff}

.company-modal-equipment-list{
  padding:0 20px 18px;
  overflow-y:auto;
}
.company-equipment-row{
  display:grid;
  grid-template-columns:9px minmax(220px,1fr) 120px 95px 90px 120px;
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:8px 10px;
  border:1px solid #1e344b;
  border-radius:9px;
  background:#0c1b2d;
  margin-top:7px;
}
.company-equipment-row.offline{border-color:#65262e;background:#171622}
.company-equipment-row.atencao{border-color:#5e4a19}
.company-equipment-status-dot{
  width:8px;height:8px;border-radius:50%;
}
.company-equipment-status-dot.online{background:#30dd7e;box-shadow:0 0 0 4px rgba(48,221,126,.08)}
.company-equipment-status-dot.atencao{background:#f4b31c}
.company-equipment-status-dot.offline{background:#ff5360;box-shadow:0 0 0 4px rgba(255,83,96,.08)}
.company-equipment-main{min-width:0}
.company-equipment-main strong,.company-equipment-main small,
.company-equipment-row>div>small,.company-equipment-row>div>strong{display:block}
.company-equipment-main strong{
  font-size:10px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.company-equipment-main small{
  margin-top:3px;font-size:7px;color:#70889f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.company-equipment-row>div>small{font-size:6px;color:#657e96;margin-bottom:3px}
.company-equipment-row>div>strong{font-size:9px;color:#eaf5ff}
.company-equipment-state strong.online{color:#38e386}
.company-equipment-state strong.atencao{color:#f7bb2d}
.company-equipment-state strong.offline{color:#ff5d68}

@media(max-width:1450px){
  .company-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:1150px){
  .company-dashboard-layout{grid-template-columns:1fr!important}
  .dash-occurrences{max-height:360px;overflow:auto}
}
@media(max-width:720px){
  .company-overview-head{align-items:flex-start;flex-direction:column}
  .company-overview-legend{flex-wrap:wrap}
  .company-status-grid{grid-template-columns:1fr}
  .company-card-metrics{grid-template-columns:repeat(4,1fr)}
  .company-monitor-modal{width:calc(100vw - 14px)!important;max-height:92vh!important}
  .company-monitor-dialog{max-height:92vh}
  .company-modal-stats{grid-template-columns:1fr 1fr}
  .company-modal-toolbar{grid-template-columns:1fr}
  .company-equipment-row{
    grid-template-columns:9px minmax(0,1fr) 80px;
    gap:7px;
  }
  .company-equipment-ip{grid-column:2}
  .company-equipment-state{grid-column:3;grid-row:1}
  .company-equipment-latency{grid-column:2}
  .company-equipment-last{grid-column:3}
}

/* v65 - status da empresa mais evidente */
.company-main-status-dot{
  width:15px;
  height:15px;
  flex:0 0 15px;
  border-radius:50%;
  margin-top:2px;
  border:2px solid rgba(255,255,255,.16);
}
.company-main-status-dot.online{
  background:#2bd977;
  box-shadow:0 0 0 5px rgba(43,217,119,.10),0 0 15px rgba(43,217,119,.28);
}
.company-main-status-dot.atencao{
  background:#f7aa14;
  box-shadow:0 0 0 5px rgba(247,170,20,.10),0 0 15px rgba(247,170,20,.25);
}
.company-main-status-dot.offline{
  background:#ff4d58;
  box-shadow:0 0 0 5px rgba(255,77,88,.10),0 0 15px rgba(255,77,88,.26);
}
.company-status-card.online .company-card-top{
  border-bottom:1px solid rgba(43,217,119,.10);
  padding-bottom:9px;
}
.company-status-card.atencao .company-card-top{
  border-bottom:1px solid rgba(247,170,20,.10);
  padding-bottom:9px;
}
.company-status-card.offline .company-card-top{
  border-bottom:1px solid rgba(255,77,88,.12);
  padding-bottom:9px;
}
.company-render-error{
  padding:20px;
  border:1px solid #71313a;
  border-radius:12px;
  background:#21141b;
  color:#ff9da5;
  font-size:10px;
}

/* ============================================================
   v66 - popup de equipamentos mais compacto
   ============================================================ */
.company-monitor-modal{
  width:min(1180px,calc(100vw - 24px))!important;
  max-height:90vh!important;
}

.company-monitor-dialog{
  max-height:90vh!important;
}

/* cabeçalho menor */
.company-monitor-modal-head{
  padding:13px 17px 10px!important;
}
.company-modal-eyebrow{
  font-size:6px!important;
}
.company-monitor-modal-head h3{
  font-size:18px!important;
  margin-top:2px!important;
}
.company-monitor-modal-head p{
  font-size:8px!important;
  margin-top:2px!important;
}
.company-monitor-close{
  width:32px!important;
  height:32px!important;
  border-radius:9px!important;
  font-size:18px!important;
}

/* cards-resumo menores */
.company-modal-stats{
  gap:6px!important;
  padding:9px 17px 0!important;
}
.company-modal-stats article{
  padding:7px 9px!important;
  border-radius:8px!important;
}
.company-modal-stats span{
  font-size:6px!important;
}
.company-modal-stats strong{
  font-size:17px!important;
  margin-top:1px!important;
}

/* busca e filtro mais baixos */
.company-modal-toolbar{
  grid-template-columns:minmax(0,1fr) 165px!important;
  gap:6px!important;
  padding:8px 17px!important;
}
.company-modal-search{
  grid-template-columns:30px 1fr!important;
  border-radius:8px!important;
}
.company-modal-search input,
.company-modal-toolbar select{
  height:34px!important;
  font-size:8px!important;
}
.company-modal-toolbar select{
  padding:0 8px!important;
  border-radius:8px!important;
}

/* lista: mais dispositivos visíveis */
.company-modal-equipment-list{
  padding:0 17px 14px!important;
}

/* linha bem mais compacta */
.company-equipment-row{
  grid-template-columns:8px minmax(240px,1fr) 105px 78px 72px 94px!important;
  gap:7px!important;
  min-height:42px!important;
  padding:5px 8px!important;
  margin-top:4px!important;
  border-radius:8px!important;
}

/* indicador menor */
.company-equipment-status-dot{
  width:7px!important;
  height:7px!important;
}
.company-equipment-status-dot.online{
  box-shadow:0 0 0 3px rgba(48,221,126,.08)!important;
}
.company-equipment-status-dot.offline{
  box-shadow:0 0 0 3px rgba(255,83,96,.08)!important;
}

/* texto mais eficiente */
.company-equipment-main strong{
  font-size:8.5px!important;
  line-height:1.1!important;
}
.company-equipment-main small{
  margin-top:2px!important;
  font-size:6px!important;
  line-height:1.1!important;
}
.company-equipment-row>div>small{
  font-size:5.5px!important;
  margin-bottom:1px!important;
  line-height:1!important;
}
.company-equipment-row>div>strong{
  font-size:8px!important;
  line-height:1.1!important;
}

/* IP mais destacado mesmo compacto */
.company-equipment-ip strong{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:8px!important;
  letter-spacing:-.15px;
}

/* status em cápsula pequena */
.company-equipment-state strong{
  display:inline-flex!important;
  align-items:center;
  min-height:19px;
  padding:0 5px;
  border-radius:999px;
  font-size:6.5px!important;
  font-weight:900!important;
}
.company-equipment-state strong.online{
  background:rgba(40,211,117,.10);
}
.company-equipment-state strong.atencao{
  background:rgba(247,181,34,.10);
}
.company-equipment-state strong.offline{
  background:rgba(255,89,100,.10);
}

/* hover ajuda a acompanhar a linha */
.company-equipment-row:hover{
  background:#102238!important;
  border-color:#33506d!important;
}

/* scrollbar mais discreta */
.company-modal-equipment-list{
  scrollbar-width:thin;
  scrollbar-color:#40566f transparent;
}
.company-modal-equipment-list::-webkit-scrollbar{
  width:6px;
}
.company-modal-equipment-list::-webkit-scrollbar-thumb{
  background:#40566f;
  border-radius:99px;
}

/* desktop grande: ainda mais linhas visíveis */
@media(min-width:1400px){
  .company-monitor-modal{
    width:min(1240px,calc(100vw - 30px))!important;
  }
  .company-equipment-row{
    grid-template-columns:8px minmax(280px,1fr) 110px 82px 74px 96px!important;
  }
}

/* tablet/mobile continuam legíveis */
@media(max-width:900px){
  .company-equipment-row{
    grid-template-columns:8px minmax(0,1fr) 78px!important;
    min-height:48px!important;
    padding:6px 7px!important;
  }
}

/* v67 - monitoramento de empresa em nova guia */
.company-standalone-view{
  padding:16px!important;
  min-height:100vh;
  background:#071421;
}
.company-standalone-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:2px 0 9px;
}
.company-standalone-head h2{
  margin:3px 0 0;
  color:#fff;
  font-size:20px;
}
.company-standalone-head p{
  margin:3px 0 0;
  color:#718aa3;
  font-size:8px;
}
.company-standalone-actions{
  display:flex;
  gap:6px;
}
.company-standalone-actions .btn{
  height:32px!important;
  padding:0 9px!important;
  font-size:8px!important;
}
.standalone-stats{
  padding:0!important;
  margin-top:3px;
}
.standalone-toolbar{
  padding:8px 0!important;
}
.standalone-equipment-list{
  padding:0!important;
  max-height:calc(100vh - 205px);
  overflow:auto;
}
.company-standalone-error{
  margin:60px auto;
  max-width:520px;
  padding:22px;
  text-align:center;
  border:1px solid #6c2932;
  border-radius:12px;
  background:#1d141a;
  color:#ff9ca4;
}

/* em guia dedicada esconde o sistema normal */
body.company-tab-mode #appView .sidebar,
body.company-tab-mode #appView .topbar,
body.company-tab-mode .desktop-nav-trigger,
body.company-tab-mode .desktop-top-menu-trigger,
body.company-tab-mode .mobile-bottom-nav{
  display:none!important;
}
body.company-tab-mode #appView .main,
body.company-tab-mode #appView .main-content,
body.company-tab-mode #appView .app-main,
body.company-tab-mode #appView > main{
  padding-top:0!important;
  margin-left:0!important;
  width:100%!important;
}
body.company-tab-mode #companyStandaloneView{
  display:block!important;
}
body.company-tab-mode .company-equipment-row{
  min-height:39px!important;
  margin-top:4px!important;
}

@media(max-width:720px){
  .company-standalone-view{padding:9px!important}
  .company-standalone-head{flex-direction:column}
  .company-standalone-actions{width:100%}
  .company-standalone-actions .btn{flex:1}
  .standalone-equipment-list{max-height:none}
}

/* v68 - legibilidade do dashboard e monitoramento */
#dashboardView h1, #dashboardView h2 { font-size: 24px !important; }
#dashboardView h3 { font-size: 17px !important; }
#dashboardView p, #dashboardView small { font-size: 12px !important; line-height: 1.35 !important; }

.company-status-card { min-width: 520px; }
.company-status-card strong,
.company-status-card .company-name { font-size: 16px !important; }
.company-status-card small,
.company-status-card span { font-size: 11px !important; }
.company-status-card [class*="stat"] strong { font-size: 18px !important; }

.dashboard-stat-card span,
.dashboard-stat-card small { font-size: 12px !important; }
.dashboard-stat-card strong { font-size: 22px !important; }

.dashboard-events-panel h2,
.dashboard-events-panel h3 { font-size: 17px !important; }
.dashboard-events-panel strong { font-size: 13px !important; }
.dashboard-events-panel span,
.dashboard-events-panel small,
.dashboard-events-panel p { font-size: 11px !important; line-height: 1.35 !important; }

.company-standalone-head h2 { font-size: 25px !important; }
.company-standalone-head p { font-size: 13px !important; }
.company-modal-eyebrow { font-size: 11px !important; }

.company-modal-stats article span { font-size: 11px !important; }
.company-modal-stats article strong { font-size: 22px !important; }

.company-equipment-main strong { font-size: 13px !important; }
.company-equipment-main small { font-size: 10px !important; }
.company-equipment-ip small,
.company-equipment-state small,
.company-equipment-latency small,
.company-equipment-last small { font-size: 9px !important; }
.company-equipment-ip strong,
.company-equipment-state strong,
.company-equipment-latency strong,
.company-equipment-last strong { font-size: 12px !important; }

@media (min-width:1200px){
  body { font-size: 15px; }
}

/* v69 - presença de usuários e indicador no menu */
.online-users-menu-wrap{
  position:relative;
  flex:0 0 auto;
}
.online-users-menu-btn{
  height:36px!important;
  display:flex!important;
  align-items:center;
  gap:6px;
  padding:0 10px!important;
  border:1px solid #24415d!important;
  border-radius:9px!important;
  background:#0d1d30!important;
  color:#e9f4ff!important;
  font-size:9px!important;
  font-weight:800!important;
  cursor:pointer;
}
.online-users-dot{
  width:8px;height:8px;border-radius:50%;
  background:#2bdd78;
  box-shadow:0 0 0 4px rgba(43,221,120,.09),0 0 10px rgba(43,221,120,.30);
}
.online-users-menu-btn strong{
  min-width:18px;
  height:18px;
  padding:0 5px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#0a5031;
  color:#5af09d;
  font-size:8px;
}
.online-users-dropdown{
  position:absolute;
  right:0;
  top:42px;
  width:285px;
  background:#fff;
  border:1px solid #dbe5ef;
  border-radius:12px;
  box-shadow:0 20px 60px rgba(0,0,0,.30);
  color:#0f172a;
  overflow:hidden;
  z-index:30000;
}
.online-users-dropdown[hidden]{display:none!important}
.online-users-dropdown-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 12px;
  border-bottom:1px solid #e8eef5;
}
.online-users-dropdown-head strong,
.online-users-dropdown-head small{display:block}
.online-users-dropdown-head strong{font-size:10px}
.online-users-dropdown-head small{font-size:8px;color:#64748b;margin-top:2px}
.online-users-dropdown-head>span{
  min-width:24px;height:24px;display:grid;place-items:center;
  border-radius:999px;background:#e9faef;color:#15803d;font-size:9px;font-weight:900;
}
.online-users-dropdown-list{
  max-height:290px;
  overflow:auto;
  padding:5px;
}
.online-user-row{
  display:grid;
  grid-template-columns:32px 1fr 8px;
  align-items:center;
  gap:8px;
  padding:8px;
  border-radius:8px;
}
.online-user-row:hover{background:#f4f7fa}
.online-user-avatar{
  width:32px;height:32px;border-radius:9px;
  display:grid;place-items:center;
  background:#e7f0ff;color:#2563eb;font-size:10px;font-weight:900;
}
.online-user-row strong,.online-user-row small{display:block}
.online-user-row strong{font-size:9px}
.online-user-row small{font-size:7px;color:#64748b;margin-top:2px}
.online-user-row>i{
  width:7px;height:7px;border-radius:50%;
  background:#29d876;box-shadow:0 0 0 3px rgba(41,216,118,.10);
}
.online-users-empty{
  padding:18px;text-align:center;color:#64748b;font-size:9px;
}

.users-summary-presence{
  grid-template-columns:repeat(5,1fr)!important;
}
.users-summary .presence strong{color:#16a34a}

.registration-badge,.presence-badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:4px 7px;
  border-radius:999px;
  font-size:8px;
  font-weight:900;
  white-space:nowrap;
}
.registration-badge.active{background:#e9faef;color:#15803d}
.registration-badge.blocked{background:#fff0f1;color:#b91c1c}
.presence-badge.online{background:#e9faef;color:#15803d}
.presence-badge.offline{background:#f1f5f9;color:#64748b}
.presence-badge i{
  width:6px;height:6px;border-radius:50%;background:currentColor;
}
.user-presence-cell small,.last-login-cell small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:7px;
}
.last-login-cell strong{
  display:block;
  font-size:8px;
  color:#334155;
  white-space:nowrap;
}
.user-row-online{
  box-shadow:inset 3px 0 0 #2ad879;
}

@media(max-width:1200px){
  .users-summary-presence{grid-template-columns:repeat(3,1fr)!important}
}
@media(max-width:900px){
  .online-users-menu-wrap{display:none!important}
  .users-summary-presence{grid-template-columns:1fr 1fr!important}
}

/* ============================================================
   v70 - REORGANIZAÇÃO VISUAL DO DASHBOARD
   ============================================================ */

/* largura e respiro geral */
#dashboardView,
.dashboard-pro{
  width:100%!important;
  max-width:none!important;
  padding-left:10px!important;
  padding-right:10px!important;
}

/* cabeçalho do dashboard */
.dashboard-pro .dash-pro-header{
  margin-bottom:10px!important;
}
.dashboard-pro .dash-pro-header h1,
.dashboard-pro .dash-pro-header h2{
  margin-bottom:3px!important;
}

/* KPIs superiores mais equilibrados */
.dashboard-pro .dash-kpis,
.dashboard-pro .kpi-grid,
#dashboardView .dashboard-kpis{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:8px!important;
  margin-bottom:10px!important;
}
.dashboard-pro .dash-kpis article,
.dashboard-pro .kpi-grid article,
#dashboardView .dashboard-kpis article{
  min-height:82px!important;
  padding:12px 14px!important;
  border-radius:12px!important;
}

/* área principal: empresa com mais espaço, ocorrências mais estreitas */
.company-dashboard-layout,
.dash-monitor-layout.company-dashboard-layout{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 285px!important;
  gap:10px!important;
  align-items:start!important;
}

/* grid das empresas mais largo */
.company-status-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(340px,1fr))!important;
  gap:10px!important;
  align-content:start!important;
}

/* quando só há uma empresa, ela não fica minúscula */
.company-status-grid > .company-status-card:only-child{
  max-width:720px!important;
  width:100%!important;
}

/* card da empresa maior e mais proporcional */
.company-status-card{
  min-width:0!important;
  width:100%!important;
  min-height:205px!important;
  padding:14px!important;
  border-radius:14px!important;
}
.company-card-identity h4{
  font-size:14px!important;
}
.company-card-identity small{
  font-size:9px!important;
}
.company-health-badge{
  font-size:8px!important;
  padding:5px 8px!important;
}
.company-health-message{
  min-height:52px!important;
  margin:12px 0!important;
}
.company-health-message strong{
  font-size:10px!important;
}
.company-health-message small{
  font-size:8px!important;
}
.company-card-metrics{
  gap:7px!important;
}
.company-card-metrics>div{
  padding:9px 7px!important;
}
.company-card-metrics strong{
  font-size:17px!important;
}
.company-card-metrics span{
  font-size:8px!important;
}
.company-card-footer{
  font-size:8px!important;
  margin-top:10px!important;
}

/* últimas ocorrências mais compactas */
.dash-occurrences{
  width:100%!important;
  max-height:560px!important;
  min-height:0!important;
  overflow-y:auto!important;
  border-radius:12px!important;
}
.dash-occurrences .panel-head,
.dash-occurrences > header{
  padding:12px 12px 9px!important;
}
.dash-occurrences h3{
  font-size:14px!important;
}
.dash-occurrences small{
  font-size:8px!important;
}
.occurrence-row{
  padding:9px 10px!important;
  gap:8px!important;
}
.occurrence-main strong{
  font-size:10px!important;
}
.occurrence-main span,
.occurrence-main small,
.occurrence-actions time{
  font-size:7.5px!important;
}
.treat-event-btn{
  font-size:7px!important;
  padding:4px 6px!important;
}

/* título Status por empresa */
.company-overview-head{
  padding:2px 2px 8px!important;
  align-items:center!important;
}
.company-overview-head h3{
  font-size:15px!important;
}
.company-overview-head p{
  font-size:9px!important;
}
.company-overview-legend{
  font-size:8px!important;
}

/* rodapé do dashboard */
.company-dashboard-footer{
  margin-top:8px!important;
  padding:7px 9px!important;
}

/* topo: online + perfil sem esmagar */
#appView .topnav-right{
  gap:6px!important;
}
.online-users-menu-btn{
  min-width:auto!important;
  height:34px!important;
  padding:0 8px!important;
  gap:5px!important;
}
.online-users-menu-btn span:not(.online-users-dot){
  font-size:8px!important;
}
.online-users-menu-btn strong{
  min-width:17px!important;
  height:17px!important;
  font-size:7px!important;
}
#appView .header-profile-btn{
  min-width:165px!important;
  max-width:180px!important;
  height:38px!important;
}
#appView .header-avatar{
  width:29px!important;
  height:29px!important;
  min-width:29px!important;
}
#appView .header-profile-text strong{
  font-size:8px!important;
}
#appView .header-profile-text small{
  font-size:6px!important;
}

/* relógio mais discreto */
#appView .topnav-clock{
  min-width:56px!important;
}
#appView .topnav-clock strong{
  font-size:10px!important;
}

/* telas grandes */
@media(min-width:1500px){
  .company-dashboard-layout,
  .dash-monitor-layout.company-dashboard-layout{
    grid-template-columns:minmax(0,1fr) 300px!important;
  }
  .company-status-grid{
    grid-template-columns:repeat(2,minmax(420px,1fr))!important;
  }
}

/* telas médias */
@media(max-width:1300px){
  .company-dashboard-layout,
  .dash-monitor-layout.company-dashboard-layout{
    grid-template-columns:minmax(0,1fr) 265px!important;
  }
  .company-status-grid{
    grid-template-columns:1fr!important;
  }
}

/* tablet */
@media(max-width:1000px){
  .dashboard-pro .dash-kpis,
  .dashboard-pro .kpi-grid,
  #dashboardView .dashboard-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .company-dashboard-layout,
  .dash-monitor-layout.company-dashboard-layout{
    grid-template-columns:1fr!important;
  }
  .dash-occurrences{
    max-height:360px!important;
  }
}

/* mobile */
@media(max-width:720px){
  #dashboardView,
  .dashboard-pro{
    padding-left:8px!important;
    padding-right:8px!important;
  }
  .dashboard-pro .dash-kpis,
  .dashboard-pro .kpi-grid,
  #dashboardView .dashboard-kpis{
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }
  .company-status-grid{
    grid-template-columns:1fr!important;
  }
  .company-status-grid > .company-status-card:only-child{
    max-width:none!important;
  }
  .company-overview-head{
    align-items:flex-start!important;
    flex-direction:column!important;
  }
}

/* ============================================================
   v71 - ONLINE + PERFIL alinhados no canto direito
   ============================================================ */
@media(min-width:901px){

  /* Toda a área da direita deve ficar em uma única linha */
  #appView .sidebar-footer,
  #appView .topnav-right{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-end!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
    min-width:max-content!important;
    margin-left:auto!important;
  }

  /* Online deixa de subir para uma segunda linha */
  #appView .online-users-menu-wrap{
    position:relative!important;
    display:flex!important;
    align-items:center!important;
    flex:0 0 auto!important;
    margin:0!important;
    align-self:center!important;
  }

  #appView .online-users-menu-btn{
    height:38px!important;
    min-width:78px!important;
    padding:0 9px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    border-radius:10px!important;
    background:#0d1e31!important;
    border:1px solid #24415d!important;
    box-shadow:none!important;
  }

  #appView .online-users-menu-btn:hover{
    background:#122940!important;
    border-color:#366386!important;
  }

  #appView .online-users-dot{
    width:8px!important;
    height:8px!important;
    flex:0 0 8px!important;
  }

  #appView .online-users-menu-btn span:not(.online-users-dot){
    font-size:8px!important;
    line-height:1!important;
  }

  #appView .online-users-menu-btn strong{
    min-width:18px!important;
    height:18px!important;
    font-size:8px!important;
  }

  /* Perfil mais elegante e menos apertado */
  #appView .header-profile-wrap{
    display:flex!important;
    align-items:center!important;
    flex:0 0 auto!important;
    margin:0!important;
  }

  #appView .header-profile-btn{
    min-width:190px!important;
    max-width:210px!important;
    height:42px!important;
    padding:4px 9px!important;
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    border-radius:11px!important;
    background:#0d1d2f!important;
    border:1px solid #29445f!important;
  }

  #appView .header-profile-btn:hover{
    background:#12263c!important;
    border-color:#3b6286!important;
  }

  #appView .header-avatar{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    flex:0 0 34px!important;
    border-radius:10px!important;
    box-shadow:0 0 0 2px rgba(48,221,126,.12)!important;
  }

  /* pequeno indicador verde sobre o avatar = usuário atual online */
  #appView .header-profile-wrap::after{
    content:"";
    position:absolute;
    right:168px;
    bottom:5px;
    width:8px;
    height:8px;
    border-radius:50%;
    background:#2bdd78;
    border:2px solid #0d1d2f;
    box-shadow:0 0 8px rgba(43,221,120,.45);
    pointer-events:none;
  }

  #appView .header-profile-wrap{
    position:relative!important;
  }

  #appView .header-profile-text{
    min-width:0!important;
    flex:1!important;
  }

  #appView .header-profile-text strong{
    font-size:9px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  #appView .header-profile-text small{
    margin-top:3px!important;
    font-size:6.5px!important;
    color:#86a0bc!important;
  }

  /* dropdown do online abre alinhado com o botão */
  #appView .online-users-dropdown{
    right:0!important;
    top:44px!important;
  }

  /* garante que relógio/status não empurrem o perfil para baixo */
  #appView .topnav-clock,
  #appView .topnav-system,
  #appView .topnav-sound{
    flex:0 0 auto!important;
    align-self:center!important;
  }

  #appView .topnav-clock{
    min-width:58px!important;
  }

  /* remove qualquer label antigo/duplicado próximo ao perfil */
  #appView #userEmail,
  #appView .current-user,
  #appView .current-user-label{
    display:none!important;
  }
}

/* desktops menores: mantém tudo na linha sem esmagar */
@media(min-width:901px) and (max-width:1450px){
  #appView .header-profile-btn{
    min-width:165px!important;
    max-width:175px!important;
  }
  #appView .header-profile-wrap::after{
    right:144px;
  }
  #appView .online-users-menu-btn{
    min-width:64px!important;
    padding:0 7px!important;
  }
  #appView .topnav-system{
    display:none!important;
  }
}

/* celular: deixa o perfil simples */
@media(max-width:900px){
  #appView .header-profile-wrap::after{
    content:none!important;
  }
}

/* ============================================================
   v72 - topo em uma única linha + botão Sair visível
   ============================================================ */
@media(min-width:901px){

  #appView .sidebar{
    flex-wrap:nowrap!important;
    overflow:visible!important;
  }

  #appView .sidebar-brand{
    flex:0 0 130px!important;
    min-width:130px!important;
    max-width:130px!important;
  }

  #appView .sidebar nav{
    flex:1 1 auto!important;
    min-width:0!important;
    display:flex!important;
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    gap:1px!important;
  }

  #appView .sidebar nav .nav-item{
    flex:0 0 auto!important;
    white-space:nowrap!important;
  }

  /* bloco direito: nunca quebra */
  #appView .topnav-right,
  #appView .sidebar-footer{
    flex:0 0 auto!important;
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:5px!important;
    min-width:max-content!important;
    white-space:nowrap!important;
    overflow:visible!important;
  }

  #appView .topnav-sound{
    flex:0 0 58px!important;
    width:58px!important;
    min-width:58px!important;
    height:34px!important;
    padding:0 6px!important;
    font-size:8px!important;
  }

  #appView .topnav-system{
    flex:0 0 112px!important;
    width:112px!important;
    min-width:112px!important;
    height:34px!important;
    padding:4px 7px!important;
  }

  #appView .topnav-clock{
    flex:0 0 58px!important;
    width:58px!important;
    min-width:58px!important;
    text-align:center!important;
  }

  #appView .online-users-menu-wrap{
    flex:0 0 auto!important;
    width:auto!important;
    margin:0!important;
  }

  #appView .online-users-menu-btn{
    flex:0 0 72px!important;
    width:72px!important;
    min-width:72px!important;
    height:34px!important;
    padding:0 7px!important;
    margin:0!important;
  }

  #appView .header-profile-wrap{
    flex:0 0 auto!important;
    width:auto!important;
    margin:0!important;
  }

  #appView .header-profile-btn{
    flex:0 0 170px!important;
    width:170px!important;
    min-width:170px!important;
    max-width:170px!important;
    height:38px!important;
    margin:0!important;
    padding:4px 7px!important;
  }

  #appView .header-avatar{
    width:29px!important;
    height:29px!important;
    min-width:29px!important;
    flex:0 0 29px!important;
  }

  #appView .header-profile-text strong{
    font-size:8px!important;
  }

  #appView .header-profile-text small{
    font-size:6px!important;
  }

  #appView .header-profile-wrap::after{
    right:143px!important;
    bottom:4px!important;
  }

  .top-logout-btn{
    flex:0 0 54px!important;
    width:54px!important;
    min-width:54px!important;
    height:34px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    margin:0!important;
    padding:0 6px!important;
    border:1px solid #5a2e33!important;
    border-radius:9px!important;
    background:#2a1519!important;
    color:#ff9ba3!important;
    font-size:8px!important;
    font-weight:900!important;
    cursor:pointer!important;
  }

  .top-logout-btn:hover{
    background:#3a1b20!important;
    border-color:#84414a!important;
    color:#ffc3c8!important;
  }

  /* evita qualquer elemento "subir" ou "descer" */
  #appView .topnav-right > *,
  #appView .sidebar-footer > *{
    align-self:center!important;
    margin-top:0!important;
    margin-bottom:0!important;
    position:relative!important;
    top:auto!important;
    bottom:auto!important;
  }

  /* remove textos duplicados ou flutuantes */
  #appView #userEmail,
  #appView .current-user,
  #appView .current-user-label{
    display:none!important;
  }
}

/* telas menores: esconde "Sistema online" antes de quebrar */
@media(min-width:901px) and (max-width:1500px){
  #appView .topnav-system{
    display:none!important;
  }

  #appView .header-profile-btn{
    flex-basis:150px!important;
    width:150px!important;
    min-width:150px!important;
    max-width:150px!important;
  }

  #appView .header-profile-wrap::after{
    right:123px!important;
  }

  #appView .sidebar-brand{
    flex-basis:105px!important;
    min-width:105px!important;
    max-width:105px!important;
  }

  #appView .sidebar-brand span{
    display:none!important;
  }
}

/* ainda menor: compacta os textos do menu */
@media(min-width:901px) and (max-width:1200px){
  #appView .sidebar .nav-item{
    padding:0 5px!important;
    font-size:9px!important;
  }
  #appView .sidebar .nav-item span{
    font-size:9px!important;
  }
}

/* mobile mantém comportamento próprio */
@media(max-width:900px){
  .top-logout-btn{
    display:none!important;
  }
}

/* ============================================================
   v73 - menu sempre visível + fontes maiores + Sair destacado
   ============================================================ */
@media(min-width:901px){

  /* desativa totalmente o auto-ocultar */
  #appView .sidebar{
    transform:translateY(0)!important;
    position:relative!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    width:100%!important;
    height:58px!important;
    min-height:58px!important;
    box-shadow:none!important;
  }

  #appView .sidebar::after{
    display:none!important;
    content:none!important;
  }

  .desktop-nav-trigger,
  .desktop-top-menu-trigger{
    display:none!important;
  }

  body.desktop-nav-open #appView .main,
  body.desktop-nav-open #appView .main-content,
  body.desktop-nav-open #appView .app-main,
  body.desktop-nav-open #appView > main,
  #appView .main,
  #appView .main-content,
  #appView .app-main,
  #appView > main{
    padding-top:0!important;
  }

  /* fontes do menu */
  #appView .sidebar-brand strong{
    font-size:15px!important;
  }
  #appView .sidebar-brand span{
    font-size:10px!important;
  }

  #appView .sidebar .nav-item,
  #appView .sidebar .nav-item span{
    font-size:12px!important;
    font-weight:800!important;
  }

  #appView .sidebar .nav-item{
    height:40px!important;
    min-height:40px!important;
    padding:0 10px!important;
  }

  /* controles do topo com letras maiores */
  #appView .topnav-sound{
    font-size:10px!important;
    font-weight:900!important;
  }

  #appView .topnav-system strong{
    font-size:9px!important;
  }

  #appView .topnav-system small{
    font-size:7px!important;
  }

  #appView .topnav-clock strong{
    font-size:12px!important;
  }

  #appView .topnav-clock small{
    font-size:7px!important;
  }

  #appView .online-users-menu-btn span:not(.online-users-dot){
    font-size:9px!important;
    font-weight:900!important;
  }

  #appView .online-users-menu-btn strong{
    font-size:8px!important;
  }

  #appView .header-profile-text strong{
    font-size:10px!important;
  }

  #appView .header-profile-text small{
    font-size:7px!important;
  }

  /* botão Sair mais visível */
  .top-logout-btn{
    width:68px!important;
    min-width:68px!important;
    flex-basis:68px!important;
    height:38px!important;
    padding:0 10px!important;
    border:1px solid #e0525d!important;
    background:#7c1f28!important;
    color:#fff!important;
    font-size:10px!important;
    font-weight:900!important;
    box-shadow:0 0 0 1px rgba(255,255,255,.04),0 6px 16px rgba(124,31,40,.25)!important;
  }

  .top-logout-btn:hover{
    background:#a52b36!important;
    border-color:#ff7c86!important;
    color:#fff!important;
    transform:translateY(-1px);
  }

  /* perfil um pouco mais largo para acompanhar as fontes maiores */
  #appView .header-profile-btn{
    width:180px!important;
    min-width:180px!important;
    max-width:180px!important;
    height:40px!important;
  }

  /* não esconder o bloco Sistema Online em telas comuns */
  #appView .topnav-system{
    display:flex!important;
  }
}

/* apenas se a tela for realmente estreita, compacta sem quebrar */
@media(min-width:901px) and (max-width:1250px){
  #appView .topnav-system{
    display:none!important;
  }
  #appView .sidebar .nav-item,
  #appView .sidebar .nav-item span{
    font-size:10px!important;
  }
}

/* v74 - empresas sem equipamentos no Dashboard */
.company-status-card.sem_equipamentos{
  border-color:#3a4b5f!important;
  background:linear-gradient(145deg,#0e1a28,#101b27)!important;
}
.company-main-status-dot.sem_equipamentos{
  background:#7b8fa6!important;
  box-shadow:0 0 0 5px rgba(123,143,166,.10)!important;
}
.company-health-badge.sem_equipamentos{
  background:#253548!important;
  color:#b7c4d2!important;
}
.company-health-message.sem_equipamentos{
  background:rgba(100,120,145,.10)!important;
}
.company-health-message.sem_equipamentos .company-health-symbol{
  background:#26394d!important;
  color:#aebfd0!important;
}
.company-status-card.sem_equipamentos .company-card-metrics strong{
  color:#aeb9c5!important;
}
.company-status-card.sem_equipamentos .company-open-label{
  color:#8fb6d9!important;
}

/* v75 - edição de permissões de usuário */
.user-action-btn.edit{
  background:#eef5ff!important;
  border-color:#bfd6ff!important;
  color:#1d4ed8!important;
  font-weight:900!important;
}
.user-action-btn.edit:hover{
  background:#dbeafe!important;
  border-color:#93c5fd!important;
}

.edit-user-modal .modal-form{
  width:min(760px,calc(100vw - 26px));
}
.edit-user-grid{
  padding-top:4px;
}
.edit-role-preview{
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px 12px;
  border:1px solid #dbe4ee;
  border-radius:10px;
  background:#f8fafc;
}
.edit-role-preview>span{
  width:34px;height:34px;display:grid;place-items:center;
  border-radius:9px;background:#eef2f7;font-size:16px;
}
.edit-role-preview strong,
.edit-role-preview small{display:block}
.edit-role-preview strong{font-size:10px;color:#1f2937}
.edit-role-preview small{font-size:8px;color:#64748b;margin-top:3px;line-height:1.35}
.edit-role-preview.admin{
  background:#eff6ff;
  border-color:#bfdbfe;
}
.edit-role-preview.admin>span{background:#dbeafe}
.edit-role-preview.operator{
  background:#ecfdf5;
  border-color:#bbf7d0;
}
.edit-role-preview.operator>span{background:#d1fae5}

.edit-user-warning{
  display:flex;
  gap:9px;
  margin:0 18px 6px;
  padding:10px 11px;
  border-radius:9px;
  background:#fff8e8;
  border:1px solid #f5d98e;
}
.edit-user-warning strong,
.edit-user-warning small{display:block}
.edit-user-warning strong{font-size:9px;color:#92400e}
.edit-user-warning small{font-size:8px;color:#8a6740;margin-top:2px;line-height:1.35}

@media(max-width:720px){
  .edit-user-modal .modal-form{
    width:calc(100vw - 14px);
  }
}

/* v76 — legibilidade do Dashboard: fontes maiores sem alterar o layout */
.company-card-identity h4{font-size:16px!important;line-height:1.2!important}
.company-card-identity small{font-size:10.5px!important}
.company-health-badge{font-size:9.5px!important;padding:5px 9px!important}
.company-health-message strong{font-size:11.5px!important}
.company-health-message small{font-size:9px!important}
.company-card-metrics strong{font-size:19px!important}
.company-card-metrics span{font-size:9px!important}
.company-card-footer{font-size:9.5px!important}
.company-card-footer .company-open-label{font-size:10.5px!important;font-weight:800!important}

.dash-occurrences h3{font-size:16px!important}
.dash-occurrences small{font-size:9px!important}
.occurrence-main strong{font-size:11.5px!important;line-height:1.25!important}
.occurrence-main span,.occurrence-main small,.occurrence-actions time{font-size:8.7px!important;line-height:1.3!important}
.treat-event-btn{font-size:8.5px!important;padding:5px 7px!important}

.company-overview-head h3,.company-overview-head strong{font-size:16px!important}
.company-overview-head p,.company-overview-head small{font-size:10px!important}

@media(max-width:900px){
  .company-card-identity h4{font-size:15px!important}
  .company-health-message strong{font-size:11px!important}
  .company-card-metrics strong{font-size:18px!important}
  .occurrence-main strong{font-size:11px!important}
}

/* v77 - gerenciamento manual de reservas do roteador */
.router-reserve-btn{margin-left:6px;padding:6px 9px;border:1px solid #4a76a8;border-radius:7px;background:#102b46;color:#8fc7ff;font-size:11px;font-weight:800;cursor:pointer}
.router-reserve-btn:hover{background:#173b5e;color:#fff}
.router-reservation-modal{border:0;padding:0;background:transparent}
.router-reservation-modal::backdrop{background:rgba(2,8,18,.72);backdrop-filter:blur(3px)}
.router-reservation-box{width:min(650px,calc(100vw - 24px));background:#fff;border-radius:14px;padding:18px;box-shadow:0 30px 80px rgba(0,0,0,.4)}
.router-reservation-box h3{font-size:19px;margin:0}.router-reservation-box small{font-size:11px;color:#64748b}
.router-warning{display:flex;flex-direction:column;gap:3px;margin:12px 0;padding:11px;border:1px solid #f0d38a;background:#fff8df;border-radius:9px;color:#7c5700;font-size:12px}
.router-integration-note{margin-top:10px;padding:9px;border-radius:8px;background:#eef5ff;color:#35587b;font-size:11px;line-height:1.4}

/* v78 - cadastro e reserva em uma única etapa */
.router-choice{border:1px solid #cbd5e1;border-radius:10px;padding:11px 12px;background:#f8fbff}
.router-choice-line{display:flex;align-items:flex-start;gap:10px}
.router-choice-line input{width:18px;height:18px;margin-top:2px}
.router-choice-line span{display:flex;flex-direction:column;gap:2px}
.router-choice-line strong{font-size:13px}
.router-choice-line small{font-size:11px;color:#64748b}
.router-mac-warning{display:block;margin-top:8px;padding:7px 9px;border-radius:7px;background:#fff4d6;color:#7a5600;font-size:11px}

/* v79 - estado da integração real com Agent/ER706W */
.router-integration-note.working{background:#eef6ff;color:#215b94;border:1px solid #bfdcff}
.router-integration-note.success{background:#eafaf0;color:#13783a;border:1px solid #a9e3bd}
.router-integration-note.error{background:#fff0f1;color:#b4232d;border:1px solid #ffc4c8}
#rrConfirm:disabled{opacity:.65;cursor:wait}

.router-integration-note.reserved{background:#eef7ff;color:#155b8a;border:1px solid #a8d4f2}

/* v81 - ER706W exige MAC com hífen */
.router-mac-warning[hidden]{display:none!important}
#scannerEquipForm input[name="mac_address"],
#rrMac{text-transform:uppercase}

/* v82 - se já existe no roteador, permite continuar no JPLuz */
.router-integration-note.reserved{font-weight:600}

/* v83 - gerenciamento do ER706W na tela Equipamentos */
.equip-router-btn{
  margin:0 6px 0 0;
  padding:7px 10px;
  border:1px solid #4b7fba;
  border-radius:7px;
  background:#102b46;
  color:#9fd0ff;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.equip-router-btn:hover{background:#174064;color:#fff}
.router-manage-box{width:min(700px,calc(100vw - 24px))}
.router-manage-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.btn.danger{background:#d92d20;color:#fff;border:1px solid #b42318}
.btn.danger:hover{background:#b42318}
.router-reservation-meta{
  margin-top:10px;
  padding:8px 10px;
  border-radius:8px;
  background:#f1f5f9;
  color:#475569;
  font-size:11px;
}

/* v84 - cadastro em uma única ação */
.scanner-router-workflow{
  margin:10px 0 0;
  padding:9px 11px;
  border-radius:8px;
  font-size:11px;
  line-height:1.4;
}
.scanner-router-workflow.working{
  background:#eef6ff;
  color:#215b94;
  border:1px solid #bfdcff;
}
.scanner-router-workflow.error{
  background:#fff0f1;
  color:#b4232d;
  border:1px solid #ffc4c8;
}

.scanner-mac-summary{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:10px;margin:10px 0}
.scanner-mac-card{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border:1px solid #d6deea;border-radius:10px;background:#fff;cursor:pointer;text-align:left}
.scanner-mac-card span{font-size:12px;font-weight:700;color:#475569}
.scanner-mac-card strong{font-size:20px}
.scanner-mac-state-badge{display:inline-flex;margin-left:8px;padding:3px 6px;border-radius:999px;font-size:9px;font-weight:800;white-space:nowrap}
.scanner-mac-state-badge.registered{background:#dcfce7;color:#15803d}
.scanner-mac-state-badge.unregistered{background:#dbeafe;color:#1d4ed8}
.scanner-mac-state-badge.missing{background:#fef3c7;color:#a16207}
.scanner-filter-select{min-width:170px}
@media (max-width:900px){.scanner-mac-summary{grid-template-columns:1fr}}

.scan-status.router-seen{color:#2563eb}
.scan-status.router-seen i{background:#3b82f6}
.scan-mac-badge{display:block;width:max-content;margin-top:3px;padding:2px 5px;border-radius:999px;font-size:9px;font-weight:800}
.scan-mac-badge.registered{background:#dcfce7;color:#15803d}
.scan-mac-badge.unregistered{background:#dbeafe;color:#1d4ed8}
.scan-mac-badge.missing{background:#fef3c7;color:#a16207}
#scannerMacStatusFilter{min-width:175px}

/* v87 - filtros MAC definitivos */
.scanner-filters #scannerMacStatusFilter,
#scannerMacStatusFilter{
  min-width:180px!important;
  height:38px!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
}
.scanner-mac-filter-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:8px 0 6px;
  font-size:12px;
  font-weight:800;
  color:#334155;
}
.scanner-mac-filter-title span{
  padding:4px 8px;
  border-radius:999px;
  background:#eaf2ff;
  color:#2563eb;
  font-size:10px;
}
.scanner-mac-card.active{
  border-color:#2563eb!important;
  box-shadow:0 0 0 2px rgba(37,99,235,.14)!important;
}

/* v88 - ER706W como origem principal */
.scan-status.router-stale{color:#9a6700}
.scan-status.router-stale i{background:#d9a400}
.scan-status.router-seen{color:#1d4ed8}
.scan-status.router-seen i{background:#3b82f6}

/* v89 - MAC com hífen + reserva confiável + hover de linha */
#scannerBody tr,
.scanner-table tbody tr{
  transition:background-color .14s ease, box-shadow .14s ease, transform .08s ease;
}
#scannerBody tr:hover,
.scanner-table tbody tr:hover{
  background:#dbeafe!important;
  box-shadow:inset 4px 0 0 #2563eb, inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd;
}
#scannerBody tr:hover td,
.scanner-table tbody tr:hover td{
  background:transparent!important;
}
.router-reservation-badge{
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:4px 7px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
}
.router-reservation-badge.reserved{
  background:#dcfce7;
  color:#15803d;
  border:1px solid #86efac;
}
.router-reservation-badge.free{
  background:#f1f5f9;
  color:#64748b;
  border:1px solid #cbd5e1;
}
.router-reservation-desc{
  display:block;
  margin-top:3px;
  max-width:145px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#64748b;
  font-size:9px;
}

.scanner-data-row:hover, #scannerBody tr:hover{background:#dbeafe!important;box-shadow:inset 3px 0 #2563eb}
#scannerBody tr:hover td{background:transparent!important}
.router-reservation-badge{display:inline-flex;padding:3px 7px;border-radius:999px;font-size:10px;font-weight:800;white-space:nowrap}
.router-reservation-badge.reserved{background:#dcfce7;color:#166534;border:1px solid #86efac}
.router-reservation-badge.free{background:#f8fafc;color:#64748b;border:1px solid #cbd5e1}
.router-reservation-desc{display:block;font-size:9px;color:#64748b;margin-top:2px}
.er706-countdown{display:inline-flex;gap:4px;align-items:center;font-size:10px;color:#94a3b8;margin-right:7px}
.er706-countdown strong{font-size:10px;color:#cbd5e1}
.er706-countdown.urgent strong{color:#ef4444;animation:er706blink 1s ease-in-out infinite}
@keyframes er706blink{50%{opacity:.3}}

/* v93: alinhamento estável das 11 colunas */
#scannerBody tr{display:table-row!important}
#scannerBody td{display:table-cell!important;vertical-align:middle}
#scannerBody td:nth-child(6), thead th:nth-child(6){min-width:105px}
.router-reservation-badge.unknown{background:#fff7ed;color:#9a3412;border:1px solid #fdba74}.scan-mac{white-space:nowrap}
/* v95 - formatação da tabela Rede / ER706W */
.scanner-table-wrap-v95{
  width:100%;
  overflow-x:auto;
  overflow-y:visible;
  border-radius:14px;
}
.scanner-table-wrap-v95 table{
  width:100%;
  min-width:1180px;
  table-layout:fixed;
}
.scanner-table-wrap-v95 th,
.scanner-table-wrap-v95 td{
  padding:10px 12px!important;
  vertical-align:middle!important;
}
.scanner-table-wrap-v95 th{
  font-size:10px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
  letter-spacing:.02em;
}
.scanner-table-wrap-v95 td{
  font-size:11px!important;
}
.scanner-table-wrap-v95 th:nth-child(1),
.scanner-table-wrap-v95 td:nth-child(1){width:72px}
.scanner-table-wrap-v95 th:nth-child(2),
.scanner-table-wrap-v95 td:nth-child(2){width:86px}
.scanner-table-wrap-v95 th:nth-child(3),
.scanner-table-wrap-v95 td:nth-child(3){width:122px}
.scanner-table-wrap-v95 th:nth-child(4),
.scanner-table-wrap-v95 td:nth-child(4){width:210px}
.scanner-table-wrap-v95 th:nth-child(5),
.scanner-table-wrap-v95 td:nth-child(5){width:155px}
.scanner-table-wrap-v95 th:nth-child(6),
.scanner-table-wrap-v95 td:nth-child(6){width:145px}
.scanner-table-wrap-v95 th:nth-child(7),
.scanner-table-wrap-v95 td:nth-child(7){width:170px}
.scanner-table-wrap-v95 th:nth-child(8),
.scanner-table-wrap-v95 td:nth-child(8){width:72px}
.scanner-table-wrap-v95 th:nth-child(9),
.scanner-table-wrap-v95 td:nth-child(9){width:170px}
.scanner-table-wrap-v95 th:nth-child(10),
.scanner-table-wrap-v95 td:nth-child(10){width:105px}
.scanner-table-wrap-v95 th:nth-child(11),
.scanner-table-wrap-v95 td:nth-child(11){width:145px}

.scanner-table-wrap-v95 td:nth-child(4) .scan-name,
.scanner-table-wrap-v95 td:nth-child(7){
  white-space:normal!important;
  line-height:1.25;
}
.scanner-table-wrap-v95 td:nth-child(5) code{
  white-space:nowrap!important;
  font-size:10.5px!important;
}
.scanner-table-wrap-v95 td:nth-child(6){
  text-align:left;
}
.scanner-table-wrap-v95 td:nth-child(8),
.scanner-table-wrap-v95 td:nth-child(10){
  white-space:nowrap;
}
.scanner-table-wrap-v95 tr{
  min-height:48px;
}
.scanner-table-wrap-v95 tbody tr:hover{
  background:#dbeafe!important;
  box-shadow:inset 4px 0 0 #2563eb;
}
.scanner-table-wrap-v95 tbody tr:hover td{
  background:transparent!important;
}
@media (max-width:1200px){
  .scanner-table-wrap-v95 table{min-width:1120px}
}
