:root {
    --ink: #172624;
    --muted: #697977;
    --line: #dfe7e5;
    --soft-line: #edf2f1;
    --canvas: #f5f8f7;
    --card: #ffffff;
    --green-950: #0d302b;
    --green-900: #123c36;
    --green-800: #185046;
    --green-700: #21685b;
    --green-100: #dff0eb;
    --green-50: #eef8f5;
    --blue: #3478c8;
    --blue-soft: #e7f0fb;
    --gold: #b47a24;
    --gold-soft: #fbf0d9;
    --coral: #cd5b4b;
    --coral-soft: #fbe7e3;
    --red: #b63d34;
    --red-soft: #fdeae8;
    --shadow: 0 8px 30px rgba(21, 55, 49, .07);
    --radius: 16px;
}

* { box-sizing: border-box; }

html { color-scheme: light; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

body.app-initializing .app-shell {
    opacity: 0;
    animation: reveal-app-shell 0s linear 1.5s forwards;
}

@keyframes reveal-app-shell {
    to { opacity: 1; }
}

button, input, select, textarea { min-width: 0; max-width: 100%; font: inherit; touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(52, 120, 200, .22);
    outline-offset: 2px;
}

.is-hidden { display: none !important; }
.ui-icon { width: 1em; height: 1em; display: inline-block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.nav-icon .ui-icon { width: 18px; height: 18px; }
.primary-button .ui-icon, .secondary-button .ui-icon, .ghost-button .ui-icon, .row-button .ui-icon { width: 15px; height: 15px; }
.logout-form .ui-icon { width: 16px; height: 16px; }
.stat-icon .ui-icon, .travel-summary-card > span .ui-icon, .payment-summary-card > span .ui-icon, .report-summary-card > span .ui-icon, .operation-summary-card > span .ui-icon { width: 18px; height: 18px; }

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 284px;
    display: flex;
    flex-direction: column;
    color: #d9e9e5;
    background: linear-gradient(180deg, #0b2d28 0%, var(--green-950) 52%, #0a2925 100%);
    border-right: 1px solid rgba(255,255,255,.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 19px 21px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: var(--green-950);
    background: #9ed8c8;
    font-size: 22px;
    font-weight: 850;
    letter-spacing: -.04em;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 18px; letter-spacing: -.02em; }
.brand-copy small { color: #91aaa4; font-size: 11px; text-transform: uppercase; letter-spacing: .11em; }

.main-nav { padding: 18px 12px 22px; overflow-y: auto; }
.nav-label { margin: 0 12px 9px; color: #6f8c85; font-size: 9px; font-weight: 850; letter-spacing: .17em; white-space: nowrap; }
.nav-label--spaced { margin-top: 19px; }
.nav-item {
    width: 100%;
    min-height: 50px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    padding: 7px 10px;
    color: #a9c0bb;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 720;
    white-space: nowrap;
    transition: background .16s, color .16s, border-color .16s, transform .16s;
}
.nav-item > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.045); transform: translateX(2px); }
.nav-item.is-active { color: white; background: linear-gradient(135deg, #185046, #1d5c50); border-color: rgba(158,216,200,.16); box-shadow: 0 7px 18px rgba(2,18,16,.15), inset 3px 0 #9ed8c8; }
.nav-item--subreport { width: calc(100% - 14px); margin-left: 14px; padding-top: 5px; padding-bottom: 5px; color: #91aba5; font-size: 11px; }
.nav-item--subreport .nav-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.nav-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: #9bb7b0; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.075); border-radius: 10px; font-size: 15px; font-weight: 800; line-height: 1; transition: color .16s, background .16s, transform .16s; }
.nav-item:hover .nav-icon { color: #d9eee8; background: rgba(158,216,200,.1); transform: scale(1.04); }
.nav-item.is-active .nav-icon { color: var(--green-950); background: #9ed8c8; border-color: rgba(255,255,255,.38); box-shadow: 0 4px 11px rgba(3,24,20,.18); }
.nav-count { min-width: 22px; padding: 3px 6px; border-radius: 999px; color: #c6d8d3; background: rgba(255,255,255,.09); font-size: 9px; font-weight: 800; text-align: center; }
.nav-count.alert:not(:empty) { color: #ffdbd6; background: rgba(205,91,75,.28); }

.sidebar-bottom { margin-top: auto; }
.profile-row > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.profile-row { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.profile-row strong { color: white; font-size: 12px; }
.profile-row small { color: #7e9a93; font-size: 10px; }
.profile-row > span:nth-child(2) strong, .profile-row > span:nth-child(2) small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin-left: auto; }
.logout-form button { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; color: #9fb7b1; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 8px; font-size: 15px; }
.logout-form button:hover { color: white; background: rgba(255,255,255,.1); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--green-900); background: #b9e0d5; font-weight: 800; }
.avatar--admin { color: white; background: #2b6b5e; }

.main-content { min-height: 100vh; margin-left: 284px; }
.topbar {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 34px;
    background: rgba(255,255,255,.93);
    border-bottom: 1px solid var(--line);
}
.mobile-menu { display: none; }
.mobile-nav-backdrop { display: none; }
.page-heading { min-width: 250px; }
.page-heading p, .section-kicker { margin: 0 0 5px; color: var(--green-700); font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.page-heading h1 { margin: 0 0 4px; font-size: 24px; line-height: 1.15; letter-spacing: -.04em; }
.page-heading > span { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 11px; }
.search-box { width: min(29vw, 335px); height: 43px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); }
.search-box span { color: var(--muted); font-size: 19px; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 12px; }
.search-box:focus-within { border-color: #8ab8ab; box-shadow: 0 0 0 3px rgba(60,129,112,.1); }

.primary-button, .secondary-button, .ghost-button, .text-button, .icon-button, .danger-button {
    border: 0;
    font-weight: 750;
    transition: transform .12s, background .12s, border-color .12s;
}
.primary-button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; color: white; background: var(--green-800); border-radius: 10px; box-shadow: 0 4px 12px rgba(18,60,54,.14); }
.primary-button:hover { background: var(--green-700); transform: translateY(-1px); }
.primary-button:disabled { opacity: .6; cursor: wait; transform: none; }
.danger-button { min-height: 39px; padding: 0 15px; color: white; background: var(--red); border-radius: 9px; box-shadow: 0 4px 12px rgba(182,61,52,.16); }
.danger-button:hover { background: #982f28; }
.danger-button:disabled { opacity: .6; cursor: wait; }
.secondary-button, .ghost-button { min-height: 39px; padding: 0 14px; color: var(--green-800); background: white; border: 1px solid #cbd9d6; border-radius: 9px; }
.secondary-button:hover, .ghost-button:hover { background: var(--green-50); border-color: #a8c1bb; }
.text-button { padding: 7px 3px; color: var(--green-800); background: transparent; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--green-800); background: var(--green-50); border: 1px solid #cde2dc; border-radius: 10px; font-size: 19px; }

.content-wrap { max-width: 1640px; margin: 0 auto; padding: 23px 34px 38px; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; padding: 11px 16px; color: #526563; background: #edf5f2; border: 1px solid #d4e5e0; border-radius: 12px; }
.demo-banner > div { display: flex; align-items: center; gap: 11px; }
.demo-banner p { margin: 0; font-size: 12px; line-height: 1.5; }
.demo-banner strong { color: var(--ink); }
.demo-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--green-700); border-radius: 50%; font-family: Georgia, serif; font-weight: 700; }
.view-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.period-tabs { display: inline-flex; padding: 4px; background: #e9efed; border-radius: 10px; }
.period-tabs button { min-height: 34px; padding: 0 15px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 12px; font-weight: 700; }
.period-tabs button:hover { color: var(--ink); }
.period-tabs button.is-active { color: var(--green-900); background: white; box-shadow: 0 2px 7px rgba(20,55,49,.09); }
.period-toolbar-side { display: flex; align-items: center; justify-content: flex-end; gap: 11px; }
.date-range { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0 11px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; }
.date-range > span { color: var(--green-700); font-size: 15px; }
.date-range strong { color: #657774; font-weight: 700; }
.custom-period-panel { flex: 1 0 100%; display: grid; grid-template-columns: minmax(380px, 1.2fr) minmax(310px, .9fr) minmax(230px, auto); gap: 16px 22px; padding: 18px 20px; background: linear-gradient(135deg, #fff, #f6faf8); border: 1px solid #cdded9; border-radius: 15px; box-shadow: 0 12px 30px rgba(20,55,49,.08); }
.custom-period-panel__header { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--soft-line); }
.custom-period-panel__header > div { min-width: 0; flex: 1; }
.custom-period-panel__header p { margin: 0 0 3px; color: var(--green-700); font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.custom-period-panel__header h2 { margin: 0 0 3px; font-size: 17px; letter-spacing: -.025em; }
.custom-period-panel__header div > span { color: var(--muted); font-size: 10px; }
.custom-period-panel__icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-800); background: var(--green-100); border-radius: 11px; font-size: 19px; }
.custom-period-close { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: #6e807c; background: white; border: 1px solid var(--line); border-radius: 9px; font-size: 20px; line-height: 1; }
.custom-period-close:hover { color: var(--ink); background: var(--green-50); }
.custom-period-fields { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); align-items: end; gap: 10px; }
.custom-period-fields label { display: grid; gap: 7px; }
.custom-period-fields label span, .custom-period-presets > span { color: #61736f; font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.custom-period-fields input { width: 100%; min-height: 43px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid #cbdad6; border-radius: 10px; font: inherit; font-size: 12px; }
.custom-period-fields input:focus { outline: none; border-color: #6fa897; box-shadow: 0 0 0 3px rgba(59,127,108,.11); }
.custom-period-arrow { width: 34px; height: 43px; display: grid; place-items: center; color: var(--green-700); font-size: 18px; }
.custom-period-presets { display: grid; align-content: end; gap: 7px; }
.custom-period-presets > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.custom-period-presets button { min-height: 34px; padding: 0 10px; color: var(--green-800); background: #edf6f3; border: 1px solid #d4e7e1; border-radius: 8px; font-size: 9px; font-weight: 800; }
.custom-period-presets button:hover { background: #dff0eb; border-color: #b8d8cf; }
.custom-period-presets button.is-active { color: white; background: var(--green-700); border-color: var(--green-700); box-shadow: 0 4px 10px rgba(33,104,91,.16); }
.custom-period-actions { display: grid; align-content: end; gap: 8px; }
.custom-period-selection { min-height: 49px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; color: var(--green-800); background: #edf6f3; border: 1px solid #d4e7e1; border-radius: 10px; }
.custom-period-selection > .ui-icon { width: 20px; height: 20px; }
.custom-period-selection > div { min-width: 0; display: grid; gap: 1px; }
.custom-period-selection small { color: #6c7d79; font-size: 7px; font-weight: 850; letter-spacing: .08em; }
.custom-period-selection strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.custom-period-selection em { color: var(--muted); font-size: 8px; font-style: normal; }
.custom-period-actions > div:last-child { display: flex; justify-content: flex-end; gap: 8px; }
.custom-period-actions .primary-button, .custom-period-actions .ghost-button { min-height: 43px; white-space: nowrap; }
.custom-period-actions .primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.custom-period-error { grid-column: 1 / -1; margin: -2px 0 0; padding: 9px 11px; color: #8f332d; background: var(--red-soft); border: 1px solid #efc8c4; border-radius: 9px; font-size: 10px; font-weight: 750; }

.stats-grid { display: grid; grid-template-columns: .8fr .8fr 1.25fr 1.25fr; gap: 13px; margin-bottom: 16px; }
.stat-card { min-height: 112px; display: flex; align-items: flex-start; gap: 13px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 12px rgba(21,55,49,.035); }
.stat-card > div { min-width: 0; display: grid; gap: 4px; }
.stat-card small { color: var(--muted); font-size: 11px; font-weight: 650; }
.stat-card strong { font-size: 22px; letter-spacing: -.04em; line-height: 1.2; }
.stat-card p { margin: 0; color: #82918f; font-size: 10px; line-height: 1.4; }
.stat-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; font-weight: 850; }
.stat-icon--green { color: var(--green-700); background: var(--green-100); }
.stat-icon--blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon--gold { color: var(--gold); background: var(--gold-soft); }
.stat-icon--coral { color: var(--coral); background: var(--coral-soft); }
.money-stack { display: flex; flex-wrap: wrap; gap: 3px 9px; font-size: 17px !important; }
.money-stack span:not(:last-child)::after { content: " ·"; color: #b7c2c0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 22px; border-bottom: 1px solid var(--soft-line); }
.card-header h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.025em; }
.card-header > div > span { color: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.dot--upcoming { background: var(--blue); }
.dot--active { background: #3c9c80; }
.dot--completed { background: #9aa8a6; }

.planner-layout { display: grid; grid-template-columns: minmax(340px, .82fr) minmax(590px, 1.35fr); gap: 16px; margin-bottom: 16px; }

.agenda-card, .calendar-card { min-height: 556px; overflow: hidden; }
.agenda-card { display: flex; flex-direction: column; }
.agenda-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px 14px; }
.agenda-header h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.03em; }
.agenda-header > div > span { color: var(--muted); font-size: 10px; }
.agenda-count { min-width: 38px; height: 38px; display: grid; place-items: center; color: var(--green-800); background: var(--green-100); border-radius: 11px; font-size: 16px; }
.agenda-tabs { display: flex; gap: 4px; margin: 0 20px 12px; padding: 4px; background: #edf2f1; border-radius: 9px; }
.agenda-tabs button { flex: 1; min-height: 32px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 10px; font-weight: 750; }
.agenda-tabs button.is-active { color: var(--green-900); background: white; box-shadow: 0 2px 7px rgba(20,55,49,.08); }
.agenda-list { min-height: 0; display: grid; align-content: start; gap: 8px; flex: 1; padding: 0 14px 14px; overflow-y: auto; }
.agenda-item { width: 100%; min-width: 0; display: grid; grid-template-columns: 48px minmax(105px, 1fr) minmax(110px, .95fr) 22px; align-items: center; gap: 10px; padding: 11px; color: var(--ink); background: #fbfdfc; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 11px; text-align: left; }
.agenda-item:hover { background: var(--green-50); border-color: #bdd5cf; transform: translateY(-1px); }
.agenda-item--active { border-left-color: #3c9c80; }
.agenda-item--completed { border-left-color: #9aa8a6; }
.agenda-date { width: 45px; height: 45px; display: grid; place-items: center; align-content: center; color: var(--green-800); background: var(--green-50); border-radius: 9px; }
.agenda-date strong { font-size: 16px; line-height: 1; }
.agenda-date small { margin-top: 3px; font-size: 8px; font-weight: 750; text-transform: uppercase; }
.agenda-person, .agenda-treatment { min-width: 0; display: grid; gap: 4px; }
.agenda-person strong, .agenda-treatment strong, .agenda-person small, .agenda-treatment small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-person strong { font-size: 11px; }
.agenda-person small, .agenda-treatment small { color: var(--muted); font-size: 8px; }
.agenda-treatment strong { color: var(--green-700); font-size: 9px; }
.agenda-arrow { color: #8da09c; font-size: 20px; }
.agenda-empty { align-self: center; margin: auto; padding: 45px 20px; color: var(--muted); text-align: center; }
.agenda-empty > span { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 10px; color: var(--green-700); background: var(--green-50); border-radius: 50%; font-size: 25px; }
.agenda-empty strong { display: block; color: var(--ink); font-size: 12px; }
.agenda-empty p { margin: 5px 0 0; font-size: 9px; }
.agenda-footer { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 9px 14px; background: #fbfcfc; border-top: 1px solid var(--soft-line); }
.agenda-footer span { color: var(--muted); font-size: 8px; text-align: right; }

.calendar-card { display: flex; flex-direction: column; }
.calendar-top { min-height: 82px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--soft-line); }
.calendar-top > div:nth-child(2) { text-align: center; }
.calendar-top h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; text-transform: capitalize; }
.calendar-top-actions { display: flex; align-items: center; gap: 7px; }
.calendar-nav-button { width: 36px; height: 36px; display: grid; place-items: center; color: var(--green-800); background: var(--green-50); border: 1px solid #cfe3dd; border-radius: 10px; font-size: 21px; }
.calendar-nav-button:hover, .calendar-today:hover { background: var(--green-100); }
.calendar-today { min-height: 34px; padding: 0 11px; color: var(--green-800); background: white; border: 1px solid #cfe3dd; border-radius: 9px; font-size: 9px; font-weight: 750; }
.calendar-scroll { flex: 1; overflow-x: auto; }
.calendar-weekdays, .calendar-grid { min-width: 590px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { color: #71807d; background: #f7faf9; border-bottom: 1px solid var(--line); }
.calendar-weekdays span { padding: 9px 8px; border-right: 1px solid var(--soft-line); font-size: 8px; font-weight: 850; letter-spacing: .055em; text-align: center; text-transform: uppercase; }
.calendar-weekdays span:last-child { border-right: 0; }
.calendar-grid { position: relative; }
.calendar-loading { grid-column: 1 / -1; margin: 0; padding: 70px 20px; color: var(--muted); text-align: center; }
.calendar-day { min-height: 67px; display: grid; align-content: space-between; gap: 5px; padding: 7px; color: var(--ink); background: white; border: 0; border-right: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); text-align: left; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover:not(:disabled) { background: #f3f9f7; }
.calendar-day.is-outside { color: #b2bdbb; background: #fbfcfc; cursor: default; }
.calendar-day.is-today { background: #f0f9f6; }
.calendar-day.is-selected { position: relative; z-index: 1; background: #e8f5f1; box-shadow: inset 0 0 0 2px #4e9b88; }
.calendar-day-top { display: flex; align-items: center; justify-content: space-between; }
.calendar-day time { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; font-size: 10px; font-weight: 800; }
.calendar-day.is-today time { color: white; background: var(--green-700); }
.calendar-day-top b { padding: 2px 5px; color: var(--green-700); background: white; border-radius: 999px; font-size: 6px; text-transform: uppercase; }
.day-indicators { min-height: 14px; display: flex; align-items: center; gap: 3px; }
.day-indicators strong { margin-left: 2px; color: var(--muted); font-size: 7px; font-weight: 750; }
.day-marker { width: 6px; height: 6px; display: inline-block; background: var(--blue); border-radius: 50%; }
.day-marker--active { background: #3c9c80; }
.day-marker--completed { background: #9aa8a6; }
.calendar-footer { min-height: 42px; display: flex; align-items: center; gap: 13px; padding: 8px 14px; color: var(--muted); background: #fbfcfc; font-size: 8px; }
.calendar-footer span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-footer strong { margin-left: auto; color: var(--ink); }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 1100px; }
.data-table th { height: 43px; padding: 0 13px; color: #778582; background: #f9fbfa; border-bottom: 1px solid var(--line); font-size: 9px; letter-spacing: .065em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px; border-bottom: 1px solid var(--soft-line); font-size: 11px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.patient-cell { display: flex; align-items: center; gap: 9px; min-width: 155px; }
.patient-cell .avatar { width: 33px; height: 33px; color: var(--green-800); background: #e0f0ec; font-size: 11px; }
.cell-stack { display: grid; gap: 3px; }
.cell-stack strong { max-width: 155px; color: var(--ink); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-stack small { max-width: 160px; color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-plan-stack { min-width: 205px; gap: 6px; }
.transfer-plan-stack small { max-width: 230px; line-height: 1.35; overflow: visible; text-overflow: clip; white-space: normal; }
.transfer-plan-stack small + .travel-state { margin-top: 4px; padding-top: 7px; border-top: 1px solid var(--soft-line); }
.visit-badge { min-width: 67px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 8px; color: var(--green-700); background: var(--green-50); border: 1px solid #d7e9e4; border-radius: 999px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.visit-badge.is-repeat { color: #725115; background: var(--gold-soft); border-color: #ecd8ad; }
.money { color: var(--ink); font-weight: 750; white-space: nowrap; }
.money.money--due { color: var(--coral); }
.status { display: inline-flex; align-items: center; gap: 6px; min-width: 76px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--upcoming, .status--planned { color: #2f6fae; background: var(--blue-soft); }
.status--active, .status--paid { color: #277a65; background: var(--green-100); }
.status--completed { color: #6d7d7a; background: #edf1f0; }
.status--overdue { color: var(--red); background: var(--red-soft); }
.status--today { color: #98651c; background: var(--gold-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-button-reset { padding: 0; color: inherit; background: transparent; border: 0; text-align: left; }
.patient-link { cursor: pointer; }
.patient-link:hover strong { color: var(--green-700); text-decoration: underline; text-underline-offset: 2px; }
.row-button { min-width: 31px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; color: var(--green-800); background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.row-button:hover { background: var(--green-50); border-color: #b8d0ca; }
.row-button--danger { color: var(--red); border-color: #ead2cf; }
.row-button--danger:hover { background: var(--red-soft); border-color: #dfaaa4; }
.loading-cell, .empty-cell { padding: 44px !important; color: var(--muted); text-align: center; }

.patient-directory-table { min-width: 1120px; }
.patient-directory-table th:first-child, .patient-directory-table td:first-child { padding-left: 20px; }
.patient-directory-table th:last-child, .patient-directory-table td:last-child { padding-right: 20px; }
.representative { display: inline-flex; align-items: center; min-height: 27px; padding: 5px 9px; border-radius: 8px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.representative--agency { color: #725115; background: var(--gold-soft); }
.representative--sales { color: var(--green-800); background: var(--green-100); }
.representative--direct { color: var(--muted); background: #edf1f0; }

.payment-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 16px; }
.payment-summary-card { min-height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.payment-summary-card > div { display: grid; gap: 5px; }
.payment-summary-card small { color: var(--muted); font-size: 10px; font-weight: 700; }
.payment-summary-card strong { font-size: 18px; }
.payment-summary-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.payment-summary-card.is-overdue > span { color: var(--red); background: var(--red-soft); }
.payment-summary-card.is-today > span { color: var(--gold); background: var(--gold-soft); }
.payment-summary-card.is-planned > span { color: var(--blue); background: var(--blue-soft); }
.payment-table { min-width: 850px; }

.logistics-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 16px; }
.travel-summary-card { min-height: 92px; display: flex; align-items: center; gap: 13px; padding: 17px 19px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.travel-summary-card > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; font-size: 17px; }
.travel-summary-card > div { display: grid; gap: 3px; }
.travel-summary-card small { color: var(--muted); font-size: 9px; font-weight: 800; }
.travel-summary-card strong { font-size: 21px; line-height: 1; }
.travel-summary-card p { margin: 0; color: var(--muted); font-size: 9px; }
.travel-summary-card.is-flight > span { color: var(--blue); background: var(--blue-soft); }
.travel-summary-card.is-transfer > span { color: var(--green-800); background: var(--green-100); }
.travel-summary-card.is-hotel > span { color: var(--gold); background: var(--gold-soft); }
.logistics-table { min-width: 1320px; }
.logistics-table tr.is-past-plan { opacity: .62; }
.travel-state { display: inline-flex; align-items: center; min-height: 27px; padding: 5px 9px; border-radius: 8px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.travel-state--pending { color: #98651c; background: var(--gold-soft); }
.travel-state--arranged, .travel-state--reserved, .travel-state--checked_in { color: #2f6fae; background: var(--blue-soft); }
.travel-state--completed { color: var(--green-800); background: var(--green-100); }
.travel-state--not_needed { color: var(--muted); background: #edf1f0; }

.report-filter-card { display: grid; grid-template-columns: minmax(220px, .85fr) minmax(270px, 1fr) minmax(430px, 1.6fr); align-items: end; gap: 20px; margin-bottom: 16px; padding: 19px 22px; }
.report-filter-intro h2 { margin: 0 0 5px; font-size: 17px; letter-spacing: -.025em; }
.report-filter-intro > span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.report-filter-group { min-width: 0; display: grid; gap: 7px; }
.report-filter-group > small { color: #71817e; font-size: 8px; font-weight: 850; letter-spacing: .09em; }
.report-mobile-filters, .report-mobile-hint { display: none; }
.report-segmented { min-width: 0; display: flex; gap: 4px; padding: 4px; background: #eaf0ee; border-radius: 10px; }
.report-segmented button { min-height: 37px; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.report-segmented button:hover { color: var(--ink); }
.report-segmented button.is-active { color: var(--green-900); background: white; box-shadow: 0 2px 8px rgba(20,55,49,.09); }
.report-segmented button b { min-width: 21px; padding: 3px 5px; color: #70817e; background: rgba(255,255,255,.62); border-radius: 999px; font-size: 8px; }
.report-segmented button.is-active b { color: white; background: var(--green-700); }
.report-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.report-summary-card { min-height: 104px; display: flex; align-items: flex-start; gap: 13px; padding: 18px 19px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 12px rgba(21,55,49,.035); }
.report-summary-card > span { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; font-size: 14px; font-weight: 850; }
.report-summary-card > div { min-width: 0; display: grid; gap: 4px; }
.report-summary-card small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .045em; }
.report-summary-card strong { font-size: 21px; line-height: 1.1; }
.report-summary-card p { margin: 0; color: #82918f; font-size: 9px; }
.report-summary-card.is-new > span { color: var(--green-700); background: var(--green-100); }
.report-summary-card.is-repeat > span { color: var(--gold); background: var(--gold-soft); }
.report-summary-card.is-patient > span { color: var(--blue); background: var(--blue-soft); }
.report-summary-card.is-money > span { color: var(--coral); background: var(--coral-soft); }
.report-summary-card.is-paid > span { color: var(--green-700); background: var(--green-100); }
.report-summary-card.is-money .money-stack, .report-summary-card.is-paid .money-stack { font-size: 16px !important; }
.report-card { margin-bottom: 16px; }
.report-detail-summary { cursor: pointer; list-style: none; }
.report-detail-summary::-webkit-details-marker { display: none; }
.report-detail-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; color: var(--green-800); background: var(--green-50); border: 1px solid #cfe2dc; border-radius: 9px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.report-detail-toggle .ui-icon { width: 14px; height: 14px; transition: transform .18s; }
.report-detail-toggle__close { display: none; }
.report-detail-disclosure[open] .report-detail-toggle__open { display: none; }
.report-detail-disclosure[open] .report-detail-toggle__close { display: inline; }
.report-detail-disclosure[open] .report-detail-toggle .ui-icon { transform: rotate(180deg); }
.report-detail-disclosure:not([open]) .report-detail-summary { border-bottom: 0; }
.report-source-table { min-width: 1280px; }
.report-detail-table { min-width: 1120px; }
.report-source-cell { min-width: 170px; display: flex; align-items: center; gap: 9px; }
.report-source-cell .avatar { width: 34px; height: 34px; color: white; background: var(--green-700); font-size: 10px; }
.report-type { display: inline-flex; align-items: center; min-height: 27px; padding: 5px 9px; border-radius: 8px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.report-type--agency { color: #725115; background: var(--gold-soft); }
.report-type--sales_rep { color: var(--green-800); background: var(--green-100); }
.report-type--unassigned { color: #53616a; background: #edf1f3; }
.report-number { min-width: 29px; height: 29px; display: inline-grid; place-items: center; color: var(--green-800); background: var(--green-50); border-radius: 8px; font-size: 12px; }
.report-money-stack { display: grid; gap: 2px; font-size: 10px !important; white-space: nowrap; }
.report-money-stack--paid { color: var(--green-700); }
.report-money-stack--due { color: var(--coral); }
.report-source-summary-row td { transition: background .16s, border-color .16s; }
.report-source-summary-row:hover td, .report-source-summary-row.is-expanded td { background: #f6fbf9; }
.report-source-summary-row.is-expanded td { border-bottom-color: transparent; }
.report-source-toggle { width: 100%; min-width: 215px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; }
.report-source-toggle:hover strong { color: var(--green-700); }
.report-expand-icon { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-700); background: var(--green-50); border-radius: 8px; font-size: 14px; transition: transform .18s, background .18s; }
.report-source-summary-row.is-expanded .report-expand-icon { color: white; background: var(--green-700); transform: rotate(180deg); }
.report-source-detail-row > td { padding: 0 16px 16px !important; background: #f6fbf9; }
.report-source-detail { padding: 15px; background: white; border: 1px solid #cfe1dc; border-radius: 12px; box-shadow: 0 8px 22px rgba(18,60,54,.06); }
.report-source-detail__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 11px; padding: 0 2px 10px; border-bottom: 1px solid var(--soft-line); }
.report-source-detail__head > div { display: grid; gap: 3px; }
.report-source-detail__head strong { font-size: 12px; }
.report-source-detail__head span, .report-source-detail__head > small { color: var(--muted); font-size: 9px; }
.report-patient-list { display: grid; gap: 7px; }
.report-patient-item { min-width: 1030px; display: grid; grid-template-columns: minmax(220px, 1.35fr) minmax(180px, 1fr) minmax(155px, .8fr) minmax(160px, .8fr) auto; align-items: center; gap: 16px; padding: 10px 12px; background: #fbfdfc; border: 1px solid var(--soft-line); border-radius: 10px; }
.report-patient-name { display: flex; align-items: center; gap: 9px; }
.report-patient-name .avatar { width: 31px; height: 31px; color: var(--green-900); background: #cbe8df; font-size: 9px; }
.report-patient-money strong { color: var(--green-800); }
.operations-report-block { display: grid; gap: 14px; margin: 14px 0 16px; }
.operations-report-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.operation-summary-card { min-height: 92px; display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.operation-summary-card > span { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; font-size: 15px; font-weight: 850; }
.operation-summary-card > div { min-width: 0; display: grid; gap: 3px; }
.operation-summary-card small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .045em; }
.operation-summary-card strong { font-size: 22px; line-height: 1; }
.operation-summary-card p { margin: 0; color: #82918f; font-size: 9px; }
.operation-summary-card.is-hotel > span { color: #98651c; background: var(--gold-soft); }
.operation-summary-card.is-night > span { color: #6c4f8f; background: #f0e9f8; }
.operation-summary-card.is-transfer > span { color: #2f6fae; background: var(--blue-soft); }
.operation-summary-card.is-completed > span { color: var(--green-800); background: var(--green-100); }
.operations-report-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.operations-report-card { min-width: 0; }
.hotel-report-table { min-width: 900px; }
.transfer-report-table { min-width: 920px; }
.operation-count { min-width: 34px; height: 34px; display: inline-grid; place-items: center; color: var(--green-800); background: var(--green-50); border-radius: 9px; font-size: 14px; }
.operation-status-list { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 340px; }
.operation-status-count { min-width: 31px; height: 31px; display: inline-grid; place-items: center; border-radius: 8px; font-size: 12px; }
.operation-status-count--pending { color: #98651c; background: var(--gold-soft); }
.operation-status-count--arranged { color: #2f6fae; background: var(--blue-soft); }
.operation-status-count--completed { color: var(--green-800); background: var(--green-100); }
.operation-summary-row td { transition: background .16s, border-color .16s; }
.operation-summary-row:hover td, .operation-summary-row.is-expanded td { background: #f6fbf9; }
.operation-summary-row.is-expanded td { border-bottom-color: transparent; }
.operation-row-toggle { width: 100%; min-width: 220px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; }
.operation-row-toggle:hover strong { color: var(--green-700); }
.operation-summary-row.is-expanded .report-expand-icon { color: white; background: var(--green-700); transform: rotate(180deg); }
.operation-detail-row > td { padding: 0 16px 16px !important; background: #f6fbf9; }
.operation-detail-panel { min-width: 900px; padding: 15px; background: white; border: 1px solid #cfe1dc; border-radius: 12px; box-shadow: 0 8px 22px rgba(18,60,54,.06); }
.operation-person-item { min-width: 1000px; display: grid; align-items: center; gap: 15px; padding: 10px 12px; background: #fbfdfc; border: 1px solid var(--soft-line); border-radius: 10px; }
.operation-person-item--hotel { grid-template-columns: minmax(220px, 1.25fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, .8fr) auto; }
.operation-person-item--transfer { grid-template-columns: minmax(220px, 1.2fr) minmax(175px, .9fr) minmax(160px, .8fr) minmax(250px, 1.3fr) auto; }

.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.team-list { padding: 8px 18px 16px; }
.team-row { display: flex; align-items: center; gap: 11px; min-height: 67px; padding: 9px 3px; border-bottom: 1px solid var(--soft-line); }
.team-row:last-child { border-bottom: 0; }
.team-row .avatar { color: white; background: var(--green-700); }
.team-row__body { min-width: 0; flex: 1; display: grid; gap: 3px; }
.team-row__body strong { font-size: 12px; }
.team-row__body span { color: var(--muted); font-size: 9px; }
.team-row__count { display: grid; justify-items: end; gap: 2px; }
.team-row__count strong { font-size: 15px; }
.team-row__count small { color: var(--muted); font-size: 9px; }

.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px; }
.directory-item { min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.directory-item .avatar { width: 42px; height: 42px; color: white; background: var(--green-700); }
.directory-item__body { min-width: 0; flex: 1; display: grid; gap: 5px; }
.directory-item__body strong, .directory-item__body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directory-item__body strong { font-size: 12px; }
.directory-item__body span { color: var(--muted); font-size: 9px; }
.settings-hero { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 14px; padding: 26px 28px; color: white; background: linear-gradient(125deg, #103b35, #176256); border-radius: 17px; box-shadow: 0 16px 38px rgba(10, 54, 48, .16); }
.settings-hero > div { max-width: 720px; display: grid; gap: 8px; }
.settings-hero .section-kicker { color: #9be0cc; }
.settings-hero h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.settings-hero > div > span { color: #c7ddd7; font-size: 11px; line-height: 1.6; }
.settings-hero__icon { width: 72px; height: 72px; display: grid; place-items: center; flex: 0 0 auto; color: #123c36; background: #9be0cc; border: 1px solid rgba(255,255,255,.25); border-radius: 22px; font-size: 30px; box-shadow: inset 0 0 0 7px rgba(255,255,255,.18); }
.settings-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.settings-summary article { min-height: 76px; display: flex; align-items: center; gap: 11px; padding: 13px 14px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.settings-summary article > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-800); background: var(--green-100); border-radius: 10px; font-size: 14px; }
.settings-summary article > div { display: grid; gap: 2px; }
.settings-summary strong { font-size: 19px; letter-spacing: -.03em; }
.settings-summary small { color: var(--muted); font-size: 8px; }
.settings-definition-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.settings-definition-card .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.directory-metric { display: grid; justify-items: center; gap: 2px; min-width: 45px; padding: 7px; color: var(--green-800); background: var(--green-50); border-radius: 9px; }
.directory-metric strong { font-size: 14px; }
.directory-metric small { color: var(--muted); font-size: 8px; }
.directory-role { padding: 5px 8px; color: #2f6fae; background: var(--blue-soft); border-radius: 999px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.directory-role.role--admin { color: #8a5a18; background: var(--gold-soft); }
.directory-role.role--finance { color: #6c4f8f; background: #f0e9f8; }
.directory-role.role--viewer { color: #697774; background: #edf1f0; }
.directory-side { display: grid; justify-items: end; gap: 6px; }
.directory-actions { display: flex; align-items: center; gap: 5px; }
.directory-edit { min-height: 27px; padding: 0 8px; color: var(--green-800); background: white; border: 1px solid #d3dfdc; border-radius: 7px; font-size: 8px; font-weight: 750; white-space: nowrap; }
.directory-edit:hover { background: var(--green-50); border-color: #abc8c0; }
.directory-delete { min-height: 27px; padding: 0 8px; color: var(--red); background: white; border: 1px solid #ead2cf; border-radius: 7px; font-size: 8px; font-weight: 750; white-space: nowrap; }
.directory-delete:hover { background: var(--red-soft); border-color: #dfaaa4; }
.login-badge { width: max-content; max-width: 100%; padding: 4px 7px; color: #788784; background: #edf1f0; border-radius: 999px; font-size: 8px !important; font-weight: 800; }
.login-badge.is-enabled { color: var(--green-800); background: var(--green-100); }

.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(6, 29, 26, .54); backdrop-filter: blur(3px); }
.modal { width: min(100%, 720px); max-height: calc(100vh - 40px); overflow-y: auto; background: white; border: 1px solid rgba(255,255,255,.6); border-radius: 18px; box-shadow: 0 28px 80px rgba(6,29,26,.28); }
.modal--large { width: min(100%, 920px); }
.modal--small { width: min(100%, 520px); }
.modal-header, .drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 19px; border-bottom: 1px solid var(--line); }
.modal-header h2, .drawer-header h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.03em; }
.modal-header > div > span, .drawer-header > div > span { color: var(--muted); font-size: 11px; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: #758481; background: #f2f6f5; border: 0; border-radius: 9px; font-size: 23px; line-height: 1; }
.modal-close:hover { color: var(--ink); background: #e9efed; }
.form-section { padding: 20px 24px; border-bottom: 1px solid var(--soft-line); }
.form-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.form-section-title > span { width: 25px; height: 25px; display: grid; place-items: center; color: white; background: var(--green-700); border-radius: 8px; font-size: 11px; font-weight: 850; }
.form-section-title > div { display: grid; gap: 2px; }
.form-section-title strong { font-size: 12px; }
.form-section-title small { color: var(--muted); font-size: 9px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px 24px; }
.form-section .form-grid { padding: 0; }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-grid--4 { grid-template-columns: repeat(4, 1fr); }
.field { min-width: 0; display: grid; align-content: start; gap: 6px; }
.field > span { color: #4e605d; font-size: 10px; font-weight: 750; }
.field-note { color: #7b8b88; font-size: 8px; font-weight: 500; line-height: 1.4; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #d7e1df; border-radius: 9px; outline: none; font-size: 11px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #72a698; box-shadow: 0 0 0 3px rgba(60,129,112,.1); }
.field--wide { grid-column: span 2; }
.field--full { grid-column: 1 / -1; }
.patient-picker-field { position: relative; z-index: 20; }
.patient-combobox { position: relative; }
.patient-combobox .patient-search-input { min-height: 48px; padding: 11px 40px 11px 14px; border-color: #cbd9d6; font-size: 13px; font-weight: 650; }
.patient-combobox.is-open .patient-search-input { border-color: #5c9b8c; box-shadow: 0 0 0 4px rgba(60,129,112,.12); }
.patient-search-chevron { position: absolute; top: 50%; right: 14px; color: #6f827e; font-size: 18px; pointer-events: none; transform: translateY(-52%); transition: transform .16s ease; }
.patient-combobox.is-open .patient-search-chevron { transform: translateY(-48%) rotate(180deg); }
.patient-search-menu { position: absolute; top: calc(100% + 9px); right: 0; left: 0; z-index: 60; max-height: 350px; overflow-y: auto; padding: 10px; background: white; border: 1px solid #d3dddb; border-radius: 14px; box-shadow: 0 22px 48px rgba(15, 45, 40, .2); overscroll-behavior: contain; }
.patient-search-option { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; align-items: center; gap: 11px; margin: 0 0 7px; padding: 11px 12px; color: var(--ink); text-align: left; background: #f5f7f8; border: 1px solid transparent; border-radius: 11px; }
.patient-search-option:last-child { margin-bottom: 0; }
.patient-search-option:hover, .patient-search-option:focus-visible { background: #edf5f2; border-color: #b8d5ce; outline: none; }
.patient-search-option.is-selected { background: var(--green-100); border-color: #9cc8bd; }
.patient-search-option--new { background: #eef4f2; }
.patient-search-option--new strong { color: var(--green-800); }
.patient-search-option > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.patient-search-option strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.patient-search-option small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.patient-search-option > i { color: #8b9a97; font-size: 17px; font-style: normal; text-align: right; }
.patient-search-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: var(--green-800); background: white; border: 1px solid #d7e2df; border-radius: 10px; font-size: 10px; font-weight: 850; }
.patient-search-option--new .patient-search-avatar { color: white; background: var(--green-700); border-color: var(--green-700); font-size: 17px; }
.patient-search-empty { display: grid; gap: 3px; margin: 0 0 7px; padding: 13px; color: #677773; background: #fbfcfc; border: 1px dashed #ccd8d5; border-radius: 11px; }
.patient-search-empty strong { font-size: 11px; }
.patient-search-empty small { font-size: 9px; }
.money-input { position: relative; }
.money-input input { padding-right: 48px; }
.money-input b { position: absolute; right: 11px; top: 50%; color: var(--muted); font-size: 10px; transform: translateY(-50%); }
.form-hint { margin: 13px 0 0; padding: 9px 11px; color: #677773; background: #f5f8f7; border-radius: 8px; font-size: 9px; line-height: 1.5; }
.login-access { display: grid; gap: 12px; padding: 13px; background: #f7faf9; border: 1px solid var(--line); border-radius: 11px; }
.login-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.login-toggle > input { width: 18px; height: 18px; margin: 0; accent-color: var(--green-700); }
.login-toggle > span { display: grid; gap: 3px; }
.login-toggle strong { font-size: 11px; }
.login-toggle small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.login-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.login-fields .form-hint { grid-column: 1 / -1; margin: 0; }
.second-transfer-panel { padding: 0; overflow: hidden; }
.second-transfer-panel > summary { min-height: 70px; display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; gap: 11px; padding: 16px 24px; color: var(--green-900); background: #f3f9f7; cursor: pointer; list-style: none; }
.second-transfer-panel > summary::-webkit-details-marker { display: none; }
.second-transfer-panel > summary > span { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--green-700); border-radius: 10px; font-size: 17px; }
.second-transfer-panel > summary > div { display: grid; gap: 3px; }
.second-transfer-panel > summary strong { font-size: 12px; }
.second-transfer-panel > summary small { color: var(--muted); font-size: 9px; }
.second-transfer-panel > summary > i { color: var(--muted); font-size: 18px; font-style: normal; transition: transform .15s; }
.second-transfer-panel[open] > summary > i { transform: rotate(180deg); }
.second-transfer-panel.is-managed > summary { display: none; }
.second-transfer-panel.is-managed .second-transfer-content { border-top: 0; }
.second-transfer-content { padding: 18px 24px 22px; border-top: 1px solid var(--soft-line); }
.second-transfer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.second-transfer-heading > div { display: grid; gap: 3px; }
.second-transfer-heading strong { font-size: 12px; }
.second-transfer-heading small { color: var(--muted); font-size: 9px; }
.extra-transfer-manager { display: grid; gap: 14px; }
.extra-transfer-list { display: grid; gap: 14px; }
.extra-transfer-card { padding: 18px; background: #f8fbfa; border: 1px solid #dce9e6; border-radius: 13px; }
.extra-transfer-card .second-transfer-heading { margin-bottom: 14px; }
.add-extra-transfer-button { width: 100%; min-height: 44px; border-style: dashed; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 17px 24px; background: #fbfcfc; border-radius: 0 0 18px 18px; }
.delete-warning { display: flex; align-items: flex-start; gap: 12px; margin: 20px 24px; padding: 15px; color: #71332d; background: var(--red-soft); border: 1px solid #efccc8; border-radius: 11px; }
.delete-warning > span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--red); border-radius: 8px; font-weight: 850; }
.delete-warning > div { min-width: 0; display: grid; gap: 5px; }
.delete-warning strong { overflow-wrap: anywhere; font-size: 12px; }
.delete-warning p { margin: 0; color: #87514c; font-size: 10px; line-height: 1.5; }

.drawer-backdrop { justify-content: flex-end; padding: 0; }
.drawer { width: min(100%, 520px); height: 100%; overflow-y: auto; background: white; box-shadow: -20px 0 60px rgba(6,29,26,.22); animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(30px); opacity: .6; } }
.drawer-header { position: sticky; top: 0; z-index: 2; background: white; }
.drawer-actions { display: flex; align-items: center; gap: 7px; }
#drawer-content { padding: 20px 24px 40px; }
.drawer-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 23px; }
.info-box { min-height: 58px; display: grid; align-content: center; gap: 4px; padding: 10px 12px; background: var(--canvas); border: 1px solid var(--soft-line); border-radius: 10px; }
.info-box small { color: var(--muted); font-size: 9px; }
.info-box strong { font-size: 11px; }
.drawer-section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.drawer-section-title h3 { margin: 0; font-size: 13px; }
.timeline { position: relative; display: grid; gap: 11px; }
.timeline::before { content: ""; position: absolute; left: 12px; top: 20px; bottom: 20px; width: 1px; background: #cfddda; }
.timeline-item { position: relative; margin-left: 32px; padding: 13px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.timeline-item::before { content: ""; position: absolute; left: -26px; top: 18px; width: 9px; height: 9px; background: var(--green-700); border: 4px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #c6d7d3; }
.timeline-item__top { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 7px; }
.timeline-actions { display: flex; align-items: center; gap: 5px; }
.timeline-item h4 { margin: 0; font-size: 11px; }
.timeline-item p { margin: 4px 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.timeline-money { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--soft-line); color: var(--muted); font-size: 9px; }
.timeline-money strong { color: var(--ink); }
.mini-payments { display: grid; gap: 6px; margin-top: 10px; }
.mini-payment { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; background: var(--canvas); border-radius: 8px; font-size: 9px; }
.mini-payment > div { display: grid; gap: 2px; }
.mini-payment span { color: var(--muted); }
.logistics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.logistics-card { padding: 10px; background: #f8fbfa; border: 1px solid var(--soft-line); border-radius: 10px; }
.logistics-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--soft-line); }
.logistics-card header > span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-800); background: var(--green-100); border-radius: 8px; font-size: 12px; }
.logistics-card header > div { min-width: 0; display: grid; gap: 2px; }
.logistics-card header strong { font-size: 10px; }
.logistics-card header small { color: var(--muted); font-size: 8px; }
.logistics-line { display: grid; grid-template-columns: 42px 1fr; gap: 7px; padding: 5px 0; }
.logistics-line > b { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.logistics-line > div { min-width: 0; display: grid; gap: 2px; }
.logistics-line strong { overflow-wrap: anywhere; font-size: 9px; }
.logistics-line span { color: var(--muted); font-size: 8px; line-height: 1.35; overflow-wrap: anywhere; }

.activity-accordion { margin-top: 24px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.activity-accordion > summary { min-height: 65px; display: grid; grid-template-columns: 1fr auto 22px; align-items: center; gap: 10px; padding: 12px 14px; background: #f8fbfa; cursor: pointer; list-style: none; }
.activity-accordion > summary::-webkit-details-marker { display: none; }
.activity-accordion > summary > span { display: grid; gap: 3px; }
.activity-accordion > summary b { font-size: 12px; }
.activity-accordion > summary small { color: var(--muted); font-size: 8px; }
.activity-accordion > summary > strong { min-width: 27px; height: 27px; display: grid; place-items: center; color: var(--green-800); background: var(--green-100); border-radius: 8px; font-size: 10px; }
.activity-accordion > summary > i { color: var(--muted); font-size: 17px; font-style: normal; transition: transform .15s; }
.activity-accordion[open] > summary > i { transform: rotate(180deg); }
.activity-content { padding: 13px; border-top: 1px solid var(--soft-line); }
.activity-list { display: grid; gap: 0; }
.activity-item { position: relative; display: grid; grid-template-columns: 31px 1fr; gap: 10px; padding: 11px 2px; }
.activity-item:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 42px; bottom: -2px; width: 1px; background: #d7e2df; }
.activity-icon { width: 31px; height: 31px; display: grid; place-items: center; position: relative; z-index: 1; color: var(--green-700); background: var(--green-100); border-radius: 9px; font-size: 10px; font-weight: 850; }
.activity-item--call .activity-icon { color: var(--blue); background: var(--blue-soft); }
.activity-item--whatsapp .activity-icon { color: #277a65; background: #dcf3e9; }
.activity-item--payment .activity-icon { color: var(--gold); background: var(--gold-soft); }
.activity-item--document .activity-icon { color: #6c4f8f; background: #f0e9f8; }
.activity-item > div { min-width: 0; display: grid; gap: 3px; }
.activity-item strong { font-size: 10px; }
.activity-item p { margin: 0; color: #53635f; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.activity-item time { color: #8a9896; font-size: 8px; }
.activity-empty { display: grid; gap: 4px; padding: 20px 10px; color: var(--muted); text-align: center; }
.activity-empty strong { color: var(--ink); font-size: 10px; }
.activity-empty span { font-size: 8px; }

.toast-region { position: fixed; z-index: 120; right: 22px; bottom: 22px; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 380px; display: flex; align-items: flex-start; gap: 9px; padding: 13px 15px; color: white; background: var(--green-900); border-radius: 11px; box-shadow: 0 14px 35px rgba(6,29,26,.25); animation: toast-in .2s ease-out; }
.toast.is-error { background: #84362f; }
.toast strong { font-size: 12px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.auth-body { min-height: 100vh; background: #eaf1ef; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(370px, .9fr) minmax(480px, 1.1fr); }
.auth-brand-panel { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(32px, 5vw, 72px); color: white; background: radial-gradient(circle at 20% 15%, rgba(100,181,159,.24), transparent 34%), linear-gradient(145deg, #0d302b, #123c36 58%, #185046); }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand > div { display: grid; gap: 3px; }
.auth-brand strong { font-size: 21px; letter-spacing: -.025em; }
.auth-brand small { color: #9ab5ae; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.auth-brand-copy { max-width: 560px; }
.auth-brand-copy p { margin: 0 0 12px; color: #9ed8c8; font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.auth-brand-copy h1 { margin: 0 0 17px; font-size: clamp(34px, 4.4vw, 62px); line-height: 1.02; letter-spacing: -.055em; }
.auth-brand-copy > span { max-width: 520px; display: block; color: #b8ccc7; font-size: 14px; line-height: 1.7; }
.auth-security-note { max-width: 460px; display: flex; align-items: flex-start; gap: 11px; padding: 14px; color: #c9d9d5; background: rgba(255,255,255,.055); border: 1px solid rgba(158,216,200,.17); border-radius: 12px; }
.auth-security-note > span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-950); background: #9ed8c8; border-radius: 8px; font-weight: 850; }
.auth-security-note > div { display: grid; gap: 4px; }
.auth-security-note strong { font-size: 11px; }
.auth-security-note small { color: #9fb8b2; font-size: 9px; line-height: 1.5; }
.auth-form-panel { min-height: 100vh; display: grid; place-items: center; padding: 34px; background: white; }
.auth-form-wrap { width: min(100%, 440px); }
.auth-form-wrap h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.045em; }
.auth-description { margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-form { display: grid; gap: 14px; }
.auth-form .field > span { font-size: 10px; }
.auth-form .field input { min-height: 47px; font-size: 12px; }
.auth-submit { width: 100%; min-height: 48px; margin-top: 4px; }
.auth-submit > span { margin-left: auto; font-size: 18px; }
.auth-error { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; padding: 11px 12px; color: #7b322c; background: var(--red-soft); border: 1px solid #efc8c4; border-radius: 10px; }
.auth-error > span { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--red); border-radius: 7px; font-weight: 850; }
.auth-error strong { font-size: 10px; line-height: 1.45; }
.auth-help { margin: 17px 0 0; color: #899692; font-size: 9px; line-height: 1.5; text-align: center; }

@media (max-width: 1180px) {
    .planner-layout { grid-template-columns: 1fr; }
    .agenda-card { min-height: 430px; }
    .calendar-card { min-height: 540px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .patient-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar { align-items: flex-start; }
    .top-actions { flex-wrap: wrap; justify-content: flex-end; }
    .search-box { width: 280px; }
    .form-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filter-card { grid-template-columns: 1fr 1fr; align-items: start; }
    .report-filter-intro { grid-column: 1 / -1; }
    .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .custom-period-panel { grid-template-columns: 1fr 1fr; }
    .custom-period-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
}

@media (max-width: 850px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { min-height: auto; padding: 28px; }
    .auth-brand-copy h1 { font-size: 35px; }
    .auth-security-note { display: none; }
    .auth-form-panel { min-height: auto; padding: 40px 22px; }
    .sidebar { width: min(86vw, 320px); transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: 15px 0 45px rgba(6,29,26,.25); }
    .sidebar.is-open { transform: translateX(0); }
    .mobile-nav-backdrop { position: fixed; inset: 0; z-index: 25; display: block; padding: 0; background: rgba(6,29,26,.48); border: 0; backdrop-filter: blur(2px); }
    body.mobile-menu-open { overflow: hidden; }
    .main-content { margin-left: 0; }
    .mobile-menu { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-900); background: var(--green-50); border: 1px solid #cee1dc; border-radius: 10px; }
    .topbar { min-height: auto; flex-wrap: wrap; padding: 17px 20px; }
    .page-heading { flex: 1; }
    .top-actions { width: 100%; justify-content: stretch; }
    .search-box { width: auto; flex: 1; }
    .content-wrap { padding: 18px 20px 30px; }
    .patient-grid, .team-grid, .directory-grid { grid-template-columns: 1fr; }
    .logistics-summary { grid-template-columns: 1fr; }
    .report-filter-card { grid-template-columns: 1fr; }
    .report-filter-intro { grid-column: auto; }
    .report-segmented { overflow-x: auto; }
    .report-segmented button { min-width: 92px; }
    .settings-definition-card .directory-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
    body { font-size: 11px; }
    .app-shell, .main-content, .topbar, .content-wrap, .view-panel, .card, .data-card, .table-scroll, form, details { min-width: 0; max-width: 100%; }
    .main-content { width: 100%; }
    .topbar { gap: 12px; }
    .page-heading, .top-actions, .search-box, .card-header > div, .report-filter-card > *, .form-section, .form-grid, .field { min-width: 0; max-width: 100%; }
    .auth-brand-panel { gap: 26px; padding: 23px 20px 27px; }
    .auth-brand-copy h1 { font-size: 27px; }
    .auth-brand-copy > span { font-size: 11px; }
    .auth-form-panel { padding: 32px 18px; }
    .auth-form-wrap h2 { font-size: 23px; }
    .brand-mark { width: 38px; height: 38px; font-size: 19px; }
    .brand-copy strong { font-size: 15px; }
    .brand-copy small { font-size: 9px; }
    .nav-label { font-size: 8px; }
    .nav-item { min-height: 46px; font-size: 10px; }
    .profile-row strong { font-size: 10px; }
    .profile-row small { font-size: 9px; }
    .page-heading p, .page-heading > span { display: none; }
    .page-heading h1 { font-size: 17px; }
    .section-kicker { font-size: 8px; }
    .top-actions { display: grid; grid-template-columns: 1fr; }
    .primary-button { width: 100%; }
    .content-wrap { padding: 14px 12px 28px; }
    .demo-banner, .view-toolbar, .card-header { align-items: flex-start; flex-direction: column; }
    .planner-layout { gap: 11px; }
    .agenda-card { min-height: 420px; }
    .calendar-card { min-height: 510px; }
    .agenda-item { grid-template-columns: 44px 1fr 20px; }
    .agenda-treatment { grid-column: 2; }
    .agenda-arrow { grid-column: 3; grid-row: 1 / span 2; }
    .agenda-footer { align-items: stretch; flex-direction: column; }
    .agenda-footer span { text-align: left; }
    .calendar-top { grid-template-columns: 36px 1fr auto; padding: 11px; }
    .calendar-top .calendar-today { display: none; }
    .calendar-scroll { overflow: visible; }
    .calendar-weekdays, .calendar-grid { min-width: 0; }
    .calendar-weekdays span { padding: 8px 2px; font-size: 7px; }
    .calendar-day { min-height: 58px; padding: 5px; }
    .calendar-day time { width: 22px; height: 22px; }
    .calendar-day-top b, .day-indicators strong { display: none; }
    .day-marker:nth-of-type(n+4) { display: none; }
    .calendar-footer { flex-wrap: wrap; }
    .calendar-footer strong { width: 100%; margin-left: 0; }
    .period-tabs { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
    .period-tabs button { min-width: 0; padding: 0 7px; font-size: 10px; white-space: nowrap; }
    .period-toolbar-side { width: 100%; justify-content: stretch; }
    .date-range { width: 100%; justify-content: center; font-size: 9px; }
    .custom-period-panel { width: 100%; grid-template-columns: 1fr; padding: 15px; }
    .custom-period-panel__header { grid-column: auto; align-items: flex-start; }
    .custom-period-panel__header h2 { font-size: 15px; }
    .custom-period-panel__header div > span { display: block; line-height: 1.45; }
    .custom-period-fields { grid-template-columns: 1fr; }
    .custom-period-arrow { width: 100%; height: 18px; transform: rotate(90deg); }
    .custom-period-presets > div { grid-template-columns: 1fr 1fr; }
    .custom-period-actions { grid-column: auto; display: grid; }
    .custom-period-actions > div:last-child { display: grid; grid-template-columns: 1fr 1.35fr; }
    .custom-period-actions .primary-button, .custom-period-actions .ghost-button { width: 100%; padding: 0 8px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { min-height: 104px; padding: 14px; }
    .stat-card--wide { grid-column: 1 / -1; }
    .stat-card small { font-size: 9px; }
    .stat-card strong { font-size: 17px; }
    .stat-card p { font-size: 8px; }
    .legend { display: none; }
    .patient-grid { grid-template-columns: 1fr; padding: 12px; }
    .payment-summary, .logistics-summary { grid-template-columns: 1fr; }
    .report-filter-card { padding: 16px; }
    .report-segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .report-segmented button { min-width: 0; padding: 0 7px; white-space: normal; line-height: 1.25; }
    .report-summary { grid-template-columns: 1fr 1fr; gap: 9px; }
    .report-summary-card { min-height: 106px; padding: 14px; }
    .report-summary-card > span { width: 32px; height: 32px; }
    .report-summary-card small { font-size: 8px; }
    .report-summary-card strong { font-size: 16px; }
    .operations-report-summary { grid-template-columns: 1fr 1fr; gap: 9px; }
    .operation-summary-card { min-height: 98px; padding: 13px; }
    .settings-hero { min-height: 0; padding: 20px; }
    .settings-hero__icon { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; }
    .settings-summary { grid-template-columns: 1fr 1fr; }
    .form-grid, .form-grid--3, .form-grid--4, .logistics-grid { grid-template-columns: 1fr; }
    .login-fields { grid-template-columns: 1fr; }
    .login-fields .form-hint { grid-column: auto; }
    .field--wide { grid-column: auto; }
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal { max-height: 94dvh; border-radius: 18px 18px 0 0; overscroll-behavior: contain; }
    .modal-header { position: sticky; top: 0; z-index: 4; background: white; }
    .modal-header, .form-section, .modal-footer { padding-left: 17px; padding-right: 17px; }
    .modal-footer { position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); padding-top: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-radius: 0; }
    .modal-footer > button { width: 100%; min-width: 0; padding: 0 9px; }
    .modal > form > .form-grid { padding-left: 17px; padding-right: 17px; }
    .card-header h2 { font-size: 14px; }
    .card-header > div > span { font-size: 9px; }
    .payment-summary-card strong { font-size: 16px; }
    .travel-summary-card strong { font-size: 17px; }
    .operation-summary-card strong { font-size: 17px; }
    .modal-header h2, .drawer-header h2 { font-size: 16px; }
    .field input, .field select, .field textarea, .search-box input, .custom-period-fields input, .patient-combobox .patient-search-input, .report-mobile-filters select { min-width: 0; max-width: 100%; font-size: 16px; }
    input[type="date"], input[type="datetime-local"], input[type="time"] { width: 100%; min-width: 0; max-width: 100%; }
    .patient-search-menu { position: fixed; top: 82px; right: 12px; bottom: 12px; left: 12px; max-height: none; }
    .drawer { width: 100%; overscroll-behavior: contain; }
    .drawer-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px 14px; }
    .drawer-header > div:first-child { min-width: 0; }
    .drawer-header h2, .drawer-header > div > span { overflow-wrap: anywhere; }
    .drawer-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 40px; }
    .drawer-actions .row-button { width: 100%; min-height: 38px; }
    #drawer-content { padding: 14px 12px 32px; }
    .drawer-contact { grid-template-columns: 1fr; }
    .timeline { gap: 9px; }
    .timeline::before { left: 7px; }
    .timeline-item { margin-left: 20px; padding: 11px; }
    .timeline-item::before { left: -19px; }
    .timeline-item__top { align-items: flex-start; flex-direction: column; }
    .timeline-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .timeline-actions .row-button { width: 100%; min-height: 36px; }
    .mini-payment { align-items: flex-start; flex-direction: column; }
    .activity-accordion > summary { grid-template-columns: minmax(0, 1fr) auto 18px; }

    .table-scroll { overflow: visible; }
    .data-table { width: 100%; min-width: 0; max-width: 100%; display: block; border-collapse: separate; }
    .data-table thead { display: none; }
    .data-table tbody { display: grid; gap: 10px; padding: 10px; }
    .data-table tbody tr { min-width: 0; display: block; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 12px rgba(21,55,49,.045); }
    .data-table tbody tr:hover { background: white; }
    .data-table td { min-width: 0; display: grid; grid-template-columns: minmax(80px, .7fr) minmax(0, 1.3fr); align-items: start; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--soft-line); font-size: 9px; text-align: right; }
    .data-table td::before { content: attr(data-label); color: #778582; font-size: 8px; font-weight: 850; letter-spacing: .055em; line-height: 1.4; text-align: left; text-transform: uppercase; }
    .data-table td:last-child { border-bottom: 0; }
    .data-table td[colspan] { display: block; padding: 24px 12px !important; text-align: center; }
    .data-table td[colspan]::before { display: none; }
    .data-table .patient-cell, .data-table .report-source-cell { min-width: 0; justify-content: flex-end; text-align: left; }
    .data-table .cell-stack { min-width: 0; justify-items: end; text-align: right; }
    .data-table .cell-stack strong, .data-table .cell-stack small { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
    .data-table .patient-cell .cell-stack, .data-table .report-source-cell .cell-stack { justify-items: start; text-align: left; }
    .data-table .row-actions { flex-wrap: wrap; }
    .data-table .row-button { min-height: 36px; }
    .data-table .report-source-toggle, .data-table .operation-row-toggle { min-width: 0; justify-content: flex-end; }
    .data-table .report-source-toggle > span:first-child, .data-table .operation-row-toggle > span:first-child { min-width: 0; }
    .loading-cell, .empty-cell { padding: 28px 14px !important; }

    .report-source-detail-row, .operation-detail-row { overflow: visible !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
    .report-source-detail-row > td, .operation-detail-row > td { padding: 0 !important; background: transparent; }
    .report-source-detail, .operation-detail-panel { min-width: 0; padding: 11px; border-radius: 11px; }
    .report-source-detail__head { align-items: flex-start; flex-direction: column; gap: 5px; }
    .report-patient-item, .operation-person-item, .operation-person-item--hotel, .operation-person-item--transfer { min-width: 0; display: grid; grid-template-columns: 1fr; align-items: start; gap: 9px; padding: 11px; }
    .report-patient-item > *, .operation-person-item > * { min-width: 0; }
    .report-patient-item .cell-stack, .operation-person-item .cell-stack { justify-items: start; text-align: left; }
    .report-patient-item .row-button, .operation-person-item .row-button { width: 100%; min-height: 38px; }
    .operation-status-list { min-width: 0; justify-content: flex-end; }

    .sales-report-filter, .operations-report-filter { gap: 11px; padding: 12px; }
    .sales-report-filter .report-filter-intro, .operations-report-filter .report-filter-intro { padding: 0 2px 10px; border-bottom: 1px solid var(--soft-line); }
    .sales-report-filter .report-filter-intro h2, .operations-report-filter .report-filter-intro h2 { margin: 0; font-size: 13px; }
    .sales-report-filter .report-filter-intro > span, .operations-report-filter .report-filter-intro > span { display: none; }
    .sales-report-filter .report-filter-group, .operations-report-filter .report-filter-group { display: none; }
    .sales-report-filter .report-mobile-filters, .operations-report-filter .report-mobile-filters { display: grid; gap: 9px; }
    .report-mobile-filters label { position: relative; min-width: 0; display: grid; gap: 6px; padding: 9px; background: #f4f8f7; border: 1px solid #dce7e4; border-radius: 12px; }
    .report-mobile-filters label::after { content: "⌄"; position: absolute; right: 21px; bottom: 23px; z-index: 1; color: var(--green-700); font-size: 15px; font-weight: 850; line-height: 1; pointer-events: none; }
    .report-mobile-filters label > span { padding-left: 2px; color: #61736f; font-size: 8px; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
    .report-mobile-filters select { width: 100%; min-height: 44px; padding: 0 38px 0 11px; color: var(--ink); appearance: none; -webkit-appearance: none; background: white; border: 1px solid #cbdad6; border-radius: 9px; outline: none; font-size: 16px; font-weight: 650; }
    .report-mobile-filters select:focus { border-color: #6fa897; box-shadow: 0 0 0 3px rgba(59,127,108,.11); }
    .report-mobile-hint { display: block !important; margin-top: 8px; padding: 8px 10px; color: var(--green-800) !important; background: var(--green-50); border-radius: 8px; font-size: 9px !important; line-height: 1.4; }

    #report-summary { gap: 8px; }
    #report-summary .report-summary-card { min-height: 91px; gap: 9px; padding: 12px; }
    #report-summary .report-summary-card > span { width: 29px; height: 29px; }
    #report-summary .report-summary-card strong { font-size: 16px; }
    #report-summary .report-summary-card p { font-size: 8px; }

    .report-source-table tbody { gap: 12px; }
    .report-source-table .report-source-summary-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-source-table .report-source-summary-row > td:first-child { grid-column: 1 / -1; display: block; padding: 13px; background: #f1f8f6; border-bottom: 1px solid #d7e7e2; text-align: left; }
    .report-source-table .report-source-summary-row > td:first-child::before { display: none; }
    .report-source-table .report-source-summary-row > td:not(:first-child) { display: flex; align-items: flex-start; flex-direction: column; gap: 5px; padding: 10px; background: white; text-align: left; }
    .report-source-table .report-source-summary-row > td:not(:first-child)::before { min-height: 22px; display: block; }
    .report-source-table .report-source-summary-row > td:nth-child(even) { border-right: 1px solid var(--soft-line); }
    .report-source-table .report-source-summary-row > td:nth-last-child(-n+2) { border-bottom: 0; }
    .report-source-table .report-source-summary-row .cell-stack { justify-items: start; text-align: left; }
    .report-source-table .report-money-stack { white-space: normal; overflow-wrap: anywhere; }
    .report-source-table .report-source-toggle { min-height: 46px; justify-content: space-between; }
    .report-source-table .report-expand-icon { width: 32px; height: 32px; }
    .report-source-table .report-number { min-width: 32px; height: 32px; }

    .report-detail-summary { min-height: 0; align-items: center; flex-direction: row; padding: 14px; }
    .report-detail-summary > div { min-width: 0; }
    .report-detail-summary h2 { font-size: 14px; }
    .report-detail-summary > div > span { display: none; }
    .report-detail-toggle { margin-left: auto; }
    .report-detail-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-detail-table tbody tr > td { display: flex; align-items: flex-start; flex-direction: column; gap: 5px; text-align: left; }
    .report-detail-table tbody tr > td:nth-child(-n+3), .report-detail-table tbody tr > td:last-child, .report-detail-table tbody tr > td[colspan] { grid-column: 1 / -1; }
    .report-detail-table tbody tr > td:nth-child(even) { border-right: 1px solid var(--soft-line); }
    .report-detail-table tbody tr > td:nth-last-child(2) { border-bottom: 0; }
    .report-detail-table .patient-cell, .report-detail-table .cell-stack { justify-content: flex-start; justify-items: start; text-align: left; }
    .report-detail-table .row-button { width: 100%; }

    .second-transfer-heading { align-items: stretch; flex-direction: column; }
    .second-transfer-heading .row-button { width: 100%; min-height: 38px; white-space: normal; }
    .extra-transfer-card { min-width: 0; padding: 13px; }
    .money-stack, .report-money-stack, .timeline-money, .logistics-line strong, .logistics-line span { max-width: 100%; overflow-wrap: anywhere; }

    .directory-grid { padding: 12px; }
    .directory-item { align-items: flex-start; flex-wrap: wrap; }
    .directory-item__body strong, .directory-item__body span { white-space: normal; overflow-wrap: anywhere; }
    .directory-side { width: 100%; display: flex; align-items: center; justify-content: space-between; padding-left: 54px; }
    .directory-actions { flex-wrap: wrap; justify-content: flex-end; }
    .settings-hero { align-items: flex-start; }
    .settings-hero > div { min-width: 0; }
    .settings-hero h2 { font-size: 18px; }
    .settings-summary strong { font-size: 17px; }
    .toast-region { right: 12px; bottom: 12px; left: 12px; }
    .toast { min-width: 0; width: 100%; }
}

@media (max-width: 410px) {
    .topbar { gap: 12px; padding: 13px 12px; }
    .page-heading h1 { font-size: 17px; }
    .stats-grid, .report-summary, .operations-report-summary, .settings-summary { grid-template-columns: 1fr; }
    #report-summary { grid-template-columns: 1fr; }
    .stat-card, .report-summary-card, .operation-summary-card { min-height: 86px; }
    .calendar-day { min-height: 52px; }
    .calendar-footer { gap: 8px; }
    .custom-period-presets > div { grid-template-columns: 1fr; }
    .custom-period-actions > div:last-child { grid-template-columns: 1fr; }
    .modal-footer { grid-template-columns: 1fr; }
    .settings-hero__icon { display: none; }
    .directory-side { padding-left: 0; }
}

@media (max-width: 360px) {
    .period-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid { grid-template-columns: 1fr; }
    .report-source-table .report-source-summary-row, .report-detail-table tbody tr { grid-template-columns: 1fr; }
    .report-source-table .report-source-summary-row > td, .report-detail-table tbody tr > td { grid-column: 1 / -1; border-right: 0 !important; }
    .drawer-actions { grid-template-columns: 1fr 1fr; }
    .drawer-actions .modal-close { grid-column: 1 / -1; width: 100%; }
}
