/* Painel administrativo — visual moderno com tema claro/escuro e cores da empresa (definidas em Configurações). */
:root {
  --brand: #0f3d5e; --accent: #ffd166;
  --bg: #f5f7fb; --surface: #ffffff; --surface-2: #f8fafc; --ink: #0f172a; --muted: #64748b; --line: #e6eaf0;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, transparent);
  --good: #16a34a; --mid: #d97706; --bad: #dc2626; --neutral: #cbd5e1;
  --radius: 16px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.05);
  --side-w: 256px; --side-w-collapsed: 76px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #111827; --surface-2: #0f172a; --ink: #e5e7eb; --muted: #94a3b8; --line: #1f2937;
  --brand-soft: color-mix(in srgb, var(--brand) 30%, transparent);
  --neutral: #475569; --shadow: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
:root[data-theme="dark"] a { color: color-mix(in srgb, var(--brand) 50%, white); }
h1 { font-size: 26px; letter-spacing: -.02em; margin: 0; } h2 { font-size: 16px; margin: 0 0 14px; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* ---------- layout + barra lateral */
.layout { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; transition: grid-template-columns .2s ease; }
.layout.collapsed { grid-template-columns: var(--side-w-collapsed) 1fr; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; min-height: 58px; }
.brand-logo { height: 36px; max-width: 150px; object-fit: contain; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 12px 6px; white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 12px; color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; white-space: nowrap; position: relative; }
.nav a svg { flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
:root[data-theme="dark"] .nav a.active { color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.side .spacer { flex: 1; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #1f2937; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.who-text { overflow: hidden; } .who-text b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; } .who-text span { font-size: 12px; color: var(--muted); }
.side-btn { display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; text-align: left; }
.side-btn:hover { background: var(--surface-2); color: var(--ink); }
.layout.collapsed .brand-name, .layout.collapsed .nav-label, .layout.collapsed .nav a span, .layout.collapsed .who-text, .layout.collapsed .side-btn span { display: none; }
.layout.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.layout.collapsed .brand-logo { display: none; }
.layout.collapsed .brand-mark { display: grid !important; }
.layout.collapsed .nav a, .layout.collapsed .side-btn, .layout.collapsed .who { justify-content: center; }

.main { padding: 28px 36px 48px; min-width: 0; }
.mobile-bar { display: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }

/* ---------- componentes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 20px; }
.grid.k4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kpi { display: flex; gap: 16px; align-items: flex-start; }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
:root[data-theme="dark"] .kpi-icon { color: #fff; }
.kpi-icon.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.kpi-icon.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .value { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.good { color: var(--good); } .bad { color: var(--bad); } .midc { color: var(--mid); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; white-space: nowrap; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: translateY(1px); } .btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.icon-only { padding: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; padding: 16px 18px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
input[type=color] { padding: 2px; height: 42px; width: 64px; cursor: pointer; }
textarea { resize: vertical; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--surface-2); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); border-color: transparent; }
.badge.warn { background: color-mix(in srgb, var(--mid) 14%, transparent); color: var(--mid); border-color: transparent; }
.badge.off { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-color: transparent; }
.badge.nps { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); min-width: 120px; }
.stack span { display: block; height: 100%; }
.stack .p { background: var(--good); } .stack .n { background: var(--neutral); } .stack .d { background: var(--bad); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.lp { background: var(--good); } .legend i.ln { background: var(--neutral); } .legend i.ld { background: var(--bad); }
.bars { display: grid; grid-template-columns: repeat(11, 1fr); gap: 8px; align-items: end; height: 170px; }
.bars .bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 12px; color: var(--muted); gap: 4px; }
.bars .bar div { width: 100%; border-radius: 8px 8px 3px 3px; min-height: 3px; }
.hbar { display: grid; grid-template-columns: minmax(140px, 40%) 1fr 56px; gap: 12px; align-items: center; margin: 10px 0; font-size: 14px; }
.chart svg { width: 100%; height: 210px; display: block; }
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment-icon { width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 35%, transparent); display: grid; place-items: center; flex: none; }
.q-editor { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: var(--surface-2); }
.q-editor > .row { margin-top: 10px; }
.q-editor > .row:first-child { margin-top: 0; }
.q-editor .row > * { flex: 1; } .q-editor .row > b, .q-editor .row > .btn, .q-editor .row > label.chk { flex: 0 0 auto; }
.q-editor .row > input:first-of-type { flex: 4; }
.q-editor.nps-marked { border-color: color-mix(in srgb, var(--accent) 80%, black 5%); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.q-num { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; }
label.chk { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; cursor: pointer; }
label.chk input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.code-box { font: 800 36px ui-monospace, monospace; letter-spacing: .25em; background: var(--brand); color: var(--accent); padding: 20px; border-radius: 14px; text-align: center; margin: 14px 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: var(--surface); border-radius: 18px; padding: 26px; width: min(600px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 12px; z-index: 60; max-width: 420px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-weight: 600; }
.toast.error { background: var(--bad); color: #fff; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: var(--accent); opacity: .18; right: -120px; bottom: -120px; }
.login-hero h2 { font-size: 34px; line-height: 1.15; max-width: 420px; letter-spacing: -.02em; }
.login-hero .logo-box { background: #fff; border-radius: 14px; padding: 10px 16px; display: inline-flex; }
.login-hero .logo-box img { height: 40px; max-width: 200px; object-fit: contain; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login { width: min(400px, 100%); }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.login .btn { justify-content: center; padding: 12px; }
.answers { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.answers li { margin: 3px 0; } .answers b { font-weight: 600; color: var(--muted); }
.preview-media { max-width: 240px; max-height: 150px; border-radius: 10px; display: block; margin-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 34px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-choice { display: grid; place-items: center; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-choice:hover { background: var(--surface-2); }
.icon-choice.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); outline: 2px solid var(--brand); }
.menu-icon-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.menu-icon-row:last-child { border-bottom: 0; }
.menu-icon-row .current { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-slot { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; }
.brand-slot .thumb { width: 72px; height: 72px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; border: 1px solid var(--line); }
.brand-slot .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.style-preview { display: flex; gap: 8px; align-items: center; padding: 14px; border-radius: 12px; background: var(--brand); color: #fff; flex-wrap: wrap; }
.style-preview svg { color: var(--accent); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; display: flex; gap: 8px; align-items: center; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }

@media (max-width: 900px) {
  .layout, .layout.collapsed { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .layout.mobile-open .side { transform: none; }
  .layout.mobile-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 30; }
  .layout.collapsed .brand-name, .layout.collapsed .nav-label, .layout.collapsed .nav a span, .layout.collapsed .who-text, .layout.collapsed .side-btn span { display: initial; }
  .collapse-btn { display: none !important; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .main { padding: 18px 16px 40px; }
  .grid.c2 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 28px; min-height: 200px; }
  .menu-icon-row { grid-template-columns: 1fr; }
}

.chart .zero { stroke: var(--line); } .chart .tbar { fill: color-mix(in srgb, var(--brand) 18%, transparent); }
.chart .tline { fill: none; stroke: var(--brand); stroke-width: 2.5; } .chart .tpt { fill: var(--brand); } .chart .tlabel { fill: var(--muted); }
:root[data-theme="dark"] .chart .tline { stroke: var(--accent); } :root[data-theme="dark"] .chart .tpt { fill: var(--accent); }
:root[data-theme="dark"] .brand-logo { background: #fff; padding: 4px 8px; border-radius: 8px; }
.comments-card { max-height: 460px; overflow-y: auto; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.style-grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.style-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.style-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.style-card.selected { border-color: var(--brand); outline: 2px solid var(--brand); background: var(--brand-soft); }
.mini-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; padding: 10px 8px; border-radius: 10px; align-items: center; justify-items: center; margin-bottom: 4px; }
.mini-scale svg { width: 100%; max-width: 20px; height: auto; color: #fff; }
.mini-num { width: 100%; aspect-ratio: 1; border-radius: 5px; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.code-input { font: 700 26px ui-monospace, monospace; letter-spacing: .3em; text-align: center; }
.qr { width: 200px; height: 200px; display: block; margin: 12px 0; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.secret { word-break: break-all; }
.steps { padding-left: 18px; color: var(--muted); }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.recovery code { font: 700 16px ui-monospace, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 8px; border-radius: 8px; text-align: center; letter-spacing: .08em; }
.login a.small { display: inline-block; margin-top: 14px; }
.contact-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: color-mix(in srgb, var(--good) 8%, var(--surface)); display: grid; gap: 4px; }
.timeline { list-style: none; padding: 0; margin: 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { padding: 6px 0 8px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.q-editor .row.cond { background: var(--brand-soft); border-radius: 10px; padding: 8px 10px; }
.q-editor .row.cond > * { flex: 0 1 auto; }
.q-editor .row.cond select { min-width: 200px; }
.q-editor .row.cond input[type=number] { width: 80px; }
details.tr { margin-top: 10px; } details.tr summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: 14px; }
details.tr .form-grid { margin-top: 10px; }
.mt { margin-top: 18px; }
.hours { display: grid; gap: 6px; margin-top: 8px; }
.hours-row { display: grid; grid-template-columns: 130px 110px auto 110px; gap: 8px; align-items: center; }
.poster { text-align: center; border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: #fff; color: #0f172a; }
.poster.off { opacity: .45; }
.poster-logo { max-height: 60px; max-width: 220px; }
.poster-title { font-size: 26px; font-weight: 800; margin: 10px 0; }
.poster-qr { width: 240px; height: 240px; }
.poster-sub { font-size: 14px; color: #475569; } .poster-branch { font-size: 12px; color: #94a3b8; margin-top: 6px; }
@media print {
  body.printing-poster > *:not(.modal-bg) { display: none !important; }
  body.printing-poster .modal-bg { position: static; background: none; padding: 0; }
  body.printing-poster .modal { box-shadow: none; width: 100%; max-height: none; }
  body.printing-poster .modal > *:not(div), body.printing-poster .modal .actions, body.printing-poster .modal p, body.printing-poster .modal .row { display: none !important; }
  body.printing-poster .poster { border: 0; padding-top: 60px; }
  body.printing-poster .poster-title { font-size: 44px; } body.printing-poster .poster-qr { width: 420px; height: 420px; } body.printing-poster .poster-sub { font-size: 22px; }
}
.guide ol { padding-left: 20px; line-height: 1.6; } .guide h2 { margin-top: 16px; }
