/* AlwaysDesk — sistema visual do portal do gestor e da Central. */
:root {
  --brand: #e5242b; --brand-600: #cc1d23; --brand-700: #b3171d; --brand-tint: #fdeced; --brand-ring: rgba(229, 36, 43, .18);
  --ink: #0f1728; --ink-700: #344054; --ink-500: #667085; --ink-400: #98a2b3; --ink-300: #d0d5dd;
  --bg: #f4f6f9; --surface: #fff; --surface-2: #f8fafc; --hover: #f2f4f7;
  --line: #e4e7ec; --line-2: #eef1f5;
  --side: #0c1322; --side-2: #141d31; --side-ink: #c4cbd8; --side-mute: #7a869c;
  --ok: #0f8a54; --ok-tint: #e3f5ec; --warn: #b25e09; --warn-tint: #fdf1e0; --bad: #c4161c; --bad-tint: #fdecec; --info: #2459c7; --info-tint: #e8effd;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05); --sh-2: 0 8px 24px -6px rgba(16, 24, 40, .12); --sh-3: 0 24px 48px -12px rgba(16, 24, 40, .28);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
#root { min-height: 100vh; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; color: inherit; }
h1, h2, h3 { letter-spacing: -.015em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-500); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.spinner { width: 24px; height: 24px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
.center-load { display: grid; place-items: center; min-height: 40vh; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(15, 138, 84, .45); } 70% { box-shadow: 0 0 0 6px rgba(15, 138, 84, 0); } 100% { box-shadow: 0 0 0 0 rgba(15, 138, 84, 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Botões ─────────────────────────────────────────────── */
.btn { height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid transparent; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; text-decoration: none !important; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(179, 23, 29, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #1d2939; }
.btn-ghost { background: var(--surface); color: var(--ink-700); border-color: var(--line); box-shadow: var(--sh-1); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover:not(:disabled) { filter: brightness(.94); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #f5c5c7; }
.btn-danger:hover:not(:disabled) { background: var(--bad-tint); }
.btn-danger-solid { background: var(--bad); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink-500); display: inline-grid; place-items: center; padding: 0; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-tint); color: var(--bad); }
.icon-btn.bordered { border-color: var(--line); background: var(--surface); }

/* ── Campos ─────────────────────────────────────────────── */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.field > small { display: block; color: var(--ink-500); font-size: 12px; margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
input, select, textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--ink-300); border-radius: var(--r-sm); font-size: 14px; font-family: inherit; background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s; box-shadow: var(--sh-1); }
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
input[type=checkbox] { width: 16px; height: 16px; box-shadow: none; accent-color: var(--brand); }
input[type=color] { padding: 3px; width: 56px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.check input { margin-top: 2px; flex: none; }
.check b { display: block; font-size: 13.5px; }
.check small { color: var(--ink-500); font-size: 12.5px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
.input-icon input { padding-left: 34px; }

/* ── Status ─────────────────────────────────────────────── */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-700); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-400); flex: none; }
.status.on i { background: var(--ok); animation: pulse 2s infinite; }
.status.on { color: var(--ok); }
.status.warn i { background: var(--warn); } .status.warn { color: var(--warn); }
.status.bad i { background: var(--bad); } .status.bad { color: var(--bad); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--hover); color: var(--ink-700); white-space: nowrap; }
.pill.ok { background: var(--ok-tint); color: var(--ok); } .pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.bad { background: var(--bad-tint); color: var(--bad); } .pill.info { background: var(--info-tint); color: var(--info); }
.pill.brand { background: var(--brand-tint); color: var(--brand-700); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* ── Login ──────────────────────────────────────────────── */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-side { position: relative; overflow: hidden; background: var(--side); color: #fff; padding: 44px 56px; display: flex; flex-direction: column; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 520px at 85% 110%, rgba(229, 36, 43, .32), transparent 60%), radial-gradient(600px 400px at -10% -10%, rgba(80, 110, 190, .22), transparent 60%); pointer-events: none; }
.auth-side::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); pointer-events: none; }
.auth-side > * { position: relative; z-index: 1; }
.lockup { display: flex; align-items: center; gap: 11px; }
.lockup b { white-space: nowrap; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.lockup small { display: block; font-size: 12px; color: var(--side-mute); font-weight: 500; letter-spacing: .02em; margin-top: -1px; }
.lockup img.brand-logo { max-height: 56px; max-width: 210px; width: auto; object-fit: contain; }
.side .lockup.brand { padding: 10px 10px 26px; justify-content: flex-start; }
.auth-copy { margin-top: auto; max-width: 520px; }
.auth-copy h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; font-weight: 700; margin: 0 0 16px; letter-spacing: -.03em; }
.auth-copy h1 em { font-style: normal; color: #ff6b70; }
.auth-copy p { color: var(--side-ink); font-size: 15.5px; max-width: 440px; margin: 0; }
.auth-scene { margin: 44px 0 auto; max-width: 520px; }
.auth-foot { margin-top: 36px; font-size: 12px; color: var(--side-mute); display: flex; gap: 18px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; animation: rise .35s ease both; }
.auth-card h2 { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.02em; }
.auth-card .sub { color: var(--ink-500); margin: 0 0 28px; }
.auth-card .btn { width: 100%; height: 44px; font-size: 14.5px; margin-top: 6px; }
.auth-card input { height: 44px; }
.auth-help { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-500); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-error { background: var(--bad-tint); color: var(--bad); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; font-weight: 500; }
/* Cena ilustrativa: janela de sessão remota. */
.scene-win { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); overflow: hidden; backdrop-filter: blur(6px); }
.scene-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 11.5px; color: var(--side-mute); }
.scene-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.scene-bar span { margin-left: 10px; }
.scene-body { display: grid; grid-template-columns: 1fr 1fr; }
.scene-cell { padding: 18px 18px 20px; }
.scene-cell + .scene-cell { border-left: 1px solid rgba(255, 255, 255, .08); }
.scene-cell .eyebrow { color: var(--side-mute); font-size: 10px; }
.scene-id { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: .04em; margin: 6px 0 10px; color: #fff; }
.scene-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, .06); color: var(--side-ink); }
.scene-row:first-of-type { border-top: 0; }
.scene-row .status { color: #46d493; font-size: 11.5px; }
.scene-row .status i { background: #46d493; }
.scene-row .status.off { color: var(--side-mute); } .scene-row .status.off i { background: var(--side-mute); animation: none; }
.auth-mobile { display: none; margin-bottom: 36px; }
.auth-mobile b { color: var(--ink); }
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-mobile { display: flex; } .auth-main { place-items: start center; padding-top: 56px; } }

/* ── Estrutura logada ───────────────────────────────────── */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px 14px; }
.side .lockup { padding: 6px 8px 24px; color: #fff; gap: 12px; }
.side .lockup .ad-mark { width: 42px; height: 42px; }
.auth-side .lockup .ad-mark { width: 48px; height: 48px; }
.auth-side .lockup b { font-size: 22px; }
.side-label { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--side-mute); padding: 14px 12px 6px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--side-ink); font-weight: 500; font-size: 13.5px; text-align: left; width: 100%; position: relative; }
.nav svg { color: var(--side-mute); flex: none; }
.nav:hover { background: var(--side-2); color: #fff; }
.nav.active { background: var(--side-2); color: #fff; }
.nav.active svg { color: #fff; }
.nav.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .count { margin-left: auto; font-size: 11.5px; color: var(--side-mute); font-variant-numeric: tabular-nums; }
.nav .count.alert { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .07); padding: 14px 10px 0; display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { display: block; color: var(--side-mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .icon-btn { color: var(--side-mute); }
.side-foot .icon-btn:hover { background: var(--side-2); color: #fff; }
.plan-chip { margin: 12px 4px 0; padding: 12px; border-radius: var(--r); background: var(--side-2); border: 1px solid rgba(255, 255, 255, .06); font-size: 12px; }
.plan-chip b { color: #fff; font-size: 12.5px; }
.plan-chip .bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .1); margin: 8px 0 5px; overflow: hidden; }
.plan-chip .bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.plan-chip small { color: var(--side-mute); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-weight: 600; font-size: 14px; color: var(--ink-700); display: flex; align-items: center; gap: 8px; }
.topbar .title span { color: var(--ink-400); }
.topbar .spacer { flex: 1; }
.topbar .input-icon { width: 300px; }
.topbar .input-icon input { height: 36px; background: var(--surface-2); box-shadow: none; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.content { padding: 28px; width: 100%; max-width: 1320px; animation: rise .25s ease both; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-500); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-500); font-weight: 600; font-size: 13px; background: none; border: 0; padding: 0; margin-bottom: 14px; }
.back:hover { color: var(--ink); }

/* Faixa de números (uma peça única, sem cards soltos). */
.metrics { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); margin-bottom: 22px; overflow: hidden; }
.metric { padding: 18px 20px; border-left: 1px solid var(--line-2); min-width: 0; }
.metric:first-child { border-left: 0; }
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } .metric:nth-child(3n+1) { border-left: 0; } }
@media (max-width: 640px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .metric { border-left: 0; } }
.metric .label { font-size: 12.5px; color: var(--ink-500); font-weight: 500; display: flex; align-items: flex-start; gap: 7px; line-height: 1.25; min-height: 2.5em; }
.metric .label svg { flex: none; margin-top: 1px; }
.metric .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .value small { font-size: 14px; color: var(--ink-400); font-weight: 600; margin-left: 2px; }
.metric .hint { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.metric.accent .value { color: var(--brand); }
.metric.ok .value { color: var(--ok); }
.metric.bad .value { color: var(--bad); }
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } .metric:nth-child(3n+1) { border-left: 0; } .metric:nth-child(n+4) { border-top: 1px solid var(--line-2); } }
@media (max-width: 640px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metric { border-left: 0 !important; border-top: 1px solid var(--line-2); } .metric:nth-child(-n+2) { border-top: 0; } .metric:nth-child(2n) { border-left: 1px solid var(--line-2) !important; } }

/* Painéis e tabelas */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); margin-bottom: 20px; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); min-height: 56px; flex-wrap: wrap; }
.panel-head h3 { font-size: 14.5px; font-weight: 600; margin: 0; }
.panel-head p { margin: 0; font-size: 12.5px; color: var(--ink-500); }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-500); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1180px) { .cols, .cols-2 { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-500); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--surface-2); }
td.right, th.right { text-align: right; }
td .sub { display: block; font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.device-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.device-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--hover); color: var(--ink-500); display: grid; place-items: center; flex: none; }
.device-ic.on { background: var(--ok-tint); color: var(--ok); }
.device-cell b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; padding: 52px 24px; color: var(--ink-500); }
.empty .ic { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px; background: var(--hover); display: grid; place-items: center; color: var(--ink-400); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 auto 16px; max-width: 380px; }

/* Barra de filtros */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--hover); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--ink-500); display: inline-flex; align-items: center; gap: 6px; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.seg button .n { color: var(--ink-400); font-weight: 500; }
.toolbar select { width: auto; min-width: 170px; height: 34px; }
.toolbar .spacer { flex: 1; }

/* Lista de atividade */
.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { display: flex; gap: 12px; padding: 11px 18px; }
.feed li + li { border-top: 1px solid var(--line-2); }
.feed .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--hover); color: var(--ink-500); flex: none; }
.feed .ic.ok { background: var(--ok-tint); color: var(--ok); } .feed .ic.bad { background: var(--bad-tint); color: var(--bad); } .feed .ic.info { background: var(--info-tint); color: var(--info); }
.feed .ic svg { width: 15px; height: 15px; }
.feed b { font-weight: 600; font-size: 13px; display: block; }
.feed small { color: var(--ink-500); font-size: 12px; }
.feed .unread b::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }

/* Barras de distribuição e medidores */
.dist { padding: 6px 18px 14px; }
.dist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 0; font-size: 13px; }
.dist-row .name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dist-row .name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-row .bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--hover); overflow: hidden; }
.dist-row .bar i { display: block; height: 100%; border-radius: 99px; }
.meter { margin-bottom: 16px; }
.meter:last-child { margin-bottom: 0; }
.meter .lab { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.meter .lab span:last-child { color: var(--ink-500); font-variant-numeric: tabular-nums; }
.meter .track { height: 8px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 99px; background: var(--ok); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-500); }
.kv > span:last-child { overflow-wrap: anywhere; }

/* Detalhe */
.detail-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-hero .big { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-500); box-shadow: var(--sh-1); }
.detail-hero .big.on { color: var(--ok); }
.detail-hero h1 { font-size: 24px; margin: 0; font-weight: 700; }
.detail-hero .meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--ink-500); font-size: 13px; margin-top: 3px; }
.detail-hero .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs::-webkit-scrollbar { display: none; } .tabs { scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; font-size: 13.5px; color: var(--ink-500); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }

/* Conversa */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 560px; }
.chat-list { border-right: 1px solid var(--line-2); overflow-y: auto; max-height: 640px; }
.chat-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 12px 16px; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line-2); }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--brand-tint); }
.chat-item b { font-size: 13.5px; font-weight: 600; display: block; }
.chat-item small { color: var(--ink-500); font-size: 12px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; }
.chat-log { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; max-height: 560px; background: var(--surface-2); }
.bubble { max-width: 72%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--sh-1); }
.bubble small { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }
.bubble.out { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line-2); }
@media (max-width: 860px) { .chat { grid-template-columns: 1fr; } .chat-list { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line-2); } }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(12, 19, 34, .5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: rise .15s ease both; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); width: 100%; max-width: 480px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { max-width: 680px; }
.modal-head { padding: 20px 22px 4px; position: relative; }
.modal-head h2 { font-size: 18px; margin: 2px 0 0; font-weight: 700; padding-right: 36px; }
.modal-head .icon-btn { position: absolute; top: 14px; right: 14px; }
.modal-body { padding: 14px 22px 6px; overflow-y: auto; }
.modal-body p { margin-top: 0; }
.modal-error { margin: 0 22px 8px; background: var(--bad-tint); color: var(--bad); padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line-2); margin-top: 8px; }
.code-box { font-family: var(--mono); font-size: 17px; background: var(--surface-2); border: 1px dashed var(--ink-300); border-radius: var(--r-sm); padding: 14px; text-align: center; letter-spacing: .04em; word-break: break-all; }
.secret { display: flex; gap: 8px; align-items: center; background: var(--warn-tint); border: 1px solid #f3d7ae; border-radius: var(--r-sm); padding: 10px 12px; margin: 10px 0; }
.secret code { font-family: var(--mono); font-size: 15px; flex: 1; }
.note { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 12.5px; color: var(--ink-500); }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 300; box-shadow: var(--sh-3); font-weight: 500; font-size: 13.5px; animation: rise .2s ease both; transition: opacity .3s; }
.toast.out { opacity: 0; }

/* Painel de notificações */
.popover { position: absolute; top: 52px; right: 20px; width: 380px; max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); z-index: 40; animation: rise .15s ease both; }
.popover header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); }

/* Assinatura / download */
.plan-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 22px; }
.plan-hero h2 { margin: 2px 0 4px; font-size: 22px; }
.plan-hero .price { font-size: 26px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.plan-hero .price small { font-size: 13px; color: var(--ink-500); font-weight: 500; }
.pix { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 16px; align-items: center; }
.pix .qr { width: 148px; height: 148px; border: 1px solid var(--line); border-radius: var(--r-sm); display: grid; place-items: center; background: #fff; padding: 6px; }
.pix .qr img, .pix .qr svg { width: 100%; height: 100%; }
.pix textarea { font-family: var(--mono); font-size: 11.5px; min-height: 92px; }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0; }
.dl-item { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.dl-item + .dl-item { border-left: 1px solid var(--line-2); }
.dl-item h3 { margin: 0; font-size: 16px; }
.dl-item p { margin: 0 0 8px; color: var(--ink-500); font-size: 13.5px; flex: 1; }
.dl-item .btn { align-self: flex-start; }

/* Cores do gráfico de receita */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 18px 18px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 36px; background: linear-gradient(180deg, var(--brand), #f0686d); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bars .b span { font-size: 11px; color: var(--ink-500); }
.bars-empty { height: 150px; display: grid; place-items: center; color: var(--ink-400); font-size: 13px; }

/* menu só aparece no celular/tablet (regra antes da media query) */
.menu-btn { display: none !important; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-open .side { transform: none; box-shadow: var(--sh-3); }
  .menu-btn { display: inline-grid !important; }
  .topbar { padding: 0 16px; }
  .topbar .input-icon { display: none; }
  .content { padding: 20px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dl-item + .dl-item { border-left: 0; border-top: 1px solid var(--line-2); }
  .pix { grid-template-columns: 1fr; }
}
@media print { .side, .topbar, .page-head .actions, .toolbar { display: none !important; } .shell { grid-template-columns: 1fr; } .panel { box-shadow: none; } }

.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
.meter.unlimited .track { background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); }
.meter.unlimited .fill { display: none; }

/* ── Acesso remoto pelo navegador ───────────────────────── */
body.rs-open { overflow: hidden; }
.rs { position: fixed; inset: 0; z-index: 150; background: #0a0f1a; display: flex; flex-direction: column; color: #fff; }
.rs-bar { display: flex; align-items: center; gap: 16px; padding: 8px 14px; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); flex-wrap: wrap; z-index: 3; transition: transform .18s ease; }
.rs-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rs-title b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.rs-title small { display: block; font-size: 12px; color: var(--ink-500); }
.rs-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-400); flex: none; }
.rs-dot.on { background: var(--ok); animation: pulse 2s infinite; } .rs-dot.warn { background: var(--warn); } .rs-dot.bad { background: var(--bad); }
.rs-meta { display: flex; gap: 14px; font-size: 12px; color: var(--ink-500); align-items: center; }
.rs-meta b { color: var(--ink); font-size: 13px; }
.rs-verify { color: var(--brand-700) !important; }
.rs-stats { color: var(--ok); font-size: 11.5px; }
.rs-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.rs-btn { height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-700); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; position: relative; }
.rs-btn svg { width: 15px; height: 15px; }
.rs-btn:hover { background: var(--hover); }
.rs-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.rs-btn.badge::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.rs-quality { width: auto; height: 32px; font-size: 12.5px; padding: 0 8px; box-shadow: none; }
.rs-end { height: 32px; padding: 0 14px; border-radius: 7px; border: 0; background: var(--brand); color: #fff; font-weight: 700; font-size: 12.5px; }
.rs-end:hover { background: var(--brand-600); }
.rs-body { flex: 1; display: flex; min-height: 0; position: relative; }
.rs-stage { flex: 1; position: relative; overflow: hidden; outline: none; display: grid; place-items: center; }
.rs.original .rs-stage { overflow: auto; place-items: start; }
.rs-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.rs.original .rs-video { width: auto; height: auto; max-width: none; object-fit: none; }
.rs-stage.controlling .rs-video { cursor: default; }
.rs-btn:disabled { opacity: .5; cursor: default; }
.rs-wait { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: #c4cbd8; text-align: center; padding: 20px; background: #0a0f1a; }
.rs-wait .spinner { border-color: rgba(255,255,255,.15); border-top-color: var(--brand); width: 34px; height: 34px; }
.rs-wait p { margin: 0; max-width: 380px; }
.rs-fail { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 30px; max-width: 460px; }
.rs-fail b { font-size: 16px; font-weight: 600; }
.rs-fail-ic { width: 46px; height: 46px; border-radius: 50%; background: rgba(229,36,43,.18); color: #ff8a8e; display: grid; place-items: center; }
.rs-chat { width: 320px; background: #fff; color: var(--ink); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.rs-chat > header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.rs-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.rs-chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line-2); }
.rs-chat-form input { height: 34px; }
.rs-toast { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); background: rgba(12,19,34,.92); color: #fff; padding: 9px 14px; border-radius: 9px; font-size: 13px; z-index: 5; box-shadow: var(--sh-3); display: flex; gap: 10px; align-items: center; }
/* Tela cheia com barra oculta: aparece ao encostar no topo. */
.rs.autohide .rs-bar { position: absolute; top: 0; left: 0; right: 0; transform: translateY(-100%); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.rs.autohide.peek .rs-bar { transform: none; }
.rs.fs .rs-toast { top: 16px; }
.rs-keys { width: auto; height: 32px; font-size: 12.5px; padding: 0 8px; box-shadow: none; }
.rs-stage.dropping::after { content: "Solte para colar no computador remoto"; position: absolute; inset: 14px; border: 2px dashed var(--brand); border-radius: 12px; background: rgba(229,36,43,.12); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; pointer-events: none; }
.rs-files { position: absolute; inset: 12px; z-index: 4; background: #fff; color: var(--ink); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45); display: flex; flex-direction: column; overflow: hidden; }
.rs-files-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.rs-files-head b { font-size: 15px; } .rs-files-head small { display: block; color: var(--ink-500); font-size: 12px; margin-top: 2px; }
.rs-files-tools { display: flex; gap: 6px; align-items: center; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.rs-files-tools .rs-path { flex: 1; min-width: 200px; height: 32px; font-size: 12.5px; }
.rs-files-tools .rs-btn.on { background: var(--brand); border-color: var(--brand); }
.rs-files-tools .rs-btn.on:hover { background: var(--brand-600); }
.rs-files-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.rs-files-list { flex: 1; overflow: auto; position: relative; }
.rs-files-list table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rs-files-list th { position: sticky; top: 0; background: #fff; text-align: left; font-weight: 600; color: var(--ink-500); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.rs-files-list td { padding: 6px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; cursor: default; user-select: none; }
.rs-files-list tr:hover td { background: var(--hover); }
.rs-files-list tr.sel td { background: rgba(229,36,43,.09); }
.rs-files-list tr[data-dir="1"].drop-target td { background: rgba(229,36,43,.16); }
.rs-files-empty { padding: 26px; text-align: center; }
.rs-drop { display: none; position: absolute; inset: 8px; border: 2px dashed var(--brand); border-radius: 10px; background: rgba(229,36,43,.06); color: var(--brand-700); font-weight: 700; place-items: center; pointer-events: none; }
.rs-files-list.dropping .rs-drop { display: grid; }
.rs-xfers:empty { display: none; }
.rs-xfers { border-top: 1px solid var(--line-2); padding: 8px 16px; max-height: 170px; overflow-y: auto; display: grid; gap: 8px; }
.rs-xfer { display: grid; grid-template-columns: 1fr 160px auto; gap: 12px; align-items: center; font-size: 12.5px; }
.rs-xfer small { display: block; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-bar-track { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.rs-bar-track i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.rs-xfer.ok .rs-bar-track i { background: var(--ok); } .rs-xfer.bad .rs-bar-track i { background: var(--bad); }
@media (max-width: 900px) { .rs-meta { display: none; } .rs-btn span { display: none; } .rs-chat { position: absolute; right: 0; top: 0; bottom: 0; } }

/* Inventário */
.metric .value.sm { font-size: 16px; line-height: 1.3; margin-top: 6px; white-space: normal; overflow-wrap: anywhere; }
.inv-strip { margin-bottom: 14px; }
.inv-alerts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.inv-alerts .pill { height: 26px; font-size: 12.5px; padding: 0 10px; }

.ad-mark { border-radius: 22%; object-fit: contain; display: block; flex: none; }

.code-block{background:#0c1322;color:#e6e9f0;border-radius:10px;padding:14px 16px;overflow-x:auto;font-family:var(--mono);font-size:12.5px;line-height:1.6;margin:6px 0 14px}
.code-block code{font-family:inherit;white-space:pre}


/* ── Celular: topo enxuto, menu com fundo, tabelas em cartões ── */
@media (max-width: 900px) {
  .shell.menu-open::before { content: ""; position: fixed; inset: 0; background: rgba(12,19,34,.45); z-index: 55; }
  .topbar { gap: 8px; height: 56px; }
  .topbar .title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
  .topbar .spacer { display: none; }
  .topbar .btn { height: 38px; padding: 0 11px; }
  .topbar .btn span { display: none; }
  .popover { left: 8px; right: 8px; width: auto; top: 60px; }
  .page-head { align-items: flex-start; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .detail-hero .actions { margin-left: 0; width: 100%; }
  .detail-hero .actions .btn { flex: 1 1 auto; }
  .toolbar { padding: 12px; }
  .toolbar .input-icon, .toolbar select { width: 100% !important; min-width: 0; }
  .seg { max-width: 100%; overflow-x: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .modal { max-height: calc(100dvh - 24px); }
  .overlay { padding: 12px; align-items: end; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .content { padding: 16px 12px; }
  .page-head h1 { font-size: 21px; }
  .metric { padding: 14px; }
  .metric .value { font-size: 23px; }
  .panel-head { padding: 12px 14px; }
  .panel-body { padding: 14px; }
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: auto; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px; border-bottom: 1px solid var(--line-2); }
  .table-wrap tbody tr:last-child { border-bottom: 0; }
  .table-wrap td { border: 0; padding: 0 !important; font-size: 13.5px; }
  .table-wrap td:first-child { flex: 1 1 100%; }
  .table-wrap td.right { text-align: left; }
  .table-wrap td:has(.row-actions) { flex: 1 1 100%; }
  .table-wrap .row-actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .table-wrap .row-actions .btn { flex: 1 1 auto; }
  .table-wrap td:empty { display: none; }
  tbody tr.clickable:hover td { background: none; }
  .bubble { max-width: 88%; }
  .rs-bar { padding: 6px 8px; gap: 8px; }
}

/* Selo CENTRAL não vaza da lateral */
.side { overflow-x: hidden; }
.side .lockup { min-width: 0; }
.side .lockup > div { min-width: 0; }
.side .lockup b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; white-space: normal; line-height: 1.15; }
.admin-tag { font-size: 9.5px; letter-spacing: .1em; padding: 2px 6px; border-radius: 5px; background: rgba(229,36,43,.18); color: #ff8a8e; font-weight: 700; }

/* Verificação anti-robô e links legais no login */
.captcha { display: flex; justify-content: center; min-height: 65px; margin: 4px 0 14px; }
.captcha[hidden] { display: none; }
.auth-legal { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-500); }
.auth-legal a { color: var(--ink-500); text-decoration: underline; text-underline-offset: 2px; }
.panel-head p a { color: var(--brand); font-weight: 600; }

/* Central: lista de alertas (ações descem para baixo do texto no celular) */
.feed li.alert-item { align-items: flex-start; flex-wrap: wrap; }
.alert-item .alert-body { flex: 1 1 320px; min-width: 0; }
.alert-item .alert-actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
  .alert-item .alert-body { flex-basis: calc(100% - 44px); }
  .alert-item .alert-actions { flex-basis: 100%; justify-content: flex-start; padding-left: 44px; }
}

/* ── Segurança da conta e Painel de controle ─────────────────────────────── */
.auth.single { grid-template-columns: 1fr; min-height: 100vh; }
.auth.single .auth-main { min-height: 100vh; }
.auth.single .auth-card .lockup { margin-bottom: 22px; }
.auth.single .auth-card.wide { max-width: 860px; width: 100%; }
.form-ok { background: var(--ok-tint); color: var(--ok); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.twofa .sub { margin-top: 0; }
.code-input { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 22px !important; letter-spacing: .3em; text-align: center; }
.tf-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
button.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tf-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-opt { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tf-opt small { color: var(--ink-500); font-size: 13px; line-height: 1.45; flex: 1; }
.tf-opt .btn { margin-top: 6px; }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.recovery code { font-family: "JetBrains Mono", ui-monospace, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px; text-align: center; font-size: 14px; letter-spacing: .06em; }
.qr-box { display: flex; gap: 18px; align-items: center; margin: 6px 0 16px; flex-wrap: wrap; }
.qr-box .qr { width: 168px; height: 168px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; flex: none; }
.qr-box .qr svg { width: 100%; height: 100%; }
.secret-key { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; word-break: break-all; flex: 1; min-width: 200px; }
.steps-list { margin: 0 0 8px; padding-left: 20px; color: var(--ink-700); font-size: 13.5px; line-height: 1.6; }
.kvt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kvt td { padding: 11px 18px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.meter-inline { display: inline-block; width: 90px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.meter-inline i { display: block; height: 100%; background: var(--ok); border-radius: 6px; }
.meter-inline.bad i { background: var(--bad); }
.tpl-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tpl-edit textarea { width: 100%; min-height: 300px; }
.tpl-preview { display: flex; flex-direction: column; gap: 6px; }
.tpl-preview iframe { width: 100%; flex: 1; min-height: 340px; border: 1px solid var(--line); border-radius: 10px; background: #f3f4f6; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-700); }
.warn-note { background: var(--warn-tint); color: var(--warn); }
@media (max-width: 720px) {
  .tf-options, .tpl-edit { grid-template-columns: 1fr; }
  .recovery { grid-template-columns: 1fr; }
  .kvt td { padding: 10px 14px; }
}
.auth-card.wide .btn { width: auto; height: auto; margin-top: 0; }
.auth-card.wide .btn-primary[type=submit] { height: 40px; }

/* Dispositivo recém-registrado (janela de código de registro). */
.just-added { animation: justAdded 4s ease; }
@keyframes justAdded { 0%, 60% { background: rgba(18,150,90,.14); box-shadow: inset 3px 0 0 var(--ok); } 100% { background: transparent; } }

/* Menu de exportação (relatórios e ficha de máquina). */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-3); padding: 6px; min-width: 210px; }
.menu.wide { min-width: 280px; }
.menu small { display: block; padding: 8px 10px 3px; color: var(--ink-400); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 7px; font-size: 13px; color: var(--ink-700); cursor: pointer; }
.menu button:hover { background: var(--hover); color: var(--ink); }


/* Barras de rolagem finas e sem setas (evita o visual de barra do sistema). */
* { scrollbar-width: thin; scrollbar-color: #c3ccd8 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3ccd8; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a6b1c2; background-clip: content-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* Grupos: cards coloridos e alternador de visualização. */
.view-seg button { display: inline-flex; align-items: center; gap: 6px; }
.view-seg button svg { width: 15px; height: 15px; }
.group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.group-card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--gc, var(--brand)); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .15s, transform .15s; }
.group-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.gc-top { display: flex; align-items: center; gap: 8px; }
.gc-top b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.gc-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.gc-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.group-card:hover .gc-actions { opacity: 1; }
.gc-count { display: flex; align-items: baseline; gap: 6px; }
.gc-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.gc-lbl { font-size: 12.5px; color: var(--ink-500); }
.gc-open { align-self: flex-start; }
@media (max-width: 560px) { .group-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

/* Chamar atenção no acesso remoto pelo navegador */
.rs-attn-flash { animation: rsAttn .35s ease 0s 6 alternate; }
@keyframes rsAttn { from { box-shadow: inset 0 0 0 0 transparent; } to { box-shadow: inset 0 0 0 6px var(--brand, #e5242b); } }
