/* =====================================================================
   Eletroserv · folha de estilos única
   Identidade: azul-marinho profundo + azul elétrico da logo, cartões
   brancos, verde para dinheiro que entra, vermelho para o que sai.
   Breakpoints: ≤1100 trilho compacto · ≤900 tabelas viram cartões ·
   ≤760 celular (navegação inferior e diálogos em folha).
   ===================================================================== */

:root {
  --navy: #001e50;
  --navy-2: #0b2d68;
  --blue: #0072ff;
  --blue-dark: #005bd0;
  --blue-soft: #e8f1ff;
  --ink: #13223a;
  --muted: #52657a;
  --line: #dde5ef;
  --line-strong: #c3d0de;
  --paper: #f3f6fa;
  --white: #fff;
  --green: #12805c;
  --green-soft: #e2f4ec;
  --red: #c02a3e;
  --red-dark: #9d1f31;
  --red-soft: #fdecef;
  --amber: #8a5a00;
  --amber-soft: #fff3d1;
  --violet: #5b2db8;
  --violet-soft: #f0e9ff;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 30, 80, .06);
  --shadow: 0 6px 24px rgba(0, 30, 80, .10);
  --rail: 240px;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--paper); line-height: 1.45; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.6px; margin-bottom: 6px; }
h2 { font-size: 19px; letter-spacing: -.3px; }
h3 { font-size: 16px; }
a { color: var(--blue-dark); }
img { max-width: 100%; }
.muted { color: var(--muted); font-weight: 400; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.oculto { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
body.booting .rail, body.booting .workspace, body.locked .rail, body.locked .workspace { visibility: hidden; }

/* ------------------------------------------------------------ controles */
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, .button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--white); color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
button:hover, .button-link:hover { border-color: var(--blue); color: var(--blue-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(0, 114, 255, .45); outline-offset: 2px;
}
button.small, .button-link.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.primary:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.accent { background: var(--blue); border-color: var(--blue); color: #fff; }
.accent:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.quiet { background: transparent; border-color: transparent; }
.quiet:hover { background: var(--blue-soft); border-color: transparent; }
.danger { background: var(--red); border-color: var(--red); color: #fff; }
.danger:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.danger-outline { color: var(--red); border-color: #efc3ca; }
.danger-outline:hover { background: var(--red-soft); border-color: var(--red); color: var(--red-dark); }
.icon-button { width: 40px; min-height: 40px; padding: 0; border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); }
.icon-button:hover { background: var(--paper); color: var(--ink); }

input, select, textarea {
  width: 100%; max-width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--white); color: var(--ink);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 114, 255, .16); }
input:disabled, select:disabled, textarea:disabled { background: var(--paper); color: var(--muted); }

/* ------------------------------------------------------------ login */
#login { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--white); overflow-y: auto; }
.login-banner {
  display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 56px clamp(32px, 6vw, 80px);
  background: radial-gradient(120% 90% at 0% 0%, #0b3a8a 0%, var(--navy) 55%, #00143a 100%); color: #fff;
}
.login-banner img { width: min(300px, 70%); height: auto; background: #fff; border-radius: var(--r-lg); padding: 14px 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.login-banner .tag { font-size: 17px; line-height: 1.5; max-width: 460px; margin: 6px 0 0; opacity: .92; }
.login-banner ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; font-size: 15px; }
.login-banner li { position: relative; padding-left: 28px; opacity: .92; }
.login-banner li::before { content: ''; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(0, 114, 255, .25); }
.login-banner .foot { margin: 22px 0 0; font-size: 13px; opacity: .65; }
#login-form { width: min(380px, 100%); margin: auto; padding: 40px 24px; display: flex; flex-direction: column; gap: 8px; }
#login-form h2 { font-size: 26px; color: var(--navy); margin: 0; }
#login-form .login-sub { margin: 0 0 14px; color: var(--muted); }
#login-form label { margin-top: 8px; font-size: 14px; font-weight: 600; }
#login-form input { min-height: 50px; font-size: 16px; }
#login-form .pass { display: flex; gap: 8px; }
#login-form .pass input { flex: 1; min-width: 0; }
#login-form .pass button { min-height: 50px; min-width: 92px; }
#login-erro { margin: 6px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--red-soft); color: var(--red-dark); font-size: 14px; font-weight: 600; }
#login-btn { margin-top: 14px; min-height: 52px; font-size: 16px; background: var(--blue); border-color: var(--blue); }
#login-btn:hover { background: var(--blue-dark); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ------------------------------------------------------------ trilho / navegação */
.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--rail); padding: 26px 18px 20px;
  display: flex; flex-direction: column; background: var(--navy); color: #fff;
}
.brand { display: block; border-radius: var(--r); }
.brand img { display: block; width: 100%; height: auto; background: #fff; border-radius: var(--r); padding: 10px 12px; }
.rail-label { margin: 34px 12px 10px; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: #9fb4d3; }
.rail nav { display: grid; gap: 4px; }
.rail nav button {
  justify-content: flex-start; gap: 12px; min-height: 46px; padding: 11px 14px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: #d4e1f2; font-size: 15px; text-align: left;
}
.rail nav button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.rail nav button.active { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(0, 114, 255, .35); }
.rail-foot { margin-top: auto; padding: 0 12px; font-size: 12px; color: #9fb4d3; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #2fd18b; box-shadow: 0 0 0 3px rgba(47, 209, 139, .2); }

/* ------------------------------------------------------------ área de trabalho */
.workspace { margin-left: var(--rail); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 36px;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-logo { display: none; width: auto; height: 34px; }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; font-size: 15px; color: var(--navy); }
.role { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--blue-dark); background: var(--blue-soft); padding: 3px 8px; border-radius: 999px; }
.topbar-actions { margin-left: auto; display: flex; gap: 6px; }
main { width: 100%; max-width: 1400px; margin: 0 auto; padding: 30px 36px 24px; flex: 1; }
footer { padding: 12px 36px 28px; font-size: 12px; color: var(--muted); }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 36px; font-size: 14px; line-height: 1.5; }
.banner.demo { background: #ffe7a3; color: var(--navy); }
.banner.warning { background: #ffe4dc; color: #6d2b1f; }

#toast {
  position: fixed; z-index: 2000; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px; border-radius: var(--r); background: var(--navy); color: #fff; box-shadow: var(--shadow);
  border-left: 4px solid var(--blue); font-size: 14px; line-height: 1.45; animation: toast-in .18s ease-out;
}
#toast[data-kind='success'] { border-left-color: #2fd18b; }
#toast[data-kind='error'] { border-left-color: #ff5d6f; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ------------------------------------------------------------ cabeçalho de página e blocos */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--blue-dark); }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.subtitle .badge { vertical-align: 1px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.panel { min-width: 0; padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.panel + .panel, .grid + .panel { margin-top: 20px; }
.quote-sections > .panel, .quote-parties > .panel, .quote-form > .panel, .grid .col > .panel { margin-top: 0; }
.panel h2 { margin-bottom: 6px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.grid .col { display: grid; gap: 20px; align-content: start; min-width: 0; }
.notice { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--amber-soft); color: var(--amber); font-size: 13px; }
.footnote { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }

.filterbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 20px; padding: 14px 16px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.filterbar label { flex: 1 1 160px; display: grid; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.filterbar label.grow { flex: 2 1 240px; }
.filterbar input, .filterbar select { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); font-size: 14px; }
.filterbar .filter-note { flex: 2 1 220px; margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

.empty { padding: 30px 16px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r); background: #fafcfe; }
.empty h3 { margin-bottom: 8px; color: var(--navy); }
.empty p { max-width: 420px; margin: 0 auto 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.empty.compact { padding: 18px; margin: 12px 0; }
.empty.compact p { margin-bottom: 12px; }

/* ------------------------------------------------------------ indicadores */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.metric { min-width: 0; padding: 20px 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.metric span { font-size: 13px; font-weight: 700; color: var(--muted); }
.metric strong { display: block; margin: 10px 0 6px; font-size: clamp(24px, 2.3vw, 34px); font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { font-size: 12px; color: var(--muted); }
.metric.positive strong { color: var(--green); }
.metric.negative strong { color: var(--red); }
.metric.balance { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); border-color: var(--navy); color: #fff; }
.metric.balance span, .metric.balance small { color: #bcd0ec; }
.positive { color: var(--green); }
.negative { color: var(--red); }

.forecast {
  display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; margin-bottom: 20px; padding: 14px 20px;
  background: var(--blue-soft); border: 1px solid #d4e4fb; border-radius: var(--r); font-size: 14px;
}
.forecast b { margin-left: 6px; font-variant-numeric: tabular-nums; }
.forecast .has-overdue b { color: var(--red); }
.forecast small { flex-basis: 100%; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* gráfico */
.chart svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.chart .grid-line { stroke: #e4eaf2; stroke-width: 1; }
.chart .axis { fill: var(--muted); }
.chart .axis-x { fill: var(--ink); font-weight: 600; }
.chart .bar.in, .chart-legend .lg-in { fill: var(--green); background: var(--green); }
.chart .bar.out, .chart-legend .lg-out { fill: var(--red); background: var(--red); }
.chart .bar-label.in { fill: var(--green); font-weight: 700; }
.chart .bar-label.out { fill: var(--red); font-weight: 700; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 11px; height: 11px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.chart-legend small { margin-left: auto; }

.allocation { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.allocation:last-of-type { border-bottom: 0; }
.allocation strong { font-size: 15px; overflow-wrap: anywhere; }
.allocation .nums { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.allocation small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.category { display: flex; justify-content: space-between; gap: 8px; margin: 14px 0 6px; font-size: 14px; }
.category-progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; background: #e8eef5; accent-color: var(--blue); }
.category-progress::-webkit-progress-bar { background: #e8eef5; border-radius: 3px; }
.category-progress::-webkit-progress-value { background: var(--blue); border-radius: 3px; }
.category-progress::-moz-progress-bar { background: var(--blue); border-radius: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { gap: 10px; min-height: 38px; padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.chip b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--paper); font-variant-numeric: tabular-nums; }

/* selos de situação */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.badge.paid, .badge.done { background: var(--green-soft); color: var(--green); }
.badge.pending, .badge.waiting { background: var(--amber-soft); color: var(--amber); }
.badge.progress { background: var(--blue-soft); color: var(--blue-dark); }
.badge.quote { background: var(--violet-soft); color: var(--violet); }
.badge.cancel { background: var(--red-soft); color: var(--red); }
.overdue { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--red); }

/* ------------------------------------------------------------ tabelas */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
td strong { overflow-wrap: anywhere; }
td small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row-actions button { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.mobile-label { display: none; }

/* ------------------------------------------------------------ serviços */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.service-card {
  display: flex; flex-direction: column; min-width: 0; padding: 20px; background: var(--white);
  border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.service-card.status-concluído { border-top-color: var(--green); }
.service-card.status-aguardando { border-top-color: #e3a600; }
.service-card.status-cancelado { border-top-color: var(--line-strong); opacity: .85; }
.service-card.status-orçamento { border-top-color: var(--violet); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-top .eyebrow { margin: 0; color: var(--muted); }
.service-card h2 { margin: 14px 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.service-card p { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.card-bottom { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; }
.card-bottom small { display: block; font-size: 12px; color: var(--muted); }
.card-bottom b { font-size: 18px; font-variant-numeric: tabular-nums; }

.detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.detail-metrics > div { min-width: 0; padding: 16px 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.detail-metrics span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.detail-metrics strong { font-size: 21px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.detail-metrics .positive strong { color: var(--green); }
.detail-metrics .negative strong { color: var(--red); }
.detail-metrics .highlight { background: var(--navy); border-color: var(--navy); color: #fff; }
.detail-metrics .highlight span { color: #bcd0ec; }
.detail-note p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.nf-panel { margin-bottom: 20px; }
.nf-panel h2 small { font-size: 14px; }
.nf-name { overflow-wrap: anywhere; line-height: 1.6; }
.nf-panel .actions { margin-top: 10px; }

.error-panel { max-width: 560px; margin: 30px auto; border-color: #f0c4cf; background: #fff8f9; }
.error-panel h2 { color: var(--red); }
.error-detail { margin: 0 0 8px; padding: 10px 12px; max-height: 120px; overflow: auto; border-radius: var(--r-sm); background: var(--red-soft); color: var(--red-dark); font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

/* ------------------------------------------------------------ diálogos */
dialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px;
  border: 0; border-radius: var(--r-lg); background: var(--white); color: var(--ink); box-shadow: 0 24px 80px rgba(0, 20, 60, .35);
}
dialog::backdrop { background: rgba(0, 20, 50, .55); backdrop-filter: blur(2px); }
dialog[open] { animation: dialog-in .16s ease-out; }
@keyframes dialog-in { from { transform: translateY(10px); opacity: 0; } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dialog-head h2 { margin: 0; font-size: 21px; color: var(--navy); }
.dialog-head p { margin: 4px 0 0; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fields > * { min-width: 0; }
.fields .full { grid-column: 1 / -1; }
.fields label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.fields small { display: block; font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--muted); }
#form-error:not(:empty), .quote-error:not(:empty) { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--red-soft); color: var(--red-dark); font-size: 14px; line-height: 1.5; white-space: pre-line; }
#form-error:empty, .quote-error:empty { display: none; }

.confirm-dialog { width: min(460px, calc(100vw - 32px)); border-top: 4px solid var(--blue); }
.confirm-dialog.is-danger { border-top-color: var(--red); }
.confirm-dialog h2 { margin-bottom: 10px; font-size: 20px; color: var(--navy); }
.confirm-dialog p { color: var(--muted); line-height: 1.6; }
.summary-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; padding: 14px; border-radius: var(--r-sm); background: var(--paper); overflow-wrap: anywhere; }
.summary-list dt { font-size: 13px; color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 700; }
.safe-note { padding-left: 12px; border-left: 3px solid var(--blue); font-size: 13px; }

.password-dialog { width: min(520px, calc(100vw - 32px)); }
.password-dialog h3 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.password-dialog p.muted { margin: 0 0 14px; font-size: 13px; line-height: 1.5; }
.password-dialog .dialog-actions { margin-top: 14px; }
.divider { margin: 22px 0; border: 0; border-top: 1px solid var(--line); }

.pdf-ready-dialog { width: min(440px, calc(100vw - 32px)); }
.pdf-ready-dialog h2 { color: var(--navy); }
.pdf-ready-name { font-weight: 700; overflow-wrap: anywhere; }
.pdf-ready-help, .pdf-ready-status { line-height: 1.5; color: var(--muted); }
.pdf-ready-status { min-height: 1.5em; color: var(--red-dark); }
.pdf-ready-actions { display: flex; flex-direction: column; gap: 10px; }
.pdf-ready-actions button { width: 100%; min-height: 48px; white-space: normal; }

/* ------------------------------------------------------------ orçamentos */
.quote-note { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.quote-help { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.quote-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.quote-sections { display: grid; gap: 16px; min-width: 0; }
.quote-section h2 { margin-bottom: 14px; }
.quote-totals { position: sticky; top: 84px; border-top: 4px solid var(--blue); }
.quote-totals dl { margin: 0; }
.quote-totals dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.quote-totals dt, .quote-totals dd { margin: 0; }
.quote-totals dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.quote-total { display: block; margin: 16px 0; padding: 16px; border-radius: var(--r-sm); background: var(--navy); color: #fff; font-size: 26px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quote-total small { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #bcd0ec; }
.quote-internal { display: grid; gap: 2px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: #f8fafc; font-size: 13px; }
.quote-internal .quote-note { margin-top: 4px; font-size: 12px; }
.quote-buttons { display: grid; gap: 8px; margin-top: 14px; }
.quote-totals > button { width: 100%; margin-top: 12px; }
.save-state { font-weight: 600; }
.quote-item { margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--r-sm); background: #fbfcfe; }
.quote-item.readonly { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--white); }
.quote-item.readonly .quote-note { margin: 2px 0 0; }
.quote-item-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.item-grid > * { min-width: 0; }
.item-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.item-grid .span-all { grid-column: 1 / -1; }
.item-subtotal { margin: 12px 0 0; text-align: right; font-size: 14px; font-weight: 700; color: var(--navy); }
.quote-lock { margin-bottom: 18px; padding: 14px 16px; border: 1px solid #c9dcf6; border-radius: var(--r); background: var(--blue-soft); font-size: 14px; line-height: 1.6; }
.quote-read { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 14px; }
.quote-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quote-company { max-width: 960px; }
.quote-company .actions { margin-top: 18px; }

/* ------------------------------------------------------------ máquinas */
.mq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; align-items: start; }
.mq-card {
  display: grid; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.mq-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.mq-foto { display: block; width: 100%; height: 160px; object-fit: contain; background: #eef3fa; }
.mq-foto-vazia { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef3fa, #dfe9f7); color: var(--muted); font-weight: 600; font-size: 14px; }
.mq-corpo { display: grid; justify-items: start; gap: 6px; padding: 14px 16px; }
.mq-nome { font-weight: 700; font-size: 16px; color: var(--navy); }
.mq-sub { font-size: 13px; color: var(--muted); }
.mq-preco { font-weight: 700; color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.mq-badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; background: var(--paper); color: var(--muted); }
.mq-badge[data-sit='À venda'] { background: var(--green-soft); color: var(--green); }
.mq-badge[data-sit='Alugada'] { background: var(--blue-soft); color: var(--blue-dark); }
.mq-badge[data-sit='Vendida'] { background: var(--red-soft); color: var(--red); }
.mq-badge[data-sit='Em manutenção'] { background: var(--amber-soft); color: var(--amber); }
.mq-badge[data-sit='Reservada'] { background: var(--violet-soft); color: var(--violet); }
.mq-alu { padding: 10px 16px; border-top: 1px dashed var(--line); font-size: 13px; line-height: 1.5; }
.mq-vazio { grid-column: 1 / -1; }
.mq-dialog { width: min(680px, calc(100vw - 32px)); padding: 0; }
.mq-dialog > form, .mq-dialog > .mq-det { padding: 22px 24px; }
.mq-det.is-busy { opacity: .7; pointer-events: none; }
.mq-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mq-foto-grande { display: flex; width: 100%; height: 240px; object-fit: contain; border-radius: var(--r); background: #eef3fa; border: 1px solid var(--line); }
.mq-photo-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.mq-photo-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.mq-photo-slot h4 { margin: 0; font-size: 13px; }
.mq-photo-slot > p { margin: 0; font-size: 13px; }
.mq-photo-slot button, .mq-photo-slot label { min-height: 40px; font-size: 13px; }
.mq-photo-view { padding: 0; border: 0; background: #eef3fa; overflow: hidden; }
.mq-photo-view img { display: block; width: 100%; height: 90px; object-fit: contain; }
.mq-btn-foto { display: flex; align-items: center; justify-content: center; padding: 8px; border: 1.5px dashed #9db4d6; border-radius: var(--r-sm); background: #f4f8ff; color: var(--blue-dark); font-weight: 600; cursor: pointer; text-align: center; }
.mq-btn-foto:hover { background: var(--blue-soft); }
.mq-photo-full { display: block; width: 100%; max-height: 70dvh; object-fit: contain; border-radius: var(--r-sm); background: #eef3fa; }
.mq-ficha { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 18px 0; align-items: center; font-size: 14px; }
.mq-ficha dt { color: var(--muted); font-weight: 600; }
.mq-ficha dd { margin: 0; }
.mq-alugueis { display: grid; gap: 8px; }
.mq-alugueis h3 { margin: 4px 0; }
.mq-alu-linha { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; }
.mq-alu-acoes { display: flex; flex-wrap: wrap; gap: 6px; }
.mq-aberto { font-weight: 700; color: var(--amber); }
.mq-detail .dialog-actions { justify-content: space-between; }

/* ------------------------------------------------------------ fluxo orçamento → serviço */
.badge.paused { background: #ececf3; color: #4a4a68; }
.badge.draft { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.badge.muted-badge { background: #eef0f3; color: #5d6670; }
.status-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line); border-left: 5px solid var(--blue);
  border-radius: var(--r); background: var(--white); box-shadow: var(--shadow-sm);
}
.status-card > div:first-child { flex: 1 1 320px; }
.status-card p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.status-card.status-pendente { border-left-color: #e3a600; background: #fffcf2; }
.status-card.status-aprovado { border-left-color: var(--green); background: #f6fcf9; }
.status-card.status-reprovado { border-left-color: var(--red); background: #fff8f9; }
.status-card.status-cancelado { border-left-color: var(--line-strong); }
.timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.timeline-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.timeline strong { font-size: 14px; }
.timeline p { margin: 2px 0 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.timeline small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.quote-item.is-labor { border-left-color: var(--green); background: #f7fcf9; }
.quote-item.readonly.is-labor { background: var(--white); }
.add-items { margin: 4px 0 16px; }
.inherited { margin-bottom: 20px; border-top: 4px solid var(--green); }
.inherited h3 { margin: 18px 0 8px; font-size: 15px; color: var(--navy); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; margin: 14px 0 0; }
.info-grid dt { font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.info-grid dd { margin: 4px 0 0; font-size: 14px; }
.info-grid dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.totals-line { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 24px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.totals-line div { display: flex; gap: 8px; align-items: baseline; }
.totals-line dt { font-size: 13px; color: var(--muted); }
.totals-line dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals-line .grand dd { font-size: 18px; color: var(--navy); }
@media (max-width: 760px) {
  .status-card { padding: 14px; }
  .status-card .actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .status-card .actions button:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .totals-line { justify-content: flex-start; }
}

/* ============================================================ tablet: trilho compacto */
@media (max-width: 1100px) {
  :root { --rail: 96px; }
  .rail { padding: 18px 10px; align-items: stretch; }
  .brand img { padding: 6px; }
  .rail-label, .rail-foot { display: none; }
  .rail nav { margin-top: 22px; }
  .rail nav button { flex-direction: column; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; font-size: 11.5px; text-align: center; }
  main { padding: 26px 24px 20px; }
  .topbar, .banner { padding-left: 24px; padding-right: 24px; }
  footer { padding: 12px 24px 26px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .quote-form { grid-template-columns: minmax(0, 1fr); }
  .quote-totals { position: static; }
  .quote-buttons { grid-template-columns: 1fr 1fr; }
}

/* ============================================================ tabelas viram cartões */
@media (max-width: 900px) {
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; }
  .stack-table tr { position: relative; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .stack-table tbody tr:last-child { border-bottom: 0; }
  .stack-table td { padding: 3px 0; border: 0; }
  .stack-table tbody tr:hover td { background: transparent; }
  .stack-table td:first-child { padding-right: 130px; font-size: 15px; }
  .stack-table td.amount { position: absolute; top: 14px; right: 0; font-size: 17px; }
  .stack-table .row-actions { justify-content: flex-start; margin-top: 8px; }
  .stack-table .badge { margin-top: 4px; }
  .mobile-label { display: inline; margin-right: 6px; font-size: 12px; color: var(--muted); }
  .metric strong { font-size: 26px; }
}

/* ============================================================ celular */
@media (max-width: 760px) {
  h1 { font-size: 25px; }
  input, select, textarea { font-size: 16px; } /* evita zoom automático no iOS */

  /* login: faixa compacta da marca + formulário */
  #login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-banner { padding: 22px 20px; gap: 10px; }
  .login-banner img { width: 190px; padding: 10px 12px; }
  .login-banner .tag { font-size: 14px; }
  .login-banner ul, .login-banner .foot { display: none; }
  #login-form { margin: 0 auto; padding: 26px 20px 40px; justify-content: flex-start; }

  /* navegação inferior estilo aplicativo */
  .rail {
    inset: auto 0 0 0; width: 100%; height: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    flex-direction: row; box-shadow: 0 -4px 18px rgba(0, 30, 80, .3);
  }
  .brand { display: none; }
  .rail nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; width: 100%; margin: 0; }
  .rail nav button { min-height: 56px; padding: 6px 2px; font-size: 10.5px; border-radius: 10px; letter-spacing: -.1px; }
  .rail nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail nav button.active { box-shadow: none; }
  .workspace { margin-left: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 56px; padding: 8px 12px; gap: 10px; }
  .topbar-logo { display: block; height: 32px; }
  .topbar-title { font-size: 14px; }
  #demo { display: none; }
  main { padding: 18px 14px 14px; }
  .banner { padding: 10px 14px; font-size: 13px; }
  footer { padding: 6px 14px 22px; }
  #toast { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: none; }

  .page-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 16px; }
  .page-head .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .subtitle { font-size: 13px; }
  .panel { padding: 16px; }
  .panel h2 { font-size: 17px; }
  .filterbar { padding: 12px; gap: 10px; }
  .filterbar label, .filterbar label.grow { flex: 1 1 100%; }
  .filterbar .filter-note { flex-basis: 100%; }

  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px 16px; }
  .metric strong { font-size: 22px; margin: 6px 0 2px; }
  .metric small { font-size: 11px; }
  .metric.balance { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
  .metric.balance strong { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 24px; }
  .forecast { gap: 6px 16px; padding: 12px 14px; font-size: 13px; }
  .chart-legend small { margin-left: 0; flex-basis: 100%; }
  .chip { flex: 1 1 calc(50% - 8px); justify-content: space-between; }
  .detail-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .detail-metrics > div { padding: 12px 14px; }
  .detail-metrics strong { font-size: 18px; }
  .card-bottom .row-actions { width: 100%; }
  .card-bottom .row-actions button { flex: 1; }

  /* diálogos em formato de folha, presos à parte de baixo da tela */
  dialog, .confirm-dialog, .mq-dialog, .pdf-ready-dialog, .password-dialog {
    width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }
  .mq-dialog { padding: 0; }
  .mq-dialog > form, .mq-dialog > .mq-det { padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); }
  .fields { grid-template-columns: 1fr; gap: 12px; }
  .dialog-actions { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: 16px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line); }
  .dialog-actions button { flex: 1; }

  .quote-parties { grid-template-columns: 1fr; }
  .item-grid { grid-template-columns: 1fr 1fr; }
  .quote-buttons { grid-template-columns: 1fr; }
  .quote-item.readonly { flex-direction: column; align-items: flex-start; }

  .mq-grid { grid-template-columns: 1fr; }
  .mq-foto { height: 190px; }
  .mq-foto-grande { height: 200px; }
  .mq-photo-slots { grid-template-columns: 1fr; }
  .mq-photo-slot { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; }
  .mq-photo-slot h4 { grid-column: 1 / -1; }
  .mq-photo-slot .mq-photo-view, .mq-photo-slot > p { grid-column: 1; }
  .mq-photo-view img { width: 56px; height: 56px; }
  .mq-photo-slot .mq-btn-foto:only-of-type { grid-column: 2 / -1; }
  .mq-quick { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------------
   Cobrança dos aluguéis (aba Máquinas) e Parâmetros
   --------------------------------------------------------------------- */
.mq-cobranca { margin-bottom: 20px; }
.mq-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mq-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); border-left-width: 4px; background: var(--white); }
.mq-kpi span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.mq-kpi strong { font-size: 20px; }
.mq-kpi small { font-size: 12px; color: var(--muted); }
.mq-kpi.atrasado { border-left-color: var(--red); background: var(--red-soft); }
.mq-kpi.atrasado strong { color: var(--red-dark); }
.mq-kpi.proximo { border-left-color: var(--amber); background: var(--amber-soft); }
.mq-kpi.proximo strong { color: var(--amber); }
.mq-kpi.recebido { border-left-color: var(--green); background: var(--green-soft); }
.mq-kpi.recebido strong { color: var(--green); }
.mq-kpi.curso { border-left-color: var(--blue); background: var(--blue-soft); }
.mq-cob-lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.mq-cob-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); border-left: 4px solid var(--amber); }
.mq-cob-item[data-sit="atrasado"] { border-left-color: var(--red); }
.mq-cob-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.mq-cob-item[data-sit="atrasado"] small { color: var(--red); font-weight: 600; }
.mq-cob-valor { font-weight: 700; white-space: nowrap; }
.mq-cob-ok { margin: 12px 0 0; }
.mq-selo { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.mq-selo.atrasado { background: var(--red-soft); color: var(--red-dark); }
.mq-selo.em-dia { background: var(--green-soft); color: var(--green); }
.mq-alu-linha { flex-direction: column; align-items: stretch; }
.mq-alu-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.mq-regra { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.mq-par-resumo { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 6px; font-size: 13px; color: var(--muted); }
.mq-par-resumo strong { color: var(--ink); }
.mq-par-resumo .atrasado, .mq-par-resumo .atrasado strong { color: var(--red); }
.mq-par-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.mq-parcelas { width: 100%; border-collapse: collapse; font-size: 13px; }
.mq-parcelas th { position: sticky; top: 0; background: var(--paper); text-align: left; padding: 6px 8px; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.mq-parcelas td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.mq-parcelas td small { display: block; color: var(--muted); font-size: 11px; }
.mq-parcelas td:last-child { text-align: right; }
.mq-par-sit { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mq-par-sit.recebido { background: var(--green-soft); color: var(--green); }
.mq-par-sit.atrasado { background: var(--red-soft); color: var(--red-dark); }
.mq-par-sit.hoje { background: var(--amber-soft); color: var(--amber); }
.mq-par-sit.a_vencer { background: var(--paper); color: var(--muted); }
.mq-par-sit.em_curso { background: var(--blue-soft); color: var(--blue-dark); }
.mq-aviso { padding: 8px 10px; border-radius: var(--r-sm); background: var(--amber-soft); color: var(--amber); font-size: 13px; }
.mq-alu-hist ol { margin: 10px 0 0; padding-left: 18px; font-size: 13px; }
.mq-alu-hist li { margin-bottom: 6px; }
.mq-alu-hist small { display: block; color: var(--muted); font-size: 11px; }
.lock-note { display: inline-block; font-size: 12px; color: var(--muted); }
.params-dialog { width: min(640px, calc(100vw - 32px)); }
.par-group h3 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-dark); }
.par-item { margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.par-item.is-busy { opacity: .6; pointer-events: none; }
.par-item legend { padding: 0 4px; font-weight: 700; color: var(--navy); }
.par-num { display: inline-block; margin-right: 4px; padding: 1px 6px; border-radius: 6px; background: var(--navy); color: #fff; font-size: 12px; }
.par-item > p.muted { margin: 4px 0 10px; font-size: 13px; }
.par-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.par-opt:hover { background: var(--paper); }
.par-opt input[type=radio] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; padding: 0; box-shadow: none; }
.par-opt > span { flex: 1; min-width: 0; }
.par-opt small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.par-padrao { font-style: normal; font-size: 11px; font-weight: 700; color: var(--blue-dark); }
.par-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 760px) {
  .mq-cob-item { grid-template-columns: 1fr auto; }
  .mq-cob-item button { grid-column: 1 / -1; }
  .mq-parcelas th:nth-child(1), .mq-parcelas td:nth-child(1) { display: none; }
}
.field-hint { display: block; min-height: 0; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--amber); }
.field-hint:empty { display: none; }

/* =====================================================================
   PRIVACIDADE (LGPD): aceite no primeiro acesso e tela Privacidade
   ===================================================================== */
.accept-dialog { width: min(720px, calc(100vw - 24px)); padding: 0; flex-direction: column; overflow: hidden; border-top: 6px solid var(--blue); }
.accept-dialog[open] { display: flex; }
.acc-head { padding: 22px 26px 14px; border-bottom: 1px solid var(--line); }
.acc-head h2 { margin: 0 0 4px; font-size: 22px; color: var(--navy); }
.acc-head p { margin: 0; }
.acc-body { max-height: min(56vh, 520px); overflow-y: auto; padding: 18px 26px; font-size: 14.5px; line-height: 1.6; background: #fbfcfe; }
.pv-dialog .acc-body { max-height: 60vh; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 14px; }
.acc-body h3 { margin: 18px 0 8px; font-size: 15px; color: var(--navy); }
.acc-body h3:first-child { margin-top: 0; }
.acc-body ul { margin: 0; padding-left: 20px; }
.acc-body li { margin-bottom: 6px; }
.acc-body p { margin: 0 0 8px; }
.acc-end { margin-top: 16px !important; padding-top: 12px; border-top: 1px dashed var(--line-strong); color: var(--muted); font-size: 13px; text-align: center; }
.accept-dialog .quote-error { margin: 0 26px; }
.acc-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px 22px; border-top: 1px solid var(--line); }
.login-legal { margin: 14px 0 0; text-align: center; font-size: 13px; }
.login-legal a { color: var(--muted); }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; letter-spacing: .2px; }

.pv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.pv-kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.pv-kpi span { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.pv-kpi strong { font-size: 28px; color: var(--navy); font-variant-numeric: tabular-nums; }
.pv-kpi small { font-size: 12px; color: var(--muted); }
.pv-kpi.aberto { border-left-color: var(--amber); }
.pv-kpi.vencido { border-left-color: var(--red); background: var(--red-soft); }
.pv-kpi.vencido strong { color: var(--red-dark); }
.pv-kpi.ok, .pv-kpi.feito { border-left-color: var(--green); }
.pv-kpi.anon { border-left-color: var(--navy); }
.pv-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.pv-busca { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pv-busca label { flex: 1 1 280px; display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.pv-resultados { margin-top: 16px; }
.pv-res-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pv-res { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pv-res li label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--r-sm); cursor: pointer; background: var(--white); }
.pv-res li.mantido label { border-left-color: var(--muted); background: var(--paper); }
.pv-res input[type=checkbox] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; margin-top: 3px; padding: 0; }
.pv-res span { display: grid; gap: 2px; min-width: 0; }
.pv-res em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--blue-dark); }
.pv-res small { color: var(--muted); font-size: 12px; }
.pv-res .pv-mantido { color: var(--amber); font-weight: 600; }
.pv-res .pv-nota { color: var(--muted); font-style: italic; }
.pv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.pv-grid .panel + .panel { margin-top: 0; }
.pv-grid + .panel { margin-top: 20px; }
.pv-docs { display: grid; gap: 10px; }
.pv-doc { display: grid; gap: 2px; justify-items: start; justify-content: stretch; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--navy); text-align: left; text-decoration: none; font-weight: 400; min-height: 0; }
.pv-doc strong { font-size: 15px; }
.pv-doc small { color: var(--muted); font-size: 12px; }
.pv-doc:hover { border-color: var(--blue); }
.pv-sub { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--blue-dark); }
.pv-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.pv-log li { padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper); }
.pv-log small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (max-width: 900px) {
  .pv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .accept-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .acc-body { max-height: none; flex: 1; padding: 16px; }
  .acc-head, .acc-actions { padding-left: 16px; padding-right: 16px; }
  .acc-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pv-busca button { width: 100%; }
}

/* =====================================================================
   TEMA 2026 — mesma identidade do orçamento em PDF
   (azul-marinho #0B1F4B + azul #0B63D8, faixas de cor, cartões com
   destaque lateral). Camada final: sobrepõe o tema anterior.
   ===================================================================== */
:root {
  --navy: #0b1f4b; --navy-2: #13306b; --blue: #0b63d8; --blue-dark: #0a52b4; --blue-soft: #e9f1fd;
  --card: #eef3fb; --paper: #f2f5fa; --line: #dbe3ee; --line-strong: #c5d1e0;
  --r-sm: 10px; --r: 14px; --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 75, .05), 0 1px 1px rgba(11, 31, 75, .03);
  --shadow: 0 10px 30px rgba(11, 31, 75, .10);
}
body { background: var(--paper); }
h1 { color: var(--navy); font-weight: 800; letter-spacing: -.8px; }
h2 { color: var(--navy); }

/* faixa de cor no topo, igual ao PDF */
.workspace::before { content: ""; display: block; height: 6px; background: linear-gradient(90deg, var(--navy) 0 62%, var(--blue) 62% 100%); }

/* trilho lateral */
.rail { background: linear-gradient(180deg, #0b1f4b 0%, #0a1a40 60%, #071431 100%); box-shadow: 4px 0 24px rgba(11, 31, 75, .18); }
.brand img { border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.rail-label { color: #8fa9d4; }
.rail nav button { position: relative; color: #c9d7ee; font-weight: 600; }
.rail nav button:hover { background: rgba(255, 255, 255, .07); }
.rail nav button.active { background: linear-gradient(90deg, var(--blue) 0%, #2b7cf0 100%); box-shadow: 0 6px 18px rgba(11, 99, 216, .40); }
@media (min-width: 761px) {
  .rail::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--blue); }
  .rail nav button.active::before { content: ""; position: absolute; left: -18px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: #7fb2ff; }
}

/* barra superior */
.topbar { background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); }
.topbar-title { font-size: 16px; font-weight: 800; }
.topbar-actions button { border-radius: 999px; }
.topbar-actions .quiet { border: 1px solid var(--line); background: var(--white); }
.topbar-actions .quiet:hover { border-color: var(--blue); background: var(--blue-soft); }

/* cabeçalho de página */
.page-head { padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--blue); letter-spacing: 1.4px; }
.eyebrow::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 8px; vertical-align: middle; border-radius: 2px; background: var(--blue); }

/* botões */
button, .button-link { border-radius: var(--r-sm); }
.primary { background: var(--navy); border-color: var(--navy); box-shadow: 0 2px 6px rgba(11, 31, 75, .18); }
.accent { background: linear-gradient(180deg, #1673ea 0%, var(--blue) 100%); border-color: var(--blue); box-shadow: 0 4px 12px rgba(11, 99, 216, .28); }
.accent:hover { background: var(--blue-dark); }

/* campos */
input, select, textarea { border-radius: var(--r-sm); background-color: #fff; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #9fb3cc; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11, 99, 216, .14); }

/* painéis e cartões */
.panel { border-radius: var(--r); box-shadow: var(--shadow-sm); }
.panel-head { padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-head h2::before { content: ""; display: inline-block; width: 4px; height: 18px; margin-right: 10px; vertical-align: -3px; border-radius: 2px; background: var(--blue); }
.filterbar { border-radius: var(--r); box-shadow: var(--shadow-sm); }
.empty { background: linear-gradient(180deg, #fbfcff 0%, #f5f8fd 100%); }

/* indicadores do painel */
.metric { border-left: 5px solid var(--line-strong); }
.metric.positive { border-left-color: var(--green); }
.metric.negative { border-left-color: var(--red); }
.metric.balance { background: var(--navy); border-color: var(--navy); border-left: 5px solid var(--blue); }
.metric span { text-transform: uppercase; letter-spacing: .5px; font-size: 12px; }

/* tabelas no estilo do PDF */
@media (min-width: 901px) {
  thead th { background: var(--card); color: var(--navy); border-bottom: 2px solid var(--blue); }
  thead th:first-child { border-top-left-radius: var(--r-sm); }
  thead th:last-child { border-top-right-radius: var(--r-sm); }
  tbody tr:hover td { background: var(--blue-soft); }
}

/* diálogos com faixa de cor */
dialog { border-top: 5px solid var(--blue); }
.dialog-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.accept-dialog .dialog-head { border: 0; }

/* login com as faixas do PDF */
.login-banner { position: relative; background: radial-gradient(120% 90% at 0% 0%, #12408f 0%, var(--navy) 55%, #061230 100%); }
.login-banner::before, .login-banner::after { content: ""; position: absolute; left: 0; right: 0; height: 8px; background: linear-gradient(90deg, var(--navy) 0 62%, var(--blue) 62% 100%); }
.login-banner::before { top: 0; }
.login-banner::after { bottom: 0; }
#login-form h2 { font-weight: 800; }
#login-btn { background: linear-gradient(180deg, #1673ea 0%, var(--blue) 100%); box-shadow: 0 6px 16px rgba(11, 99, 216, .3); }

@media (max-width: 760px) {
  .workspace::before { height: 4px; }
  .page-head { padding-bottom: 14px; margin-bottom: 18px; }
  .rail nav button.active { background: var(--blue); }
}
