:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #657486;
  --line: #dfe5ec;
  --brand: #456cc4;
  --brand-strong: #3457a3;
  --accent: #d56f3e;
  --success: #287a55;
  --warn: #a36412;
  --danger: #b93c3c;
  --sky: #4a7c9d;
  --shadow: 0 2px 5px rgba(20, 33, 45, 0.035);
}

.record-workspace { background:#fff; color:#273746; min-width:0; }
.dashboard-workspace { min-width:0; }
.dashboard-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:4px 0 24px; }
.dashboard-heading .eyebrow { color:#8a96a3; font-size:10px; margin:0 0 7px; }
.dashboard-heading h2 { font-size:25px; font-weight:600; margin:0; color:#34475a; }
.dashboard-date { display:grid; gap:5px; text-align:right; font-size:12px; color:#64798b; }
.dashboard-date small { font-size:11px; color:#97a2ae; }
.dashboard-kpis { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; margin-bottom:26px; }
.dashboard-kpi { display:flex; align-items:flex-start; gap:10px; padding:16px 12px; min-width:0; min-height:134px; border:1px solid var(--kpi-border); border-radius:6px; background:var(--kpi-bg); color:var(--kpi-color); text-align:left; box-shadow:none; }
.dashboard-kpi[type="button"] { cursor:pointer; }
.dashboard-kpi[type="button"]:hover { filter:brightness(.98); }
.dashboard-kpi-icon { display:flex; align-items:center; justify-content:center; width:32px; height:32px; flex:0 0 32px; background:var(--kpi-icon-bg); border-radius:6px; }
.dashboard-kpi-body { display:flex; flex-direction:column; gap:5px; min-width:0; }
.dashboard-kpi-body > strong { font-size:23px; line-height:1.15; font-weight:650; overflow-wrap:anywhere; }
.dashboard-kpi-label { color:#526172; font-size:11px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
.dashboard-kpi-body small { font-size:10px; color:#8b96a2; line-height:1.4; overflow-wrap:anywhere; }
.kpi-red { --kpi-color:#bb4c5a; --kpi-border:#edd6db; --kpi-bg:#fffafb; --kpi-icon-bg:#f8e7eb; }
.kpi-green { --kpi-color:#679c70; --kpi-border:#dce9dd; --kpi-bg:#fbfdfb; --kpi-icon-bg:#eaf3e8; }
.kpi-amber { --kpi-color:#b57e3c; --kpi-border:#ecdfcb; --kpi-bg:#fdfbf7; --kpi-icon-bg:#f3eada; }
.kpi-violet { --kpi-color:#8b759f; --kpi-border:#e6ddea; --kpi-bg:#fdfbfe; --kpi-icon-bg:#eee8f4; }
.kpi-blue { --kpi-color:#598cb1; --kpi-border:#d9e6ef; --kpi-bg:#f9fcff; --kpi-icon-bg:#e7f1f8; }
.kpi-orange { --kpi-color:#b57758; --kpi-border:#efdfd6; --kpi-bg:#fffaf7; --kpi-icon-bg:#f8ebe1; }
.dashboard-workspace .clinic-flow > .panel-header .eyebrow { display:none; }
.dashboard-workspace .clinic-flow > .panel-header h2 { font-size:16px; color:#526476; }
.dashboard-workspace .clinic-kanban { grid-template-columns:repeat(4,minmax(0,1fr)); }
.dashboard-workspace .kanban-column { border:1px solid #e0e5eb; border-top:3px solid #9aaed1; border-radius:6px; background:#f7f9fc; }
.dashboard-workspace .stage-1 { border-top-color:#d4b678; background:#fdfbf7; }
.dashboard-workspace .stage-2 { border-top-color:#9bbd99; background:#f9fcf8; }
.dashboard-workspace .stage-3 { border-top-color:#99b4b5; background:#f7fbfb; }
.dashboard-workspace .flow-card { border:1px solid #e4e9ee; border-radius:5px; }
.dashboard-workspace .flow-empty { min-height:150px; display:grid; place-items:center; margin:0; }
.dashboard-bottom { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr); gap:26px; border-top:1px solid #e0e6ed; padding-top:24px; margin-top:28px; }
.dashboard-bottom > section { min-width:0; }
.dashboard-bottom h2 { font-size:15px; color:#526476; }
.dashboard-count { color:#8c9caa; font-weight:400; margin-left:8px; }
.dashboard-message-list article { border-bottom:1px solid #e3e9ef; padding:12px 0; }
.dashboard-message-list article > div { display:flex; justify-content:space-between; gap:12px; font-size:12px; }
.dashboard-message-list article > div > span, .dashboard-message-list small { color:#8494a2; font-size:10px; }
.dashboard-message-list p { font-size:12px; color:#617587; line-height:1.6; margin:6px 0; overflow-wrap:anywhere; }
@media(max-width:1400px) { .dashboard-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); } .dashboard-kpi { min-height:106px; } }
@media(max-width:1050px) { .dashboard-workspace .clinic-kanban { grid-template-columns:repeat(2,minmax(0,1fr)); } .dashboard-bottom { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) { .dashboard-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .dashboard-kpi { gap:8px; padding:12px 10px; min-height:150px; flex-direction:column; } .dashboard-kpi-body > strong { font-size:23px; } .dashboard-heading { align-items:flex-start; flex-direction:column; } .dashboard-date { text-align:left; } .dashboard-heading h2 { font-size:23px; } .dashboard-workspace .clinic-kanban { grid-template-columns:minmax(0,1fr); } }
.collaborator-filters { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; margin:16px 0; }
.collaborator-filters .field { flex:1 1 220px; min-width:0; }
.collaborator-filters select { width:100%; min-width:0; }
.collaborator-filters .clinic-scope { max-width:none; margin-bottom:0; }
.collaborator-filters select, .collaborator-filters > button { height:40px; box-sizing:border-box; }
.record-patient-bar { display:flex; gap:24px; justify-content:space-between; align-items:center; padding:22px 24px; border-bottom:1px solid #e4e9ee; }
.record-patient-identity { display:flex; align-items:center; gap:14px; min-width:0; }
.record-patient-identity .person-avatar { width:48px; height:48px; flex-basis:48px; }
.record-patient-identity h2 { font-size:22px; margin:4px 0; overflow-wrap:anywhere; }
.record-eyebrow { font-size:10px; font-weight:700; color:#6c7f90; letter-spacing:0; }
.record-patient-meta { font-size:12px; color:#687b8d; }
.record-patient-picker { display:grid; gap:6px; font-size:12px; color:#687b8d; width:260px; max-width:100%; }
.record-patient-picker select, .record-scene-toolbar select { min-width:0; width:100%; padding:8px 10px; border:1px solid #dbe3ea; border-radius:4px; background:#fff; color:#35495b; }
.record-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:16px 24px; gap:16px; background:#fafbfd; border-bottom:1px solid #e4e9ee; }
.record-summary > div { display:grid; gap:4px; }
.record-summary strong { font-size:18px; font-weight:600; color:#345977; overflow-wrap:anywhere; }
.record-summary span { font-size:11px; color:#788694; }
.record-tabs { display:flex; gap:20px; padding:0 24px; border-bottom:1px solid #dce4eb; flex-wrap:wrap; }
.record-tabs button { display:flex; gap:8px; align-items:center; border:0; border-bottom:2px solid transparent; border-radius:0; padding:16px 0; color:#718191; background:transparent; font-size:13px; }
.record-tabs button.active { color:#3779b4; border-bottom-color:#3779b4; }
.record-section-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:22px 24px 14px; }
.record-section-heading h2 { margin:0; font-size:20px; font-weight:600; }
.record-section-heading p { margin:5px 0 0; font-size:11px; color:#81909d; }
.record-view-switch { display:flex; border:1px solid #dce4eb; border-radius:5px; overflow:hidden; flex-shrink:0; }
.record-view-switch button { padding:8px 12px; font-size:12px; border:0; background:#f7f9fb; color:#677e90; border-radius:0; }
.record-view-switch button.active { background:#427aaa; color:#fff; }
.record-clinical-grid { display:grid; grid-template-columns:minmax(0,1fr) 245px; }
.record-model-area { min-width:0; background:#fff; }
.record-scene-toolbar { display:flex; align-items:center; justify-content:space-between; padding:8px 24px; gap:12px; }
.record-scene-toolbar label { display:flex; align-items:center; gap:8px; font-size:11px; color:#748594; }
.record-scene-toolbar select { width:100px; padding:6px; font-size:11px; }
.record-tools { display:flex; flex-wrap:wrap; gap:4px; }
.record-tool { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border:1px solid #e0e6ec; border-radius:4px; background:white; color:#5b7893; }
.record-tool:hover, .record-tool[aria-pressed="true"] { background:#e9f2fa; color:#276b9e; }
.record-tool:disabled { opacity:.45; cursor:not-allowed; }
.record-scene { position:relative; height:380px; background:#f7f9fb; }
.record-scene-canvas { position:absolute; inset:0; overflow:hidden; }
.record-scene canvas { display:block; width:100%; height:100%; touch-action:none; }
.record-model-note { position:absolute; top:12px; left:24px; right:24px; font-size:10px; color:#7c8c9a; z-index:1; pointer-events:none; }
.record-scene-message { position:absolute; top:35%; left:10%; right:10%; font-size:13px; text-align:center; background:#fff; padding:16px; border:1px solid #dce4eb; border-radius:4px; }
.record-tooth-selector { padding:14px 24px 4px; }
.record-tooth-group { margin-bottom:10px; }
.record-tooth-group > span { display:block; font-size:10px; color:#8995a0; margin-bottom:5px; }
.record-tooth-row { display:grid; grid-template-columns:repeat(16,minmax(0,1fr)); gap:4px; }
.record-tooth-row button { min-width:0; height:30px; padding:0; font-size:11px; color:#536677; background:#f7f9fb; border:1px solid #e2e7ed; border-bottom:3px solid var(--tooth-status); border-radius:3px; }
.record-tooth-row button.selected { outline:2px solid #337eaf; outline-offset:1px; background:#e8f3fb; color:#245d85; }
.record-tooth-row button.has-evolution { background:#d9edfc; color:#135b91; border-color:#1676bd; border-bottom-color:var(--tooth-status); font-weight:700; box-shadow:inset 0 0 0 1px #1676bd; }
.record-tooth-row button.has-evolution.selected { outline:3px solid #194e75; background:#b9ddf6; }
.record-legend { display:flex; flex-wrap:wrap; gap:10px 16px; padding:12px 24px 20px; font-size:10px; color:#718395; }
.record-legend span { display:flex; align-items:center; gap:5px; }
.record-legend i, .record-condition i { display:inline-block; width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.record-tooth-detail { border-left:1px solid #e4e9ee; padding:16px 20px; background:#fbfcfd; min-width:0; }
.record-selected-number { font-size:46px; line-height:1.1; font-weight:500; color:#3e6685; margin:12px 0; }
.record-condition { display:flex; align-items:center; gap:6px; font-size:11px; color:#556d7e; }
.record-condition i { background:var(--tooth-status); }
.record-tooth-anatomy { font-size:11px; color:#8a96a1; border-bottom:1px solid #e3e9ee; padding-bottom:18px; margin-bottom:18px; }
.record-tooth-detail h3 { font-size:12px; color:#4c6376; font-weight:600; }
.record-tooth-detail h3 > span { color:#8594a1; margin-left:4px; }
.record-tooth-events { max-height:210px; overflow:auto; margin-bottom:20px; }
.record-empty { font-size:12px; color:#8b97a3; line-height:1.6; padding:8px 0; }
.record-add { display:inline-flex; justify-content:center; align-items:center; gap:8px; font-size:12px; }
.record-tooth-detail > .record-add { width:100%; }
.record-patient-alert { border-top:1px solid #e1e7ed; margin-top:22px; padding-top:12px; }
.record-patient-alert p { color:#84909c; font-size:11px; line-height:1.6; }
.record-history { padding:0 24px 24px; }
.record-evolution { border-left:2px solid #8eb1ca; padding:4px 0 8px 14px; margin:14px 0 22px; }
.record-evolution > div { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.record-evolution time { color:#397daf; font-size:11px; }
.record-author { display:flex; flex-direction:column; align-items:flex-start; gap:6px; max-width:100%; }
.record-author > span { font-size:10px; color:#8b97a3; overflow-wrap:anywhere; }
.record-author button { display:inline-flex; align-items:center; gap:5px; padding:4px 8px; font-size:11px; }
.record-author button[hidden] { display:none; }
.record-evolution > div > span, .record-evolution small { font-size:10px; color:#8b97a3; }
.record-evolution h3 { margin:7px 0; font-size:13px; font-weight:600; overflow-wrap:anywhere; }
.record-evolution p { font-size:12px; color:#647889; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; margin:6px 0; }
.record-evolution footer { display:flex; flex-wrap:wrap; gap:8px; font-size:10px; color:#7e8f9d; }
.record-document-grid { display:grid; grid-template-columns:1fr 1fr; gap:28px; padding:24px; }
.record-document-grid h2 { font-size:16px; font-weight:600; }
.record-model-area:fullscreen { padding:16px; display:flex; flex-direction:column; }
.record-model-area:fullscreen .record-scene { flex:1; min-height:0; }
@media(max-width:1100px) {
  .record-clinical-grid { grid-template-columns:minmax(0,1fr); }
  .record-tooth-detail { border-left:0; border-top:1px solid #e4e9ee; }
  .record-tooth-events { max-height:250px; }
  .record-tooth-detail > .record-add { width:auto; }
}
@media(max-width:600px) {
  .record-patient-bar { flex-direction:column; align-items:stretch; padding:16px; gap:16px; }
  .record-patient-picker { width:100%; }
  .record-patient-identity h2 { font-size:19px; }
  .record-summary { grid-template-columns:repeat(2,minmax(0,1fr)); padding:16px; }
  .record-tabs { padding:0 16px; gap:0 16px; }
  .record-tabs button { padding:12px 0; font-size:11px; }
  .record-section-heading { flex-direction:column; align-items:flex-start; padding:20px 16px 12px; }
  .record-scene-toolbar { padding:8px 12px; align-items:flex-start; flex-direction:column; }
  .record-scene { height:300px; }
  .record-tooth-selector { padding:12px 16px 0; }
  .record-tooth-row { grid-template-columns:repeat(8,minmax(0,1fr)); gap:6px; }
  .record-model-note { left:16px; right:16px; font-size:9px; }
  .record-document-grid { grid-template-columns:1fr; padding:16px; }
  .record-legend { padding:12px 16px; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

.is-hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(17, 100, 102, 0.12), transparent 34%),
    var(--bg);
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-brand {
  color: var(--ink);
}

.auth-copy {
  margin-bottom: 0;
  color: var(--muted);
}

.auth-error {
  min-height: 22px;
  color: var(--danger);
  font-weight: 700;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: #10262c;
  color: #f7fbfb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-strong);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #bdd0d2;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: #d9e7e8;
  text-align: left;
  cursor: pointer;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.tenant-card {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.tenant-card span {
  color: #bdd0d2;
  font-size: 12px;
  text-transform: uppercase;
}

.tenant-card select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px;
  background: #18353b;
  color: #ffffff;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-switcher {
  display: grid;
  grid-template-columns: auto minmax(150px, 180px);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
}

.role-switcher span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-switcher select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  outline: 0;
}

.current-user {
  display: grid;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box {
  display: grid;
  grid-template-columns: 22px minmax(220px, 360px);
  align-items: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
}

.primary-button,
.ghost-button,
.icon-button,
.small-button {
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--brand-strong);
  padding: 10px 15px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
}

.ghost-button {
  border: 1px solid var(--line);
  padding: 9px 12px;
  background: #ffffff;
  color: var(--ink);
}

.tenant-card .ghost-button {
  border-color: transparent;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 20px;
}

.small-button {
  border: 1px solid var(--line);
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
}

.module-root {
  display: grid;
  gap: 18px;
}

.metric-grid,
.section-grid,
.admin-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.metric,
.record-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric-link { text-align: left; cursor: pointer; }
.metric-link:hover { background: #edf3ff; }

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 8px;
  padding: 3px 8px;
  background: #eef3f6;
  color: var(--sky);
  font-size: 12px;
  font-weight: 800;
}

.status.success {
  background: #e7f4ee;
  color: var(--success);
}

.status.warn {
  background: #fff1dc;
  color: var(--warn);
}

.status.danger {
  background: #fae6e6;
  color: var(--danger);
}

.timeline,
.message-list,
.inventory-list,
.treatment-list,
.automation-grid {
  display: grid;
  gap: 10px;
}

.record-card {
  padding: 14px;
}

.feature-card {
  border: 1px solid #cfdde2;
  border-radius: 8px;
  padding: 14px;
  background: #f4faf9;
}

.feature-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-strong);
}

.feature-card p,
.muted {
  color: var(--muted);
}

.feature-card p {
  margin-bottom: 0;
}

.record-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.record-card p {
  margin-bottom: 8px;
  color: var(--muted);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kanban-column {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfc;
}

.kanban-column h3 {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
}

.tooth-map {
  display: grid;
  grid-template-columns: repeat(8, minmax(34px, 1fr));
  gap: 8px;
}

.tooth {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-strong);
  font-weight: 800;
}

.tooth.alert {
  border-color: #efb09a;
  background: #fff0eb;
  color: var(--accent);
}

.mouth-3d {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(17, 100, 102, 0.16), transparent 32%),
    linear-gradient(135deg, #f8fbfc, #edf4f5);
  overflow: hidden;
}

.mouth-3d span {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-strong);
  font-weight: 800;
}

.arch {
  position: absolute;
  width: 70%;
  height: 58px;
  border: 12px solid rgba(17, 100, 102, 0.5);
  border-bottom: 0;
  border-radius: 100px 100px 0 0;
}

.arch.upper {
  top: 34px;
}

.arch.lower {
  bottom: 34px;
  transform: rotate(180deg);
  border-color: rgba(213, 111, 62, 0.48);
}

.inbox-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
}

.channel-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.channel-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  cursor: pointer;
}

.channel-tabs button.active {
  border-color: var(--brand);
  color: var(--brand-strong);
  font-weight: 800;
}

.chat-thread {
  display: grid;
  gap: 10px;
}

.bubble {
  max-width: 72%;
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef3f6;
}

.bubble.out {
  justify-self: end;
  background: #ddf0ea;
}

.automation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.chart-bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 70px;
  align-items: center;
  gap: 12px;
}

.bar {
  height: 14px;
  border-radius: 8px;
  background: #e7edf2;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--brand);
}

dialog {
  width: min(620px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(16, 38, 44, 0.48);
}

.dialog-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-actions {
  margin: 0;
  padding: 0;
}

.dialog-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.required-mark {
  color: var(--danger);
  font-weight: 700;
}

.profile-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.audit-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; }
.audit-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; font-size: 12px; }
.audit-detail { width: 230px; max-width: 100%; overflow-wrap: anywhere; }
.audit-detail dt { font-weight: 600; margin-top: 8px; }
.audit-detail dd { margin: 2px 0 0; color: var(--muted); }
.form-error { margin: 16px 22px 0; padding: 14px; border: 1px solid #d99a9a; border-left: 4px solid var(--danger); border-radius: 4px; background: #fff4f4; color: #8b2727; font-size: 13px; overflow-wrap: anywhere; }
.form-error[hidden] { display: none; }
.form-error p { margin: 8px 0 0; line-height: 1.5; }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.report-run { border-bottom: 1px solid var(--line); padding: 14px 0; min-width: 0; }
.report-run summary { cursor: pointer; font-size: 13px; padding-bottom: 12px; overflow-wrap: anywhere; }
.report-run summary span { display: block; margin: 6px 0 0 16px; color: var(--muted); font-size: 12px; }
.report-run > p { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }

.checkbox-field {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.checkbox-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-list label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.checkbox-list input {
  width: 16px;
  height: 16px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.app-shell { grid-template-columns: 212px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 12px 16px;
  gap: 22px;
  background: #202d4b;
}
.sidebar .brand { padding: 0 6px 18px; border-bottom: 1px solid #ffffff20; }
.brand strong { font-size: 19px; }
.brand span { color: #aab9d3; font-size: 11px; margin-top: 3px; }
.brand-mark { flex: 0 0 48px; width: 48px; height: 38px; color: #456cc4; font-size: 13px; letter-spacing: 0; }
.nav { gap: 3px; }
.nav-administration { min-width: 0; }
.nav-administration summary { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; color: #d9e7e8; font-size: 12px; cursor: pointer; list-style: none; border-radius: 5px; }
.nav-administration summary::-webkit-details-marker { display: none; }
.nav-administration summary::after { content: "+"; margin-left: auto; }
.nav-administration[open] summary::after { content: "-"; }
.nav-administration summary:hover { background: #33476e; }
.nav-submenu { display: grid; gap: 3px; margin-left: 12px; padding-left: 5px; border-left: 1px solid #ffffff30; }
.nav button { min-height: 38px; font-size: 12px; border-radius: 5px; gap: 6px; color: #bdc9df; }
.nav button > span:first-child { font-size: 19px; text-align: center; }
.nav button.active { background: #456cc4; color: #fff; box-shadow: 0 3px 8px #111a3130; }
.nav button:hover { background: #33476e; }
.nav button.active:hover { background: #456cc4; }
.tenant-card { padding: 14px 4px 0; border: 0; border-top: 1px solid #ffffff20; border-radius: 0; background: none; }
.tenant-card select { background: #2c3a59; border-radius: 4px; font-size: 12px; padding: 9px 5px; }
.tenant-card .ghost-button { background: none; color: #c8d6ee; font-size: 12px; text-align: left; padding-left: 4px; }
.workspace { padding: 0 26px 30px; }
.topbar { flex-wrap: wrap; gap: 18px; padding: 18px 0 22px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.topbar > div:first-child { order: 2; flex: 1 1 100%; }
.topbar-actions { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 10px; min-width: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.search-box { order: -1; flex: 1 1 200px; max-width: 330px; min-width: 0; grid-template-columns: 18px minmax(0, 1fr); border-radius: 4px; background: #fff; min-height: 36px; }
.search-box input { font-size: 12px; }
.role-switcher { margin-left: auto; grid-template-columns: auto minmax(85px, 110px); min-height: 36px; padding: 0 8px; border-radius: 4px; }
.role-switcher select { font-size: 12px; }
.current-user { min-height: 36px; border: 0; background: none; padding: 0 6px; max-width: 210px; overflow-wrap: anywhere; font-size: 11px; }
h1 { font-size: 25px; font-weight: 600; }
h2 { font-size: 18px; font-weight: 600; }
.eyebrow { font-size: 10px; font-weight: 600; }
.primary-button, .ghost-button, .small-button { border-radius: 4px; font-size: 12px; min-height: 34px; }
.primary-button { border-color: var(--brand); }
.primary-button:hover { background: var(--brand-strong); }
.small-button:hover, .ghost-button:hover { border-color: var(--brand); color: var(--brand); }
.module-root { gap: 26px; }
.metric-grid { gap: 12px; }
.metric { position: relative; padding: 17px 18px; border-radius: 6px; border-left: 3px solid #456cc4; box-shadow: none; }
.metric:nth-child(2) { border-left-color: #65a16f; }
.metric:nth-child(3) { border-left-color: #cb9850; }
.metric:nth-child(4) { border-left-color: #ca7081; }
.metric span { font-size: 11px; }
.metric strong { color: #456cc4; font-size: 25px; font-weight: 600; overflow-wrap: anywhere; }
.metric:nth-child(2) strong { color: #50855a; }
.metric:nth-child(3) strong { color: #a47332; }
.metric:nth-child(4) strong { color: #b9576a; }
.panel { border: 0; border-radius: 0; box-shadow: none; padding: 18px 0; background: transparent; border-top: 1px solid var(--line); min-width: 0; }
.panel-header { align-items: center; flex-wrap: wrap; gap: 10px; }
.panel-header > div { margin-right: auto; }
.panel-header p { margin-top: 5px; font-size: 12px; }
.table-scroll { overflow-x: auto; max-width: 100%; background: #fff; }
.table { font-size: 12px; }
.table th { background: #edf1f7; text-transform: none; font-size: 11px; font-weight: 600; white-space: nowrap; }
.table td { padding: 14px 10px; }
.table tr:hover td { background: #f8faff; }
.status { font-size: 10px; min-height: 21px; border-radius: 4px; font-weight: 600; }
.section-grid { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 24px; }
.record-card { box-shadow: none; border-radius: 5px; font-size: 12px; }
.record-card header { flex-wrap: wrap; }
.record-card p { margin-top: 8px; line-height: 1.5; }
.feature-card { background: #f0f4fa; border: 0; border-left: 2px solid #92acd8; border-radius: 0; font-size: 12px; }
.clinic-flow { min-width: 0; }
.clinic-kanban { align-items: stretch; gap: 12px; }
.kanban-column { min-width: 0; padding: 0; background: #eef1f6; border: 0; border-top: 3px solid #7293cd; border-radius: 5px; }
.kanban-column:nth-child(2) { border-top-color: #c8a35d; }
.kanban-column:nth-child(3) { border-top-color: #79ab81; }
.kanban-column:nth-child(4) { border-top-color: #8b90a7; }
.column-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 12px; border-bottom: 1px solid var(--line); }
.kanban-column h3 { margin: 0; padding: 12px; font-size: 12px; text-transform: none; color: #45536b; }
.column-heading h3 { padding: 0; }
.stage-count { min-width: 24px; text-align: center; background: #dfe6f2; color: #456cc4; padding: 2px 7px; border-radius: 4px; font-size: 10px; }
.stage-1 .stage-count { background: #f2e8d5; color: #9a742c; }
.stage-2 .stage-count { background: #e0eddf; color: #50855a; }
.flow-cards { display: grid; align-content: start; gap: 10px; padding: 10px; }
.flow-card { padding: 12px; background: #fff; }
.flow-time { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 10px; color: var(--muted); font-size: 10px; }
.flow-time strong { color: var(--brand); font-size: 12px; }
.patient-heading { display: flex; align-items: center; gap: 9px; }
.patient-heading > div { min-width: 0; overflow-wrap: anywhere; }
.patient-heading p { margin: 3px 0 0; font-size: 11px; }
.patient-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #e9eef8; color: #456cc4; font-size: 11px; font-weight: 700; }
.flow-professional { font-size: 10px; }
.flow-empty { padding: 28px 8px; text-align: center; color: #8490a2; font-size: 11px; }
.flow-stage-label { display: grid; gap: 5px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.flow-stage-label select { width: 100%; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 4px; color: #45536b; font-size: 11px; }
.channel-tabs { border-bottom: 1px solid var(--line); gap: 0; }
.channel-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; font-size: 12px; }
.channel-tabs button.active { border-color: var(--brand); }
.chat-thread { min-height: 260px; align-content: start; padding: 20px; background: #f0f4f2; }
.bubble { font-size: 13px; background: #fff; line-height: 1.5; }
.bubble.out { background: #e0eddc; }
.bar-row:nth-child(2) .bar span { background: #7da551; }
.bar-row:nth-child(3) .bar span { background: #cea34e; }
.bar-row:nth-child(4) .bar span { background: #bd758b; }
.dialog-panel { padding: 0; gap: 0; }
.dialog-header { padding: 15px 20px; background: #456cc4; color: #fff; }
.dialog-header .eyebrow { color: #dae5ff; }
.dialog-header h2 { font-size: 17px; }
.dialog-header .icon-button { background: transparent; color: #fff; border-color: #ffffff40; }
.dialog-fields { padding: 22px; max-height: 65vh; overflow-y: auto; }
.dialog-actions { padding: 14px 22px; background: #f5f7fa; border-top: 1px solid var(--line); justify-content: flex-end; }
.field input, .field select, .field textarea { border-radius: 4px; font-size: 13px; }
.checkbox-list label { border: 0; padding: 6px 4px; font-size: 13px; }
input[type="checkbox"] { accent-color: var(--brand); }
:focus-visible { outline: 2px solid #456cc4; outline-offset: 3px; }
.auth-screen { background: #f0f3f8; }
.auth-card { border-top: 4px solid var(--brand); }
.auth-brand span { color: var(--muted); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; }
  .sidebar .brand { padding: 0 0 14px; justify-content: center; }
  .sidebar .brand > div:last-child, .nav button > span:last-child { display: none; }
  .nav button { display: flex; justify-content: center; min-height: 40px; }
  .tenant-card { display: none; }
  .nav-administration summary { justify-content: center; padding: 8px 2px; gap: 2px; }
  .nav-administration summary > span:nth-child(2) { display: none; }
  .nav-administration summary::after { margin-left: 3px; }
  .nav-submenu { margin-left: 0; padding-left: 0; border-left: 0; }
  .clinic-kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tenant-card {
    display: none;
  }

  .metric-grid,
  .section-grid,
  .admin-grid,
  .kanban,
  .inbox-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    grid-template-columns: 22px 1fr;
  }

  .role-switcher {
    grid-template-columns: auto 1fr;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-fields {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sidebar { position: static; height: auto; gap: 10px; padding: 10px 12px; }
  .sidebar .brand { justify-content: flex-start; padding: 0; border: 0; }
  .sidebar .brand > div:last-child { display: block; }
  .nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 3px; }
  .nav button { flex: 0 0 42px; width: 42px; height: 38px; min-height: 38px; }
  .workspace { padding: 0 14px 20px; }
  .topbar { padding-top: 12px; gap: 14px; }
  .topbar-actions { flex-direction: row; align-items: center; gap: 8px; }
  .search-box { flex-basis: 100%; max-width: none; }
  .role-switcher { margin-left: 0; grid-template-columns: auto minmax(80px, 1fr); }
  .current-user { flex: 1; min-width: 95px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 12px; }
  .metric strong { font-size: 21px; }
  .clinic-kanban { grid-template-columns: 1fr; }
  .kanban-column { min-height: 120px; }
  .automation-grid { grid-template-columns: 1fr; }
  .panel-header { align-items: flex-start; }
  .dialog-fields { padding: 16px; }
  .bubble { max-width: 90%; }
  .nav-administration { flex: 0 0 180px; }
  .nav-administration summary { justify-content: flex-start; padding: 8px; gap: 8px; }
  .nav-administration summary > span:nth-child(2) { display: inline; }
  .nav-administration summary::after { margin-left: auto; }
  .nav-submenu button { width: 100%; justify-content: flex-start; flex: none; }
  .nav-submenu button > span:last-child { display: inline; }
}
/* Calendar periods retain stable columns; narrow screens scroll within the agenda. */
.schedule-toolbar, .schedule-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.schedule-toolbar { justify-content: space-between; margin-bottom: 16px; }
.schedule-toolbar .channel-tabs { margin: 0; }
.schedule-controls label { display: flex; align-items: center; gap: 8px; }
.schedule-controls input { min-width: 140px; max-width: 180px; }
.schedule-calendar-scroll { max-width: 100%; overflow-x: auto; }
.schedule-calendar { display: grid; grid-template-columns: repeat(7, minmax(135px, 1fr)); min-width: 945px; border-top: 1px solid #dce2e5; border-left: 1px solid #dce2e5; }
.schedule-day, .schedule-empty { min-height: 160px; min-width: 0; padding: 8px; border-right: 1px solid #dce2e5; border-bottom: 1px solid #dce2e5; }
.schedule-day.is-today { background: #edf8f3; }
.schedule-day-heading { width: 100%; padding: 6px 0; background: transparent; border: 0; text-align: left; font-size: 13px; font-weight: 600; cursor: pointer; }
.schedule-day-heading:hover { text-decoration: underline; }
.schedule-day-heading span { font-weight: 400; }
.schedule-entry { padding: 8px 0; border-top: 1px solid #dce2e5; font-size: 12px; overflow-wrap: anywhere; }
.schedule-entry strong, .schedule-entry > span { display: block; margin-bottom: 4px; }
.schedule-entry .status { white-space: normal; }
.status.appointment-late { color: #b91c1c; background: #fee2e2; font-weight: 700; }
.person-avatar { width: 36px; height: 36px; min-width: 36px; flex: 0 0 36px; object-fit: cover; border-radius: 50%; vertical-align: middle; }
.person-list-name .person-avatar { width:28px; height:28px; min-width:28px; flex-basis:28px; }
.integration-config { padding:24px 0; border-top:1px solid #dce2e8; }
.integration-config .field { min-width:0; }
.nav-message-group { min-width:0; }
.nav-group-label { display:block; padding:10px; font-size:13px; }
.campaign-workspace { min-width:0; padding:8px 0 28px; }
.campaign-toolbar { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin:8px 0 24px; }
.campaign-tabs { display:flex; max-width:100%; overflow-x:auto; border-bottom:1px solid #9a91b0; }
.campaign-tabs button { flex-shrink:0; border:0; border-bottom:3px solid transparent; border-radius:0; padding:13px 15px 10px; background:transparent; color:#41445d; font-size:14px; cursor:pointer; }
.campaign-tabs button.active { color:#583a9f; border-bottom-color:#583a9f; font-weight:700; }
.campaign-actions { display:flex; align-items:center; gap:16px; }
.campaign-search { display:flex; align-items:center; position:relative; width:280px; max-width:100%; }
.campaign-search input { width:100%; min-width:0; height:48px; padding:0 44px 0 16px; background:#fff; border:1px solid #bdb5cf; border-radius:8px; }
.campaign-search svg { position:absolute; right:14px; width:20px; height:20px; pointer-events:none; }
.campaign-create { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:48px; padding:0 22px; background:#583a9f; white-space:nowrap; border-radius:6px; }
.campaign-create svg { width:18px; height:18px; }
.module-action-toolbar { display:flex; justify-content:flex-end; align-items:center; gap:16px; margin:8px 0 24px; }
.module-action-toolbar:has(> button[hidden]) { display:none; }
.module-action-toolbar > button { min-height:48px; padding:0 22px; max-width:100%; }
.lead-workspace { min-width:0; max-width:100%; }
.report-period { display:flex; flex-wrap:wrap; align-items:end; gap:14px; }
.report-period label { display:grid; gap:6px; }
.report-period input,.report-period select { padding:10px; background:white; border:1px solid var(--line); border-radius:4px; }
.report-run { margin-top:16px; padding:16px 0; border-bottom:1px solid var(--line); }
.report-run summary { cursor:pointer; display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; }
.report-run td { overflow-wrap:anywhere; }
.lead-period { display:flex; flex-wrap:wrap; align-items:end; gap:16px; padding:0 0 20px; }
.lead-period > strong { font-size:20px; margin-right:auto; align-self:center; }
.lead-period label { display:grid; gap:6px; font-size:13px; }
.lead-period label[hidden] { display:none; }
.lead-period input,.lead-period select { padding:10px; border:1px solid var(--line); border-radius:4px; background:white; min-height:40px; max-width:100%; }
.lead-period input { width:100px; }
.lead-board { display:grid; grid-template-columns:repeat(7,minmax(230px,1fr)); gap:14px; overflow-x:auto; align-items:start; padding:0 0 20px; }
.lead-column { --stage:#849ebf; background:#f0f3f5; border-top:3px solid var(--stage); min-height:340px; }
.lead-stage-1 { --stage:#76aaa5; }.lead-stage-2 { --stage:#a490bf; }.lead-stage-3 { --stage:#d8ac4b; }.lead-stage-4 { --stage:#67a67d; }.lead-stage-5 { --stage:#c78282; }
.lead-stage-4 { --stage:#8a95bd; }.lead-stage-5 { --stage:#cfaa55; }.lead-stage-6 { --stage:#67a67d; }.lead-stage-7 { --stage:#c78282; }
.lead-column > header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 12px; }
.lead-column h2 { margin:0; font-size:14px; font-weight:600; }
.lead-count { min-width:24px; padding:3px 6px; text-align:center; background:white; font-size:12px; border-radius:4px; }
.lead-column-body { display:grid; gap:12px; padding:0 10px 12px; }
.lead-card { padding:12px; background:white; border-left:3px solid var(--stage); border-radius:6px; box-shadow:0 2px 4px #182b3710; min-width:0; overflow-wrap:anywhere; }
.lead-workspace .lead-card .lead-card-name { display:block; width:100%; height:auto; padding:0; text-align:left; border:0; background:transparent; color:#263a4b; font-weight:600; }
.lead-potential { display:inline-block; margin-top:8px; background:#eef2f4; border-radius:4px; padding:3px 6px; font-size:11px; }
.lead-card p { margin:10px 0; font-size:13px; }
.lead-card small { color:#647786; font-size:11px; }
.lead-card-owner { display:flex; align-items:center; gap:6px; margin-top:14px; font-size:12px; color:#647786; }
.lead-card-owner svg { width:14px; height:14px; flex-shrink:0; }
.lead-card footer { display:flex; justify-content:space-between; align-items:center; border-top:1px solid #edf0f2; margin-top:12px; padding-top:10px; font-size:11px; color:#647786; }
.lead-column-empty { padding:40px 0; text-align:center; color:#71808a; font-size:12px; }
.lead-workspace button { padding:8px 12px; border:1px solid var(--line); border-radius:4px; background:white; color:var(--primary); cursor:pointer; }
.lead-workspace [data-edit-lead] { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:8px; }
.lead-workspace [data-edit-lead] svg { width:18px; height:18px; }
.lead-filters { display:grid; grid-template-columns:minmax(0,2fr) repeat(4,minmax(0,1fr)) auto; gap:12px; align-items:end; margin-bottom:24px; }
.lead-filters label { display:grid; gap:6px; min-width:0; }
.lead-filters input,.lead-filters select { min-width:0; width:100%; height:40px; padding:8px; border:1px solid var(--line); border-radius:4px; background:white; }
.lead-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px; padding:20px 0; border-block:1px solid var(--line); }
.lead-metrics span { display:block; font-size:13px; }
.lead-metrics strong { display:block; font-size:24px; margin-top:8px; }
.lead-pipeline { display:flex; flex-wrap:wrap; gap:20px; padding:20px 0; }
.lead-pipeline strong { color:#117c78; margin-left:8px; }
.lead-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.lead-history { border-bottom:1px solid var(--line); padding:12px 0; }
.lead-history p { white-space:pre-wrap; overflow-wrap:anywhere; }
.lead-workspace td { overflow-wrap:anywhere; max-width:240px; }
@media(max-width:1000px){.lead-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.lead-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.lead-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.lead-form-grid{grid-template-columns:1fr}.lead-workspace table{min-width:850px}}
@media(max-width:600px) { .module-action-toolbar > button { width:100%; } }
.campaign-empty { padding:20px; background:#fff; border:1px solid #e2dff3; border-radius:8px; }
.campaign-empty strong { font-size:15px; color:#222; }
.campaign-empty p { font-size:13px; color:#6a6485; margin:8px 0 0; }
#campaignResults { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),362px)); gap:20px; }
#campaignResults .campaign-empty { grid-column:1/-1; }
.campaign-row { display:flex; flex-direction:column; align-items:stretch; min-width:0; min-height:204px; padding:16px; border:1px solid #bdb8d6; border-radius:8px; background:#fff; gap:10px; }
.campaign-row h3 { display:flex; align-items:center; gap:8px; margin:0; font-size:16px; overflow-wrap:anywhere; }
.campaign-card-icon { flex:none; display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#d9ee92; color:#314a38; }
.campaign-card-icon svg { width:16px; height:16px; }
.campaign-row p { margin:0; font-size:14px; color:var(--muted); }
.campaign-row .campaign-card-message { color:#34425a; white-space:pre-wrap; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.campaign-card-schedule { display:grid; gap:8px; margin-top:auto; padding-top:12px; }
.campaign-card-schedule p { display:flex; gap:8px; align-items:center; }
.campaign-card-schedule svg { width:16px; height:16px; color:#252c34; flex:none; }
.campaign-card-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; }
.campaign-status { font-size:13px; font-weight:600; padding:4px 9px; border-radius:20px; background:#edf0f4; color:#465368; }
.campaign-status.scheduled { background:#fff5c6; color:#84510c; }
.campaign-status.sending { background:#e5f0ff; color:#28529b; }
.campaign-status.completed { background:#e4f5e8; color:#27683a; }
.campaign-status.cancelled { background:#fdeaea; color:#a13232; }
.campaign-icon-button { display:grid; place-items:center; width:30px; height:30px; border:0; border-radius:4px; background:transparent; color:#655981; cursor:pointer; }
.campaign-icon-button:hover { background:#f0edf8; }
.campaign-icon-button svg { width:17px; height:17px; }
#campaignFeedback:empty { display:none; }
@media(max-width:1200px) { .campaign-toolbar { flex-direction:column; align-items:stretch; } .campaign-actions { justify-content:flex-end; } }
@media(max-width:600px) { .campaign-actions { flex-wrap:wrap; } .campaign-search { width:100%; } .campaign-create { width:100%; } .campaign-tabs button { padding-left:11px; padding-right:11px; } .campaign-row { align-items:flex-start; flex-direction:column; } .nav-message-group { flex:0 0 180px; } .nav-message-group > button { width:100%; } .nav-message-group > button > span:last-child { display:inline; } .nav-message-group .nav-submenu button { width:100%; } }
#integrationWorkspace { min-width:0; max-width:100%; overflow-x:hidden; }
.integration-config input, .integration-auth input { min-width:0; width:100%; box-sizing:border-box; }
.integration-config input[type="checkbox"] { width:auto; }
.integration-config .dialog-fields { max-height:none; }
.integration-status { display:grid; grid-template-columns:minmax(130px, 1fr) minmax(0, 3fr); gap:8px 16px; font-size:13px; }
.integration-status dd { margin:0; overflow-wrap:anywhere; }
.integration-auth { max-width:560px; display:grid; gap:16px; }
.integration-inbox { display:grid; grid-template-columns:minmax(200px, 1fr) minmax(0, 2fr); border-top:1px solid #dce2e8; margin-top:16px; }
#integrationConversations { max-height:650px; overflow:auto; border-right:1px solid #dce2e8; }
.integration-conversation { display:grid; gap:6px; width:100%; min-width:0; padding:16px; border:0; border-bottom:1px solid #dce2e8; background:#fff; color:#29333e; text-align:left; border-radius:0; }
.integration-conversation.selected { background:#e9f2fb; border-left:3px solid #2677ae; }
.integration-conversation span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.integration-conversation strong, .integration-conversation small { overflow-wrap:anywhere; }
.integration-detail { min-width:0; padding:16px; }
.integration-thread { display:flex; flex-direction:column; gap:12px; height:400px; overflow:auto; padding:12px 0; }
.integration-thread .bubble { max-width:90%; white-space:pre-wrap; overflow-wrap:anywhere; }
.integration-thread .bubble p { margin:0 0 6px; }
.integration-thread small { font-size:11px; }
.integration-error { color:#a72222; overflow-wrap:anywhere; }
#integrationReply { display:grid; gap:8px; }
#integrationReply[hidden] { display:none; }
@media(max-width:700px) {
  .integration-inbox { grid-template-columns:minmax(0, 1fr); }
  #integrationConversations { max-height:240px; border-right:0; border-bottom:1px solid #dce2e8; }
  .integration-status { grid-template-columns:minmax(0, 1fr); }
  .integration-detail { padding:12px 0; }
}
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; background: #e8edf3; color: #344054; font-size: 12px; }
.person-with-photo, #currentUserBadge { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
#currentUserBadge > span { overflow-wrap: anywhere; }
@media (max-width:600px) {
  #currentUserBadge { flex:1 0 100%; max-width:none; width:100%; }
  #currentUserBadge > span:not(.person-avatar) { flex:1; min-width:0; }
}
#personPhotoPreview .person-avatar { width: 80px; height: 80px; margin-bottom: 8px; }
.patient-age {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  color: #596474;
  white-space: normal;
}
.birthday-badge {
  display: inline-block;
  max-width: 100%;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid #e8b74c;
  border-radius: 4px;
  background: #fff4cf;
  color: #795000;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
#authEnrollment { text-align: center; }
#authMfaQr { max-width: 100%; height: auto; }
#authMfaSecret { display: block; overflow-wrap: anywhere; user-select: all; margin: 12px 0; }
#authMfa .field { margin: 16px 0; }
#authReplaceField { display: block; margin: 12px 0; font-size: 13px; }
#authRecoveryCodes { padding: 12px; background: #f1f5f8; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
#authSetupField small { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.campaign-wizard { width:min(1160px,96vw); max-width:96vw; height:90vh; max-height:94vh; padding:24px; border:1px solid #deddea; border-radius:8px; color:#233344; background:white; }
.campaign-wizard::backdrop { background:#17233266; }
.campaign-wizard-form { min-height:100%; display:flex; flex-direction:column; gap:14px; }
.campaign-wizard header,.campaign-wizard footer { display:flex; align-items:center; gap:16px; justify-content:space-between; }
.campaign-wizard header span,.campaign-wizard small { color:#687486; font-size:12px; }
.campaign-wizard progress { width:100%; height:4px; border:0; appearance:none; }
.campaign-wizard progress::-webkit-progress-bar { background:#e6e6ef; }
.campaign-wizard progress::-webkit-progress-value { background:#d2eb66; }
.campaign-wizard-content { flex:1; }
.campaign-wizard label { display:flex; flex-direction:column; gap:10px; margin-bottom:18px; font-size:14px; }
.campaign-wizard input:not([type="checkbox"]),.campaign-wizard textarea { box-sizing:border-box; width:100%; min-width:0; padding:12px; border:1px solid #bdb8d6; border-radius:6px; background:white; color:inherit; font:inherit; }
.campaign-wizard textarea { resize:vertical; }
.campaign-wizard button { cursor:pointer; padding:10px 16px; border:1px solid #bdb8d6; border-radius:6px; background:white; color:#593aa0; font-weight:600; }
.campaign-wizard .primary-button { background:#593aa0; color:white; border-color:#593aa0; }
.campaign-wizard button:focus-visible,.campaign-wizard input:focus-visible { outline:2px solid #593aa0; outline-offset:2px; }
.campaign-wizard button:disabled { opacity:.5; cursor:wait; }
.campaign-wizard footer { justify-content:flex-end; padding-top:20px; }
.campaign-wizard [role="alert"] { color:#b42318; margin:0; }
.campaign-tokens { display:flex; flex-wrap:wrap; gap:8px; margin:-6px 0 22px; }
.campaign-tokens button { padding:5px 12px; border-radius:20px; font-size:12px; }
.campaign-image img,.campaign-summary img { display:block; max-width:240px; max-height:180px; object-fit:contain; margin:12px 0; }
.campaign-audience { display:grid; grid-template-columns:260px minmax(0,1fr); gap:28px; }
.campaign-audience aside { display:flex; flex-direction:column; gap:10px; border-right:1px solid #ecebf3; padding-right:20px; }
.campaign-audience aside button { text-align:left; }
.campaign-audience [aria-pressed="true"] { border:2px solid #593aa0; }
.campaign-audience-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.campaign-audience-toolbar input { flex:1; }
.campaign-patient-list { border-top:1px solid #e6e6ef; }
.campaign-patient-list label { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 24px; align-items:center; padding:14px 0; margin:0; border-bottom:1px solid #e6e6ef; overflow-wrap:anywhere; }
.campaign-patient-list input { appearance:none; width:42px; height:24px; border-radius:14px; background:#bdb8cf; position:relative; cursor:pointer; margin-left:-18px; }
.campaign-patient-list input::after { content:''; position:absolute; width:18px; height:18px; border-radius:50%; background:white; top:3px; left:3px; }
.campaign-patient-list input:checked { background:#593aa0; }
.campaign-patient-list input:checked::after { left:21px; }
.campaign-schedule { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.campaign-summary { padding:20px 0; border-bottom:1px solid #deddea; overflow-wrap:anywhere; }
.campaign-summary p { white-space:pre-wrap; }
.campaign-summary button { float:right; margin-left:10px; }
@media(max-width:650px) { .campaign-wizard { padding:16px; } .campaign-audience,.campaign-schedule { grid-template-columns:minmax(0,1fr); gap:16px; } .campaign-audience aside { border:0; padding:0; } .campaign-wizard footer { flex-wrap:wrap; } .campaign-summary button { float:none; display:block; margin:0 0 12px; } }

/* Explicit sidebar modes override the older automatic compact breakpoints. */
.procedure-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:8px 0 24px; }
.procedure-workspace { min-width:0; max-width:100%; overflow:hidden; }
.procedure-workspace .table-scroll { width:100%; min-width:0; }
.procedure-toolbar input { width:240px; max-width:100%; padding:11px 12px; border:1px solid #c5badb; border-radius:6px; background:white; }
.procedure-toolbar .primary-button { background:#593b99; border-color:#593b99; }
.procedure-table { background:white; width:100%; }
.procedure-table th:first-child { width:42%; }
.procedure-table th { background:#faf9fc; color:#373043; }
.procedure-table td { border-bottom:1px solid #eae4f2; font-size:13px; }
.procedure-table input,.procedure-table select { width:100%; min-width:110px; padding:9px; border:1px solid #c5badb; border-radius:5px; background:white; }
.procedure-row-actions { display:flex; gap:6px; align-items:center; }
.procedure-row-actions button { display:flex; align-items:center; justify-content:center; background:white; color:#593b99; border:1px solid transparent; border-radius:4px; padding:6px; cursor:pointer; }
.procedure-row-actions button:hover { background:#f2edf9; }
.procedure-row-actions svg { width:17px; height:17px; }
#procedureError { color:#a83038; }
@media(max-width:650px){.procedure-toolbar { flex-wrap:wrap; }.procedure-toolbar input { width:100%; }.procedure-table { min-width:700px; }}
#recordDialog.agenda-drawer { margin:0 0 0 auto; width:min(640px,100vw); max-width:100vw; height:100dvh; max-height:100dvh; border-radius:0; padding:24px; border:0; border-left:1px solid #e7e0f0; }
#recordDialog.agenda-drawer .dialog-fields { grid-template-columns:minmax(0,1fr); }
#recordDialog.agenda-drawer .dialog-actions { position:sticky; bottom:0; background:white; padding-top:16px; border-top:1px solid #e7e0f0; }
.schedule-form { gap:24px; }
.camera-crop-frame{overflow:hidden;max-width:100%;line-height:0}
.camera-crop-frame video{display:block;width:100%;height:auto;transform-origin:center}
.camera-crop-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px;padding:10px 0}
.camera-crop-controls label{display:grid;gap:5px}.camera-crop-controls input{width:100%}
.patient-list-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:12px;align-items:end;margin:16px 0}
.patient-list-filters input{width:100%;min-width:0}
tr[data-patient-list-row][hidden]{display:none}
.search-box{position:relative}
.global-search-results{position:absolute;top:calc(100% + 6px);left:0;width:min(540px,calc(100vw - 32px));max-height:65vh;overflow:auto;background:#fff;border:1px solid #bfcbd5;border-radius:6px;box-shadow:0 6px 20px #0002;z-index:90;padding:8px;color:#233345}
.global-search-results[hidden]{display:none}
.global-search-results>button{display:flex;flex-direction:column;gap:4px;text-align:left;width:100%;padding:10px;background:white;border:0;border-bottom:1px solid #e2e7eb;cursor:pointer;white-space:normal;overflow-wrap:anywhere}
.global-search-results>button:hover,.global-search-results>button:focus{background:#edf6fa}
.global-search-results small,.global-search-results>button span{font-size:12px;color:#526778}
.global-search-results p{font-size:12px;margin:8px}
.global-search-results footer{display:flex;justify-content:space-between;align-items:center;padding-top:8px}
.clinical-dictation{position:relative;width:100%}
.clinical-dictation textarea{width:100%;box-sizing:border-box;padding-bottom:52px;padding-right:48px}
.dictation-mic{position:absolute;bottom:10px;right:10px;width:38px;height:38px;border:0;border-radius:50%;background:transparent;color:#303030;display:grid;place-items:center;padding:8px;cursor:pointer}
.dictation-mic.recording{background:#459b60;color:white}
.dictation-mic:disabled{opacity:.45;cursor:not-allowed}
.dictation-mic svg{width:22px;height:22px}
.dictation-status{display:block;font-size:12px;margin-top:5px;color:#536272}
.schedule-form [data-laboratory]{grid-column:1 / -1}
#recordDialog.agenda-drawer { padding:0; }
#recordDialog.agenda-drawer .dialog-panel { height:100%; display:flex; flex-direction:column; }
#recordDialog.agenda-drawer .dialog-header { flex:none; background:white; color:#292632; border-bottom:1px solid #e7e0f0; padding:18px 24px; }
#recordDialog.agenda-drawer .dialog-header .eyebrow { display:none; }
#recordDialog.agenda-drawer .dialog-header .icon-button { color:#563aa1; border:0; }
#recordDialog.agenda-drawer .dialog-fields { flex:1; min-height:0; max-height:none; align-content:start; padding:24px; }
#recordDialog.agenda-drawer .dialog-actions { flex:none; margin:0; display:flex; gap:16px; padding:16px 24px; }
#recordDialog.agenda-drawer .dialog-actions button { flex:1; min-height:40px; border-radius:6px; border:1px solid #563aa1; }
#recordDialog.agenda-drawer .dialog-actions .primary-button { background:#563aa1; color:white; }
#recordDialog.agenda-drawer .dialog-actions .ghost-button { background:white; color:#563aa1; }
.schedule-form [hidden] { display:none !important; }
.schedule-kind { display:flex; padding:4px; border:1px solid #eeeaf5; border-radius:28px; margin:12px 0; }
.schedule-kind button { flex:1; border:0; background:white; color:#494459; padding:12px 8px; border-radius:24px; font-weight:700; }
.schedule-kind button[aria-selected="true"] { background:#563aa1; color:white; }
.schedule-time-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:16px; align-items:end; }
.schedule-repeat-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:12px; align-items:end; }
.schedule-repeat-row[hidden] { display:none; }
.schedule-repeat-row label { display:grid; gap:6px; min-width:0; }
.schedule-all-day { display:flex; align-items:center; gap:8px; padding-bottom:12px; white-space:nowrap; }
.schedule-form input[type="checkbox"],.schedule-form input[type="radio"] { width:18px; height:18px; accent-color:#563aa1; flex:none; }
.schedule-status { display:flex; gap:18px; flex-wrap:wrap; margin-top:8px; }
.schedule-status label { display:flex; align-items:center; gap:8px; }
.schedule-warning { margin:0; padding:5px 10px; width:fit-content; border-radius:8px; background:#fff6c7; color:#804d16; font-weight:600; }
.schedule-picker { position:relative; min-width:0; }
.schedule-picker summary { padding:12px; border:1px solid #bdb4d4; border-radius:6px; color:#514863; cursor:pointer; overflow-wrap:anywhere; }
.schedule-picker-body { background:white; border:1px solid #e7e0f0; box-shadow:0 6px 18px #2313441a; padding:16px; border-radius:6px; }
.schedule-picker .checkbox-list { max-height:260px; overflow:auto; display:flex; flex-direction:column; flex-wrap:nowrap; }
.schedule-picker .checkbox-list label { display:flex; flex-shrink:0; align-items:center; gap:12px; padding:10px 4px; }
.schedule-picker .primary-button { width:100%; margin-bottom:12px; background:#563aa1; }
.procedure-filter { width:100%; margin-bottom:12px; }
.schedule-picker .checkbox-list label[hidden] { display:none; }
.selection-picker summary { min-height:44px; box-sizing:border-box; }
.selection-picker .checkbox-list label { min-width:0; }
.selection-picker .checkbox-list label span { overflow-wrap:anywhere; }
.selection-picker .checkbox-list input[type="checkbox"] { flex:0 0 16px; width:16px; height:16px; padding:0; }
.patient-open { border:0; background:none; color:#49318b; padding:0; font-weight:700; text-align:left; cursor:pointer; }
.patient-workspace { min-width:0; background:white; padding:0 20px 24px; }
.patient-breadcrumb { display:flex; gap:16px; align-items:center; padding:16px 0; border-bottom:1px solid #eeeaf5; }
.patient-breadcrumb button { border:0; background:none; color:#655a79; }
.patient-profile { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:30px 0 16px; }
.patient-profile .person-avatar { width:60px; height:60px; }
.patient-profile .person-avatar { min-width:60px; flex-shrink:0; }
.patient-profile h2 { font-size:22px; margin:0 0 8px; }
.patient-profile p { margin:0; }
.patient-anamnesis-status { font-size:13px; color:#655a79; margin-bottom:26px; }
.patient-tabs { display:flex; gap:20px; border-bottom:1px solid #e7e0f0; overflow-x:auto; }
.patient-tabs button { border:0; background:none; padding:12px 0; color:#514761; white-space:nowrap; }
.patient-tabs button[aria-current="page"] { border-bottom:2px solid #563aa1; color:#563aa1; font-weight:700; }
.patient-tab-content { padding-top:24px; min-width:0; }
.patient-section-heading { display:flex; gap:16px; align-items:center; justify-content:space-between; margin-bottom:18px; flex-wrap:wrap; }
.patient-section-heading h2 { font-size:20px; margin:0; }
.patient-workspace button svg,.patient-editor button svg { width:18px; height:18px; flex:none; }
.patient-workspace button,.patient-editor button { cursor:pointer; }
.patient-workspace .primary-button,.patient-editor .primary-button { background:#563aa1; color:white; border:1px solid #563aa1; border-radius:6px; }
.patient-section-heading button,.patient-profile>button { display:inline-flex; gap:8px; align-items:center; }
.patient-clinical-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(230px,1fr); gap:28px; }
.patient-clinical-grid>section,.patient-clinical-grid>aside { min-width:0; }
.patient-segments { display:flex; gap:8px; flex-wrap:wrap; padding:0; border:0; margin:16px 0; }
.patient-segments button { padding:8px 16px; background:white; color:#563aa1; border:1px solid #d8d0e9; border-radius:5px; }
.patient-segments button[aria-pressed="true"] { background:#563aa1; color:white; }
.patient-segments label { display:flex; align-items:center; gap:8px; padding:10px; }
.patient-odontogram .record-patient-bar,.patient-odontogram .record-summary,.patient-odontogram .record-tabs,.patient-odontogram .record-tooth-detail,.patient-odontogram .record-section-heading>div:first-child { display:none; }
.patient-odontogram .record-clinical-grid { display:block; }
.patient-odontogram .record-workspace { padding:0; }
.patient-odontogram .record-scene { min-height:320px; height:340px; }
.patient-odontogram .record-tooth-row { grid-template-columns:repeat(16,minmax(0,1fr)); gap:2px; }
.patient-odontogram .record-tooth-row button { min-width:0; padding:6px 0; font-size:11px; }
.patient-empty { color:#787184; padding:24px 0; }
.patient-entry { padding:16px 0; border-bottom:1px solid #eeeaf5; }
.patient-entry header { display:flex; flex-direction:column; gap:6px; }
.patient-entry header span { color:#746980; font-size:12px; }
.patient-entry p { white-space:pre-wrap; overflow-wrap:anywhere; }
.patient-visits{margin-top:24px}
.patient-visit-count{font-weight:400;color:#657282;font-size:13px}
.patient-visit-list{display:grid;gap:14px}
.patient-visit{border:1px solid #bfcbd5;border-left:4px solid #4787a0;border-radius:6px;background:#fff;padding:16px;min-width:0}
.patient-visit header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-bottom:12px;border-bottom:1px solid #e1e7ec}
.patient-visit header strong{font-size:15px;overflow-wrap:anywhere}
.patient-visit dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:14px 0}
.patient-visit dt,.patient-visit-notes>span{font-size:12px;color:#627080;margin-bottom:4px}
.patient-visit dd{margin:0;font-weight:500;overflow-wrap:anywhere;white-space:pre-line}
.patient-visit-notes{border-top:1px solid #edf0f3;padding-top:10px}
.patient-visit-notes p{margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.patient-visit footer{display:flex;justify-content:flex-end;margin-top:10px}
.patient-visits .patient-visit footer button{margin:0;max-width:100%;text-align:right}
@media(max-width:600px){.patient-visit dl{grid-template-columns:minmax(0,1fr)}.patient-visit{padding:12px}}
.patient-entry button,.patient-visits button { color:#563aa1; background:none; border:0; display:inline-flex; gap:6px; align-items:center; margin:6px 12px 0 0; }
#patientProcedureFilter { max-width:500px; width:100%; padding:10px; margin:12px 0; }
.patient-row-actions { min-width:160px; }
.patient-row-actions summary { cursor:pointer; color:#563aa1; }
.patient-row-actions>div { display:flex; flex-direction:column; align-items:stretch; gap:4px; padding:8px 0; }
.patient-row-actions button { text-align:left; background:#f6f4fa; border:0; padding:8px; color:#563aa1; }
.patient-visits { margin:20px 0; }
.patient-visits h3 { color:#563aa1; font-size:16px; border-bottom:1px solid #eeeaf5; padding-bottom:12px; }
.patient-visits article { padding:16px; border-bottom:1px solid #eeeaf5; }
.patient-files { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:16px; }
.patient-files article { border:1px solid #e7e0f0; border-radius:6px; padding:16px; overflow-wrap:anywhere; }
.patient-files article>span { display:block; margin-bottom:12px; color:#563aa1; }
.patient-editor { margin:0 0 0 auto; width:min(640px,100vw); max-width:100vw; height:100dvh; max-height:100dvh; padding:0; border:0; border-radius:0; }
.patient-editor form { height:100%; display:flex; flex-direction:column; }
.patient-editor header,.patient-editor footer { display:flex; align-items:center; justify-content:space-between; flex:none; gap:16px; padding:18px 24px; border-bottom:1px solid #e7e0f0; }
.patient-editor header h2 { font-size:19px; margin:0; }
.patient-editor header button { border:0; background:none; color:#563aa1; }
.patient-editor footer { border-top:1px solid #e7e0f0; border-bottom:0; }
.patient-editor footer button { flex:1; padding:10px; border:1px solid #563aa1; color:#563aa1; background:white; border-radius:6px; }
.patient-editor-body { min-height:0; overflow:auto; flex:1; display:flex; flex-direction:column; gap:24px; padding:24px; }
.patient-editor input:not([type="checkbox"]):not([type="radio"]),.patient-editor select,.patient-editor textarea { width:100%; min-width:0; padding:10px; border:1px solid #bdb4d4; border-radius:6px; background:white; color:#292632; }
.patient-editor textarea { min-height:130px; resize:vertical; }
.patient-editor input[type="checkbox"],.patient-editor input[type="radio"] { width:18px; height:18px; accent-color:#563aa1; }
.patient-editor-error { padding:12px 24px; margin:0; color:#9b2335; background:#fff0f2; }
.patient-editor-error[hidden] { display:none; }
.patient-charge { display:flex; gap:12px; align-items:center; padding:16px; border:1px solid #ddd5ec; border-radius:6px; }
.patient-teeth-picker summary { padding:12px; border:1px solid #bdb4d4; border-radius:6px; cursor:pointer; }
.patient-teeth-picker>div { padding:12px; border:1px solid #eeeaf5; }
.patient-tooth-groups { display:flex; gap:8px; flex-wrap:wrap; }
.patient-tooth-groups button { border:0; color:#563aa1; padding:8px; }
.patient-teeth-options { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:16px; max-height:200px; overflow:auto; }
.patient-teeth-options label { display:flex; gap:8px; align-items:center; }
[data-tooth-faces] fieldset { border:0; padding:0; margin:12px 0; display:flex; gap:18px; flex-wrap:wrap; }
[data-tooth-faces] label { display:flex; align-items:center; gap:4px; }
.patient-budget-items { border:0; padding:0; }
.patient-budget-items .budget-commission-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:12px; }
.patient-budget-items .budget-commission-row label { min-width:0; }
@media(max-width:850px){.patient-clinical-grid{grid-template-columns:minmax(0,1fr)}.patient-workspace{padding:0 12px 20px}.patient-profile{align-items:flex-start}.patient-profile h2{font-size:18px}.patient-odontogram .record-scene{height:290px;min-height:290px}.patient-editor-body{padding:18px}.patient-tabs{gap:16px}}
.schedule-inline-create { display:flex; gap:8px; align-items:end; margin-bottom:12px; }
.schedule-marker-options { display:flex; flex-direction:column; gap:4px; }
.schedule-marker-options button { background:#f6f4fa; border:0; padding:10px; text-align:left; color:#563aa1; }
#googleCalendarWorkspace form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end; gap:16px; }
#googleCalendarWorkspace label { display:flex; flex-direction:column; gap:6px; min-width:0; font-size:13px; }
#googleCalendarWorkspace input,#googleCalendarWorkspace select { width:100%; min-width:0; height:40px; padding:8px; border:1px solid #dce1ee; border-radius:4px; background:white; color:inherit; font:inherit; }
#googleCalendarWorkspace button { min-height:40px; padding:8px 12px; border:1px solid #ccd4e5; border-radius:4px; font:inherit; cursor:pointer; }
#googleCalendarWorkspace button:disabled { opacity:.55; cursor:not-allowed; }
@media(max-width:700px){#googleCalendarWorkspace form{grid-template-columns:1fr;}}
.availability-day { display:block; padding:10px; border:1px solid #e3e5ee; border-radius:8px; margin-top:8px; }
.availability-times { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:10px 0; }
.availability-times label { flex-direction:column; align-items:stretch !important; font-size:12px; }
.availability-times input { width:100%; min-width:0; background:#f6f6fa; }
@media(max-width:540px){.availability-times{grid-template-columns:repeat(2,minmax(0,1fr));}}
.availability-day label,.dentist-availability>label { display:flex; align-items:center; gap:8px; }
.dentist-availability input[type="checkbox"] { width:18px; height:18px; }
.schedule-form .checkbox-field { min-width:0; border:0; padding:0; }
@media(max-width:480px){.schedule-time-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.schedule-all-day{grid-column:1/-1}.schedule-status{gap:12px}.schedule-kind button{font-size:13px}}
.agenda-workspace { background:white; border-top:1px solid #e9e5f0; min-width:0; }
.agenda-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:16px; border-bottom:1px solid #e9e5f0; }
.agenda-toolbar button { display:flex; align-items:center; justify-content:center; gap:8px; min-height:36px; padding:6px 10px; border:1px solid transparent; border-radius:5px; background:white; color:#593a98; cursor:pointer; }
.agenda-toolbar button:hover { background:#f2edf9; }
.agenda-toolbar #scheduleToday { border-color:#593a98; }
.agenda-toolbar strong { font-size:14px; font-weight:500; }
.agenda-toolbar select { margin-left:auto; width:130px; padding:8px; border:1px solid #d8cde7; border-radius:5px; background:white; }
.agenda-toolbar svg,.agenda-filters svg { width:20px; height:20px; }
.agenda-toolbar [data-schedule-move="-1"] svg,.agenda-mini-heading [data-mini-move="-1"] svg { transform:rotate(180deg); }
.agenda-layout { display:grid; grid-template-columns:210px minmax(0,1fr); }
.agenda-layout.filters-collapsed { grid-template-columns:minmax(0,1fr); }
.agenda-layout.filters-collapsed .agenda-filters { display:none; }
.agenda-filters { padding:18px 12px; border-right:1px solid #e8e3ef; }
.agenda-filters .primary-button { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; background:#593a98; border:0; padding:12px; }
.agenda-mini-heading { display:flex; align-items:center; justify-content:space-between; gap:5px; margin:20px 0 12px; }
.agenda-mini-heading strong { font-size:12px; font-weight:500; }
.agenda-mini-heading button { display:grid; place-items:center; padding:4px; background:none; border:0; color:#65439b; cursor:pointer; }
.agenda-mini { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; margin-bottom:20px; }
.agenda-mini span,.agenda-mini button { text-align:center; font-size:11px; min-height:24px; padding:4px 0; }
.agenda-mini button { color:#624097; background:white; border:0; border-radius:50%; cursor:pointer; aspect-ratio:1; }
.agenda-mini button.selected { background:#593a98; color:white; }
.agenda-filters label { display:flex; align-items:center; gap:8px; font-size:13px; margin:12px 0; overflow-wrap:anywhere; }
.agenda-filters input[type="checkbox"] { accent-color:#593a98; flex:none; }
.agenda-filters .agenda-date-label { display:grid; }
.agenda-date-label input { min-width:0; width:100%; border:1px solid #ddd5e9; border-radius:4px; padding:6px; }
.agenda-dentists { border-top:1px solid #e9e3f1; margin-top:14px; padding-top:5px; }
.agenda-main { min-width:0; }
.agenda-grid-scroll { overflow:auto; max-height:72vh; }
.agenda-time-grid { display:grid; grid-template-columns:48px repeat(var(--days),minmax(120px,1fr)); }
.agenda-column-heading,.agenda-grid-corner { position:sticky; top:0; z-index:2; background:white; border:0; border-bottom:1px solid #e2dfe7; min-height:82px; }
.agenda-column-heading { display:grid; justify-items:center; align-content:center; gap:8px; color:#5e556c; cursor:pointer; }
.agenda-column-heading span { font-size:11px; }
.agenda-column-heading strong { font-size:24px; font-weight:400; width:38px; height:38px; display:grid; place-items:center; }
.agenda-column-heading .today,.agenda-day-number.today { border-radius:50%; background:#76a1da; color:white; }
.agenda-hour { font-size:10px; color:#83798d; text-align:right; padding:5px 6px 0 0; border-bottom:1px solid #e9e7ec; min-height:62px; }
.agenda-hour-cell { min-height:62px; border-right:1px solid #e2e0e6; border-bottom:1px solid #e9e7ec; background:linear-gradient(to bottom,transparent calc(50% - 1px),#f5f4f7 50%,transparent calc(50% + 1px)); padding:3px; }
.agenda-event { display:block; width:100%; text-align:left; padding:6px; margin-bottom:3px; border:1px solid #cddfef; border-left:3px solid #5888b5; border-radius:4px; background:#edf5fc; color:#314c65; cursor:pointer; overflow-wrap:anywhere; }
.agenda-event strong,.agenda-event span,.agenda-event small { display:block; font-size:11px; }
.agenda-event .person-avatar { float:left; margin-right:5px; width:24px; height:24px; min-width:24px; max-width:24px; min-height:24px; max-height:24px; flex:0 0 24px; aspect-ratio:1; object-fit:cover; border-radius:50%; }
.agenda-event .avatar-initials { display:inline-flex; align-items:center; justify-content:center; }
.agenda-month { display:grid; grid-template-columns:repeat(7,minmax(100px,1fr)); overflow:auto; }
.agenda-month > strong { text-align:center; font-size:12px; padding:12px; }
.agenda-month > section,.agenda-month > div { min-height:120px; padding:5px; border:1px solid #eeeaf3; }
.agenda-day-number { width:30px; height:30px; padding:4px; border:0; background:white; cursor:pointer; margin-bottom:4px; }
.agenda-empty { padding:24px; color:#746981; }
.agenda-free { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:20px; padding:20px; }
.agenda-free h3 { font-size:14px; }
.agenda-free p { padding:8px; border-bottom:1px solid #ece8f2; font-size:13px; }
@media(max-width:850px){ .agenda-layout { grid-template-columns:minmax(0,1fr); } .agenda-filters { max-width:320px; width:100%; border-right:0; border-bottom:1px solid #e8e3ef; } .agenda-toolbar { gap:6px; padding:10px; } .agenda-toolbar strong { flex-basis:100%; } .agenda-main { overflow:auto; } }
.improvements-board { min-width:0; }
.improvements-banner { display:flex; align-items:center; gap:10px; padding:14px; background:#f0edf8; color:#593a98; border-radius:6px; margin-bottom:24px; }
.improvements-toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:18px; }
.improvements-toolbar select,.improvements-toolbar input[type="search"] { width:auto; max-width:100%; min-height:36px; border:1px solid #e5dff2; background:white; border-radius:5px; padding:7px 10px; }
.improvements-toolbar #improvementSort { max-width:110px; }
.improvements-toolbar #newImprovement { background:#593a98; border-color:#593a98; }
.improvements-tabs { display:flex; flex-wrap:wrap; gap:3px; }
.improvements-tabs button { border:0; background:transparent; border-radius:5px; padding:9px 12px; color:#554569; cursor:pointer; }
.improvements-tabs button.active { background:#593a98; color:white; }
.improvements-following { display:flex; gap:6px; align-items:center; font-size:13px; }
#improvementSearch { margin-left:auto; }
#newImprovement { display:flex; align-items:center; gap:4px; }
.improvement-row { display:flex; align-items:flex-start; gap:14px; padding:20px 16px; background:white; border-bottom:1px solid #eae4f4; }
.improvement-vote { flex:none; width:44px; display:grid; justify-items:center; border:1px solid #e7def6; border-radius:6px; background:white; padding:5px; color:#635178; cursor:pointer; }
.improvement-vote svg { width:16px; height:16px; transform:rotate(180deg); }
.improvement-vote.voted { background:#eee6fc; color:#58349c; border-color:#8162b7; }
.improvement-copy { flex:1; min-width:0; }
.improvement-title { text-align:left; border:0; background:none; padding:0; color:#25253c; font-size:16px; font-weight:600; cursor:pointer; overflow-wrap:anywhere; }
.improvement-copy > p { font-size:14px; color:#6b637d; overflow-wrap:anywhere; margin:8px 0; white-space:pre-wrap; }
.improvement-meta { display:flex; flex-wrap:wrap; gap:8px; color:#746588; font-size:12px; }
.improvement-status { display:inline-block; padding:3px 7px; border-radius:4px; background:#eeebf2; color:#554468; font-size:12px; }
.improvement-comments { display:flex; align-items:center; gap:4px; align-self:center; background:none; border:0; color:#6d5b83; cursor:pointer; }
.improvement-comments svg { width:16px; height:16px; }
.improvement-empty { padding:30px; background:white; border:1px solid #e6dff0; border-radius:6px; }
.improvement-dialog { width:min(1000px,94vw); max-width:94vw; max-height:90dvh; border:1px solid #e4ddee; border-radius:8px; padding:24px; color:#342d44; }
.improvement-dialog::backdrop { background:#28203966; }
.improvement-dialog header,.improvement-dialog footer,.improvement-detail-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.improvement-dialog button { cursor:pointer; border:1px solid #ded3ed; padding:8px 12px; background:white; color:#593a98; border-radius:5px; }
.improvement-dialog .primary-button { background:#593a98; color:white; }
.improvement-dialog label { display:grid; gap:8px; margin:16px 0; }
.improvement-dialog input,.improvement-dialog textarea,.improvement-dialog select { width:100%; min-width:0; padding:10px; border:1px solid #ded7e9; border-radius:5px; font:inherit; }
.improvement-dialog h2 { font-size:22px; overflow-wrap:anywhere; }
.improvement-dialog h3 { font-size:16px; }
.improvement-detail { display:grid; grid-template-columns:minmax(0,1fr) 220px; gap:28px; }
.improvement-detail aside { border-left:1px solid #e5dfee; padding-left:20px; }
.improvement-text,.improvement-comment p { white-space:pre-wrap; overflow-wrap:anywhere; }
.improvement-comment { padding:20px 0; border-bottom:1px solid #eee8f4; }
.improvement-comment time { display:block; margin-top:5px; color:#80738d; font-size:12px; }
.improvement-image { max-width:100%; max-height:300px; object-fit:contain; }
.improvement-privacy { color:#786889; font-size:12px; }
.improvement-dialog [role="alert"],#improvementError { color:#a32f35; }
#appShell .nav [data-module="improvements"] { border-top:1px solid #e8e2ef; margin-top:18px; }
@media(max-width:650px){ .improvement-detail { grid-template-columns:minmax(0,1fr); } .improvement-detail aside { border-left:0; padding-left:0; border-top:1px solid #e5dfee; } .improvement-dialog { padding:16px; } .improvement-row { padding:14px 8px; gap:8px; } #improvementSearch { margin:0; width:100%; } }
.global-actions { position:relative; order:-1; flex:none; }
.global-actions summary { cursor:pointer; padding:9px 14px; border:1px solid #d5cde6; border-radius:5px; color:#593a94; background:#fff; font-size:14px; }
.global-actions-list { position:absolute; top:calc(100% + 6px); left:0; width:210px; padding:6px; background:#fff; border:1px solid #e2ddea; border-radius:6px; box-shadow:0 6px 20px #29203922; z-index:50; display:grid; gap:3px; }
.global-actions-list button { padding:11px 10px; border:0; background:white; text-align:left; color:#443853; border-radius:4px; cursor:pointer; }
.global-actions-list button:hover,.global-actions-list button:focus-visible { background:#eee9fa; }
.global-actions-list button:disabled { color:#999; cursor:not-allowed; }
.topbar-actions .search-box { order:-2; }
.nav-tooltip { position:fixed; z-index:10000; max-width:220px; padding:7px 10px; border-radius:6px; background:#24212b; color:white; font-size:12px; line-height:1.4; box-shadow:0 2px 6px #0002; pointer-events:none; }
.nav-tooltip::before { content:''; position:absolute; left:-5px; top:calc(50% - 5px); border-top:5px solid transparent; border-bottom:5px solid transparent; border-right:5px solid #24212b; }
.nav-message-heading { display:flex; align-items:center; min-width:0; }
.nav-message-heading > [data-module] { flex:1; min-width:0; }
#appShell .sidebar .nav [data-campaigns-toggle] { flex:none; width:28px; padding:4px; justify-content:center; }
#appShell .sidebar .nav [data-campaigns-toggle] svg { width:16px; height:16px; }
#appShell .sidebar #campaignSubmenu[hidden] { display:none; }
#appShell.sidebar-collapsed .nav-message-heading { flex-direction:column; }
#appShell .sidebar .nav [data-module="schedule"] > span:first-child,#appShell .sidebar .nav [data-module="dentistView"] > span:first-child { color:#29847a; background:#e8f5f0; border-radius:4px; }
#appShell { grid-template-columns:280px minmax(0,1fr); }
#appShell .sidebar { position:sticky; top:0; height:100dvh; overflow-y:auto; display:flex; flex-direction:column; background:#fff; color:#514b65; border-right:1px solid #e9e6f0; padding:22px 16px; gap:22px; }
#appShell .sidebar .brand { padding:0 36px 20px 4px; border:0; justify-content:flex-start; gap:8px; }
#appShell .sidebar .brand > div:last-child { display:block; }
#appShell .sidebar .brand strong { color:#342454; font-size:18px; }
#appShell .sidebar .brand span { color:#827990; }
#appShell .sidebar .brand-mark { width:46px; height:43.7px; flex-basis:46px; font-size:11px; background:transparent; color:#50318a; }
.brand-mark img { display:block; width:100%; height:100%; object-fit:contain; }
.auth-brand .brand-mark { width:55.2px; height:43.7px; flex-basis:55.2px; background:transparent; }
.sidebar-toggle { position:absolute; right:14px; top:25px; display:grid; place-items:center; width:32px; height:32px; padding:4px; border:0; border-radius:4px; background:white; color:#5b3b98; cursor:pointer; }
.sidebar-toggle:hover { background:#f0ecf9; }
.sidebar-toggle:focus-visible { outline:2px solid #6747a3; outline-offset:2px; }
#appShell .sidebar .nav { display:grid; grid-template-columns:minmax(0,1fr); overflow:visible; gap:5px; }
#appShell .sidebar .nav button,#appShell .sidebar .nav summary { color:#595367; min-height:42px; font-size:14px; text-align:left; gap:10px; padding:9px 10px; }
#appShell .sidebar .nav button > span:last-child { display:inline; }
#appShell .sidebar .nav button > span:first-child { width:24px; flex:none; color:#807891; }
#appShell .sidebar .nav button > span:first-child,#appShell .sidebar .nav summary > span:first-child { display:grid; place-items:center; }
#appShell .sidebar .nav svg { width:22px; height:22px; }
#appShell .sidebar .nav button:hover,#appShell .sidebar .nav summary:hover { background:#f5f2fa; }
#appShell .sidebar .nav button.active { color:#5a379d; background:#eee9fa; box-shadow:none; font-weight:600; }
#appShell .sidebar .nav-submenu { border-color:#e7e1f1; }
#appShell .sidebar .nav-message-group { flex:initial; }
#appShell .sidebar .tenant-card { display:block; margin-top:auto; border-top:1px solid #e9e6f0; }
#appShell .sidebar .tenant-card > span { color:#807891; }
#appShell .sidebar .tenant-card select { color:#514b65; background:white; border:1px solid #ddd7e8; width:100%; }
#appShell.sidebar-collapsed { grid-template-columns:80px minmax(0,1fr); }
#appShell.sidebar-collapsed .sidebar { padding:16px 10px; gap:16px; }
#appShell.sidebar-collapsed .sidebar .brand { padding:0; justify-content:center; }
#appShell.sidebar-collapsed .sidebar .brand > div:last-child,#appShell.sidebar-collapsed .nav button > span:last-child,#appShell.sidebar-collapsed .nav summary > span:last-child,#appShell.sidebar-collapsed .nav-group-label,#appShell.sidebar-collapsed .tenant-card { display:none; }
#appShell.sidebar-collapsed .sidebar-toggle { position:static; align-self:center; order:1; }
#appShell.sidebar-collapsed .sidebar .brand { order:0; }
#appShell.sidebar-collapsed .sidebar .nav { order:2; }
#appShell.sidebar-collapsed .nav button,#appShell.sidebar-collapsed .nav summary { justify-content:center; padding:9px 4px; }
#appShell.sidebar-collapsed .nav summary::after { display:none; }
#appShell.sidebar-collapsed .nav-submenu { margin-left:0; padding-left:0; }
@media(max-width:650px) {
  #appShell { grid-template-columns:64px minmax(0,1fr); }
  #appShell:not(.sidebar-collapsed) .sidebar { width:min(280px,85vw); z-index:20; box-shadow:8px 0 24px #30264518; }
  #appShell.sidebar-collapsed { grid-template-columns:64px minmax(0,1fr); }
  #appShell.sidebar-collapsed .sidebar { padding:12px 6px; }
  #appShell .workspace { padding-left:12px; padding-right:12px; }
}
.patient-financial-summary { display:flex; flex-wrap:wrap; gap:24px; padding:16px 0; }
.patient-financial-summary p { flex:1; min-width:140px; margin:0; border-left:3px solid #c99b13; padding-left:12px; }
.patient-financial-summary p:first-child { border-color:#d95858; }
.patient-financial-summary p:last-child { border-color:#41884b; }
.patient-financial-summary strong { display:block; margin-top:8px; font-size:20px; }
.patient-debt { border-top:1px solid #dedde5; padding:20px 0; }
.patient-payment { display:flex; flex-wrap:wrap; align-items:center; gap:20px; padding:20px 0; }
.patient-payment span { flex:1; min-width:140px; }
.patient-budget-items [data-budget-item] { border-bottom:1px solid #dedde5; padding:12px 0; }
.patient-budget-items [data-budget-item][hidden] { display:none; }
#appShell .sidebar .nav [data-module] > span:first-child { color:var(--menu-icon,#3566b0); }
.nav [data-module="dashboard"] { --menu-icon:#3566b0; }
.nav [data-module="messages"] { --menu-icon:#087d80; }
.nav [data-module="campaigns"] { --menu-icon:#bf5a20; }
.nav [data-module="integrations"] { --menu-icon:#6851af; }
.nav [data-module="tenants"] { --menu-icon:#207c58; }
.nav [data-module="schedule"] { --menu-icon:#168076; }
.nav [data-module="onlineBooking"] { --menu-icon:#297bb0; }
.nav [data-module="patients"] { --menu-icon:#ad3e79; }
.nav [data-module="records"] { --menu-icon:#3973ae; }
.nav [data-module="treatments"] { --menu-icon:#378145; }
.nav [data-module="contracts"] { --menu-icon:#926514; }
.nav [data-module="finance"] { --menu-icon:#228347; }
.nav [data-module="inventory"] { --menu-icon:#b76622; }
.nav [data-module="lab"] { --menu-icon:#7b4fba; }
.nav [data-module="insurance"] { --menu-icon:#167d94; }
.nav [data-module="reports"] { --menu-icon:#4267b4; }
.nav [data-module="admin"] { --menu-icon:#7854a5; }
.nav [data-module="exports"] { --menu-icon:#12806c; }
.nav [data-module="audit"] { --menu-icon:#b3484f; }
.nav [data-module="procedures"] { --menu-icon:#ac4684; }
.nav [data-module="improvements"] { --menu-icon:#a57712; }
#appShell .sidebar .nav .nav-administration > summary > span:first-child { color:#7854a5; }
#appShell .sidebar .nav .nav-message-group > summary > span:first-child { color:#00848c; }
.topbar .module-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; min-width:0; min-height:44px; width:100%; }
.topbar #moduleTitle { font-size:28px; font-weight:500; margin:0; min-width:0; overflow-wrap:anywhere; line-height:1.2; }
.module-heading-context { display:grid; gap:6px; text-align:right; min-width:0; }
.module-heading-context p { margin:0; font-size:12px; overflow-wrap:anywhere; }
.module-heading-context #moduleEyebrow { color:var(--muted); font-size:11px; font-weight:400; text-transform:none; letter-spacing:0; }
.module-heading-context #moduleClinic { color:var(--text); }
.topbar { border-bottom:1px solid var(--line); padding:10px 0 8px; gap:10px; margin-bottom:12px; }
.module-root > .panel:first-child,
.module-root > .agenda-workspace:first-child { border-top:0; }
.topbar-actions { padding-bottom:6px; }
.dashboard-heading .dashboard-date { display:none; }
@media(max-width:600px){.topbar .module-heading{gap:8px;align-items:flex-start;flex-wrap:wrap}.module-heading-context{max-width:100%;margin-left:auto;gap:4px}.topbar-actions .current-user{max-width:160px}}
.person-camera video { display:block; width:100%; max-height:320px; aspect-ratio:4/3; object-fit:contain; background:#171717; margin:12px 0; }
.person-camera [data-camera-panel]>div { display:flex; flex-wrap:wrap; gap:12px; }
.person-camera [data-camera-error] { color:#a02020; }
.patient-anamnesis-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr)); gap:16px; }
.patient-anamnesis-card { border:1px solid #dedde5; border-radius:8px; padding:20px; }
.patient-anamnesis-card footer { display:flex; flex-wrap:wrap; gap:12px; padding-top:16px; border-top:1px solid #dedde5; }
.anamnesis-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.anamnesis-editor.anamnesis-expanded { width:min(1200px,100vw); max-width:100vw; }
.anamnesis-question { border:0; padding:12px 0 24px; margin:0; }
.anamnesis-question legend { margin-bottom:12px; }
.anamnesis-question label { display:inline-flex; align-items:center; gap:8px; margin-right:24px; }
.anamnesis-question input { width:18px; height:18px; }
.anamnesis-question [data-answer-alert] { display:block; color:#885700; margin-top:8px; }
.anamnesis-question [data-answer-alert][hidden],.anamnesis-meta[hidden] { display:none; }
.anamnesis-editor [data-standard-questions] textarea { min-height:60px; }
@media(max-width:600px){.anamnesis-meta{grid-template-columns:1fr}.patient-anamnesis-card{padding:16px}}
.supplier-supplies{grid-column:1 / -1;min-width:0}
.supplier-supply-row{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) 40px;gap:8px;align-items:end;margin-bottom:12px}
.supplier-supply-row input{width:100%;min-width:0;box-sizing:border-box}
.sidebar [data-module="imports"]{--menu-icon:#078477}
@media(max-width:600px){.supplier-supply-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.clinic-scope{max-width:360px;min-width:0;margin-bottom:16px}
.clinic-scope select{width:100%}
[data-clinic-parent]{display:block;max-width:240px;width:100%;margin-top:6px;padding:8px;border:1px solid var(--line);border-radius:4px;background:white;color:inherit}
#auditRetentionForm{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin:0 0 20px}
#auditRetentionForm label{display:grid;gap:6px}
#auditRetentionMonths{width:160px;max-width:100%;padding:8px;border:1px solid var(--line);border-radius:4px}
[data-clinic-parent]{min-width:180px}
.table td label:has([data-clinic-parent]){display:block;margin-top:8px}
.clinic-hierarchy .clinic-tree-name{position:relative;margin-left:calc(var(--clinic-depth) * 24px);min-width:200px;max-width:320px}
.clinic-hierarchy .clinic-tree-name > strong{display:block;overflow-wrap:anywhere}
.clinic-tree-kind{display:block;font-size:11px;color:var(--muted);margin-bottom:5px}
.clinic-hierarchy .clinic-child .clinic-tree-name::before{content:"";position:absolute;left:-16px;top:0;width:10px;height:26px;border-left:1px solid #b5c4d9;border-bottom:1px solid #b5c4d9}
.clinic-hierarchy .clinic-root > td{border-top:2px solid #ccd7e6;background:#f0f4f8}
.clinic-hierarchy .clinic-tree-name label{display:block;margin-top:8px}
.inventory-payment{display:flex;align-items:center;flex-wrap:wrap;gap:12px;border:1px solid #c6d3e4;padding:16px;min-width:0}.inventory-payment label{display:flex;align-items:center;gap:6px}.inventory-payment input[type=radio]{width:auto}.inventory-payment input[type=number]{width:80px}.inventory-payment strong{margin-left:auto}.inventory-entry-summary{border-top:1px solid #c6d3e4;padding-top:14px;color:#405b76}.inventory-list>div>button{margin:8px 0 14px}
.inventory-dialog{width:min(1100px,calc(100vw - 32px));max-width:1100px}.inventory-dialog #dialogFields{grid-template-columns:repeat(5,minmax(0,1fr))}.inventory-dialog .field:has([name=item]),.inventory-dialog .field:has([name=supplier]){grid-column:span 2}.inventory-dialog .field:has([name=source]){grid-column:span 4}.inventory-list [data-edit-inventory] svg{width:16px;height:16px;vertical-align:middle}@media(max-width:750px){.inventory-dialog #dialogFields{grid-template-columns:repeat(2,minmax(0,1fr))}.inventory-dialog .field:has([name=source]){grid-column:span 2}.inventory-payment strong{margin-left:0}}@media(max-width:450px){.inventory-dialog #dialogFields{grid-template-columns:minmax(0,1fr)}.inventory-dialog .field:has([name=item]),.inventory-dialog .field:has([name=supplier]),.inventory-dialog .field:has([name=source]){grid-column:span 1}}
.inventory-record footer{display:flex;justify-content:flex-end;margin-top:10px}.inventory-record [data-edit-inventory]{margin:0}
.inventory-list .inventory-record{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:4px;padding:9px 12px;min-width:0}.inventory-list .inventory-record header{grid-column:1;align-items:center;gap:6px 12px}.inventory-list .inventory-record p{grid-column:1;margin:0;font-size:11px;line-height:1.4;overflow-wrap:anywhere}.inventory-list .inventory-record footer{grid-column:2;grid-row:1/3;align-self:center;margin:0}.inventory-list .inventory-record [data-edit-inventory]{padding:6px 9px;min-height:32px}.inventory-list .inventory-low{border-color:#d68b8b;border-left:3px solid #bd4141;background:#fff4f4}.inventory-list .inventory-low header>strong{color:#9f2929}.inventory-list .inventory-low .status.danger{background:#fbe0e0;color:#a12626;font-weight:600}.inventory-list .inventory-record .status{white-space:normal;overflow-wrap:anywhere}@media(max-width:550px){.inventory-list .inventory-record header{align-items:flex-start;flex-direction:column}.inventory-list .inventory-record{column-gap:8px;padding:9px}}
.clinic-message-dialog{width:min(720px,calc(100vw - 24px));max-height:90vh;overflow:auto;padding:24px;border:1px solid #b7c5d7;border-radius:8px}.clinic-message-dialog textarea{resize:vertical}.clinic-message-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.clinic-message-dialog footer{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.clinic-message-dialog [role=alert]{color:#b42318}.inventory-record[hidden],.field[hidden]{display:none!important}@media(max-width:550px){.clinic-message-fields{grid-template-columns:minmax(0,1fr)}}
#clinicMessagesRoot{min-width:0;width:100%;max-width:100%}#clinicMessagesRoot .panel{min-width:0;max-width:100%}#clinicMessagesRoot .panel-header{flex-wrap:wrap;gap:12px}#clinicMessagesRoot .panel-header button{max-width:100%;white-space:normal}#clinicMessagesRoot .table-scroll{width:100%;max-width:100%;overflow:auto}#clinicMessagesRoot .table{min-width:440px}.clinic-message-dialog input,.clinic-message-dialog select,.clinic-message-dialog textarea{min-width:0;max-width:100%}
#holidaysRoot{min-width:0;max-width:100%}#holidaysRoot .panel-header{flex-wrap:wrap;gap:12px}.holiday-filters{display:grid;grid-template-columns:100px repeat(2,minmax(140px,1fr)) minmax(160px,2fr) minmax(120px,1fr);gap:12px}.holiday-filters input,.holiday-filters select{min-width:0;width:100%}.holiday-pagination,.holiday-switches,.holiday-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.holiday-pagination{margin-top:16px}.holiday-actions{flex-wrap:nowrap}.holiday-actions button{width:36px;height:36px;padding:6px}.holiday-warning{padding:10px 12px;border-left:3px solid #b45309;background:#fff6df;color:#774810;overflow-wrap:anywhere}.agenda-hour-cell.agenda-holiday,.agenda-month>section.agenda-holiday{background:#fce8e8;box-shadow:inset 0 0 0 1px #e8baba}.agenda-column-heading.agenda-holiday{background:#fce8e8}.holiday-day-label{display:block;white-space:normal;font-size:11px;line-height:1.3;color:#8b2929;overflow-wrap:anywhere}.agenda-day-number .holiday-day-label{max-width:110px}.holiday-switches{margin-top:16px}#holidaysRoot .table{min-width:850px}@media(max-width:900px){.holiday-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:500px){.holiday-filters{grid-template-columns:minmax(0,1fr)}}
.message-history-heading{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:16px}.message-history-heading span{font-size:12px;color:#52637a}.message-history-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.message-history-filters input,.message-history-filters select{min-width:0;max-width:100%}.clinic-message-dialog [data-new-criterion]{margin:16px 0;padding:12px;border:1px solid #b7c5d7}.clinic-message-dialog [data-new-criterion][hidden]{display:none}@media(max-width:800px){.message-history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:500px){.message-history-filters{grid-template-columns:minmax(0,1fr)}}
.holiday-actions button,.holiday-pagination button,.holiday-pagination select{border:1px solid #c2ccd9;background:#fff;border-radius:4px;color:#405775;padding:6px}.holiday-pagination button:disabled,.agenda-filters button:disabled{opacity:.5;cursor:not-allowed}.agenda-column-heading .holiday-day-label{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.agenda-month>section>.holiday-day-label{padding:4px 6px;max-width:100%}
#holidaysRoot .holiday-filters{grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr))}
.checkbox-field:has([name="communicationConsent"]) .checkbox-list{display:block}
.checkbox-field:has([name="communicationConsent"]) .checkbox-list label{display:flex;align-items:flex-start;gap:12px;line-height:1.6;white-space:normal;padding:12px;max-width:100%;box-sizing:border-box;color:#000;font-weight:400}
.checkbox-field [name="communicationConsent"]{flex:0 0 18px;width:18px;height:18px;margin-top:4px}
.patient-next-visit-soon{display:inline-block;padding:5px 8px;border-left:3px solid #b87508;border-radius:3px;background:#fff1cc;color:#704300;font-weight:700}
.registration-origin{display:flex;flex-wrap:wrap;gap:10px 24px;padding-top:14px;border-top:1px solid #dce3ed;font-size:12px;color:#526379}
.patient-age .patient-minor-badge{display:inline-block;color:#8a390c;background:#fff0d4;border:1px solid #e7bb75;border-radius:3px;padding:2px 6px;margin-left:5px;font-size:11px;font-weight:700;line-height:1.4;white-space:normal}
.patient-sort-button{display:inline-flex;align-items:center;gap:6px;border:0;background:none;color:inherit;font:inherit;font-weight:600;padding:4px 0;text-align:left;cursor:pointer}
.patient-sort-button svg{width:14px;height:14px}
th[aria-sort="ascending"] .patient-sort-button svg{transform:rotate(180deg)}
