@font-face { font-family: Vazirmatn; src: url("fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("fonts/Vazirmatn-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

* { box-sizing: border-box; }
.demo-shortcuts, .demo-actions, .demo-filters, .demo-record-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.demo-shortcuts { margin-bottom: 18px; }
.demo-filters { justify-content: space-between; margin: 20px 0; }
.demo-record-heading { justify-content: space-between; }
.demo-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.demo-metric { display: grid; gap: 4px; padding: 16px; }
.demo-metric strong { font-size: 26px; }
.demo-form { padding: 20px; }
.demo-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.demo-fields label, .demo-filters label { display: grid; gap: 6px; font-size: 12px; }
.demo-fields small { color: var(--muted); font-size: 10px; }
.demo-fields input, .demo-fields select, .demo-filters select { min-width: 0; width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.demo-fields input:focus-visible, .demo-fields select:focus-visible, .demo-filters select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.demo-fields input[type="date"], .demo-fields input[type="time"] { direction: ltr; }
.demo-fields select:disabled { opacity: .7; }
.demo-fields textarea { width: 100%; min-width: 0; resize: vertical; min-height: 70px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.demo-slot-panel { margin: 12px 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.demo-slot-panel h4 { margin: 0; }
.demo-slot-panel .muted { font-size: 11px; }
.demo-slot-selected { outline: 2px solid var(--blue); background: var(--blue-soft); }
.sheet-entry-scroll { overflow: auto; max-width: 100%; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; }
.sheet-entry-table { border-collapse: collapse; text-align: right; font-size: 12px; }
.sheet-entry-table caption { text-align: right; padding: 10px; color: var(--muted); }
.sheet-entry-table th, .sheet-entry-table td { min-width: 190px; padding: 10px; vertical-align: top; border: 1px solid var(--line); }
.sheet-entry-table th { background: var(--blue-soft); }
.sheet-entry-table td .entry-field { margin: 0; }
.sheet-entry-table td .entry-field > label { display: none; }
.sheet-entry-table input, .sheet-entry-table textarea, .sheet-entry-table select { width: 100%; }
.patient-stepper { display: grid; gap: 10px; margin: 18px 0; }
.patient-step { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.patient-step.current { border: 2px solid var(--green); background: var(--green-soft); }
.patient-step.done { border-color: #8eb5a1; }
.patient-step.locked { opacity: .6; }
.patient-step strong, .patient-step small { display: block; }
.patient-step small { margin-top: 6px; color: var(--muted); }
.timeline-task { padding: 12px 0; border-bottom: 1px solid var(--line); }
@media(max-width:700px) { .patient-stepper { grid-template-columns: 1fr; } .patient-step { padding: 10px 14px; } .sidebar .nav-list { grid-template-columns: repeat(3,minmax(0,1fr)); max-width: 360px; } }
.demo-records { display: grid; gap: 14px; align-content: start; min-width: 0; }
.demo-record { padding: 18px; min-width: 0; }
.demo-record h3, .demo-detail h3 { margin: 0 0 6px; font-size: 16px; }
.demo-record p { margin: 8px 0; font-size: 12px; }
.demo-record.selected { border-color: var(--blue); }
.demo-record .demo-actions { margin: 16px 0 10px; }
.demo-record details { margin-top: 12px; font-size: 12px; }
.demo-record summary { cursor: pointer; }
.demo-case-layout { display: grid; gap: 20px; align-items: start; }
.demo-detail { min-width: 0; padding: 22px; }
.demo-detail .demo-form { padding: 12px 0; }
.demo-detail .demo-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demo-case-info { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 12px; }
.demo-case-info dt { color: var(--muted); }
.demo-case-info dd { margin: 0; }
.demo-timeline { padding-inline-start: 20px; font-size: 12px; }
.demo-timeline li { padding: 7px 0; }
.demo-timeline small { display: block; color: var(--muted); }
.demo-check { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 12px; }
.demo-check input { width: 18px; height: 18px; accent-color: var(--green); }
.demo-empty { padding: 22px; color: var(--muted); }
@media (max-width: 900px) { .demo-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }  }
@media (max-width: 560px) { .demo-fields, .demo-detail .demo-fields { grid-template-columns: 1fr; } .demo-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .demo-actions > button { min-height: 44px; } }
html { min-width: 320px; background: var(--page); }
body {
  margin: 0;
  font: 15px/1.75 Vazirmatn, Tahoma, Arial, sans-serif;
}
button { font: inherit; }
button[hidden], [hidden] { display: none !important; }
button:focus-visible, a:focus-visible { outline: 3px solid #78b9a5; outline-offset: 3px; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 3;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 26px 16px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; font-size: 20px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; font-size: 11px; }
.nav-list { display: grid; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav-item {
  display: flex;
  align-items: center;
  padding: 0 13px;
  text-align: right;
  background: transparent;
  cursor: pointer;
}

.nav-group { min-width: 0; }
.nav-section-label { margin: 8px 0 0; }
.nav-section-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 12px;
  text-align: right;
  cursor: pointer;
}
.nav-section-toggle:hover, .nav-section-toggle[aria-expanded="true"] { color: #fff; background: #ffffff10; }
.nav-section-toggle > span { transition: transform .18s ease; }
.nav-section-toggle[aria-expanded="true"] > span { transform: rotate(180deg); }
.nav-group-items { display: grid; gap: 2px; }
.nav-subitem { width: 100%; min-height: 38px; gap: 9px; padding-inline: 12px; font-size: 12px; }
.nav-subitem > span:first-child { width: 18px; flex: 0 0 18px; color: #9ebbb0; font-size: 12px; }
.nav-subitem > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-secondary-group { padding-top: 8px; border-top: 1px solid #ffffff1b; }
.sidebar-bottom { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #ffffff1b; font-size: 11px; }
.status-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #dfa94c; }

.main-content { min-height: 100vh; margin-right: 248px; padding: 30px clamp(20px, 4vw, 58px) 25px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { margin: 2px 0 0; }
.eyebrow { margin: 0; color: var(--muted); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.environment { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: #ffffffb8; color: #68766f; font-size: 11px; }
.environment .status-dot { width: 7px; height: 7px; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; font-weight: 800; }
.manager-entry-button { padding: 8px 13px; font-size: 11px; font-weight: 700; cursor: pointer; }

.notice { display: flex; align-items: center; gap: 12px; margin-bottom: 27px; padding: 12px 15px; border: 1px solid #eedfbe; border-radius: 13px; background: #fffaf0; color: #655536; }
.notice p { margin: 0; font-size: 12px; }

.notice-icon { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border: 1px solid #e8d5aa; border-radius: 50%; font-size: 12px; font-weight: 800; }
.notice.subtle { border-color: #e5ece8; background: #f7faf8; color: var(--muted); }
.notice.subtle .notice-icon { border-color: #dae6df; }

.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.welcome-row h2 { margin: 5px 0 3px; font-size: clamp(20px, 2.4vw, 29px); letter-spacing: -.5px; }
.muted { margin: 0; color: var(--muted); font-size: 13px; }
.date-card { display: inline-flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: #61716a; font-size: 12px; white-space: nowrap; }
.date-icon { color: var(--green); font-size: 18px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 0 15px; }
.section-heading h2, .panel-heading h2 { margin: 3px 0 0; }
.tag { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; white-space: nowrap; }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.live-data-section { margin: 0 0 22px; }
.entry-form { margin-top: 16px; }
.manager-login-panel { display: grid; max-width: 640px; gap: 16px; margin: 30px auto; padding: 24px; }
.manager-login-panel h3 { margin: 3px 0; font-size: 17px; }
.manager-login-panel .entry-field input { width: 100%; }
.manager-login-panel .refresh-button { justify-self: start; min-width: 110px; }
.finance-subheading { margin-top: 28px; }
.finance-table-panel { overflow-x: auto; padding: 10px 16px; }
.finance-table { width: 100%; border-collapse: collapse; min-width: 660px; text-align: right; }
.finance-table th, .finance-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
.finance-table th { color: #5e6f84; font-weight: 700; background: #f7f9fc; }
.finance-table td:first-child { font-weight: 700; }
.secondary-button { color: #475b75; border-color: #dce4ed; }
.entry-toolbar { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.entry-toolbar label { font-size: 12px; font-weight: 700; }
.entry-toolbar select { min-width: 180px; padding: 8px 10px; border: 1px solid #dfe7e2; border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.entry-group { margin: 17px 0 0; }

.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry-field { display: flex; min-width: 0; flex-direction: column; }
.entry-field label { color: #53625b; font-weight: 700; }
.entry-field input, .entry-field select, .entry-field textarea { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid #dfe7e2; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; }
.entry-field textarea { resize: vertical; }
.entry-field input:focus, .entry-field select:focus, .entry-field textarea:focus, .entry-toolbar select:focus { border-color: #78b9a5; outline: 2px solid #78b9a533; }
.entry-field input[readonly], .entry-field select:disabled { border-style: dashed; color: #808a84; background: #f5f7f5; }
.entry-field small { color: #929e97; }
.entry-actions { display: flex; align-items: center; gap: 12px; padding-top: 15px; border-top: 1px solid var(--line); }
.entry-actions p { margin: 0; color: var(--muted); font-size: 10px; }
.live-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.live-data-card { min-width: 0; padding: 17px; }
.live-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.live-card-heading h3 { margin: 1px 0 0; font-size: 13px; }
.live-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 15px; }
.live-metric { display: flex; min-width: 0; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; }
.live-metric span { color: var(--muted); font-size: 10px; }
.live-metric strong { font-size: 16px; }
.live-source, .data-updated { margin: 13px 0 0; color: #929e97; font-size: 10px; }
.data-message { min-height: 28px; margin: -4px 0 12px; color: #68766f; }

.journey-filter { margin: 14px 0 18px; padding: 16px; }
.journey-filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.journey-filter-fields .refresh-button { min-height: 39px; }
.journey-filter-hint { margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.journey-filter-hint.warning { color: #8d5a19; }
.refresh-button { cursor: pointer; }

.summary-card, .panel { border: 1px solid var(--line); }
.summary-card { display: grid; grid-template-columns: 38px 1fr; align-content: start; align-items: center; column-gap: 11px; }
.summary-icon { display: grid; width: 38px; height: 38px; grid-row: span 2; place-items: center; border-radius: 12px; font-size: 18px; }
.summary-icon.green { color: var(--green); background: var(--green-soft); }

.card-label { color: #66746d; font-size: 12px; font-weight: 650; }
.placeholder { grid-column: 2; margin-top: 10px; font-size: 15px; }
.card-foot { grid-column: 1 / -1; margin-top: 20px; color: #99a39e; font-size: 10px; }

.content-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 15px; }
.panel { padding: 20px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.panel-mark { color: #c0cbc5; font-size: 12px; font-weight: 700; }
.journey { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 10px; margin: 22px 0 17px; }
.journey-step { display: flex; align-items: center; gap: 10px; min-width: 0; }
.journey-step > span { border: 1px solid #dcece4; font-size: 11px; font-weight: 800; }
.journey-step strong, .journey-step small { display: block; }
.journey-step strong { font-size: 12px; }
.journey-step small { margin-top: 1px; color: #929e97; font-size: 9px; line-height: 1.5; }
.text-button { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; background: transparent; border: 0; cursor: pointer; }

.connection-row { display: flex; align-items: center; border-bottom: 1px solid #f0f2f0; }
.connection-row:first-of-type { margin-top: 12px; }
.connection-row:last-of-type { margin-bottom: 9px; border-bottom: 0; }
.connection-logo { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: 14px; font-weight: 800; }
.connection-logo.crm { color: var(--blue); background: var(--blue-soft); }
.connection-logo.tasks { color: var(--violet); background: var(--violet-soft); }
.connection-logo.apps { color: var(--amber); background: var(--amber-soft); }
.connection-row > span:nth-child(2) { min-width: 0; flex: 1; }
.connection-row strong, .connection-row small { display: block; }
.connection-row strong { font-size: 11px; }
.connection-row small { overflow: hidden; margin-top: 2px; color: #98a29c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.view { display: none; }
.view.active { display: block; animation: appear .18s ease-out; }
@keyframes appear { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.workflow-grid, .team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.workflow-number { color: #a9bbb2; font-size: 11px; font-weight: 800; }
.workflow-card h3, .team-card h3, .report-row h3, .connection-detail h3 { margin: 9px 0 4px; }
.workflow-card p, .team-card p, .report-row p, .connection-detail p, .note-panel p { margin: 0; color: var(--muted); font-size: 11px; }
.workflow-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 23px; padding-top: 10px; border-top: 1px solid #f0f2f0; color: #939e98; font-size: 9px; }
.note-panel { margin-top: 14px; background: #f9fbf9; box-shadow: none; }
.note-panel > strong { display: block; margin-bottom: 5px; font-size: 12px; }
.team-card { display: flex; align-items: center; gap: 12px; min-height: 94px; }
.team-card > div { min-width: 0; flex: 1; }
.team-card h3 { margin: 0 0 3px; }
.team-symbol { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); font-weight: 800; }
.team-symbol.blue { color: var(--blue); background: var(--blue-soft); }
.team-symbol.amber { color: var(--amber); background: var(--amber-soft); }
.team-symbol.violet { color: var(--violet); background: var(--violet-soft); }
.team-grid + .notice { margin-top: 15px; }
.report-list { display: grid; gap: 10px; }
.report-row { display: flex; align-items: center; gap: 13px; padding: 15px 17px; }
.report-row > div { min-width: 0; flex: 1; }
.report-row h3 { margin: 0 0 3px; }
.report-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); }
.report-icon.blue { color: var(--blue); background: var(--blue-soft); }
.report-icon.amber { color: var(--amber); background: var(--amber-soft); }
.report-icon.violet { color: var(--violet); background: var(--violet-soft); }
.report-status { color: #909b95; font-size: 10px; white-space: nowrap; }
.connection-detail-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid #edf1ed; }
.connection-detail-row:last-child { border-bottom: 0; }
.connection-detail-row > div { min-width: 0; flex: 1; }
.connection-detail-row h3 { margin: 0 0 3px; }
.connection-detail-row p { line-height: 1.7; }
.footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; border-top: 1px solid #e9eeea; color: #9aa49f; font-size: 10px; }

@media (max-width: 980px) {
  .sidebar { width: 215px; }
  .main-content { margin-right: 215px; padding-inline: 25px; }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar { position: fixed; inset: auto 0 0; width: auto; flex-direction: row; align-items: center; }
  .brand, .sidebar-bottom { display: none; }
  .nav-list { width: 100%; }
  .nav-item { text-align: center; }
  .nav-item > span { height: 23px; font-size: 17px; }
  
  .main-content { margin: 0; }
  .topbar { margin-bottom: 16px; }
  .topbar h1 { font-size: 21px; }
  .environment { padding: 6px 8px; font-size: 9px; }
  .topbar-actions { gap: 8px; }
  .manager-entry-button { padding: 7px 9px; font-size: 10px; }
  .manager-login-panel { margin: 18px 0; padding: 18px; }
  .avatar { width: 34px; height: 34px; }
  .notice { align-items: start; margin-bottom: 22px; padding: 10px 11px; }
  .welcome-row { align-items: start; margin-bottom: 25px; }
  .welcome-row h2 { max-width: 260px; font-size: 21px; }
  .welcome-row .muted { max-width: 250px; font-size: 11px; }
  .date-card { padding: 8px; font-size: 9px; }
  .summary-grid { grid-template-columns: 1fr; gap: 9px; }
  .live-data-grid { grid-template-columns: 1fr; gap: 9px; }
  
  .entry-toolbar, .entry-actions { align-items: stretch; flex-direction: column; }
  .journey-filter-fields { grid-template-columns: 1fr; }
  .entry-toolbar select { width: 100%; }
  .live-data-card { padding: 14px; }
  .live-metrics { gap: 7px; }
  .live-metric { padding: 7px 8px; }
  .live-metric strong { font-size: 14px; }
  .data-message { font-size: 10px; }
  .refresh-button { padding: 6px 8px; font-size: 9px; }
  .summary-card { min-height: 112px; grid-template-columns: 37px 1fr; padding: 13px; }
  .card-foot { margin-top: 10px; }
  .journey { grid-template-columns: 1fr; }
  .workflow-grid, .team-grid { grid-template-columns: 1fr; }
  .workflow-card { min-height: 155px; }
  .report-row { align-items: start; gap: 9px; padding: 12px; }
  .report-row p { font-size: 10px; }
  .report-status { align-self: center; font-size: 9px; }
  .connection-detail-row { align-items: start; gap: 9px; }
  .connection-detail-row .tag { align-self: center; }
  .connection-detail p { font-size: 10px; }
  .footer { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

:root {
  color-scheme: light;
}

html, body { background: var(--page); }

button, input, select, textarea { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(47, 86, 139, .34);
  outline-offset: 3px;
}

.brand-mark { border-color: rgba(255, 255, 255, .24); }

.nav-item.active > span { color: #fff; }

.environment, .date-card {
  border-color: rgba(31, 57, 91, .1);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
.avatar {
  border-color: rgba(34, 65, 106, .14);
}
.notice, .notice.subtle {
  border-color: rgba(36, 70, 116, .12);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.summary-card, .panel {
  border-color: rgba(31, 57, 91, .1);
  background: rgba(255, 255, 255, .69);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.summary-card, .live-data-card, .workflow-card, .team-card, .report-row, .connection-detail {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.summary-card:hover, .live-data-card:hover, .workflow-card:hover, .team-card:hover, .report-row:hover {
  border-color: rgba(37, 70, 116, .18);
}
.entry-form { background: rgba(255, 255, 255, .78); }
.entry-toolbar { border-bottom-color: var(--line); }
.entry-toolbar select, .entry-field input, .entry-field textarea, .entry-field select {
  border-color: rgba(34, 62, 99, .15);
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
}
.entry-field select {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid rgba(34, 62, 99, .15);
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
}
.entry-field input:focus, .entry-field textarea:focus, .entry-field select:focus, .entry-toolbar select:focus {
  border-color: rgba(43, 78, 127, .46);
  outline: 2px solid rgba(57, 94, 146, .12);
}
.entry-field input[readonly] { background: rgba(237, 241, 247, .7); }
.entry-field small.field-warning { color: #8b6a36; }
.entry-group { border-top: 1px solid rgba(28, 54, 91, .07); }
.entry-actions { border-top-color: var(--line); }
.refresh-button {
  border-color: rgba(30, 59, 99, .16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.live-metric { background: rgba(238, 243, 249, .66); }

.status-dot.connected { background: #527b6b; }
.journey-step > span { border-color: rgba(37, 70, 116, .14); color: #18345b; background: rgba(233, 239, 248, .76); }
.workflow-meta, .connection-row, .entry-group { border-color: rgba(28, 54, 91, .09); }
.connection-logo, .team-symbol { color: #18345b; background: rgba(232, 239, 248, .84); }
.connection-logo.crm, .team-symbol.blue { color: #315477; background: rgba(235, 241, 248, .9); }
.connection-logo.tasks, .team-symbol.violet { color: #526785; background: rgba(238, 241, 247, .9); }
.connection-logo.apps, .team-symbol.amber { color: #765d35; background: rgba(245, 241, 232, .9); }
.report-icon, .summary-icon.green { color: #18345b; background: rgba(232, 239, 248, .88); }
.summary-icon.blue { color: #315477; background: rgba(235, 241, 248, .9); }
.summary-icon.amber { color: #765d35; background: rgba(245, 241, 232, .9); }

@media (max-width: 700px) {
  .sidebar {
  padding-bottom: calc(5px + env(safe-area-inset-bottom));
}
  
  
  
  .main-content { padding-bottom: calc(116px + env(safe-area-inset-bottom)); }
  
}

@media (prefers-reduced-transparency: reduce) {
  .summary-card, .panel, .notice, .notice.subtle, .environment, .date-card, .refresh-button, .sidebar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-color: #fff;
}
}

body {
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item {
  gap: 12px;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.nav-item > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item > span {
  width: auto;
  color: inherit;
  font-size: inherit;
  text-align: right;
}
.nav-item.active {
  border-color: rgba(255, 255, 255, .12);
}
.more-menu {
  display: contents;
}
.main-content {
  max-width: 1500px;
  padding-top: 34px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: .01em;
}

.summary-grid {
  gap: 16px;
}
.summary-card, .panel {
  border-radius: 20px;
}
.summary-card {
  min-height: 148px;
  padding: 20px;
}
.summary-card:hover, .live-data-card:hover, .workflow-card:hover, .team-card:hover, .report-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 34px rgba(27, 46, 75, .075);
}
.entry-form {
  padding: clamp(16px, 2.4vw, 26px);
}
.entry-toolbar {
  padding-bottom: 19px;
}
.entry-group {
  margin-top: 21px;
  padding-top: 15px;
}
.entry-group legend {
  margin-bottom: 14px;
}
.entry-grid {
  gap: 15px;
}
.entry-field {
  gap: 7px;
}
.entry-field label {
  font-size: 11px;
}
.entry-field input, .entry-field textarea, .entry-field select {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
}
.entry-field textarea {
  min-height: 76px;
}
.entry-field small {
  font-size: 10px;
  line-height: 1.6;
}
.entry-actions {
  margin-top: 24px;
}
.entry-actions .refresh-button {
  min-height: 42px;
  padding-inline: 18px;
}
.route-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.route-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}
.route-card h3 {
  margin: 2px 0 3px;
  font-size: 13px;
}
.route-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.route-card .text-button {
  flex: 0 0 auto;
}
.workflow-grid {
  gap: 16px;
}
.workflow-card {
  min-height: 198px;
  border-radius: 20px;
}
.workflow-card h3, .team-card h3, .report-row h3, .connection-detail h3 {
  font-size: 13px;
  font-weight: 700;
}
.workflow-card p, .team-card p, .report-row p, .connection-detail p, .note-panel p {
  line-height: 1.8;
}
.connection-row {
  gap: 12px;
  padding: 14px 0;
}
.connection-logo, .team-symbol, .summary-icon {
  border-radius: 13px;
}
.refresh-button {
  padding-inline: 14px;
}
.footer {
  padding-top: 18px;
}
.benchmark-tabs { display: grid; gap: 14px; }
.benchmark-tab { min-width: 0; padding: 16px; }
.benchmark-tab h3 { margin: 0 0 10px; font-size: 14px; }
.benchmark-table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.benchmark-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.benchmark-table th, .benchmark-table td { min-width: 95px; padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: right; white-space: pre-wrap; }
.benchmark-table th { color: #40574f; background: #f3f7f4; font-weight: 700; }
.benchmark-table tr:last-child td { border-bottom: 0; }
.benchmark-truncated { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.crm-report-list { display: grid; gap: 14px; }
.crm-month-report { padding: 18px; }
.crm-month-report h3 { margin: 0 0 12px; font-size: 15px; }
.crm-month-report h4 { margin: 18px 0 8px; font-size: 12px; }
.crm-month-report .live-data-grid { margin-bottom: 12px; }
.crm-quality-note { margin: 10px 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.crm-report-warning { margin: 4px 0 10px; }
.crm-mapping-group { min-width: 0; }
.crm-column-grid { margin-top: 10px; }
.crm-replace-option { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.crm-replace-option input { accent-color: var(--green); }

@media (max-width: 700px) {
  .sidebar {
  height: calc(76px + env(safe-area-inset-bottom));
  padding: 5px 7px calc(5px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
}
  .nav-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 260px;
  margin-inline: auto;
  gap: 2px;
}
  .nav-item {
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 5px 2px;
  border-radius: 12px;
  line-height: 1.35;
}
  .nav-item > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}
  .nav-item > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
  .more-menu > .nav-group { display: contents; }
  .more-menu .nav-item {
  display: none;
}
  .more-menu .nav-section-label { display: none; }
  .sidebar.more-open .more-menu {
  position: absolute;
  inset: auto 12px calc(100% + 10px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: 18px;
}
  .sidebar.more-open .more-menu .nav-section-label {
  display: block;
  grid-column: 1 / -1;
  margin: 3px 0 0;
}
  .sidebar.more-open .nav-section-toggle {
  min-height: 42px;
  padding-inline: 10px;
  font-size: 12px;
}
  .sidebar.more-open .nav-group-items {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding-bottom: 6px;
}
  .sidebar.more-open .more-menu .nav-item {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  font-size: 11px;
}
  .sidebar.more-open .more-menu .nav-item > span {
  text-align: right;
}
  .sidebar.more-open .more-menu .nav-item { min-height: 42px; padding: 6px 8px; }
  .sidebar.more-open .nav-subitem > span:last-child { white-space: normal; }
  .sidebar.more-open .nav-subitem > span:first-child { width: 18px; flex: 0 0 18px; font-size: 11px; }
  .route-cards {
  grid-template-columns: 1fr;
}
  .route-card {
  align-items: flex-start;
  flex-direction: column;
}
  .main-content {
  padding: 20px 15px calc(94px + env(safe-area-inset-bottom));
}
  .entry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
  .entry-form, .panel {
  border-radius: 17px;
}
}

@media (max-width: 380px) {
  .entry-grid {
  grid-template-columns: 1fr;
}
  .topbar h1 {
  font-size: 21px;
}
}
.avatar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.journey-step > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 12px;
}
.journey-step > span svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.summary-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.employee-app-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
}
.employee-app-panel h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
}
.employee-app-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
.employee-app-panel .employee-app-status {
  margin-top: 10px;
  color: #536780;
  font-weight: 650;
}
.employee-app-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(30, 59, 99, .12);
  border-radius: 17px;
  color: #18345b;
  background: rgba(232, 239, 248, .82);
}
.employee-app-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 701px) {
  .more-toggle { display: none; }
}
@media (max-width: 700px) {
  .employee-app-panel {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}
  .employee-app-panel > button {
  grid-column: 1 / -1;
  width: 100%;
}
  .sidebar.more-open .more-menu {
  max-height: min(60vh, 360px);
  overflow-y: auto;
}
}

.patient-context { margin-bottom: 22px; border-inline-start: 4px solid var(--green); }
.patient-context > label { display: grid; gap: 6px; max-width: 420px; margin-bottom: 12px; }
.patient-context select { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; }
.patient-context .patient-step { font: inherit; cursor: pointer; text-align: start; min-width: 0; }
.patient-context .patient-step:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
@media(max-width:700px) { .patient-context .patient-stepper { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; } }

/* Clear operational forms and adjacent navigation flyouts. */
body { line-height: 1.9; }
input, select, textarea, button { font-family: inherit; }
.section-heading h2 { font-size: 23px; letter-spacing: -.35px; }
.demo-fields label, .demo-filters label, .demo-record p, .demo-case-info { font-size: 13px; }
.demo-form > h3 { margin: 0 0 20px; font-size: 19px; }
.demo-form > h4 { margin: 26px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; color: var(--green-dark); }
.demo-form .demo-fields { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfb; }
.demo-form > .demo-actions, .demo-form > button[type=submit] { margin-top: 20px; }
.view > .demo-records, .view > .demo-case-layout, .view > .workflow-grid { margin-block: 24px; }
.entry-group { margin-block: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fcfdfc; min-width: 0; }
.entry-group legend { padding-inline: 9px; color: var(--green-dark); font-size: 15px; font-weight: 600; }
.auto-fields { margin-block: 18px; padding: 14px 18px; border: 1px dashed #cad8d1; border-radius: 12px; color: var(--muted); }
.auto-fields > summary { cursor: pointer; font-size: 13px; }
.auto-fields > .entry-grid, .auto-fields > .demo-fields { margin-top: 15px; }
.page-link, button[data-open] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #c5d7ef; border-radius: 10px; padding: 9px 13px; background: #edf4ff; color: #22558a; font-weight: 600; text-decoration: none; }
.page-link:hover, button[data-open]:hover { background: #dfeeff; border-color: #7ea5d2; }
.page-link::after, button[data-open]::after { font-size: 16px; }
.doctor-members { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 16px; }
.doctor-members .demo-check { margin: 0; padding: 8px; border-radius: 8px; background: white; }
.nav-group-items { position: fixed; right: 250px; top: var(--flyout-top,100px); width: 290px; max-height: min(70vh,580px); overflow: auto; padding: 12px; border: 1px solid #d9e5df; background: #fff; color: var(--ink); z-index: 25; }
.nav-group-items .nav-item { border-radius: 10px; padding: 11px; }
.nav-group-items .nav-item:hover, .nav-group-items .nav-item.active { background: var(--green-soft); color: var(--green-dark); }
.nav-section-toggle[aria-expanded=true] { background: #ffffff18; border-radius: 9px; }
@media(max-width:900px) { .doctor-members { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) {
 .nav-group-items { position: fixed; right: 12px; left: 12px; top: auto; bottom: 86px; width: auto; max-height: 60vh; }
 .doctor-members { grid-template-columns: 1fr; }
 .section-heading h2 { font-size: 20px; }
}

/* One patient header and one timeline per view. */
#view-patienttimeline > #demo-timeline-steps { display: none; }
#view-patienttimeline > .section-heading { margin-top: 24px; }
#view-patienttimeline label:has(#demo-timeline-person) { display: none; }
#demo-timeline-heading > h3, #demo-timeline-heading > p:first-of-type { display: none; }
.patient-context > strong { display: none; }
.patient-context .auto-fields { margin-bottom: 0; }
.mizito-checklist > .doctor-members { margin-top: 16px; }
.sheet-entry-table:not(.show-auto-columns) .auto-column { display: none; }
.walkthrough-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:24px 0; }
.walkthrough-case { padding:24px; display:flex; flex-direction:column; align-items:start; gap:14px; }
.walkthrough-case h3, .walkthrough-case p { margin:0; }
.walkthrough-case p { font-size:13px; color:var(--muted); }
.patient-next-action { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:18px; padding-top:16px; border-top:1px solid var(--line); font-size:13px; }
.stage-work { padding:24px; margin:20px 0; border-inline-start:4px solid var(--green); }
.stage-work h3 { margin-top:0; }
.selected-patient { outline:3px solid var(--blue); outline-offset:3px; }
.patient-step:disabled { cursor:not-allowed; }
@media(max-width:800px) { .walkthrough-grid { grid-template-columns:1fr; } .patient-next-action { align-items:stretch; flex-direction:column; } }

/* Call-center workbooks: a full-page editable grid with manual columns first. */
.operator-mode .main-content, .queue-mode .main-content { max-width:none; padding:18px 20px 12px; }
.operator-mode .main-content > .topbar, .operator-mode .main-content > .notice, .operator-mode .footer { display:none; }
.sheet-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:12px; }
.sheet-heading h2 { margin:0; font-size:20px; }
.cc-new-lead { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cc-new-lead select, #cc-pool-owner { font:inherit; padding:8px; border:1px solid var(--line); border-radius:9px; background:white; }

.operator-table,.lead-queue-table { border-collapse:separate; border-spacing:0; width:max-content; min-width:100%; font-size:13px; text-align:right; }
.operator-table th,.operator-table td,.lead-queue-table th,.lead-queue-table td { padding:10px; border-inline-end:1px solid #e0e7e3; border-bottom:1px solid #e0e7e3; min-width:150px; max-width:240px; vertical-align:top; background:white; }
.operator-table th,.lead-queue-table th { position:sticky; top:0; z-index:2; background:#e9f2ef; color:#214d42; white-space:nowrap; }
.operator-table td:first-child,.operator-table th:first-child { position:sticky; right:0; min-width:160px; z-index:3; background:#f4f8f6; }
.operator-table th:first-child { z-index:4; }
.operator-table input,.operator-table select,.operator-table textarea { font:inherit; width:100%; min-width:145px; border:1px solid #cad7d0; border-radius:6px; padding:9px; background:white; }
.operator-table textarea { min-width:230px; min-height:60px; resize:vertical; }
.operator-table input:focus,.operator-table textarea:focus,.operator-table select:focus { outline:2px solid #75a898; outline-offset:1px; }
.operator-table .needs-date { border-color:#3973aa; background:#f0f6ff; }
.operator-grid:not(.show-automatic) .auto-column { display:none; }
.lead-queue-scroll { overflow:auto; max-width:100%; border:1px solid var(--line); border-radius:12px; }
.lead-queue-table td { min-width:120px; }
.lead-queue-table td:nth-child(6) { min-width:260px; white-space:normal; }
.operator-sheet > .data-message:empty, .cc-queue-shell > .data-message:empty { display:none; }
.operator-table tr.selected-patient td { background:#f0f7ff; }
@media(max-width:800px){.sheet-heading { align-items:start; flex-direction:column; }.operator-grid { min-height:65vh; max-height:70vh; }.operator-mode .main-content { padding:16px 10px 96px; }}
.operator-table td:first-child,.operator-table th:first-child { width:160px; max-width:160px; }
.operator-table td:nth-child(2),.operator-table th:nth-child(2) { position:sticky; right:160px; min-width:175px; width:175px; max-width:175px; z-index:3; background:#f4f8f6; }
.operator-table th:nth-child(2) { z-index:4; }

/* Reception form and electronic record. Section order, labels beside fields and dark table headers follow the current CRM's pages. */
.bt-form { display: grid; gap: 18px; }
.bt-section { min-width: 0; margin: 0; padding: 14px 18px 18px; border: 1px solid var(--line); border-radius: 12px; }
.bt-section legend { padding: 0 8px; }
.bt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 26px; }
.bt-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bt-field { display: grid; grid-template-columns: minmax(78px, 34%) minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.bt-field > span { overflow-wrap: anywhere; }
.bt-field > span small { display: block; color: var(--muted); font-size: 10px; }
.bt-field input, .bt-field select, .bt-field textarea, .bt-field output { min-width: 0; width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.bt-field output { display: flex; align-items: center; overflow-wrap: anywhere; }

.bt-field textarea { min-height: 74px; resize: vertical; }
.bt-field input:focus-visible, .bt-field select:focus-visible, .bt-field textarea:focus-visible, .bt-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.bt-wide { grid-column: 1 / -1; }
.bt-wide.bt-field { grid-template-columns: minmax(78px, 12%) minmax(0, 1fr); }
.bt-area { align-items: start; }
.bt-area > .bt-check { padding-top: 8px; }
.bt-checks { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.bt-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.bt-check input { width: 18px; height: 18px; accent-color: var(--green); }
.bt-rows { display: grid; gap: 12px; }
.bt-row { display: grid; grid-template-columns: 56px repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 10px 18px; }
.bt-row-title { align-self: center; font-size: 12px; font-weight: 600; }
.bt-row .bt-field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.bt-row .bt-field > span { color: var(--muted); font-size: 11px; }
.bt-btn { min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f1f4f2; color: var(--muted); font: inherit; font-size: 12px; }
.bt-btn:disabled { cursor: not-allowed; }
.bt-remaining input { font-weight: 600; }
.bt-remaining input.bt-debt { color: #b3261e; }
.bt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bt-record { display: grid; gap: 14px; margin: 16px 0; }
.bt-history-line { margin: 0; font-size: 12px; }
.bt-emr-form { display: grid; gap: 14px; }
.bt-tabs { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f7; }
.bt-tab-row { display: flex; flex-wrap: wrap; gap: 4px; }
.bt-tab { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }

.bt-tab[aria-selected="true"] { background: var(--surface); font-weight: 600; }
.bt-plus { color: var(--green); font-weight: 700; }
.bt-panel { display: grid; gap: 12px; min-width: 0; }
.bt-panel[hidden] { display: none; }
.bt-table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.bt-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 12px; }
.bt-table th { padding: 10px; text-align: right; white-space: nowrap; }
.bt-table td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
.bt-table .bt-empty { color: var(--muted); text-align: center; }
.demo-case-layout { grid-template-columns: minmax(200px, .45fr) minmax(0, 2fr); }
.demo-detail .bt-grid, .demo-detail .bt-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .bt-grid, .bt-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-case-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .bt-grid, .bt-grid-4, .demo-detail .bt-grid, .demo-detail .bt-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .bt-field, .bt-wide.bt-field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bt-row { grid-template-columns: minmax(0, 1fr); }
  .bt-section { padding: 12px; }
  .bt-tab, .bt-actions > button { min-height: 44px; }
}

/* Integration map: one card per timeline stage, showing where the stage is entered today (sheet / CRM / Mizito) and what replaces it. */
.map-lead { max-width: 760px; margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.map-src { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 11px; line-height: 1.6; }
.map-sheet { color: var(--green-dark); background: var(--green-soft); }
.map-crm { color: #24506f; background: var(--blue-soft); }
.map-mizito { color: #4d4180; background: var(--violet-soft); }
.map-today { margin-bottom: 18px; padding: 16px 20px; }
.map-today summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.map-today ol { display: grid; gap: 8px; margin: 14px 0 0; padding-inline-start: 22px; font-size: 12px; }
.map-stages { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.map-stage { padding: 18px 20px; }
.map-stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.map-stage-head > div { flex: 1; min-width: 0; }
.map-stage-head h3 { margin: 0; font-size: 15px; }
.map-stage-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.map-step { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--green-dark); color: #fff; font-size: 13px; font-weight: 600; }
.map-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.map-cols h4 { margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 600; }
.map-cols p { margin: 0 0 12px; font-size: 12px; line-height: 1.9; }
.map-src-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.map-note { margin: 4px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 12px; }

.map-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.map-extra .panel { padding: 18px 20px; }
.map-extra h3 { margin: 0 0 10px; font-size: 14px; }
.map-extra ul, .map-extra ol { display: grid; gap: 8px; margin: 0; padding-inline-start: 18px; font-size: 12px; line-height: 1.8; }
.map-extra .map-src-list { margin-top: 6px; padding: 0; }
@media (max-width: 900px) { .map-cols, .map-extra { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .map-stage, .map-extra .panel { padding: 14px; } .map-stage-head { flex-wrap: wrap; } }
.map-coverage { margin-bottom: 18px; padding: 18px 20px; }
.map-coverage h3 { margin: 0 0 8px; font-size: 14px; }
.map-coverage p { margin: 0 0 12px; font-size: 12px; line-height: 1.9; }
.map-coverage code { direction: ltr; unicode-bidi: isolate; font-size: 11px; }
.map-class-table { min-width: 420px; }
.map-fields { margin-top: 14px; }
.map-fields summary { cursor: pointer; color: var(--green-dark); font-size: 12px; font-weight: 600; }
.map-fields .bt-table-scroll { margin-top: 10px; }
.map-field-table { min-width: 720px; }
.map-field-table th[scope="row"], .map-class-table th[scope="row"] { min-width: 170px; border-top: 1px solid var(--line); background: none; color: var(--ink); font-weight: 600; text-align: right; white-space: normal; }
.map-field-table td:last-child { min-width: 260px; color: var(--muted); font-size: 11px; line-height: 1.8; }

/* ============================================================
   UI v2 — one calm palette for the whole panel (appended last on purpose: it settles the three earlier theme layers).
   Primary = navy for navigation and actions. Status colours are separate and never reused for decoration:
   ok (green) · due (amber) · info/follow (blue) · new (violet) · danger (red) · neutral (grey).
   ============================================================ */
:root {
  --blue: #1d5fa8;
  --blue-soft: #e4eefb;
  --amber: #8f5300;
  --amber-soft: #fdf0d8;
  --violet: #6b3fb0;
  --violet-soft: #f0e9fb;
  --ok: #1d6b45;
  --ok-soft: #e1f3e8;
  --danger: #a8231b;
  --danger-soft: #fbe6e4;
  --neutral: #4c5766;
  --neutral-soft: #eaedf2;
}
body { font-family: Vazirmatn, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif; font-size: 14px; }
.panel, .summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); -webkit-backdrop-filter: none; backdrop-filter: none; }
.muted, .data-message, .eyebrow { color: var(--muted); }
.data-message { font-size: 12px; }
.data-message.warning { color: var(--danger); font-weight: 600; }
.refresh-button { padding: 8px 16px; border: 1px solid var(--green); background: var(--green); color: #fff; font-size: 13px; font-weight: 600; }
.refresh-button:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.refresh-button:disabled { background: var(--neutral-soft); border-color: var(--line); color: var(--muted); cursor: not-allowed; opacity: 1; }
.text-button { font-size: 13px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.tag { min-height: 24px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.tag.neutral { color: var(--neutral); background: var(--neutral-soft); }
.tag.success { color: var(--ok); background: var(--ok-soft); }
.tag.map-partial { color: var(--amber); background: var(--amber-soft); }
.tag.map-missing { color: var(--danger); background: var(--danger-soft); }
.section-heading h2, .panel-heading h2 { color: var(--ink); }
.bt-section { background: var(--surface); border-color: var(--line); }
.bt-section legend { font-size: 14px; font-weight: 600; }
.bt-section legend small { color: var(--muted); font-size: 12px; font-weight: 400; }
.bt-field { font-size: 13px; }
.bt-field > span { color: var(--muted); }
.bt-field input, .bt-field select, .bt-field textarea { border-color: #c9d3de; font-size: 14px; }
.bt-field output { min-height: 38px; background: var(--surface-2); border-color: var(--line); color: var(--ink); font-size: 14px; }
.bt-field input[readonly], .bt-field input:disabled, .bt-field textarea:disabled { background: var(--surface-2); color: var(--muted); }

.bt-tab[aria-selected="true"] { border-color: var(--green); color: var(--green-dark); }
.bt-tab:hover { background: var(--green-soft); }

/* Call-center workspace: list of this operator's patients beside one full record (replaces the 37-column strip). */
.operator-grid { min-height: 0; max-height: none; overflow: visible; border: 0; border-radius: 0; background: none; }
.cc-workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.cc-list { position: sticky; top: 16px; display: grid; gap: 12px; max-height: calc(100vh - 32px); padding: 14px; overflow: auto; }
.cc-list input[type="search"] { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid #c9d3de; border-radius: 10px; background: var(--surface); font: inherit; }
.cc-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip { min-height: 32px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }

.cc-items { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cc-item { display: grid; gap: 4px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: right; cursor: pointer; }
.cc-item:hover { border-color: #a9bacb; background: var(--surface-2); }
.cc-item.selected { border-color: var(--green); background: var(--green-soft); }
.cc-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-item strong { font-size: 14px; }
.cc-item small { color: var(--muted); font-size: 12px; }
.cc-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.cc-record { display: grid; gap: 16px; padding: 18px 20px; }
.cc-record-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cc-record-head h3 { margin: 0; font-size: 20px; }
.cc-record-head p { margin: 4px 0 0; font-size: 13px; }
.cc-auto { display: none; }
.operator-grid.show-automatic .cc-auto { display: block; }
.cc-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 -20px -18px; padding: 12px 20px; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; background: var(--surface); }
.cc-record .needs-date { border-color: var(--blue); background: var(--blue-soft); }
.tag.cc-tag-new { color: var(--violet); background: var(--violet-soft); }
.tag.cc-tag-follow { color: var(--blue); background: var(--blue-soft); }
.tag.cc-tag-due { color: var(--amber); background: var(--amber-soft); }
.tag.cc-tag-booked { color: var(--ok); background: var(--ok-soft); }
@media (max-width: 1100px) { .cc-workspace { grid-template-columns: 250px minmax(0, 1fr); } }
@media (max-width: 800px) {
  .cc-workspace { grid-template-columns: minmax(0, 1fr); }
  .cc-list { position: static; max-height: 320px; }
  .cc-actions { margin: 0 -12px -12px; padding: 12px; }
}
.cc-record .bt-field, .cc-record .bt-wide.bt-field { grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: start; }
.cc-record .bt-grid { gap: 14px 18px; }

/* No arrows or link icons on buttons: a link looks like a link, an action looks like a button. */
.page-link::after, button[data-open]::after { content: none; }
button[data-open], .page-link { padding: 4px 0; border: 0; border-radius: 0; background: none; font-size: 13px; font-weight: 600; }
button[data-open]:hover, .page-link:hover { background: none; text-decoration: underline; }

/* List first, record second (every section). */
.list-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 18px; margin-bottom: 10px; padding: 14px 16px; }
.list-filters label { display: grid; gap: 6px; min-width: 170px; color: var(--muted); font-size: 12px; }
.list-filters input, .list-filters select { min-height: 40px; padding: 7px 10px; border: 1px solid #c9d3de; border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.list-table { padding: 0; overflow-x: auto; }
.list-table .bt-table { min-width: 560px; }
.list-table tbody tr { cursor: pointer; }

.row-open { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: right; }
.row-open:hover { text-decoration: underline; }
.cc-back { margin-bottom: 10px; }
.record-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.record-steps li { counter-increment: step; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; }
.record-steps li::before { content: counter(step, persian) ". "; }
.record-steps li.done { border-color: var(--ok-soft); background: var(--ok-soft); color: var(--ok); }
.record-steps li.current { color: #fff; font-weight: 600; }
.patient-context[hidden] { display: none; }
.patient-close { float: left; }
.referral-panel { margin-bottom: 18px; padding: 16px 18px; }
.referral-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.referral-head h3 { margin: 0; font-size: 16px; }
.referral-panel .list-filters { padding: 0; margin-bottom: 12px; }
.referral-close { display: flex; flex-wrap: wrap; gap: 6px; }
.referral-close input { min-width: 160px; min-height: 36px; padding: 6px 10px; border: 1px solid #c9d3de; border-radius: 8px; font: inherit; }
.referral-close .refresh-button { min-height: 36px; }

/* Month overview cards */
.overview-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.overview-card { align-content: start; gap: 6px; min-height: 0; padding: 16px 18px; border-top: 4px solid var(--line); }
.overview-card .card-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.overview-card strong { color: var(--ink); font-size: 30px; line-height: 1.2; }
.overview-card .card-foot { color: var(--muted); font-size: 12px; }
.overview-card.tone-ok { border-top-color: var(--ok); }
.overview-card.tone-info { border-top-color: var(--blue); }
.overview-card.tone-violet { border-top-color: var(--violet); }
.overview-card.tone-neutral { border-top-color: var(--neutral); }
.overview-progress { display: block; height: 6px; margin-top: 4px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.overview-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
#overview-period { margin: 4px 0 0; font-size: 12px; }
#view-patientfiles .demo-case-layout { grid-template-columns: minmax(0, 1fr); }
#view-patientfiles:not(.record-open) #demo-case-detail { display: none; }
#view-patientfiles.record-open #demo-case-list, #view-patientfiles.record-open > .list-filters { display: none; }
.overview-card { display: flex; flex-direction: column; align-items: stretch; }
.overview-card > * { grid-column: auto; }

/* Persian date controls */
.range-control { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; }
.range-control label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.range-control input { width: 118px; min-height: 40px; padding: 7px 10px; border: 1px solid #c9d3de; border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; text-align: center; }
.range-control select { min-height: 40px; }
.range-control input.invalid { border-color: var(--danger); background: var(--danger-soft); }
.day-control .text-button { min-height: 40px; }
.owner-change summary { cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 600; }
.owner-change form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.owner-change select, .owner-change input { min-height: 34px; padding: 4px 8px; border: 1px solid #c9d3de; border-radius: 8px; font: inherit; font-size: 13px; }

/* Booking: category boxes, month calendar, day slots */
.booking-categories { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.booking-box { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: right; cursor: pointer; box-shadow: var(--shadow); }
.booking-box span { color: var(--muted); font-size: 13px; font-weight: 600; }
.booking-box strong { font-size: 26px; }
.booking-box small { color: var(--muted); font-size: 12px; }
.booking-box.active { border-color: var(--green); box-shadow: inset 0 -4px 0 var(--green); }
.booking-box:disabled { opacity: .45; cursor: not-allowed; }
.booking-form { display: grid; gap: 16px; }
.booking-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calendar-head strong { font-size: 16px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-weekday { padding: 4px 0; color: var(--muted); font-size: 12px; text-align: center; }
.calendar-day { display: grid; justify-items: center; gap: 2px; min-height: 58px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.calendar-day .calendar-num { font-size: 15px; font-weight: 600; }
.calendar-day small { color: var(--ok); font-size: 11px; min-height: 14px; }
.calendar-day.filled { background: var(--ok-soft); }
.calendar-day.full { background: var(--ok); border-color: var(--ok); color: #fff; }
.calendar-day.full small { color: #fff; }
.calendar-day.past { opacity: .55; }
.calendar-day.today { border-color: var(--blue); }
.calendar-day.selected { outline: 2px solid var(--green); outline-offset: 1px; }
.booking-day h3 { margin: 0 0 10px; font-size: 15px; }
.slot-list { display: grid; gap: 6px; }
.slot { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: 13px; text-align: right; }
.slot-time { min-width: 44px; font-weight: 600; }
.slot.booked { border-color: #bfe3cc; background: var(--ok-soft); color: var(--ok); }
.slot.empty { color: var(--muted); cursor: pointer; }
.slot.empty:hover { border-color: var(--green); color: var(--green-dark); }
.slot.unavailable { color: var(--muted); background: var(--surface-2); font-size: 12px; }
.all-appointments { margin-top: 16px; padding: 14px 18px; }
.all-appointments summary { cursor: pointer; font-weight: 600; }
/* Clinic day */
.clinic-row { justify-content: flex-start; gap: 10px 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.clinic-row > span:first-child { min-width: 240px; font-weight: 600; }
.clinic-group h3 { margin-bottom: 6px; }
.doctor-tabs { margin: 4px 0 8px; }
@media (max-width: 900px) { .booking-layout, .booking-categories { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .booking-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .booking-categories { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .calendar-day { min-height: 46px; } .clinic-row > span:first-child { min-width: 0; width: 100%; } }
/* Seven operational sections, shared reservation calendar and surgery days. */
.patient-stepper { grid-template-columns:repeat(7,minmax(0,1fr)); }
.record-steps { grid-template-columns:repeat(7,minmax(0,1fr)); }
.calendar-day.filled { background:#111820 !important; color:#fff !important; font-weight:800; border-color:#111820; }
.calendar-day.filled .calendar-num,.calendar-day.filled small { color:#fff !important; font-weight:800; }
.calendar-day.filled.selected { outline:3px solid #73b5a3; outline-offset:2px; }
.clinic-time-card { padding:22px; border-inline-start:4px solid var(--green); }
.clinic-time-card h3 { margin:0 0 12px; }
.clinic-time-card p { margin:0 0 14px; font-size:13px; }
.care-summary { padding:18px; border:1px solid var(--line); background:#f6f9f7; border-radius:12px; margin:18px 0; grid-template-columns:auto 1fr auto 1fr; }
#unified-room-root > label { max-width:440px; margin-block:20px; }
#unified-room-root > label select { font:inherit; padding:10px; border:1px solid var(--line); border-radius:10px; background:#fff; }
#surgery-calendar { max-width:780px; margin-block:20px; }
#booking-members { min-height:150px; }
@media(max-width:900px){.patient-stepper,.record-steps { grid-template-columns:repeat(2,minmax(0,1fr)); }.care-summary { grid-template-columns:auto 1fr; }}
.calendar-patients { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; font-weight:400; }

/* Compact daily appointments, coordinator reservation calendar, and patient identity. */
#demo-clinic-day-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:12px; align-items:start; }
#demo-clinic-day-list .clinic-time-card { padding:12px; margin:0; border-inline-start-width:3px; }
#demo-clinic-day-list .clinic-time-card h3 { margin:0 0 8px; font-size:15px; }
#demo-clinic-day-list .clinic-time-card p { margin:0 0 8px; font-size:12px; }
#demo-clinic-day-list .clinic-row { display:flex; flex-wrap:wrap; gap:6px; }
#demo-clinic-day-list .text-button { padding:6px 9px; font-size:12px; }
.room-reservation-layout { display:grid; grid-template-columns:minmax(285px,.85fr) minmax(0,1.15fr); gap:20px; align-items:start; }
.room-reservation-layout > * { min-width:0; }
.room-reservation-layout .bt-grid { grid-template-columns:minmax(0,1fr); }
.calendar-day.operating-day:not(.filled) { background:#e9f4ef; border-color:#4f9275; color:#164a35; }
.room-surgery-calendar .calendar-day:disabled { opacity:.4; cursor:default; }
.room-surgery-calendar > .text-button { margin:8px 0; }
.bastani-identity .bt-identity-grid { gap:16px 22px; }
.bastani-identity .bt-field { grid-template-columns:minmax(72px,.9fr) minmax(0,1.1fr); }
.bastani-identity .bt-field > span { color:var(--ink); font-weight:600; }
.bastani-identity .bt-field output { padding:5px 0; min-height:32px; background:transparent; border:0; border-radius:0; }
.bastani-identity .bt-identity-tag { grid-column:1 / -1; }
.bastani-identity .bt-identity-tag output { min-height:20px; }
.visit-board { align-items:stretch; max-width:100%; min-width:0; }
.visit-column { flex:0 0 252px; min-height:360px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); padding:10px; }
.visit-column > h3 { display:flex; justify-content:space-between; align-items:start; gap:8px; font-size:13px; min-height:52px; margin:0 0 12px; line-height:1.9; }
.visit-card { padding:12px; margin-bottom:12px; border:1px solid var(--line); border-radius:10px; }

.visit-card p { font-size:12px; margin:8px 0; }
.visit-card select { max-width:100%; width:100%; padding:6px; font:inherit; font-size:11px; border:1px solid var(--line); border-radius:6px; background:var(--surface); }
.visit-card .text-button { font-size:12px; margin-top:8px; padding:6px 8px; }
@media (max-width:1100px) { .bastani-identity .bt-grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:800px) { .room-reservation-layout { grid-template-columns:minmax(0,1fr); } }
@media (max-width:600px) { .bastani-identity .bt-identity-grid { grid-template-columns:minmax(0,1fr); } .bastani-identity .bt-field { grid-template-columns:minmax(90px,.8fr) minmax(0,1.2fr); } }

/* Keep room save errors and confirmation visible beside the sticky save action. */
.room-save-feedback { flex-basis:100%; margin:0; }
.room-save-feedback:empty { display:none; }
#unified-room-root [aria-invalid="true"] { border-color:var(--danger); }
@media (max-width:700px) { .room-reservation-layout .cc-actions { bottom:86px; } }

.aban-section-root .list-filters > select { min-width:0; max-width:100%; }
.aban-section-root .cc-actions [role="status"] { flex-basis:100%; margin:0; }
@media (max-width:700px) { .aban-section-root .cc-actions { bottom:86px; } }

/* Imported patient names must not widen the coordinator's native selector. */
#unified-room-root > label { display:grid; gap:8px; min-width:0; }
#unified-room-case { width:100%; min-width:0; max-width:100%; }

.followup-inline { display:flex; align-items:center; gap:8px; min-width:240px; }
.followup-inline input { min-width:130px; flex:1; }
#view-saleswork .list-table td { vertical-align:middle; padding-block:14px; }
.followup-inline input { min-height:42px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); font:inherit; }
.followup-inline input:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
#sales-work-date-filter .demo-filters { display:contents; }
#sales-work-date-filter label { min-width:0; }
#sales-work-date-filter > .demo-filters > label { min-width:130px; }
#sales-work-date-filter .range-control { flex:1 1 420px; }
#view-saleswork > .data-message:empty { display:none; }
body[data-aban-native="ready"] #demo-advance-clock { display:none; }
@media(max-width:560px) {
 #sales-work-date-filter { gap:12px; padding:14px; }
 #sales-work-date-filter .range-control { display:grid; grid-template-columns:1fr 1fr; gap:10px; flex-basis:100%; }
 #sales-work-date-filter .range-control label:first-child { grid-column:1 / -1; }
 #sales-work-date-filter .range-control input { width:100%; }
 #sales-work-date-filter > .demo-filters > label { flex:1 1 120px; }
}
/* Work lists, clinical summary and patient roadmap */
.data-tools { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-block:14px; }
.data-tools .bt-field { min-width:160px; flex:1 1 190px; }
.data-tools select,.data-tools input { width:100%; min-width:0; min-height:42px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; background:var(--surface); color:var(--ink); }
.data-tools .data-result-count { align-self:center; font-size:12px; }
.data-tools button { white-space:nowrap; }
.field-search-match { outline:2px solid var(--blue); outline-offset:2px; }
.clinical-summary { margin-block:16px; background:var(--surface); }
.clinical-summary dd { white-space:pre-wrap; overflow-wrap:anywhere; }
.patient-roadmap { display:grid; gap:18px; margin-top:18px; }
.roadmap-block { border:1px solid var(--line); border-right:4px solid var(--green); border-radius:12px; background:var(--surface); padding:18px; min-width:0; }
.roadmap-block >header { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.roadmap-block h3 { margin:0; font-size:16px; }
.postop-milestone { border-right:3px solid var(--line); padding:8px 14px; margin-block:8px; }
.postop-milestone.done { border-color:var(--ok); background:var(--ok-soft); }
.postop-milestone h4,.postop-milestone p { margin:4px 0; }
.patient-finance-history >h3 { margin-top:24px; }
.finance-editor input:not([type=checkbox]) { min-width:130px; width:100%; min-height:40px; border:1px solid var(--line); border-radius:8px; padding:8px; color:var(--ink); background:var(--surface); font:inherit; }
.finance-editor input[type=checkbox] { width:18px; height:18px; }
.finance-editor details { min-width:140px; }
.surgery-finance-form >.bt-section { margin-block:18px; }
.surgery-finance-form >button { margin-top:16px; }
.finance-totals { padding:16px; background:var(--blue-soft); border-radius:12px; }
[hidden] { display:none !important; }
@media(max-width:560px){ .data-tools { gap:10px; padding:12px; }.data-tools .bt-field { flex-basis:100%; }.data-tools button { flex:1; }.roadmap-block { padding:12px; }.clinical-summary .demo-case-info { grid-template-columns:1fr; } }
/* Support follows the source stages, stacked vertically without a horizontal board. */
.visit-board { display:grid; grid-template-columns:minmax(0,1fr); overflow-x:clip; overflow-y:visible; gap:16px; padding:0; }
.visit-column,.support-unassigned { flex:initial; width:100%; min-width:0; min-height:0; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.visit-column >h3,.support-unassigned >h3 { display:flex; align-items:center; justify-content:space-between; min-height:0; gap:12px; margin:0 0 12px; font-size:14px; }
.support-unassigned { border-right:4px solid var(--amber); }
.vertical-visit-list { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; }
.visit-card { margin:0; cursor:default; background:var(--surface-2); overflow-wrap:anywhere; min-width:0; }
.visit-card:active { cursor:default; }
.visit-card >header,.support-contact-record >header { display:flex; align-items:start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.support-card-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.support-card-actions >select { width:auto; flex:1 1 240px; min-width:0; min-height:40px; font-size:13px; }
.support-note-preview { white-space:pre-wrap; overflow-wrap:anywhere; }
.support-contact-list,.support-contact-history { display:grid; gap:12px; }
.support-contact-record { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px; }
.support-contact-record p { white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; line-height:1.9; margin:8px 0; }
.support-case-detail { min-width:0; }
.support-case-detail .bt-table { width:100%; table-layout:fixed; }
.support-case-detail .bt-table th,.support-case-detail .bt-table td { white-space:normal; overflow-wrap:anywhere; }
.support-case-detail >form { margin-block:20px; padding:16px; border:1px solid var(--line); border-radius:12px; }
@media(max-width:560px){ .visit-column,.support-unassigned,.support-contact-record { padding:12px; }.support-card-actions { align-items:stretch; }.support-card-actions >select { flex-basis:100%; }.support-card-actions >button { flex:1 1 120px; } }

/* Two workspaces: «ارتباط با بیمار» and «داخلی کلینیک»; each has its own sidebar menu. */
.nav-list[hidden], .bt-field[hidden] { display: none !important; }
.space-switch { display: inline-flex; gap: 4px; margin-bottom: 10px; padding: 4px; border: 1px solid var(--line); }
.space-switch button { min-height: 36px; padding: 4px 16px; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

body:not([data-space="internal"]) .internal-only { display: none; }
.internal-me { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.internal-me select { min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
@media (min-width: 701px) { .nav-narrow { display: none; } }
@media (max-width: 700px) { .nav-wide { display: none; } .space-switch { display: flex; } .space-switch button { flex: 1; } }

/* Internal workspace pages. */
.workdesk-list { margin-bottom: 16px; }
.workdesk-list h3 { margin: 0 0 8px; font-size: 15px; }
.workdesk-list ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.workdesk-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.workdesk-list li:last-child { border-bottom: 0; }
.demo-metric .text-button { justify-self: start; }
.chat-messages { display: grid; gap: 10px; max-height: 60vh; margin: 16px 0; padding: 4px; overflow-y: auto; list-style: none; }
.chat-messages > li { display: grid; gap: 2px; max-width: min(560px, 85%); padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); justify-self: start; }
.chat-messages > li.mine { justify-self: end; }
.chat-messages > li strong { font-size: 12px; }
.chat-messages > li p { margin: 0; white-space: pre-wrap; }
.chat-messages > li small { font-size: 12px; }
.chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 260px) auto; align-items: end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-compose textarea { min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; }
@media (max-width: 700px) { .chat-compose { grid-template-columns: 1fr; } }
.letter-body { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; }

/* ============================================================
   UI v3 — light, single-accent workspace (Linear / Notion / Stripe style). Appended last on purpose.
   No dark sidebar: the whole panel is one light surface family; the only strong colour is the teal accent,
   and status colours stay as soft tags. Tokens below are the only palette; never add raw colours.
   ============================================================ */
:root {
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #1b2130;
  --muted: #626b7a;
  --line: #e5e8ed;
  --line-strong: #d3d8df;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .12);
}
body { background: var(--page); color: var(--ink); }

/* Sidebar: same light family as the page, separated by a hairline. */
.sidebar { border-left: 1px solid var(--line); background: var(--surface); box-shadow: none; color: var(--ink); }
.brand { padding-bottom: 22px; }
.brand-mark { border: 0; border-radius: 10px; color: #fff; }
.brand strong { color: var(--ink); }
.brand small { color: var(--muted); }
.nav-list { gap: 2px; }
.nav-item { min-height: 40px; border: 0; border-radius: 8px; color: #3d4555; font-size: 13.5px; }
.nav-item > span:first-child, .nav-item > svg { color: #8a93a3; }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.active { border: 0; background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.nav-item.active > span, .nav-item.active > svg { color: var(--green-dark); }
.nav-section-label { margin-top: 6px; }
.nav-section-toggle { min-height: 38px; color: #6b7383; font-weight: 600; }
.nav-section-toggle:hover, .nav-section-toggle[aria-expanded="true"], .nav-section-toggle[aria-expanded=true] { background: var(--hover); color: var(--ink); }
.nav-section-toggle > span { color: #9aa2b0; }
.nav-item.more-toggle[aria-expanded="true"] { background: var(--hover); }
.sidebar-bottom { border-top-color: var(--line); color: var(--muted); }
.nav-group-items { border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); }
.nav-group-items .nav-item { color: var(--ink); }
.nav-group-items .nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-group-items .nav-item.active { background: var(--green-soft); color: var(--green-dark); }

/* Header area */
.topbar { margin-bottom: 18px; }
.topbar h1 { color: var(--ink); font-size: 22px; font-weight: 600; letter-spacing: 0; }
.environment, .date-card { border: 1px solid var(--line); background: var(--surface); box-shadow: none; color: var(--muted); }
.manager-entry-button { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: none; }
.manager-entry-button:hover { background: var(--hover); }
.avatar { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); box-shadow: none; }
.notice, .notice.subtle { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: none; color: var(--muted); }
.notice strong { color: var(--ink); }
.notice-icon, .notice.subtle .notice-icon { border-color: var(--line-strong); color: var(--muted); }
.space-switch { border-color: var(--line); background: var(--hover); border-radius: 10px; }
.space-switch button { border-radius: 8px; color: var(--muted); }
.space-switch button:hover { background: transparent; color: var(--ink); }
.space-switch button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--line); }

/* Surfaces, type, controls */
.panel, .summary-card, .booking-box { border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.section-heading h2, .panel-heading h2 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.refresh-button { min-height: 36px; border-radius: 8px; box-shadow: none; }
.text-button { color: var(--green-dark); }
.text-button:hover { color: var(--green); }
.row-open { color: var(--ink); }
.row-open:hover { color: var(--green-dark); }
.bt-field input, .bt-field select, .bt-field textarea, .list-filters input, .list-filters select, .range-control input, .data-tools select, .data-tools input, .internal-me select { border-color: var(--line-strong); border-radius: 8px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid color-mix(in srgb, var(--green) 35%, transparent); outline-offset: 1px; border-color: var(--green); }
.bt-section legend { color: var(--ink); }

/* Tables: quiet header instead of a dark bar. */
.bt-table th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.bt-table td { border-color: var(--line); }
.list-table tbody tr:hover td { background: var(--surface-2); }

/* Cards and steps keep status colours soft. */
.overview-card { border-top-width: 3px; }
.record-steps li.current { border-color: var(--green); background: var(--green); }
.cc-chip.active { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.cc-item.selected { box-shadow: inset -3px 0 var(--green); }
.chat-messages > li.mine { border-color: color-mix(in srgb, var(--green) 22%, var(--line)); background: var(--green-soft); }
.chat-messages > li strong { color: var(--green-dark); }

/* Mobile bottom bar: light, with a hairline. */
@media (max-width: 700px) {
  .sidebar { border-top: 1px solid var(--line); border-left: 0; background: var(--surface); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav-item { min-height: 58px; font-size: 10px; }
  
  .sidebar.more-open .more-menu { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-pop); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sidebar.more-open .nav-section-toggle { color: var(--ink); }
}
button[data-open], .page-link { color: var(--green-dark); }
button[data-open]:hover, .page-link:hover { color: var(--green); }
@media (max-width: 700px) { .topbar { flex-wrap: wrap; } .topbar > div:first-child { width: 100%; } .environment { display: none; } .topbar-actions { flex-wrap: wrap; } }

/* ============================================================
   Brand: navy + white (organisation colours). Light surfaces stay; navy is the only strong colour.
   ============================================================ */
:root {
  --green: #1f3a60;
  --green-dark: #142a47;
  --green-soft: #eaf0f7;
  --hover: #f1f4f8;
  --page: #f5f7fa;
}
.brand-mark { background: var(--green); }
.nav-item.active { box-shadow: inset -3px 0 var(--green); }
@media (max-width: 700px) { .nav-item.active { box-shadow: inset 0 3px var(--green); } }

/* Desktop menu groups open in place (accordion) instead of floating windows. */
@media (min-width: 701px) {
  .nav-group-items { position: static; width: auto; max-height: none; margin: 2px 0 6px; padding: 0 12px 0 0; overflow: visible; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
  .nav-group-items .nav-item { min-height: 36px; padding: 6px 10px; font-size: 13px; }
  .nav-group-items .nav-subitem > span:first-child { display: none; }
  .nav-section-toggle > span { transition: transform .15s ease; }
}

/* Breadcrumb above the page title. */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 22px; margin-bottom: 2px; font-size: 12px; color: var(--muted); }
.crumbs button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.crumbs button:hover { color: var(--green); text-decoration: underline; }
.crumb-sep { color: var(--line-strong); }

/* Quick search (⌘K). */
.command-open { display: inline-flex; align-items: center; gap: 10px; min-width: 180px; min-height: 36px; padding: 4px 10px 4px 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; justify-content: space-between; }
.command-open:hover { border-color: var(--green); color: var(--ink); }
.command-open kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); font: inherit; font-size: 11px; direction: ltr; }
dialog.command { width: min(620px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(16, 24, 40, .22); }
dialog.command::backdrop { background: rgba(20, 42, 71, .28); }
dialog.command input { width: 100%; min-height: 54px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; font-size: 16px; outline: none; }
.command-list { max-height: min(52vh, 440px); margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.command-group { padding: 10px 10px 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.command-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.command-item strong { font-weight: 600; font-size: 14px; }
.command-item small { color: var(--muted); font-size: 12px; text-align: left; }
.command-item.selected { background: var(--green-soft); }
.command-item.selected strong { color: var(--green-dark); }
.command-empty { padding: 18px; color: var(--muted); text-align: center; }
.command-hint { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; }
@media (max-width: 700px) { .command-open { min-width: 0; } .command-open kbd { display: none; } }

/* Calm page changes. */
@media (prefers-reduced-motion: no-preference) {
  .view.active { animation: view-in .18s ease-out; }
  @keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* ── Projects, tasks, letters thread (Mizito replacement) ── */
.check-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 13px; cursor: pointer; }
.check-chip:has(input:checked) { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.check-chip input { margin: 0; accent-color: var(--green); }
.tag-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.task-label { margin-inline-start: 6px; }
.bt-table tr.group-row td { padding: 10px 12px 6px; background: var(--page); color: var(--muted); font-size: 12px; font-weight: 600; cursor: default; }
.bt-table tr.unread .row-open { font-weight: 700; }
.bt-table tr.unread td:first-child { box-shadow: inset -3px 0 var(--green); }
.bt-table tr.task-done .row-open { color: var(--muted); text-decoration: line-through; }
.late { color: var(--danger); font-weight: 600; font-size: 12px; }
.inline-filters { padding: 0; border: 0; box-shadow: none; background: none; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project-card { display: grid; gap: 8px; align-content: start; padding: 16px 18px; cursor: pointer; transition: border-color .15s ease; }
.project-card:hover { border-color: var(--green); }
.project-card p { margin: 0; font-size: 12px; }
.project-card-top { display: flex; justify-content: space-between; gap: 6px; }
.project-open { font-size: 16px; text-align: right; }
.progress-stack { display: flex; height: 8px; overflow: hidden; border-radius: 999px; background: var(--neutral-soft); }
.progress-stack .seg { display: block; height: 100%; }
.seg-done { background: var(--ok); } .seg-overdue { background: var(--danger); } .seg-upcoming { background: var(--blue); } .seg-today { background: var(--violet); } .seg-nodate { background: #c3cad4; }
.project-page { gap: 14px; }
.project-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.project-stat { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.project-stat strong { font-size: 20px; }
.project-stat span { color: var(--muted); font-size: 12px; }
.project-stat.tone-due strong { color: var(--danger); }
.project-tabs { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.board { display: flex; gap: 12px; padding-bottom: 8px; overflow-x: auto; align-items: flex-start; }
.board-col { display: grid; gap: 8px; flex: 0 0 250px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.board-col.done { background: color-mix(in srgb, var(--ok-soft) 50%, var(--surface-2)); }
.board-col.drop { border-color: var(--green); background: var(--green-soft); }
.board-col header { display: flex; align-items: center; gap: 6px; }
.board-col h4 { flex: 1; margin: 0; font-size: 13px; }
.task-card { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: grab; }
.task-card.dragging { opacity: .5; }
.task-card.state-overdue { border-right: 3px solid var(--danger); }
.task-card p { margin: 0; font-size: 12px; }
.task-card .row-open { font-size: 13px; }
.task-calendar .calendar-grid { gap: 4px; }
.task-cal-day { display: grid; align-content: start; gap: 3px; min-height: 84px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; }
.task-cal-day.today { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.cal-task { overflow: hidden; padding: 2px 6px; border: 0; border-radius: 5px; background: var(--blue-soft); color: var(--blue); font: inherit; font-size: 11px; text-align: right; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.cal-task.state-overdue { background: var(--danger-soft); color: var(--danger); }
.cal-task.state-done { background: var(--ok-soft); color: var(--ok); }
.task-meter { height: 6px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.task-meter span { display: block; height: 100%; background: var(--green); }
.checklist { display: grid; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; }
.checklist li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.checklist li:hover { background: var(--hover); }
.checklist label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checklist input { accent-color: var(--green); width: 16px; height: 16px; }
.checklist li.done span { color: var(--muted); text-decoration: line-through; }
.checklist li.late span { color: var(--danger); }
.checklist small { font-size: 12px; }
.checklist-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.checklist-add input, .checklist-add select, .task-record textarea { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font: inherit; }
.task-record .bt-section > textarea { width: 100%; margin: 8px 0; }
.letter-thread { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.letter-entry { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.letter-entry p { margin: 0; white-space: pre-wrap; }
.letter-entry strong { font-size: 13px; color: var(--green-dark); }
.letter-entry.paraf { border-style: dashed; background: var(--surface-2); }
.letter-entry.decision { border-color: var(--amber-soft); background: color-mix(in srgb, var(--amber-soft) 40%, var(--surface)); }
.decision-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; grid-column: 1 / -1; }
.chat-messages > li.chat-day { justify-self: center; max-width: none; padding: 2px 12px; border: 0; background: var(--hover); color: var(--muted); font-size: 12px; }
.chat-messages > li.system { justify-self: center; max-width: 90%; padding: 4px 12px; border: 0; background: none; color: var(--muted); font-size: 12px; text-align: center; }
.chat-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chat-foot .text-button { font-size: 12px; }
.chat-readers summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.chat-readers ul { margin: 4px 0 0; padding: 0 14px 0 0; font-size: 12px; color: var(--muted); }
.workdesk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 14px; align-items: start; }
.workdesk-grid .workdesk-list { margin: 0; }
.workdesk-list li.unread .text-button { font-weight: 700; }
.workdesk-list .progress-stack { flex: 1 1 120px; min-width: 100px; }

.demo-metric.tone-due strong { color: var(--danger); }
@media (max-width: 700px) { .project-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .board-col { flex-basis: 78vw; } .task-cal-day { min-height: 56px; } .cal-task { font-size: 10px; } }
.project-page { grid-template-columns: minmax(0, 1fr); }
.project-page > *, .project-body, .cc-record > * { min-width: 0; }
.board { max-width: 100%; }
.bt-field .check-chip input, .check-chip input[type=checkbox] { width: 16px; height: 16px; min-width: 0; min-height: 0; flex: 0 0 16px; margin: 0; padding: 0; border-radius: 4px; }
.check-chip span { white-space: nowrap; color: inherit; }
.bt-field > .check-grid { grid-column: 1 / -1; }
.workdesk-metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Planner, minutes, reminders, support extras */
.qty-input { width: 84px; }
.plan-steps li.current { background: var(--green-soft); }
.plan-steps li.waiting span { color: var(--muted); }
.minutes-rows { display: grid; gap: 8px; }
.minutes-row input:not(.qty-input), .minutes-row select { flex: 1 1 160px; min-width: 0; }
.toast-stack { position: fixed; left: 16px; bottom: 16px; z-index: 40; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-right: 4px solid var(--green); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); }
.toast p { margin: 0; }
.toast .text-button { justify-self: start; }
.support-extras { display: grid; gap: 4px; margin-top: 8px; }
.support-extras ul { margin: 6px 0; padding-inline-start: 18px; font-size: 13px; }
@media (max-width: 700px) { .toast-stack { bottom: 96px; } }
.finance-issues { display: grid; gap: 4px; padding: 10px 14px; border: 1px solid var(--danger-soft); border-radius: 10px; background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.finance-editor [aria-invalid="true"], .surgery-finance-form [aria-invalid="true"], #unified-room-root [aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.is-required > span::after { content: " *"; color: var(--danger); }
/* Finance pages */
.pay-rows { display: grid; gap: 8px; }
.pay-row select, .pay-row input { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font: inherit; }
.pay-fields { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.bill-summary { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-weight: 600; color: var(--ink); }
.list-table td .checklist-add input, .list-table td select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: 12px; max-width: 160px; }
.minutes-row, .pay-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bt-field .minutes-row > select, .bt-field .minutes-row > input, .bt-field .pay-row > select, .bt-field .pay-row > input, .pay-fields > select, .pay-fields > input { flex: 1 1 150px; width: auto; min-width: 0; }
.bt-field .minutes-row > .qty-input, .bt-field .pay-row > .qty-input { flex: 0 0 84px; }
.pay-fields { flex: 3 1 320px; }

/* ── میز کار نقش‌ها، نتیجه‌گیری گزارش‌ها، صندوق پیام (۱۴۰۵/۰۸/۲۸) ── */
.desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.desk-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.desk-card strong { line-height: 1.1; }
.desk-card .text-button { align-self: flex-start; margin-top: auto; }
.report-insights h3 { margin: 0 0 8px; font-size: 1rem; }
.report-insights ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; }
.report-insights .insight-warn { color: #8a4b08; }
.report-insights .insight-good { color: #1f6b45; }
.report-insights .insight-info { color: var(--green-dark); }
.nav-show-all { display: block; margin: 8px 12px; font-size: .85rem; }
#view-inbox .chat-thread { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
#view-inbox .chat-msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; background: var(--green-soft); justify-self: start; }
#view-inbox .chat-msg.mine { background: #fff; border: 1px solid #d9e1ec; justify-self: end; }
#view-inbox .chat-msg p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.patient-comms .list-filters, .patient-docs .list-filters { flex-wrap: wrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ورود و پرداختی */
body.auth-locked .app-shell, body.auth-locked main, body.auth-locked aside { filter: blur(6px); pointer-events: none; user-select: none; }
.login-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(20, 42, 71, .55); }
.login-card { width: min(420px, 100%); display: grid; gap: 12px; }
.login-card h2 { margin: 0; color: var(--green-dark); }
.payroll-frame { width: 100%; min-height: 75vh; border: 1px solid #d9e1ec; border-radius: 12px; background: #fff; }
/* نمودار میله‌ای گزارش‌ها و جمع‌بندی بنچمارک */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin: 12px 0; }
.bar-chart { margin: 0; display: grid; gap: 6px; min-width: 0; }
.bar-chart figcaption { font-weight: 700; color: var(--green-dark); margin-bottom: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: .85rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--green-soft); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 6px; }
.bar-warn .bar-fill { background: #c47a1a; }
.bar-value { color: #475569; white-space: nowrap; font-size: .8rem; }
.benchmark-summary { display: grid; gap: 12px; }
@media (max-width: 700px) { .chart-grid { grid-template-columns: 1fr; } .bar-row { grid-template-columns: 1fr; } }
/* پیگیری ویزیت: نوار شمارش و ستون‌های کنار هم */
.visit-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; align-items: center; }
.visit-chip { border: 1px solid #d9e1ec; background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .82rem; cursor: pointer; color: var(--green-dark); }
.visit-chip[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.visit-chip.empty { color: #94a3b8; }
.visit-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.visit-board-grid .support-stage { min-width: 0; }
.visit-board-grid .visit-card { font-size: .88rem; }

/* Keep the operator's action and patient context visible above the working sheet. */
.operator-sheet .sheet-heading { background:var(--green-soft); border-inline-start:4px solid var(--green); border-radius:10px; padding:14px 18px; }
.operator-sheet .operator-grid { display:block; width:100%; max-height:none; overflow:visible; }
.operator-sheet .bt-section { margin-block:16px; padding:16px; border:1px solid var(--line); }
.operator-sheet .bt-section legend { font-weight:700; color:var(--green-dark); padding-inline:8px; }
.operator-sheet .list-table { overflow-x:auto; }
.desk-card { align-content:start; }
.aban-source-work { margin-block:24px; }

/* ── UI v4: sections are distinguishable at a glance (manager feedback 1405/09/05) ──
   Each record section gets a calm tint from the existing palette: a colored start edge,
   a soft legend band and more breathing room. No new colors. */
.bt-form fieldset.bt-section { --sec: var(--green); --sec-soft: var(--green-soft); border: 1px solid var(--line); border-inline-start: 4px solid var(--sec); border-radius: 10px; padding: 18px 18px 16px; margin-block: 22px; background: linear-gradient(to bottom, var(--sec-soft) 0, var(--surface, #fff) 46px); }
.bt-form fieldset.bt-section:nth-of-type(5n+2) { --sec: var(--blue); --sec-soft: var(--blue-soft); }
.bt-form fieldset.bt-section:nth-of-type(5n+3) { --sec: var(--violet); --sec-soft: var(--violet-soft); }
.bt-form fieldset.bt-section:nth-of-type(5n+4) { --sec: var(--ok); --sec-soft: var(--ok-soft); }
.bt-form fieldset.bt-section:nth-of-type(5n) { --sec: var(--amber); --sec-soft: var(--amber-soft); }
.bt-form fieldset.bt-section > legend { background: var(--sec-soft); color: var(--sec); border: 1px solid color-mix(in srgb, var(--sec) 25%, transparent); border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 14px; }
.bt-form fieldset.bt-section > legend small { color: var(--muted); font-weight: 400; }
.bt-form fieldset.bt-section .bt-grid { row-gap: 14px; }
.cc-record-head { padding-block-end: 14px; border-block-end: 2px solid var(--green-soft); }
.cc-record-head strong, .cc-record-head h3 { font-size: 20px; }
/* Menu stage groups: a small colored marker per stage so the journey order reads visually. */
.nav-section-toggle[aria-controls]::before { content: ""; display: inline-block; inline-size: 8px; block-size: 8px; border-radius: 50%; margin-inline-end: 8px; background: var(--neutral-soft); vertical-align: middle; }
.nav-section-toggle[aria-controls="nav-sales-items"]::before { background: var(--blue); }
.nav-section-toggle[aria-controls="nav-booking-items"]::before { background: var(--violet); }
.nav-section-toggle[aria-controls="nav-reception-items"]::before { background: var(--amber); }
.nav-section-toggle[aria-controls="nav-room-items"]::before { background: var(--green); }
.nav-section-toggle[aria-controls="nav-doctor-items"]::before { background: var(--danger); }
.nav-section-toggle[aria-controls="nav-support-items"]::before { background: var(--ok); }
.nav-section-toggle[aria-controls="nav-beauty-items"]::before { background: var(--violet-soft); box-shadow: inset 0 0 0 2px var(--violet); }
.nav-section-toggle[aria-controls="nav-club-items"]::before { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
/* Lists and panels: a touch more space and a visible header band. */
.panel.list-table .bt-table thead th { background: var(--surface-2); font-weight: 700; }
.panel.list-table .bt-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.desk-card { border-inline-start: 4px solid var(--green); }
.desk-card strong { color: var(--green-dark); font-size: 26px; }
/* Larger, clearer field text in every form (manager feedback 1405/09/05). */
.bt-form input, .bt-form select, .bt-form textarea, .bt-form output, .list-filters input, .list-filters select { font-size: 15.5px; font-weight: 500; color: var(--ink); min-block-size: 44px; }
.bt-form label, .bt-form .bt-grid > label > span, .bt-form dt, .list-filters label { font-size: 14px; font-weight: 600; color: var(--ink-2, var(--ink)); }
.bt-form output { display: flex; align-items: center; padding-inline: 12px; background: var(--surface-2); border-radius: 8px; }
.bt-table td { font-size: 14.5px; } .bt-table th { font-size: 13.5px; }
.nav-section-toggle[aria-controls="nav-mail-items"]::before { background: var(--blue); }
.nav-section-toggle[aria-controls="nav-work-items"]::before { background: var(--violet); }
.nav-section-toggle[aria-controls="nav-fin-items"]::before { background: var(--ok); }
.nav-section-toggle[aria-controls="nav-marketing-items"]::before { background: var(--amber); }
.nav-section-toggle[aria-controls="nav-reports-items"]::before { background: var(--green); }
.store-status { position: fixed; inset-block-end: 12px; inset-inline-start: 12px; z-index: 50; display: flex; gap: 10px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 13px; border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.store-status.warning { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 700px) { .store-status { inset-block-end: 72px; } }
