/* DETCREDE — dashboard
 * Tokens de cor em :root (tema escuro por padrão do SO ou escolhido).
 * Regra visual (T-404): uma variável por significado — ícone = classe do
 * equipamento, opacidade/traço = estado, vermelho = risco (a única cor forte).
 */

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --header-h: 56px;

  /* tema claro */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e6e9ee;
  --border: #dde1e7;
  --border-strong: #c5cbd4;
  --text: #16191f;
  --text-2: #4a525e;
  --text-3: #6b7380;
  --accent: #2f6fed;
  --accent-hover: #255ed0;
  --accent-soft: #e8f0fe;
  --on-accent: #ffffff;
  --bar: #2f6fed;
  --bar-text: #ffffff;
  --bar-hover: rgba(255, 255, 255, .16);
  --link: #3aa757;
  --port-access: #bfe9dd;
  --port-access-text: #146c5a;
  --port-trunk: #fbd3ad;
  --port-trunk-text: #8a4b0f;
  --port-other: #e3e6ea;
  --card: #ffffff;
  --card-border: #e2e6eb;
  --risk: #c62828;
  --risk-soft: #fdecec;
  --risk-border: #f0b8b8;
  --warn: #9a5b00;
  --warn-soft: #fff3dc;
  --ok: #1e7a45;
  --ok-soft: #e4f4ea;
  --canvas: #eef1f5;
  --edge: #8a93a0;
  --edge-inferred: #a3abb6;
  --group-bg: rgba(255, 255, 255, .55);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --focus: 0 0 0 3px rgba(47, 111, 237, .35);
  --sidebar: #fafbfc;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #161a21;
  --surface-2: #1c212a;
  --surface-3: #252b35;
  --border: #2a303a;
  --border-strong: #3a424f;
  --text: #e8eaee;
  --text-2: #b3bac5;
  --text-3: #8b94a1;
  --accent: #5b9bf0;
  --accent-hover: #7aaef4;
  --accent-soft: #1b2a42;
  --on-accent: #0b1220;
  --risk: #ff6b6b;
  --risk-soft: #3a1a1c;
  --risk-border: #6b2a2d;
  --warn: #f0b458;
  --warn-soft: #33270f;
  --ok: #5fcf8e;
  --ok-soft: #13301f;
  --canvas: #12161c;
  --edge: #7a8391;
  --edge-inferred: #5d6573;
  --group-bg: #181d25;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(91, 155, 240, .45);
  --sidebar: #13171d;
  --bar: #1a2a4a;
  --bar-text: #e8eaee;
  --bar-hover: rgba(255, 255, 255, .1);
  --link: #4fbf6c;
  --port-access: #1d4a40;
  --port-access-text: #9be3cf;
  --port-trunk: #53391d;
  --port-trunk-text: #f7c692;
  --port-other: #2a303a;
  --card: #1c212a;
  --card-border: #2f3642;
  color-scheme: dark;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
[hidden] { display: none !important; }

.icon { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 2; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.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;
}

/* ─── Botões e campos ───────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .tab:focus-visible,
.icon-btn:focus-visible, .row-link:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--risk); border-color: var(--risk-border); }
.btn-danger:hover:not(:disabled) { background: var(--risk-soft); border-color: var(--risk); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn-sm { width: 30px; height: 30px; }

.input, .select, textarea.input {
  height: 34px; padding: 0 10px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input::placeholder { color: var(--text-3); }
.select { padding-right: 28px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field-label { font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }

.search-box { position: relative; display: flex; align-items: center; }
.search-box .icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.search-box .input { padding-left: 32px; width: 100%; }

/* ─── Selos ─────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.risk { background: var(--risk-soft); color: var(--risk); border-color: var(--risk-border); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--text-3); }
.dot.online { background: var(--ok); }
.dot.offline { background: transparent; border: 1.5px solid var(--text-3); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }

/* ─── Login ─────────────────────────────────────────────────────────── */

.login-view {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; padding: 28px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 18px;
}
.login-card .brand { margin-bottom: 4px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.form-error {
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--risk-soft); color: var(--risk); border: 1px solid var(--risk-border);
  font-size: 13px;
}

/* ─── Cabeçalho ─────────────────────────────────────────────────────── */

.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.app-header {
  flex-shrink: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px 0 10px;
  background: var(--bar); color: var(--bar-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .02em; font-size: 15px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
}
.app-header .brand-mark { background: rgba(255, 255, 255, .18); color: var(--bar-text); }
.brand-mark .icon { width: 17px; height: 17px; }

.icon-btn.on-bar { background: transparent; border-color: transparent; color: var(--bar-text); }
.icon-btn.on-bar:hover { background: var(--bar-hover); color: var(--bar-text); }
.btn-on-bar { background: rgba(255, 255, 255, .95); border-color: transparent; color: #1b3f8f; }
.btn-on-bar:hover:not(:disabled) { background: #fff; border-color: transparent; }
:root[data-theme="dark"] .btn-on-bar { background: var(--accent); color: var(--on-accent); }

.site-picker {
  display: flex; align-items: center; gap: 6px; margin-left: 10px;
  padding: 0 4px 0 10px; height: 34px; border-radius: var(--radius-sm); background: var(--bar-hover);
}
.site-picker .select {
  max-width: 240px; height: 32px; font-weight: 600; border: 0; background: transparent; color: var(--bar-text);
}
.site-picker .select option { color: var(--text); background: var(--surface); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ws-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--bar-text); opacity: .9; padding: 0 4px; }
.ws-dot .dot { background: rgba(255, 255, 255, .6); }
.ws-dot.connected .dot { background: #7ee29a; }
.ws-dot.connecting .dot { background: #ffd27a; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px 0 4px;
  border: 0; border-radius: 999px; background: var(--bar-hover); color: var(--bar-text); cursor: pointer;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--bar); font-weight: 800; font-size: 12px;
}
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 40;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--surface-2); }

/* ─── Menu lateral ──────────────────────────────────────────────────── */

.shell { flex: 1; min-height: 0; display: flex; }
.sidenav {
  width: 252px; flex-shrink: 0; overflow-y: auto; overflow-x: hidden; padding: 10px 8px;
  background: var(--sidebar, var(--surface)); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidenav:hover {
  scrollbar-color: var(--border) transparent;
}
.sidenav::-webkit-scrollbar {
  width: 4px;
}
.sidenav::-webkit-scrollbar-track {
  background: transparent;
}
.sidenav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}
.sidenav:hover::-webkit-scrollbar-thumb {
  background: var(--border);
}
.sidenav::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* Seções recolhíveis (padrão "sidebar group" moderno). */
.nav-section { display: flex; flex-direction: column; margin-bottom: 2px; }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-section.closed .nav-items { display: none; }
.nav-group {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  height: 28px; padding: 0 8px; margin-top: 6px; border: 0; border-radius: var(--radius-sm);
  background: none; cursor: pointer; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3);
  transition: color .15s, background .15s;
}
.nav-section:first-child .nav-group { margin-top: 0; }
.nav-group:hover { color: var(--text); background: var(--surface-2); }
.nav-group:focus-visible { outline: none; box-shadow: var(--focus); }
.nav-caret { transition: transform .15s; width: 14px; height: 14px; opacity: 0.6; }
.nav-section.closed .nav-caret { transform: rotate(-90deg); }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--text-2); font-weight: 500; font-size: 13.5px; text-align: left;
  transition: all .15s ease;
}
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.nav-sub-toggle { margin-left: auto; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; color: var(--text-3); }
.nav-sub-toggle:hover { background: var(--surface-3); color: var(--text); }
.nav-sub-toggle .icon { transition: transform .15s; }
.nav-sub-toggle.closed .icon { transform: rotate(-90deg); }
.nav-sub.closed { display: none; }
.nav-item:focus-visible { outline: none; box-shadow: var(--focus); }
.nav-item .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--risk); color: #fff;
}
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 12px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav-sub:empty { display: none; }
.nav-item-sub { height: 30px; font-size: 12.5px; font-weight: 500; border-radius: 6px; }
.nav-item-sub .icon { width: 14px; height: 14px; }
.nav-item-sub span:not(.nav-num) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.nav-num { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; padding: 1px 6px; background: var(--surface-2); border-radius: 10px; }
.nav-more { color: var(--text-3); }
.inv-cat-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.inv-cat-note[hidden] { display: none; }
.shell.collapsed .nav-sub { margin: 0; padding: 0; border: 0; }
.shell.collapsed .nav-num { display: none; }
.shell.collapsed .sidenav { width: 58px; padding: 8px 4px; }
.shell.collapsed .nav-item span:not(.count), .shell.collapsed .nav-group { display: none; }
/* Celular: o menu vira gaveta por cima do conteúdo (recolhido = fechado). */
@media (max-width: 760px) {
  .shell { position: relative; }
  .sidenav { position: absolute; inset: 0 auto 0 0; z-index: 40; width: min(84vw, 300px); box-shadow: var(--shadow); }
  .shell.collapsed .sidenav { display: none; }
  .shell:not(.collapsed)::after { content: ''; position: absolute; inset: 0; z-index: 30; background: rgb(0 0 0 / 0.35); }
}
.shell.collapsed .nav-section.closed .nav-items { display: flex; }
.shell.collapsed .nav-section + .nav-section { border-top: 1px solid var(--border); padding-top: 4px; }
.shell.collapsed .nav-item { justify-content: center; padding: 0; position: relative; }
.shell.collapsed .nav-item .count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.content:has(> main > .map-view:not([hidden])) { overflow: hidden; }

/* ─── Abas (painel lateral, VLANs) ─────────────────────────────────── */

.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 12px;
  border: 0; background: none; cursor: pointer;
  color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); }
.tab[aria-selected="true"]::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px;
  background: var(--accent); border-radius: 2px 2px 0 0;
}
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.seg button {
  height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.btn[aria-pressed="true"],
.seg button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ─── Painel (dashboard) ───────────────────────────────────────────── */

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.dash-grid > .span-3 { grid-column: span 3; }
.dash-grid > .span-4 { grid-column: span 4; }
.dash-grid > .span-5 { grid-column: span 5; }
.dash-grid > .span-6 { grid-column: span 6; }
.dash-grid > .span-7 { grid-column: span 7; }
.dash-grid > .span-8 { grid-column: span 8; }
.dash-grid > .span-12 { grid-column: span 12; }
.widget { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.widget-head h3 { font-size: 14px; }
.stat-tile { padding: 16px; display: flex; gap: 14px; align-items: center; }
.stat-tile .tile-icon {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.stat-tile .tile-icon.risk { background: var(--risk-soft); color: var(--risk); }
.stat-tile .label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.stat-tile .value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-tile .value.risk { color: var(--risk); }
.stat-tile .sub { font-size: 12px; color: var(--text-3); }
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.legend-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legend-list span.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ─── Barra de varredura ────────────────────────────────────────────── */

.scan-bar {
  display: flex; align-items: center; gap: 14px; padding: 8px 16px;
  background: var(--accent-soft); border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.scan-bar .progress { flex: 1; max-width: 420px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.scan-bar .progress > span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.scan-bar .scan-text { display: flex; flex-direction: column; min-width: 0; }
.scan-bar .scan-detail { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Páginas ───────────────────────────────────────────────────────── */

main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Páginas ocupam a largura toda (antes: 1440px centralizado, com faixas vazias). */
.page { padding: 20px 28px 32px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 700; }
.page-head p { color: var(--text-2); margin-top: 3px; max-width: 760px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 16px; }
.card h3 { font-size: 15px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--text); }
.notice.risk { background: var(--risk-soft); border-color: var(--risk-border); color: var(--text); }
.notice.ok { background: var(--ok-soft); border-color: transparent; color: var(--text); }
.notice.info { background: var(--accent-soft); border-color: transparent; color: var(--text); }

/* Identificação: barra de confiança e tabelas compactas de evidência. */
.conf-bar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--border); vertical-align: middle; margin: 0 6px; overflow: hidden; }
.conf-bar > span { display: block; height: 100%; border-radius: 3px; }
.conf-bar.conf-ok > span { background: var(--ok); }
.conf-bar.conf-info > span { background: var(--accent); }
.conf-bar.conf-warn > span { background: var(--warn); }
.table.compact th, .table.compact td { padding: 6px 8px; font-size: 12.5px; vertical-align: top; }
details.section > summary { cursor: pointer; list-style: revert; }
.notice .icon { margin-top: 1px; }
.notice strong { color: var(--text); }

.empty {
  padding: 40px 20px; text-align: center; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty h3 { color: var(--text); font-size: 15px; }
.empty p { max-width: 520px; }
.empty .icon { width: 28px; height: 28px; color: var(--text-3); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 12px 14px; }
.kpi .label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.kpi .value { font-size: 22px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .value.risk { color: var(--risk); }

/* ─── Tabelas ───────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--text-3);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface); position: sticky; top: 0;
}
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th button:focus-visible { box-shadow: var(--focus); border-radius: 4px; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: var(--surface-2); }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-3); }
.type-cell { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.table-foot { padding: 10px 12px; font-size: 12.5px; color: var(--text-3); border-top: 1px solid var(--border); }

/* Tabela do cofre de credenciais sem rolagem horizontal no desktop (T-2207) */
.data-vault { width: 100%; table-layout: auto; }
.data-vault .vault-name { max-width: 220px; word-break: break-word; overflow-wrap: anywhere; }
.data-vault .vault-scope { max-width: 240px; word-break: break-all; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.35; }
.data-vault td.row-actions { width: 1%; white-space: nowrap; text-align: right; }
.data-vault td.row-actions .icon-btn { margin-left: 2px; }

/* ─── Mapa ──────────────────────────────────────────────────────────── */

.map-view { position: relative; flex: 1; min-height: 480px; display: flex; flex-direction: column; }
.map-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.map-summary { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.map-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.map-summary .risk b { color: var(--risk); }
.map-summary .collect-suggest summary { cursor: pointer; color: var(--warn, var(--text)); display: inline-flex; gap: 6px; align-items: center; }
.map-summary .collect-suggest ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.map-top .search-box { width: 280px; }
.map-top .toolbar { margin-left: auto; }

.map-body { flex: 1; min-height: 0; display: flex; }
.map-canvas-wrap { position: relative; flex: 1; min-width: 0; min-height: 0; }
#cy { position: absolute; inset: 0; background: var(--canvas); }
/* Menu de contexto por classe de equipamento (T-514 / SPEC-04) */
.node-menu {
  position: absolute; z-index: 20; min-width: 220px; max-width: 280px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.node-menu-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.node-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.node-menu-item:hover, .node-menu-item:focus-visible { background: var(--surface-2); outline: none; }
.node-menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.node-menu-item.danger { color: var(--risk); }
.node-menu-note { padding: 6px 10px; font-size: 12px; color: var(--text-2); }
/* Propriedade declarada no perfil e ainda não coletada (T-515) */
.fact.missing .fact-val { color: var(--text-2); font-style: italic; }
.facts-wrap.hide-empty .fact.missing, .facts-wrap.hide-empty .fact-group.all-missing { display: none; }
.facts-toggle { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; cursor: pointer; }
.map-dock {
  width: 580px; max-width: 48%; min-width: 380px; flex-shrink: 0; min-height: 0;
  border-left: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column;
}
.map-dock[hidden] { display: none; }
.drawer.docked {
  position: relative; inset: auto; z-index: auto; width: 100%; height: 100%;
  border-left: 0; box-shadow: none;
}

.map-cats {
  display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; order: 3; min-width: 0;
}
.map-cats[hidden] { display: none; }
.map-cat {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 10px; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.map-cat b { color: var(--text); font-size: 13px; }
.map-cat-total { color: var(--text-3); margin-left: -5px; }
.map-cat:hover { border-color: var(--accent); }
.map-cat.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.map-cat.active b, .map-cat.active .map-cat-total { color: #fff; }
.map-legend {
  position: absolute; left: 16px; bottom: 16px; z-index: 5;
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: 12px; color: var(--text-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-line { width: 26px; height: 0; border-top: 2px solid var(--link); }
.legend-pill {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px;
  border: 1px solid var(--link); color: var(--link); background: var(--surface); font-size: 11px; font-weight: 600;
}
.legend-line.dashed { border-top-style: dashed; border-top-color: var(--edge-inferred); }
.legend-line.wifi { border-top-style: dotted; border-top-width: 3px; border-top-color: var(--accent); }
.legend-risk { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--risk); background: var(--risk-soft); }

.map-empty { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; pointer-events: none; }
.map-empty .card { pointer-events: auto; max-width: 440px; }

/* ─── Painel lateral (drawer) ───────────────────────────────────────── */

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .25); z-index: 49; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(640px, 100vw); display: flex; flex-direction: column;
  max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.drawer-head { position: relative; padding: 16px 92px 12px 18px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
/* Fechar sempre no canto (com o cabeçalho quebrando linha ele caía sozinho embaixo). */
.drawer-head > [data-drawer-close] { position: absolute; top: 12px; right: 12px; }
.drawer-head > [data-drawer-wide] { position: absolute; top: 12px; right: 50px; }
/* Borda de arrastar para mudar a largura do painel */
.drawer-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 3; touch-action: none; }
.drawer-resize:hover, .drawer-resizing .drawer-resize { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
.drawer.docked .drawer-resize { left: 0; }
body.drawer-resizing { cursor: ew-resize; user-select: none; }
@media (max-width: 700px) { .drawer-resize, .drawer-head > [data-drawer-wide] { display: none; } .drawer { width: 100vw !important; } }
.drawer-head h3 { font-size: 18px; word-break: normal; overflow-wrap: anywhere; }
/* O bloco do título nunca encolhe abaixo de 260px: quando falta espaço, são os
   botões que descem para a linha de baixo (antes o título quebrava letra a letra). */
.drawer-head > div:first-child { min-width: min(260px, 100%) !important; }
.drawer-head .sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.drawer-head .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.drawer-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
/* Abas do painel lateral: quebram linha quando não cabem (drawer docked de
   500px tem 7 abas) em vez de criar scroll horizontal. */
.drawer-tabs { display: flex; flex-wrap: wrap; gap: 0 2px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.drawer-tabs .tab { height: 40px; font-size: 13px; padding: 0 9px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; display: flex; flex-direction: column; gap: 18px; }

/* Editor de notas EasyMDE (T-625): integra com os tokens de tema. */
.EasyMDEContainer .CodeMirror {
  background: var(--surface); color: var(--text); border-color: var(--border);
  border-radius: 0 0 var(--radius) var(--radius); min-height: 280px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13.5px;
}
.EasyMDEContainer .CodeMirror-cursor { border-color: var(--text); }
.EasyMDEContainer .editor-toolbar {
  background: var(--surface-2); border-color: var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.EasyMDEContainer .editor-toolbar button { color: var(--text-2) !important; }
.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active { background: var(--surface-3); border-color: var(--border); }
.EasyMDEContainer .editor-toolbar i.separator { border-color: var(--border); }
.EasyMDEContainer .CodeMirror-selected { background: var(--accent-soft) !important; }

/* Histórico de mudanças do ativo (T-310) */
.timeline { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-icon { flex: 0 0 26px; height: 26px; width: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-text { font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.timeline-text .mono { font-size: 12.5px; }
.timeline-item.change-ok .timeline-icon { background: var(--ok-soft); color: var(--ok); }
.timeline-item.change-warn .timeline-icon { background: var(--warn-soft); color: var(--warn); }
.timeline-item.change-info .timeline-icon { background: var(--accent-soft); color: var(--accent); }

.section h4 { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: minmax(92px, 150px) minmax(0, 1fr); gap: 7px 14px; font-size: 13.5px; }
/* Campo dentro do valor (ex.: técnico do chamado) não estoura o cartão: ocupa a célula e encolhe com ela. */
.kv dd .select, .kv dd .input { width: 100%; max-width: 100%; min-width: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-word; }
.not-informed { color: var(--text-3); font-style: italic; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-family: var(--font-mono);
}

/* Etiqueta da origem de um campo do equipamento (agente, SNMP, inventário externo...). */
.origin-tag { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: 11px; line-height: 18px;
  font-family: var(--font-sans, inherit); font-style: normal; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); vertical-align: 1px; }
.origin-tag.origin-manual { background: var(--accent-soft); }
.origin-tag.origin-agent, .origin-tag.origin-snmp, .origin-tag.origin-device_api { background: var(--ok-soft); }
.origin-tag.origin-inventory { background: var(--warn-soft); }
.field-others { margin-top: 2px; font-family: var(--font-sans, inherit); }

/* Automações (T-1216): passos de uma execução. */
.auto-steps { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; }
.auto-steps .pre { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px; }

.fact-group { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fact-group + .fact-group { margin-top: 10px; }
.fact-group-head { padding: 8px 12px; background: var(--surface-2); font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; }
.fact { padding: 9px 12px; border-top: 1px solid var(--border); }
.fact-key { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; gap: 8px; }
.fact-val { font-family: var(--font-mono); font-size: 12.5px; margin-top: 3px; word-break: break-word; white-space: pre-wrap; }
pre.raw {
  margin: 0; padding: 12px; max-height: 300px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word;
}
details.collapsible summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); padding: 4px 0; }

/* Painel de portas: cor = tipo (access/trunk), LED = link, contorno = selecionada */
.port-strip {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 12px;
  border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.port {
  width: 40px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0 5px; border: 1.5px solid transparent; border-radius: 6px; cursor: pointer;
  background: var(--port-other); color: var(--text-2);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
.port.access { background: var(--port-access); color: var(--port-access-text); }
.port.trunk { background: var(--port-trunk); color: var(--port-trunk-text); }
.port .jack { width: 22px; height: 16px; border-radius: 2px; background: #59626d; position: relative; }
.port .jack::after { content: ''; position: absolute; left: 6px; right: 6px; top: 0; height: 4px; background: rgba(255, 255, 255, .35); border-radius: 0 0 2px 2px; }
.port.up .jack { background: #2e3a45; box-shadow: 0 0 0 2px var(--link) inset; }
.port .poe { font-size: 8.5px; line-height: 1; opacity: .8; }
.port.selected { border-color: var(--accent); box-shadow: var(--focus); }
.port-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.port-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.port-legend .l-access::before { background: var(--port-access); }
.port-legend .l-trunk::before { background: var(--port-trunk); }
.port-legend .l-other::before { background: var(--port-other); }
.port-legend .l-up::before { background: #2e3a45; box-shadow: 0 0 0 2px var(--link) inset; }

.dev-head { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; }
.dev-head dt { color: var(--text-3); }
.dev-head dd { margin: 0; overflow-wrap: anywhere; }
.dev-art { width: 96px; height: 60px; flex-shrink: 0; background-size: contain; background-repeat: no-repeat; background-position: center; }


.member-fdb { cursor: default; background: var(--surface-2); }
.member-fdb .cell-main { color: var(--text-2); }
.member-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.member {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 9px 12px; border-top: 1px solid var(--border); cursor: pointer; background: var(--surface);
  text-align: left; border-left: 0; border-right: 0; border-bottom: 0; width: 100%;
}
.member:first-child { border-top: 0; }
.member:hover { background: var(--surface-2); }

.cred-result { padding: 10px 12px; border-radius: var(--radius); font-size: 13px; }
.cred-result.ok { background: var(--ok-soft); }
.cred-result.fail { background: var(--risk-soft); }

/* ─── Riscos / CFTV / Sites / Perfis ────────────────────────────────── */

.list { display: flex; flex-direction: column; gap: 10px; }
.alert-card { padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.alert-card.risky { border-left: 3px solid var(--risk); }
.alert-card .title { font-weight: 700; }
.alert-card .desc { color: var(--text-2); grid-column: 1 / 2; }
.alert-card .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); grid-column: 1 / 2; }
.alert-card .side { grid-row: 1 / span 3; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.alert-card.resolved { opacity: .7; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cam-card { overflow: hidden; display: flex; flex-direction: column; }
.cam-shot {
  aspect-ratio: 16 / 9; background: var(--surface-3); display: grid; place-items: center;
  color: var(--text-3); font-size: 12.5px; border: 0; padding: 0; width: 100%; cursor: zoom-in;
}
.cam-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-shot.none { cursor: default; flex-direction: column; gap: 6px; display: flex; align-items: center; justify-content: center; }
.cam-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cam-actions { display: flex; gap: 6px; margin-top: auto; }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.site-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.site-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.site-card h3 { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.site-card h3 > span:first-child { flex: 1 1 160px; min-width: 0; }
.site-card h3 > .toolbar { flex-wrap: wrap; justify-content: flex-end; }
.optin-box { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.optin-state { display: flex; gap: 8px; flex-wrap: wrap; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }

/* ─── Modais ────────────────────────────────────────────────────────── */

.modal-backdrop, .modal-overlay {
  position: fixed; inset: 0; z-index: 1050; background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  box-sizing: border-box;
}
.modal, .saas-modal {
  width: 100%; max-width: 580px; max-height: calc(100vh - 40px); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  box-sizing: border-box;
}
.modal.sm { max-width: 440px; }
.modal.md { max-width: 600px; }
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1120px; }
.modal.fullscreen { max-width: calc(100vw - 32px); height: calc(100vh - 32px); max-height: calc(100vh - 32px); }

.modal-head {
  flex-shrink: 0; padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  box-sizing: border-box; background: var(--surface);
}
.modal-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.modal-head p { color: var(--text-2); font-size: 12.5px; margin: 2px 0 0 0; line-height: 1.4; }
.modal-head .icon-btn { margin-left: auto; flex-shrink: 0; }
.modal-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
  box-sizing: border-box;
}
.modal-foot {
  flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  box-sizing: border-box; background: var(--surface);
}
.chips-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  height: 28px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-family: var(--font-mono); font-size: 12px;
}
.chip-btn:hover { border-color: var(--accent); }
.chip-btn .muted { font-family: var(--font-sans); }
.code-area { font-family: var(--font-mono); font-size: 12.5px; min-height: 240px; }

.lightbox { max-width: 1000px; }
.lightbox img { width: 100%; display: block; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.print-choice-card {
  transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.print-choice-card:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.print-choice-card:active {
  transform: scale(0.995);
}

/* ─── Toasts ────────────────────────────────────────────────────────── */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; width: 340px; max-width: calc(100vw - 32px);
  padding: 11px 13px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 13px; animation: toast-in .18s ease-out;
}
.toast.risk { border-left: 3px solid var(--risk); }
.toast.ok { border-left: 3px solid var(--ok); }
.toast .t-title { font-weight: 700; }
.toast .t-msg { color: var(--text-2); }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1100px) {
  .site-picker .select { max-width: 150px; }
  .ws-dot span:not(.dot) { display: none; }
  .map-top .search-box { width: 200px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  /* Celular: barra em duas linhas fixas — menu, marca e ações; depois site e ramo lado a lado. */
  .app-header { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; gap: 6px; padding: 6px 8px; }
  .app-header > #nav-toggle { grid-row: 1; grid-column: 1; justify-self: start; z-index: 1; }
  .app-header > .brand { grid-row: 1; grid-column: 1; padding-left: 42px; min-width: 0; }
  .app-header > .header-right { grid-row: 1; grid-column: 2; justify-self: end; gap: 2px; margin: 0; }
  .app-header > .site-picker { grid-row: 2; grid-column: 1; margin: 0; min-width: 0; height: 32px; }
  .app-header > #entity-picker { grid-column: 2; }
  .app-header > .site-picker:not(#entity-picker):has(+ #entity-picker[hidden]) { grid-column: 1 / -1; }
  .app-header .site-picker .select { max-width: none; width: 100%; min-width: 0; font-size: 12.5px; text-overflow: ellipsis; padding-left: 2px; }
  /* O ícone do seletor some no celular: o espaço vai para o nome do site/ramo (T-2203). */
  .app-header .site-picker > .icon, .app-header .site-picker > i { display: none; }
  .app-header > .site-picker { padding-left: 6px; }
  .app-header .brand-mark { display: none; }
  #btn-scan { font-size: 0; gap: 0; padding: 0 9px; }
  #btn-scan .icon { margin: 0; }
  .tabs { order: 3; width: 100%; }
  .tab { height: 40px; }
  .page { padding: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* ── Notas (Épico D / RF-34) ─────────────────────────────────────────── */
.notes-layout { display: grid; grid-template-columns: 220px minmax(240px, 320px) 1fr; gap: 12px; min-height: calc(100vh - 190px); }
.notes-books, .notes-list, .notes-editor { padding: 10px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.notes-book-row { display: flex; align-items: center; gap: 2px; }
.notes-books > .notes-book { flex: 0 0 auto; }
.notes-book { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; min-width: 0; }
.notes-book span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-book:hover, .notes-book.active { background: var(--surface-2); }
.notes-book.active { box-shadow: inset 3px 0 0 var(--accent); }
.notes-new-book { margin-top: auto; }
.notes-items { display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.notes-item { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 9px 10px; border: 1px solid transparent;
  border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  box-shadow: inset 3px 0 0 var(--border); }
.notes-item:hover { background: var(--surface-2); }
.notes-item.active { border-color: var(--accent); background: var(--surface-2); }
.notes-item.kind-warning { box-shadow: inset 3px 0 0 #d4a106; }
.notes-item.kind-danger { box-shadow: inset 3px 0 0 var(--risk); }
.notes-item.kind-success { box-shadow: inset 3px 0 0 #2e9d5b; }
.notes-snippet { font-size: 12px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notes-snippet mark { background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 2px; }
.notes-empty { padding: 12px 4px; }
.notes-active-filters { margin: 2px 0; }
.notes-title { font-size: 18px; font-weight: 600; width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent;
  color: var(--text); padding: 6px 2px; }
.notes-title:focus { outline: none; border-bottom-color: var(--accent); }
.notes-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.notes-meta label { display: flex; flex-direction: column; gap: 3px; }
.notes-meta .grow { flex: 1; min-width: 180px; }
.notes-meta select, .notes-meta input { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.notes-link { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.notes-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.notes-toolbar .grow { flex: 1; }
.btn.danger { color: var(--risk); }
.notes-conflict { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--risk-soft); color: var(--text); font-size: 13px; }
.notes-body { flex: 1; min-height: 320px; width: 100%; resize: vertical; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.notes-body:focus { outline: none; border-color: var(--accent); }
.notes-preview { flex: 1; min-height: 320px; padding: 4px 6px; overflow: auto; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; } .md h1 { font-size: 20px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; }
.md p, .md ul, .md ol, .md pre, .md table, .md blockquote { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.md pre { background: var(--surface-2); padding: 10px; border-radius: var(--radius-sm); overflow: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--border); padding-left: 10px; color: var(--text-2); }
.md table { border-collapse: collapse; } .md th, .md td { border: 1px solid var(--border); padding: 4px 8px; }
.md img { max-width: 100%; border-radius: var(--radius-sm); }
.md-fallback { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.notes-attachments h4 { display: flex; align-items: center; gap: 6px; margin: 12px 0 6px; font-size: 13px; }
.notes-att { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px solid var(--border); font-size: 13px; }
.notes-att .grow { flex: 1; }
.notes-foot { margin-top: 6px; }
.notes-version { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
@media (max-width: 1100px) { .notes-layout { grid-template-columns: 1fr; } .notes-books { flex-direction: row; flex-wrap: wrap; } }
/* Imprimir a nota como PDF: só o texto renderizado */
@media print {
  body.printing-note * { visibility: hidden; }
  body.printing-note .notes-editor .notes-title, body.printing-note #note-preview, body.printing-note #note-preview * { visibility: visible; }
  body.printing-note #note-preview { position: absolute; left: 0; top: 40px; width: 100%; }
  body.printing-note .notes-editor .notes-title { position: absolute; left: 0; top: 0; border: 0; }
}

/* Formulário de host manual (T-540) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ─── Formulários em grade (modais) ─────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .field { font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.form-grid .field.full { grid-column: 1 / -1; }
.form-grid .field.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form-grid .field[hidden] { display: none; }
.select-sm { height: 30px; font-size: 12.5px; padding-top: 0; padding-bottom: 0; }

/* ─── Administração (T-602..T-604 / T-2112 Duas Colunas) ────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: calc(100vh - 200px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-sidebar {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.admin-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-nav-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 4px 8px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
}
.admin-nav-item:hover {
  background: var(--surface);
  color: var(--text);
}
.admin-nav-item[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.admin-nav-item .icon-sm {
  flex-shrink: 0;
}
.admin-content {
  padding: 20px 24px;
  overflow-y: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-tabs { display: none; }
.admin-body { padding: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.admin-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.admin-head p { margin: 0; max-width: 820px; font-size: 13px; line-height: 1.5; }
.admin-head .btn { flex-shrink: 0; }
.admin-sub { margin: 6px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.row-actions, table.data td.actions { white-space: nowrap; text-align: right; }
.empty-inline { display: flex; gap: 12px; align-items: center; padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); }
.empty-inline p { margin: 0; font-size: 13px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.icon-pick label:has(input:focus-visible) { box-shadow: var(--focus); }

/* Compatibilidade com classes .data-table e .table-container em módulos adicionais */
.table-container { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.data-table th { padding: 9px 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--surface-2); }

@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
  }
  .admin-nav-group { flex-direction: row; flex-wrap: wrap; width: 100%; gap: 4px; }
  .admin-nav-title { width: 100%; margin-top: 4px; margin-bottom: 2px; }
  .admin-nav-item { width: auto; font-size: 12px; padding: 6px 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-head { flex-direction: column; }
}

/* ─── Painel frontal de portas (etapa 1 / A3) ─────────────────────── */
.faceplate {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px; overflow-x: auto;
  border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.fp-block { display: flex; flex-direction: column; gap: 5px; }
.fp-side { padding-left: 10px; border-left: 2px solid var(--border); }
.fp-row { display: flex; gap: 3px; }
/* Portas compactas: um switch de 24–28 portas cabe em 2 fileiras mesmo no
   painel encaixado no mapa (500px), sem precisar rolar na horizontal. */
.faceplate .port { width: 28px; flex-shrink: 0; font-size: 10px; padding: 3px 0 4px; }
.faceplate .port .jack { width: 18px; height: 13px; }
.port.sfp .jack { width: 22px; height: 10px; border-radius: 1px; background: #8a939d; }
.port.mgmt .jack { background: #b07a2a; }
.port.unread { background: var(--surface-2); color: var(--text-3); border: 1.5px dashed var(--border-strong); }
.port.unread .jack { background: #9aa3ae; opacity: .7; }
.model-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.model-pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; cursor: pointer;
  text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.model-pick:hover { border-color: var(--accent); }
.model-pick:disabled { opacity: .6; cursor: progress; }

.ports-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ports-head h4 { margin: 0; }

.cam-shot { border-radius: var(--radius); overflow: hidden; background: #0f1419; min-height: 120px; display: grid; place-items: center; }
.cam-shot img { display: block; width: 100%; height: auto; }

.stat-tile.clickable, .bar-row.clickable { cursor: pointer; }
.stat-tile.clickable:hover { border-color: var(--accent); }
.bar-row.clickable:hover .type-cell { color: var(--accent); }
.stat-tile.clickable:focus-visible, .bar-row.clickable:focus-visible { outline: none; box-shadow: var(--focus); }

.local-nets { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.local-net { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.local-net .select-sm { width: auto; }

.probe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.probe-opt { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.probe-opt > span { display: flex; flex-direction: column; gap: 1px; }
.probe-opt input { margin-top: 3px; }
@media (max-width: 760px) { .probe-grid { grid-template-columns: 1fr; } }

.local-net { flex-wrap: nowrap; }
.local-net .iface { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-net .badge { flex-shrink: 0; }

.optin-box-edit { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }

.row-off { opacity: .55; }
.switch-sm { position: relative; display: inline-block; width: 34px; height: 18px; }
.switch-sm input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-sm span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch-sm span::before { content: ''; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch-sm input:checked + span { background: var(--accent); }
.switch-sm input:checked + span::before { transform: translateX(16px); }

.admin-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.admin-foot strong { color: var(--text-2); font-variant-numeric: tabular-nums; }

.input-with-btn { display: flex; gap: 6px; }
.input-with-btn .input { flex: 1; min-width: 0; }
.input-with-btn .btn { flex-shrink: 0; }

/* T-609: papel só-leitura (Auditor/Leitura) esconde as ações de escrita. */
body[data-role="readonly"] [data-write] { display: none !important; }

/* T-609: abas dentro de modais (formulário do site). */
.modal-tabs { border-bottom: 1px solid var(--border); margin-bottom: 14px; gap: 2px; }
.modal-tabs .tab { height: 38px; font-size: 13px; }
.tab-panel { display: flex; flex-direction: column; gap: 12px; }
.tab-panel[hidden] { display: none; }

/* Inspetor de porta: hosts vistos atrás de um uplink. */
.port-hosts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; max-height: 220px; overflow: auto; }
.port-hosts li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; }

/* Etiquetas que podem ter texto longo (evidências): quebram, sem rolagem lateral. */
.tags-wrap { flex-wrap: wrap; }
.tags-wrap .tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Endereços IP (T-904) */
.ipam-subnets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ipam-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; display: grid; gap: 8px; color: var(--text); }
.ipam-card:hover { border-color: var(--accent); }
.ipam-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ipam-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ipam-card-counts { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.ipam-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--border); }
.ipam-bar .in-use { background: var(--ok); }
.ipam-bar .seen { background: var(--warn); opacity: .6; }
table.data tbody tr.ipam-free td { color: var(--text-3); padding-top: 4px; padding-bottom: 4px; }

/* Impressões por período (T-908) */
.data th.num, .data td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prn-table tfoot td { border-top: 2px solid var(--border); padding-top: 10px; }
.prn-table td .icon-btn { vertical-align: middle; }
.prn-table td { vertical-align: top; }
.prn-table td:nth-child(2) { max-width: 240px; }
.prn-sup { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prn-sup .icon { vertical-align: -2px; margin-right: 3px; }
.prn-table td:last-child { white-space: nowrap; }

/* Ligados há mais de N horas (T-913) */
.uptime-grid { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .uptime-grid { grid-template-columns: 1fr; } }
.uptime-kpis { display: grid; gap: 12px; }
.uptime-kpis .value { font-size: 28px; font-weight: 800; }
.uptime-kpis .value.warn { color: var(--warn); }
.uptime-days { display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.uptime-day { flex: 1; background: var(--warn); opacity: .7; border-radius: 2px 2px 0 0; min-width: 3px; }
.uptime-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Suprimentos da impressora (T-908) */
.supply-list { display: grid; gap: 10px; }
.supply-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.supply-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.supply-fill { height: 100%; border-radius: 5px; }
.supply-fill.unknown { width: 100%; opacity: .18; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.5) 6px 12px); }

/* Prévia da etiqueta (T-912) */
.lbl-preview { display: grid; justify-items: center; gap: 10px; padding: 18px 0 6px; overflow: hidden; }
.lbl-sample { background: #fff; color: #000; outline: 1px dashed var(--border-strong); transform-origin: top left; font-family: Arial, Helvetica, sans-serif; }
.lbl-sample .lbl { width: 100%; height: 100%; padding: 1.6mm; display: flex; gap: 1.5mm; align-items: center; overflow: hidden; }
.lbl-sample .lbl-text { flex: 1; min-width: 0; font-size: var(--f); line-height: 1.18; }
.lbl-sample .ln { overflow-wrap: anywhere; }
.lbl-sample .lbl-qr { width: var(--q); height: var(--q); flex: none; }
.lbl-sample .lbl-qr svg { width: 100%; height: 100%; }

/* Manual de operação (T-909) */
.man-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .man-layout { grid-template-columns: 1fr; } }
.man-side { position: sticky; top: 12px; padding: 12px; display: grid; gap: 10px; max-height: calc(100vh - 120px); overflow: auto; }
.man-toc { display: grid; gap: 2px; }
.man-toc a { padding: 6px 8px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 13px; }
.man-toc a:hover, .man-toc a.active { background: var(--accent-soft); color: var(--text); }
.man-body { padding: 18px 24px; line-height: 1.6; max-width: 900px; }
.man-body h1 { font-size: 22px; margin-top: 0; }
.man-body h2 { font-size: 18px; margin-top: 26px; padding-top: 8px; border-top: 1px solid var(--border); }
.man-sec:first-of-type h2 { border-top: 0; }
.man-body table { width: 100%; margin-bottom: 12px; }
@media print {
  .sidenav, .topbar, header, .man-side, #man-print, .page-head p { display: none !important; }
  .man-layout { display: block; }
  .man-body { box-shadow: none; border: 0; max-width: none; padding: 0; }
}

/* Estatística de impressões (T-908) */
.prn-stats { padding: 14px 16px; }
.prn-stats-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-btn { background: var(--surface); border: 0; padding: 6px 12px; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.prn-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
@media (max-width: 860px) { .prn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prn-kpis .value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.prn-chart { width: 100%; overflow: hidden; }
.usage-chart { width: 100%; height: auto; display: block; }
.usage-chart .g { stroke: var(--border); stroke-width: 1; }
.usage-chart .ax { fill: var(--text-3); font-size: 11px; }
.usage-chart .mono { fill: #475569; }
.usage-chart .color { fill: #d946ef; }
.usage-chart .rest { fill: var(--link); }
.usage-chart .none { stroke: var(--border-strong); stroke-width: 2; stroke-dasharray: 3 3; }
.usage-chart g:hover rect { opacity: .8; }
.prn-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.prn-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.prn-legend .sw.mono { background: #475569; } .prn-legend .sw.color { background: #d946ef; } .prn-legend .sw.rest { background: var(--link); }
.prn-legend .sw.none { background: none; border-top: 2px dashed var(--border-strong); height: 0; width: 14px; }

/* Porta com erro novo (T-917) */
.port.err { box-shadow: 0 0 0 2px var(--warn); }

/* Tabelas curtas de fatos por extenso (Fase 10) */
.fact-val { white-space: pre-line; }

/* Chatwoot por caixa de entrada (000051) e Integrações. */
.cw-conn-card {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.cw-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.cw-meta-item { display: flex; flex-direction: column; gap: 2px; }
.cw-meta-item .muted { font-size: 11.5px; }

.cw-section-header {
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.cw-section-header:first-of-type { margin-top: 8px; }
.cw-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cw-section-title .icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}
.cw-section-title h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.cw-section-title .muted {
  font-size: 12px;
  color: var(--text-3);
}

.cw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.cw-grid > .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.cw-grid > .card .table-wrap {
  flex: 1;
}
.cw-inbox-table th:nth-child(2) { width: 105px; }
.cw-inbox-table th:nth-child(3), .cw-inbox-table td:nth-child(3) { width: 70px; text-align: center; }
.cw-inbox-table th:nth-child(4), .cw-inbox-table td:nth-child(4) { width: 85px; text-align: center; }
.cw-inbox-table th:nth-child(5) { width: 145px; }
.cw-inbox-table th:nth-child(6) { width: 40px; }
@media (max-width: 1100px) {
  .cw-grid {
    grid-template-columns: 1fr;
  }
}

.cw-grid h3 { font-size: 15px; font-weight: 600; margin: 0; }
#cw-kind button { display: inline-flex; align-items: center; gap: 6px; }
#cw-pick-person option { padding: 4px 8px; }
.cw-sync-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.cw-sync-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.cw-sync-stat { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.cw-inbox-table th, .cw-inbox-table td { vertical-align: middle; }

/* Estrutura da organização (T-1100). */
.struct-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
.struct-side { display: flex; flex-direction: column; gap: 14px; }
.struct-grid h3 { font-size: 14.5px; }
.tree-name { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: nowrap; }
.tree-name > strong { min-width: 0; }
.tree-elbow { flex: 0 0 auto; }
.cell-clip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-elbow { color: var(--text-3); font-family: var(--font-mono); }
.levels-grid { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px 8px; align-items: center; }
.ea-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; margin-top: 8px; }
.ea-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 1100px) { .struct-grid { grid-template-columns: 1fr; } }

/* Expediente (T-1104). */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.cal-card-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.cal-card h3 { font-size: 15px; }
.cal-summary { margin: 6px 0 10px; color: var(--text-2); font-family: var(--font-mono); font-size: 12.5px; }
.cal-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 12px; }
.cal-day { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; font-size: 13px; }
.cal-ents { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cal-preview { grid-template-columns: 2fr 1.4fr 1fr auto; align-items: end; }
@media (max-width: 900px) { .cal-preview { grid-template-columns: 1fr; } }

/* Locais (T-1101). */
.kind-list { display: flex; flex-direction: column; }
.kind-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kind-row .row-actions { margin-left: auto; }
.legacy-list { display: flex; flex-direction: column; gap: 8px; }
.legacy-row { display: grid; grid-template-columns: 1fr minmax(180px, 46%); gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }

/* Solicitante (T-1102): sem painel técnico. */
.requester-notice { padding: 40px 28px; max-width: 720px; }
.requester-notice h2 { margin-bottom: 8px; }
body.requester main, body.requester .sidenav .nav-section, body.requester #btn-scan, body.requester #entity-picker { display: none !important; }

/* Ligados fora do expediente (T-1103 / T-2205). */
.oh-days { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 6px; }
.oh-day { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.oh-bar { width: 100%; max-width: 26px; background: var(--accent); border-radius: 3px 3px 0 0; }
.oh-lbl { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.oh-filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.oh-filter-group { display: flex; align-items: center; gap: 6px; }
.oh-search-wrap { flex: 1; min-width: 200px; position: relative; }
.oh-search-wrap input { width: 100%; padding-left: 28px; }
.oh-search-icon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

.oh-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.oh-tab { padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--text-2); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: color .15s, border-color .15s; }
.oh-tab:hover { color: var(--text); }
.oh-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.oh-tab-count { background: var(--surface-2); color: var(--text-2); font-size: 11px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
.oh-tab[aria-selected="true"] .oh-tab-count { background: var(--accent-soft); color: var(--accent); }

.oh-podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.oh-podium-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
.oh-podium-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.oh-podium-card.gold { border-left: 4px solid #f59e0b; }
.oh-podium-card.silver { border-left: 4px solid #94a3b8; }
.oh-podium-card.bronze { border-left: 4px solid #d97706; }
.oh-podium-medal { font-size: 22px; line-height: 1; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.oh-podium-card.gold .oh-podium-medal { background: #fef3c7; color: #b45309; }
.oh-podium-card.silver .oh-podium-medal { background: #f1f5f9; color: #475569; }
.oh-podium-card.bronze .oh-podium-medal { background: #ffedd5; color: #c2410c; }
.oh-podium-info { flex: 1; min-width: 0; }
.oh-podium-ip { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text); }
.oh-podium-host { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oh-podium-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.oh-podium-time { text-align: right; flex-shrink: 0; }
.oh-podium-hours { font-size: 16px; font-weight: 700; color: var(--text); }
.oh-podium-sub { font-size: 11px; color: var(--text-3); }

.oh-rank-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 1; }
.oh-rank-badge.gold { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.oh-rank-badge.silver { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.oh-rank-badge.bronze { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.oh-rank-badge.default { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

.oh-impact-cell { display: flex; flex-direction: column; gap: 4px; min-width: 100px; }
.oh-impact-top { display: flex; justify-content: space-between; align-items: baseline; }
.oh-impact-bar { height: 5px; width: 100%; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.oh-impact-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.oh-impact-fill.critical { background: var(--risk); }
.oh-impact-fill.warn { background: var(--warn); }

.oh-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; line-height: 1.3; }
.oh-tag-crit { background: var(--risk-soft); color: var(--risk); border: 1px solid var(--risk-border); }
.oh-tag-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(154, 91, 0, .25); }
.oh-tag-online { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(30, 122, 69, .25); }

.oh-pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.oh-page-btns { display: flex; gap: 4px; align-items: center; }
.oh-page-btn { min-width: 32px; height: 32px; padding: 0 8px; font-size: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.oh-page-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.oh-page-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.oh-page-btn:disabled { opacity: .45; cursor: not-allowed; }

.oh-sortable { cursor: pointer; user-select: none; }
.oh-sortable:hover { color: var(--text); }
.oh-sort-arrow { display: inline-block; margin-left: 4px; font-size: 10px; color: var(--text-3); }

/* ── Chamados (Fase 12) ─────────────────────────────────────────────── */
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.prio { font-size: 12px; font-weight: 600; white-space: nowrap; }
.prio-5 { color: var(--risk); }
.prio-4 { color: var(--warn); }
.prio-3 { color: var(--text-2); }
.prio-2, .prio-1 { color: var(--text-3, var(--text-2)); font-weight: 500; }
.tk-table td { vertical-align: top; }
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.tk-main, .tk-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tk-main h3, .tk-side h3 { font-size: 14px; margin-bottom: 8px; }
@media (max-width: 1000px) { .tk-layout { grid-template-columns: 1fr; } }
.tk-timeline { display: flex; flex-direction: column; gap: 8px; }
.tk-msg { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.tk-msg.requester { background: var(--surface-2); }
.tk-msg.private { border-style: dashed; background: var(--warn-soft); }
.tk-msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.tk-event { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-2); padding: 0 4px; }
.tk-event > span:first-of-type { flex: 1; min-width: 0; }
.tk-reply { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tk-reply .toolbar { justify-content: flex-end; flex-wrap: wrap; }
.tk-tasks { display: flex; flex-direction: column; gap: 4px; }
.tk-task { display: flex; gap: 8px; align-items: center; }
.tk-task .check { flex: 1; min-width: 0; }
.tk-task.done .check { text-decoration: line-through; color: var(--text-2); }
.tk-line { display: flex; gap: 6px; align-items: center; padding: 3px 0; }
.tk-line > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tk-x { margin-left: auto; padding: 2px; }
.tk-asset { position: relative; }
.tk-asset .tk-x { position: absolute; top: 6px; right: 0; }
/* Pré-cadastro sugerido (suggest.js) */
.sg-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.sg-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.sg-item:hover { background: var(--surface-2); }
.sg-item input { margin-top: 3px; }
.sg-item > span { min-width: 0; overflow-wrap: anywhere; }
.sg-detail { display: block; font-size: .85em; color: var(--text-2); margin-top: 2px; }
.sg-needs { display: flex; gap: 4px; align-items: center; font-size: .85em; color: var(--warn); margin-top: 4px; }
.tk-asset { padding: 8px 0; border-top: 1px solid var(--border); }
.tk-asset:first-of-type { border-top: 0; }
.tk-asset-results { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.tk-asset-hit { display: block; width: 100%; text-align: left; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: inherit; cursor: pointer; text-decoration: none; }
.tk-asset-hit:hover, .tk-asset-hit:focus-visible { background: var(--surface-2); border-color: var(--border); }
.tk-dash-h { display: flex; align-items: center; gap: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 18px 0 8px; }
.tk-dash-h:first-of-type { margin-top: 6px; }
.tk-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tk-stat-label-wrap { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tk-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 16px; }
.tk-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tk-card-title { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.tk-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tk-donut-visual { width: 120px; height: 120px; position: relative; flex-shrink: 0; }
.tk-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.tk-donut-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.tk-bars-wrap { display: flex; flex-direction: column; gap: 10px; }
.tk-bar-row { display: flex; flex-direction: column; gap: 3px; }
.tk-bar-track { background: var(--surface-2); border-radius: 4px; height: 8px; overflow: hidden; }
.tk-bar-fill { background: var(--accent); height: 100%; border-radius: 4px; }
.tk-comments-list { display: flex; flex-direction: column; gap: 8px; }
.field.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.tk-chart { width: 100%; height: 180px; display: block; background: var(--surface-2); border-radius: var(--radius-sm); }
.tk-bar-open { fill: var(--accent); background: var(--accent); }
.tk-bar-solved { fill: var(--ok); background: var(--ok); }
.tk-chart-axis { display: flex; justify-content: space-between; padding: 4px 0; margin-top: 4px; }
.tk-legend { display: flex; gap: 16px; align-items: center; margin-top: 6px; }
.tk-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.tk-ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.tk-ranks h3 { font-size: 14px; margin-bottom: 8px; }
@media print {
  .sidenav, .topbar, header, #tk-dash-page .toolbar { display: none !important; }
}

/* Sino de avisos (T-1207) */
.bell-wrap #bell-btn { position: relative; }
.bell-count { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--risk); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.bell-menu { width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; }
.bell-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bell-item { flex-direction: column; align-items: stretch; gap: 2px; }
.bell-item.unread { background: var(--accent-soft); }
.bell-item .bell-title { font-weight: 600; font-size: 13px; }
.bell-item .bell-body { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-item .bell-when { font-size: 11.5px; color: var(--text-3, var(--text-2)); }

/* Código para o chat (T-1210) */
.chat-code { font-size: 40px; font-weight: 800; letter-spacing: .3em; text-align: center; margin: 14px 0; color: var(--accent); }

/* Base de conhecimento (Fase 13) */
.kb-layout { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); border-top: 1px solid var(--border); min-height: 420px; }
.kb-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 72vh; }
.kb-item { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: inherit; cursor: pointer; }
.kb-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-badges .badge { align-self: flex-start; }
.kb-item:hover, .kb-item.active { background: var(--surface-2); }
.kb-snip { font-size: 13px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kb-snip mark { background: var(--warn-soft); color: inherit; }
.kb-view { padding: 16px 20px; min-width: 0; }
.kb-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kb-body { margin-top: 12px; }
.kb-help { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 10px; }
.kb-preview { border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px; margin-top: 10px; }
.kb-suggest { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
@media (max-width: 900px) { .kb-layout { grid-template-columns: 1fr; } .kb-list { border-right: 0; max-height: 40vh; } }

/* ── Visão KANBAN & Hover Card de Chamados ── */
.tk-kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 14px;
  padding: 14px;
  overflow-x: auto;
  min-height: 560px;
  align-items: start;
}
.tk-kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.tk-kanban-col-head {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  border-top-left-radius: var(--radius, 10px);
  border-top-right-radius: var(--radius, 10px);
  background: var(--surface);
}
.tk-kanban-col-head.col-stage { border-top: 3px solid #6366f1; }
.tk-kanban-col-head.col-n1 { border-top: 3px solid #0284c7; }
.tk-kanban-col-head.col-n2 { border-top: 3px solid #f59e0b; }
.tk-kanban-col-head.col-pending { border-top: 3px solid #ec4899; }
.tk-kanban-col-head.col-solved { border-top: 3px solid #10b981; }

.tk-kanban-col-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tk-kanban-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}
.tk-kanban-cards {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  transition: background 0.15s ease;
}
.tk-kanban-cards.dragover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  outline: 2px dashed var(--accent);
  border-radius: 8px;
}
.tk-kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.tk-kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.tk-kanban-card:active {
  cursor: grabbing;
  opacity: 0.8;
}
.tk-kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
}
.tk-kanban-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tk-kanban-card-sub {
  font-size: 11.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tk-kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font-size: 11.5px;
}

/* ── Hover Popover Flutuante com Resumo e Botão Atender ── */
.tk-hover-popover {
  position: fixed;
  z-index: 9999;
  width: 330px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.97) translateY(4px);
  transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1), transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tk-hover-popover::before {
  display: none;
}
.tk-hover-popover.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.tk-pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.tk-pop-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.tk-pop-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 8px 10px;
  border-radius: 6px;
  max-height: 110px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.tk-pop-meta {
  font-size: 11.5px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tk-pop-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  position: relative;
  z-index: 2;
}
.tk-pop-actions .btn {
  flex: 1;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}

/* ── Chips de Seleção de Faixas no Scan ── */
.chips-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.chip-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.chip-btn.chip-fast {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.chip-btn.chip-fast:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
}

/* ══════════════════════════════════════════════════════════════════════════
   MÓDULO DE RESERVAS & AGENDA (GLPI-STYLE)
   ══════════════════════════════════════════════════════════════════════════ */
.reservations-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* KPIs Globais e Módulos (Reservas, Ouvidoria, etc.) */
.kpi-bar,
.res-kpi-bar,
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.kpi-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon.kpi-warn { background: var(--warn-soft); color: var(--warn); }
.kpi-icon.kpi-ok { background: var(--ok-soft); color: var(--ok); }
.kpi-icon.kpi-risk { background: var(--risk-soft); color: var(--risk); }
.kpi-icon.kpi-accent,
.kpi-icon.kpi-info-accent { background: var(--accent-soft); color: var(--accent); }
.kpi-icon.kpi-muted { background: var(--surface-2); color: var(--text-3); }

.kpi-info { display: flex; flex-direction: column; min-width: 0; }
.kpi-value { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--text); }
.kpi-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Barra de Ferramentas / Filtros */
.res-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border-radius: 10px;
}
.res-nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}
.res-current-period {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.res-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Grade do Calendário */
.calendar-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.calendar-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
}
.calendar-header-day {
  padding: 10px 4px;
}
.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(115px, auto);
}
.calendar-day {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  min-height: 115px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}
.calendar-day:nth-child(7n) {
  border-right: none;
}
.calendar-day:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.calendar-day.other-month {
  background: color-mix(in srgb, var(--surface) 92%, black);
  opacity: 0.55;
  cursor: default;
}
.calendar-day.is-today {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.calendar-day.is-today .day-number {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.day-number {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.day-badge-count {
  font-size: 10.5px;
  background: var(--surface-3);
  color: var(--text-2);
  padding: 1px 6px;
  border-radius: 10px;
}

/* Eventos / Pílulas no Calendário */
.day-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 120px;
}
.res-pill {
  font-size: 11px;
  padding: 4px 7px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  border-left: 3px solid;
}
.res-pill:hover {
  transform: scale(1.02);
  filter: brightness(1.15);
}
.pill-time {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.85;
}
.pill-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.pill-title {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* Cores de status das pílulas */
.pill-pending {
  background: color-mix(in srgb, var(--warn) 18%, var(--surface-2));
  color: var(--warn);
  border-left-color: var(--warn);
}
.pill-approved {
  background: color-mix(in srgb, var(--ok) 18%, var(--surface-2));
  color: var(--ok);
  border-left-color: var(--ok);
}
.pill-in-use {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-2));
  color: var(--accent);
  border-left-color: var(--accent);
}
.pill-completed {
  background: color-mix(in srgb, var(--text-3) 15%, var(--surface-2));
  color: var(--text-2);
  border-left-color: var(--text-3);
}
.pill-cancelled {
  background: color-mix(in srgb, var(--risk) 18%, var(--surface-2));
  color: var(--risk);
  border-left-color: var(--risk);
}
.pill-meeting {
  background: color-mix(in srgb, #8b5cf6 20%, var(--surface-2));
  color: #8b5cf6;
  border-left-color: #8b5cf6;
}
.pill-ticket {
  background: color-mix(in srgb, #f97316 20%, var(--surface-2));
  color: #f97316;
  border-left-color: #f97316;
}
.pill-task {
  background: color-mix(in srgb, #06b6d4 20%, var(--surface-2));
  color: #06b6d4;
  border-left-color: #06b6d4;
}
.pill-visit {
  background: color-mix(in srgb, #10b981 20%, var(--surface-2));
  color: #10b981;
  border-left-color: #10b981;
}
.pill-confidential {
  background: color-mix(in srgb, #64748b 20%, var(--surface-2));
  color: #64748b;
  border-left-color: #64748b;
}

/* Formulários e Grades em Modais */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-column: span 6;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  box-sizing: border-box;
}
.field.full { grid-column: span 12; }
.field.col-6 { grid-column: span 6; }
.field.col-4 { grid-column: span 4; }
.field.col-3 { grid-column: span 3; }
.field.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  margin-top: 4px;
}
.field .input, .field .select, .field textarea,
.field input.input, .field select.select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .field, .field.full, .field.col-6, .field.col-4, .field.col-3 {
    grid-column: span 1 !important;
  }
}

.conflict-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.conflict-alert.alert-danger {
  background: var(--risk-soft);
  color: var(--risk);
  border: 1px solid var(--risk-border);
}
.conflict-alert.alert-success {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
}

.res-equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}
.res-equip-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.res-equip-card:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}
.res-equip-card input[type="checkbox"] {
  margin-top: 3px;
}
.equip-name { font-weight: 600; font-size: 13px; color: var(--text); }
.equip-cat { font-size: 11px; margin-top: 2px; }

/* Detalhes da Reserva */
.res-detail-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.res-detail-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.res-return { padding: 8px 0; border-bottom: 1px solid var(--border); }
.res-return:last-child { border-bottom: 0; }
.attendee-row { display: flex; gap: 8px; align-items: center; }
.attendee-empty { padding: 8px 10px; background: var(--surface-2); border-radius: 6px; }
.res-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: var(--surface-2);
  padding: 14px;
  border-radius: 8px;
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.meta-label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; font-weight: 600; letter-spacing: 0.03em; }
.meta-value { font-size: 13.5px; font-weight: 500; color: var(--text); }

.res-section h4 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
}
.checklist-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: 6px;
  margin-bottom: 8px;
}

/* ── Banner Global de Impersonate (Personificação) ── */
.impersonate-banner {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: linear-gradient(90deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.impersonate-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.impersonate-btn-exit {
  background: #ffffff;
  color: #c2410c;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.impersonate-btn-exit:hover {
  background: #fff7ed;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ── Canvas Editor de Formulários Dinâmicos (Estilo GLPI FormCreator) ── */
.canvas-builder {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  min-height: 540px;
}
.canvas-palette {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.canvas-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: grab;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s ease;
}
.canvas-palette-item:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateX(3px);
}
.canvas-stage {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 20px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.canvas-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.canvas-field-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  position: relative;
  transition: all 0.2s ease;
}
.canvas-field-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.canvas-field-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-12 { grid-column: span 12; }

.canvas-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: all 0.15s ease;
}
.canvas-palette-item:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateX(3px);
}
.canvas-field-card.dragging {
  opacity: 0.45;
  outline: 2px dashed var(--accent);
}
.canvas-field-card.dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.canvas-options-box {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 8px;
  margin-top: 6px;
}
.canvas-opt-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  margin: 2px;
}
.canvas-formula-box {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  margin-top: 6px;
}

@media (max-width: 800px) {
  .canvas-builder { grid-template-columns: 1fr; }
  .col-span-4 { grid-column: span 12; }
  .col-span-6 { grid-column: span 12; }
}

/* Visão do Dia / Timeline de Agenda (Estilo Outlook) */
.day-schedule-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.day-schedule-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.day-schedule-actions .btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.day-schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.day-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.day-item-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.day-item-time {
  min-width: 105px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.day-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.day-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.day-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.day-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  text-align: center;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px dashed var(--border);
  gap: 8px;
}

/* Escolha do modelo da ordem de serviço. */
.os-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.os-choice strong { display: inline-flex; align-items: center; gap: 6px; }
.os-choice:hover, .os-choice:focus-visible { border-color: var(--accent, var(--link)); }

/* Formulários de atendimento (form_fields.js): grade de 6 colunas; 1 coluna no celular. */
.ff-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.ff-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; }
.ff-grid > .span-full { grid-column: span 6; }
.ff-grid > .span-half { grid-column: span 3; }
.ff-grid > .span-third { grid-column: span 2; }
.ff-grid > [hidden] { display: none; }
.ff-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ff-section h4 { margin: 6px 0 0; font-size: 14px; }
.ff-section { border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.ff-choices { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ff-choices legend { width: 100%; margin-bottom: 4px; }
.ff-calc { display: block; background: var(--surface-2); font-weight: 700; }
.req { color: var(--risk, #dc2626); }
@media (max-width: 640px) { .ff-grid > .span-half, .ff-grid > .span-third { grid-column: span 6; } }

/* Editor de formulários (forms_admin.js): tipos | campos | propriedades. */
.fe-access .toolbar { margin: 4px 0 8px; }
.fe-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr) 300px; gap: 14px; margin-top: 14px; align-items: start; }
.fe-palette { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; }
.fe-palette .fe-type { justify-content: flex-start; width: 100%; }
.fe-canvas { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-content: start; min-height: 220px;
  padding: 10px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); }
.fe-canvas > .empty { grid-column: span 6; }
.fe-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; min-width: 0; }
.fe-item.selected { border-color: var(--accent, var(--link)); box-shadow: 0 0 0 2px var(--accent-soft); }
.fe-item.fe-w-full { grid-column: span 6; }
.fe-item.fe-w-half { grid-column: span 3; }
.fe-item.fe-w-third { grid-column: span 2; }
.fe-item-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fe-item-head > span:first-child { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.fe-item-foot > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 120px; }
.fe-item-foot .toolbar { gap: 0; flex-shrink: 0; }
.fe-item-foot .btn.btn-sm { padding: 2px 6px; }
.fe-ents { max-height: 150px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; display: grid; gap: 4px; }
.fe-props { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); position: sticky; top: 0; }
@media (max-width: 1100px) {
  .fe-layout { grid-template-columns: 1fr; }
  .fe-palette { flex-direction: row; flex-wrap: wrap; position: static; }
  .fe-palette .fe-type { width: auto; }
  .fe-props { position: static; }
}

/* T-2206: a grade dos formulários tem 12 colunas; o que não é .field (caixa de marcar, parágrafo, div)
   ocupa a linha inteira em vez de 1/12 (era o "espremido"). Botão dentro
   de um campo fica do tamanho do texto (não estica na largura toda). */
.form-grid > :not(.field) { grid-column: 1 / -1; }
.field > .btn, .field > .toolbar > .btn { align-self: flex-start; }

/* ── Assistente de implantação (T-812) ── */
.ob-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.ob-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ob-bar span { display: block; height: 100%; background: var(--ok, #2e9d5b); }
.ob-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.ob-steps { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.ob-step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.ob-step:hover, .ob-step.active { background: var(--surface-2); }
.ob-step.active { box-shadow: inset 3px 0 0 var(--accent); }
.ob-n { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); flex: 0 0 auto; }
.ob-title { flex: 1; min-width: 0; }
.ob-step.st-done .ob-st { color: var(--ok, #2e9d5b); }
.ob-step.st-attention .ob-st { color: #d4a106; }
.ob-step.st-skipped .ob-st, .ob-step.st-pending .ob-st { color: var(--text-3); }
.ob-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ob-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ob-panel h4 { margin-top: 6px; }
.ob-actions { flex-wrap: wrap; }
.ob-nav { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; flex-wrap: wrap; }
.ob-choice { display: flex; gap: 18px; flex-wrap: wrap; }
.ob-confirm { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.ob-list { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.ob-guide-steps li { line-height: 1.5; }
.ob-probe { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 900px) { .ob-layout { grid-template-columns: 1fr; } }

/* Inventário → Periféricos (T-1006/T-1007) */
.pf-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pf-tab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pf-tab:hover { border-color: var(--accent); color: var(--text); }
.pf-tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.pf-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.pf-tools .search-box { flex: 1 1 260px; max-width: 420px; }
.pf-tools .check { align-items: center; }
.pf-tools .check input { margin-top: 0; }

/* Código de pareamento da sonda (T-806) */
.ob-pair-code { margin: 12px 0; padding: 14px 16px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); }
.ob-code { font-size: 30px; font-weight: 700; letter-spacing: 4px; margin: 4px 0; color: var(--text); }
.ob-gpo { display: flex; flex-direction: column; gap: 12px; margin: 0 0 12px; }
.ob-gpo .field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ob-gpo .field-row > .field { grid-column: auto; }
@media (max-width: 700px) { .ob-gpo .field-row { grid-template-columns: 1fr; } }
.ob-probe-scan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Impressões: seções por setor e impressoras ligadas aos computadores (T-1007) */
.prn-extra { margin-top: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.prn-extra h3 { font-size: 15px; margin: 0; }
.prn-share { display: inline-block; width: 90px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.prn-share span { display: block; height: 100%; background: var(--accent); }
/* Licença (T-807) */
.lic-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.lic-big { font-size: 16px; font-weight: 700; margin: 4px 0; }
.lic-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lic-meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.lic-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.lic-bar span { display: block; height: 100%; background: var(--ok, #2e9d5b); }
.lic-bar.warn span { background: #d4a106; }
.lic-bar.risk span { background: var(--risk); }

/* Miniaturas de imagens anexadas ao chamado (e-mail/WhatsApp) */
.tk-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-thumb { display: block; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); line-height: 0; }
.tk-thumb img { display: block; max-width: min(320px, 100%); max-height: 220px; object-fit: contain; }
.tk-thumb.broken { padding: 8px; line-height: 1.4; }

/* Celular: tabela marcada .table-cards vira cartões (cada célula com o rótulo da coluna em data-label). */
@media (max-width: 760px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border-bottom: 1px solid var(--border); padding: 10px 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .table-cards td { padding: 0; border: 0; min-width: 0; }
  .table-cards td:first-child { grid-column: 1 / -1; }
  .table-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
}

/* Barra de formatação da resposta do chamado */
.tk-fmt { display: flex; align-items: center; gap: 2px; margin-bottom: 4px; flex-wrap: wrap; }
.tk-fmt .icon-btn { width: 30px; height: 28px; font-size: 14px; }
.tk-fmt .muted { margin-left: 8px; }

/* Ordenação dos chamados (lista e Kanban) */
.tk-sort { display: inline-flex; align-items: center; gap: 6px; }
.tk-sort .select { width: auto; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; text-transform: inherit; letter-spacing: inherit; }
.th-sort:hover { color: var(--text); }

/* Auditoria */
.aud-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 10px; align-items: end; margin: 8px 0 12px; }
.aud-filters .aud-q { grid-column: span 2; }
.aud-filters .btn { height: 36px; }
.aud-target { word-break: break-word; }
.aud-more { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; }
@media (max-width: 760px) { .aud-filters .aud-q { grid-column: auto; } }

.aud-filters > .field { grid-column: auto; margin: 0; }
.aud-filters > .field.aud-q { grid-column: span 2; }
@media (max-width: 760px) { .aud-filters > .field.aud-q { grid-column: auto; } }

/* Chamado: histórico do equipamento e anexar arrastando */
.tk-hist { display: block; padding: 3px 0; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.tk-hist:hover { color: var(--accent); }
.tk-reply.dragover { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 8px; }

/* Regras de atribuição: arrastar para ordenar (T-1206) */
.tk-drag { cursor: grab; white-space: nowrap; }
.tk-drag .icon-sm { vertical-align: middle; opacity: .6; margin-right: 4px; }
tr.dragging { opacity: .45; }

/* Base de conhecimento: anexos do artigo (T-1300) */
.kb-file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }

/* Logotipo do cliente no tema escuro (T-2203): a imagem é do cliente e costuma ter texto escuro; uma placa
   clara atrás garante a leitura sem alterar a marca. */
:root[data-theme="dark"] #pt-brand-logo-wrap img { background: var(--on-accent); border-radius: 6px; padding: 2px 4px; }

/* Utilitários de layout e tipografia (T-2203 / T-2205) */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.font-bold { font-weight: 700; }
.text-accent { color: var(--accent); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-risk { color: var(--risk); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.timeline-track { display: flex; flex-direction: column; gap: 10px; padding-left: 12px; border-left: 2px solid var(--border); margin-left: 6px; }
.card-soft-ok { background: var(--ok-soft); border: 1px solid var(--ok); }
.card-soft-accent { background: var(--accent-soft); }
.card-surface-2 { background: var(--surface-2); }
.border-t { border-top: 1px solid var(--border); padding-top: 10px; }
.text-center { text-align: center; }

/* Agenda e Calendário Semanal/Diário (T-1503) */
.agenda-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  flex-wrap: wrap;
}
.agenda-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.agenda-tab-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.agenda-tab-btn.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.week-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.week-header-row {
  display: grid;
  grid-template-columns: 65px repeat(7, minmax(130px, 1fr));
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
}
.week-header-cell {
  padding: 10px 6px;
  border-right: 1px solid var(--border);
}
.week-header-cell:last-child {
  border-right: none;
}
.week-header-cell.is-today {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}
.week-body {
  display: grid;
  grid-template-columns: 65px repeat(7, minmax(130px, 1fr));
}
.week-time-slot {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.week-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 52px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  background: var(--surface);
  transition: background 0.12s ease;
}
.week-cell:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.week-cell.is-today {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.day-timeline-view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.task-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-2);
  transition: color 0.15s ease, transform 0.15s ease;
}
.task-toggle-btn:hover {
  color: var(--ok);
  transform: scale(1.15);
}
.task-done {
  text-decoration: line-through;
  opacity: 0.65;
}


/* Fato em forma de lista (firewall, DHCP, rotas...): tabela compacta na largura toda (T-927). */
.fact:has(.fact-table-wrap) { grid-column: 1 / -1; }
.fact-table-wrap { overflow: auto; max-height: 340px; margin-top: 4px; border: 1px solid var(--border); border-radius: 6px; }
.fact-table { font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; margin: 0; }
.fact-table th { position: sticky; top: 0; background: var(--surface-2); }
.fact-val .fact-table-wrap + p { white-space: normal; margin: 4px 0 0; }

/* Painel didático (T-937): resumo, explicação e frases; tabela técnica recolhida. */
.fact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fact-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.fact-card.warn { border-color: var(--risk-border); background: var(--risk-soft); }
.fact-card-n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.fact-card-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.fact-help { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-2); margin-top: 2px; white-space: normal; }
.fact-sentences { margin: 4px 0 0; padding-left: 18px; font-family: var(--font-sans, inherit); font-size: 13px; white-space: normal; line-height: 1.5; }
.fact-tech { margin-top: 6px; white-space: normal; }
.fact-tech summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.fact:has(.fact-sentences) { grid-column: 1 / -1; }

/* ─── Canvas da topologia no estilo UniFi (T-938) ───────────────────── */
:root {
  --speed-10g: #2f7de1; --speed-2g5: #7b5cd6; --speed-1g: #2fa55a; --speed-100m: #e08a1e; --speed-10m: #d64545;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --speed-10g: #5aa0ff; --speed-2g5: #a48cff; --speed-1g: #4fcf7c; --speed-100m: #f3a640; --speed-10m: #ff6b6b; }
}
:root[data-theme="dark"] { --speed-10g: #5aa0ff; --speed-2g5: #a48cff; --speed-1g: #4fcf7c; --speed-100m: #f3a640; --speed-10m: #ff6b6b; }
/* Fundo pontilhado discreto, como os canvas de controladora. */
#cy {
  background-color: var(--canvas);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text-3) 22%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.legend-line.speed-10g { border-top-color: var(--speed-10g); border-top-width: 4px; }
.legend-line.speed-2g5 { border-top-color: var(--speed-2g5); border-top-width: 3.5px; }
.legend-line.speed-1g { border-top-color: var(--speed-1g); border-top-width: 3px; }
.legend-line.speed-100m { border-top-color: var(--speed-100m); border-top-width: 2.5px; }
.map-legend { flex-wrap: wrap; row-gap: 4px; }

/* T-2216: hardware em gráfico na ficha (volumes, discos, memória). */
.fact-val .hw-viz, .hw-viz { white-space: normal; font-family: var(--font-sans); font-size: 13px; }
.hw-vols { display: grid; gap: 10px; }
.hw-vol-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hw-vol-free { margin-left: auto; font-size: 12px; color: var(--text-2); }
.hw-vol-free.warn { color: var(--warn); font-weight: 600; }
.hw-vol-free.crit { color: var(--risk); font-weight: 600; }
.hw-bar { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 4px 0 2px; }
.hw-bar-used { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.hw-bar-used.warn { background: var(--warn); }
.hw-bar-used.crit { background: var(--risk); }
.hw-vol-foot { font-size: 12px; color: var(--text-2); }
.hw-tag { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.hw-disks { display: grid; gap: 6px; }
.hw-disk { display: flex; gap: 10px; align-items: baseline; }
.hw-disk-size { min-width: 64px; font-weight: 600; }
.hw-mem { display: flex; align-items: baseline; gap: 8px; }
.hw-mem-total { font-size: 20px; font-weight: 700; }
.hw-slots-sum { margin-bottom: 6px; }
.hw-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.hw-slot { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--accent-soft); }
.hw-slot.empty { background: transparent; border-style: dashed; color: var(--text-2); }

/* T-2221: CNPJ/CEP com o botão Buscar ao lado */
.ff-lookup { display: flex; gap: 6px; align-items: center; }
.ff-lookup .input { flex: 1; min-width: 0; }

/* T-2300: relatórios avançados — colunas em grade, números à direita */
.rp-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; margin: 4px 0 6px; }
#view-reports td.num, #view-reports th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* T-2302: item que passou no filtro da árvore */
tr.tree-hit > td:first-child { box-shadow: inset 3px 0 0 hsl(45 90% 50%); }
tr.tree-hit .tree-name strong { text-decoration: underline; text-decoration-color: hsl(45 90% 50%); }

/* T-2222: formulário personalizado — nativos e campos do cliente na mesma grade, ordem pelo `order`. */
.fl-mixed { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.fl-mixed > form, .fl-mixed > [data-cf-inline], .fl-mixed > [data-cf-person], .fl-mixed > [data-cf-entity],
.fl-mixed .cf-inline, .fl-mixed [data-cf-host], .fl-mixed .ff-grid { display: contents; }
.fl-mixed .cf-inline > .field-label { display: none; }
.fl-mixed > form > :not(.field), .fl-mixed > form > .form-error { order: 9999; grid-column: 1 / -1; }
.fl-mixed .ff-field.span-full, .fl-mixed .ff-section { grid-column: span 12; }
.fl-mixed .ff-field.span-half { grid-column: span 6; }
.fl-mixed .ff-field.span-third { grid-column: span 4; }
.fl-mixed .field[hidden], .fl-mixed [data-ff][hidden] { display: none; }
@media (max-width: 720px) { .fl-mixed .ff-field, .fl-mixed .ff-section { grid-column: 1 / -1 !important; } }
.modal-head .fl-customize { margin-left: auto; margin-right: 6px; }

/* Faixa de versão nova do servidor (update_watch.js). */
.update-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9999; display: flex; gap: 12px;
  align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--surface, #1e293b); color: var(--text, #fff);
  border: 1px solid var(--border, #334155); box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px); }

/* Menu de ações da linha (action_menu.js). */
.action-menu { position: absolute; z-index: 9000; min-width: 220px; padding: 4px; border-radius: 10px;
  background: var(--surface, #1e293b); border: 1px solid var(--border, #334155); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.action-menu hr { border: 0; border-top: 1px solid var(--border, #334155); margin: 4px 0; }
.action-menu-item { display: flex; gap: 8px; align-items: center; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.action-menu-item:hover:not([disabled]), .action-menu-item:focus-visible { background: var(--hover, rgba(148,163,184,.15)); outline: none; }
.action-menu-item[disabled] { opacity: .45; cursor: default; }
.action-menu-item.danger { color: var(--risk, #ef4444); }
.row-menu-cell { width: 1%; white-space: nowrap; text-align: right; }

/* Links de texto sem o azul/sublinhado padrão do navegador: cor do tema, sublinhado só ao passar o mouse. */
a { color: var(--accent, inherit); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
table.data a { color: inherit; font-weight: 600; }

/* Painel de tarefas (T-2332) */
.job-item { gap: 4px; }
.job-bar { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; margin: 2px 0; }
.job-bar > span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
