/* ==========================================================================
   SlimNOC2 — Base + App shell
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { display: block; }

/* ==========================================================================
   Acessibilidade — foco de teclado visível
   SLIMNOC_A11Y_FOCUS_V1
   Antes só o campo de busca tinha indicador de foco; botões, itens de
   menu, abas e links da sidebar não mostravam onde o teclado estava.
   ========================================================================== */

:where(a, button, [role="button"], [role="tab"], [role="menuitem"], [tabindex]):focus-visible,
:where(input, select, textarea):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ==========================================================================
   Preferências do sistema — HIG › Accessibility / Materials
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .modal-backdrop { backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root {
    --border: #4a4f5c;
    --border-soft: #3a3e49;
    --border-strong: #5b616f;
    --text-muted: #c4c7ce;
    --text-dim: #a9adb6;
  }
  [data-theme="light"] {
    --border: #b6c3d6;
    --border-soft: #cbd6e4;
    --border-strong: #8fa1ba;
    --text-muted: #3d4c63;
    --text-dim: #4b5a72;
  }
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ==========================================================================
   Layout
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  /* SLIMNOC_DVH_V1 — em navegador móvel a barra de endereço muda a altura
     visível; 100vh cortava o rodapé. 100dvh acompanha a área visível. */
  height: 100dvh;
  grid-template-rows: 100dvh;
  transition: grid-template-columns var(--transition);
}

.app.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  /*
   * SLIMNOC_V2_MOBILE_MAIN_GRID_FIX_V1
   * Trava o .main sempre na 2ª coluna do grid, sem depender de
   * auto-placement — evita que ele seja jogado na coluna errada (e
   * colapse pra largura 0) sempre que o .sidebar sai do fluxo normal
   * do grid (ex: position:fixed no modo "gaveta" do celular) ou quando
   * só existe UMA coluna explícita definida (ex: .app.is-collapsed
   * antes desse fix). Seguro em qualquer largura/estado.
   */
  grid-column: 2;
}

.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 26px 16px;
  /* SLIMNOC_SAFE_AREA_V1 — respeita notch / barra inferior em modo PWA */
  padding-top: max(22px, env(safe-area-inset-top));
  padding-right: max(26px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-left: max(26px, env(safe-area-inset-left));
  scroll-padding-top: 12px;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
  cursor: pointer;
  user-select: none;
}

.brand__logo {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #ffffff;
}

/* Logo da EMPRESA no topo da sidebar (editável em Preferências).
   Sobrepõe o chip azul da marca fixa — se a imagem falhar, a inicial da
   empresa aparece no lugar. */
.sidebar .brand__logo--company,
[data-theme="light"] .sidebar .brand__logo--company {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface-3);
  border-color: var(--border);
}
.brand__logo--company img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Ícone FIXO do SlimNOC (quando a empresa ainda não tem logo). O próprio
   ícone já traz o quadrado arredondado — o chip fica sem fundo/borda. */
.sidebar .brand__logo--app,
[data-theme="light"] .sidebar .brand__logo--app {
  background: transparent;
  border-color: transparent;
}
.brand__logo--app img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand__logo-fallback {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-soft);
}

.brand__text { min-width: 0; overflow: hidden; }

.brand__title {
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.15;
  white-space: nowrap;
}
.brand__title span { color: var(--primary-text); }

.brand__sub {
  /* SLIMNOC_A11Y_TYPE_V1 — era 9,5px (abaixo do mínimo de 11px) e ficava
     cortado à direita; agora quebra em duas linhas dentro da sidebar. */
  font-size: 10.5px;
  line-height: 1.2;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: normal;
  font-weight: 600;
}

.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 12px 10px;
}

.nav__label {
  /* SLIMNOC_A11Y_TYPE_V1 — 10,5px → 11px (mínimo recomendado) */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 8px 10px;
  white-space: nowrap;
}

.nav__item { margin-bottom: 2px; }

.nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background var(--transition), color var(--transition);
}

.nav__link:hover { background: var(--bg-surface-2); color: var(--text); }

.nav__link.is-active {
  background: var(--primary-soft);
  color: var(--info-text);
  font-weight: 500;
}

.nav__link .icon { flex: none; width: 18px; height: 18px; opacity: 0.9; }
.nav__link span { flex: 1; white-space: nowrap; overflow: hidden; }

.nav__caret {
  flex: none;
  width: 14px;
  height: 14px;
  opacity: 0.6;
  transition: transform var(--transition);
}
.nav__item.is-open > .nav__link .nav__caret { transform: rotate(90deg); }

.nav__sub {
  display: none;
  margin: 2px 0 6px 0;
  padding-left: 27px;
  position: relative;
}
.nav__item.is-open > .nav__sub { display: block; }

.nav__sub::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--border);
}

.nav__sublink {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 14.5px;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  transition: background var(--transition), color var(--transition);
}
.nav__sublink:hover { color: var(--text); background: var(--bg-surface-2); }

.nav__sublink.is-active {
  background: var(--primary-soft);
  color: var(--info-text);
  font-weight: 500;
}
.nav__sublink.is-active::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--primary);
}

/* Plan card */
.plan {
  flex: none;
  margin: 10px 14px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}
.plan__name { font-size: 14px; font-weight: 700; letter-spacing: 0.3px; }
.plan__row {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 5px;
  white-space: nowrap;
}
.plan__row b { color: var(--text-soft); font-weight: 600; }
.plan__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.plan__track {
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: var(--bg-surface-3);
  overflow: hidden;
}
.plan__fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #f5a623, #ef4444);
}
.plan__pct { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.sidebar__version {
  flex: none;
  padding: 4px 20px 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Collapsed sidebar */
.app.is-collapsed .brand { padding: 0 18px; }
.app.is-collapsed .brand__text,
.app.is-collapsed .nav__label,
.app.is-collapsed .nav__link span,
.app.is-collapsed .nav__caret,
.app.is-collapsed .nav__sub,
.app.is-collapsed .plan,
.app.is-collapsed .sidebar__version { display: none; }
.app.is-collapsed .nav__link { justify-content: center; padding: 11px 0; }

/* ==========================================================================
   Topbar
   ========================================================================== */

.topbar {
  flex: none;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  padding: 0 max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
}

.topbar__toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.topbar__toggle:hover { background: var(--bg-surface-2); color: var(--text); }

.search {
  position: relative;
  width: min(440px, 40vw);
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}
.search input::placeholder { color: var(--text-dim); }
.search input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.search__icon {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.topbar__spacer { flex: 1; }

.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: var(--transition);
}
.company:hover { border-color: var(--border-strong); }
.company__icon { color: var(--text-muted); }
.company__label { font-size: 11.5px; color: var(--text-muted); line-height: 1.2; }
.company__name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.company__caret { color: var(--text-muted); }
/* SLIMNOC_HIG_COMPANY_BOX_V1 — "SLIM WEB SOLUTIONS" quebrava em duas
   linhas e o conteúdo (14px + 36px = 50px) estourava o box de 44px,
   empurrando o rótulo "Empresa:" para fora da caixa. Agora é uma linha
   com reticências. */
.company > div { min-width: 0; }
.company__label { white-space: nowrap; }
.company__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover { background: var(--bg-surface-2); color: var(--text); }

.badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-topbar);
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 4px;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition);
}
.user:hover { background: var(--bg-surface-2); }
.user__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-surface-3);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.user__name { font-size: 14px; font-weight: 600; line-height: 1.25; }
.user__status {
  font-size: 12px;
  color: var(--success-text);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  flex: none;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  padding: 0 26px;
  padding: 0 max(26px, env(safe-area-inset-right)) 0 max(26px, env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  background: var(--bg-topbar);
  font-size: 14px;
  color: var(--text-muted);
}
.footer__left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

/* SLIMNOC_BRAND_MARK_V1 — marca FIXA do SlimNOC (o ícone da empresa fica
   no topo da sidebar; aqui é a identidade do produto). */
/* SLIMNOC_FOOTER_BRAND_V1 — marca do sistema COM o slogan no rodapé.
   Versão monocromática (azul) para funcionar nos temas claro e escuro. */
.footer__logo {
  height: 30px;
  width: auto;
  display: block;
  flex: none;
  margin-right: 4px;
}
@media (max-width: 900px) {
  .footer__logo { height: 24px; }
}
.footer__copy { color: var(--text-dim); }
.footer__left b { color: var(--primary-text); font-weight: 600; }
.footer__right { display: flex; gap: 16px; }
.footer__right span b { color: var(--text-soft); font-weight: 500; }
.footer__sep { color: var(--border-strong); }

/* ==========================================================================
   Page header
   ========================================================================== */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-title { font-size: 28.5px; font-weight: 700; letter-spacing: -0.3px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-size: 14px;
  color: var(--text-muted);
}
.breadcrumb .sep { color: var(--text-dim); }
.breadcrumb .current { color: var(--text-soft); }
.page-head__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn:hover { background: var(--bg-surface-2); color: var(--text); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }

/* SLIMNOC_A11Y_PRIMARY_SOLID_V1 — o branco sobre #2f7cf6 dava 3,94:1.
   O tom sólido dá 5,52:1 (hover 5,31:1), mantendo o azul de marca. */
.btn--primary {
  background: var(--primary-solid);
  border-color: var(--primary-solid);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(47, 124, 246, 0.28);
}
.btn--primary:hover { background: var(--primary-solid-hover); border-color: var(--primary-solid-hover); color: #fff; }

.btn--ghost { background: transparent; }
.btn--sm { height: 32px; padding: 0 11px; font-size: 14px; border-radius: 7px; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--danger { color: var(--danger-text); }
.btn--danger:hover { background: var(--danger-soft); border-color: rgba(239,68,68,.4); color: var(--danger-text); }

/* ==========================================================================
   Card
   ========================================================================== */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.card__title { font-size: 16px; font-weight: 600; }
.card__body { padding: 16px; }

/* ==========================================================================
   Badges / chips
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
/* SLIMNOC_A11Y_STATUS_TEXT_V1 — cores de texto de status agora vêm de
   tokens por tema (contraste AA em escuro e claro), em vez de valores
   fixos pensados só para o tema escuro. */
.badge--online { background: var(--success-soft); color: var(--success-text); border-color: rgba(34,197,94,.25); }
.badge--alert  { background: var(--warning-soft); color: var(--warning-text); border-color: rgba(245,166,35,.28); }
.badge--offline{ background: var(--danger-soft);  color: var(--danger-text); border-color: rgba(239,68,68,.28); }
.badge--warning{ background: var(--warning-soft); color: var(--warning-text); border-color: rgba(245,166,35,.28); }
.badge--info   { background: var(--primary-soft); color: var(--info-text); border-color: rgba(47,124,246,.28); }
.badge--muted  { background: var(--bg-surface-2); color: var(--text-muted); border-color: var(--border); }
.badge--desligado { background: var(--warning-soft); color: var(--warning-text); border-color: rgba(245,166,35,.30); }
/* SLIMNOC_PROVISION_ONU_PENDING_STATUS_V1 */
.badge--provisionando { background: var(--primary-soft); color: var(--info-text); border-color: rgba(47,124,246,.28); }

/* SLIMNOC_ONU_BREAK_DATE_V1 — empilha "Rompimento" em cima e a data/hora da queda abaixo */
.badge:has(.onu-break-date) {
  height: auto;
  min-height: 22px;
  white-space: normal;
  align-items: flex-start;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
  padding: 3px 9px;
}
.badge .onu-break-date {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 1px;
}

/* ==========================================================================
   Dropdown
   ========================================================================== */

.dropdown { position: relative; }
.dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  display: none;
}
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}
.dropdown__item:hover { background: var(--bg-surface-3); color: var(--text); }
.dropdown__sep { height: 1px; margin: 5px 4px; background: var(--border); }

/* ==========================================================================
   Toast
   ========================================================================== */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 62px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  padding: 12px 15px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14.5px;
  animation: toast-in 220ms ease;
}
.toast--success { border-left-color: var(--success); }
.toast--warn { border-left-color: var(--warning); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.ml-auto { margin-left: auto; }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-danger { color: var(--danger-text); }

/* ==========================================================================
   Responsivo — celular / tablet estreito
   SLIMNOC_V2_MOBILE_LAYOUT_V1
   ========================================================================== */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 18, 0.6);
  z-index: 90;
}

@media (max-width: 900px) {
  /* sem essa coluna reservada, o conteúdo fica espremido do lado do
     sidebar mesmo com ele escondido — no celular o sidebar vira um
     "drawer" que flutua por cima, não divide a tela. */
  .app,
  .app.is-collapsed {
    grid-template-columns: 0 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }
  .app.is-mobile-nav-open .sidebar { transform: translateX(0); }
  .app.is-mobile-nav-open .sidebar-backdrop { display: block; }

  .topbar {
    padding: 0 14px;
    padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
    gap: 10px;
  }
  .topbar .search { display: none; }
  .company { display: none; }

  .content {
    padding: 16px 14px 12px;
    padding: 16px max(14px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  /* SLIMNOC_A11Y_TOUCH_V1 — alvos de toque ≥44px no celular */
  .icon-btn,
  .topbar__toggle,
  .user { min-width: 44px; min-height: 44px; }
  .nav__link { min-height: 44px; padding-top: 11px; padding-bottom: 11px; }
  .nav__sublink { min-height: 40px; padding-top: 9px; padding-bottom: 9px; }
  .dropdown__item { min-height: 44px; }
  .tab { padding-top: 12px; padding-bottom: 11px; }

  .footer {
    height: auto;
    min-height: var(--footer-h);
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 4px 14px;
  }
  .footer__left { flex: 1 1 100%; text-align: left; }
}

@media (max-width: 560px) {
  .page-title { font-size: 23px; }
  .page-head { gap: 10px; margin-bottom: 16px; }

  .kpi-grid { gap: 10px; }
  .kpi { padding: 13px; gap: 10px; }
  .kpi__icon { width: 40px; height: 40px; }
  .kpi__value { font-size: 24px; }

  .details__foot { flex-wrap: wrap; }
  .details__foot .btn,
  .details__foot .btn--primary,
  .details__foot .dropdown { flex: 1 1 100%; }

  .toolbar > .btn,
  .toolbar > select.btn,
  .toolbar > .search { flex: 1 1 auto; }
}




/* ==========================================================================
   SLIMNOC_MENU_SLIMISP_V1
   Menu lateral no estilo Slim ISP, com paleta POR TEMA:
   - Tema ESCURO (:root/data-theme=dark): sidebar azul-escura (#0d1420),
     itens em branco/cinza-claro, ativo azul claro.
   - Tema CLARO ([data-theme=light]): sidebar azul vivo (#0067d5),
     itens em branco.
   ========================================================================== */

/* ---------- TEMA ESCURO (padrão) ----------
   SLIMNOC_THEME_DARK_SLIMISP_V1 — sidebar um tom ACIMA do fundo
   (oklch(24.5% 0 0/.94) = #202020 sobre o fundo #161616), texto claro e
   item ativo no azul de marca (tokens --sidebar / --sidebar-foreground /
   --sidebar-accent / --sidebar-primary do SLIM ISP). */
.sidebar {
  background: #202020;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar .brand { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.sidebar .brand__title { color: #eeeeee; }
.sidebar .brand__title span { color: #58b0ff; }
.sidebar .brand__sub { color: #a4a4a4; }

/* Tons do tema escuro do SLIM ISP (--sidebar-foreground / --muted-foreground
   / --sidebar-accent / --sidebar-primary). Contrastes sobre #202020:
   muted 7,0:1 · links 9,6:1 · sublink ativo 6,5:1 · ativo branco 4,57:1. */
.sidebar .nav__label { color: #a4a4a4; }
.sidebar .nav__link { color: #c9c9c9; }
.sidebar .nav__link:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.sidebar .nav__link.is-active {
  background: #0075dd;
  color: #ffffff;
  font-weight: 600;
}
.sidebar .nav__sublink { color: #a4a4a4; }
.sidebar .nav__sublink:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.sidebar .nav__sublink.is-active {
  background: rgba(0, 117, 221, 0.2);
  color: #58b0ff;
  font-weight: 600;
}
.sidebar .sidebar__version { color: #a4a4a4; }

/* SLIMNOC_SIDEBAR_SIGNATURE_V1 — assinatura do sistema no rodapé da
   sidebar (marca + slogan), como no SLIM ISP. Versão monocromática azul,
   que lê bem na sidebar escura e na clara. */
.sidebar__brand {
  flex: none;
  display: flex;
  justify-content: center;
  padding: 8px 14px 0;
}
.sidebar__brand img {
  height: 30px;
  width: auto;
  display: block;
}
.app.is-collapsed .sidebar__brand { display: none; }

/* SLIMNOC_SIDEBAR_ICON_COLOR_V1 — ícones da navegação em azul de marca,
   como no SLIM ISP (lá os ícones são oklch(.56 .19 250), não cinza).
   No item ativo o ícone volta a herdar (branco) para não perder destaque;
   o caret de expandir continua monocromático. */
.sidebar .nav__link .icon:not(.nav__caret) { color: var(--primary-text); }
.sidebar .nav__link.is-active .icon:not(.nav__caret) { color: inherit; }
/* ---------- TEMA CLARO ----------
   SLIMNOC_THEME_LIGHT_SLIMISP_V1 — igual ao SLIM ISP no ar: sidebar CLARA
   (oklch(93% 0 0/.94) = #e8e8e8) com texto escuro e o item ativo em azul
   de marca com texto branco (--sidebar / --sidebar-foreground /
   --sidebar-accent / --sidebar-primary do SLIM ISP). */
[data-theme="light"] .sidebar {
  background: #e8e8e8;
  border-right: 1px solid rgba(0, 0, 0, 0.10);
}
[data-theme="light"] .sidebar .brand { border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
[data-theme="light"] .sidebar .brand__logo {
  background: #0067d5;
  border-color: #0067d5;
  color: #ffffff;
}
[data-theme="light"] .sidebar .brand__title { color: #1b1b1b; }
[data-theme="light"] .sidebar .brand__title span { color: #0067d5; }
[data-theme="light"] .sidebar .brand__sub { color: #636363; }

/* Tons calibrados para ≥4,5:1 sobre #e8e8e8
   (muted 4,90 / links 10,3 / rótulos de seção 4,90 / ativo branco 5,38). */
[data-theme="light"] .sidebar .nav__label { color: #636363; }
[data-theme="light"] .sidebar .nav__link { color: #333333; }
[data-theme="light"] .sidebar .nav__link:hover { background: rgba(0, 0, 0, 0.06); color: #1b1b1b; }
[data-theme="light"] .sidebar .nav__link.is-active {
  background: #0067d5;
  color: #ffffff;
  font-weight: 600;
}
[data-theme="light"] .sidebar .nav__sublink { color: #4a4a4a; }
[data-theme="light"] .sidebar .nav__sublink:hover { background: rgba(0, 0, 0, 0.06); color: #1b1b1b; }
[data-theme="light"] .sidebar .nav__sublink.is-active {
  background: rgba(0, 103, 213, 0.12);
  color: #0059bb;
  font-weight: 600;
}
[data-theme="light"] .sidebar .nav__sublink.is-active::before { background: #0067d5; }
[data-theme="light"] .sidebar .sidebar__version { color: #636363; }

/* ==========================================================================
   SLIMNOC_RADII_CONCENTRIC_V1
   Substitui os "pills" (999px) com !important por raios concêntricos.
   HIG › Buttons / Toolbars: controles usam raios concêntricos entre si e
   com os cartões e barras. Campos em pílula fazem valores longos parecerem
   cortados e quebram a concentricidade com o restante da UI.
   Os .btn/.btn--sm já definiam 9px/7px; removido o !important para o tema
   poder ajustar.
   ========================================================================== */
.btn { border-radius: 9px; }
.btn--sm { border-radius: 7px; }
.btn--icon { border-radius: 9px; }
.btn--icon.btn--sm { border-radius: 7px; }

.field input,
.field select,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
select {
  border-radius: 9px;
}
textarea { border-radius: var(--radius); }


/* SLIMNOC_READONLY_BADGE_V1 — aviso de perfil somente leitura */
/* ==========================================================================
   SLIMNOC_LIGHT_THEME_CONTRAST_V1
   Componentes do shell com azul-claro fixo (pensado para o tema escuro)
   ficavam com contraste baixo no tema claro. Reaponta para o token AA.
   ========================================================================== */
[data-theme="light"] .tab.is-active { color: var(--info-text); }
[data-theme="light"] .widget-card__icon { color: var(--info-text); }

#readOnlyBadge {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: var(--warning-text);
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
}
