@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: "DM Sans", sans-serif;
  color: #233a3b;
  background: #f5f8f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #203839;
  --muted: #829393;
  --green: #157b70;
  --green-dark: #11675e;
  --green-light: #e8f4f1;
  --line: #e8eeec;
  --surface: #fff;
  --shadow: 0 7px 24px rgba(37, 70, 67, .045);
}

.cloud-invite-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 1.1fr) minmax(140px, .65fr) auto;
  gap: 12px;
  align-items: end;
}
.cloud-invite-form .field { margin: 0; }
.cloud-invite-help {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.cloud-invite-status {
  min-height: 18px;
  margin: 8px 0;
  color: var(--green-dark);
  font-size: 13px;
}
.cloud-invite-list { display: grid; gap: 8px; }
.cloud-invite-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.cloud-invite-row > span { display: grid; gap: 4px; min-width: 0; }
.cloud-invite-row strong { overflow-wrap: anywhere; }
.cloud-invite-row small { color: var(--muted); }
.cloud-invite-row select { max-width: 180px; }
.access-profile-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }
.access-profile-list > div { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfc; }
.access-profile-list strong { color: var(--green-dark); font-size: 13px; }
.access-profile-list span { color: var(--muted); font-size: 12px; line-height: 1.45; }
@media (max-width: 760px) {
  .cloud-invite-form { grid-template-columns: minmax(0, 1fr); }
  .cloud-invite-help { align-items: flex-start; flex-direction: column; }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 250px; flex: 0 0 250px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 27px 16px 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 10px 24px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--green); color: #fff; font: 800 24px Manrope,sans-serif; text-align: center; line-height: 34px; transform: rotate(-8deg); }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font: 800 18px Manrope,sans-serif; letter-spacing: -.8px; }
.brand-copy small { color: #96a4a4; font-size: 10px; margin-top: 3px; }
.clinic-switcher { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 10px; background: #f7f9f8; border: 1px solid #eef2f0; border-radius: 11px; margin-bottom: 27px; color: var(--ink); text-align: left; }
.clinic-avatar,.profile-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; color: #19776c; background: #dcefeb; font-weight: 700; }
.clinic-switcher strong,.clinic-switcher small,.profile-button strong,.profile-button small { display: block; }
.clinic-switcher strong,.profile-button strong { font-size: 12px; font-weight: 700; }
.clinic-switcher small,.profile-button small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.switch-chevron { margin-left: auto; font-size: 17px; color: #899a99; }
.nav-label { color: #a0adac; font-size: 9px; font-weight: 700; letter-spacing: 1.1px; padding: 0 11px 9px; }
.main-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #718382; border-radius: 9px; text-align: left; padding: 10px 11px; display: flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 500; transition: .15s ease; }
.nav-item:hover { background: #f5f8f7; color: var(--green); }
.nav-item.active { background: var(--green-light); color: var(--green-dark); font-weight: 700; }
.nav-icon { display: inline-grid; place-items: center; width: 18px; font-size: 17px; }
.nav-count { margin-left: auto; background: #d4ebe6; color: #18776b; font-size: 10px; border-radius: 10px; min-width: 19px; text-align: center; padding: 2px 5px; }
.sidebar-bottom { margin-top: auto; }
.help-card { border: 1px solid #e8efed; border-radius: 12px; padding: 14px; margin: 22px 2px 17px; position: relative; }
.help-icon { position: absolute; top: 13px; right: 12px; width: 18px; height: 18px; border: 1px solid #dfe9e6; border-radius: 50%; display: grid; place-items: center; color: #8b9b99; font-size: 10px; }
.help-card strong,.help-card small { display: block; }
.help-card strong { font-size: 11px; }
.help-card small { color: var(--muted); font-size: 10px; margin-top: 6px; line-height: 1.5; }
.help-card button { border: 0; color: var(--green); background: transparent; font-size: 10px; font-weight: 700; padding: 10px 0 0; }
.help-card button span { padding-left: 4px; }
.profile-button { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; background: transparent; text-align: left; padding: 9px 5px 0; color: var(--ink); border-top: 1px solid var(--line); }
.profile-avatar { background: #f6e8df; color: #a26143; border-radius: 50%; font-size: 10px; }
.profile-more { margin-left: auto; color: #90a09f; font-size: 20px; letter-spacing: 1px; }
.main-area { min-width: 0; flex: 1; }
.topbar { height: 72px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 36px; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #9aa8a6; font-size: 11px; }
.breadcrumbs strong { color: #405655; font-weight: 600; }
.crumb-separator { color: #c4cfcc; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.search-box { width: 240px; height: 35px; border: 1px solid #e9efed; border-radius: 8px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: #98a7a5; }
.search-box span { font-size: 20px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.search-box input::placeholder { color: #a1aeac; }
.icon-button { width: 30px; height: 30px; border: 0; background: transparent; color: #708582; font-size: 20px; position: relative; }
.notification-button i { position: absolute; width: 5px; height: 5px; border: 1px solid #fff; background: #e58669; border-radius: 50%; top: 5px; right: 5px; }
.topbar-divider { height: 24px; width: 1px; background: var(--line); }
.help-link { background: transparent; border: 0; color: #687b79; font-size: 11px; }
.help-link span { color: var(--green); padding-left: 4px; }
.mobile-menu { display: none; }
.page-content { max-width: 1440px; margin: 0 auto; padding: 30px 36px 50px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
h1,h2,h3,p { margin-top: 0; }
h1 { color: var(--ink); font: 700 24px Manrope,sans-serif; letter-spacing: -.65px; margin-bottom: 6px; }
.page-heading p { color: #869593; font-size: 11px; margin-bottom: 0; }
.heading-actions { display: flex; gap: 9px; align-items: center; }
.button { border: 1px solid #e3ebe8; background: #fff; color: #516765; border-radius: 8px; padding: 9px 13px; font-weight: 600; font-size: 10px; transition: .15s; }
.button:hover { border-color: #b7d4ce; color: var(--green); }
.button.primary { border-color: var(--green); background: var(--green); color: #fff; box-shadow: 0 3px 8px #157b7022; }
.button.primary:hover { background: var(--green-dark); }
.button .plus { font-size: 15px; vertical-align: -1px; margin-right: 5px; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 17px; }
.metric-card,.panel,.section-card { background: #fff; border: 1px solid #edf1ef; border-radius: 12px; box-shadow: var(--shadow); }
.metric-card { padding: 17px 18px 15px; min-height: 112px; }
.metric-top { display: flex; justify-content: space-between; align-items: center; color: #81928f; font-size: 10px; }
.metric-icon { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; color: #25887c; background: #eaf5f2; font-size: 16px; }
.metric-card strong { display: block; font: 700 23px Manrope,sans-serif; letter-spacing: -.5px; color: #294342; margin: 9px 0 3px; }
.metric-foot { color: #91a09e; font-size: 9px; }
.metric-foot b { color: #278a70; font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(240px,.9fr); gap: 16px; }
.panel { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.panel-head h2,.section-title { font: 700 13px Manrope,sans-serif; color: #304746; margin: 0; }
.panel-head p { color: #93a09e; font-size: 9px; margin: 5px 0 0; }
.text-button { color: var(--green); font-size: 10px; border: 0; background: transparent; font-weight: 700; white-space: nowrap; }
.appointment-list { display: grid; }
.appointment-row { display: grid; grid-template-columns: 63px 3px minmax(0,1fr) auto; align-items: center; gap: 12px; border-top: 1px solid #f0f3f2; padding: 12px 0; }
.appointment-time { color: #607573; font-size: 10px; font-weight: 600; }
.appointment-color { height: 38px; border-radius: 4px; background: var(--procedure-color, #83b9aa); }
.appointment-info strong { display: block; color: #3a504f; font-size: 10px; font-weight: 700; }
.appointment-info small { display: block; color: #99a6a4; font-size: 9px; margin-top: 4px; }
.status { display: inline-block; border-radius: 20px; font-size: 8px; font-weight: 600; padding: 5px 8px; white-space: nowrap; }
.status.confirmed,.status.pago,.status.aprovado { color: #27836c; background: #e9f5ef; }
.status.waiting,.status.analise { color: #a67c33; background: #fbf3e5; }
.status.pending { color: #7d75af; background: #f0eef9; }
.status.late,.status.atrasado { color: #c16254; background: #fbecea; }
.status.neutral { background: #f0f3f2; color: #788987; }
.side-stack { display: grid; gap: 15px; align-content: start; }
.revenue-amount { font: 700 21px Manrope,sans-serif; letter-spacing: -.5px; color: #294342; }
.revenue-amount small { font: 500 10px "DM Sans",sans-serif; color: #94a19f; }
.chart { height: 79px; display: flex; align-items: end; gap: 9px; padding: 7px 4px 0; border-bottom: 1px solid #edf1ef; margin: 10px 0 9px; }
.chart-bar { flex: 1; background: #dcefe9; border-radius: 4px 4px 0 0; min-height: 14px; }
.chart-bar:nth-child(2n) { background: #9acabe; }.chart-bar:nth-child(4) { background: #278a7b; }
.chart-labels { display: flex; justify-content: space-between; color: #a2aeac; font-size: 8px; }
.goal-row { display: flex; justify-content: space-between; color: #82928f; font-size: 9px; margin-top: 13px; }
.progress-track { height: 5px; background: #edf2f0; border-radius: 5px; margin-top: 7px; overflow: hidden; }
.progress-fill { height: 100%; width: 72%; background: #3b9a82; border-radius: inherit; }
.attention-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #f0f3f2; }
.attention-dot { width: 8px; height: 8px; border-radius: 50%; background: #e2a04e; }
.attention-row div { flex: 1; color: #607471; font-size: 9px; }
.attention-row small { display: block; color: #9aa7a5; font-size: 8px; margin-top: 3px; }
.attention-row b { color: #ad7c38; font-size: 8px; font-weight: 600; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 15px; }
.filter-input,.filter-select { border: 1px solid #e6edeb; border-radius: 7px; padding: 8px 10px; background: #fff; color: #5d716e; font-size: 10px; outline: none; }
.filter-input { min-width: 205px; }
.data-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th { text-align: left; color: #97a4a2; font-size: 9px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid #edf1ef; }
td { padding: 12px; color: #657775; font-size: 10px; border-bottom: 1px solid #f0f3f2; }
tbody tr:last-child td { border-bottom: 0; }
.patient-cell { display: flex; align-items: center; gap: 9px; color: #3f5654; font-weight: 600; }
.patient-avatar { width: 29px; height: 29px; border-radius: 50%; background: #e7f2ef; display: grid; place-items: center; color: #438577; font-size: 9px; font-weight: 700; }
.patient-avatar.orange { background: #f7eade; color: #ad7753; }.patient-avatar.purple { background: #efebf8; color: #8276ac; }.patient-avatar.blue { background: #e6eef7; color: #6684aa; }
.table-action { border: 0; background: transparent; color: var(--green); font-size: 10px; font-weight: 600; }
.two-column { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(250px,.8fr); gap: 15px; }
.two-column > * { min-width: 0; }
.patient-profile-head { padding: 20px; display: flex; align-items: center; gap: 15px; }
.patient-profile-head .patient-avatar { width: 54px; height: 54px; font-size: 15px; }
.patient-profile-head > .patient-photo { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%; object-fit: cover; }
.patient-profile-head h2 { font: 700 17px Manrope,sans-serif; margin: 0 0 5px; }
.patient-profile-head p { color: #91a09e; font-size: 10px; margin: 0; }
.alert-banner { padding: 10px 12px; border-radius: 8px; background: #fff6e8; color: #a7742e; font-size: 10px; margin: 0 0 14px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-button { white-space: nowrap; border: 0; background: transparent; color: #879694; font-size: 10px; padding: 0 0 10px; }
.tab-button.active { color: var(--green); border-bottom: 2px solid var(--green); font-weight: 700; }
.patient-detail-content { min-width: 0; padding-top: 17px; }
.clinical-subtabs { display: flex; flex-wrap: nowrap; gap: 6px; padding: 12px 0 0; overflow-x: auto; scrollbar-width: thin; }
.clinical-subtab { flex: 0 0 auto; border: 1px solid transparent; border-radius: 18px; padding: 6px 10px; background: #f6f9f8; color: #758783; font-size: 9px; }
.clinical-subtab:hover,.clinical-subtab.active { border-color: #b7d5cb; background: #eaf5f2; color: var(--green-dark); font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.detail-item small { color: #9aa7a4; display: block; font-size: 9px; margin-bottom: 5px; }
.detail-item strong { color: #4b6260; font-size: 10px; font-weight: 600; }
.patient-face-photo { display: block; width: 68px; height: 68px; border-radius: 50%; object-fit: cover; }
.odontogram-reference { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; border: 1px solid #d7dddb; background: #fff; }
.odontogram-arch-block { min-width: 0; padding: 6px 6px 0; }
.odontogram-arch-title { min-height: 23px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #aeb8b5; color: #586762; font-size: 9px; letter-spacing: .04em; }
.odontogram-arch-title strong { font-size: 10px; }
.odontogram-arch-title span { color: #82908c; }
.anatomical-row { display: flex; align-items: stretch; position: relative; }
.anatomical-quadrant { display: grid; flex: 1 1 50%; min-width: 0; grid-template-columns: repeat(8,minmax(0,1fr)); }
.quadrant-label { display: none; }
.anatomical-slot { min-width: 0; display: grid; justify-items: center; border-right: 1px solid #e0e5e3; transition: background .15s; }
.anatomical-quadrant:first-child .anatomical-slot:first-child { border-left: 1px solid #e0e5e3; }
.anatomical-quadrant:first-child .anatomical-slot:last-child { border-right: 2px solid #9fa9a6; }
.anatomical-slot.selected { background: #fff3e9; box-shadow: inset 0 0 0 1px #e4a77d; }
.anatomical-tooth-card { width: 100%; min-width: 0; height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tooth-number { height: 12px; color: #45534f; font: 600 8px Arial,sans-serif; }
.anatomical-tooth { width: min(100%,42px); height: 62px; overflow: visible; }
.tooth-not-erupted { height: 76px; display: grid; align-items: center; color: #ccd4d1; font-size: 18px; }
.replaced-tooth-history { max-width: 100%; overflow: hidden; border: 0; padding: 1px 2px; background: transparent; color: #647d76; font-size: 6px; white-space: nowrap; cursor: pointer; }
.primary-row .anatomical-tooth { width: min(100%,48px); height: 77px; }
.tooth-flipped { transform: scale(1,-1) translate(0,-88px); }
.tooth-root { fill: #fff; stroke: #34413d; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tooth-crown { fill: #fff; stroke: #34413d; stroke-width: 1.6; stroke-linejoin: round; }
.tooth-detail { fill: none; stroke: #78837f; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.implant-crown { fill: #fff9e8; stroke: #92733b; stroke-width: 2; }
.prosthetic-crown { fill: #f5dfaa; stroke: #a77c27; stroke-width: 2; }
.prosthetic-crown.crown-only { fill: #f6e8c9; stroke: #a77c27; }
.prosthetic-seam { fill: none; stroke: #8a6928; stroke-width: 1.5; stroke-linecap: round; }
.implant-fixture { fill: #cbd4d1; stroke: #5c6e69; stroke-width: 1.7; stroke-linejoin: round; }
.implant-thread { fill: none; stroke: #5c6e69; stroke-width: 1; stroke-linecap: round; }
.implant-abutment { fill: #ded8c4; stroke: #756d58; }
.extraction-mark ellipse { fill: #fbf0ee; stroke: #ae4a40; stroke-width: 1.5; stroke-dasharray: 2 1; }
.extraction-mark path { fill: none; stroke: #ae4a40; stroke-width: 2; stroke-linecap: round; }
.tooth-surface-hit { fill: #fff; fill-opacity: .01; stroke: #a7b0ad; stroke-width: .8; stroke-linejoin: round; cursor: pointer; transition: fill .12s,stroke .12s; }
.tooth-surface-hit:hover,.tooth-surface-hit:focus { fill: #a9d8ca; fill-opacity: .85; stroke: #347e6e; stroke-width: 1.5; outline: none; }
.tooth-surface-hit.has-record { fill: #f3c9a7; fill-opacity: .85; }
.tooth-surface-hit.has-record.completed { fill: #91c9b7; }
.tooth-surface-hit.has-record.pending { fill: #f1c48c; }
.tooth-surface-hit.has-record:hover,.tooth-surface-hit.has-record:focus { stroke: #286f60; stroke-width: 1.6; }
.tooth-surface-hit.face-selected { fill: #73bda9; fill-opacity: .9; stroke: #277663; stroke-width: 1.4; }
.extracted-tooth { fill: #f8e4df; stroke: #b94a3f; stroke-dasharray: 2 1; }
.tooth-selector { display: grid; justify-items: center; gap: 7px; padding: 8px; border: 1px solid #e6eeeb; border-radius: 9px; background: #f9fbfa; }
.tooth-selector > p { margin: 0; color: #788985; font-size: 9px; text-align: center; line-height: 1.45; }
.tooth-selector .anatomical-tooth-card { width: 130px; height: 190px; }
.tooth-selector .anatomical-tooth { width: 118px; height: 164px; }
.tooth-selector .tooth-number { font-size: 11px; }
.tooth-face-key { color: #72817d; font-size: 8px; text-align: center; }
.whole-tooth-field label { display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.whole-tooth-field input { margin-top: 1px; accent-color: var(--green); }
.whole-tooth-field small { color: #899793; font-size: 8px; }
.whole-tooth-field input { width: auto; }
.odontogram-midline { height: 20px; display: flex; align-items: center; gap: 8px; color: #899591; font-size: 8px; text-transform: uppercase; }
.odontogram-midline i { height: 1px; flex: 1; background: #c4ccca; }
.lower-title { justify-content: flex-end; border-top: 1px solid #aeb8b5; border-bottom: 0; }
.odontogram-legend { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 7px 8px; border-top: 1px solid #aeb8b5; color: #687571; font-size: 8px; }
.odontogram-legend span { display: inline-flex; align-items: center; gap: 4px; }
.odontogram-legend b { color: #3d514b; font-size: 9px; }
.legend-mark { width: 9px; height: 9px; border-radius: 2px; background: #f1c48c; }
.legend-mark.completed { background: #91c9b7; }
.surface-history { margin-top: 8px; }
.pending-dot { background: #e5a84c; box-shadow: 0 0 0 3px #fff3df; }
.legend { display: flex; gap: 14px; color: #8a9a97; font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; background: #e8aa80; }.legend i.done-key { background: #7db8a7; }
.timeline-item { display: flex; gap: 11px; padding: 10px 0; border-top: 1px solid #eef2f0; }
.timeline-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 3px; border-radius: 50%; background: #68aa98; box-shadow: 0 0 0 3px #e8f4f0; }
.timeline-item strong { color: #506663; font-size: 10px; display: block; }
.timeline-item small { color: #99a6a4; font-size: 9px; display: block; margin-top: 4px; line-height: 1.5; }
.empty-state { text-align: center; color: #8c9a98; font-size: 11px; padding: 36px 15px; }
.calendar-toolbar { display: flex; align-items: center; gap: 10px; }
.calendar-date { color: #415956; font-size: 11px; font-weight: 700; }
.calendar-toggle { display: flex; border: 1px solid #e7eeeb; padding: 3px; border-radius: 7px; gap: 2px; }
.calendar-toggle button { border: 0; background: transparent; color: #899895; padding: 5px 7px; font-size: 9px; border-radius: 5px; }
.calendar-toggle button.active { background: #eaf4f1; color: var(--green); font-weight: 700; }
.schedule-list { display: grid; }
.schedule-row { display: grid; grid-template-columns: 62px minmax(0,1fr); min-height: 75px; border-top: 1px solid #eef2f0; }
.schedule-time { padding-top: 15px; color: #8b9a98; font-size: 10px; }
.schedule-event { margin: 8px 0; border-left: 3px solid #52a08d; border-radius: 0 6px 6px 0; background: #edf6f3; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.schedule-event.lilac { border-color: #988fc6; background: #f2f0f9; }.schedule-event.peach { border-color: #d99a72; background: #fff3eb; }.schedule-event.blue { border-color: #7d9ec4; background: #eff4fa; }
.schedule-event strong { display: block; color: #506562; font-size: 10px; }.schedule-event small { display: block; color: #899a97; font-size: 9px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1/-1; }
.field label { color: #637774; font-size: 10px; font-weight: 600; }
.field input,.field select,.field textarea { border: 1px solid #e3ebe8; border-radius: 7px; outline: 0; padding: 9px 10px; color: #526764; font-size: 11px; background: #fff; width: 100%; }
.field textarea { min-height: 75px; resize: vertical; }
.field input:focus,.field select:focus,.field textarea:focus { border-color: #8bbdb2; box-shadow: 0 0 0 3px #e9f4f1; }
.field input[type="color"] { min-height: 36px; padding: 3px; cursor: pointer; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: #18333066; display: grid; place-items: center; padding: 16px; }
.modal { width: min(490px,100%); background: #fff; border-radius: 14px; box-shadow: 0 20px 70px #16302d33; padding: 22px; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 17px; }
.modal-head h2 { margin: 0 0 5px; font: 700 16px Manrope,sans-serif; color: #304846; }
.modal-head p { margin: 0; color: #8d9b99; font-size: 10px; }
.modal-close { border: 0; background: #f4f7f6; color: #758784; width: 27px; height: 27px; border-radius: 7px; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 20px; background: #234541; color: #fff; border-radius: 9px; padding: 12px 16px; font-size: 11px; box-shadow: 0 8px 24px #1a393733; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

[hidden] { display: none !important; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 20%, #e8f4f1 0, transparent 38%), #f5f8f7; }
.auth-card { width: min(440px,100%); background: #fff; border: 1px solid #e8efed; border-radius: 18px; box-shadow: 0 18px 55px rgba(37,70,67,.1); overflow: hidden; }
.auth-brand { padding: 25px 28px 20px; border-bottom: 1px solid #eef2f0; }
.auth-content { padding: 28px; }
.auth-eyebrow { color: #788f8b; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; }
.auth-content h1 { margin: 10px 0 8px; font-size: 23px; }
.auth-content > p { color: #748582; font-size: 12px; line-height: 1.6; }
.google-signin { width: 100%; min-height: 44px; margin: 11px 0 13px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; }
.google-signin:disabled { opacity: .65; cursor: wait; }
.google-mark { font: 700 16px Arial,sans-serif; color: #4285f4; background: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.auth-status { min-height: 18px; margin: 8px 0 0; color: #607573; font-size: 11px; }
.auth-membership { margin-top: 15px; padding: 14px; background: #fff8eb; border: 1px solid #f1e2c3; border-radius: 10px; }
.auth-membership p { color: #685638; font-size: 11px; line-height: 1.55; margin: 0 0 10px; }
.auth-membership code { display: block; overflow-wrap: anywhere; color: #495c59; font-size: 10px; line-height: 1.6; margin-bottom: 11px; }
.auth-signout { margin-top: 14px; }
.auth-footnote { display: block; margin-top: 23px; color: #91a09e; font-size: 10px; line-height: 1.55; }
.profile-button .profile-more { font-size: 10px; letter-spacing: 0; }
.status-card { display: flex; justify-content: space-between; align-items: center; border: 1px solid #edf1ef; border-radius: 9px; padding: 12px; margin-bottom: 9px; }
.status-card strong { display: block; color: #4b625f; font-size: 10px; }.status-card small { display: block; color: #98a5a3; font-size: 9px; margin-top: 4px; }
.inventory-level { width: 90px; }.inventory-level .progress-track { margin-top: 0; }
.muted { color: #93a19f; font-size: 10px; }

@media (max-width: 1050px) {
  .sidebar { width: 220px; flex-basis: 220px; }
  .page-content { padding: 26px 23px 42px; }
  .topbar { padding: 0 24px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .odontogram-management { grid-template-columns: 1fr; }
}
.odontogram-management { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.clinical-service-panels { grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); }
.odontogram-management .panel { margin: 0; min-width: 0; }
.odontogram-management .panel-head { align-items: flex-start; }
.odontogram-management .panel-head h2 { margin: 0; color: #405753; font: 700 12px Manrope,sans-serif; }
.odontogram-management .panel-head p { margin: 4px 0 0; color: #92a09c; font-size: 9px; line-height: 1.4; }
.pending-dental-service { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid #eef2f0; }
.pending-dental-info { min-width: 0; }
.pending-dental-info strong,.pending-dental-info small { display: block; }
.pending-dental-info strong { overflow: hidden; color: #506663; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pending-dental-info small { margin-top: 4px; color: #96a39f; font-size: 8px; line-height: 1.4; }
.pending-dental-service .table-action { grid-column: 2; justify-self: end; }
.inline-status { display: inline-flex; align-items: center; gap: 5px; color: #82918d; font-size: 8px; }
.inline-status select { max-width: 90px; border: 1px solid #e3ebe8; border-radius: 6px; padding: 5px; background: #fff; color: #5c716e; font-size: 8px; }
.pending-dental-service .inline-status { justify-self: end; }
.empty-pending { padding: 10px 0; }
.pending-service-open { display: block; min-width: 0; border: 0; padding: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.pending-service-open strong,.pending-service-open small { display: block; }
.pending-service-open strong { overflow: hidden; color: #506663; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pending-service-open small { margin-top: 4px; color: #96a39f; font-size: 8px; line-height: 1.45; }
.pending-service-open:hover strong { color: var(--green); }
.service-category { display: inline-block; margin-bottom: 4px; color: #7d9991; font-size: 7px; letter-spacing: .04em; text-transform: uppercase; }
.pending-service-value { color: #536f68; font-size: 9px; font-weight: 700; white-space: nowrap; }
.pending-service-price { display: grid; gap: 3px; color: #82918d; font-size: 7px; }
.pending-service-price input { width: 92px; min-width: 76px; border: 1px solid #dfe9e5; border-radius: 6px; padding: 6px 7px; color: #4b655f; font-size: 9px; }
.pending-service-price input:focus { border-color: #8bbdb2; outline: 0; box-shadow: 0 0 0 2px #e9f4f1; }
.service-panel-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.compact-button { padding: 7px 9px; font-size: 9px; white-space: nowrap; }
.compact-button:disabled { opacity: .45; cursor: not-allowed; }
.service-editor-heading { padding: 10px 12px; border: 1px solid #e6efec; border-radius: 9px; background: #f7faf9; }
.service-editor-heading strong,.service-editor-heading small { display: block; }
.service-editor-heading strong { color: #405753; font-size: 11px; }
.service-editor-heading small { margin-top: 4px; color: #879692; font-size: 9px; line-height: 1.45; }
.modal:has(.quote-builder-list) { width: min(900px,100%); }
.quote-builder-list { display: grid; gap: 8px; max-height: none; overflow: visible; }
.quote-builder-item { display: grid; grid-template-columns: auto minmax(90px,1fr) minmax(120px,1.4fr) minmax(100px,.8fr); align-items: center; gap: 8px; border: 1px solid #e7eeec; border-radius: 9px; padding: 9px; }
.quote-include,.payment-method-options label,.payment-method-option { display: inline-flex; align-items: center; gap: 6px; color: #647975; font-size: 9px; }
.quote-include input,.payment-method-options input,.payment-method-option input { accent-color: var(--green); }
.quote-item-description strong,.quote-item-description small { display: block; }
.quote-item-description strong { color: #516864; font-size: 9px; }
.quote-item-description small { margin-top: 3px; color: #99a6a2; font-size: 8px; }
.quote-builder-item .field { gap: 4px; }
.quote-builder-item .field label { font-size: 8px; }
.quote-builder-item .field input { padding: 7px; font-size: 9px; }
.quote-discount-field { max-width: 190px; }
.installment-field[hidden] { display: none; }
.payment-estimates { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; color: #788984; font-size: 9px; }
.payment-estimates strong { color: #3e6158; }
.payment-method-options { display: flex; flex-wrap: wrap; gap: 8px; }
.quote-builder-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; padding: 11px; border-radius: 8px; background: #f4f8f6; color: #778782; font-size: 9px; }
.quote-builder-totals span { display: inline-flex; gap: 6px; }
.quote-builder-totals strong { color: #3e6158; }
.planned-service-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.health-question-positive { border-color: #e6d3b8; background: #fffcf6; }
.health-answer-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 5px; color: #768781; font-size: 9px; line-height: 1.45; }
.health-answer-summary strong { color: #668075; font-size: 9px; }
.health-question-positive .health-answer-summary strong { color: #ab7248; }
.catalog-service-groups { display: grid; gap: 10px; max-height: 350px; overflow-y: auto; }
.catalog-group h3 { margin: 0 0 5px; color: #647a74; font-size: 9px; font-weight: 700; }
.catalog-service-list { display: grid; max-height: 190px; overflow-y: auto; border: 1px solid #e8efed; border-radius: 8px; padding: 0 10px; }
.catalog-service-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border: 0; border-bottom: 1px solid #edf2f0; background: transparent; color: inherit; text-align: left; }
.catalog-service-row:hover { background: #f7fbf9; }
.catalog-service-row:last-child { border-bottom: 0; }
.catalog-service-row strong,.catalog-service-row small { display: block; }
.catalog-service-row strong { color: #516864; font-size: 9px; }
.catalog-service-row small { margin-top: 3px; color: #91a09c; font-size: 8px; }
.catalog-service-row b { color: #56736a; font-size: 9px; white-space: nowrap; }
.catalog-service-row b small { margin-top: 3px; color: var(--green); font-size: 7px; text-align: right; }
.catalog-settings-list .catalog-service-list { max-height: 220px; }
.catalog-repeat-option { display: flex; align-items: center; gap: 7px; color: #637774; font-size: 9px; }
.catalog-repeat-option input,.catalog-tooth-picker input { accent-color: var(--green); }
.catalog-tooth-picker { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 5px; margin-top: 7px; }
.catalog-tooth-picker label { display: grid; justify-items: center; gap: 2px; padding: 5px 2px; border: 1px solid #e5eeeb; border-radius: 6px; color: #5a716b; font-size: 8px; }
.catalog-tooth-picker label:has(input:checked) { border-color: #80b5a8; background: #edf7f4; color: var(--green-dark); }
.catalog-tooth-picker input { margin: 0; }
.assessment-workspace { display: grid; grid-template-columns: minmax(210px,.72fr) minmax(0,1.8fr); align-items: start; gap: 14px; }
.assessment-workspace > .panel { min-width: 0; padding: 15px; }
.assessment-list .panel-head { align-items: flex-start; }
.assessment-history-list { display: grid; gap: 3px; max-height: 570px; overflow-y: auto; }
.assessment-history-item { width: 100%; display: grid; justify-items: start; gap: 5px; padding: 11px; border: 1px solid #edf1ef; border-radius: 8px; background: #fff; text-align: left; }
.assessment-history-item strong { color: #536a64; font-size: 10px; }
.assessment-history-item small { color: #91a09c; font-size: 8px; line-height: 1.5; }
.assessment-history-item:hover,.assessment-history-item.active { border-color: #b7d5cb; background: #f3f8f6; }
.assessment-editor-panel > .panel-head { margin-bottom: 12px; }
.assessment-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.assessment-fields:disabled { opacity: .8; }
.assessment-context { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin: 2px 0 15px; padding: 10px 12px; border: 1px solid #e6efec; border-radius: 8px; background: #f7faf9; color: #526a65; font-size: 9px; }
.assessment-context span { color: #8b9b97; }
.assessment-workspace .assessment-required { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid #e4ece9; border-radius: 9px; background: #f8fbfa; }
.assessment-required-icon { display: grid; flex: 0 0 26px; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #e7f2ee; color: #4c796d; font-weight: 700; }
.assessment-required strong { color: #46655c; font-size: 10px; }
.assessment-required p { margin: 5px 0 10px; color: #72847e; font-size: 9px; line-height: 1.5; }
.view-only-notice { margin-bottom: 12px; }
.validity-warning { border-color: #ead9b9; background: #fffbf2; }
.validity-warning .assessment-required-icon { background: #f8eed8; color: #97733b; }
.readonly-date { min-height: 35px; display: flex; align-items: center; padding: 8px 10px; border: 1px solid #e8efed; border-radius: 7px; color: #647a74; background: #f8fbfa; font-size: 9px; }
.assessment-revision-history { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e9efed; color: #637a73; font-size: 9px; }
.assessment-revision-history summary { cursor: pointer; font-weight: 700; }
.assessment-revision-history > div { display: grid; gap: 4px; padding: 9px 0; border-bottom: 1px solid #edf1ef; }
.assessment-revision-history small { color: #82928d; line-height: 1.5; }
.ortho-visual-section { padding: 12px; border: 1px solid #e8efed; border-radius: 9px; background: #fbfdfc; }
.ortho-visual-heading { display: grid; gap: 4px; margin-bottom: 10px; }
.ortho-visual-heading strong { color: #526a64; font-size: 10px; }
.ortho-visual-heading small { color: #8a9a96; font-size: 8px; line-height: 1.5; }
.ortho-visual-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.ortho-visual-group > span { display: block; margin-bottom: 7px; color: #71837e; font-size: 8px; font-weight: 700; }
.ortho-visual-options { display: flex; flex-wrap: wrap; gap: 6px; }
.ortho-visual-option { display: grid; justify-items: center; gap: 4px; min-width: 60px; padding: 6px; border: 1px solid #e4ece9; border-radius: 7px; background: #fff; color: #768782; }
.ortho-visual-option:hover,.ortho-visual-option.selected { border-color: #9dc9bd; background: #edf7f4; color: var(--green-dark); }
.ortho-visual-option svg { width: 42px; height: 45px; fill: #f1e4d7; stroke: #8e9b94; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ortho-visual-option svg .ortho-profile-indicator,.ortho-visual-option svg .ortho-angle-mark { fill: none; stroke: #cc816e; stroke-width: 2.2; }
.ortho-visual-option small { font-size: 8px; }
.angle-options .ortho-visual-option svg { width: 48px; height: 48px; }
.assessment-fields:disabled .ortho-visual-option { cursor: not-allowed; }
.history-actions { display: flex; align-items: center; gap: 7px; }
.upcoming-returns { display: grid; gap: 6px; margin: 14px 0; padding: 10px; border: 1px solid #e2eee9; border-radius: 8px; background: #f7fbf9; }
.upcoming-returns > strong { color: #4c6a61; font-size: 9px; }
.upcoming-return { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid #e8f0ed; color: #566d66; font-size: 9px; }
.upcoming-return small { display: block; margin-top: 3px; color: #8b9b96; font-size: 8px; }
.face-clinic-layout { display: grid; grid-template-columns: minmax(200px,.8fr) minmax(0,1.2fr); align-items: start; gap: 14px; margin: 12px 0 18px; }
.face-drawing-wrap { display: grid; justify-items: center; gap: 8px; border: 1px solid #e6eeeb; border-radius: 12px; padding: 12px; background: linear-gradient(160deg,#fbfdfc,#f4f8f6); }
.face-map { display: block; width: min(100%,270px); height: auto; overflow: visible; }
.mannequin-head,.mannequin-shoulders { fill: #fff9f3; stroke: #bdaea1; stroke-width: 1.25; pointer-events: none; }
.mannequin-shoulders { fill: #f5e9df; }
.face-region { fill: #e7f0ed; fill-opacity: .72; stroke: #a4aaa0; stroke-width: .85; cursor: pointer; transition: fill .15s,fill-opacity .15s,stroke .15s; }
.region-forehead { fill: #f2d9c8; }
.region-eyes,.region-glabella { fill: #dce5f1; }
.region-nose { fill: #edd9d4; }
.region-cheek { fill: #f1d0ca; }
.region-mouth { fill: #e9bbc0; }
.region-chin { fill: #dfebdc; }
.region-jaw { fill: #e9e2cb; }
.region-atm { fill: #ddd9ed; }
.region-neck { fill: #d9e8e4; }
.region-ear { fill: #edd6c9; }
.face-region:hover,.face-region:focus { fill: #9dcfc0; fill-opacity: .75; stroke: #347e6e; stroke-width: 1.5; outline: none; }
.face-region.pending { fill: #f0bf7a; fill-opacity: .9; stroke: #bc873d; }
.face-region.completed { fill: #8bc6b4; fill-opacity: .9; stroke: #4a927e; }
.face-region.pending.completed { fill: #c1ceb0; }
.face-features { pointer-events: none; }
.face-features path { fill: none; stroke: #8c786b; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.face-features .mannequin-outline { stroke: #bdaea1; stroke-width: 1.25; }
.face-map-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; color: #788984; font-size: 8px; }
.face-map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.face-map-legend .legend-mark { display: inline-block; }
.face-clinic-details { min-width: 0; }
.face-category-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.face-category-chip { border: 1px solid #e3ebe8; border-radius: 14px; padding: 5px 8px; color: #657a75; background: #f8fbfa; font-size: 8px; }
.face-record-list { border: 1px solid #e8efed; border-radius: 9px; padding: 0 10px; }
.face-record-list .timeline-item:first-child { border-top: 0; }
.tooth-history-modal { width: min(660px,100%); }
.tooth-history-records { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; }
.tooth-history-card { padding: 10px 12px; border: 1px solid #e8efed; border-radius: 8px; background: #fcfdfd; }
.tooth-history-card-head,.prosthesis-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tooth-history-card-head strong { color: #435f58; font-size: 10px; }
.tooth-history-card p,.tooth-history-card small { display: block; margin: 5px 0 0; color: #82928d; font-size: 8px; line-height: 1.5; }
.tooth-history-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 8px; }
.clinic-admin-grid { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.3fr); gap: 14px; align-items: start; }
.clinic-admin-grid > .panel { min-width: 0; }
.clinic-choice { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid transparent; border-bottom-color: #edf1ef; background: #fff; color: #526a64; text-align: left; }
.clinic-choice.active,.clinic-choice:hover { border-color: #b8d5cc; border-radius: 8px; background: #f3f8f6; }
.clinic-choice > span:nth-child(2) { flex: 1; display: grid; gap: 3px; }
.clinic-choice strong,.staff-row strong { color: #49645d; font-size: 9px; }
.clinic-choice small,.staff-row small { display: block; color: #91a09c; font-size: 8px; }
.clinic-choice-avatar { width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: #e5f1ed; color: var(--green); font-size: 9px; font-weight: 700; }
.clinic-choice-avatar img,.clinic-avatar img { width: 100%; height: 100%; object-fit: contain; }
.clinic-form-grid { gap: 9px 12px; }
.clinic-logo-upload { display: grid; gap: 7px; color: #71837e; font-size: 9px; }
.clinic-logo-upload img { max-width: 130px; max-height: 70px; object-fit: contain; }
.staff-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 9px; padding: 10px 0; border-top: 1px solid #edf1ef; }
.staff-row > span { display: grid; gap: 4px; }
.clinic-admin-grid + .alert-banner { margin-top: 14px; }
.prosthesis-card { margin: 9px 0; padding: 12px; border: 1px solid #e6eeeb; border-radius: 9px; background: #fff; }
.prosthesis-card-head strong { color: #49645d; font-size: 10px; }
.prosthesis-meta { display: flex; flex-wrap: wrap; gap: 6px 13px; margin: 9px 0; color: #84938f; font-size: 8px; }
.prosthesis-card p { color: #71837e; font-size: 9px; line-height: 1.5; }
.image-purpose-options { display: grid; gap: 4px; padding: 8px 11px; border: 1px solid #e7efec; border-radius: 8px; }
.image-purpose-options .consent-check { margin: 7px 0; }
.tooth-history-modal .view-only-notice { margin-top: 10px; }
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; width: 250px; transform: translateX(-101%); transition: transform .2s; box-shadow: 10px 0 25px #1833301a; }
  .sidebar.open { transform: translateX(0); }
  .topbar { height: 62px; padding: 0 15px; gap: 12px; }
  .mobile-menu { display: block; border: 0; background: transparent; color: #54706b; font-size: 18px; }
  .breadcrumbs { margin-right: auto; }
  .topbar-actions { gap: 8px; }
  .search-box { width: 34px; border: 0; padding: 0 5px; }
  .search-box input { display: none; }
  .search-box span { font-size: 23px; }
  .help-link,.topbar-divider { display: none; }
  .page-content { padding: 22px 15px 35px; }
  h1 { font-size: 21px; }
  .page-heading { align-items: flex-start; }
  .heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .dashboard-grid,.two-column { grid-template-columns: 1fr; }
  .metric-grid { gap: 9px; }
  .metric-card { padding: 13px; min-height: 103px; }
  .metric-card strong { font-size: 20px; }
}
@media (max-width: 480px) {
  .breadcrumbs { font-size: 10px; gap: 6px; }
  .page-heading { display: grid; }
  .heading-actions { justify-content: flex-start; }
  .metric-top { font-size: 9px; }
  .metric-icon { width: 25px; height: 25px; }
  .panel { padding: 14px; }
  .appointment-row { grid-template-columns: 46px 3px minmax(0,1fr); gap: 8px; }
  .appointment-row .status { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .calendar-toolbar { flex-wrap: wrap; }
  .anatomical-row { display: grid; grid-template-columns: 1fr; }
  .anatomical-quadrant { grid-template-columns: repeat(8,minmax(0,1fr)); }
  .quadrant-label { display: block; grid-column: 1 / -1; padding: 2px 4px; color: #93a09c; font-size: 7px; text-transform: uppercase; }
  .anatomical-tooth-card { height: 68px; }
  .anatomical-tooth { width: min(100%,42px); height: 56px; }
  .tooth-not-erupted { height: 68px; }
}

[hidden] { display: none !important; }
.event-open { border: 0; background: transparent; padding: 0; text-align: left; min-width: 0; flex: 1; }
.event-open strong { display: block; color: #506562; font-size: 10px; }
.event-open small { display: block; color: #899a97; font-size: 9px; margin-top: 4px; }
.event-actions { display: flex; align-items: center; gap: 7px; }
.status-select { max-width: 124px; border: 1px solid #e3ebe8; border-radius: 6px; background: #fff; padding: 5px 6px; color: #5c716e; font-size: 9px; }
.week-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; }
.week-day { display: grid; gap: 6px; text-align: center; border: 1px solid #e8efed; border-radius: 8px; background: #fff; padding: 11px 5px; color: #5d7470; }
.week-day small { font-size: 9px; color: #93a19f; text-transform: capitalize; }
.week-day strong { font: 700 16px Manrope,sans-serif; }
.week-day span { font-size: 8px; }
.procedure-markers { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 5px; }
.procedure-markers b { width: 10px; height: 4px; border-radius: 3px; background: var(--procedure-color); }
.procedure-markers small { color: #71817e; font-size: 7px; }
.week-day.active { border-color: #157b70; box-shadow: inset 0 0 0 1px #157b70; color: #155e54; }
.week-day.occupancy-empty { background: #fff; }
.week-day.occupancy-light { background: #eff8f5; }
.week-day.occupancy-medium { background: #e2f1e9; }
.week-day.occupancy-high { background: #f9e9e2; }
.calendar-overview { margin-bottom: 15px; }
.month-weekdays,.month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.month-weekdays span { padding: 0 0 8px; text-align: center; color: #98a6a4; font-size: 9px; }
.month-day { position: relative; min-height: 48px; border: 1px solid #edf1ef; background: #fff; color: #607573; text-align: left; padding: 6px; font-size: 10px; }
.month-day .procedure-markers { position: absolute; left: 5px; bottom: 6px; justify-content: flex-start; max-width: 62%; }
.month-day .procedure-markers b { width: 7px; height: 4px; }
.month-day:hover { border-color: #9cc9be; }
.month-day.active { border-color: #157b70; box-shadow: inset 0 0 0 1px #157b70; color: #155e54; }
.month-day.occupancy-empty { background: #fff; }
.month-day.occupancy-light { background: #eff8f5; }
.month-day.occupancy-medium { background: #e2f1e9; }
.month-day.occupancy-high { background: #f9e9e2; }
.month-day.outside { color: #c1ccca; }
.month-day i { position: absolute; right: 6px; bottom: 5px; border-radius: 10px; background: #d7eee8; color: #267c6d; font-size: 8px; font-style: normal; padding: 2px 5px; }
.calendar-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; margin-top: 12px; color: #758681; font-size: 8px; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 4px; }
.calendar-legend-title { color: #516863; font-weight: 700; }
.calendar-legend i { width: 9px; height: 9px; border: 1px solid #dfe9e5; border-radius: 3px; background: #fff; }
.calendar-legend i.occupancy-light { background: #eff8f5; }
.calendar-legend i.occupancy-medium { background: #e2f1e9; }
.calendar-legend i.occupancy-high { background: #f9e9e2; }
.calendar-legend i.procedure-legend-dot { border: 0; border-radius: 50%; background: var(--procedure-color); }
.day-calendar-scroll { overflow: auto; max-height: 68vh; border: 1px solid #edf1ef; border-radius: 8px; }
.day-calendar-grid { display: grid; min-width: max-content; position: relative; }
.day-calendar-heading { position: sticky; top: 0; z-index: 4; display: grid; place-items: center; padding: 5px; overflow: hidden; background: #f7faf9; border-bottom: 1px solid #e8efed; border-right: 1px solid #edf1ef; color: #627772; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.day-calendar-time { position: sticky; left: 0; z-index: 2; display: flex; justify-content: center; padding-top: 2px; background: #fff; border-right: 1px solid #edf1ef; color: #91a09c; font-size: 8px; }
.day-calendar-slot { z-index: 0; width: 100%; height: 100%; border: 0; border-top: 1px solid #eef2f0; border-right: 1px solid #f1f4f3; background: transparent; padding: 0; }
.day-calendar-slot:not(:disabled):hover { background: #eaf5f2; }
.day-calendar-slot:disabled { cursor: default; }
.day-calendar-event { z-index: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; overflow: hidden; margin: 2px; border-left: 3px solid var(--procedure-color); border-radius: 4px; background: color-mix(in srgb, var(--procedure-color) 13%, white); padding: 3px 4px; }
.day-calendar-event .event-open { width: 100%; overflow: hidden; }
.day-calendar-event .event-open strong { overflow: hidden; color: #435b56; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.day-calendar-event .event-open small { overflow: hidden; margin-top: 2px; color: #687c77; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.day-calendar-event .status-select { width: 100%; max-width: 100%; border: 0; background: transparent; padding: 1px 0; font-size: 7px; }
.catalog-color-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--procedure-color); vertical-align: 1px; }
.face-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin: 10px 0; }
.face-area { min-height: 48px; border: 1px solid #e2ece9; border-radius: 8px; background: #f9fbfa; color: #5f7772; font-size: 10px; font-weight: 700; }
.face-area small { display: block; margin-top: 4px; color: #8d9d99; font-size: 8px; font-weight: 400; }
.face-area:hover,.face-area.has-record { border-color: #8dbfaf; background: #edf7f4; color: var(--green); }
.question-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 18px; }
.question-summary span { color: #637774; font-size: 9px; border-bottom: 1px solid #eef2f0; padding: 6px 0; }
.question-summary b { color: #20816e; margin-right: 5px; }
.upload-box { display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px dashed #b6d2cb; background: #f8fbfa; border-radius: 9px; padding: 15px; }
.upload-box label { cursor: pointer; }
.upload-box label strong,.upload-box label small { display: block; }
.upload-box label strong { color: #47716a; font-size: 11px; }
.upload-box label small { color: #91a09c; font-size: 9px; margin-top: 4px; }
.upload-box input { max-width: 190px; color: #6a7f7b; font-size: 9px; }
.attachment-list { margin-top: 12px; }
.anamnesis-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.anamnesis-question { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid #edf1ef; padding: 9px 0; }
.question-label { color: #526a66; font-size: 9px; }
.yes-no-options { display: flex; gap: 6px; }
.yes-no-option { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border: 1px solid #e2eae7; border-radius: 20px; padding: 5px 9px; color: #738580; font-size: 9px; }
.yes-no-option input { position: absolute; opacity: 0; pointer-events: none; }
.radio-dot { width: 10px; height: 10px; border: 1px solid #afbfbb; border-radius: 50%; }
.yes-no-option.checked { border-color: #9cc9be; background: #edf7f4; color: #287c6c; }
.yes-no-option.checked .radio-dot { border: 3px solid #398e7b; background: #fff; }
.question-detail { grid-column: 1/-1; }
.question-detail label { display: block; color: #637774; font-size: 9px; margin-bottom: 4px; }
.question-detail input { width: 100%; border: 1px solid #e2eae7; border-radius: 6px; padding: 7px 8px; color: #5d716e; background: #fff; font-size: 10px; }
.privacy-copy { color: #7d8f8b; font-size: 10px; line-height: 1.65; }
.consent-check { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0; color: #536966; font-size: 10px; line-height: 1.55; }
.consent-check input { flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--green); }
.consent-check b { color: #a55f4f; font-weight: 600; }
.public-form-mode { background: #f5f8f7; }
.public-form-mode .app-shell { display: none; }
.public-form-shell { position: fixed; z-index: 40; inset: 0; overflow-y: auto; background: #f5f8f7; padding: 0 18px 35px; }
.public-form-header { height: 66px; max-width: 850px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.public-form-header .brand { padding: 0; }
.public-form-content { max-width: 850px; margin: 14px auto; }
.public-form-title { text-align: center; padding: 20px 10px 17px; }
.public-form-title .metric-icon { margin: 0 auto 13px; width: 42px; height: 42px; font-size: 20px; }
.public-form-title h1 { margin-bottom: 8px; }
.public-form-title p { max-width: 600px; margin: 0 auto; color: #869593; font-size: 11px; line-height: 1.6; }
.public-section { margin: 12px 0; padding: 19px; }
.public-section h2 { color: #304746; font: 700 13px Manrope,sans-serif; margin-bottom: 12px; }
.public-section .field textarea { min-height: 64px; }
.public-section .panel-head p { color: #91a09c; font-size: 9px; margin: -5px 0 0; }
.compact-grid { gap: 9px 13px; }
.compact-grid .field { gap: 4px; }
.compact-grid .field input,.compact-grid .field select { padding: 8px 9px; }
.identification-grid,.address-grid { align-items: start; }
.identification-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.address-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.field-span-two { grid-column: span 2; }
.field input[list] { min-width: 0; }
.field-hint { color: #91a09c; font-size: 8px; }
.field-hint.error { color: #b64d42; }
.photo-section { display: grid; grid-template-columns: minmax(0,1fr) 110px; align-items: center; gap: 15px; }
.photo-section .muted { line-height: 1.5; margin: -5px 0 10px; }
.upload-compact { display: inline-flex; border: 1px solid #dfeae6; border-radius: 7px; padding: 8px 10px; color: #47716a; cursor: pointer; font-size: 9px; }
.upload-compact input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.face-photo-preview { width: 104px; height: 104px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #b6d2cb; border-radius: 50%; background: #f8fbfa; color: #91a09c; font-size: 9px; }
.face-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.face-crop-editor { grid-column: 1/-1; display: grid; grid-template-columns: 150px minmax(0,1fr); align-items: center; gap: 8px 14px; padding-top: 12px; border-top: 1px solid #edf1ef; }
.face-crop-editor canvas { grid-row: span 3; width: 150px; height: 150px; border-radius: 8px; background: #edf2f0; object-fit: contain; cursor: grab; touch-action: none; }
.face-crop-editor canvas:active { cursor: grabbing; }
.face-crop-editor label { color: #637774; font-size: 9px; }
.face-crop-editor input[type="range"] { width: 100%; accent-color: var(--green); }
.face-crop-editor .button { justify-self: start; }
.phone-row { display: grid; grid-template-columns: 130px minmax(0,1fr) 30px; align-items: center; gap: 9px; margin: 8px 0; }
.phone-row label { color: #637774; font-size: 9px; }
.phone-row input { min-width: 0; border: 1px solid #e3ebe8; border-radius: 7px; padding: 8px 9px; color: #526764; font-size: 10px; }
.icon-button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: #f2f6f4; color: #8c9a97; font-size: 16px; }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.public-section .panel-head { gap: 12px; }
.public-submit { display: flex; justify-content: center; gap: 9px; padding: 8px 0 13px; }
@media (max-width: 600px) {
  .week-grid { gap: 4px; }
  .week-day { padding: 8px 2px; }
  .week-day span { font-size: 7px; }
  .event-actions { align-items: flex-end; flex-direction: column; }
  .status-select { max-width: 105px; }
  .face-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .anamnesis-grid,.question-summary { grid-template-columns: 1fr; }
  .upload-box { align-items: flex-start; flex-direction: column; }
  .public-section { padding: 14px; }
  .photo-section { grid-template-columns: minmax(0,1fr) 78px; gap: 10px; }
  .face-photo-preview { width: 76px; height: 76px; }
  .phone-row { grid-template-columns: minmax(0,1fr) 30px; gap: 5px; }
  .phone-row label { grid-column: 1/-1; }
  .face-crop-editor { grid-template-columns: 105px minmax(0,1fr); gap: 7px 10px; }
  .face-crop-editor canvas { width: 105px; height: 105px; }
  .anamnesis-question { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 760px) {
  .identification-grid,.address-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 480px) {
  .identification-grid,.address-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .patient-profile-head { align-items: flex-start; gap: 10px; padding: 14px; }
  .patient-profile-head > div { min-width: 0; flex: 1; }
  .patient-profile-head > .status { flex: 0 0 auto; font-size: 8px; }
}
@media (max-width: 760px) {
  .clinical-service-panels { grid-template-columns: minmax(0,1fr); }
  .assessment-workspace { grid-template-columns: minmax(0,1fr); }
  .assessment-history-list { max-height: 250px; }
  .clinic-admin-grid { grid-template-columns: minmax(0,1fr); }
  .ortho-visual-grid { grid-template-columns: minmax(0,1fr); }
  .face-clinic-layout { grid-template-columns: minmax(0,1fr); }
  .face-map { width: min(100%,220px); }
  .quote-builder-item { grid-template-columns: auto minmax(0,1fr); }
  .quote-item-description { grid-column: 2; }
  .quote-builder-item > .field { grid-column: 1/-1; }
  .quote-discount-field { max-width: none; }
  .quote-builder-totals { justify-content: flex-start; }
  .planned-service-actions { justify-content: flex-start; }
  .clinical-service-panel .panel-head { align-items: flex-start; flex-direction: column; }
  .pending-service-value { justify-self: end; }
  .pending-service-price { justify-self: end; }
  .pending-service-price input { width: 104px; }
  .service-panel-actions { justify-content: flex-start; }
  .catalog-tooth-picker { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .history-actions { align-items: flex-end; flex-direction: column; }
}
.modal:has(.tooth-selector) { width: min(650px,100%); }
.modal:has(.quote-builder-list) { width: min(960px,100%); }
.modal:has(.catalog-settings-list) { width: min(820px,100%); }
