/* ============================================================
   MinhaClinica — design system
   Paleta: verde musgo (moss)  •  Tipografia: San Francisco (system)
   ============================================================ */

:root {
    --moss-900: #2B3123;
    --moss-800: #333B29;
    --moss-700: #414A31;
    --moss-600: #55693F;
    --moss-500: #63764B;
    --moss-400: #8B9A6E;
    --moss-300: #A9B58C;
    --moss-200: #CDD6BE;
    --moss-100: #E4E9D8;
    --moss-50:  #F4F6EF;

    --surface:  #FFFFFF;
    --ink:      #22271C;
    --ink-soft: #5B6350;
    --line:     #E1E5D6;

    --honey:    #C99A3F;
    --honey-100:#F4E9CF;
    --danger:   #B4462F;
    --danger-100:#F6E1DB;

    --radius:   16px;
    --radius-sm:10px;
    --shadow:   0 1px 3px rgba(33, 40, 22, .07), 0 8px 24px -16px rgba(33, 40, 22, .18);
    --shadow-sm:0 1px 2px rgba(33, 40, 22, .06);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
            "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--moss-50);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}

a { color: var(--moss-600); text-decoration: none; }
a:hover { color: var(--moss-700); }

h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    font-weight: 600;
    color: var(--moss-900);
    margin: 0;
}

:focus-visible {
    outline: 2px solid var(--moss-600);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------------- App shell ---------------- */

/* Navegação: barra lateral fixa no desktop; no celular vira gaveta
   aberta pelo botão hambúrguer da barra superior. A página rola no body. */
:root { --sidebar-w: 252px; --mobilebar-h: 58px; }

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1080;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--moss-700);
    color: #EAEEE0;
    box-shadow: 1px 0 0 rgba(0,0,0,.08), 6px 0 24px -18px rgba(33, 40, 22, .5);
}
.sidebar__head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 18px 18px 14px;
}
.sidebar__brand, .mobilebar__brand {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 600; font-size: 1.06rem; letter-spacing: -0.02em;
    white-space: nowrap;
}
.sidebar__brand:hover, .mobilebar__brand:hover { color: #fff; }
.sidebar__brand .sidebar__mark, .mobilebar__brand .sidebar__mark { width: 32px; height: 32px; }
.sidebar__close, .mobilebar__toggle {
    display: none;
    background: none; border: 0; color: #fff; padding: 8px; border-radius: 8px; cursor: pointer;
}
.sidebar__close:hover, .mobilebar__toggle:hover { background: rgba(255,255,255,.08); }
.sidebar__close svg, .mobilebar__toggle svg { width: 24px; height: 24px; display: block; }

.sidenav {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 2px;
    padding: 4px 12px 12px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidenav__link {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 9px 12px; min-height: 42px; border-radius: var(--radius-sm);
    color: #D7DEC8; font-weight: 500; font-size: .93rem; text-align: left;
    background: none; border: 0; cursor: pointer; white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.sidenav__link > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidenav__link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidenav__link.is-active { background: var(--moss-600); color: #fff; }
/* grupo com página ativa: destaque leve no cabeçalho (o item fica com o destaque forte) */
.sidenav__trigger.is-active { background: none; color: #fff; }
.sidenav__trigger.is-active:hover { background: rgba(255,255,255,.08); }

.sidenav__icon, .sidenav__caret {
    flex: 0 0 auto; fill: none; stroke: currentColor;
    stroke-linecap: round; stroke-linejoin: round;
}
.sidenav__icon { width: 19px; height: 19px; stroke-width: 1.8; opacity: .9; }
.sidenav__caret { width: 15px; height: 15px; stroke-width: 2; opacity: .7; transition: transform .18s ease; }
.sidenav__group.is-open .sidenav__caret { transform: rotate(180deg); }

.sidenav__sub {
    display: none;
    flex-direction: column; gap: 1px;
    margin: 2px 0 6px 21px; padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,.14);
}
.sidenav__group.is-open .sidenav__sub { display: flex; }
.sidenav__item {
    display: flex; align-items: center;
    padding: 7px 12px; min-height: 36px; border-radius: 8px;
    color: #C9D2B8; font-size: .9rem; font-weight: 500;
}
.sidenav__item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidenav__item.is-active { background: var(--moss-600); color: #fff; font-weight: 600; }

.sidebar__foot {
    padding: 12px 14px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,.12);
}

/* Botão "Instalar app" (PWA) no rodapé da barra lateral */
.install { margin-bottom: 12px; }
.install[hidden] { display: none; }
.install__btn {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
    color: #fff; text-align: left; cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.install__btn:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.24); }
.install__btn svg { width: 22px; height: 22px; flex: 0 0 auto; }
.install__btn strong { display: block; font-size: .9rem; font-weight: 600; }
.install__btn small { display: block; font-size: .76rem; color: #C9D2B8; }
.install__ios {
    margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: rgba(0,0,0,.16); color: #DCE3CF; font-size: .82rem; line-height: 1.45;
}
.install__ios[hidden] { display: none; }
.install__ios p { margin: 0 0 4px; }
.install__ios ol { margin: 0; padding-left: 18px; }
.install__ios li + li { margin-top: 2px; }
.install__ios svg { width: 15px; height: 15px; vertical-align: -2px; margin-left: 2px; }

/* Barra superior: só no celular/tablet */
.mobilebar {
    display: none;
    position: sticky; top: 0; z-index: 1030;
    align-items: center; gap: 8px; min-height: var(--mobilebar-h);
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
    background: var(--moss-700);
    box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 6px 18px -12px rgba(33, 40, 22, .45);
}

.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 1075;
    background: rgba(20, 24, 14, .45);
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s;
}

/* Desktop: conteúdo ao lado da barra */
@media (min-width: 901px) {
    .content { margin-left: var(--sidebar-w); }
}

/* Celular/tablet: barra lateral vira gaveta */
@media (max-width: 900px) {
    .mobilebar { display: flex; }
    .mobilebar__toggle, .sidebar__close { display: block; }
    .sidebar {
        width: min(86vw, 300px);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .24s ease, visibility .24s;
        padding-top: env(safe-area-inset-top);
    }
    body.nav-open .sidebar { transform: none; visibility: visible; }
    body.nav-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    body.nav-open { overflow: hidden; }
    .sidenav__link { min-height: 46px; }
    .sidenav__item { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar, .sidebar-backdrop, .sidenav__caret { transition: none; }
}

/* logo (também usado na tela de login) — imagem em /icons/logo-128.png */
.sidebar__mark {
    display: block; flex: 0 0 auto;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--moss-700);
    object-fit: cover;
}
/* na barra lateral/superior o fundo é da mesma cor do logo: contorno sutil para destacar */
.sidebar .sidebar__mark, .mobilebar .sidebar__mark { box-shadow: 0 0 0 1px rgba(244, 246, 239, .22); }

/* user menu (login partial) — rodapé da barra lateral */
.user-menu { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.user-menu__profile { display: flex; align-items: center; gap: 9px; color: #EAEEE0; min-width: 0; flex: 1; }
.user-menu__profile:hover { color: #fff; }
.user-menu__avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
    background: var(--moss-500); color: #fff;
    display: grid; place-items: center; font-size: .84rem; font-weight: 600;
}
.user-menu__name { font-size: .86rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__logout { margin: 0; flex: 0 0 auto; }
.user-menu .btn-ghost { color: #EAEEE0; }
.user-menu .btn-ghost:hover { color: #fff; background: rgba(255,255,255,.08); }
.user-menu--guest { justify-content: flex-start; flex-wrap: wrap; }

/* ---------------- Content ---------------- */

.content {
    flex: 1; min-width: 0;
    padding: clamp(18px, 3vw, 30px) max(clamp(16px, 3vw, 34px), env(safe-area-inset-right)) 60px max(clamp(16px, 3vw, 34px), env(safe-area-inset-left));
}
.content__inner { max-width: 1040px; margin: 0 auto; }

.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h1 { font-size: clamp(1.35rem, 4vw, 1.7rem); }
.page-header__sub { color: var(--ink-soft); margin-top: 4px; font-size: .95rem; }
.page-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- Buttons ---------------- */

.btn, .btn-soft, .btn-ghost, .btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font); font-size: .93rem; font-weight: 600;
    padding: 10px 18px; border-radius: 11px; cursor: pointer;
    border: 1px solid transparent; transition: all .15s ease; white-space: nowrap;
    text-decoration: none;
}
.btn { background: var(--moss-600); color: #fff; }
.btn:hover { background: var(--moss-700); color: #fff; }
.btn-soft { background: var(--moss-100); color: var(--moss-800); }
.btn-soft:hover { background: var(--moss-200); color: var(--moss-900); }
.btn-outline { background: var(--surface); color: var(--moss-700); border-color: var(--line); }
.btn-outline:hover { border-color: var(--moss-300); background: var(--moss-50); }
.btn-ghost { background: transparent; color: inherit; padding: 8px 12px; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1eb457; color: #fff; }

/* Botões de ícone (outline) */
.btn-icon {
    display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-soft); transition: all .15s ease; text-decoration: none;
}
.btn-icon:hover { border-color: var(--moss-300); background: var(--moss-50); }
.btn-icon svg { width: 20px; height: 20px; }
.btn-icon--wa { color: #25D366; }
.btn-icon--wa:hover { color: #1eb457; border-color: #25D366; background: rgba(37, 211, 102, .08); }
.btn-icon--cake { color: var(--honey); }
.btn-icon--cake:hover { color: #8A6516; border-color: var(--honey); background: var(--honey-100); }

/* Botão primário do Identity (Bootstrap) tematizado em verde musgo */
.btn-primary {
    --bs-btn-bg: var(--moss-600);
    --bs-btn-border-color: var(--moss-600);
    --bs-btn-hover-bg: var(--moss-700);
    --bs-btn-hover-border-color: var(--moss-700);
    --bs-btn-active-bg: var(--moss-700);
    --bs-btn-active-border-color: var(--moss-700);
    --bs-btn-disabled-bg: var(--moss-400);
    --bs-btn-disabled-border-color: var(--moss-400);
    border-radius: 11px;
    font-weight: 600;
}

/* ---------------- Cards ---------------- */

.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(16px, 3vw, 24px);
}
.card + .card, .card + .kpi-grid { margin-top: 18px; }
.card__title { font-size: 1.02rem; margin-bottom: 4px; }
.card__hint { color: var(--ink-soft); font-size: .9rem; margin-bottom: 18px; }

/* ---------------- Forms (grid + form-floating) ---------------- */

.form-grid {
    display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px 12px;
}
/* Colunas próprias (prefixo gcol- para não colidir com o grid do Bootstrap).
   Conjunto completo de 1 a 12 — colunas não definidas caíam para 1/12 da
   largura (campos minúsculos/quebrados). */
.gcol-12 { grid-column: span 12; }
.gcol-11 { grid-column: span 11; }
.gcol-10 { grid-column: span 10; }
.gcol-9  { grid-column: span 9; }
.gcol-8  { grid-column: span 8; }
.gcol-7  { grid-column: span 7; }
.gcol-6  { grid-column: span 6; }
.gcol-5  { grid-column: span 5; }
.gcol-4  { grid-column: span 4; }
.gcol-3  { grid-column: span 3; }
.gcol-2  { grid-column: span 2; }
.gcol-1  { grid-column: span 1; }

.group-label {
    display: block; font-size: .85rem; font-weight: 600;
    color: var(--moss-800); margin-bottom: 8px;
}

/* Tema dos controles do Bootstrap (form-control / form-select / form-floating) */
.form-control, .form-select {
    font-family: var(--font);
    color: var(--ink);
    background-color: var(--moss-50);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.form-control:focus, .form-select:focus {
    color: var(--ink);
    background-color: #fff;
    border-color: var(--moss-400);
    box-shadow: 0 0 0 3px rgba(85, 105, 63, .16);
}
.form-control::placeholder { color: var(--moss-300); }

/* Campos com rótulo flutuante: esconde o placeholder (o rótulo já indica o campo).
   O atributo é mantido nas views pois o floating label depende de :placeholder-shown. */
.form-floating > .form-control::placeholder,
.form-floating > .form-control:focus::placeholder,
.form-floating > .form-select::placeholder { color: transparent !important; }

.form-floating > label { color: var(--ink-soft); font-weight: 500; padding-left: 14px; }
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control-plaintext ~ label,
.form-floating > .form-select ~ label { color: var(--moss-600); }
.form-floating > .form-control, .form-floating > .form-select { border-radius: 10px; }

/* Estado de validação (jQuery unobtrusive usa input-validation-error) */
.form-control.input-validation-error,
.form-select.input-validation-error {
    border-color: var(--danger);
    background-color: var(--danger-100);
}

/* checkboxes como pílulas */
.check-row { display: flex; gap: 12px; flex-wrap: wrap; }
.check-pill {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 12px 16px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--moss-50);
    font-weight: 500; cursor: pointer; user-select: none;
    transition: all .15s ease;
}
.check-pill:hover { border-color: var(--moss-300); }
.check-pill input { accent-color: var(--moss-600); width: 17px; height: 17px; }
.check-pill:has(input:checked) {
    border-color: var(--moss-500); background: var(--moss-100); color: var(--moss-900);
}

/* módulos liberados (tela de usuários): lista de opções com descrição */
.modulo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.modulo-opt {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 12px 14px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--moss-50);
    cursor: pointer; user-select: none; transition: all .15s ease;
}
.modulo-opt:hover { border-color: var(--moss-300); }
.modulo-opt input { accent-color: var(--moss-600); width: 17px; height: 17px; margin-top: 2px; flex: 0 0 auto; }
.modulo-opt strong { display: block; font-weight: 600; color: var(--moss-900); font-size: .93rem; }
.modulo-opt small { display: block; color: var(--ink-soft); font-size: .8rem; line-height: 1.35; margin-top: 2px; }
.modulo-opt:has(input:checked) { border-color: var(--moss-500); background: var(--moss-100); }
.modulo-opt.is-disabled { opacity: .55; cursor: not-allowed; }

.field-hint { display: block; font-size: .8rem; color: var(--ink-soft); margin-top: 4px; }
/* block (não inline-block): quando vazio não reserva uma linha entre os campos */
.field-validation-error, .text-danger { color: var(--danger); font-size: .82rem; display: block; margin-top: 3px; }
.field-validation-error:empty, .text-danger:empty { margin: 0; }
.validation-summary-errors { color: var(--danger); font-size: .88rem; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }

.form-actions {
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
    margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
}

/* ---------------- Chips & badges ---------------- */

.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 600; line-height: 1.6;
}
.chip--pilates { background: var(--moss-100); color: var(--moss-800); }
.chip--clinica { background: #EAE3D0; color: #7A5E21; }
.chip-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.badge-level {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600;
}
.badge-level--exp { background: var(--honey-100); color: #8A6516; }
.badge-level--completo { background: var(--moss-100); color: var(--moss-700); }

/* ---------------- Activity ring ---------------- */

.ring { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; }
.ring svg { width: 44px; height: 44px; }
.ring__track { stroke: var(--moss-200); }
.ring__value { transition: stroke-dasharray .6s ease; }
.ring--partial .ring__value { stroke: var(--honey); }
.ring--full .ring__value { stroke: var(--moss-600); }
.ring__label {
    position: absolute; font-size: .58rem; font-weight: 700;
    color: var(--moss-700); font-variant-numeric: tabular-nums;
}
.ring--partial .ring__label { color: #8A6516; }
.ring--lg, .ring--lg svg { width: 66px; height: 66px; }
.ring--lg .ring__label { font-size: .8rem; }

@media (prefers-reduced-motion: reduce) {
    .ring__value { transition: none; }
}

/* ---------------- Client list ---------------- */

.client-list { display: flex; flex-direction: column; gap: 10px; }
.client-row {
    display: flex; align-items: center; gap: 16px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 18px;
    box-shadow: var(--shadow-sm); transition: border-color .15s ease;
}
.client-row:hover { border-color: var(--moss-300); }
.client-row__main { flex: 1; min-width: 0; }
.client-row__name { font-weight: 600; color: var(--moss-900); font-size: 1.02rem; }
a.client-row__link { text-decoration: none; color: inherit; }
a.client-row__link:hover .client-row__name { color: var(--moss-600); text-decoration: underline; }
.client-row__meta { color: var(--ink-soft); font-size: .86rem; margin-top: 3px;
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.client-row__actions { display: flex; gap: 8px; align-items: center; }

.data-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 28px; }
.data-list.one-col { grid-template-columns: 1fr; }
.data-item__label { font-size: .78rem; color: var(--ink-soft); font-weight: 600;
    text-transform: uppercase; letter-spacing: .03em; }
.data-item__value { font-size: .98rem; color: var(--ink); margin-top: 2px; }

/* segmented control */
.segmented {
    display: inline-flex; background: var(--moss-100); border-radius: 12px; padding: 4px; gap: 4px;
}
.segmented a {
    padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--moss-700);
}
.segmented a.is-active { background: #fff; color: var(--moss-900); box-shadow: var(--shadow-sm); }

/* empty state */
.empty {
    text-align: center; padding: 56px 24px; color: var(--ink-soft);
    background: var(--surface); border: 1px dashed var(--moss-200); border-radius: var(--radius);
}
.empty h3 { margin-bottom: 6px; }

.section-label {
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--moss-500); margin: 4px 0 14px;
}

/* ============================================================
   Auth (login / registro) — sem sidebar, centralizado
   ============================================================ */

.auth-body {
    min-height: 100vh; margin: 0; padding: 24px;
    display: grid; place-items: center;
    background: radial-gradient(1100px 560px at 50% -15%, var(--moss-100), var(--moss-50) 62%);
}
.auth-shell { width: 100%; max-width: 430px; }
.auth-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 22px; box-shadow: var(--shadow); padding: 34px 30px;
}
.auth-brand {
    display: flex; align-items: center; gap: 11px;
    font-weight: 600; font-size: 1.16rem; color: var(--moss-900);
    letter-spacing: -0.02em; margin-bottom: 22px;
}
.auth-card h1 { font-size: 1.32rem; margin-bottom: 18px; }
.auth-card h2 { font-size: 1.1rem; }
/* uma coluna só: esconde o bloco de login externo e neutraliza a grid do BS */
.auth-card .row { margin: 0; }
.auth-card .row > * { flex: 0 0 100%; max-width: 100%; padding: 0; }
.auth-card .col-lg-4 { display: none; }
.auth-card hr { display: none; }
.auth-card .form-floating { margin-bottom: 14px; }
.auth-card .checkbox { margin: 2px 0 16px; color: var(--ink-soft); }
.auth-card .btn-lg { padding: 12px 18px; }
.auth-links { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.auth-footer { text-align: center; margin-top: 18px; color: var(--ink-soft); font-size: .88rem; }

/* ---------------- KPIs (dashboard) ---------------- */

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi-grid--3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi__label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.kpi__value { font-size: clamp(1.15rem, 3.6vw, 1.5rem); font-weight: 700; color: var(--moss-800); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi--receber .kpi__value { color: var(--moss-700); }
.kpi--recebido .kpi__value { color: var(--moss-600); }
.kpi--atraso .kpi__value { color: var(--danger); }

/* Serviços da consulta (formulário de agendamento) e valor da consulta */
.consulta-servicos { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.consulta-servicos__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.consulta-servicos__pago { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
#servicoLinhas:not(:empty) { margin-top: 12px; }
.servico-linha { display: grid; grid-template-columns: minmax(0, 1fr) 84px 120px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.consulta-total { margin-top: 14px; padding: 12px 16px; background: var(--moss-50); border-radius: var(--radius-sm); display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.consulta-total > div { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); font-size: .92rem; }
.consulta-total > div strong { color: var(--ink); font-weight: 600; }
.consulta-total .consulta-total__final { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--moss-200); color: var(--ink); font-weight: 700; font-size: 1rem; }
.consulta-total .consulta-total__final strong { color: var(--moss-700); font-weight: 700; }
@media (max-width: 560px) {
    .servico-linha { grid-template-columns: 1fr 1fr 44px; }
    .servico-linha > select { grid-column: 1 / -1; }
}

/* Abas do perfil do cliente (Resumo / Pilates / Prontuário / Financeiro) */
.perfil-tabs { margin: 0 0 18px; position: sticky; top: 8px; z-index: 5; box-shadow: var(--shadow-sm); }
.perfil-tabs a { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.perfil-tab > .card:first-child { margin-top: 0; }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--honey); color: #fff;
    font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tab-badge--soft { background: var(--moss-200); color: var(--moss-800); }
.tab-badge--danger { background: var(--danger); }

/* Tela da turma: próximas aulas com os alunos (justificar falta / reposição) */
.aula-turma { padding: 12px 0; border-top: 1px solid var(--line); }
.aula-turma:first-of-type { border-top: 0; padding-top: 0; }
.aula-turma__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.aula-turma__data { font-weight: 700; color: var(--moss-800); }
.aluno-aula { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap;
    padding: 8px 0 8px 12px; border-left: 3px solid var(--moss-200); margin-top: 6px; }
.aluno-aula__main { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; min-width: 0; }
.aluno-aula__nome { font-weight: 600; color: var(--ink); }
.aluno-aula__info { flex-basis: 100%; font-size: .85rem; color: var(--ink-soft); display: flex; gap: 4px; flex-wrap: wrap; }
.aluno-aula__info:empty { display: none; }
.aluno-aula__info a { color: var(--moss-700); font-weight: 600; text-decoration: underline; }
.aluno-aula__pendente { color: #8A6516; font-weight: 600; }
.aluno-aula--fora { border-left-color: var(--honey); }
.aluno-aula--fora .aluno-aula__nome { text-decoration: line-through; color: var(--ink-soft); font-weight: 500; }

/* Previsão de valor das consultas (agenda) */
.agenda-previsao { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; margin: 0 0 14px; padding: 10px 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .9rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.agenda-previsao strong { color: var(--moss-800); font-size: 1.02rem; }

/* Ranking (serviços mais contratados / maior receita) */
.rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rank__item { display: flex; gap: 12px; align-items: flex-start; }
.rank__pos {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: var(--moss-100); color: var(--moss-800); font-size: .8rem; font-weight: 700;
}
.rank__main { flex: 1; min-width: 0; }
.rank__linha { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.rank__nome { font-weight: 600; color: var(--moss-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__valor { flex: 0 0 auto; font-weight: 700; color: var(--moss-800); font-variant-numeric: tabular-nums; }
.rank__barra { height: 6px; border-radius: 3px; background: var(--moss-100); margin: 6px 0 4px; overflow: hidden; }
.rank__barra span { display: block; height: 100%; border-radius: 3px; background: var(--moss-500); }
.rank__sub { font-size: .8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .rank-grid { grid-template-columns: 1fr; gap: 22px; } }

/* Gráfico de barras (relatório) */
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; font-size: .82rem; color: var(--ink-soft); }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.chart { display: flex; align-items: stretch; gap: 12px; height: 220px; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.chart__bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 5px; width: 100%; }
.chart__bar { width: 18px; border-radius: 6px 6px 0 0; min-height: 2px; }
.chart__bar--rec { background: var(--moss-500); }
.chart__bar--desp { background: var(--honey); }
.chart__label { font-size: .72rem; color: var(--ink-soft); margin-top: 8px; font-weight: 600; }
.chart__saldo { font-size: .7rem; font-variant-numeric: tabular-nums; margin-top: 2px; }

.cat-bar__track { background: var(--moss-50); border-radius: 999px; height: 10px; overflow: hidden; margin-top: 5px; }
.cat-bar__fill { height: 100%; background: var(--honey); border-radius: 999px; }

.aniversario-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.aniversario-row:last-child { border-bottom: none; }
.aniversario-row__dia { width: 42px; height: 42px; border-radius: 12px; background: var(--moss-100); color: var(--moss-800); display: grid; place-items: center; font-weight: 700; flex: 0 0 42px; }
.aniversario-row__main { flex: 1; min-width: 0; }

/* ---------------- Tabelas de dados ---------------- */

.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl thead th {
    text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; color: var(--ink-soft); padding: 0 12px 10px;
    border-bottom: 1px solid var(--line);
}
.tbl tbody td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--moss-50); }
.tbl .t-actions { text-align: right; white-space: nowrap; }
.tbl .t-actions .btn, .tbl .t-actions .btn-soft, .tbl .t-actions .btn-outline,
.tbl .t-actions .btn-ghost { padding: 6px 12px; font-size: .85rem; }

.pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
    border-radius: 999px; font-size: .76rem; font-weight: 600;
}
.pill--on { background: var(--moss-100); color: var(--moss-700); }
.pill--off { background: #EDEDE7; color: var(--ink-soft); }
.pill--warn { background: var(--honey-100); color: #8A6516; }
.pill--danger { background: var(--danger-100); color: var(--danger); }
a.pill { text-decoration: none; }

.form-narrow { max-width: 640px; }
.inline-form { display: inline; }

/* Popover (marcar pago / comprovante) — via <details>, sem JS */
/* Mensagens de retorno das ações (partial _Flash) e avisos dentro de formulários */
.flash {
    border: 1px solid var(--moss-300); background: var(--moss-50); color: var(--ink);
    border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; overflow-wrap: anywhere;
}
.flash--ok { border-color: var(--moss-300); background: #fff; border-left: 4px solid var(--moss-500); }
.flash--erro { border-color: var(--danger); background: var(--danger-100); color: var(--danger); }
.flash--aviso { border-color: #D9B55A; background: #FBF3DC; color: #6B4E0F; }
.flash ul { margin: 6px 0 10px 18px; padding: 0; }

/* Aviso de versão nova (quando a tela não pôde se recarregar sozinha) */
.atualizacao {
    position: fixed; left: 50%; transform: translateX(-50%); z-index: 2000;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 14px;
    width: max-content; max-width: calc(100vw - 24px);
    padding: 10px 12px 10px 16px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--moss-300);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18); font-size: .93rem; font-weight: 600;
}
.atualizacao .btn { padding: 8px 14px; }

.pop { position: relative; display: inline-block; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.pop__panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow); padding: 12px; width: 250px;
    display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.pop__label { font-size: .78rem; font-weight: 600; color: var(--moss-800); }
.pop__panel input {
    width: 100%; font-family: var(--font); font-size: .9rem; padding: 9px 11px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--moss-50); color: var(--ink);
}
.pop__panel input:focus { outline: none; border-color: var(--moss-400); background: #fff; box-shadow: 0 0 0 3px rgba(85, 105, 63, .14); }

/* ---------------- Calendário ---------------- */

.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-range { font-weight: 600; color: var(--moss-900); font-size: 1.02rem; }

.cal-week { display: grid; grid-template-columns: 60px repeat(7, 1fr); gap: 8px; }
.cal-dayhead { text-align: center; padding: 6px 4px 10px; }
.cal-dayhead__dow { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 700; }
.cal-dayhead__num { font-size: 1.05rem; font-weight: 600; color: var(--moss-900); margin-top: 2px; }
.cal-dayhead.is-today .cal-dayhead__num { color: #fff; background: var(--moss-600); border-radius: 999px; width: 30px; height: 30px; line-height: 30px; display: inline-block; }
.cal-time { font-size: .76rem; color: var(--ink-soft); text-align: right; padding-top: 8px; font-variant-numeric: tabular-nums; }
.cal-cell { min-height: 40px; display: flex; flex-direction: column; gap: 6px; }

.slot-card { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--moss-400); border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow-sm); transition: border-color .15s ease; text-decoration: none; }
.slot-card:hover { border-color: var(--moss-300); border-left-color: var(--moss-600); }
.slot-card--cheia { border-left-color: var(--danger); }
.slot-card--vaga { border-left-color: var(--honey); }
.slot-card--cancelada { opacity: .5; }
.slot-card__nome { font-weight: 600; font-size: .85rem; color: var(--moss-900); line-height: 1.2; }
.slot-card__prof { font-size: .75rem; color: var(--ink-soft); margin-top: 2px; }
.vaga-pill { display: inline-block; margin-top: 5px; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--moss-100); color: var(--moss-700); font-variant-numeric: tabular-nums; }
.vaga-pill--cheia { background: var(--danger-100); color: var(--danger); }
.vaga-pill--livre { background: var(--honey-100); color: #8A6516; }

/* Semana estilo Google Agenda (eixo de horas + eventos posicionados) */
.gcal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.gcal__head { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.gcal__dayhead { text-align: center; padding: 8px 4px; border-left: 1px solid var(--line); }
.gcal__dayhead__dow { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 700; }
.gcal__dayhead__num { font-size: 1.05rem; font-weight: 600; color: var(--moss-900); margin-top: 2px; }
.gcal__dayhead.is-today .gcal__dayhead__num { color: #fff; background: var(--moss-600); border-radius: 999px; width: 30px; height: 30px; line-height: 30px; display: inline-block; }
.gcal__body { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: relative; }
.gcal__axis { position: relative; }
.gcal__hourlabel { position: absolute; right: 6px; padding-top: 2px; font-size: .7rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.gcal__col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 52px); }
.gcal__col.is-today { background-color: rgba(85, 105, 63, .045); }
.gcal__event { position: absolute; border-radius: 8px; padding: 3px 7px; font-size: .74rem; line-height: 1.15; overflow: hidden; background: var(--moss-100); border-left: 3px solid var(--moss-500); color: var(--moss-900); text-decoration: none; box-shadow: var(--shadow-sm); }
.gcal__event:hover { filter: brightness(.97); z-index: 4; }
.gcal__event--cheia { background: #F6E6E1; border-left-color: var(--danger); }
.gcal__event--vaga { background: var(--honey-100); border-left-color: var(--honey); }
.gcal__event--cancelada { opacity: .55; }
.gcal__event__t { font-weight: 700; }
.gcal__event__sub { color: var(--ink-soft); font-size: .68rem; }
.gcal__now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 3; }
.gcal__now::before { content: ''; position: absolute; left: -3px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }

.cal-week-mobile { display: none; }
.cal-day-group { margin-bottom: 16px; }
.cal-day-group__label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--moss-600); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cal-day-group__label.is-today { color: var(--moss-800); }

.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-month__dow { text-align: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--ink-soft); padding-bottom: 6px; }
.cal-mday { min-height: 76px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.cal-mday--empty { background: transparent; border: none; }
.cal-mday:not(.cal-mday--empty):hover { border-color: var(--moss-300); }
.cal-mday__num { font-size: .85rem; font-weight: 600; color: var(--moss-800); }
.cal-mday.is-today .cal-mday__num { color: #fff; background: var(--moss-600); border-radius: 999px; width: 24px; height: 24px; line-height: 24px; text-align: center; }
.cal-mday__info { margin-top: auto; font-size: .72rem; color: var(--ink-soft); }
.cal-mday__count { font-weight: 700; color: var(--moss-700); }

/* Roster de presença */
.roster-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.roster-row:last-child { border-bottom: none; }
.roster-row--feita { opacity: .55; }

/* Lista limitada: mostra os 5 primeiros; o resto abre no modal "Ver tudo" (site.js). */
.lista-limitada > :nth-child(n+6) { display: none; }
.lista-limitada > :nth-child(5) { border-bottom: none; }
.ver-tudo { margin-top: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--moss-700); }
.ver-tudo:hover { background: var(--moss-100, rgba(85, 105, 63, .1)); }
.modal-lista {
    border: 1px solid var(--line); border-radius: 16px; padding: 0; background: #fff; color: inherit;
    width: min(720px, calc(100vw - 32px)); max-height: min(80vh, 760px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
.modal-lista[open] { display: flex; flex-direction: column; }
.modal-lista::backdrop { background: rgba(30, 36, 24, .45); }
.modal-lista__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-lista__head h2 { margin: 0; font-size: 1.05rem; }
.modal-lista__body { padding: 4px 20px 12px; overflow-y: auto; }
.roster-row__main { flex: 1; min-width: 0; }
.roster-row__nome { font-weight: 600; color: var(--moss-900); text-decoration: none; }
.roster-row__nome:hover { color: var(--moss-600); text-decoration: underline; }
.roster-row__confirmar { display: block; width: fit-content; margin-top: 4px; font-size: .85rem; font-weight: 600; color: #128C4B; text-decoration: none; }
.roster-row__confirmar:hover { text-decoration: underline; }
a.client-row { color: inherit; }
a.client-row .btn-ghost { color: var(--moss-600); }
.presenca-toggle { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.presenca-toggle label { cursor: pointer; position: relative; }
.presenca-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.presenca-toggle .opt { display: inline-block; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink-soft); background: var(--moss-50); }
.presenca-toggle input:checked + .opt.opt--presente { background: var(--moss-600); color: #fff; border-color: var(--moss-600); }
.presenca-toggle input:checked + .opt.opt--falta { background: var(--danger); color: #fff; border-color: var(--danger); }
.presenca-toggle input:checked + .opt.opt--just { background: var(--honey); color: #fff; border-color: var(--honey); }
.presenca-toggle input:focus-visible + .opt { outline: 2px solid var(--moss-600); outline-offset: 2px; }

/* ============================================================
   Ficha de avaliação do Pilates
   ============================================================ */

/* Escala de dor (slider 0–10) */
.slider-dor-wrap { display: flex; align-items: center; gap: 14px; }
.slider-dor { flex: 1; accent-color: var(--moss-600); height: 6px; cursor: pointer; }
.slider-dor__val {
    min-width: 58px; text-align: center; font-weight: 700; font-size: 1.1rem;
    color: #fff; background: var(--moss-600); border-radius: 10px; padding: 6px 8px;
    font-variant-numeric: tabular-nums;
}
.slider-dor__val[data-nivel="alto"] { background: var(--danger); }
.slider-dor__val[data-nivel="medio"] { background: var(--honey); }
.slider-dor__ends { display: flex; justify-content: space-between; font-size: .76rem; color: var(--ink-soft); margin-top: 4px; }

/* Mapa de dor (boneco frente/costas) */
.boneco { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.boneco__fig { flex: 1 1 220px; max-width: 280px; text-align: center; }
.boneco__fig svg { width: 100%; height: auto; }
.boneco__cap { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 6px; }
.boneco__outline { fill: var(--moss-50); stroke: var(--moss-300); stroke-width: 1.5; }
.dor-regiao { fill: var(--moss-200); stroke: var(--moss-400); stroke-width: 1; cursor: pointer; transition: fill .12s ease; }
.dor-regiao:hover { fill: var(--moss-300); }
.dor-regiao:focus-visible { outline: none; stroke: var(--ink); stroke-width: 2.5; }
.dor-regiao.is-sel { fill: var(--danger); stroke: #8c3221; }
.dor-legenda { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; min-height: 8px; }
.dor-legenda:empty::after { content: "Nenhuma região marcada."; color: var(--ink-soft); font-size: .85rem; }

/* Lista dinâmica de atividades */
.atividade-row { display: grid; grid-template-columns: 1fr 130px 40px; gap: 8px; align-items: start; margin-bottom: 8px; }
.atividade-row__rm {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--danger); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.atividade-row__rm:hover { background: var(--danger-100); border-color: var(--danger); }

/* Avaliação funcional (toggle 0/4/8/10) */
.func-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.func-item:last-child { border-bottom: none; }
.func-item__head { font-weight: 600; margin-bottom: 8px; }
.func-lado { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.func-lado__lbl { width: 20px; font-weight: 700; color: var(--moss-700); }
.func-toggle { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.func-toggle label { cursor: pointer; position: relative; }
.func-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.func-toggle .opt {
    display: inline-block; min-width: 42px; text-align: center; padding: 6px 12px; border-radius: 9px;
    border: 1px solid var(--line); font-size: .82rem; font-weight: 700; color: var(--ink-soft); background: var(--moss-50);
}
.func-toggle input:checked + .opt { background: var(--moss-600); color: #fff; border-color: var(--moss-600); }
.func-toggle input:focus-visible + .opt { outline: 2px solid var(--moss-600); outline-offset: 2px; }
.func-total {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px;
    padding-top: 14px; border-top: 1px solid var(--line);
}
.func-total__num { font-size: 1.8rem; font-weight: 700; color: var(--moss-700); font-variant-numeric: tabular-nums; }

/* Gráficos de evolução */
.evo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.evo-chart__cap { font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.evo-chart svg { width: 100%; height: auto; display: block; }
.evo-chart__axis { stroke: var(--line); stroke-width: 1; }
.evo-chart__line { fill: none; stroke: var(--moss-500); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.evo-chart__dot { fill: var(--moss-600); }
.evo-chart__empty { color: var(--ink-soft); font-size: .85rem; padding: 18px 0; text-align: center; }

@media (max-width: 900px) {
    .evo-grid { grid-template-columns: 1fr; }
    .atividade-row { grid-template-columns: 1fr 90px 38px; }
}

/* Escala Visual Analógica de dor (EVA) — 0–2 leve, 3–7 moderada, 8–10 intensa */
.eva { max-width: 760px; }
.eva__faixas, .eva__escala { display: grid; grid-template-columns: repeat(11, 1fr); }
.eva__faixas { gap: 0 4px; margin-bottom: 6px; }
.eva__faixas span {
    text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ink-soft);
    border-bottom: 2px solid var(--line); padding-bottom: 3px;
}
.eva__escala { border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.eva__item {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 0 8px; background: var(--eva-cor); color: #fff; cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.eva__item input { position: absolute; opacity: 0; pointer-events: none; }
.eva__num { font-weight: 700; font-size: 1.05rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.eva__face { font-size: 1.1rem; line-height: 1; }
.eva__item:hover { filter: brightness(1.06); }
.eva__item:has(input:checked) {
    transform: scale(1.08); z-index: 1; border-radius: 6px;
    box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink);
}
.eva__item:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: -3px; }
.eva__legenda { margin-top: 8px; font-size: .82rem; color: var(--ink-soft); }
@media (max-width: 560px) {
    .eva__num { font-size: .9rem; }
    .eva__face { font-size: .85rem; }
    .eva__faixas span { font-size: .6rem; letter-spacing: 0; }
}

/* Variáveis do contrato agrupadas (Empresa | Aluno | Data) */
.token-group { height: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--moss-50); }
.token-group__title { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--moss-700); }
.token-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.token-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.token-list .token-chip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; padding: 3px 9px; }
.token-list__desc { font-size: .8rem; color: var(--ink-soft); }

/* ============================================================
   Responsivo
   Breakpoints:  ≤560 celular  •  ≤700 tabelas viram cards
                 ≤900 tablet retrato / celular grande (menu hambúrguer)
                 901–1160 tablet paisagem  •  ≥1400 desktop grande
   ============================================================ */

/* Componentes de apoio usados nas views */
.card-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.profile-head { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-head h1 { overflow-wrap: anywhere; }
.filter-bar {
    display: grid; gap: 10px; flex: 1;
    grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
}
.filter-bar__single { width: auto; min-width: 220px; }
/* Barra só com o campo de busca: uma coluna larga o bastante para o texto de exemplo. */
.filter-bar--busca { grid-template-columns: minmax(0, 420px); }
.check-pill { max-width: 100%; }

/* Tabela com rolagem horizontal (ex.: Relatórios) — sombra indica que há mais */
.tbl-scroll {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    background:
        linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left center / 40px 100% no-repeat local,
        linear-gradient(to left, var(--surface) 30%, rgba(255,255,255,0)) right center / 40px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(33,40,22,.16), transparent) left center / 12px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(33,40,22,.16), transparent) right center / 12px 100% no-repeat scroll;
}
.tbl--scroll { min-width: 620px; }
.tbl--scroll td:first-child, .tbl--scroll th:first-child {
    position: sticky; left: 0; background: var(--surface); z-index: 1;
}

/* Lista mobile da agenda: cards não ficam colados */
.cal-day-group .slot-card + .slot-card { margin-top: 8px; }

/* Desktop grande: aproveita a largura */
@media (min-width: 1600px) {
    .content__inner { max-width: 1200px; }
}

/* Tablet paisagem / notebook (já descontando a barra lateral) */
@media (min-width: 901px) and (max-width: 1300px) {
    /* colunas estreitas ocupam metade; largas ocupam a linha toda */
    .gcol-5, .gcol-4, .gcol-3, .gcol-2 { grid-column: span 6; }
    .gcol-11, .gcol-10, .gcol-9, .gcol-8, .gcol-7 { grid-column: span 12; }
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .gcal__event { font-size: .78rem; }
}

/* Tablet retrato / celular grande */
@media (max-width: 900px) {
    .data-list { grid-template-columns: 1fr; }
    /* campos empilham: qualquer coluna fracionária vira largura total */
    .gcol-11, .gcol-10, .gcol-9, .gcol-8, .gcol-7, .gcol-6,
    .gcol-5, .gcol-4, .gcol-3, .gcol-2, .gcol-1 { grid-column: span 12; }

    /* toolbars de calendário/agenda: data em cima, navegação e abas embaixo */
    .cal-toolbar { justify-content: center; }
    .cal-toolbar .cal-range { order: -1; flex-basis: 100%; text-align: center; }
    .cal-toolbar > .segmented { flex-basis: 100%; }
    .cal-toolbar > .segmented a { flex: 1; text-align: center; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-bar__single { width: 100%; min-width: 0; }

    /* calendário: grade semanal vira lista por dia */
    .cal-week, .gcal { display: none; }
    .cal-week-mobile { display: block; }
    .cal-day-group__label { position: sticky; top: var(--mobilebar-h); z-index: 2; background: var(--moss-50); padding-top: 6px; }
    .cal-month { gap: 3px; }
    .cal-mday { min-height: 54px; padding: 5px; }
    .cal-mday__info { font-size: .66rem; }

    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid--3 > .kpi:nth-child(3):last-child { grid-column: span 2; }

    /* gráfico de 12 meses: rola na horizontal em vez de espremer */
    .chart { overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
    .chart { gap: 6px; }
    .chart__col { flex: 1 0 44px; scroll-snap-align: end; }

    .aniversario-row { flex-wrap: wrap; }
    /* tabelas no tablet retrato: compactas, texto quebra em vez de rolar */
    .tbl { font-size: .86rem; }
    .tbl thead th, .tbl tbody td { padding: 8px; }
    .tbl .t-actions { white-space: normal; }
}

/* Tabelas viram lista de cards */
@media (max-width: 700px) {
    .tbl:not(.tbl--scroll), .tbl:not(.tbl--scroll) tbody { display: block; width: 100%; }
    .tbl:not(.tbl--scroll) thead { display: none; }
    .tbl:not(.tbl--scroll) tbody tr {
        display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
        padding: 12px 14px; margin-bottom: 10px;
        border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
    }
    .tbl:not(.tbl--scroll) tbody tr:last-child { margin-bottom: 0; }
    .tbl:not(.tbl--scroll) tbody tr:hover { background: var(--surface); }
    .tbl:not(.tbl--scroll) tbody td {
        display: flex; justify-content: space-between; align-items: center; gap: 12px;
        padding: 0; border: 0; text-align: right; min-width: 0; overflow-wrap: anywhere;
    }
    .tbl:not(.tbl--scroll) tbody td::before {
        content: attr(data-label); flex: 0 0 auto; text-align: left;
        font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
        color: var(--ink-soft);
    }
    .tbl:not(.tbl--scroll) tbody td[data-label=""]::before,
    .tbl:not(.tbl--scroll) tbody td:not([data-label])::before { display: none; }
    /* 1ª coluna = título do card */
    .tbl:not(.tbl--scroll) tbody td:first-child {
        justify-content: flex-start; text-align: left; font-weight: 600; font-size: .98rem;
        flex-wrap: wrap; gap: 6px;
    }
    .tbl:not(.tbl--scroll) tbody td:first-child::before { display: none; }
    /* linha de "vazio" com colspan */
    .tbl:not(.tbl--scroll) tbody td[colspan] { justify-content: center; text-align: center; }
    /* ações = rodapé do card */
    .tbl:not(.tbl--scroll) tbody td.t-actions {
        justify-content: flex-end; flex-wrap: wrap; gap: 8px; white-space: normal;
        margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line);
    }
    .tbl:not(.tbl--scroll) tbody td.t-actions::before { display: none; }
    .tbl:not(.tbl--scroll) tbody td.t-actions:empty { display: none; }
    /* textos longos (evolução, alterações) ocupam a largura do card */
    .tbl:not(.tbl--scroll) tbody td[style*="pre-wrap"] { display: block; text-align: left; }
    .tbl:not(.tbl--scroll) tbody td[style*="pre-wrap"]::before { display: block; margin-bottom: 2px; }
    .tbl:not(.tbl--scroll) tbody td[style*="nowrap"] { white-space: normal !important; }
}

/* Celular */
@media (max-width: 560px) {
    .page-header { align-items: stretch; }
    .page-header__actions { width: 100%; }
    .page-header__actions > .btn, .page-header__actions > .btn-soft,
    .page-header__actions > .btn-outline { flex: 1 1 auto; }
    .page-header > .segmented { width: 100%; }

    /* abas segmentadas: rolam na horizontal, abas de largura igual */
    .segmented {
        display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    .segmented::-webkit-scrollbar { display: none; }
    .segmented a { flex: 1 0 auto; text-align: center; scroll-snap-align: start; white-space: nowrap; }

    /* lista de clientes: ações descem para linha própria */
    .client-row { flex-wrap: wrap; padding: 12px 14px; gap: 12px; }
    .client-row__main { flex: 1 1 calc(100% - 60px); }
    .client-row__name {
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .client-row__ver { display: none; }
    .client-row__actions { flex: 1 1 100%; }
    .client-row__actions:not(:has(> :not(.client-row__ver))) { display: none; }
    .client-row__actions > * { flex: 1; }

    .profile-head { gap: 12px; }
    .profile-head .ring--lg, .profile-head .ring--lg svg { width: 52px; height: 52px; }

    /* chamada: nome + evolução em cima, presença em largura total embaixo */
    .roster-row { gap: 10px; }
    .roster-row__main { flex: 1 1 0; }
    .roster-row > .btn-soft { order: 1; }
    .presenca-toggle { order: 2; flex: 1 1 100%; display: grid; grid-template-columns: 52px repeat(3, 1fr); }
    .presenca-toggle .opt { display: block; width: 100%; text-align: center; padding-left: 4px; padding-right: 4px; }

    /* calendário mensal: só número + contador */
    .cal-mday { min-height: 48px; padding: 4px; align-items: center; }
    .cal-mday__info { font-size: 0; margin-top: auto; }
    .cal-mday__info br { display: none; }
    .cal-mday__count {
        font-size: .7rem; display: inline-grid; place-items: center;
        min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
        background: var(--moss-100); color: var(--moss-700);
    }
    .cal-month__dow { font-size: .62rem; }

    .kpi { padding: 12px 14px; }
    .chart__saldo { display: none; }

    .filter-bar { grid-template-columns: 1fr; }

    /* formulário: barra de ações fixa no rodapé, alcançável pelo polegar */
    .form-actions {
        position: sticky; bottom: 0; z-index: 20;
        padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
        background: var(--surface); box-shadow: 0 -8px 16px -12px rgba(33, 40, 22, .3);
        margin-bottom: -4px;
    }
    .form-actions > * { flex: 1 1 0; }

    /* popovers viram "bottom sheet" */
    .pop[open]::before {
        content: ""; position: fixed; inset: 0; z-index: 1040; background: rgba(20, 24, 14, .38);
    }
    .pop__panel {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1050;
        width: auto; max-width: none; border-radius: 18px 18px 0 0;
        padding: 18px max(16px, env(safe-area-inset-left)) calc(18px + env(safe-area-inset-bottom));
        box-shadow: 0 -12px 32px rgba(20, 24, 14, .25);
    }
    .pop__panel .btn { width: 100%; }

    /* atividades da ficha de Pilates: nome em cima, nota + remover embaixo */
    .atividade-row { grid-template-columns: 1fr 44px; }
    .atividade-row > :first-child { grid-column: 1 / -1; }

    /* EVA: 2 linhas (0–5 / 6–10); a faixa aparece na legenda abaixo */
    .eva__faixas { display: none; }
    .eva__escala { grid-template-columns: repeat(6, 1fr); }

    .tel-row { flex-wrap: wrap; }
}

/* Telas de toque: alvos de no mínimo 44px e inputs sem zoom no iOS */
@media (pointer: coarse) {
    .btn, .btn-soft, .btn-outline { min-height: 44px; }
    .btn-icon, .atividade-row__rm { width: 44px; height: 44px; }
    .presenca-toggle .opt, .func-toggle .opt, .segmented a {
        min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    }
    .form-control, .form-select, .pop__panel input, textarea, select { font-size: 16px; }
    .check-pill { min-height: 44px; }
}
