/* ============================================================
   Painel NOC — Seeg Conectado.
   Usa os tokens da marca (colors.css / var(--seeg-*)).
   Shell: sidebar lateral + topbar fino. Dark-first.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--seeg-bg);
  color: var(--seeg-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .display { font-family: "Poppins", "Inter", sans-serif; letter-spacing: -.01em; }
a { color: var(--seeg-link); text-decoration: none; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--seeg-text-muted); }
::selection { background: rgba(246,163,25,.28); }

/* transição suave global de cor/fundo (sem custo de layout) */
a, button, .card, .side-link, .icon-btn, .btn, input, select, textarea, .badge, tr, th, td, .banner {
  transition: background-color var(--seeg-dur) var(--seeg-ease),
              border-color var(--seeg-dur) var(--seeg-ease),
              color var(--seeg-dur) var(--seeg-ease),
              box-shadow var(--seeg-dur) var(--seeg-ease),
              transform var(--seeg-dur) var(--seeg-ease);
}
/* ao alternar tema, anima também superfícies grandes */
html.theme-anim, html.theme-anim body, html.theme-anim .sidebar {
  transition: background-color var(--seeg-dur-slow) var(--seeg-ease), color var(--seeg-dur-slow) var(--seeg-ease);
}

:focus-visible { outline: none; box-shadow: var(--seeg-focus-ring); border-radius: var(--seeg-radius-sm); }
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--seeg-accent);
  color: #1a1a1a; padding: 8px 14px; border-radius: var(--seeg-radius-sm); font-weight: 600;
  transition: top var(--seeg-dur) var(--seeg-ease);
}
.skip-link:focus { top: 12px; }

.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }

/* ============================================================
   SHELL — sidebar + content
   ============================================================ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--seeg-sidebar-w);
  background: var(--seeg-rail-bg); color: var(--seeg-rail-text);
  display: flex; flex-direction: column; z-index: 60;
  box-shadow: var(--seeg-shadow-lg);
  transition: width var(--seeg-dur) var(--seeg-ease), transform var(--seeg-dur) var(--seeg-ease);
}
.sidebar .brand-row {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  height: var(--seeg-topbar-h); padding: 0 10px 0 14px; flex: none;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.sidebar .brand { display: flex; align-items: center; color: #fff; min-width: 0; }
.sidebar .brand .brand-word { font-family: "Poppins","Inter",sans-serif; font-weight: 700; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; color: #fff; transition: opacity var(--seeg-dur) var(--seeg-ease); }
.sidebar .brand .brand-word .bw-accent { color: var(--seeg-orange); }
.sidebar .brand-row .brand-toggle { flex: none; width: 36px; height: 36px; background: transparent; color: rgba(255,255,255,.78); }
.sidebar .brand-row .brand-toggle:hover { background: rgba(255,255,255,.10); color: #fff; }

.side-nav { display: flex; flex-direction: column; gap: 3px; padding: 14px 12px; overflow-y: auto; flex: 1; }
.side-sep { color: rgba(255,255,255,.4); font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; padding: 14px 12px 6px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--seeg-radius-sm);
  color: var(--seeg-rail-text); font-weight: 500; font-size: 14.5px; position: relative; white-space: nowrap;
}
.side-link .side-ic { display: inline-flex; }
.side-link .ic { width: 18px; height: 18px; }
.side-link:hover { background: var(--seeg-rail-hover); color: #fff; }
.side-link.active { background: var(--seeg-orange); color: var(--seeg-navy); font-weight: 600; box-shadow: var(--seeg-shadow-sm); }
.side-link.active .ic { color: var(--seeg-navy); }

.rail-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; flex: none; }
.rail-foot .rail-ver { padding: 6px 12px 2px; }
.rail-btn {
  background: rgba(255,255,255,.06); color: var(--seeg-rail-text); border: 0; cursor: pointer;
  width: 38px; height: 38px; border-radius: var(--seeg-radius-sm); display: inline-flex;
  align-items: center; justify-content: center;
}
.rail-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.rail-ver { font-size: 11px; color: rgba(255,255,255,.45); }
/* botões do rodapé (tema / sair) — visual dos nav-items, só-ícone quando recolhido */
.rail-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border-radius: var(--seeg-radius-sm); color: var(--seeg-rail-text); font-weight: 500;
  font-size: 14px; background: transparent; border: 0; cursor: pointer; white-space: nowrap; text-align: left; }
.rail-link:hover { background: var(--seeg-rail-hover); color: #fff; }
.rail-link .side-ic { display: inline-flex; }
.rail-link .ic { width: 18px; height: 18px; }

.content { margin-left: var(--seeg-sidebar-w); min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left var(--seeg-dur) var(--seeg-ease); }
.content > main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 28px; flex: 1; }

/* ---- colapsado (desktop) ---- */
body[data-collapsed="1"] .sidebar { width: var(--seeg-sidebar-w-collapsed); }
body[data-collapsed="1"] .content { margin-left: var(--seeg-sidebar-w-collapsed); }
body[data-collapsed="1"] .side-label,
body[data-collapsed="1"] .rail-ver { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
body[data-collapsed="1"] .sidebar .brand-row { justify-content: center; padding: 0; }
body[data-collapsed="1"] .sidebar .brand { display: none; }
body[data-collapsed="1"] .side-link { justify-content: center; padding: 10px; }
body[data-collapsed="1"] .rail-link { justify-content: center; padding: 10px; }
body[data-collapsed="1"] .rail-foot { flex-direction: column; }

/* ============================================================
   BOTÃO DE MENU FLUTUANTE (mobile) — abre o drawer da sidebar
   ============================================================ */
.menu-fab { display: none; }

.icon-btn {
  background: transparent; color: var(--seeg-text-muted); border: 1px solid transparent; cursor: pointer;
  width: 38px; height: 38px; border-radius: var(--seeg-radius-sm); font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--seeg-surface-alt); color: var(--seeg-text); }
.icon-btn:active { transform: scale(.94); }
.only-mobile { display: none; }

.icon-btn.spinning .ic, .ic.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PÁGINA
   ============================================================ */
.page-head { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
.page-head h1 { font-size: 23px; margin: 0; }

/* fundo "aurora" sutil (estático: dois radial-gradients fixos, custo zero).
   Fora das telas de auth, que já têm o próprio fundo de marca. */
body:not(.auth-body)::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(52vmax 52vmax at 8% -10%, var(--seeg-aurora-1), transparent 60%),
    radial-gradient(44vmax 44vmax at 100% 110%, var(--seeg-aurora-2), transparent 62%);
}

/* ---- Cards / métricas ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
/* borda em gradiente (dupla camada de background) + relevo (highlight 1px no topo) */
.card {
  background:
    linear-gradient(var(--seeg-surface), var(--seeg-surface)) padding-box,
    var(--seeg-grad-border) border-box;
  border: 1px solid transparent;
  border-radius: var(--seeg-radius-md); padding: 16px 18px;
  box-shadow: var(--seeg-shadow-card), inset 0 1px 0 var(--seeg-card-highlight);
}
.card:hover {
  box-shadow: var(--seeg-shadow-md), 0 0 24px var(--seeg-glow-accent),
              inset 0 1px 0 var(--seeg-card-highlight);
}
.card .card-head { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card .card-head .section-title { margin: 0; }
.metric { position: relative; overflow: hidden; }
/* barra de cor no topo — permanente e por tom (estilo Seeg Nota) */
.metric::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--seeg-primary); transition: background-color var(--seeg-dur) var(--seeg-ease); }
.metric:has(.value.ok)::after   { background: var(--seeg-success); }
.metric:has(.value.warn)::after { background: var(--seeg-orange); }
.metric:has(.value.bad)::after  { background: var(--seeg-danger); }
.metric:hover { transform: translateY(-2px); }
/* ícone numa caixa tonal (cor por tom) */
.metric .metric-ic { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: var(--seeg-radius-md);
  background: var(--seeg-blue-100); color: var(--seeg-primary); }
.metric:has(.value.ok) .metric-ic   { background: #E4F4EC; color: var(--seeg-success); }
.metric:has(.value.warn) .metric-ic { background: var(--seeg-orange-100); color: var(--seeg-orange-600); }
.metric:has(.value.bad) .metric-ic  { background: #FBE6E4; color: var(--seeg-danger); }
[data-theme="dark"] .metric .metric-ic                  { background: rgba(246,163,25,.16); color: var(--seeg-orange-300); }
[data-theme="dark"] .metric:has(.value.ok) .metric-ic   { background: rgba(30,158,90,.20); color: #6ee7a8; }
[data-theme="dark"] .metric:has(.value.warn) .metric-ic { background: rgba(246,163,25,.18); color: var(--seeg-orange-300); }
[data-theme="dark"] .metric:has(.value.bad) .metric-ic  { background: rgba(214,69,59,.22); color: #ff9b91; }
.metric .value { font-family: "Poppins"; font-size: 31px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric .label { color: var(--seeg-text-muted); font-size: 13px; margin-top: 3px; text-transform: capitalize; }
.metric .value.ok { color: var(--seeg-success); }
.metric .value.warn { color: var(--seeg-orange-600); }
.metric .value.bad { color: var(--seeg-danger); }
[data-theme="dark"] .metric .value.warn { color: var(--seeg-orange-400); }
/* sparkline no rodapé do card KPI (decorativo: atrás do conteúdo, sem hit-test) */
.metric .kpi-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34px;
  display: block; opacity: .5; pointer-events: none; }
.metric:has(.kpi-spark) { padding-bottom: 36px; }

/* ---- Seções ---- */
.section-title { font-size: 14px; color: var(--seeg-text-muted); margin: 26px 0 10px; font-weight: 600;
  letter-spacing: .01em; }

/* ---- Tabelas ---- */
.table-wrap { background: var(--seeg-bg); border: 1px solid var(--seeg-border); border-radius: var(--seeg-radius-md);
  overflow-x: auto; box-shadow: var(--seeg-shadow-sm); }
[data-theme="dark"] .table-wrap { background: var(--seeg-surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--seeg-border); border-right: 1px solid var(--seeg-border); font-size: 13.5px; }
th:last-child, td:last-child { border-right: 0; }
th { background: var(--seeg-surface); color: var(--seeg-text-muted); font-weight: 600; font-size: 12.5px; position: relative; }
[data-theme="dark"] th { background: var(--seeg-surface-alt); }
tbody tr:hover { background: var(--seeg-surface); }
[data-theme="dark"] tbody tr:hover { background: var(--seeg-surface-alt); }
tr:last-child td { border-bottom: 0; }
.vazio { text-align: center; color: var(--seeg-text-muted); padding: 26px; }

/* ---- Badges de status (pílula com anel + ícone, estilo Seeg Nota) ---- */
.badge { display: inline-flex; align-items: center; gap: .4em; padding: 3px 10px;
  border-radius: var(--seeg-radius-pill); font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  --bi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E"); }
.badge::before { content: ""; width: 14px; height: 14px; flex: none; background-color: currentColor;
  -webkit-mask: var(--bi) center / contain no-repeat; mask: var(--bi) center / contain no-repeat; }
.badge.online, .badge.resolvido { background: #E4F4EC; color: var(--seeg-success); box-shadow: inset 0 0 0 1px rgba(30,158,90,.30);
  --bi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.badge.offline, .badge.confirmado { background: #FBE6E4; color: var(--seeg-danger); box-shadow: inset 0 0 0 1px rgba(214,69,59,.28);
  --bi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E"); }
.badge.alerta, .badge.pendente { background: var(--seeg-orange-100); color: var(--seeg-orange-700); box-shadow: inset 0 0 0 1px rgba(246,163,25,.34);
  --bi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E"); }
.badge.neutro, .badge.descartado { background: var(--seeg-gray-200); color: var(--seeg-gray-700); box-shadow: inset 0 0 0 1px var(--seeg-gray-300);
  --bi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='4.93' y1='4.93' x2='19.07' y2='19.07'/%3E%3C/svg%3E"); }
.badge.info, .badge.leitura { background: var(--seeg-blue-100); color: var(--seeg-blue-700); box-shadow: inset 0 0 0 1px rgba(13,70,140,.22); }
[data-theme="dark"] .badge.online, [data-theme="dark"] .badge.resolvido { background: rgba(30,158,90,.20); color: #6ee7a8; box-shadow: inset 0 0 0 1px rgba(110,231,168,.30); }
[data-theme="dark"] .badge.offline, [data-theme="dark"] .badge.confirmado { background: rgba(214,69,59,.22); color: #ff9b91; box-shadow: inset 0 0 0 1px rgba(255,155,145,.30); }
[data-theme="dark"] .badge.alerta, [data-theme="dark"] .badge.pendente { background: rgba(246,163,25,.18); color: var(--seeg-orange-300); box-shadow: inset 0 0 0 1px rgba(246,163,25,.34); }
[data-theme="dark"] .badge.neutro, [data-theme="dark"] .badge.descartado { background: rgba(255,255,255,.08); color: var(--seeg-gray-300); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
[data-theme="dark"] .badge.info, [data-theme="dark"] .badge.leitura { background: rgba(68,128,196,.22); color: var(--seeg-blue-300); box-shadow: inset 0 0 0 1px rgba(121,166,216,.30); }

/* ---- Botões ---- */
.btn { border: 1px solid var(--seeg-border); background: var(--seeg-bg); color: var(--seeg-text);
  padding: 9px 16px; border-radius: var(--seeg-radius-sm); cursor: pointer; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; font-family: inherit; }
.btn:hover { background: var(--seeg-surface); border-color: var(--seeg-gray-400); }
[data-theme="dark"] .btn:not(.btn-cta):not(.btn-primary) { background: var(--seeg-surface); }
[data-theme="dark"] .btn:not(.btn-cta):not(.btn-primary):hover { background: var(--seeg-surface-alt); }
.btn:active { transform: translateY(1px); }
.btn-cta { background: var(--seeg-orange); color: var(--seeg-graphite); border-color: var(--seeg-orange); }
.btn-cta:hover { background: var(--seeg-accent-hover); border-color: var(--seeg-accent-hover); box-shadow: 0 4px 14px rgba(246,163,25,.34); }
.btn-primary { background: var(--seeg-primary); color: #fff; border-color: var(--seeg-primary); }
.btn-primary:hover { background: var(--seeg-primary-hover); border-color: var(--seeg-primary-hover); }
[data-theme="dark"] .btn-primary { color: var(--seeg-graphite); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---- Paginação no topo da seção (estilo Seeg Nota) ---- */
[x-cloak] { display: none !important; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 10px; flex-wrap: wrap; }
.section-head .section-title { margin: 0; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.pager .muted { font-size: 13px; color: var(--seeg-text-muted); }

/* ---- Banner / avisos ---- */
.banner { border-radius: var(--seeg-radius-md); padding: 13px 16px; margin-bottom: 14px; border-left: 4px solid;
  display: flex; align-items: flex-start; gap: 10px; box-shadow: var(--seeg-shadow-sm); animation: fadeUp .4s var(--seeg-ease-out) both; }
.banner .banner-ic { flex: none; margin-top: 1px; }
.banner.info { background: var(--seeg-blue-100); border-color: var(--seeg-info); color: var(--seeg-blue-700); }
.banner.aviso { background: var(--seeg-orange-100); border-color: var(--seeg-orange); color: var(--seeg-orange-700); }
.banner.critico { background: #FBE6E4; border-color: var(--seeg-danger); color: #a3271e; }
[data-theme="dark"] .banner { background: var(--seeg-surface-alt); color: var(--seeg-text); }
[data-theme="dark"] .banner.info { border-color: var(--seeg-blue-400); }

/* ---- Inputs / Form ---- */
.inp { padding: 9px 12px; border: 1px solid var(--seeg-border); border-radius: var(--seeg-radius-md);
  background: var(--seeg-bg); color: var(--seeg-text); font: inherit; font-size: 14px; width: 100%; }
.inp::placeholder { color: var(--seeg-text-muted); }
.inp:hover { border-color: var(--seeg-gray-400); }
.inp:focus { outline: none; box-shadow: var(--seeg-focus-ring); border-color: var(--seeg-primary); }
details > summary { color: var(--seeg-text); }

/* barra de filtros como toolbar */
.filtros { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
  background: var(--seeg-surface); border: 1px solid var(--seeg-border); border-radius: var(--seeg-radius-md);
  padding: 12px 14px; box-shadow: var(--seeg-shadow-sm); }
.filtros label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* ============================================================
   DASHBOARD 2026 — toolbar, segmented, chip ao-vivo, bento,
   gráficos, heatmap e MTTR
   ============================================================ */
.dash-toolbar { gap: 12px; }
.dash-toolbar .toolbar-label { font-size: 12.5px; font-weight: 600; color: var(--seeg-text-muted);
  text-transform: uppercase; letter-spacing: .05em; }
.dash-toolbar .toolbar-end { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.dash-toolbar .inp { width: auto; min-width: 140px; }

/* segmented control (pílula) */
.segmented { display: inline-flex; gap: 3px; padding: 3px; background: var(--seeg-surface-alt);
  border: 1px solid var(--seeg-border); border-radius: var(--seeg-radius-pill); }
.segmented > button { border: 0; background: transparent; color: var(--seeg-text-muted); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: var(--seeg-radius-pill);
  transition: background-color var(--seeg-dur) var(--seeg-ease), color var(--seeg-dur) var(--seeg-ease); }
.segmented > button:hover { color: var(--seeg-text); }
.segmented > button.active { background: var(--seeg-grad-accent); color: var(--seeg-navy);
  box-shadow: var(--seeg-shadow-sm); }
.segmented.seg-sm > button { padding: 4px 10px; font-size: 12px; }

/* chip "AO VIVO" — o livePoll seta .busy/.err no dot */
.chip-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: var(--seeg-radius-pill); border: 1px solid var(--seeg-border);
  background: var(--seeg-surface-alt); font-size: 12.5px; font-weight: 500; color: var(--seeg-text-muted);
  white-space: nowrap; }
.chip-live .chip-dot { width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--seeg-success); animation: livepulse 2s var(--seeg-ease) infinite; }
.chip-live .chip-dot.busy { background: var(--seeg-orange); }
.chip-live .chip-dot.err { background: var(--seeg-danger); animation: none; }
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 158, 90, .45); }
  70% { box-shadow: 0 0 0 7px rgba(30, 158, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 158, 90, 0); }
}

/* bento grid (12 colunas) */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.bento .b-4 { grid-column: span 4; }
.bento .b-6 { grid-column: span 6; }
.bento .b-8 { grid-column: span 8; }
.bento .b-12 { grid-column: span 12; }
@media (max-width: 1150px) {
  .bento .b-6, .bento .b-8 { grid-column: span 12; }
  .bento .b-4 { grid-column: span 6; }
}

/* caixa de gráfico (altura fixa p/ Chart.js responsivo) + skeleton de troca de filtro */
.chart-box { position: relative; height: 230px; }
.chart-box.tall { height: 280px; }
.chart-box.loading::after { content: ""; position: absolute; inset: 0;
  border-radius: var(--seeg-radius-sm); background: var(--seeg-surface-alt);
  animation: pulseSoft 1.1s var(--seeg-ease) infinite alternate; }
@keyframes pulseSoft { from { opacity: .25; } to { opacity: .65; } }

/* heatmap hora × dia (CSS grid puro, intensidade via --a inline) */
.heatmap { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 3px; }
.heatmap .hm-lab { font-size: 10.5px; color: var(--seeg-text-muted); display: flex; align-items: center; }
.heatmap .hm-lab.hm-hora { justify-content: center; }
.heatmap .hm-cell { aspect-ratio: 1 / 1; min-height: 10px; border-radius: 4px;
  background: var(--seeg-surface-alt); }
.heatmap .hm-cell.on { background: rgb(246 163 25 / var(--a, .2)); }
.heatmap .hm-cell:hover { outline: 1px solid var(--seeg-orange); outline-offset: -1px; }

/* MTTR — número grande + chip de tendência vs período anterior */
.mttr-big { font-family: "Poppins", "Inter", sans-serif; font-size: 40px; font-weight: 700;
  line-height: 1.05; font-variant-numeric: tabular-nums; }
.delta-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--seeg-radius-pill); }
.delta-chip.boa { background: #E4F4EC; color: var(--seeg-success); }
.delta-chip.ruim { background: #FBE6E4; color: var(--seeg-danger); }
[data-theme="dark"] .delta-chip.boa { background: rgba(30, 158, 90, .20); color: #6ee7a8; }
[data-theme="dark"] .delta-chip.ruim { background: rgba(214, 69, 59, .22); color: #ff9b91; }

/* texto com degradê de marca (títulos de destaque) */
.grad-text { background: linear-gradient(120deg, var(--seeg-blue-500), var(--seeg-orange-500));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="dark"] .grad-text { background: linear-gradient(120deg, #79A6D8, var(--seeg-orange-400));
  -webkit-background-clip: text; background-clip: text; }

/* ---- Ordenação de tabelas (indicador persistente ⇅ → ▲/▼) ---- */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--seeg-text); }
.sort-ic { width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px;
  opacity: .4; color: var(--seeg-text-muted);
  transition: opacity var(--seeg-dur) var(--seeg-ease), color var(--seeg-dur) var(--seeg-ease); }
.th-sort:hover .sort-ic { opacity: .7; }
.sort-ic.active { opacity: 1; color: var(--seeg-accent); }

/* ---- Colunas redimensionáveis ---- */
table.table-fixed { table-layout: fixed; }
table.table-fixed th, table.table-fixed td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-resizer { position: absolute; top: 0; right: -5px; width: 10px; height: 100%; z-index: 3;
  cursor: col-resize; user-select: none; touch-action: none; display: flex; justify-content: center; }
.col-resizer::before { content: ""; width: 2px; height: 100%; background: transparent;
  transition: background-color var(--seeg-dur) var(--seeg-ease); }
.col-resizer:hover::before, .col-resizer.dragging::before { background: var(--seeg-accent); }

/* ============================================================
   ESTADOS — skeleton, empty
   ============================================================ */
.skel-block { display: flex; flex-direction: column; gap: 10px; }
.skel, .skel-line { position: relative; overflow: hidden; background: var(--seeg-surface-alt); border-radius: var(--seeg-radius-sm); }
.skel-line { height: 14px; }
.skel-line:nth-child(2) { width: 80%; } .skel-line:nth-child(3) { width: 60%; }
.skel::after, .skel-line::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.empty-state { text-align: center; padding: 64px 20px; color: var(--seeg-text-muted); }
.empty-state .empty-ic { color: var(--seeg-gray-400); margin-bottom: 12px; }

footer { text-align: center; color: var(--seeg-text-muted); font-size: 12px; padding: 22px; }

/* ============================================================
   TOASTS (card na surface, borda esquerda colorida, ícone +
   título + descrição opcional, X no canto — estilo Seeg Nota)
   ============================================================ */
.toast-wrap { position: fixed; bottom: 16px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 10px;
  width: min(384px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; display: flex; align-items: flex-start; gap: 12px;
  background: var(--seeg-surface); color: var(--seeg-text);
  border: 1px solid var(--seeg-border); border-left: 4px solid var(--seeg-info);
  border-radius: var(--seeg-radius-md); padding: 13px 36px 13px 14px;
  box-shadow: var(--seeg-shadow-lg); transform: translateX(16px); opacity: 0;
  transition: transform var(--seeg-dur) var(--seeg-ease), opacity var(--seeg-dur) var(--seeg-ease); }
.toast.in { transform: none; opacity: 1;
  transition: transform var(--seeg-dur-slow) var(--seeg-ease-out), opacity var(--seeg-dur-slow) var(--seeg-ease-out); }
.toast-success { border-left-color: var(--seeg-success); }
.toast-warn    { border-left-color: var(--seeg-warning); }
.toast-error   { border-left-color: var(--seeg-danger); }
.toast .toast-ic { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast-info    .toast-ic { color: var(--seeg-info); }
.toast-success .toast-ic { color: var(--seeg-success); }
.toast-warn    .toast-ic { color: var(--seeg-orange-600); }
.toast-error   .toast-ic { color: var(--seeg-danger); }
.toast .toast-body { flex: 1; min-width: 0; }
.toast .toast-title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.toast .toast-desc { margin-top: 2px; font-size: 12.5px; color: var(--seeg-text-muted); overflow-wrap: break-word; }
.toast .toast-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center; background: none; border: 0;
  border-radius: var(--seeg-radius-sm); color: var(--seeg-text-muted); cursor: pointer; }
.toast .toast-x:hover { background: var(--seeg-surface-alt); color: var(--seeg-text); }
/* tema escuro: o info navy some na surface navy (mesmo ajuste do .banner.info) */
[data-theme="dark"] .toast-info  { border-left-color: var(--seeg-blue-400); }
[data-theme="dark"] .toast-info    .toast-ic { color: var(--seeg-blue-300); }
[data-theme="dark"] .toast-success .toast-ic { color: #6ee7a8; }
[data-theme="dark"] .toast-warn    .toast-ic { color: var(--seeg-orange-300); }
[data-theme="dark"] .toast-error   .toast-ic { color: #ff9b91; }

/* ============================================================
   COMMAND PALETTE (Ctrl/Cmd + K)
   ============================================================ */
.cmdk { position: fixed; inset: 0; z-index: 400; background: rgba(7,18,46,.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh; animation: fadeIn .14s var(--seeg-ease); }
.cmdk[hidden] { display: none; }
.cmdk-panel { width: min(560px, 92vw); background: var(--seeg-bg); border: 1px solid var(--seeg-border);
  border-radius: var(--seeg-radius-lg); box-shadow: var(--seeg-shadow-lg); overflow: hidden; animation: popIn .18s var(--seeg-ease-out); }
.cmdk-head { padding: 8px; border-bottom: 1px solid var(--seeg-border); }
.cmdk-input { width: 100%; border: 0; background: transparent; color: var(--seeg-text); font: inherit; font-size: 16px; padding: 10px 12px; outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cmdk-item { padding: 11px 14px; border-radius: var(--seeg-radius-sm); cursor: pointer; font-size: 14.5px; }
.cmdk-item.active { background: var(--seeg-surface-alt); }

/* ============================================================
   ANIMAÇÕES DE ENTRADA
   ============================================================ */
.fade-up { animation: fadeUp .5s var(--seeg-ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ============================================================
   TELAS DE AUTENTICAÇÃO (login / aguardando / negado)
   ============================================================ */
.auth-body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--seeg-blue-900);
  background-image:
    radial-gradient(60vmax 60vmax at 15% 10%, rgba(13,70,140,.55), transparent 60%),
    radial-gradient(50vmax 50vmax at 85% 85%, rgba(246,163,25,.20), transparent 60%),
    linear-gradient(160deg, var(--seeg-navy), var(--seeg-blue-900));
  color: #fff; }
.auth-card { background: var(--seeg-glass-bg); color: var(--seeg-text); width: 372px; max-width: 90vw;
  border: 1px solid var(--seeg-glass-border); border-radius: var(--seeg-radius-lg); box-shadow: var(--seeg-shadow-lg);
  padding: 38px 34px; text-align: center; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  animation: popIn .5s var(--seeg-ease-out) both; }
[data-theme="dark"] .auth-card { color: #EAF1FB; }
.auth-logo { width: 58px; height: 58px; margin-bottom: 14px; animation: fadeUp .6s var(--seeg-ease-out) both; }
.auth-title { font-size: 23px; margin: 0 0 4px; }
.auth-sub { color: var(--seeg-text-muted); margin: 0 0 24px; font-size: 14px; }
[data-theme="dark"] .auth-card .auth-sub { color: #9DB4DA; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 16px;
  border-radius: var(--seeg-radius-sm); font-weight: 600; background: #fff; color: #3C3C3B; border: 1px solid var(--seeg-gray-300);
  text-decoration: none; transition: box-shadow var(--seeg-dur) var(--seeg-ease), transform var(--seeg-dur) var(--seeg-ease); }
.btn-google:hover { box-shadow: 0 6px 18px rgba(0,0,0,.18); transform: translateY(-1px); }
.btn-google svg { width: 18px; height: 18px; }
.auth-hint { margin-top: 16px; font-size: 12px; color: var(--seeg-text-muted); }
.auth-erro { margin-top: 14px; color: var(--seeg-danger); font-size: 13px; }
.auth-body footer { color: rgba(255,255,255,.6); }

/* ============================================================
   MAPA (Leaflet)
   ============================================================ */
.map-wrap { position: relative; }
#map { height: calc(100vh - 210px); min-height: 460px; border-radius: var(--seeg-radius-md);
  border: 1px solid var(--seeg-border); z-index: 0; box-shadow: var(--seeg-shadow-sm); }
.leaflet-container { background: var(--seeg-surface-alt); font-family: "Inter", sans-serif; }
.leaflet-popup-content-wrapper { background: var(--seeg-surface); color: var(--seeg-text);
  border: 1px solid var(--seeg-border); border-radius: var(--seeg-radius-md); box-shadow: var(--seeg-shadow-lg); }
.leaflet-popup-tip { background: var(--seeg-surface); border: 1px solid var(--seeg-border); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.45; }
.leaflet-popup-content .popup-title { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.leaflet-popup-content .popup-row { display: flex; align-items: center; gap: 6px; }
.leaflet-popup-close-button { color: var(--seeg-text-muted) !important; }
.pdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.leaflet-bar a, .leaflet-control-zoom a { background: var(--seeg-surface); color: var(--seeg-text); border-color: var(--seeg-border); }
.leaflet-bar a:hover { background: var(--seeg-surface-alt); color: var(--seeg-text); }
.leaflet-control-attribution { background: var(--seeg-glass-bg) !important; color: var(--seeg-text-muted) !important; }
.leaflet-control-attribution a { color: var(--seeg-link) !important; }

.map-legend { position: absolute; top: 12px; right: 12px; z-index: 500; background: var(--seeg-glass-bg);
  border: 1px solid var(--seeg-glass-border); border-radius: var(--seeg-radius-md); box-shadow: var(--seeg-shadow-md);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); min-width: 172px; overflow: hidden; }
.map-legend .legend-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--seeg-text); }
.map-legend .legend-head .ic { transition: transform var(--seeg-dur) var(--seeg-ease); }
.map-legend.collapsed .legend-head .ic { transform: rotate(-90deg); }
.map-legend .legend-body { padding: 2px 12px 12px; display: grid; gap: 8px; font-size: 12.5px; color: var(--seeg-text-muted); }
.map-legend.collapsed .legend-body { display: none; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-row .pdot { width: 11px; height: 11px; }

.map-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  z-index: 480; background: rgba(7,18,46,.30); border-radius: var(--seeg-radius-md); color: #fff; font-size: 14px; font-weight: 500; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }

/* marcador de OS ativa (pulsante) */
.os-marker { background: none; border: 0; }
.os-pulse { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--seeg-orange);
  border: 2px solid var(--seeg-navy); box-shadow: 0 0 0 0 rgba(246,163,25,.6); animation: ospulse 1.8s var(--seeg-ease) infinite; }
@keyframes ospulse { 0% { box-shadow: 0 0 0 0 rgba(246,163,25,.55); } 70% { box-shadow: 0 0 0 14px rgba(246,163,25,0); } 100% { box-shadow: 0 0 0 0 rgba(246,163,25,0); } }

/* ============================================================
   USUÁRIOS (gestão de acesso — form de adicionar + seleção/toolbar)
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.user-add-card { margin-bottom: 4px; }
.user-add-form { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(160px, 2fr) 170px auto;
  gap: 10px; align-items: center; }

.users-toolbar { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; flex-wrap: wrap; }
.users-toolbar .toolbar-info { margin-left: auto; font-size: 13px; }

.btn-danger { color: var(--seeg-danger); border-color: rgba(214,69,59,.45); }
.btn-danger:hover { background: #FBE6E4; border-color: var(--seeg-danger); }
[data-theme="dark"] .btn-danger:hover { background: rgba(214,69,59,.18); }

.sel-cell { width: 36px; text-align: center; }
.sel-radio { accent-color: var(--seeg-orange); width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }
.sel-radio:disabled { cursor: not-allowed; opacity: .35; }

.inp-role { width: auto; min-width: 140px; padding: 6px 10px; font-size: 13px; }
td [data-role-form] { margin: 0; }

@media (max-width: 760px) {
  .user-add-form { grid-template-columns: 1fr; }
  .users-toolbar .toolbar-info { margin-left: 0; width: 100%; }
}

/* ============================================================
   DRAWER OVERLAY (mobile)
   ============================================================ */
.drawer-overlay { position: fixed; inset: 0; background: rgba(7,18,46,.5); z-index: 55; opacity: 0; pointer-events: none;
  transition: opacity var(--seeg-dur) var(--seeg-ease); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); width: var(--seeg-sidebar-w) !important; box-shadow: none; }
  body.drawer-open .sidebar { transform: none; box-shadow: var(--seeg-shadow-lg); }
  body.drawer-open .drawer-overlay { opacity: 1; pointer-events: auto; }
  .content { margin-left: 0 !important; }
  body[data-collapsed="1"] .side-label, body[data-collapsed="1"] .rail-ver { opacity: 1; width: auto; }
  body[data-collapsed="1"] .sidebar .brand { display: flex; }
  body[data-collapsed="1"] .sidebar .brand-row { justify-content: space-between; padding: 0 10px 0 14px; }
  body[data-collapsed="1"] .side-link, body[data-collapsed="1"] .rail-link { justify-content: flex-start; padding: 10px 12px; }
  .only-mobile { display: inline-flex; }
  .only-desktop { display: none; }
  .menu-fab { display: inline-flex; align-items: center; justify-content: center;
    position: fixed; top: 10px; left: 10px; z-index: 50; width: 42px; height: 42px;
    border-radius: var(--seeg-radius-sm); background: var(--seeg-surface);
    border: 1px solid var(--seeg-border); color: var(--seeg-text); box-shadow: var(--seeg-shadow-sm); }
  .content > main { padding: 58px 16px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .bento .b-4, .bento .b-6, .bento .b-8 { grid-column: span 12; }
  .dash-toolbar .toolbar-end { margin-left: 0; width: 100%; justify-content: space-between; }
  .heatmap { grid-template-columns: 28px repeat(24, 1fr); gap: 2px; }
  .heatmap .hm-cell { border-radius: 2px; }
}

/* ============================================================
   PREFERÊNCIA DE MOVIMENTO REDUZIDO
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
