.wf-screen { display:grid; min-width:0; gap:17px; }
.wf-screen .page-head { margin-bottom:3px; }
.wf-screen .wf-card { min-width:0; }
.wf-card-header { align-items:center; }
.wf-card-header .wf-note { margin-top:0; }
.wf-screen .wf-split { align-items:start; }
.wf-note { display:block; max-width:72ch; margin-top:.21rem; font-size:.82rem; line-height:1.4; overflow-wrap:anywhere; white-space:pre-wrap; }
.wf-screen .wf-actions { gap:7px; }
.wf-screen .wf-card-header .wf-actions { flex-shrink:0; max-width:100%; }
.wf-card > .wf-actions { justify-content:flex-start; margin-top:13px; }
.wf-screen th:last-child,.wf-screen td:last-child { text-align:right; }
.wf-screen td:last-child .wf-actions { justify-content:flex-end; }
.wf-screen td .wf-actions .btn { min-height:34px; padding:.39rem .58rem; }
.wf-screen tbody td { overflow-wrap:normal; }
.wf-screen .table-wrap > table { min-width:440px; }
.wf-screen .table-wrap > table:has(th:nth-child(6)) { min-width:680px; }
.wf-screen .table-wrap > table:has(th:nth-child(7)) { min-width:760px; }
.wf-screen .table-wrap td:first-child { min-width:60px; }
.wf-screen .table-wrap td:first-child:has(.wf-identity) { min-width:160px; }
.wf-screen .table-wrap td:has(.wf-actions) { width:1%; min-width:162px; }
.wf-screen .table-wrap td:has(.wf-actions) .wf-actions { flex-wrap:nowrap; }
.wf-status--completed,.wf-status--active,.wf-status--payment,.wf-status--arrived { color:#14654c; background:#e4f4eb; }
.wf-status--pending,.wf-status--requested,.wf-status--waiting,.wf-status--charge { color:#805013; background:#fff1d7; }
.wf-status--scheduled,.wf-status--planned,.wf-status--in_exam { color:#245d81; background:#e6f0fa; }
.wf-status--cancelled { color:#94324f; background:#faebf0; }
.wf-screen .wf-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:9px; }
td .wf-tags { margin-top:0; }
.wf-stat { min-height:100px; display:grid; align-content:start; gap:6px; background:linear-gradient(153deg,#fff 45%,#faf8fc); }
.wf-stat > .muted { font-weight:650; font-size:.875rem; }
.wf-stat > strong,.wf-big-number { font-size:clamp(1.45rem,2.4vw,2rem); line-height:1.18; font-weight:750; font-variant-numeric:tabular-nums; letter-spacing:-.04em; }
.wf-stat .wf-note { margin-top:0; }
.wf-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr)); gap:13px; }
.wf-announcement { display:flex; align-items:center; justify-content:space-between; gap:13px; background:#f1f8f4; border-color:#cee3d8; }
.wf-search-form { display:flex; flex-wrap:wrap; align-items:end; gap:8px; margin-bottom:16px; }
.wf-search-form .field { width:min(100%,410px); }
.wf-search-form.wf-compact { flex-wrap:nowrap; margin-bottom:0; }
.wf-search-form.wf-compact .field { width:auto; flex:1 1 auto; }
.wf-list { display:grid; gap:0; }
.wf-list-item { display:flex; align-items:center; justify-content:space-between; padding:12px 0; gap:12px; border-top:1px solid var(--line); }
.wf-list-item:first-child { border-top:0; }
.wf-list-item > div:first-child { min-width:0; }
.wf-list-item strong { overflow-wrap:anywhere; }
.wf-identity { display:flex; align-items:center; gap:10px; min-width:0; overflow-wrap:anywhere; }
.wf-avatar { display:grid; place-items:center; width:37px; height:37px; flex:0 0 37px; border-radius:11px; color:var(--plum); background:var(--lav); font-size:.79rem; font-weight:750; }
.wf-related { margin-top:13px; padding-top:11px; border-top:1px solid var(--line); display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.wf-related .btn { min-height:34px; }
.wf-def { display:grid; grid-template-columns:1fr 1fr; gap:13px 19px; margin:0; }
.wf-def div { min-width:0; }
.wf-def dt { font-size:.83rem; color:var(--muted); }
.wf-def dd { font-weight:620; overflow-wrap:anywhere; white-space:pre-wrap; margin:.18rem 0 0; }
.wf-calendar-toolbar,.wf-filter-line { display:flex; justify-content:space-between; align-items:center; gap:13px; flex-wrap:wrap; }
.wf-calendar-toolbar .muted { margin-top:.3rem; font-size:.85rem; }
.wf-week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; margin:17px 0 15px; }
.wf-week-day { display:grid; place-items:center; gap:2px; min-width:0; min-height:86px; padding:6px 2px; background:#fbfbfd; color:var(--muted); border:1px solid var(--line); border-radius:11px; font-size:.80rem; }
.wf-week-day strong { font-size:1.25rem; color:var(--ink); }
.wf-week-day:hover,.wf-week-day.active { color:var(--plum); background:var(--lav); border-color:#e4ccdf; }
.wf-week-day.active strong { color:var(--plum); }
.wf-calendar-count { display:grid; place-items:center; min-width:20px; height:20px; border-radius:999px; padding-inline:5px; background:#e9daea; color:#59344f; font-size:.7rem; line-height:1; font-weight:730; }
.wf-calendar-count--empty { background:transparent; color:#7d7281; }
.wf-filter-line .wf-tabs { flex:1 1 225px; margin-bottom:0; border:0; }
.wf-date-jump { flex:0 0 auto; }
.wf-date-jump input { min-width:130px; }
.wf-filter-line + .table-wrap { margin-top:13px; }
.wf-filter-line .wf-search-form { flex:0 1 290px; }
.wf-bars { display:grid; gap:10px; }
.wf-bar-row { display:grid; grid-template-columns:minmax(106px,1fr) minmax(40px,2fr) max-content; align-items:center; gap:10px; font-size:.85rem; color:var(--muted); }
.wf-bar-row > span { overflow-wrap:anywhere; }
.wf-bar-row b { display:inline-block; min-width:22px; text-align:right; color:var(--ink); font-variant-numeric:tabular-nums; }
.wf-bar-track progress { appearance:none; display:block; width:100%; height:9px; overflow:hidden; border:none; border-radius:99px; background:#f2edf5; color:var(--plum); }
.wf-bar-track progress::-webkit-progress-bar { background:#f2edf5; border-radius:99px; }
.wf-bar-track progress::-webkit-progress-value { background:linear-gradient(90deg,var(--plum),#597faf); border-radius:99px; }
.wf-bar-track progress::-moz-progress-bar { background:linear-gradient(90deg,var(--plum),#597faf); border-radius:99px; }
.wf-inbox { display:grid; grid-template-columns:minmax(230px,1fr) minmax(0,2fr); gap:16px; align-items:start; }
.wf-thread-list { display:grid; gap:4px; max-height:460px; overflow:auto; margin-top:11px; }
.wf-thread { display:flex; align-items:center; gap:8px; padding:8px; text-align:left; border:1px solid transparent; border-radius:10px; background:transparent; min-width:0; }
.wf-thread:hover,.wf-thread.active { background:#f8eff6; border-color:#ead9e7; }
.wf-thread-text { display:block; min-width:0; flex:1; }
.wf-thread-text strong,.wf-thread-text .wf-note { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.wf-conversation { display:flex; flex-direction:column; gap:10px; min-height:195px; max-height:420px; overflow:auto; padding:12px; border:1px solid var(--line); border-radius:12px; background:#faf9fc; }
.wf-bubble { align-self:flex-start; display:grid; gap:3px; max-width:min(94%,510px); min-width:0; padding:9px 12px; border-radius:12px 12px 12px 4px; background:#fff; border:1px solid var(--line); }
.wf-bubble--out { align-self:flex-end; border-radius:12px 12px 4px 12px; background:#f3e9f2; border-color:#e6d5e4; }
.wf-bubble p { font-size:.9rem; overflow-wrap:anywhere; white-space:pre-wrap; }
.wf-message-direction { font-size:.73rem; font-weight:740; color:var(--plum); }
.wf-compose { display:flex; gap:9px; align-items:end; margin-top:12px; }
.wf-compose .field { flex:1; }
.wf-compose textarea { min-height:66px; }
.wf-dialog { width:min(calc(100dvw - 22px),680px); max-height:calc(100dvh - 22px); padding:0; overflow:auto; }
.wf-dialog-form { gap:0; }
.wf-dialog-header,.wf-dialog-actions { position:sticky; z-index:1; background:white; padding:13px 19px; }
.wf-dialog-header { top:0; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.wf-dialog-header h2 { margin:0; }
.wf-dialog-actions { bottom:0; border-top:1px solid var(--line); }
.wf-dialog-content { padding:16px 19px; }
.wf-dialog-content:empty { padding:0; }
.wf-form-section + .wf-form-section { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.wf-form-section h3 { margin:0 0 11px; color:var(--plum); }
.wf-form-grid .wf-wide { grid-column:1/-1; }
.wf-checkbox { display:flex; align-items:flex-start; gap:7px; line-height:1.4; font-size:.89rem; }
.wf-checkbox input { margin-top:2px; }
.wf-form-alert { margin-top:10px; padding:9px 12px; background:#fbeaef; color:#8c2848; border:1px solid #f3d0db; border-radius:9px; }
.wf-rx-list { display:grid; gap:12px; }
.wf-rx { margin-bottom:4px; }
.wf-rx-empty { font-size:.87rem; margin-bottom:10px; }
.wf-rx > button { margin-top:6px; }
.wf-rx-item { min-width:0; border:1px solid var(--line); background:#f8f9fc; border-radius:12px; padding:10px 12px 9px; margin:0 0 4px; }
.wf-rx-item legend { color:var(--plum); font-weight:700; font-size:.87rem; padding-inline:7px; }
.wf-rx-item > button { margin-top:8px; }
.wf-detailed-actions { display:grid; gap:11px; margin-top:16px; }
.wf-detailed-actions .wf-actions { justify-content:flex-start; }
.wf-dialog-content > .wf-def + .wf-form-section { margin-top:18px; }
.wf-official-filters { justify-content:flex-start; margin-bottom:14px; }
.wf-official-filters .field { flex:0 1 180px; }
.wf-clinic-profile { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.wf-clinic-logo { width:72px; height:48px; object-fit:contain; border:1px solid var(--line); padding:3px; border-radius:8px; }
.wf-clinic-profile ~ .wf-actions { justify-content:flex-start; margin-top:12px; }
.wf-demo-fill { margin-top:15px; }
.wf-screen .sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
#wf-print { display:none; }
@media (max-width:780px) {
  .wf-screen .wf-split,.wf-inbox { grid-template-columns:1fr; }
  .wf-thread-list { max-height:225px; }
  .wf-search-form .field { width:auto; flex:1 1 180px; }
}
@media (max-width:530px) {
  .wf-screen { gap:13px; }
  .wf-card-header { align-items:flex-start; flex-wrap:wrap; }
  .wf-card-header .wf-actions { justify-content:flex-start; }
  .wf-announcement { align-items:flex-start; flex-direction:column; }
  .wf-announcement .wf-actions { justify-content:flex-start; }
  .wf-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .wf-week { gap:4px; }
  .wf-week-day { min-height:68px; font-size:.72rem; }
  .wf-week-day strong { font-size:1.12rem; }
  .wf-dialog-header,.wf-dialog-actions,.wf-dialog-content { padding-inline:12px; }
  .wf-official-filters .field { flex:1 1 120px; }
  .wf-rx-item { padding-inline:8px; }
  .wf-bar-row { grid-template-columns:minmax(78px,1fr) minmax(24px,1fr) max-content; }
}
@media print {
  @page { size:A4; margin:12mm; }
  :root,body { margin:0; min-width:0; background:white; color:#161616; }
  body:has(> #wf-print) > :not(#wf-print) { display:none !important; }
  #wf-print { display:block; font:10pt/1.24 Arial,sans-serif; }
  #wf-print h1 { font-size:18pt; margin:10px 0; }
  #wf-print h2 { font-size:11pt; margin:0 0 4px; }
  #wf-print section { break-inside:avoid; margin-bottom:7px; }
  #wf-print dl { margin:0; border:1px solid #d9d9d9; }
  #wf-print dl > div { display:grid; grid-template-columns:33% 67%; border-top:1px solid #e1e1e1; }
  #wf-print dl > div:first-child { border-top:0; }
  #wf-print dt,#wf-print dd { margin:0; padding:2px 6px; overflow-wrap:anywhere; white-space:pre-wrap; }
  #wf-print dt { font-weight:bold; }
  #wf-print .wf-print-head { display:flex; justify-content:space-between; border-bottom:2px solid #4f072d; padding-bottom:7px; }
  #wf-print .wf-print-head > div { min-width:0; }
  #wf-print .wf-print-head > div:last-child { text-align:right; display:grid; justify-items:end; align-content:space-between; font-size:10pt; }
  #wf-print .wf-print-head strong { color:#4f072d; font-size:13pt; }
  #wf-print .wf-print-identity { display:flex; align-items:center; gap:12px; padding-right:12px; overflow-wrap:anywhere; }
  #wf-print .wf-print-tenant-logo { flex-shrink:0; width:108px; height:60px; object-fit:contain; }
  #wf-print .wf-print-head .brand-wordmark--print { width:132px; height:auto; flex-shrink:0; }
  #wf-print .wf-print-head > div:last-child .brand-wordmark--print { width:80px; }
  #wf-print .wf-print-sign { display:flex; justify-content:space-around; min-height:66px; margin-top:11px; padding-top:7px; border-top:1px solid #d9d9d9; break-inside:avoid; }
}
