:root {
  --bg: #FDF6EE;          /* marfim */
  --surface: #FFFFFF;
  --surface-2: #F8EEEC;
  --text: #2E2E2E;        /* grafite */
  --muted: #6B6266;
  --line: #EDE0DC;
  --primary: #4B1F5B;     /* roxo profundo */
  --primary-2: #A35D8F;   /* mauve */
  --primary-soft: #F6E6EB; /* rosa elegante diluído */
  --primary-text: #4B1F5B;
  --ok: #059669;
  --ok-soft: #DCFCE7;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --wa: #25D366;
  --serie-2: #A35D8F;
  --shadow: 0 1px 2px rgba(75, 31, 91, .05), 0 4px 16px rgba(75, 31, 91, .06);
  --row: 26px;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1020; --surface: #241629; --surface-2: #2F1E35; --text: #FDF6EE; --muted: #BFAEB8; --line: #3D2A44;
    --primary: #A35D8F; --primary-2: #D9A3B1; --primary-soft: #3A2240; --primary-text: #D9A3B1;
    --ok: #34D399; --ok-soft: #0F3B2C; --warn: #FBBF24; --warn-soft: #3D2E0A; --danger: #F87171; --danger-soft: #451A1A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --serie-2: #D9A3B1; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1020; --surface: #241629; --surface-2: #2F1E35; --text: #FDF6EE; --muted: #BFAEB8; --line: #3D2A44;
  --primary: #A35D8F; --primary-2: #D9A3B1; --primary-soft: #3A2240; --primary-text: #D9A3B1;
  --ok: #34D399; --ok-soft: #0F3B2C; --warn: #FBBF24; --warn-soft: #3D2E0A; --danger: #F87171; --danger-soft: #451A1A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --serie-2: #D9A3B1; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 13px; color: var(--text); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }

/* ---- Estrutura ---- */
.app { display: grid; grid-template-columns: 208px 1fr; height: 100vh; height: 100dvh; }
.main { display: grid; grid-template-rows: auto 1fr; min-width: 0; min-height: 0; }
.content { padding: 14px 18px 18px; min-height: 0; overflow: hidden; }
.tela { height: 100%; display: grid; gap: 12px; min-height: 0; grid-template-rows: auto 1fr; }

/* ---- Menu lateral ---- */
.nav { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; padding: 2px 8px 16px; letter-spacing: -.02em; }
.logo-marca { width: 34px; height: 34px; object-fit: contain; flex: none; }
.top-logo { display: none; width: 30px; height: 30px; flex: none; }
.top-logo img { width: 30px; height: 30px; object-fit: contain; display: block; }
.icone-btn.so-celular { display: none; }
.verificando .app { visibility: hidden; }
.nav-rodape .icone-btn { margin-left: auto; flex: none; }
.logo { color: inherit; text-decoration: none; }

.logo em { font-style: normal; background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted); font-weight: 600; position: relative; text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--primary-soft); color: var(--primary-text); }
.nav-item .badge { margin-left: auto; }
.nav-rodape { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.nav-rodape div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nav-rodape div span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-rodape b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Topo ---- */
.top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.top-titulo { display: flex; flex-direction: column; margin-right: auto; }
.top-titulo span { color: var(--muted); font-size: 12px; }
.proto { display: flex; align-items: center; gap: 8px; }
.proto-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---- Componentes ---- */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { padding: 5px 11px; border-radius: 8px; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.select { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font-weight: 700; background: var(--primary); color: #fff; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.ok { background: var(--ok); }
.btn.perigo { background: var(--danger-soft); color: var(--danger); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.bloco { width: 100%; }
.icone-btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); }
.icone-btn:hover { background: var(--primary-soft); color: var(--primary-text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; }
.card > * { flex-shrink: 0; }
.card > .lista, .card > .tabela-wrap, .card > .jornada, .card > .cards-agend { flex-shrink: 1; }
.link { color: var(--primary-text); font-weight: 700; text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.endereco { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.endereco span { flex: 1; min-width: 0; }
.motivo { color: var(--danger) !important; }
.motivo b { font-size: 11.5px !important; }
.seg .badge { margin-left: 4px; padding: 1px 6px; }
.barra-confirmar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.barra-confirmar.pronta { border-color: var(--primary); background: var(--primary-soft); }
.barra-confirmar .btn { padding: 10px 18px; }
.card-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.lista { overflow: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; margin: 0 -4px; padding: 0 4px; }
.vazio { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 12.5px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; }
.kpi span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kpi b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.kpi.alerta b { color: var(--primary-text); }

.cols3 { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 12px; min-height: 0; }
.cols2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; min-height: 0; }

.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); }
.item-cor { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.item-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.item-txt b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-txt span { color: var(--muted); font-size: 11.5px; }
.item-acoes { display: flex; align-items: center; gap: 6px; flex: none; }
.item-hora { font-weight: 800; font-size: 13px; min-width: 42px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge.roxo { background: var(--primary-soft); color: var(--primary-text); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.perigo { background: var(--danger-soft); color: var(--danger); }
.badge svg.i { width: 12px; height: 12px; }
.btn svg.i { width: 14px; height: 14px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11px; flex: none; }
.ponto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---- Agenda ---- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-data { display: flex; align-items: center; gap: 4px; }
.nav-data b { margin-left: 8px; font-size: 14px; }
.legenda { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.legenda span { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.agenda-corpo { min-height: 0; display: flex; flex-direction: column; }

.dia { display: flex; flex-direction: column; min-height: 0; flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.dia-head, .dia-body { display: grid; grid-template-columns: 52px repeat(var(--n), minmax(0, 1fr)); }
.dia-head { border-bottom: 1px solid var(--line); }
.dia-body { padding: 8px 0 4px; }
.col-head { padding: 9px 10px; font-weight: 700; display: flex; align-items: center; gap: 7px; border-left: 1px solid var(--line); font-size: 12.5px; }
.dia-scroll { overflow: auto; min-height: 0; flex: 1; }
.horas div { height: var(--row); font-size: 10.5px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-6px); font-weight: 600; }
.col { position: relative; border-left: 1px solid var(--line); }
.slot { height: var(--row); border-top: 1px dashed transparent; }
.slot:nth-child(odd) { border-top-color: var(--line); }
.slot[data-act]:hover { background: var(--primary-soft); cursor: pointer; }
.slot.off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, transparent 5px 10px); }
.bloco { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 3px 7px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; font-size: 11px; line-height: 1.25; }
.bloco b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloco span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloco.st-pendente { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, var(--surface)) 0 6px, var(--surface) 6px 12px); border-left-style: dashed; }
.bloco.st-concluido { opacity: .6; }
.bloco.st-falta { opacity: .55; border-left-color: var(--danger); }
.bloco.externo { background: var(--surface-2); border-left-color: var(--muted); cursor: default; }
.agora { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.agora::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.fechado { flex: 1; display: grid; place-items: center; color: var(--muted); }
.dia-lista { display: none; }

.semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; flex: 1; min-height: 0; }
.sem-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sem-col.hoje { border-color: var(--primary); }
.sem-head { padding: 8px 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; cursor: pointer; }
.sem-head b { font-size: 15px; }
.sem-lista { overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.chip { border-radius: 7px; padding: 4px 6px; font-size: 11px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-left: 3px solid var(--c); cursor: pointer; line-height: 1.3; }
.chip b { margin-right: 4px; }
.chip.st-pendente { border-left-style: dashed; }
.chip.st-concluido, .chip.st-falta { opacity: .55; }

.mes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(0, 1fr)); gap: 6px; flex: 1; min-height: 0; }
.mes-dow { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding-bottom: 2px; }
.mes-cel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-height: 0; overflow: hidden; text-align: left; }
.mes-cel:hover { border-color: var(--primary); }
.mes-cel.fora { opacity: .35; }
.mes-cel.hoje { border-color: var(--primary); background: var(--primary-soft); }
.mes-cel b { font-size: 13px; }
.mes-barra { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: auto; }
.mes-barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

/* ---- Formulários ---- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; overflow: auto; min-height: 0; align-content: start; }
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo.full { grid-column: 1 / -1; }
.campo label, .rotulo { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.campo input, .campo select, .campo textarea { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; width: 100%; outline: none; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--primary); }
.campo textarea { resize: vertical; min-height: 120px; line-height: 1.45; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 12px; cursor: pointer; user-select: none; }
.check input { display: none; }
.check:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.campo label.check { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text); }
.campo label.check:has(input:checked) { color: var(--primary-text); }
.form-acoes { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.toggle div { display: flex; flex-direction: column; gap: 2px; }
input.sw, .toggle input[type=checkbox] { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; }
input.sw::after, .toggle input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
input.sw:checked, .toggle input[type=checkbox]:checked { background: var(--primary); }
input.sw:checked::after, .toggle input[type=checkbox]:checked::after { left: 19px; }

/* ---- Perfil e jornada do prestador ---- */
.perfil { display: flex; gap: 14px; align-items: center; }
.perfil-acoes { display: flex; flex-direction: column; gap: 6px; }
img.avatar { object-fit: cover; background: var(--surface-2); }
.jornada { display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; flex: 1; }
.jornada-linha { display: grid; grid-template-columns: 40px 34px auto 1fr; align-items: center; gap: 6px 12px; padding: 7px 10px; background: var(--surface-2); border-radius: 10px; }
.jornada-linha.off .faixa { opacity: .35; }
.jornada-linha .conf { grid-column: 1 / -1; font-size: 11px; color: var(--warn); font-weight: 600; }
.faixa { display: flex; align-items: center; gap: 5px; }
.faixa span { font-size: 11px; color: var(--muted); font-weight: 600; }
.faixa input { width: 86px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; }
.toggle select { width: auto; max-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.toggle input[type=number], .toggle input[type=time] { width: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }

/* ---- Tabelas ---- */
.tabela-wrap { overflow: auto; min-height: 0; flex: 1; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 6px 8px; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td, tr.sel td { background: var(--surface-2); }
.pessoa { display: flex; align-items: center; gap: 8px; }
.pessoa div { display: flex; flex-direction: column; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.busca { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; width: 220px; outline: none; }

/* ---- Cliente: agendar ---- */
.wizard { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 12px; min-height: 0; }
.passo-num { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.passo-num.feito { background: var(--primary); color: #fff; }
.opcao { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); text-align: left; width: 100%; }
.opcao:hover { border-color: var(--primary); }
.opcao.on { border-color: var(--primary); background: var(--primary-soft); }
.opcao div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.opcao span { color: var(--muted); font-size: 11.5px; }
.dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.dia-btn { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); gap: 1px; }
.dia-btn span { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.dia-btn b { font-size: 14px; }
.dia-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.dia-btn.on span { color: rgba(255,255,255,.85); }
.dia-btn:disabled { opacity: .35; cursor: not-allowed; }
.horarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 5px; overflow: auto; align-content: start; }
.hora-btn { padding: 7px 0; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 12px; }
.hora-btn:hover:not(:disabled) { border-color: var(--primary); }
.hora-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.hora-btn:disabled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; opacity: .6; cursor: not-allowed; }
.legenda-disp { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.legenda-disp span { display: flex; align-items: center; gap: 5px; }
.legenda-disp i { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.resumo { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.resumo-linha { display: flex; justify-content: space-between; gap: 10px; }
.resumo-linha span { color: var(--muted); }
.resumo-preco { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; padding-top: 6px; border-top: 1px dashed var(--line); }
.aviso { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text); font-size: 12px; line-height: 1.4; }
.aviso.warn { background: var(--warn-soft); color: var(--warn); }
.aviso.ok { background: var(--ok-soft); color: var(--ok); }
.aviso svg { margin-top: 1px; }
.status-grande { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 16px 8px; }
.status-grande .circulo { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.status-grande .circulo svg { width: 26px; height: 26px; }

.cards-agend { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; overflow: auto; align-content: start; min-height: 0; }
.ag-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.ag-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ag-data { display: flex; gap: 10px; align-items: center; }
.ag-data .cal { width: 44px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text); text-align: center; padding: 4px 0; flex: none; }
.ag-data .cal span { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.ag-data .cal b { font-size: 17px; }

/* ---- Banner, modal, toast ---- */
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 600; }
.banner .btn { background: #fff; color: #4B1F5B; margin-left: auto; }
.modal-fundo { position: fixed; inset: 0; background: rgba(46, 46, 46, .5); display: grid; place-items: center; padding: 16px; z-index: 50; backdrop-filter: blur(2px); }
.modal-fundo[hidden] { display: none; }
.modal { background: var(--surface); border-radius: 18px; width: min(520px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.largo { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-corpo { padding: 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-pe { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.det { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.det div { display: flex; flex-direction: column; gap: 1px; }
.det span { font-size: 11px; color: var(--muted); font-weight: 600; }
.historico { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; }
.wa-preview { background: #E7FFDB; color: #111; border-radius: 12px 12px 12px 2px; padding: 10px 12px; white-space: pre-wrap; font-size: 12.5px; line-height: 1.45; align-self: flex-start; max-width: 100%; border: 0; width: 100%; min-height: 170px; resize: vertical; outline: none; }
.wa-fundo { background: #EFE7DD; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
/* Editor de modelos de mensagem */
.em-abas { flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.em-ponto { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-left: 5px; vertical-align: middle; }
.em-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.em-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.em-col .wa-preview { max-height: 46dvh; overflow: auto; overflow-wrap: anywhere; resize: none; }
.campo .em-txt { min-height: 300px; resize: vertical; font: inherit; font-size: 12.5px; line-height: 1.45; }
.em-vars { display: flex; flex-wrap: wrap; gap: 4px; }
.em-var { font-family: ui-monospace, monospace; font-size: 11px; padding: 3px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-text); }
.em-var:hover { background: var(--primary); color: #fff; }
.em-col .btn[data-act="emRestaurar"] { align-self: flex-start; }
@media (max-width: 760px) { .em-grade { grid-template-columns: 1fr; } .campo .em-txt { min-height: 190px; } }
.contrato { font-family: Georgia, 'Times New Roman', serif; font-size: 13px; line-height: 1.6; color: #1a1a1a; background: #fff; padding: 22px 26px; border-radius: 8px; border: 1px solid var(--line); }
.contrato h4 { text-align: center; font-size: 14px; margin-bottom: 12px; letter-spacing: .03em; }
.contrato p { margin-bottom: 8px; text-align: justify; }
.contrato .assin { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 26px; text-align: center; font-size: 11.5px; }
.contrato .assin div { border-top: 1px solid #333; padding-top: 4px; }
.carimbo { font-family: ui-monospace, monospace; font-size: 11px; background: var(--ok-soft); color: var(--ok); padding: 8px 10px; border-radius: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* ---- Celular: tudo em cascata ---- */
@media (max-width: 860px) {
  body { overflow: auto; }
  .app { display: block; height: auto; }
  .main { display: block; padding-bottom: 72px; }
  .content { overflow: visible; padding: 12px; }
  .tela { height: auto; display: flex; flex-direction: column; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); justify-content: space-around; gap: 0; }
  .logo, .nav-rodape { display: none; }
  .top-logo { display: block; }
  .icone-btn.so-celular { display: grid; }
  .nav-item { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 4px; flex: 1; text-align: center; align-items: center; }
  .nav-item svg.i { width: 19px; height: 19px; }
  .nav-item .badge { position: absolute; top: 2px; right: 50%; transform: translateX(18px); margin: 0; padding: 1px 5px; }
  .top { padding: 10px 12px; gap: 8px; position: sticky; top: 0; z-index: 30; }
  .top-titulo { width: calc(100% - 38px); flex-direction: row; align-items: baseline; gap: 8px; }
  .proto { width: 100%; justify-content: space-between; }
  .proto .seg { flex: 1; }
  .proto .seg button { flex: 1; padding: 5px 4px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cols3, .cols2, .wizard { display: flex; flex-direction: column; }
  .lista, .tabela-wrap, .horarios, .sem-lista, .cards-agend { overflow: visible; }
  .card { min-height: auto; overflow: visible; }
  .barra-confirmar { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 20; flex-direction: column; align-items: stretch; gap: 8px; }
  .legenda { margin-left: 0; width: 100%; }
  .toolbar { gap: 8px; }
  .dia { display: none; }
  .dia-lista { display: flex; flex-direction: column; gap: 6px; }
  .semana { display: flex; flex-direction: column; }
  .mes { gap: 3px; grid-template-rows: auto; grid-auto-rows: auto; }
  .mes-cel { padding: 4px; min-height: 52px; }
  .mes-cel .mes-info { display: none; }
  .form { grid-template-columns: 1fr; overflow: visible; }
  .busca { width: 100%; }
  .jornada { overflow: visible; }
  .jornada-linha { grid-template-columns: 40px 1fr; }
  .jornada-linha .faixa { grid-column: 1 / -1; padding-left: 52px; }
  .faixa input { flex: 1; min-width: 0; }
  .det { grid-template-columns: 1fr; }
  .cards-agend { grid-template-columns: 1fr; }
  table.responsiva thead { display: none; }
  table.responsiva tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
  table.responsiva td { border: 0; padding: 0; }
  table.responsiva td:first-child { grid-column: 1 / -1; }
  table.responsiva td[data-l]::before { content: attr(data-l) ': '; color: var(--muted); font-size: 11px; }
  .modal-fundo { place-items: end center; padding: 0; }
  .modal, .modal.largo { width: 100%; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .contrato { padding: 14px; }
}

@media print {
  body { overflow: visible; background: #fff; }
  .app, .toast { display: none; }
  .modal-fundo { position: static; background: none; padding: 0; display: block; backdrop-filter: none; }
  .modal { box-shadow: none; width: 100%; max-height: none; }
  .modal-head, .modal-pe, .nao-imprimir { display: none !important; }
  .modal-corpo { overflow: visible; padding: 0; }
  .contrato { border: 0; padding: 0; }
}

/* ---- Dashboard ---- */
.dash { grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.dash .card { padding: 12px; gap: 8px; }
.filtros { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filtros-info { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.kpis-dash { grid-template-columns: minmax(0, 2.6fr) repeat(6, minmax(0, 1fr)); gap: 8px; }
.kpi-dash { padding: 9px 11px; gap: 1px; cursor: default; min-width: 0; }
.kpi-dash > span:first-child { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-dash b { font-size: 18px; white-space: nowrap; }
.delta { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.delta.bom { color: var(--ok); }
.delta.ruim { color: var(--danger); }
.dash-l1 { display: grid; grid-template-columns: 1.75fr 1fr 1.05fr; gap: 10px; min-height: 0; }
.dash-l2 { display: grid; grid-template-columns: 1.45fr 1fr 1fr; gap: 10px; min-height: 0; }
.dash-l2.dois { grid-template-columns: 1fr 1fr; }
.leg { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); font-weight: 600; }
.leg span, .proj-linhas span { display: inline-flex; align-items: center; gap: 5px; }
.sw-re, .sw-ag, .sw-pe, .sw-marca { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-re { background: var(--primary); }
.sw-ag { background: color-mix(in srgb, var(--primary) 40%, var(--surface)); }
.sw-pe { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--primary) 50%, var(--surface)) 0 3px, var(--surface) 3px 6px); }
.sw-marca { width: 2px; height: 12px; border-radius: 1px; background: var(--text); }
.sw-salao, .sw-prof { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-salao { background: var(--primary); }
.sw-prof { background: var(--serie-2); }
.seg-rot { align-self: center; padding: 0 6px 0 8px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Cartão largo: faturamento total dividido entre salão e profissionais */
.kpi-divisao { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.div-topo { display: flex; flex-direction: column; gap: 1px; }
.div-topo > span:first-child { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.div-partes { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.div-barra { display: flex; gap: 2px; height: 10px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.div-barra i { height: 100%; border-radius: 0; }
.div-leg { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.div-leg span { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.div-leg b { color: var(--text); font-size: 11.5px; }

/* Colunas (faturamento por dia/semana) */
.cc-wrap { flex: 1 1 auto; min-height: 140px; display: flex; flex-direction: column; }
.cc { flex: 1; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: 1fr 16px; min-height: 0; }
.cc-y { position: relative; }
.cc-y span { position: absolute; right: 6px; transform: translateY(50%); font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-plot { position: relative; border-bottom: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); }
.cc-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.cc-media { position: absolute; left: 0; right: 0; height: 1px; background: color-mix(in srgb, var(--text) 45%, transparent); z-index: 1; pointer-events: none; }
.cc-media em { position: absolute; right: 2px; bottom: 3px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.cc-cols { position: absolute; inset: 0; display: flex; gap: 2px; }
.cc-col { flex: 1; height: 100%; display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; min-width: 0; border-radius: 4px 4px 0 0; }
.cc-col:hover { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.cc-col i { width: 100%; max-width: 24px; display: block; flex: none; }
.cc-re { background: var(--primary); }
.cc-ag { background: color-mix(in srgb, var(--primary) 40%, var(--surface)); }
.cc-col i.topo { border-radius: 4px 4px 0 0; }
.cc-xs { grid-column: 2; display: flex; gap: 2px; }
.cc-xs span { flex: 1; min-width: 0; text-align: center; font-size: 10px; color: var(--muted); white-space: nowrap; padding-top: 3px; }
.cc-xs span.hoje { color: var(--primary-text); font-weight: 800; }

/* Barras horizontais (serviços, clientes) */
.hb { display: flex; flex-direction: column; gap: 2px; }
.hb-linha { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 8px; }
.hb-linha[data-act] { cursor: pointer; }
.hb-linha:hover, .hb-linha.on { background: var(--surface-2); }
.hb-linha.on { box-shadow: inset 3px 0 0 var(--primary); }
.hb-rot { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hb-rot > div { display: flex; flex-direction: column; min-width: 0; }
.hb-rot b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-rot span, .hb-val span { font-size: 10.5px; color: var(--muted); }
.hb-trilho { height: 10px; }
.hb-trilho i { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.hb-val { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.hb-val b { font-size: 12px; }

/* Tabela de profissionais */
.tab-dash td { padding: 6px 8px; font-size: 12px; }
.tab-dash td.num { font-variant-numeric: tabular-nums; }
.barra-cel { height: 6px; border-radius: 3px; margin-bottom: 3px; min-width: 70px; }
.barra-cel i { display: block; height: 100%; background: var(--primary); border-radius: 0 3px 3px 0; }

/* Projeção */
.proj-hero { display: flex; flex-direction: column; gap: 3px; }
.proj-hero > b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.proj-hero > span { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.proj-barra { position: relative; display: flex; gap: 2px; height: 14px; background: var(--surface-2); border-radius: 4px; margin: 4px 0; }
.proj-barra i { height: 100%; border-radius: 0; }
.proj-barra i:first-child { border-radius: 4px 0 0 4px; }
.proj-marca { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); border-radius: 1px; transform: translateX(-1px); }
.proj-linhas { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.proj-linhas > div { display: flex; justify-content: space-between; gap: 8px; }
.proj-linhas span { color: var(--muted); }
.proj-linhas b { font-variant-numeric: tabular-nums; }
.proj-linhas .total { border-top: 1px solid var(--line); padding-top: 4px; }
.proj-linhas .total span { color: var(--text); font-weight: 700; }

/* Mapa de calor */
.hm { display: grid; grid-template-columns: 28px repeat(var(--cols), minmax(0, 1fr)); gap: 2px; align-items: center; }
.hm i { display: block; height: 20px; border-radius: 3px; }
.hm i:hover { outline: 2px solid var(--text); outline-offset: -2px; }
.hm-h, .hm-d { font-size: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.hm-leg { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); }
.hm-leg i { width: 14px; height: 10px; border-radius: 2px; }

/* Clientes */
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 6px; }
.mini-kpis > div { background: var(--surface-2); border-radius: 9px; padding: 6px 8px; display: flex; flex-direction: column; min-width: 0; cursor: default; }
.mini-kpis b { font-size: 16px; }
.mini-kpis span { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.mini-kpis .alerta b { color: var(--warn); }

/* Tooltip */
.tip { position: fixed; z-index: 70; pointer-events: none; background: var(--text); color: var(--bg); padding: 7px 10px; border-radius: 8px; font-size: 11.5px; line-height: 1.45; max-width: 260px; opacity: 0; transition: opacity .1s; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); left: 0; top: 0; }
.tip.on { opacity: 1; }
.tip .delta.bom { color: #4ADE80; }
.tip .delta.ruim { color: #F87171; }

@media (max-width: 1280px) and (min-width: 861px) {
  .kpis-dash { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-divisao { grid-column: span 2; }
}
@media (max-width: 860px) {
  .dash { display: flex; flex-direction: column; }
  .kpis-dash { grid-template-columns: 1fr 1fr; }
  .kpi-divisao { grid-template-columns: 1fr; gap: 8px; grid-column: span 2; }
  .dash-l1, .dash-l2, .dash-l2.dois { display: flex; flex-direction: column; }
  .filtros .seg { flex-wrap: wrap; width: 100%; }
  .filtros .seg button { flex: 1; }
  .filtros .select { flex: 1; min-width: 0; }
  .filtros-info { margin-left: 0; width: 100%; }
  .cc-wrap { min-height: 200px; }
  .mini-kpis { grid-template-columns: 1fr 1fr; }
  .nav-item { font-size: 9px; min-width: 0; }
  .nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Reserva direta: dias e horários livres do profissional */
.dia-btn i { font-style: normal; font-size: 9.5px; font-weight: 700; color: var(--ok); }
.dia-btn.on i { color: rgba(255,255,255,.9); }
.dia-btn:disabled i { color: var(--muted); }
.nv-dica { text-transform: none; letter-spacing: 0; font-weight: 500; }
.nv-jornada { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.nv-jornada b { color: var(--text); }
.nv-jornada .i { width: 13px; height: 13px; flex: none; }
.nv-horarios { max-height: 190px; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }

/* Ajustes: horário de funcionamento por dia */
.hor-linha { grid-template-columns: 40px 34px 1fr; }
.hor-linha .faixa { min-width: 0; }
.hor-linha .faixa input { flex: 1; min-width: 0; max-width: 120px; }
.jornada:has(.hor-linha) { container-type: inline-size; }
@container (max-width: 360px) {
  .hor-linha .faixa { grid-column: 1 / -1; padding-left: 0; }
  .hor-linha .faixa input { max-width: none; }
}
