/* ==========================================================================
   Console do provedor — tema "fibra": painéis com cantos marcados, grade técnica ao fundo,
   números em Chakra Petch e dados em IBM Plex Mono. Claro, escuro ou automático (/static/theme.js).
   ========================================================================== */
@font-face { font-family: "Chakra Petch"; font-weight: 500; font-display: swap; src: url(/static/fonts/chakra-petch-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url(/static/fonts/chakra-petch-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url(/static/fonts/chakra-petch-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/static/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/static/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

/* ---- tokens: claro (padrão) ---- */
:root {
  color-scheme: light;
  --f-head: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --bg: #eaeff8; --bg-glow: rgba(91, 69, 240, .10); --grid: rgba(20, 32, 72, .055);
  --card: #ffffff; --card-2: #f4f7fd; --field: #f4f7fd;
  --ink: #0a1024; --muted: #586184; --line: #d3daeb; --line-hi: #aeb9da;
  --brand: #5b45f0; --brand-ink: #ffffff; --brand-soft: rgba(91, 69, 240, .10); --brand-glow: rgba(91, 69, 240, .28);
  --shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 8px 24px -14px rgba(20, 32, 72, .35);

  --ok: #0f7a55; --ok-bg: #dff5ec; --warn: #8a5600; --warn-bg: #fff0cc; --bad: #b3202f; --bad-bg: #fde5e8;
  --s-on: #0f7a55; --s-on-bg: #dff5ec; --s-on-dot: #12b76a;
  --s-off: #b3202f; --s-off-bg: #fde5e8; --s-off-dot: #e5384b;
  --s-blk: #8a5600; --s-blk-bg: #fff0cc; --s-blk-dot: #f0a500;
  --s-aw: #1f4fd1; --s-aw-bg: #e1eaff; --s-aw-dot: #2f6bff;
  --s-gray: #566079; --s-gray-bg: #e6eaf4; --s-gray-dot: #9aa5c0;
  --d-down: #3556f0; --d-up: #0d9f95;
  --glow: 0 0 0 rgba(0,0,0,0);
}
/* ---- tokens: escuro (automático pelo sistema, ou escolhido) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #05070f; --bg-glow: rgba(124, 108, 255, .16); --grid: rgba(128, 150, 255, .06);
    --card: #0b1021; --card-2: #0f1630; --field: #080c1a;
    --ink: #e7ecfa; --muted: #8893b8; --line: #1b2544; --line-hi: #34427a;
    --brand: #8b7cff; --brand-ink: #090c1c; --brand-soft: rgba(139, 124, 255, .13); --brand-glow: rgba(139, 124, 255, .38);
    --shadow: 0 0 0 1px rgba(139,124,255,.04) inset, 0 12px 30px -18px rgba(0, 0, 0, .9);
    --ok: #52e39a; --ok-bg: rgba(40, 200, 130, .12); --warn: #ffd166; --warn-bg: rgba(255, 190, 40, .12); --bad: #ff7a88; --bad-bg: rgba(255, 70, 90, .13);
    --s-on: #52e39a; --s-on-bg: rgba(40, 200, 130, .13); --s-on-dot: #36e08c;
    --s-off: #ff7a88; --s-off-bg: rgba(255, 70, 90, .14); --s-off-dot: #ff4d62;
    --s-blk: #ffd166; --s-blk-bg: rgba(255, 190, 40, .13); --s-blk-dot: #ffc23d;
    --s-aw: #8db4ff; --s-aw-bg: rgba(70, 130, 255, .15); --s-aw-dot: #4c8dff;
    --s-gray: #a2add0; --s-gray-bg: rgba(150, 165, 210, .12); --s-gray-dot: #5f6c96;
    --d-down: #6f8bff; --d-up: #2fe0cc;
    --glow: 0 0 18px;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #05070f; --bg-glow: rgba(124, 108, 255, .16); --grid: rgba(128, 150, 255, .06);
  --card: #0b1021; --card-2: #0f1630; --field: #080c1a;
  --ink: #e7ecfa; --muted: #8893b8; --line: #1b2544; --line-hi: #34427a;
  --brand: #8b7cff; --brand-ink: #090c1c; --brand-soft: rgba(139, 124, 255, .13); --brand-glow: rgba(139, 124, 255, .38);
  --shadow: 0 0 0 1px rgba(139,124,255,.04) inset, 0 12px 30px -18px rgba(0, 0, 0, .9);
  --ok: #52e39a; --ok-bg: rgba(40, 200, 130, .12); --warn: #ffd166; --warn-bg: rgba(255, 190, 40, .12); --bad: #ff7a88; --bad-bg: rgba(255, 70, 90, .13);
  --s-on: #52e39a; --s-on-bg: rgba(40, 200, 130, .13); --s-on-dot: #36e08c;
  --s-off: #ff7a88; --s-off-bg: rgba(255, 70, 90, .14); --s-off-dot: #ff4d62;
  --s-blk: #ffd166; --s-blk-bg: rgba(255, 190, 40, .13); --s-blk-dot: #ffc23d;
  --s-aw: #8db4ff; --s-aw-bg: rgba(70, 130, 255, .15); --s-aw-dot: #4c8dff;
  --s-gray: #a2add0; --s-gray-bg: rgba(150, 165, 210, .12); --s-gray-dot: #5f6c96;
  --d-down: #6f8bff; --d-up: #2fe0cc;
  --glow: 0 0 18px;
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); font: 15.5px/1.55 var(--f-body); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 480px at 8% -8%, var(--bg-glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 34px 34px,
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-head); letter-spacing: .005em; }
h1 { font-size: 1.65rem; font-weight: 700; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 1.08rem; font-weight: 600; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: .92rem; }
.mono, .secret, .code, pre.raw { font-family: var(--f-mono); }
.mono { font-size: .88rem; }
.hint { color: var(--muted); font-size: .84rem; margin-top: 5px; display: block; }
details summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.glyph { width: 28px; height: 28px; fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; filter: drop-shadow(var(--glow) var(--brand-glow)); }
.glyph circle { fill: var(--brand); stroke: none; }

/* ---- painéis ("card") com marcas de canto ---- */
.card, .tcard, .ccard, .stat, .tile {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow);
}
.card { padding: 20px; margin-bottom: 16px; }
.card::before, .tcard::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: 6px; opacity: .9;
  background:
    linear-gradient(var(--brand), var(--brand)) top left / 14px 1.5px no-repeat,
    linear-gradient(var(--brand), var(--brand)) top left / 1.5px 14px no-repeat,
    linear-gradient(var(--line-hi), var(--line-hi)) bottom right / 14px 1.5px no-repeat,
    linear-gradient(var(--line-hi), var(--line-hi)) bottom right / 1.5px 14px no-repeat;
}

/* ---- botões e campos ---- */
.btn, .tbtn {
  display: inline-block; padding: 10px 18px; background: var(--brand); color: var(--brand-ink); border: 1px solid transparent; border-radius: 6px;
  font: 600 .95rem var(--f-body); cursor: pointer; text-decoration: none; box-shadow: 0 6px 18px -8px var(--brand-glow); transition: filter .12s, transform .06s, border-color .12s;
}
.btn:hover, .tbtn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active, .tbtn:active { transform: translateY(1px); }
.btn.secondary, .tbtn.secondary { background: transparent; color: var(--ink); border-color: var(--line-hi); box-shadow: none; }
.btn.secondary:hover, .tbtn.secondary:hover { border-color: var(--brand); color: var(--brand); filter: none; }
.btn.link { background: none; color: var(--brand); padding: 0; font-weight: 500; box-shadow: none; border: 0; }
.btn.block { width: 100%; margin-top: 18px; }
.btn.sm { padding: 6px 12px; font-size: .86rem; }
.btn.danger { background: var(--bad); color: #fff; box-shadow: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.tbtn { display: block; width: 100%; text-align: center; padding: 15px 18px; font-size: 1.05rem; border-radius: 8px; }
.tbtn.ok { background: var(--s-on-dot); color: #04130c; }

label { display: block; font-weight: 500; margin: 14px 0 6px; font-size: .88rem; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 6px;
  transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-hi); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=file] { width: 100%; padding: 10px; font: inherit; color: var(--ink); background: var(--field); border: 1px dashed var(--line-hi); border-radius: 6px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 1px solid var(--line-hi); border-radius: 5px; background: var(--card-2); color: var(--ink); font: inherit; cursor: pointer; }
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--ink); margin: 14px 0 6px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
fieldset.group { border: 0; border-top: 1px solid var(--line); padding: 0; margin: 26px 0 0; min-width: 0; }
fieldset.group:first-of-type { border-top: 0; margin-top: 0; }
fieldset.group legend { font: 600 1.05rem var(--f-head); padding: 0 12px 0 0; margin: 0 0 4px; float: left; width: 100%; }
fieldset.group legend + * { clear: both; }
.toolbar input[type=text], .toolbar select { width: auto; padding: 9px 12px; }
form.inline { display: inline; }

/* ---- avisos e chips ---- */
.alert, .flash, .notice { border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; border: 1px solid transparent; }
.alert.bad, .flash.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert.ok, .flash.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert.warn, .flash.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice { margin: 10px 0; }
.notice.aw { background: var(--s-aw-bg); color: var(--s-aw); } .notice.on { background: var(--s-on-bg); color: var(--s-on); } .notice.blk { background: var(--s-blk-bg); color: var(--s-blk); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.s-on { background: var(--s-on-bg); color: var(--s-on); } .chip.s-off { background: var(--s-off-bg); color: var(--s-off); }
.chip.s-blk { background: var(--s-blk-bg); color: var(--s-blk); } .chip.s-aw { background: var(--s-aw-bg); color: var(--s-aw); } .chip.s-gray { background: var(--s-gray-bg); color: var(--s-gray); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.s-on { background: var(--s-on-dot); box-shadow: var(--glow) var(--s-on-dot); } .dot.s-off { background: var(--s-off-dot); }
.dot.s-blk { background: var(--s-blk-dot); } .dot.s-aw { background: var(--s-aw-dot); } .dot.s-gray { background: var(--s-gray-dot); }

/* ---- listas, tabelas ---- */
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.amount { font: 600 1.05rem var(--f-head); white-space: nowrap; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; font-size: .94rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; letter-spacing: .02em; padding: 8px 10px; border-bottom: 1px solid var(--line-hi); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:hover td { background: var(--brand-soft); }
table.t tr:last-child td { border-bottom: 0; }
.secret { font-size: 1.05rem; background: var(--field); border: 1px dashed var(--line-hi); border-radius: 6px; padding: 12px; word-break: break-all; }
.code { word-break: break-all; background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 12px; font-size: .9rem; }
pre.raw { background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow-x: auto; font-size: .82rem; white-space: pre-wrap; }

/* ---- portal do cliente e telas de entrada ---- */
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px 56px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; flex-wrap: wrap; }
header.top .brand { display: flex; align-items: center; gap: 10px; font: 700 1.15rem var(--f-head); }
header.top nav { display: flex; gap: 16px; align-items: center; font-size: .94rem; flex-wrap: wrap; }
.login { max-width: 430px; margin: 7vh auto 0; }
.login h1 { margin-bottom: 8px; }

/* ---- seletor de tema ---- */
.theme { display: inline-flex; border: 1px solid var(--line-hi); border-radius: 7px; padding: 2px; background: var(--card-2); }
.theme button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--muted); font: 500 .76rem var(--f-body); padding: 5px 8px; border-radius: 5px; cursor: pointer; }
.theme button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.theme button:not([aria-pressed="true"]):hover { color: var(--ink); }

/* ---- painel administrativo ---- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); border-right: 1px solid var(--line);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.side .brand { display: flex; align-items: center; gap: 10px; font: 700 1.1rem var(--f-head); padding: 4px 8px 18px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .93rem; position: relative; }
.side a.nav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .75; flex: none; }
.side a.nav:hover { background: var(--brand-soft); }
.side a.nav.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side a.nav.on::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); box-shadow: 0 0 12px var(--brand-glow); }
.side a.nav.on svg { opacity: 1; }
.nav-sep { color: var(--muted); font-size: .76rem; font-weight: 500; padding: 16px 10px 4px; }
.side .foot { margin-top: auto; padding: 14px 4px 0; display: flex; flex-direction: column; gap: 10px; }
.side .foot form { margin: 0; }
/* seletor de tema no menu: ocupa a largura do menu em 3 partes iguais e nunca transborda (fonte maior, zoom do
   navegador ou escala do Windows deixavam o "Escuro" para fora da caixa) */
.side { overflow-x: hidden; }
.side .foot { container-type: inline-size; }
.side .foot .theme { display: grid; grid-template-columns: repeat(var(--theme-n, 3), minmax(0, 1fr)); width: 100%; box-sizing: border-box; }
.side .foot .theme button { justify-content: center; min-width: 0; padding: 6px 4px; overflow: hidden; }
.side .foot .theme button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container (max-width: 205px) { .side .foot .theme:not(:has(.glass-btn)) button span { display: none; } .side .foot .theme:not(:has(.glass-btn)) button { padding: 7px 4px; } }
@container (max-width: 150px) { .side .foot .theme button span { display: none; } }
.main { padding: 24px 28px 64px; min-width: 0; max-width: 1240px; width: 100%; }
.main h1 { margin-bottom: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { display: inline; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; } .stat .n { font: 700 1.6rem var(--f-head); } .stat .l { color: var(--muted); font-size: .85rem; }

/* busca grande */
.bigsearch { display: flex; gap: 10px; margin: 4px 0 20px; position: relative; }
.bigsearch input { flex: 1; min-width: 0; font: 400 1.08rem var(--f-body); padding: 15px 18px 15px 46px; border-radius: 8px; background: var(--card); border: 1px solid var(--line-hi); box-shadow: var(--shadow); }
.bigsearch::before { content: ""; position: absolute; left: 16px; top: 50%; width: 15px; height: 15px; margin-top: -9px; border: 2px solid var(--muted); border-radius: 50%; pointer-events: none; }
.bigsearch::after { content: ""; position: absolute; left: 29px; top: 50%; width: 7px; height: 2px; margin-top: 6px; background: var(--muted); transform: rotate(45deg); pointer-events: none; }
.bigsearch .btn { padding: 0 26px; border-radius: 8px; }

/* quadros de situação */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { display: block; padding: 16px 18px 15px 22px; text-decoration: none; color: var(--ink); overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--line-hi); }
a.tile { transition: transform .1s, border-color .12s; }
a.tile:hover { transform: translateY(-2px); border-color: var(--line-hi); text-decoration: none; }
.tile .n { font: 700 2.6rem/1.05 var(--f-head); letter-spacing: -.01em; }
.tile .l { font-weight: 600; margin-top: 4px; }
.tile .h { color: var(--muted); font-size: .82rem; margin-top: 1px; }
.tile.s-on::before { background: var(--s-on-dot); box-shadow: 0 0 14px var(--s-on-dot); } .tile.s-off::before { background: var(--s-off-dot); }
.tile.s-blk::before { background: var(--s-blk-dot); } .tile.s-aw::before { background: var(--s-aw-dot); } .tile.s-gray::before { background: var(--s-gray-dot); }
.tile.s-on .n { color: var(--s-on); text-shadow: var(--glow) color-mix(in srgb, var(--s-on-dot) 55%, transparent); }
.tile.s-off .n { color: var(--s-off); } .tile.s-blk .n { color: var(--s-blk); } .tile.s-aw .n { color: var(--s-aw); } .tile.s-gray .n { color: var(--s-gray); }
.tile.s-on .l::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--s-on-dot); vertical-align: middle; animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-on-dot) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }

/* cartões de cliente (resultado da busca) */
.ccard { padding: 16px 18px 16px 22px; margin-bottom: 12px; overflow: hidden; }
.ccard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--line-hi); }
.ccard.s-on::before { background: var(--s-on-dot); box-shadow: 0 0 14px var(--s-on-dot); } .ccard.s-off::before { background: var(--s-off-dot); }
.ccard.s-blk::before { background: var(--s-blk-dot); } .ccard.s-aw::before { background: var(--s-aw-dot); } .ccard.s-gray::before { background: var(--s-gray-dot); }
.ccard-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.ccard-name { font: 600 1.12rem var(--f-head); text-decoration: none; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 18px; margin-bottom: 14px; }
.cgrid .k { color: var(--muted); font-size: .78rem; }
.cgrid .v { font-size: .96rem; word-break: break-word; }
.chips-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips-filter a { text-decoration: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-hi); background: var(--card); color: var(--ink); font-size: .9rem; display: inline-flex; gap: 8px; align-items: center; }
.chips-filter a:hover { border-color: var(--brand); }
.chips-filter a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }

/* consumo */
.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.usage .u { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--card-2); }
.usage .k { font-size: .78rem; color: var(--muted); }
.usage .v { font: 500 .88rem var(--f-mono); margin-top: 3px; }
.usage .h { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.tchart { width: 100%; height: auto; display: block; }
.tchart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.tchart .axis { fill: var(--muted); font: 11px var(--f-mono); }
.tchart .hit { fill: transparent; }
.tchart .day:hover .hit { fill: var(--brand-soft); }
.bar-d { fill: var(--d-down); } .bar-u { fill: var(--d-up); }
.legend { display: flex; gap: 16px; font-size: .84rem; color: var(--muted); margin: 6px 0 0; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.legend .sw.bar-d { background: var(--d-down); } .legend .sw.bar-u { background: var(--d-up); }
form.period { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 10px; }
form.period label { margin-top: 0; }
form.period input { width: auto; }

/* ---- área do técnico (celular primeiro) ---- */
.tech { max-width: 640px; margin: 0 auto; padding: 0 14px 70px; }
.tech header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; }
.tech header .who { font-size: .9rem; color: var(--muted); }
.tech header .hr { display: flex; align-items: center; gap: 8px; }
.tech header .brand { display: flex; align-items: center; gap: 10px; font: 700 1.05rem var(--f-head); }
.tech h1 { font-size: 1.4rem; }
.tcard { padding: 16px; margin-bottom: 14px; border-radius: 8px; }
.tcard h2 { font-size: 1rem; margin-bottom: 10px; }
a.tos { display: block; position: relative; overflow: hidden; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px 14px 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
a.tos::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--s-aw-dot); }
a.tos.s-blk::before { background: var(--s-blk-dot); } a.tos.s-on::before { background: var(--s-on-dot); }
a.tos .t { font: 600 1.05rem var(--f-head); }
.tech input[type=text], .tech input[type=password], .tech textarea, .tech input[type=tel] { font-size: 1rem; }

/* ---- responsivo ---- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; gap: 6px; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); align-items: center; }
  .side .brand { padding: 0 10px 0 4px; white-space: nowrap; }
  .side a.nav { white-space: nowrap; } .side a.nav.on::before { display: none; }
  .side .foot { margin: 0 0 0 8px; flex-direction: row; align-items: center; padding: 0; }
  .nav-sep { display: none; }
  .main { padding: 16px 14px 60px; }
  .grid2 { grid-template-columns: 1fr; }
  .bigsearch { flex-direction: column; } .bigsearch .btn { padding: 14px; }
  .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .theme button span { display: none; } .theme button { padding: 6px 8px; }
  .tech header { align-items: flex-start; } .tech header .brand { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- fotos dos colaboradores ---- */
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--line-hi); font: 700 .82rem var(--f-head); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 26px; height: 26px; font-size: .66rem; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.2rem; }
.who { display: inline-flex; align-items: center; gap: 10px; }
.nav.me { gap: 8px; }
.photoform { display: inline-flex; gap: 6px; align-items: center; }
.filebtn { cursor: pointer; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-weight: 400; }
.bgprev { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
input[type="range"] { width: 100%; padding: 0; accent-color: var(--brand); }

/* ---- painel inicial: gráficos animados ---- */
:root { --c-orange: #d9680b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-orange: #ff9a3d; } }
:root[data-theme="dark"] { --c-orange: #ff9a3d; }
.t-on { --c: var(--s-on-dot); } .t-off { --c: var(--s-off-dot); } .t-blk { --c: var(--s-blk-dot); }
.t-aw { --c: var(--s-aw-dot); } .t-gray { --c: var(--s-gray-dot); } .t-orange { --c: var(--c-orange); }
.livebar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 12px; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--s-on-dot); box-shadow: 0 0 0 0 var(--s-on-dot); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-on-dot) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.dash { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-bottom: 18px; }
.panel { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 14px 16px 16px; grid-column: span 3; min-width: 0; }
.panel.w4 { grid-column: span 4; } .panel.w6 { grid-column: span 6; } .panel.w8 { grid-column: span 8; }
.panel h3 { margin: 0 0 10px; font-size: .95rem; text-align: center; }
.panel h3 .cnt { color: var(--muted); font-weight: 500; }
@media (max-width: 1100px) { .panel, .panel.w4 { grid-column: span 6; } .panel.w8 { grid-column: span 12; } }
@media (max-width: 640px) { .panel, .panel.w4, .panel.w6, .panel.w8 { grid-column: span 12; } }
.dbody { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.donut { width: 128px; height: 128px; flex: none; transform: rotate(-90deg); overflow: visible; }
.donut .ring { fill: none; stroke: var(--line); stroke-width: 5; opacity: .55; }
.donut .seg { fill: none; stroke: var(--c); stroke-width: 5; animation: seg 1s cubic-bezier(.2, .7, .2, 1) both; }
.donut .seg:hover { stroke-width: 6; }
@keyframes seg { from { stroke-dasharray: 0 100; } }
.donut .dc { transform: rotate(90deg); transform-origin: 21px 21px; font: 700 7px var(--f-head); fill: var(--ink); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: .86rem; min-width: 0; }
.legend li, .legend a { display: flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; }
.legend a:hover span { text-decoration: underline; }
.legend b { margin-left: auto; padding-left: 8px; font: 600 .86rem var(--f-mono); }
.sw { width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.nodata { text-align: center; margin: 6px 0 0; }
.hb { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: .86rem; }
.hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htrack { height: 12px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.htrack i { display: block; height: 100%; background: var(--brand); border-radius: 0 3px 3px 0; animation: grow .9s cubic-bezier(.2, .7, .2, 1) both; }
.hb b { font: 600 .86rem var(--f-mono); min-width: 2ch; text-align: right; }
@keyframes grow { from { width: 0 !important; } }
.vchart { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 6px; }
.vb { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 3px; font-size: .72rem; color: var(--muted); }
.vb b { font: 600 .74rem var(--f-mono); color: var(--ink); }
.vcol { width: 100%; max-width: 28px; flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line-hi); }
.vcol i { display: block; width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.vb.today .vcol i { background: var(--s-on-dot); }
.vb em { font-style: normal; white-space: nowrap; transform: rotate(-40deg); transform-origin: top right; margin-top: 4px; height: 1.4em; }
@keyframes rise { from { height: 0 !important; } }
@media (prefers-reduced-motion: reduce) {
  .donut .seg, .htrack i, .vcol i, .live i { animation: none; }
}
.actions .photoform { margin-right: 6px; }
.ptform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ptform input { width: auto; margin: 0; }

/* concentrador: barras de proporção */
.hbar { display: inline-block; width: 120px; height: 8px; background: var(--line); border-radius: 99px; vertical-align: middle; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.hbar.big { display: block; width: 100%; height: 12px; margin: 10px 0; }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }

/* painel de cada login (cliente.html) */
.lp { margin-bottom: 14px; }
.lp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.lp-title { display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 28px; }
.lp-cols p { margin: 4px 0; }
.lp-cols > div + div { border-left: 1px solid var(--line); padding-left: 24px; }
@media (max-width: 640px) { .lp-cols > div + div { border-left: 0; padding-left: 0; } }

/* ---- marca (logo) ---- */
.brand-logo { height: 30px; width: auto; max-width: 160px; object-fit: contain; display: block; flex: none; }
.side .brand-logo { height: 34px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logoprev { background: repeating-conic-gradient(var(--card-2) 0% 25%, var(--card) 0% 50%) 0 0 / 18px 18px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: inline-block; }
.logoprev img { display: block; max-width: 320px; height: auto; max-height: 80px; }
.wrap, .shell { position: relative; z-index: 1; }

/* ---- tela de entrada futurista ---- */
@property --ls-a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.ls-stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ls-stage canvas { position: absolute; inset: 0; }
.ls-aurora i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(80px); opacity: .5; animation: ls-drift 22s ease-in-out infinite alternate; }
.ls-aurora i:nth-child(1) { background: radial-gradient(circle, var(--brand-glow), transparent 65%); top: -18vmax; left: -12vmax; }
.ls-aurora i:nth-child(2) { background: radial-gradient(circle, color-mix(in srgb, var(--d-up) 55%, transparent), transparent 65%); bottom: -22vmax; right: -14vmax; animation-duration: 28s; animation-delay: -8s; opacity: .35; }
.ls-aurora i:nth-child(3) { background: radial-gradient(circle, color-mix(in srgb, var(--d-down) 45%, transparent), transparent 65%); top: 30%; left: 55%; width: 30vmax; height: 30vmax; animation-duration: 34s; animation-delay: -15s; opacity: .28; }
.ls-grid { position: absolute; left: -25%; right: -25%; bottom: -8%; height: 52%; transform: perspective(520px) rotateX(62deg); transform-origin: 50% 100%;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 56px 56px;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%); animation: ls-grid 5s linear infinite; }
.ls-scan { position: absolute; left: 0; right: 0; height: 120px; top: -120px; background: linear-gradient(to bottom, transparent, var(--brand-soft), transparent); animation: ls-scan 9s linear infinite; opacity: .7; }
@keyframes ls-drift { to { transform: translate(8vmax, 6vmax) scale(1.18); } }
@keyframes ls-grid { to { background-position: 0 56px; } }
@keyframes ls-scan { to { transform: translateY(calc(100vh + 240px)); } }

.login .ls-card { position: relative; overflow: hidden; padding: 28px 26px 24px; border-radius: 16px; backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  background: color-mix(in srgb, var(--card) 80%, transparent); border: 1px solid var(--line-hi); box-shadow: 0 20px 60px -24px var(--brand-glow), var(--shadow); animation: ls-in .8s cubic-bezier(.2, .8, .2, 1) both; }
.login .ls-card::before { content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--ls-a), transparent 0 62%, var(--brand) 82%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; animation: ls-spin 6s linear infinite; }
.login .ls-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), var(--brand-soft), transparent 62%); opacity: .9; }
.login .ls-card > * { position: relative; z-index: 1; }
.login .ls-card form > *, .login .ls-card > p, .login .ls-card > .alert { animation: ls-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.login .ls-card form > *:nth-child(2), .login .ls-card form > *:nth-child(3) { animation-delay: .25s; }
.login .ls-card form > *:nth-child(4), .login .ls-card form > *:nth-child(5) { animation-delay: .35s; }
.login .ls-card form > *:nth-child(6) { animation-delay: .45s; }
.login .ls-card .btn.block { position: relative; overflow: hidden; box-shadow: 0 8px 26px -10px var(--brand-glow); transition: transform .15s, box-shadow .2s; }
.login .ls-card .btn.block::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-18deg); animation: ls-shine 4.2s ease-in-out infinite; }
.login .ls-card .btn.block:hover { transform: translateY(-1px); box-shadow: 0 12px 34px -8px var(--brand-glow); }
.login .ls-card input:focus { box-shadow: 0 0 0 3px var(--brand-soft), 0 0 18px -4px var(--brand-glow); border-color: var(--brand); }
@keyframes ls-in { from { opacity: 0; transform: translateY(26px) scale(.97); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes ls-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ls-spin { to { --ls-a: 360deg; } }
@keyframes ls-shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }

.ls-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 18px; }
.ls-orb { position: relative; width: 104px; height: 104px; display: grid; place-items: center; margin-bottom: 4px; }
.ls-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--brand); opacity: .55; animation: ls-orbit 14s linear infinite; }
.ls-ring.r2 { inset: 9px; border-style: solid; border-color: transparent; border-top-color: var(--brand); border-right-color: color-mix(in srgb, var(--brand) 40%, transparent); opacity: .9; animation-duration: 4.5s; animation-direction: reverse; filter: drop-shadow(0 0 6px var(--brand-glow)); }
.ls-logo { max-width: 66px; max-height: 66px; object-fit: contain; animation: ls-float 5s ease-in-out infinite; filter: drop-shadow(0 0 14px var(--brand-glow)); }
.ls-glyph { width: 52px; height: 52px; animation: ls-float 5s ease-in-out infinite; }
.ls-name { font: 700 1.35rem var(--f-head); letter-spacing: .02em; }
.ls-sub { color: var(--muted); font-size: .92rem; letter-spacing: .12em; text-transform: uppercase; }
.ls-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 4px 12px; border-radius: 999px; font: 500 .74rem var(--f-mono); color: var(--s-on); background: var(--s-on-bg); border: 1px solid color-mix(in srgb, var(--s-on) 30%, transparent); }
.ls-status span { transition: opacity .25s; } .ls-status span.out { opacity: 0; }
.ls-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--s-on-dot); box-shadow: 0 0 0 0 var(--s-on-dot); animation: ls-pulse 1.8s ease-out infinite; }
@keyframes ls-orbit { to { transform: rotate(360deg); } }
@keyframes ls-float { 50% { transform: translateY(-4px); } }
@keyframes ls-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-on-dot) 70%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

/* animação desligada pelo admin, ou aparelho com "reduzir movimento": tudo parado e legível */
.login .ls-card.ls-static, .login .ls-card.ls-static::before, .login .ls-card.ls-static * { animation: none !important; }
.login .ls-card.ls-static::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  .ls-stage { display: none; }
  .login .ls-card, .login .ls-card::before, .login .ls-card *, .login .ls-card *::after { animation: none !important; }
  .login .ls-card::before { display: none; }
}
@media (max-width: 480px) { .login { margin-top: 3vh; } .ls-orb { width: 88px; height: 88px; } }

/* com logo enviada: logo grande (sem anéis) e uma linha de luz varrendo por baixo */
.ls-orb.has-logo { width: auto; height: auto; min-height: 0; padding-bottom: 14px; margin-bottom: 6px; }
.ls-orb.has-logo .ls-ring { display: none; }
.ls-orb.has-logo .ls-logo { max-width: 240px; max-height: 84px; }
.ls-orb.has-logo::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); background-size: 200% 100%; animation: ls-sweep 3.4s linear infinite; }
@keyframes ls-sweep { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.ls-static .ls-orb.has-logo::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .ls-orb.has-logo::after { animation: none; } }

/* ---- efeitos dentro do painel (html[data-fx="on"]; desligados por "reduzir movimento") ---- */
#fx-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1000; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, var(--d-down), var(--brand), var(--d-up)); box-shadow: 0 0 12px var(--brand-glow); }
#fx-bar.go { opacity: 1; width: 88%; transition: width 9s cubic-bezier(.1, .7, .2, 1); }

.fx-pulse { display: block; margin: 14px 4px 0; padding: 10px 10px 8px; border-radius: 10px; text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line); position: relative; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.fx-pulse[hidden] { display: none; }
.fx-pulse:hover { border-color: var(--brand); box-shadow: 0 0 22px -8px var(--brand-glow); }
.fx-p-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fx-p-title { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.fx-p-n { font: 700 1.5rem/1 var(--f-head); color: var(--s-on); text-shadow: 0 0 14px color-mix(in srgb, var(--s-on-dot) 45%, transparent); }
.fx-pulse canvas { display: block; width: 100%; height: 44px; margin-top: 4px; }
.fx-p-sub { font: 500 .66rem/1.35 var(--f-mono); color: var(--muted); margin-top: 3px; white-space: normal; overflow-wrap: anywhere; }
.fx-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--s-on-dot); animation: pulse 2s ease-out infinite; }

.fxhero { position: relative; overflow: hidden; margin-bottom: 14px; border-radius: 10px; border: 1px solid var(--line-hi); min-height: 84px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--card) 88%, transparent), color-mix(in srgb, var(--brand) 9%, var(--card))); box-shadow: var(--shadow); }
.fxhero canvas { position: absolute; inset: 0; opacity: .9; }
.fxhero::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; left: -40%; background: linear-gradient(100deg, transparent, var(--brand-soft), transparent); animation: fx-sweep 7s ease-in-out infinite; pointer-events: none; }
.fxhero-in { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.fxhero-t { font: 700 1.3rem var(--f-head); }
.fxhero-s { color: var(--muted); font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; }
@keyframes fx-sweep { 0%, 35% { left: -40%; } 100% { left: 130%; } }

html[data-fx="on"] .main > * { animation: fx-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
html[data-fx="on"] .main > *:nth-child(2) { animation-delay: .04s; } html[data-fx="on"] .main > *:nth-child(3) { animation-delay: .08s; }
html[data-fx="on"] .main > *:nth-child(4) { animation-delay: .12s; } html[data-fx="on"] .main > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes fx-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
html[data-fx="on"] a.tile:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 10px 30px -14px var(--brand-glow); }
html[data-fx="on"] .panel { transition: border-color .2s, box-shadow .2s; }
html[data-fx="on"] .panel:hover, html[data-fx="on"] .ccard:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); box-shadow: 0 8px 28px -16px var(--brand-glow); }
html[data-fx="on"] .side { position: sticky; }
html[data-fx="on"] .side::after { content: ""; position: absolute; top: 0; right: -1px; width: 2px; height: 100%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--brand), var(--d-up), transparent); background-size: 100% 240%; animation: fx-flow 6s linear infinite; opacity: .7; }
@keyframes fx-flow { from { background-position: 0 -140%; } to { background-position: 0 140%; } }
html[data-fx="on"] .side .brand svg, html[data-fx="on"] .side .brand-logo { filter: drop-shadow(0 0 8px var(--brand-glow)); animation: fx-glow 4.5s ease-in-out infinite; }
@keyframes fx-glow { 50% { filter: drop-shadow(0 0 14px var(--brand-glow)); } }
html[data-fx="on"] .side a.nav { transition: background .15s, transform .15s, color .15s; }
html[data-fx="on"] .side a.nav:hover { transform: translateX(3px); }
html[data-fx="on"] .side a.nav.on::before { animation: fx-glow-bar 2.8s ease-in-out infinite; }
@keyframes fx-glow-bar { 50% { box-shadow: 0 0 20px var(--brand); } }
html[data-fx="on"] #rows tr.fresh td { animation: fx-fresh 2.2s ease-out; }
@keyframes fx-fresh { 0% { background-color: color-mix(in srgb, var(--brand) 40%, transparent); box-shadow: inset 3px 0 0 var(--brand); } 100% { box-shadow: inset 3px 0 0 transparent; } }

@media (max-width: 900px) { .fx-pulse { display: none; } html[data-fx="on"] .side::after { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html[data-fx="on"] *, html[data-fx="on"] *::before, html[data-fx="on"] *::after { animation: none !important; transition: none !important; }
  .fxhero canvas, #fx-bar { display: none; }
}

/* Rede ao vivo: em telas baixas o flex do menu comprimia o widget e cortava o conteúdo */
.side > * { flex-shrink: 0; }
.fx-pulse { min-height: 0; }
@media (max-height: 800px) { .fx-pulse canvas { height: 30px; } .fx-pulse { margin-top: 8px; padding: 8px 10px 6px; } }
@media (max-height: 640px) { .fx-pulse { display: none; } }

/* ---- topo do painel (busca por campo, dashboards, sino, ajustes) e cabeçalho do menu ---- */
.sidehead { display: flex; flex-direction: column; gap: 10px; padding: 0 2px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.me-card { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 6px; border-radius: 10px; }
.me-card:hover { background: var(--brand-soft); }
.me-card span:last-child { display: flex; flex-direction: column; min-width: 0; }
.me-card b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card small { color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menusearch { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line-hi); }
.menusearch svg { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; flex: none; }
.menusearch input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 0; font: 400 .9rem var(--f-body); color: var(--ink); outline: none; box-shadow: none; }
.menusearch:focus-within { border-bottom-color: var(--brand); }

.topbar { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; position: relative; z-index: 20; flex-wrap: wrap; }
.tb-search { flex: 1 1 360px; display: flex; align-items: stretch; min-width: 0; background: var(--card); border: 1px solid var(--line-hi); border-radius: 999px; box-shadow: var(--shadow); overflow: hidden; }
.tb-search select { border: 0; border-right: 1px solid var(--line); background-color: transparent; padding: 0 14px 0 18px; font: 500 .92rem var(--f-body); color: var(--ink); max-width: 150px; border-radius: 0; box-shadow: none; }
.tb-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 14px; font: 400 .98rem var(--f-body); color: var(--ink); outline: none; box-shadow: none; }
.tb-search button { border: 0; background: transparent; padding: 0 16px; cursor: pointer; color: var(--muted); }
.tb-search button svg, .tb-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tb-search button:hover { color: var(--brand); }
.tb-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.tb-dash { flex: 0 1 250px; min-width: 0; border-radius: 999px; padding: 10px 32px 10px 16px; background-color: var(--card); border: 1px solid var(--line-hi); font: 500 .88rem var(--f-body); color: var(--ink); cursor: pointer; }
.dd { position: relative; }
.dd > summary { list-style: none; }
.dd > summary::-webkit-details-marker { display: none; }
.tb-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 1px solid var(--line-hi); color: var(--ink); cursor: pointer; position: relative; box-shadow: var(--shadow); }
.tb-btn:hover, .dd[open] > .tb-btn { border-color: var(--brand); color: var(--brand); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--d-down, #ef4444); color: #fff; font: 700 .7rem/18px var(--f-body); text-align: center; font-style: normal; }
.badge[hidden] { display: none; }
.dd-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-width: calc(100vw - 28px); max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line-hi); border-radius: 12px; box-shadow: 0 18px 48px -12px rgba(0, 0, 0, .45); padding: 8px; z-index: 40; }
.dd-menu { width: 230px; padding: 6px; display: flex; flex-direction: column; }
.dd-menu a, .dd-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font: 500 .92rem var(--f-body); background: transparent; border: 0; cursor: pointer; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--brand-soft); }
.dd-menu form { margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }
.nt { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.nt:hover { background: var(--brand-soft); }
.nt b { min-width: 30px; text-align: center; padding: 3px 6px; border-radius: 8px; font: 700 .85rem var(--f-mono); background: var(--brand-soft); }
.nt.bad b { background: color-mix(in srgb, #ef4444 22%, transparent); color: #ef4444; }
.nt.warn b { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #d97706; }
.nt.ev small { color: var(--muted); }
.nt-h { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
@media (max-width: 900px) { .topbar { margin-top: 0; } .tb-search { flex-basis: 100%; order: 1; } .tb-dash { flex: 1 1 0; } .side .sidehead { display: none; } }

/* listas dos seletores do topo seguem o tema (a lista nativa herdava texto claro sobre fundo branco) */
.tb-search select, .tb-dash { color-scheme: light; }
:root[data-theme="dark"] .tb-search select, :root[data-theme="dark"] .tb-dash { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-search select, :root:not([data-theme="light"]) .tb-dash { color-scheme: dark; } }
.tb-search select option, .tb-dash option { background: var(--card); color: var(--ink); }
.me-card b { line-height: 1.25; }
.me-card small { line-height: 1.3; margin-top: 1px; }
.me-card span:last-child { flex: 1; }

.qrbox svg { display: block; width: 100%; height: auto; }

[data-field="create_body"], [data-field="client_cert"], [data-field="client_key"], [data-field="extra_headers"] { grid-column: 1 / -1; }
