/* =====================================================================================================================
   Gestor — visual baseado no design-kit "Vedas UI" (design-kit/vedas-ui.css):
   fundo cinza-azulado claro, cards brancos arredondados com sombra suave, botões em pílula, chips, Nunito Sans,
   tema escuro (html.escuro). Os nomes de classe antigos (.topbar, .panel, .table, .badge-*...) foram mantidos para
   não precisar reescrever os templates — só o visual mudou.
   Fonte: sem @import do Google Fonts de propósito (a loja pode estar sem internet); usa Nunito Sans se estiver
   instalada, senão Segoe UI.
   ===================================================================================================================== */

:root {
  --brand-50: #F1F6FC;
  --brand-100: #E0ECF8;
  --brand-200: #BCD6EF;
  --brand-400: #249ED4;
  --brand-500: #0772BA;
  --brand-700: #1E285C;
  --brand-800: #161E47;

  --ink: #1F2433;
  --ink-soft: #5B6275;
  --ink-mute: #8A90A2;
  --surface: #F4F6F9;
  --line: #E5E8EE;
  --white: #FFFFFF;
  --white-hover: #F5F6FA;

  --primary-bg: var(--brand-500);
  --primary-hover: #05609E;
  --secondary-bg: var(--brand-50);
  --secondary-hover: var(--brand-100);
  --secondary-text: var(--brand-700);
  --danger-bg: #FEF2F2;
  --danger-hover: #FEE2E2;
  --danger-text: #DC2626;
  --focus-ring: var(--brand-100);

  --chip-orange-bg: #FFEDD5;  --chip-orange-text: #C2410C;
  --chip-blue-bg: #F1F6FC;    --chip-blue-text: #1E285C;
  --chip-sky-bg: #F0F9FF;     --chip-sky-text: #0369A1;
  --chip-green-bg: #ECFDF5;   --chip-green-text: #047857;
  --chip-red-bg: #FEF2F2;     --chip-red-text: #B91C1C;
  --chip-amber-bg: #FFFBEB;   --chip-amber-text: #B45309;
  --chip-gray-bg: #F4F4F5;    --chip-gray-text: #71717A;

  --radius-xl: 10px;
  --radius-2xl: 14px;
  --radius-3xl: 18px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(16,24,40,.04);
  --shadow-pop: 0 8px 32px rgba(15,42,92,.16);
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
  --scrollbar: #d5d9e4;

  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* Aliases antigos (alguns templates/JS ainda podem referenciar). */
  --vmi-red: var(--primary-bg);
  --vmi-red-dark: var(--primary-hover);
}

html.escuro {
  --ink: #E7EAF2;
  --ink-soft: #ACB3C5;
  --ink-mute: #80889C;
  --surface: #0E121C;
  --line: #2C3244;
  --white: #1A2030;
  --white-hover: #222A3D;

  --primary-bg: #1F80C6;
  --primary-hover: #2A90D8;
  --secondary-bg: rgba(36,158,212,.16);
  --secondary-hover: rgba(36,158,212,.24);
  --secondary-text: #8CC8EE;
  --danger-bg: rgba(239,68,68,.15);
  --danger-hover: rgba(239,68,68,.22);
  --danger-text: #FCA5A5;
  --focus-ring: rgba(36,158,212,.24);

  --chip-orange-bg: rgba(249,115,22,.18);  --chip-orange-text: #FDBA74;
  --chip-blue-bg: rgba(36,158,212,.16);    --chip-blue-text: #8CC8EE;
  --chip-sky-bg: rgba(14,165,233,.16);     --chip-sky-text: #7DD3FC;
  --chip-green-bg: rgba(16,185,129,.15);   --chip-green-text: #6EE7B7;
  --chip-red-bg: rgba(239,68,68,.15);      --chip-red-text: #FCA5A5;
  --chip-amber-bg: rgba(245,158,11,.15);   --chip-amber-text: #FCD34D;
  --chip-gray-bg: rgba(255,255,255,.08);   --chip-gray-text: #A1A1AA;

  --shadow-card: 0 1px 2px rgba(0,0,0,.4);
  --shadow-pop: 0 8px 32px rgba(0,0,0,.5);
  --scrollbar: #3a4258;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 800; letter-spacing: -0.025em; }
h1 { margin: 0 0 6px; font-size: 1.65rem; }
h2 { font-size: 1.05rem; margin: 0 0 14px; }
a { color: var(--brand-500); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
html.escuro a { color: #8CC8EE; }
code {
  font-family: ui-monospace, Consolas, monospace; font-size: .85em;
  background: var(--secondary-bg); color: var(--secondary-text);
  padding: 2px 7px; border-radius: 6px;
}
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 999px; }

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); color: var(--ink);
  padding: 0 24px; height: 64px;
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); margin-right: 14px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; font-weight: 900; font-size: 1.05rem; flex: none;
  box-shadow: var(--shadow-sm);
}
.brand-text { font-weight: 800; font-size: .95rem; line-height: 1.15; display: flex; flex-direction: column; }
.brand-sub { color: var(--ink-mute); font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.topbar nav { display: flex; gap: 2px; flex: 1; height: 100%; align-items: center; overflow-x: auto; }
.topbar nav a {
  display: inline-flex; align-items: center; height: 2.25rem; padding: 0 1rem;
  border-radius: var(--radius-pill); color: var(--ink-soft);
  font-size: .875rem; font-weight: 700; white-space: nowrap;
  transition: all .15s var(--ease);
}
.topbar nav a:hover:not(.active) { background: var(--surface); color: var(--ink); text-decoration: none; }
.topbar nav a.active { background: var(--primary-bg); color: #fff; }
.theme-toggle {
  width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s var(--ease); flex: none;
}
.theme-toggle:hover { background: var(--white-hover); color: var(--ink); }
.logout-form { margin: 0; }
.logout-form button, .logout-form button[type="submit"] {
  height: 2.25rem; padding: 0 1rem; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--white); color: var(--ink-soft);
  font-size: .85rem; font-weight: 700; cursor: pointer; box-shadow: none;
}
.logout-form button:hover, .logout-form button[type="submit"]:hover { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }

/* ---------- Status do monitoramento (importação automática) ---------- */
.watch-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700;
  padding: .3rem .75rem; border-radius: var(--radius-pill);
  background: var(--chip-gray-bg); color: var(--chip-gray-text);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-on { background: #10B981; box-shadow: 0 0 0 0 rgba(16,185,129,.5); animation: pulse-ring 2s infinite; }
.dot-off { background: #A1A1AA; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.45); } 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }

/* ---------- Layout ---------- */
.page { padding: 32px 32px 64px; max-width: 1240px; margin: 0 auto; animation: slide-up .25s var(--ease); }
/* Transform only (no opacity:0 start): if animations are paused/unsupported the page is still fully visible. */
@keyframes slide-up { from { transform: translateY(6px); } to { transform: none; } }
.page > .hint { margin-top: 0; margin-bottom: 24px; font-size: .95rem; max-width: 80ch; }

/* ---------- Cards do painel inicial ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 18px 0 28px; }
.card {
  background: var(--white); border-radius: var(--radius-2xl); box-shadow: var(--shadow-card);
  padding: 20px 22px; border: 1px solid var(--line);
}
.card-num { font-size: 2.2rem; font-weight: 900; color: var(--ink); line-height: 1; letter-spacing: -.03em; }
.card-label { color: var(--ink-soft); margin-top: 8px; font-size: .85rem; font-weight: 700; }
.card-accent { display: block; width: 32px; height: 4px; border-radius: 4px; background: var(--brand-400); margin-bottom: 14px; }

.steps { padding-left: 20px; margin: 0; }
.steps li { margin-bottom: 10px; line-height: 1.55; color: var(--ink-soft); }
.steps li::marker { color: var(--brand-500); font-weight: 800; }

/* ---------- Tabelas ---------- */
.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--white); box-shadow: var(--shadow-card);
  margin-bottom: 24px; border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--line);
}
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th {
  background: var(--surface); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-mute); font-weight: 800;
}
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: var(--white-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table tr.save-ok td { background: var(--chip-green-bg) !important; transition: background .3s ease; }
.table tr.save-fail td { background: var(--chip-red-bg) !important; transition: background .3s ease; }
.table td a { white-space: nowrap; }

/* ---------- Campos (input/select/textarea em qualquer lugar do gestor) ---------- */
input[type="text"], input[type="number"], input[type="password"], input[type="search"], input[type="email"], input[type="tel"], input:not([type]),
select, textarea {
  height: 2.5rem; padding: 0 .875rem;
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  background: var(--white); color: var(--ink); font-size: .92rem;
  outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; padding: .625rem .875rem; resize: vertical; }
select {
  appearance: none; padding-right: 2.25rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A90A2' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
}
input::placeholder, textarea::placeholder { color: var(--ink-mute); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--focus-ring); }
input:disabled, input[readonly] { background: var(--surface); color: var(--ink-mute); }
input[type="color"] {
  width: 2.75rem; height: 2.25rem; padding: 3px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--white); cursor: pointer; vertical-align: middle;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-500); width: 1.05rem; height: 1.05rem; vertical-align: middle; cursor: pointer; }
input[type="range"] { accent-color: var(--brand-500); }
input[type="file"] { font-size: .85rem; color: var(--ink-soft); max-width: 260px; }
input[type="file"]::file-selector-button {
  height: 2.1rem; padding: 0 .9rem; margin-right: .6rem; border: 0; border-radius: var(--radius-pill);
  background: var(--secondary-bg); color: var(--secondary-text); font-weight: 700; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--secondary-hover); }
.readonly-code { color: var(--ink-mute); font-variant-numeric: tabular-nums; cursor: help; font-weight: 700; }

.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; vertical-align: middle; margin-right: 6px; border: 1px solid var(--line); }

/* ---------- Formulários ---------- */
.inline-form { display: flex; gap: 10px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.inline-form label { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--ink-soft); }
.panel .inline-form:last-child { margin-bottom: 0; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; align-items: start; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.form-grid label input[type="color"] { width: 100%; height: 44px; }
.form-grid .form-actions { grid-column: 1 / -1; margin-top: 4px; }
.form-grid small.hint { font-weight: 400; margin-top: -2px; }

.logo-preview {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 14px;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-xl);
}
.logo-preview img { max-height: 70px; max-width: 200px; border-radius: 8px; }

/* ---------- Botões (pílula) ---------- */
button { cursor: pointer; }
button[type="submit"], .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.5rem; padding: 0 1.25rem; border: 0; border-radius: var(--radius-pill);
  background: var(--primary-bg); color: #fff; box-shadow: var(--shadow-sm);
  font-size: .875rem; font-weight: 700; white-space: nowrap; text-decoration: none;
  transition: all .15s var(--ease);
}
button[type="submit"]:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; }
button[type="submit"]:active, .btn:active { transform: scale(.98); }
button[type="submit"]:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }
.btn-secondary { background: var(--secondary-bg); color: var(--secondary-text); box-shadow: none; }
.btn-secondary:hover { background: var(--secondary-hover); }
button.danger, button[type="submit"].danger {
  height: 2.25rem; padding: 0 1rem; background: var(--danger-bg); color: var(--danger-text); box-shadow: none;
}
button.danger:hover, button[type="submit"].danger:hover { background: var(--danger-hover); }
.table button[type="submit"] { height: 2.25rem; padding: 0 1rem; font-size: 13px; }

/* ---------- Painéis ---------- */
.panel {
  background: var(--white); border-radius: var(--radius-2xl); padding: 22px 26px; margin-bottom: 20px;
  box-shadow: var(--shadow-card); border: 1px solid var(--line);
}
.panel + h2 { margin-top: 8px; }
.panel fieldset {
  display: inline-block; width: 300px; margin: 6px 10px 6px 0; vertical-align: top;
  border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 12px 14px; background: var(--surface);
}
.panel legend { font-size: .75rem; font-weight: 800; color: var(--ink-soft); padding: 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 700; color: var(--ink-soft); margin-top: 8px; margin-right: 10px; }
.pane-field { margin-top: 4px; }
.pane-common-fields { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* ---------- Badges → chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .625rem;
  border-radius: var(--radius-pill); font-size: .75rem; line-height: 1rem; font-weight: 700; white-space: nowrap;
  background: var(--chip-gray-bg); color: var(--chip-gray-text);
}
.badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.badge-mgv_auto { background: var(--chip-green-bg); color: var(--chip-green-text); }
.badge-mgv_manual { background: var(--chip-sky-bg); color: var(--chip-sky-text); }
.badge-manual { background: var(--chip-orange-bg); color: var(--chip-orange-text); }

/* ---------- Avisos ---------- */
.flash {
  display: flex; align-items: center; gap: 10px;
  background: var(--chip-green-bg); color: var(--chip-green-text);
  padding: 12px 18px; border-radius: var(--radius-xl); margin-bottom: 20px; font-size: .92rem; font-weight: 700;
  animation: slide-up .25s var(--ease);
}
.error { color: var(--danger-text); font-weight: 700; }
.hint { color: var(--ink-soft); font-size: .88rem; line-height: 1.55; }

/* ---------- Login ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(36,158,212,.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(30,40,92,.18), transparent 60%),
    var(--surface);
}
.login-card {
  background: var(--white); padding: 36px 32px; border-radius: var(--radius-3xl); width: 360px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-pop); border: 1px solid var(--line);
  animation: slide-up .3s var(--ease);
}
.login-card h1 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 1.5rem; }
.login-card input { height: 3rem; font-size: 1rem; }
.login-card button[type="submit"] { height: 3rem; font-size: 15px; }

@media (max-width: 860px) {
  .topbar { padding: 0 12px; gap: 6px; }
  .brand-text { display: none; }
  .page { padding: 20px 14px 48px; }
}

/* ---------- Assistente de enquadramento ---------- */
.text-soft { color: var(--ink-soft); }
.calib-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.calib-status .btn { margin-left: auto; }
.grid-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.grid-options form { margin: 0; }
.grid-option, .grid-option[type="submit"] {
  width: 100%; height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 14px; border-radius: var(--radius-2xl); border: 2px solid var(--line);
  background: var(--white); color: var(--ink); box-shadow: var(--shadow-card); white-space: normal;
}
.grid-option:hover, .grid-option[type="submit"]:hover { background: var(--white); border-color: var(--brand-400); }
.grid-option.selected, .grid-option.selected:hover { border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--focus-ring); }
.mini-wall { display: grid; gap: 3px; height: 70px; width: auto; max-width: 100%; margin: 0 auto; }
.mini-wall span {
  display: flex; align-items: center; justify-content: center; min-height: 0;
  background: var(--secondary-bg); color: var(--secondary-text); border-radius: 4px; font-size: .75rem; font-weight: 800;
}
.grid-option.selected .mini-wall span { background: var(--primary-bg); color: #fff; }
.grid-option-label { font-size: .85rem; font-weight: 800; text-align: center; }
/* Monitores (dentro do editor de tela) */
.mon-block { padding: 14px 0; border-top: 1px solid var(--line); }
.mon-block:first-of-type { border-top: 0; padding-top: 4px; }
.mon-block .orient-form { margin: 0; }
.mon-hint { margin: 2px 0 12px; }
.grid-options.compact { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-bottom: 12px; }
.grid-options.compact .grid-option { padding: 10px; gap: 8px; border-width: 1.5px; box-shadow: none; border-radius: 14px; }
.grid-options.compact .mini-wall { height: 40px; }
.grid-options.compact .grid-option-label { font-size: .78rem; font-weight: 700; }
.calib-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--chip-amber-bg); color: var(--chip-amber-text); font-weight: 600; }
.calib-bar span { flex: 1 1 240px; }
.mon-help { margin-top: 6px; }
.mon-help summary { cursor: pointer; color: var(--brand-500); font-weight: 600; font-size: .9rem; }
.mon-help[open] summary { margin-bottom: 10px; }
/* Monitores (dentro do editor de tela) */
.mon-block { padding: 14px 0; border-top: 1px solid var(--line); }
.mon-block:first-of-type { border-top: 0; padding-top: 4px; }
.mon-block .orient-form { margin: 0; }
.mon-hint { margin: 2px 0 12px; }
.grid-options.compact { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-bottom: 12px; }
.grid-options.compact .grid-option { padding: 10px; gap: 8px; border-width: 1.5px; box-shadow: none; border-radius: var(--radius-xl, 14px); }
.grid-options.compact .mini-wall { height: 40px; }
.grid-options.compact .grid-option-label { font-size: .78rem; font-weight: 700; }
.calib-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--chip-amber-bg); color: var(--chip-amber-text); font-weight: 600; }
.calib-bar span { flex: 1 1 240px; }
.mon-help { margin-top: 6px; }
.mon-help summary { cursor: pointer; color: var(--brand-600, var(--brand-500)); font-weight: 600; font-size: .9rem; }
.mon-help[open] summary { margin-bottom: 10px; }

/* ---------- Logo (static/img/logo-mark.svg) ---------- */
img.brand-mark { background: none; box-shadow: none; border-radius: 0; object-fit: contain; }
.brand-accent { color: var(--brand-500); }
html.escuro .brand-accent { color: var(--brand-400); }
.login-card h1 img.brand-mark { width: 40px; height: 40px; }

/* "S" of "Super" drawn like the logo (template "sglyph" in nav.html) */
.wordmark { white-space: nowrap; }
.s-glyph { height: .72em; width: auto; vertical-align: baseline; margin-right: .03em; overflow: visible; }
.s-glyph path { fill: none; stroke-width: 12; stroke-linecap: butt; stroke-linejoin: round; }
.s-glyph .s-top { stroke: currentColor; }
.s-glyph .s-bot { stroke: var(--brand-500); }
html.escuro .s-glyph .s-bot { stroke: var(--brand-400); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Dispositivos ---------- */
.device-code { font-size: 1.15rem; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.table button.btn-secondary[type="submit"] { background: var(--secondary-bg); color: var(--secondary-text); box-shadow: none; }
.table button.btn-secondary[type="submit"]:hover { background: var(--secondary-hover); }

/* ---------- Sub-menu (aba Produtos: Produtos · Setores · Importar) ---------- */
.subtabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 22px; flex-wrap: wrap;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
}
.subtabs a {
  display: inline-flex; align-items: center; gap: 8px; height: 2.4rem; padding: 0 1.1rem;
  border-radius: var(--radius-pill); color: var(--ink-soft); font-size: .9rem; font-weight: 700; white-space: nowrap;
}
.subtabs a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.subtabs a.active { background: var(--secondary-bg); color: var(--secondary-text); }
.subtabs-hint { font-weight: 600; color: var(--ink-mute); font-size: .78rem; }
.subtabs a.active .subtabs-hint { color: inherit; opacity: .75; }

/* ---------- Modo de uso (Início) ---------- */
.mode-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.mode-option { margin: 0; }
.mode-option button, .mode-option button[type="submit"] {
  width: 100%; height: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 18px; border-radius: var(--radius-2xl); border: 2px solid var(--line);
  background: var(--white); color: var(--ink); box-shadow: none; text-align: left; white-space: normal;
}
.mode-option button:hover { background: var(--white); border-color: var(--brand-400); }
.mode-option button.selected { border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--focus-ring); }
.mode-option strong { font-size: 1rem; }
.mode-option span { color: var(--ink-soft); font-weight: 600; font-size: .85rem; }

/* =====================================================================================================================
   Telas / editor de tela (cards, chips, botões, playlist, campos) — design-kit Vedas UI
   ===================================================================================================================== */
.label { display: block; margin-bottom: .375rem; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.optional { font-weight: 600; color: var(--ink-mute); font-size: 12px; margin-left: 4px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .65rem;
  border-radius: var(--radius-pill); font-size: .75rem; line-height: 1rem; font-weight: 700; white-space: nowrap;
}
.chip-dot { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.chip-blue  { background: var(--chip-blue-bg);  color: var(--chip-blue-text); font-family: ui-monospace, Consolas, monospace; }
.chip-gray  { background: var(--chip-gray-bg);  color: var(--chip-gray-text); }
.chip-green { background: var(--chip-green-bg); color: var(--chip-green-text); }
.chip-amber { background: var(--chip-amber-bg); color: var(--chip-amber-text); }

/* Buttons (links and submit buttons share the look) */
.btn-sm, button[type="submit"].btn-sm { height: 2.25rem; padding: 0 1rem; font-size: 13px; }
.btn-outline { background: var(--white); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-outline:hover { background: var(--white-hover); }
.btn-ghost { background: transparent; color: var(--ink-soft); box-shadow: none; }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn svg, button svg { flex: none; }
button[type="submit"].btn-secondary-submit { background: var(--secondary-bg); color: var(--secondary-text); box-shadow: none; }
button[type="submit"].btn-secondary-submit:hover { background: var(--secondary-hover); }
button.icon-btn, button[type="submit"].icon-btn { width: 2.25rem; height: 2.25rem; padding: 0; }
.push-right { margin-left: auto; }

/* Page header */
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--ink-soft); margin-bottom: 10px; }
.back-link:hover { color: var(--ink); text-decoration: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 2px; }
.page-head .hint { margin: 4px 0 0; max-width: 70ch; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }

/* Screen cards (Telas) */
.screen-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); gap: 16px; margin-bottom: 24px; }
.screen-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card); padding: 18px 20px; display: flex; flex-direction: column; gap: 16px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.screen-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-pop); }
.screen-card-top { display: flex; gap: 16px; align-items: center; }
.screen-card-title { min-width: 0; }
.screen-card-title h3 { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-wall.screen-wall { height: 52px; flex: none; max-width: 120px; margin: 0; }
.screen-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.screen-card-actions form { margin: 0; }

.empty-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 36px 20px; border: 2px dashed var(--line); border-radius: var(--radius-2xl); color: var(--ink-soft);
  grid-column: 1 / -1;
}
.empty-card svg { color: var(--ink-mute); margin-bottom: 4px; }
.empty-card strong { color: var(--ink); font-size: 1rem; }
.empty-card.compact { padding: 22px 16px; }

/* Form fields */
.field-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; margin-bottom: 14px; }
.field-row .field { margin-bottom: 0; }
.field.grow { flex: 1 1 240px; }
.field input[type="text"], .field select { width: 100%; }
.field-hint { margin: -4px 0 14px; }
.input-suffix { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .88rem; font-weight: 600; }
.rename-row { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-2xl); padding: 14px 18px; box-shadow: var(--shadow-card); margin-bottom: 20px; }
.item-form h2 { margin-bottom: 16px; }
.form-footer { display: flex; gap: 10px; align-items: center; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line); }

.upload-box {
  display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px dashed var(--line);
  border-radius: var(--radius-xl); background: var(--surface);
}
.upload-box .hint { margin: 6px 0 0; }
.upload-thumb { width: 120px; height: 68px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex: none; }

/* Playlist */
.playlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pl-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--white);
  transition: background .15s var(--ease);
}
.pl-item:hover { background: var(--white-hover); }
.pl-item.editing { border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--focus-ring); }
.pl-num {
  width: 1.75rem; height: 1.75rem; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink-soft); font-size: .8rem; font-weight: 800;
}
.pl-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--secondary-bg); color: var(--secondary-text);
}
.pl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-main .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-actions { display: flex; gap: 6px; align-items: center; }
.pl-actions form { margin: 0; }

/* Painéis independentes: one card per TV */
.pane-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 14px; }
.panel fieldset.pane-card { width: auto; margin: 0; display: block; padding: 14px; }
.pane-card .field { margin-bottom: 10px; }
.pane-card input[type="number"] { width: 100%; }
.pane-thumb-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pane-common-fields { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pane-common-fields summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }

@media (max-width: 860px) {
  .screen-cards { grid-template-columns: 1fr; }
  .pl-item { flex-wrap: wrap; }
}

/* ---------- Servidor (Início) ---------- */
.addr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.addr-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.addr-box .label { margin-bottom: 2px; }
code.addr { display: block; font-size: .85rem; padding: 6px 9px; user-select: all; overflow-wrap: anywhere; }
.port-row { margin-bottom: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.port-hint { flex: 1 1 280px; margin: 0; }

/* ---------- Senhas (gestor) ---------- */
.ticket-now {
  flex: none; min-width: 112px; padding: 10px 14px; border-radius: var(--radius-xl);
  background: var(--primary-bg); color: #fff; display: flex; flex-direction: column; align-items: center;
}
.ticket-now span { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.ticket-now strong { font-size: 1.9rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.queue-edit summary { cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.queue-edit form { margin: 12px 0 0; }

/* Duração travada quando o item é um vídeo (vale a duração do vídeo) */
input.locked { background: var(--surface); color: var(--ink-soft); cursor: not-allowed; }
.video-duration-note { color: var(--chip-sky-text); font-weight: 700; margin-top: -6px; }

/* ---------- Prévia "Como fica nas TVs" (editor de tela) ---------- */
.preview-panel .section-head { align-items: center; }
.tv-preview {
  position: relative; overflow: hidden; margin: 0 auto; border-radius: 10px;
  background: #000; box-shadow: 0 0 0 6px #1b1d24, 0 10px 30px rgba(15,42,92,.25);
}
.tv-preview iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
/* TV frames over the picture: where one TV ends and the next begins */
.tv-bezels { position: absolute; inset: 0; display: grid; pointer-events: none; }
.tv-bezels span { border: 3px solid #1b1d24; position: relative; }
.tv-bezels em {
  position: absolute; left: 6px; top: 6px; font-style: normal; font-size: 11px; font-weight: 800;
  color: #fff; background: rgba(0,0,0,.55); padding: 1px 7px; border-radius: 999px; letter-spacing: .04em;
}
.pl-item.playing { border-color: var(--chip-green-text); box-shadow: 0 0 0 3px var(--chip-green-bg); }
.pl-item.playing .pl-num { background: var(--chip-green-bg); color: var(--chip-green-text); }
.tv-preview-wrap { width: 100%; padding: 6px 0; }

/* ---------- Modo online (SuperScreenCloud) ---------- */
.topbar-account { font-size: .8rem; font-weight: 700; color: var(--ink-soft); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activate-panel { border: 2px solid var(--brand-200); }
.code-input { width: 11rem; font-size: 1.4rem !important; font-weight: 800; letter-spacing: .2em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Login / cadastro do painel online ---------- */
.cloud-card { width: 400px; gap: 12px; }
.cloud-card .field { margin: 0; }
.cloud-card input[type="email"], .cloud-card input[type="password"], .cloud-card input[type="text"], .cloud-card input[type="tel"] { width: 100%; height: 3rem; font-size: 1rem; }
.cloud-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.cloud-brand strong { display: block; font-size: 1.1rem; font-weight: 900; letter-spacing: -.02em; }
.cloud-brand span { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); }
.cloud-switch { text-align: center; margin: 2px 0 0; }
.cloud-card .flash { margin: 0; }

/* ---------- Usuários (sub-contas) e Admin geral ---------- */
.topbar-link { font-size: .8rem; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: var(--secondary-bg); color: var(--brand-500); white-space: nowrap; }
.topbar-link:hover { background: var(--secondary-hover); }
.acting-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 18px; background: #FFF4C2; color: #5C4300; font-size: .9rem; border-bottom: 1px solid #F1D776;
}
.acting-banner form { margin: 0; }
.acting-banner button { padding: 6px 14px; font-size: .82rem; }
html.escuro .acting-banner { background: #3D3205; color: #FFE58A; border-color: #5C4A08; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.perm-list.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.perm-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.perm-option:has(input:checked) { border-color: var(--brand-500); background: var(--secondary-bg); }
.perm-option input { margin-top: 3px; }
.perm-option strong { display: block; font-size: .88rem; }
.perm-option small { display: block; color: var(--ink-mute); font-size: .76rem; margin-top: 2px; }
.perm-list.compact .perm-option { padding: 7px 10px; }
.user-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.user-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface); }
.user-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.user-card-head strong { word-break: break-all; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; font-weight: 900; text-transform: uppercase; }
.user-card .field input { width: 100%; }
.user-pass { margin: 4px 0 12px; }
.user-pass summary { cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--brand-500); margin-bottom: 8px; }
.user-actions { display: flex; gap: 8px; justify-content: space-between; }
.admin-table td { vertical-align: middle; }
.admin-search { display: flex; gap: 10px; margin-bottom: 16px; }
.admin-search input { flex: 1; }
.forbidden-card { max-width: 520px; margin: 60px auto; text-align: center; }

/* ---------- Conta online no Admin local (sincronização) ---------- */
.sync-panel { border: 2px solid var(--brand-100); }
.sync-facts { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.sync-facts > div { background: var(--secondary-bg); border-radius: 12px; padding: 10px 14px; min-width: 150px; }
.sync-facts > div.grow { flex: 1 1 260px; }
.sync-facts .label { display: block; margin-bottom: 2px; }
.sync-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sync-actions form { margin: 0; }
.sync-prefer { display: block; width: auto; max-width: 720px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.sync-prefer label { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; font-size: .9rem; cursor: pointer; }
.sync-prefer label input { margin-top: 3px; }
.sync-prefer .hint { margin: 6px 0 0; }

/* ---------- Painel online: entrar com código por email ---------- */
.btn-link-secondary { display: block; text-align: center; padding: 11px 16px; border-radius: 999px; background: var(--secondary-bg); color: var(--brand-500); font-weight: 800; }
.btn-link-secondary:hover { background: var(--secondary-hover); }
.cloud-card .code-input { width: 100%; }
.cloud-card button.btn-secondary { margin-top: -4px; }

/* ---------- Admin geral: backup ---------- */
.backup-panel { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.backup-panel > div { flex: 1 1 420px; }
.backup-panel h2 { margin-top: 0; }
.btn-link-primary { display: inline-block; padding: 11px 20px; border-radius: 999px; background: var(--primary-bg); color: #fff !important; font-weight: 800; white-space: nowrap; }
.btn-link-primary:hover { filter: brightness(1.1); }

/* =====================================================================
   Celular (dez/2026: "90% vai usar no celular"). Up to 760 px wide:
   - menu = app-like bar fixed at the bottom (icon + label);
   - every .table = a list of cards (labels come from responsive.js);
   - forms in one column; inputs at 16 px so iPhones don't zoom in.
   On a PC nothing changes except the (hidden) menu icons.
   ===================================================================== */
.nav-ico { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

@media (max-width: 760px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

  /* top bar: logo + store name, theme, Usuários/Admin, Sair */
  .topbar { height: 56px; padding: 0 10px; gap: 6px; position: sticky; top: 0; z-index: 50; }
  .topbar .brand { flex: 1; min-width: 0; gap: 8px; }
  .topbar .brand-text { display: flex !important; flex-direction: column; min-width: 0; }
  .topbar .brand-text .wordmark, .topbar .brand-text > strong { font-size: .92rem; }
  .topbar .brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
  .topbar-account { display: none; }
  .topbar-link { padding: 6px 10px; font-size: .75rem; }
  .theme-toggle { width: 34px; height: 34px; }
  .logout-form button[type="submit"] { padding: 0 12px; height: 34px; font-size: 13px; }

  /* bottom menu */
  .topbar .main-nav {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60;
    display: flex; gap: 2px; height: auto; flex: none; width: auto; margin: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--white); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(14, 22, 48, .10);
    overflow-x: auto; scrollbar-width: none;
  }
  .topbar .main-nav::-webkit-scrollbar { display: none; }
  .topbar .main-nav a {
    flex: 1 1 0; min-width: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 56px; padding: 4px 1px; border-radius: 14px;
    font-size: 10.5px; font-weight: 800; letter-spacing: -.01em; color: var(--ink-soft); white-space: nowrap; background: none;
  }
  .topbar .main-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .topbar .main-nav a.active { background: var(--secondary-bg); color: var(--brand-500); }
  .main-nav .nav-ico { display: block; }

  /* page */
  .page { padding: 16px 12px 24px; }
  h1 { font-size: 1.45rem; }
  .panel { padding: 16px; border-radius: 16px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 18px; }
  .card { padding: 14px; }
  .card-num { font-size: 1.7rem; }
  .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; width: auto; display: flex; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs a { white-space: nowrap; flex: none; }
  .subtabs-hint { display: none; }
  .acting-banner { font-size: .8rem; padding: 8px 12px; }

  /* forms: one column, big touch targets */
  input, select, textarea { font-size: 16px !important; }
  .field-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .field-row > *, .field-row .field, .field.grow { width: 100%; flex: none; }
  .form-grid { grid-template-columns: 1fr; }
  button[type="submit"], .btn { min-height: 44px; }

  /* tables → cards */
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table { background: none; box-shadow: none; border: 0; border-radius: 0; overflow: visible; }
  .table thead { display: none; }
  .table tbody tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: start;
    background: var(--white); border: 1px solid var(--line); border-radius: 16px;
    padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-card);
  }
  .table tbody tr:hover { background: var(--white); }
  .table td { padding: 0; border: 0 !important; min-width: 0; }
  .table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 4px;
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute);
  }
  .table td:has(input[type="text"], input[type="email"], input[type="file"], select), .table td[colspan], .table td:last-child { grid-column: 1 / -1; }
  .table td input[type="text"], .table td input[type="number"], .table td input[type="email"], .table td select { width: 100% !important; }
  .table td form { display: inline-block; margin: 0 6px 6px 0; }
  .table td a { white-space: normal; }

  /* other blocks */
  .screen-cards, .user-cards, .perm-list { grid-template-columns: 1fr; }
  .backup-panel { flex-direction: column; align-items: stretch; }
  .backup-panel > div { flex: none; }
  .backup-panel .btn-link-primary { text-align: center; }
  .admin-search { flex-direction: column; }
  .sync-facts > div { min-width: 0; flex: 1 1 40%; }
  .login-card, .cloud-card { width: auto; max-width: 100%; }
}
.nav-short { display: none; }
@media (max-width: 760px) {
  .main-nav .nav-long { display: none; }
  .main-nav .nav-short { display: inline; }
}

/* ---------- Rede de franquias: seletor de loja ---------- */
.store-switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 24px; background: var(--secondary-bg); border-bottom: 1px solid var(--line); margin: 0; }
.store-switch label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); }
.store-switch select { min-width: 220px; max-width: 100%; height: 2.3rem; font-weight: 700; }
.store-switch.in-franchise { background: #E8F4FF; }
html.escuro .store-switch.in-franchise { background: #10263D; }
.replicate-panel { border: 2px solid var(--brand-100); }
@media (max-width: 760px) {
  .store-switch { padding: 8px 12px; }
  .store-switch select { flex: 1; min-width: 0; }
}
@media (max-width: 760px) {
  /* crowded top bar: logo + the store's name only */
  .topbar .brand-text .wordmark, .topbar .brand-text > strong { display: none; }
  .topbar .brand-sub { font-size: .72rem; color: var(--ink); max-width: 40vw; }
}

/* ---------- Topo no celular: nome da loja + um botão de menu ---------- */
.m-store, .m-menu { display: none; }
@media (max-width: 760px) {
  .topbar { gap: 8px; }
  .topbar .theme-toggle, .topbar .topbar-link, .topbar .topbar-account, .topbar > .logout-form { display: none !important; }
  .store-switch { display: none; } /* the selector moves into the top bar */
  .topbar .brand { flex: 1; min-width: 0; margin-right: 0; }
  .topbar .brand-sub { max-width: none; font-size: .82rem; font-weight: 800; letter-spacing: .02em; text-transform: none; color: var(--ink); }
  /* with a rede: the store name IS the selector */
  .topbar:has(.m-store) .brand { flex: none; }
  .topbar:has(.m-store) .brand-text { display: none !important; }
  .m-store { display: block; flex: 1; min-width: 0; margin: 0; }
  .m-store select {
    width: 100%; height: 38px; padding: 0 30px 0 12px; border-radius: 12px;
    border: 1px solid var(--line); background-color: var(--secondary-bg);
    font-size: 14px !important; font-weight: 800; color: var(--ink);
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  }
  .m-menu { display: block; position: relative; flex: none; }
  .m-menu > summary {
    list-style: none; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--secondary-bg); color: var(--ink);
  }
  .m-menu > summary::-webkit-details-marker { display: none; }
  .m-menu > summary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .m-menu[open] > summary { background: var(--primary-bg); color: #fff; }
  .m-menu-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; width: min(280px, calc(100vw - 20px));
    background: var(--white); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: 0 18px 40px rgba(14, 22, 48, .18); padding: 8px; display: flex; flex-direction: column;
  }
  .m-menu-account { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
  .m-menu-account strong { font-size: .9rem; overflow-wrap: anywhere; }
  .m-menu-account span { font-size: .75rem; color: var(--ink-mute); }
  .m-menu-panel a, .m-menu-panel .m-menu-item {
    display: flex; align-items: center; width: 100%; min-height: 46px; padding: 0 12px; border-radius: 12px;
    font-size: .95rem; font-weight: 700; color: var(--ink); background: none; box-shadow: none; text-align: left; justify-content: flex-start;
  }
  .m-menu-panel a:hover, .m-menu-panel .m-menu-item:hover { background: var(--secondary-bg); text-decoration: none; }
  .m-menu-panel form { margin: 0; }
  .m-menu-panel .m-menu-exit { color: var(--chip-red-text, #c62828); }
}
@media (max-width: 760px) {
  .m-menu-panel .m-menu-item, .m-menu-panel button.m-menu-item[type] { border: 0 !important; outline: 0; height: auto; font-family: inherit; cursor: pointer; }
}

/* ---------- Dados da empresa ---------- */
.flash-error { background: var(--chip-red-bg, #fdecec); color: var(--chip-red-text, #b42318); border-color: transparent; }
.company-fields { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.company-block { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 4px; margin: 0; min-width: 0; }
.company-block legend { font-weight: 800; font-size: .85rem; padding: 0 6px; color: var(--ink-soft); }
.company-block .field input, .company-block .field select { width: 100%; }
.seg-choice { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.seg-choice label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 700; }
.seg-choice label:has(input:checked) { border-color: var(--brand-500); background: var(--secondary-bg); color: var(--brand-500); }
.cep-field { flex: 0 0 150px; }
.num-field { flex: 0 0 120px; }
.uf-field { flex: 0 0 90px; }
.company-alert { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 2px solid #F1D776; background: #FFF8DB; }
html.escuro .company-alert { background: #3D3205; border-color: #5C4A08; }
@media (max-width: 760px) {
  .cep-field, .num-field, .uf-field { flex: none; }
  .company-block { padding: 10px 12px 2px; }
}
/* cadastro (painel online): wider card with the company blocks */
.signup-body { align-items: flex-start; padding: 24px 12px 48px; }
.signup-card { width: min(640px, 100%); }
.signup-card .company-block { margin-bottom: 4px; }
.signup-card .field input, .signup-card .field select { width: 100%; height: 2.8rem; }
.seg-choice input[type="radio"], .login-card .seg-choice input[type="radio"] { height: auto !important; width: auto !important; margin: 0; }
.seg-choice label { flex: 1 1 auto; }
.table .chip { white-space: normal; text-align: left; height: auto; line-height: 1.3; padding-top: 3px; padding-bottom: 3px; }

/* ---------- Admin: bloquear empresa ---------- */
.block-box { margin-top: 6px; }
.block-box > summary { cursor: pointer; display: inline-flex; align-items: center; height: 2.25rem; padding: 0 14px; border-radius: 999px; background: var(--chip-red-bg, #fdecec); color: var(--chip-red-text, #b42318); font-weight: 800; font-size: 13px; list-style: none; }
.block-box > summary::-webkit-details-marker { display: none; }
.block-box[open] > summary { margin-bottom: 8px; }
.block-box form { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.block-box .field { margin: 0; }
.block-tvs { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; }
.btn-unblock[type="submit"] { background: var(--chip-green-bg); color: var(--chip-green-text); box-shadow: none; }
.chip-red { background: var(--chip-red-bg, #fdecec); color: var(--chip-red-text, #b42318); }

/* ---------- Senhas: olho para mostrar e requisitos ao digitar (static/js/password.js) ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 2.9rem !important; }
.pw-eye {
  position: absolute; top: 50%; right: .3rem; transform: translateY(-50%);
  width: 2.25rem; height: 2.25rem; min-height: 0; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-mute);
  cursor: pointer; box-shadow: none;
}
.pw-eye:hover, .pw-eye.on { color: var(--brand-500); background: var(--surface); }
.pw-eye:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.pw-eye svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pw-rules { list-style: none; margin: .35rem 0 .6rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .2rem .9rem; font-size: .82rem; color: var(--ink-mute); text-align: left; }
.pw-rules li { position: relative; padding-left: 1.35rem; line-height: 1.45; }
.pw-rules li::before { content: ""; position: absolute; left: .1rem; top: .3rem; width: .7rem; height: .7rem; border: 1.5px solid currentColor; border-radius: 50%; }
.pw-rules li.ok { color: var(--chip-green-text); }
.pw-rules li.ok::before { border: 0; top: .2rem; width: .9rem; height: .9rem; border-radius: 0; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.pw-rules li.pw-extra { grid-column: 1 / -1; padding-left: 0; color: var(--danger-text); }
.pw-rules li.pw-extra::before { display: none; }
.pw-match { margin: .3rem 0 .5rem; font-size: .82rem; color: var(--danger-text); text-align: left; }
.pw-match.ok { color: var(--chip-green-text); }
/* ---------- Tipografia mais leve (dez/2026, pedido do usuário: "muito negrito")
   Sem a Nunito Sans instalada o navegador usa Segoe UI, e 800/900 nela vira
   "Black" — pesado demais. Títulos 700, rótulos 600. ---------- */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; }
.label { font-weight: 600; }
.optional { font-weight: 500; }
.brand-text { font-weight: 700; }
.brand-sub { font-weight: 600; }

/* ---------- Telas de acesso: entrar, criar conta, código (visual clean) ---------- */
.login-body {
  background:
    radial-gradient(900px 480px at 0% -10%, rgba(36,158,212,.09), transparent 60%),
    radial-gradient(700px 420px at 100% 110%, rgba(30,40,92,.07), transparent 60%),
    var(--surface);
}
.login-card { box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 32px -12px rgba(16,24,40,.12); }
.cloud-card { padding: 36px 36px 32px; gap: 14px; }
.cloud-brand { gap: 10px; margin-bottom: 10px; }
.cloud-brand img { width: 34px; height: 34px; }
.cloud-brand strong { font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }
.cloud-brand span { font-size: .7rem; font-weight: 500; letter-spacing: .04em; text-transform: none; }
.cloud-card h1 { font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.cloud-card .label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.cloud-card input[type="email"], .cloud-card input[type="password"], .cloud-card input[type="text"], .cloud-card input[type="tel"],
.signup-card .field input, .signup-card .field select { height: 2.75rem; font-size: .95rem; }
.cloud-card button[type="submit"] { height: 2.85rem; font-weight: 700; }
.cloud-card .error { font-weight: 600; font-size: .9rem; background: var(--danger-bg); padding: 10px 14px; border-radius: 12px; margin: 0; }
.btn-link-secondary { font-weight: 700; }
/* cadastro: seções separadas por uma linha fina, sem caixas */
.signup-card .company-fields { gap: 6px; margin-bottom: 8px; }
.signup-card .company-block, .cloud-card .company-block { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 18px 0 2px; margin: 6px 0 0; }
.cloud-card .company-block legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); }
.cloud-card .company-block legend + * { clear: both; }
.seg-choice label { font-weight: 600; font-size: .88rem; }
.signup-card .seg-choice label { padding: 10px 14px; border-radius: 12px; }
@media (max-width: 760px) {
  .cloud-card { padding: 26px 20px 24px; }
}
.cloud-card .company-block .field { margin-bottom: 12px; }
.cloud-card .company-block .field-row { gap: 12px; margin-bottom: 0; }
.cloud-card .company-block .field-row .field { margin-bottom: 12px; }
.cloud-card .pw-rules { margin-top: -4px; }

/* ---------- Admin geral: editar empresa (/admin/empresa/{id}) ---------- */
.admin-table .btn-edit { display: inline-block; padding: 7px 16px; margin: 4px 0; font-size: 13px; }
.edit-login, .edit-company { max-width: 720px; }
.edit-login .field input, .edit-company .field input, .edit-company .field select { width: 100%; }
.admin-users { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.admin-user-row { display: grid; grid-template-columns: 1fr minmax(200px, 260px) auto; gap: 12px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.admin-user-row:first-child { border-top: 0; }
.admin-user-row .field { margin: 0; }
.admin-user-row .pw-rules { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) {
  .admin-user-row { grid-template-columns: 1fr; }
}
.admin-user-row .pw-rules { order: 9; }
.edit-company { display: block; width: 100%; }
.edit-company .company-fields, .edit-company .company-block { width: 100%; }
.edit-company > button[type="submit"] { margin-top: 4px; }
.pw-rules[hidden], .pw-match[hidden], .pw-rules li[hidden] { display: none; }

/* ---------- Downloads (painel online, /downloads) ---------- */
.downloads-body .topbar { gap: 12px; }
.downloads-body .topbar-spacer { flex: 1; }
.downloads-page { max-width: 920px; }
.dl-guide { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; margin: 18px 0 22px; }
.dl-guide h2 { font-size: 1rem; margin: 0 0 8px; }
.dl-guide ul { margin: 0 0 8px; padding-left: 18px; color: var(--ink-soft); font-size: .92rem; line-height: 1.6; }
.dl-guide em { font-style: normal; font-weight: 600; color: var(--brand-500); }
.dl-guide .hint { margin: 0; font-size: .82rem; }
.dl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.dl-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.dl-head { display: flex; gap: 14px; align-items: center; }
.dl-head h2 { margin: 0 0 4px; font-size: 1.05rem; }
.dl-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--secondary-bg); color: var(--brand-500); }
.dl-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dl-desc { margin: 0; color: var(--ink-soft); font-size: .9rem; line-height: 1.6; flex: 1; }
.dl-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-btn { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 700; }
.dl-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dl-size { font-weight: 500; opacity: .75; font-size: .85em; }
.dl-meta { margin: 0; color: var(--ink-mute); font-size: .78rem; }
@media (max-width: 760px) {
  .dl-list { grid-template-columns: 1fr; }
  .dl-card { padding: 18px; }
  .dl-buttons .dl-btn { flex: 1 1 auto; justify-content: center; }
  .downloads-body .brand-text { display: flex; }
}
@media (max-width: 760px) {
  .downloads-body .topbar .topbar-link { display: inline-flex !important; }
  .downloads-body .topbar .brand-sub { display: none; }
}

/* ---------- Rede: dados cadastrais (matriz e franquias) ---------- */
.rede-company-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.rede-company-head .label { margin-bottom: 2px; }
.rede-company-name { display: block; font-size: 1.05rem; font-weight: 700; }
.rede-company .btn-link-secondary { display: inline-block; }
.rede-doc { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .88rem; margin: 2px 0 10px; }
.user-actions .btn-link-secondary { display: inline-flex; align-items: center; padding: 9px 16px; font-size: 13px; }
.company-block, .panel fieldset.company-block { display: block; width: 100%; }
.company-block .field-row .field input, .company-block .field-row .field select { width: 100%; }
.user-actions .btn-link-secondary { white-space: nowrap; }
/* Medium screens: the store's topbar links (Rede, Usuários, Empresa,
   Downloads) + the email squeezed the main menu ("Pr…"). Drop the email. */
@media (min-width: 761px) and (max-width: 1240px) {
  .topbar .topbar-account { display: none; }
  .topbar .topbar-link { padding: 6px 10px; }
}

/* ---------- Produtos: seleção e ações em lote ---------- */
.table .sel-col { width: 2.5rem; text-align: center; }
.table .sel-col input { width: 1.15rem; height: 1.15rem; cursor: pointer; accent-color: var(--brand-500); }
.table tr.row-selected td { background: var(--secondary-bg); }
.bulk-bar {
  position: sticky; bottom: 14px; z-index: 20; margin: 12px 0 20px;
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  padding: 12px 16px; border-radius: 16px; background: var(--white);
  border: 1px solid var(--brand-500); box-shadow: 0 10px 30px -10px rgba(16,24,40,.35);
}
.bulk-bar[hidden] { display: none; }
.bulk-count { font-size: .9rem; color: var(--ink-soft); }
.bulk-count strong { color: var(--brand-500); font-size: 1.05rem; }
.bulk-group { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulk-group select { min-width: 180px; }
.bulk-clear { background: none !important; box-shadow: none !important; color: var(--ink-mute) !important; margin-left: auto; padding: 0 6px; }
@media (max-width: 760px) {
  .bulk-bar { bottom: 78px; padding: 10px 12px; }
  .bulk-group, .bulk-group select { width: 100%; }
  .bulk-group button { flex: 1; }
  .table td.sel-col { text-align: left; }
}
.bulk-bar button[type="submit"].btn-secondary { background: var(--secondary-bg); color: var(--secondary-text); box-shadow: none; }
.bulk-bar button[type="submit"].btn-secondary:hover { background: var(--secondary-hover); }
.bulk-bar .bulk-clear { border: 0 !important; outline: none; height: auto; font-weight: 600; text-decoration: underline; }
.table tr.row-selected td { background: var(--secondary-bg) !important; }
@media (max-width: 760px) {
  .bulk-bar .bulk-count { order: 0; flex: 1; }
  .bulk-bar .bulk-clear { order: 1; margin-left: 0; }
  .bulk-bar .bulk-group { order: 2; }
}

/* ---------- Aparência: fundo de cada produto (cor + opacidade + prévia) ---------- */
.rowbg-field { display: flex; flex-direction: column; gap: 8px; grid-column: 1 / -1; }
.rowbg-title { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.rowbg-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rowbg-controls input[type="range"] { flex: 1; min-width: 160px; max-width: 360px; accent-color: var(--brand-500); }
.rowbg-controls output { min-width: 3rem; font-weight: 700; color: var(--ink); }
.rowbg-preview { border-radius: 12px; padding: 14px 16px; max-width: 520px;
  background: linear-gradient(135deg, #f4d9c6 0%, #e9b49a 30%, #c96a5a 55%, #f2e2d0 80%, #d98c74 100%); }
.rowbg-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 12px; border-radius: 8px;
  font-weight: 900; font-size: 1.05rem; letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0,0,0,.35); transition: background .15s; }
.rowbg-off { color: var(--chip-amber-text, #b45309) !important; }

/* ---------- Editor de tela: orientação do monitor ---------- */
.orient-form { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.orient-options { display: flex; flex-wrap: wrap; gap: 8px; }
.orient-option { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--ink-soft); background: var(--white); }
.orient-option input { position: absolute; opacity: 0; pointer-events: none; }
.orient-option.on, .orient-option:has(input:checked) { border-color: var(--brand-500); background: var(--secondary-bg); color: var(--brand-500); }
.orient-option:focus-within { box-shadow: 0 0 0 3px var(--focus-ring); }
.orient-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; }
.orient-ico svg { width: 26px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 760px) { .orient-option { flex: 1 1 calc(50% - 8px); } }

/* ---------- Relatórios de tempo de tela ---------- */
.report-btn { display: inline-flex !important; align-items: center; gap: 8px; }
.report-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.report-filters { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 14px; }
.report-periods { display: flex; flex-wrap: wrap; gap: 8px; }
.period-chip[type="submit"] { background: var(--white); color: var(--ink-soft); border: 1px solid var(--line); box-shadow: none; height: 2.3rem; padding: 0 16px; font-weight: 600; }
.period-chip[type="submit"].on { background: var(--secondary-bg); color: var(--brand-500); border-color: var(--brand-500); }
.report-custom { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.report-custom .field { margin: 0; }
.report-custom select { min-width: 200px; }
.report-period { margin: 0 0 8px; color: var(--ink-soft); font-weight: 600; }
.day-bars { display: flex; flex-direction: column; gap: 6px; }
.day-bar { display: grid; grid-template-columns: 6.5rem 1fr 6.5rem; gap: 10px; align-items: center; font-size: .86rem; }
.day-label { color: var(--ink-soft); }
.day-track { height: 12px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.day-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), #249ED4); }
.day-val { text-align: right; font-weight: 600; }
.report-screen { padding: 14px 0; border-top: 1px solid var(--line); }
.report-screen:first-of-type { border-top: 0; }
.report-screen-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.report-table td .hint { font-size: .78rem; }
@media (max-width: 760px) {
  .day-bar { grid-template-columns: 4.8rem 1fr 5.5rem; font-size: .8rem; }
  .report-custom .field, .report-custom select { width: 100%; }
}

/* ---------- Admin geral: Métricas ---------- */
a.period-chip { display: inline-flex; align-items: center; height: 2.3rem; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink-soft); font-weight: 600; text-decoration: none; }
a.period-chip.on { background: var(--secondary-bg); color: var(--brand-500); border-color: var(--brand-500); }
.hour-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 160px; }
.hour-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.hb-track { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--surface); border-radius: 6px; overflow: hidden; }
.hb-track i { display: block; width: 100%; background: linear-gradient(180deg, #249ED4, var(--brand-500)); border-radius: 6px 6px 0 0; min-height: 2px; }
.hb-label { font-size: .68rem; color: var(--ink-mute); white-space: nowrap; }
@media (max-width: 760px) { .hb-label { font-size: .55rem; writing-mode: vertical-rl; } .hour-bars { gap: 2px; } }

/* ---------- Acesso remoto (Dispositivos) ---------- */
.remote-status { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; color: var(--ink-soft); font-weight: 600; }
.remote-status .dot { width: 10px; height: 10px; border-radius: 50%; background: #F59E0B; animation: rpulse 1.2s infinite; }
.remote-status.on .dot { background: #10B981; animation: none; }
@keyframes rpulse { 50% { opacity: .3; } }
.remote-screen { position: relative; background: #0F1320; border-radius: 14px; min-height: 240px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.remote-screen img { display: block; max-width: 100%; max-height: 72vh; cursor: crosshair; }
.remote-wait { color: #80889C; padding: 40px; }
.remote-tap { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #FFD400; pointer-events: none; animation: rtap .7s ease-out forwards; }
@keyframes rtap { to { transform: scale(2); opacity: 0; } }
.remote-screen { justify-items: center; }
.remote-controls { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.remote-type { display: flex; gap: 8px; }
.remote-type input { flex: 1; }
.remote-keys { display: flex; flex-wrap: wrap; gap: 8px; }
.remote-keys button { height: 2.4rem; }
@media (max-width: 760px) { .remote-type { flex-direction: column; } }

/* Dispositivos → Monitores da loja: endereço do Sync */
.sync-server { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .25rem 0 .75rem; }
.sync-server code { font-size: .9em; }

/* Carrossel (editor de tela) */
.carousel-editor { display: flex; flex-direction: column; gap: .6rem; }
.carousel-list { display: flex; flex-direction: column; gap: .35rem; }
.carousel-row { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; border: 1px solid var(--line, #e3e7ef); border-radius: 12px; background: var(--surface, #fff); }
.carousel-thumb { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; background: #111; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .9rem; }
.carousel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.carousel-secs { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.carousel-secs input { width: 4.5rem; }
.carousel-actions { display: inline-flex; gap: .2rem; }
.carousel-actions .btn-icon { min-width: 2rem; padding: .25rem .45rem; background: transparent; color: var(--ink, #1e285c); border: 1px solid var(--line, #e3e7ef); border-radius: 8px; box-shadow: none; }
.carousel-actions .btn-icon.danger { color: #c0392b; }
@media (max-width: 760px) {
  .carousel-row { flex-wrap: wrap; }
  .carousel-name { flex-basis: calc(100% - 80px); }
}

/* Sync: endereço online escondido (painel oficial) e pasta da balança */
.other-url { margin: 4px 0 14px; }
.other-url summary { cursor: pointer; font-size: .85rem; color: var(--ink-soft); }
.other-url summary::marker { color: var(--ink-faint, var(--ink-soft)); }
.other-url[open] summary { margin-bottom: 10px; }
.other-url .field { max-width: 32rem; }
.scale-row { align-items: flex-end; }

/* =====================================================================
   Visual 2026 (pedido do usuário: "painel mais clean, profissional e
   moderno"): menu lateral fixo no PC, cartões leves (borda fina, sem
   sombra pesada), cantos menores, pesos de fonte mais leves, azul da
   marca como cor principal. No celular continua a barra de baixo + ☰.
   ===================================================================== */
body { font-size: 15px; }
.wordmark { font-family: "Nunito Sans", "Segoe UI", system-ui, sans-serif; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }
a { font-weight: 500; }
.hint { font-size: .86rem; }
.label, .field .label { font-weight: 600; }

/* buttons: rounded rectangles instead of pills */
button[type="submit"], .btn { border-radius: 10px; font-weight: 600; box-shadow: none; height: 2.5rem; }
button.danger, button[type="submit"].danger, .table button[type="submit"] { border-radius: 9px; }
.btn-sm, .btn.btn-sm { border-radius: 9px; }
input[type="file"]::file-selector-button { border-radius: 8px; font-weight: 600; }

/* surfaces */
.panel { border-radius: 14px; padding: 22px 24px; box-shadow: none; }
.card { border-radius: 14px; box-shadow: none; display: flex; flex-direction: column; padding: 18px 20px; }
.card-accent { display: none; }
.card-label { order: -1; margin: 0 0 10px; font-weight: 600; font-size: .8rem; color: var(--ink-mute); }
.card-num { font-weight: 700; font-size: 2rem; }
.table { border-radius: 12px; box-shadow: none; }
.table th { font-weight: 600; letter-spacing: .04em; font-size: .7rem; }
.flash { border-radius: 10px; font-weight: 600; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.chip, .badge { font-weight: 600; }

/* ---- side menu (PC) ---- */
.topbar .side-extra, .topbar .side-foot { display: none; }
@media (min-width: 761px) {
  body:has(> .app-side) { padding-left: 248px; }
  .topbar.app-side {
    position: fixed; top: 0; bottom: 0; left: 0; width: 248px; height: auto;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 18px 14px 16px; border-bottom: 0; border-right: 1px solid var(--line);
    box-shadow: none; overflow-y: auto; z-index: 40;
  }
  .app-side .brand { padding: 2px 8px 20px; margin: 0; }
  .app-side .brand-text { display: flex; }
  .app-side .brand-sub { text-transform: none; letter-spacing: 0; font-size: .78rem; font-weight: 600; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
  .app-side nav { flex: none; height: auto; flex-direction: column; align-items: stretch; gap: 2px; overflow: visible; }
  .app-side nav a {
    display: flex; align-items: center; gap: .75rem; height: 2.5rem; padding: 0 .8rem;
    border-radius: 10px; font-size: .9rem; font-weight: 500; color: var(--ink-soft);
  }
  .app-side nav a .nav-ico { display: block; width: 19px; height: 19px; stroke-width: 1.8; opacity: .85; }
  .app-side nav a:hover:not(.active) { background: var(--surface); color: var(--ink); }
  .app-side nav a.active { background: var(--secondary-bg); color: var(--brand-500); font-weight: 600; }
  .app-side nav a.active .nav-ico { opacity: 1; }
  html.escuro .app-side nav a.active { color: #8CC8EE; }
  .app-side .side-extra { display: flex; margin-top: 22px; }
  .side-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-mute); font-weight: 600; padding: 0 .8rem 6px; }
  .app-side .side-foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding: 14px 4px 0; border-top: 1px solid var(--line); }
  .app-side .topbar-account { display: block; max-width: 100%; padding: 0 4px; font-weight: 500; font-size: .8rem; }
  .side-foot-actions { display: flex; gap: 8px; align-items: center; }
  .side-foot .logout-form { flex: 1; }
  .side-foot .logout-form button, .side-foot .logout-form button[type="submit"] { width: 100%; border-radius: 10px; font-weight: 600; }
  .app-side .theme-toggle { border-radius: 10px; }
  .app-side .main-nav .nav-long { display: inline; }
  .app-side .main-nav .nav-short { display: none; }
  .page { padding: 30px 40px 64px; }
  .store-switch { padding: 10px 40px; }
}
/* tablet / small notebook: icons only */
@media (min-width: 761px) and (max-width: 1100px) {
  body:has(> .app-side) { padding-left: 76px; }
  .topbar.app-side { width: 76px; padding: 16px 10px; align-items: center; }
  .app-side .brand { padding: 0 0 16px; }
  .app-side .brand-text, .app-side nav a span, .side-label, .app-side .topbar-account { display: none !important; }
  .app-side nav a { justify-content: center; padding: 0; width: 48px; }
  .app-side .side-extra { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
  .side-foot-actions { flex-direction: column; }
  .side-foot .logout-form button, .side-foot .logout-form button[type="submit"] { padding: 0 8px; font-size: .75rem; }
  .page { padding: 24px 24px 56px; }
  .store-switch { padding: 10px 24px; }
}
.btn-link-primary, .btn-link-secondary, .block-box > summary, .logout-form button { border-radius: 10px; font-weight: 600; }
.subtabs { border-radius: 12px; }
.subtabs a { border-radius: 9px; font-weight: 600; }
.topbar nav a.active { background: var(--secondary-bg); color: var(--brand-500); }
@media (max-width: 760px) {
  .grid-options.compact { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .grid-options.compact .grid-option { padding: 8px 6px; }
  .grid-options.compact .mini-wall { height: 30px; }
  .grid-options.compact .grid-option-label { font-size: .7rem; }
}

/* Monitores → Personalizado: total de monitores e ordem de cada um */
.custom-ico { display: flex; align-items: center; justify-content: center; }
.custom-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--brand-500); }
.custom-grid { margin: 4px 0 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.custom-grid[hidden] { display: none; }
.cg-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.cg-head .field input { width: 7rem; }
.cg-total { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; }
.cg-total strong { font-size: 1rem; }
.cg-wall { display: grid; gap: 6px; max-width: 640px; max-height: 360px; margin: 12px 0; }
.cg-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 0; padding: 8px; border-radius: 10px; background: var(--white); border: 1.5px solid var(--brand-200); }
.cg-num { font-size: clamp(1.1rem, 3vw, 2rem); font-weight: 700; color: var(--brand-500); line-height: 1; }
.cg-cell select { height: 2rem; font-size: .78rem; padding: 0 1.8rem 0 .5rem; max-width: 100%; }
.cg-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-link-plain, button.btn-link-plain { background: none; border: 0; color: var(--brand-500); font-weight: 600; cursor: pointer; padding: 0 4px; height: auto; box-shadow: none; }
@media (max-width: 760px) {
  .cg-cell select { font-size: 14px !important; }
  .cg-wall { max-height: none; }
}

/* Dispositivos: a tabela cabia mal ao lado do menu lateral (botões saíam da tela) */
.table-scroll { max-width: 100%; }
@media (min-width: 761px) {
  .table-scroll { overflow-x: auto; margin-bottom: 24px; border-radius: 12px; }
  .table-scroll > .table { margin-bottom: 0; }
  .devices-table th, .devices-table td { padding: 10px 10px; }
  .devices-table td input[type="text"], .devices-table td select { width: 100%; min-width: 7.5rem; max-width: 15rem; }
  .devices-table td.hint, .devices-table td[data-info] { max-width: 12rem; overflow-wrap: anywhere; font-size: .78rem; }
  .devices-table .dev-actions-cell { min-width: 14.5rem; }
  .devices-table .dev-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .devices-table .dev-actions form { display: block !important; margin: 0; }
  .devices-table .dev-actions button, .devices-table .dev-actions .btn { width: 100%; height: 2.1rem; padding: 0 .75rem; font-size: .8rem; white-space: nowrap; }
}
@media (max-width: 760px) {
  .devices-table .dev-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .devices-table .dev-actions form { margin: 0 !important; }
}
/* Notebook / tablet (761–1279 px): cada monitor vira um cartão, como no celular. */
@media (min-width: 761px) and (max-width: 1279px) {
  .devices-table, .devices-table tbody, .devices-table tr, .devices-table td { display: block; width: 100%; }
  .devices-table { background: none; border: 0; border-radius: 0; overflow: visible; }
  .devices-table thead { display: none; }
  .devices-table tbody tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; align-items: start;
    background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px;
  }
  .devices-table tbody tr:hover { background: var(--white); }
  .devices-table td { padding: 0; border: 0 !important; min-width: 0; max-width: none !important; }
  .devices-table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 4px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute);
  }
  .devices-table td input[type="text"], .devices-table td select { max-width: none; }
  .devices-table td[colspan], .devices-table .dev-actions-cell { grid-column: 1 / -1; min-width: 0; }
  .devices-table .dev-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .devices-table .dev-actions button { width: auto; }
  .table-scroll { overflow: visible; }
}
/* Acesso remoto: arrastar/rolar na imagem (remote-input.js) */
#rimg { touch-action: none; user-select: none; cursor: pointer; }
.remote-tap.remote-drag { background: rgba(36,158,212,.35); border-color: #249ED4; }
.sync-code-input { font-size: 1.3rem !important; letter-spacing: .18em; text-align: center; font-variant-numeric: tabular-nums; }
/* Dispositivos → Sync da loja: código de ativação */
.sync-code-box { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; margin: 8px 0 14px; border-radius: 12px; background: var(--secondary-bg); }
.sync-code { font-size: 2.2rem; font-weight: 700; letter-spacing: .14em; color: var(--brand-500); font-variant-numeric: tabular-nums; }
html.escuro .sync-code { color: #8CC8EE; }
.ok-text { color: var(--chip-green-text) !important; font-weight: 600; }
/* Carrossel de setores (editor) */
.sc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.sc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.sc-row select { flex: 1 1 12rem; min-width: 0; }
.sc-row .carousel-secs input { width: 5rem; }
