:root {
  --navy-950: #000f33;
  --navy-900: #0a1b43;
  --navy-800: #1a2f4f;
  --blue: #225af2;
  --blue-dark: #1d4ed8;
  --blue-light: #4e7bf5;
  --blue-soft: #eef3ff;
  --ice: #eff7fa;
  --sky: #b4e1f1;
  --logo-dot: #f2ff86;
  --ink: #0a1b43;
  --muted: #68778b;
  --line: #e8e8e8;
  --surface: #ffffff;
  --canvas: #f3f5f7;
  --danger: #f95d51;
  --danger-soft: #fff1ee;
  --success: #278a74;
  --shadow: 0 14px 40px rgba(0, 15, 51, 0.08);
  --radius: 20px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px; display: flex; flex-direction: column; color: var(--navy-950); background: rgba(255,255,255,.96); border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(0,15,51,.035); z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; width: fit-content; }
.brand-mark { width: 45px; aspect-ratio: 1; border-radius: 15px; background: #e8e8e8; display: grid; place-items: center; transform: rotate(30deg); }
.brand-mark::before { content: ""; width: 27px; height: 27px; border-radius: 50%; background: var(--blue); display: block; }
.brand-mark span { position: absolute; width: 12px; height: 12px; background: var(--logo-dot); border-radius: 50%; transform: translate(8px,-8px); }
.brand-copy { display: flex; align-items: flex-end; gap: 8px; }
.brand-copy strong { font-size: 18px; line-height: .8; letter-spacing: -.04em; }
.brand-copy small { color: var(--blue); font-size: 10px; letter-spacing: .16em; font-weight: 800; padding-bottom: 1px; }
.brand-dark { color: var(--navy-950); }
.brand-dark .brand-mark { background: #e1e4e8; }

.main-nav { margin: 46px 0 0; display: grid; gap: 6px; }
.main-nav a { display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 14px; border-radius: 12px; color: #5f6f85; font-weight: 650; font-size: 14px; transition: .18s ease; }
.main-nav a span { display: grid; place-items: center; width: 23px; color: #8794a6; font-size: 18px; }
.main-nav a:hover { color: var(--navy-950); background: #f2f4f7; }
.main-nav a[aria-current="page"] { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(34,90,242,.16); }
.main-nav a[aria-current="page"] span { color: #fff; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-chip > span { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.user-chip div { min-width: 0; display: grid; }
.user-chip b { max-width: 110px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.user-chip small { color: #8292ad; font-size: 10px; }
.link-button { border: 0; background: transparent; color: #8ea2c2; cursor: pointer; font-size: 12px; padding: 8px; }
.link-button:hover { color: var(--blue); }

.content-shell { min-width: 0; }
.main-content { width: min(1540px, 100%); margin: 0 auto; padding: 34px clamp(24px, 3vw, 52px) 64px; }
.mobile-header { display: none; }
.demo-banner { background: #e8f1ff; color: var(--blue); border-bottom: 1px solid #d7e5ff; text-align: center; padding: 6px 12px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; }
.page-header { min-height: 86px; margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-header h1 { margin: 3px 0 5px; font-size: clamp(32px, 4vw, 52px); line-height: .98; letter-spacing: -.055em; color: var(--navy-950); }
.page-header p:not(.eyebrow) { color: var(--muted); margin: 0; font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.back-link:hover { color: var(--blue); }
.title-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.button { min-height: 43px; padding: 0 17px; border: 1px solid transparent; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 750; font-size: 13px; cursor: pointer; transition: .18s ease; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(34,90,242,.2); }
.button-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.button-secondary { color: var(--navy-900); background: var(--blue-soft); }
.button-ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button-small { min-height: 34px; padding: 0 11px; border-radius: 10px; font-size: 11px; }
.button-wide { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.metric-card { min-height: 154px; position: relative; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 30px rgba(7,26,62,.035); overflow: hidden; }
.metric-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; font-size: 42px; line-height: 1; letter-spacing: -.05em; color: var(--navy-950); }
.metric-card small { display: block; margin-top: 7px; color: #98a3b5; font-size: 11px; }
.metric-icon { position: absolute; right: 16px; top: 16px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 850; }
.metric-accent { background: linear-gradient(145deg, var(--blue), var(--blue-light)); border-color: var(--blue); }
.metric-accent p, .metric-accent small { color: #dce7ff; }
.metric-accent strong { color: #fff; }
.metric-accent .metric-icon { color: var(--blue); background: #fff; }
.metric-warning { background: var(--danger-soft); border-color: #ffd8dc; }
.metric-warning .metric-icon { color: #fff; background: var(--danger); }

.finance-strip { display: grid; grid-template-columns: 1fr 1fr .75fr; border: 1px solid #dde8f3; border-radius: var(--radius); background: linear-gradient(135deg,#f4f7ff 0%,#eef7fa 100%); margin-bottom: 14px; overflow: hidden; }
.finance-strip-compact { grid-template-columns: 1fr 1fr; }
.finance-strip > div { min-height: 108px; padding: 19px 22px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid rgba(16,32,61,.08); }
.finance-strip > div:last-child { border-right: 0; }
.finance-strip p { margin: 0 0 8px; color: #5f6f85; font-size: 12px; }
.finance-strip strong { font-size: clamp(22px, 2.3vw, 31px); letter-spacing: -.04em; color: var(--navy-950); }
.finance-strip a { margin-top: 6px; color: var(--blue); font-size: 11px; font-weight: 800; }

.day-focus { margin-bottom: 14px; }
.day-focus .panel-header { align-items: center; }
.day-focus .panel-header small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.day-task-list { display: grid; }
.day-task { min-height: 65px; padding: 9px 0; display: grid; grid-template-columns: 82px minmax(180px,1fr) 82px auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.day-task:last-child { border-bottom: 0; }
.day-task-state { width: fit-content; padding: 5px 8px; border-radius: 20px; color: #57708f; background: #eef3f8; font-size: 9px; font-weight: 850; }
.day-task-danger .day-task-state { color: var(--danger); background: var(--danger-soft); }
.day-task-today .day-task-state { color: var(--blue); background: var(--blue-soft); }
.day-task-copy { min-width: 0; display: grid; }
.day-task-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy-950); font-size: 12px; }
.day-task-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.day-task time { color: var(--muted); font-size: 10px; font-weight: 800; }
.day-task-actions, .task-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.day-task-actions form, .task-row-actions form { margin: 0; }
.day-task-actions button, .day-task-actions a, .task-row-actions button, .task-row-actions a { min-height: 30px; padding: 0 9px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; cursor: pointer; font-size: 9px; font-weight: 800; }
.day-task-actions .is-primary, .task-row-actions .is-primary { color: var(--success); border-color: #cdeee3; background: #effbf7; }
.day-task-actions button:hover, .task-row-actions button:hover, .task-row-actions a:hover { color: var(--blue); border-color: #cfdcff; background: var(--blue-soft); }

.dashboard-grid, .detail-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 14px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 9px 30px rgba(7,26,62,.04); }
.panel-large { grid-column: span 1; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.panel-header h2, .panel > h2 { margin: 4px 0 0; color: var(--navy-950); font-size: 20px; letter-spacing: -.035em; }
.panel-header a { color: var(--blue); font-size: 12px; font-weight: 800; }
.count-badge { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 850; }

.surgery-days { display: grid; gap: 9px; }
.surgery-day { display: flex; align-items: center; gap: 14px; min-height: 67px; padding: 10px; border-radius: 15px; background: #f8fafc; }
.date-badge { flex: 0 0 45px; height: 48px; display: grid; align-content: center; place-items: center; border-radius: 12px; background: var(--navy-950); color: #fff; }
.date-badge strong { line-height: 1; font-size: 19px; }
.date-badge span { margin-top: 3px; color: var(--sky); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.surgery-day-main { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(0,1fr) minmax(100px, .5fr); align-items: center; gap: 16px; }
.surgery-day-main > div:first-child { min-width: 0; display: grid; }
.surgery-day-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.surgery-day-main small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.capacity span { display: block; margin-bottom: 6px; text-align: right; font-size: 11px; font-weight: 800; }
.progress { width: 100%; height: 6px; border-radius: 20px; background: #e5eaf0; overflow: hidden; }
.progress i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--blue-light)); }
.progress-large { height: 8px; }

.task-list, .timeline { display: grid; }
.task-row { min-height: 59px; padding: 10px 0; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row > div { min-width: 0; flex: 1; display: grid; }
.task-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.task-row small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.task-row time { color: var(--danger); font-size: 10px; font-weight: 800; }
.status-dot { flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.status-dot.danger { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.status-dot.positive { background: var(--success); box-shadow: 0 0 0 4px #e4f7f1; }
.date-mini { flex: 0 0 37px; height: 39px; border-radius: 11px; display: grid; align-content: center; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 850; line-height: 1; }
.date-mini small { margin-top: 3px; font-size: 7px; color: var(--blue); text-transform: uppercase; }
.empty-state { padding: 28px 14px; border: 1px dashed #d9e0e9; border-radius: 14px; color: var(--muted); text-align: center; font-size: 12px; }
.empty-state.positive { color: var(--success); background: #effbf7; border-color: #cdeee3; }

.compact-table { display: grid; }
.compact-row { min-height: 54px; padding: 8px 2px; display: grid; grid-template-columns: 100px minmax(120px,1fr) minmax(120px,.65fr) 84px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.compact-row:last-child { border-bottom: 0; }
.compact-row > b { color: var(--blue); }
.compact-row > small { color: var(--muted); text-align: right; }
.operation-row { grid-template-columns: 100px 1fr 120px 150px; }
.operation-row strong { text-align: right; color: var(--success); }
.bonus-panel { margin-top: 14px; }
.bonus-row { grid-template-columns: minmax(150px,1fr) 100px minmax(180px,1fr) 130px; }
.bonus-row strong { text-align: right; color: var(--blue); }
.table-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; }

.status-pill { width: fit-content; max-width: 100%; display: inline-flex; padding: 5px 8px; border-radius: 20px; background: #eef2f6; color: #58667d; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-new { background: var(--blue-soft); color: var(--blue); }
.status-considering, .status-postponed { background: #fff6d8; color: #a56b00; }
.status-preparation, .status-operation_booked { background: #e6faf5; color: var(--success); }
.status-completed, .status-closed { background: var(--navy-900); color: #fff; }
.status-refused, .status-no_response { background: var(--danger-soft); color: var(--danger); }

.filters { display: flex; gap: 10px; margin-bottom: 18px; }
.filters select, .search-field { min-height: 43px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
.search-field { flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 12px; }
.search-field span { color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filters select { min-width: 200px; padding: 0 12px; color: var(--ink); }

.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 11px 10px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; white-space: nowrap; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.data-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #f9fbfd; }
.data-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.data-table td a { color: var(--blue); }
.task-table { min-width: 760px; }
.task-table td:last-child { width: 260px; text-align: right; }
.task-result { max-width: 360px; margin: 7px 0 0; color: #465872; font-size: 10px; line-height: 1.4; }
.task-completion-summary { max-width: 960px; margin-bottom: 14px; }
.task-completion-summary small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.task-completion-summary h2 { margin: 6px 0 4px; }
.task-completion-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.task-is-complete { opacity: .68; }
.task-is-overdue { background: #fffafa; }
.danger-text { color: var(--danger) !important; font-weight: 800; }
.finance-table { min-width: 1100px; }
.finance-table td:not(:first-child) { white-space: nowrap; }
.finance-table td:last-child { color: var(--success); }

.record-form { max-width: 960px; }
.form-section h2 { margin: 4px 0 20px; font-size: 22px; letter-spacing: -.04em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: span 2; }
.field.is-hidden { display: none; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.field i { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #dce3ec; border-radius: 11px; outline: 0; background: #fafbfd; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field-error, .form-alert { color: var(--danger); font-size: 11px; }
.form-alert { padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); }
.field-help { color: var(--muted); font-size: 10px; line-height: 1.35; }
.privacy-callout { margin-top: 20px; padding: 16px 18px; border: 1px solid #dce7f5; border-radius: 15px; background: linear-gradient(135deg,#eef3ff,#eff7fa); color: #40546f; }
.privacy-callout b { color: var(--navy-950); font-size: 12px; }
.privacy-callout p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }
.duplicate-callout { margin-bottom: 20px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #f2d49a; border-radius: 15px; background: #fff9e8; color: #71501a; }
.duplicate-callout b { color: var(--navy-950); font-size: 13px; }
.duplicate-callout p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }
.tariff-callout { margin-top: 20px; padding: 16px 18px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; border: 1px solid #dce7f5; border-radius: 15px; background: #f7f9fc; }
.tariff-callout > div { display: grid; align-content: start; gap: 5px; }
.tariff-callout b { color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.tariff-callout strong { color: var(--navy-950); font-size: 18px; }
.tariff-callout small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.consultation-context { margin-bottom: 20px; display: grid; grid-template-columns: minmax(190px,.8fr) minmax(300px,1.7fr); gap: 1px; overflow: hidden; border: 1px solid #dce7f5; border-radius: 15px; background: #dce7f5; }
.consultation-context article { min-height: 112px; padding: 16px 18px; display: grid; align-content: start; background: #f7f9fc; }
.consultation-context article > span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.consultation-context strong { margin-top: 7px; color: var(--navy-950); font-size: 13px; }
.consultation-context p { margin: 6px 0 0; color: #465872; font-size: 10px; line-height: 1.5; }
.consultation-context a { width: fit-content; margin-top: 9px; color: var(--blue); font-size: 9px; font-weight: 800; }
.consultation-intake { background: #f1f6ff !important; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.button-danger { color: var(--danger); border: 1px solid #efc3ca; background: var(--danger-soft); box-shadow: none; }
.button-danger:hover { border-color: var(--danger); background: #fde9ec; }
.confirmation-task { display: grid; grid-template-columns: 9px minmax(0,1fr); align-items: start; padding: 14px 0; }
.confirmation-task > .status-dot { margin-top: 6px; }
.confirmation-task > .task-row-copy { display: grid; }
.inline-confirmation { grid-column: 2; min-width: 0; margin-top: 11px; padding: 12px; border: 1px solid #dce7f5; border-radius: 13px; background: #f8faff; }
.inline-confirmation-fields { display: grid; grid-template-columns: 120px 205px minmax(150px,1fr); gap: 8px; }
.inline-confirmation-fields label { min-width: 0; display: grid; gap: 5px; }
.inline-confirmation-fields label > span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.inline-confirmation-fields select, .inline-confirmation-fields input { width: 100%; min-height: 34px; padding: 6px 9px; border: 1px solid #dce3ec; border-radius: 9px; outline: 0; color: var(--navy-950); background: #fff; font-size: 10px; }
.inline-confirmation-fields select:focus, .inline-confirmation-fields input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.inline-confirmation-actions { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.inline-confirmation-actions button { min-height: 32px; padding: 0 11px; border: 1px solid #dce3ec; border-radius: 9px; color: #53657d; background: #fff; cursor: pointer; font-size: 9px; font-weight: 850; }
.inline-confirmation-actions button:hover { color: var(--blue); border-color: #cfdcff; background: var(--blue-soft); }
.inline-confirmation-actions .confirmation-success { color: var(--success); border-color: #bfe5d9; background: #effbf7; }
.inline-confirmation-actions .confirmation-danger { color: var(--danger); border-color: #f1c7cc; background: var(--danger-soft); }

.next-action { min-height: 92px; margin: 14px 0 22px; padding: 18px; display: flex; align-items: center; justify-content: space-between; border-radius: 16px; background: var(--navy-950); color: #fff; }
.next-action > div > p { margin: 0 0 5px; color: #9eacc2; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.next-action h2 { margin: 0; color: #fff; font-size: 20px; }
.next-action > div > span { display: block; margin-top: 6px; color: #aab7cc; font-size: 12px; }
.patient-summary { margin-bottom: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--line); }
.info-grid > div { min-height: 79px; padding: 14px; display: grid; align-content: center; background: #fff; }
.info-grid small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.info-grid b { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.timeline-row { min-height: 62px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.timeline-row:last-child { border-bottom: 0; }
.timeline-row > div { display: grid; }
.timeline-row > div { min-width: 0; flex: 1; }
.timeline-row b { font-size: 12px; }
.timeline-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.timeline-row p, .operation-main p { margin: 8px 0 0; color: #465872; font-size: 11px; line-height: 1.5; }
.timeline-row em { margin-top: 7px; color: var(--blue); font-size: 10px; font-style: normal; font-weight: 750; }
.section-heading { min-height: 42px; margin-bottom: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 4px 0 0; color: var(--navy-950); font-size: 20px; letter-spacing: -.035em; }
.timeline-link { margin-inline: -8px; padding-inline: 8px; border-radius: 11px; transition: background .16s ease; }
.timeline-link:hover { background: #f7f9fc; }
.row-arrow { color: var(--blue); font-size: 14px; font-weight: 800; }
.contact-icon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 900; }
.task-complete { width: 30px; height: 30px; border: 1px solid #cdeee3; border-radius: 9px; color: var(--success); background: #effbf7; cursor: pointer; font-weight: 900; }
.task-complete:hover { color: #fff; background: var(--success); }
.task-complete-wide { width: auto; min-width: 84px; padding-inline: 10px; }

.scope-tabs { display: flex; gap: 7px; margin: -4px 0 14px; overflow-x: auto; padding-bottom: 2px; }
.scope-tabs a { flex: 0 0 auto; min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 750; }
.scope-tabs a b { min-width: 20px; height: 20px; padding-inline: 5px; display: grid; place-items: center; border-radius: 7px; background: #eef2f6; color: var(--navy-900); font-size: 9px; }
.scope-tabs a[aria-current="page"] { color: #fff; background: var(--blue); border-color: var(--blue); }
.scope-tabs a[aria-current="page"] b { color: var(--blue); background: #fff; }

.journey { position: relative; display: grid; gap: 14px; margin-bottom: 14px; }
.journey::before { content: ""; position: absolute; left: 39px; top: 42px; bottom: 42px; width: 2px; background: #dce7ff; }
.journey-step { position: relative; padding-left: 24px; }
.journey-heading { min-height: 48px; display: flex; align-items: center; gap: 13px; margin-bottom: 10px; }
.journey-heading > span { position: relative; z-index: 1; flex: 0 0 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--blue); color: #fff; box-shadow: 0 0 0 6px #fff; font-size: 12px; font-weight: 900; }
.journey-heading > div { min-width: 0; flex: 1; }
.journey-heading h2 { margin: 3px 0 0; color: var(--navy-950); font-size: 19px; letter-spacing: -.035em; }
.journey-step .timeline { margin-left: 49px; }
.operation-card { min-height: 78px; padding: 12px 8px; display: grid; grid-template-columns: minmax(0,1fr) 170px 20px; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); border-radius: 11px; transition: background .16s ease; }
.operation-card:hover { background: #f7f9fc; }
.operation-main { min-width: 0; display: grid; }
.operation-main b { font-size: 12px; }
.operation-main small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.operation-money { display: grid; justify-items: end; }
.operation-money span { color: var(--muted); font-size: 9px; }
.operation-money strong { margin-top: 4px; color: var(--navy-950); font-size: 15px; }
.operation-money small { margin-top: 4px; color: var(--success); font-size: 9px; }
.task-panel { margin-bottom: 20px; }

.patient-command { margin-bottom: 10px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; border-color: #d9e5ff; background: linear-gradient(135deg,#f7f9ff,#edf5fb); }
.current-step-badge { width: 68px; height: 68px; display: grid; place-items: center; align-content: center; border-radius: 18px; color: #fff; background: var(--blue); }
.current-step-badge span { font-size: 25px; font-weight: 900; line-height: 1; }
.current-step-badge small { margin-top: 5px; max-width: 60px; font-size: 7px; font-weight: 850; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.current-step-copy { min-width: 0; }
.current-step-copy p { margin: 0 0 5px; color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.current-step-copy h2 { margin: 0; color: var(--navy-950); font-size: 22px; letter-spacing: -.035em; }
.current-step-copy > span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.quick-actions-menu { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.75); }
.quick-actions-menu > summary { min-height: 43px; padding: 0 14px; display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; }
.quick-actions-menu > summary::-webkit-details-marker { display: none; }
.quick-actions-menu > summary span { color: var(--blue); font-size: 10px; font-weight: 850; }
.quick-actions-menu > summary small { color: var(--muted); font-size: 9px; }
.quick-actions-menu > summary::after { content: "+"; margin-left: auto; color: var(--blue); font-size: 17px; font-weight: 500; }
.quick-actions-menu[open] > summary { border-bottom: 1px solid var(--line); }
.quick-actions-menu[open] > summary::after { content: "−"; }
.quick-actions { margin: 0; padding: 10px 14px; display: flex; align-items: center; gap: 7px; overflow-x: auto; }
.quick-actions a { flex: 0 0 auto; padding: 7px 10px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.compact-summary { margin-bottom: 14px; padding: 12px; }
.compact-summary .info-grid > div { min-height: 66px; }
.patient-workspace { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); align-items: start; gap: 14px; }
.event-panel { min-width: 0; }
.count-badge.neutral { color: var(--blue); background: var(--blue-soft); }
.event-timeline { display: grid; }
.event-row { min-height: 84px; padding: 13px 5px; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: start; gap: 12px; border-top: 1px solid var(--line); }
.event-row:first-child { border-top: 0; }
.event-row:hover { background: #f8fafc; }
.event-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 900; }
.event-operation .event-icon { color: #fff; background: var(--navy-950); }
.event-manipulation .event-icon { color: #7448d8; background: #f0eaff; }
.event-followup .event-icon { color: var(--success); background: #e8f8f3; }
.event-copy { min-width: 0; display: grid; }
.event-title { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.event-title b { overflow: hidden; text-overflow: ellipsis; color: var(--navy-950); font-size: 12px; }
.event-title time { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.event-copy > small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.event-copy p { margin: 8px 0 0; color: #465872; font-size: 11px; line-height: 1.5; }
.event-copy em { margin-top: 7px; color: var(--blue); font-size: 10px; font-style: normal; font-weight: 750; }
.event-row > .row-arrow { align-self: center; }
.task-row > .task-row-actions { flex: 0 0 auto; display: flex; }
.actions-panel .task-row { display: grid; grid-template-columns: 9px minmax(0,1fr); align-items: start; gap: 5px 11px; }
.actions-panel .task-row > .status-dot { grid-column: 1; grid-row: 1; margin-top: 4px; }
.actions-panel .task-row-copy { grid-column: 2; }
.actions-panel .task-row-copy b,
.actions-panel .task-row-copy small { overflow: visible; white-space: normal; line-height: 1.4; }
.actions-panel .task-row-copy b { font-size: 12px; }
.actions-panel .task-row-actions { grid-column: 2; width: auto; margin-left: 0; justify-content: flex-start; }
.task-action-hint { color: #53657d !important; }
.completed-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.45; }

.service-field { display: block; margin-top: 15px; }
.service-field .service-search { width: 100%; min-height: 44px; margin-top: 8px; padding: 9px 12px; }
.service-picker > div { margin-top: 7px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.service-picker > div > div label { min-height: 52px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid #dce3ec; border-radius: 12px; color: var(--navy-900); background: #fafbfd; cursor: pointer; font-size: 11px; font-weight: 750; }
.service-picker > div > div[hidden] { display: none; }
.service-empty { margin-top: 9px; color: var(--muted); }
.service-field input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--blue); }
.service-picker > div > div:has(input:checked) label { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px rgba(34,90,242,.08); }
.operation-total { margin-top: 15px; padding: 16px 18px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 18px; border-radius: 15px; color: #fff; background: var(--navy-950); }
.operation-total > div { display: grid; }
.operation-total small { color: #aab7cc; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.operation-total strong { margin-top: 4px; font-size: 24px; letter-spacing: -.04em; }
.operation-total p { margin: 0; color: #b9c5d7; font-size: 10px; line-height: 1.5; }
.operation-total p span { display: block; margin-bottom: 3px; }
.operation-total p b { color: #fff; }
.operation-price-override { margin-top: 13px; padding: 14px; border: 1px solid #dce7f5; border-radius: 13px; background: var(--blue-soft); }
.operation-stage-guide { margin-bottom: 20px; padding: 10px; display: flex; align-items: center; gap: 8px; border-radius: 13px; background: #f2f5f8; }
.operation-stage-guide span { min-height: 35px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; border-radius: 10px; color: var(--muted); font-size: 9px; font-weight: 800; }
.operation-stage-guide span i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); background: #fff; font-size: 8px; font-style: normal; }
.operation-stage-guide span.is-current { color: #fff; background: var(--blue); }
.operation-stage-guide span.is-current i { color: var(--blue); }
.operation-stage-guide > b { color: #a5afbd; font-size: 10px; }
.operation-stage-guide > em { margin-left: auto; padding: 7px 10px; border-radius: 9px; color: #a33e49; background: #fdebed; font-size: 9px; font-style: normal; font-weight: 800; }
.form-section-separated { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.operation-status-card { margin-top: 20px; padding: 15px 16px; display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.45fr); align-items: center; gap: 18px; border: 1px solid #dce7f5; border-radius: 14px; background: var(--blue-soft); }
.operation-status-card > div { min-width: 0; display: grid; gap: 4px; }
.operation-status-card > div > span { color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.operation-status-card > div > b { color: var(--navy-950); font-size: 13px; }
.operation-status-card > div > small { color: #536984; font-size: 10px; line-height: 1.45; }
.operation-status-card > strong { justify-self: end; padding: 8px 11px; border-radius: 9px; color: var(--blue); background: #fff; font-size: 10px; }
.operation-result-help { margin: 0; padding: 10px 12px; border-radius: 10px; color: #536984; background: var(--blue-soft); font-size: 10px; line-height: 1.45; }
.follow-up-operation-source { margin: 8px 0 17px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
.follow-up-operation-source b { color: var(--navy-950); font-size: 12px; }
.follow-up-operation-source span { color: var(--muted); font-size: 10px; }
.advanced-section { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfd; }
.advanced-section summary { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.advanced-section summary::-webkit-details-marker { display: none; }
.advanced-section summary span { color: var(--navy-950); font-size: 11px; font-weight: 850; }
.advanced-section summary small { color: var(--muted); font-size: 9px; }
.advanced-section[open] summary { border-bottom: 1px solid var(--line); }
.advanced-section .form-grid { padding: 16px; }
.danger-section { border-color: #efc3ca; background: var(--danger-soft); }
.danger-section summary span { color: var(--danger); }
.danger-section > .field { margin: 16px; }
.danger-section > .button { margin: 0 16px 16px; }

.panel-description { max-width: 650px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.medical-documents-panel { margin-bottom: 14px; }
.medical-lock { flex: 0 0 auto; padding: 7px 10px; border-radius: 20px; color: #146a54; background: #e6faf5; font-size: 9px; font-weight: 800; }
.medical-warning { margin: -2px 0 14px; padding: 11px 13px; display: flex; align-items: center; gap: 10px; border: 1px solid #ffdf9e; border-radius: 12px; color: #76500a; background: #fff8e8; font-size: 10px; }
.medical-warning span { color: #8b6a2f; }
.medical-document-groups { display: grid; gap: 10px; }
.medical-document-group { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfd; }
.medical-document-group > header { display: flex; align-items: center; gap: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.medical-document-group > header > div { min-width: 0; display: grid; }
.medical-document-group > header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy-950); font-size: 12px; }
.medical-document-group > header small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.medical-source-icon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--navy-950); font-size: 11px; font-weight: 900; }
.medical-document-actions { display: grid; }
.medical-document-action { min-height: 61px; padding: 10px 2px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.medical-document-action:last-child { border-bottom: 0; }
.medical-document-action > div:first-child { min-width: 0; display: grid; }
.medical-document-action b { font-size: 11px; }
.document-status { margin-top: 4px; color: var(--muted); font-size: 9px; }
.document-status.status-ready { color: var(--success); font-weight: 800; }
.document-status.status-draft { color: #a56b00; font-weight: 800; }
.document-buttons { flex: 0 0 auto; display: flex; gap: 7px; }

.clinical-document-form { max-width: 1040px; }
.clinical-document-identity { margin-bottom: 14px; display: grid; grid-template-columns: 1.35fr .7fr .9fr; align-items: start; gap: 16px; }
.clinical-patient-chip,.clinical-document-progress { min-height: 70px; padding: 12px 14px; display: grid; align-content: center; border-radius: 13px; background: var(--blue-soft); }
.clinical-patient-chip small,.clinical-document-progress small { color: var(--blue); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.clinical-patient-chip strong,.clinical-document-progress strong { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy-950); font-size: 12px; }
.clinical-patient-chip span,.clinical-document-progress > span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.clinical-document-progress { background: #eef7f4; }
.clinical-document-progress small { color: var(--success); }
.source-summary { max-width: 1040px; margin-bottom: 14px; padding: 15px 17px; border: 1px solid #dce7f5; border-radius: 15px; background: linear-gradient(135deg,#eef3ff,#eff7fa); }
.source-summary summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.source-summary summary::-webkit-details-marker { display: none; }
.source-summary summary span { color: var(--blue); font-size: 9px; font-weight: 800; }
.source-summary[open] summary { padding-bottom: 11px; border-bottom: 1px solid #dce7f5; }
.source-summary b { color: var(--navy-950); font-size: 11px; }
.source-summary p { margin: 7px 0 0; color: #40546f; font-size: 11px; line-height: 1.5; }
.source-summary small { margin-top: 8px; display: block; color: var(--muted); font-size: 9px; }
.clinical-form-section { margin-bottom: 14px; }
.clinical-form-section > header { margin-bottom: 20px; display: flex; align-items: flex-start; gap: 13px; }
.clinical-form-section > header > span { flex: 0 0 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue); font-size: 11px; font-weight: 900; }
.clinical-form-section > header h2 { margin: 1px 0 0; color: var(--navy-950); font-size: 18px; letter-spacing: -.03em; }
.clinical-form-section > header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.clinical-fields { display: grid; grid-template-columns: 1fr; gap: 17px; }
.clinical-fields textarea { line-height: 1.55; resize: vertical; }
.clinical-form-optional > summary { display: flex; align-items: flex-start; gap: 13px; list-style: none; cursor: pointer; }
.clinical-form-optional > summary::-webkit-details-marker { display: none; }
.clinical-form-optional > summary > span { flex: 0 0 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 900; }
.clinical-form-optional > summary div { flex: 1; }
.clinical-form-optional > summary h2 { margin: 1px 0 0; color: var(--navy-950); font-size: 18px; letter-spacing: -.03em; }
.clinical-form-optional > summary p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.clinical-form-optional > summary > b { margin-top: 8px; color: var(--blue); font-size: 9px; }
.clinical-form-optional > summary > b i { font-style: normal; }
.clinical-form-optional .optional-open { display: none; }
.clinical-form-optional[open] .optional-open { display: inline; }
.clinical-form-optional[open] .optional-closed { display: none; }
.clinical-form-optional[open] > summary { margin-bottom: 20px; }
.clinical-revision-history { margin-bottom: 14px; }
.clinical-revision-history > summary { color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 800; }
.clinical-revision-history > div { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 8px; }
.clinical-revision-history a { padding: 10px 12px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy-950); text-decoration: none; }
.clinical-revision-history a:hover { border-color: var(--blue); }
.clinical-revision-history a b { font-size: 10px; }
.clinical-revision-history a span { color: var(--muted); font-size: 9px; }
.clinical-safety-note { max-width: 1040px; }
.clinical-form-actions { position: sticky; bottom: 12px; z-index: 8; max-width: 1040px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: 0 10px 30px rgba(0,15,51,.1); backdrop-filter: blur(12px); }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 285px; align-items: start; gap: 12px; overflow-x: auto; padding-bottom: 16px; scroll-snap-type: x proximity; }
.kanban-column { scroll-snap-align: start; padding: 12px; border-radius: 18px; background: #e9eef4; }
.kanban-column > header { min-height: 38px; display: flex; align-items: center; justify-content: space-between; }
.kanban-column > header h2 { margin: 0; font-size: 12px; color: var(--navy-900); }
.kanban-column > header span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 8px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 850; }
.kanban-stack { display: grid; gap: 8px; }
.kanban-card { min-height: 128px; padding: 14px; display: grid; align-content: space-between; gap: 12px; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(8,25,57,.05); }
.kanban-card > div { display: grid; }
.kanban-card b { font-size: 12px; }
.kanban-card small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.kanban-card > strong { color: var(--navy-950); font-size: 16px; }
.kanban-card footer { display: grid; gap: 5px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.kanban-card time { color: var(--blue); font-weight: 800; }
.kanban-empty { padding: 24px 0; color: #98a4b5; text-align: center; font-size: 11px; }

.calendar-grid { display: grid; grid-template-columns: 1.4fr .7fr; gap: 14px; }
.calendar-page-header { margin-bottom: 18px; }
.calendar-toolbar { margin-bottom: 14px; padding: 12px; display: grid; grid-template-columns: auto minmax(250px,1fr) auto; align-items: center; gap: 16px; }
.calendar-view-switch { display: inline-flex; align-items: center; padding: 4px; border-radius: 12px; background: #f0f3f7; }
.calendar-view-switch a { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 9px; color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.calendar-view-switch a[aria-current="page"] { color: #fff; background: var(--blue); box-shadow: 0 5px 12px rgba(34,90,242,.18); }
.calendar-period-nav { display: flex; align-items: center; justify-content: center; gap: 13px; text-align: center; }
.calendar-period-nav > div { min-width: 180px; display: grid; }
.calendar-period-nav b { color: var(--navy-950); font-size: 13px; }
.calendar-period-nav small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.calendar-arrow { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--blue); background: #fff; font-size: 15px; font-weight: 850; }
.calendar-arrow:hover { border-color: #bfcdf0; background: var(--blue-soft); }
.calendar-kind-filter label { display: grid; gap: 4px; }
.calendar-kind-filter span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.calendar-kind-filter select { min-height: 36px; padding: 0 32px 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy-900); background: #fff; font-size: 10px; font-weight: 750; }
.schedule-board-panel { min-width: 0; margin-bottom: 14px; }
.schedule-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(164px,1fr); gap: 9px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.schedule-column { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.schedule-column.is-today { border-color: #b9cbff; background: var(--blue-soft); }
.schedule-column > header { min-height: 38px; display: flex; align-items: center; gap: 8px; }
.schedule-column > header > strong { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--navy-950); background: #fff; font-size: 13px; }
.schedule-column.is-today > header > strong { color: #fff; background: var(--blue); }
.schedule-column > header > div { display: grid; }
.schedule-column > header b { color: var(--navy-900); font-size: 9px; text-transform: uppercase; }
.schedule-column > header small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.schedule-column-slots { display: grid; gap: 6px; }
.schedule-slot { min-height: 88px; padding: 9px; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 7px; border: 1px solid #dce6f4; border-left: 4px solid var(--blue); border-radius: 10px; background: #fff; }
.schedule-slot.slot-manipulation { border-left-color: #8b5cf6; }
.schedule-slot.slot-operation { border-left-color: var(--navy-950); }
.schedule-slot.is-booked { background: #f1f4f7; border-color: #d7dee8; }
.schedule-slot-time { display: grid; align-content: start; }
.schedule-slot-time b { color: var(--navy-950); font-size: 12px; }
.schedule-slot-time small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.schedule-slot-copy { min-width: 0; display: grid; align-content: start; }
.schedule-slot-copy > small { color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.schedule-slot-copy > b { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; color: var(--navy-950); font-size: 10px; white-space: nowrap; }
.schedule-slot.is-free .schedule-slot-copy > b { color: var(--success); }
.schedule-slot-copy p { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; color: #637289; font-size: 8px; white-space: nowrap; }
.schedule-slot-copy em { margin-top: 3px; color: #8794a6; font-size: 7px; font-style: normal; }
.schedule-slot-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.schedule-slot-actions .button { min-height: 27px; padding: 0 9px; font-size: 8px; }
.slot-edit-link { color: var(--blue); font-size: 8px; font-weight: 800; }
.schedule-no-slots { min-height: 54px; display: grid; place-items: center; border: 1px dashed #dce2ea; border-radius: 9px; color: #a1aab7; font-size: 8px; }
.slot-booking-summary { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.slot-booking-summary > div { display: grid; }
.slot-booking-summary small { color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.slot-booking-summary b { margin-top: 4px; color: var(--navy-950); font-size: 16px; }
.slot-booking-summary p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.calendar-workspace { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); align-items: start; gap: 14px; }
.calendar-agenda { min-width: 0; }
.calendar-agenda-days { display: grid; }
.agenda-day { border-top: 1px solid var(--line); }
.agenda-day:first-child { border-top: 0; }
.agenda-day > header { min-height: 58px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; }
.agenda-day > header > div:nth-child(2) { display: grid; }
.agenda-day > header > div:nth-child(2) b { color: var(--navy-950); font-size: 11px; text-transform: capitalize; }
.agenda-day > header > div:nth-child(2) small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.agenda-day > header > span { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); background: #f1f4f7; font-size: 9px; font-weight: 850; }
.agenda-day.is-today > header > span { color: var(--blue); background: var(--blue-soft); }
.agenda-date { width: 40px; height: 40px; display: grid; place-items: center; align-content: center; border-radius: 11px; color: var(--navy-950); background: #f1f4f7; }
.agenda-date strong { font-size: 16px; line-height: 1; }
.agenda-date span { margin-top: 3px; font-size: 7px; font-weight: 850; text-transform: uppercase; }
.agenda-day.is-today .agenda-date { color: #fff; background: var(--blue); }
.agenda-events { padding: 0 0 12px 54px; display: grid; gap: 7px; }
.agenda-event { min-height: 72px; padding: 11px 10px; display: grid; grid-template-columns: 48px 8px minmax(0,1fr) 18px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.agenda-event:hover { border-color: #cbd8f5; box-shadow: 0 8px 18px rgba(8,25,57,.06); transform: translateY(-1px); }
.agenda-event > time { color: var(--navy-950); font-size: 11px; font-weight: 850; line-height: 1.25; }
.agenda-event:not(:has(time br)) > time { font-size: 13px; }
.agenda-event > time br { display: block; }
.agenda-event-mark { width: 7px; height: 36px; border-radius: 5px; background: var(--blue); }
.agenda-event.event-operation .agenda-event-mark { background: var(--navy-950); }
.agenda-event.event-manipulation .agenda-event-mark { background: #8b5cf6; }
.agenda-event.event-followup .agenda-event-mark { background: var(--success); }
.agenda-event-copy { min-width: 0; display: grid; }
.agenda-event-copy > small { color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.agenda-event.event-operation .agenda-event-copy > small { color: var(--navy-800); }
.agenda-event.event-manipulation .agenda-event-copy > small { color: #7448d8; }
.agenda-event.event-followup .agenda-event-copy > small { color: var(--success); }
.agenda-event-copy b { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; color: var(--navy-950); font-size: 12px; white-space: nowrap; }
.agenda-event-copy p { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 9px; white-space: nowrap; }
.agenda-event-copy em { margin-top: 3px; color: #9aa6b6; font-size: 8px; font-style: normal; }
.agenda-empty { min-height: 46px; display: flex; align-items: center; color: #a0aab8; font-size: 9px; }
.calendar-rail { min-width: 0; display: grid; gap: 14px; }
.surgery-day-panel .calendar-day.compact { padding: 12px; }
.surgery-day-panel .calendar-day.compact > header { margin-bottom: 9px; }
.surgery-day-panel .calendar-day.compact .date-badge { width: 41px; height: 41px; }
.calendar-subscription { margin-bottom: 14px; padding: 16px 18px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px 18px; border: 1px solid #dce7f5; border-radius: 16px; background: linear-gradient(135deg,#eef3ff,#f4f9fb); }
.calendar-subscription.compact { margin-bottom: 0; grid-template-columns: 1fr; }
.calendar-subscription.compact > a { justify-self: start; }
.calendar-subscription b { color: var(--navy-950); font-size: 12px; }
.calendar-subscription p { margin: 5px 0 0; color: #53647b; font-size: 10px; line-height: 1.5; }
.calendar-subscription details { grid-column: 1 / -1; min-width: 0; }
.calendar-subscription summary { color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 800; }
.calendar-link-row { margin-top: 10px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; }
.calendar-subscription code { min-width: 0; padding: 10px; display: block; overflow-x: auto; border-radius: 9px; background: rgba(255,255,255,.8); color: var(--navy-900); font-size: 9px; }
.calendar-subscription details small { margin-top: 6px; display: block; color: var(--muted); font-size: 9px; }
.calendar-subscription details form { margin-top: 10px; }
.calendar-local-note { grid-column: 1 / -1; color: var(--muted); font-size: 9px; line-height: 1.5; }
.calendar-local-rotate { grid-column: 1 / -1; }
.calendar-subscription-steps { margin: 0; padding-left: 18px; color: #53647b; font-size: 10px; line-height: 1.65; }
.calendar-subscription-steps li + li { margin-top: 3px; }
.calendar-platform-list { margin-top: 10px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.calendar-platform-list article { padding: 10px; border: 1px solid rgba(44,94,238,.12); border-radius: 10px; background: rgba(255,255,255,.68); }
.calendar-platform-list article b { font-size: 10px; }
.calendar-platform-list article p { margin-top: 3px; font-size: 9px; }
.calendar-side { display: grid; align-content: start; gap: 14px; }
.calendar-days { display: grid; gap: 12px; }
.calendar-day { padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.calendar-day > header { display: flex; align-items: center; gap: 13px; margin-bottom: 13px; }
.calendar-day > header > div:nth-child(2) { min-width: 0; flex: 1; }
.calendar-day h3 { margin: 0; font-size: 13px; }
.calendar-day p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.capacity-number { font-weight: 850; font-size: 18px; }
.calendar-capacity { flex: 0 0 auto; display: grid; justify-items: end; gap: 3px; }
.calendar-capacity a { color: var(--blue); font-size: 9px; font-weight: 800; }
.operation-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.operation-chips a { display: flex; gap: 6px; padding: 7px 9px; border-radius: 9px; background: #f3f6f9; font-size: 9px; }
.operation-chips a b { color: var(--blue); }
.muted { color: var(--muted); font-size: 10px; }

.field input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--blue); }
.field > div[id^="id_roles"] { padding: 12px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; border: 1px solid #dce3ec; border-radius: 11px; background: #fafbfd; }
.field > div[id^="id_roles"] label { display: flex; align-items: center; gap: 8px; color: var(--navy-900); font-size: 11px; font-weight: 700; }

.finance-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 14px; }
.finance-summary article { min-height: 115px; padding: 20px; display: grid; align-content: center; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.finance-summary article.highlight { color: #fff; background: var(--navy-950); border-color: var(--navy-950); }
.finance-summary p { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.finance-summary .highlight p { color: #aebbd0; }
.finance-summary strong { font-size: clamp(22px,2.4vw,32px); letter-spacing: -.04em; }
.finance-summary small { margin-top: 5px; color: var(--muted); font-size: 9px; }

.partner-section + .partner-section { margin-top: 14px; }
.partner-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.partner-metrics article { min-height: 105px; padding: 18px; display: grid; align-content: center; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.partner-metrics p { margin: 0 0 8px; color: var(--muted); font-size: 10px; }
.partner-metrics strong { color: var(--navy-950); font-size: 24px; letter-spacing: -.04em; }
.info-list { display: grid; margin-top: 16px; }
.info-list > div { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.info-list span { color: var(--muted); font-size: 10px; }
.info-list b { font-size: 11px; text-align: right; }
.info-list a { color: var(--blue); }
.partner-notes { margin-top: 16px; padding: 14px; border-radius: 13px; background: #f7f9fc; }
.partner-notes b { font-size: 11px; }
.partner-notes p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.patient-audit-history { margin-top: 14px; padding: 0; overflow: hidden; }
.patient-audit-history > summary { min-height: 70px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; list-style: none; }
.patient-audit-history > summary::-webkit-details-marker { display: none; }
.patient-audit-history > summary > span { display: grid; gap: 3px; }
.patient-audit-history > summary small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.patient-audit-history > summary b { color: var(--navy-950); font-size: 14px; }
.patient-audit-history > summary em { min-width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-style: normal; font-weight: 850; }
.patient-audit-history[open] > summary { border-bottom: 1px solid var(--line); }
.audit-history-list { padding: 4px 20px 12px; display: grid; }
.audit-history-row { padding: 13px 0; display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 15px; border-bottom: 1px solid var(--line); }
.audit-history-row:last-child { border-bottom: 0; }
.audit-history-row > time { color: var(--muted); font-size: 9px; font-weight: 700; }
.audit-history-row > div { min-width: 0; display: grid; gap: 4px; }
.audit-history-row > div > b { color: var(--navy-950); font-size: 11px; }
.audit-history-row > div > small { color: var(--muted); font-size: 9px; }
.audit-history-row p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.audit-history-row ul, .audit-change-list { margin: 5px 0 0; padding: 0; display: grid; gap: 5px; list-style: none; }
.audit-history-row li, .audit-change-list li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 9px; }
.audit-history-row li span, .audit-change-list li span { color: var(--navy-900); font-weight: 800; }
.audit-history-row li b, .audit-change-list li b { color: var(--blue); font-size: 9px; }
.audit-history-row del, .audit-change-list del { color: #8b96a6; }
.audit-history-row ins, .audit-change-list ins { color: #16745d; font-weight: 750; text-decoration: none; }
.audit-history-row li i, .audit-change-list li i { color: #a7b0bc; font-style: normal; }
.audit-result-count { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.date-filter { min-height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.date-filter span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.date-filter input { min-width: 122px; border: 0; outline: 0; background: transparent; color: var(--navy-900); font: inherit; }
.pagination { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 10px; }
.audit-filters { grid-template-columns: minmax(200px,1fr) auto auto auto auto auto; }
.audit-category { display: inline-flex; padding: 5px 8px; border-radius: 8px; color: #506078; background: #eef2f6; font-size: 8px; font-weight: 800; white-space: nowrap; }
.audit-category.category-clinical { color: #7a3f8f; background: #f5eafa; }
.audit-category.category-financial { color: #146a54; background: #e3f8f1; }
.audit-category.category-administrative { color: #6d5411; background: #fff4d4; }
.audit-category.category-mixed { color: var(--blue); background: var(--blue-soft); }
.audit-table td:nth-child(3) { min-width: 310px; }

.report-period-panel { margin-bottom: 14px; display: grid; grid-template-columns: minmax(180px,.7fr) auto minmax(360px,1fr); align-items: end; gap: 18px; }
.report-period-copy { display: grid; gap: 5px; }
.report-period-copy strong { color: var(--navy-950); font-size: 17px; letter-spacing: -.025em; }
.report-period-copy small { font-size: 9px; line-height: 1.35; }
.report-presets { display: flex; padding: 4px; border-radius: 12px; background: #f1f4f7; }
.report-presets a { min-height: 34px; padding: 0 11px; display: flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.report-presets a[aria-current="page"] { color: #fff; background: var(--blue); box-shadow: 0 5px 12px rgba(34,90,242,.15); }
.report-custom-period { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.report-custom-period label { min-height: 40px; padding: 0 9px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.report-custom-period label span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.report-custom-period input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--navy-900); background: transparent; font-size: 10px; }
.report-money-card strong { font-size: clamp(24px,2.7vw,39px); }
.report-grid { margin-bottom: 14px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 14px; }
.report-total { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-size: 15px; font-weight: 850; }
.source-bars { display: grid; gap: 16px; }
.source-bar-row { display: grid; gap: 7px; }
.source-bar-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-bar-row b { color: var(--navy-900); font-size: 11px; }
.source-bar-row span { color: var(--muted); font-size: 9px; font-weight: 800; }
.attention-summary { margin-bottom: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.attention-summary a { min-height: 72px; padding: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 14px; background: #f7f9fb; }
.attention-summary span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.attention-summary strong { color: var(--navy-950); font-size: 24px; }
.report-attention-list { display: grid; }
.report-attention-list + .report-attention-list { margin-top: 12px; }
.report-attention-list > p { margin: 3px 0 4px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.report-attention-list > a { min-height: 48px; padding: 8px 2px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.report-attention-list > a:last-child { border-bottom: 0; }
.report-attention-list > a > span:first-child { min-width: 0; display: grid; }
.report-attention-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy-900); font-size: 10px; }
.report-attention-list small { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.report-attention-list time, .report-attention-list > a > span:last-child { color: var(--danger); font-size: 9px; font-weight: 800; white-space: nowrap; }
.report-operation-table { min-width: 780px; }
.report-operation-table td:nth-last-child(-n+2) { white-space: nowrap; }
.report-operation-table td:last-child strong { color: var(--success); }
.report-method-note { margin: 13px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.messages { margin-bottom: 14px; }
.message { padding: 12px 14px; border-radius: 12px; color: #146a54; background: #e3f8f1; font-size: 12px; font-weight: 700; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 88% 11%, rgba(180,225,241,.75) 0, transparent 31%), radial-gradient(circle at 72% 22%, rgba(234,128,255,.1) 0, transparent 18%), linear-gradient(135deg, #f1f3f4, #e9eef3); }
.login-card { width: min(980px,100%); min-height: 600px; display: grid; grid-template-columns: 1.1fr .9fr; grid-template-rows: auto 1fr auto; column-gap: clamp(34px,6vw,85px); padding: clamp(28px,5vw,68px); border: 1px solid rgba(255,255,255,.92); border-radius: 30px; background: linear-gradient(135deg,rgba(255,255,255,.96),rgba(248,251,255,.92)); box-shadow: 0 30px 90px rgba(0,15,51,.13); overflow: hidden; }
.login-card::before { content: "ONE·DAY·SURGERY"; position: absolute; align-self: end; justify-self: start; color: rgba(0,15,51,.035); font-size: clamp(52px,9vw,105px); font-weight: 900; letter-spacing: -.08em; white-space: nowrap; pointer-events: none; }
.login-card > .brand { grid-column: 1 / -1; }
.login-copy { align-self: center; }
.login-copy h1 { margin: 8px 0 18px; font-size: clamp(44px,6vw,78px); line-height: .88; letter-spacing: -.07em; color: var(--navy-950); }
.login-copy > p:not(.eyebrow) { max-width: 480px; color: var(--muted); line-height: 1.6; }
.login-form { align-self: center; display: grid; gap: 8px; padding: 25px; border: 1px solid #dfe6ed; border-radius: 20px; background: rgba(255,255,255,.82); color: var(--navy-950); box-shadow: 0 16px 45px rgba(0,15,51,.07); backdrop-filter: blur(18px); }
.login-form label { margin-top: 5px; color: #5f6f85; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.login-form input:not([type="hidden"]) { min-height: 47px; padding: 0 13px; border: 1px solid #d7dfe8; border-radius: 11px; outline: 0; color: var(--navy-950); background: #f7f9fb; }
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,90,242,.12); }
.login-form .button { margin-top: 10px; background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(34,90,242,.18); }
.login-form .form-alert { color: #ffb8bf; background: rgba(236,91,104,.14); }
.privacy-note { grid-column: 1 / -1; align-self: end; margin: 0; color: #8a96a8; font-size: 10px; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .sidebar { padding-inline: 14px; }
  .main-content { padding-inline: 24px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid, .detail-grid, .calendar-grid, .calendar-workspace, .patient-workspace { grid-template-columns: 1fr; }
  .partner-metrics { grid-template-columns: repeat(2,1fr); }
  .finance-summary { grid-template-columns: repeat(2,1fr); }
  .report-period-panel { grid-template-columns: 1fr auto; }
  .report-custom-period { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; width: min(290px,86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 18px 0 60px rgba(0,0,0,.22); }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-header { height: 59px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; color: var(--navy-950); background: #fff; border-bottom: 1px solid var(--line); }
  .mobile-header > span { font-size: 13px; letter-spacing: -.02em; }
  .mobile-header > span b { color: var(--blue); font-size: 9px; letter-spacing: .12em; }
  .menu-button, .round-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; color: var(--navy-950); background: #f1f3f6; font-size: 18px; }
  .round-button { color: #fff; background: var(--blue); }
  .main-content { padding: 24px 15px 54px; }
  .page-header { align-items: flex-start; flex-wrap: wrap; }
  .page-header > .button { width: 100%; }
  .header-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .page-header h1 { font-size: 38px; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 137px; padding: 16px; }
  .metric-card strong { font-size: 36px; }
  .finance-strip { grid-template-columns: 1fr 1fr; }
  .finance-strip > div { min-height: 90px; padding: 15px; }
  .finance-strip > div:nth-child(2) { border-right: 0; }
  .finance-strip > div:last-child { grid-column: span 2; border-top: 1px solid rgba(16,32,61,.08); }
  .day-task { grid-template-columns: 74px minmax(0,1fr) 68px; }
  .day-task-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .panel { padding: 17px; }
  .compact-row { grid-template-columns: 86px minmax(120px,1fr); }
  .compact-row > :nth-child(3), .compact-row > :nth-child(4) { display: none; }
  .bonus-row { grid-template-columns: minmax(150px,1fr) 100px; }
  .filters { display: grid; grid-template-columns: 1fr auto; }
  .search-field { grid-column: span 2; }
  .filters select { min-width: 0; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .duplicate-callout { align-items: stretch; flex-direction: column; }
  .duplicate-callout .header-actions { grid-template-columns: 1fr; }
  .patient-command { grid-template-columns: auto minmax(0,1fr); }
  .patient-command > .button { grid-column: 2; justify-self: start; }
  .quick-actions-menu > summary { padding-block: 9px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 10px; }
  .quick-actions-menu > summary small { grid-column: 1; }
  .quick-actions-menu > summary::after { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .actions-panel .task-row-actions { width: auto; margin-left: 0; justify-content: flex-start; }
  .service-picker > div { grid-template-columns: 1fr; }
  .operation-total { grid-template-columns: 1fr; gap: 9px; }
  .operation-stage-guide { align-items: stretch; display: grid; grid-template-columns: 1fr; }
  .operation-stage-guide > b { display: none; }
  .operation-stage-guide > em { margin-left: 0; }
  .operation-status-card { grid-template-columns: 1fr; }
  .operation-status-card > strong { justify-self: start; }
  .tariff-callout { grid-template-columns: 1fr; }
  .consultation-context { grid-template-columns: 1fr; }
  .inline-confirmation-fields { grid-template-columns: 1fr; }
  .clinical-document-identity { grid-template-columns: 1fr 1fr; }
  .medical-document-action { align-items: flex-start; flex-direction: column; }
  .field-wide { grid-column: span 1; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .journey-step { padding: 16px; }
  .journey::before { display: none; }
  .journey-heading { flex-wrap: wrap; }
  .journey-heading .button { margin-left: 49px; }
  .journey-step .timeline { margin-left: 0; }
  .operation-card { grid-template-columns: minmax(0,1fr) 120px 16px; }
  .calendar-day > header { align-items: flex-start; }
  .calendar-toolbar { grid-template-columns: 1fr; }
  .calendar-view-switch { width: 100%; }
  .calendar-view-switch a { flex: 1; justify-content: center; }
  .calendar-period-nav { justify-content: space-between; }
  .calendar-kind-filter select { width: 100%; }
  .schedule-board { grid-auto-columns: minmax(180px,74vw); }
  .slot-booking-summary { align-items: stretch; flex-direction: column; }
  .slot-booking-summary .button { align-self: start; }
  .agenda-events { padding-left: 0; }
  .calendar-subscription { grid-template-columns: 1fr; }
  .calendar-subscription details { grid-column: 1; }
  .field > div[id^="id_roles"] { grid-template-columns: 1fr; }
  .audit-filters { grid-template-columns: 1fr; }
  .audit-filters .search-field { grid-column: 1; }
  .audit-history-row { grid-template-columns: 1fr; gap: 5px; }
  .finance-summary { grid-template-columns: 1fr; }
  .finance-summary article { min-height: 94px; }
  .report-period-panel { grid-template-columns: 1fr; align-items: stretch; }
  .report-presets { overflow-x: auto; }
  .report-presets a { flex: 1 0 auto; }
  .report-custom-period { grid-column: 1; grid-template-columns: 1fr 1fr; }
  .report-custom-period .button { grid-column: 1 / -1; }
  .report-grid { grid-template-columns: 1fr; }
  .login-page { padding: 0; }
  .login-card { min-height: 100vh; grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; gap: 34px; padding: 28px 22px; border-radius: 0; }
  .login-copy { align-self: end; }
  .login-copy h1 { font-size: 50px; }
  .login-form { padding: 20px; }
  .privacy-note { grid-column: 1; }
}

@media (max-width: 430px) {
  .metric-card { min-height: 128px; }
  .metric-card p { max-width: 90px; }
  .metric-icon { width: 27px; height: 27px; right: 12px; top: 12px; }
  .surgery-day-main { grid-template-columns: 1fr; gap: 8px; }
  .capacity span { text-align: left; }
  .info-grid { grid-template-columns: 1fr; }
  .journey-heading .button { width: calc(100% - 49px); }
  .operation-card { grid-template-columns: 1fr 16px; }
  .operation-money { grid-column: 1; grid-row: 2; justify-items: start; }
  .operation-card .row-arrow { grid-column: 2; grid-row: 1 / span 2; }
  .partner-metrics { grid-template-columns: 1fr; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .clinical-document-identity { grid-template-columns: 1fr; }
  .clinical-form-actions { grid-template-columns: 1fr; }
  .medical-warning { align-items: flex-start; flex-direction: column; }
  .agenda-event { grid-template-columns: 42px 7px minmax(0,1fr); }
  .agenda-event > .row-arrow { display: none; }
  .agenda-event-copy p { white-space: normal; line-height: 1.35; }
  .calendar-link-row { grid-template-columns: 1fr; }
  .calendar-link-row .button { justify-self: start; }
  .calendar-platform-list { grid-template-columns: 1fr; }
  .report-money-card strong { font-size: 28px; white-space: nowrap; }
  .report-custom-period { grid-template-columns: 1fr; }
  .report-custom-period .button { grid-column: 1; }
  .attention-summary { grid-template-columns: 1fr; }
}
