/* Marca Stand Pontual — o mesmo visual do portal da oficina: logótipo oficial, vermelho #EF1B1B,
   barra lateral escura e fundo claro. */
:root {
  color-scheme: light;
  --bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --border: #e2e3e5;
  --text: #27282b;
  --muted: #7a7d82;
  --primary: #ef1b1b;
  --primary-hover: #ce1717;
  --primary-soft: #fff0f0;
  --danger: #c72121;
  --danger-soft: #fde4e4;
  --ok: #1d7a4f;
  --ok-soft: #e3f3ea;
  --warn: #a3580a;
  --warn-soft: #fdf0df;

  --c-vendas: #1f9d63;
  --c-aquisicoes: #3a3b40;
  --c-despesas: #ef1b1b;

  --side-bg: #161616;
  --side-text: #bcbcc3;

  --wk: #f0f0f2;
  --fer: #fde7e7;
  --fe: #fcd34d;

  --e-P: #dff3e7;   --e-P-ink: #17603d;
  --e-T: #e3e9f6;   --e-T-ink: #2f4f9e;
  --e-FO: #ece6fb;  --e-FO-ink: #5b34b5;
  --e-FJ: #fdeccb;  --e-FJ-ink: #8a4b00;
  --e-F: #fde0e0;   --e-F-ink: #b3261e;
  --e-B: #fbe3f0;   --e-B-ink: #9b1b66;
  --e-Fe: #fff2b8;  --e-Fe-ink: #7a5a00;

  --radius: 11px;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: none;
  background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column;
  padding: 34px 18px 20px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.official-brand { padding: 0 5px 22px; }
.official-brand img { display: block; width: 100%; max-width: 185px; height: auto; }
.official-brand span { display: block; color: #b6b6bb; font-size: 9px; letter-spacing: 2px; margin-top: 15px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: 8px;
  color: var(--side-text); text-decoration: none; font-weight: 500;
}
nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
nav a.active { background: var(--primary); color: #fff; font-weight: 700; }
nav svg, .icon-btn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.nav-sec {
  font-size: 10px; text-transform: uppercase; letter-spacing: 2px;
  color: #77777e; padding: 18px 14px 6px;
}
.sidebar-foot { margin-top: auto; padding: 20px 5px 0; border-top: 1px solid #ffffff28; font-size: 12px; color: var(--side-text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* cabeçalho das páginas: faixa escura com brilho vermelho, como na oficina */
.topbar {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 26px 28px 0; padding: 26px 30px 24px; border-radius: 16px;
  background: radial-gradient(600px 220px at 85% -20%, #ef1b1b40, transparent 70%), linear-gradient(135deg, #17171c, #24242c);
  color: #fff; box-shadow: 0 18px 40px #17171c26;
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 60%); mask: linear-gradient(90deg, transparent, #000 60%);
}
.topbar::after { content: ""; position: absolute; left: 30px; right: 30px; bottom: 0; height: 2px; background: linear-gradient(90deg, #ef1b1b, #ef1b1b00); }
.heading-title { flex: 1; min-width: 0; }
.eyebrow { display: block; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; font-weight: 700; color: #ff7b7b; }
.topbar h1 { font-size: 30px; margin: 6px 0 0; letter-spacing: -1.1px; color: #fff; line-height: 1.15; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.topbar .btn { background: #ffffff10; border-color: #ffffff26; color: #fff; }
.topbar .btn:hover { background: #ffffff1c; }
.topbar .btn.primary { background: var(--primary); border-color: var(--primary); }
.topbar .btn.primary:hover { background: var(--primary-hover); }
.topbar .icon-btn { color: #fff; }
.topbar .icon-btn:hover { background: #ffffff1c; color: #fff; }
.topbar select { background: #ffffff10; border-color: #ffffff26; color: #fff; }
.topbar select option { color: var(--text); }
.view { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; width: 100%; min-width: 0; }
.topbar .menu-btn { display: none; }
.backdrop { display: none; }

/* ---------- componentes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.card.p0 { padding: 0; overflow: hidden; }
.card h3 { margin: 0 0 14px; font-size: 15px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; }
.btn.danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.b-pago, .b-aprovado, .b-ativo { background: var(--ok-soft); color: var(--ok); }
.b-pendente { background: var(--warn-soft); color: var(--warn); }
.b-rejeitado, .b-inativo, .b-n-vendido { background: var(--danger-soft); color: var(--danger); }
.b-feito, .b-vendido, .b-sim { background: var(--ok-soft); color: var(--ok); }
.b-por-fazer, .b-em-stock, .b-saiu-do-mystand { background: var(--warn-soft); color: var(--warn); }
.b-removido-na-oficina { background: var(--danger-soft); color: var(--danger); }
.bloco-mystand { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; margin: 14px 20px 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.bloco-mystand span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.bloco-mystand small { grid-column: 1 / -1; color: var(--muted); }
@media (max-width: 860px) { .bloco-mystand { grid-template-columns: 1fr; } }
.b-stock { background: var(--primary-soft); color: var(--primary); }
.tbl small.sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.tbl tbody tr { cursor: pointer; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.alerta-tipo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); }
.lista li.clic { cursor: pointer; }
.lista li.clic:hover { background: var(--surface-2); }
.chart .zero { stroke: var(--muted); stroke-width: 1; }
.chart .bar.s-lucro { fill: var(--c-vendas); }
.chart .bar.s-receitas { fill: var(--c-aquisicoes); }
.dot.s-lucro { background: var(--c-vendas); }
.dot.s-receitas { background: var(--c-aquisicoes); }
.dot.s-linha { background: var(--text); height: 3px; }
.campo-secao { grid-column: 1 / -1; margin: 6px 0 -4px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.campo-secao:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
dialog.largo { width: min(1040px, calc(100vw - 32px)); }
dialog.largo .grid-form { grid-template-columns: repeat(4, 1fr); max-height: 70vh; }
.horas-input { width: 64px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.pivot td, .pivot th { white-space: nowrap; }
.pivot td.num, .pivot th.num { min-width: 86px; }
@media (max-width: 860px) { dialog.largo .grid-form { grid-template-columns: 1fr 1fr; } }

input[type=text], input[type=date], input[type=search], select, textarea {
  height: 36px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); min-width: 0;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .icon-btn:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px;
}

.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filtros .pesq { flex: 1 1 220px; }
.filtros .pesq input { width: 100%; }

/* tabelas: só o deslocamento da página (as listas longas são paginadas); deslocamento horizontal quando são
   mais largas do que o ecrã */
.table-wrap { overflow-x: auto; }
.grade thead .nome { z-index: 3; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .strong { font-weight: 600; }
.tbl .muted { color: var(--muted); }
.tbl .wrap { min-width: 180px; }
.tbl .acoes { text-align: right; white-space: nowrap; width: 1%; }
.tbl td:first-child, .tbl th:first-child { padding-left: 18px; }
.nowrap { white-space: nowrap; }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty.sm { padding: 16px 0; text-align: left; }
.empty.error { color: var(--danger); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- painel ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-size: 26px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12.5px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.kpi.neg .val { color: var(--danger); }
.kpi.pos .val { color: var(--ok); }
.dot.s-vendas { background: var(--c-vendas); }
.dot.s-aquisicoes { background: var(--c-aquisicoes); }
.dot.s-despesas { background: var(--c-despesas); }
.dot.s-resultado { background: var(--text); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar.s-vendas { fill: var(--c-vendas); }
.chart .bar.s-aquisicoes { fill: var(--c-aquisicoes); }
.chart .bar.s-despesas { fill: var(--c-despesas); }
.chart .bar:hover { opacity: .8; }
.chart .linha { fill: none; stroke: var(--text); stroke-width: 2; stroke-dasharray: 4 3; }
.chart .ponto { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.leg { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.leg span { display: inline-flex; align-items: center; gap: 6px; }

.hbar { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar-t i { display: block; height: 100%; border-radius: 4px; }
.hbar-t i.s-despesas { background: var(--c-despesas); }
.hbar-t i.s-vendas { background: var(--c-vendas); }
.hbar-v { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.lista li:last-child { border-bottom: 0; }
.lista small { color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.mini-stats .card { padding: 14px 16px; }
.mini-stats .val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-stats .lbl { font-size: 12.5px; color: var(--muted); }
a.mini { color: inherit; text-decoration: none; }
a.mini:hover .card { border-color: var(--primary); }

/* ---------- mapas ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nav-mes { display: flex; align-items: center; gap: 4px; }
.nav-mes strong { min-width: 150px; text-align: center; font-size: 15px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 32px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--primary-soft); color: var(--primary); }
.legenda { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-left: auto; }
.legenda span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); display: inline-block; }
.lg.fds { background: var(--wk); }
.lg.fer { background: var(--fer); }
.lg.fe-a { background: var(--fe); }
.lg.fe-p { background: repeating-linear-gradient(45deg, var(--fe) 0 3px, transparent 3px 6px); }

.grade { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
.grade th, .grade td {
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  text-align: center; padding: 0; height: 36px; min-width: 30px;
}
.grade thead th { background: var(--surface-2); font-weight: 600; height: 42px; }
.grade th.dia small { display: block; font-weight: 500; color: var(--muted); font-size: 10px; line-height: 1.1; }
.grade .nome {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  text-align: left; padding: 5px 12px; min-width: 170px; white-space: nowrap; line-height: 1.25;
}
.grade thead .nome { z-index: 3; background: var(--surface-2); }
.grade .nome small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.grade .fds { background: var(--wk); }
.grade .fer { background: var(--fer); }
.grade th.hoje { color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); }
.grade td.cel { cursor: pointer; user-select: none; font-weight: 700; font-size: 11px; }
.grade td.cel:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.grade td.fe-a { background: var(--fe); }
.grade td.fe-p { background: repeating-linear-gradient(45deg, var(--fe) 0 4px, var(--surface) 4px 8px); }
.grade td.fe-a.fds, .grade td.fe-a.fer { background: color-mix(in srgb, var(--fe) 40%, var(--wk)); }
.grade .tot { min-width: 40px; padding: 0 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.grade th.tot { font-size: 11px; }
.grade .tot.sep { border-left: 2px solid var(--border); }
.grade .neg { color: var(--danger); }
.grade th.mes-h { cursor: pointer; min-width: 52px; }
.grade th.mes-h:hover { color: var(--primary); }
.grade td.mes-c { font-variant-numeric: tabular-nums; }
.grade td.mes-c.tem { background: color-mix(in srgb, var(--fe) 35%, transparent); font-weight: 700; }

.e-P { background: var(--e-P) !important; color: var(--e-P-ink); }
.e-FG { background: var(--wk) !important; color: var(--muted); }
.e-FO { background: var(--e-FO) !important; color: var(--e-FO-ink); }
.e-FJ { background: var(--e-FJ) !important; color: var(--e-FJ-ink); }
.e-F { background: var(--e-F) !important; color: var(--e-F-ink); }
.e-B { background: var(--e-B) !important; color: var(--e-B-ink); }
.e-Fe { background: var(--e-Fe) !important; color: var(--e-Fe-ink); cursor: not-allowed !important; }

.pinceis { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pinceis .lbl { font-size: 12px; color: var(--muted); margin-right: 4px; }
.pincel {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 6px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 12.5px; font-weight: 600;
}
.pincel b { display: inline-grid; place-items: center; min-width: 24px; height: 22px; border-radius: 5px; font-size: 11px; }
.pincel.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.dica { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ---------- diálogo ---------- */
dialog {
  border: 0; padding: 0; border-radius: 14px; width: min(600px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { margin: 0; font-size: 17px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 18px 20px; max-height: 65vh; overflow: auto; }
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.campo.larg { grid-column: 1 / -1; }
.campo input, .campo select, .campo textarea { width: 100%; font-weight: 400; }
.campo small { font-weight: 400; color: var(--muted); }
.req { color: var(--danger); }
.form-info { margin: 0 20px; padding: 10px 12px; border-radius: 8px; background: #f2f2f4; color: #3a3b40; font-size: 13px; font-weight: 600; }
.form-info:empty { display: none; }
.form-erro { margin: 10px 20px 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.form-erro:empty { display: none; }
.dlg-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); margin-top: 14px; }
.spacer { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #18212d; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-weight: 600; font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.erro { background: var(--danger); }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 30;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 25; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { margin: 16px 16px 0; padding: 20px 20px 18px; }
  .topbar h1 { font-size: 24px; }
  .view { padding: 16px 16px 40px; }
  .legenda { margin-left: 0; }
  .grid-form { grid-template-columns: 1fr; }
}


/* ---------- conta na barra lateral ---------- */
.conta { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; }
.conta strong { color: #fff; font-size: 13px; margin-top: 2px; }
.conta small { color: #8f8f97; }
.conta .acoes-conta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.conta button { background: transparent; border: 0; padding: 4px 0; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.conta button:hover { color: #ff6464; }
.sidebar-foot #dataHoje { color: #77777e; font-size: 11px; }
body.perfil-equipa [data-gestor] { display: none !important; }
.toast { background: #202020; }

/* ---------- ecrã de entrada (igual ao da oficina) ---------- */
.enterprise-login { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: 44% 56%; background: #f6f6f7; color: #25252b; }
.login-aside { position: relative; isolation: isolate; overflow: hidden; background: #151515; color: #fff; padding: 44px 11%; display: flex; flex-direction: column; justify-content: space-between; gap: 70px; }
.login-aside::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(135deg, #ffffff05, transparent 55%), linear-gradient(#ffffff03 1px, transparent 1px), linear-gradient(90deg, #ffffff03 1px, transparent 1px); background-size: auto, 56px 56px, 56px 56px; }
.login-aside::after { content: ""; position: absolute; z-index: -1; width: 410px; height: 410px; border: 1px solid #ffffff0b; border-radius: 50%; right: -260px; top: 30%; box-shadow: 0 0 0 65px #ffffff03, 0 0 0 130px #ffffff02; }
.login-brand { display: flex; flex-direction: column; align-items: flex-start; }
.login-brand img.official-login-logo { width: 220px; max-width: 100%; height: auto; }
.login-brand span.official-login-caption { color: #b8b8c0; font-size: 9px; letter-spacing: 2.4px; margin-top: 17px; }
.login-intro { max-width: 420px; }
.login-kicker, .login-form-kicker { font-size: 10px; letter-spacing: 1.8px; font-weight: 650; }
.login-kicker { color: #ff7777; display: flex; align-items: center; gap: 11px; }
.login-kicker::before { content: ""; display: block; width: 25px; height: 1px; background: #ef1b1b; }
.login-intro h1 { font-size: clamp(32px, 3.25vw, 49px); line-height: 1.13; letter-spacing: -1.8px; font-weight: 600; margin: 22px 0; }
.login-intro > p { color: #b6b6bf; font-size: 14px; line-height: 1.8; max-width: 340px; margin: 0; }
.login-capabilities { display: grid; gap: 22px; margin-top: 42px; }
.login-capabilities > div { display: flex; align-items: flex-start; gap: 15px; }
.login-capabilities > div > span { font-size: 10px; font-variant-numeric: tabular-nums; color: #acacb5; border: 1px solid #ffffff25; width: 29px; height: 29px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; }
.login-capabilities p { font-size: 12px; line-height: 1.5; color: #a2a2ae; margin: 0; }
.login-capabilities strong { display: block; font-size: 13px; font-weight: 550; color: #f3f3f6; margin-bottom: 4px; }
.login-aside-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 22px; border-top: 1px solid #ffffff16; font-size: 10px; color: #96969f; }
.login-aside-footer > span:first-child { letter-spacing: 1.3px; }
.login-main { padding: 31px 7% 24px; display: flex; flex-direction: column; min-width: 0; background: #f6f6f7; }
.login-topbar, .login-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; font-size: 11px; color: #7e7e87; }
.login-topbar > span:first-child > span { margin: 0 10px; color: #c4c4ca; }
.login-access-label { border: 1px solid #e2e3e5; background: #fff; border-radius: 5px; padding: 6px 9px; color: #6b6b74; white-space: nowrap; font-size: 10px; }
.login-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 0 40px; }
.login-card { background: #fff; border: 1px solid #e2e3e5; border-radius: 13px; padding: 34px 36px; width: 100%; max-width: 420px; box-shadow: 0 6px 24px #15151505; }
.login-card-icon { width: 42px; height: 42px; background: #fff0f0; border: 1px solid #f3d9d9; border-radius: 10px; color: #d41e1e; display: grid; place-items: center; margin-bottom: 26px; }
.login-card-icon svg { width: 22px; height: 22px; }
.login-form-kicker { color: #7e7e87; font-size: 9px; letter-spacing: 1.6px; }
.login-card h2 { font-size: 27px; letter-spacing: -.8px; line-height: 1.3; color: #25252b; margin: 9px 0; }
.login-card-heading p { font-size: 13px; line-height: 1.7; color: #7a7d82; margin: 0 0 28px; }
.login-field { display: block; font-size: 12px; line-height: 1.5; font-weight: 600; color: #46464e; }
.login-field input { margin-top: 8px; margin-bottom: 19px; }
.login-card input { width: 100%; font-size: 13px; line-height: 1.5; height: 46px; padding: 12px 13px; border: 1px solid #dcdde0; border-radius: 6px; background: #fff; color: #25252b; }
.login-card input::placeholder { color: #a0a0a8; }
.login-card input:focus { outline: 2px solid #fbe1e1; outline-offset: 1px; border-color: #de7777; }
.login-password { position: relative; margin-top: 8px; }
.login-password input { padding-right: 72px; }
.login-password button { position: absolute; right: 10px; top: 0; height: 46px; background: transparent; border: 0; color: #5f5f69; font-size: 11px; padding: 0 4px; cursor: pointer; }
.login-error { color: var(--danger); font-size: 12px; font-weight: 600; margin: 12px 0 0; }
.login-error:empty { margin: 0; }
.login-submit { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 46px; padding: 0 16px; border: 1px solid #ef1b1b; border-radius: 6px; background: #ef1b1b; color: #fff; font-size: 12px; font-weight: 600; margin-top: 18px; cursor: pointer; transition: background .15s; }
.login-submit:hover { background: #d01919; }
.login-submit:disabled { opacity: .65; cursor: wait; }
.login-submit span { font-size: 18px; font-weight: 400; }
.enterprise-login button:focus-visible { outline: 2px solid #e54d4d; outline-offset: 2px; }
.login-help { display: grid; gap: 4px; border-top: 1px solid #efeff1; margin-top: 26px; padding-top: 21px; font-size: 11px; line-height: 1.5; color: #8d8d95; }
.login-help strong { font-weight: 500; color: #5e5e67; }
.login-help code { font-size: 11px; word-break: break-all; color: #3a3a40; }
.login-platform-note { font-size: 11px; color: #8d8d95; margin: 18px 0 0; text-align: center; }
.login-footer { font-size: 10px; color: #9a9aa2; }
@media (min-width: 1500px) { .login-aside { padding: 55px 13%; } .login-main { padding-left: 10%; padding-right: 10%; } }
@media (max-width: 1000px) {
  .enterprise-login { grid-template-columns: 40% 60%; }
  .login-aside { padding: 34px 10%; gap: 45px; }
  .login-intro h1 { font-size: 34px; }
  .login-main { padding: 25px 7%; }
  .login-card { padding: 30px; }
  .login-aside-footer > span:last-child { display: none; }
}
@media (max-width: 700px) {
  .enterprise-login { display: flex; flex-direction: column; }
  .login-aside { padding: 24px; gap: 0; }
  .login-brand img.official-login-logo { width: 165px; }
  .login-brand span.official-login-caption { margin-top: 10px; font-size: 8px; }
  .login-intro, .login-aside-footer { display: none; }
  .login-main { flex: 1; padding: 22px 22px 20px; }
  .login-center { padding: 32px 0 35px; }
  .login-card { padding: 28px 25px; }
  .login-card h2 { font-size: 25px; }
  .login-footer { font-size: 9px; }
  .official-brand img { max-width: 155px; }
  .official-brand span { display: none; }
  .topbar { margin: 16px 16px 0; padding: 20px 20px 18px; }
  .topbar h1 { font-size: 24px; }
}
@media (min-width: 701px) and (max-height: 800px) {
  .login-center { padding: 24px 0 20px; }
  .login-card { padding: 26px 32px; }
  .login-card-icon { margin-bottom: 18px; }
  .login-card-heading p { margin-bottom: 20px; }
  .login-aside { gap: 35px; }
  .login-capabilities { margin-top: 32px; gap: 18px; }
}

/* ---------- ligações na ficha da viatura ---------- */
.ligacoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 20px; margin: 14px 20px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.ligacoes h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ligacoes h4 small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.ligacoes section:last-child { grid-column: 1 / -1; }
.ligacoes section { min-width: 0; align-self: start; }
.ligacoes .dica { margin: 0; }
.ligacoes .lista li { padding: 6px 0; align-items: center; }
.ligacoes .lista li > span:first-child { flex: 1; min-width: 0; line-height: 1.4; }
.ligacoes .btn.sm { margin-top: 10px; }
.acoes-ligacao { display: flex; flex: none; gap: 6px; align-items: center; white-space: nowrap; }
.acoes-ligacao a.ligacao { padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 12px; text-decoration: none; }
.acoes-ligacao a.ligacao:hover { background: var(--primary-soft); text-decoration: none; }
.acoes-ligacao small { font-size: 12px; }
a.ligacao { color: var(--primary); font-weight: 600; text-decoration: none; }
a.ligacao:hover { text-decoration: underline; }
.tbl.mini td { padding: 7px 10px; font-size: 13px; }
.tbl.mini tr { cursor: pointer; }
.sidebar-foot .versao { display: flex; flex-direction: column; gap: 2px; color: #77777e; font-size: 11px; margin-top: 4px; }
.sidebar-foot .versao code { font-size: 10.5px; color: #9a9aa2; }
.sidebar-foot .versao small { color: #5f5f66; }
.dot.s-fora { background: #9a9aa2; }
.kpi .sub a.ligacao-simples { color: var(--primary); font-weight: 600; text-decoration: none; }
.kpi .sub a.ligacao-simples:hover { text-decoration: underline; }
.pivot tr.nao-operacional td { color: var(--muted); }
.pivot tr.subtotal td { font-weight: 700; background: var(--surface-2); }
.tag-fora { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: #f0f0f2; color: var(--muted); }
.check-op { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check-op input { width: 16px; height: 16px; accent-color: var(--primary); }
.b-ficha { background: #f0f0f2; color: #5f5f66; }
.b-lancamento { background: var(--ok-soft); color: var(--ok); }

/* ---------- ordenação das tabelas ---------- */
.tbl th.ordenavel { cursor: pointer; user-select: none; }
.tbl th.ordenavel:hover { color: var(--text); }
.tbl th .seta { display: inline-block; width: 10px; margin-left: 4px; color: var(--muted); }
.tbl th.ordenavel:hover .seta::after { content: "↕"; opacity: .6; }
.tbl th.asc, .tbl th.desc { color: var(--primary); }
.tbl th.asc .seta::after { content: "▲"; opacity: 1; font-size: 9px; }
.tbl th.desc .seta::after { content: "▼"; opacity: 1; font-size: 9px; }

/* ---------- ficha da pessoa e listas ---------- */
.bloco-mystand.ficha { margin: 0 0 10px; grid-template-columns: repeat(2, 1fr); }
.conta .acoes-conta { gap: 10px 14px; }

/* ---------- paginação ---------- */
.paginacao { position: sticky; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.paginacao .pag-nav { display: flex; align-items: center; gap: 10px; }
.paginacao .pag-nav span { color: var(--text); font-weight: 600; }
.paginacao label { display: flex; align-items: center; gap: 8px; }
.paginacao select { height: 30px; }
.paginacao .btn:disabled { opacity: .4; cursor: default; }
.aviso-oficina { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.btn.retoma { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.retoma:hover { filter: brightness(.92); }
.datas { position: relative; display: flex; gap: 6px; align-items: center; }
.datas input[type=text] { flex: 1; }
.datas .icon-btn { flex: none; }
.datas-cal { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
