/* ===== Base / tema ===== */
:root {
  --bg: #0b0e14;
  --bg-2: #141922;
  --bg-3: #1b222c;
  --line: #262e3a;
  --line-soft: #1f2732;
  --txt: #e8eef5;
  --txt-dim: #92a0b0;
  --accent: #3b8eea;
  --accent-2: #2570d3;
  --green: #2ea043;
  --amber: #d29922;
  --cyan: #39c5cf;
  --red: #f85149;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(59,142,234,.06), transparent 60%),
    var(--bg);
  color: var(--txt);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== Ícones + refinamentos visuais ===== */
.ic { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
::selection { background: rgba(59,142,234,.3); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #33404f; background-clip: content-box; }

/* ===== Layout: menu lateral + conteúdo ===== */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
body.loading .app-shell { display: none; }

.sidebar {
  width: 232px; flex-shrink: 0; background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 4px 6px 16px; }
.brand-txt { min-width: 0; }
.brand-txt strong { display: block; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase;
  color: var(--txt-dim); opacity: .65; padding: 0 10px 6px;
}
.sidebar-foot {
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.sidebar .conn { padding: 0 4px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-sm);
}
.brand strong { display: block; font-size: 16px; line-height: 1.15; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--txt-dim); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-dim); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); transition: background .3s; }
.conn.online .dot { background: var(--green); }
.conn.offline .dot { background: var(--red); }

/* ===== Botões ===== */
.btn {
  font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-3); color: var(--txt);
  cursor: pointer; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn-primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent); }
.btn-icon { background: none; border: none; color: var(--txt-dim); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.btn-icon:hover { background: var(--bg-3); color: var(--txt); }

/* ===== Navegação ===== */
.nav-tab {
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 10px;
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 10px; border-radius: var(--radius-sm);
  border: none; background: none; color: var(--txt-dim); cursor: pointer; transition: all .15s;
  text-align: left;
}
.nav-tab .ic { opacity: .75; flex-shrink: 0; }
.nav-tab:hover { color: var(--txt); background: var(--bg-3); }
.nav-tab.active { color: #fff; background: var(--bg-3); }
.nav-tab.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-tab.active .ic { opacity: 1; color: var(--accent); }
/* Contador de pedidos online pendentes */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,81,73,.5); }
  50% { box-shadow: 0 0 0 5px rgba(248,81,73,0); }
}

/* ===== Conteúdo / views ===== */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; display: flex; flex-direction: column; }
.view[hidden] { display: none; }
.view-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 24px 6px; flex-wrap: wrap;
}
/* Cabeçalho de cada tela */
.view-head { padding: 22px 24px 0; }
.view-head h1 { font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.view-head p { font-size: 13px; color: var(--txt-dim); margin-top: 3px; }
.view-head + .view-toolbar { padding-top: 14px; }
.datebar { display: flex; align-items: center; gap: 8px; }
.datebar label { font-size: 13px; color: var(--txt-dim); font-weight: 600; }
.datebar input {
  font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 9px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--txt); color-scheme: dark;
}

/* ===== Stats ===== */
.stats { display: flex; gap: 12px; padding: 0; flex-wrap: wrap; }
/* Quando os números ficam soltos na tela (fora da barra de ações),
   seguem o mesmo recuo do título e das listas. */
.view > .stats { padding: 6px 24px 4px; }
.stat {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px; display: flex; flex-direction: column; min-width: 120px;
}
.stat-num { font-size: 22px; font-weight: 700; }
.stat-lbl { font-size: 12px; color: var(--txt-dim); }
.stat-in .stat-num { color: var(--green); }
.stat-out .stat-num { color: var(--red); }
.stat-saldo .stat-num { color: var(--accent); }

/* ===== Caixa: lista de movimentos ===== */
.caixa-list {
  padding: 10px 24px 28px; display: flex; flex-direction: column; gap: 8px;
  max-width: 760px; width: 100%;
}
.mov {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  border-left-width: 3px;
}
.mov-in { border-left-color: var(--green); }
.mov-out { border-left-color: var(--red); }
.mov-icon { font-size: 18px; }
.mov-mid { flex: 1; min-width: 0; }
.mov-desc { font-size: 14px; font-weight: 600; }
.mov-sub { font-size: 12px; color: var(--txt-dim); margin-top: 2px; }
.mov-forma { margin-left: 4px; }
.mov-valor { font-weight: 700; font-size: 15px; white-space: nowrap; }
.mov-in .mov-valor { color: var(--green); }
.mov-out .mov-valor { color: var(--red); }
.mov-del {
  background: none; border: none; color: var(--txt-dim); cursor: pointer; font-size: 14px;
  padding: 4px 8px; border-radius: 6px;
}
.mov-del:hover { background: var(--bg-3); color: var(--red); }

/* ===== Agenda ===== */
.btn-nav { padding: 8px 12px; font-size: 16px; line-height: 1; }
.agenda-list { padding: 10px 24px 28px; display: flex; flex-direction: column; gap: 8px; max-width: 780px; width: 100%; }
.ag-row {
  display: flex; align-items: stretch; gap: 14px; padding: 12px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
}
.ag-row.off { opacity: .5; }
.ag-hora {
  font-size: 18px; font-weight: 700; color: var(--accent); min-width: 52px;
  display: flex; align-items: center;
}
.ag-mid { flex: 1; min-width: 0; }
.ag-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-cliente { font-size: 15px; font-weight: 600; }
.ag-placa { font-size: 13px; font-weight: 700; letter-spacing: .5px; background: var(--bg); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; }
.ag-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.st-ag { background: rgba(154,167,180,.15); color: var(--txt-dim); }
.st-cf { background: rgba(57,197,207,.15); color: var(--cyan); }
.st-ok { background: rgba(46,160,67,.15); color: var(--green); }
.st-cc { background: rgba(248,81,73,.15); color: var(--red); }
.ag-servicos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ag-obs { font-size: 12px; color: var(--txt-dim); margin-top: 5px; }
.ag-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.ag-valor { font-weight: 700; font-size: 15px; white-space: nowrap; }
.ag-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ===== Cadastros ===== */
.subnav { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.subtab {
  font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 7px; cursor: pointer;
  background: none; border: none; color: var(--txt-dim);
}
.subtab:hover { color: var(--txt); }
.subtab.active { background: var(--bg-3); color: #fff; font-weight: 600; }

.cad-list { padding: 10px 24px 28px; display: flex; flex-direction: column; gap: 8px; max-width: 760px; width: 100%; }
.cad-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
}
.cad-row.off { opacity: .55; }
.cad-main { flex: 1; min-width: 0; }
.cad-nome { font-size: 15px; font-weight: 600; }
.cad-sub { font-size: 12px; color: var(--txt-dim); margin-top: 2px; }
.cad-actions { display: flex; gap: 6px; }
.badge-off {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: var(--bg-3); color: var(--txt-dim); padding: 2px 6px; border-radius: 5px; margin-left: 4px;
}
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 4px 0; }
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ===== Seletor de categoria de veículo ===== */
.cat-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-btn {
  font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 9px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
}
.cat-btn:hover { border-color: var(--accent); }
.cat-btn.sel { background: var(--accent-2); border-color: var(--accent-2); color: #fff; font-weight: 600; }
.serv-item.serv-off { opacity: .5; }

/* ===== Matriz de preços ===== */
.matriz-hint { padding: 4px 24px 10px; color: var(--txt-dim); font-size: 13px; max-width: 900px; }
.matriz-wrap { padding: 0 24px 28px; overflow-x: auto; max-width: 100%; }
.matriz { border-collapse: separate; border-spacing: 0; min-width: 520px; }
.matriz th, .matriz td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 10px 12px; text-align: center; }
.matriz thead th { background: var(--bg-2); font-size: 13px; color: var(--txt-dim); position: sticky; top: 0; }
.matriz th:first-child, .matriz td:first-child { border-left: 1px solid var(--line); }
.matriz thead th:first-child { text-align: left; }
.matriz tbody tr:first-child td { border-top: 1px solid var(--line); }
.m-serv { text-align: left; font-weight: 600; font-size: 14px; background: var(--bg-2); white-space: nowrap; }
.m-cell { cursor: pointer; min-width: 92px; }
.m-cell:hover { background: var(--bg-3); }
.m-preco { font-weight: 700; font-size: 14px; }
.m-com { font-size: 11px; color: var(--txt-dim); margin-top: 2px; }
.m-empty { color: var(--txt-dim); font-size: 12px; opacity: .7; }
.preco-ctx { padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }

/* ===== Comissão ===== */
.periodo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.presets { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.preset {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 7px; cursor: pointer;
  background: none; border: none; color: var(--txt-dim);
}
.preset:hover { color: var(--txt); }
.preset.active { background: var(--bg-3); color: #fff; font-weight: 600; }

.comissao-list { padding: 10px 24px 28px; display: flex; flex-direction: column; gap: 8px; max-width: 760px; width: 100%; }
.com-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
}
.com-rank {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  background: var(--bg-3); color: var(--txt-dim); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.com-row:first-child .com-rank { background: var(--accent-2); color: #fff; }
.com-mid { flex: 1; min-width: 0; }
.com-nome { font-size: 15px; font-weight: 600; }
.com-bar { height: 6px; background: var(--bg); border-radius: 4px; margin: 7px 0; overflow: hidden; }
.com-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.com-sub { font-size: 12px; color: var(--txt-dim); }
.com-valor { font-size: 18px; font-weight: 700; color: var(--green); white-space: nowrap; }

/* ===== Fidelidade ===== */
.fid-config { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.fid-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--txt-dim); }
.fid-meta input { width: 64px; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); color: var(--txt); text-align: center; }
.fid-list { padding: 10px 24px 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; max-width: 1000px; }
.fid-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fid-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fid-nome { font-size: 15px; font-weight: 600; }
.fid-sub { font-size: 12px; color: var(--txt-dim); margin-top: 2px; }
.fid-count { font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.fid-badge { font-size: 11px; font-weight: 700; background: rgba(46,160,67,.15); color: var(--green); padding: 2px 7px; border-radius: 6px; margin-left: 4px; }
.fid-selos { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 5px; }
.selo { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-block; box-sizing: border-box; }
.selo.on { background: var(--amber); border-color: var(--amber); }

/* Bloco de fidelidade dentro da Nova OS */
.os-fidelidade {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; background: rgba(210,153,34,.1); border: 1px solid var(--amber); border-radius: 9px;
}
.fid-info { font-size: 13px; }
.fid-premio { color: var(--green); font-weight: 700; }
.fid-aplicar { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.fid-aplicar input { width: 16px; height: 16px; accent-color: var(--green); }

/* ===== Painel de Relatórios ===== */
.rel-stats { padding: 6px 24px 4px; }
.rel-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  padding: 10px 24px 28px; max-width: 1100px;
}
.rel-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.rel-card.rel-wide { grid-column: 1 / -1; }
.rel-card h3 { font-size: 14px; color: var(--txt-dim); margin-bottom: 14px; font-weight: 600; }
.chart { min-height: 60px; }
.chart-empty { color: var(--txt-dim); font-size: 13px; padding: 18px 0; text-align: center; opacity: .7; }

/* Barras horizontais */
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-label { font-size: 13px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--bg); border-radius: 5px; height: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; transition: width .35s ease; }
.bar-fill.top { background: var(--green); }
.bar-val { font-size: 13px; font-weight: 700; white-space: nowrap; text-align: right; }
.bar-sub { font-size: 11px; color: var(--txt-dim); font-weight: 400; margin-left: 5px; }

/* Colunas verticais */
.cols { display: flex; align-items: flex-end; gap: 8px; height: 180px; overflow-x: auto; padding-top: 8px; }
.col-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; min-width: 34px; height: 100%; }
.col-val { font-size: 10px; color: var(--txt-dim); margin-bottom: 4px; white-space: nowrap; height: 14px; }
.col-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.col-bar { width: 60%; max-width: 34px; background: var(--accent); border-radius: 5px 5px 0 0; transition: height .35s ease; }
.col-lbl { font-size: 11px; color: var(--txt-dim); margin-top: 6px; white-space: nowrap; }

@media (max-width: 720px) {
  .rel-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr auto; }
}

/* ===== Modal pagamento ===== */
.modal-sm { max-width: 420px; }
.pag-info {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.pag-placa { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.pag-total { font-size: 22px; color: var(--green); }
.pag-formas { display: flex; gap: 8px; }
.pag-forma {
  flex: 1; font: inherit; font-size: 14px; padding: 14px 8px; border-radius: 10px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pag-forma:hover { border-color: var(--accent); }
.pag-forma.sel { border-color: var(--accent); background: var(--accent-2); color: #fff; font-weight: 600; }
.pag-servicos { font-size: 13px; color: var(--txt-dim); text-align: right; max-width: 60%; }

/* Escolher pessoa (lavador / quem entrega) */
.pick-lista { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  font: inherit; font-size: 14px; padding: 10px 14px; border-radius: 999px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
}
.pick:hover { border-color: var(--accent); }
.pick.sel { border-color: var(--accent); background: var(--accent-2); color: #fff; font-weight: 600; }
.pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-vazio { font-size: 13px; color: var(--txt-dim); }

/* ===== Escala de lavadores ===== */
.modo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.modo-opt {
  display: grid; gap: 3px; padding: 12px 14px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.modo-opt:hover { border-color: var(--accent); }
.modo-opt.sel { border-color: var(--accent); background: var(--accent-2); color: #fff; }
.modo-opt input { margin-bottom: 4px; }
.modo-opt span { font-size: 12px; opacity: .85; }

.escala-resumo { display: flex; flex-wrap: wrap; gap: 8px; }
.dia-cap {
  display: grid; justify-items: center; gap: 2px; min-width: 46px; padding: 8px 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 16px; font-weight: 700;
}
.dia-cap strong { font-size: 11px; font-weight: 600; color: var(--txt-dim); }
.dia-cap.zero { color: var(--amber); border-color: var(--amber); }

.escala-lista { display: grid; gap: 10px; margin-top: 12px; }
.escala-linha {
  display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 12px; align-items: start;
  padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.escala-nome { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.escala-nome .ic { flex: none; color: var(--accent); }
.escala-turnos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.turno-chip {
  font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--txt);
}
.turno-chip strong { color: var(--accent); margin-right: 4px; }
.turno-chip:hover { border-color: var(--red); color: var(--red); }
.turno-chip:hover strong { color: var(--red); }

.folga-lista { display: grid; gap: 8px; margin-top: 12px; }
.folga-linha {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 13px;
}

.dias-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.dia-opt {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 11px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.dia-opt:hover { border-color: var(--accent); }

.hint-alerta { color: var(--amber); font-weight: 600; }

/* Ocupação nos horários da agenda */
.slot-vagas { display: block; font-size: 10px; opacity: .8; margin-top: 2px; }
.slot.cheio { opacity: .45; cursor: not-allowed; }

/* ===== Board (kanban) ===== */
.board {
  flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  padding: 10px 24px 28px; overflow-x: auto;
}
.col {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; min-width: 240px; min-height: 200px;
}
.col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.col-title { font-weight: 600; font-size: 14px; }
.col-count {
  background: var(--bg-3); color: var(--txt-dim); font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 20px;
}
.col[data-status="aguardando"] .col-title { color: var(--txt-dim); }
.col[data-status="lavando"]    .col-title { color: var(--cyan); }
.col[data-status="pronto"]     .col-title { color: var(--amber); }
.col[data-status="entregue"]   .col-title { color: var(--green); }
.col-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }

/* ===== Card OS ===== */
.card {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; box-shadow: var(--shadow); animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-placa { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.card-time { font-size: 11px; color: var(--txt-dim); white-space: nowrap; }
.card-modelo { font-size: 13px; color: var(--txt-dim); margin-top: 2px; }
.card-cliente { font-size: 12px; color: var(--txt-dim); margin-top: 4px; }
.card-pessoa {
  font-size: 12px; color: var(--txt-dim); margin-top: 4px;
  display: flex; align-items: center; gap: 5px; min-width: 0;
}
.card-pessoa span, .card-pessoa { overflow-wrap: anywhere; }
.card-pessoa .ic { flex: none; color: var(--accent); }
.card-pessoa-vazio .ic { color: var(--amber); }
.card-servicos { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 11px; background: var(--bg); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 6px; color: var(--txt-dim);
}
.card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.card-total { font-weight: 700; font-size: 15px; }
.card-actions { display: flex; gap: 6px; }
.btn-mini {
  font: inherit; font-size: 12px; padding: 5px 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--txt);
}
.btn-mini:hover { filter: brightness(1.2); }
.btn-mini.go { background: var(--accent-2); border-color: var(--accent-2); color: #fff; font-weight: 600; }
.btn-mini.done { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.col-empty { color: var(--txt-dim); font-size: 13px; text-align: center; padding: 24px 8px; opacity: .7; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
/* Respeita o atributo hidden (o [hidden] tem mais especificidade que .modal-overlay) */
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--txt-dim); font-weight: 600; }
.field input, .field select {
  font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 9px;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
#fPlaca { text-transform: uppercase; }

.servicos-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.serv-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
}
.serv-item:hover { border-color: var(--accent); }
.serv-item input { width: 17px; height: 17px; accent-color: var(--accent); }
.serv-item .serv-nome { flex: 1; font-size: 14px; }
.serv-item .serv-preco { font-size: 13px; color: var(--txt-dim); font-weight: 600; }

.modal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; flex-wrap: wrap; gap: 10px; }
.total-line { font-size: 14px; color: var(--txt-dim); }
.total-line strong { color: var(--txt); font-size: 17px; }
.foot-actions { display: flex; gap: 10px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--line); color: var(--txt);
  padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100;
  font-size: 14px; animation: pop .2s ease;
}
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }

/* ===== Refinamentos com ícones ===== */
.pag-forma { flex-direction: column; gap: 6px; }
.pag-forma .ic { color: var(--txt-dim); }
.pag-forma.sel .ic { color: #fff; }
.pag-lbl { font-size: 13px; }

.mov-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--bg-3); color: var(--txt-dim); }
.mov-icon.in { color: var(--green); background: rgba(46,160,67,.12); }
.mov-icon.out { color: var(--red); background: rgba(248,81,73,.12); }
.mov-forma { display: inline-flex; align-items: center; gap: 4px; }

.tag-pago { display: inline-flex; align-items: center; gap: 4px; color: var(--green); border-color: rgba(46,160,67,.35); }
.card-cliente { display: flex; align-items: center; gap: 5px; }
.card-cliente .ic { opacity: .8; }
.fid-info { display: inline-flex; align-items: center; gap: 7px; }
.os-fidelidade .ic { color: var(--amber); }
.bar-label, .col-lbl { display: flex; align-items: center; }

/* ===== Polimento geral ===== */
.btn { transition: filter .15s, background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 2px 10px rgba(37,112,211,.3); }

.card { transition: border-color .15s, transform .12s, box-shadow .15s; }
.card:hover { border-color: #33404f; transform: translateY(-1px); }

.stat { position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .5; }
.stat-in::before { background: var(--green); }
.stat-out::before { background: var(--red); }
.stat-saldo::before { background: var(--accent); }

.rel-card { box-shadow: var(--shadow-sm); }
.rel-card h3 { display: flex; align-items: center; gap: 7px; }
.mov, .cad-row, .ag-row, .com-row, .fid-card { box-shadow: var(--shadow-sm); transition: border-color .15s; }
.mov:hover, .cad-row:hover, .ag-row:hover, .com-row:hover, .fid-card:hover { border-color: #33404f; }

.modal { box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.col-empty { line-height: 1.5; }
input:focus, select:focus { outline: none; box-shadow: 0 0 0 3px rgba(59,142,234,.15); }

.backup-geral-status {
  margin: 0 24px 6px; padding: 10px 14px; border-radius: 9px; font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--txt-dim); max-width: 700px;
}
.backup-geral-status[hidden] { display: none; }
.backup-geral-status.ok { color: var(--green); border-color: rgba(46,160,67,.35); }
.backup-geral-status.erro { color: var(--red); border-color: rgba(248,81,73,.35); }

/* ===== Relatório de faturas (imprimível) ===== */
.fat-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.fat-periodo { font-size: 12px; color: var(--txt-dim); margin-left: 4px; }
.rel-papel {
  background: #fff; color: #1a1a1a; border-radius: 10px; padding: 22px;
  font-size: 13px; line-height: 1.5;
}
.rp-head { text-align: center; border-bottom: 2px solid #333; padding-bottom: 12px; margin-bottom: 14px; }
.rp-titulo { font-size: 17px; font-weight: 700; }
.rp-sub { font-size: 12px; color: #666; margin-top: 2px; }
.rp-resumo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.rp-resumo div { text-align: center; padding: 8px 4px; background: #f4f5f7; border-radius: 7px; }
.rp-resumo span { display: block; font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: .3px; }
.rp-resumo strong { font-size: 14px; }
.rp-tabela { width: 100%; border-collapse: collapse; font-size: 12px; }
.rp-tabela th { text-align: left; border-bottom: 1.5px solid #333; padding: 7px 6px; font-size: 11px; text-transform: uppercase; color: #555; }
.rp-tabela td { border-bottom: 1px solid #e3e5e8; padding: 7px 6px; }
.rp-num { text-align: right; }
.rp-paga { color: #1a7f37; }
.rp-rodape { margin-top: 14px; font-size: 11px; color: #666; text-align: center; }
@media (max-width: 560px) { .rp-resumo { grid-template-columns: repeat(2, 1fr); } }

/* ===== Área do cliente ===== */
.cli-fid {
  background: var(--bg); border: 1px solid rgba(210,153,34,.35); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 16px;
}
.cli-fid-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--txt-dim); margin-bottom: 10px; }
.cli-fid-top strong { font-size: 17px; color: var(--amber); }
.cli-fid-msg { font-size: 13px; color: var(--txt-dim); margin-top: 10px; line-height: 1.5; }
.cli-fid-msg strong { color: var(--green); }
.cli-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; margin-bottom: 7px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.cli-item-t { font-size: 14px; font-weight: 600; }
.cli-item-s { font-size: 12px; color: var(--txt-dim); margin-top: 2px; overflow-wrap: anywhere; }
.cli-item-dir { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cli-item-v { font-size: 14px; font-weight: 700; white-space: nowrap; }
#cliPainel .pub-step h2 { margin-bottom: 10px; }

/* ===== Equipe e acessos ===== */
.equipe-topo { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.equipe-sec {
  font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--txt-dim); margin: 18px 0 8px;
}
.papel-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 5px; margin-left: 6px;
}
.papel-dono      { background: rgba(46,160,67,.15);  color: var(--green); }
.papel-gerente   { background: rgba(59,142,234,.15); color: var(--accent); }
.papel-atendente { background: var(--bg-3);          color: var(--txt-dim); }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.perm-chip {
  font-size: 10.5px; background: var(--bg); border: 1px solid var(--line);
  color: var(--txt-dim); padding: 2px 7px; border-radius: 5px;
}
.perm-chip.perm-tudo { color: var(--green); border-color: rgba(46,160,67,.35); }
.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.perm-item {
  display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px;
  padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.perm-item:hover { border-color: var(--accent); }
.perm-item input { width: 16px; height: 16px; accent-color: var(--accent); }
.perm-item.perm-off { opacity: .55; cursor: default; }
@media (max-width: 480px) { .perm-grid { grid-template-columns: 1fr; } }

/* ===== Cadastro em análise / recusado ===== */
.pendente-card { text-align: center; max-width: 420px; }
.pendente-card .auth-mark { margin: 0 auto 16px; }
.pend-txt { font-size: 14px; color: var(--txt-dim); line-height: 1.6; margin: 10px 0 16px; }
.pend-empresa {
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
  padding: 14px; font-size: 14px; line-height: 1.5; margin-bottom: 18px;
}
.auth-dica { font-size: 11.5px; color: var(--txt-dim); margin-top: 2px; }

/* ===== Aprovações (fundador) ===== */
.aprov-card { border-left: 3px solid var(--amber); }
.aprov-dados {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.aprov-dados div { min-width: 0; }
.aprov-dados span { display: block; font-size: 10.5px; color: var(--txt-dim); text-transform: uppercase; letter-spacing: .4px; }
.aprov-dados strong { font-size: 13.5px; overflow-wrap: anywhere; }
.aprov-acoes { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 480px) { .aprov-dados { grid-template-columns: 1fr; } }

/* ===== Retorno de clientes (quem sumiu) ===== */
#fidRetorno .stats { padding: 6px 24px 4px; }
.ret-msg-box {
  margin: 4px 24px 8px; padding: 14px 16px; max-width: 760px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.ret-msg-box .txtarea { width: 100%; }
.ret-msg-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.ret-dica { font-size: 12px; color: var(--txt-dim); }
.ret-list { padding: 10px 24px 28px; display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.ret-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; flex-wrap: wrap; row-gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  border-left: 3px solid var(--amber); box-shadow: var(--shadow-sm); overflow: hidden;
}
.ret-row.off { opacity: .55; border-left-color: var(--line); }
.ret-mid { flex: 1; min-width: 0; }
.ret-nome { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ret-sub { font-size: 12px; color: var(--txt-dim); margin-top: 2px; overflow-wrap: anywhere; }
.ret-dias { text-align: center; flex-shrink: 0; }
.ret-dias strong { display: block; font-size: 19px; color: var(--amber); }
.ret-dias span { font-size: 10.5px; color: var(--txt-dim); }
.ret-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: var(--bg-3); color: var(--txt-dim); padding: 2px 7px; border-radius: 5px; margin-left: 6px;
}
.btn-convidar { background: #25d366; border-color: #25d366; color: #04270f; font-weight: 700; flex-shrink: 0; }
.btn-convidar:hover { filter: brightness(1.08); }
@media (max-width: 900px) { .ret-msg-box { margin-left: 16px; margin-right: 16px; } #fidRetorno .stats, .ret-list { padding-left: 16px; padding-right: 16px; } }

/* ===== Busca e ficha do cliente/veículo ===== */
.busca-box { padding: 0 6px 14px; }
.busca-box input {
  width: 100%; font: inherit; font-size: 13px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
}
.busca-box input::placeholder { color: var(--txt-dim); }
.busca-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,142,234,.15); }

.busca-sec {
  font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--txt-dim); margin: 6px 0 6px;
}
.busca-item {
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px;
  padding: 11px 13px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
}
.busca-item:hover { border-color: var(--accent); background: var(--bg-3); }
.busca-placa { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.busca-nome { font-size: 15px; font-weight: 600; }
.busca-sub { font-size: 12px; color: var(--txt-dim); }

.ficha-topo { padding-bottom: 4px; }
.ficha-nome { font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.ficha-sub { font-size: 13px; color: var(--txt-dim); margin-top: 2px; }
.ficha-nums {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 13px 10px;
}
.ficha-nums div { text-align: center; min-width: 0; }
.ficha-nums strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.ficha-nums span { font-size: 10.5px; color: var(--txt-dim); }
.ficha-titulo {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--txt-dim); margin-top: 4px;
}
.ficha-carros { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-link { cursor: pointer; font: inherit; font-size: 12px; color: var(--accent); border-color: rgba(59,142,234,.4); }
.tag-link:hover { background: rgba(59,142,234,.12); }
.ficha-fid { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.ficha-fid-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--txt-dim); margin-bottom: 9px; }
.ficha-fid-top strong { color: var(--amber); }
.ficha-hist { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.ficha-os {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
}
.ficha-os-esq { min-width: 0; }
.ficha-os-data { font-size: 13px; font-weight: 600; }
.ficha-os-sub { font-size: 11.5px; color: var(--txt-dim); overflow-wrap: anywhere; }
.ficha-os-val { font-size: 14px; font-weight: 700; white-space: nowrap; text-align: right; }
.ficha-tag-gratis { font-size: 11px; color: var(--green); font-weight: 700; }
.ficha-tag-andamento { display: block; font-size: 10px; color: var(--cyan); font-weight: 600; }
.ficha-whats { width: 100%; margin-top: 4px; }
@media (max-width: 480px) { .ficha-nums { grid-template-columns: repeat(2, 1fr); } }

/* ===== PWA: instalar e atualizar ===== */
.btn-instalar {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; font-size: 13px; font-weight: 600; padding: 9px;
  background: rgba(59,142,234,.12); border-color: rgba(59,142,234,.4); color: var(--accent);
}
.btn-instalar:hover { background: rgba(59,142,234,.2); }
.btn-instalar[hidden] { display: none; }
.pwa-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 150;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  background: var(--bg-3); border: 1px solid var(--accent); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow); font-size: 14px;
  animation: pop .2s ease;
}
.pwa-bar[hidden] { display: none; }
.pwa-bar span { color: var(--txt); }
.pwa-bar .btn { padding: 7px 14px; font-size: 13px; }

/* Em modo app instalado, respeita as áreas seguras do celular */
@media (display-mode: standalone) {
  .sidebar { padding-top: max(16px, env(safe-area-inset-top)); }
  .content { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* ===== Seletor de unidade (filiais) ===== */
.unidade-sel { padding: 0 6px 12px; }
.unidade-sel[hidden] { display: none; }
.unidade-sel select {
  width: 100%; font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line); color: var(--txt); cursor: pointer;
}
.unidade-sel select:hover { border-color: var(--accent); }
.unidade-sel select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,142,234,.15); }
.card-unidade {
  display: inline-block; margin-top: 5px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt-dim);
  padding: 2px 7px; border-radius: 5px;
}

/* ===== Proteção contra conteúdo vazando das caixas ===== */
/* Textos longos (placa, modelo, nome) quebram em vez de estourar */
.card, .ag-row, .mov, .cad-row, .est-row, .fat-row, .com-row, .fid-card, .fund-card { overflow: hidden; }
.card-placa, .card-modelo, .card-cliente, .tag,
.ag-cliente, .ag-obs, .mov-desc, .cad-nome, .est-nome, .fat-nome, .com-nome, .fid-nome, .fund-nome {
  overflow-wrap: anywhere; min-width: 0;
}
/* Linha de ações do cartão pode quebrar em telas estreitas */
.card-bottom { flex-wrap: wrap; row-gap: 8px; }
.card-actions { flex-wrap: wrap; justify-content: flex-end; }
.card-top { min-width: 0; }
.card-total { white-space: nowrap; }
/* Listas: a coluna do meio pode encolher, os valores não */
.ag-mid, .mov-mid, .cad-main, .est-mid, .fat-mid, .com-mid { min-width: 0; }
.ag-right, .est-qtd, .fat-valor, .com-valor, .mov-valor { flex-shrink: 0; }
.ag-row, .mov, .cad-row, .est-row, .fat-row { flex-wrap: wrap; row-gap: 8px; }
.ag-actions, .cad-actions, .est-actions { flex-wrap: wrap; }

/* ===== Acabamento visual ===== */
/* Colunas do pátio com faixa de cor no topo */
.col { overflow: hidden; position: relative; }
.col::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.col[data-status="aguardando"]::before { background: var(--txt-dim); opacity: .5; }
.col[data-status="lavando"]::before   { background: var(--cyan); }
.col[data-status="pronto"]::before    { background: var(--amber); }
.col[data-status="entregue"]::before  { background: var(--green); }
.col-head { padding-top: 14px; }

/* Estados vazios mais agradáveis */
.col-empty {
  color: var(--txt-dim); font-size: 13px; text-align: center;
  padding: 28px 16px; opacity: .75; line-height: 1.5;
  border: 1px dashed var(--line); border-radius: 10px; background: rgba(255,255,255,.012);
}

/* Cartões e listas com respiro e reação consistentes */
.stat { transition: border-color .15s, transform .12s; }
.stat:hover { border-color: #33404f; }
.col { background: var(--bg-2); }
.col-body { padding: 12px; }

/* Título de seção dentro dos painéis */
.rel-card h3, .backup-card h3 { letter-spacing: .2px; }

/* Barra de rolagem some quando não precisa */
.content { padding-bottom: 8px; }

/* ===== Responsivo ===== */
@media (max-width: 1000px) {
  .board { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}

/* Menu lateral vira barra no topo em telas pequenas */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 20;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 10px 12px; gap: 8px;
  }
  .sidebar .brand { padding: 0 4px; }
  .sidebar .nav {
    flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .sidebar .nav::-webkit-scrollbar { display: none; }
  .nav-group { flex-direction: row; gap: 4px; }
  .nav-group-title { display: none; }
  .nav-tab { width: auto; white-space: nowrap; padding: 8px 12px; }
  .nav-tab.active::before { left: 0; top: auto; bottom: -4px; transform: none; width: 100%; height: 2px; border-radius: 2px; }
  .sidebar-foot {
    border-top: none; margin: 0; padding: 0;
    position: absolute; top: 12px; right: 12px;
    flex-direction: row; align-items: center; gap: 10px;
  }
  .sidebar-foot .conn .conn-txt { display: none; }
  .user-chip { max-width: 110px; }
  /* Todo o conteúdo acompanha o mesmo recuo lateral */
  .view-head, .view-toolbar, .view > .stats,
  .board, .caixa-list, .agenda-list, .cad-list, .comissao-list, .fid-list,
  .estoque-list, .fund-list, .rel-grid, .rel-stats, .fund-stats,
  .matriz-hint, .matriz-wrap, #fundFaturas .stats {
    padding-left: 16px; padding-right: 16px;
  }
}

@media (max-width: 560px) {
  .field-row { flex-direction: column; }
  .user-chip { display: none; }
  .view-head h1 { font-size: 19px; }
}

/* ============================================================
   CELULAR — barra de abas embaixo, uma coluna do pátio por vez,
   modais como folha deslizante. O atendente usa com uma mão só.
   ============================================================ */
.barra-mobile { display: none; }
.board-abas { display: none; }
.sheet-overlay { display: none; }

@media (max-width: 900px) {
  /* O menu do topo fica só com marca, busca e sair — navegar é pela barra de baixo */
  .sidebar .nav { display: none; }
  .sidebar { padding: 8px 12px; gap: 6px; }
  .sidebar .brand { padding: 0; }
  .brand-txt strong { font-size: 15px; }

  /* Espaço para a barra não tapar o fim da página */
  .content { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

  .barra-mobile {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--bg-2); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 20px rgba(0,0,0,.28);
  }
  .barra-mobile[hidden] { display: none; }
  .aba-mob {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font: inherit; font-size: 11px; font-weight: 600; min-height: 52px; padding: 6px 2px;
    background: none; border: none; color: var(--txt-dim); cursor: pointer; border-radius: 10px;
  }
  .aba-mob .ic { color: currentColor; }
  .aba-mob.active { color: var(--accent); background: rgba(59,142,234,.10); }
  .aba-mob span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

  /* Folha "Mais" */
  .sheet-overlay {
    display: flex; align-items: flex-end;
    position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.55);
  }
  .sheet-overlay[hidden] { display: none; }
  .sheet {
    width: 100%; background: var(--bg-2); border-top-left-radius: 18px; border-top-right-radius: 18px;
    padding: 10px 18px calc(24px + env(safe-area-inset-bottom, 0px));
    max-height: 80vh; overflow-y: auto;
  }
  .sheet-alca { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .sheet-item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font: inherit; font-size: 12px; padding: 16px 8px; cursor: pointer;
    background: var(--bg); border: 1px solid var(--line); border-radius: 12px; color: var(--txt);
  }
  .sheet-item .ic { color: var(--accent); }

  /* Pátio: uma coluna por vez, escolhida pelas abas */
  .board-abas {
    display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 4px;
    scrollbar-width: none;
  }
  .board-abas::-webkit-scrollbar { display: none; }
  .board-aba {
    font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
    padding: 9px 14px; border-radius: 999px; min-height: 40px;
    background: var(--bg-2); border: 1px solid var(--line); color: var(--txt-dim);
  }
  .board-aba span {
    display: inline-block; margin-left: 5px; padding: 1px 7px; border-radius: 999px;
    background: var(--bg); font-size: 11px;
  }
  .board-aba.active { color: #fff; background: var(--accent-2); border-color: var(--accent); }
  .board-aba.active span { background: rgba(255,255,255,.22); }

  .board { grid-template-columns: 1fr; }
  .board .col { display: none; }
  .board[data-col="aguardando"] .col[data-status="aguardando"],
  .board[data-col="lavando"]    .col[data-status="lavando"],
  .board[data-col="pronto"]     .col[data-status="pronto"],
  .board[data-col="entregue"]   .col[data-status="entregue"] { display: flex; }
  .board .col-head { display: none; } /* a aba já diz qual coluna é */

  /* Alvos de toque maiores — mão molhada, tela pequena */
  .btn, .btn-mini, .subtab, .pag-forma, .pick, .cat-btn { min-height: 40px; }
  .btn-mini { padding: 9px 13px; font-size: 13px; }
  .btn-mini.icon-only { min-width: 40px; }
  .card-actions { gap: 8px; }
  input, select, textarea { font-size: 16px; } /* abaixo de 16px o iPhone dá zoom sozinho */

  /* Modais viram folha deslizante, com o rodapé sempre à vista */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay .modal {
    width: 100%; max-width: 100%; max-height: 92vh;
    border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  }
  .modal-head { position: sticky; top: 0; z-index: 2; background: var(--bg-2); }
  .modal-body { overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .modal-foot {
    position: sticky; bottom: 0; background: var(--bg-2);
    padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line);
  }
  .foot-actions { display: flex; gap: 8px; }
  .foot-actions .btn { flex: 1; }

  /* Números e tabelas que não cabem lado a lado */
  .stats, .stats-full { grid-template-columns: repeat(2, 1fr); display: grid; }
  .stats-full { padding-left: 16px; padding-right: 16px; }
  .view-toolbar { gap: 10px; }
  .view-toolbar .btn-primary { flex: 1; }
}

@media (max-width: 400px) {
  .sheet-grid { grid-template-columns: repeat(2, 1fr); }
  .stats, .stats-full { grid-template-columns: 1fr; }
}

/* ===== Login / Auth ===== */
body.loading .app-shell { display: none; }
/* Respeitar o atributo hidden (regras de autor sobrepõem o [hidden] do user-agent) */
.auth-screen[hidden], .os-fidelidade[hidden], .field[hidden] { display: none; }
.auth-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(59,142,234,.14), transparent 60%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 26px; box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 13px; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-sm);
}
.auth-brand strong { display: block; font-size: 18px; }
.auth-tagline { font-size: 12px; color: var(--txt-dim); }
.auth-tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 18px; }
.auth-tab { flex: 1; font: inherit; font-size: 14px; font-weight: 600; padding: 9px; border-radius: 8px; border: none; background: none; color: var(--txt-dim); cursor: pointer; }
.auth-tab.active { background: var(--bg-3); color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-submit { margin-top: 4px; padding: 12px; font-size: 15px; }
.auth-err { font-size: 13px; color: var(--red); background: rgba(248,81,73,.1); border: 1px solid rgba(248,81,73,.3); border-radius: 8px; padding: 9px 11px; }
.auth-msg { font-size: 13px; color: var(--green); background: rgba(46,160,67,.1); border: 1px solid rgba(46,160,67,.3); border-radius: 8px; padding: 9px 11px; }

.user-chip { font-size: 12px; color: var(--txt-dim); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btnLogout { display: inline-flex; align-items: center; color: var(--txt-dim); }
#btnLogout:hover { color: var(--red); }

/* ===== Estoque ===== */
#filtroBaixoWrap { font-size: 13px; color: var(--txt-dim); }
.estoque-list { padding: 10px 24px 28px; display: flex; flex-direction: column; gap: 8px; max-width: 820px; }
.est-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm);
  border-left-width: 3px; border-left-color: var(--line);
}
.est-row.alerta { border-left-color: var(--red); }
.est-mid { flex: 1; min-width: 0; }
.est-nome { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.est-sub { font-size: 12px; color: var(--txt-dim); margin-top: 2px; }
.est-qtd { text-align: right; white-space: nowrap; }
.est-qtd strong { font-size: 18px; }
.est-qtd span { font-size: 11px; color: var(--txt-dim); margin-left: 3px; }
.est-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge-baixo {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: rgba(248,81,73,.15); color: var(--red); padding: 2px 6px; border-radius: 5px;
}

/* ===== Painel do Fundador ===== */
.fund-titulo { font-size: 17px; font-weight: 600; }
.fund-stats { padding: 6px 24px 4px; }
.fund-list { padding: 10px 24px 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; max-width: 1100px; }
.fund-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.fund-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fund-nome { font-size: 16px; font-weight: 700; }
.fund-sub { font-size: 12px; color: var(--txt-dim); margin-top: 3px; }
.fund-fat { font-size: 18px; font-weight: 700; color: var(--green); text-align: right; white-space: nowrap; }
.fund-fat span { display: block; font-size: 11px; color: var(--txt-dim); font-weight: 400; }
/* O que EU recebo: número principal do cartão */
.fund-receber { font-size: 22px; font-weight: 800; color: var(--green); text-align: right; white-space: nowrap; line-height: 1.1; }
.fund-receber span { display: block; font-size: 11px; color: var(--txt-dim); font-weight: 400; margin-top: 2px; }
.fund-rodape {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; flex-wrap: wrap;
}
.fund-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.fund-fatcli { font-size: 11.5px; color: var(--txt-dim); }
/* Destaque e discrição nos números do topo */
.stat-destaque { border-color: rgba(46,160,67,.45); }
.stat-destaque .stat-num { font-size: 26px; }
.stat-secundario { opacity: .75; }
.stat-secundario .stat-num { font-size: 17px; color: var(--txt-dim); }
.fund-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.fund-metrics div { text-align: center; }
.fund-metrics strong { display: block; font-size: 17px; }
.fund-metrics span { font-size: 11px; color: var(--txt-dim); }
.fund-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
#fundFaturas .stats { padding: 6px 24px 4px; }
.fat-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.fat-row.off { opacity: .6; }
.fat-mid { flex: 1; min-width: 0; }
.fat-nome { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fat-sub { font-size: 12px; color: var(--txt-dim); margin-top: 3px; }
.fat-valor { font-size: 16px; font-weight: 700; white-space: nowrap; }
.cob-ctx { padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
/* Faturas: lista em coluna única (sobrepõe o grid de .fund-list) */
#faturasList { display: flex; flex-direction: column; max-width: 820px; }

/* Selo de pedido vindo do site (aba Agenda) */
.ag-online {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: rgba(59,142,234,.15); color: var(--accent); padding: 2px 7px; border-radius: 5px;
}
/* Leva e traz na agenda */
.ag-leva {
  display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px;
  color: var(--amber); background: rgba(210,153,34,.1);
  border: 1px solid rgba(210,153,34,.3); border-radius: 7px; padding: 5px 9px;
}
.ag-leva { flex-wrap: wrap; }
.ag-leva strong { font-weight: 700; }
.ag-mapa {
  margin-left: auto; font-size: 11px; font-weight: 700; text-decoration: none;
  color: #fff; background: var(--accent-2); padding: 3px 9px; border-radius: 6px; white-space: nowrap;
}
.ag-mapa:hover { background: var(--accent); }

/* Botão de localização (página do cliente) */
.geo-btn { width: 100%; margin-top: 8px; font-size: 13px; padding: 10px; }
.geo-status {
  margin-top: 8px; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 8px;
  background: var(--bg-3); color: var(--txt-dim); border: 1px solid var(--line);
}
.geo-status.ok { color: var(--green); background: rgba(46,160,67,.1); border-color: rgba(46,160,67,.3); }
.geo-status.erro { color: var(--amber); background: rgba(210,153,34,.1); border-color: rgba(210,153,34,.3); }

/* Escolha de atendimento (página do cliente) */
.atend-opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.atend-btn {
  font: inherit; text-align: left; padding: 13px 14px; border-radius: 11px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
  display: flex; flex-direction: column; gap: 4px;
}
.atend-btn:hover { border-color: var(--accent); }
.atend-btn.sel { border-color: var(--accent); background: rgba(59,142,234,.12); }
.atend-btn strong { font-size: 14px; }
.atend-btn span { font-size: 11.5px; color: var(--txt-dim); line-height: 1.35; }
.atend-btn.sel span { color: var(--txt); }
.pub-como { font-size: 13px; color: var(--txt-dim); }
.on-sep { height: 1px; background: var(--line); margin: 18px 0; }
@media (max-width: 420px) { .atend-opcoes { grid-template-columns: 1fr; } }

/* Config do agendamento online (Cadastros) */
.on-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.on-link { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.on-link .pub-input { flex: 1; min-width: 200px; font-size: 13px; }
@media (max-width: 560px) { .on-grid { grid-template-columns: 1fr; } }

/* ===== Página pública de agendamento (cliente) ===== */
.pub-body { display: block; }
.pub-wrap { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 20px 16px 40px; }
.pub-wrap[hidden] { display: none; }
.pub-card {
  width: 100%; max-width: 480px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 24px 22px; box-shadow: var(--shadow);
}
.pub-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.pub-mark {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 13px; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-sm);
}
.pub-titulo { font-size: 19px; font-weight: 700; line-height: 1.2; }
.pub-sub { font-size: 13px; color: var(--txt-dim); }
.pub-step { margin-bottom: 20px; }
.pub-step h2 { font-size: 13px; font-weight: 700; color: var(--txt-dim); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.pub-input {
  width: 100%; font: inherit; font-size: 15px; padding: 12px 13px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt); color-scheme: dark;
}
.pub-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,142,234,.15); }
.pub-input.placa { text-transform: uppercase; letter-spacing: 1px; }
.pub-fields { display: flex; flex-direction: column; gap: 12px; }
.pub-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--txt-dim); font-weight: 600; }
.pub-info { color: var(--txt-dim); font-size: 14px; padding: 10px 0; }
.pub-hint { color: var(--txt-dim); font-size: 12px; margin-top: 8px; }
/* Seleção única de serviço (rádio) na página do cliente */
#pubServicos .serv-item input[type="radio"] { accent-color: var(--accent); }
#pubServicos .serv-item:has(input:checked) { border-color: var(--accent); background: rgba(59,142,234,.1); }
.pub-nota { color: var(--txt-dim); font-size: 12px; text-align: center; margin-top: 12px; line-height: 1.5; }
.pub-total {
  display: flex; align-items: center; justify-content: space-between; margin: 22px 0 14px;
  padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
}
.pub-total span { font-size: 13px; color: var(--txt-dim); }
.pub-total strong { font-size: 21px; color: var(--green); }
.pub-btn { width: 100%; padding: 14px; font-size: 15px; }
.pub-erro {
  font-size: 13px; color: var(--red); background: rgba(248,81,73,.1);
  border: 1px solid rgba(248,81,73,.3); border-radius: 9px; padding: 10px 12px; margin-bottom: 12px;
}
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.slot {
  font: inherit; font-size: 14px; font-weight: 600; padding: 11px 6px; border-radius: 9px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
}
.slot:hover { border-color: var(--accent); }
.slot.sel { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.pub-ok { text-align: center; }
.pub-check {
  width: 66px; height: 66px; margin: 6px auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(46,160,67,.15); color: var(--green);
}
.pub-ok .pub-info { line-height: 1.7; }
.pub-ok .pub-btn { margin-top: 18px; }

/* ===== Backup ===== */
.backup-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; max-width: 560px; box-shadow: var(--shadow-sm);
}
.backup-card h3 { font-size: 16px; margin-bottom: 10px; }
.backup-card p { font-size: 14px; color: var(--txt-dim); line-height: 1.55; margin-bottom: 10px; }
.backup-dica { font-size: 13px !important; border-left: 3px solid var(--amber); padding-left: 12px; }
.backup-status { margin-top: 12px; font-size: 13px; color: var(--txt-dim); }

/* ===== Avisar cliente ===== */
.txtarea {
  font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 9px; resize: vertical;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt); line-height: 1.45;
}
.txtarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,142,234,.15); }
.btn-mini.avisado { color: var(--green); border-color: rgba(46,160,67,.4); }

/* ===== Comprovante ===== */
.btn-mini.icon-only { padding: 5px 7px; display: inline-flex; align-items: center; color: var(--txt-dim); }
.btn-mini.icon-only:hover { color: var(--txt); }
.recibo-paper {
  background: #fff; color: #1a1a1a; border-radius: 10px; padding: 20px 22px;
  font-family: ui-monospace, "SFMono-Regular", "Courier New", monospace; font-size: 13px; line-height: 1.5;
}
.rc-head { text-align: center; margin-bottom: 10px; }
.rc-nome { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.rc-sub { font-size: 11px; color: #666; }
.rc-title { text-align: center; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; color: #666; margin-bottom: 10px; }
.rc-meta { display: flex; justify-content: space-between; font-size: 12px; color: #444; }
.rc-sep { border-top: 1px solid #ddd; margin: 10px 0; }
.rc-sep.dashed { border-top: 1px dashed #bbb; }
.rc-line, .rc-item, .rc-total { display: flex; justify-content: space-between; gap: 12px; }
.rc-line { color: #333; margin: 3px 0; }
.rc-line span:first-child { color: #888; }
.rc-item { margin: 4px 0; }
.rc-total { font-weight: 700; font-size: 15px; margin: 4px 0; }
.rc-foot { text-align: center; font-size: 12px; color: #666; margin-top: 4px; }
.recibo-actions { display: flex; gap: 10px; margin-top: 16px; }
.recibo-actions .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-whats { background: #25d366; border-color: #25d366; color: #04270f; font-weight: 600; }
.btn-whats:hover { filter: brightness(1.08); }

/* ===== Documentos públicos (termos, privacidade) ===== */
.doc-wrap { max-width: 780px; }
.doc-card { text-align: left; }
.doc-card h2 {
  font-size: 16px; margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--line);
}
.doc-card h2:first-of-type { border-top: none; padding-top: 0; }
.doc-card p, .doc-card li { font-size: 14px; line-height: 1.65; color: var(--txt); }
.doc-card ul { margin: 8px 0 8px 20px; display: grid; gap: 6px; }
.doc-card a { color: var(--accent); }
.doc-data { font-size: 12px; color: var(--txt-dim); margin-bottom: 18px; }
.doc-contato { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.doc-aviso {
  margin-top: 22px; padding: 12px 16px; font-size: 13px; color: var(--amber);
  background: var(--bg); border: 1px dashed var(--amber); border-radius: 10px;
}
.doc-rodape { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.auth-legal { margin-top: 14px; font-size: 12px; color: var(--txt-dim); text-align: center; line-height: 1.6; }
.auth-legal a { color: var(--accent); }

/* Restaurar backup */
.restaurar-linha { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.restaurar-linha input[type="file"] {
  flex: 1; min-width: 200px; font: inherit; font-size: 13px; color: var(--txt-dim);
  padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
}

/* ===== Mensalistas ===== */
/* Números ocupando a largura toda, em vez de caixinhas encolhidas à esquerda */
.stats-full {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; padding: 14px 24px 0;
}
.stats-full .stat { min-width: 0; padding: 14px 18px; }
.stats-full .stat-num { font-size: 26px; }

/* Barra de filtro/ação acima de uma lista */
.barra-lista { padding: 14px 24px 10px; }
.barra-info { font-size: 13px; color: var(--txt-dim); overflow-wrap: anywhere; }

/* Estado vazio guiado: diz o que fazer, não só que está vazio */
.vazio-guia {
  margin: 4px 24px 24px; padding: 28px 24px; text-align: center;
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--radius);
}
.vazio-guia h3 { font-size: 16px; margin-bottom: 6px; }
.vazio-guia p { font-size: 13px; color: var(--txt-dim); max-width: 460px; margin: 0 auto 16px; }
.vazio-passos {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 18px;
}
.vazio-passo {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 8px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
}
.vazio-passo b {
  display: grid; place-items: center; width: 20px; height: 20px; flex: none;
  background: var(--accent-2); color: #fff; border-radius: 50%; font-size: 11px;
}
.vazio-passo.feito b { background: var(--green); }
.vazio-passo.feito { color: var(--txt-dim); }


.os-plano {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.os-plano[hidden] { display: none; }
.plano-atraso { color: var(--amber); font-weight: 600; font-size: 12px; }
.plano-trava { font-size: 12px; color: var(--amber); overflow-wrap: anywhere; }

.ass-resultados {
  display: grid; gap: 4px; margin-top: 6px; max-height: 220px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px;
}
.ass-resultados[hidden] { display: none; }
.ass-item {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 6px; background: none; border: none; color: var(--txt);
}
.ass-item:hover { background: var(--accent-2); color: #fff; }
.ass-item span { font-size: 12px; opacity: .8; flex: none; }
.ass-vazio { font-size: 13px; color: var(--txt-dim); padding: 8px 10px; }

/* ===== Resultado dos convites e cupons ===== */
.subtabs-inner { margin-bottom: 16px; }
.res-badge {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt-dim);
}
.res-badge.ok  { color: var(--green); border-color: var(--green); }
.res-badge.nao { color: var(--amber); border-color: var(--amber); }
.res-badge .ic { flex: none; }
.res-cupom {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-2); color: #fff; letter-spacing: .3px;
}
.res-cupom.usado { background: var(--bg); color: var(--txt-dim); border: 1px solid var(--line); }
.cupom-cod { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 1px; }
.cupom-linha { display: flex; gap: 8px; }
.cupom-linha input { flex: 1; text-transform: uppercase; }

/* ===== Fidelidade: opções avançadas ===== */
.fid-avancado { display: grid; gap: 14px; margin-bottom: 20px; }
.fid-avancado[hidden] { display: none; }
.fid-bloco { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.fid-bloco h4 { margin: 0 0 4px; font-size: 15px; }
.fid-bloco textarea { width: 100%; resize: vertical; font: inherit; }
.fid-sub-titulo { margin: 16px 0 8px; font-size: 13px; color: var(--txt-dim); font-weight: 600; }
.fid-servicos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; }
.fid-vencido { color: var(--amber); font-weight: 600; }
.cli-fid-regra { font-size: 12px; opacity: .8; margin-top: 8px; overflow-wrap: anywhere; }

/* ===== Comanda do lavador ===== */
.cm-placa {
  text-align: center; font-size: 30px; font-weight: 800; letter-spacing: 2px;
  margin: 8px 0 2px; overflow-wrap: anywhere;
}
.cm-veiculo { text-align: center; font-size: 13px; color: var(--txt-dim); margin-bottom: 8px; }
.cm-titulo { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--txt-dim); margin: 8px 0 6px; }
.cm-tarefa { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 5px 0; overflow-wrap: anywhere; }
.cm-box { flex: none; width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 2px; }
.cm-obs { font-size: 13px; overflow-wrap: anywhere; }
.cm-assina { font-size: 12px; margin-top: 14px; }

.recibo-cpf { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.recibo-cpf .pub-label { flex: 1; }

@media print {
  body { background: #fff !important; }
  /* imprime só o comprovante, a comanda ou o relatório que estiver aberto */
  body > *:not(#modalRecibo):not(#modalComanda):not(#modalRelFat) { display: none !important; }
  #modalRecibo, #modalComanda, #modalRelFat { position: static; background: none; display: block; padding: 0; height: auto; }
  #modalRecibo[hidden], #modalComanda[hidden], #modalRelFat[hidden] { display: none !important; }
  #modalRecibo .modal, #modalComanda .modal { box-shadow: none; border: none; max-width: 380px; background: #fff; margin: 0 auto; }
  #modalRelFat .modal { box-shadow: none; border: none; max-width: 100%; background: #fff; margin: 0; }
  #modalRecibo .modal-head, #modalComanda .modal-head, #modalRelFat .modal-head,
  .recibo-actions, .recibo-cpf { display: none !important; }
  .recibo-paper, .rel-papel { border-radius: 0; padding: 0; }
  .rp-tabela { font-size: 11px; }

  /* Largura escolhida em Cadastros -> Impressão (o @page vem do core.js) */
  :root[data-papel="58"] #modalRecibo .modal,
  :root[data-papel="58"] #modalComanda .modal { max-width: 54mm; font-size: 11px; }
  :root[data-papel="58"] .cm-placa { font-size: 22px; letter-spacing: 1px; }
  :root[data-papel="58"] .cm-tarefa { font-size: 12px; }
  :root[data-papel="80"] #modalRecibo .modal,
  :root[data-papel="80"] #modalComanda .modal { max-width: 76mm; font-size: 12px; }
  :root[data-papel="a4"] #modalRecibo .modal,
  :root[data-papel="a4"] #modalComanda .modal { max-width: 150mm; }

  /* Papel térmico é preto no branco — cor economiza tinta e sai chapado */
  #modalRecibo *, #modalComanda * { color: #000 !important; background: transparent !important; }
  .rc-sep { border-color: #000 !important; }
}
