/* Hórus Barbearia · CRM de retorno · app.css
   Shell (login, sidebar, topbar, bottom nav) + componentes compartilhados.
   Tema escuro único. Breakpoints: <=768 mobile · 769-1100 sidebar recolhida · >1100 completa. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color-scheme: dark;
}
html.has-modal { overflow: hidden; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.ico { flex: none; }
strong, b { font-weight: 600; }
/* foco por teclado: anel verde sólido (o tint do contrato, a 12%, não passa de 1,2:1 sobre o fundo
   e some em botões e links; os inputs mantêm o tint porque a borda verde já marca o foco) */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible { border-color: var(--green); }
.btn--primary:focus-visible { outline-color: var(--green-400); }
::selection { background: rgba(25,197,50,.35); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- utilitários ---------- */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.link { color: var(--green); font-weight: 600; cursor: pointer; }
.link:hover { color: var(--green-400); text-decoration: underline; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hide-mobile { }
/* .hide-desktop some acima de 768 e volta ao display natural do elemento no mobile (nada de display:initial, que viraria inline) */
@media (min-width: 769px) { .hide-desktop { display: none !important; } }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; }
/* 24px é o gap de seção do projeto: o mesmo respiro que separa o cabeçalho do conteúdo em
   toda view, com ou sem .page-head, para a troca de tela não mexer na altura do conteúdo. */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.page-sub { color: var(--text-2); margin-top: 4px; font-size: 14px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.tag--vip { background: var(--green-tint); color: var(--green-400); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.pill--demo { border-color: rgba(245,185,66,.35); color: var(--st-risco); }
.pill--demo::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--st-risco); }
.pill--green { border-color: rgba(25,197,50,.4); color: var(--green-400); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot--green { background: var(--green); }
.dot--red { background: var(--st-sumido); }
.demo-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--text-3); line-height: 1.45; margin: 0; }
.demo-note .ico { margin-top: 1px; }

/* ---------- grid ---------- */
.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- card ---------- */
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0; }
/* título + subtítulo à esquerda e ação à direita, centrados na vertical (mesmo padrão em todas as telas) */
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--card-pad) 0; }
.card__title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.card__sub { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.card__body { padding: var(--card-pad); min-width: 0; }
.card__head + .card__body { padding-top: 14px; }
.card__foot { padding: 12px var(--card-pad); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.card--flat { background: var(--surface-2); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; line-height: 1; border: 1px solid transparent; white-space: nowrap; user-select: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--green); color: var(--on-green); }
.btn--primary:hover:not(:disabled) { background: var(--green-400); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn--danger { border-color: var(--st-sumido); color: var(--st-sumido); }
.btn--danger:hover:not(:disabled) { background: rgba(239,83,80,.12); }
.btn--sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn--icon { width: 36px; height: 36px; padding: 0; }
.btn--icon.btn--sm { width: 32px; height: 32px; }
.btn--block { width: 100%; }
.btn .ico { flex: none; }

/* ---------- inputs ---------- */
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; transition: border-color var(--t) var(--ease); min-width: 0;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--green-tint); outline-offset: 2px; border-color: var(--green); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .5; cursor: not-allowed; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B3B8B1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.select option { background: var(--surface-2); color: var(--text); }
.input[type="date"], .input[type="time"] { color-scheme: dark; }
.input[type="number"] { font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field__hint { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.field.is-error .input, .field.is-error .select, .field.is-error .textarea { border-color: var(--st-sumido); }
.field__error, .form__error { color: var(--st-sumido); font-size: 13px; font-weight: 500; }
.form { display: flex; flex-direction: column; gap: 16px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); cursor: pointer; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform var(--t) var(--ease), background var(--t) var(--ease); }
.switch input:checked + span { background: var(--green); border-color: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--on-green); }
.switch input:focus-visible + span { outline: 2px solid var(--green-tint); outline-offset: 2px; }
.search { position: relative; min-width: 0; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 38px; }

/* ---------- toolbar, chips, tabs ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; min-width: 0; }
.toolbar__spacer { flex: 1 1 auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.is-active { background: var(--green-tint); border-color: var(--green); color: var(--green-400); }
.chip__count { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.chip.is-active .chip__count { color: inherit; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color var(--t) var(--ease), border-color var(--t) var(--ease); }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--green); }
.tab__count { font-family: var(--mono); font-size: 12px; color: var(--text-3); background: var(--surface-3); padding: 1px 7px; border-radius: var(--radius-pill); }
.tab.is-active .tab__count { background: var(--green-tint); color: var(--green-400); }

/* ---------- badge, avatar, barber chip ---------- */
.badge { --st: var(--st-novo); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--st); background: color-mix(in srgb, var(--st) 14%, transparent); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--st); flex: none; }
.badge--em-dia { --st: var(--st-em-dia); }
.badge--hora { --st: var(--st-hora); }
.badge--risco { --st: var(--st-risco); }
.badge--sumido { --st: var(--st-sumido); }
.badge--novo { --st: var(--st-novo); }
.badge--agendado { --st: var(--st-novo); }
.badge--confirmado { --st: var(--st-hora); }
.badge--concluido { --st: var(--st-em-dia); }
.badge--faltou { --st: var(--st-sumido); }
.badge--cancelado { --st: var(--text-3); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: var(--av, 36px); height: var(--av, 36px); border-radius: 50%; font-weight: 700; font-size: calc(var(--av, 36px) * .36); letter-spacing: .02em; flex: none; background: var(--surface-3); color: var(--text-2); user-select: none; }
.avatar--t0 { background: #1C3326; color: #8EE0A8; }
.avatar--t1 { background: #1E2E44; color: #8FB8F0; }
.avatar--t2 { background: #3A2A1C; color: #F0B98F; }
.avatar--t3 { background: #2E2440; color: #C3A6F0; }
.avatar--t4 { background: #1E3838; color: #8FE0DC; }
.avatar--t5 { background: #3A2430; color: #F0A6C0; }
.barber-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.barber-chip .dot { background: var(--cat, var(--text-3)); }
.barber-chip--none { color: var(--text-3); }

/* ---------- kpi ---------- */
.kpi { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--card-pad); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi__label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.kpi__value { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi__hint { font-size: 12px; color: var(--text-3); }
.kpi--link { text-decoration: none; color: inherit; cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.kpi--link:hover { border-color: var(--line-strong); background: var(--surface-2); }
.kpi--link:hover .kpi__label { color: var(--text); }
.kpi--ok .kpi__hint { color: var(--green-400); }
.kpi--warn .kpi__value { color: var(--st-risco); }
.kpi--bad .kpi__value { color: var(--st-sumido); }
.kpi--bad .kpi__hint { color: var(--st-sumido); }

/* ---------- table, list ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { font-size: 12px; font-weight: 600; color: var(--text-3); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .02em; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-clickable { cursor: pointer; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.num { font-family: var(--mono); }
.table th.actions, .table td.actions { text-align: right; white-space: nowrap; }
.list { display: flex; flex-direction: column; min-width: 0; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list__item:first-child { padding-top: 0; }
.list__item:last-child { border-bottom: 0; padding-bottom: 0; }
.list__main { flex: 1 1 auto; min-width: 0; }
.list__aside { flex: none; display: flex; align-items: center; gap: 8px; }
.list__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__sub { font-size: 13px; color: var(--text-2); }
.list__item.is-link { cursor: pointer; }
.list__item.is-link:hover .list__title { color: var(--green-400); }

/* ---------- progress, empty, ring, bars ---------- */
.progress { display: block; height: 6px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
/* display: block é obrigatório: em <span> a barra fica inline e ignora width e height (trilho vazio) */
.progress__bar { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; transition: width 300ms var(--ease); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 16px; color: var(--text-2); }
.empty .ico { color: var(--text-3); margin-bottom: 4px; }
.empty h3 { font-size: 16px; color: var(--text); }
.empty p { max-width: 380px; font-size: 13px; }
.empty .btn { margin-top: 8px; }
.ring { display: block; flex: none; }
.ring__label { font-family: var(--mono); font-size: 11px; font-weight: 500; fill: var(--text); }
.bars { display: block; width: 100%; }

/* ---------- modal ---------- */
/* no desktop a caixa sobe 32px: os 88px de baixo são a faixa dos toasts (z 200), que senão cobrem os botões do rodapé do modal */
/* o padding de baixo reserva a faixa dos toasts: com dois empilhados são ~172px, e um toast
   sobre o rodapé do modal esconderia o botão de confirmar */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px 24px 176px; background: rgba(0,0,0,.62); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal__box { width: 100%; max-width: 520px; max-height: calc(100vh - 200px); background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; animation: modalIn 160ms var(--ease); }
.modal__box--wide { max-width: 760px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.modal__title { font-size: 18px; font-weight: 700; line-height: 1.2; }
.modal__body { padding: 20px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal__foot:empty { display: none; }
.confirm__text { font-size: 14px; color: var(--text-2); }
@keyframes modalIn { from { transform: translateY(8px); } to { transform: none; } }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.5); font-size: 14px; animation: toastIn 200ms var(--ease); }
.toast__icon { display: flex; color: var(--green); flex: none; }
.toast--warn .toast__icon { color: var(--st-risco); }
.toast--error .toast__icon { color: var(--st-sumido); }
.toast__text { flex: 1 1 auto; min-width: 0; }
.toast__action { font-weight: 600; color: var(--green-400); padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.toast__action:hover { background: var(--green-tint); }
.toast__close { display: flex; color: var(--text-3); padding: 6px; border-radius: 6px; }
.toast__close:hover { color: var(--text); background: rgba(255,255,255,.06); }
@keyframes toastIn { from { transform: translateY(8px); } to { transform: none; } }

/* ---------- menu flutuante ---------- */
.menu { position: fixed; z-index: 150; min-width: 208px; padding: 6px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: menuIn 120ms var(--ease); }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 7px; font-size: 14px; font-weight: 500; text-align: left; color: var(--text); white-space: nowrap; }
.menu__item:hover:not(:disabled), .menu__item:focus-visible { background: rgba(255,255,255,.06); }
.menu__item:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.menu__item .ico { color: var(--text-2); }
.menu__item--danger, .menu__item--danger .ico { color: var(--st-sumido); }
.menu__item:disabled { opacity: .45; }
.menu__divider { height: 1px; background: var(--line-strong); margin: 6px 0; }
@keyframes menuIn { from { transform: translateY(-4px); } to { transform: none; } }

/* ---------- seletor de cliente e serviços (modais globais) ---------- */
.picker { position: relative; min-width: 0; }
.picker__input { position: relative; }
.picker__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); display: flex; pointer-events: none; }
.picker__input .input { padding-left: 38px; padding-right: 36px; }
.picker__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; padding: 6px; color: var(--text-3); border-radius: 6px; }
.picker__clear:hover { color: var(--text); background: rgba(255,255,255,.06); }
.picker__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 272px; overflow: auto; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.picker__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 7px; text-align: left; min-height: 42px; }
.picker__item:hover, .picker__item.is-active { background: rgba(255,255,255,.06); }
.picker__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.picker__meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.picker__item--free .ico, .picker__item--create .ico { color: var(--green); }
.picker__empty { padding: 10px 12px; }
.picker__selected { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 6px 4px 8px; background: var(--surface-2); border: 1px solid var(--green); border-radius: var(--radius-sm); }
.picker__selected .picker__clear { position: static; transform: none; margin-left: auto; }
.svc__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.svc__item { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); text-align: left; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.svc__item:hover { border-color: var(--text-3); }
.svc__item.is-active { border-color: var(--green); background: var(--green-tint); }
.svc__check { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; color: transparent; flex: none; }
.svc__item.is-active .svc__check { background: var(--green); border-color: var(--green); color: var(--on-green); }
.svc__name { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc__price { font-size: 12px; color: var(--text-3); font-family: var(--mono); white-space: nowrap; flex: none; }
.svc__item.is-active .svc__price { color: var(--green-400); }
.svc__total { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.svc__sum { font-size: 18px; font-weight: 500; font-family: var(--mono); }
@media (min-width: 560px) { .svc__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* telas estreitas: uma coluna (em 2 colunas "Corte + Barba R$ 70" não cabe em 375px e trunca) e,
   no cliente selecionado, o badge sai para o nome não sumir */
@media (max-width: 480px) {
  .svc__grid { grid-template-columns: minmax(0, 1fr); }
  .picker__selected .badge { display: none; }
  .picker__selected .picker__name { flex: 1 1 96px; }
}

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 24px; background: var(--bg); }
.login__card { width: 100%; max-width: 400px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 14px; padding: 36px 28px 28px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.login__logo { width: 180px; height: 147px; background: url(../assets/logo-white.png) no-repeat; background-size: 225px auto; background-position: -6px -56px; }
.login__sub { font-size: 12px; color: var(--text-3); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; margin-top: -8px; }
.login__form { width: 100%; display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.login__form .btn { margin-top: 4px; }
.login__note { font-size: 12px; color: var(--text-3); text-align: center; }
.login__foot { font-size: 12px; color: var(--text-3); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface-1); border-right: 1px solid var(--line); padding: 16px 12px; gap: 8px; overflow-y: auto; overflow-x: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; min-width: 0; }
/* brand-eye.png é o olho inteiro recortado do logo (604x254), sem a palavra e sem o respingo
   solto que sobrava no icon-eye.png. Sempre 'contain': nada de recorte por background-position. */
.brand__mark { width: 44px; height: 19px; flex: none; background: url(../assets/brand-eye.png) no-repeat center/contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand__sub { font-size: 12px; color: var(--text-3); }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.nav__item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: 8px; font-weight: 500; color: var(--text-2); width: 100%; position: relative; text-align: left; white-space: nowrap; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item.is-active { background: var(--green-tint); color: var(--green-400); font-weight: 600; }
.nav__item .ico { width: 22px; height: 22px; }
.nav__label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
/* branco sobre --st-sumido dá 3,5:1; este vermelho escurecido chega a 4,6:1 e passa AA */
.nav__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: #D93A36; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); line-height: 1; }
.nav__badge[hidden] { display: none; }
.sidebar__foot { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar); display: flex; align-items: center; gap: 16px; padding: 0 var(--pad); background: rgba(11,12,11,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar__brand { display: none; align-items: center; gap: 8px; }
.topbar__brand .brand__name { font-size: 16px; }
.topbar__title { font-size: 16px; font-weight: 700; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.content { width: 100%; max-width: calc(var(--content-max) + var(--pad) * 2); margin: 0 auto; padding: var(--pad); flex: 1 1 auto; min-width: 0; }
.view { min-width: 0; }
.view-enter { animation: viewIn 200ms var(--ease); }
@keyframes viewIn { from { transform: translateY(6px); } to { transform: none; } }
.bottomnav { display: none; }
.sheet-nav { display: flex; flex-direction: column; gap: 2px; }
.sheet-nav .nav__item { height: 48px; font-size: 15px; }
.sheet-nav .menu__divider { margin: 8px 0; }
.placeholder .empty { padding: 64px 16px; }

/* ---------- tabela vira card (mobile) ---------- */
@media (max-width: 768px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; background: var(--surface-2); }
  .table tbody tr:hover { background: var(--surface-2); }
  .table tbody tr:last-child { margin-bottom: 0; }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border: 0; text-align: left; min-width: 0; }
  .table td[data-label]::before { content: attr(data-label); color: var(--text-3); font-size: 12px; font-weight: 500; flex: none; }
  .table td.num { text-align: right; }
  .table td.actions { justify-content: flex-end; padding-top: 10px; }
  .table td.actions .btn--icon { width: 40px; height: 40px; }
}

/* ---------- tablet: sidebar recolhida (769 a 1100) ---------- */
@media (max-width: 1100px) and (min-width: 769px) {
  .shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding: 12px 8px; align-items: center; }
  .brand { padding: 6px 0 14px; justify-content: center; width: 100%; }
  .brand__text { display: none; }
  .nav__item { justify-content: center; padding: 0; width: 46px; }
  .nav__label { display: none; }
  .nav__badge { position: absolute; top: 3px; right: 3px; margin: 0; min-width: 17px; height: 17px; font-size: 11px; padding: 0 4px; }
  .sidebar__foot { width: 100%; align-items: center; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- mobile (<= 768) ---------- */
@media (max-width: 768px) {
  :root { --card-pad: var(--card-pad-m); }
  .hide-mobile { display: none !important; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 var(--pad-m); gap: 10px; }
  .topbar__brand { display: flex; }
  .topbar__title { display: none; }
  .topbar__right { gap: 8px; }
  .topbar__new { width: 40px; height: 40px; padding: 0; }
  .topbar__new span { display: none; }
  .content { padding: var(--pad-m); padding-bottom: calc(var(--bottomnav) + 24px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; }
  .page-title { font-size: 20px; }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .grid--4, .grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi__value { font-size: 24px; }
  .btn--icon { width: 40px; height: 40px; }
  /* alvo de toque mínimo de 40px: no celular os botões pequenos, os chips de filtro e as
     caixas de marcar carregam as ações do dia a dia e não podem ficar em 32 ou 36px */
  .btn--sm { height: 40px; padding: 0 14px; }
  .btn--icon.btn--sm { width: 40px; height: 40px; }
  .chip { min-height: 40px; }
  .tab { min-height: 40px; }
  .checkbox { min-height: 40px; }
  .checkbox input { width: 22px; height: 22px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(var(--bottomnav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(18,20,18,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  /* sem altura fixa: o item estica na linha do grid (60px menos a borda), senão estoura 1px para fora da tela */
  .bottomnav__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--text-3); position: relative; min-height: 44px; min-width: 0; }
  .bottomnav__item .ico { width: 24px; height: 24px; }
  .bottomnav__item.is-active { color: var(--green-400); }
  .bottomnav__item .nav__badge { position: absolute; top: 6px; left: calc(50% + 4px); margin: 0; min-width: 17px; height: 17px; font-size: 11px; padding: 0 4px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__box { max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 14px 14px 0 0; border-bottom: 0; animation-name: sheetIn; }
  .modal__body { padding: 16px; }
  .modal__head { padding: 12px 12px 12px 16px; }
  .modal__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal__foot .btn { flex: 1 1 auto; }
  .toasts { bottom: calc(var(--bottomnav) + 16px + env(safe-area-inset-bottom)); }
  .login { padding: 16px; }
  .login__card { padding: 28px 20px 22px; }
}
@keyframes sheetIn { from { transform: translateY(16px); } to { transform: none; } }
