/* RegalTec Cloud — mesma gramática visual da ContaCloud (SuperAdmin / Suporte / Portal do Cliente).
   Azul #231734 e laranja #f77701 são as únicas cores de marca; verde, âmbar e vermelho existem só como estados.
   Roboto no corpo, Poppins nos títulos, ícones Tabler locais. Sem build. */

:root {
    --blue: #231734; --blue-d: #150d20; --blue-mid: #5b4a73; --blue-l: #f1eef5;
    --orange: #f77701; --orange-d: #d96500; --orange-l: #fff1e3;

    --bg: #eef1f4; --card: #fff; --surface-2: #f5f5f5; --line: #e0e0e0; --line-strong: #bdbdbd;
    --ink: #212121; --mut: #616161;
    --ok: #2e7d32; --ok-l: #e8f5e9; --warn: #e65100; --warn-l: #fff3e0; --danger: #c62828; --danger-l: #ffebee;
    --info: var(--blue); --info-l: var(--blue-l); --neutral: #616161; --neutral-l: #eeeeee;

    --r: 4px; --fs: 14px; --ctl: 34px; --ctl-sm: 28px; --sh: none;
    --font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --head: "Poppins", "Roboto", system-ui, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
/* Portal do cliente: mesmo sistema, cantos e controlos mais generosos (padrão Portal ContaCloud). */
body.pc { --bg: #eef1f4; --line: #e0e3e8; --line-strong: #c3c8d0; --surface-2: #f6f7f9; --ink: #1f2328; --mut: #5f6670; --r: 8px; --fs: 15px; --ctl: 40px; --ctl-sm: 34px; --sh: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: var(--fs); line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, dl, dd, ul, ol { margin: 0; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; line-height: 1.3; }
h1 { font-size: 20px; } h2 { font-size: 15px; } h3 { font-size: 14px; }
body.pc h1 { font-size: 22px; } body.pc h2 { font-size: 16px; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12px; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
.ti { line-height: 1; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
body.pc :focus-visible { outline-offset: 2px; }
h1[tabindex="-1"]:focus { outline: none; }

.muted { color: var(--mut); } .small { font-size: 12.5px; } .right { text-align: right; } .nowrap { white-space: nowrap; } .hidden { display: none !important; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .center { text-align: center; } .sp { flex: 1; }
.wrap { overflow-wrap: anywhere; } .sub { display: block; font-size: 12px; color: var(--mut); }
.mono { letter-spacing: .04em; }

/* ───────── Barra superior ───────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 0 20px; background: var(--blue); color: #fff; border-bottom: 3px solid var(--orange); position: sticky; top: 0; z-index: 40; }
body.pc .topbar { min-height: 56px; }
.topbar__brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.topbar__brand strong { font-family: var(--head); font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.topbar__logo { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff; color: var(--blue); font: italic 900 19px/1 Georgia, serif; }
.topbar__tag { font-size: 11px; font-weight: 500; letter-spacing: 1.2px; color: #dbe4fb; padding: 2px 8px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 2px; }
body.pc .topbar__tag { background: rgba(255, 255, 255, .16); border: 0; border-radius: 999px; letter-spacing: .8px; padding: 3px 8px; }
.env { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 2px; text-transform: uppercase; letter-spacing: .6px; background: var(--orange); color: #fff; }
.env.prod { background: #fff; color: var(--danger); }
.topbar__user { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.topbar__name { font-weight: 500; }
.topbar__link { color: #dbe4fb; font-size: 13px; } .topbar__link:hover { color: #fff; text-decoration: none; }
.topbar__btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5); border-radius: var(--r); padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.topbar__btn:hover { background: rgba(255, 255, 255, .14); border-color: #fff; text-decoration: none; }
.topbar form { margin: 0; }
.burger { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; margin-right: 4px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5); border-radius: var(--r); cursor: pointer; font-size: 18px; }
.co { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 5px; background: rgba(255, 255, 255, .12); color: #fff; max-width: 360px; min-width: 0; }
.co span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }

/* ───────── Estrutura ───────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.shell { flex: 1; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 8px 0 24px; }
.side .grp { padding: 16px 20px 6px; font-size: 11px; font-weight: 500; letter-spacing: 1.1px; text-transform: uppercase; color: var(--mut); }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: var(--ink); border-left: 3px solid transparent; font-size: 14px; }
.side a .ti { font-size: 18px; width: 18px; text-align: center; color: var(--mut); flex: none; }
.side a:hover { background: var(--surface-2); text-decoration: none; }
.side a.on { background: var(--blue-l); border-left-color: var(--orange); color: var(--blue); font-weight: 500; }
.side a.on .ti { color: var(--blue); }
.side .n { margin-left: auto; min-width: 20px; padding: 0 6px; height: 20px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.main { padding: 20px 24px 40px; min-width: 0; }
.page { display: flex; flex-direction: column; gap: 14px; max-width: 1480px; }
.foot { text-align: center; color: var(--mut); font-size: 12px; padding: 14px 12px 20px; }

/* Portal: navegação em cartão, conteúdo centrado (padrão PcLayout) */
body.pc .shell { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px; align-items: start; }
body.pc .side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
body.pc .side .grp { padding: 8px 12px 4px; }
body.pc .side a { padding: 10px 12px; border-left: 0; border-radius: 5px; font-weight: 500; }
body.pc .side a.on { background: var(--blue-l); color: var(--blue); box-shadow: inset 3px 0 0 var(--orange); }
body.pc .side a .ti { font-size: 19px; width: 19px; }
body.pc .main { padding: 0; }

/* ───────── Cabeçalho de página ───────── */
.page-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; }
.page-h > div:first-child, .page-h .titles { min-width: 0; }
.page-h h1 { margin: 0; }
.page-h .lead { color: var(--mut); margin-top: 2px; max-width: 760px; }
.page-h .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-h .acts form { margin: 0; }
.crumbs { font-size: 12.5px; color: var(--mut); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.crumbs a { color: var(--mut); } .crumbs a:hover { color: var(--blue); }

/* ───────── Cartões ───────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 14px 16px; margin: 0; min-width: 0; }
body.pc .card { padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card.hl { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 10px; }
.card .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.card .hd h2, .card .hd h3 { margin: 0; font-size: 15px; }
body.pc .card .hd { background: transparent; padding: 14px 18px; }
.card .bd { padding: 14px 16px; }
.card.flush > .notice, .card.flush > .flash { margin: 10px 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; align-items: start; } .grid > .kpi, .grid > a.kpi { align-self: stretch; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--mut); margin: 6px 0 -4px; }
.hint { color: var(--mut); font-size: 13px; }

/* ───────── KPIs ───────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sh); min-width: 0; }
.kpi .l { font-size: 12px; color: var(--mut); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; order: -1; }
.kpi .v { font-family: var(--head); font-size: 24px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--mut); margin: 0; }
.kpi.ok { border-top-color: var(--ok); } .kpi.info { border-top-color: var(--blue-mid); } .kpi.warn { border-top-color: var(--orange); } .kpi.brand { border-top-color: var(--blue); } .kpi.danger { border-top-color: var(--danger); }
a.kpi { color: var(--ink); } a.kpi:hover { text-decoration: none; border-color: var(--blue); }

/* ───────── Tabelas ───────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; color: var(--mut); background: var(--surface-2); padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
tbody tr:hover { background: var(--blue-l); } tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.act, th.act { text-align: right; white-space: nowrap; }
td.ctr, th.ctr { text-align: center; }
.row-acts { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.row-acts form { margin: 0; }
.card.flush table + .pager { border-top: 1px solid var(--line); }
.card.flush:has(+ .pager) { border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: -14px; }
.card.flush + .pager { border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
.dense td { padding: 5px 12px; }

/* ───────── Estados ───────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 6px; border-radius: 10px; font-size: 12px; font-weight: 500; line-height: 18px; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.b-ok { color: var(--ok); background: var(--ok-l); border-color: #c8e6c9; }
.b-info { color: var(--blue); background: var(--blue-l); border-color: #d9d2e4; }
.b-warn { color: var(--warn); background: var(--warn-l); border-color: #ffe0b2; }
.b-danger { color: var(--danger); background: var(--danger-l); border-color: #ffcdd2; }
.b-neutral { color: var(--neutral); background: var(--neutral-l); border-color: #e0e0e0; }
.tag { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--orange-d); background: var(--orange-l); border-radius: 2px; vertical-align: middle; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; background: var(--mut); }
.dot.ok { background: #1a9b5b; } .dot.warn { background: #e0a100; } .dot.danger { background: #d23a3a; } .dot.neutral { background: #8892a0; }

/* ───────── Botões ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ctl); padding: 0 14px; font: inherit; font-weight: 500; line-height: 1; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--blue-l); border-color: var(--blue); }
.btn .ti { font-size: 16px; }
.btn.sm { height: var(--ctl-sm); padding: 0 10px; font-size: 13px; }
.btn.p { color: #fff; background: var(--blue); border-color: var(--blue); } .btn.p:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn.o { color: #fff; background: var(--orange); border-color: var(--orange); } .btn.o:hover { background: var(--orange-d); border-color: var(--orange-d); }
.btn.d { color: var(--danger); border-color: #ef9a9a; } .btn.d:hover { background: var(--danger-l); border-color: var(--danger); }
.btn.dd { color: #fff; background: var(--danger); border-color: var(--danger); } .btn.dd:hover { background: #a61f1f; }
.btn.block { width: 100%; height: 40px; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ico { width: var(--ctl-sm); padding: 0; }

/* ───────── Alertas ───────── */
.flash, .notice { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--r); border: 1px solid; }
.flash.ok { color: #1b5e20; background: var(--ok-l); border-color: #a5d6a7; }
.flash.err { color: #8e1b1b; background: var(--danger-l); border-color: #ef9a9a; }
.flash.warn, .notice { color: #8a3a00; background: var(--orange-l); border-color: #f9b98a; }
.flash.info, .note { color: var(--blue-d); background: var(--blue-l); border-color: #d9d2e4; }
.flash > div { flex: 1; }
.note { padding: 9px 12px; border: 1px solid #d9d2e4; border-radius: var(--r); }

/* ───────── Formulários ───────── */
.form { display: flex; flex-direction: column; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; }
label { font-size: 12px; font-weight: 500; color: var(--mut); display: block; margin: 0; }
body.pc label { font-size: 13px; }
.fld .help { font-size: 12px; color: var(--mut); } .fld .err { font-size: 12.5px; color: var(--danger); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=month], input[type=search], input[type=tel], input[type=url], select, textarea {
    width: 100%; height: var(--ctl); padding: 0 10px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r);
}
textarea { height: auto; min-height: 96px; padding: 7px 9px; resize: vertical; }
select { padding-right: 4px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 2px solid var(--blue-l); }
input[readonly], input:disabled, select:disabled { background: var(--surface-2); color: var(--mut); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; flex: none; }
label.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; color: var(--ink); cursor: pointer; min-height: var(--ctl); }
.fld > label.chk { min-height: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; } .row > * { flex: 1 1 160px; min-width: 0; } .row.nofill > * { flex: none; }
.row > .fld { margin: 0; }
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fgrid .span2 { grid-column: 1 / -1; }
.fsec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.fsec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.fsec > h3 { font-size: 14px; margin-bottom: 8px; }
.fsec > .hint { margin: -4px 0 10px; }
.form-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.card.flush > form > .bd, .card.flush > .bd { padding: 14px 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.filters > div, .filters > .fld { min-width: 150px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.filters .grow { flex: 1 1 240px; }
.filters .fld { margin: 0; }

.dl { display: grid; grid-template-columns: minmax(130px, 220px) minmax(0, 1fr); margin: 0; }
.dl dt { padding: 8px 0; color: var(--mut); font-weight: 500; border-bottom: 1px solid var(--line); }
.dl dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin: 0; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--mut); } .facts dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.secret { font-size: 14px; padding: 3px 8px; background: var(--orange-l); border-color: var(--orange); user-select: all; }

/* ───────── Separadores, paginação, vazio ───────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); flex-wrap: wrap; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--mut); border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; padding: 8px 16px; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.tabs a.on { color: var(--blue); background: var(--card); border-color: var(--line-strong); border-bottom: 1px solid var(--card); box-shadow: inset 0 3px 0 var(--orange); }
.tabs a .n { background: var(--orange); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 17px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: var(--surface-2); border-top: 1px solid var(--line); }
.pager__info { color: var(--mut); font-size: 12.5px; } .pager__ctrl { display: flex; align-items: center; gap: 6px; }
.pager .btn { height: var(--ctl-sm); padding: 0 10px; font-size: 13px; } .pager .cur { display: inline-flex; align-items: center; height: var(--ctl-sm); padding: 0 10px; border-radius: var(--r); background: var(--blue); color: #fff; font-size: 13px; font-weight: 500; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px 16px; color: var(--mut); }
.empty strong { color: var(--ink); font-size: 14px; }
.bar { height: 10px; background: var(--neutral-l); border-radius: 2px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--blue); } .bar.warn > i { background: var(--orange); } .bar.danger > i { background: var(--danger); }

/* ───────── Conversas e linha do tempo ───────── */
.msg { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 10px; background: #fff; }
.msg.staff { background: var(--blue-l); border-color: #d9d2e4; } .msg.internal { background: var(--orange-l); border-color: #f9b98a; }
.msg .who { font-size: 12.5px; color: var(--mut); margin-bottom: 4px; } .msg .body { white-space: pre-wrap; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { padding: 6px 0 6px 18px; border-left: 2px solid var(--line); position: relative; font-size: 13px; } .timeline li:before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }

/* ───────── Mapa e escala ───────── */
.map { height: 560px; border-radius: var(--r); border: 1px solid var(--line); z-index: 0; } .map.sm { height: 320px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--mut); margin: 8px 0; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.roster { min-width: 900px; } .roster th, .roster td { padding: 6px 8px; font-size: 12.5px; border: 1px solid var(--line); vertical-align: top; } .roster td { min-width: 120px; height: 70px; }
.roster .ev { display: block; background: var(--blue-l); border-left: 3px solid var(--blue); padding: 2px 6px; margin-bottom: 3px; border-radius: 3px; } .roster .ev.out { background: var(--orange-l); border-color: var(--orange); } .roster .ev.bad { background: var(--danger-l); border-color: var(--danger); }
.roster td.off { background: repeating-linear-gradient(45deg, #f1f3f8, #f1f3f8 6px, #fafbfd 6px, #fafbfd 12px); }
.tech-ico { width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 18px solid #1a9b5b; filter: drop-shadow(0 0 2px #fff); } .tech-ico.en_route { border-bottom-color: #1d62d1; } .tech-ico.on_site { border-bottom-color: #7b3fc4; }
.qr { display: flex; justify-content: center; padding: 10px; } .qr svg, .qr img, .qr canvas { width: 180px; height: 180px; background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: var(--r); }

/* ───────── Carregamento (padrão ContaCloud: sa-boot / sa-loading / sa-spinner) ───────── */
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: rt-spin .7s linear infinite; flex: none; display: inline-block; }
@keyframes rt-spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; padding: 22px 16px; color: var(--mut); }
/* barra fina no topo durante a navegação */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3200; pointer-events: none; opacity: 0; transition: opacity .15s; }
.progress.on { opacity: 1; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--orange)); transition: width .4s ease; }
/* cartão de carregamento (aparece só se a navegação demorar) */
.boot { position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center; background: rgba(238, 241, 244, .85); }
.boot.on { display: flex; }
.boot__card { display: flex; align-items: center; gap: 14px; width: 340px; max-width: calc(100vw - 32px); padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 4px; box-shadow: 0 8px 26px rgba(33, 33, 33, .16); }
.boot__mark { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--blue); color: #fff; font: italic 900 19px/1 Georgia, serif; animation: rt-pulse 1.2s ease-in-out infinite; }
@keyframes rt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.boot__copy { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; } .boot__copy strong { font-size: 12.5px; }
.boot__bar { height: 3px; background: var(--neutral-l); overflow: hidden; border-radius: 2px; } .boot__bar i { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--orange)); animation: rt-slide 1.2s ease-in-out infinite; }
@keyframes rt-slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(330%); } }
/* botão a processar */
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: rt-spin .7s linear infinite; }
.btn:not(.p):not(.o):not(.dd).busy::after { border-color: var(--line-strong); border-top-color: var(--blue); }
/* esqueletos para blocos carregados de forma assíncrona (mapa, gráficos) */
.skeleton { position: relative; overflow: hidden; background: var(--neutral-l); border-radius: var(--r); min-height: 16px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); animation: rt-shimmer 1.3s infinite; }
@keyframes rt-shimmer { to { transform: translateX(100%); } }
.skeleton-line { height: 12px; margin: 8px 0; } .skeleton-line.w60 { width: 60%; } .skeleton-line.w40 { width: 40%; }
.is-loading { position: relative; } .is-loading::before { content: ""; position: absolute; inset: 0; z-index: 5; background: rgba(255, 255, 255, .7); border-radius: var(--r); }
.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -11px 0 0 -11px; width: 22px; height: 22px; z-index: 6; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: rt-spin .7s linear infinite; }
.page { animation: rt-in .18s ease-out; } @keyframes rt-in { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .spinner, .boot__mark, .boot__bar i, .skeleton::after, .btn.busy::after, .is-loading::after { animation-duration: 2.4s !important; } }

/* ───────── Janelas modais (<dialog>) para acções pequenas ───────── */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 32px); width: 620px; max-height: 90vh; overflow: visible; }
dialog.modal.sm { width: 440px; } dialog.modal.lg { width: 860px; }
dialog.modal::backdrop { background: rgba(33, 33, 33, .5); }
.modal__box { background: var(--card); border-radius: 6px; border-top: 4px solid var(--blue); box-shadow: 0 18px 50px rgba(0, 0, 0, .3); display: flex; flex-direction: column; max-height: 90vh; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: 2px 2px 0 0; }
.modal__head h2 { font-size: 16px; margin: 0; }
.modal__body { padding: 14px 16px 16px; overflow-y: auto; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 6px 6px; }
.modal__x { background: transparent; border: 0; font-size: 20px; line-height: 1; color: var(--mut); cursor: pointer; padding: 2px 6px; }

/* ───────── Autenticação (padrão sa-auth) ───────── */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.auth__body { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 24px; }
.auth__card { width: 100%; max-width: 400px; padding: 24px 24px 20px; border-top: 4px solid var(--blue); }
.auth__card.wide { max-width: 860px; }
.auth__title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.auth__lead { color: var(--mut); margin-bottom: 14px; }
.auth__alt { margin-top: 14px; text-align: center; font-size: 12.5px; }
.auth__foot { text-align: center; padding: 14px 16px; color: var(--mut); font-size: 12px; }
.auth .form .btn.p { height: 40px; }
.auth .topbar { position: static; }

/* ───────── Assistente de instalação (fluxo por passos) ───────── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0; list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; color: var(--mut); border-right: 1px solid var(--line); border-bottom: 3px solid transparent; min-width: 0; }
.steps li:last-child { border-right: 0; }
.steps li .n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--neutral-l); color: var(--mut); font-size: 12px; font-weight: 600; flex: none; }
.steps li.done { color: var(--ink); } .steps li.done .n { background: var(--ok); color: #fff; }
.steps li.on { color: var(--blue); font-weight: 500; background: var(--blue-l); border-bottom-color: var(--orange); } .steps li.on .n { background: var(--blue); color: #fff; }
.steps li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard { max-width: 920px; margin: 0 auto; width: 100%; padding: 20px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.wiz-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.req td { padding: 8px 12px; } .req .ic { width: 30px; font-weight: 700; text-align: center; } .req tr.ok .ic { color: var(--ok); } .req tr.bad .ic { color: var(--danger); } .req tr.warn .ic { color: var(--warn); }
.probe { border: 1px solid; border-radius: var(--r); padding: 9px 12px; } .probe.ok { background: var(--ok-l); border-color: #a5d6a7; } .probe.bad { background: var(--danger-l); border-color: #ef9a9a; }
.help-box { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 8px 12px; } .help-box summary { cursor: pointer; font-weight: 500; }
.log { list-style: none; margin: 0; padding: 0; } .log li { padding: 5px 0; border-bottom: 1px solid var(--line); } .log li:before { content: "✔ "; color: var(--ok); } .log li.warnt:before { content: "! "; color: var(--warn); }
.warnt { color: var(--warn); }

/* ───────── Responsivo ───────── */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .g-side, .g3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
    .shell, body.pc .shell { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
    body.pc .shell { padding: 12px; gap: 12px; }
    .burger { display: inline-flex; }
    .side { position: fixed; left: -260px; top: 0; bottom: 0; width: 250px; z-index: 60; overflow: auto; transition: left .2s; padding-top: 60px; border: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    .side.open { left: 0; }
    body.pc .side { position: fixed; border-radius: 0; top: 0; }
    .main { padding: 14px 12px 32px; } body.pc .main { padding: 0; }
    .g2, .g4, .fgrid, .fgrid.c3 { grid-template-columns: minmax(0, 1fr); }
    .dl { grid-template-columns: minmax(0, 1fr); } .dl dt { border-bottom: 0; padding-bottom: 0; }
    .topbar { padding: 0 12px; } .topbar__name, .topbar__link { display: none; }
    .steps li span:last-child { display: none; } .steps li { justify-content: center; }
}
@media print { .topbar, .side, .btn, .filters, .tabs, .foot { display: none !important; } .shell { display: block; } .main, body.pc .main { padding: 0; } .card { box-shadow: none; border: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───────── Adições (consola admin: painel, escala, backups) ───────── */
.card.bare { border: 0; box-shadow: none; background: transparent; padding: 0; }
.wk { font-weight: 500; padding: 0 4px; white-space: nowrap; }
.roster td.today { background: var(--surface-2); }
.filters.weeknav { align-items: center; }
.kgroup { display: flex; flex-direction: column; gap: 8px; }
.kgroup > h2 { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--mut); font-family: var(--font); }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.todo .txt { flex: 1; min-width: 0; font-weight: 500; }
.todo .txt small { display: block; color: var(--mut); font-size: 12px; font-weight: 400; }
.todo-ok { display: flex; align-items: center; gap: 8px; padding: 16px; color: var(--ok); font-weight: 500; }
.meter { height: 8px; background: var(--neutral-l); border-radius: 4px; overflow: hidden; min-width: 80px; }
.meter > i { display: block; height: 100%; background: var(--blue-mid); } .meter.warn > i { background: var(--orange); } .meter.danger > i { background: var(--danger); }
.pre-box { margin: 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.preview-frame { width: 100%; height: 520px; border: 1px solid var(--line); background: #fff; border-radius: var(--r); }
.mapbox { height: 70vh; min-height: 360px; padding: 0; }

/* ───────── Acrescentos do portal do cliente (views portal/**, auth/*) ───────── */
.fld input[aria-invalid="true"], .fld select[aria-invalid="true"], .fld textarea[aria-invalid="true"] { border-color: var(--danger); background: #fff8f8; }
.codebox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.codebox .secret { font-size: 18px; padding: 8px 12px; letter-spacing: .08em; overflow-wrap: anywhere; }
.steps-list { margin: 0 0 4px; padding-left: 20px; color: var(--mut); } .steps-list li { padding: 2px 0; }
.prose { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.map-card { height: 55vh; min-height: 320px; padding: 0 !important; overflow: hidden; }
.card .hd .row-acts, .page-h .acts .badge { flex: none; }
.tbl-wrap td .badge { vertical-align: middle; }
tfoot td { padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface-2); }
.auth__card .flash { margin-bottom: 14px; }
.auth__alt form { margin: 0; }
@media (max-width: 820px) { .map-card { height: 45vh; } .page-h .acts { width: 100%; } }
body.pc .card.flush { padding: 0; }   /* body.pc .card tem maior especificidade que .card.flush e anulava o corpo sem margens */
body.pc .card.flush > .bd { padding: 14px 18px; }
body.pc .card.flush > .hd { padding: 12px 18px; }
.scroll-y { max-height: 55vh; overflow-y: auto; }
@media (max-width: 960px) { .scroll-y { max-height: 360px; } }
@media (max-width: 640px) { .hide-sm { display: none; } }
@media (max-width: 640px) { td.act, th.act { white-space: normal; } td.act .row-acts { justify-content: flex-start; } }
@media (max-width: 640px) { td.act .btn { white-space: normal; height: auto; min-height: var(--ctl-sm); padding: 4px 8px; line-height: 1.2; } }
.stack.tight { gap: 4px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
#map-visits .mv { padding: 6px 0; border-bottom: 1px solid var(--line); } #map-visits .mv:last-child { border-bottom: 0; }

/* ───────── Portal: laranja RegalTec misturado com o azul, como no admin ───────── */
body.pc .kpi { border-top-color: var(--blue-mid); } body.pc .kpi.warn { border-top-color: var(--orange); }
body.pc .page-h h1 { position: relative; padding-bottom: 6px; } body.pc .page-h h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 3px; border-radius: 2px; background: var(--orange); }
body.pc .card.flush > .hd { border-left: 3px solid var(--orange); }
body.pc .foot { border-top: 3px solid var(--orange); background: transparent; padding-top: 14px; }

/* ── Cronómetro de trabalho (chamados) ── */
.timer { font-family: var(--head); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .5px; }
.work { display: flex; flex-direction: column; gap: 12px; }
.work__clock { display: flex; align-items: center; gap: 12px; }
.work__time { font-size: 32px; line-height: 1; color: var(--blue-d); }
.work--running .work__time { color: var(--ok); }
.work--paused .work__time { color: var(--warn); }
.work__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); flex: none; }
.work--running .work__dot { background: var(--ok); animation: rt-pulse 1.4s ease-in-out infinite; }
.work--paused .work__dot { background: var(--warn); }
.work__acts { display: flex; gap: 8px; flex-wrap: wrap; } .work__acts form { margin: 0; }
.work__hint { color: var(--mut); font-size: 12px; }
.work__others { font-size: 12px; color: var(--mut); border-top: 1px solid var(--line); padding-top: 8px; }
.topbar__timer { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 3px; background: var(--orange); color: #fff; font-size: 13px; font-weight: 500; }
.topbar__timer:hover { text-decoration: none; background: var(--orange-d); color: #fff; }
.topbar__timer .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: rt-pulse 1.4s ease-in-out infinite; }
.topbar__timer .timer { font-size: 13px; }
.outcomes { display: grid; gap: 8px; }
.outcome { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; cursor: pointer; background: #fff; }
.outcome input { margin-top: 3px; accent-color: var(--orange); }
.outcome b { display: block; font-weight: 500; } .outcome small { color: var(--mut); }
.outcome:has(input:checked) { border-color: var(--orange); background: var(--orange-l); box-shadow: inset 3px 0 0 var(--orange); }
.work-note { white-space: pre-line; }
.work-sum { display: grid; gap: 4px; font-size: 13px; }
.work-sum b { font-weight: 500; color: var(--mut); text-transform: uppercase; font-size: 11px; letter-spacing: .4px; display: block; }
@media (max-width: 640px) { .topbar__timer .lbl { display: none; } .work__time { font-size: 26px; } }

/* ── Instalador ── */
.wiz-c { overflow: hidden; }
.wiz-c > form, .wiz-c > .wiz-actions { margin: 0; }
.sum { width: 100%; border-collapse: collapse; } .sum th { text-align: left; width: 150px; color: var(--mut); font-weight: 500; padding: 8px 12px; vertical-align: top; background: var(--surface-2); border-bottom: 1px solid var(--line); } .sum td { padding: 8px 12px; border-bottom: 1px solid var(--line); word-break: break-word; }
.wiz-c .req { width: 100%; border-collapse: collapse; } .wiz-c .req td { border-bottom: 1px solid var(--line); vertical-align: top; } .req .help { color: var(--mut); font-size: 12px; margin-top: 2px; }
.wiz-c .probe { margin: 4px 0; }
.wiz-c .help-box { margin-top: 14px; } .wiz-c .help-box .fgrid { margin-top: 10px; }
.err { color: var(--danger); } .warnt { color: var(--warn); }
.wiz-c .bd > .flash { margin-bottom: 12px; }
@media (max-width: 640px) { .steps { grid-template-columns: repeat(6, minmax(0, 1fr)); } .steps li { padding: 10px 4px; } }
@media (max-width: 960px) { .tk-grid > .stack:last-child { order: -1; } }

/* ── Mapa 360 avançado ── */
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ok); padding: 0 6px; } .live__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: rt-pulse 1.4s ease-in-out infinite; }
.live--off { color: var(--mut); } .live--off .live__dot { background: var(--line-strong); animation: none; }
.mapfilters { align-items: flex-end; }
.mapx { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; margin-top: 14px; align-items: stretch; }
.mapx__map { position: relative; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.mapx .mapbox { height: 68vh; min-height: 420px; border: 0; border-radius: 0; }
.mapx__side { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; max-height: 68vh; overflow: hidden; }
.mapx__side .tabs { margin: 0; padding: 0 6px; flex: none; } .mapx__side .tabs b { font-weight: 500; color: var(--mut); margin-left: 3px; font-size: 12px; }
.mapx__list { overflow-y: auto; flex: 1; }
.maptools { position: absolute; top: 10px; left: 54px; z-index: 500; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: rgba(255, 255, 255, .95); border: 1px solid var(--line); border-radius: var(--r); padding: 5px 10px; font-size: 12.5px; }
.maptools .chk { margin: 0; }
.maplegend { position: absolute; left: 10px; bottom: 22px; z-index: 500; background: rgba(255, 255, 255, .95); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; font-size: 12px; gap: 3px; }
.maplegend .dot, .mrow__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.tdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; } .tdot.free { background: #2e7d32; } .tdot.en_route { background: #f77701; } .tdot.on_site { background: #7b3fc4; }
.mrow { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 9px 12px; cursor: pointer; font: inherit; }
.mrow:hover { background: var(--blue-l); } .mrow__dot { margin-top: 6px; flex: none; }
.mrow__dot--ok { background: var(--ok); } .mrow__dot--warn { background: var(--warn); } .mrow__dot--danger { background: var(--danger); } .mrow__dot--neutral { background: #8892a0; } .mrow__dot--info { background: var(--blue-mid); } .mrow__dot--brand { background: var(--orange); }
.mrow__b { display: flex; flex-direction: column; min-width: 0; } .mrow__b b { font-weight: 500; } .mrow__b small { color: var(--mut); font-size: 12px; }
.pin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); color: #fff; font: 600 12px/22px var(--font); text-align: center; background: #8892a0; }
.pin--ok { background: #2e7d32; } .pin--warn { background: #e65100; } .pin--danger { background: #c62828; } .pin--neutral { background: #8892a0; }
.pin--late { animation: pin-pulse 1.6s ease-out infinite; } @keyframes pin-pulse { 0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, .6); } 100% { box-shadow: 0 0 0 14px rgba(198, 40, 40, 0); } }
.tpin { width: 30px; height: 30px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .45); color: #fff; font: 600 12px/26px var(--font); text-align: center; }
.tpin--available { background: #2e7d32; } .tpin--en_route { background: #f77701; } .tpin--on_site { background: #7b3fc4; } .tpin--stale { background: #8a8f98; opacity: .8; }
.pop { font-size: 13px; line-height: 1.45; } .pop strong { font-size: 14px; } .pop__list { margin: 4px 0; padding-left: 16px; } .pop .btn { margin-top: 6px; }
.mapx.is-full { background: #fff; padding: 8px; } .mapx.is-full .mapbox { height: calc(100vh - 20px); } .mapx.is-full .mapx__side { max-height: calc(100vh - 20px); }
@media (max-width: 960px) { .mapx { grid-template-columns: minmax(0, 1fr); } .mapx__side { max-height: 40vh; } .maptools { left: 10px; top: 54px; } .maplegend { display: none; } }
.eta { margin: 0 0 12px; font-weight: 500; }

/* ── Marca RegalTec: logótipo, topbar branca e laranja/roxo-escuro da marca ── */
.topbar { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(35, 23, 52, .12); }
.topbar__img { height: 18px; width: auto; display: block; }
.topbar__brand strong { display: none; }
.topbar__tag { color: var(--blue); border-color: var(--line-strong); }
body.pc .topbar__tag { background: var(--blue-l); color: var(--blue); }
.topbar__link { color: var(--mut); } .topbar__link:hover { color: var(--orange-d); }
.topbar__btn { color: var(--blue); border-color: var(--line-strong); } .topbar__btn:hover { background: var(--blue-l); border-color: var(--blue); color: var(--blue); }
.topbar__name { color: var(--blue); }
.burger { color: var(--blue); border-color: var(--line-strong); }
.co { background: var(--blue-l); color: var(--blue); }
.topbar__timer, .topbar__timer:hover { color: #fff; }
.side a.on, .side a.active { box-shadow: inset 3px 0 0 var(--orange); }
@media (max-width: 640px) { .topbar__img { height: 16px; } }

/* ── Laranja só como acento discreto (não cansa a vista): fundos sólidos laranja passam a tons suaves ── */
.env { background: var(--orange-l); color: var(--orange-d); border: 1px solid #f5c79a; }
.env.prod { background: var(--danger-l); color: var(--danger); border-color: #ef9a9a; }
.side .n, .tabs a .n { background: var(--blue-l); color: var(--blue); border: 1px solid var(--line-strong); font-weight: 600; }
.topbar__timer, .topbar__timer:hover { background: var(--blue); color: #fff; }
.topbar__timer .dot { background: var(--orange); }
.btn.o { color: #fff; background: var(--blue); border-color: var(--blue); } .btn.o:hover { background: var(--blue-d); border-color: var(--blue-d); }
.tpin--en_route { background: var(--blue-mid); } .tdot.en_route { background: var(--blue-mid); }
.kpi.warn { border-top-color: #e0a100; } body.pc .kpi.warn { border-top-color: #e0a100; }
body.pc .foot { border-top: 1px solid var(--line); }
.card.hl { box-shadow: inset 3px 0 0 var(--orange); border-color: var(--line); }
.outcome:has(input:checked) { background: var(--blue-l); border-color: var(--blue); box-shadow: inset 3px 0 0 var(--orange); }

/* ───────── Formulários v2: uma só gramática ─────────
   Cada secção é uma linha: título + explicação à esquerda, campos à direita. Largura total, controlos compactos, rodapé de acções sempre visível. */
.form { gap: 0; }
.fsec { display: grid; grid-template-columns: 230px minmax(0, 1fr); column-gap: 32px; row-gap: 2px; align-content: start; border-top: 1px solid var(--line); padding: 18px 0; margin: 0; }
.fsec:first-child { border-top: 0; padding-top: 2px; }
.fsec:last-child { padding-bottom: 4px; }
.fsec > h3 { grid-column: 1; grid-row: 1; font-size: 14px; margin: 0; color: var(--ink); }
.fsec > .hint { grid-column: 1; grid-row: 2; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--mut); }
.fsec > :not(h3):not(.hint) { grid-column: 2; grid-row: 1 / span 4; max-width: 880px; min-width: 0; }
.fgrid, .fgrid.c3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; }
.fgrid .span2 { grid-column: 1 / -1; }
.fld .help { line-height: 1.4; }
.stack.tight { display: flex; flex-direction: column; gap: 8px; }
.form-foot { position: sticky; bottom: 0; z-index: 5; }
.card.form-card .bd.form { padding: 16px 20px; }
.modal .fsec, .wiz-c .fsec { display: block; padding: 10px 0; }
.modal .fsec > :not(h3):not(.hint), .wiz-c .fsec > :not(h3):not(.hint) { max-width: none; }
.modal .fsec > h3, .wiz-c .fsec > h3 { margin-bottom: 6px; }
@media (max-width: 900px) {
  .fsec { display: block; }
  .fsec > h3 { margin-bottom: 4px; } .fsec > .hint { margin-bottom: 10px; }
  .fsec > :not(h3):not(.hint) { max-width: none; }
}
[hidden] { display: none !important; }

/* ───────── Painel: barra de estado + duas colunas ───────── */
.statbar { display: flex; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; }
.statbar > * { flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-left: 1px solid var(--line); color: var(--ink); text-decoration: none !important; min-width: 0; }
.statbar > *:first-child { border-left: 0; }
.statbar > *:hover { background: var(--surface-2); }
.statbar .v { font: 600 24px/1.1 Poppins, Roboto, sans-serif; }
.statbar .l { font-size: 12.5px; color: var(--mut); }
.statbar > *.bad .v { color: var(--danger); } .statbar > *.warn .v { color: #b45309; }
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
ul.plain { list-style: none; margin: 0; padding: 0; } ul.plain > li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); } ul.plain > li:first-child { border-top: 0; }
ul.plain .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; } ul.plain small { color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) { .dash { grid-template-columns: minmax(0, 1fr); } .statbar > * { flex-basis: 45%; } }
.mt { margin-top: 12px; }
.testrow { align-items: flex-end; margin-top: 10px; } .testrow .fld { flex: 1 1 260px; min-width: 220px; }
.fsec .flash { margin-bottom: 4px; }
.fbody { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.csat-pick { margin: 0 0 14px; font-size: 15px; } .csat-n { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font: 600 17px Poppins, sans-serif; background: #f9a825; margin: 0 6px; }
.csat-n.s1 { background: #c62828; } .csat-n.s2 { background: #ef6c00; } .csat-n.s4 { background: #7cb342; } .csat-n.s5 { background: #2e7d32; }

/* ───────── Gráficos (SVG/CSS puros, sem JavaScript) ───────── */
.chart svg { width: 100%; max-width: 620px; height: auto; display: block; margin: 0 auto; } .chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { font: 12px Roboto, sans-serif; fill: var(--mut); }
.clegend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--mut); margin-top: 4px; } .clegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
rect.b-navy, i.b-navy { fill: #231734; background: #231734; } rect.b-orange, i.b-orange { fill: #f77701; background: #f77701; } rect.b-ok, i.b-ok { fill: #2e9d57; background: #2e9d57; }
rect.b-danger, i.b-danger { fill: #c62828; background: #c62828; } rect.b-warn, i.b-warn { fill: #e5a100; background: #e5a100; } rect.b-info, i.b-info { fill: #5b6fb3; background: #5b6fb3; } rect.b-mut, i.b-mut { fill: #b7bcc6; background: #b7bcc6; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; } .hbars li { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; }
.hbars .l { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hbars .bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; } .hbars .bar i { display: block; height: 100%; border-radius: 5px; } .hbars .n { text-align: right; }
.donut { text-align: center; } .donut svg { width: 104px; height: 104px; } .donut .trk { fill: none; stroke: var(--surface-2); stroke-width: 11; } .donut .val { fill: none; stroke-width: 11; stroke-linecap: round; }
.donut .s-ok { stroke: #2e9d57; } .donut .s-warn { stroke: #e5a100; } .donut .s-danger { stroke: #c62828; } .donut .s-navy { stroke: #231734; } .donut .num { font: 600 20px Poppins, sans-serif; fill: var(--ink); } .donut .cap { font-size: 12px; color: var(--mut); margin-top: 2px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.gauges { display: flex; justify-content: space-around; gap: 8px; padding: 6px 0 2px; }
.statgroup { margin-bottom: 10px; } .statgroup > h2 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); font-weight: 500; margin: 0 0 5px 2px; } .statgroup .statbar { margin-bottom: 0; }
.statbar .s { font-size: 11.5px; color: var(--mut); }
.chart-sub { font-size: 12px; font-weight: 500; color: var(--mut); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .05em; } .statpair { margin-bottom: 10px; align-items: start; } .statpair .statgroup { margin: 0; } .statbar small { font-size: 14px; color: var(--mut); font-weight: 400; }

/* ───────── Sino de notificações (topo, ao lado do nome) ───────── */
.bell { position: relative; } .bell > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; position: relative; color: var(--ink); }
.bell > summary::-webkit-details-marker { display: none; } .bell > summary:hover, .bell[open] > summary { background: var(--surface-2); } .bell > summary .ti { font-size: 20px; }
.bell__n { position: absolute; top: -3px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font: 600 10px/14px Roboto, sans-serif; text-align: center; border: 2px solid #fff; box-sizing: border-box; pointer-events: none; }
.bell__pop { position: absolute; right: -60px; top: 42px; z-index: 60; width: 360px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(16, 24, 40, .16); overflow: hidden; }
.bell__hd { padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.bell__it { display: flex; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none !important; } .bell__it:first-of-type { border-top: 0; } .bell__it:hover { background: var(--surface-2); }
.bell__it .ti { font-size: 20px; margin-top: 1px; } .bell__it span { display: flex; flex-direction: column; min-width: 0; } .bell__it small { color: var(--mut); font-size: 12.5px; }
.t-danger { color: var(--danger); } .t-warn { color: #b45309; } .t-info { color: var(--blue); }
.bell__empty { padding: 18px 14px; color: var(--mut); text-align: center; } .bell__empty .ti { color: var(--ok); vertical-align: -3px; }

/* Linhas de regras de automação e tabelas de formulário compactas */
.rrow{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line,#e3e6ea)}
.rrow:last-child{border-bottom:0}
.rrow select,.rrow input{width:auto;min-width:160px;max-width:100%}
.rrow input[name$="[v_text]"],.rrow input[name$="[v_text]"]{min-width:280px;flex:1}
.rrow [hidden]{display:none}
table.mini{border-collapse:collapse}
table.mini th{font-size:12px;text-align:left;color:var(--muted,#6b7280);padding:4px 12px 4px 0;font-weight:600}
table.mini td{padding:6px 12px 6px 0}
table.mini input{width:110px}

@media (min-width:641px){.row-acts.nw{flex-wrap:nowrap}}
@media (min-width:641px){td.act{white-space:nowrap;width:1%}}
.btn.sm.ico{padding-left:8px;padding-right:8px;min-width:34px;justify-content:center}
.geo-form{display:inline-flex;gap:6px;align-items:center;flex-wrap:wrap;margin:0}
.geo-form .geo-note{min-width:200px;height:var(--ctl-sm,32px)}
.geo-msg{color:var(--mut);flex-basis:100%}
.presence{display:flex;gap:4px;align-items:center;flex-wrap:wrap}
/* ecrã de bloqueio */
.lockwho{display:flex;align-items:center;gap:12px;margin:0 0 14px}
.lockwho__av{width:42px;height:42px;border-radius:50%;background:var(--blue);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:18px;flex:none}
.lockwho .sub{display:block;font-size:12.5px;color:var(--mut)}

/* Menu lateral: rolável, grupos recolhíveis e mais compacto em ecrãs baixos */
.side { position: sticky; top: 52px; align-self: start; height: calc(100vh - 52px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
body.pc .side { top: 76px; height: auto; max-height: calc(100vh - 88px); }
.side::-webkit-scrollbar { width: 6px; } .side::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.side .grpbox { display: block; }
.side button.grp { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.side button.grp:hover { color: var(--ink); }
.side button.grp .ti { font-size: 14px; transition: transform .15s; }
.side .grpbox.closed .grpbody { display: none; }
.side .grpbox.closed button.grp .ti { transform: rotate(-90deg); }
.side a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 820px) {
  .side .grp { padding-top: 10px; padding-bottom: 4px; }
  .side a { padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
  body.pc .side a { padding-top: 7px; padding-bottom: 7px; }
}
@media (max-height: 640px) { .side a { padding-top: 4px; padding-bottom: 4px; } .side a .ti { font-size: 16px; } }
@media (max-width: 900px) { .side { position: fixed; height: auto; max-height: none; } }
/* Painel do cliente */
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.dash__main, .dash__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.minimap { height: 340px; border-bottom: 1px solid var(--line); }
.maplegend--row { position: static; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; margin: 0; box-shadow: none; border: 0; background: transparent; font-size: 12px; list-style: none; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li + li { border-top: 1px solid var(--line); }
.todo a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: var(--ink); } .todo a:hover { background: var(--surface-2); text-decoration: none; }
.todo a > .ti:first-child { font-size: 20px; flex: none; } .todo b { display: block; font-size: 13.5px; } .todo small { display: block; color: var(--mut); font-size: 12px; } .todo .go { margin-left: auto; color: var(--mut); font-size: 16px; }
.todo .t-danger { color: var(--danger); } .todo .t-warn { color: var(--orange); } .todo .t-info { color: var(--blue); }
.allok { display: flex; gap: 12px; align-items: center; padding: 16px 14px; } .allok .ti { font-size: 26px; color: var(--ok); } .allok b { display: block; } .allok span { color: var(--mut); font-size: 12.5px; }
.tl { list-style: none; margin: 0; padding: 0; } .tl li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; } .tl li + li { border-top: 1px solid var(--line); }
.tl__when { flex: none; width: 46px; text-align: center; font-weight: 600; font-size: 13px; } .tl__when small { display: block; font-weight: 400; color: var(--mut); font-size: 11.5px; }
.tl__what { flex: 1; min-width: 0; } .tl__what b { display: block; font-size: 13.5px; } .tl__what small { display: block; color: var(--mut); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .dash { grid-template-columns: minmax(0, 1fr); } }
/* menu do utilizador (portal) */
.umenu { position: relative; } .umenu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; padding: 3px 8px 3px 4px; border-radius: 999px; } .umenu > summary::-webkit-details-marker { display: none; }
.umenu > summary:hover, .umenu[open] > summary { background: var(--surface-2); }
.umenu__av { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.umenu__who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; } .umenu__who b { font-size: 13px; } .umenu__who small { font-size: 11px; color: var(--mut); }
.umenu > summary > .ti { font-size: 14px; color: var(--mut); }
.umenu__pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(35, 23, 52, .16); padding: 6px; }
.umenu__hd { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; } .umenu__hd b { display: block; font-size: 13.5px; } .umenu__hd small { display: block; color: var(--mut); font-size: 12px; }
.umenu__pop a, .umenu__pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 5px; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.umenu__pop a:hover, .umenu__pop button:hover { background: var(--surface-2); text-decoration: none; } .umenu__pop .ti { font-size: 17px; color: var(--mut); }
@media (max-width: 640px) { .umenu__who, .umenu > summary > .ti { display: none; } }
.maplegend--row li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
/* controlos do menu: recolher/expandir tudo */
.side .sidectl { display: flex; gap: 6px; padding: 6px 12px 2px; justify-content: flex-end; }
.side .sidectl button { background: none; border: 0; color: var(--mut); font: inherit; font-size: 11.5px; cursor: pointer; padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; }
.side .sidectl button:hover { background: var(--surface-2); color: var(--ink); } .side .sidectl .ti { font-size: 14px; }

/* Portal: barra lateral encostada à esquerda, de cima a baixo (estilo aplicação) */
body.pc .shell { grid-template-columns: 236px minmax(0, 1fr); gap: 0; max-width: none; width: 100%; padding: 0; align-items: stretch; }
body.pc .side { position: sticky; top: 52px; height: calc(100vh - 52px); max-height: none; align-self: start; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 8px 8px 24px; }
body.pc .main { padding: 22px 28px 40px; }
body.pc .page { max-width: 1180px; }
.dash { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
@media (max-width: 900px) { body.pc .shell { grid-template-columns: minmax(0, 1fr); padding: 0; } body.pc .side { position: fixed; top: 0; height: auto; } body.pc .main { padding: 14px 12px 32px; } }

/* Biblioteca técnica / fichas */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; } dl.kv dt { color: var(--mut); } dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kb-body { font-size: 15px; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; }

/* ===== Menu lateral unificado (consola e portal) ===== */
body.sa .shell, body.pc .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 0; padding: 0; max-width: none; width: 100%; align-items: stretch; transition: grid-template-columns .18s ease; }
body.sa .shell > .side, body.pc .shell > .side { position: sticky; top: 55px; height: calc(100vh - 55px); align-self: start; display: flex; flex-direction: column; padding: 0; gap: 0; overflow: hidden; background: var(--card); border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.side .sidebody { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 12px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.side .sidebody::-webkit-scrollbar { width: 6px; } .side .sidebody::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.side .grpbox { display: block; margin: 0; }
.side .grpbox.top { padding-bottom: 4px; }
.side .grpbox:not(.top) { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 2px; }
.side button.grp { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 12px 20px 6px; background: none; border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--mut); text-align: left; }
.side button.grp:hover { color: var(--ink); }
.side button.grp .ti { font-size: 14px; transition: transform .15s; }
.side .grpbox.closed .grpbody { display: none; } .side .grpbox.closed button.grp .ti { transform: rotate(-90deg); }
.side .grpbody a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 38px; margin: 1px 8px; padding: 0 12px; border: 0; border-radius: 6px; color: var(--ink); font-size: 14px; font-weight: 400; box-shadow: none; }
.side .grpbody a .ti { flex: none; width: 20px; font-size: 19px; text-align: center; color: var(--mut); }
.side .grpbody a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .grpbody a:hover { background: var(--surface-2); text-decoration: none; }
.side .grpbody a.on { background: var(--blue-l); color: var(--blue); font-weight: 500; box-shadow: inset 3px 0 0 var(--orange); }
.side .grpbody a.on .ti { color: var(--blue); }
.side .grpbody a .n { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; border: 0; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.side .sidefoot { flex: none; border-top: 1px solid var(--line); padding: 8px; background: var(--card); }
.side .railbtn { display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 12px; background: none; border: 0; border-radius: 6px; color: var(--mut); font: inherit; font-size: 13.5px; cursor: pointer; }
.side .railbtn:hover { background: var(--surface-2); color: var(--ink); } .side .railbtn .ti { font-size: 19px; width: 20px; text-align: center; flex: none; }
.railtip { position: fixed; z-index: 200; display: none; transform: translateY(-50%); background: #231734; color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 13px; line-height: 1.2; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(35, 23, 52, .25); }
.railtip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: #231734; transform: translateY(-50%) rotate(45deg); }
body.sa .main { padding: 22px 28px 40px; } body.pc .main { padding: 22px 28px 40px; }
body.pc .page { max-width: 1180px; }
@media (min-width: 901px) {
  body.rail.sa .shell, body.rail.pc .shell { grid-template-columns: 64px minmax(0, 1fr); }
  body.rail .side button.grp { display: none; }
  body.rail .side .grpbox.closed .grpbody { display: block; }
  body.rail .side .grpbox:not(.top) { margin-top: 6px; padding-top: 6px; }
  body.rail .side .grpbody a, body.rail .side .railbtn { justify-content: center; padding: 0; margin-left: 10px; margin-right: 10px; }
  body.rail .side .railbtn { width: calc(100% - 20px); margin: 0 10px; }
  body.rail .side .grpbody a span, body.rail .side .railbtn span { display: none; }
  body.rail .side .grpbody a .n { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10.5px; margin: 0; }
  body.rail .side .sidebody { overflow-x: hidden; }
}
@media (max-width: 900px) {
  body.sa .shell, body.pc .shell { grid-template-columns: minmax(0, 1fr); }
  body.sa .shell > .side, body.pc .shell > .side { position: fixed; left: -270px; top: 0; bottom: 0; height: auto; width: 256px; z-index: 60; padding-top: 56px; transition: left .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  body.sa .shell > .side.open, body.pc .shell > .side.open { left: 0; }
  .side .railbtn { display: none; }
  body.sa .main, body.pc .main { padding: 14px 12px 32px; }
}
td.act .row-acts { display: inline-flex; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; align-items: center; } td.act { white-space: nowrap; }

/* Caixa de Passwords */
.pwrow { display: flex; gap: 8px; align-items: stretch; } .pwrow input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.genopts { margin-top: 6px; font-size: 13px; } .genopts summary { cursor: pointer; color: var(--mut); } .genrow { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 8px 0; } .genrow input[type=number] { width: 70px; }
.meter { margin-top: 8px; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--mut); } .meter i { display: block; height: 6px; border-radius: 3px; background: var(--line-strong); width: 0; max-width: 100%; flex: none; min-width: 0; transition: width .15s; }
.meter { position: relative; } .meter.weak i { background: #C62828; } .meter.fair i { background: #E08A00; } .meter.good i, .meter.strong i { background: #2E7D32; } .meter span { flex: 1; }
.members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; } .members .sub { color: var(--mut); font-size: 12.5px; }
.vault-box .secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; overflow-wrap: anywhere; } .vault-box .reauth { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); } .vault-box .reauth label { display: block; margin-bottom: 6px; font-size: 13px; }
.vault-box .hint { margin-top: 10px; font-size: 13px; color: var(--mut); } .vault-box .notes { white-space: pre-wrap; }
.meter { display: block; } .meter i { display: block; } .meter span { display: block; margin-top: 4px; }
.members .mrow { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

/* Escolha de modelo de relatório */
.tplgrp h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--mut); }
.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.tpl { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); cursor: pointer; }
.tpl:hover { border-color: var(--line-strong); } .tpl:has(input:checked) { border-color: var(--blue); background: var(--blue-l); box-shadow: inset 3px 0 0 var(--orange); }
.tpl input { margin-top: 3px; } .tpl span { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .tpl small { color: var(--mut); font-size: 12.5px; line-height: 1.35; }
form.inl, .inl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .inl .grow { flex: 1; min-width: 180px; } .w70 { width: 76px; }
.bar { height: 6px; border-radius: 3px; background: var(--line-strong); overflow: hidden; min-width: 90px; } .bar i { display: block; height: 100%; background: var(--blue); }

/* Matriz de competências */
.mxd { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 6px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink); }
i.mxd { min-width: 12px; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.mxd.l0 { background: #ECEAF0; color: #6b6577; } .mxd.l1 { background: #FDECC8; color: #7a4a00; } .mxd.l2 { background: #DDEAF7; color: #1d4a7a; } .mxd.l3 { background: #D5EDDA; color: #1b5e2f; } .mxd.l4 { background: #231734; color: #fff; }
.mx-wrap { overflow: auto; max-height: calc(100vh - 340px); } table.mx { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
table.mx th, table.mx td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--line); } table.mx th.who { position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left; min-width: 190px; border-right: 1px solid var(--line); }
table.mx thead th { position: sticky; top: 0; z-index: 3; background: var(--card); } table.mx thead th.who { z-index: 4; }
table.mx th.v { height: 190px; vertical-align: bottom; min-width: 40px; max-width: 44px; padding: 8px 2px; } table.mx th.v span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--ink); }
table.mx th.who small { display: block; color: var(--mut); font-weight: 400; font-size: 12px; }
table.mx td.below { box-shadow: inset 0 -3px 0 #E08A00; } table.mx td.none { box-shadow: inset 0 -3px 0 #C62828; }
table.mx tfoot td.cov.ok { color: #1b5e2f; } table.mx tfoot td.cov.single { color: #B26A00; font-weight: 600; } table.mx tfoot td.cov.uncovered { color: #C62828; font-weight: 700; }
table.mx tfoot th, table.mx tfoot td { background: var(--surface-2); font-size: 12.5px; }
.legend--inline { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--mut); align-self: center; margin-left: auto; }
.gaphd { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface-2); border-top: 1px solid var(--line); }
.sticky-foot { position: sticky; bottom: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; display: flex; justify-content: flex-end; gap: 10px; }
details.inlinedit { position: relative; display: inline-block; } details.inlinedit[open] > form { position: absolute; right: 0; z-index: 20; width: min(560px, 80vw); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: 0 8px 30px rgba(35, 23, 52, .18); text-align: left; } details.inlinedit summary { list-style: none; cursor: pointer; }
.legend--inline { flex-direction: row; align-items: center; }
/* matriz de competências v2: competências em linhas, técnicos em colunas; rola com a página (sem scroll interno) */
table.mx2 { width: 100%; border-collapse: collapse; }
table.mx2 th, table.mx2 td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.mx2 .c { text-align: center; width: 1%; white-space: nowrap; }
table.mx2 th.tech { min-width: 78px; } table.mx2 th.tech a { display: block; font-weight: 600; line-height: 1.2; } table.mx2 th.tech small { display: block; font-weight: 400; color: var(--mut); font-size: 12px; }
table.mx2 td.cn { width: auto; }
table.mx2 td.below { box-shadow: inset 0 -3px 0 #E08A00; } table.mx2 td.none { box-shadow: inset 0 -3px 0 #C62828; }
table.mx2 td.cov.ok { color: #1b5e2f; } table.mx2 td.cov.single { color: #B26A00; font-weight: 600; } table.mx2 td.cov.uncovered { color: #C62828; font-weight: 700; }
table.mx2 tbody tr:hover td { background: var(--surface-2); }
.rpt-struct { list-style: none; margin: 0; padding: 0; counter-reset: s; } .rpt-struct li { counter-increment: s; padding: 12px 0 12px 38px; border-bottom: 1px solid var(--line); position: relative; }
.rpt-struct li::before { content: counter(s); position: absolute; left: 0; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; }
.rpt-struct li > span { display: block; color: var(--mut); font-size: 13.5px; margin-top: 2px; } .rpt-guide { margin: 6px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; font: inherit; font-size: 13.5px; white-space: pre-wrap; color: var(--ink); }
.rpt-flow { margin: 0 0 8px; padding-left: 20px; } .rpt-flow li { padding: 3px 0; }
.filters .legend.legend--inline { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-left: auto; padding: 0; }
.filters .legend.legend--inline > span { display: inline-flex; align-items: center; gap: 4px; padding: 0; margin: 0; }
.paper-wrap { background: #E9E6EF; padding: 22px 16px; overflow-x: auto; }
.paper { background: #fff; width: 794px; max-width: 100%; margin: 0 auto; padding: 38px 42px 44px; box-shadow: 0 1px 3px rgba(35,23,52,.18), 0 8px 24px rgba(35,23,52,.12); box-sizing: border-box; min-height: 600px; }
/* inquérito de formação */
.survey .qrow { border: 0; padding: 0; margin: 0 0 16px; } .survey legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; } .scale label { cursor: pointer; } .scale input { position: absolute; opacity: 0; }
.scale span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; border: 1px solid var(--line-strong, #cfc9da); border-radius: 8px; font-weight: 600; background: var(--card); }
.scale s11 span, .scale.s11 span { min-width: 38px; height: 38px; }
.scale input:checked + span { background: var(--blue, #231734); color: #fff; border-color: var(--blue, #231734); } .scale input:focus-visible + span { outline: 2px solid var(--orange, #F77701); outline-offset: 2px; }
/* cronograma e inquérito (admin) */
table.cron td, table.cron th { vertical-align: top; } table.cron tr.muted td { opacity: .6; text-decoration: line-through; }
.svy__row { display: grid; grid-template-columns: minmax(150px, 1.2fr) 2fr 36px; gap: 10px; align-items: center; padding: 5px 0; } .svy__row b { text-align: right; }

/* ───────── Portal do cliente: acesso em duas colunas ───────── */
.pauth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: #f6f4f9; }
.pauth__main { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px) 20px; }
.pauth__brand { display: flex; align-items: center; gap: 12px; }
.pauth__tag { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: var(--card); }
.pauth__box { width: 100%; max-width: 440px; margin: auto; padding: 28px 0; }
.pauth__card { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 12px; padding: 32px 32px 26px; box-shadow: 0 10px 30px rgba(35, 23, 52, .08); }
.pauth__title { font-size: 25px; line-height: 1.2; font-weight: 700; margin: 0 0 6px; color: var(--blue); }
.pauth__lead { color: var(--mut); margin: 0 0 24px; }
.pauth__card .form .fld { margin-bottom: 18px; } .pauth__card .form input { height: 46px; }
.pauth__card .btn.p { height: 48px; font-size: 15px; margin-top: 4px; }
.pauth__card .auth__alt { text-align: center; margin: 18px 0 0; font-size: 14px; }
.pauth__card .flash { margin-bottom: 18px; }
.pauth__secure { display: flex; gap: 8px; align-items: flex-start; color: var(--mut); font-size: 12.5px; line-height: 1.5; margin: 16px 4px 0; } .pauth__secure i { font-size: 15px; margin-top: 1px; color: var(--blue); }
.pauth__foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--mut); font-size: 12px; } .pauth__foot a { color: var(--blue); font-weight: 600; }
.pw { position: relative; } .pw input { padding-right: 46px; width: 100%; }
.pw__btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; color: var(--mut); border-radius: 8px; cursor: pointer; display: grid; place-items: center; font-size: 19px; }
.pw__btn:hover { color: var(--blue); background: rgba(35, 23, 52, .06); } .pw__btn:focus-visible { outline: 2px solid var(--orange, #F77701); outline-offset: 1px; }
.auth__card .form .fld { margin-bottom: 14px; }
.pauth__side { position: relative; background: linear-gradient(160deg, #2d1e44 0%, var(--blue, #231734) 55%, #170f24 100%); color: #fff; display: flex; align-items: center; padding: 48px clamp(24px, 5vw, 72px); overflow: hidden; }
.pauth__side::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--orange, #F77701); }
.pauth__side::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 400px; height: 400px; border-radius: 50%; border: 60px solid rgba(247, 119, 1, .09); }
.pauth__inner { position: relative; z-index: 1; max-width: 480px; width: 100%; }
.pauth__eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: #F7A04D; margin: 0 0 12px; font-weight: 600; }
.pauth__side h2 { font-size: 28px; line-height: 1.25; font-weight: 700; margin: 0 0 12px; color: #fff; }
.pauth__sub { color: rgba(255, 255, 255, .72); font-size: 14.5px; line-height: 1.55; margin: 0 0 26px; }
.pauth__mock { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 8px; display: grid; gap: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
.pm__row { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; background: #fff; color: var(--ink, #231734); border-radius: 10px; padding: 10px 12px; }
.pm__ico { width: 38px; height: 38px; border-radius: 9px; background: #f1ecf7; color: var(--blue, #231734); display: grid; place-items: center; font-size: 19px; }
.pm__txt b { display: block; font-size: 14px; font-weight: 600; color: #231734; } .pm__txt small { display: block; font-size: 12px; color: #6b6478; margin-top: 1px; }
.pm__chip { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #ece9f1; color: #4a4258; white-space: nowrap; }
.pm__chip--o { background: #fff0e0; color: #b35300; } .pm__chip--g { background: #e2f5e9; color: #1d7a45; }
.pauth__pts { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: rgba(255, 255, 255, .8); }
.pauth__pts li { display: flex; gap: 10px; align-items: center; } .pauth__pts i { color: #F7A04D; font-size: 19px; }
@media (max-width: 900px) { .pauth { grid-template-columns: 1fr; } .pauth__side { display: none; } .pauth__box { margin: 4vh auto auto; } .pauth__card { padding: 26px 20px 22px; } }
.pauth__feat { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.pauth__feat li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 14px; color: rgba(255, 255, 255, .9); }
.pauth__feat i { color: #F7A04D; font-size: 19px; }
.rolepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rolepick__i { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--card); cursor: pointer; font-weight: 400; }
.rolepick__i:has(input:checked) { border-color: var(--blue); background: var(--blue-l); }
.rolepick__i input { margin-top: 3px; } .rolepick__i b { display: block; font-weight: 600; } .rolepick__i small { display: block; color: var(--mut); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.permh { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
.perml { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; font-size: 14px; }
.perml li.on { color: var(--ink); } .perml li.on i { color: #1d7a45; } .perml li.off { color: #9a9aa5; } .perml li i { width: 16px; }
.stackbtn { display: grid; gap: 8px; } .stackbtn form { margin: 0; }
table.pm td.c, table.pm th.c { text-align: center; } table.pm .pm__g td { background: var(--surface-2); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); } .pm__y { color: #1d7a45; font-size: 18px; }

/* v14 · Gestão e BI */
.mg-ops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mg-ops li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mg-ops li:last-child { border-bottom: 0; }
.mg-month { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mg-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px 26px; box-shadow: var(--sh); overflow-x: auto; }

/* v14 · Em serviço */
.topbar__duty { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 3px; background: var(--ok, #2e7d32); color: #fff; font-size: 13px; font-weight: 500; }
.topbar__duty:hover { text-decoration: none; color: #fff; filter: brightness(.92); }
.topbar__duty .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: rt-pulse 1.4s ease-in-out infinite; }
.duty-pts { margin: 6px 0 10px; padding-left: 18px; }
#duty-prompt .chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.tt-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px; gap: 8px; align-items: center; }
@media (max-width: 640px) { .tt-row { grid-template-columns: 1fr 1fr; } .tt-row .chk { grid-column: 1 / -1; } }
.tech-card { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tech-card:last-child { border-bottom: 0; }
.tech-card .av { width: 38px; height: 38px; border-radius: 50%; background: var(--navy, #231734); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }

/* v15 · ITSM */
.itsm-ev > div { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 13px; } .itsm-ev > div:first-child { border-top: 0; }
.itsm-ev .sub { display: block; color: var(--mut); font-size: 12.5px; margin-top: 2px; }
.itsm-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; font-size: 12.5px; }
.itsm-flow .st { padding: 3px 10px; border-radius: 12px; background: var(--bg, #f2f0f6); color: var(--mut); border: 1px solid var(--line); }
.itsm-flow .st.on { background: var(--navy, #231734); color: #fff; border-color: transparent; font-weight: 600; }
.itsm-flow .st.done { color: var(--ok, #2e7d32); border-color: currentColor; }
.itsm-pre { white-space: pre-line; margin: 0 0 8px; }
.itsm-box { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin: 0 0 10px; }
.itsm-box h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--mut); }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }

/* Mapa em tempo real: técnico activo com anel pulsante; sem sinal a cinzento */
.tpin--active { background: #2e7d32; } .tpin--no_gps { background: #8a8f98; opacity: .8; }
.tpin--live { animation: tpin-pulse 1.8s ease-out infinite; }
@keyframes tpin-pulse { 0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, .55), 0 1px 5px rgba(0, 0, 0, .45); } 70% { box-shadow: 0 0 0 12px rgba(46, 125, 50, 0), 0 1px 5px rgba(0, 0, 0, .45); } 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0), 0 1px 5px rgba(0, 0, 0, .45); } }
@media (prefers-reduced-motion: reduce) { .tpin--live { animation: none; } }
.form-foot-inline { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* Modal de confirmação (substitui a caixa nativa do navegador) */
dialog.confirm .modal__box { border-top-color: var(--blue); } dialog.confirm .modal__box.is-danger { border-top-color: var(--danger); }
dialog.confirm .cf-msg { margin: 0; font-size: 15px; line-height: 1.5; }
dialog.confirm[open] { animation: cf-in .12s ease-out; } @keyframes cf-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.confirm[open] { animation: none; } }

/* ── MFA ── */
form.inline { display: inline; margin: 0; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.codes code, code.sel { user-select: all; font-family: ui-monospace, Consolas, monospace; background: var(--bg-soft, #f4f2f7); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; display: inline-block; }
code.big { font-size: 22px; letter-spacing: 2px; padding: 10px 16px; }
code.wrap { word-break: break-all; }
.mfa-pub { max-width: 520px; margin: 40px auto; padding: 0 16px; }
.mfa-pub .card { margin-bottom: 16px; }
.mfa-num { font-size: 56px; font-family: var(--head); font-weight: 700; text-align: center; letter-spacing: 4px; margin: 8px 0; }
.mfa-ch { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; background: var(--card); }
.mfa-ch .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mfa-numpad { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mfa-numpad input { width: 90px; font-size: 22px; text-align: center; }
.h-side { margin: 0 0 4px; font-size: 15px; }

/* MFA v19b: separadores, acções agrupadas, cobertura */
.mfa-tabs { margin: 0 0 14px; }
.sub-tabs { margin: 0 0 14px; }
.sub-tabs a { padding: 6px 12px; font-size: 13px; }
.acts-col { display: flex; flex-direction: column; gap: 8px; align-items: stretch; } .acts-col .btn { justify-content: flex-start; }
.cover { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; } .cover .donut { width: 120px; flex: none; }
.note form.inline { display: inline-block; margin-left: 8px; }
.note.warn { border-left-color: var(--orange); }
#mfa-live { display: flex; flex-direction: column; gap: 14px; } #mfa-live > .card, #mfa-live > .grid { margin: 0; }
#mfa-live .hbars li { grid-template-columns: 150px 1fr 34px; }
.filters + #mfa-live, .tabs + .filters { margin-top: 0; }

/* Select com pesquisa / múltiplo (public/assets/js/select.js) */
.ss { position: relative; min-width: 150px; max-width: 100%; }
.ss__native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ss__btn { width: 100%; min-height: var(--ctl); display: flex; align-items: center; gap: 6px; padding: 3px 8px; text-align: left; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r); font: inherit; cursor: pointer; }
.ss__btn:hover { border-color: var(--blue-mid); }
.ss__btn:focus-visible, .ss.is-open .ss__btn { outline: 2px solid var(--orange); outline-offset: 1px; }
.ss__txt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss__txt.is-ph { color: var(--mut); }
.ss__caret { color: var(--mut); font-size: 14px; flex: none; }
.ss.is-open .ss__caret { transform: rotate(180deg); }
.ss__chip { background: var(--blue-l); color: var(--blue); border-radius: 10px; padding: 0 8px; font-size: 12px; line-height: 20px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.ss__chip--more { background: var(--orange-l); color: var(--orange-d); }
.ss__panel { position: absolute; z-index: 60; left: 0; top: calc(100% + 4px); min-width: 100%; width: max-content; max-width: min(420px, 92vw); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); overflow: hidden; }
.ss__panel[hidden] { display: none; }
.ss__panel--up { top: auto; bottom: calc(100% + 4px); }
.ss__search { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; font: inherit; background: var(--surface-2); outline: none; border-radius: 0; }
.ss__tools { display: flex; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ss__tool { border: 0; background: none; color: var(--blue); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px; text-decoration: underline; }
.ss__list { list-style: none; margin: 0; padding: 4px 0; max-height: 260px; overflow-y: auto; }
.ss__opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; }
.ss__opt[hidden] { display: none; }
.ss__opt:hover, .ss__opt.is-active { background: var(--blue-l); }
.ss__opt[aria-selected="true"] { font-weight: 600; }
.ss:not(.ss--multi) .ss__opt[aria-selected="true"]::after { content: "\eb7b"; font-family: "tabler-icons"; margin-left: auto; color: var(--orange-d); }
.ss__opt[aria-disabled="true"] { opacity: .5; cursor: default; }
.ss__box::before { content: "\eb2c"; font-family: "tabler-icons"; font-size: 17px; color: var(--mut); }
.ss__opt[aria-selected="true"] .ss__box::before { content: "\eb28"; color: var(--orange-d); }
.ss__empty { padding: 10px 12px; color: var(--mut); font-size: 13px; }
.ss__search--hid { position: absolute; width: 1px; height: 1px; opacity: 0; padding: 0; border: 0; overflow: hidden; pointer-events: none; }

.dash__sum { display: flex; gap: 18px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--mut); } .dash__sum b { color: var(--ink); font-size: 15px; margin-right: 2px; }
.dash .card { margin: 0; } .dash__main > *, .dash__side > * { width: 100%; }
.tabs a .cnt { background: var(--surface-2); color: var(--mut); border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 17px; } .tabs a.on .cnt { background: var(--orange); color: #fff; }
.tabs + .filters { margin-top: 12px; }
.notice.info { color: var(--blue); background: #eef4fb; border-color: #c9dcf2; margin-bottom: 14px; }

/* Visualizador interno de documentos (tudo dentro da aplicação) */
html.dv-open { overflow: hidden; }
.dv { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: rgba(20, 14, 32, .82); }
.dv[hidden] { display: none; }
.dv__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; background: var(--card); border-bottom: 1px solid var(--line-strong); flex-wrap: wrap; }
.dv__ttl { min-width: 0; display: flex; flex-direction: column; } .dv__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; font-size: 15px; } .dv__sub { font-size: 12px; color: var(--mut); }
.dv__bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .dv__bar .btn { display: inline-flex; align-items: center; gap: 6px; } .dv__bar [hidden] { display: none; }
.dv__count, .dv__pg, .dv__zl { font-size: 12px; color: var(--mut); font-variant-numeric: tabular-nums; text-align: center; } .dv__count { min-width: 52px; } .dv__zl { min-width: 40px; } .dv__pg { margin-right: 6px; }
.dv__zoom { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.dv__scroll { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; align-items: center; outline: none; background: transparent; }
.dv__loading { color: #fff; font-size: 13px; margin: auto; } .dv__loading[hidden], .dv__pages[hidden], .dv__img[hidden], .dv__text[hidden], .dv__other[hidden] { display: none; }
.dv__pages { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dv__page { background: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, .45); position: relative; flex: none; } .dv__page canvas { display: block; }
.dv__img { max-width: 100%; margin: auto; object-fit: contain; background: #fff; border-radius: 4px; box-shadow: 0 6px 22px rgba(0, 0, 0, .45); }
.dv__text { width: min(980px, 100%); margin: 0; padding: 18px 22px; background: #fff; color: #1b1b1b; border-radius: 6px; font: 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; box-shadow: 0 6px 22px rgba(0, 0, 0, .45); }
.dv__other { background: var(--card); border-radius: 8px; padding: 28px 34px; text-align: center; max-width: 400px; margin: auto; } .dv__other .ti { font-size: 42px; color: var(--mut); }
@media (max-width: 720px) { .dv__lbl { display: none; } .dv__name { max-width: 55vw; } .dv__scroll { padding: 6px; } .dv__zoom { border: 0; } }

/* Impressão do documento (a camada prepara .dv-print; o resto da página fica oculto) */
.dv-print { display: none; }
@media print {
  html.dv-printing body > *:not(.dv-print) { display: none !important; }
  html.dv-printing .dv-print { display: block !important; }
  html.dv-printing .dv-print img { display: block; width: 100%; max-height: 277mm; object-fit: contain; page-break-after: always; break-after: page; }
  html.dv-printing .dv-print--land img { max-height: 188mm; }
  html.dv-printing .dv-print img:last-child { page-break-after: auto; break-after: auto; }
  html.dv-printing .dv-print pre { white-space: pre-wrap; font: 11px/1.4 ui-monospace, Consolas, monospace; }
}

@keyframes bellpulse { 0% { transform: scale(1); } 30% { transform: scale(1.35); } 100% { transform: scale(1); } } .bell--pulse .bell__n, .bell--pulse .ti-bell { animation: bellpulse .8s ease 2; }

/* Bases detectadas: pesquisa, selecção múltipla e barra de acções */
.searchbox { position: relative; display: block; } .searchbox i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--mut); pointer-events: none; } .searchbox input { padding-left: 32px; width: 100%; }
th.chk, td.chk { width: 38px; padding-right: 0; } th.chk input, td.chk input { vertical-align: middle; }
tbody tr:has(input.bk-row:checked) td { background: var(--blue-l); }
.bulkbar { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding: 10px 14px; background: var(--blue); color: #fff; border-radius: var(--r); box-shadow: 0 8px 24px rgba(16,24,40,.28); border-left: 4px solid var(--orange); }
.bulkbar[hidden] { display: none; } .bulkbar .sp { flex: 1; } .bulkbar__n { display: inline-flex; align-items: center; gap: 8px; }
.bulkbar .btn { background: #fff; color: var(--ink); } .bulkbar .btn.p { background: var(--orange); border-color: var(--orange); color: #fff; } .bulkbar .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ───────── v37: consistência com o agente RTS Backup SQL (mesmos tokens, contraste e controlos) ───────── */
body.pc, body { --ink: #101828; --mut: #475467; --line: #d5dae1; --line-strong: #98a2b3; }
body { -webkit-font-smoothing: auto; text-rendering: optimizeLegibility; }
body.pc input:not([type=checkbox]):not([type=radio]):not([type=file]), body.pc select, body.pc textarea { border-color: var(--line-strong); border-radius: 8px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
body.pc input::placeholder { color: #667085; }
body.pc input:focus, body.pc select:focus, body.pc textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35, 23, 52, .14); outline: 0; }
body.pc th { font-weight: 600; color: #344054; }
body.pc .btn { font-weight: 600; border-radius: 8px; }
body.pc .card > h2, body.pc .card .hd h2 { color: var(--blue); }
/* Menu: rótulos dos grupos com contraste reforçado */
.side .grp { color: #475467; font-weight: 600; }
.side, .side * { scroll-behavior: auto; }
/* Barra de progresso ao mudar de página */
.navload { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 200; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .15s; }
.navload.on { opacity: 1; }
.navload::after { content: ""; position: absolute; inset: 0; width: 35%; background: var(--orange); animation: navslide 1s ease-in-out infinite; }
@keyframes navslide { 0% { left: -35%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .navload::after { animation: none; width: 100%; } }
.inst-latest { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--orange); }
.inst-latest__ic { width: 46px; height: 46px; border-radius: 10px; background: var(--blue-l); color: var(--blue); display: grid; place-items: center; font-size: 24px; flex: none; }
.inst-latest__tx { flex: 1 1 280px; min-width: 0; } .inst-latest__tx b { display: block; font-size: 16px; font-family: var(--head); }
.progress { height: 8px; border-radius: 999px; background: #e4e7ec; overflow: hidden; } .progress__bar { height: 100%; width: 0; background: var(--orange); transition: width .2s; }

/* ───────── Estabilidade: nada se desloca sozinho (sem animações de entrada, sem saltos pela barra de scroll ou pelas fontes) ───────── */
html { overflow-y: scroll; scrollbar-gutter: stable; }
.page, dialog.confirm[open] { animation: none !important; }
.bell--pulse .bell__n, .bell--pulse .ti-bell { animation: none !important; }
.side, .side * { transition: none !important; }
body { overflow-anchor: none; }

/* ───────── Janelas (modais): sempre no mesmo sítio, mesmo tamanho de cantos, sem movimento ───────── */
dialog.modal { position: fixed; inset: 0; margin: 8vh auto auto; max-height: none; }
dialog.modal .modal__box { max-height: calc(100vh - 8vh - 24px); border-radius: var(--r); }
dialog.modal .modal__head { border-radius: calc(var(--r) - 2px) calc(var(--r) - 2px) 0 0; }
dialog.modal .modal__foot { border-radius: 0 0 var(--r) var(--r); }
dialog.modal, dialog.modal *, dialog.modal::backdrop { animation: none !important; transition: none !important; }
html:has(dialog[open]) { overflow: hidden; }
@media (max-width: 640px) { dialog.modal { margin-top: 4vh; } dialog.modal .modal__box { max-height: calc(100vh - 4vh - 16px); } }
/* Menus e listas suspensas: ancorados ao botão, sem animação */
.umenu__pop, .bell__pop, .ss__panel { animation: none !important; transition: none !important; }

/* ───────── Menu lateral e cabeçalho: UMA só medida (--topbar-h), lida do próprio cabeçalho (app.js). Acaba com os desvios de 52/55/76 px. ───────── */
:root { --topbar-h: 60px; }
@media (min-width: 901px) {
  .topbar, body.pc .topbar { height: var(--topbar-h); min-height: var(--topbar-h); flex-wrap: nowrap; }
  .topbar__brand, .topbar__user { flex-wrap: nowrap; }
  .topbar .co { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .co > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.sa .shell > .side, body.pc .shell > .side { top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); max-height: none; }
}

/* ───────── Menu lateral FIXO ao ecrã (desktop): não depende da altura do conteúdo nem do rodapé, nunca se desloca com o scroll da direita ───────── */
@media (min-width: 901px) {
  body.sa .shell > .side, body.pc .shell > .side { position: fixed; top: var(--topbar-h); left: 0; bottom: auto; height: calc(100vh - var(--topbar-h)); max-height: none; align-self: auto; width: 248px; z-index: 30; }
  body.rail.sa .shell > .side, body.rail.pc .shell > .side { width: 64px; }
  body.sa .shell > .main, body.pc .shell > .main { grid-column: 2; min-width: 0; }
  body.sa .foot, body.pc .foot { margin-left: 248px; }
  body.rail.sa .foot, body.rail.pc .foot { margin-left: 64px; }
}

/* ───────── Plano de visitas por cliente ───────── */
.psite { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; background: var(--card); }
.psite__h { margin-bottom: 8px; }
.psite__lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.pline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 10px; background: var(--surface-2); border-radius: 6px; }
.pline__days { display: flex; flex-wrap: wrap; gap: 6px; }
.pday { display: inline-flex; }
.pday input { position: absolute; opacity: 0; pointer-events: none; }
.pday span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 34px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--card); color: var(--ink); font-size: 13px; cursor: pointer; user-select: none; }
.pday input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.pday input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.pline__f { display: flex; flex-direction: column; gap: 3px; } .pline__f label { font-size: 12px; color: var(--mut); }
.pline__f input[type=time] { width: 110px; } .pline__f input[type=number] { width: 96px; } .pline__t select { min-width: 220px; }
.pline__rm { margin-left: auto; }
@media (max-width: 640px) { .pline__t, .pline__t select { width: 100%; min-width: 0; } }

/* ───────── Pesquisa de localização (ponto do cliente) ───────── */
.geo { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
.geo > label { display: block; font-weight: 500; margin-bottom: 6px; }
.geo__bar { display: flex; gap: 8px; align-items: flex-start; } .geo__box { position: relative; flex: 1; min-width: 0; } .geo__box input { width: 100%; }
.geo .help { margin-top: 6px; }
.geo__msg { margin-top: 6px; font-size: 13px; color: var(--mut); min-height: 18px; } .geo__msg.err { color: var(--danger, #b42318); }
.geo__list { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; z-index: 40; left: 0; right: 0; top: 100%; max-height: 320px; overflow-y: auto; background: var(--card); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 12px 28px rgba(16, 24, 40, .18); }
.geo__list[hidden] { display: none; }
.geo__list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.geo__list li b { font-size: 14px; font-weight: 600; color: var(--ink); } .geo__list li small { font-size: 12.5px; color: var(--mut); }
.geo__list li:hover, .geo__list li.is-on { background: var(--blue-l); }
.geo__map { height: 280px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

/* ───────── Relatórios da escala (pré-visualização horizontal) ───────── */
.rr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; } .rr-bar__l { min-width: 190px; text-align: center; } .rr-bar__sp { flex: 1; }
.rr-card .bd { overflow-x: auto; } .rr-card .rr { min-width: 1040px; }

/* ───────── Escala: 3 tipos de visualização ───────── */
.vsw { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--card); }
.vsw a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--ink); font-size: 13.5px; border-right: 1px solid var(--line); text-decoration: none; } .vsw a:last-child { border-right: 0; }
.vsw a:hover { background: var(--surface-2); } .vsw a.on { background: var(--blue); color: #fff; font-weight: 600; } .vsw a .ti { font-size: 16px; }
@media (max-width: 700px) { .vsw a span { display: none; } }
.roster .multi { display: inline-block; margin: 0 0 4px; padding: 1px 7px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 11.5px; font-weight: 700; }
.agenda { display: flex; flex-direction: column; gap: 12px; }
.ag-day { background: var(--card); border: 1px solid var(--line); border-radius: 8px; } .ag-day.today { border-color: var(--orange); }
.ag-day > header { display: flex; align-items: baseline; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: 8px 8px 0 0; }
.ag-none { margin: 0; padding: 12px 14px; }
.ag-t { width: 100%; border-collapse: collapse; } .ag-t td { padding: 7px 14px; border-bottom: 1px solid var(--line); vertical-align: top; } .ag-t tr:last-child td { border-bottom: 0; }
.ag-t tr.ag-tech td { background: #fff; padding-top: 10px; border-bottom: 0; color: var(--blue); } .ag-t tr.out td:first-child { box-shadow: inset 3px 0 0 #5b3fa6; }
.rlinks { display: inline-flex; align-items: center; gap: 6px; } .rlinks__l { display: inline-flex; align-items: center; gap: 5px; color: var(--mut); font-size: 13px; margin-right: 2px; }
.rlinks { flex-wrap: wrap; } .rlinks form { display: inline; margin: 0 8px 0 -2px; } .rlinks__ok { color: var(--ok, #067647); margin-left: 4px; font-size: 16px; vertical-align: -2px; }
