/* ==========================================================================
   Creche · Sistema de design
   Tinta (azul profundo) para estrutura, verde-folha para ação,
   girassol para destaque e as cores de lápis de cera para as salas.
   ========================================================================== */

:root {
    --ink: #1D2352;
    --ink-2: #2A3170;
    --ink-3: #3A4290;
    --bg: #F3F5FA;
    --surface: #FFFFFF;
    --surface-2: #F8F9FC;
    --line: #E3E7F0;
    --line-2: #EDF0F6;
    --text: #1E2342;
    --muted: #677091;
    --faint: #98A0BA;

    --primary: #127C6E;
    --primary-h: #0D675B;
    --primary-soft: #E2F3EF;
    --sun: #F4B23A;
    --sun-soft: #FFF3D9;
    --sun-ink: #8A5A00;
    --coral: #E8604F;
    --coral-soft: #FDEBE8;
    --sky: #3A87D8;
    --sky-soft: #E5F0FB;
    --lilac: #7766E8;
    --lilac-soft: #EEEBFD;
    --green: #26985F;
    --green-soft: #E2F5EA;
    --pink: #E2629A;
    --pink-soft: #FCE9F1;

    --r-xl: 22px;
    --r-lg: 16px;
    --r-md: 11px;
    --r-sm: 8px;
    --shadow-1: 0 1px 2px rgba(29, 35, 82, .05);
    --shadow-2: 0 1px 2px rgba(29, 35, 82, .05), 0 10px 28px -14px rgba(29, 35, 82, .22);
    --shadow-3: 0 24px 60px -20px rgba(29, 35, 82, .45);

    --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --display: "Baloo 2", "Figtree", system-ui, sans-serif;
    --sidebar-w: 266px;
    --topbar-h: 66px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); margin: 0; line-height: 1.15; font-weight: 700; }
h1 { font-size: 1.85rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .98rem; }
p { margin: 0 0 .6rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; border-radius: 6px; }
h1:focus { outline: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.tiny { font-size: .76rem; }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-line; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout helpers ---------- */
.row { display: flex; gap: .75rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.stack-sm { display: flex; flex-direction: column; gap: .4rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.25rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-sm { gap: .4rem; }
.gap-lg { gap: 1.25rem; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.grid { display: grid; gap: 1.1rem; }
.grid-2 { display: grid; gap: 1.1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1.1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 1.1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.grid-side { display: grid; gap: 1.1rem; grid-template-columns: 320px minmax(0, 1fr); }
.auto-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.auto-grid-sm { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

.sidebar {
    position: sticky; top: 0; height: 100vh;
    background: var(--ink);
    color: #CBD0EC;
    display: flex; flex-direction: column;
    z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.2rem 1.25rem 1rem; color: #fff; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 14px;
    background: var(--sun);
    display: grid; place-items: center;
    color: var(--ink);
    flex: none;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.12rem; line-height: 1.05; color: #fff; }
.brand-sub { font-size: .76rem; color: #9FA6D6; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: #3A4290 transparent; }
.nav-section { margin-top: 1rem; }
.nav-section-title { font-size: .74rem; color: #8189C2; padding: 0 .75rem .35rem; font-weight: 600; }
.nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .75rem; margin: 1px 0;
    border-radius: 10px;
    color: #CBD0EC; font-weight: 500; font-size: .92rem;
    position: relative;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--ink-2); color: #fff; }
.nav-link.active::before {
    content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 4px;
    border-radius: 0 4px 4px 0; background: var(--sun);
}
.nav-link.active .icon { color: var(--sun); }
.nav-link .nav-count {
    margin-left: auto; background: var(--coral); color: #fff; font-size: .7rem; font-weight: 700;
    min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px;
}
.sidebar-foot { padding: .9rem 1rem 1.1rem; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { display: flex; align-items: center; gap: .65rem; color: #fff; }
.sidebar-user .who { min-width: 0; }
.sidebar-user .who b { display: block; font-size: .88rem; }
.sidebar-user .who span { font-size: .75rem; color: #9FA6D6; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: var(--topbar-h);
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: .9rem;
    padding: 0 1.75rem;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-2);
}
.topbar .menu-btn { display: none; }
.topbar-title { font-weight: 600; color: var(--muted); font-size: .9rem; }
.topbar-search { position: relative; flex: 0 1 360px; margin-left: auto; }
.topbar-search input { padding-left: 2.3rem; background: var(--surface); }
.topbar-search .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    box-shadow: var(--shadow-3); padding: .35rem; max-height: 380px; overflow-y: auto; z-index: 60;
}
.search-results a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 8px; color: var(--text); }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.content { padding: 1.6rem 1.75rem 3rem; max-width: 1480px; width: 100%; }
.sidebar-backdrop { display: none; }

/* ---------- page header ---------- */
.page-header { display: flex; align-items: flex-end; gap: 1rem; justify-content: space-between; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-header .sub { color: var(--muted); margin-top: .25rem; }
.page-header .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs { display: flex; gap: .35rem; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }
.crumbs a { color: var(--muted); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    min-width: 0;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.2rem .2rem; }
.card-header h3 { font-size: 1.05rem; }
.card-header .sub { font-size: .82rem; color: var(--muted); }
.card-body { padding: 1rem 1.2rem 1.2rem; }
.card-body.flush { padding: 0; }
.card-foot { padding: .8rem 1.2rem; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: .5rem; }
.card.pad { padding: 1.2rem; }
.card.tinted { background: var(--surface-2); box-shadow: none; }
.card.link-card { transition: border-color .15s, box-shadow .15s; cursor: pointer; color: inherit; display: block; }
.card.link-card:hover { border-color: #CDD4E6; box-shadow: var(--shadow-2); text-decoration: none; }

/* hero da direção */
.hero {
    border-radius: var(--r-xl);
    background: var(--ink);
    color: #DDE1F7;
    padding: 1.5rem 1.6rem;
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center;
}
.hero h1 { color: #fff; font-size: 2rem; }
.hero .date { color: #A9B0E0; font-weight: 500; }
.hero-figures { display: flex; gap: 2.2rem; flex-wrap: wrap; margin-top: 1.1rem; }
.hero-fig b { display: block; font-family: var(--display); font-size: 2.2rem; line-height: 1; color: #fff; font-weight: 700; }
.hero-fig span { font-size: .85rem; color: #A9B0E0; }
.hero-fig.sun b { color: var(--sun); }
.hero-ring { position: relative; width: 150px; height: 150px; z-index: 1; }
.hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hero-ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.hero-ring .lbl b { font-family: var(--display); font-size: 2rem; color: #fff; display: block; line-height: 1; }
.hero-ring .lbl span { font-size: .76rem; color: #A9B0E0; }
.hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(244,178,58,.18), transparent 65%); pointer-events: none;
}

/* stat */
.stat { padding: 1rem 1.1rem; display: flex; gap: .9rem; align-items: center; }
.stat-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat-label { color: var(--muted); font-size: .84rem; }
.stat-value { font-family: var(--display); font-size: 1.55rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat-foot { font-size: .78rem; color: var(--muted); }
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.tone-sun { background: var(--sun-soft); color: var(--sun-ink); }
.tone-coral { background: var(--coral-soft); color: var(--coral); }
.tone-sky { background: var(--sky-soft); color: var(--sky); }
.tone-lilac { background: var(--lilac-soft); color: var(--lilac); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-pink { background: var(--pink-soft); color: var(--pink); }
.tone-ink { background: #E7E9F5; color: var(--ink); }

/* ==========================================================================
   Buttons & forms
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    height: 40px; padding: 0 1rem;
    border-radius: var(--r-md); border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: .9rem;
    cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    background: var(--surface); color: var(--text); border-color: var(--line);
    text-decoration: none !important;
}
.btn:hover { border-color: #C9D0E2; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-2); }
.btn-sun { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn-danger { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn-danger:hover { background: #D4503F; }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn-soft:hover { background: #D1ECE6; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--line-2); color: var(--text); }
.btn-sm { height: 32px; padding: 0 .7rem; font-size: .83rem; border-radius: 9px; }
.btn-lg { height: 48px; padding: 0 1.4rem; font-size: 1rem; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > label, .label { font-size: .83rem; font-weight: 600; color: #444B6B; }
.field .hint { font-size: .78rem; color: var(--faint); }
.input, .select, .textarea, input.form-control, select.form-control, textarea.form-control {
    width: 100%; height: 40px; padding: 0 .8rem;
    border: 1px solid var(--line); border-radius: var(--r-md);
    background: var(--surface); color: var(--text);
    font: inherit; font-size: .92rem;
    transition: border-color .15s, box-shadow .15s;
}
.textarea, textarea.form-control { height: auto; min-height: 90px; padding: .6rem .8rem; resize: vertical; line-height: 1.45; }
.select, select.form-control {
    appearance: none; padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23677091' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .8rem center;
}
.input:focus, .select:focus, .textarea:focus, .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-sm { height: 34px; font-size: .85rem; }
.invalid, .form-control.invalid { border-color: var(--coral) !important; }
.validation-message { color: var(--coral); font-size: .8rem; }
.validation-errors { color: var(--coral); background: var(--coral-soft); border-radius: var(--r-md); padding: .6rem 1rem .6rem 2rem; margin: 0 0 1rem; font-size: .88rem; }
.form-grid { display: grid; gap: 1rem 1.1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-section { font-family: var(--display); font-size: 1.02rem; color: var(--ink); margin: .6rem 0 -.2rem; grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group .addon { display: grid; place-items: center; padding: 0 .8rem; border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--surface-2); color: var(--muted); font-size: .85rem; }

.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .9rem; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .9rem; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 12px; background: #CDD3E4; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--primary-soft); }

.seg { display: inline-flex; background: var(--line-2); padding: 3px; border-radius: 11px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); padding: .38rem .8rem; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* filtros */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.filters .input, .filters .select { width: auto; min-width: 170px; }
.filters .search-input { position: relative; flex: 1 1 260px; max-width: 380px; }
.filters .search-input .input { padding-left: 2.3rem; width: 100%; }
.filters .search-input .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--faint); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table th {
    text-align: left; font-size: .78rem; font-weight: 600; color: var(--muted);
    padding: .7rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.table td { padding: .72rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: #FAFBFD; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); padding: .72rem 1rem; }
.table .actions-cell { text-align: right; white-space: nowrap; width: 1%; }
.table.compact td, .table.compact th { padding: .45rem .7rem; }
.cell-person { display: flex; align-items: center; gap: .7rem; min-width: 180px; }
.cell-person b { display: block; font-weight: 600; color: var(--text); }
.cell-person span { font-size: .8rem; color: var(--muted); }
.cell-person a { color: inherit; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1rem; border-top: 1px solid var(--line-2); font-size: .85rem; color: var(--muted); }

/* ==========================================================================
   Pills, badges, avatars, chips
   ========================================================================== */
.pill {
    display: inline-flex; align-items: center; gap: .35rem;
    height: 24px; padding: 0 .6rem; border-radius: 999px;
    font-size: .76rem; font-weight: 600; white-space: nowrap;
    background: var(--line-2); color: var(--muted);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--green-soft); color: #17774A; }
.pill-red { background: var(--coral-soft); color: #C24434; }
.pill-sun { background: var(--sun-soft); color: var(--sun-ink); }
.pill-sky { background: var(--sky-soft); color: #25689F; }
.pill-lilac { background: var(--lilac-soft); color: #5A49C7; }
.pill-ink { background: #E7E9F5; color: var(--ink); }
.pill-primary { background: var(--primary-soft); color: var(--primary); }
.pill-pink { background: var(--pink-soft); color: #B73E73; }

.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; flex: none;
    font-weight: 700; font-size: .82rem; color: #fff;
    overflow: hidden; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { width: 26px; height: 26px; font-size: .66rem; }
.avatar.sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 1.8rem; }
.avatar.ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ring, var(--primary)); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 500; }
.chip.alert { background: var(--coral-soft); border-color: #F7C9C2; color: #B23A2B; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; display: grid; }

.sala-tag { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: var(--text); }
.sala-tag i { width: 10px; height: 10px; border-radius: 4px; background: var(--c, var(--primary)); display: inline-block; }

.alert { display: flex; gap: .7rem; padding: .8rem 1rem; border-radius: var(--r-md); font-size: .9rem; align-items: flex-start; }
.alert-info { background: var(--sky-soft); color: #22598A; }
.alert-warn { background: var(--sun-soft); color: var(--sun-ink); }
.alert-danger { background: var(--coral-soft); color: #A93627; }
.alert-ok { background: var(--green-soft); color: #17693F; }

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a {
    border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted);
    padding: .7rem .9rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
    display: inline-flex; align-items: center; gap: .45rem;
}
.tabs button:hover, .tabs a:hover { color: var(--text); text-decoration: none; }
.tabs button.on, .tabs a.active { color: var(--ink); border-bottom-color: var(--primary); }
.tabs .count { background: var(--line-2); color: var(--muted); font-size: .72rem; padding: 0 .45rem; border-radius: 99px; }

/* ==========================================================================
   Modal & toasts
   ========================================================================== */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(20, 24, 58, .45);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 5vh 1rem; z-index: 100; overflow-y: auto;
    animation: fade .15s ease-out;
}
.modal {
    background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 560px;
    box-shadow: var(--shadow-3); animation: pop .18s ease-out;
    display: flex; flex-direction: column; max-height: 90vh;
}
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1080px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem .6rem; }
.modal-head .sub { color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.modal-body { padding: .6rem 1.4rem 1.2rem; overflow-y: auto; }
.modal-foot { padding: .9rem 1.4rem; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toast-host { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.toast {
    display: flex; gap: .7rem; align-items: flex-start;
    background: var(--ink); color: #fff; padding: .8rem 1rem; border-radius: 14px;
    box-shadow: var(--shadow-3); font-size: .9rem; animation: pop .2s ease-out;
}
.toast .icon { flex: none; margin-top: 1px; }
.toast.ok .icon { color: #7EE0AA; }
.toast.error { background: #8E2A1F; }
.toast.warn .icon { color: var(--sun); }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-3); padding: .4rem; z-index: 70; animation: pop .12s ease-out;
}
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
    padding: .55rem .7rem; border-radius: 9px; border: 0; background: none; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .sep { height: 1px; background: var(--line-2); margin: .3rem 0; }
.click-away { position: fixed; inset: 0; z-index: 65; }

/* notifications */
.bell { position: relative; }
.bell .badge-dot {
    position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; border-radius: 9px;
    background: var(--coral); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
    box-shadow: 0 0 0 2px var(--bg);
}
.notif-panel { width: 370px; max-width: calc(100vw - 2rem); padding: 0; }
.notif-panel .head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem .6rem; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex !important; gap: .7rem; padding: .7rem 1rem !important; border-radius: 0 !important; border-top: 1px solid var(--line-2) !important; align-items: flex-start !important; }
.notif-item.unread { background: #F6FAFF; }
.notif-item .t { font-weight: 600; font-size: .88rem; }
.notif-item .d { font-size: .82rem; color: var(--muted); }

/* ==========================================================================
   Empty & skeleton
   ========================================================================== */
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--muted); }
.empty .empty-icon { width: 60px; height: 60px; margin: 0 auto .8rem; border-radius: 20px; display: grid; place-items: center; background: var(--line-2); color: var(--faint); }
.empty h3 { color: var(--text); margin-bottom: .3rem; font-size: 1.05rem; }
.empty p { max-width: 360px; margin: 0 auto .9rem; font-size: .9rem; }
.skeleton { background: linear-gradient(90deg, var(--line-2), #F7F8FB, var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-screen { min-height: 50vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Kid cards / profile
   ========================================================================== */
.kid-card { padding: 1rem; display: flex; flex-direction: column; gap: .75rem; position: relative; border-top: 4px solid var(--c, var(--primary)); color: inherit; }
.kid-card .top { display: flex; gap: .8rem; align-items: center; }
.kid-card .name { font-weight: 700; color: var(--ink); line-height: 1.2; }
.kid-card .meta { font-size: .8rem; color: var(--muted); }
.kid-card .flags { display: flex; gap: .35rem; flex-wrap: wrap; }

.profile-head { display: flex; gap: 1.3rem; align-items: center; padding: 1.3rem 1.4rem; flex-wrap: wrap; }
.profile-head .info { flex: 1; min-width: 220px; }
.profile-head h1 { font-size: 1.7rem; }
.profile-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .4rem; font-size: .88rem; color: var(--muted); }
.profile-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: .55rem 1rem; font-size: .9rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }

/* presença (quadro) */
.attend-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.attend-card {
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: .9rem;
    display: flex; flex-direction: column; gap: .7rem; transition: border-color .15s, box-shadow .15s;
}
.attend-card.in { border-color: #A9DEC4; background: linear-gradient(180deg, #F3FBF7, #fff 60%); }
.attend-card.out { background: var(--surface-2); }
.attend-card.absent { border-color: #F5CFC9; background: linear-gradient(180deg, #FFF6F4, #fff 60%); }
.attend-card .who { display: flex; gap: .65rem; align-items: center; }
.attend-card .who b { display: block; font-size: .92rem; line-height: 1.2; }
.attend-card .times { display: flex; gap: .8rem; font-size: .8rem; color: var(--muted); }
.attend-card .times b { color: var(--text); }
.attend-card .acts { display: flex; gap: .4rem; }
.attend-card .acts .btn { flex: 1; }
.scan-box { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; border-radius: var(--r-lg); background: var(--ink); color: #fff; flex-wrap: wrap; }
.scan-box .input { background: var(--ink-2); border-color: var(--ink-3); color: #fff; max-width: 340px; }
.scan-box .input::placeholder { color: #9FA6D6; }

/* mapa mensal */
.month-map { border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.month-map th, .month-map td { border-bottom: 1px solid var(--line-2); padding: .35rem .25rem; text-align: center; min-width: 26px; }
.month-map th.name, .month-map td.name { text-align: left; min-width: 180px; position: sticky; left: 0; background: var(--surface); z-index: 1; padding-left: .8rem; }
.month-map .we { background: #F6F7FB; }
.mm { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font-weight: 700; font-size: .68rem; }
.mm.p { background: var(--green-soft); color: var(--green); }
.mm.a { background: var(--coral-soft); color: var(--coral); }
.mm.t { background: var(--sun-soft); color: var(--sun-ink); }
.mm.j { background: var(--sky-soft); color: var(--sky); }

/* ==========================================================================
   Linha do dia (timeline) — o elemento de assinatura
   ========================================================================== */
.timeline { position: relative; padding-left: 0; list-style: none; margin: 0; }
.timeline li { display: grid; grid-template-columns: 58px 40px minmax(0, 1fr); gap: .2rem .6rem; position: relative; padding-bottom: 1rem; }
.timeline li::before { content: ""; position: absolute; left: 77px; top: 42px; bottom: 2px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline li:last-child::before { display: none; }
.timeline .time { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 1rem; padding-top: .45rem; text-align: right; font-variant-numeric: tabular-nums; }
.timeline .node { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; font-size: 1.15rem; z-index: 1; }
.timeline .body { padding: .15rem 0 0; min-width: 0; }
.timeline .body b { display: block; color: var(--text); }
.timeline .body p { font-size: .87rem; color: var(--muted); margin: .1rem 0 0; }
.timeline .body .by { font-size: .74rem; color: var(--faint); }
.timeline .body img { border-radius: 12px; max-height: 180px; margin-top: .4rem; }
.t-entrada { background: var(--green-soft); }
.t-saida { background: #E7E9F5; }
.t-refeicao { background: var(--sun-soft); }
.t-sono { background: var(--lilac-soft); }
.t-higiene { background: var(--sky-soft); }
.t-atividade { background: var(--pink-soft); }
.t-comportamento { background: var(--primary-soft); }
.t-ocorrencia { background: var(--coral-soft); }
.t-obs { background: var(--line-2); }
.t-transport { background: var(--sky-soft); color: var(--ink); font-weight: 700; font-size: .85rem; }

.day-strip { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
.day-strip button { flex: none; width: 54px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: .45rem 0; cursor: pointer; font: inherit; }
.day-strip button b { display: block; font-family: var(--display); font-size: 1.2rem; color: var(--ink); line-height: 1.1; }
.day-strip button span { font-size: .7rem; color: var(--muted); }
.day-strip button.on { background: var(--ink); border-color: var(--ink); }
.day-strip button.on b { color: #fff; }
.day-strip button.on span { color: #A9B0E0; }

/* diário rápido */
.quick-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.quick-btn {
    border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: .8rem .6rem; cursor: pointer; font: inherit;
    display: flex; flex-direction: column; align-items: center; gap: .3rem; font-weight: 600; font-size: .85rem; color: var(--text);
}
.quick-btn .e { font-size: 1.5rem; line-height: 1; }
.quick-btn:hover, .quick-btn.on { border-color: var(--primary); background: var(--primary-soft); }
.kid-pick { display: flex; flex-wrap: wrap; gap: .45rem; }
.kid-pick button {
    display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface); cursor: pointer; font: inherit; font-size: .84rem; font-weight: 500; color: var(--text);
}
.kid-pick button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* avaliação */
.rating { display: inline-flex; gap: 3px; }
.rating button { border: 0; background: none; padding: 1px; cursor: pointer; color: #D6DBE8; font-size: 1.25rem; line-height: 1; }
.rating button.on { color: var(--sun); }
.rating.readonly button { cursor: default; }
.meter { height: 8px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.meter.sun > i { background: var(--sun); }
.meter.coral > i { background: var(--coral); }
.meter.sky > i { background: var(--sky); }
.meter.lilac > i { background: var(--lilac); }

/* ==========================================================================
   Kanban (matrículas)
   ========================================================================== */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: .9rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: #EAEDF5; border-radius: var(--r-lg); padding: .7rem; min-height: 240px; display: flex; flex-direction: column; gap: .6rem; }
.kanban-col h4 { display: flex; align-items: center; justify-content: space-between; padding: .2rem .3rem; font-size: .92rem; }
.kanban-card { background: var(--surface); border-radius: 13px; padding: .8rem; box-shadow: var(--shadow-1); border: 1px solid var(--line-2); cursor: pointer; }
.kanban-card:hover { border-color: #CDD4E6; }
.kanban-card b { display: block; color: var(--ink); }
.kanban-card .meta { font-size: .78rem; color: var(--muted); }

/* ==========================================================================
   Calendário
   ========================================================================== */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); }
.cal .dow { font-size: .76rem; font-weight: 600; color: var(--muted); padding: .55rem .6rem; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
.cal .day { min-height: 112px; padding: .35rem .4rem; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal .day:hover { background: #FAFBFD; }
.cal .day.other { background: #FAFBFD; }
.cal .day.other .n { color: var(--faint); }
.cal .day.sel { box-shadow: inset 0 0 0 2px var(--primary); }
.cal .day .n { font-weight: 700; font-size: .82rem; color: var(--text); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .n { background: var(--ink); color: #fff; }
.cal .ev { font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid currentColor; }
.cal .more { font-size: .7rem; color: var(--muted); padding-left: 4px; }

.ev-list { display: flex; flex-direction: column; }
.ev-item { display: flex; gap: .8rem; align-items: center; padding: .6rem .2rem; border-bottom: 1px dashed var(--line); }
.ev-item:last-child { border-bottom: 0; }
.ev-date { width: 48px; text-align: center; flex: none; border-radius: 12px; padding: .3rem 0; background: var(--surface-2); border: 1px solid var(--line-2); }
.ev-date b { display: block; font-family: var(--display); font-size: 1.2rem; line-height: 1; color: var(--ink); }
.ev-date span { font-size: .68rem; color: var(--muted); }

/* ==========================================================================
   Charts
   ========================================================================== */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { font-size: 10.5px; fill: var(--faint); font-family: var(--font); }
.chart .gridline { stroke: var(--line-2); stroke-width: 1; }
.chart .val { font-size: 10.5px; fill: var(--muted); font-weight: 600; font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.donut-legend { display: flex; flex-direction: column; gap: .45rem; font-size: .85rem; flex: 1; min-width: 160px; }
.donut-legend div { display: flex; align-items: center; gap: .5rem; }
.donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* lista simples */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line-2); color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { text-decoration: none; background: var(--surface-2); }
.list-item .grow b { display: block; font-size: .92rem; font-weight: 600; }
.list-item .grow span { font-size: .8rem; color: var(--muted); }

/* comunicados / mensagens */
.notice { padding: 1rem 1.2rem; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface); }
.notice.important { border-left: 4px solid var(--coral); }
.notice h3 { margin-bottom: .25rem; }
.thread { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; }
.bubble { max-width: 78%; padding: .65rem .9rem; border-radius: 16px; font-size: .9rem; background: var(--surface-2); border: 1px solid var(--line-2); align-self: flex-start; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); border-bottom-right-radius: 5px; }
.bubble.them { border-bottom-left-radius: 5px; }
.bubble .when { font-size: .7rem; opacity: .7; margin-top: .2rem; }
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 520px; }
.inbox-list { border-right: 1px solid var(--line-2); overflow-y: auto; max-height: 640px; }
.inbox-item { display: flex; gap: .65rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.on { background: var(--primary-soft); }
.inbox-item.unread b { color: var(--ink); }
.inbox-item .preview { font-size: .8rem; color: var(--muted); }

/* ementa */
.menu-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; }
.menu-day { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: .9rem; display: flex; flex-direction: column; gap: .55rem; }
.menu-day.today { border-color: var(--sun); box-shadow: 0 0 0 3px var(--sun-soft); }
.menu-day h4 { display: flex; justify-content: space-between; align-items: center; }
.meal { display: flex; gap: .55rem; align-items: flex-start; font-size: .87rem; }
.meal .e { font-size: 1.1rem; line-height: 1.2; }
.meal small { display: block; color: var(--faint); font-size: .72rem; }

/* upload */
.dropzone { border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 1.3rem; text-align: center; color: var(--muted); position: relative; background: var(--surface-2); }
.dropzone:hover { border-color: var(--primary); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-edit { position: relative; display: inline-block; }
.photo-edit label { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 3px var(--surface); overflow: hidden; }
.photo-edit label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ==========================================================================
   Autenticação
   ========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art {
    background: var(--ink); color: #DDE1F7; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art h1 { color: #fff; font-size: 2.7rem; max-width: 460px; }
.auth-art p { color: #A9B0E0; max-width: 420px; font-size: 1.02rem; }
.auth-crayons { display: flex; gap: .55rem; align-items: flex-end; margin-top: 2rem; }
.auth-crayons i { width: 14px; border-radius: 8px 8px 3px 3px; display: block; }
.auth-form { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.8rem; margin-bottom: .3rem; }
.demo-box { margin-top: 1.4rem; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: .9rem 1rem; font-size: .82rem; }
.demo-box code { font-size: .8rem; color: var(--ink); }

.public-shell { min-height: 100vh; background: var(--bg); }
.public-top { background: var(--ink); color: #fff; padding: 1rem 1.5rem; }
.public-top .inner, .public-body { max-width: 900px; margin: 0 auto; }
.public-body { padding: 1.5rem 1rem 3rem; }
.steps { display: flex; gap: .5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.steps .s { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .88rem; color: var(--muted); padding: .4rem .8rem .4rem .4rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); }
.steps .s i { width: 24px; height: 24px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-style: normal; font-size: .78rem; }
.steps .s.on { color: var(--ink); border-color: var(--primary); }
.steps .s.on i { background: var(--primary); color: #fff; }
.steps .s.done i { background: var(--green); color: #fff; }

/* ==========================================================================
   Portal dos pais
   ========================================================================== */
.parent-shell { min-height: 100vh; background: var(--bg); }
.parent-top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30; }
.parent-top .inner { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.25rem; }
.parent-nav { display: flex; gap: .25rem; margin-left: 1rem; }
.parent-nav a { color: #CBD0EC; padding: .5rem .8rem; border-radius: 10px; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .45rem; }
.parent-nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.parent-nav a.active { background: var(--ink-2); color: #fff; }
.parent-nav a.active .icon { color: var(--sun); }
.parent-body { max-width: 1160px; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
.parent-tabbar { display: none; }
.child-hero { border-radius: var(--r-xl); padding: 1.3rem; display: flex; gap: 1.1rem; align-items: center; color: var(--ink); background: var(--c-soft, var(--primary-soft)); flex-wrap: wrap; }
.child-hero .status { margin-left: auto; text-align: right; }
.status-big { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 999px; font-weight: 700; background: var(--surface); }
.status-big .dot { width: 10px; height: 10px; border-radius: 50%; }

/* ==========================================================================
   Impressão (faturas, relatórios)
   ========================================================================== */
.doc-page { background: #fff; max-width: 820px; margin: 0 auto; padding: 2.4rem 2.6rem; border-radius: var(--r-lg); box-shadow: var(--shadow-2); color: #1b1f33; font-size: 13px; }
.doc-head { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-start; padding-bottom: 1.2rem; border-bottom: 2px solid var(--ink); }
.doc-head .org b { font-family: var(--display); font-size: 1.35rem; color: var(--ink); display: block; }
.doc-title { text-align: right; }
.doc-title h2 { font-size: 1.5rem; }
.doc-title .no { font-weight: 700; font-size: 1rem; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.2rem 0; }
.doc-parties .box { background: var(--surface-2); border-radius: 12px; padding: .8rem 1rem; }
.doc-parties .box .lbl { font-size: .75rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.doc-table th { background: var(--ink); color: #fff; font-weight: 600; font-size: .78rem; padding: .5rem .6rem; text-align: left; }
.doc-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.doc-totals { margin-left: auto; width: 290px; max-width: 100%; margin-top: 1rem; }
.doc-totals div { display: flex; justify-content: space-between; padding: .3rem 0; }
.doc-totals .grand { border-top: 2px solid var(--ink); font-weight: 800; font-size: 1.1rem; color: var(--ink); padding-top: .5rem; margin-top: .3rem; }
.doc-foot { margin-top: 2rem; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8rem; }
.stamp { display: inline-block; border: 3px solid var(--green); color: var(--green); font-weight: 800; padding: .2rem .8rem; border-radius: 8px; transform: rotate(-6deg); font-size: 1.1rem; }
.stamp.void { border-color: var(--coral); color: var(--coral); }
.print-only { display: none; }

@media print {
    @page { size: A4; margin: 12mm; }
    body { background: #fff; font-size: 12px; }
    .sidebar, .topbar, .no-print, .toast-host, .page-header .actions, .filters, #blazor-error-ui, .parent-top, .parent-tabbar, .tabs { display: none !important; }
    .app-shell { display: block; }
    .content, .parent-body { padding: 0; max-width: none; }
    .card, .doc-page { box-shadow: none; border: 0; padding: 0; }
    .print-only { display: block; }
    .table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .doc-table th, .pill, .mm { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit; }
}

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1280px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kanban { grid-template-columns: repeat(5, 250px); }
}
@media (max-width: 1080px) {
    .app-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-3); }
    .app-shell.nav-open .sidebar { transform: none; }
    .app-shell.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(20,24,58,.4); z-index: 35; }
    .topbar .menu-btn { display: inline-flex; }
    .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .menu-week { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .inbox { grid-template-columns: minmax(0, 1fr); }
    .inbox-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line-2); }
    .auth-wrap { grid-template-columns: minmax(0, 1fr); }
    .auth-art { padding: 2rem 1.5rem; }
    .auth-art h1 { font-size: 2rem; }
    .auth-crayons, .auth-art .foot { display: none; }
    .parent-nav { display: none; }
    .parent-tabbar {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line);
        padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
    }
    .parent-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--muted); padding: .3rem 0; }
    .parent-tabbar a.active { color: var(--primary); }
}
@media (max-width: 720px) {
    body { font-size: 14px; }
    .content { padding: 1.1rem 1rem 3rem; }
    .topbar { padding: 0 1rem; }
    .topbar-title { display: none; }
    .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    h1 { font-size: 1.5rem; }
    .hero { grid-template-columns: minmax(0, 1fr); padding: 1.25rem; }
    .hero-ring { display: none; }
    .hero h1 { font-size: 1.6rem; }
    .hero-figures { gap: 1.4rem; }
    .hero-fig b { font-size: 1.8rem; }
    .cal .day { min-height: 64px; }
    .cal .ev { font-size: 0; padding: 0; height: 6px; border-left: 0; border-radius: 3px; background: currentColor !important; }
    .modal-backdrop { padding: 0; align-items: flex-end; }
    .modal { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 94vh; }
    .doc-page { padding: 1.2rem; }
    .doc-head, .doc-parties { grid-template-columns: 1fr; display: grid; }
    .doc-title { text-align: left; }
    .dl { grid-template-columns: 1fr; gap: .1rem; }
    .dl dd { margin-bottom: .45rem; }
    .filters .input, .filters .select { flex: 1 1 140px; min-width: 0; }
    .timeline li { grid-template-columns: 46px 36px minmax(0, 1fr); }
    .timeline li::before { left: 63px; }
    .timeline .node { width: 36px; height: 36px; }
    .child-hero .status { margin-left: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Blazor */
#blazor-error-ui {
    background: #FFF4D6; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0;
    padding: .7rem 1.25rem .8rem; position: fixed; width: 100%; z-index: 1000; color: var(--sun-ink);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--coral-soft); padding: 1rem; color: #A93627; border-radius: var(--r-md); }
.blazor-error-boundary::after { content: "Ocorreu um erro ao mostrar esta secção."; }

/* conversa */
.chat { display: flex; flex-direction: column; gap: .7rem; padding: 1.1rem; overflow-y: auto; max-height: 520px; background: var(--surface-2); flex: 1; }
.bubble { max-width: 78%; padding: .65rem .9rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); font-size: .92rem; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); border-bottom-right-radius: 5px; }
.bubble:not(.me) { border-bottom-left-radius: 5px; }
.bubble .meta { font-size: .7rem; opacity: .7; margin-top: .25rem; }
.chat-compose { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid var(--line-2); background: var(--surface); }
.chat-compose textarea { flex: 1; min-height: 44px; resize: vertical; }
