/* =====================================================================
   Visual da barbearia — proposta aprovada pelo dono em 04/10/2026
   (.claude/skills/visual-moderno/propostas/barbearia-aprovada.html).

   Bricolage Grotesque nos títulos, Geist no texto, Geist Mono nos números.
   Neutros quentes; a cor da marca vem da barbearia (Brand::cssRoot) e o
   laranja-queimado é só o padrão. Bootstrap continua por baixo: as telas
   usam as classes dele, e é aqui que elas ganham a cara nova.
   ===================================================================== */

/* ---------- 1. Fontes locais (OFL; a CSP é font-src 'self') ---------- */
@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('../fonts/bricolage-grotesque-var.woff2') format('woff2');
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Geist';
    src: url('../fonts/geist-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Geist Mono';
    src: url('../fonts/geist-mono-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- 2. Tokens ---------- */
:root {
    --font-display: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
    --font-sans: 'Geist', 'Helvetica Neue', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --r-xs: 6px;
    --r-sm: 9px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 22px;

    --sidebar-w: 232px;
    --sidebar-w-collapsed: 72px;
    --topbar-h: 60px;
    --tabbar-h: 64px;

    --ease: cubic-bezier(.4, 0, .2, 1);
    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --spring: cubic-bezier(.2, .9, .25, 1);
    --fast: .15s;
    --normal: .22s;
    --slow: .25s;

    /* superfícies — claro (neutros quentes) */
    --bg:            #f6f4f1;
    --bg-subtle:     #efece7;
    --surface:       #ffffff;
    --surface-2:     #faf8f5;
    --surface-hover: #f3f0eb;
    --border:        #e4dfd8;
    --border-strong: #d3ccc2;
    --text:          #1d1a17;
    --text-muted:    #6c655d;
    /* "apagado" ainda passa 4,5:1 sobre o fundo creme — a proposta usava
       #9a9289, que não passa no AA. */
    --text-faint:    #6f685f;

    --ok:   #1f7a4d;  --ok-bg:   #dff1e7;
    --warn: #8f5200;  --warn-bg: #fbecd2;
    --bad:  #b42318;  --bad-bg:  #fbe3e0;
    --info: #1f5f8b;  --info-bg: #e1edf6;
    --neutral-bg: #efece7;

    --brand-ink: #ffffff;
    --brand-soft: color-mix(in srgb, var(--brand) 12%, var(--surface));

    --shadow-xs: 0 1px 2px rgb(40 30 20 / .05);
    --shadow-sm: 0 1px 2px rgb(40 30 20 / .06), 0 4px 12px -8px rgb(40 30 20 / .14);
    --shadow-md: 0 1px 2px rgb(40 30 20 / .06), 0 8px 24px -12px rgb(40 30 20 / .18);
    --shadow-lg: 0 2px 6px rgb(40 30 20 / .06), 0 24px 48px -16px rgb(40 30 20 / .28);
    --shadow-brand: 0 10px 24px -8px rgba(var(--brand-rgb), .55);

    color-scheme: light;

    /* Bootstrap lê estas: sem elas, azul e cinza-frio vazam nos componentes dele. */
    --bs-body-font-family: var(--font-sans);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-color: var(--text-faint);
    --bs-secondary-bg: var(--surface-2);
    --bs-tertiary-bg: var(--bg-subtle);
    --bs-border-color: var(--border);
    --bs-border-color-translucent: var(--border);
    --bs-heading-color: var(--text);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-focus-ring-color: rgba(var(--brand-rgb), .25);
}

[data-bs-theme="dark"] {
    --bg:            #12100e;
    --bg-subtle:     #151310;
    --surface:       #1b1815;
    --surface-2:     #201c18;
    --surface-hover: #25211c;
    --border:        #2b2621;
    --border-strong: #3a332c;
    --text:          #f2eee9;
    --text-muted:    #a59d93;
    --text-faint:    #918980;

    --ok:   #5cc792;  --ok-bg:   #173225;
    --warn: #e8a64a;  --warn-bg: #33260f;
    --bad:  #f08a80;  --bad-bg:  #3a1916;
    --info: #7ab8e0;  --info-bg: #12283a;
    --neutral-bg: #25211c;

    --brand-soft: color-mix(in srgb, var(--brand) 20%, var(--surface));

    --shadow-xs: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4), 0 6px 16px -10px rgb(0 0 0 / .6);
    --shadow-md: 0 1px 2px rgb(0 0 0 / .4), 0 12px 28px -14px rgb(0 0 0 / .7);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / .5), 0 28px 56px -18px rgb(0 0 0 / .8);

    color-scheme: dark;
}

/* ---------- 3. Base ---------- */
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    font-size: .9375rem;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
    text-wrap: balance;
}
h4, h5, h6, .h4, .h5, .h6 { letter-spacing: -.01em; }

a { color: var(--brand-text); text-decoration: none; transition: color var(--fast) var(--ease); }
a:hover { color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
a.btn:hover, a.nav-link:hover, a.dropdown-item:hover, .mobile-nav a:hover, a.card-link-block:hover,
a.agenda-item:hover, a.now-row:hover, a.icon-btn:hover, a.brand-mark:hover, a.chip:hover { text-decoration: none; }

/* Números: monoespaçados e de largura fixa — valor que muda não faz a linha pular. */
.num, .tabular, .mono, .stat-value, .kpi-value, time {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}
.mono { font-size: .9em; }

.text-muted   { color: var(--text-muted) !important; }
.text-faint   { color: var(--text-faint) !important; }
.text-brand   { color: var(--brand-text) !important; }
.text-body    { color: var(--text) !important; }
.text-success { color: var(--ok) !important; }
.text-danger  { color: var(--bad) !important; }
.text-warning { color: var(--warn) !important; }
.text-info    { color: var(--info) !important; }
.fw-medium    { font-weight: 500; }
.fw-semibold  { font-weight: 600 !important; }
.fs-tiny      { font-size: .75rem; }
.fs-small     { font-size: .8125rem; }
.lh-tight     { line-height: 1.28; }
.min-w-0      { min-width: 0; }
.eyebrow {
    font: 500 .72rem/1 var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand-text);
}

::selection { background: rgba(var(--brand-rgb), .2); }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* Ícone de traço (SVG próprio, mesmo desenho da proposta). */
.ico {
    width: 18px; height: 18px; flex: none;
    stroke: currentColor; fill: none; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 4. Estrutura ---------- */
.app-shell { min-height: 100vh; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--normal) var(--ease), transform var(--slow) var(--spring);
    view-transition-name: sidebar;
}

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--normal) var(--ease);
}

body.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .app-main    { margin-left: var(--sidebar-w-collapsed); }
/* Recolhida = só ícones (display: none tira a largura do texto; opacity não). */
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-badge { display: none; }
body.sidebar-collapsed .nav-section-title {
    font-size: 0; padding: 0; margin: .6rem .55rem .35rem;
    border-top: 1px solid var(--border);
}
body.sidebar-collapsed .sidebar-nav .nav-link,
body.sidebar-collapsed .sidebar-foot .btn { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .sidebar-foot .btn .ico,
body.sidebar-collapsed .sidebar-foot .btn i { transform: rotate(180deg); }

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 0 1rem;
    flex-shrink: 0;
    overflow: hidden;
}
.brand-mark {
    width: 32px; height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    display: grid; place-items: center;
    background: var(--brand);
    color: var(--brand-ink);
    font: 700 .9rem/1 var(--font-display);
    letter-spacing: -.02em;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; font: 700 1rem/1.15 var(--font-display); letter-spacing: -.015em; color: var(--text); }
.brand-text span { display: block; font-size: .7rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .25rem .75rem 1.25rem;
}
.nav-section-title {
    font: 500 .6875rem/1 var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    padding: .9rem .5rem .45rem;
    white-space: nowrap;
}
.sidebar-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem .55rem;
    margin-bottom: 1px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.sidebar-nav .nav-link i { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-link:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-nav .nav-link.active {
    background: var(--brand-soft);
    color: var(--brand-text);
    font-weight: 600;
}
.nav-badge {
    margin-left: auto;
    font: 500 .6875rem/1 var(--font-mono);
    padding: .2rem .45rem;
    border-radius: 99px;
    background: var(--bad-bg);
    color: var(--bad);
}
.nav-badge.soft { background: var(--neutral-bg); color: var(--text-muted); }

.sidebar-foot { padding: .6rem .75rem; border-top: 1px solid var(--border); flex-shrink: 0; }

/* Topo (vidro fosco: é uma das duas superfícies que pode ter) */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 1.25rem;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
    view-transition-name: topbar;
}
.topbar-title {
    font: 700 1.05rem/1.2 var(--font-display);
    letter-spacing: -.015em;
    margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}

.icon-btn {
    width: 40px; height: 40px;
    display: inline-grid; place-items: center;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.05rem;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.has-dot { position: relative; }
.icon-btn.has-dot::after {
    content: '';
    position: absolute; top: 9px; right: 9px;
    width: 8px; height: 8px;
    border-radius: 99px;
    background: var(--bad);
    border: 2px solid var(--bg);
}

.topbar-search { position: relative; flex: 1; max-width: 420px; }
.topbar-search .ico, .topbar-search > i {
    position: absolute; left: .75rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    width: 16px; height: 16px;
    pointer-events: none;
}
.topbar-search input {
    width: 100%;
    height: 38px;
    padding: 0 2.8rem 0 2.2rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    font-size: .875rem;
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.topbar-search input::placeholder { color: var(--text-faint); }
.topbar-search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16);
}
.topbar-search kbd {
    position: absolute; right: .5rem; top: 50%;
    transform: translateY(-50%);
    font: 500 .6875rem/1 var(--font-mono);
    padding: .25rem .4rem;
    border-radius: 5px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.app-content { flex: 1; padding: 1.5rem 1.6rem 3rem; }
.container-app { width: 100%; max-width: 1320px; margin-inline: auto; }
main.app-content { view-transition-name: conteudo; }

.app-footer {
    padding: 1rem 1.5rem 1.4rem;
    text-align: center;
    font-size: .75rem;
    color: var(--text-faint);
}
.app-footer a { color: var(--text-muted); font-weight: 500; }

/* ---------- 5. Cabeçalho de página ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.page-head h1 { font-size: 1.625rem; margin: 0; line-height: 1.1; }
.page-head .subtitle { color: var(--text-muted); font-size: .8125rem; margin-top: .3rem; }
.page-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.breadcrumb-mini {
    display: flex; align-items: center; gap: .35rem;
    font-size: .75rem; color: var(--text-faint);
    margin-bottom: .35rem;
}
.breadcrumb-mini a { color: var(--text-muted); }

/* ---------- 6. Cartões ---------- */
.card {
    --bs-card-bg: var(--surface);
    --bs-card-color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: none;
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.card-header:first-child { border-radius: var(--r-md) var(--r-md) 0 0; }
.card-header h2, .card-header h3, .card-header .card-title {
    font: 700 1rem/1.25 var(--font-display);
    letter-spacing: -.01em;
    margin: 0;
}
.card-header .card-title i { display: none; }
.card-body { padding: 1rem; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: .8rem 1rem; }
.card-footer:last-child { border-radius: 0 0 var(--r-md) var(--r-md); }

.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.card-link-block { display: block; color: inherit; }
.card-link-block:hover { color: inherit; }

/* Indicador: a proposta tirou o ícone colorido; número em mono, rótulo pequeno. */
.stat-card { position: relative; padding: .95rem 1rem; }
.stat-icon { display: none; }
.stat-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.stat-value {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin-top: .2rem;
    color: var(--text);
}
.stat-value small { font-size: .85rem; font-weight: 500; color: var(--text-muted); }
.stat-trend { font-size: .75rem; margin-top: .3rem; display: flex; align-items: center; gap: .25rem; color: var(--text-muted); }

/* Faixa de números (painel, caixa, comissões, relatórios): um bloco só,
   divisórias de 1px — no lugar de quatro cartões grandes. */
.kpis {
    display: grid;
    grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}
/* Cinco números numa linha (/admin/sistema); no celular vale o 2 da media query abaixo. */
.kpis-5 { --kpi-cols: 5; }
.kpi { background: var(--surface); padding: .85rem 1rem; display: grid; gap: .2rem; align-content: start; min-width: 0; }
.kpi-label { font-size: .75rem; color: var(--text-muted); }
.kpi-value { font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-note { font-size: .75rem; color: var(--text-muted); }
.kpi-note.up { color: var(--ok); }
.kpi-note.down { color: var(--bad); }

/* Painel de conteúdo (bloco branco com cabeçalho leve) */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem;
    display: grid;
    gap: .75rem;
    align-content: start;
    min-width: 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.panel-head h2, .panel-head h3 { font-size: 1.0625rem; margin: 0; letter-spacing: -.01em; }
.panel-head a { font-size: .8125rem; color: var(--brand-text); white-space: nowrap; }
.panel-head .num { font-size: .75rem; color: var(--text-muted); }

/* ---------- 7. Botões ---------- */
.btn {
    --bs-btn-font-weight: 600;
    border-radius: var(--r-sm);
    font-size: .875rem;
    font-weight: 600;
    padding: .5rem .9rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    transition: transform .12s var(--ease), background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
    border-width: 1px;
}
.btn i { font-size: 1rem; }
.btn:active { transform: scale(.98); }
.btn-lg { padding: .7rem 1.2rem; font-size: .95rem; border-radius: 12px; min-height: 48px; }
.btn-sm { padding: .3rem .65rem; font-size: .8125rem; min-height: 32px; }

.btn-primary, .btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-ink);
}
.btn-primary:hover, .btn-primary:focus-visible, .btn-brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: var(--brand-ink);
}
.btn-primary:active, .btn-primary.active { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; color: var(--brand-ink) !important; }
[data-bs-theme="dark"] .btn-primary:hover { filter: brightness(1.08); background: var(--brand); border-color: var(--brand); }
/* O desabilitado do Bootstrap é azul e mais específico que o nosso. */
.btn-primary:disabled, .btn-primary.disabled {
    background: var(--brand); border-color: var(--brand); color: var(--brand-ink);
    opacity: .45; box-shadow: none; transform: none;
}

.btn-outline-secondary, .btn-light {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--surface);
}
.btn-outline-secondary:hover, .btn-light:hover, .btn-outline-secondary:active, .btn-outline-secondary.active {
    background: var(--surface-hover) !important;
    border-color: var(--border-strong) !important;
    color: var(--text) !important;
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-text); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); color: var(--brand-text); }
.btn-warning { background: var(--warn); border-color: var(--warn); color: #fff; }
[data-bs-theme="dark"] .btn-warning { color: #1d1a17; }
.btn-warning:hover { background: var(--warn); border-color: var(--warn); color: #fff; filter: brightness(1.08); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
[data-bs-theme="dark"] .btn-danger { color: #1d1a17; }
.btn-danger:hover { background: var(--bad); border-color: var(--bad); filter: brightness(1.08); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
[data-bs-theme="dark"] .btn-success { color: #0d1f16; }
.btn-outline-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn-outline-danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }

.btn-group-tight .btn { border-radius: var(--r-xs); }
.btn-block { width: 100%; justify-content: center; padding: .8rem; border-radius: 12px; font-size: .95rem; min-height: 48px; }

.btn-close { filter: none; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ---------- 8. Formulários ---------- */
.form-label { font-size: .8125rem; font-weight: 500; color: var(--text-muted); margin-bottom: .35rem; }
.form-label .req { color: var(--bad); }

.form-control, .form-select {
    border-radius: var(--r-sm);
    border-color: var(--border-strong);
    background-color: var(--surface);
    color: var(--text);
    font-size: .9375rem;
    padding: .55rem .8rem;
    min-height: 42px;
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.form-control-sm, .form-select-sm { min-height: 36px; font-size: .875rem; padding: .35rem .65rem; }
.form-control-lg, .form-select-lg { min-height: 48px; font-size: 1rem; }
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16);
    background-color: var(--surface);
    color: var(--text);
}
.form-control:disabled, .form-control[readonly] { background: var(--surface-2); color: var(--text-muted); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--bad); }
.invalid-feedback { font-size: .78rem; color: var(--bad); }
.form-text { font-size: .78rem; color: var(--text-muted); }
textarea.form-control { min-height: 92px; line-height: 1.55; }
.form-control-color { min-height: 42px; padding: .3rem; }

.input-group-text {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text-muted);
    font-size: .84rem;
    border-radius: var(--r-sm);
}

.form-check-input { border-color: var(--border-strong); background-color: var(--surface); cursor: pointer; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.4em; height: 1.35em; }
.form-check { min-height: 1.6rem; }
.form-check-label { cursor: pointer; }

.field-icon { position: relative; }
.field-icon > i {
    position: absolute; left: .78rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: .95rem;
    pointer-events: none;
}
.field-icon > .form-control { padding-left: 2.3rem; }
.field-icon:focus-within > i { color: var(--brand-text); }

/* Interruptor (gorjeta da comanda, opções liga/desliga) */
.switch {
    position: relative; flex: none;
    width: 44px; height: 26px;
    border-radius: 99px;
    background: var(--border-strong);
    border: 0;
    transition: background var(--normal) var(--ease);
    cursor: pointer;
}
.switch::after {
    content: '';
    position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / .25);
    transition: transform var(--normal) var(--spring);
}
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* Seletor segmentado e abas */
.segmented {
    display: inline-flex;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 3px;
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.segmented a, .segmented button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: .8125rem;
    font-weight: 500;
    padding: .4rem .8rem;
    min-height: 32px;
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    border-radius: 7px;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
    white-space: nowrap;
}
.segmented a:hover, .segmented button:hover { color: var(--text); text-decoration: none; }
.segmented a.active, .segmented button.active, .segmented [aria-pressed="true"], .segmented [aria-selected="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

.nav-pills, .nav-tabs {
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    border: 0;
    padding: 3px;
    background: var(--bg-subtle);
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    max-width: 100%;
    width: fit-content;
}
.nav-pills .nav-link, .nav-tabs .nav-link {
    white-space: nowrap; border-radius: 7px; font-size: .8125rem; font-weight: 500;
    border: 0; padding: .45rem .85rem; color: var(--text-muted); background: transparent;
    display: inline-flex; align-items: center; gap: .35rem; min-height: 34px;
}
.nav-pills .nav-link:hover, .nav-tabs .nav-link:hover { color: var(--text); }
.nav-pills .nav-link.active, .nav-tabs .nav-link.active {
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs);
}

/* Fichas: abas por barbeiro, serviços no "novo horário" */
.tabs-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs-chips::-webkit-scrollbar { display: none; }
.chip-tab {
    flex: none;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 13px 6px 6px;
    min-height: 40px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .875rem; font-weight: 500;
    color: var(--text-muted);
    transition: background var(--normal) var(--ease), color var(--normal) var(--ease), border-color var(--normal) var(--ease);
}
.chip-tab[aria-selected="true"], .chip-tab.active {
    background: var(--text); color: var(--bg); border-color: var(--text);
}
.chip-tab .avatar { width: 26px; height: 26px; font-size: .625rem; }

.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice {
    padding: .5rem .8rem;
    min-height: 44px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: .875rem;
    display: inline-flex; align-items: center; gap: .4rem;
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), color var(--fast) var(--ease), transform .12s var(--ease);
}
.choice:active { transform: scale(.97); }
.choice small { color: var(--text-muted); font-family: var(--font-mono); font-size: .75rem; }
.choice[aria-pressed="true"], .choice.active, input:checked + .choice {
    border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); font-weight: 600;
}
.choice[aria-pressed="true"] small, input:checked + .choice small { color: var(--brand-text); }

/* ---------- 9. Tabelas ---------- */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}
.table-wrap .table-responsive { border-radius: inherit; }

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-hover-bg: var(--surface-hover);
    --bs-table-border-color: var(--border);
    color: var(--text);
    margin: 0;
    font-size: .875rem;
}
.table > thead th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font: 500 .6875rem/1.2 var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: .65rem .9rem;
    white-space: nowrap;
}
.table > tbody > tr { transition: background var(--fast) var(--ease); }
.table > tbody > tr:hover > * { background: var(--surface-hover); }
.table > tbody td, .table > tfoot td { padding: .7rem .9rem; border-color: var(--border); vertical-align: middle; }
.table > tbody > tr:last-child td { border-bottom: 0; }
.table > tfoot td { border-bottom: 0; }
.table > tfoot tr:first-child td { border-top: 1px solid var(--border); }
.table-row-link, [data-href] { cursor: pointer; }

.th-sort { color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
.th-sort:hover { color: var(--brand-text); }

/* ---------- 10. Pílulas e fichas ---------- */
.badge-soft, .pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 99px;
    background: var(--neutral-bg);
    color: var(--text-muted);
    white-space: nowrap;
    line-height: 1.45;
}
.badge-soft .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex-shrink: 0; }
.badge-soft.ok, .pill.ok       { background: var(--ok-bg);   color: var(--ok); }
.badge-soft.warn, .pill.warn   { background: var(--warn-bg); color: var(--warn); }
.badge-soft.bad, .pill.bad     { background: var(--bad-bg);  color: var(--bad); }
.badge-soft.info, .pill.info   { background: var(--info-bg); color: var(--info); }
.badge-soft.brand, .pill.brand { background: var(--brand-soft); color: var(--brand-text); }
/* "Na cadeira": a única pílula cheia, com o ponto pulsando — é o "agora". */
.pill.live, .badge-soft.live {
    background: var(--brand); color: var(--brand-ink);
    position: relative; padding-left: 1.15rem;
}
.pill.live::before, .badge-soft.live::before {
    content: ''; position: absolute; left: .45rem; top: 50%;
    width: 6px; height: 6px; margin-top: -3px;
    border-radius: 50%; background: currentColor;
    animation: pulse 1.6s ease-in-out infinite;
}
.badge-soft.live .dot { display: none; }
@keyframes pulse { 50% { opacity: .25; } }

.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .78rem;
    padding: .3rem .65rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    color: var(--text-muted);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip .btn-close { font-size: .55rem; opacity: .6; }

.badge { font-weight: 600; }

/* ---------- 11. Avatar ---------- */
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-size: .75rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar-xs { width: 24px; height: 24px; font-size: .6rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .68rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.05rem; }
.avatar-xl { width: 76px; height: 76px; font-size: 1.5rem; font-family: var(--font-display); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -9px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- 12. Progresso e gráficos ---------- */
.progress { height: 6px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.progress-bar { background: var(--brand); border-radius: 99px; transition: width .6s var(--ease-out); }
.progress-thin { height: 4px; }
.progress-bar.ok   { background: var(--ok); }
.progress-bar.warn { background: var(--warn); }
.progress-bar.bad  { background: var(--bad); }

.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--bg-subtle); }
.ring .value { stroke: var(--brand); transition: stroke-dashoffset .8s var(--ease-out); }

/* Gráfico de barras em SVG próprio (views/partials/bars.php) */
.chart svg { width: 100%; height: auto; display: block; max-height: 210px; }
/* Os dias que não são hoje ficam mais claros, mas ainda à vista: a .3 de antes,
   no tema escuro e no celular, as barras quase sumiam no fundo do cartão. */
.chart .bar { fill: var(--brand); opacity: .42; }
[data-bs-theme="dark"] .chart .bar:not(.hi):not(.prev) { opacity: .62; }
.chart .bar.hi { opacity: 1; }
.chart .bar.prev { fill: var(--text-faint); opacity: .25; }
.chart text { fill: var(--text-muted); font: 500 10.5px var(--font-mono); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .val { fill: var(--text); font-weight: 600; }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .75rem; color: var(--text-muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; background: var(--brand); }
.chart-legend i.prev { background: var(--text-faint); opacity: .4; }

/* ---------- 13. Linha do tempo ---------- */
.timeline { position: relative; padding-left: 1.65rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 11px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(var(--border), transparent);
}
.timeline-item { position: relative; padding-bottom: 1.15rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -1.65rem; top: 2px;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface);
    border: 2px solid var(--border);
    font-size: .68rem;
    color: var(--text-muted);
    z-index: 1;
}
.timeline-dot.brand { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }
.timeline-dot.ok    { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.timeline-dot.bad   { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }

/* ---------- 14. Estado vazio ---------- */
.empty-state { text-align: center; padding: 2.5rem 1.25rem; }
.empty-state .icon {
    width: 56px; height: 56px;
    margin: 0 auto .9rem;
    border-radius: 16px;
    display: grid; place-items: center;
    font-size: 1.45rem;
    background: var(--bg-subtle);
    border: 1px dashed var(--border-strong);
    color: var(--text-muted);
}
.empty-state h3 { font-size: 1.0625rem; margin-bottom: .3rem; }
.empty-state p { color: var(--text-muted); font-size: .875rem; max-width: 380px; margin: 0 auto 1.1rem; }

/* ---------- 15. Menus, modais, folhas ---------- */
.dropdown-menu {
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-color: var(--text);
    --bs-dropdown-border-color: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    padding: .35rem;
    font-size: .875rem;
}
.dropdown-menu.show { animation: dropIn var(--fast) var(--ease-out); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } }
.dropdown-item {
    border-radius: 7px;
    padding: .55rem .65rem;
    color: var(--text);
    display: flex; align-items: center; gap: .6rem;
    min-height: 40px;
}
.dropdown-item i { font-size: 1rem; color: var(--text-muted); width: 18px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-hover); color: var(--text); }
.dropdown-item.text-danger i { color: inherit; }
.dropdown-item.text-danger:hover { background: var(--bad-bg); color: var(--bad); }
.dropdown-divider { border-color: var(--border); margin: .3rem 0; }
.dropdown-header { font: 500 .6875rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }

.modal { --bs-modal-bg: var(--surface); --bs-modal-color: var(--text); }
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 1rem 1.15rem; }
.modal-title { font: 700 1.125rem/1.2 var(--font-display); letter-spacing: -.01em; }
.modal-body { padding: 1.15rem; }
.modal-footer { border-top: 1px solid var(--border); padding: .8rem 1.15rem; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal.fade .modal-dialog { transform: translateY(12px) scale(.985); transition: transform var(--slow) var(--spring), opacity var(--normal); }
.modal.show .modal-dialog { transform: none; }
.modal-backdrop { --bs-backdrop-bg: #0a0806; }
.modal-backdrop.show { opacity: .42; }

.offcanvas { background: var(--surface); color: var(--text); border-color: var(--border); }
.offcanvas-header { border-bottom: 1px solid var(--border); }

.accordion {
    --bs-accordion-bg: var(--surface);
    --bs-accordion-color: var(--text);
    --bs-accordion-border-color: var(--border);
    --bs-accordion-btn-color: var(--text);
    --bs-accordion-active-bg: var(--surface-2);
    --bs-accordion-active-color: var(--text);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16);
}
.accordion-button { font-weight: 600; min-height: 48px; }

/* Folha que sobe (bottom sheet) — <dialog> nativo: foco preso e Esc de graça.
   No celular encosta embaixo; no computador vira painel central. */
.sheet {
    border: 0;
    padding: 0;
    margin: auto auto 0;
    width: 100%;
    max-width: 560px;
    max-height: min(92dvh, 860px);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 -12px 36px -12px rgb(0 0 0 / .4);
    overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheetUp var(--slow) var(--spring); }
.sheet.closing { animation: sheetDown .18s var(--ease) forwards; }
.sheet::backdrop { background: rgb(10 8 6 / .42); animation: fadeIn var(--normal) var(--ease); }
.sheet.closing::backdrop { animation: fadeOut .18s var(--ease) forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet-grab {
    display: block;
    width: 100%; height: 22px;
    border: 0; background: transparent;
    flex: none; cursor: grab; touch-action: none;
}
.sheet-grab::before {
    content: ''; display: block; width: 38px; height: 4px; border-radius: 4px;
    background: var(--border-strong); margin: 9px auto 0;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 1rem .5rem; flex: none; }
.sheet-head h2 { font-size: 1.1875rem; margin: 0; }
.sheet-body { padding: .25rem 1rem 1rem; overflow-y: auto; display: grid; gap: 1rem; overscroll-behavior: contain; }
.sheet-foot {
    flex: none;
    padding: .75rem 1rem calc(.85rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: grid; gap: .6rem;
}
.sheet-sum { display: flex; justify-content: space-between; font-size: .8125rem; color: var(--text-muted); }
.sheet-sum b { color: var(--text); font-family: var(--font-mono); }
.field { display: grid; gap: .4rem; }
.field > label, .field > .label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }

@media (min-width: 768px) {
    .sheet { margin: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
    .sheet[open] { animation: popIn var(--slow) var(--spring); }
    .sheet.closing { animation: popOut .16s var(--ease) forwards; }
    .sheet-grab { height: 10px; pointer-events: none; }
    .sheet-grab::before { display: none; }
}
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes popOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Busca de cliente dentro da folha */
.combo { position: relative; }
.combo-list {
    list-style: none; margin: .35rem 0 0; padding: .25rem;
    border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--surface); box-shadow: var(--shadow-md);
    max-height: 240px; overflow-y: auto;
}
.combo-list button {
    width: 100%; text-align: left; border: 0; background: transparent;
    display: flex; justify-content: space-between; gap: .5rem; align-items: center;
    padding: .55rem .6rem; border-radius: 7px; min-height: 44px; color: var(--text);
}
.combo-list button:hover, .combo-list button:focus-visible { background: var(--surface-hover); }
.combo-list small { color: var(--text-muted); font-family: var(--font-mono); font-size: .75rem; }
.combo-picked {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .7rem; border-radius: var(--r-sm);
    border: 1px solid var(--border-strong); background: var(--bg);
    min-height: 48px;
}
.combo-picked b { font-weight: 600; }
.combo-picked small { color: var(--text-muted); font-family: var(--font-mono); }

/* Grade de horários (folha e página pública) */
.times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.times button {
    min-height: 44px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: 500 .875rem var(--font-mono);
    font-variant-numeric: tabular-nums;
    transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform .12s var(--ease);
}
.times button:active { transform: scale(.96); }
.times button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.times button:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; background: transparent; }
@media (min-width: 480px) { .times { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Esqueleto: contorno do que vai chegar, no lugar de spinner */
.skeleton {
    background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--surface-hover) 37%, var(--bg-subtle) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: var(--r-xs);
    color: transparent !important;
}
.skeleton-line { height: 12px; border-radius: 6px; }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ---------- 16. Alertas e avisos (toast) ---------- */
.alert {
    border: 1px solid transparent;
    border-radius: var(--r-md);
    font-size: .875rem;
    padding: .75rem .9rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}
.alert i { font-size: 1.05rem; margin-top: .05rem; flex-shrink: 0; }
.alert-success { background: var(--ok-bg);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert-danger  { background: var(--bad-bg);  color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert-info    { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert strong { color: inherit; }
.alert .btn { flex-shrink: 0; }

.toast-stack {
    position: fixed;
    right: 1rem; top: calc(var(--topbar-h) + .75rem);
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}
.toast-item {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: .6rem;
    background: var(--text);
    color: var(--bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: .75rem .85rem;
    font-size: .875rem;
    animation: toastIn var(--slow) var(--spring);
}
.toast-item.leaving { animation: toastOut .18s var(--ease) forwards; }
.toast-item i { font-size: 1.05rem; margin-top: .05rem; }
.toast-item.success i { color: #5cc792; }
.toast-item.danger i  { color: #f08a80; }
.toast-item.warning i { color: #e8a64a; }
.toast-item.info i    { color: #7ab8e0; }
[data-bs-theme="dark"] .toast-item.success i { color: var(--ok); filter: brightness(.7); }
[data-bs-theme="dark"] .toast-item.danger i  { color: #b42318; }
[data-bs-theme="dark"] .toast-item.warning i { color: #8f5200; }
[data-bs-theme="dark"] .toast-item.info i    { color: #1f5f8b; }
.toast-item .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .7; }
[data-bs-theme="dark"] .toast-item .btn-close { filter: none; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ---------- 17. Entrada de conteúdo ---------- */
@keyframes fadeUp { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* Só opacidade no contêiner da página: transform aqui prenderia os modais
   (position: fixed) dentro do conteúdo. O deslize fica no .stagger. */
.page-enter { animation: fadeIn var(--normal) var(--ease-out) both; }
.stagger > * { animation: fadeUp var(--slow) var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(6) { animation-delay: .25s; }
.stagger > *:nth-child(7) { animation-delay: .3s; }
.stagger > *:nth-child(n+8) { animation-delay: .35s; }
/* A lista entra em sequência só na primeira carga: depois de uma troca de aba
   o JS reaplica a classe (.list-anim), e o leitor de tela não ouve nada a mais. */
.list-anim > * { animation: fadeUp var(--slow) var(--ease-out) both; }
.list-anim > *:nth-child(2) { animation-delay: .04s; }
.list-anim > *:nth-child(3) { animation-delay: .08s; }
.list-anim > *:nth-child(4) { animation-delay: .12s; }
.list-anim > *:nth-child(5) { animation-delay: .16s; }
.list-anim > *:nth-child(6) { animation-delay: .2s; }
.list-anim > *:nth-child(n+7) { animation-delay: .22s; }

/* Troca de página: cross-fade curto; topo e menu têm nome próprio e não piscam. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
::view-transition-old(conteudo) { animation: .16s var(--ease) both fadeOut; }
::view-transition-new(conteudo) { animation: .22s var(--ease-out) both fadeUp; }

/* ---------- 18. Painel: "Agora e a seguir" ---------- */
.now { display: grid; }
.now-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .6rem .25rem;
    border-top: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    transition: background var(--fast) var(--ease);
}
.now-row:first-child { border-top: 0; }
.now-row:hover { background: var(--surface-hover); color: var(--text); }
.now-row time { font-size: .8125rem; color: var(--text-muted); }
.now-row .who { display: grid; min-width: 0; }
.now-row .who b { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-row .who small { color: var(--text-muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-row .tags { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.now-row.is-now time { color: var(--brand-text); font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.dash-side { display: grid; gap: 1rem; min-width: 0; }
.dash-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem; align-items: start; }

.list-rows { display: grid; }
.list-rows > * { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--border); min-height: 44px; }
.list-rows > *:first-child { border-top: 0; }

/* ---------- 19. Agenda ---------- */
.agenda-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.agenda-day-label { font: 500 .8125rem var(--font-mono); color: var(--text-muted); }

.agenda-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; align-items: start; }
.agenda-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); min-width: 0; }
.agenda-col-head {
    display: flex; align-items: center; gap: .6rem;
    padding: .75rem .9rem; border-bottom: 1px solid var(--border);
    font: 700 1rem var(--font-display); letter-spacing: -.01em;
}
.agenda-col-head .count { margin-left: auto; font: 500 .75rem var(--font-mono); color: var(--text-muted); }
.agenda-col-body { padding: .75rem; display: grid; gap: .5rem; }

.slot { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: .6rem; align-items: stretch; }
.slot > time { font-size: .75rem; color: var(--text-muted); padding-top: .7rem; }
.slot-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: 12px;
    padding: .6rem .75rem;
    display: flex; align-items: center; gap: .6rem;
    min-height: 52px;
    min-width: 0;
    color: var(--text);
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform .12s var(--ease);
}
.agenda-col .slot-card { background: var(--surface-2); }
.slot-card:hover { box-shadow: var(--shadow-sm); color: var(--text); }
.slot-card:active { transform: scale(.99); }
.slot-card .who { display: grid; min-width: 0; flex: 1; }
.slot-card .who b { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-card .who small { color: var(--text-muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-card.is-done { border-left-color: var(--ok); opacity: .72; }
.slot-card.is-miss { border-left-color: var(--bad); opacity: .72; }
.slot-card.is-live { border-left-color: var(--brand); box-shadow: 0 0 0 1px rgba(var(--brand-rgb), .35); }
.slot-card.is-wait { border-left-color: var(--warn); }
.slot-card .card-link { position: absolute; inset: 0; border-radius: inherit; }
.slot-card .card-link:focus-visible { outline-offset: -2px; }
.slot-card .side { position: relative; z-index: 1; display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }

.slot-free {
    display: flex; align-items: center; gap: .5rem;
    width: 100%;
    min-height: 44px;
    padding: .5rem .75rem;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: .8125rem;
    text-align: left;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.slot-free:hover, .slot-free:active { background: var(--brand-soft); color: var(--brand-text); border-color: rgba(var(--brand-rgb), .5); text-decoration: none; }
.slot-free .ico { width: 15px; height: 15px; }
.slot-block {
    display: flex; align-items: center; gap: .5rem; min-height: 40px;
    padding: .45rem .75rem; border-radius: 12px; font-size: .8125rem; color: var(--text-muted);
    background: repeating-linear-gradient(135deg, var(--bg-subtle) 0 6px, transparent 6px 12px);
    border: 1px solid var(--border);
}
.slot-now { display: flex; align-items: center; gap: .5rem; color: var(--bad); font: 500 .6875rem var(--font-mono); }
.slot-now::after { content: ''; flex: 1; height: 1px; background: var(--bad); opacity: .6; }

.agenda-item {
    display: flex; gap: .8rem; align-items: center;
    padding: .65rem .8rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    min-width: 0;
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.agenda-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.agenda-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; font-size: .8125rem; min-width: 44px; color: var(--text-muted); }

.day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 640px; }
.day-strip a {
    display: grid; justify-items: center; gap: 1px;
    padding: .4rem 0; border-radius: 10px; min-height: 52px;
    color: var(--text-muted); border: 1px solid transparent;
}
.day-strip a:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.day-strip .wd { font: 500 .625rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.day-strip .dd { font: 600 1rem var(--font-mono); color: var(--text); }
.day-strip a.active { background: var(--text); border-color: var(--text); }
.day-strip a.active .wd, .day-strip a.active .dd { color: var(--bg); }
.day-strip a.today:not(.active) .dd { color: var(--brand-text); }
.day-strip .n { font: 500 .625rem var(--font-mono); color: var(--text-faint); }
.day-strip a.active .n { color: var(--bg); opacity: .8; }

/* ---------- 20. Comanda estilo balcão ---------- */
.pos { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .pos { grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); align-items: start; } }
.pos-items { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .1rem .9rem; }
.pos-item { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .65rem 0; border-top: 1px solid var(--border); min-height: 52px; }
.pos-item:first-child { border-top: 0; }
.pos-item .what { min-width: 0; flex: 1; display: grid; }
.pos-item .what b { font-weight: 500; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-item .what small { color: var(--text-muted); font-size: .75rem; }
.pos-item .amount { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }
.pos-item.is-new { animation: fadeUp var(--slow) var(--ease-out) both; }
.pos-quick { display: grid; gap: .5rem; }
.pos-quick .choices { gap: 6px; }
.pos-totals { display: grid; gap: .25rem; padding: .75rem .9rem; border-radius: 12px; background: var(--bg-subtle); }
.pos-totals div { display: flex; justify-content: space-between; font-size: .8125rem; color: var(--text-muted); }
.pos-totals div span:last-child { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pos-totals .big { color: var(--text); font-size: .95rem; font-weight: 600; align-items: baseline; }
.pos-totals .big span:last-child { font-size: 1.375rem; font-weight: 600; }
.pos-tip { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; font-size: .875rem; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
.pay-methods label { margin: 0; }
.pay-methods input { position: absolute; opacity: 0; pointer-events: none; }
.pay-methods .choice { width: 100%; justify-content: center; }
.pay-methods input:focus-visible + .choice { outline: 2px solid var(--brand); outline-offset: 2px; }
.cash-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
.cash-quick button {
    min-height: 48px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: 500 .9rem var(--font-mono);
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform .12s var(--ease);
}
.cash-quick button:active { transform: scale(.96); }
.cash-quick button[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); }

.change-box {
    display: grid; gap: .2rem;
    padding: .75rem .9rem;
    border-radius: 12px;
    background: var(--bg-subtle);
    transition: background-color var(--normal) var(--ease), color var(--normal) var(--ease);
}
.change-box .change-line { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.change-box .change-line [data-change-out] { font: 600 1.375rem var(--font-mono); font-variant-numeric: tabular-nums; }
.change-box.is-change { background: var(--ok-bg); }
.change-box.is-change .change-line { color: var(--ok); }
.change-box.is-short, .change-box.is-invalid { background: var(--bad-bg); }
.change-box.is-short .change-line, .change-box.is-invalid .change-line,
.change-box.is-invalid [data-change-hint] { color: var(--bad) !important; }
.change-box.flash [data-change-out] { animation: tick .25s var(--ease); }
@keyframes tick { from { transform: translateY(-4px); opacity: .4; } to { transform: none; opacity: 1; } }

/* Check desenhado ao concluir (comanda fechada, horário marcado) */
.done-layer {
    position: fixed; inset: 0; z-index: 1095;
    display: grid; place-items: center; align-content: center; gap: .75rem;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    text-align: center; padding: 1.5rem;
    animation: fadeIn var(--normal) var(--ease);
}
.done-layer h2 { font-size: 1.5rem; margin: .25rem 0 0; }
.done-layer p { color: var(--text-muted); margin: 0; }
.done-layer .num-big { font: 600 1.75rem var(--font-mono); color: var(--ok); }
.check-draw { width: 84px; height: 84px; }
.check-draw circle { fill: var(--ok-bg); stroke: var(--ok); stroke-width: 3; stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw .4s var(--ease) forwards; }
.check-draw path { fill: none; stroke: var(--ok); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .25s .32s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- 21. Barra inferior (celular) e botão flutuante ---------- */
.mobile-nav {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1035;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--border);
    padding: .3rem .35rem calc(.3rem + env(safe-area-inset-bottom));
    view-transition-name: tabbar;
}
.mobile-nav-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.mobile-nav a, .mobile-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px;
    padding: .3rem .2rem;
    font-size: .6875rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 0; background: transparent;
    border-radius: 10px;
    transition: color var(--fast) var(--ease);
}
.mobile-nav .ico { width: 22px; height: 22px; transition: transform var(--normal) var(--spring); }
.mobile-nav a.active { color: var(--brand-text); font-weight: 600; }
.mobile-nav a:active .ico, .mobile-nav button:active .ico { transform: scale(.88); }

.fab {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
    z-index: 1036;
    width: 56px; height: 56px;
    border-radius: 18px;
    border: 0;
    background: var(--brand);
    color: var(--brand-ink);
    box-shadow: var(--shadow-brand);
    place-items: center;
    transition: transform var(--fast) var(--ease);
}
.fab:hover { color: var(--brand-ink); }
.fab:active { transform: scale(.94); }
.fab .ico { width: 24px; height: 24px; stroke-width: 2; }

/* ---------- 22. Utilitários ---------- */
.divider-text {
    display: flex; align-items: center; gap: .75rem;
    color: var(--text-faint); font-size: .78rem;
    margin: 1.1rem 0;
}
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.hover-reveal .reveal { opacity: 0; transition: opacity var(--fast) var(--ease); }
.hover-reveal:hover .reveal, .hover-reveal:focus-within .reveal { opacity: 1; }
@media (hover: none) { .hover-reveal .reveal { opacity: 1; } }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Datas em português: só a primeira letra sobe. */
.first-cap { display: inline-block; }
.first-cap::first-letter { text-transform: uppercase; }
.cursor-pointer { cursor: pointer; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; }

.bg-surface { background: var(--surface) !important; }
.bg-subtle  { background: var(--bg-subtle) !important; }
.bg-body    { background: var(--bg) !important; }
.border-app { border-color: var(--border) !important; }
.border, .border-top, .border-bottom { border-color: var(--border) !important; }
.rounded-app { border-radius: var(--r-md) !important; }
.row-line { border-color: var(--border) !important; }

/* ---------- 23. Responsivo ---------- */
@media (max-width: 1199.98px) {
    .app-content { padding: 1.25rem 1.15rem 3rem; }
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); width: min(300px, 86vw); }
    body.sidebar-open .app-sidebar { transform: none; }
    .app-main { margin-left: 0 !important; }
    body.sidebar-collapsed .app-sidebar { width: min(300px, 86vw); }
    body.sidebar-collapsed .nav-label, body.sidebar-collapsed .brand-text, body.sidebar-collapsed .nav-badge { display: revert; }
    .sidebar-nav .nav-link { min-height: 44px; }

    .sidebar-backdrop {
        position: fixed; inset: 0;
        background: rgb(10 8 6 / .42);
        z-index: 1039;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--normal) var(--ease);
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
}

@media (max-width: 767.98px) {
    body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
    .app-content { padding: 1rem .9rem 1.5rem; }
    /* Com o botão flutuante, o fim da página sobe a altura dele: o último botão
       do formulário (o "Cancelar" ao lado do "Salvar") ficava embaixo do "+". */
    body:has(.fab) .app-content { padding-bottom: calc(1.5rem + 56px + 14px); }
    .app-topbar { padding: 0 .6rem 0 .75rem; gap: .25rem; }
    /* O aviso desce do topo, logo abaixo da barra: embaixo, ele ficava em cima do
       botão "Salvar" do fim do formulário — o mesmo que acabou de dar o erro — e o
       toque caía no aviso (visto no cadastro e em Cliente novo, 390 px). */
    .toast-stack { top: calc(var(--topbar-h) + .5rem + env(safe-area-inset-top)); bottom: auto; right: .75rem; left: .75rem; width: auto; }
    @keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.98); } }
    @keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.98); } }

    .page-head { margin-bottom: 1rem; align-items: flex-start; }
    .page-head h1 { font-size: 1.375rem; }
    .page-head-actions { width: 100%; }
    .page-head-actions > .btn, .page-head-actions > form, .page-head-actions > a { flex: 1; }
    .page-head-actions > form .btn { width: 100%; }

    .card-body { padding: .9rem; }
    .card-header { padding: .75rem .9rem; }

    .kpis { --kpi-cols: 2; }
    .kpi { padding: .75rem .85rem; }
    .kpi-value, .stat-value { font-size: 1.2rem; }

    .mobile-nav { display: block; }
    .fab { display: grid; }
    .app-footer { display: none; }

    .agenda-cols { grid-template-columns: minmax(0, 1fr); }

    /* Tabela vira lista de cartões no celular */
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tfoot { display: block; width: 100%; }
    .table-cards tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 12px;
        margin: 0 0 .6rem;
        padding: .35rem 0;
        background: var(--surface);
    }
    .table-wrap .table-cards tbody tr, .card .table-cards tbody tr { margin: .6rem; }
    .table-cards tbody tr:hover > * { background: transparent; }
    .table-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        border: 0;
        padding: .35rem .85rem;
        min-height: 32px;
        text-align: right;
    }
    .table-cards tbody td::before {
        content: attr(data-label);
        font: 500 .6875rem var(--font-mono);
        text-transform: uppercase;
        letter-spacing: .07em;
        color: var(--text-muted);
        flex-shrink: 0;
        text-align: left;
    }
    .table-cards tbody td[data-label=""]::before, .table-cards tbody td:not([data-label])::before { content: none; }
    .table-cards tbody td.cell-main { display: block; padding-top: .55rem; font-weight: 600; text-align: left; }
    .table-cards tbody td.cell-main::before { content: none; }
    .table-cards tbody td[colspan] { display: block; text-align: center; }
    .table-cards tfoot tr { display: flex; justify-content: space-between; padding: .2rem .85rem; }
    .table-cards tfoot td { border: 0; padding: .25rem 0; }
    .table-cards tfoot td:empty { display: none; }

    .modal-dialog { margin: .5rem; }
    .modal-footer .btn { flex: 1; }
    .btn, .form-control, .form-select { min-height: 44px; }
    .btn-sm { min-height: 40px; }
    .icon-btn { width: 44px; height: 44px; }
}

@media (max-width: 575.98px) {
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}

@media (hover: none) {
    .card-hover:hover { box-shadow: none; }
}

/* ---------- 24. Agendamento online (página pública) ---------- */
.bk-head {
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    padding: .75rem 0;
    position: sticky; top: 0; z-index: 20;
}
.bk-head .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.bk-head strong { font: 700 1.05rem/1.2 var(--font-display); letter-spacing: -.015em; }
.bk-wrap { max-width: 640px; margin-inline: auto; padding-inline: 1rem; }

.bk-steps { display: flex; align-items: center; gap: .35rem; margin-bottom: 1.25rem; font-size: .75rem; }
.bk-step { display: flex; align-items: center; gap: .35rem; color: var(--text-muted); white-space: nowrap; }
.bk-step .n {
    width: 24px; height: 24px; border-radius: 99px;
    display: grid; place-items: center;
    background: var(--bg-subtle); border: 1px solid var(--border);
    font: 600 .6875rem var(--font-mono);
}
.bk-step.done { color: var(--brand-text); }
.bk-step.done .n { background: var(--brand-soft); border-color: transparent; color: var(--brand-text); }
.bk-step.active { color: var(--text); font-weight: 600; }
.bk-step.active .n { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.bk-steps .sep { flex: 1; height: 1px; background: var(--border); min-width: 8px; }

.bk-pick { display: block; cursor: pointer; margin-bottom: .5rem; position: relative; }
.bk-pick input { position: absolute; opacity: 0; pointer-events: none; }
.bk-pick .box {
    display: flex; align-items: center; gap: .8rem;
    padding: .8rem .95rem;
    min-height: 56px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.bk-pick:hover .box { border-color: var(--border-strong); }
.bk-pick input:checked + .box { border-color: var(--brand); background: var(--brand-soft); }
.bk-pick input:focus-visible + .box { outline: 2px solid var(--brand); outline-offset: 2px; }
.bk-pick .check {
    width: 22px; height: 22px; border-radius: 99px; flex-shrink: 0;
    border: 1.5px solid var(--border-strong);
    display: grid; place-items: center;
    color: transparent; font-size: .7rem;
    transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.bk-pick input:checked + .box .check { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.bk-pick .price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }

.bk-days {
    display: flex; gap: .45rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.bk-day {
    flex: 0 0 auto;
    width: 62px;
    padding: .5rem .3rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    text-align: center;
    scroll-snap-align: start;
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.bk-day:hover { text-decoration: none; border-color: var(--border-strong); }
.bk-day span { display: block; }
.bk-day .wd { font: 500 .625rem var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.bk-day .dd { font: 600 1.15rem/1.3 var(--font-mono); color: var(--text); }
.bk-day .mm { font-size: .625rem; color: var(--text-muted); }
.bk-day.active { border-color: var(--text); background: var(--text); }
.bk-day.active .wd, .bk-day.active .dd, .bk-day.active .mm { color: var(--bg); }
.bk-day.full { opacity: .4; pointer-events: none; }

.bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .45rem; }
.bk-slot {
    display: grid; place-items: center;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font: 500 .95rem var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--text);
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), color var(--fast) var(--ease), transform .12s var(--ease);
}
.bk-slot:hover { border-color: var(--brand); color: var(--brand-text); text-decoration: none; }
.bk-slot:active { transform: scale(.96); }
.bk-slot.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.bk-bar {
    position: sticky; bottom: 0;
    margin: 1rem -1rem -1rem;
    padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: .85rem;
    z-index: 15;
}
.bk-bar .info { flex: 1; min-width: 0; line-height: 1.25; }
@media (min-width: 641px) {
    .bk-bar { margin-inline: 0; border-radius: 14px; border: 1px solid var(--border); }
}

/* ---------- 25. Arquivos e fotos ---------- */
.file-card { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.file-icon { width: 38px; height: 38px; border-radius: var(--r-xs); display: grid; place-items: center; background: var(--bg-subtle); color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); padding: 1.75rem 1rem; text-align: center; background: var(--surface-2); color: var(--text-muted); cursor: pointer; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .65rem; }

/* Calendário mensal (reservado; mantém as classes antigas legíveis) */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--border); gap: 1px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.cal-day { background: var(--surface); min-height: 100px; padding: .4rem; }

/* ---------- 26. Acessibilidade: movimento reduzido desliga tudo ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    @view-transition { navigation: none; }
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ---------- 27. Impressão (comprovante, PDF) ---------- */
@media print {
    .app-sidebar, .app-topbar, .mobile-nav, .fab, .no-print, .page-head-actions, .support-banner, .toast-stack { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0 !important; }
    body { background: #fff; color: #000; font-size: 11pt; padding: 0 !important; }
    .card { border: 1px solid #ddd !important; box-shadow: none !important; break-inside: avoid; }
    .print-only { display: block !important; }
    a { color: #000; text-decoration: none; }
    @page { margin: 14mm; }
}
.print-only { display: none; }

/* Ícone do tema: os dois no HTML, o CSS mostra o certo (sem piscar no carregamento). */
.theme-ico-dark, .theme-ico-light { display: inline-grid; }
.theme-ico-light { display: none; }
[data-bs-theme="dark"] .theme-ico-dark { display: none; }
[data-bs-theme="dark"] .theme-ico-light { display: inline-grid; }

/* Agenda no celular: uma aba por barbeiro (o JS liga .has-tabs; sem JS as
   colunas ficam empilhadas, como antes). */
@media (max-width: 767.98px) {
    .agenda-cols.has-tabs > .agenda-col:not(.is-active) { display: none; }
    .agenda-cols.has-tabs > .agenda-col { border: 0; background: transparent; }
    .agenda-cols.has-tabs .agenda-col-head { display: none; }
    .agenda-cols.has-tabs .agenda-col-body { padding: 0; }
    .agenda-cols.has-tabs .slot-card { background: var(--surface); }
    .agenda-bar .btn-group { flex: none; }
    .agenda-bar .segmented { flex: 1; }
    .agenda-bar .segmented a { flex: 1; }
}

/* Fichas com rádio/checkbox escondido (folha "novo horário") */
input:checked + .chip-tab { background: var(--text); color: var(--bg); border-color: var(--text); }
input:focus-visible + .chip-tab, input:focus-visible + .choice { outline: 2px solid var(--brand); outline-offset: 2px; }
.sheet .tabs-chips label, .sheet .choices label { cursor: pointer; }
.sheet fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sheet legend { float: none; width: auto; font-size: .78rem; color: var(--text-muted); font-weight: 500; }
/* Na folha, serviços numa linha que rola: a grade de horários fica à vista
   logo abaixo, como na proposta, mesmo com um catálogo comprido. */
.sheet .choices {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
    mask-image: linear-gradient(90deg, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.sheet .choices::-webkit-scrollbar { display: none; }
.sheet .choices label { flex: none; }
.sheet .choice { white-space: nowrap; }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1); opacity: .6; }

/* "Fechar comanda" sempre à vista enquanto se mexe no pagamento: gruda acima
   da barra inferior no celular (ela cobriria o botão no fim da rolagem). */
[data-close-btn] { position: sticky; bottom: .75rem; z-index: 3; box-shadow: var(--shadow-brand); }
@media (max-width: 767.98px) {
    [data-close-btn] { bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); }
}
/* Foco e rolagem automática não escondem o alvo atrás do topo nem da barra inferior. */
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
@media (max-width: 767.98px) { html { scroll-padding-bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); } }

/* Foco de teclado nos botões: anel na cor da marca (o do Bootstrap pintava o
   botão contornado de cinza-azulado). */
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .3); }
.btn-outline-secondary:focus-visible, .btn-light:focus-visible, .btn-ghost:focus-visible {
    background: var(--surface); color: var(--text); border-color: var(--brand);
}

/* Linhas de indicadores das outras telas (caixa, cliente, comissões,
   relatórios) viram a mesma faixa compacta do painel, sem mexer no HTML de cada uma. */
.row:has(> * > .stat-card) {
    --bs-gutter-x: 0; --bs-gutter-y: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(170px, 45%), 1fr));
    gap: 1px;
    margin-left: 0; margin-right: 0;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}
.row:has(> * > .stat-card) > * { width: auto; max-width: none; padding: 0; margin: 0; }
.row:has(> * > .stat-card) .stat-card { border: 0; border-radius: 0; height: 100%; }
.stat-value[style] { font-size: 1.3rem !important; }
@media (max-width: 767.98px) { .stat-value[style] { font-size: 1.15rem !important; } }
code { color: var(--brand-text); font-family: var(--font-mono); font-size: .85em; }

/* ---------- Movimento: trocar de dia na agenda "folheia" para o lado ---------- */
@keyframes vtOutLeft  { to   { opacity: 0; transform: translateX(-24px); } }
@keyframes vtInRight  { from { opacity: 0; transform: translateX(24px); } }
@keyframes vtOutRight { to   { opacity: 0; transform: translateX(24px); } }
@keyframes vtInLeft   { from { opacity: 0; transform: translateX(-24px); } }
html:active-view-transition-type(next)::view-transition-old(conteudo) { animation: .18s var(--ease) both vtOutLeft; }
html:active-view-transition-type(next)::view-transition-new(conteudo) { animation: .24s var(--ease-out) both vtInRight; }
html:active-view-transition-type(prev)::view-transition-old(conteudo) { animation: .18s var(--ease) both vtOutRight; }
html:active-view-transition-type(prev)::view-transition-new(conteudo) { animation: .24s var(--ease-out) both vtInLeft; }

/* ---------- Celular: os modais do Bootstrap viram folha que sobe ---------- */
@media (max-width: 767.98px) {
    .modal-dialog, .modal-dialog-centered {
        position: fixed; left: 0; right: 0; bottom: 0;
        margin: 0; max-width: none; min-height: 0; align-items: flex-end;
    }
    .modal-content {
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        border-bottom: 0;
        max-height: 92dvh;
        overflow-y: auto;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .modal-content::before {
        content: ''; display: block; width: 38px; height: 4px; border-radius: 4px;
        background: var(--border-strong); margin: 9px auto 0;
    }
    .modal-footer { border-radius: 0; }
    .modal.fade .modal-dialog { transform: translateY(100%); transition: transform var(--slow) var(--spring); }
    .modal.show .modal-dialog { transform: none; }
}

/* Agenda no celular mais enxuta, como na proposta: o topo já diz "Agenda";
   link e bloqueio viram botões pequenos numa linha. */
@media (max-width: 767.98px) {
    .agenda-head { margin-bottom: .75rem; }
    .agenda-head h1 { display: none; }
    .agenda-head .subtitle { margin-top: 0; }
    .agenda-head .page-head-actions > .btn { flex: 1 1 0; min-height: 40px; font-size: .8125rem; padding: .35rem .5rem; }
    .agenda-bar { margin-bottom: .75rem; }
    .day-strip { margin-bottom: .75rem !important; }
}
@media (max-width: 767.98px) {
    /* filtro de barbeiro (semana/lista) em linha própria: dividindo a linha,
       ele espremia o Dia/Semana/Lista até sumir */
    .agenda-bar > form { flex: 1 1 100% !important; max-width: none !important; order: 3; }
}

/* Atendimento que já passou (concluído, faltou, cancelado): só o texto apaga.
   Opacidade no cartão inteiro derrubava o contraste da etiqueta abaixo do AA. */
.slot-card.is-done, .slot-card.is-miss { opacity: 1; background: transparent; }
.slot-card.is-done .who b, .slot-card.is-miss .who b { color: var(--text-muted); font-weight: 500; }

/* Link no meio de texto não pode depender só da cor (WCAG 1.4.1). */
p a:not(.btn), .subtitle a, .form-text a, .alert a:not(.btn), li a:not(.btn):not(.dropdown-item) {
    text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}

/* Guia de quem entrou pelo "Ver demonstração" (partials/demo-guide). */
.demo-guide {
    display: grid; gap: 1rem; padding: 1.25rem;
    border-radius: var(--r-lg); background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent);
    animation: demo-guide-in .5s var(--spring) backwards;
}
.demo-guide[hidden] { display: none; }
.demo-guide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.demo-guide-tag { font: 500 .75rem/1rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
.demo-guide-t { font: 700 1.5rem/2rem var(--font-display); letter-spacing: -.015em; margin: .25rem 0; text-wrap: balance; }
.demo-guide-p { margin: 0; color: var(--text-muted); max-width: 60ch; }
.demo-guide-close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); }
.demo-guide-close:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--text); }
.demo-guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.demo-guide-steps li { display: flex; gap: .75rem; align-items: center; }
.demo-guide-steps li > span:last-child { display: grid; }
.demo-guide-steps small { color: var(--text-muted); }
.demo-guide-n { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font: 600 .875rem/1 var(--font-mono); }
.demo-guide-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.demo-guide-actions .btn-link { color: var(--brand-text); }
@media (max-width: 767.98px) {
    .demo-guide-actions > .btn-primary { flex: 1 1 100%; justify-content: center; }
    .demo-guide-actions > .btn-outline-secondary { flex: 1 1 0; justify-content: center; }
}
@media (min-width: 768px) { .demo-guide { padding: 1.5rem; } .demo-guide-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@keyframes demo-guide-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .demo-guide { animation: none; } }

/* ===================================================================
   Plataforma (/admin): topo com abas, sem barra lateral de barbearia
   =================================================================== */
.platform-top { padding: 0 1rem; gap: .75rem; }
.platform-mark { display: inline-flex; align-items: center; gap: .45rem; font: 700 .95rem/1 var(--font-display); white-space: nowrap; }
.platform-nav { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.platform-nav::-webkit-scrollbar { display: none; }
.platform-nav a {
    display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .7rem;
    border-radius: 10px; color: var(--text-muted); text-decoration: none; font-size: .875rem; white-space: nowrap;
}
.platform-nav a:hover { background: var(--surface-hover); color: var(--text); }
.platform-nav a.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.platform-main { padding: 1.25rem 1rem 2rem; }
.kv-row { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.kv-row:last-child { border-bottom: 0; }
.kv-row > span:first-child { color: var(--text-muted); }
.kv-row > :last-child { font-family: var(--font-mono); font-size: .8125rem; text-align: right; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 767.98px) {
    .platform-mark span { display: none; }
    .platform-nav a span { display: none; }
    /* No celular as nove abas não cabem ao lado da marca e do "Sair": a
       rolagem escondida cortava os ícones da ponta (390 px). Elas descem
       para uma segunda linha, de largura inteira, divididas por igual. */
    .platform-top { height: auto; flex-wrap: wrap; row-gap: 0; padding-top: .35rem; padding-bottom: .35rem; }
    .platform-nav { order: 3; flex: 1 0 100%; justify-content: space-between; gap: 0; overflow: visible; }
    .platform-nav a { flex: 1 1 0; justify-content: center; min-width: 0; min-height: 40px; padding: 0; }
}

/* ===================================================================
   Assinatura: "Meu plano" (barbearia) e cobrança no /admin
   =================================================================== */
.plan-hero { background: linear-gradient(160deg, var(--brand-soft), var(--surface) 55%); }
.plan-hero-name { font: 700 1.6rem/1.15 var(--font-display); letter-spacing: -.02em; margin: .3rem 0 .35rem; }
.plan-price { font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-meters { display: grid; gap: .75rem; }
@media (min-width: 768px) { .plan-meters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
.plan-grid { display: grid; gap: .75rem; }
@media (min-width: 768px) { .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan-card {
    display: flex; flex-direction: column; gap: .35rem; padding: 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
    transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.plan-card:hover { border-color: var(--border-strong); }
.plan-card.current { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.plan-card.chosen { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.plan-card-name { font: 700 1.1rem/1.2 var(--font-display); margin: 0; }
.plan-card-price strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.plan-card-price span { color: var(--text-muted); font-size: .8125rem; }
.plan-feats { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .3rem; font-size: .875rem; flex: 1; }
.plan-feats li { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.plan-feats .bi-check2 { color: var(--ok); }
.plan-feats li.off { color: var(--text-muted); }
.plan-feats li.off .bi-x { color: var(--text-faint); }
.plan-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; padding: .75rem .9rem; border-radius: 12px; background: var(--bg-subtle); }
.pix-box { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
@media (min-width: 576px) { .pix-box { flex-direction: row; align-items: flex-start; } }
.pix-qr { width: 200px; height: 200px; padding: 8px; background: #fff; border-radius: 12px; border: 1px solid var(--border); image-rendering: pixelated; flex-shrink: 0; }
.plan-pay .choices .choice { flex: 1 1 0; justify-content: center; text-align: center; }
.plan-checkout .choices .choice { flex: 1 1 0; text-align: center; }
.billing-notice { display: flex; align-items: flex-start; gap: .6rem; }
.billing-notice .btn { margin-left: auto; flex-shrink: 0; }
@media (max-width: 575.98px) { .billing-notice { flex-wrap: wrap; } .billing-notice .btn { margin-left: 0; width: 100%; } }
.admin-filters { display: flex; flex-direction: row; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.admin-filters > * { flex: 1 1 140px; min-width: 0; }
td.mono, .kpi-value.mono { white-space: nowrap; }
.admin-filters .form-control, .admin-filters .form-select { min-width: 0; }
.admin-filters > .btn { flex: 0 0 auto; }
.signup-plan { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border-radius: var(--r-md); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.plan-gift { font-size: .6875rem; font-weight: 600; padding: .1rem .4rem; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .plan-card { transition: none; } }
input:focus-visible + .choice { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Privacidade e cookies (/privacidade) ---------- */
.privacy p, .privacy li { line-height: 1.6; }
.privacy-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; }
.privacy-list li {
    display: grid; gap: .25rem; padding: .85rem 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.privacy-list code { color: var(--brand-text); font-size: .85rem; word-break: break-word; }

/* ---------- WhatsApp (Configurações → WhatsApp) ----------
   Celular primeiro: conexão e mensagens empilhadas; a partir de 992px, lado a
   lado. O QR fica num quadro branco nos dois temas (o celular lê melhor). */
.wa-grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 992px) { .wa-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.wa-number { display: flex; align-items: center; gap: .75rem; padding: .75rem; border-radius: var(--r-md); background: var(--bg-subtle); }
.wa-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 1.25rem; background: #25d366; color: #fff; }
.wa-avatar.off { background: var(--border); color: var(--text-muted); }
.wa-qr-box { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
@media (min-width: 576px) and (max-width: 991.98px) { .wa-qr-box { flex-direction: row; align-items: center; } }
.wa-qr { width: 240px; height: 240px; max-width: 100%; aspect-ratio: 1; padding: 10px; background: #fff; border-radius: 14px; border: 1px solid var(--border); image-rendering: pixelated; flex-shrink: 0; transition: opacity .2s ease; }
.wa-qr.is-fresh { animation: wa-fade .25s ease; }
.wa-qr-wait { display: grid; place-content: center; gap: .5rem; text-align: center; }
.wa-qr-wait .skeleton-line { width: 160px; background: var(--bg-subtle); }
.wa-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.wa-kpis { --kpi-cols: 3; }
@media (max-width: 380px) { .wa-kpis .kpi-label { font-size: .6875rem; } }
.wa-msg { display: grid; gap: .5rem; padding: .85rem 0; border-top: 1px solid var(--border); }
.wa-msg label[for^="on_"] { cursor: pointer; }
.wa-msg .form-switch .form-check-input { width: 2.6em; height: 1.4em; cursor: pointer; }
.wa-tpl summary, .wa-vars summary { cursor: pointer; color: var(--brand-text); min-height: 32px; display: inline-flex; align-items: center; }
.wa-tpl textarea { font-family: inherit; line-height: 1.5; }
.wa-days { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.wa-days .form-control { width: 5.5rem; }
.wa-vars code { color: var(--brand-text); }
.wa-save { padding: .75rem 0 .25rem; background: linear-gradient(to bottom, transparent, var(--surface) 30%); }
/* No celular a barra de abas fica por cima do rodapé: o "Salvar" gruda logo acima dela. */
@media (max-width: 767.98px) { .wa-save { bottom: calc(var(--tabbar-h, 64px) + env(safe-area-inset-bottom)); } }
.wa-hist { display: grid; }
.wa-hist li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--border); min-height: 48px; }
.wa-hist li:first-child { border-top: 0; }
@keyframes wa-fade { from { opacity: .3; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wa-qr, .wa-qr.is-fresh { animation: none; transition: none; } }

/* /admin/sistema, rotinas por estabelecimento: no desktop cabe no cartão sem rolar
   (colunas fixas, nome com o slug embaixo, erro quebrando a linha); no celular a
   table-cards já vira cartões. */
@media (min-width: 768px) {
    .table-rotinas { table-layout: fixed; width: 100%; }
    .table-rotinas th:first-child { width: 34%; }
    .table-rotinas th, .table-rotinas td { overflow-wrap: anywhere; padding-inline: .5rem; }
    .table-rotinas th { white-space: nowrap; }
    .table-rotinas .badge-soft { white-space: nowrap; }
}
