/* ==========================================================================
   Vella · design system
   1. Tokens  2. Base  3. Animações  4. Auth  5. App shell
   6. Componentes  7. Telas  8. Responsivo  9. Movimento reduzido
   ========================================================================== */

/* 1. Tokens --------------------------------------------------------------- */

@property --p {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-2: #fbfbfd;
    --surface-glass: rgba(255, 255, 255, .72);
    --fill: rgba(118, 118, 128, .12);
    --fill-2: rgba(118, 118, 128, .08);
    --line: rgba(0, 0, 0, .08);
    --line-strong: rgba(0, 0, 0, .14);

    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #86868b;

    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-press: #006edb;
    --accent-soft: rgba(0, 113, 227, .1);
    --accent-ring: rgba(0, 113, 227, .28);
    --on-accent: #fff;

    --green: #34c759;
    --orange: #ff9f0a;
    --red: #ff3b30;
    --purple: #af52de;
    --teal: #30b0c7;
    --yellow: #ffcc00;

    --radius-xs: 8px;
    --radius-s: 10px;
    --radius: 14px;
    --radius-l: 20px;
    --radius-xl: 28px;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .02);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .06);
    --shadow-3: 0 10px 30px rgba(0, 0, 0, .08), 0 30px 80px rgba(0, 0, 0, .12);

    --ease: cubic-bezier(.32, .72, 0, 1);
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --spring: cubic-bezier(.34, 1.4, .64, 1);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --sidebar-w: 256px;
    --topbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --surface: #1c1c1e;
        --surface-2: #232325;
        --surface-glass: rgba(28, 28, 30, .72);
        --fill: rgba(118, 118, 128, .24);
        --fill-2: rgba(118, 118, 128, .16);
        --line: rgba(255, 255, 255, .1);
        --line-strong: rgba(255, 255, 255, .18);

        --text: #f5f5f7;
        --text-2: #a1a1a6;
        --text-3: #8e8e93;

        --accent: #0a84ff;
        --accent-hover: #2a94ff;
        --accent-press: #0077ed;
        --accent-soft: rgba(10, 132, 255, .18);
        --accent-ring: rgba(10, 132, 255, .4);

        --green: #30d158;
        --orange: #ff9f0a;
        --red: #ff453a;
        --purple: #bf5af2;
        --teal: #40c8e0;

        --shadow-1: 0 0 0 1px rgba(255, 255, 255, .04);
        --shadow-2: 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 30px rgba(0, 0, 0, .4);
        --shadow-3: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 80px rgba(0, 0, 0, .6);
    }
}

/* 2. Base ----------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.47;
    letter-spacing: -.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern", "tnum" 0;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.022em; line-height: 1.15; }
h1 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.03em; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 17px; }
p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px; }

::selection { background: var(--accent-soft); }

.icon { width: 20px; height: 20px; flex: none; }

.muted { color: var(--text-2); }
.only-mobile { display: none !important; }

/* 3. Animações ------------------------------------------------------------ */

@keyframes rise {
    from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(4px); }
    to   { opacity: 1; transform: none; filter: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop {
    0%   { transform: scale(.6); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-16px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateY(-10px) scale(.96); }
}
@keyframes ring-fill { from { --p: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(6vw, -4vh) scale(1.1); }
    66%  { transform: translate(-4vw, 5vh) scale(.95); }
    100% { transform: translate(0, 0) scale(1); }
}
@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.reveal {
    animation: rise .8s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

/* Transição entre páginas (View Transitions API, navegadores compatíveis). */
@view-transition { navigation: auto; }
.main { view-transition-name: main; }
::view-transition-old(main) { animation: .18s ease-in both fade reverse; }
::view-transition-new(main) { animation: .4s var(--ease-out) both rise; }

/* 4. Auth ----------------------------------------------------------------- */

body.auth {
    display: grid;
    place-items: center;
    overflow-x: hidden;
}

.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.aurora span {
    position: absolute;
    width: 52vmax;
    height: 52vmax;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
    animation: drift 22s ease-in-out infinite;
}
.aurora span:nth-child(1) { background: #a8c8ff; top: -20vmax; left: -12vmax; }
.aurora span:nth-child(2) { background: #b9eae0; bottom: -24vmax; right: -14vmax; animation-delay: -7s; animation-duration: 26s; }
.aurora span:nth-child(3) { background: #e6d4ff; top: 30%; left: 45%; width: 34vmax; height: 34vmax; animation-delay: -14s; opacity: .4; }

@media (prefers-color-scheme: dark) {
    .aurora span { opacity: .22; }
    .aurora span:nth-child(1) { background: #1f4fbf; }
    .aurora span:nth-child(2) { background: #136b62; }
    .aurora span:nth-child(3) { background: #5a2b9e; }
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    padding: 48px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 19px;
    letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-lg { font-size: 24px; gap: 12px; }

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px 32px;
    background: var(--surface-glass);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    backdrop-filter: saturate(180%) blur(30px);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-3);
}
.auth-card-wide { max-width: 480px; }

.auth-head { text-align: center; margin-bottom: 28px; display: grid; gap: 8px; justify-items: center; }
.auth-head h1 { font-size: 28px; }
.auth-head p { color: var(--text-2); max-width: 34ch; }

.auth-switch { color: var(--text-2); font-size: 14px; }
.auth-foot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-3);
    font-size: 12.5px;
    text-align: center;
}
.auth-foot .icon { width: 16px; height: 16px; }

.error-card { text-align: center; display: grid; gap: 12px; }
.error-code {
    font-size: 72px;
    font-weight: 700;
    letter-spacing: -.05em;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.debug {
    text-align: left;
    font: 12px/1.5 var(--font-mono);
    background: var(--fill-2);
    padding: 12px;
    border-radius: var(--radius-s);
    overflow-x: auto;
    white-space: pre-wrap;
}

/* 5. App shell ------------------------------------------------------------ */

body.app { display: flex; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 14px 14px;
    background: var(--surface-glass);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 4px 10px 18px; }

.nav { display: grid; gap: 2px; }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-s);
    color: var(--text);
    font-weight: 500;
    font-size: 14.5px;
    transition: background .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
}
.nav-item .icon { color: var(--text-2); transition: color .25s var(--ease), transform .35s var(--spring); }
.nav-item:hover { background: var(--fill-2); text-decoration: none; }
.nav-item:hover .icon { transform: scale(1.08); }
.nav-item:active { transform: scale(.98); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-item.is-active .icon { color: var(--accent); }

.sidebar-foot { margin-top: auto; display: grid; gap: 8px; }

.me {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--fill-2);
}
.me form { margin-left: auto; }
.me-text { display: grid; min-width: 0; line-height: 1.25; }
.me-text strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 12px; color: var(--text-2); }

.avatar {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #5e8bff, var(--accent));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

.scrim { display: none; }

.shell {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 32px;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(380px, 100%);
}
.search .icon { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.search input {
    width: 100%;
    height: 38px;
    padding: 0 48px 0 38px;
    border: 0;
    border-radius: var(--radius-s);
    background: var(--fill);
    outline: none;
    transition: background .25s var(--ease), box-shadow .25s var(--ease);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-1); }
.search kbd {
    position: absolute;
    right: 10px;
    font: 500 11.5px var(--font);
    color: var(--text-3);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--line-strong);
    pointer-events: none;
}

.main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 28px 32px 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr); /* conteúdo largo (abas, tabelas) rola por dentro, não estoura a página */
    gap: 20px;
}

/* 6. Componentes ---------------------------------------------------------- */

/* Botões */
.btn {
    --btn-bg: var(--fill);
    --btn-fg: var(--text);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 980px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease), opacity .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn .icon { width: 18px; height: 18px; transition: transform .35s var(--spring); }
.btn:hover .icon:last-child:not(:first-child) { transform: translateX(3px); }

.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); }
.btn-primary:hover { --btn-bg: var(--accent-hover); box-shadow: 0 6px 20px var(--accent-ring); }
.btn-primary:active { --btn-bg: var(--accent-press); }

.btn-secondary { --btn-bg: var(--accent-soft); --btn-fg: var(--accent); }
.btn-secondary:hover { --btn-bg: color-mix(in srgb, var(--accent) 16%, transparent); }

.btn-ghost { --btn-bg: transparent; --btn-fg: var(--accent); padding: 0 10px; }
.btn-ghost:hover { --btn-bg: var(--accent-soft); }

.btn-danger { --btn-bg: color-mix(in srgb, var(--red) 12%, transparent); --btn-fg: var(--red); }

.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn-sm.btn-ghost { padding: 0 8px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: .6; pointer-events: none; }
.btn.is-loading { color: transparent; }
.btn.is-loading .icon { opacity: 0; }
.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--btn-fg);
    border-right-color: transparent;
    animation: spin .7s linear infinite;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-2);
    transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn:active { transform: scale(.92); }

/* Formulários */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { display: grid; gap: 7px; align-content: start; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); padding-left: 2px; }
.field-hint { font-size: 12.5px; color: var(--text-3); padding-left: 2px; transition: color .2s; }
.field-error {
    font-size: 12.5px;
    color: var(--red);
    padding-left: 2px;
    animation: rise .35s var(--ease-out) both;
}

.input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 16px; /* evita zoom no iOS */
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s;
    -webkit-appearance: none;
    appearance: none;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: color-mix(in srgb, var(--text) 24%, transparent); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

select.input {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
}

.has-error .input { border-color: var(--red); }
.has-error .input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent); }
.has-error.field, .check.has-error { animation: shake .45s var(--ease) both; }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-action {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-3);
    transition: background .2s, color .2s;
}
.input-action:hover { background: var(--fill-2); color: var(--text); }
.input-action .when-on, .input-action.is-on .when-off { display: none; }
.input-action.is-on .when-on { display: block; }

.input-group { display: grid; grid-template-columns: 112px auto 1fr; align-items: center; gap: 8px; }
.input-sep { color: var(--text-3); font-size: 20px; font-weight: 300; }

/* Medidor de força de senha */
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 2px; }
.strength i {
    height: 4px;
    border-radius: 4px;
    background: var(--fill);
    transform-origin: left;
    transition: background .35s var(--ease), transform .35s var(--spring);
}
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--red); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--orange); }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--yellow); }
.strength[data-level="4"] i:nth-child(-n+4) { background: var(--green); }

/* Checkbox */
.check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.45;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 7px;
    border: 1.5px solid var(--line-strong);
    background: var(--surface);
    color: #fff;
    transition: background .2s var(--ease), border-color .2s var(--ease), box-shadow .25s;
}
.check-box .icon { width: 15px; height: 15px; stroke-width: 3; transform: scale(0); transition: transform .3s var(--spring); }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box .icon { transform: scale(1); }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 4px var(--accent-ring); }
.check.has-error .check-box { border-color: var(--red); }

/* Cards */
.card {
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-2);
    transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.card-title .icon { color: var(--text-3); width: 18px; height: 18px; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 11px;
    border-radius: 980px;
    background: var(--fill);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-glass { background: rgba(255, 255, 255, .2); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* Anel de progresso */
.ring {
    --size: 76px;
    --track: var(--fill);
    flex: none;
    position: relative;
    width: var(--size);
    height: var(--size);
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--track) 0);
    animation: ring-fill 1.4s .3s var(--ease-out) both;
}
.ring::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--surface);
}
.ring span { position: relative; font-size: 13px; color: var(--text-2); }
.ring strong { font-size: 22px; color: var(--text); font-weight: 600; letter-spacing: -.02em; }

/* Lista de passos */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.step a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    margin: 0 -12px;
    border-radius: var(--radius);
    color: var(--text);
    transition: background .25s var(--ease);
}
.step a:hover { background: var(--fill-2); text-decoration: none; }
.step-dot {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    transition: all .3s var(--ease);
}
.step-dot .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.step.is-done .step-dot { background: var(--green); border-color: var(--green); color: #fff; animation: pop .5s var(--spring) both; }
.step.is-done strong { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-3); }
.step-text { display: grid; min-width: 0; line-height: 1.3; }
.step-text strong { font-weight: 500; font-size: 15px; }
.step-text small { color: var(--text-3); font-size: 13px; }
.step-go { margin-left: auto; color: var(--text-3); width: 18px; height: 18px; transition: transform .3s var(--spring), color .2s; }
.step a:hover .step-go { transform: translateX(4px); color: var(--accent); }

/* Estado vazio */
.empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 36px 16px 20px;
    text-align: center;
}
.empty p { color: var(--text-2); max-width: 42ch; font-size: 14px; }
.empty h4 { margin-top: 4px; }
.empty .btn { margin-top: 8px; }
.empty-sm { padding: 16px 8px 6px; gap: 8px; }
.empty-sm p { font-size: 13.5px; }
.empty-lg { padding: 56px 16px 40px; }
.empty-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--fill-2);
    color: var(--text-3);
}
.empty-icon .icon { width: 26px; height: 26px; }
.empty-sm .empty-icon { width: 40px; height: 40px; border-radius: 12px; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.empty-sm .empty-icon .icon { width: 22px; height: 22px; }
.empty-icon-lg { width: 72px; height: 72px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); }
.empty-icon-lg .icon { width: 34px; height: 34px; }

/* Indicadores */
.stat {
    display: grid;
    gap: 4px;
    padding: 20px 22px;
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-2);
}
.stat-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    margin-bottom: 10px;
}
.stat-icon .icon { width: 19px; height: 19px; }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.tint-blue   { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.tint-green  { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.tint-purple { background: color-mix(in srgb, var(--purple) 13%, transparent); color: var(--purple); }
.tint-orange { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }

/* Toasts */
.toasts {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 100;
    transform: translateX(-50%);
    display: grid;
    gap: 8px;
    width: min(420px, calc(100% - 32px));
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px 12px 14px;
    background: var(--surface-glass);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-3);
    font-size: 14px;
    pointer-events: auto;
    animation: toast-in .55s var(--spring) both;
}
.toast.is-leaving { animation: toast-out .3s var(--ease) both; }
.toast-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; }
.toast-icon .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.toast-success .toast-icon { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.toast-error .toast-icon { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.toast-info .toast-icon { background: var(--accent-soft); color: var(--accent); }
.toast-text { flex: 1; }
.toast-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); }
.toast-close:hover { background: var(--fill); }
.toast-close .icon { width: 15px; height: 15px; }

/* Controle segmentado */
.segmented {
    position: relative;
    display: inline-flex;
    padding: 2px;
    border-radius: 10px;
    background: var(--fill);
}
.segmented button {
    position: relative;
    z-index: 1;
    height: 30px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 13.5px;
    font-weight: 500;
    transition: color .2s;
}
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }

/* 7. Telas ---------------------------------------------------------------- */

.page-head { display: grid; gap: 6px; padding: 8px 0 8px; }
.eyebrow { color: var(--text-2); font-size: 14px; font-weight: 500; }
.eyebrow::first-letter { text-transform: uppercase; }
.lead { color: var(--text-2); font-size: 17px; }

.grid { display: grid; gap: 20px; }
.grid-hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

.card-onboarding { padding: 28px; }
.onboarding-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.onboarding-head h2 { margin-bottom: 4px; }
.onboarding-head p { font-size: 14px; }

.card-trial {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(140deg, #3d7bff 0%, #0071e3 45%, #30b0c7 100%);
    box-shadow: 0 16px 40px rgba(0, 113, 227, .28);
    display: grid;
    gap: 6px;
    justify-items: start;
}
.card-trial::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 70%);
    animation: drift 14s ease-in-out infinite;
}
.card-trial p { position: relative; color: rgba(255, 255, 255, .86); font-size: 14px; }
.trial-days { margin-top: 10px; color: #fff !important; font-size: 17px !important; }
.trial-days strong { font-size: 44px; font-weight: 700; letter-spacing: -.04em; margin-right: 4px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* Formulários longos */
.label { font-size: 13px; font-weight: 500; color: var(--text-2); padding-left: 2px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.optional { font-weight: 400; color: var(--text-3); margin-left: 4px; }
.small { font-size: 13px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.form-sections { gap: 0; }
.form-section { display: grid; gap: 18px; padding: 24px 0; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 4px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 4px; }
.section-title .icon { width: 18px; height: 18px; color: var(--text-3); }
.card-form > .section-title { margin-bottom: 18px; }

.form-row-3 { grid-template-columns: 110px 1fr 1fr; }
.form-row-cep { grid-template-columns: 150px 1fr; }
.form-row-city { grid-template-columns: 1fr 110px; }
.form-narrow { max-width: 440px; }

.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 8px; flex-wrap: wrap; }
.form-actions-start { justify-content: flex-start; }
.form-actions .btn-ghost { margin-right: auto; }

.card-form { padding: 28px; }
.card-intro { display: grid; gap: 4px; margin-bottom: 20px; }

@keyframes flash { 0% { background: var(--accent-soft); } }
.input.flash { animation: flash .9s var(--ease) both; }
.field.is-loading label::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    border-right-color: transparent;
    animation: spin .7s linear infinite;
    vertical-align: -1px;
}

/* Prefixo dentro do input (R$) */
.input-affix { position: relative; }
.input-affix > span {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 16px;
    pointer-events: none;
}
.input-affix .input { padding-left: 44px; font-variant-numeric: tabular-nums; }

/* Cartões de escolha (radio) */
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
    display: grid;
    gap: 2px;
    padding: 16px;
    height: 100%;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s, transform .2s var(--ease);
}
.choice-body .icon { width: 22px; height: 22px; color: var(--text-3); margin-bottom: 8px; transition: color .2s, transform .4s var(--spring); }
.choice-body strong { font-weight: 600; font-size: 15px; }
.choice-body small { color: var(--text-3); font-size: 12.5px; }
.choice:hover .choice-body { border-color: color-mix(in srgb, var(--text) 24%, transparent); }
.choice:active .choice-body { transform: scale(.98); }
.choice input:checked + .choice-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice input:checked + .choice-body .icon { color: var(--accent); transform: scale(1.12); }
.choice input:focus-visible + .choice-body { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Bloco que abre e fecha suavemente (grid 0fr → 1fr) */
.collapsible {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .45s var(--ease), opacity .3s var(--ease), padding .45s var(--ease);
}
.collapsible.is-open { grid-template-rows: 1fr; opacity: 1; }
/* Fechado dentro de um .form, compensa o gap do grid para não sobrar vão. */
.form > .collapsible:not(.form-section) { transition: grid-template-rows .45s var(--ease), opacity .3s var(--ease), margin .45s var(--ease); }
.form > .collapsible:not(.form-section):not(.is-open) { margin-top: -18px; }
.collapsible-inner { overflow: hidden; display: grid; gap: 18px; min-height: 0; }
.form-section.collapsible { padding-top: 0; padding-bottom: 0; border-top-color: transparent; }
.form-section.collapsible.is-open { padding: 24px 0; border-top-color: var(--line); }

/* Abas (links) */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--fill-2);
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    color: var(--text-2);
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: background .25s var(--ease), color .2s, box-shadow .25s;
}
.tab .icon { width: 17px; height: 17px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04); }

/* Controle segmentado com radios */
.segmented { width: max-content; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label span {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-2);
    transition: background .25s var(--ease), color .2s, box-shadow .25s;
}
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

/* Switch estilo iOS */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
    position: relative;
    flex: none;
    width: 46px;
    height: 28px;
    border-radius: 28px;
    background: var(--fill);
    transition: background .3s var(--ease);
}
.switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .04);
    transition: transform .4s var(--spring), width .2s var(--ease);
}
.switch:active .switch-thumb { width: 28px; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch:active input:checked + .switch-track .switch-thumb { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Horários */
.days { display: grid; }
.day {
    display: grid;
    grid-template-columns: 170px 1fr auto;
    align-items: start;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
.day:first-child { border-top: 0; }
.day .switch { height: 44px; }
.day-name { font-weight: 500; }
.day-body { display: grid; gap: 6px; min-width: 0; }
.ranges { display: grid; gap: 8px; }
.range { display: flex; align-items: center; gap: 10px; animation: rise .4s var(--ease-out) both; }
.range.is-leaving { animation: toast-out .25s var(--ease) both; }
.range-sep { color: var(--text-3); font-size: 13px; }
.input-time { width: 120px; height: 44px; font-variant-numeric: tabular-nums; }
.range:only-child [data-range-remove] { visibility: hidden; }
.day-off { display: none; height: 44px; align-items: center; color: var(--text-3); }
.day:not(.is-on) .ranges, .day:not(.is-on) .day-add { display: none; }
.day:not(.is-on) .day-off { display: flex; }
.day:not(.is-on) .day-name { color: var(--text-2); }
.day-add { margin-top: 4px; }

.icon-btn-sm { width: 34px; height: 34px; }
.icon-btn-sm .icon { width: 18px; height: 18px; }

/* Foto de perfil */
.photo-field { display: flex; align-items: center; gap: 24px; }
.photo {
    position: relative;
    flex: none;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #5e8bff, var(--accent));
    box-shadow: var(--shadow-2);
    transition: transform .3s var(--spring);
}
.photo:hover { transform: scale(1.03); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade .4s var(--ease); }
.photo-initials { display: grid; place-items: center; height: 100%; color: #fff; font-size: 34px; font-weight: 600; }
.photo-edit {
    position: absolute;
    inset: auto 0 0;
    height: 34px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(100%);
    transition: opacity .25s, transform .35s var(--ease);
}
.photo-edit .icon { width: 17px; height: 17px; }
.photo:hover .photo-edit { opacity: 1; transform: none; }
.photo-text { display: grid; gap: 4px; min-width: 0; }
.photo-actions { display: flex; align-items: center; gap: 16px; margin: 10px 0 2px; flex-wrap: wrap; }
.check-sm { align-items: center; font-size: 14px; }
.check-sm .check-box { margin-top: 0; width: 20px; height: 20px; border-radius: 6px; }

/* Chips (checkbox) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: 36px;
    padding: 0 16px;
    border-radius: 980px;
    border: 1.5px solid var(--line-strong);
    font-size: 14px;
    font-weight: 500;
    transition: all .25s var(--ease);
}
.chip .icon { width: 0; height: 15px; stroke-width: 2.6; opacity: 0; transition: width .3s var(--spring), opacity .2s, margin .3s var(--spring); }
.chip:hover span { border-color: color-mix(in srgb, var(--text) 24%, transparent); }
.chip:active span { transform: scale(.96); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:checked + span .icon { width: 15px; opacity: 1; margin-right: 6px; }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Assinatura */
.signature-preview {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 28px 16px 18px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px dashed var(--line-strong);
}
.signature-preview span {
    font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", "Apple Chancery", cursive;
    font-size: 30px;
    line-height: 1.2;
    padding: 0 24px 6px;
    border-bottom: 1px solid var(--text-3);
    min-width: 60%;
    text-align: center;
}
.signature-preview small { color: var(--text-3); font-size: 12px; margin-top: 6px; }

.dropzone {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 20px;
    border-radius: var(--radius);
    border: 1.5px dashed var(--line-strong);
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone img { max-height: 120px; max-width: 100%; object-fit: contain; }
.dropzone-text { display: grid; justify-items: center; gap: 4px; text-align: center; color: var(--text-2); }
.dropzone-text .icon { width: 26px; height: 26px; color: var(--accent); margin-bottom: 4px; }
.dropzone-text small { color: var(--text-3); }
[hidden] { display: none !important; }

/* Conta */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-weight: 500; }
.card-form > .small + form { margin-top: 14px; }
.card-form p.small { margin-bottom: 4px; }
.badge-green { background: color-mix(in srgb, var(--green) 15%, transparent); color: color-mix(in srgb, var(--green) 80%, var(--text)); }
.badge-orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: color-mix(in srgb, var(--orange) 75%, var(--text)); }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: var(--text-2); font-size: 14px; }
.info-list li { display: flex; align-items: center; gap: 12px; }
.info-list .icon { width: 18px; height: 18px; color: var(--text-3); }

/* Aviso no topo do conteúdo */
.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 16px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--orange) 11%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--orange) 22%, transparent);
    font-size: 14px;
}
.notice > .icon { color: var(--orange); width: 18px; height: 18px; }
.notice p { flex: 1; }
.notice form { margin-left: auto; }

/* Avatar com foto */
.avatar { overflow: hidden; text-decoration: none !important; transition: transform .3s var(--spring); }
.avatar:hover { transform: scale(1.06); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Passos que dependem de fases futuras */
.step.is-later .step-text strong { color: var(--text-2); }
.step.is-later .step-dot { border-style: dashed; }
.step .badge { height: 22px; font-size: 11.5px; padding: 0 9px; }

.pop { animation: pop .6s .2s var(--spring) both; }
.auth-head .empty-icon-lg { margin-bottom: 6px; }

/* Assistente de onboarding */
body.focus { min-height: 100dvh; }
.aurora-soft span { opacity: .28; }
.focus-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-h);
    padding: 0 28px;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
}
.focus-main { position: relative; z-index: 1; max-width: 760px; padding-top: 16px; }

.wizard-progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wizard-progress a { display: block; padding: 8px 0; }
.wizard-progress span {
    display: block;
    height: 5px;
    border-radius: 5px;
    background: var(--fill);
    position: relative;
    overflow: hidden;
}
.wizard-progress span::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .8s var(--ease-out);
}
.wizard-progress .is-done span::after { background: var(--green); transform: scaleX(1); animation: grow .8s .2s var(--ease-out) both; }
.wizard-progress .is-current span::after { transform: scaleX(1); animation: grow .8s .2s var(--ease-out) both; }
@keyframes grow { from { transform: scaleX(0); } }

.wizard-head { display: grid; gap: 6px; padding: 12px 0 4px; }
.wizard-nav { display: flex; justify-content: space-between; }

/* Pacientes ---------------------------------------------------------------- */

.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head-row > div:first-child { display: grid; gap: 6px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; width: max-content; margin-bottom: 2px; }
.back-link .icon { width: 16px; height: 16px; }
.icon.flip { transform: rotate(180deg); }
.icon.rot-up { transform: rotate(-90deg); }
.icon.rot-down { transform: rotate(90deg); }

.tabs-scroll { max-width: 100%; }
.tab-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tab.is-active .tab-count { color: var(--text-2); }

/* Avatares com tons estáveis por nome */
.tone-1 { background: linear-gradient(135deg, #6ea8ff, #0071e3); }
.tone-2 { background: linear-gradient(135deg, #7ad3c4, #30a89a); }
.tone-3 { background: linear-gradient(135deg, #c39bff, #8e5cf0); }
.tone-4 { background: linear-gradient(135deg, #ffb27a, #f0763a); }
.tone-5 { background: linear-gradient(135deg, #ff94b4, #e0487a); }
.tone-6 { background: linear-gradient(135deg, #9fb4c8, #5f7690); }
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; box-shadow: var(--shadow-2); }

/* Filtros */
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-inline { width: min(300px, 100%); }
.search-inline input { height: 36px; padding-right: 12px; }
.input-sm { height: 36px; font-size: 14px; padding: 0 30px 0 12px; border-radius: var(--radius-s); width: auto; }
select.input-sm { background-position: right 8px center; background-size: 16px; }
.chip-sm span { height: 36px; padding: 0 14px; font-size: 13.5px; }

/* Lista de pacientes */
.card-list { padding: 6px; }
.patient-list { list-style: none; margin: 0; padding: 0; }
.patient-list li { animation: rise .5s var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 30ms); }
.patient-list li + li .patient-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 64px;
    right: 14px;
    border-top: 1px solid var(--line);
}
.patient-row {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--text);
    transition: background .2s var(--ease);
}
.patient-row:hover { background: var(--fill-2); text-decoration: none; }
.patient-row:hover::before, .patient-list li:hover + li .patient-row::before { opacity: 0; }
.patient-main { display: grid; min-width: 0; line-height: 1.3; }
.patient-main strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.patient-main small, .patient-slot { color: var(--text-2); font-size: 13px; }
.patient-slot { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.patient-slot .icon { width: 15px; height: 15px; color: var(--text-3); }
.patient-tags { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.row-go { width: 17px; height: 17px; color: var(--text-3); transition: transform .3s var(--spring); }
.patient-row:hover .row-go, .pending-list a:hover .row-go { transform: translateX(3px); }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 9px;
    border-radius: 7px;
    background: var(--fill-2);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}
a.tag:hover { background: var(--fill); text-decoration: none; }
.badge-gray { background: var(--fill); color: var(--text-2); }
.badge-red { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.tint-red { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.empty-actions .btn { margin: 0; }

.notice-info { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 18%, transparent); }
.notice-info > .icon { color: var(--accent); }

/* Ficha */
.patient-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.patient-hero-text { flex: 1; min-width: 220px; display: grid; gap: 6px; }
.patient-hero-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.patient-hero-title h1 { font-size: 28px; }
.patient-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 14px; }
.patient-meta span { display: inline-flex; align-items: center; gap: 6px; }
.patient-meta .icon { width: 16px; height: 16px; color: var(--text-3); }
.patient-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kv-list { margin: 14px 0 0; display: grid; }
.kv-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.kv-list > div:first-child { border-top: 0; padding-top: 0; }
.kv-list dt { color: var(--text-2); }
.kv-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv-block > div { grid-template-columns: 1fr; gap: 4px; }

.pending-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.pending-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 -12px; border-radius: var(--radius-s); color: var(--text); font-size: 14px; transition: background .2s; }
.pending-list a:hover { background: var(--fill-2); text-decoration: none; }
.pending-list .row-go { margin-left: auto; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot-orange { background: var(--orange); }
.dot-green { background: var(--green); }
.dot-accent { background: var(--accent); }
.dot-gray { background: var(--text-3); }

/* Formulários do paciente */
.textarea { height: auto; min-height: 46px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.input-pair { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.input-pair-wide { grid-template-columns: 1fr 1fr; }
.input-pair .input-time { width: 100%; }
.segmented-fill { display: flex; width: 100%; height: 46px; padding: 3px; border-radius: var(--radius); }
.segmented-fill label { flex: 1; }
.segmented-fill label span { width: 100%; height: 100%; justify-content: center; font-size: 15px; border-radius: 11px; }
.card-sub { margin: -10px 0 16px; }

.card-details summary { list-style: none; cursor: pointer; margin: 0; user-select: none; }
.card-details summary::-webkit-details-marker { display: none; }
.card-details:not([open]) > summary { margin-bottom: 0; }
.sheet-head h2:focus { outline: none; }
.card-details .summary-go { margin-left: auto; transition: transform .35s var(--ease); }
.card-details[open] .summary-go { transform: rotate(90deg); }
.details-body { padding-top: 18px; animation: rise .45s var(--ease-out) both; }

.tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 46px;
    padding: 6px 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: text;
    transition: border-color .2s, box-shadow .25s;
}
.tag-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tag-input input { flex: 1; min-width: 140px; height: 32px; border: 0; outline: 0; background: transparent; font-size: 15px; padding: 0 6px; }
.tag-removable { height: 30px; padding: 0 4px 0 10px; background: var(--accent-soft); color: var(--accent); font-size: 14px; animation: pop .35s var(--spring) both; }
.tag-removable button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; }
.tag-removable button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.tag-removable .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.tag-input + .field-hint { margin-top: 8px; }

/* Diálogos tipo "sheet" */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog[open]::backdrop { animation: fade .3s var(--ease) both; }
dialog.is-closing::backdrop { animation: fade .25s var(--ease) reverse both; }
.sheet {
    width: min(480px, calc(100% - 32px));
    max-height: calc(100dvh - 48px);
    padding: 24px;
    border: 0;
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-3);
    overflow: auto;
}
.sheet[open] { animation: sheet-in .5s var(--spring) both; }
.sheet.is-closing { animation: sheet-out .22s var(--ease) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(12px) scale(.97); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.radio-list { display: grid; gap: 2px; padding: 4px; border-radius: var(--radius); background: var(--fill-2); }
.radio-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-weight: 500; transition: background .2s; }
.radio-row:hover { background: var(--surface); }
.radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-row .dot { margin-left: auto; }
.radio-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); transition: border .25s var(--spring); }
.radio-row input:checked + .radio-dot { border: 6px solid var(--accent); }
.radio-row input:focus-visible + .radio-dot { box-shadow: 0 0 0 4px var(--accent-ring); }
.radio-row:has(input:checked) { background: var(--surface); box-shadow: var(--shadow-1); }

/* Prontuário: anamnese */
.card-highlight { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); display: grid; gap: 12px; justify-items: start; }
.copy-field { display: flex; gap: 8px; width: 100%; }
.copy-field .input { font: 13.5px var(--font-mono); color: var(--text-2); }
.btn.is-done { --btn-bg: color-mix(in srgb, var(--green) 16%, transparent); --btn-fg: var(--green); }

.doc-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.doc-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc-list li:first-child { border-top: 0; }
.doc-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.doc-main { flex: 1; min-width: 180px; display: grid; line-height: 1.35; }
.doc-main strong { font-weight: 500; }
.doc-main small { color: var(--text-2); font-size: 13px; }
.doc-actions { display: flex; align-items: center; gap: 6px; }
.anamnesis-start { display: grid; gap: 14px; margin-top: 10px; }
.anamnesis-start.is-compact { padding-top: 16px; border-top: 1px solid var(--line); }
.anamnesis-start-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anamnesis-start-row .segmented { margin-right: auto; }

.questions { display: grid; gap: 26px; }
.question { display: grid; gap: 10px; }
.question-label { display: flex; gap: 12px; font-weight: 500; font-size: 15.5px; line-height: 1.4; }
.question-n {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--fill-2);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    margin-top: -1px;
}
.question > :not(label) { margin-left: 38px; }
.form-actions-sticky {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    padding: 10px;
    margin: 0 auto;
    width: max-content;
    max-width: 100%;
    border-radius: 980px;
    background: var(--surface-glass);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: var(--shadow-3);
}

/* Editor de modelos */
.tq-list { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 8px; counter-reset: tq; }
.tq { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); animation: rise .35s var(--ease-out) both; }
.tq-handle { display: grid; gap: 0; }
.tq-handle .icon-btn { width: 28px; height: 22px; border-radius: 6px; }
.tq-body { flex: 1; display: grid; gap: 8px; min-width: 0; }
.tq-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tq-meta [data-tq-options] { flex: 1; min-width: 200px; }

/* Importação */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.stepper li { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 6px; border-radius: 980px; background: var(--fill-2); color: var(--text-2); font-size: 14px; font-weight: 500; }
.stepper li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); font-size: 12px; }
.stepper li span .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.stepper .is-current { background: var(--accent-soft); color: var(--accent); }
.stepper .is-current span { background: var(--accent); color: #fff; }
.stepper .is-done span { background: var(--green); color: #fff; }
.dropzone-lg { min-height: 200px; }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: color-mix(in srgb, var(--green) 7%, var(--surface)); }
.dropzone.has-error { border-color: var(--red); }

.map-list { display: grid; margin-top: 12px; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 260px); align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.map-row:first-child { border-top: 0; }
.map-col { display: grid; min-width: 0; line-height: 1.35; }
.map-col small { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-arrow { color: var(--text-3); width: 18px; height: 18px; transition: color .2s, transform .3s var(--spring); }
.map-row.is-mapped .map-arrow { color: var(--accent); transform: translateX(3px); }
.map-row.is-mapped select { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--text-3); padding: 10px 12px; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table tr.is-error td { background: color-mix(in srgb, var(--red) 5%, transparent); }
.table tr.is-warn td { background: color-mix(in srgb, var(--orange) 6%, transparent); }
.row-msg { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.row-msg .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.row-error { color: var(--red); }
.row-warn { color: color-mix(in srgb, var(--orange) 80%, var(--text)); }
.row-ok { color: var(--green); }
.form-actions-left { margin-right: auto; }

/* Passo 3 do onboarding */
.quick-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ring-sm { --size: 56px; }
.ring-sm::before { inset: 6px; }
.ring-sm strong { font-size: 18px; }
.quick-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 12px; }
.quick-list { list-style: none; margin: 18px 0 8px; padding: 0; display: grid; gap: 2px; }
.quick-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.quick-list li:first-child { border-top: 0; }
.quick-list strong { font-weight: 500; }
.quick-list .muted { margin-left: auto; font-size: 13px; }

/* Busca global */
.search-trigger { border: 0; height: 38px; padding: 0 48px 0 38px; border-radius: var(--radius-s); background: var(--fill); color: var(--text-3); text-align: left; font-size: 15px; transition: background .2s; }
.search-trigger:hover { background: color-mix(in srgb, var(--fill) 140%, transparent); }
.search-trigger span { white-space: nowrap; overflow: hidden; }

.palette {
    width: min(620px, calc(100% - 24px));
    margin: 12vh auto auto;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}
.palette[open] { animation: palette-in .35s var(--spring) both; }
.palette.is-closing { animation: sheet-out .18s var(--ease) both; }
@keyframes palette-in { from { opacity: 0; transform: scale(.96) translateY(-8px); } }
.palette-box {
    border-radius: 18px;
    background: var(--surface-glass);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    backdrop-filter: saturate(180%) blur(30px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    overflow: hidden;
}
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input .icon { width: 20px; height: 20px; color: var(--text-3); }
.palette-input input { flex: 1; height: 58px; border: 0; outline: 0; background: transparent; font-size: 18px; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-input kbd { font: 500 11.5px var(--font); color: var(--text-3); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); }
.palette-results { max-height: min(420px, 60vh); overflow-y: auto; padding: 8px; }
.palette-label { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 8px 10px 4px; }
.palette-empty { padding: 28px 12px; text-align: center; color: var(--text-2); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; color: var(--text); font-size: 15px; }
.palette-item:hover { text-decoration: none; }
.palette-item.is-active { background: var(--accent); color: #fff; }
.palette-item.is-active small, .palette-item.is-active .palette-meta, .palette-item.is-active .palette-icon { color: rgba(255, 255, 255, .85); }
.palette-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--text-2); }
.palette-icon .icon { width: 18px; height: 18px; }
.palette-text { display: grid; line-height: 1.3; min-width: 0; }
.palette-text small { color: var(--text-2); font-size: 12.5px; }
.palette-meta { margin-left: auto; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* Página pública (paciente) */
body.public { min-height: 100dvh; }
.public-main { position: relative; z-index: 1; max-width: 720px; padding-top: 40px; }
.public-head { display: grid; justify-items: center; text-align: center; gap: 10px; padding-bottom: 8px; }
.public-head .eyebrow { margin-top: 6px; }
.public-head .lead { max-width: 52ch; }
.progress-bar { position: sticky; top: 0; z-index: 10; height: 4px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out); }
.public-foot { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 0 16px 48px; display: grid; gap: 8px; text-align: center; color: var(--text-3); font-size: 13px; }
.public-foot p { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.public-foot .icon { width: 15px; height: 15px; }
.public-brand { margin-top: 12px; font-weight: 600; color: var(--text-2); }
.public-message { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 56px 28px; margin-top: 10vh; }
.empty-icon-green { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.center { text-align: center; }

/* Agenda ------------------------------------------------------------------- */

.badge-purple { background: color-mix(in srgb, var(--purple) 13%, transparent); color: var(--purple); }

.agenda-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 8px; }
.agenda-title { display: grid; gap: 4px; }
.agenda-title h1 { font-size: clamp(26px, 3vw, 34px); }
.agenda-title h1::first-letter { text-transform: uppercase; }
.agenda-title p { font-size: 14px; }
.agenda-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-group { display: flex; align-items: center; gap: 2px; }

.seg-links { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--fill); }
.seg-links a { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.seg-links a:hover { color: var(--text); text-decoration: none; }
.seg-links a.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }

.agenda-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 980px; background: var(--surface); box-shadow: var(--shadow-1); border: 1px solid var(--line); color: var(--text); font-size: 13.5px; font-weight: 500; transition: background .2s, transform .2s var(--ease); }
.pill:hover { background: var(--surface-2); text-decoration: none; }
.pill:active { transform: scale(.97); }
.pill .icon { width: 16px; height: 16px; color: var(--text-3); }
.pill-warn { border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.pill-warn .icon { color: var(--orange); }
.pill-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--orange); color: #fff; font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; }
.legend { margin-left: auto; display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Cores por status: usadas na grade, no mês, na lista de hoje e nas barrinhas */
.ev-agendada            { --ev: var(--accent); }
.ev-confirmada          { --ev: var(--green); }
.ev-realizada           { --ev: var(--text-3); }
.ev-falta               { --ev: var(--red); }
.ev-cancelada_paciente  { --ev: var(--orange); }
.ev-cancelada_psicologo { --ev: var(--text-3); }
.ev-remarcada           { --ev: var(--purple); }
.ev-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ev); }
.ev-bar { flex: none; width: 4px; align-self: stretch; border-radius: 4px; background: var(--ev); }

/* Grade dia/semana */
.cal-card { padding: 0; overflow: hidden; }
.cal { --hour: 64px; --gutter: 58px; }
.cal-head, .cal-allday, .cal-body { display: grid; grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line); background: var(--surface); position: relative; z-index: 3; }
.cal-dayhead { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; color: var(--text-2); border-left: 1px solid var(--line); transition: background .2s; }
.cal-dayhead:hover { background: var(--fill-2); text-decoration: none; }
.cal-dayhead span { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.cal-dayhead strong { display: grid; place-items: center; min-width: 32px; height: 32px; border-radius: 50%; font-size: 19px; font-weight: 500; color: var(--text); }
.cal-dayhead small { font-size: 11px; color: var(--text-3); }
.cal-dayhead.is-today span { color: var(--red); }
.cal-dayhead.is-today strong { background: var(--red); color: #fff; font-weight: 600; }
.cal-day .cal-dayhead { justify-content: flex-start; padding-left: 16px; }

.cal-allday { border-bottom: 1px solid var(--line); background: var(--surface); }
.cal-allday > div { min-height: 34px; padding: 4px; border-left: 1px solid var(--line); display: grid; gap: 3px; align-content: start; }
.cal-allday .cal-gutter { display: grid; place-items: center end; padding-right: 8px; border-left: 0; }
.cal-gutter small { font-size: 10.5px; color: var(--text-3); }
.allday-chip { display: flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--text-3) 16%, transparent); font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.allday-chip .icon { width: 12px; height: 12px; }

.cal-scroll { max-height: max(460px, calc(100dvh - 290px)); overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.cal-body { position: relative; height: calc(var(--hours) * var(--hour)); }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 8px; top: calc(var(--top) * var(--hour) / 60); transform: translateY(-50%); font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line); background: var(--fill-2); cursor: copy; }
.cal-col::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(to bottom, var(--line) 1px, transparent 1px),
        linear-gradient(to bottom, transparent calc(var(--hour) / 2), color-mix(in srgb, var(--line) 45%, transparent) calc(var(--hour) / 2), transparent calc(var(--hour) / 2 + 1px));
    background-size: 100% var(--hour);
}
.cal-col.is-today { background: color-mix(in srgb, var(--accent) 5%, var(--fill-2)); }
.cal-work { position: absolute; left: 0; right: 0; top: calc(var(--top) * var(--hour) / 60); height: calc(var(--len) * var(--hour) / 60); background: var(--surface); }
.cal-col.is-today .cal-work { background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.cal-col.is-blocked::before, .cal-block {
    background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--text-3) 14%, transparent) 0 6px, transparent 6px 12px);
}
.cal-col.is-blocked::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cal-block { position: absolute; left: 0; right: 0; z-index: 1; top: calc(var(--top) * var(--hour) / 60); height: calc(var(--len) * var(--hour) / 60); border-top: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong); }
.cal-block span { display: inline-flex; align-items: center; gap: 4px; margin: 4px 6px; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.cal-block .icon { width: 12px; height: 12px; }

.ev {
    position: absolute;
    z-index: 2;
    top: calc(var(--top) * var(--hour) / 60 + 1px);
    height: calc(var(--len) * var(--hour) / 60 - 2px);
    left: calc(var(--lane) / var(--lanes) * 100% + 2px);
    width: calc(100% / var(--lanes) - 4px);
    display: grid;
    align-content: start;
    gap: 1px;
    padding: 5px 8px;
    border: 0;
    border-left: 3px solid var(--ev);
    border-radius: 8px;
    background: color-mix(in srgb, var(--ev) 14%, var(--surface));
    color: color-mix(in srgb, var(--ev) 55%, var(--text));
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    font-size: 12.5px;
    line-height: 1.25;
    transition: transform .25s var(--spring), box-shadow .25s var(--ease), background .2s;
    animation: fade .4s var(--ease) both;
}
.ev:hover { z-index: 4; transform: scale(1.02); box-shadow: var(--shadow-2); background: color-mix(in srgb, var(--ev) 20%, var(--surface)); }
.ev strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: color-mix(in srgb, var(--ev) 35%, var(--text)); }
.ev small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.ev-short { grid-auto-flow: column; justify-content: start; gap: 6px; align-items: center; padding-top: 2px; padding-bottom: 2px; }
.ev.ev-realizada { background: color-mix(in srgb, var(--text-3) 12%, var(--surface)); }
.ev.ev-cancelada_paciente, .ev.ev-cancelada_psicologo, .ev.ev-remarcada { opacity: .6; }
.ev.ev-cancelada_paciente strong, .ev.ev-cancelada_psicologo strong, .ev.ev-remarcada strong { text-decoration: line-through; }
.ev.ev-remarcada { border-left-style: dashed; }
.ev-flag { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 25%, transparent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--orange) 0%, transparent); } }

.cal-now { position: absolute; left: 0; right: 0; z-index: 3; top: calc(var(--top) * var(--hour) / 60); height: 2px; background: var(--red); pointer-events: none; transition: top 1s linear; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* Mês */
.month-card { padding: 0; overflow: hidden; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-wd { padding: 12px 10px 8px; font-size: 12px; font-weight: 600; color: var(--text-3); text-align: right; border-bottom: 1px solid var(--line); }
.month-cell { display: flex; flex-direction: column; gap: 3px; min-height: 112px; padding: 6px 6px 8px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); color: var(--text); transition: background .2s; min-width: 0; }
.month-cell:nth-child(7n + 1) { border-left: 0; }
.month-cell:nth-child(-n + 14) { border-top: 0; }
.month-cell:hover { background: var(--fill-2); text-decoration: none; }
.month-cell.is-other { color: var(--text-3); background: color-mix(in srgb, var(--fill-2) 60%, transparent); }
.month-day { align-self: flex-end; display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.month-cell.is-today .month-day { background: var(--red); color: #fff; font-weight: 600; }
.month-ev { display: flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.month-ev.ev-cancelada_paciente, .month-ev.ev-cancelada_psicologo { opacity: .55; text-decoration: line-through; }
.month-more { font-size: 11.5px; color: var(--text-3); font-weight: 500; padding-left: 13px; }
.month-block { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--text-3) 14%, transparent); white-space: nowrap; overflow: hidden; }
.month-block .icon { width: 11px; height: 11px; }

/* Painel da sessão */
.sheet-session { width: min(540px, calc(100% - 24px)); }
.sheet-session > div { display: grid; gap: 16px; }
.sheet-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sheet-title h2 { font-size: 20px; }
.sheet-title h2 a { color: var(--text); }
.sheet-title p { font-size: 13.5px; }
.sheet-title p::first-letter { text-transform: uppercase; }
.sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13.5px; color: var(--text-2); }
.sheet-meta > span:not(.badge) { display: inline-flex; align-items: center; gap: 5px; }
.sheet-meta .icon { width: 15px; height: 15px; color: var(--text-3); }
.sheet-note { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-2); padding: 8px 12px; border-radius: var(--radius-s); background: var(--fill-2); }
.sheet-note .icon { width: 16px; height: 16px; }
.sheet-links { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-status { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.status-btn {
    --tone: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: border-color .2s, background .2s, transform .2s var(--ease), color .2s;
}
.status-btn .icon { width: 18px; height: 18px; color: var(--tone); }
.status-btn:hover { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 8%, var(--surface)); }
.status-btn:active { transform: scale(.97); }
.status-btn.is-current { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--surface)); color: color-mix(in srgb, var(--tone) 60%, var(--text)); }
.status-btn[disabled] { opacity: .45; pointer-events: none; }
.status-btn.is-loading { color: transparent; }
.status-btn.is-loading .icon { opacity: 0; }
.st-confirmada { --tone: var(--green); }
.st-realizada { --tone: var(--green); }
.st-falta { --tone: var(--red); }
.st-cancelada_paciente { --tone: var(--orange); }
.st-cancelada_psicologo { --tone: var(--text-2); }
.st-agendada { --tone: var(--accent); }
.charge-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sheet-more { border-top: 1px solid var(--line); padding-top: 12px; }
.sheet-more summary { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; list-style: none; }
.sheet-more summary::-webkit-details-marker { display: none; }
.sheet-more summary .icon { width: 17px; height: 17px; color: var(--text-3); }
.sheet-more summary .summary-go { margin-left: auto; transition: transform .3s var(--ease); }
.sheet-more[open] .summary-go { transform: rotate(90deg); }
.sheet-more > :not(summary) { margin-top: 12px; animation: rise .35s var(--ease-out) both; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-delete { text-align: center; }
.sheet-loading { display: grid; place-items: center; min-height: 200px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--fill); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* Hoje: lista de sessões */
.today-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.today-list li { display: flex; align-items: center; gap: 8px; border-radius: var(--radius); transition: background .2s; }
.today-list li.is-now { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.today-list li.is-off { opacity: .55; }
.today-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 0; border-radius: var(--radius); background: transparent; text-align: left; transition: background .2s; }
.today-row:hover { background: var(--fill-2); }
.today-time { display: grid; width: 46px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.today-time strong { font-weight: 600; }
.today-time small { color: var(--text-3); font-size: 12px; }
.today-row .ev-bar { height: 34px; align-self: center; }
.today-name { flex: 1; display: grid; min-width: 0; line-height: 1.3; }
.today-name strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-name small { color: var(--text-2); font-size: 12.5px; }
.today-quick { display: flex; gap: 4px; padding-right: 8px; }

/* Ficha: sessões */
.mini-sessions { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.mini-sessions button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 0 -10px; width: calc(100% + 20px); border: 0; border-radius: var(--radius-s); background: transparent; text-align: left; font-size: 14px; transition: background .2s; }
.mini-sessions button:hover { background: var(--fill-2); }
.mini-sessions .ev-bar { height: 22px; align-self: center; }
.mini-sessions .badge { margin-left: auto; }
.mini-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.mini-stats strong { color: var(--text); }
.card-head-pad { padding: 14px 14px 4px; }
.card-foot { padding: 4px 14px 12px; }
.table-hover tbody tr { cursor: pointer; transition: background .15s; }
.table-hover tbody tr:hover td { background: var(--fill-2); }
.table tr.is-future td { color: var(--text-2); }

/* Fechar o dia */
.close-list { list-style: none; margin: 0; padding: 0; }
.close-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; flex-wrap: wrap; animation: rise .4s var(--ease-out) both; }
.close-list li + li { border-top: 1px solid var(--line); }
.close-time { width: 48px; font-weight: 600; font-variant-numeric: tabular-nums; }
.close-name { flex: 1; min-width: 160px; display: grid; line-height: 1.3; }
.close-name strong { font-weight: 500; }
.close-name small { color: var(--text-2); font-size: 12.5px; }

/* Lista de espera */
.wait-list { list-style: none; margin: 0; padding: 0; }
.wait-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.wait-list li + li { border-top: 1px solid var(--line); }
.wait-list li.is-done { opacity: .55; }
.wait-main { flex: 1; min-width: 180px; display: grid; line-height: 1.35; }
.wait-main strong { font-weight: 500; }
.wait-main small { color: var(--text-2); font-size: 12.5px; }
.wait-note { font-style: italic; }
.doc-list-muted li { opacity: .6; }

.switch-row { align-items: flex-start; }
.switch-text { display: grid; line-height: 1.35; }
.switch-text strong { font-weight: 500; }
.switch-text small { color: var(--text-2); font-size: 13px; }

/* Prontuário --------------------------------------------------------------- */

/* Texto formatado (negrito e listas) */
.rich { line-height: 1.6; overflow-wrap: anywhere; }
.rich p { margin: 0 0 .6em; }
.rich p:last-child, .rich ul:last-child { margin-bottom: 0; }
.rich ul { margin: 0 0 .6em; padding-left: 1.2em; }
.rich li { margin: .15em 0; }
.rich strong { font-weight: 600; }
.rich-sm { font-size: 14px; color: var(--text-2); }

/* Editor de evolução */
.evo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.evo-aside { position: sticky; top: calc(var(--topbar-h) + 12px); }
.evo-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.evo-templates { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.evo-templates .seg-links button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background .25s var(--ease), color .2s; }
.evo-templates .seg-links button:hover { color: var(--text); }
.evo-templates .seg-links button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.evo-fields { display: grid; gap: 22px; }
.evo-field { display: grid; gap: 8px; }
.evo-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.evo-field-head label { font-weight: 600; font-size: 15px; color: var(--text); }
.rt-tools { display: flex; gap: 2px; opacity: .55; transition: opacity .2s; }
.evo-field:focus-within .rt-tools, .rt-tools:hover { opacity: 1; }
.rt-bold { font-weight: 700; font-size: 15px; font-family: Georgia, serif; }
.evo-textarea { font-size: 16px; line-height: 1.6; min-height: 120px; padding: 14px 16px; resize: none; }
.evo-actions { gap: 10px; }
.autosave { font-size: 13px; color: var(--text-3); padding: 0 8px; min-width: 170px; transition: color .3s; }
.autosave.is-saved { color: var(--green); }
.autosave.is-error { color: var(--red); }
.evo-prev-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .03em; }
.evo-task { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 10px 12px; margin: 12px 0 8px; border-radius: var(--radius-s); background: color-mix(in srgb, var(--green) 9%, transparent); }
.evo-task .icon { width: 17px; height: 17px; color: var(--green); flex: none; margin-top: 1px; }

/* Escala de humor 1–5 */
.mood-scale { display: grid; grid-template-columns: 48px repeat(5, minmax(0, 1fr)); gap: 6px; }
.mood-scale label { cursor: pointer; }
.mood-scale input { position: absolute; opacity: 0; pointer-events: none; }
.mood-scale span { display: grid; place-items: center; gap: 0; height: 56px; border-radius: var(--radius); border: 1.5px solid var(--line-strong); background: var(--surface); text-align: center; transition: all .25s var(--ease); }
.mood-scale strong { font-size: 18px; line-height: 1; }
.mood-scale small { font-size: 11px; color: var(--text-3); line-height: 1; }
.mood-scale label:hover span { border-color: color-mix(in srgb, var(--text) 24%, transparent); }
.mood-scale input:checked + span { border-color: var(--mood); background: color-mix(in srgb, var(--mood) 13%, var(--surface)); transform: translateY(-2px); box-shadow: 0 6px 16px color-mix(in srgb, var(--mood) 20%, transparent); }
.mood-scale input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-ring); }
.mood-none { --mood: var(--text-3); }
.mood-1 { --mood: #e5484d; }
.mood-2 { --mood: #f08c3a; }
.mood-3 { --mood: #8e8e93; }
.mood-4 { --mood: #30a46c; }
.mood-5 { --mood: #1f8f5a; }
.mood-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--mood) 14%, transparent); color: color-mix(in srgb, var(--mood) 75%, var(--text)); }
.switch input:checked + .switch-red { background: var(--red); }

/* Leitura de evolução */
.evo-read { display: grid; gap: 4px; }
.evo-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.evo-meta span { display: inline-flex; align-items: center; gap: 4px; }
.evo-meta .icon { width: 15px; height: 15px; }
.risk-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: color-mix(in srgb, var(--red) 9%, transparent); color: color-mix(in srgb, var(--red) 75%, var(--text)); font-size: 14px; }
.risk-note .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.version-card.is-current { border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }

/* Aba prontuário */
.record-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.record-bar p { display: inline-flex; align-items: center; gap: 6px; }
.record-bar .icon { width: 15px; height: 15px; }
.evo-list { list-style: none; margin: 6px 0 0; padding: 0; }
.evo-list li + li { border-top: 1px solid var(--line); }
.evo-list a { display: flex; align-items: center; gap: 14px; padding: 12px 10px; margin: 0 -10px; border-radius: var(--radius-s); color: var(--text); transition: background .2s; }
.evo-list a:hover { background: var(--fill-2); text-decoration: none; }
.evo-date { flex: none; display: grid; justify-items: center; width: 42px; line-height: 1.1; }
.evo-date strong { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.evo-date small { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; font-weight: 600; }
.evo-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.evo-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evo-main > small { color: var(--text-2); font-size: 13.5px; line-height: 1.4; }
.evo-list .badge { height: 22px; font-size: 11.5px; padding: 0 8px; }

.inline-pop { position: relative; }
.inline-pop summary { list-style: none; }
.inline-pop summary::-webkit-details-marker { display: none; }
.inline-pop-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 320px; padding: 16px; border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow-3); border: 1px solid var(--line); animation: sheet-in .35s var(--spring) both; }

.card-warn { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--orange) 40%, transparent), var(--shadow-2); }
.plan-due { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 13.5px; font-weight: 500; color: color-mix(in srgb, var(--orange) 80%, var(--text)); }
.plan-due .icon { width: 16px; height: 16px; }

.dropzone-sm { min-height: 76px; padding: 12px; margin-top: 8px; }
.dropzone-sm .dropzone-text { grid-auto-flow: column; grid-template-rows: auto auto; column-gap: 10px; text-align: left; justify-items: start; }
.dropzone-sm .dropzone-text .icon { grid-row: span 2; width: 22px; height: 22px; margin: 0; align-self: center; }
.attach-form.is-uploading .dropzone { opacity: .7; pointer-events: none; }
.attach-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.attach-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.attach-list li:first-child { border-top: 0; }
.attach-main { flex: 1; min-width: 0; display: grid; line-height: 1.3; color: var(--text); }
.attach-main:hover { text-decoration: none; }
.attach-main:hover strong { color: var(--accent); }
.attach-main strong { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-main small { font-size: 12px; color: var(--text-3); }
.doc-icon-sm { width: 34px; height: 34px; border-radius: 10px; }
.doc-icon-sm .icon { width: 17px; height: 17px; }
.empty-icon-neutral { background: var(--fill-2) !important; color: var(--text-3) !important; }

.card-notes { background: color-mix(in srgb, var(--yellow) 6%, var(--surface)); }
.notice-sm { font-size: 13px; padding: 10px 12px; margin: 8px 0; align-items: flex-start; }
.note-form { display: grid; gap: 8px; margin-top: 10px; justify-items: start; }
.note-form .textarea { width: 100%; }
.note { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.note summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; font-size: 14px; }
.note summary::-webkit-details-marker { display: none; }
.note-text { min-width: 0; }
.note[open] .note-text { display: none; }
.note-actions { display: flex; gap: 6px; }

.sheet-wide { width: min(640px, calc(100% - 24px)); }
.input-affix-end { display: flex; align-items: center; gap: 10px; }
.input-affix-end .input { width: 110px; padding-left: 14px; }
.input-affix-end > span { position: static; transform: none; color: var(--text-2); font-size: 15px; }
.info-list-sm { font-size: 13.5px; gap: 10px; }
.info-list-sm li { align-items: flex-start; }
.access-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; max-height: 360px; overflow-y: auto; }
.access-list li { display: flex; gap: 12px; }
.access-list + p { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.access-when { flex: none; width: 74px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pending-group summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 -12px; border-radius: var(--radius-s); cursor: pointer; list-style: none; font-size: 14px; }
.pending-group summary::-webkit-details-marker { display: none; }
.pending-group summary:hover { background: var(--fill-2); }
.pending-group summary .row-go { margin-left: auto; transition: transform .3s var(--ease); }
.pending-group[open] summary .row-go { transform: rotate(90deg); }
.pending-group ul { list-style: none; margin: 0 0 6px 18px; padding: 0; display: grid; }
.pending-group ul a { display: block; padding: 6px 0; font-size: 13.5px; }

/* Linha do tempo */
.timeline { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--line); }
.tl-month { position: relative; padding: 14px 0 6px 28px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.tl-month:first-child { padding-top: 0; }
.tl-item { position: relative; display: flex; gap: 12px; padding: 8px 0 12px 28px; animation: rise .45s var(--ease-out) both; }
.tl-dot { position: absolute; left: 2px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--tl, var(--text-3)); box-shadow: 0 0 0 3px var(--surface); }
.tl-realizada { --tl: var(--green); }
.tl-falta { --tl: var(--red); }
.tl-cancelada_paciente { --tl: var(--orange); }
.tl-plano { --tl: var(--purple); }
.tl-doc { --tl: var(--accent); }
.tl-avulsa { --tl: var(--teal); }
.tl-risk .tl-dot { background: var(--red); border-color: var(--red); }
.tl-body { min-width: 0; display: grid; gap: 4px; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.tl-head strong { font-weight: 600; }
.tl-head .muted { font-size: 13px; }
.tl-head .badge { height: 22px; font-size: 11.5px; padding: 0 8px; }
.tl-head .badge .icon { width: 12px; height: 12px; }
.tl-text { font-size: 14px; color: var(--text-2); line-height: 1.5; }
a.tl-text:hover { color: var(--text); text-decoration: none; }
.tl-risk-note { font-size: 13.5px; color: color-mix(in srgb, var(--red) 75%, var(--text)); }
.tl-task { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); }
.tl-task .icon { width: 14px; height: 14px; color: var(--green); }

/* Gráfico de humor (uma série: sem legenda, título nomeia; dica nativa por ponto) */
.mood-chart { margin: 8px 0 0; }
.mood-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.mc-grid { stroke: var(--line); stroke-width: 1; }
.mc-axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.mc-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mc-hit { fill: transparent; cursor: pointer; }
.mc-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; transition: r .2s var(--spring); }
.mc-point:hover .mc-dot, .mc-point:focus .mc-dot { r: 6.5; }
.mc-point:focus { outline: none; }
.mc-point.is-risk .mc-dot { fill: var(--red); }
.mood-chart figcaption { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.mc-key { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* Painel Virtuna ----------------------------------------------------------- */

/* Cor própria do painel: deixa claro, de relance, que não é a área do psicólogo. */
body.admin { --accent: #5e5ce6; --accent-hover: #6e6cf0; --accent-press: #4f4dd6; --accent-soft: rgba(94, 92, 230, .11); --accent-ring: rgba(94, 92, 230, .3); }
@media (prefers-color-scheme: dark) {
    body.admin { --accent: #7d7aff; --accent-hover: #8e8bff; --accent-soft: rgba(125, 122, 255, .18); --accent-ring: rgba(125, 122, 255, .4); }
}
.badge-admin { background: color-mix(in srgb, #5e5ce6 14%, transparent); color: #5e5ce6; height: 22px; font-size: 11.5px; padding: 0 8px; }
.admin-note { display: flex; gap: 8px; align-items: flex-start; padding: 0 10px; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.admin-note .icon { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.search-form { margin: 0; }

.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-sub { font-size: 12.5px; color: var(--text-3); }
.stat-value-sm { font-size: 20px; }
.seg-sm a { height: 26px; padding: 0 10px; font-size: 12.5px; }
.d-block { display: block; }
.d-block-badge { margin-top: 4px; height: 20px; font-size: 11px; padding: 0 7px; }
.pending-text { display: grid; min-width: 0; line-height: 1.3; }
.pending-text small { color: var(--text-3); font-size: 12.5px; }

/* Funil: uma série, barras finas na cor de destaque, valor escrito na ponta */
.funnel { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.funnel li { display: grid; grid-template-columns: 170px minmax(0, 1fr) 72px; align-items: center; gap: 12px; }
.funnel-label { font-size: 13.5px; color: var(--text-2); }
.funnel-track { height: 12px; border-radius: 4px; background: var(--fill-2); overflow: hidden; }
.funnel-bar { display: block; height: 100%; width: var(--w); border-radius: 4px; background: var(--accent); transform-origin: left; animation: grow .9s calc(.2s + var(--i) * 90ms) var(--ease-out) both; }
.funnel-value { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.funnel-value small { color: var(--text-3); font-size: 12px; margin-left: 2px; }

/* Cadastros por semana: barras verticais com topo arredondado presas na base e 2px de vão */
.weekbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; align-items: end; height: 170px; margin-top: 12px; }
.weekbar { display: grid; grid-template-rows: 18px 1fr 18px; height: 100%; cursor: default; }
.weekbar-value { font-size: 11.5px; font-weight: 600; text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; }
.weekbar-col { position: relative; border-bottom: 1px solid var(--line-strong); margin: 0 4px; }
.weekbar-fill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 4px 4px 0 0; background: var(--accent); transform-origin: bottom; animation: grow-y .8s calc(.2s + var(--i) * 40ms) var(--ease-out) both; transition: filter .2s; }
.weekbar:hover .weekbar-fill { filter: brightness(1.12); }
.weekbar-label { font-size: 10.5px; color: var(--text-3); text-align: center; white-space: nowrap; padding-top: 4px; }
@keyframes grow-y { from { transform: scaleY(0); } }
.table-toggle { margin-top: 12px; font-size: 13px; }
.table-toggle summary { cursor: pointer; color: var(--accent); width: max-content; }
.table-toggle .table { margin-top: 8px; max-width: 320px; }

/* Lista de contas */
.table-accounts td { vertical-align: middle; }
.acc-name { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 220px; }
.acc-name:hover { text-decoration: none; }
.acc-name span:last-child { display: grid; line-height: 1.3; min-width: 0; }
.acc-name strong { font-weight: 500; }
.acc-name small { font-size: 12px; color: var(--text-3); }
.table-accounts .muted.d-block, .table-accounts small.d-block { font-size: 11.5px; }
.steps-mini { display: inline-flex; gap: 3px; }
.steps-mini i { width: 18px; height: 6px; border-radius: 3px; background: var(--fill); }
.steps-mini i.on { background: var(--green); }

/* Detalhe da conta */
.steps-compact .step-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.steps-compact .step.is-done strong { text-decoration: none; color: var(--text); }
.admin-notes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.admin-notes li { padding: 10px 12px; border-radius: var(--radius-s); background: var(--fill-2); font-size: 14px; display: grid; gap: 4px; }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.status-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); gap: 12px; justify-items: start; }
.status-form .form-row { width: 100%; }
.code-input { width: 130px; font: 600 18px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; text-align: center; }

/* Lado do psicólogo: código e histórico */
.support-code { display: grid; justify-items: center; gap: 6px; padding: 18px; margin-bottom: 14px; border-radius: var(--radius); background: var(--accent-soft); text-align: center; }
.support-code-value { font: 700 34px var(--font-mono); letter-spacing: .14em; color: var(--accent); }
.grant-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.grant-list li { align-items: center; }
.grant-text { flex: 1; }

/* Faixa do modo suporte, no topo do app */
.support-bar {
    position: sticky;
    top: var(--topbar-h);
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 32px;
    padding: 10px 10px 10px 16px;
    border-radius: 0 0 var(--radius) var(--radius);
    background: #5e5ce6;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(94, 92, 230, .3);
    animation: toast-in .5s var(--spring) both;
}
.support-bar .icon { width: 17px; height: 17px; }
.support-bar span { flex: 1; }
.btn-glass { --btn-bg: rgba(255, 255, 255, .2); --btn-fg: #fff; }
.btn-glass:hover { --btn-bg: rgba(255, 255, 255, .3); }

/* Financeiro --------------------------------------------------------------- */

.recv-groups { display: grid; margin-top: 8px; }
.recv + .recv { border-top: 1px solid var(--line); }
.recv-head { display: flex; align-items: center; gap: 12px; padding: 12px 4px; cursor: pointer; list-style: none; border-radius: var(--radius-s); transition: background .2s; }
.recv-head::-webkit-details-marker { display: none; }
.recv-head:hover { background: var(--fill-2); }
.recv-name { flex: 1; display: grid; min-width: 0; line-height: 1.3; }
.recv-name strong { font-weight: 500; }
.recv-name small { color: var(--text-3); font-size: 12.5px; }
.recv-total { font-variant-numeric: tabular-nums; }
.recv-head .summary-go { width: 17px; height: 17px; color: var(--text-3); transition: transform .3s var(--ease); }
.recv[open] .recv-head .summary-go { transform: rotate(90deg); }
.recv-body { padding: 0 4px 14px 46px; display: grid; gap: 12px; animation: rise .35s var(--ease-out) both; }
.recv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.recv-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recv-price { list-style: none; cursor: pointer; font-variant-numeric: tabular-nums; font-size: 14px; padding: 2px 8px; border-radius: 6px; border-bottom: 1px dashed var(--line-strong); }
.recv-price::-webkit-details-marker { display: none; }
.recv-price:hover { background: var(--fill-2); }
.recv-adjust .inline-pop-body { width: 260px; gap: 8px; }
.recv-pay { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.recv-pay .input-sm[type=date] { width: 150px; }

.pay-list, .receipt-list, .expense-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.pay-list li, .receipt-list li, .expense-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pay-list li:first-child, .receipt-list li:first-child, .expense-list li:first-child { border-top: 0; }
.pay-main, .receipt-main { flex: 1; display: grid; min-width: 0; line-height: 1.3; color: var(--text); }
.receipt-main:hover { text-decoration: none; }
.receipt-main:hover strong { color: var(--accent); }
.pay-main small, .receipt-main small { color: var(--text-3); font-size: 12.5px; }
.pay-main strong, .receipt-main strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-done { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.pay-done .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.receipt-actions { display: flex; align-items: center; gap: 2px; }
.receipt-actions form { margin: 0; }
.receipt-list li.is-canceled .receipt-main { opacity: .55; text-decoration: line-through; }
.receipt-list li.is-fresh { animation: flash-row 2s var(--ease) both; border-radius: var(--radius-s); }
@keyframes flash-row { 0%, 40% { background: var(--accent-soft); } }
.receipt-actions .inline-pop-body { right: 0; width: 280px; gap: 8px; }
.expense-list li > span:first-child { flex: 1; min-width: 0; font-size: 14px; }
.expense-list strong:not(:first-child) { font-variant-numeric: tabular-nums; }
.card-details-inline { margin-top: 10px; }
.card-details-inline summary { list-style: none; width: max-content; }
.card-details-inline summary::-webkit-details-marker { display: none; }
.card-details-inline[open] summary { margin-bottom: 12px; }
.input-short { width: 140px; }
.table tr.is-canceled td { opacity: .55; }

/* Receita Saúde: campos tocáveis para copiar */
.copy-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font: 500 13.5px var(--font); font-variant-numeric: tabular-nums; color: var(--text); cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.copy-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-chip .icon { width: 13px; height: 13px; color: var(--text-3); flex: none; }
.copy-chip:hover { border-color: var(--accent); }
.copy-chip:active { transform: scale(.97); }
.copy-chip.is-copied { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
.copy-chip.is-copied .icon { color: var(--green); }
.copy-missing { font-size: 12.5px; color: var(--red); }
.rs-table td { vertical-align: middle; }
.rs-table tr.is-done td:not(:first-child) { opacity: .5; }
.rs-table form { margin: 0; }

.month-bars { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.month-bars li { display: grid; grid-template-columns: 52px minmax(0, 1fr) 96px; gap: 10px; align-items: center; font-size: 13px; }
.mb-label { color: var(--text-2); }
.mb-value { text-align: right; font-variant-numeric: tabular-nums; }


/* Documentos, termos, agendamento online, notificações e segurança (Fases 7 a 9) */
.fieldset-plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.doc-list li.is-canceled .doc-main { opacity: .55; text-decoration: line-through; }
.doc-list-pad { padding: 0 16px 6px; margin-top: 0; }
.doc-icon.tint-green { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.doc-hint { margin: -2px 0 8px; }
.btn-danger-text { color: var(--red) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.input-lg { height: 54px; font-size: 18px; border-radius: var(--radius); }
.input-code { font: 600 22px/1 var(--font-mono); letter-spacing: .28em; text-align: center; }
.input-pin { letter-spacing: .6em; }
.input-medium { max-width: 320px; }
.input-affix-wide > span { font-size: 14px; }
.input-affix-wide { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); overflow: hidden; }
.input-affix-wide > span { position: static; transform: none; display: flex; align-items: center; padding: 0 2px 0 12px; color: var(--text-3); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.input-affix-wide .input { border: 0; padding-left: 2px; box-shadow: none; min-width: 0; flex: 1; }
.input-affix-wide:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.inline-details > summary { list-style: none; display: inline-flex; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > summary { margin-bottom: 12px; }
.inline-details > .form, .inline-details > div, .inline-details > p { animation: rise .3s var(--ease-out) both; }
.card-danger { border: 1px solid color-mix(in srgb, var(--red) 18%, transparent); }
.auth-icon { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.auth-icon .icon { width: 26px; height: 26px; }
.auth-icon-danger { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.lock-card .auth-head .avatar { margin: 0 auto 14px; }
.lock-card .auth-head p { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }

/* Sino */
.bell { position: relative; }
.bell.is-active { color: var(--accent); }
.bell-dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 600; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg, #f5f5f7); animation: pop .4s var(--spring) both; }
.notif-list { list-style: none; margin: 0; padding: 6px; }
.notif-list a { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: var(--radius); color: inherit; text-decoration: none; transition: background .2s; }
.notif-list a:hover { background: var(--fill-2); }
.notif-text { flex: 1; display: grid; line-height: 1.35; min-width: 0; }
.notif-text strong { font-weight: 500; }
.notif-text small { color: var(--text-3); font-size: 12.5px; }
.notif-list li.is-unread .notif-text strong { font-weight: 600; }
.notif-list li.is-unread a { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* Termos */
.consent-text { font-size: 16px; line-height: 1.65; }
.consent-text p { margin: 0 0 14px; }
.consent-text p:last-child { margin-bottom: 0; }
.var-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.var-list li { display: grid; gap: 2px; justify-items: start; }
.var-list small { color: var(--text-3); font-size: 12px; padding-left: 4px; }

/* Agendamento online */
.slot-days { display: grid; gap: 14px; margin-top: 8px; }
.slot-day { border: 0; margin: 0; padding: 0; min-width: 0; }
.slot-day legend { padding: 0 0 8px; font-size: 14px; }
.slot-day legend span { color: var(--text-2); margin-left: 4px; }
.slot-times { display: flex; flex-wrap: wrap; gap: 8px; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot span { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--fill); font: 500 15px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; transition: background .2s, color .2s, transform .2s var(--spring), box-shadow .2s; }
.slot span:hover { background: color-mix(in srgb, var(--accent) 14%, var(--fill)); }
.slot input:checked + span { background: var(--accent); color: var(--on-accent); transform: scale(1.04); box-shadow: 0 4px 14px var(--accent-ring); }
.slot input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-ring); }
.request-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; }
.request-list > li { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--line); }
.request-list > li:first-child { border-top: 0; }
.request-list-done { padding: 0 16px 8px; }
.request-list-done > li { padding: 12px 0; align-items: center; }
.request-list > li.is-fresh { background: color-mix(in srgb, var(--accent) 6%, transparent); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: var(--radius); }
.request-main { display: grid; gap: 3px; min-width: 200px; flex: 1; }
.request-main strong { font-weight: 600; }
.request-main small { color: var(--text-2); font-size: 13px; }
.request-when { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; font-size: 14.5px; }
.request-when .icon { width: 16px; height: 16px; }
.request-reason { margin: 4px 0 0; color: var(--text-2); font-style: italic; }
.request-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Páginas legais */
.legal-doc { font-size: 15.5px; line-height: 1.7; }
.legal-doc h2 { font-size: 17px; margin: 26px 0 8px; letter-spacing: -.01em; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc p, .legal-doc ul { margin: 0 0 12px; }
.legal-doc ul { padding-left: 20px; }
.legal-doc li { margin-bottom: 6px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Verificação em duas etapas */
.qr-box { display: grid; place-items: center; padding: 18px; margin: 14px 0; border-radius: var(--radius-l); background: #fff; box-shadow: inset 0 0 0 1px var(--line); width: fit-content; }
.qr-box svg { display: block; width: 196px; height: 196px; }
.howto { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.recovery-codes { list-style: none; margin: 4px 0; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; border-radius: var(--radius); background: var(--surface); font: 500 16px/1.4 var(--font-mono); letter-spacing: .06em; box-shadow: inset 0 0 0 1px var(--line); width: 100%; max-width: 360px; }

/* 8. Responsivo ----------------------------------------------------------- */

@media (hover: hover) {
    .card:hover, .stat:hover { box-shadow: var(--shadow-3); }
}

@media (max-width: 1080px) {
    .grid-hero { grid-template-columns: minmax(0, 1fr); }
}

/* Hoje: previsão do mês */
.month-forecast { display: flex; align-items: baseline; justify-content: space-between; margin: 12px 0 10px; }
.month-forecast span { color: var(--text-2); font-size: 14px; }
.month-forecast strong { font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.forecast-bar { display: flex; height: 8px; border-radius: 8px; background: var(--fill); overflow: hidden; }
.forecast-bar span { width: var(--w); height: 100%; transform-origin: left; animation: grow .9s .3s var(--ease-out) both; }
.forecast-bar .is-paid { background: var(--green); }
.forecast-bar .is-pending { background: var(--orange); animation-delay: .5s; }
.forecast-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.forecast-list li { display: flex; align-items: center; gap: 8px; }
.forecast-list strong { margin-left: auto; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.forecast-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.forecast-note strong { color: var(--text-2); font-weight: 500; }
.forecast-next { display: flex; align-items: center; gap: 8px; margin: 14px -10px -6px; padding: 10px; border-radius: var(--radius); background: var(--fill-2); color: var(--text-2); font-size: 14px; transition: background .2s; }
.forecast-next:hover { background: var(--fill); text-decoration: none; }
.forecast-next strong { margin-left: auto; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.forecast-next .icon { width: 16px; height: 16px; color: var(--text-3); }

@media (max-width: 860px) {
    .only-mobile { display: inline-grid !important; }
    .hide-mobile { display: none !important; }

    .sidebar {
        transform: translateX(-104%);
        transition: transform .45s var(--ease), box-shadow .45s var(--ease);
        box-shadow: none;
        background: var(--surface);
    }
    body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-3); }
    body.sidebar-open { overflow: hidden; }

    .scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(0, 0, 0, .3);
        opacity: 0;
        pointer-events: none;
        transition: opacity .35s var(--ease);
    }
    body.sidebar-open .scrim { opacity: 1; pointer-events: auto; }

    .shell { margin-left: 0; }
    .search { flex: 1; min-width: 0; width: auto; }
    .search kbd { display: none; }
    .main { padding: 20px 16px 48px; gap: 16px; }
    .grid, .stack, .stats { gap: 16px; }
    .stats { grid-template-columns: 1fr; }
    .stat { grid-template-columns: auto 1fr auto; align-items: center; column-gap: 14px; }
    .stat-icon { margin: 0; grid-row: span 1; }
    .stat-value { font-size: 22px; }

    .grid-2 { grid-template-columns: 1fr; }
    .card-form { padding: 22px; }
    .day { grid-template-columns: 1fr auto; gap: 8px 12px; }
    .day-body { grid-column: 1 / -1; grid-row: 2; }
    .day:not(.is-on) .day-body { display: none; }
    .focus-bar { padding: 0 16px; }

    .patient-row { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; padding: 12px 10px; }
    .patient-list li + li .patient-row::before { left: 56px; }
    .patient-hero-actions { width: 100%; }
    .patient-hero-actions .btn { flex: 1; }
    .kv-list > div { grid-template-columns: 1fr; gap: 2px; }
    .quick-grid { grid-template-columns: 1fr; }
    .map-row { grid-template-columns: 1fr; gap: 8px; }
    .map-arrow { display: none; }
    .stats-3 { grid-template-columns: 1fr; }
    .question > :not(label) { margin-left: 0; }
    .search-inline { width: 100%; flex: 1 1 100%; }
    .filters .input-sm { flex: 1; }
    .palette { margin-top: 8px; }

    .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stats-4 .stat { grid-template-columns: minmax(0, 1fr); align-items: start; padding: 16px; }
    .stats-4 .stat-icon { margin-bottom: 6px; width: 32px; height: 32px; }
    .stats-4 .stat-value { font-size: 19px; overflow-wrap: anywhere; }
    .funnel li { grid-template-columns: 1fr 64px; }
    .funnel-label { grid-column: 1 / -1; }
    .support-bar { margin: 0 16px; }

    .evo-layout { grid-template-columns: 1fr; }
    .evo-aside { position: static; }
    .mood-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .mood-scale small { display: none; }
    .inline-pop-body { right: auto; left: 0; width: min(320px, calc(100vw - 48px)); }
    .autosave { min-width: 0; width: 100%; text-align: center; }

    .agenda-controls { width: 100%; justify-content: space-between; }
    .cal-card:has(.cal:not(.cal-day)) { overflow-x: auto; }
    .cal:not(.cal-day) { min-width: 760px; }
    .cal { --gutter: 48px; --hour: 58px; }
    .cal-scroll { max-height: none; overflow-y: visible; }
    .month-cell { min-height: 76px; padding: 4px; }
    .month-ev { font-size: 0; gap: 0; }
    .month-ev .ev-dot { width: 7px; height: 7px; }
    .month-cell { flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
    .month-day { margin-left: calc(100% - 26px); } /* ocupa a linha toda sem esticar o círculo */
    .month-block { font-size: 0; padding: 2px; }
    .month-more { font-size: 10.5px; padding-left: 2px; }
    .status-grid { grid-template-columns: 1fr; }
    .today-quick .btn-ghost { display: none; }
    .close-choices { width: 100%; display: flex; }
    .close-choices label { flex: 1; }
    .close-choices label span { width: 100%; justify-content: center; padding: 0 6px; }
}

@media (max-width: 520px) {
    .auth-shell { padding: 32px 16px; }
    .auth-card { padding: 28px 20px 24px; border-radius: 24px; }
    .form-row { grid-template-columns: 1fr; }
    .input-group { grid-template-columns: 96px auto 1fr; }
    .card, .card-onboarding { padding: 20px; }
    .onboarding-head { gap: 16px; }
    .ring { --size: 64px; }

    .choice-grid { grid-template-columns: 1fr; }
    .choice-body { grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
    .choice-body .icon { margin: 0; grid-row: span 2; }
    .form-row-3, .form-row-cep { grid-template-columns: 1fr 1fr; }
    .form-row-3 .field:last-child { grid-column: 1 / -1; }
    .form-row-cep .field:last-child { grid-column: 1 / -1; }
    .form-row-city { grid-template-columns: 1fr 96px; }
    .input-time { width: auto; flex: 1; min-width: 0; }
    .photo-field { flex-direction: column; text-align: center; }
    .photo-actions { justify-content: center; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn { width: 100%; }
    .form-actions .btn-ghost { margin: 0; }
}

/* 9. Movimento reduzido --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    @view-transition { navigation: none; }
}
