/* GenBGP: interface de operação. Cor da marca vem de /tema-N.css (variáveis --brand-*). */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.f837d382a885.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.42b95430773b.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.75fb76ec3559.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.3714175d15f3.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/plexmono-400.4cc7b4398540.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/plexmono-500.bc5ccab82723.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-subtle: #f5f6f7;
  --bg-hover: #eef0f2;
  --surface: #ffffff;
  --border: #e1e4e8;
  --border-strong: #c9ced4;
  --text: #16181b;
  --text-muted: #555c65;
  --text-faint: #7d848d;

  --ok: #1a7f37;      --ok-soft: #e6f4ea;     --ok-line: #b5dcc0;
  --warn: #8a5a00;    --warn-soft: #fdf3dc;   --warn-line: #ecd59a;
  --danger: #b4233c;  --danger-soft: #fbe9ec; --danger-line: #efb9c3;
  --info: #3b4a5c;    --info-soft: #eef1f5;   --info-line: #cdd5df;

  /* fallback se /tema.css não carregar */
  --brand: #1f5a96; --brand-hover: #194a7b; --on-brand: #ffffff;
  --brand-text: #194a7b; --brand-soft: #edf2f8; --brand-line: #b9cde2;

  --radius: 4px;
  --sidebar: 216px;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171a; --bg-subtle: #1b1e22; --bg-hover: #23272c; --surface: #1b1e22;
  --border: #2c3137; --border-strong: #3d434b;
  --text: #e5e7ea; --text-muted: #a3aab3; --text-faint: #7f8790;
  --ok: #4cc472;     --ok-soft: #14301e;     --ok-line: #23502f;
  --warn: #e3b341;   --warn-soft: #33290f;   --warn-line: #5a4614;
  --danger: #f2788c; --danger-soft: #3a1820; --danger-line: #66293a;
  --info: #a8b6c7;   --info-soft: #20262d;   --info-line: #36404b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15171a; --bg-subtle: #1b1e22; --bg-hover: #23272c; --surface: #1b1e22;
    --border: #2c3137; --border-strong: #3d434b;
    --text: #e5e7ea; --text-muted: #a3aab3; --text-faint: #7f8790;
    --ok: #4cc472;     --ok-soft: #14301e;     --ok-line: #23502f;
    --warn: #e3b341;   --warn-soft: #33290f;   --warn-line: #5a4614;
    --danger: #f2788c; --danger-soft: #3a1820; --danger-line: #66293a;
    --info: #a8b6c7;   --info-soft: #20262d;   --info-line: #36404b;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font); font-feature-settings: "cv11", "tnum";
}
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 18px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
p { margin: 0 0 8px; }
code, .mono, kbd { font-family: var(--mono); font-size: 0.93em; }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 6px 10px; border: 1px solid var(--border); }
.skip:focus { left: 8px; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-subtle); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
a.brand { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; }
a.brand:hover { text-decoration: none; }
a.brand img { max-height: 26px; max-width: 150px; display: block; }
a.brand .mark { width: 22px; height: 22px; border-radius: 3px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .has-dark-logo .logo-light { display: none !important; }
:root[data-theme="dark"] .has-dark-logo .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .has-dark-logo .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .has-dark-logo .logo-dark { display: block !important; }
}
.nav { padding: 8px 0; flex: 1; }
.nav-group { padding: 10px 14px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.nav a { display: flex; align-items: center; gap: 8px; padding: 5px 14px; margin: 0 6px; border-radius: var(--radius); color: var(--text-muted); }
.nav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: inset 2px 0 0 var(--brand); }
:root[data-theme="dark"] .nav a.active { background: var(--bg-hover); }
.nav svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.sidebar-foot { padding: 10px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-faint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 48px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--bg); position: sticky; top: 0; z-index: 10;
}
.topbar .title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.topbar .title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { color: var(--text-faint); font-size: 13px; }
.menu-btn { display: none; }
.content { padding: 20px; max-width: 1280px; width: 100%; }
.content.narrow { max-width: 760px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text);
  font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1b0a0e; }
.btn-danger:hover { filter: brightness(0.94); background: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-text); font: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--danger); }

/* ---------- Painéis ---------- */
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel + .panel, .panel + .section, .section + .section { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.panel-head h2 { flex: 1; }
.panel-body { padding: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow: visible; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 12px; padding: 7px 12px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); white-space: nowrap; }
.table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-subtle); }
.table td.actions-cell { text-align: right; white-space: nowrap; }
.table .sub { color: var(--text-faint); font-size: 12px; }
.panel > .table-wrap > .table th:first-child, .panel > .table-wrap > .table td:first-child { padding-left: 14px; }
.empty { padding: 28px 14px; text-align: center; color: var(--text-muted); }
details.data summary { cursor: pointer; color: var(--text-faint); font-size: 12px; }
details.data pre { margin: 6px 0 0; padding: 8px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); font: 12px/1.4 var(--mono); white-space: pre-wrap; max-width: 520px; }

/* ---------- Status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 3px;
  font-size: 12px; font-weight: 500; border: 1px solid var(--info-line); background: var(--info-soft); color: var(--info); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.badge.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.badge.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.badge.brand { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.danger { background: var(--danger); }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--info-line); background: var(--info-soft); border-radius: var(--radius); margin-bottom: 14px; }
.alert.ok { border-color: var(--ok-line); background: var(--ok-soft); }
.alert.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.alert.danger { border-color: var(--danger-line); background: var(--danger-soft); }
.alert .alert-title { font-weight: 600; }
.alert > div > p:last-child, .alert > div > ul:last-child { margin-bottom: 0; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.messages { margin-bottom: 14px; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field label, .field .label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 4px; }
.field .help { color: var(--text-faint); font-size: 12px; margin-top: 4px; }
.field .errors { color: var(--danger); font-size: 12px; margin: 4px 0 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.req { color: var(--danger); margin-left: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: 13px var(--font);
}
textarea { height: auto; padding: 7px 9px; line-height: 1.45; resize: vertical; }
textarea.mono, input.mono { font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
input[type=file] { font: 13px var(--font); color: var(--text-muted); }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); margin: 0; vertical-align: -2px; }
.checks { display: grid; gap: 6px; }
.checks label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 12px; margin: 0; }
legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.form-actions { display: flex; gap: 8px; padding-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filters .field { min-width: 140px; }
.filters .field label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.color-field { display: flex; gap: 6px; }
.color-field input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg-subtle); }
.auth-box { width: 100%; max-width: 360px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; font-size: 17px; font-weight: 600; }
.auth-brand img { max-height: 40px; max-width: 240px; }
.auth .panel-body { padding: 20px; }
.auth-foot { text-align: center; margin-top: 14px; font-size: 12px; color: var(--text-faint); }

/* ---------- Senha temporária ---------- */
.secret { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg-subtle); font: 500 16px var(--mono); letter-spacing: 0.04em; }
.secret span { flex: 1; user-select: all; }

/* ---------- Prévia de aparência ---------- */
.preview { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.preview-bar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-bottom: 1px solid var(--pv-border); background: var(--pv-subtle); color: var(--pv-text); font-weight: 600; }
.preview-bar img { max-height: 22px; max-width: 130px; }
.preview-body { padding: 12px; background: var(--pv-bg); color: var(--pv-text); display: grid; gap: 10px; }
.preview .pv-light { --pv-bg: #ffffff; --pv-subtle: #f5f6f7; --pv-border: #e1e4e8; --pv-text: #16181b; }
.preview .pv-dark { --pv-bg: #15171a; --pv-subtle: #1b1e22; --pv-border: #2c3137; --pv-text: #e5e7ea; }
.pv-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--radius); font-size: 12px; font-weight: 500; width: max-content; }
.pv-link { font-size: 13px; text-decoration: underline; }
.pv-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 3px; font-size: 12px; border: 1px solid; width: max-content; }
.swatches { display: grid; grid-template-columns: repeat(10, 1fr); height: 18px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ---------- Abas ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 12px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 500; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }

/* ---------- Usuário (menu) ---------- */
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--bg-hover); }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); border: 1px solid var(--brand-line); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 12px rgb(0 0 0 / 0.08); padding: 4px; z-index: 30; }
.usermenu .menu .who { padding: 6px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 6px 10px; border: 0; background: none; color: var(--text); font: 13px var(--font); border-radius: 3px; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--bg-hover); text-decoration: none; }

/* ---------- Indicadores ---------- */
.stat { padding: 12px 14px; }
.stat .label { font-size: 12px; color: var(--text-muted); }
.stat .value { font-size: 18px; font-weight: 600; margin-top: 2px; }
.placeholder-row td { color: var(--text-faint); }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .15s; }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.35); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .content { padding: 16px; }
  .grid-2, .grid-3, .form-row { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .usermenu .name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Utilitários ---------- */
.mt { margin-top: 14px; }
.my { margin: 12px 0; }
.w-sm { max-width: 170px; }
.w-md { max-width: 300px; }
.tabs-note { margin-left: auto; align-self: center; padding: 0 4px; }
.kv + .alert, .muted + .alert { margin-top: 10px; }
.panel-body > .small.muted { margin-top: 10px; }
.brand-inner { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mark { width: 22px; height: 22px; border-radius: 3px; background: var(--brand); color: var(--on-brand); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.auth-brand .mark { width: 28px; height: 28px; font-size: 14px; }
.preview .mark { width: 20px; height: 20px; font-size: 11px; }
@media (max-width: 900px) { .tabs-note { display: none; } }
[hidden] { display: none !important; }
pre.code { margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-subtle); white-space: pre-wrap; overflow-wrap: anywhere; }
fieldset.carrier { display: grid; gap: 12px; min-width: 0; }
.secret.small { font-size: 12px; letter-spacing: 0; }
.secret.small span { overflow-wrap: anywhere; }
svg.ico { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; vertical-align: -2px; }
.rules { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.rule { font: 500 11px var(--mono); padding: 1px 5px; border: 1px solid var(--border); border-radius: 3px; color: var(--text-faint); }
.rule.on { color: var(--text); border-color: var(--border-strong); background: var(--bg-subtle); }
.rule.bad { color: var(--danger); border-color: var(--danger-line); }
tr.row-problem td { background: var(--danger-soft); }
tr.row-fixed td { color: var(--text-muted); }
.stat-row { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--border); }
.stat-row .stat { min-width: 120px; border-right: 1px solid var(--border); }
.text-danger { color: var(--danger); } .text-ok { color: var(--ok); } .text-warn { color: var(--warn); }
.help-tip { display: inline-grid; place-items: center; width: 15px; height: 15px; border: 1px solid var(--border-strong); border-radius: 50%; font: 600 10px var(--sans, inherit); color: var(--text-muted); cursor: help; vertical-align: 1px; margin-left: 3px; }
.what { display: grid; gap: 10px; }
.what h3 { font-size: 13px; margin: 0 0 2px; }
.what ul { margin: 0; padding-left: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.steps .st { font: 600 11px var(--mono); min-width: 74px; }
.st.ok { color: var(--ok); } .st.erro { color: var(--danger); } .st.executando { color: var(--warn); } .st.pendente { color: var(--text-faint); }
.modes { display: flex; gap: 8px; flex-wrap: wrap; }
.modes label { display: flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 12px; cursor: pointer; }
.modes label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.w-check { width: 28px; }
pre.diff { margin: 0; padding: 10px 12px; overflow-x: auto; white-space: pre; }
.d-add { color: var(--ok); background: var(--ok-soft); display: block; }
.d-del { color: var(--danger); background: var(--danger-soft); display: block; }
.d-hunk { color: var(--text-faint); display: block; margin-top: 6px; }
.d-ctx { color: var(--text-muted); display: block; }
form.inline { display: inline; }
.qr-box { display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.qr-box svg { display: block; width: 180px; height: 180px; }
.secret-inline { user-select: all; letter-spacing: 0.05em; }
.theme-menu { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.theme-menu .menu-label { display: block; padding: 4px 12px; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.theme-menu button .check { display: inline-block; width: 16px; color: var(--brand-text); }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; padding: 18px 0 4px; font-size: 12px; color: var(--text-faint); }
.site-footer a { color: var(--text-muted); }
.site-footer .footer-logo { height: 20px; max-width: 120px; width: auto; object-fit: contain; }
/* Logos: altura por tamanho (P/M/G), largura proporcional com máximo; nunca distorce */
.logo-h-P img, .logo-slot.logo-h-P img { height: 28px; }
.logo-h-M img, .logo-slot.logo-h-M img { height: 36px; }
.logo-h-G img, .logo-slot.logo-h-G img { height: 44px; }
.brand-inner[class*="logo-h-"] img, .logo-slot[class*="logo-h-"] img { width: auto; max-width: 220px; max-height: none; object-fit: contain; }
.logo-l-P img { height: 64px; } .logo-l-M img { height: 96px; } .logo-l-G img { height: 128px; }
.brand-inner[class*="logo-l-"] img, .logo-slot[class*="logo-l-"] img { width: auto; max-width: min(360px, 100%); max-height: none; object-fit: contain; }
a.brand { height: auto; min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
.auth-brand img { max-height: none; }
.logo-sizes { display: grid; gap: 10px; }
.logo-size-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.logo-size-row.pv-light { background: #ffffff; } .logo-size-row.pv-dark { background: #15181c; color: #c9ced4; }
.logo-size-row > .small { min-width: 110px; }
.logo-slot { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.logo-slot .sz { position: absolute; top: -8px; right: -6px; font: 600 9px var(--mono); color: var(--text-faint); }

/* ---- Responsivo sem quebras nem rolagem (ajustes nº 01, item 1) ---- */
.grid > *, .form-row > *, .toolbar > *, .stat-row > *, .panel, .panel-body, .field { min-width: 0; }
.table { width: 100%; }
.table td { overflow-wrap: anywhere; }                       /* textos livres podem quebrar */
.mono:not(.wrap-ok):not(pre), .nowrap, .badge, .btn, .tabs a, time, .value, .st { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.table td.mono, .table td .mono, .table td.nowrap, .table td .nowrap, .table td .badge { overflow-wrap: normal; }
.wrap-ok { white-space: normal; overflow-wrap: anywhere; }
/* valores longos (chaves, impressões digitais): uma linha, reticências, texto completo no title */
.truncate { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
span.truncate { display: inline-block; vertical-align: bottom; }
.prefix-list { display: flex; flex-wrap: wrap; gap: 0 8px; }
@media (max-width: 1279px) { .hide-md { display: none; } }
/* < 768 px: tabelas viram lista de blocos "rótulo: valor" (rótulos copiados do cabeçalho por app.js) */
@media (max-width: 767px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--border); padding: 6px 0; }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 3px 12px; text-align: left; }
  .table td::before { content: attr(data-label); display: block; color: var(--text-muted); font-size: 11px; }
  .table td[data-label=""]::before, .table td:not([data-label])::before { content: none; }
  .table td.empty { text-align: center; }
  .table td.actions-cell { text-align: left; white-space: normal; }
  .table td.right { text-align: left; }
  .table td.truncate { display: block; max-width: none; }
  .hide-sm { display: none !important; }
}
.table td.truncate { display: table-cell; max-width: 260px; }
/* Visão geral (item 10) */
.ov-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ov-head h2 { margin: 0; font-size: 15px; }
.ov-row { margin-bottom: 12px; }
.ov-carriers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.ov-device { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.ov-device:has(> :only-child) { grid-template-columns: 1fr; }
.ov-bottom { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ov-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px 12px; padding: 10px 14px 6px; }
.ov-kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-kv .label { font-size: 11px; color: var(--text-muted); }
.ov-kv .value { font-size: 15px; font-weight: 600; min-height: 1.3em; }
.ov-probes { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 14px 10px; }
.spark { height: 0; }
.spark.has-data { height: 36px; margin: 0 14px 10px; }
.ov-links { display: grid; gap: 6px; padding: 10px 14px; }
.ov-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.ov-events { list-style: none; margin: 0; padding: 8px 14px; display: grid; gap: 4px; }
.ov-events li { display: grid; grid-template-columns: auto auto minmax(0, 190px) minmax(0, 1fr); gap: 4px 10px; align-items: baseline; min-width: 0; }
.ov-events .ev-title, .ov-events .ev-text { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.ov-events .ev-text { color: var(--text-muted); }
.stat-row .stat { flex: 1 1 110px; }
.stat-row > .stat { min-width: 120px; }
.stat-row .stat .value { font-size: 16px; }
.table td.cell-narrow { max-width: 220px; }
@media (max-width: 1100px) { .ov-device, .ov-bottom { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .ov-events li { grid-template-columns: auto minmax(0, 1fr); } .ov-events .ev-title { grid-column: 2; white-space: normal; font-weight: 500; } .ov-events .ev-text { grid-column: 2; } }

.table td.actions-cell { white-space: normal; }
.actions-cell a, .actions-cell button, .actions-cell .badge { white-space: nowrap; }
.sys-line { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; font-size: 12px; color: var(--text-muted); padding: 8px 2px; }
.sys-line > span { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.ov-kv .badge { align-self: flex-start; }
/* Gráficos (item 9) */
.charts-toolbar .seg { display: inline-flex; gap: 2px; }
.charts-toolbar .seg .btn.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.charts-toolbar input[type=datetime-local] { width: auto; }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 12px; }
.chart-panel .panel-head h2 { flex: 1; min-width: 0; }
.chart-body { padding: 8px 6px 0; min-height: 196px; overflow: hidden; }
.chart-canvas { width: 100%; }
.chart-empty { padding: 70px 0; text-align: center; }
.chart-stats { display: grid; gap: 2px; padding: 6px 14px 10px; }
.chart-stat { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.chart-stat .swatch { width: 10px; height: 3px; border-radius: 2px; flex: none; }
.chart-events { list-style: none; margin: 0; padding: 8px 14px; display: grid; gap: 2px; }
.chart-event { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; text-align: left; color: var(--text); padding: 2px 4px; border-radius: 3px; }
.chart-event.active, .chart-event:hover { background: var(--bg-subtle); }
.uplot { font-family: inherit; }
.uplot, .uplot * { max-width: 100%; }
.spark-svg { display: block; width: 100%; height: 36px; padding: 0 14px 10px; box-sizing: content-box; max-width: calc(100% - 28px); }
.spark-svg .rx { fill: none; stroke: var(--brand); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.spark-svg .tx { fill: none; stroke: var(--text-faint); stroke-width: 1; vector-effect: non-scaling-stroke; }
.charts-grid > .panel, .ov-row > .panel, .ov-carriers > .panel { margin: 0; }

.msg-full { white-space: normal; overflow-wrap: anywhere; min-width: 260px; }

/* visão geral mais compacta (Blocos e Eventos em largura total) */
.ov-row { margin-bottom: 10px; }
.ov-bottom .stat { padding: 8px 14px; }
.ov-bottom .panel-head { min-height: 34px; padding: 4px 14px; }
.ov-events { padding: 6px 14px; gap: 2px; }
.ov-kv { padding: 8px 14px 4px; }
.ov-probes { padding: 0 14px 8px; }
.ov-alert { margin: 8px 14px 0; }
