@font-face{font-family:'DM Sans';font-weight:400;font-style:normal;font-display:swap;src:url("../fonts/dm-sans-400.c26dd178864e.ttf") format('truetype')}
@font-face{font-family:'DM Sans';font-weight:500;font-style:normal;font-display:swap;src:url("../fonts/dm-sans-500.a165d87fb7ee.ttf") format('truetype')}
@font-face{font-family:'DM Sans';font-weight:600;font-style:normal;font-display:swap;src:url("../fonts/dm-sans-600.e783b4d0a9b7.ttf") format('truetype')}
@font-face{font-family:'DM Sans';font-weight:700;font-style:normal;font-display:swap;src:url("../fonts/dm-sans-700.411346eea6cd.ttf") format('truetype')}

:root {
  --ink: #382a3e;
  --ink-soft: #5a4b60;
  --muted: #716b74;
  --accent: #bb492f;
  --accent-dark: #a53e27;
  --accent-soft: #f8ece8;
  --orange: #d76544;
  --peach: #f4c2a9;
  --purple: #725b7e;
  --purple-soft: #f1ecf4;
  --paper: #fdfcfd;
  --canvas: #f8f5f7;
  --surface: #fff;
  --line: #e5e0e6;
  --line-soft: #efebf0;
  --green: #2c7a56;
  --green-soft: #e5f3ec;
  --amber: #8a5d0c;
  --amber-soft: #fbf0d9;
  --blue: #2f5f8f;
  --blue-soft: #e7eff8;
  --red: #b3261e;
  --red-soft: #fbe9e7;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(56, 42, 62, .04), 0 6px 20px rgba(56, 42, 62, .045);
  --sans: 'DM Sans', Arial, sans-serif;
  --sidebar: 264px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -.8px; }
h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.3px; }
p { margin: 0 0 1em; }
::selection { background: var(--peach); color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }

/* Brand */
.brand { display: inline-flex; align-items: center; font-size: 26px; font-weight: 700; letter-spacing: -1.3px; line-height: 1; }
.brand-period { color: var(--accent); }
.brand-mark { display: flex; gap: 3px; align-items: center; margin-right: 9px; height: 22px; }
.brand-mark i { display: block; width: 4px; height: 12px; background: var(--accent); border-radius: 4px; }
.brand-mark i:nth-child(2) { height: 22px; }
.brand-mark i:nth-child(3) { height: 16px; }
.brand-sm { font-size: 22px; }

/* App shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 6px; }
.sidebar .sidebar-close { display: none; }
.org-card { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.org-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.org-name { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.org-role { font-size: 12.5px; color: var(--purple); }
.org-switch { margin-top: 8px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.org-switch summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
.org-switch summary::-webkit-details-marker { display: none; }
.org-switch summary .icon { width: 16px; height: 16px; }
.org-switch form { margin-top: 4px; }
.org-switch button { width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font-size: 13.5px; }
.org-switch button:hover { background: var(--accent-soft); color: var(--accent); }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 500; color: var(--ink-soft); transition: background .15s, color .15s; }
.side-nav a:hover { background: var(--canvas); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.user-chip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); }
.user-chip:hover, .user-chip[aria-current="page"] { background: var(--canvas); }
.user-chip-text { min-width: 0; display: grid; line-height: 1.3; }
.user-chip-text strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 40px 64px; outline: none; }
.nav-backdrop { display: none; }

/* Avatars */
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #ede7f0; color: #614c6c; font-size: 12.5px; font-weight: 600; flex-shrink: 0; letter-spacing: .3px; }
.avatar-soft { background: var(--accent-soft); color: var(--accent); }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.button .icon { width: 18px; height: 18px; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-ghost { background: var(--surface); border-color: #d9c8cf; color: var(--ink); }
.button-ghost:hover { background: #f4ebe9; }
.button-danger { background: var(--red); color: #fff; }
.button-danger:hover { background: #941f18; }
.button-danger-text { color: var(--red); }
.button-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.button-block { width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); }
.icon-button:hover { background: var(--canvas); color: var(--ink); }
.icon-button-danger:hover { background: var(--red-soft); color: var(--red); }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }
.link-danger { color: var(--red); }

/* Page header */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-lead { color: var(--muted); max-width: 640px; margin: 8px 0 0; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent); margin: 0 0 8px; }
.count { font-size: .55em; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; vertical-align: middle; letter-spacing: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--accent); }
.section { margin-top: 36px; }
.section-title { margin-bottom: 14px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 18px; }
.card-flush { padding: 0; overflow: hidden; }
.card-narrow { max-width: 520px; }
.card-medium { max-width: 760px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { margin-bottom: 14px; }
.card-head .card-title { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }

/* Alerts */
.messages { display: grid; gap: 10px; margin-bottom: 22px; }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: 14px; margin-bottom: 18px; }
.messages .alert { margin-bottom: 0; }
.alert p { margin: 0; }
.alert a { font-weight: 600; text-decoration: underline; }
.alert-success { background: var(--green-soft); border-color: #bfe0cf; color: #1e5a3f; }
.alert-error { background: var(--red-soft); border-color: #f2c4bf; color: #8a1d17; }
.alert-warning { background: var(--amber-soft); border-color: #eed7a6; color: #6b480a; }
.alert-info { background: var(--purple-soft); border-color: #ddd2e3; color: #4e3c58; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { display: grid; gap: 4px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
a.stat:hover { border-color: #d9c8cf; transform: translateY(-1px); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -1px; line-height: 1.1; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--canvas); color: var(--ink-soft); }
.badge-lg { font-size: 13px; padding: 4px 12px; }
.badge-neutral { background: var(--canvas); color: var(--ink-soft); }
.badge-status-active { background: var(--green-soft); color: var(--green); }
.badge-status-waiting { background: var(--amber-soft); color: var(--amber); }
.badge-status-paused { background: var(--blue-soft); color: var(--blue); }
.badge-status-finished { background: #efedf0; color: var(--muted); }
.badge-role-owner { background: var(--accent-soft); color: var(--accent); }
.badge-role-admin { background: var(--purple-soft); color: var(--purple); }
.badge-role-therapist { background: var(--green-soft); color: var(--green); }
.badge-role-reception { background: var(--blue-soft); color: var(--blue); }
.badge-kind-session { background: var(--green-soft); color: var(--green); }
.badge-kind-diagnosis { background: var(--accent-soft); color: var(--accent); }
.badge-kind-consultation { background: var(--purple-soft); color: var(--purple); }
.badge-kind-other { background: var(--canvas); color: var(--ink-soft); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9c2cc; margin-right: 8px; vertical-align: 1px; }
.dot-green { background: #3aa673; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfafb; }
.table-compact td { padding: 9px 16px; }
.table small { display: block; font-size: 12.5px; }
.cell-main { display: block; }
.cell-actions { text-align: right; width: 1%; white-space: nowrap; }
.row-muted td { color: var(--muted); }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.row-actions form { display: contents; }
.person-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-cell-lg { gap: 16px; }
.person-text { display: grid; min-width: 0; line-height: 1.35; }
.person-text strong { font-weight: 600; }
.person-text small { color: var(--muted); font-size: 12.5px; }
.row-link:hover strong { color: var(--accent); }
.file-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.file-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.file-image { background: var(--blue-soft); color: var(--blue); }
.file-audio { background: var(--purple-soft); color: var(--purple); }
.file-video { background: var(--amber-soft); color: var(--amber); }

/* Lists */
.plain-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 2px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.list-row > span { display: inline-flex; align-items: center; gap: 10px; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 0 -10px; border-radius: var(--radius-sm); }
.person-row:hover { background: var(--canvas); }
.person-row .person-text { flex: 1; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.feed-item { display: flex; gap: 14px; padding: 10px; margin: 0 -10px; border-radius: var(--radius-sm); }
.feed-item:hover { background: var(--canvas); }
.feed-date { flex-shrink: 0; width: 48px; font-size: 12.5px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.feed-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.feed-text { flex-basis: 100%; font-size: 13.5px; color: var(--muted); }

/* Empty states */
.empty, .empty-hero { text-align: center; padding: 44px 24px; }
.empty h2, .empty-hero h2 { margin-bottom: 8px; }
.empty p, .empty-hero p { color: var(--muted); max-width: 460px; margin: 0 auto 18px; }
.empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.empty-icon .icon { width: 26px; height: 26px; }

/* Forms */
.stack { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid-inline { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: end; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.req { color: var(--accent); }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea, .toolbar select, .copy-field input {
  width: 100%; min-height: 44px; padding: 10px 12px; background: var(--surface); border: 1px solid #d9d1db; border-radius: var(--radius-sm); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 0; resize: vertical; line-height: 1.5; }
.field select, .toolbar select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23716b74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar select:focus, .search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(187, 73, 47, .14); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.help { margin: 0; font-size: 12.5px; color: var(--muted); }
.error { margin: 0; font-size: 13px; color: var(--red); font-weight: 500; }
.field-check { align-content: start; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.static-value { margin: 0; padding: 10px 12px; background: var(--canvas); border-radius: var(--radius-sm); font-size: 15px; overflow-wrap: anywhere; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-actions-center { justify-content: center; }
.form-actions form { display: contents; }
.form-sections { display: grid; gap: 18px; max-width: 860px; }
.form-sections > .card + .card { margin-top: 0; }
.form-section { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
.form-section-head h2 { font-size: 1.02rem; }
.form-section-head p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.form-actions-sticky { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, var(--canvas) 70%, transparent); }
.field-submit { align-self: end; }

/* Toolbar, filters, chips */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; max-width: 360px; }
.filters { display: flex; gap: 10px; margin-bottom: 14px; }
.search { position: relative; flex: 1; max-width: 520px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { width: 100%; min-height: 44px; padding: 10px 12px 10px 40px; background: var(--surface); border: 1px solid #d9d1db; border-radius: var(--radius-sm); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.chip span { color: var(--muted); font-weight: 600; }
.chip:hover { border-color: #d9c8cf; }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-current="true"] span { color: #d8cddc; }
.chips-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pagination-info { font-size: 13px; color: var(--muted); }

/* Patient */
.patient-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.patient-head h1 { margin-bottom: 6px; }
.patient-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; color: var(--muted); font-size: 14px; }
.patient-meta strong { color: var(--ink); font-weight: 600; }
.patient-head-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 12px 11px; font-weight: 500; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a .icon { width: 18px; height: 18px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { font-size: 12px; font-weight: 600; background: var(--canvas); color: var(--muted); padding: 0 8px; border-radius: 99px; }
.tabs a[aria-current="page"] .tab-count { background: var(--accent-soft); color: var(--accent); }
.split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 22px; align-items: start; }
.split-aside { position: sticky; top: 24px; }
.split-aside .form-grid { grid-template-columns: 1fr 1fr; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline-item { position: relative; }
.timeline-dot { position: absolute; left: -22px; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--orange); }
.timeline .card + .card { margin-top: 0; }
.entry { padding: 16px 20px; }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.entry-head > div { display: flex; align-items: center; gap: 10px; }
.entry-head time { font-weight: 600; }
.entry-body p { margin: 0 0 .6em; }
.entry-body p:last-child { margin-bottom: 0; }
.entry-actions { display: flex; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.details { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 14.5px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.record-meta { margin-top: 18px; }
.dropzone { position: relative; border: 2px dashed #dccfd6; border-radius: var(--radius); background: var(--paper); transition: border-color .15s, background .15s; }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-inner { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; pointer-events: none; }
.dropzone-inner .icon { width: 28px; height: 28px; color: var(--accent); }
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-files { border-style: solid; border-color: var(--green); }
.dropzone.has-error { border-color: var(--red); }
.dropzone-files { font-size: 13.5px; font-weight: 600; color: var(--green); overflow-wrap: anywhere; }
.danger-zone h1 { font-size: 1.5rem; margin-bottom: 14px; }
.danger-zone ul { margin: 0 0 1em; padding-left: 20px; }

/* Team */
.invite-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.invite-list .card + .card { margin-top: 0; }
.invite { display: grid; gap: 10px; }
.invite-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.invite-head > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { min-height: 36px; font-size: 13px; color: var(--muted); }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.role-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.role-card p { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.event { font-weight: 500; }
.event-patientviewed, .event-documentdownloaded { color: var(--muted); }
.event-patientdeleted, .event-documentdeleted, .event-notedeleted, .event-invitationrevoked { color: var(--red); }

/* Auth pages */
.auth-page { background: var(--paper); }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-single { grid-template-columns: 1fr; }
.auth-panel { display: flex; flex-direction: column; padding: 32px 48px; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 40px 0; }
.auth-card h1 { margin-bottom: 10px; }
.auth-card .lead { color: var(--muted); margin-bottom: 26px; }
.auth-alt { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.auth-alt a, .auth-alt .link { color: var(--accent); font-weight: 600; }
.auth-foot { margin: 0; font-size: 12.5px; color: var(--muted); }
.auth-foot a:hover { color: var(--accent); }
.auth-visual { position: relative; overflow: hidden; background: var(--ink); }
.auth-visual img { width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.auth-quote { position: absolute; left: 40px; right: 40px; bottom: 40px; padding: 22px 26px; background: rgba(253, 252, 253, .94); border-radius: var(--radius); box-shadow: 10px 12px 0 rgba(242, 232, 228, .5); }
.auth-quote p { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.5; letter-spacing: -.2px; }

/* Checkbox lists (CheckboxSelectMultiple) */
.field > div > div > label { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; font-size: 14px; cursor: pointer; }
.field > div > div > label input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }

/* Shared bits for the record tabs */
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-bar > p { margin: 0; max-width: 640px; font-size: 14px; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border-radius: 99px; background: var(--purple-soft); color: var(--purple); font-size: 12.5px; font-weight: 500; }
.tag .icon { width: 14px; height: 14px; }
.tag:hover { background: #e7def0; }
.homework { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid #f0dfb5; }
.homework-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.homework-head strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--amber); }
.homework-head .icon { width: 16px; height: 16px; }
.homework p { margin: 4px 0 0; font-size: 14px; }
.cell-clip { max-width: 420px; }
.danger-inline { margin-top: 18px; }
.prose { margin: 0 0 18px; }
.note-text { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--ink-soft); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--canvas); border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 4px; }

/* Goals */
.goal-group + .goal-group { margin-top: 28px; }
.goal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.goal-list .card + .card { margin-top: 0; }
.goal { display: grid; gap: 10px; align-content: start; scroll-margin-top: 20px; }
.goal:target { border-color: var(--accent); }
.goal-achieved, .goal-dropped { background: var(--paper); }
.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.goal-head h3 { font-size: 16px; font-weight: 600; margin-top: 6px; line-height: 1.35; }
.badge-area { background: var(--purple-soft); color: var(--purple); }
.progress { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.progress-bar { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--orange), var(--accent)); }
.goal-achieved .progress-bar { background: #3aa673; }
.goal-meta { margin: 0; font-size: 13px; color: var(--muted); }
.goal-meta strong { color: var(--ink); }
.goal-description { margin: 0; font-size: 14px; color: var(--ink-soft); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: left; font-size: 14px; }
.step:hover { border-color: #d9c8cf; }
.step-check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #cfc6d2; flex-shrink: 0; }
.step-check .icon { width: 14px; height: 14px; stroke-width: 2.5; opacity: 0; }
.step.is-done { background: var(--green-soft); border-color: #cfe7da; color: #1e5a3f; }
.step.is-done .step-check { background: #3aa673; border-color: #3aa673; color: #fff; }
.step.is-done .step-check .icon { opacity: 1; }
.goal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.goal-actions form { display: contents; }

/* Assessments */
.badge-assessment-initial { background: var(--accent-soft); color: var(--accent); }
.badge-assessment-control { background: var(--blue-soft); color: var(--blue); }
.badge-assessment-final { background: var(--green-soft); color: var(--green); }
.compare th.compare-col, .compare td.compare-col { text-align: center; }
.compare-col a { color: var(--accent); }
.compare-col small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; }
.table .phoneme-cell { font-size: 17px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); background: none; width: 90px; }
.art { display: inline-grid; place-items: center; min-width: 28px; height: 26px; padding: 0 6px; border-radius: 6px; font-size: 12.5px; font-weight: 700; background: #f1eef2; color: var(--muted); }
.art-ok { background: var(--green-soft); color: var(--green); }
.art-distorted { background: var(--amber-soft); color: var(--amber); }
.art-substituted { background: var(--red-soft); color: var(--red); }
.art-elided { background: #3f2f45; color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.form-sections-wide { max-width: 1000px; }
.form-section-full { grid-template-columns: 1fr; }
.form-section-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.phoneme-group { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.phoneme-group legend { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.phoneme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 8px; }
.phoneme { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; gap: 4px 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: background .15s, border-color .15s; }
.phoneme-label { grid-row: 1 / 3; font-size: 20px; font-weight: 700; text-align: center; }
.phoneme select, .phoneme input { width: 100%; min-height: 32px; padding: 4px 6px; font-size: 13px; border: 1px solid #ddd5df; border-radius: 6px; background: #fff; }
.phoneme select { appearance: auto; }
.phoneme:has(option[value="ok"]:checked) { background: var(--green-soft); border-color: #cfe7da; }
.phoneme:has(option[value="distorted"]:checked) { background: var(--amber-soft); border-color: #eed7a6; }
.phoneme:has(option[value="substituted"]:checked), .phoneme:has(option[value="elided"]:checked) { background: var(--red-soft); border-color: #f2c4bf; }
.details-compact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); font-size: 14px; gap: 6px 14px; }
.articulation-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 22px; }
.art-group h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 6px; }
.art-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.art-item { display: flex; align-items: baseline; gap: 10px; padding: 3px 8px; border-radius: 6px; font-size: 14px; }
.art-phoneme { width: 26px; font-weight: 700; font-size: 15px; }
.art-label em { font-style: normal; font-weight: 600; }
.art-item-distorted { background: var(--amber-soft); }
.art-item-substituted, .art-item-elided { background: var(--red-soft); }
.art-item-none .art-label { color: var(--muted); }

/* Recordings */
.recorder .card-title { display: flex; align-items: center; gap: 8px; }
.recorder-ui { display: grid; gap: 12px; }
.recorder-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
.rec-timer { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.recorder-review { display: grid; gap: 10px; }
.recorder audio, .recording audio { width: 100%; height: 40px; }
.recorder-fallback summary { cursor: pointer; font-size: 13.5px; color: var(--muted); }
.recorder-fallback .stack { margin-top: 10px; }
.recording-groups { display: grid; gap: 16px; margin-top: 18px; }
.recording-groups .card + .card { margin-top: 0; }
.recording-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recording { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--paper); }
.recording-meta { display: grid; line-height: 1.35; }
.recording video { width: 100%; max-height: 260px; border-radius: 6px; background: #000; }

/* Documents */
.grid-docs { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.grid-docs > .card + .card { margin-top: 0; }
.generate-card p { margin-bottom: 12px; }
.template-picks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.template-pick { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; transition: border-color .15s, background .15s; }
.template-pick .icon { color: var(--accent); width: 18px; height: 18px; }
.template-pick:hover { border-color: var(--accent); background: var(--accent-soft); }
.template-pick > span { display: grid; }
.template-picks-lg .template-pick { padding: 14px 16px; }
.chips-docs { margin-top: 4px; }
.file-pdf { background: var(--red-soft); color: var(--red); }
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.preview-stage { min-height: 70vh; display: grid; background: #f3eff2; }
.preview-stage iframe { width: 100%; height: 78vh; border: 0; background: #fff; }
.preview-stage img { max-width: 100%; max-height: 78vh; margin: auto; object-fit: contain; }
.preview-stage video { width: 100%; max-height: 78vh; background: #000; }
.preview-center { display: grid; justify-items: center; align-content: center; gap: 16px; padding: 40px 24px; text-align: center; }
.preview-center audio { width: min(520px, 100%); }
.preview-icon { width: 54px; height: 54px; color: var(--accent); }
.preview-info { position: sticky; top: 24px; display: grid; gap: 16px; }
.preview-title { font-size: 1.1rem; letter-spacing: -.2px; }
.details-stacked { grid-template-columns: 1fr; gap: 2px; font-size: 14px; }
.details-stacked dd { margin-bottom: 8px; }
.preview-nav { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.generate-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.generate-layout > .card + .card { margin-top: 0; }
.generate-layout textarea { font-size: 14.5px; line-height: 1.6; }
.generate-help { position: sticky; top: 24px; }
.hint-list { margin: 0 0 20px; padding-left: 18px; font-size: 13.5px; color: var(--ink-soft); display: grid; gap: 6px; }
.placeholder-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.placeholder-list li { display: grid; gap: 1px; }
.placeholder-list span { color: var(--muted); }

/* Resources */
.section-tight { margin-bottom: 22px; }
.section-tight .section-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.section-tight .section-title .icon { width: 18px; height: 18px; color: var(--accent); }
.resource-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.resource-list .card + .card { margin-top: 0; }
.resource { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 14px 16px; }
.resource-pinned { border-color: #ecc9bd; }
.resource-main { flex: 1; min-width: 0; display: flex; gap: 14px; }
.resource-main:hover strong { color: var(--accent); }
.resource-text { display: grid; gap: 4px; min-width: 0; }
.resource-text strong { font-weight: 600; overflow-wrap: anywhere; }
.resource-desc { font-size: 13.5px; color: var(--ink-soft); }
.resource-text small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; color: var(--muted); }
.file-link { background: var(--blue-soft); color: var(--blue); }
.title-pin { width: 18px; height: 18px; color: var(--accent); margin-right: 6px; vertical-align: -2px; }
.field-align { align-self: end; padding-bottom: 10px; }
.upload-progress { display: grid; gap: 6px; }
.upload-progress .progress { height: 10px; }
.upload-progress-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pinned-resources { margin-bottom: 22px; }
.pinned-resources .card-title { display: flex; align-items: center; gap: 8px; }
.pinned-resources .card-title .icon { color: var(--accent); width: 18px; height: 18px; }
.pinned-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 0; }

/* Visibility badges, choice cards */
.badge .icon { width: 13px; height: 13px; }
.badge-visibility-private { background: #efedf0; color: var(--ink-soft); }
.badge-visibility-shared { background: var(--purple-soft); color: var(--purple); }
.badge-visibility-team { background: var(--green-soft); color: var(--green); }
.choice-cards { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice-cards legend { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.choice-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.choice-card input { margin-top: 4px; accent-color: var(--accent); }
.choice-card span { display: grid; gap: 2px; }
.choice-card small { color: var(--muted); font-size: 12.5px; }
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.section-gap { margin-top: 20px; }

/* Boards */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.board-grid .card + .card { margin-top: 0; }
.board-tile { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start; transition: border-color .15s, transform .15s; }
.board-tile:hover { border-color: #d9c8cf; transform: translateY(-1px); }
.board-tile-personal { border-color: #ecc9bd; background: linear-gradient(180deg, #fff, #fdf6f3); }
.board-tile-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.board-tile-text { display: grid; gap: 2px; }
.board-tile-text span { font-size: 13px; color: var(--muted); }
.board-tile .badge { justify-self: start; }
.board-header .page-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.kanban-column { flex: 0 0 290px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); background: #f1edf1; border: 1px solid var(--line); border-radius: var(--radius); }
.kanban-column-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 8px; }
.kanban-column-head h2 { font-size: 14px; font-weight: 600; }
.kanban-cards { list-style: none; margin: 0; padding: 4px 10px; display: grid; gap: 8px; align-content: start; min-height: 40px; overflow-y: auto; flex: 1; }
.kanban-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 1px 2px rgba(56, 42, 62, .05); cursor: grab; border-left-width: 4px; }
.kanban-card.is-dragging { opacity: .45; }
.kanban-card-link { display: grid; gap: 4px; padding: 10px 12px; }
.kanban-card-link strong { font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.kanban-card-desc { font-size: 12.5px; color: var(--muted); }
.kanban-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kanban-card-meta:empty { display: none; }
.card-color-red { border-left-color: var(--red); }
.card-color-amber { border-left-color: #e0a526; }
.card-color-green { border-left-color: #3aa673; }
.card-color-blue { border-left-color: #4a7fb5; }
.card-color-purple { border-left-color: var(--purple); }
.kanban-drop-marker { height: 4px; border-radius: 4px; background: var(--accent); list-style: none; }
.kanban-cards.is-over { background: rgba(187, 73, 47, .05); border-radius: var(--radius-sm); }
.kanban-add { padding: 8px 10px 10px; }
.kanban-add input { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px dashed #cfc4d1; border-radius: var(--radius-sm); background: transparent; font-size: 13.5px; }
.kanban-add input:focus { outline: none; border-style: solid; border-color: var(--accent); background: #fff; }
.kanban-hint { margin-top: 4px; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.due .icon { width: 13px; height: 13px; }
.due-overdue { color: var(--red); font-weight: 600; }
.tag-small { font-size: 11.5px; padding: 1px 8px 1px 6px; }
.avatar-xs { width: 24px; height: 24px; font-size: 10.5px; margin-left: auto; }
.column-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.column-row { display: flex; align-items: center; gap: 6px; }
.column-rename { flex: 1; display: flex; gap: 4px; }
.column-rename input { flex: 1; min-height: 36px; padding: 6px 10px; border: 1px solid #d9d1db; border-radius: var(--radius-sm); }
.column-actions { display: flex; }
.icon-button:disabled { opacity: .35; cursor: default; }

/* Calendar */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 14px; }
.cal-toolbar .chips { margin: 0; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-person { margin-left: auto; min-width: 200px; }
.cal-person select { width: 100%; min-height: 38px; padding: 6px 34px 6px 10px; border: 1px solid #d9d1db; border-radius: var(--radius-sm); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23716b74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 18px; appearance: none; }
.ev { display: block; padding: 3px 7px; border-radius: 5px; font-size: 12px; line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--accent-soft); color: #7d2f1e; border-left: 3px solid var(--accent); }
.ev time { font-weight: 600; }
.ev strong { font-weight: 600; }
.ev span { opacity: .85; }
.ev:hover { filter: brightness(.97); }
.ev-visit { background: var(--accent-soft); color: #7d2f1e; border-left-color: var(--accent); }
.ev-meeting { background: var(--purple-soft); color: #4e3c58; border-left-color: var(--purple); }
.ev-absence { background: var(--amber-soft); color: #6b480a; border-left-color: #e0a526; }
.ev-task { background: var(--blue-soft); color: #234a70; border-left-color: #4a7fb5; }
.ev-other { background: var(--green-soft); color: #1e5a3f; border-left-color: #3aa673; }
.ev-busy { background: repeating-linear-gradient(135deg, #efecf0, #efecf0 6px, #e6e2e8 6px, #e6e2e8 12px); color: var(--ink-soft); border-left-color: #9c95a0; }
.ev-lock { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; }
.ev-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border-left: 3px solid; }
.ev-dot.ev-busy { border-left-color: #9c95a0; }
.cal-legend .icon { width: 14px; height: 14px; }
.week-scroll { overflow-x: auto; }
.week-grid { display: grid; grid-template-columns: 54px repeat(7, minmax(110px, 1fr)); min-width: 880px; }
.week-corner, .week-allday-label { border-bottom: 1px solid var(--line); }
.week-allday-label { font-size: 11px; color: var(--muted); padding: 6px 4px; text-align: right; }
.week-day-head { display: grid; justify-items: center; padding: 10px 4px 8px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); text-transform: capitalize; }
.week-day-head strong { font-size: 20px; color: var(--ink); font-weight: 600; line-height: 1.1; }
.week-day-head.is-today strong { color: #fff; background: var(--accent); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; }
.week-allday { display: grid; gap: 3px; align-content: start; padding: 4px; min-height: 30px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-soft); }
.week-hours { display: grid; grid-template-rows: repeat(14, 48px); }
.week-hour { position: relative; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; }
.week-hour span { position: relative; top: -7px; }
.week-col { position: relative; display: grid; grid-template-rows: repeat(14, 48px); border-left: 1px solid var(--line-soft); }
.week-col.is-today { background: #fdf8f6; }
.week-slot { border-top: 1px solid var(--line-soft); }
.week-slot:hover { background: rgba(187, 73, 47, .06); }
.ev-block { position: absolute; margin: 0 2px; white-space: normal; z-index: 1; display: flex; flex-direction: column; gap: 1px; box-shadow: 0 1px 2px rgba(56, 42, 62, .08); }
.ev-block time { font-size: 11px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head { padding: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--line); }
.month-day { min-height: 112px; padding: 6px; display: grid; gap: 3px; align-content: start; border-bottom: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); min-width: 0; }
.month-day.is-outside { background: #faf8fa; }
.month-day.is-outside .month-date { color: #b6afb9; }
.month-date { font-size: 13px; font-weight: 600; justify-self: start; padding: 1px 6px; border-radius: 99px; }
.month-day.is-today .month-date { background: var(--accent); color: #fff; }
.month-more { font-size: 12px; color: var(--accent); font-weight: 500; }
.agenda { display: grid; gap: 14px; }
.agenda-day { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; }
.agenda-date { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 500; color: var(--muted); text-transform: capitalize; }
.agenda-date strong { font-size: 28px; line-height: 1; color: var(--ink); }
.agenda-day.is-today .agenda-date strong { color: var(--accent); }
.agenda-list, .today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.agenda-item { display: flex; gap: 14px; align-items: baseline; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); }
.agenda-item:hover { border-color: #d9c8cf; }
.agenda-item time { flex: 0 0 96px; font-size: 13px; font-weight: 600; }
.agenda-text { display: grid; gap: 2px; min-width: 0; }
.agenda-text small { font-size: 12.5px; color: var(--muted); }
.ev-border-visit { border-left-color: var(--accent) !important; }
.ev-border-meeting { border-left-color: var(--purple) !important; }
.ev-border-absence { border-left-color: #e0a526 !important; }
.ev-border-task { border-left-color: #4a7fb5 !important; }
.ev-border-other { border-left-color: #3aa673 !important; }
.ev-border-busy { border-left-color: #9c95a0 !important; }
.event-card { border-left: 5px solid var(--accent); }
.event-card h1 { margin-bottom: 6px; }
.today-card { margin-bottom: 22px; }
.today-card .card-title { display: flex; align-items: center; gap: 8px; }
.today-card .card-title .icon { color: var(--accent); width: 18px; height: 18px; }

/* Demo */
.demo-bar { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 9px 40px; background: var(--ink); color: #f3edf5; font-size: 13.5px; }
.demo-bar-text { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.demo-pill { padding: 2px 8px; border-radius: 5px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.demo-roles { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.demo-roles-label { color: #cbbfd0; margin-right: 4px; }
.demo-roles button { border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #f3edf5; padding: 4px 10px; border-radius: 99px; font-size: 13px; }
.demo-roles button:hover { background: rgba(255, 255, 255, .1); }
.demo-roles button[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: #fff; font-weight: 600; }
.demo-cta { border: 0; background: var(--orange); color: #fff; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.demo-cta:hover { background: var(--accent); }
.demo-features { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.demo-features li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.demo-features .icon { color: var(--accent); margin-top: 1px; }
.demo-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-tour { margin-bottom: 22px; border-color: #ecc9bd; background: linear-gradient(180deg, #fff 0%, #fdf6f3 100%); }
.demo-tour .card-title { display: flex; align-items: center; gap: 8px; }
.demo-tour .card-title .icon { color: var(--accent); }
.demo-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; counter-reset: step; }
.demo-steps a { display: grid; gap: 3px; height: 100%; padding: 12px 14px 12px 44px; position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s; }
.demo-steps a::before { counter-increment: step; content: counter(step); position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.demo-steps a:hover { border-color: var(--accent); }
.demo-steps strong { font-size: 14px; }
.demo-steps span { font-size: 13px; color: var(--muted); }

/* Responsive */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .split-aside { position: static; }
  .form-section { grid-template-columns: 1fr; gap: 14px; }
  .preview-layout, .generate-layout, .grid-docs { grid-template-columns: 1fr; }
  .preview-info, .generate-help { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(56, 42, 62, .18); }
  .sidebar .sidebar-close { display: inline-grid; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(56, 42, 62, .35); }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; padding: 10px 12px; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); }
  .main { padding: 22px 16px 48px; }
  .demo-bar { padding: 10px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 24px 16px; }
  .auth-card { padding: 28px 0; }
}
@media (max-width: 600px) {
  .form-grid, .split-aside .form-grid, .form-grid-inline { grid-template-columns: 1fr; }
  .page-header { align-items: flex-start; }
  .page-actions, .page-actions .button { width: 100%; }
  .filters { flex-direction: column; }
  .search { max-width: none; }
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 10px; }
  .card { padding: 18px 16px; }
  .card-flush { padding: 0; }
  .patient-head-side { width: 100%; justify-content: space-between; }
  .patient-head-side .page-actions { width: auto; }
  .patient-head-side .page-actions .button { width: auto; }
  .invite-list { grid-template-columns: 1fr; }
  .table th, .table td { padding-left: 12px; padding-right: 12px; }
  .table-patients th:nth-child(2), .table-patients td:nth-child(2), .table-patients th:nth-child(3), .table-patients td:nth-child(3), .table-patients th:nth-child(5), .table-patients td:nth-child(5) { display: none; }
  .copy-field { flex-direction: column; }
  .form-grid-3, .details-compact { grid-template-columns: 1fr; }
  .goal-list, .resource-list { grid-template-columns: 1fr; }
  .recording { grid-template-columns: 1fr; gap: 8px; }
  .recording .row-actions { justify-content: flex-start; }
  .section-bar .page-actions { width: 100%; }
  .agenda-day { grid-template-columns: 1fr; gap: 6px; }
  .agenda-item { flex-direction: column; gap: 2px; }
  .agenda-item time { flex: none; }
  .cal-person { margin-left: 0; width: 100%; }
  .kanban-column { flex-basis: 260px; }
  .preview-stage iframe { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .back-link, .no-print, .messages, .nav-backdrop, .danger-inline { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #d8d2da; break-inside: avoid; padding: 12px 14px; }
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .articulation-view { grid-template-columns: repeat(3, 1fr); }
  .page-header { margin-bottom: 12px; }
}
