/* DentalPro Senior Edition — final UX layer
   Keeps the legacy component library stable while defining one coherent,
   accessible visual system for the production candidate. */
:root {
    --primary: #0f766e;
    --primary-dark: #0b5f59;
    --primary-soft: #e8f5f2;
    --success: #15803d;
    --success-soft: #eaf7ee;
    --warning: #d97706;
    --warning-soft: #fff6df;
    --danger: #c2413b;
    --danger-soft: #fff0ef;
    --bg: #f3f7f6;
    --surface-soft: #f7faf9;
    --line: #dce8e4;
    --text: #18312e;
    --muted: #667a76;
    --shadow: 0 12px 34px rgba(18, 66, 59, .08);
    --focus-ring: 0 0 0 3px rgba(15, 118, 110, .20);
}

html { color-scheme: light; }
body { background: linear-gradient(180deg, #f8fbfa 0, var(--bg) 240px); }
:focus-visible { outline: 0; box-shadow: var(--focus-ring) !important; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

/* Navigation */
.sidebar {
    background:
        radial-gradient(circle at 20% 0, rgba(41, 157, 142, .22), transparent 28%),
        linear-gradient(180deg, #102e2b, #0b2522 62%, #081d1b);
    border-right: 1px solid rgba(255,255,255,.06);
}
.brand-mark { background: linear-gradient(145deg, #29a38f, #0f766e); box-shadow: 0 10px 24px rgba(7, 55, 49, .42); }
.nav-item.active { background: linear-gradient(90deg, rgba(24, 137, 122, .96), rgba(15, 118, 110, .72)); }
.sidebar-toggle { border-color: rgba(255,255,255,.12); }

/* Topbar */
.topbar {
    min-height: 84px;
    padding-top: 14px;
    padding-bottom: 14px;
    border-bottom-color: rgba(207, 224, 219, .9);
    box-shadow: 0 6px 22px rgba(20, 63, 57, .035);
}
.topbar-title-block h1 { color: #173c37; }
.topbar-subtitle { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.topbar-status-cards { max-width: 610px; }
.topbar-status-card {
    appearance: none;
    cursor: pointer;
    text-align: left;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, opacity .16s ease;
}
.topbar-status-card:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(32, 74, 67, .10); }
.topbar-status-card[aria-pressed="true"] { border-color: var(--primary); box-shadow: var(--focus-ring); }
.topbar-status-exam { border-color: #bce0d7; background: linear-gradient(135deg,#fff,#eefaf6); }
.topbar-status-exam > span { color: #0f766e; background: #dff4ed; }


/* Sidebar starts directly with Dashboard; the expansion control remains available. */
.sidebar-toggle-row {
    min-height: 34px;
    margin: 0 0 8px;
    padding: 0 2px;
}
.nav-menu-primary { margin-top: 0; }

/* The current day uses a light surface, so force accessible dark text instead of
   inheriting the legacy white-on-blue calendar rule. */
.calendar-day-header.is-today {
    --calendar-today-text: #123f39;
    --calendar-today-muted: #416c65;
    color: var(--calendar-today-text) !important;
}
.calendar-day-header.is-today strong {
    color: var(--calendar-today-text) !important;
    font-weight: 850;
}
.calendar-day-header.is-today span,
.calendar-day-header.is-today small {
    color: var(--calendar-today-muted) !important;
}

/* Calendar shell */
.weekly-calendar-card { border-radius: 16px; border-color: #d6e5e0; box-shadow: 0 14px 38px rgba(24, 71, 64, .08); }
.calendar-toolbar-five-days { min-height: 54px; padding: 8px 12px; background: linear-gradient(180deg,#fff,#f8fbfa); }
.calendar-date-navigation { gap: 8px; }
.calendar-current-date { min-width: 188px; padding: 6px 14px; border-color: #cfe0dc; background: #fff; }
.calendar-current-date strong { color: #174e46; font-size: 13px; }
.calendar-nav-arrow { width: 34px; height: 34px; border-color: #cfdfdb; color: #245c54; }
.calendar-legend { min-height: 31px; padding: 6px 12px; gap: 13px; border-top: 1px solid #edf3f1; border-bottom: 1px solid #dce8e4; background: #fbfdfc; }
.calendar-legend span { font-size: 9px; }

.weekly-calendar-scroll {
    max-height: calc(100vh - 205px);
    background: #f7faf9;
    scrollbar-color: #a9c8c0 #edf4f2;
    scrollbar-width: thin;
}
.weekly-calendar.calendar-view-five-days {
    min-width: calc(62px + (5 * 174px));
    grid-template-columns: 62px repeat(5, minmax(174px, 1fr));
}
.calendar-corner,
.calendar-day-header {
    position: sticky;
    top: 0;
    z-index: 18;
    min-height: 48px;
    background: rgba(249,252,251,.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #cfded9;
}
.calendar-corner { left: 0; z-index: 20; }
.calendar-day-header { padding: 7px 6px; }
.calendar-day-header strong { color: #315b55; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.calendar-day-header span { margin-top: 1px; color: #71847f; font-size: 9px; }
.calendar-day-header.is-today { background: linear-gradient(180deg,#eaf8f4,#f7fcfa); box-shadow: inset 0 3px 0 #15927e; }
.calendar-time-label {
    position: sticky;
    left: 0;
    z-index: 14;
    min-height: 46px;
    padding: 6px 7px;
    color: #667b76;
    background: #f7faf9;
    border-right: 1px solid #d5e3df;
    font-size: 9px;
}
.calendar-slot {
    min-height: 46px !important;
    padding: 3px !important;
    border-color: #e3ece9 !important;
    background: rgba(255,255,255,.78);
}
.calendar-slot.is-today { background: #fbfefc; }
.calendar-slot.is-current-slot { background: linear-gradient(90deg, rgba(31, 169, 143, .08), rgba(31, 169, 143, .02)); }
.calendar-slot.is-current-slot::before {
    content: "";
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: #ef4444;
    box-shadow: 0 0 0 1px rgba(239,68,68,.1);
}
.calendar-slot.is-current-slot::after {
    content: "";
    position: absolute;
    z-index: 7;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}
.slot-add-button { width: 20px; height: 20px; inset: 2px 2px auto auto; opacity: 0; color: var(--primary); background: #e7f6f2; }
.calendar-slot:hover .slot-add-button,
.calendar-slot:focus-within .slot-add-button { opacity: 1; }

.calendar-appointment {
    min-height: 0;
    margin: 0 0 2px;
    padding: 4px 5px 4px 7px !important;
    border-radius: 7px;
    border-left-width: 3px;
    box-shadow: 0 2px 7px rgba(31, 73, 66, .07);
    transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
.calendar-appointment:hover,
.calendar-appointment:focus-visible { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(31, 73, 66, .12); }
.appointment-card-top { gap: 4px; }
.appointment-card-top > strong { color: #254f49; font-size: 9px; }
.calendar-appointment h3 { margin: 1px 0 0; color: #1c3f3a; font-size: 10px !important; line-height: 1.15; }
.calendar-appointment p,
.calendar-appointment > small { display: none !important; }
.calendar-appointment .badge { min-height: 14px; padding: 1px 4px; font-size: 6.5px !important; }
.calendar-appointment .appointment-status-actions,
.calendar-appointment .appointment-final-actions { margin-top: 3px; gap: 2px; }
.calendar-appointment .status-mini-button,
.calendar-appointment .status-final-button {
    width: 21px;
    min-width: 21px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    border-radius: 5px;
}
.calendar-appointment .status-mini-button span,
.calendar-appointment .status-final-button span { display: none; }
.calendar-appointment .status-mini-button .ui-icon,
.calendar-appointment .status-final-button .ui-icon { width: 11px; height: 11px; }
.calendar-appointment.appointment-status-cancelled { opacity: .60; }
.calendar-appointment.appointment-status-completed { opacity: .86; }
.calendar-appointment.calendar-filter-dim { opacity: .14; filter: grayscale(.5); pointer-events: none; }

/* Dialogs and clinical visit command center */
.modal-dialog::backdrop { background: rgba(8, 29, 26, .62); backdrop-filter: blur(4px); }
.visit-command-modal-maximized { background: #f3f7f6; }
.visit-command-header-compact {
    min-height: 62px;
    padding: 9px 14px !important;
    background: linear-gradient(180deg,#fff,#f8fbfa);
    border-bottom-color: #d7e5e1;
}
.visit-header-summary { gap: 8px 12px; }
.visit-header-fact small { color: #748782; font-size: 7px; letter-spacing: .09em; }
.visit-header-fact strong { color: #1d4741; font-size: 11px; }
.visit-header-fact span { color: #72847f; font-size: 8px; }
.visit-header-separator { background: #d4e2de; }
.visit-patient-link {
    min-height: 30px;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #cfe0dc;
    border-radius: 8px;
    color: #175f55;
    background: #fff;
    font-size: 9px;
    font-weight: 800;
}
.visit-patient-link .ui-icon { width: 13px; height: 13px; }
.service-live-status { color: #0f766e; background: #e4f5f0; border-color: #c5e7de; }
.visit-command-body { padding: 10px 14px 16px !important; }
.visit-module-card { border-color: #d7e5e1; box-shadow: 0 6px 20px rgba(25, 75, 67, .045); }
.visit-command-modal .multi-tooth-picker { grid-template-columns: repeat(16, minmax(30px,1fr)); }
.visit-command-modal .multi-tooth-picker button { min-height: 32px; border-color: #d7e4e0; }
.visit-command-modal .multi-tooth-picker button.selected { border-color: #0f766e; background: linear-gradient(145deg,#1b9684,#0f766e); box-shadow: 0 6px 14px rgba(15,118,110,.20); }
.visit-entry-toolbar-command { border-color: #d7e5e1; background: linear-gradient(135deg,#fff,#f2f8f6); }
.visit-record-main { border-color: #d7e5e1; }
.visit-service-table-wrap { border-color: #d6e4e0; }
.visit-service-table th { color: #5c746e; background: #f0f6f4; }
.visit-service-table tbody tr:hover { background: #f5faf8; }
.visit-service-total { color: #0f766e !important; }

.visit-financial-summary {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(4,minmax(120px,1fr));
    gap: 6px;
}
.visit-financial-summary > div {
    min-height: 46px;
    padding: 7px 10px;
    border: 1px solid #d9e6e2;
    border-radius: 9px;
    background: #f8fbfa;
}
.visit-financial-summary small,
.visit-financial-summary strong { display: block; }
.visit-financial-summary small { color: #738680; font-size: 7.5px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.visit-financial-summary strong { margin-top: 2px; color: #355d56; font-size: 12px; }
.visit-financial-summary .visit-financial-grand { border-color: #a8d3c8; background: #eaf7f3; }
.visit-financial-summary .visit-financial-grand strong { color: #0c665b; font-size: 15px; }
.invoice-state a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.visit-command-footer-actions { border-top-color: #d4e3df; background: rgba(255,255,255,.96); }
.visit-command-footer-actions .btn-success { background: linear-gradient(135deg,#16836d,#0f6f62); box-shadow: 0 7px 16px rgba(15,111,98,.18); }

/* Forms and tables */
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: #65aa9d; box-shadow: var(--focus-ring); }
.data-table th { color: #60736f; background: #f7faf9; }
.data-table tbody tr:hover { background: #f5faf8; }
.btn-primary { background: linear-gradient(135deg,#148879,#0f766e); box-shadow: 0 7px 17px rgba(15,118,110,.17); }
.btn-primary:hover { background: linear-gradient(135deg,#117c6f,#0b625a); }
.btn-success { background: #15803d; }
.badge-primary { color: #0c665b; background: #daf2eb; }

/* Motion and responsiveness */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (max-width: 1180px) {
    .weekly-calendar.calendar-view-five-days { min-width: calc(58px + (5 * 160px)); grid-template-columns: 58px repeat(5,minmax(160px,1fr)); }
    .topbar-status-cards { max-width: none; }
    .visit-financial-summary { grid-template-columns: repeat(2,minmax(120px,1fr)); }
}
@media (max-width: 760px) {
    .weekly-calendar.calendar-view-five-days { min-width: calc(54px + (5 * 148px)); grid-template-columns: 54px repeat(5,minmax(148px,1fr)); }
    .calendar-time-label { min-height: 43px; }
    .calendar-slot { min-height: 43px !important; }
    .topbar-status-card { min-width: 0; }
    .topbar-status-card small { font-size: 9px; }
    .topbar-status-card strong { font-size: 18px; }
    .visit-patient-link span { display: none; }
    .visit-financial-summary { grid-template-columns: 1fr 1fr; }
}
.btn-danger { color: #fff; background: linear-gradient(135deg,#d14a43,#b93833); border-color: transparent; box-shadow: 0 7px 16px rgba(185,56,51,.16); }
.btn-danger:hover { background: linear-gradient(135deg,#c8403a,#a92f2b); }

/* --------------------------------------------------------------------------
   Patient cards + modal workflow (Senior Edition 3.1)
   -------------------------------------------------------------------------- */
.patient-registry-shell { overflow: hidden; }
.patient-registry-toolbar { align-items: center; }
.patient-registry-grid {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
}
.patient-registry-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    color: inherit;
    text-decoration: none;
    border: 1px solid #d8e6e2;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff, #f8fbfa);
    box-shadow: 0 8px 24px rgba(21, 71, 63, .055);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.patient-registry-card:hover {
    transform: translateY(-2px);
    border-color: #9dcfc4;
    box-shadow: 0 16px 34px rgba(21, 71, 63, .10);
}
.patient-registry-card-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.patient-registry-photo,
.patient-registry-avatar { width: 50px; height: 50px; border-radius: 15px; object-fit: cover; }
.patient-registry-avatar { display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.patient-registry-name strong,
.patient-registry-name span { display: block; }
.patient-registry-name strong { color: #123f38; font-size: 14px; }
.patient-registry-name span { margin-top: 2px; color: #78908a; font-size: 10px; font-weight: 700; }
.patient-registry-open { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: #0f766e; background: #e7f4f1; }
.patient-registry-open .ui-icon { width: 15px; height: 15px; }
.patient-registry-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.patient-registry-meta > div { min-width: 0; padding: 9px; border: 1px solid #e2ece9; border-radius: 11px; background: #fff; }
.patient-registry-meta span { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: #0f766e; }
.patient-registry-meta .ui-icon { width: 13px; height: 13px; }
.patient-registry-meta small,
.patient-registry-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patient-registry-meta small { margin-top: 3px; color: #859892; font-size: 8px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }
.patient-registry-meta strong { margin-top: 2px; color: #345d56; font-size: 10px; }
.patient-registry-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 11px; border-top: 1px solid #e5eeeb; }
.patient-registry-foot span { min-width: 0; }
.patient-registry-foot small,
.patient-registry-foot strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patient-registry-foot small { color: #8a9b96; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.patient-registry-foot strong { margin-top: 3px; color: #526d67; font-size: 10px; }

.patient-card-form { display: grid; gap: 16px; }
.patient-form-intro,
.patient-form-review {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.patient-form-intro h2 { margin: 2px 0 4px; color: #143f38; }
.patient-form-intro p,
.patient-form-review span { margin: 0; color: #718781; font-size: 11px; }
.patient-form-intro-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.patient-form-review > div { display: grid; gap: 3px; }
.patient-form-review strong { color: #244d46; }

.patient-function-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.patient-form-function-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.patient-function-card {
    position: relative;
    text-decoration: none;
    min-height: 158px;
    padding: 17px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    text-align: left;
    color: #173f39;
    border: 1px solid #d9e7e3;
    border-radius: 19px;
    background: linear-gradient(145deg, #fff, #f8fbfa);
    box-shadow: 0 9px 27px rgba(18, 68, 59, .06);
    cursor: pointer;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.patient-function-card::after {
    content: '';
    position: absolute;
    inset: auto -22px -38px auto;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: var(--patient-card-accent-soft, #e9f5f2);
    opacity: .75;
}
.patient-function-card:hover { transform: translateY(-3px); border-color: var(--patient-card-accent, #69ad9f); box-shadow: 0 17px 36px rgba(18, 68, 59, .11); }
.patient-function-card:focus-visible { outline: 3px solid rgba(15,118,110,.18); outline-offset: 2px; }
.patient-function-primary { --patient-card-accent: #1677d2; --patient-card-accent-soft: #e5f1fd; }
.patient-function-cyan { --patient-card-accent: #0891b2; --patient-card-accent-soft: #e3f7fb; }
.patient-function-warning { --patient-card-accent: #d68a12; --patient-card-accent-soft: #fff3db; }
.patient-function-danger { --patient-card-accent: #cf4f48; --patient-card-accent-soft: #fde9e7; }
.patient-function-indigo { --patient-card-accent: #6657c8; --patient-card-accent-soft: #eeeafd; }
.patient-function-green { --patient-card-accent: #17865f; --patient-card-accent-soft: #e4f5ee; }
.patient-function-clinical { --patient-card-accent: #0f766e; --patient-card-accent-soft: #dff2ee; }
.patient-function-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--patient-card-accent, #0f766e);
    border-radius: 13px;
    background: var(--patient-card-accent-soft, #e7f4f1);
}
.patient-function-icon .ui-icon { width: 21px; height: 21px; }
.patient-function-copy { display: grid; align-content: start; gap: 3px; z-index: 1; }
.patient-function-copy small { color: var(--patient-card-accent, #0f766e); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.patient-function-copy strong { color: #173f39; font-size: 14px; line-height: 1.25; }
.patient-function-copy em { color: #758a84; font-size: 9px; font-style: normal; line-height: 1.45; }
.patient-function-state,
.patient-function-metric {
    position: relative;
    z-index: 1;
    width: max-content;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid color-mix(in srgb, var(--patient-card-accent, #0f766e) 25%, #fff);
    border-radius: 999px;
    color: var(--patient-card-accent, #0f766e);
    background: #fff;
    font-size: 8px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.patient-function-metric .ui-icon { width: 13px; height: 13px; }

.patient-card-hub-hero { margin-bottom: 16px; }
.patient-hero-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.patient-hero-chips span { padding: 5px 8px; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; color: #476963; background: rgba(255,255,255,.72); font-size: 9px; font-weight: 800; }
.patient-hero-chips .ui-icon { width: 12px; height: 12px; }
.patient-hero-chips .patient-hero-warning { color: #a4493f; background: #fff0ee; }

.patient-data-modal { width: min(880px, calc(100vw - 30px)); }
.patient-data-modal-wide { width: min(1040px, calc(100vw - 30px)); }
.patient-list-modal { width: min(1050px, calc(100vw - 30px)); }
.patient-xray-modal { width: min(1240px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.patient-clinical-modal { width: min(860px, calc(100vw - 30px)); }
.patient-modal-header { background: linear-gradient(135deg, #fbfefd, #edf7f4); }
.patient-modal-header-warning { background: linear-gradient(135deg, #fffdf8, #fff4dc); }
.patient-modal-grid { gap: 13px; }
.patient-modal-grid .field { margin: 0; }
.patient-photo-modal-body { display: grid; grid-template-columns: 210px 1fr; gap: 22px; align-items: center; }
.patient-photo-modal-body .patient-photo-preview { width: 190px; height: 190px; border-radius: 24px; }
.patient-photo-update-form { display: grid; gap: 12px; }
.patient-photo-update-form .btn { justify-self: start; }
.patient-photo-delete-form { grid-column: 1 / -1; justify-self: end; }
.patient-modal-list { display: grid; gap: 9px; }
.patient-history-card { padding: 13px 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 1px solid #dce8e5; border-radius: 14px; background: #fbfdfc; }
.patient-history-card > div:first-child { min-width: 0; display: grid; gap: 3px; }
.patient-history-card > div:last-child { display: flex; align-items: center; gap: 8px; }
.patient-history-card strong { color: #254f48; font-size: 12px; }
.patient-history-card span { color: #5f7771; font-size: 10px; }
.patient-history-card small { color: #8a9a96; font-size: 9px; }
.patient-modal-upload-panel { margin-bottom: 18px; }
.patient-xray-gallery-modal { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.clinical-modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.clinical-modal-grid > div { padding: 16px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'icon title' 'icon desc'; column-gap: 12px; border: 1px solid #dce9e5; border-radius: 15px; background: #fbfdfc; }
.clinical-modal-grid > div > span { grid-area: icon; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: #0f766e; border-radius: 12px; background: #e6f4f0; }
.clinical-modal-grid > div > span .ui-icon { width: 19px; height: 19px; }
.clinical-modal-grid strong { grid-area: title; color: #254f48; font-size: 12px; }
.clinical-modal-grid small { grid-area: desc; color: #7d918b; font-size: 9px; }
.patient-card-form .field-error { color: #bd3c35; font-size: 9px; font-weight: 800; }
.patient-card-form .is-invalid { border-color: #cf4f48 !important; box-shadow: 0 0 0 3px rgba(207,79,72,.10) !important; }

@media (max-width: 1260px) {
    .patient-form-function-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .patient-profile-function-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .patient-function-grid,
    .patient-form-function-grid,
    .patient-profile-function-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .patient-form-intro,
    .patient-form-review { align-items: flex-start; flex-direction: column; }
    .patient-photo-modal-body { grid-template-columns: 1fr; }
    .patient-photo-modal-body .patient-photo-preview { width: 150px; height: 150px; }
}
@media (max-width: 620px) {
    .patient-registry-grid { padding: 10px; grid-template-columns: 1fr; }
    .patient-registry-meta { grid-template-columns: 1fr 1fr; }
    .patient-registry-meta > div:last-child { grid-column: 1 / -1; }
    .patient-function-grid,
    .patient-form-function-grid,
    .patient-profile-function-grid { grid-template-columns: 1fr; }
    .patient-function-card { min-height: 136px; }
    .patient-form-intro-actions,
    .patient-form-intro-actions .btn,
    .patient-form-review .btn { width: 100%; }
    .patient-modal-grid.cols-2,
    .patient-modal-grid.cols-3,
    .clinical-modal-grid { grid-template-columns: 1fr; }
    .patient-history-card { align-items: flex-start; flex-direction: column; }
    .patient-history-card > div:last-child { width: 100%; justify-content: space-between; }
}

/* DentalPro 3.2 — spreadsheet patient registry and enhanced patient workspace */
.patient-records-shell { overflow: hidden; }
.patient-records-toolbar { min-height: 76px; align-items: center; }
.patient-records-count {
    margin-top: 4px;
    display: inline-flex;
    color: #71857f;
    font-size: 10px;
    font-weight: 800;
}
.patient-records-search { flex: 1; justify-content: flex-end; }
.patient-records-search .search-input { width: min(430px, 100%); }
.patient-records-table-wrap { max-height: calc(100dvh - 210px); overflow: auto; }
.patient-records-table { min-width: 1280px; table-layout: auto; }
.patient-records-table thead { position: sticky; top: 0; z-index: 4; }
.patient-records-table th {
    padding: 10px 11px;
    color: #60736f;
    border-bottom: 1px solid #dbe7e3;
    background: #f5f9f7;
    font-size: 9px;
    letter-spacing: .065em;
}
.patient-records-table td {
    padding: 10px 11px;
    color: #3f5f59;
    border-bottom: 1px solid #e7efec;
    font-size: 10px;
    white-space: nowrap;
}
.patient-records-table tbody tr { transition: background .16s ease, box-shadow .16s ease; }
.patient-records-table tbody tr:nth-child(even) { background: #fbfdfc; }
.patient-records-table tbody tr:hover { background: #eef8f4; box-shadow: inset 3px 0 0 #0f766e; }
.patient-record-index { width: 42px; color: #8a9c97 !important; text-align: center !important; }
.patient-record-person { min-width: 220px; display: flex; align-items: center; gap: 10px; }
.patient-record-photo,
.patient-record-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; object-fit: cover; }
.patient-record-avatar { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.patient-record-name { min-width: 0; display: grid; gap: 2px; }
.patient-record-name strong { max-width: 210px; overflow: hidden; color: #173f39; font-size: 11px; text-overflow: ellipsis; }
.patient-record-name small { max-width: 210px; overflow: hidden; color: #84958f; font-size: 8px; text-overflow: ellipsis; }
.patient-record-code {
    padding: 4px 7px;
    display: inline-flex;
    color: #0f6c62;
    border: 1px solid #cfe5df;
    border-radius: 7px;
    background: #edf8f4;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .02em;
}
.patient-record-embg { color: #4e6661; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: .02em; }
.patient-record-phone { color: #176f66; font-weight: 800; text-decoration: none; }
.patient-record-phone:hover { text-decoration: underline; }
.patient-record-date { display: grid; gap: 1px; }
.patient-record-date strong { color: #405f59; font-size: 9px; }
.patient-record-date small { color: #8a9a96; font-size: 8px; }
.patient-record-date-next strong { color: #0f766e; }
.patient-record-action-head { text-align: right !important; }
.patient-record-action-cell { text-align: right; }
.patient-record-open { min-width: 112px; justify-content: center; padding: 7px 10px; font-size: 9px; box-shadow: none; }
.patient-record-open .ui-icon { width: 14px; height: 14px; }

.patient-workspace-heading {
    margin: 0 0 12px;
    padding: 0 2px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}
.patient-workspace-heading h2 { margin: 2px 0 3px; color: #173f39; font-size: 18px; }
.patient-workspace-heading p:not(.eyebrow) { margin: 0; color: #71857f; font-size: 10px; }
.patient-workspace-module-count {
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0f766e;
    border: 1px solid #cfe4de;
    border-radius: 999px;
    background: #f3faf7;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}
.patient-workspace-module-count .ui-icon { width: 13px; height: 13px; }
.patient-workspace-grid { gap: 15px; }
.patient-profile-function-grid .patient-workspace-card {
    min-height: 178px;
    padding: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0;
    border: 1px solid #d8e6e2;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 11px 28px rgba(21, 66, 58, .07);
}
.patient-profile-function-grid .patient-workspace-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--patient-card-accent, #0f766e);
}
.patient-profile-function-grid .patient-workspace-card::after {
    inset: auto -30px -48px auto;
    width: 120px;
    height: 120px;
    opacity: .58;
}
.patient-profile-function-grid .patient-workspace-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(21, 66, 58, .13);
}
.patient-workspace-card-top {
    padding: 17px 17px 9px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    z-index: 1;
}
.patient-workspace-card .patient-function-icon { width: 44px; height: 44px; border-radius: 14px; }
.patient-workspace-card .patient-function-copy { padding: 0 17px 14px; }
.patient-workspace-card .patient-function-copy small { font-size: 8px; }
.patient-workspace-card .patient-function-copy strong { font-size: 14px; }
.patient-workspace-card .patient-function-copy em { max-width: 31ch; font-size: 9px; }
.patient-workspace-card .patient-function-metric {
    max-width: 138px;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 8px;
}
.patient-function-action {
    position: relative;
    z-index: 1;
    padding: 10px 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--patient-card-accent, #0f766e);
    border-top: 1px solid #e5eeeb;
    background: rgba(249, 252, 251, .88);
    font-size: 9px;
    font-weight: 900;
}
.patient-function-action .ui-icon { width: 14px; height: 14px; transition: transform .18s ease; }
.patient-workspace-card:hover .patient-function-action .ui-icon { transform: translateX(3px); }

@media (max-width: 900px) {
    .patient-records-toolbar { align-items: stretch; flex-direction: column; }
    .patient-records-search { width: 100%; justify-content: stretch; }
    .patient-records-search .search-input { width: 100%; }
    .patient-records-table-wrap { max-height: none; }
}
@media (max-width: 620px) {
    .patient-workspace-heading { align-items: flex-start; flex-direction: column; }
    .patient-profile-function-grid .patient-workspace-card { min-height: 164px; }
}
.patient-records-pagination {
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #738781;
    border-top: 1px solid #dfeae7;
    background: #fbfdfc;
    font-size: 9px;
    font-weight: 800;
}
.patient-records-pagination nav { display: flex; align-items: center; gap: 7px; }
@media (max-width: 620px) {
    .patient-records-pagination { align-items: stretch; flex-direction: column; }
    .patient-records-pagination nav { justify-content: space-between; }
}

/* DentalPro 3.3 — invoice-based material management */
.material-summary-grid { margin-bottom: 14px; }
.material-toolbar { align-items: center; }
.material-toolbar h2 { margin: 2px 0 4px; color: #173f39; font-size: 17px; }
.material-toolbar p.muted { margin: 0; font-size: 10px; }
.material-toolbar .button-row { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

.material-receipts-card { overflow: hidden; }
.material-receipt-list { display: grid; gap: 9px; }
.material-receipt-record {
    overflow: hidden;
    border: 1px solid #dbe8e4;
    border-radius: 14px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.material-receipt-record[open] { border-color: #b8d8cf; box-shadow: 0 10px 25px rgba(20, 73, 64, .08); }
.material-receipt-record > summary {
    min-height: 66px;
    padding: 10px 13px;
    display: grid;
    grid-template-columns: 38px minmax(230px, 1fr) auto minmax(120px, auto) 22px;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}
.material-receipt-record > summary::-webkit-details-marker { display: none; }
.receipt-document-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #0f766e;
    border-radius: 11px;
    background: #e9f6f2;
}
.receipt-document-icon .ui-icon { width: 18px; height: 18px; }
.receipt-main-copy, .receipt-total { display: grid; gap: 3px; }
.receipt-main-copy strong { color: #173f39; font-size: 11px; }
.receipt-main-copy small, .receipt-total small { color: #748780; font-size: 8px; }
.receipt-total { text-align: right; }
.receipt-total strong { color: #173f39; font-size: 12px; }
.receipt-status { justify-self: end; }
.receipt-status-unpaid { color: #9f3b3b; background: #fff0f0; }
.receipt-status-partially_paid { color: #9a6508; background: #fff5dd; }
.receipt-status-paid { color: #147459; background: #e8f7f1; }
.receipt-expand-icon { color: #6b817a; transition: transform .18s ease; }
.material-receipt-record[open] .receipt-expand-icon { transform: rotate(180deg); }
.material-receipt-details { padding: 0 13px 13px; border-top: 1px solid #e5eeeb; background: #fbfdfc; }
.receipt-meta-grid {
    padding: 11px 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}
.receipt-meta-grid > div { padding: 8px 9px; display: grid; gap: 2px; border: 1px solid #e1ece8; border-radius: 9px; background: #fff; }
.receipt-meta-grid span { color: #7b8c87; font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.receipt-meta-grid strong { color: #294e47; font-size: 9px; }
.receipt-items-table { min-width: 850px; }
.receipt-totals-strip {
    margin-top: 9px;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}
.receipt-totals-strip span { padding: 6px 9px; display: flex; align-items: center; gap: 7px; color: #6d817b; border: 1px solid #dfeae7; border-radius: 8px; background: #fff; font-size: 8px; }
.receipt-totals-strip strong { color: #274b44; }
.receipt-totals-strip .grand-total { color: #fff; border-color: #0f766e; background: #0f766e; }
.receipt-totals-strip .grand-total strong { color: #fff; font-size: 11px; }
.receipt-notes { margin: 9px 0 0; padding: 8px 10px; color: #5f756e; border-radius: 8px; background: #f2f7f5; font-size: 9px; }
.compact-empty-state { min-height: 155px; }

.material-receipt-dialog-large {
    width: min(1560px, calc(100vw - 24px));
    max-width: 1560px;
    height: min(94vh, 980px);
    max-height: calc(100vh - 24px);
    border-radius: 18px;
}
.material-receipt-dialog-large .modal-card {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
}
.material-receipt-dialog-large .modal-header,
.material-receipt-dialog-large .modal-footer {
    flex: 0 0 auto;
}
.material-receipt-dialog-large .modal-body {
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 18px 20px;
}
.material-receipt-dialog-large .receipt-form-section {
    padding: 15px;
}
.material-receipt-dialog-large .receipt-item-primary-grid {
    grid-template-columns: minmax(260px, 2.4fr) minmax(115px, .75fr) minmax(125px, .85fr) 100px 90px minmax(125px, .85fr);
    gap: 10px;
}
.material-receipt-dialog-large .receipt-items-editor {
    gap: 11px;
}
.material-receipt-dialog-large .receipt-item-row {
    padding: 12px;
}
@media (max-width: 900px) {
    .material-receipt-dialog-large {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .material-receipt-dialog-large .modal-card { border-radius: 0; }
    .material-receipt-dialog-large .modal-body { padding: 12px; }
}
.receipt-form-section { padding: 13px; border: 1px solid #dce9e5; border-radius: 14px; background: #fbfdfc; }
.section-heading { margin-bottom: 11px; display: flex; align-items: center; gap: 9px; }
.section-heading-actions { justify-content: flex-start; }
.section-heading-actions .btn { margin-left: auto; }
.section-number { width: 27px; height: 27px; display: grid; place-items: center; color: #fff; border-radius: 9px; background: #0f766e; font-size: 10px; font-weight: 900; }
.section-heading > div { display: grid; gap: 2px; }
.section-heading strong { color: #173f39; font-size: 11px; }
.section-heading small { color: #748780; font-size: 8px; }
.receipt-items-editor { display: grid; gap: 9px; }
.receipt-item-row {
    padding: 10px;
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr) 30px;
    align-items: start;
    gap: 9px;
    border: 1px solid #dce7e4;
    border-radius: 12px;
    background: #fff;
}
.receipt-item-row.is-invalid { border-color: #d95c5c; box-shadow: 0 0 0 3px rgba(217, 92, 92, .1); }
.receipt-item-index { width: 27px; height: 27px; display: grid; place-items: center; color: #0f766e; border-radius: 8px; background: #eaf6f2; font-size: 9px; font-weight: 900; }
.receipt-item-main { min-width: 0; display: grid; gap: 7px; }
.receipt-item-primary-grid { display: grid; grid-template-columns: minmax(210px, 2fr) minmax(105px, .7fr) minmax(110px, .8fr) 90px 80px minmax(110px, .8fr); gap: 8px; align-items: end; }
.receipt-line-total { min-height: 48px; padding: 7px 9px; display: grid; align-content: center; gap: 2px; border: 1px solid #cfe3dd; border-radius: 9px; background: #f0f8f5; }
.receipt-line-total span { color: #72857f; font-size: 7px; font-weight: 800; text-transform: uppercase; }
.receipt-line-total strong { color: #0f6d62; font-size: 10px; }
.input-with-suffix { position: relative; }
.input-with-suffix input { padding-right: 39px; }
.input-with-suffix span { position: absolute; top: 50%; right: 9px; color: #7b8e88; font-size: 8px; transform: translateY(-50%); pointer-events: none; }
.receipt-item-extra { border-top: 1px dashed #dce7e3; }
.receipt-item-extra summary { padding: 7px 2px 2px; display: inline-flex; align-items: center; gap: 5px; color: #55736a; cursor: pointer; font-size: 8px; font-weight: 800; list-style: none; }
.receipt-item-extra summary::-webkit-details-marker { display: none; }
.receipt-item-extra summary .ui-icon { width: 11px; height: 11px; }
.receipt-item-extra summary span { color: #97a6a1; font-weight: 600; }
.receipt-item-extra[open] summary .ui-icon { transform: rotate(180deg); }
.receipt-item-extra .form-grid { padding-top: 8px; }
.receipt-form-summary { padding: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; border: 1px solid #cfe2dc; border-radius: 13px; background: #f4faf8; }
.receipt-form-summary > span { padding: 8px 9px; display: grid; gap: 3px; border-radius: 9px; background: #fff; }
.receipt-form-summary small { color: #71857e; font-size: 7px; font-weight: 900; text-transform: uppercase; }
.receipt-form-summary strong { color: #274d45; font-size: 11px; }
.receipt-form-summary .receipt-summary-total { background: #0f766e; }
.receipt-form-summary .receipt-summary-total small, .receipt-form-summary .receipt-summary-total strong { color: #fff; }

@media (max-width: 1050px) {
    .receipt-item-primary-grid { grid-template-columns: minmax(210px, 2fr) repeat(2, minmax(100px, 1fr)); }
    .receipt-line-total { min-height: 45px; }
    .receipt-meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .material-toolbar { align-items: stretch; flex-direction: column; }
    .material-toolbar .button-row { justify-content: stretch; }
    .material-toolbar .button-row .btn { flex: 1; }
    .material-receipt-record > summary { grid-template-columns: 34px minmax(0, 1fr) 20px; }
    .receipt-status, .receipt-total { grid-column: 2; justify-self: start; text-align: left; }
    .receipt-expand-icon { grid-column: 3; grid-row: 1; }
    .receipt-meta-grid { grid-template-columns: 1fr 1fr; }
    .receipt-item-row { grid-template-columns: 24px minmax(0, 1fr) 28px; padding: 8px; }
    .receipt-item-primary-grid { grid-template-columns: 1fr 1fr; }
    .receipt-material-field, .receipt-line-total { grid-column: 1 / -1; }
    .receipt-form-summary { grid-template-columns: 1fr 1fr; }
}

/* DentalPro 3.3.5 — large clinical center modal with compact embedded workspace */
.clinical-center-dialog {
    width: min(1740px, calc(100vw - 18px));
    max-width: none;
    height: min(96dvh, 1080px);
    max-height: calc(100dvh - 18px);
    overflow: hidden;
    border-radius: 16px;
    background: #eef4f2;
}
.clinical-center-dialog[open] { display: block; }
.clinical-center-modal-shell {
    height: 100%;
    display: grid;
    grid-template-rows: 54px minmax(0, 1fr);
    overflow: hidden;
    background: #eef4f2;
}
.clinical-center-modal-header {
    padding: 7px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #cfdfda;
    background: linear-gradient(180deg, #ffffff, #f8fbfa);
}
.clinical-center-modal-header .section-title-with-icon { min-width: 0; }
.clinical-center-modal-header .section-icon { width: 34px; height: 34px; border-radius: 10px; }
.clinical-center-modal-header .section-icon .ui-icon { width: 17px; height: 17px; }
.clinical-center-modal-header .eyebrow { font-size: 7px; }
.clinical-center-modal-header h2 { margin: 1px 0 0; font-size: 13px; line-height: 1.15; }
.clinical-center-modal-actions { display: flex; align-items: center; gap: 7px; }
.clinical-center-modal-actions .btn { min-height: 29px; padding: 5px 9px; font-size: 8px; }
.clinical-center-frame-wrap { position: relative; min-height: 0; overflow: hidden; }
.clinical-center-frame { width: 100%; height: 100%; display: block; border: 0; background: #eef4f2; }
.clinical-center-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    color: #4f6e67;
    background: rgba(238,244,242,.94);
    font-size: 10px;
    font-weight: 800;
    transition: opacity .18s ease;
}
.clinical-center-loading .ui-icon { width: 22px; height: 22px; animation: clinical-center-spin .8s linear infinite; }
.clinical-center-loading.is-hidden { opacity: 0; pointer-events: none; }
@keyframes clinical-center-spin { to { transform: rotate(360deg); } }
html.clinical-center-modal-open { overflow: hidden; }

.embedded-body { margin: 0; min-width: 0; overflow: auto; background: #eef4f2; }
.embedded-shell { min-height: 100dvh; padding: 7px 8px 14px; }
.embedded-body .flash-stack { top: 7px; right: 8px; max-width: 360px; }
.clinical-center-embedded { color: #2e514a; font-size: 10px; line-height: 1.35; }
.clinical-center-embedded > * + * { margin-top: 7px; }
.clinical-center-embedded .card { border-radius: 10px; box-shadow: 0 3px 12px rgba(29,79,70,.04); }
.clinical-center-embedded .clinical-patient-head { padding: 9px 11px; gap: 10px; }
.clinical-center-embedded .clinical-patient-head .avatar-xl { width: 38px; height: 38px; font-size: 12px; }
.clinical-center-embedded .clinical-patient-head h2 { margin: 1px 0 2px; font-size: 14px; }
.clinical-center-embedded .clinical-patient-head p { font-size: 8px; }
.clinical-center-embedded .clinical-patient-head .hero-actions { display: none; }
.clinical-center-embedded .alert-panel { padding: 8px 10px; border-radius: 9px; font-size: 9px; }
.clinical-center-embedded .alert-panel-grid { gap: 8px; }
.clinical-center-embedded .clinical-section-nav {
    top: 0;
    padding: 5px;
    gap: 4px;
    border-radius: 9px;
}
.clinical-center-embedded .clinical-section-nav a { padding: 5px 8px; border-radius: 7px; font-size: 8px; }
.clinical-center-embedded .clinical-module { padding: 10px; scroll-margin-top: 46px; }
.clinical-center-embedded .card-header { margin-bottom: 8px; gap: 8px; }
.clinical-center-embedded .card-header h2 { font-size: 13px; }
.clinical-center-embedded .card-header .eyebrow { font-size: 7px; }
.clinical-center-embedded .btn { min-height: 28px; padding: 5px 8px; gap: 4px; border-radius: 7px; font-size: 8px; }
.clinical-center-embedded .btn .ui-icon { width: 12px; height: 12px; }
.clinical-center-embedded .btn-sm { min-height: 25px; padding: 4px 7px; font-size: 7.5px; }
.clinical-center-embedded .icon-action,
.clinical-center-embedded .icon-button { width: 27px; min-width: 27px; height: 27px; min-height: 27px; }
.clinical-center-embedded .icon-action .ui-icon,
.clinical-center-embedded .icon-button .ui-icon { width: 12px; height: 12px; }
.clinical-center-embedded .odontogram-chart { gap: 4px; }
.clinical-center-embedded .odontogram-tooth { min-height: 52px; padding: 4px 2px; border-radius: 7px; }
.clinical-center-embedded .odontogram-tooth .tooth-shape { min-height: 22px; }
.clinical-center-embedded .odontogram-tooth .tooth-shape .ui-icon { width: 18px; height: 18px; }
.clinical-center-embedded .odontogram-tooth strong { font-size: 9px; }
.clinical-center-embedded .odontogram-tooth small { font-size: 6.5px; }
.clinical-center-embedded .odontogram-legend { gap: 3px; }
.clinical-center-embedded .odontogram-legend span { padding: 3px 5px; font-size: 6.5px; border-radius: 999px; }
.clinical-center-embedded .clinical-grid-two { gap: 8px; }
.clinical-center-embedded .plan-list,
.clinical-center-embedded .compact-list { gap: 6px; }
.clinical-center-embedded .plan-card { padding: 9px; border-radius: 9px; }
.clinical-center-embedded .plan-card h3 { font-size: 11px; }
.clinical-center-embedded .plan-card p,
.clinical-center-embedded .plan-card small { font-size: 7.5px; }
.clinical-center-embedded .plan-items > div,
.clinical-center-embedded .compact-list > div { padding: 6px 7px; gap: 7px; font-size: 8px; }
.clinical-center-embedded .badge { min-height: 17px; padding: 2px 5px; font-size: 6.5px; }
.clinical-center-embedded .field { gap: 3px; }
.clinical-center-embedded .field > span,
.clinical-center-embedded .field legend { font-size: 7.5px; }
.clinical-center-embedded input,
.clinical-center-embedded select,
.clinical-center-embedded textarea { min-height: 29px; padding: 5px 7px; border-radius: 7px; font-size: 8.5px; }
.clinical-center-embedded textarea { min-height: 56px; }
.clinical-center-embedded .form-grid { gap: 7px; }
.clinical-center-embedded table { font-size: 8px; }
.clinical-center-embedded th { padding: 5px 6px; font-size: 6.5px; }
.clinical-center-embedded td { padding: 6px; }
.clinical-center-embedded details > summary { padding: 6px 8px; font-size: 8px; }
.clinical-center-embedded .empty-state { padding: 16px 10px; }
.clinical-center-embedded .empty-state h3 { font-size: 11px; }
.clinical-center-embedded .empty-state p,
.clinical-center-embedded .muted { font-size: 8px; }

.embedded-body .modal-dialog { width: min(900px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); border-radius: 12px; }
.embedded-body .modal-card { max-height: calc(100dvh - 20px); }
.embedded-body .modal-header { min-height: 46px; padding: 8px 10px; }
.embedded-body .modal-header h2 { font-size: 13px; }
.embedded-body .modal-body { padding: 10px; }
.embedded-body .modal-footer { min-height: 46px; padding: 7px 10px; }
.embedded-body .consent-layout { gap: 10px; }
.embedded-body .signature-panel canvas { max-height: 150px; }

@media (max-width: 900px) {
    .clinical-center-dialog { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
    .clinical-center-modal-shell { grid-template-rows: 50px minmax(0,1fr); }
    .clinical-center-modal-actions .btn { display: none; }
    .embedded-shell { padding: 5px; }
    .clinical-center-embedded .odontogram-chart { grid-template-columns: repeat(8, minmax(34px, 1fr)); }
}


/* DentalPro 3.3.6 — balanced clinical center sizing
   Keeps the large modal, but restores comfortable readability and click targets. */
.clinical-center-modal-shell {
    grid-template-rows: 64px minmax(0, 1fr);
}
.clinical-center-modal-header {
    padding: 10px 16px;
}
.clinical-center-modal-header .section-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}
.clinical-center-modal-header .section-icon .ui-icon {
    width: 20px;
    height: 20px;
}
.clinical-center-modal-header .eyebrow {
    font-size: 9px;
}
.clinical-center-modal-header h2 {
    font-size: 16px;
}
.clinical-center-modal-actions .btn {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 10px;
}
.clinical-center-loading {
    font-size: 12px;
}

.embedded-shell {
    padding: 10px 12px 18px;
}
.clinical-center-embedded {
    font-size: 11.5px;
    line-height: 1.45;
}
.clinical-center-embedded > * + * {
    margin-top: 10px;
}
.clinical-center-embedded .card {
    border-radius: 12px;
}
.clinical-center-embedded .clinical-patient-head {
    padding: 13px 15px;
    gap: 13px;
}
.clinical-center-embedded .clinical-patient-head .avatar-xl {
    width: 48px;
    height: 48px;
    font-size: 15px;
}
.clinical-center-embedded .clinical-patient-head h2 {
    font-size: 17px;
}
.clinical-center-embedded .clinical-patient-head p {
    font-size: 10px;
}
.clinical-center-embedded .alert-panel {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 10.5px;
}
.clinical-center-embedded .clinical-section-nav {
    padding: 7px;
    gap: 6px;
    border-radius: 11px;
}
.clinical-center-embedded .clinical-section-nav a {
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 10px;
}
.clinical-center-embedded .clinical-module {
    padding: 14px;
    scroll-margin-top: 54px;
}
.clinical-center-embedded .card-header {
    margin-bottom: 11px;
    gap: 10px;
}
.clinical-center-embedded .card-header h2 {
    font-size: 15px;
}
.clinical-center-embedded .card-header .eyebrow {
    font-size: 8.5px;
}
.clinical-center-embedded .btn {
    min-height: 34px;
    padding: 7px 10px;
    gap: 6px;
    border-radius: 8px;
    font-size: 10px;
}
.clinical-center-embedded .btn .ui-icon {
    width: 15px;
    height: 15px;
}
.clinical-center-embedded .btn-sm {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 9.5px;
}
.clinical-center-embedded .icon-action,
.clinical-center-embedded .icon-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
}
.clinical-center-embedded .icon-action .ui-icon,
.clinical-center-embedded .icon-button .ui-icon {
    width: 15px;
    height: 15px;
}
.clinical-center-embedded .odontogram-chart {
    gap: 6px;
}
.clinical-center-embedded .odontogram-tooth {
    min-height: 68px;
    padding: 6px 3px;
    border-radius: 9px;
}
.clinical-center-embedded .odontogram-tooth .tooth-shape {
    min-height: 28px;
}
.clinical-center-embedded .odontogram-tooth .tooth-shape .ui-icon {
    width: 23px;
    height: 23px;
}
.clinical-center-embedded .odontogram-tooth strong {
    font-size: 11px;
}
.clinical-center-embedded .odontogram-tooth small {
    font-size: 8px;
}
.clinical-center-embedded .odontogram-legend {
    gap: 5px;
}
.clinical-center-embedded .odontogram-legend span {
    padding: 4px 7px;
    font-size: 8px;
}
.clinical-center-embedded .clinical-grid-two {
    gap: 11px;
}
.clinical-center-embedded .plan-list,
.clinical-center-embedded .compact-list {
    gap: 8px;
}
.clinical-center-embedded .plan-card {
    padding: 12px;
    border-radius: 11px;
}
.clinical-center-embedded .plan-card h3 {
    font-size: 13px;
}
.clinical-center-embedded .plan-card p,
.clinical-center-embedded .plan-card small {
    font-size: 9.5px;
}
.clinical-center-embedded .plan-items > div,
.clinical-center-embedded .compact-list > div {
    padding: 8px 9px;
    gap: 9px;
    font-size: 10px;
}
.clinical-center-embedded .badge {
    min-height: 21px;
    padding: 3px 7px;
    font-size: 8px;
}
.clinical-center-embedded .field {
    gap: 5px;
}
.clinical-center-embedded .field > span,
.clinical-center-embedded .field legend {
    font-size: 9.5px;
}
.clinical-center-embedded input,
.clinical-center-embedded select,
.clinical-center-embedded textarea {
    min-height: 36px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 10.5px;
}
.clinical-center-embedded textarea {
    min-height: 74px;
}
.clinical-center-embedded .form-grid {
    gap: 10px;
}
.clinical-center-embedded table {
    font-size: 10px;
}
.clinical-center-embedded th {
    padding: 7px 8px;
    font-size: 8.5px;
}
.clinical-center-embedded td {
    padding: 8px;
}
.clinical-center-embedded details > summary {
    padding: 8px 10px;
    font-size: 10px;
}
.clinical-center-embedded .empty-state {
    padding: 22px 14px;
}
.clinical-center-embedded .empty-state h3 {
    font-size: 13px;
}
.clinical-center-embedded .empty-state p,
.clinical-center-embedded .muted {
    font-size: 10px;
}

.embedded-body .modal-dialog {
    width: min(1040px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    border-radius: 14px;
}
.embedded-body .modal-card {
    max-height: calc(100dvh - 28px);
}
.embedded-body .modal-header {
    min-height: 56px;
    padding: 11px 14px;
}
.embedded-body .modal-header h2 {
    font-size: 16px;
}
.embedded-body .modal-body {
    padding: 14px;
}
.embedded-body .modal-footer {
    min-height: 56px;
    padding: 10px 14px;
}
.embedded-body .consent-layout {
    gap: 14px;
}
.embedded-body .signature-panel canvas {
    max-height: 190px;
}

@media (max-width: 900px) {
    .clinical-center-modal-shell { grid-template-rows: 58px minmax(0,1fr); }
    .clinical-center-modal-header { padding: 8px 11px; }
    .embedded-shell { padding: 8px; }
    .clinical-center-embedded { font-size: 11px; }
    .clinical-center-embedded .clinical-module { padding: 11px; }
    .clinical-center-embedded .odontogram-chart { grid-template-columns: repeat(8, minmax(42px, 1fr)); }
    .clinical-center-embedded .odontogram-tooth { min-height: 62px; }
}


/* DentalPro 3.3.7 — interactive odontogram status palette */
.odontogram-header {
    position: relative;
    align-items: flex-start;
    gap: 14px;
}
.odontogram-help {
    margin-top: 3px;
    font-size: 10.5px;
}
.odontogram-legend-control {
    position: relative;
    flex: 0 0 auto;
}
.odontogram-legend-toggle {
    min-width: 104px;
    justify-content: center;
}
.odontogram-legend-toggle.is-active {
    color: #0f766e;
    border-color: rgba(15,118,110,.35);
    background: #ecfdf8;
}
.odontogram-legend-panel {
    position: absolute;
    z-index: 80;
    top: calc(100% + 8px);
    right: 0;
    width: min(430px, 78vw);
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    border: 1px solid #d9e6e2;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 55, 47, .18);
}
.odontogram-legend-panel[hidden] { display: none !important; }
.odontogram-legend-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 8px !important;
    border: 1px solid currentColor !important;
    border-radius: 8px !important;
    font-size: 9px !important;
    font-weight: 750;
    line-height: 1.15;
}
.odontogram-legend-item i,
.tooth-status-option i {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 2px rgba(255,255,255,.78);
}
.odontogram-tooth {
    position: relative;
    overflow: visible;
}
.odontogram-tooth.is-status-menu-open {
    z-index: 4;
    transform: translateY(-2px);
    outline: 3px solid rgba(15,118,110,.18);
    box-shadow: 0 10px 26px rgba(15, 55, 47, .18);
}
.tooth-edit-hint {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: currentColor;
    background: rgba(255,255,255,.82);
    opacity: 0;
    transform: scale(.88);
    transition: opacity .16s ease, transform .16s ease;
}
.tooth-edit-hint .ui-icon { width: 10px; height: 10px; }
.odontogram-tooth:hover .tooth-edit-hint,
.odontogram-tooth:focus-visible .tooth-edit-hint,
.odontogram-tooth.is-status-menu-open .tooth-edit-hint {
    opacity: 1;
    transform: scale(1);
}
.tooth-quick-status {
    position: fixed;
    z-index: 9999;
    width: min(390px, calc(100vw - 20px));
    padding: 11px;
    border: 1px solid #d8e5e1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(11, 49, 42, .25);
}
.tooth-quick-status[hidden] { display: none !important; }
.tooth-quick-status.is-saving {
    opacity: .72;
    pointer-events: none;
}
.tooth-quick-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf2f0;
    font-size: 11px;
    color: #48655e;
}
.tooth-quick-status-head strong {
    color: #123f36;
    font-size: 14px;
}
.tooth-status-palette {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}
.tooth-status-option {
    min-width: 0;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 8px;
    border: 1px solid currentColor;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 9px;
    font-weight: 760;
    line-height: 1.15;
    text-align: left;
    transition: transform .14s ease, box-shadow .14s ease, outline-color .14s ease;
}
.tooth-status-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(20, 62, 53, .12);
}
.tooth-status-option.is-selected {
    outline: 3px solid rgba(15,118,110,.22);
    outline-offset: 1px;
}
.tooth-status-option span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tooth-details-button {
    width: 100%;
    justify-content: center;
    margin-top: 9px;
}
.clinical-center-embedded .odontogram-legend-panel {
    width: min(400px, 75vw);
}
.clinical-center-embedded .tooth-quick-status {
    width: min(370px, calc(100vw - 18px));
}
@media (max-width: 700px) {
    .odontogram-header { align-items: stretch; flex-direction: column; }
    .odontogram-legend-control { align-self: flex-start; }
    .odontogram-legend-panel {
        position: fixed;
        top: 74px;
        right: 10px;
        left: 10px;
        width: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tooth-status-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* DentalPro 3.3.8 — clinical header + reliable odontogram interactions */
.clinical-center-patient-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}
.clinical-center-patient-photo,
.clinical-center-patient-avatar {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(15,118,110,.18);
    box-shadow: 0 5px 14px rgba(15,55,47,.12);
}
.clinical-center-patient-avatar {
    display: grid;
    place-items: center;
    color: #0f5f55;
    background: #e8f7f2;
    font-size: 12px;
    font-weight: 850;
}
.clinical-center-patient-copy { min-width: 0; }
.clinical-center-patient-copy h2 {
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clinical-center-patient-number {
    display: inline-flex;
    margin-top: 3px;
    color: #55736c;
    font-size: 9px;
    font-weight: 760;
}
.clinical-center-embedded .odontogram-tooth {
    touch-action: manipulation;
    user-select: none;
}
.clinical-center-embedded .odontogram-legend-toggle,
.clinical-center-embedded .odontogram-tooth,
.clinical-center-embedded .tooth-status-option {
    pointer-events: auto;
}
@media (max-width: 700px) {
    .clinical-center-patient-photo,
    .clinical-center-patient-avatar {
        width: 38px;
        min-width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    .clinical-center-patient-number { font-size: 8px; }
}

/* DentalPro 3.3.9 — unified patient services center */
.patient-record-settings {
    width: 34px;
    height: 34px;
    margin-inline: auto;
    color: #146b5b;
    border: 1px solid #cfe2dd;
    border-radius: 10px;
    background: #f2f8f6;
}
.patient-record-settings:hover { color: #fff; border-color: #167764; background: #167764; transform: translateY(-1px); }
.patient-record-settings .ui-icon { width: 17px; height: 17px; }

.clinical-services-center { display: grid; gap: 14px; }
.clinical-services-nav { justify-content: center; }
.clinical-services-nav a { min-width: 100px; text-align: center; }
.clinical-active-appointment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border-color: #b8dcd2;
    background: linear-gradient(135deg,#f5fbf9,#eaf7f3);
}
.clinical-active-appointment h2 { margin: 2px 0 0; font-size: 18px; color: #174f45; }
.clinical-active-appointment-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.clinical-active-appointment-meta > span {
    min-width: 130px;
    padding: 9px 12px;
    border: 1px solid #d6e8e3;
    border-radius: 11px;
    background: rgba(255,255,255,.82);
}
.clinical-active-appointment-meta small,
.clinical-service-summary small,
.clinical-finance-stats small { display: block; color: #70877f; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.clinical-active-appointment-meta strong { display: block; margin-top: 2px; color: #234f47; font-size: 11px; }

.clinical-context-note {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid #d7e8e3;
    border-radius: 12px;
    color: #315d54;
    background: #f6faf9;
}
.clinical-context-note > .ui-icon { width: 20px; height: 20px; flex: 0 0 auto; color: #398574; }
.clinical-context-note strong,
.clinical-context-note span { display: block; }
.clinical-context-note span { margin-top: 2px; color: #72867f; font-size: 10px; }
.clinical-context-warning { border-color: #f2d6ad; color: #80571a; background: #fff9ef; }

.clinical-service-summary,
.clinical-finance-stats {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 10px;
    margin: 12px 0;
}
.clinical-service-summary > span,
.clinical-finance-stats > div {
    padding: 11px 13px;
    border: 1px solid #d7e7e2;
    border-radius: 12px;
    background: #fbfdfc;
}
.clinical-service-summary strong,
.clinical-finance-stats strong { display: block; margin-top: 3px; color: #174f45; font-size: 15px; }
.clinical-finance-due { border-color: #f0cfaa !important; background: #fff9ef !important; }
.clinical-finance-due strong { color: #a55c12 !important; }
.clinical-services-table-wrap { max-height: 340px; }
.clinical-services-table th,
.clinical-services-table td { padding: 8px 9px; font-size: 10px; }
.clinical-service-history { margin-top: 13px; border-top: 1px solid #e0ebe8; padding-top: 11px; }
.clinical-service-history summary { cursor: pointer; display: inline-flex; align-items: center; gap: 7px; color: #34685e; font-weight: 800; font-size: 11px; }
.clinical-service-history summary .ui-icon { width: 15px; height: 15px; }
.clinical-service-editor-dialog { width: min(1050px,calc(100vw - 28px)); }
.clinical-service-editor-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(240px,.65fr); gap: 16px; }
.dashboard-clinical-center-dialog .clinical-center-modal-shell { width: min(1580px,calc(100vw - 22px)); }

@media (max-width: 900px) {
    .clinical-active-appointment { align-items: stretch; flex-direction: column; }
    .clinical-active-appointment-meta { display: grid; grid-template-columns: 1fr; }
    .clinical-service-summary,
    .clinical-finance-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .clinical-service-editor-grid { grid-template-columns: 1fr; }
    .clinical-services-nav { justify-content: flex-start; }
}

/* ========================================================================== */
/* DentalPro 3.4 — Invoice register and Excel-style material receipt           */
/* ========================================================================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.receipt-document-line {
    display: grid;
    grid-template-columns: minmax(245px, 1.25fr) minmax(150px, .78fr) minmax(145px, .72fr) minmax(145px, .72fr) minmax(145px, .68fr) minmax(220px, 1.15fr);
    gap: 10px;
    align-items: end;
    padding: 13px;
    border: 1px solid #d6e5e1;
    border-radius: 14px;
    background: linear-gradient(135deg, #fbfdfc, #f3f9f7);
}
.receipt-document-line .field { margin: 0; min-width: 0; }
.receipt-supplier-control { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 6px; }
.receipt-add-supplier { width: 42px; height: 42px; color: #fff; border-color: #0f766e; background: #0f766e; }
.receipt-add-supplier:hover { color: #fff; background: #0b625b; }
.material-receipt-workspace { display: grid; align-content: start; gap: 13px; }

.receipt-excel-section {
    min-height: 0;
    border: 1px solid #d6e5e1;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}
.receipt-excel-heading {
    padding: 10px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #dfeae7;
    background: #f7fbfa;
}
.receipt-excel-heading > div { display: grid; gap: 2px; }
.receipt-excel-heading strong { color: #173f39; font-size: 12px; }
.receipt-excel-heading small { color: #72857f; font-size: 9px; }
.receipt-excel-table { width: 100%; overflow-x: auto; }
.receipt-excel-header,
.receipt-excel-row {
    min-width: 1260px;
    display: grid;
    grid-template-columns: 38px minmax(260px, 2fr) 120px 135px 94px 88px 135px 150px 86px;
    align-items: center;
}
.receipt-excel-header {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #49665e;
    border-bottom: 1px solid #dce8e4;
    background: #edf6f3;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.receipt-excel-header > span { padding: 8px 7px; border-right: 1px solid #dce8e4; }
.receipt-excel-header em { color: #8c9b96; font-style: normal; font-weight: 700; text-transform: none; }
.receipt-items-editor { display: block; }
.receipt-excel-row {
    min-height: 48px;
    border-bottom: 1px solid #e4ecea;
    background: #fff;
    transition: background .15s ease, box-shadow .15s ease;
}
.receipt-excel-row:nth-child(even) { background: #fbfdfc; }
.receipt-excel-row:focus-within { position: relative; z-index: 1; background: #f1faf7; box-shadow: inset 3px 0 #0f766e; }
.receipt-excel-row.is-invalid { background: #fff5f5; box-shadow: inset 3px 0 #d94848; }
.receipt-excel-row > * { min-width: 0; padding: 5px 6px; border-right: 1px solid #edf2f0; }
.receipt-excel-cell { display: block; margin: 0; }
.receipt-excel-cell input,
.receipt-excel-cell select {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    font-size: 10px;
}
.receipt-excel-cell input:hover,
.receipt-excel-cell select:hover { border-color: #d5e3df; background: #fff; }
.receipt-excel-cell input:focus,
.receipt-excel-cell select:focus { border-color: #72b8a9; background: #fff; box-shadow: 0 0 0 3px rgba(15,118,110,.09); }
.receipt-excel-row .receipt-item-index {
    width: 25px;
    height: 25px;
    margin: auto;
    padding: 0;
    display: grid;
    place-items: center;
    color: #0f766e;
    border: 0;
    border-radius: 7px;
    background: #e8f5f1;
    font-size: 9px;
    font-weight: 900;
}
.receipt-excel-row .input-with-suffix input { padding-right: 34px; }
.receipt-excel-total { color: #0b665d; font-size: 10px; font-weight: 900; white-space: nowrap; }
.receipt-excel-actions { display: flex; justify-content: center; gap: 4px; border-right: 0 !important; }
.receipt-excel-actions .icon-button { width: 29px; height: 29px; border-radius: 7px; }
.receipt-row-add { color: #fff; border-color: #0f766e; background: #0f766e; }
.receipt-row-add:hover { color: #fff; background: #0b625b; }
.receipt-row-delete { color: #b53d3d; border-color: #f0d1d1; background: #fff5f5; }
.form-message { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 10px; }
.form-message.is-error { color: #9b2c2c; border: 1px solid #f0caca; background: #fff4f4; }
.supplier-quick-dialog { width: min(620px, calc(100vw - 28px)); }

.invoice-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.invoice-kpi {
    min-height: 108px;
    padding: 15px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid #dce8e4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(31, 73, 65, .06);
}
.invoice-kpi > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; }
.invoice-kpi > span .ui-icon { width: 21px; height: 21px; }
.invoice-kpi > div { min-width: 0; display: grid; gap: 3px; }
.invoice-kpi small { color: #6f837c; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.invoice-kpi strong { color: #173f39; font-size: 19px; line-height: 1.15; }
.invoice-kpi em { color: #8b9b96; font-size: 8px; font-style: normal; }
.invoice-kpi-count > span { color: #2665a7; background: #edf5ff; }
.invoice-kpi-total > span { color: #6d4cb4; background: #f3efff; }
.invoice-kpi-paid > span { color: #0e7a55; background: #eaf8f1; }
.invoice-kpi-due > span { color: #b26512; background: #fff4e5; }
.invoice-filter-card { margin-bottom: 14px; }
.invoice-filter-heading { align-items: flex-start; }
.invoice-filter-grid {
    padding-top: 4px;
    display: grid;
    grid-template-columns: minmax(230px, 1.35fr) minmax(230px, 1.2fr) 145px 145px minmax(155px, .8fr) auto;
    align-items: end;
    gap: 9px;
}
.invoice-filter-grid .field { margin: 0; }
.invoice-filter-submit { min-height: 42px; white-space: nowrap; }
.invoice-register-card { overflow: hidden; }
.invoice-table-wrap { max-height: 610px; }
.invoice-register-table { min-width: 1180px; }
.invoice-register-table thead th { position: sticky; top: 0; z-index: 2; background: #eef6f3; }
.invoice-register-table th,
.invoice-register-table td { padding: 9px 10px; vertical-align: middle; }
.invoice-number { color: #0f6d62; }
.invoice-services-text { max-width: 280px; display: -webkit-box; overflow: hidden; color: #496860; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.invoice-status-issued { color: #245f9d; background: #eaf3ff; }
.invoice-status-partially_paid { color: #9b630f; background: #fff4da; }
.invoice-status-paid { color: #087453; background: #e7f7ef; }
.invoice-status-cancelled { color: #a33d3d; background: #fdecec; }
.invoice-status-draft { color: #65746f; background: #eef2f1; }
.table-action-col { width: 70px; text-align: center; }

@media (max-width: 1250px) {
    .receipt-document-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .receipt-document-line .field:last-child { grid-column: span 1; }
    .invoice-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .invoice-filter-submit { width: 100%; }
}
@media (max-width: 900px) {
    .invoice-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .receipt-document-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .receipt-document-line .field:last-child { grid-column: span 2; }
    .invoice-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .invoice-kpi-grid,
    .invoice-filter-grid,
    .receipt-document-line { grid-template-columns: 1fr; }
    .receipt-document-line .field:last-child { grid-column: auto; }
    .invoice-kpi { min-height: 92px; }
}

/* DentalPro 3.5 — Recall and installment management */
.card-header-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.btn-xs { min-height:28px; padding:4px 8px; border-radius:8px; font-size:9.5px; }

.recall-kpi-grid,
.installment-kpi-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    margin-bottom:14px;
}
.recall-kpi,
.installment-kpi {
    min-height:104px;
    display:flex;
    align-items:center;
    gap:13px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:16px;
    background:#fff;
    box-shadow:0 10px 28px rgba(20,68,60,.07);
    color:inherit;
    text-decoration:none;
    transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
.recall-kpi:hover { transform:translateY(-2px); box-shadow:0 15px 34px rgba(20,68,60,.11); }
.recall-kpi > span,
.installment-kpi > span {
    width:46px;
    height:46px;
    flex:0 0 46px;
    display:grid;
    place-items:center;
    border-radius:14px;
}
.recall-kpi > span .ui-icon,
.installment-kpi > span .ui-icon { width:22px;height:22px; }
.recall-kpi div,
.installment-kpi div { min-width:0;display:grid;gap:2px; }
.recall-kpi small,
.installment-kpi small { color:#6d817c;font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase; }
.recall-kpi strong,
.installment-kpi strong { color:#173e38;font-size:23px;line-height:1.05; }
.recall-kpi em,
.installment-kpi em { color:#7a8e89;font-size:9.5px;font-style:normal; }
.recall-kpi-active > span { color:#0f766e;background:#e7f6f2; }
.recall-kpi-overdue > span { color:#b83b37;background:#fff0ef; }
.recall-kpi-today > span { color:#b66b09;background:#fff5df; }
.recall-kpi-next > span { color:#315f9d;background:#edf4ff; }
.installment-kpi-active > span { color:#0f766e;background:#e7f6f2; }
.installment-kpi-outstanding > span { color:#315f9d;background:#edf4ff; }
.installment-kpi-overdue > span { color:#b83b37;background:#fff0ef; }
.installment-kpi-today > span { color:#b66b09;background:#fff5df; }

.recall-filter-card,
.installment-filter-card { margin-bottom:14px; }
.recall-filter-grid,
.installment-filter-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(145px,1fr));
    align-items:end;
    gap:9px;
}
.recall-filter-grid .field,
.installment-filter-grid .field { margin:0; }
.recall-search-field,
.installment-search-field { grid-column:span 2; }
.recall-filter-submit,
.installment-filter-submit { min-height:40px; }
.recall-table-wrap { max-height:650px; }
.recall-register-table { min-width:1100px; }
.recall-register-table thead th { position:sticky;top:0;z-index:3;background:#eef6f3; }
.recall-register-table th,
.recall-register-table td { padding:9px 10px;vertical-align:middle; }
.row-today { background:#fffbeb; }
.recall-phone-link { display:inline-flex;align-items:center;gap:5px;color:#0f766e;font-weight:750;text-decoration:none;white-space:nowrap; }
.recall-phone-link .ui-icon { width:14px;height:14px; }
.recall-type-chip { display:inline-flex;padding:5px 8px;border-radius:999px;background:#eef6f3;color:#315e57;font-size:9.5px;font-weight:800; }
.recall-notes-text { max-width:250px;display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#5b706b;line-height:1.35; }
.recall-status-form { display:flex;align-items:center;gap:6px;min-width:190px; }
.recall-status-form select { min-height:34px;padding:6px 8px;font-size:10px; }

.invoice-installment-link { display:grid;gap:3px;text-decoration:none; }
.invoice-installment-link small { color:#687d78;font-size:8.5px; }
.installment-plan-status-active { color:#0f6e62;background:#e5f5f0; }
.installment-plan-status-completed { color:#18743d;background:#e9f7ed; }
.installment-plan-status-cancelled { color:#a23d3a;background:#fdeceb; }
.installment-status-pending { color:#536b65;background:#edf2f0; }
.installment-status-partially_paid { color:#9a650e;background:#fff4dc; }
.installment-status-paid { color:#13753d;background:#e7f6ec; }
.installment-status-overdue { color:#ac3936;background:#feeceb; }
.installment-status-cancelled { color:#6c7471;background:#edf0ef; }

.installment-plan-list { display:grid;gap:14px; }
.installment-plan-card { padding:0;overflow:hidden;border-color:#d8e7e2; }
.installment-plan-overdue { border-color:#efc0bd;box-shadow:0 12px 30px rgba(166,55,49,.08); }
.installment-plan-header {
    display:grid;
    grid-template-columns:minmax(230px,1.15fr) minmax(480px,2.2fr) auto;
    align-items:center;
    gap:16px;
    padding:15px 17px 12px;
    background:linear-gradient(180deg,#fff,#f9fcfb);
}
.installment-patient-block { display:flex;align-items:center;gap:10px;min-width:0; }
.installment-avatar { width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;border-radius:12px;color:#fff;background:linear-gradient(145deg,#279884,#0f766e);font-size:12px;font-weight:900; }
.installment-patient-block div { min-width:0;display:grid;gap:2px; }
.installment-patient-block a { color:#173f39;text-decoration:none; }
.installment-patient-block strong { font-size:13px; }
.installment-patient-block small { color:#72857f;font-size:9px; }
.installment-plan-facts { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px; }
.installment-plan-facts > div { min-width:0;padding:8px 10px;border:1px solid #e1ece8;border-radius:10px;background:#fff; }
.installment-plan-facts small { display:block;color:#7b8e89;font-size:8px;text-transform:uppercase;font-weight:800;letter-spacing:.04em; }
.installment-plan-facts strong { display:block;margin-top:2px;color:#244c46;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.installment-plan-status { display:flex;align-items:flex-end;flex-direction:column;gap:5px; }
.installment-progress { height:6px;margin:0 17px;border-radius:999px;background:#e7efec;overflow:hidden; }
.installment-progress span { display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#1c9a83,#0f766e); }
.installment-progress-label { display:flex;justify-content:space-between;padding:5px 17px 11px;color:#72857f;font-size:8.5px; }
.installment-table-wrap { border-top:1px solid #e4edea;border-bottom:1px solid #e4edea; }
.installment-table { min-width:1160px; }
.installment-table thead th { background:#eef6f3; }
.installment-table th,
.installment-table td { padding:8px 9px;vertical-align:middle; }
.installment-row-actions { display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:250px; }
.installment-action-menu { position:relative; }
.installment-action-menu > summary { list-style:none;cursor:pointer; }
.installment-action-menu > summary::-webkit-details-marker { display:none; }
.installment-inline-form {
    position:absolute;
    right:0;
    top:calc(100% + 6px);
    z-index:30;
    width:390px;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:12px;
    border:1px solid #cfdfda;
    border-radius:13px;
    background:#fff;
    box-shadow:0 18px 45px rgba(20,58,53,.18);
}
.installment-inline-form label { display:grid;gap:4px; }
.installment-inline-form label span { color:#6e817c;font-size:8px;font-weight:800;text-transform:uppercase; }
.installment-inline-form input,
.installment-inline-form select { min-height:34px;padding:6px 8px;font-size:10px; }
.installment-inline-form .installment-notes-field { grid-column:span 2; }
.installment-inline-form button { align-self:end; }
.installment-payment-history { position:relative; }
.installment-payment-history > summary { display:inline-flex;align-items:center;gap:4px;cursor:pointer;color:#496761;font-size:9px;font-weight:800; }
.installment-payment-history > summary .ui-icon { width:13px;height:13px; }
.installment-payment-history > div { position:absolute;right:0;top:calc(100% + 6px);z-index:31;width:260px;padding:10px;border:1px solid #d5e2de;border-radius:11px;background:#fff;box-shadow:0 14px 36px rgba(20,58,53,.16); }
.installment-payment-history p,
.invoice-installment-evidence p { margin:0;padding:7px 0;border-bottom:1px solid #edf2f0;display:grid;gap:2px; }
.installment-payment-history p:last-child,
.invoice-installment-evidence p:last-child { border-bottom:0; }
.installment-payment-history small,
.invoice-installment-evidence small { color:#768984;font-size:8.5px; }
.installment-plan-footer { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 17px;background:#fbfdfc;color:#71837f;font-size:9px; }
.invoice-installment-evidence summary { cursor:pointer;color:#0f766e;font-weight:800;font-size:9px; }
.invoice-installment-evidence > div { min-width:200px;margin-top:6px;padding:8px;border:1px solid #dce8e4;border-radius:9px;background:#fff; }

@media (max-width:1250px) {
    .recall-filter-grid,.installment-filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .installment-plan-header { grid-template-columns:1fr; }
    .installment-plan-status { align-items:flex-start;flex-direction:row; }
}
@media (max-width:900px) {
    .recall-kpi-grid,.installment-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .recall-filter-grid,.installment-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .recall-search-field,.installment-search-field { grid-column:span 2; }
    .installment-plan-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
    .recall-kpi-grid,.installment-kpi-grid,
    .recall-filter-grid,.installment-filter-grid { grid-template-columns:1fr; }
    .recall-search-field,.installment-search-field { grid-column:auto; }
    .installment-plan-facts { grid-template-columns:1fr 1fr; }
    .installment-inline-form { position:fixed;left:12px;right:12px;bottom:12px;top:auto;width:auto; }
    .installment-plan-footer { align-items:flex-start;flex-direction:column; }
}

/* Reliable in-table installment forms: expand the row instead of being clipped
   by the horizontally scrollable financial register. */
.installment-inline-form {
    position: static;
    margin-top: 7px;
    width: 420px;
    max-width: calc(100vw - 90px);
    box-shadow: 0 8px 24px rgba(20,58,53,.10);
}
.installment-payment-history > div {
    position: static;
    margin-top: 7px;
    width: 280px;
    max-width: calc(100vw - 90px);
    box-shadow: 0 8px 24px rgba(20,58,53,.10);
}
.invoice-register-table { min-width: 1360px; }

/* ========================================================================
   DentalPro 3.5.3 — compact calendar navigation and light current day
   ======================================================================== */
.calendar-toolbar-five-days {
    min-height: 42px;
    padding: 5px 10px;
    justify-content: flex-end;
    background: #fff;
}
.calendar-date-navigation-compact {
    width: auto;
    margin-left: auto;
    display: grid;
    grid-template-columns: 30px auto 30px;
    align-items: center;
    gap: 5px;
}
.calendar-date-navigation-compact .calendar-nav-arrow {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    box-shadow: none;
}
.calendar-date-navigation-compact .calendar-current-date {
    min-width: 132px;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 9px;
    box-shadow: none;
    background: #f7fbf9;
}
.calendar-date-navigation-compact .calendar-current-date strong {
    margin: 0;
    color: #24574f;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}
.calendar-day-header.is-today {
    color: #24574f !important;
    border-color: #cfe7df !important;
    background: #eef9f5 !important;
    box-shadow: inset 0 2px 0 #70c5b3 !important;
}
.calendar-day-header.is-today strong {
    color: #1f5a50 !important;
}
.calendar-day-header.is-today span,
.calendar-day-header.is-today small {
    color: #5f7f78 !important;
}
.calendar-slot.is-today {
    background: #f6fcf9 !important;
}
@media (max-width: 680px) {
    .calendar-toolbar-five-days { min-height: 40px; padding: 4px 7px; }
    .calendar-date-navigation-compact { grid-template-columns: 28px auto 28px; }
    .calendar-date-navigation-compact .calendar-nav-arrow { width: 28px; height: 28px; }
    .calendar-date-navigation-compact .calendar-current-date { min-width: 118px; min-height: 28px; padding-inline: 7px; }
    .calendar-date-navigation-compact .calendar-current-date strong { font-size: 10px; }
}

/* DentalPro 3.6.1 — compact professional five-day appointment register */
.appointments-five-page { display:grid;gap:11px; }
.appointments-five-toolbar {
    min-height:74px;
    padding:11px 13px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    border-color:#dce9e5;
}
.appointments-five-heading { min-width:0;display:flex;align-items:center;gap:10px; }
.appointments-five-heading .section-icon { width:38px;height:38px;border-radius:11px; }
.appointments-five-heading h2 { margin:0;color:#1d4942;font-size:15px;line-height:1.15; }
.appointments-five-heading p:last-child { margin:2px 0 0;color:#7a8e88;font-size:9px; }
.appointments-five-controls { display:flex;align-items:end;justify-content:flex-end;gap:10px; }
.appointments-five-dentist-filter { margin:0; }
.appointments-five-dentist-filter .field { min-width:190px; }
.appointments-five-dentist-filter .field > span { font-size:8px; }
.appointments-five-dentist-filter select { min-height:34px;padding:5px 30px 5px 9px;font-size:9.5px; }
.appointments-five-navigation { display:flex;align-items:center;gap:4px;padding:3px;border:1px solid #dbe8e4;border-radius:10px;background:#f7fbf9; }
.appointments-five-navigation .icon-action { width:31px;height:31px;border-radius:8px; }
.appointments-five-today { min-width:104px;padding:3px 8px;display:grid;text-align:center;border-radius:7px;color:#315c54;text-decoration:none; }
.appointments-five-today:hover { background:#eaf6f1;color:#0f766e; }
.appointments-five-today small { color:#899a95;font-size:7px;text-transform:uppercase;font-weight:800;letter-spacing:.04em; }
.appointments-five-today strong { font-size:9.5px; }

.appointments-five-board {
    min-width:980px;
    display:grid;
    grid-template-columns:repeat(var(--appointment-days,5),minmax(0,1fr));
    gap:8px;
}
.appointments-day-column {
    min-width:0;
    overflow:hidden;
    border:1px solid #dce7e3;
    border-radius:13px;
    background:#f8fbfa;
    box-shadow:0 5px 18px rgba(25,72,63,.035);
}
.appointments-day-column.is-today { border-color:#90cdbf;background:#eef9f5;box-shadow:0 7px 22px rgba(15,118,110,.08); }
.appointments-day-column-header {
    min-height:46px;
    padding:8px 9px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:7px;
    border-bottom:1px solid #dde8e4;
    background:#fff;
}
.appointments-day-column.is-today .appointments-day-column-header { background:#def3eb; }
.appointments-day-column-header > div { display:flex;align-items:baseline;gap:5px; }
.appointments-day-column-header span { color:#738984;font-size:8px;font-weight:850;text-transform:uppercase; }
.appointments-day-column-header strong { color:#234f47;font-size:12px; }
.appointments-day-column-header > small { min-width:24px;height:24px;padding:0 6px;display:grid;place-items:center;border-radius:999px;background:#eef5f2;color:#527068;font-size:8px;font-weight:850; }
.appointments-day-column.is-today .appointments-day-column-header > small { background:#0f766e;color:#fff; }
.appointments-day-column-body { min-height:230px;padding:6px;display:grid;align-content:start;gap:5px; }
.appointments-day-empty { min-height:100px;display:grid;place-items:center;align-content:center;gap:5px;color:#9aaba6;font-size:8.5px; }
.appointments-day-empty .ui-icon { width:20px;height:20px;opacity:.58; }

.appointment-record {
    position:relative;
    min-width:0;
    padding:7px;
    display:grid;
    gap:5px;
    border:1px solid #dde8e4;
    border-left:3px solid #7fa49b;
    border-radius:9px;
    background:#fff;
    box-shadow:0 2px 8px rgba(27,68,60,.03);
    transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease;
}
.appointment-record:hover { z-index:2;border-color:#a6cfc5;transform:translateY(-1px);box-shadow:0 6px 14px rgba(25,72,63,.075); }
.appointment-record.status-scheduled,.appointment-record.status-confirmed { border-left-color:#5b8def; }
.appointment-record.status-arrived { border-left-color:#f0a43c; }
.appointment-record.status-in_progress { border-left-color:#16a085; }
.appointment-record.status-completed { border-left-color:#31a36f;background:#fbfffd; }
.appointment-record.status-cancelled,.appointment-record.status-no_show { border-left-color:#db6975;background:#fffafa;opacity:.78; }
.appointment-record-topline { display:flex;align-items:center;justify-content:space-between;gap:5px; }
.appointment-record-topline time { color:#194f45;font-size:11px;font-weight:900;line-height:1; }
.appointment-record-status { width:23px;height:23px;display:grid;place-items:center;border-radius:7px; }
.appointment-record-status .ui-icon { width:12px;height:12px; }
.appointment-record-patient { min-width:0;display:grid;gap:1px; }
.appointment-record-patient strong { overflow:hidden;color:#244b45;font-size:9.5px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap; }
.appointment-record-patient small { overflow:hidden;color:#899a95;font-size:7.5px;text-overflow:ellipsis;white-space:nowrap; }
.appointment-record-meta { min-width:0;display:grid;grid-template-columns:1fr 1fr;gap:3px; }
.appointment-record-meta span { min-width:0;padding:3px 4px;display:flex;align-items:center;gap:3px;border-radius:6px;background:#f4f8f6;color:#6a817b; }
.appointment-record-meta .ui-icon { width:10px;height:10px;flex:0 0 auto;color:#2a7c6e; }
.appointment-record-meta em { min-width:0;overflow:hidden;font-size:7.5px;font-style:normal;text-overflow:ellipsis;white-space:nowrap; }
.appointment-record-summary { margin:0;overflow:hidden;color:#6f837e;font-size:7.8px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap; }
.appointment-record-actions { padding-top:4px;display:flex;align-items:center;justify-content:flex-end;gap:3px;border-top:1px solid #edf2f0; }
.appointment-record-actions form { margin:0;display:flex; }
.appointment-record-actions .icon-action { width:25px;height:25px;border-radius:7px; }
.appointment-record-actions .icon-action .ui-icon { width:12px;height:12px; }
.icon-action-danger-ghost { color:#c45662;border-color:#f1d4d8;background:#fff8f9; }
.icon-action-danger-ghost:hover { color:#fff;border-color:#cf5965;background:#cf5965; }
.icon-action-danger { color:#fff;border-color:#c94e5b;background:#c94e5b; }
.icon-action-danger:hover { border-color:#ac3d49;background:#ac3d49; }

@media (max-width:1180px) {
    .appointments-five-page { overflow-x:auto; }
    .appointments-five-toolbar { min-width:980px; }
}
@media (max-width:720px) {
    .appointments-five-toolbar { align-items:flex-start;flex-direction:column; }
    .appointments-five-controls { width:100%;justify-content:space-between; }
}

/* DentalPro 3.7.1 — clean module headers */
.appointments-five-toolbar {
    min-height: 0;
    justify-content: flex-end;
}
.material-toolbar {
    min-height: 0;
    justify-content: flex-end;
}

/* DentalPro 3.7.3: invoice payment and installment control */
.invoice-payment-control { margin-top: 18px; }
.invoice-payment-control-head { align-items: flex-start; gap: 16px; }
.invoice-payment-control-head .muted { margin: 5px 0 0; }
.invoice-payment-control-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.invoice-payment-panel { border: 1px solid var(--border-color, #dfe8e3); border-radius: 14px; padding: 16px; background: #fbfdfc; }
.invoice-payment-panel-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.invoice-payment-panel-title > span { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #eaf5ef; color: #256b4b; }
.invoice-payment-panel-title small { display: block; color: var(--muted-color, #66756e); }
.invoice-payment-panel-title h3 { margin: 2px 0 0; font-size: 1rem; }
.invoice-payment-status-form .btn,
.invoice-installment-inline-form .btn { justify-self: start; }
.installment-summary-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.payment-complete-state { min-height: 120px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 12px; background: #eef8f2; color: #245f46; padding: 18px; text-align: left; }
.payment-complete-state > svg { width: 28px; height: 28px; flex: 0 0 auto; }
.payment-complete-state strong,
.payment-complete-state span { display: block; }
.payment-complete-state span { margin-top: 3px; color: #557266; font-size: .88rem; }
.invoice-payment-history { margin-top: 16px; }
@media (max-width: 1050px) {
  .invoice-payment-control-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .installment-summary-compact { grid-template-columns: 1fr; }
  .invoice-payment-panel { padding: 13px; }
}


/* DentalPro 3.7.4 — service-first clinical workspace and configurable service groups */
.module-service-groups .settings-module-icon { color:#1d6f61; background:#e7f5f1; }
.service-group-editor { min-width:0; }
.service-group-items-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:3px; }
.service-group-items { display:grid; gap:7px; max-height:300px; overflow:auto; padding-right:3px; }
.service-group-item-row { display:grid; grid-template-columns:minmax(0,1fr) 82px 34px; gap:7px; align-items:center; }
.service-group-item-row select,.service-group-item-row input { min-width:0; }

.clinical-services-primary { border-color:#b9ddd3; box-shadow:0 10px 30px rgba(23,97,82,.08); }
.clinical-services-primary-head { padding-bottom:10px; border-bottom:1px solid #dcebe7; }
.clinical-service-entry-workspace { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(300px,.85fr); gap:12px; margin:12px 0; }
.clinical-quick-service-form,.clinical-service-group-form { display:grid; gap:9px; align-items:end; padding:13px; border:1px solid #cfe5df; border-radius:13px; background:linear-gradient(145deg,#fbfefd,#eef8f5); }
.clinical-quick-service-form { grid-template-columns:minmax(220px,2fr) 76px 90px 70px 105px 90px auto; }
.clinical-service-group-form { grid-template-columns:minmax(0,1fr) 110px auto; }
.quick-service-title { grid-column:1/-1; display:flex; align-items:center; gap:8px; color:#245d52; }
.quick-service-title>span { display:grid; place-items:center; width:32px; height:32px; border-radius:9px; color:#176b5a; background:#dff1ec; }
.quick-service-title .ui-icon { width:16px; height:16px; }
.quick-service-title small,.quick-service-title strong { display:block; }
.quick-service-title small { color:#748a83; font-size:8px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.quick-service-title strong { margin-top:1px; font-size:12px; }
.quick-service-main,.service-group-main { min-width:0; }
.quick-service-submit { min-width:96px; }
.service-group-empty { grid-column:1/-1; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px; border-radius:9px; color:#6d807a; background:#fff; }
.service-group-empty a { color:#166d5c; font-weight:800; }

.clinical-odontogram-compact { padding:10px 12px; }
.clinical-odontogram-compact .card-header { margin-bottom:2px; }
.clinical-odontogram-compact .odontogram-chart { grid-template-columns:repeat(16,minmax(34px,1fr)); gap:4px; padding:7px 0 2px; }
.clinical-odontogram-compact .odontogram-tooth { min-height:46px; padding:3px 2px; border-radius:7px; }
.clinical-odontogram-compact .odontogram-tooth .tooth-shape { min-height:18px; }
.clinical-odontogram-compact .odontogram-tooth .tooth-shape .ui-icon { width:16px; height:16px; }
.clinical-odontogram-compact .odontogram-tooth strong { font-size:8px; }
.clinical-odontogram-compact .odontogram-tooth small { display:none; }
.clinical-odontogram-compact .tooth-edit-hint { transform:scale(.75); }
.clinical-center-embedded .clinical-odontogram-compact .odontogram-chart { grid-template-columns:repeat(16,minmax(28px,1fr)); gap:3px; }
.clinical-center-embedded .clinical-odontogram-compact .odontogram-tooth { min-height:39px; padding:2px 1px; }
.clinical-center-embedded .clinical-odontogram-compact .odontogram-tooth .tooth-shape { min-height:15px; }
.clinical-center-embedded .clinical-odontogram-compact .odontogram-tooth .tooth-shape .ui-icon { width:14px; height:14px; }

@media (max-width:1250px) {
  .clinical-service-entry-workspace { grid-template-columns:1fr; }
  .clinical-quick-service-form { grid-template-columns:minmax(240px,2fr) repeat(5,minmax(70px,1fr)) auto; }
}
@media (max-width:900px) {
  .clinical-quick-service-form,.clinical-service-group-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quick-service-main,.service-group-main,.quick-service-title { grid-column:1/-1; }
  .quick-service-submit,.clinical-service-group-form .btn { width:100%; }
  .clinical-odontogram-compact .odontogram-chart,.clinical-center-embedded .clinical-odontogram-compact .odontogram-chart { grid-template-columns:repeat(8,minmax(34px,1fr)); }
}

/* DentalPro 3.7.5 — compact appointment header and teeth-first clinical flow */
.clinical-center-modal-shell { grid-template-rows: 70px minmax(0, 1fr); }
.clinical-center-modal-header { gap: 18px; }
.clinical-center-patient-heading { min-width: 0; display: flex; align-items: center; gap: 11px; }
.clinical-center-patient-copy { min-width: 0; }
.clinical-center-patient-copy h2 {
    margin: 0;
    overflow: hidden;
    color: #193f38;
    font-size: 16px;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clinical-center-appointment-time {
    display: block;
    margin-top: 4px;
    color: #6d837c;
    font-size: 10px;
    font-weight: 750;
}
.clinical-center-header-right {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.clinical-center-appointment-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(105px, auto));
    gap: 7px;
}
.clinical-center-appointment-meta[hidden] { display: none; }
.clinical-center-appointment-meta > span {
    min-width: 0;
    padding: 6px 9px;
    border: 1px solid #d8e7e2;
    border-radius: 9px;
    background: #f6faf8;
}
.clinical-center-appointment-meta small,
.clinical-center-appointment-meta strong { display: block; }
.clinical-center-appointment-meta small {
    color: #81928d;
    font-size: 7px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.clinical-center-appointment-meta strong {
    margin-top: 1px;
    overflow: hidden;
    color: #315b52;
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clinical-center-embedded .clinical-odontogram-compact { margin-top: 0; }

@media (max-width: 980px) {
    .clinical-center-modal-shell { grid-template-rows: auto minmax(0, 1fr); }
    .clinical-center-modal-header { min-height: 72px; align-items: flex-start; }
    .clinical-center-header-right { align-items: flex-start; }
    .clinical-center-appointment-meta { grid-template-columns: repeat(3, minmax(82px, 1fr)); }
}
@media (max-width: 720px) {
    .clinical-center-modal-header { padding: 8px 10px; }
    .clinical-center-patient-avatar,
    .clinical-center-patient-photo { width: 36px; min-width: 36px; height: 36px; }
    .clinical-center-patient-copy h2 { font-size: 13px; }
    .clinical-center-appointment-time { font-size: 8px; }
    .clinical-center-appointment-meta { grid-template-columns: repeat(3, minmax(66px, 1fr)); gap: 4px; }
    .clinical-center-appointment-meta > span { padding: 4px 6px; }
}


/* DentalPro 3.7.6 — reliable appointment header and compact allergy alert */
.clinical-center-patient-title-row,
.clinical-page-patient-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.clinical-center-patient-title-row h2,
.clinical-page-patient-title h2 { min-width: 0; }
.patient-allergy-indicator {
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border: 1px solid;
    border-radius: 999px;
    font: inherit;
    font-size: 8px;
    font-weight: 850;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.patient-allergy-indicator:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(31,56,49,.10); }
.patient-allergy-indicator.has-allergy {
    color: #a72d2d;
    border-color: #f0b1b1;
    background: #fff0f0;
}
.patient-allergy-indicator.is-clear {
    color: #176b4f;
    border-color: #b8dfcf;
    background: #eef9f4;
}
.allergy-indicator-icon { display: inline-grid; place-items: center; }
.allergy-indicator-icon .ui-icon { width: 12px; height: 12px; }
.has-allergy .allergy-indicator-clear,
.is-clear .allergy-indicator-alert { display: none; }
.allergy-detail-dialog { width: min(520px, calc(100vw - 24px)); }
.allergy-detail-card { width: 100%; }
.allergy-detail-body { display: grid; gap: 12px; }
.allergy-detail-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 11px;
}
.allergy-detail-status.has-allergy { color: #9d2929; border-color: #efb4b4; background: #fff1f1; }
.allergy-detail-status.is-clear { color: #176b4f; border-color: #b8dfcf; background: #eef9f4; }
.allergy-detail-content {
    min-height: 86px;
    padding: 13px;
    border: 1px solid #dde9e5;
    border-radius: 11px;
    color: #344f48;
    background: #fbfdfc;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}
@media (max-width: 720px) {
    .clinical-center-modal-shell { grid-template-rows: auto minmax(0, 1fr); }
    .clinical-center-modal-header { flex-wrap: wrap; }
    .clinical-center-patient-heading { flex: 1 1 100%; }
    .clinical-center-header-right { width: 100%; justify-content: space-between; }
    .clinical-center-appointment-meta { flex: 1; }
    .patient-allergy-indicator { padding: 3px 6px; font-size: 7px; }
}

/* DentalPro 3.7.7 — unified service/group entry and service-driven finance */
.clinical-service-entry-unified {
    display: block;
}
.clinical-unified-service-form {
    grid-template-columns: minmax(320px, 2.5fr) 72px 88px 72px 110px 88px auto;
    width: 100%;
}
.clinical-unified-service-form .quick-service-main {
    min-width: 280px;
}
.clinical-unified-service-form select,
.clinical-unified-service-form input {
    min-width: 0;
}
.clinical-unified-service-form input[readonly] {
    color: #355f57;
    background: #eef6f3;
    cursor: not-allowed;
}
.unified-service-hint {
    grid-column: 1 / -1;
    color: #71847e;
    font-size: 9px;
    line-height: 1.35;
}
.clinical-services-table-wrap,
.clinical-finance-services-wrap {
    overflow-x: auto;
}
.clinical-services-table,
.clinical-finance-services-table {
    width: max-content;
    min-width: 100%;
}
.clinical-services-table th,
.clinical-services-table td,
.clinical-finance-services-table th,
.clinical-finance-services-table td {
    white-space: nowrap;
    vertical-align: middle;
}
.service-one-line {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.service-one-line span {
    color: #73857f;
    font-size: .92em;
}
.clinical-finance-stats-services {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.clinical-finance-service-ledger,
.clinical-finance-invoices {
    margin-top: 16px;
}
.clinical-finance-service-ledger h3,
.clinical-finance-invoices h3 {
    margin: 0 0 9px;
    color: #214f46;
    font-size: 13px;
}
@media (max-width: 1250px) {
    .clinical-unified-service-form {
        grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(70px, 1fr)) auto;
    }
    .clinical-finance-stats-services {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .clinical-unified-service-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .clinical-unified-service-form .quick-service-main,
    .clinical-unified-service-form .unified-service-hint {
        grid-column: 1 / -1;
    }
    .clinical-unified-service-form .quick-service-submit {
        width: 100%;
    }
    .clinical-finance-stats-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* DentalPro 3.7.8 — compact service actions and inline invoice payment state */
.clinical-service-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 5px;
    min-width: 68px;
    white-space: nowrap;
}
.clinical-service-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.clinical-services-table th:last-child,
.clinical-services-table td:last-child {
    width: 82px;
    min-width: 82px;
    text-align: center;
}
.clinical-finance-stats-services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.invoice-quick-payment-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.invoice-quick-payment-select {
    width: 138px;
    min-width: 138px;
    height: 32px;
    padding: 4px 28px 4px 9px;
    border: 1px solid #ccddd8;
    border-radius: 9px;
    font-size: 9.5px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .15s ease, box-shadow .15s ease;
}
.invoice-quick-payment-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(35, 126, 108, .12);
}
.invoice-quick-payment-select.is-loading {
    opacity: .55;
    pointer-events: none;
}
@media (max-width: 900px) {
    .clinical-finance-stats-services { grid-template-columns: 1fr; }
}

/* DentalPro 3.7.9 — patient finance payment filters */
.clinical-finance-ledger-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.clinical-finance-ledger-head h3,
.clinical-finance-ledger-head p {
    margin: 0;
}
.clinical-finance-payment-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid #d8e5e1;
    border-radius: 11px;
    background: #f6faf8;
}
.clinical-finance-payment-filters a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 8px;
    color: #49665f;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
.clinical-finance-payment-filters a:hover,
.clinical-finance-payment-filters a.is-active {
    color: #164f43;
    background: #fff;
    box-shadow: 0 2px 8px rgba(28, 79, 67, .10);
}
.badge-warning {
    color: #78520b;
    background: #fff4d8;
    border-color: #f0d795;
}
@media (max-width: 720px) {
    .clinical-finance-ledger-head {
        align-items: stretch;
        flex-direction: column;
    }
    .clinical-finance-payment-filters {
        width: 100%;
    }
    .clinical-finance-payment-filters a {
        flex: 1;
    }
}

/* DentalPro 3.8.0 — patient financial profile and payment entry */
.patient-balance-stats > div {
    position: relative;
    overflow: hidden;
}
.patient-payment-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 16px;
    margin: 16px 0;
}
.patient-payment-form,
.patient-payment-history {
    min-width: 0;
    padding: 16px;
    border: 1px solid #dce8e4;
    border-radius: 16px;
    background: #fbfdfc;
}
.patient-payment-form-head,
.patient-payment-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.patient-payment-form-head h3,
.patient-payment-history-head h3,
.patient-payment-form-head p,
.patient-payment-history-head p {
    margin: 0;
}
.patient-payment-form-head p,
.patient-payment-history-head p {
    margin-top: 3px;
    color: #72877f;
    font-size: 11px;
}
.patient-payment-available {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid #cfe2dc;
    border-radius: 10px;
    color: #375e55;
    background: #f1f8f5;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.patient-payment-available strong {
    color: #176353;
}
.patient-payment-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.patient-payment-notes {
    grid-column: span 2;
}
.patient-payment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2ece8;
}
.patient-payment-form-actions small {
    max-width: 62%;
    color: #6b8179;
    line-height: 1.45;
}
.patient-payment-empty-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid #cfe5d7;
    border-radius: 11px;
    color: #276245;
    background: #f0faf4;
    font-size: 12px;
    font-weight: 700;
}
.patient-payment-history-head > strong {
    color: #176353;
    font-size: 18px;
    white-space: nowrap;
}
.patient-payment-table {
    min-width: 620px;
}
.patient-payment-table th,
.patient-payment-table td {
    padding: 9px 10px;
    white-space: nowrap;
}
.patient-payment-table td:last-child,
.patient-payment-table th:last-child {
    text-align: right;
}
@media (max-width: 1050px) {
    .patient-payment-workspace {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .patient-payment-form-head,
    .patient-payment-history-head,
    .patient-payment-form-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .patient-payment-available {
        white-space: normal;
    }
    .patient-payment-fields {
        grid-template-columns: 1fr;
    }
    .patient-payment-notes {
        grid-column: auto;
    }
    .patient-payment-form-actions small {
        max-width: none;
    }
}

/* DentalPro 3.8.3 — patient financial frame */
.patient-function-finance-frame {
    background: linear-gradient(145deg,#f6fffb 0%,#edf9f3 100%);
    border-color: #bfdfd1;
}
.patient-function-finance-frame .patient-function-icon {
    color: #176353;
    background: #dff4e9;
}
.patient-function-finance-frame .patient-function-metric { color: #176353; }

.patient-financial-frame-dialog {
    width: min(1540px,calc(100vw - 28px));
    height: min(920px,calc(100dvh - 28px));
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    background: #f4f8f6;
}
.patient-financial-frame-dialog[open] { display: block; }
.patient-financial-frame-shell { height: 100%; display: flex; flex-direction: column; }
.patient-financial-frame-header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid #dce9e3;
    background: #fff;
}
.patient-financial-frame { width: 100%; min-height: 0; flex: 1; border: 0; background: #f4f8f6; }

.patient-finance-shell { display: grid; gap: 14px; padding: 14px; }
.patient-finance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 17px;
}
.patient-finance-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.patient-finance-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg,#1c7664,#155a4c);
    font-weight: 800;
}
.patient-finance-identity h2 { margin: 2px 0 3px; font-size: 20px; }
.patient-finance-identity p:last-child { margin: 0; color: #70827a; font-size: 12px; }
.patient-finance-header-actions { display: flex; align-items: end; gap: 10px; }
.patient-finance-month-filter .field { min-width: 210px; margin: 0; }
.patient-finance-month-filter .field span { font-size: 10px; }

.patient-finance-global-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 10px;
}
.patient-finance-stat {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dce9e3;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24,74,60,.055);
}
.patient-finance-stat > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border-radius: 12px;
    color: #176353;
    background: #e8f6ef;
}
.patient-finance-stat small,
.patient-finance-period-grid small { display: block; color: #71837b; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.patient-finance-stat strong { display: block; margin-top: 4px; color: #173b32; font-size: 18px; }
.patient-finance-stat.is-debt { border-color: #efc8c8; background: #fffafa; }
.patient-finance-stat.is-debt > span { color: #a63a3a; background: #fdeaea; }
.patient-finance-stat.is-debt strong { color: #9e3030; }
.patient-finance-stat.is-clear { border-color: #cce7d7; }

.patient-finance-period,
.patient-finance-ledger { padding: 15px; }
.patient-finance-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.patient-finance-section-heading h3 { margin: 2px 0 0; font-size: 17px; }
.patient-finance-section-heading > strong { color: #176353; }
.patient-finance-period-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 10px;
}
.patient-finance-period-grid > div {
    padding: 13px;
    border: 1px solid #e1ebe6;
    border-radius: 12px;
    background: #fbfdfc;
}
.patient-finance-period-grid strong { display: block; margin-top: 5px; color: #173b32; font-size: 19px; }
.patient-finance-period-grid em { display: block; margin-top: 3px; color: #77877f; font-size: 10px; font-style: normal; }
.patient-finance-period-grid .is-debt strong { color: #a33a3a; }
.patient-finance-period-grid .is-credit strong,
.patient-finance-period-grid .is-clear strong { color: #176353; }

.patient-finance-table { min-width: 1040px; }
.patient-finance-table th,
.patient-finance-table td { padding: 9px 10px; white-space: nowrap; }
.patient-finance-table td:nth-child(2) small { display: block; color: #7b8a84; font-size: 10px; }
.patient-finance-table td:nth-last-child(-n+4),
.patient-finance-table th:nth-last-child(-n+4) { text-align: right; }
.patient-finance-table td:last-child,
.patient-finance-table th:last-child { text-align: left; }

.patient-finance-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.patient-finance-list { display: grid; gap: 7px; }
.patient-finance-list > article {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 11px;
    border: 1px solid #e1ebe6;
    border-radius: 11px;
    background: #fbfdfc;
}
.patient-finance-list article > div:first-child { min-width: 0; }
.patient-finance-list strong { color: #1a3d34; }
.patient-finance-list small,
.patient-finance-list em { display: block; margin-top: 3px; color: #71827a; font-size: 10px; font-style: normal; }
.patient-finance-list-values { text-align: right; white-space: nowrap; }
.patient-finance-list-values span { font-weight: 800; }
.patient-finance-list-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.patient-finance-payment-list > article { grid-template-columns: minmax(0,1fr) auto; }
.patient-finance-payment-amount { color: #176353; font-size: 15px; font-weight: 800; white-space: nowrap; }
.patient-finance-clear-note { margin: 0; }

.patient-finance-payment-dialog { width: min(620px,calc(100vw - 24px)); }
.patient-payment-balance-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #d6e8df;
    border-radius: 12px;
    background: #f1faf5;
}
.patient-payment-balance-note > span { color: #176353; }
.patient-payment-balance-note small { display: block; color: #71827a; font-size: 10px; }
.patient-payment-balance-note strong { display: block; margin-top: 2px; color: #176353; font-size: 18px; }

@media (max-width: 1100px) {
    .patient-finance-global-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .patient-finance-two-column { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .patient-financial-frame-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
    .patient-financial-frame-header { min-height: 64px; }
    .patient-finance-shell { padding: 9px; }
    .patient-finance-header,
    .patient-finance-header-actions { align-items: stretch; flex-direction: column; }
    .patient-finance-header-actions .btn { justify-content: center; }
    .patient-finance-month-filter .field { min-width: 0; }
    .patient-finance-global-grid,
    .patient-finance-period-grid { grid-template-columns: 1fr; }
    .patient-finance-list > article { grid-template-columns: 1fr; }
    .patient-finance-list-values { text-align: left; }
}


/* 3.8.4 tabbed service picker and simplified financial frame */
.service-picker { display:grid; gap:7px; }
.service-picker-tabs { display:flex; gap:5px; padding:3px; width:max-content; max-width:100%; border:1px solid #d8e7e1; border-radius:10px; background:#f5faf8; }
.service-picker-tabs button { border:0; border-radius:8px; padding:7px 11px; background:transparent; color:#667b73; font-weight:800; cursor:pointer; }
.service-picker-tabs button.is-active { background:#fff; color:#176353; box-shadow:0 2px 8px rgba(35,91,77,.10); }
.service-picker-single-control { display:grid; grid-template-columns:minmax(170px,.72fr) minmax(260px,1.28fr); gap:7px; }
.service-picker-single-control input,.service-picker-single-control select { width:100%; min-width:0; }
.patient-finance-simple-header { min-height:auto; }
.patient-finance-simple-header>h2 { margin:0; font-size:20px; color:#183f35; }
.patient-finance-service-status-table { min-width:1050px; }
.patient-finance-service-status-table th:last-child,.patient-finance-service-status-table td:last-child { text-align:left; }
.patient-finance-print .invoice-header h1 { margin:0; letter-spacing:.08em; }
@media(max-width:760px){.service-picker-single-control{grid-template-columns:1fr}.patient-finance-simple-header>h2{font-size:17px}}
@media print { .patient-finance-print { box-shadow:none!important; border:0!important; } }

.patient-finance-simple-header.is-embedded { justify-content:flex-end; border:0; box-shadow:none; padding:0; background:transparent; }
.patient-financial-frame-header-simple h2 { margin:0; font-size:18px; color:#173b32; }

/* 3.8.5 patient service viewer and finance actions */
.patient-services-view-dialog { width:min(1420px,96vw); max-width:none; }
.patient-services-view-card { width:100%; max-height:92vh; }
.patient-services-view-card .modal-body { overflow:auto; }
.patient-services-view-table { min-width:1080px; }
.patient-services-view-table th,
.patient-services-view-table td { white-space:nowrap; }
.patient-services-view-table td:nth-child(2) { min-width:260px; white-space:normal; }
.patient-services-view-table td:nth-child(2) small { display:block; margin-top:3px; color:#788982; font-size:10px; }
.patient-finance-row-actions { display:flex; align-items:center; gap:6px; flex-wrap:nowrap; white-space:nowrap; }
.patient-finance-row-actions form { margin:0; display:inline-flex; }
.patient-finance-payment-dialog-small { width:min(430px,calc(100vw - 24px)); }
.payment-auto-status { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid #cfe8dc; border-radius:12px; background:#f0faf5; color:#176353; }
.payment-auto-status small { display:block; color:#6d8178; font-size:10px; }
.payment-auto-status strong { display:block; margin-top:2px; color:#176353; }
@media(max-width:760px){
  .patient-services-view-dialog{width:100vw;height:100dvh;border-radius:0}
  .patient-finance-row-actions{align-items:stretch;flex-direction:column}
  .patient-finance-row-actions .btn{justify-content:center}
}


/* 3.8.6 one service dropdown and complete patient finance frame */
.patient-finance-heading-totals { display:flex; align-items:flex-end; gap:10px; flex-direction:column; }
.patient-finance-heading-totals span { color:#6d8079; font-size:12px; font-weight:800; }
.patient-finance-heading-totals strong { color:#173f35; font-size:20px; }
.patient-finance-group-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:8px; margin:12px 0 14px; }
.patient-finance-group-summary article { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:9px; padding:10px 11px; border:1px solid #d8e9e3; border-radius:11px; background:#f7fbfa; }
.patient-finance-group-summary article div { min-width:0; display:grid; gap:2px; }
.patient-finance-group-summary article strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#214c41; }
.patient-finance-group-summary article small { color:#71837d; }
.patient-finance-group-summary article b { white-space:nowrap; color:#176353; }
.patient-finance-all-services-table { min-width:1210px; }
.patient-finance-all-services-table tr.is-group-service { background:linear-gradient(90deg,rgba(232,246,242,.72),rgba(255,255,255,0) 36%); }
.finance-group-name { display:block; max-width:150px; margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#4d7167; font-weight:700; }
@media(max-width:760px){.patient-finance-heading-totals{align-items:flex-start}.patient-finance-group-summary{grid-template-columns:1fr}}

/* 3.8.7 service-level Paid / Unpaid status */
.service-payment-status-form { margin:0; min-width:132px; }
.service-payment-status-select {
    width:100%;
    min-width:126px;
    height:34px;
    padding:5px 30px 5px 10px;
    border-radius:9px;
    font-size:12px;
    font-weight:800;
    cursor:pointer;
}
.service-payment-status-select.is-paid {
    color:#176353;
    border-color:#b9ddcc;
    background-color:#edf9f3;
}
.service-payment-status-select.is-unpaid {
    color:#9a3f35;
    border-color:#efc9c3;
    background-color:#fff5f3;
}
.patient-finance-simple > .patient-finance-ledger { margin-top:0; }

/* DentalPro 3.9.0 — patient payments and separate material catalog */
.payment-kpi-grid,
.inventory-overview-grid,
.material-catalog-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.inventory-overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.payment-kpi-card,
.inventory-overview-card,
.material-catalog-summary > article {
    min-height: 112px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #dce9e5;
    border-radius: 18px;
    background: linear-gradient(145deg, #ffffff 0%, #f7fbfa 100%);
    box-shadow: 0 12px 30px rgba(22, 73, 64, .08);
}
.payment-kpi-icon,
.inventory-overview-card > span,
.material-catalog-summary > article > span {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    color: #0f766e;
    border-radius: 14px;
    background: #e7f5f1;
}
.payment-kpi-icon .ui-icon,
.inventory-overview-card > span .ui-icon,
.material-catalog-summary > article > span .ui-icon { width: 23px; height: 23px; }
.payment-kpi-card div,
.inventory-overview-card div,
.material-catalog-summary > article div { display: grid; gap: 4px; }
.payment-kpi-card small,
.inventory-overview-card small,
.material-catalog-summary small { color: #667d76; font-size: 11px; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.payment-kpi-card strong,
.inventory-overview-card strong,
.material-catalog-summary strong { color: #173f39; font-size: 25px; line-height: 1.05; }
.payment-kpi-card p,
.inventory-overview-card p { margin: 0; color: #7b8d87; font-size: 12px; }
.payment-kpi-success .payment-kpi-icon { color: #087a55; background: #e8f8f1; }
.payment-kpi-danger .payment-kpi-icon,
.inventory-overview-card.is-alert > span { color: #b53e3e; background: #fff0f0; }

.payment-filter-card { margin-bottom: 16px; }
.payment-filter-form,
.material-catalog-filters {
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(210px, 1.2fr) minmax(150px, .8fr) minmax(145px, .7fr) minmax(145px, .7fr) auto;
    gap: 12px;
    align-items: end;
}
.material-catalog-filters { grid-template-columns: minmax(260px, 1.5fr) minmax(190px, 1fr) minmax(170px, .8fr) auto; }
.payment-filter-actions,
.material-catalog-filter-actions { display: flex; gap: 8px; align-items: center; }
.patient-payments-register > .card-header,
.material-catalog-card > .card-header { padding-bottom: 14px; }
.payment-receivable-list { display: grid; gap: 12px; padding: 0 16px 16px; }
.payment-receivable-card {
    overflow: hidden;
    border: 1px solid #dbe8e4;
    border-radius: 16px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.payment-receivable-card[open] { border-color: #9ccfc2; box-shadow: 0 14px 34px rgba(18, 77, 66, .1); }
.payment-receivable-card > summary {
    min-height: 86px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 46px minmax(220px, 1fr) auto minmax(105px, auto) minmax(105px, auto) 24px;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    list-style: none;
}
.payment-receivable-card > summary::-webkit-details-marker { display: none; }
.payment-patient-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #0b675f;
    border: 1px solid #bfe2d9;
    border-radius: 14px;
    background: #edf8f5;
    font-size: 14px;
    font-weight: 900;
}
.payment-receivable-main,
.payment-receivable-amount,
.payment-receivable-balance { display: grid; gap: 4px; }
.payment-receivable-main strong { color: #173f39; font-size: 15px; }
.payment-receivable-main small,
.payment-receivable-amount small,
.payment-receivable-balance small { color: #748780; font-size: 10px; font-weight: 700; }
.payment-receivable-amount,
.payment-receivable-balance { text-align: right; }
.payment-receivable-amount strong { color: #153f38; font-size: 16px; }
.payment-receivable-balance strong { color: #b13a3a; font-size: 16px; }
.payment-expand-icon { color: #759089; transition: transform .18s ease; }
.payment-receivable-card[open] .payment-expand-icon { transform: rotate(180deg); }
.payment-receivable-body { padding: 16px; border-top: 1px solid #e4eeeb; background: #fbfdfc; }
.payment-receivable-meta { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.payment-receivable-meta > span { padding: 11px 12px; display: grid; gap: 4px; border: 1px solid #dfeae7; border-radius: 12px; background: #fff; }
.payment-receivable-meta small { color: #71857e; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.payment-receivable-meta strong { color: #264d45; font-size: 12px; }
.payment-items-table { min-width: 760px; }
.payment-receivable-footer { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 430px); gap: 16px; align-items: stretch; }
.payment-history-block,
.payment-entry-form,
.payment-settled-state { padding: 15px; border: 1px solid #dce9e5; border-radius: 14px; background: #fff; }
.payment-history-block h3,
.payment-entry-heading h3 { margin: 0; color: #244c44; font-size: 14px; }
.payment-history-list { margin-top: 10px; display: grid; gap: 8px; }
.payment-history-list > div { padding: 9px 10px; display: flex; justify-content: space-between; gap: 12px; border-radius: 10px; background: #f3f8f6; }
.payment-history-list span { display: grid; gap: 2px; color: #526d65; font-size: 10px; }
.payment-history-list strong { color: #176d59; font-size: 12px; }
.payment-entry-form { display: grid; gap: 12px; }
.payment-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.payment-due-badge { padding: 7px 10px; color: #a83a3a; border-radius: 999px; background: #fff0f0; font-size: 11px; font-weight: 850; }
.payment-settled-state { display: flex; align-items: center; justify-content: center; gap: 12px; color: #087a55; background: #edf9f4; }
.payment-settled-state .ui-icon { width: 28px; height: 28px; }
.payment-settled-state div { display: grid; gap: 3px; }
.payment-settled-state strong { font-size: 15px; }
.payment-settled-state small { color: #5f7e73; font-size: 11px; }

.inventory-command-bar { margin-bottom: 14px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.inventory-command-bar h2 { margin: 2px 0 4px; }
.inventory-command-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.inventory-purchase-register { margin-bottom: 16px; }
.inventory-secondary-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); gap: 16px; align-items: start; }
.inventory-stock-card .table-wrap { max-height: 540px; }
.supplier-friendly-list { padding: 0 14px 14px; display: grid; gap: 9px; }
.supplier-friendly-list article { padding: 12px; display: flex; align-items: center; gap: 11px; border: 1px solid #e0ebe8; border-radius: 12px; background: #fbfdfc; }
.supplier-avatar { width: 38px; height: 38px; display: grid; place-items: center; color: #0f766e; border-radius: 11px; background: #e7f5f1; font-size: 11px; font-weight: 900; }
.supplier-friendly-list article > div { min-width: 0; display: grid; gap: 2px; }
.supplier-friendly-list strong { color: #234b43; font-size: 12px; }
.supplier-friendly-list small,
.supplier-friendly-list p { margin: 0; overflow: hidden; color: #71847e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.material-catalog-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.material-catalog-header { align-items: center; }
.material-migration-warning { margin: 0 16px 14px; }
.material-catalog-table { min-width: 930px; }
.material-code-pill { display: inline-flex; padding: 5px 8px; color: #0f6d62; border-radius: 8px; background: #eaf6f2; font-size: 10px; font-weight: 850; }
.material-catalog-card .table-wrap { max-height: calc(100vh - 360px); }
.form-hint { margin: 0; padding: 10px 12px; color: #5f756e; border-radius: 10px; background: #f1f7f5; font-size: 11px; line-height: 1.5; }
.clinical-realize-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid #dce9e5; }
.clinical-realize-form .btn { min-height: 48px; font-size: 13px; }
.clinical-payments-link { margin-top: 16px; }

@media (max-width: 1200px) {
    .inventory-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .payment-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .payment-filter-actions { grid-column: 1 / -1; }
    .inventory-secondary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .payment-kpi-grid,
    .material-catalog-summary { grid-template-columns: 1fr; }
    .payment-receivable-card > summary { grid-template-columns: 42px minmax(0, 1fr) 22px; }
    .payment-receivable-card > summary .badge,
    .payment-receivable-amount,
    .payment-receivable-balance { grid-column: 2; justify-self: start; text-align: left; }
    .payment-expand-icon { grid-column: 3; grid-row: 1; }
    .payment-receivable-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .payment-receivable-footer { grid-template-columns: 1fr; }
    .inventory-command-bar { align-items: flex-start; flex-direction: column; }
    .inventory-command-actions { justify-content: flex-start; }
    .material-catalog-filters { grid-template-columns: 1fr 1fr; }
    .material-catalog-search { grid-column: 1 / -1; }
    .material-catalog-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .inventory-overview-grid { grid-template-columns: 1fr; }
    .payment-filter-form,
    .material-catalog-filters { grid-template-columns: 1fr; }
    .payment-filter-actions,
    .material-catalog-filter-actions,
    .material-catalog-search { grid-column: auto; }
    .payment-receivable-meta { grid-template-columns: 1fr; }
    .inventory-command-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
    .inventory-command-actions .btn { width: 100%; }
}

/* 3.9.1 focused visit, payments and inventory UX */
.visit-final-sticky-footer {
    position: sticky;
    bottom: 0;
    z-index: 30;
    background: rgba(255,255,255,.98);
    border-top: 1px solid var(--border-color, #dce7e4);
    box-shadow: 0 -14px 30px rgba(15, 72, 62, .10);
    backdrop-filter: blur(12px);
}
.visit-final-actions { display:flex; gap:12px; align-items:center; }
.visit-final-actions .btn { min-width:150px; justify-content:center; }

.payment-kpi-grid-clean { grid-template-columns:repeat(3,minmax(0,1fr)); }
.payment-filter-row-card { padding:16px 18px; }
.payment-filter-row {
    display:grid;
    grid-template-columns:minmax(240px,1.35fr) minmax(220px,1fr) minmax(155px,.65fr) minmax(145px,.55fr) minmax(145px,.55fr) auto;
    gap:12px;
    align-items:end;
}
.payment-filter-row .field { margin:0; }
.payment-filter-row .payment-filter-actions { display:flex; gap:8px; align-items:center; }
.payment-table-card { overflow:hidden; }
.payments-main-table-wrap { max-height:68vh; }
.payments-main-table thead th { position:sticky; top:0; z-index:2; background:#f4f8f7; }
.payments-main-table td { vertical-align:middle; }
.payment-service-stack { display:flex; flex-direction:column; gap:3px; min-width:190px; }
.payment-service-stack span { font-weight:700; color:#173f38; }
.payment-service-stack small { color:#647a75; }
.table-action-group { display:flex; gap:7px; align-items:center; flex-wrap:nowrap; }
.table-action-group form { margin:0; }
.payment-edit-summary,
.receipt-edit-summary {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    padding:14px;
    border:1px solid #dbe8e5;
    background:#f6faf9;
    border-radius:14px;
}
.payment-edit-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
.payment-edit-summary span,
.receipt-edit-summary span { display:flex; flex-direction:column; gap:4px; }
.payment-edit-summary small,
.receipt-edit-summary small { color:#71857f; font-size:.76rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.payment-edit-summary strong,
.receipt-edit-summary strong { color:#123b34; }

.inventory-stock-card-full { margin-top:18px; }
.receipt-details-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.receipt-record-actions { margin-left:auto; }
.supplier-manager-dialog .modal-card { width:min(1180px,94vw); }
.supplier-manager-layout { display:grid; grid-template-columns:minmax(300px,.72fr) minmax(0,1.45fr); gap:22px; align-items:start; }
.supplier-manager-form { padding:18px; border:1px solid #dce8e5; border-radius:16px; background:#f8fbfa; position:sticky; top:0; }
.supplier-manager-list { min-width:0; }
.supplier-manager-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.material-receipt-edit-dialog .modal-card { width:min(1050px,94vw); }
.font-semibold { font-weight:700; }

@media (max-width:1100px) {
    .payment-filter-row { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .payment-filter-row .payment-search-field { grid-column:span 2; }
    .payment-filter-row .payment-filter-actions { justify-content:flex-end; }
    .supplier-manager-layout { grid-template-columns:1fr; }
    .supplier-manager-form { position:static; }
}
@media (max-width:760px) {
    .payment-kpi-grid-clean { grid-template-columns:1fr; }
    .payment-filter-row { grid-template-columns:1fr; }
    .payment-filter-row .payment-search-field { grid-column:auto; }
    .payment-filter-row .payment-filter-actions { justify-content:stretch; }
    .payment-filter-row .payment-filter-actions .btn { flex:1; }
    .visit-command-footer { flex-direction:column; align-items:stretch; }
    .visit-final-actions { width:100%; }
    .visit-final-actions .btn { flex:1; min-width:0; }
    .receipt-edit-summary { grid-template-columns:1fr; }
}

/* DentalPro 3.9.2 — compact payment KPIs, clearer patients and simplified materials */
.patient-records-count { font-size: 12px; }
.patient-records-table th { padding: 12px 13px; font-size: 11px; }
.patient-records-table td { padding: 12px 13px; font-size: 12px; }
.patient-record-avatar { font-size: 12px; }
.patient-record-name strong { font-size: 13px; }
.patient-record-name small { font-size: 10px; }
.patient-record-code { font-size: 11px; }
.patient-record-embg { font-size: 11px; }
.patient-record-date strong { font-size: 11px; }
.patient-record-date small { font-size: 10px; }
.patient-record-open { font-size: 11px; }

.payment-kpi-grid-clean { gap: 11px; margin-bottom: 13px; }
.payment-kpi-grid-clean .payment-kpi-card {
    min-height: 90px;
    padding: 14px;
    gap: 12px;
    border-radius: 15px;
    box-shadow: 0 9px 24px rgba(22, 73, 64, .07);
}
.payment-kpi-grid-clean .payment-kpi-icon {
    width: 37px;
    height: 37px;
    flex-basis: 37px;
    border-radius: 11px;
}
.payment-kpi-grid-clean .payment-kpi-icon .ui-icon { width: 19px; height: 19px; }
.payment-kpi-grid-clean .payment-kpi-card small { font-size: 9px; }
.payment-kpi-grid-clean .payment-kpi-card strong { font-size: 20px; }
.payment-kpi-grid-clean .payment-kpi-card p { font-size: 10px; }

.material-catalog-filters-no-groups {
    grid-template-columns: minmax(300px, 1.7fr) minmax(190px, .8fr) auto;
}
.material-catalog-table { min-width: 820px; }

.clinical-visit-final-footer {
    position: sticky;
    bottom: 0;
    z-index: 25;
    margin-top: 18px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #d6e5e1;
    border-radius: 16px 16px 0 0;
    background: rgba(255,255,255,.97);
    box-shadow: 0 -12px 30px rgba(15,72,62,.12);
    backdrop-filter: blur(12px);
}
.clinical-visit-footer-copy { display: grid; gap: 2px; }
.clinical-visit-footer-copy small { color: #71857f; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.clinical-visit-footer-copy strong { color: #173f39; font-size: 14px; }
.clinical-visit-footer-actions { display: flex; align-items: center; gap: 10px; }
.clinical-visit-footer-actions form { margin: 0; }
.clinical-visit-footer-actions .btn { min-width: 142px; justify-content: center; }

@media (max-width: 760px) {
    .material-catalog-filters-no-groups { grid-template-columns: 1fr; }
    .clinical-visit-final-footer { align-items: stretch; flex-direction: column; }
    .clinical-visit-footer-actions { width: 100%; }
    .clinical-visit-footer-actions form { flex: 1; }
    .clinical-visit-footer-actions .btn { width: 100%; min-width: 0; }
}

/* DentalPro 3.9.3 — installments, debtors and management dashboard */
.payment-kpi-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.payment-kpi-debtors {
    position: relative;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.payment-kpi-debtors:hover { border-color: #9ccfc2; box-shadow: 0 13px 30px rgba(22, 73, 64, .12); transform: translateY(-1px); }
.payment-kpi-debtors .payment-kpi-arrow { margin-left: auto; color: #6d8580; }
.payment-kpi-debtors .payment-kpi-arrow .ui-icon { width: 18px; height: 18px; }
.payment-installment-button { color: #0f766e; background: #e9f7f3; border-color: #c6e7de; }
.payment-installment-button:hover { color: #075e57; background: #dff2ec; }
.payment-installment-button.is-settled { color: #15724f; background: #edf9f3; }
.payment-installment-dialog {
    width: min(1480px, calc(100vw - 24px));
    max-width: 1480px;
    height: min(92vh, 900px);
    max-height: calc(100vh - 24px);
    border-radius: 20px;
}
.payment-installment-dialog .payment-installment-modal-card {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}
.payment-installment-modal-header { padding: 20px 24px; }
.payment-installment-modal-header h2 { margin: 2px 0 4px; font-size: 23px; }
.payment-installment-layout {
    min-height: 0;
    max-height: none;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(390px, .78fr) minmax(650px, 1.42fr);
    gap: 20px;
    align-items: stretch;
    padding: 20px 24px;
}
.payment-installment-entry,
.payment-installment-history-card { min-width: 0; min-height: 0; }
.payment-installment-entry {
    overflow: auto;
    padding: 20px;
    border: 1px solid #dbe8e4;
    border-radius: 16px;
    background: #f8fbfa;
}
.payment-installment-section-heading { margin-bottom: 14px; }
.payment-installment-section-heading h3 { margin: 2px 0 0; color: #173f39; font-size: 18px; }
.payment-installment-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.payment-installment-summary span { display: grid; gap: 5px; padding: 13px; border: 1px solid #dfeae7; border-radius: 12px; background: #fff; }
.payment-installment-summary small { color: #748780; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.payment-installment-summary strong { color: #183f38; font-size: 16px; }
.payment-installment-history-card {
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    border: 1px solid #dbe8e4;
    border-radius: 16px;
    background: #fff;
}
.payment-installment-history-heading {
    padding: 17px 19px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #e3ece9;
    background: #f8fbfa;
}
.payment-installment-history-heading h3 { margin: 2px 0 3px; font-size: 18px; }
.payment-installment-history-heading .muted { margin: 0; font-size: 11px; }
.payment-installment-history-summary {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    border-bottom: 1px solid #e3ece9;
    background: #fff;
}
.payment-installment-history-summary span { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid #e0ebe8; border-radius: 11px; background: #fbfdfc; }
.payment-installment-history-summary small { color: #748780; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.payment-installment-history-summary strong { color: #244b43; font-size: 13px; }
.payment-installment-history { min-height: 0; overflow: auto; padding: 0; }
.payment-installment-history-table-wrap { min-width: 0; }
.payment-installment-history-table { width: 100%; min-width: 0; }
.payment-installment-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 11px 12px;
    color: #5f756e;
    background: #f4f8f7;
    font-size: 10px;
    white-space: nowrap;
}
.payment-installment-history-table tbody td { padding: 12px; vertical-align: top; font-size: 11px; }
.payment-installment-history-table tbody tr:hover { background: #f8fbfa; }
.payment-history-number { width: 28px; height: 28px; display: grid; place-items: center; color: #0b675f; border-radius: 9px; background: #e7f5f1; font-size: 11px; font-weight: 900; }
.payment-history-notes { min-width: 170px; max-width: 260px; color: #526b64; white-space: normal; line-height: 1.45; }
.payment-history-empty { min-height: 280px; display: grid; place-content: center; gap: 6px; padding: 30px; text-align: center; color: #758983; }
.payment-history-empty strong { color: #385c54; font-size: 15px; }
.payment-history-empty small { max-width: 360px; line-height: 1.5; }
.payment-settled-message { min-height: 190px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #087a55; text-align: left; }
.payment-settled-message .ui-icon { width: 30px; height: 30px; }
.payment-settled-message div { display: grid; gap: 4px; }
.payment-settled-message small { color: #648077; }
.payment-installment-modal-footer { padding: 15px 24px; }
.debtors-dialog .modal-card { width: min(1260px, 96vw); }
.debtors-table-wrap { max-height: 65vh; }
.debtors-table { min-width: 980px; }
.debtors-table thead th { position: sticky; top: 0; z-index: 2; background: #f4f8f7; }
.debtor-reminder-form { display: grid; grid-template-columns: minmax(110px, 1fr) auto; gap: 7px; align-items: center; }
.debtor-reminder-form select { min-height: 34px; padding: 5px 28px 5px 9px; font-size: 11px; }
.reminder-note { margin: 0 auto 0 0; font-size: 10px; }

@media (max-width: 1180px) {
    .payment-kpi-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .payment-installment-dialog { width: min(980px, calc(100vw - 20px)); height: min(94vh, 920px); }
    .payment-installment-layout { grid-template-columns: 1fr; overflow: auto; }
    .payment-installment-entry { overflow: visible; }
    .payment-installment-history-card { min-height: 480px; }
}
@media (max-width: 700px) {
    .payment-kpi-grid-four { grid-template-columns: 1fr; }
    .payment-installment-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .payment-installment-dialog .payment-installment-modal-card { border-radius: 0; }
    .payment-installment-layout { padding: 12px; gap: 12px; }
    .payment-installment-summary, .payment-installment-history-summary { grid-template-columns: 1fr; }
    .payment-installment-modal-header, .payment-installment-modal-footer { padding-left: 14px; padding-right: 14px; }
}

.manager-dashboard-hero {
    margin-bottom: 16px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #fff;
    border-radius: 22px;
    background: linear-gradient(135deg, #0e6f66 0%, #164f49 62%, #173f39 100%);
    box-shadow: 0 18px 42px rgba(15, 79, 71, .2);
}
.manager-dashboard-hero h2 { margin: 3px 0 6px; color: #fff; font-size: 28px; }
.manager-dashboard-hero p { margin: 0; color: rgba(255,255,255,.78); }
.manager-dashboard-hero .eyebrow { color: #bfe8df; }
.manager-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.manager-dashboard-hero .btn-light { color: #154a43; border-color: rgba(255,255,255,.55); background: #fff; }
.manager-dashboard-hero .btn-primary { color: #fff; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.13); }
.manager-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.manager-kpi-card { min-height: 122px; padding: 18px; display: flex; align-items: center; gap: 15px; border: 1px solid #dce8e5; border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(25,69,61,.07); }
.manager-kpi-card > span { width: 47px; height: 47px; flex: 0 0 47px; display: grid; place-items: center; color: #0f766e; border-radius: 14px; background: #e8f5f2; }
.manager-kpi-card > span .ui-icon { width: 23px; height: 23px; }
.manager-kpi-card div { display: grid; gap: 4px; min-width: 0; }
.manager-kpi-card small { color: #6d817b; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.manager-kpi-card strong { color: #173f39; font-size: 23px; line-height: 1.08; }
.manager-kpi-card p { margin: 0; color: #73857f; font-size: 11px; }
.manager-kpi-paid > span { color: #087a55; background: #e9f8f1; }
.manager-kpi-debt > span { color: #b53e3e; background: #fff0f0; }
.manager-kpi-stock > span { color: #946313; background: #fff6df; }
.manager-chart-grid { display: grid; grid-template-columns: minmax(0,.82fr) minmax(0,1.18fr); gap: 16px; margin-bottom: 16px; }
.manager-chart-card { overflow: hidden; }
.manager-chart-card > .card-header { min-height: 94px; }
.patient-registration-chart { min-height: 282px; padding: 22px 20px 18px; display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 8px; align-items: end; }
.patient-chart-column { height: 230px; display: grid; grid-template-rows: 24px minmax(0,1fr) 24px; gap: 5px; align-items: end; text-align: center; }
.patient-chart-column strong { color: #234b44; font-size: 11px; }
.patient-chart-column > span { height: 174px; display: flex; align-items: flex-end; justify-content: center; border-radius: 9px; background: linear-gradient(to top,#f5f9f8,#fbfdfc); }
.patient-chart-column i { width: min(24px,72%); min-height: 5px; display: block; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg,#2e9c8c,#0f766e); box-shadow: 0 8px 18px rgba(15,118,110,.18); }
.patient-chart-column small { color: #748780; font-size: 9px; font-weight: 750; }
.finance-chart-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.finance-chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: #5f756e; font-size: 10px; font-weight: 800; }
.finance-chart-legend i { width: 18px; height: 3px; display: block; border-radius: 3px; }
.legend-realized i { background: #0f766e; }
.legend-paid i { background: #7d61c8; }
.finance-svg-wrap { min-height: 282px; padding: 10px 14px 16px; display: grid; place-items: center; overflow-x: auto; }
.finance-trend-svg { width: 100%; min-width: 650px; height: auto; overflow: visible; }
.finance-grid-line { stroke: #e3ece9; stroke-width: 1; }
.finance-line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.finance-line-realized { stroke: #0f766e; }
.finance-line-paid { stroke: #7d61c8; }
.finance-dot { stroke: #fff; stroke-width: 2; }
.finance-dot-realized { fill: #0f766e; }
.finance-dot-paid { fill: #7d61c8; }
.finance-axis-label { fill: #768a84; font-size: 10px; font-weight: 700; }
.manager-detail-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.85fr) minmax(300px,.85fr); gap: 16px; align-items: start; }
.manager-appointment-list,
.manager-debtor-list,
.manager-stock-list { display: grid; }
.manager-appointment-list > a,
.manager-debtor-list > a,
.manager-stock-list > a { min-height: 68px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; color: inherit; border-top: 1px solid #e5edeb; text-decoration: none; transition: background .16s ease; }
.manager-appointment-list > a:hover,
.manager-debtor-list > a:hover,
.manager-stock-list > a:hover { background: #f7fbfa; }
.manager-appointment-list time { width: 52px; flex: 0 0 52px; color: #0f766e; font-size: 15px; font-weight: 900; }
.manager-appointment-list div,
.manager-debtor-list div,
.manager-stock-list div { min-width: 0; display: grid; gap: 3px; flex: 1; }
.manager-appointment-list strong,
.manager-debtor-list strong,
.manager-stock-list strong { color: #234b43; font-size: 12px; }
.manager-appointment-list small,
.manager-debtor-list small,
.manager-stock-list small { overflow: hidden; color: #73867f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.manager-debtor-list .avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: #0f766e; border-radius: 12px; background: #e8f5f2; font-size: 11px; font-weight: 900; }
.manager-debtor-list b { color: #b43f3f; font-size: 12px; }
.manager-stock-list > a > span { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; color: #946313; border-radius: 11px; background: #fff5dc; }
.manager-stock-list > a > span .ui-icon { width: 18px; height: 18px; }
.manager-stock-list b { color: #9b6a15; font-size: 11px; }

@media (max-width: 1280px) {
    .manager-detail-grid { grid-template-columns: 1fr 1fr; }
    .manager-today-card { grid-column: 1 / -1; }
}
@media (max-width: 1050px) {
    .manager-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .manager-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .manager-dashboard-hero { align-items: flex-start; flex-direction: column; }
    .manager-hero-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
    .manager-kpi-grid,
    .manager-detail-grid { grid-template-columns: 1fr; }
    .manager-today-card { grid-column: auto; }
    .patient-registration-chart { overflow-x: auto; grid-template-columns: repeat(12,48px); }
}

/* DentalPro 3.9.6 — simplified installment evidence */
.payment-installment-layout {
    grid-template-columns: minmax(0, 7fr) minmax(340px, 3fr);
    gap: 18px;
}
.payment-installment-entry {
    position: relative;
    padding: 26px;
    border: 2px solid #9fd5c9;
    background: linear-gradient(145deg, #f1fbf8 0%, #ffffff 58%, #f7fbfa 100%);
    box-shadow: 0 18px 44px rgba(15, 118, 110, .12);
}
.payment-installment-entry::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(180deg, #0f766e, #42a996);
}
.payment-installment-section-heading {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #d5e9e4;
}
.payment-installment-section-heading h3 {
    font-size: 23px;
    letter-spacing: -.02em;
}
.payment-installment-entry .payment-installment-summary {
    gap: 13px;
    margin-bottom: 22px;
}
.payment-installment-entry .payment-installment-summary span {
    min-height: 84px;
    padding: 16px;
    align-content: center;
    border-color: #cfe6df;
    box-shadow: 0 8px 22px rgba(31, 91, 81, .07);
}
.payment-installment-entry .payment-installment-summary small { font-size: 10.5px; }
.payment-installment-entry .payment-installment-summary strong { font-size: 19px; }
.payment-installment-entry .field > span { color: #315e55; font-size: 12px; font-weight: 850; }
.payment-installment-entry input,
.payment-installment-entry select,
.payment-installment-entry textarea { min-height: 44px; font-size: 13px; }
.payment-installment-entry textarea { min-height: 108px; }
.payment-installment-history-card {
    border-color: #dce8e5;
    box-shadow: 0 10px 24px rgba(30, 74, 66, .06);
}
.payment-installment-history-heading { padding: 13px 14px; gap: 8px; }
.payment-installment-history-heading h3 { font-size: 15px; }
.payment-installment-history-heading .muted { font-size: 9px; line-height: 1.4; }
.payment-installment-history-heading .badge { padding: 4px 7px; font-size: 9px; }
.payment-installment-history-summary { padding: 9px 10px; gap: 6px; }
.payment-installment-history-summary span { padding: 8px; }
.payment-installment-history-summary small { font-size: 8px; }
.payment-installment-history-summary strong { font-size: 11px; }
.payment-installment-history-table-wrap,
.payment-installment-history-table { min-width: 0; }
.payment-installment-history-table thead th { padding: 9px 10px; font-size: 9px; }
.payment-installment-history-table tbody td { padding: 10px; font-size: 10px; }
.payment-history-notes { min-width: 135px; max-width: 200px; font-size: 9px; }
.payment-installment-modal-footer [data-installment-submit] {
    min-width: 220px;
    min-height: 44px;
    justify-content: center;
    box-shadow: 0 9px 20px rgba(15, 118, 110, .19);
}

.debtors-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
}
.debtors-dialog .modal-card {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 0;
    overflow: hidden;
}
.debtors-dialog .modal-header { padding: 14px 20px; }
.debtors-dialog .modal-header h2 { margin: 2px 0 3px; font-size: 20px; }
.debtors-dialog .modal-header .eyebrow { font-size: 8px; }
.debtors-dialog .modal-header .muted { margin: 0; font-size: 10px; }
.debtors-dialog .modal-body {
    min-height: 0;
    padding: 12px 18px;
    overflow: hidden;
}
.debtors-table-wrap {
    width: 100%;
    height: 100%;
    max-height: none;
    overflow: auto;
    border: 1px solid #dfe9e6;
    border-radius: 12px;
}
.debtors-table { width: 100%; min-width: 1080px; }
.debtors-table thead th { padding: 9px 10px; font-size: 9px; }
.debtors-table tbody td { padding: 9px 10px; font-size: 10px; }
.debtors-table tbody td > strong { font-size: 10.5px; }
.debtors-dialog .table-subtext { margin-top: 2px; font-size: 8.5px; }
.debtors-dialog .badge { padding: 3px 6px; font-size: 8.5px; }
.debtors-dialog .debtor-reminder-form { grid-template-columns: minmax(92px, 1fr) auto; gap: 5px; }
.debtors-dialog .debtor-reminder-form select { min-height: 30px; padding: 4px 24px 4px 7px; font-size: 9px; }
.debtors-dialog .debtor-reminder-form .btn { min-height: 30px; padding: 5px 8px; font-size: 9px; }
.debtors-dialog .modal-footer { padding: 10px 18px; }
.debtors-dialog .reminder-note { font-size: 9px; }

@media (min-width: 921px) and (max-width: 1180px) {
    .payment-installment-dialog { width: calc(100vw - 20px); max-width: none; }
    .payment-installment-layout {
        grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
        overflow: hidden;
    }
    .payment-installment-entry { overflow: auto; }
    .payment-installment-history-card { min-height: 0; }
}

@media (max-width: 920px) {
    .payment-installment-layout { grid-template-columns: 1fr; overflow: auto; }
    .payment-installment-entry { overflow: visible; }
    .payment-installment-history-card { min-height: 430px; }
}

@media (max-width: 700px) {
    .payment-installment-entry { padding: 18px; }
    .payment-installment-section-heading h3 { font-size: 20px; }
    .debtors-dialog .modal-header { padding: 12px 14px; }
    .debtors-dialog .modal-body { padding: 8px; }
    .debtors-dialog .modal-footer { padding: 9px 12px; }
}


/* DentalPro 3.9.7 — compact installment modal and wider installment number */
@media (min-width: 921px) {
    .payment-installment-dialog {
        height: min(82vh, 760px);
        max-height: calc(100vh - 28px);
    }
    .payment-installment-modal-header {
        padding: 14px 20px;
    }
    .payment-installment-modal-header h2 {
        font-size: 20px;
    }
    .payment-installment-layout {
        padding: 14px 20px;
        gap: 14px;
    }
    .payment-installment-entry {
        padding: 17px 20px;
        overflow: hidden;
    }
    .payment-installment-section-heading {
        margin-bottom: 11px;
        padding-bottom: 9px;
    }
    .payment-installment-section-heading h3 {
        font-size: 20px;
    }
    .payment-installment-entry .payment-installment-summary {
        gap: 9px;
        margin-bottom: 13px;
    }
    .payment-installment-entry .payment-installment-summary span {
        min-height: 62px;
        padding: 10px 12px;
    }
    .payment-installment-entry .payment-installment-summary small {
        font-size: 9px;
    }
    .payment-installment-entry .payment-installment-summary strong {
        font-size: 16px;
    }
    .payment-installment-entry .form-grid {
        gap: 9px 12px;
    }
    .payment-installment-entry .field {
        gap: 5px;
        margin-bottom: 8px;
    }
    .payment-installment-entry .field > span {
        font-size: 10.5px;
    }
    .payment-installment-entry input,
    .payment-installment-entry select {
        min-height: 38px;
        padding-top: 7px;
        padding-bottom: 7px;
        font-size: 12px;
    }
    .payment-installment-entry textarea {
        min-height: 68px;
        height: 68px;
        padding-top: 8px;
        padding-bottom: 8px;
        font-size: 12px;
        resize: none;
    }
    .payment-installment-history-heading {
        padding: 10px 12px;
    }
    .payment-installment-history-heading h3 {
        font-size: 14px;
    }
    .payment-installment-modal-footer {
        padding: 11px 20px;
    }
    .payment-installment-modal-footer [data-installment-submit] {
        min-height: 40px;
    }
}

.payment-installment-history-table {
    table-layout: fixed;
}
.payment-installment-history-table th:first-child,
.payment-installment-history-table td:first-child {
    width: 42%;
    min-width: 112px;
    white-space: nowrap;
}
.payment-installment-history-table th:nth-child(2),
.payment-installment-history-table td:nth-child(2) {
    width: 29%;
    white-space: nowrap;
}
.payment-installment-history-table th:nth-child(3),
.payment-installment-history-table td:nth-child(3) {
    width: 29%;
    white-space: nowrap;
    text-align: right;
}
.payment-history-number {
    width: auto;
    min-width: 84px;
    height: 28px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

@media (max-width: 920px) {
    .payment-installment-history-table th:first-child,
    .payment-installment-history-table td:first-child {
        width: 40%;
        min-width: 104px;
    }
    .payment-history-number {
        min-width: 78px;
    }
}

/* DentalPro 3.9.8 — compact debtors modal and columns */
.debtors-dialog {
    width: min(1040px, 92vw);
    max-width: 92vw;
    height: auto;
    max-height: min(78vh, 720px);
    margin: auto;
    border-radius: 18px;
}
.debtors-dialog .modal-card {
    width: 100%;
    max-width: 1040px;
    height: auto;
    max-height: min(78vh, 720px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 18px;
    overflow: hidden;
}
.debtors-dialog .modal-header { padding: 12px 16px; }
.debtors-dialog .modal-header h2 { font-size: 18px; }
.debtors-dialog .modal-header .muted { font-size: 9px; }
.debtors-dialog .modal-body {
    min-height: 0;
    padding: 9px 12px;
    overflow: hidden;
}
.debtors-table-wrap {
    width: 100%;
    height: auto;
    max-height: 52vh;
    overflow: auto;
    border-radius: 10px;
}
.debtors-table {
    width: 100%;
    min-width: 820px;
    table-layout: fixed;
}
.debtors-table th:nth-child(1),
.debtors-table td:nth-child(1) { width: 21%; }
.debtors-table th:nth-child(2),
.debtors-table td:nth-child(2) { width: 19%; }
.debtors-table th:nth-child(3),
.debtors-table td:nth-child(3) { width: 11%; text-align: center; }
.debtors-table th:nth-child(4),
.debtors-table td:nth-child(4) { width: 13%; }
.debtors-table th:nth-child(5),
.debtors-table td:nth-child(5) { width: 14%; }
.debtors-table th:nth-child(6),
.debtors-table td:nth-child(6) { width: 22%; }
.debtors-table thead th {
    padding: 7px 8px;
    font-size: 8.5px;
    white-space: normal;
    line-height: 1.2;
}
.debtors-table tbody td {
    padding: 7px 8px;
    font-size: 9.5px;
    line-height: 1.25;
    vertical-align: middle;
    overflow-wrap: anywhere;
}
.debtors-table tbody td > strong { font-size: 10px; }
.debtors-dialog .table-subtext { font-size: 8px; }
.debtors-dialog .debtor-reminder-form {
    grid-template-columns: minmax(76px, 1fr) auto;
    gap: 4px;
}
.debtors-dialog .debtor-reminder-form select {
    min-height: 28px;
    padding: 3px 22px 3px 6px;
    font-size: 8.5px;
}
.debtors-dialog .debtor-reminder-form .btn {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 8.5px;
}
.debtors-dialog .modal-footer { padding: 8px 12px; }
.debtors-dialog .reminder-note { font-size: 8.5px; }

@media (max-width: 900px) {
    .debtors-dialog {
        width: min(96vw, 860px);
        max-width: 96vw;
        max-height: 86vh;
    }
    .debtors-dialog .modal-card { max-height: 86vh; }
    .debtors-table-wrap { max-height: 62vh; }
}

/* 3.9.9 — unified materials, suppliers and invoice registers */
.materials-page-command {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 22px;
    margin-bottom: 12px;
}
.materials-page-command h2 { margin: 2px 0 5px; }
.materials-page-actions { justify-content: flex-end; }
.materials-section-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.materials-section-nav a {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 14px;
    border: 1px solid #dce8e5;
    border-radius: 14px;
    background: #fff;
    color: #244c46;
    text-decoration: none;
    box-shadow: 0 7px 20px rgba(25, 61, 55, .055);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.materials-section-nav a:hover {
    transform: translateY(-1px);
    border-color: #9fc8bf;
    box-shadow: 0 10px 24px rgba(25, 61, 55, .09);
}
.materials-section-nav a > .ui-icon {
    width: 21px;
    height: 21px;
    padding: 6px;
    border-radius: 10px;
    background: #eaf6f3;
    color: #0f766e;
    box-sizing: content-box;
}
.materials-section-nav span { font-weight: 850; }
.materials-section-nav strong {
    min-width: 30px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f0f6f4;
    text-align: center;
    font-size: 13px;
}
.catalog-table-card {
    scroll-margin-top: 18px;
    margin-bottom: 16px;
}
.catalog-table-card > .card-header {
    align-items: center;
    border-bottom: 1px solid #e4eeeb;
}
.catalog-table-card .toolbar-actions {
    align-items: center;
    flex-wrap: wrap;
}
.catalog-inline-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.catalog-inline-filter input[type="search"] { min-width: 220px; }
.catalog-inline-filter select { min-width: 155px; }
.catalog-mini-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: #e2ece9;
    border-bottom: 1px solid #e2ece9;
}
.catalog-mini-summary > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #f8fbfa;
}
.catalog-mini-summary small {
    color: #637c76;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .025em;
    text-transform: uppercase;
}
.catalog-mini-summary strong { color: #173f39; font-size: 16px; }
.catalog-standard-table { width: 100%; }
.catalog-standard-table th:last-child,
.catalog-standard-table td:last-child { text-align: right; }
.actions-column { width: 92px; white-space: nowrap; }
.table-action-group-nowrap,
.table-actions {
    display: inline-flex !important;
    flex-flow: row nowrap !important;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    white-space: nowrap;
}
.table-action-group-nowrap form,
.table-actions form {
    display: inline-flex !important;
    flex: 0 0 auto;
    margin: 0;
}
.table-action-group-nowrap .icon-action,
.table-actions .icon-action { flex: 0 0 auto; }
.supplier-full-table { min-width: 930px; }
.invoice-register-table { min-width: 1060px; }
.invoice-register-table .badge { white-space: nowrap; }
#supplierDialog .modal-card { width: min(620px, 94vw); }
#supplierDialog .modal-body { padding-bottom: 18px; }

@media (max-width: 1180px) {
    .materials-page-command { align-items: flex-start; }
    .catalog-table-card > .card-header { align-items: flex-start; }
    .catalog-inline-filter { flex-wrap: wrap; }
}
@media (max-width: 840px) {
    .materials-page-command { flex-direction: column; }
    .materials-page-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
    .materials-page-actions .btn { width: 100%; }
    .materials-section-nav { grid-template-columns: 1fr; }
    .catalog-table-card .toolbar-actions { width: 100%; align-items: stretch; }
    .catalog-inline-filter { width: 100%; display: grid; grid-template-columns: 1fr; }
    .catalog-inline-filter input[type="search"],
    .catalog-inline-filter select { min-width: 0; width: 100%; }
    .catalog-mini-summary { grid-template-columns: 1fr; }
}

/* DentalPro 3.10.0 — modern clickable management dashboard */
.manager-dashboard-modern {
    --manager-ink: #173f39;
    --manager-muted: #6c817a;
    --manager-border: #dce8e5;
    --manager-surface: #ffffff;
    display: grid;
    gap: 18px;
}
.manager-dashboard-modern .manager-dashboard-hero-modern {
    position: relative;
    overflow: hidden;
    min-height: 205px;
    margin: 0;
    padding: 30px 32px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 26px;
    background:
        radial-gradient(circle at 88% 12%, rgba(97,211,190,.25), transparent 29%),
        radial-gradient(circle at 5% 100%, rgba(96,135,230,.18), transparent 34%),
        linear-gradient(132deg, #0a675f 0%, #154f49 56%, #183e3a 100%);
    box-shadow: 0 24px 54px rgba(15,70,64,.22);
}
.manager-dashboard-modern .manager-dashboard-hero-modern::after {
    content: '';
    position: absolute;
    right: -80px;
    bottom: -135px;
    width: 330px;
    height: 330px;
    border: 46px solid rgba(255,255,255,.045);
    border-radius: 50%;
    pointer-events: none;
}
.manager-hero-copy,
.manager-hero-side { position: relative; z-index: 1; }
.manager-hero-copy { max-width: 700px; }
.manager-live-pill {
    width: max-content;
    margin-bottom: 17px;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d6f6ef;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.manager-live-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #54d3ad;
    box-shadow: 0 0 0 5px rgba(84,211,173,.12);
}
.manager-dashboard-modern .manager-dashboard-hero h2 {
    margin: 4px 0 8px;
    font-size: clamp(30px, 3vw, 43px);
    letter-spacing: -.04em;
}
.manager-dashboard-modern .manager-dashboard-hero .eyebrow { color: #bfeae0; }
.manager-dashboard-modern .manager-dashboard-hero p:not(.eyebrow) {
    max-width: 650px;
    color: rgba(255,255,255,.76);
    font-size: 13px;
    line-height: 1.65;
}
.manager-hero-side {
    width: min(350px, 100%);
    display: grid;
    gap: 16px;
}
.manager-collection-score {
    padding: 18px;
    display: grid;
    gap: 8px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(8px);
}
.manager-collection-score > span { color: rgba(255,255,255,.72); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.manager-collection-score > strong { font-size: 28px; line-height: 1; }
.manager-collection-score > div { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.14); }
.manager-collection-score > div i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#72e0bd,#e3fff6); }
.manager-dashboard-modern .manager-hero-actions .btn { min-height: 41px; border-radius: 12px; }

.manager-dashboard-modern .manager-kpi-grid-modern {
    margin: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.manager-dashboard-modern .manager-kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    padding: 19px 44px 19px 18px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--manager-border);
    border-radius: 20px;
    background: linear-gradient(145deg,#fff 0%,#fbfdfc 100%);
    box-shadow: 0 11px 30px rgba(25,69,61,.07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.manager-dashboard-modern .manager-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #0f766e;
    opacity: .85;
}
.manager-dashboard-modern .manager-kpi-card:hover {
    transform: translateY(-4px);
    border-color: #b9d9d1;
    box-shadow: 0 18px 42px rgba(25,69,61,.13);
}
.manager-dashboard-modern .manager-kpi-card:focus-visible { outline: 3px solid rgba(15,118,110,.22); outline-offset: 2px; }
.manager-dashboard-modern .manager-kpi-card .manager-kpi-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    color: #0f766e;
    border-radius: 15px;
    background: #eaf6f3;
}
.manager-dashboard-modern .manager-kpi-card .manager-kpi-icon .ui-icon { width: 24px; height: 24px; }
.manager-dashboard-modern .manager-kpi-card small { font-size: 10px; letter-spacing: .055em; }
.manager-dashboard-modern .manager-kpi-card strong { font-size: clamp(20px, 2vw, 27px); letter-spacing: -.025em; }
.manager-dashboard-modern .manager-kpi-card p { font-size: 10px; }
.manager-dashboard-modern .manager-kpi-card p b { color: #375e56; }
.manager-card-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    color: #6f8982;
    border: 1px solid #dce9e5;
    border-radius: 10px;
    background: #fff;
    transform: translateY(-50%);
    transition: transform .18s ease, color .18s ease, background .18s ease;
}
.manager-card-arrow .ui-icon { width: 15px; height: 15px; }
.manager-kpi-card:hover .manager-card-arrow { color: #fff; background: #0f766e; transform: translate(3px,-50%); }
.manager-dashboard-modern .manager-kpi-calendar::before { background: #4a78d0; }
.manager-dashboard-modern .manager-kpi-calendar .manager-kpi-icon { color: #365fae; background: #eef3ff; }
.manager-dashboard-modern .manager-kpi-realized::before { background: #8a67d1; }
.manager-dashboard-modern .manager-kpi-realized .manager-kpi-icon { color: #7352bb; background: #f3efff; }
.manager-dashboard-modern .manager-kpi-paid::before { background: #1f9d76; }
.manager-dashboard-modern .manager-kpi-paid .manager-kpi-icon { color: #15825f; background: #ebf8f2; }
.manager-dashboard-modern .manager-kpi-debt::before { background: #d96a72; }
.manager-dashboard-modern .manager-kpi-debt .manager-kpi-icon { color: #bd4d56; background: #fff0f1; }
.manager-dashboard-modern .manager-kpi-stock::before { background: #d79a31; }
.manager-dashboard-modern .manager-kpi-stock .manager-kpi-icon { color: #a46f16; background: #fff7e7; }

.manager-chart-layout {
    display: grid;
    grid-template-columns: minmax(340px,.75fr) minmax(0,1.55fr);
    gap: 16px;
}
.manager-secondary-grid {
    display: grid;
    grid-template-columns: minmax(0,1.45fr) minmax(320px,.55fr);
    gap: 16px;
}
.manager-dashboard-modern .manager-chart-card,
.manager-dashboard-modern .manager-health-card,
.manager-dashboard-modern .manager-detail-grid-modern > .card {
    border: 1px solid var(--manager-border);
    border-radius: 22px;
    background: var(--manager-surface);
    box-shadow: 0 12px 34px rgba(25,69,61,.065);
}
.manager-dashboard-modern .manager-chart-card { overflow: hidden; }
.manager-dashboard-modern .manager-card-header-modern {
    min-height: 94px;
    padding: 20px 21px;
    align-items: flex-start;
    border-bottom: 1px solid #edf3f1;
}
.manager-card-header-modern h2 { margin: 3px 0 5px; color: var(--manager-ink); font-size: 17px; letter-spacing: -.02em; }
.manager-card-header-modern p { margin: 0; }
.manager-chart-link {
    flex: 0 0 auto;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #42675f;
    border: 1px solid #dbe8e4;
    border-radius: 10px;
    background: #f9fbfa;
    font-size: 10px;
    font-weight: 850;
    text-decoration: none;
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.manager-chart-link .ui-icon { width: 14px; height: 14px; }
.manager-chart-link:hover { color: #fff; border-color: #0f766e; background: #0f766e; }

.manager-pie-layout {
    min-height: 350px;
    padding: 28px 24px;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 24px;
}
.manager-pie-chart {
    position: relative;
    width: 205px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), 0 20px 40px rgba(31,77,69,.13);
}
.manager-pie-chart::after {
    content: '';
    position: absolute;
    inset: 29px;
    border: 1px solid #e6efec;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 24px rgba(21,67,59,.08);
}
.manager-pie-chart > div { position: relative; z-index: 1; display: grid; gap: 3px; text-align: center; }
.manager-pie-chart strong { color: var(--manager-ink); font-size: 37px; line-height: 1; letter-spacing: -.04em; }
.manager-pie-chart span { color: var(--manager-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.manager-pie-legend { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.manager-pie-row {
    min-height: 45px;
    padding: 10px 11px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    color: inherit;
    border: 1px solid #e4edeb;
    border-radius: 12px;
    background: #fbfdfc;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}
.manager-pie-row:hover { background: #f2f8f6; transform: translateY(-1px); }
.manager-pie-row > i { width: 9px; height: 9px; border-radius: 50%; }
.manager-pie-row span { color: #60776f; font-size: 9px; font-weight: 800; }
.manager-pie-row strong { color: var(--manager-ink); font-size: 14px; }
.manager-pie-completed > i { background: #1f9d76; }
.manager-pie-active > i { background: #f2a93b; }
.manager-pie-scheduled > i { background: #4a78d0; }
.manager-pie-cancelled > i { background: #d96a72; }

.manager-finance-summary-strip {
    padding: 16px 20px 2px;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 10px;
}
.manager-finance-summary-strip > span {
    min-height: 64px;
    padding: 12px 13px;
    display: grid;
    align-content: center;
    gap: 4px;
    border: 1px solid #e4edeb;
    border-radius: 13px;
    background: #fbfdfc;
}
.manager-finance-summary-strip small { color: #788a84; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.manager-finance-summary-strip strong { color: var(--manager-ink); font-size: 15px; }
.manager-finance-summary-strip .positive strong { color: #14795c; }
.manager-finance-summary-strip .negative strong { color: #bd4d56; }
.manager-dashboard-modern .finance-svg-wrap-modern { min-height: 300px; padding: 5px 14px 0; }
.manager-dashboard-modern .finance-trend-svg { min-width: 680px; }
.manager-dashboard-modern .finance-grid-line { stroke: #e9efed; stroke-dasharray: 3 5; }
.manager-dashboard-modern .finance-line { stroke-width: 3.5; }
.manager-dashboard-modern .finance-dot { transition: r .15s ease; }
.manager-dashboard-modern .finance-dot:hover { r: 7px; }
.finance-chart-legend-modern { padding: 5px 22px 19px; justify-content: flex-end; }

.manager-dashboard-modern .patient-registration-chart-modern {
    min-height: 300px;
    padding: 24px 22px 20px;
    background: linear-gradient(180deg,#fff,#fbfdfc);
}
.manager-dashboard-modern .patient-chart-column { height: 246px; }
.manager-dashboard-modern .patient-chart-column > span {
    height: 188px;
    border: 1px solid #eef3f1;
    background: linear-gradient(to top,#f7faf9,#fff);
}
.manager-dashboard-modern .patient-chart-column i {
    width: min(29px,74%);
    background: linear-gradient(180deg,#65c7b5,#0f766e);
    box-shadow: 0 10px 22px rgba(15,118,110,.2);
}
.manager-dashboard-modern .patient-chart-column:hover i { filter: saturate(1.15); }

.manager-health-card { overflow: hidden; }
.manager-health-metrics { padding: 17px; display: grid; gap: 10px; }
.manager-health-metrics > a {
    min-height: 88px;
    padding: 15px;
    display: grid;
    gap: 5px;
    color: inherit;
    border: 1px solid #e3ece9;
    border-radius: 15px;
    background: linear-gradient(145deg,#fbfdfc,#fff);
    text-decoration: none;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.manager-health-metrics > a:hover { transform: translateY(-2px); border-color: #b8d8d0; box-shadow: 0 9px 24px rgba(25,69,61,.08); }
.manager-health-metrics span { color: #71857f; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.manager-health-metrics strong { color: var(--manager-ink); font-size: 23px; }
.manager-health-metrics small { color: #7c8e88; font-size: 10px; }
.manager-health-metrics div { height: 6px; overflow: hidden; border-radius: 999px; background: #e8f0ee; }
.manager-health-metrics div i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#0f766e,#62c7b3); }

.manager-dashboard-modern .manager-detail-grid-modern {
    margin: 0;
    grid-template-columns: minmax(0,1.3fr) minmax(290px,.85fr) minmax(290px,.85fr);
}
.manager-dashboard-modern .manager-detail-grid-modern .card-header { min-height: 84px; }
.manager-dashboard-modern .manager-appointment-list > a,
.manager-dashboard-modern .manager-debtor-list > a,
.manager-dashboard-modern .manager-stock-list > a { min-height: 72px; }

@media (max-width: 1280px) {
    .manager-dashboard-modern .manager-kpi-grid-modern { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .manager-dashboard-modern .manager-detail-grid-modern { grid-template-columns: 1fr 1fr; }
    .manager-dashboard-modern .manager-today-card { grid-column: 1 / -1; }
}
@media (max-width: 1080px) {
    .manager-chart-layout,
    .manager-secondary-grid { grid-template-columns: 1fr; }
    .manager-pie-layout { grid-template-columns: minmax(220px,.7fr) minmax(280px,1fr); }
}
@media (max-width: 760px) {
    .manager-dashboard-modern .manager-dashboard-hero-modern { padding: 24px; align-items: flex-start; }
    .manager-hero-side { width: 100%; }
    .manager-dashboard-modern .manager-kpi-grid-modern,
    .manager-dashboard-modern .manager-detail-grid-modern { grid-template-columns: 1fr; }
    .manager-dashboard-modern .manager-today-card { grid-column: auto; }
    .manager-pie-layout { grid-template-columns: 1fr; }
    .manager-finance-summary-strip { grid-template-columns: 1fr; }
    .manager-card-header-modern { gap: 12px; }
    .manager-chart-link { padding: 7px 9px; }
}
@media (max-width: 480px) {
    .manager-dashboard-modern .manager-kpi-card { min-height: 118px; }
    .manager-pie-legend { grid-template-columns: 1fr; }
    .manager-pie-chart { width: 180px; }
}

/* DentalPro 3.10.1 — simplified MEDIBOX dashboard */
.medibox-dashboard { display: grid; gap: 18px; }
.medibox-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.medibox-kpi-card {
    position: relative;
    min-width: 0;
    min-height: 112px;
    padding: 15px 34px 14px 14px;
    display: grid;
    grid-template-columns: 38px minmax(0,1fr);
    align-items: start;
    gap: 11px;
    overflow: hidden;
    color: #183b35;
    border: 1px solid #dfeae7;
    border-radius: 17px;
    background: linear-gradient(145deg,#fff,#f8fbfa);
    box-shadow: 0 8px 24px rgba(22,65,57,.06);
    text-decoration: none;
    transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease;
}
.medibox-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #0f766e;
}
.medibox-kpi-card:hover { transform: translateY(-3px); border-color: #b9d8d1; box-shadow: 0 13px 30px rgba(22,65,57,.11); }
.medibox-kpi-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #0f766e;
    background: #eaf7f4;
}
.medibox-kpi-icon .ui-icon { width: 19px; height: 19px; }
.medibox-kpi-card small { display: block; min-height: 27px; color: #637d76; font-size: 10px; font-weight: 850; line-height: 1.25; text-transform: uppercase; letter-spacing: .035em; }
.medibox-kpi-card strong { display: block; margin-top: 3px; color: #163b34; font-size: clamp(18px,1.45vw,25px); line-height: 1.05; letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.medibox-kpi-card p { margin: 6px 0 0; color: #7b8f89; font-size: 9px; line-height: 1.25; }
.medibox-kpi-arrow { position: absolute; right: 11px; top: 13px; color: #8da19c; }
.medibox-kpi-arrow .ui-icon { width: 14px; height: 14px; }
.medibox-kpi-card.is-completed::before { background:#2f8f63; }
.medibox-kpi-card.is-completed .medibox-kpi-icon { color:#247451; background:#eaf8f1; }
.medibox-kpi-card.is-services::before { background:#8a67d1; }
.medibox-kpi-card.is-services .medibox-kpi-icon { color:#7352bb; background:#f3efff; }
.medibox-kpi-card.is-paid::before { background:#1e9b70; }
.medibox-kpi-card.is-paid .medibox-kpi-icon { color:#157b5a; background:#eaf8f2; }
.medibox-kpi-card.is-debt::before { background:#d2676f; }
.medibox-kpi-card.is-debt .medibox-kpi-icon { color:#b84d55; background:#fff0f1; }

.medibox-chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.medibox-chart-card { min-width: 0; overflow: hidden; border: 1px solid #dfeae7; border-radius: 19px; box-shadow: 0 9px 27px rgba(22,65,57,.06); }
.medibox-chart-header { min-height: 75px; padding: 16px 17px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid #edf3f1; }
.medibox-chart-header .eyebrow { margin: 0 0 3px; color:#80918c; font-size:9px; }
.medibox-chart-header h2 { margin:0; color:#183b35; font-size:16px; letter-spacing:-.02em; }
.medibox-chart-action { flex:0 0 auto; display:inline-flex; align-items:center; gap:4px; padding:7px 8px; color:#42675f; border:1px solid #dce8e5; border-radius:9px; background:#f9fbfa; font-size:9px; font-weight:850; text-decoration:none; }
.medibox-chart-action:hover { color:#fff; border-color:#0f766e; background:#0f766e; }
.medibox-chart-action .ui-icon { width:12px; height:12px; }
.medibox-line-chart-wrap { padding: 10px 9px 4px; overflow-x:auto; }
.medibox-line-chart { width:100%; min-width:430px; height:auto; display:block; }
.medibox-chart-gridline { stroke:#e8efed; stroke-width:1; stroke-dasharray:4 5; }
.medibox-line { fill:none; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.medibox-line-visits { stroke:#0f766e; }
.medibox-dot { stroke:#fff; stroke-width:2.5; }
.medibox-dot-visits { fill:#0f766e; }
.medibox-axis-label { fill:#7d918a; font-size:9px; font-weight:700; }
.medibox-pie-layout { min-height:260px; padding:21px 18px; display:grid; grid-template-columns:minmax(130px,.8fr) minmax(150px,1fr); align-items:center; gap:18px; }
.medibox-pie { position:relative; width:min(170px,100%); aspect-ratio:1; margin:auto; display:grid; place-items:center; border-radius:50%; box-shadow:0 14px 31px rgba(27,79,69,.13); }
.medibox-pie::after { content:''; position:absolute; inset:25px; border-radius:50%; background:#fff; box-shadow:inset 0 0 0 1px #e5eeeb; }
.medibox-pie > div { position:relative; z-index:1; display:grid; text-align:center; }
.medibox-pie strong { color:#173c35; font-size:28px; letter-spacing:-.04em; }
.medibox-pie span { color:#728780; font-size:9px; font-weight:850; text-transform:uppercase; }
.medibox-pie-legend { display:grid; gap:9px; }
.medibox-pie-legend > div { padding:10px 11px; display:grid; gap:4px; border:1px solid #e3ece9; border-radius:11px; background:#fbfdfc; }
.medibox-pie-legend span { color:#6d827b; font-size:9px; font-weight:800; }
.medibox-pie-legend strong { color:#183b35; font-size:14px; }
.medibox-pie-legend i { width:8px; height:8px; display:inline-block; margin-right:5px; border-radius:50%; vertical-align:middle; }
.medibox-pie-legend .is-paid i { background:#159776; }
.medibox-pie-legend .is-unpaid i { background:#e8eceb; border:1px solid #cbd8d4; }
.medibox-pie-legend .is-total { background:#f1f8f6; }

/* Unified material register tabs */
.material-module-tabs { margin-bottom:14px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.material-module-tabs a { min-height:52px; padding:10px 13px; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:9px; color:#527069; border:1px solid #dfe9e6; border-radius:13px; background:#fff; font-size:12px; font-weight:850; text-decoration:none; transition:.16s ease; }
.material-module-tabs a:hover { border-color:#b9d7d0; background:#f6fbf9; }
.material-module-tabs a.active { color:#fff; border-color:#0f766e; background:linear-gradient(135deg,#0f766e,#159776); box-shadow:0 8px 20px rgba(15,118,110,.18); }
.material-module-tabs .ui-icon { width:17px; height:17px; }
.material-module-tabs strong { min-width:25px; padding:3px 7px; text-align:center; border-radius:999px; color:inherit; background:rgba(15,118,110,.09); font-size:10px; }
.material-module-tabs a.active strong { background:rgba(255,255,255,.18); }
.payment-register-count { display:flex; justify-content:flex-end; padding:0 0 8px; }

/* Undo completed visit */
.appointment-undo-form { min-width:0; }
.appointment-undo-form .status-final-button { width:100%; }
.status-final-button.status-undo-button { border:1px solid #91b8dc; color:#285f91; background:#edf6ff; }
.status-final-button.status-undo-button:hover { box-shadow:0 6px 15px rgba(49,112,171,.17); }
.appointment-final-actions:has(.appointment-undo-form:not([hidden])) { grid-template-columns:repeat(3,minmax(0,1fr)); }

@media (max-width:1180px) {
    .medibox-kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .medibox-chart-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:900px) {
    .medibox-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .medibox-chart-grid { grid-template-columns:1fr; }
}
@media (max-width:650px) {
    .medibox-kpi-grid, .material-module-tabs { grid-template-columns:1fr; }
    .medibox-pie-layout { grid-template-columns:1fr; }
    .medibox-kpi-card { min-height:100px; }
}


/* Patient-linked notifications in the top-right application header */
.topbar-notifications { position:relative; flex:0 0 auto; }
.topbar-notifications > summary { list-style:none; }
.topbar-notifications > summary::-webkit-details-marker { display:none; }
.notification-trigger {
    position:relative; width:40px; height:40px; display:grid; place-items:center;
    color:#315e57; border:1px solid #d7e5e1; border-radius:12px;
    background:linear-gradient(180deg,#fff,#f7fbfa); cursor:pointer;
    box-shadow:0 7px 18px rgba(22,65,57,.07); transition:.16s ease;
}
.notification-trigger:hover,.topbar-notifications[open] .notification-trigger {
    color:#fff; border-color:#0f766e; background:linear-gradient(135deg,#0f766e,#159776);
    box-shadow:0 10px 23px rgba(15,118,110,.22); transform:translateY(-1px);
}
.notification-trigger .ui-icon { width:19px; height:19px; }
.notification-count {
    position:absolute; top:-6px; right:-6px; min-width:20px; height:20px; padding:0 5px;
    display:grid; place-items:center; color:#fff; border:2px solid #fff; border-radius:999px;
    background:#dc3f45; font-size:9px; font-weight:900; line-height:1;
}
.notification-popover {
    position:absolute; z-index:90; top:calc(100% + 12px); right:0; width:min(410px,calc(100vw - 28px));
    overflow:hidden; border:1px solid #d8e6e2; border-radius:17px; background:#fff;
    box-shadow:0 24px 60px rgba(14,52,46,.20);
}
.notification-popover::before {
    content:''; position:absolute; top:-7px; right:14px; width:13px; height:13px;
    border-left:1px solid #d8e6e2; border-top:1px solid #d8e6e2; background:#fff;
    transform:rotate(45deg);
}
.notification-popover-head {
    position:relative; z-index:1; min-height:67px; padding:13px 15px;
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    border-bottom:1px solid #e6efec; background:linear-gradient(180deg,#fff,#f8fbfa);
}
.notification-popover-head div { display:grid; gap:2px; }
.notification-popover-head small { color:#83958f; font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.08em; }
.notification-popover-head strong { color:#173d36; font-size:15px; }
.notification-popover-head > span {
    min-width:30px; height:30px; padding:0 8px; display:grid; place-items:center;
    color:#0f766e; border-radius:999px; background:#e7f5f1; font-size:12px; font-weight:900;
}
.notification-list { max-height:430px; overflow:auto; scrollbar-width:thin; scrollbar-color:#afcbc4 #edf4f2; }
.notification-item {
    min-height:76px; padding:11px 13px; display:grid; grid-template-columns:36px minmax(0,1fr) auto;
    align-items:center; gap:10px; color:inherit; border-bottom:1px solid #edf3f1; text-decoration:none;
    transition:background .15s ease;
}
.notification-item:hover { background:#f5faf8; }
.notification-item-icon {
    width:34px; height:34px; display:grid; place-items:center; border-radius:10px;
    color:#0f766e; background:#e8f5f2;
}
.notification-item.is-overdue .notification-item-icon { color:#bd383d; background:#fff0ef; }
.notification-item.is-today .notification-item-icon { color:#b66b09; background:#fff5df; }
.notification-item-icon .ui-icon { width:16px; height:16px; }
.notification-item-copy { min-width:0; display:grid; gap:2px; }
.notification-item-copy strong { overflow:hidden; color:#1c3e38; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.notification-item-copy small { overflow:hidden; color:#6e817c; font-size:9.5px; text-overflow:ellipsis; white-space:nowrap; }
.notification-item-copy em { overflow:hidden; color:#80918d; font-size:9px; font-style:normal; text-overflow:ellipsis; white-space:nowrap; }
.notification-item-date { display:inline-flex; align-items:center; gap:4px; color:#647b75; font-size:9px; font-weight:850; white-space:nowrap; }
.notification-item.is-overdue .notification-item-date { color:#bd383d; }
.notification-item.is-today .notification-item-date { color:#a76308; }
.notification-item-date .ui-icon { width:11px; height:11px; }
.notification-empty { min-height:170px; padding:24px; display:grid; place-items:center; align-content:center; gap:6px; text-align:center; }
.notification-empty .ui-icon { width:28px; height:28px; color:#159776; }
.notification-empty strong { color:#244b44; font-size:13px; }
.notification-empty span { color:#7a8d87; font-size:10px; }
.notification-popover-footer { padding:10px 13px; border-top:1px solid #e6efec; background:#fbfdfc; }
.notification-popover-footer a { display:flex; align-items:center; justify-content:center; gap:6px; color:#0f766e; font-size:10px; font-weight:900; text-decoration:none; }
.notification-popover-footer a:hover { color:#0b5f59; }
.notification-popover-footer .ui-icon { width:12px; height:12px; }
@media (max-width:650px) {
    .notification-popover { position:fixed; top:72px; right:10px; left:10px; width:auto; }
    .notification-popover::before { display:none; }
    .notification-list { max-height:calc(100vh - 190px); }
}

/* DentalPro 3.10.6 — unified vertical patient form and topbar action order */
.patient-unified-form { display:grid; width:100%; gap:18px; max-width:1520px; margin:0 auto; }
.patient-unified-intro { position:sticky; top:74px; z-index:12; display:flex; align-items:center; justify-content:space-between; gap:24px; padding:22px 28px; border-color:#dce9e5; box-shadow:0 12px 30px rgba(27,67,58,.08); }
.patient-unified-intro h2 { margin:2px 0 4px; color:#153d36; font-size:28px; }
.patient-unified-intro p:not(.eyebrow) { margin:0; color:#71847e; font-size:12px; }
.patient-unified-sections { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; }
.patient-unified-section { overflow:hidden; padding:0; border:1px solid #dfeae7; box-shadow:0 8px 24px rgba(23,61,53,.055); }
.patient-unified-section-head { display:flex; align-items:flex-start; gap:15px; padding:22px 26px; border-bottom:1px solid #e6efec; background:linear-gradient(180deg,#fbfdfc 0%,#f6faf8 100%); }
.patient-unified-section-head .section-icon { flex:0 0 48px; width:48px; height:48px; }
.patient-unified-section-head h2 { margin:1px 0 3px; color:#173d36; font-size:20px; }
.patient-unified-section-head p:not(.eyebrow) { margin:0; color:#748781; font-size:12px; }
.patient-unified-grid { padding:26px; gap:18px; }
.patient-unified-grid .field > span,.patient-unified-grid .field > legend { font-size:13px; }
.patient-unified-grid input,.patient-unified-grid select,.patient-unified-grid textarea { min-height:48px; font-size:14px; }
.patient-unified-grid textarea { min-height:122px; resize:vertical; }
.patient-unified-section-warning { border-color:#eadfc9; }
.patient-unified-section-warning .patient-unified-section-head { background:linear-gradient(180deg,#fffdf8 0%,#fff9ed 100%); border-color:#eee2cb; }
.patient-unified-photo-layout { display:grid; grid-template-columns:190px minmax(0,1fr); align-items:center; gap:26px; padding:26px; }
.patient-unified-photo-layout .patient-photo-preview { width:180px; height:180px; border-radius:24px; }
.patient-unified-photo-layout .upload-dropzone { min-height:138px; }
.patient-unified-submit { position:sticky; bottom:12px; z-index:11; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px 26px; border-color:#cfe1dc; background:rgba(255,255,255,.96); box-shadow:0 14px 34px rgba(20,59,51,.15); backdrop-filter:blur(12px); }
.patient-unified-submit > div:first-child { display:grid; gap:2px; }
.patient-unified-submit strong { color:#173d36; font-size:14px; }
.patient-unified-submit span { color:#788a85; font-size:11px; }
.top-actions { align-items:center; }
.top-actions > .btn-primary + .topbar-notifications { margin-left:2px; }
@media (max-width: 1180px) {
    .patient-unified-form { max-width:100%; }
    .patient-unified-intro { padding:20px 22px; }
    .patient-unified-section-head { padding:19px 21px; }
    .patient-unified-grid { padding:22px; gap:15px; }
}
@media (max-width: 820px) {
    .patient-unified-intro { position:static; align-items:flex-start; flex-direction:column; }
    .patient-unified-grid.form-grid.cols-3,.patient-unified-grid.form-grid.cols-2 { grid-template-columns:1fr; }
    .patient-unified-grid .span-2 { grid-column:auto; }
    .patient-unified-photo-layout { grid-template-columns:1fr; }
    .patient-unified-photo-layout .patient-photo-preview { margin:0 auto; }
    .patient-unified-submit { bottom:8px; align-items:flex-start; flex-direction:column; }
    .patient-unified-submit .patient-form-intro-actions { width:100%; }
    .patient-unified-submit .btn { flex:1; }
}


/* DentalPro 3.10.7 — patient form, finance filters, services and material catalog polish */
.patient-unified-intro { justify-content:flex-start; }
.patient-unified-submit > div:first-child span { color:#788a85; font-size:12px; }
.patient-unified-submit .btn-primary,
.patient-unified-submit .btn-primary span {
    color:#fff;
    font-size:13px;
    font-weight:850;
    opacity:1;
    visibility:visible;
}
.patient-unified-submit .btn { min-height:44px; padding-inline:18px; }
.payment-filter-row { grid-template-columns:minmax(240px,1.6fr) minmax(145px,.8fr) minmax(140px,.7fr) minmax(140px,.7fr) auto; }
.service-create-button { min-width:145px; }
.service-row-actions { justify-content:flex-end; }
.service-row-actions form { margin:0; }
.material-catalog-title h2 { margin:0; color:#173d36; font-size:21px; }
.material-catalog-table .material-code-column { width:170px; }
.material-catalog-table .material-stock-column { width:150px; }
.material-catalog-table .code-chip,
.material-stock-chip {
    min-width:104px;
    min-height:30px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 10px;
    border-radius:9px;
    font-size:11px;
    font-weight:850;
    line-height:1;
    white-space:nowrap;
}
.material-catalog-table .code-chip { color:#0f6d62; background:#eaf6f2; }
.material-stock-chip.is-available { color:#0d765e; background:#e9f8f1; }
.material-stock-chip.is-low { color:#b42318; background:#fff0ee; }
.catalog-inline-filter input[type="search"],
.catalog-inline-filter select,
.catalog-inline-filter .btn { min-height:42px; }

@media (max-width:1100px) {
    .payment-filter-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .payment-filter-actions { grid-column:1 / -1; }
}
@media (max-width:720px) {
    .payment-filter-row { grid-template-columns:1fr; }
    .payment-filter-actions { grid-column:auto; }
    .service-create-button { width:100%; min-width:0; }
}

/* Services module: services and service groups in one tabbed workspace */
.service-groups-table .is-muted-row {
    opacity: .68;
    background: #f8faf9;
}
.service-group-service-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 520px;
}
.service-group-service-list > span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid #dce9e5;
    border-radius: 999px;
    background: #f4faf8;
    color: #365f56;
    font-size: 11px;
    font-weight: 750;
}
.service-group-service-list > small {
    align-self: center;
    color: var(--muted);
    font-weight: 800;
}
.service-group-management-dialog {
    width: min(980px, calc(100% - 28px));
}
.service-group-management-card {
    width: 100%;
    max-height: calc(100vh - 28px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}
.service-group-management-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(280px, .75fr) minmax(430px, 1.25fr);
    gap: 18px;
    overflow: auto;
}
.service-group-main-fields,
.service-group-items-panel {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 13px;
}
.service-group-items-panel {
    padding-left: 18px;
    border-left: 1px solid #e2ebe8;
}
.service-group-items-heading > div {
    display: grid;
    gap: 2px;
}
.service-group-items-heading small {
    color: var(--muted);
    font-size: 11px;
}
.service-group-items {
    display: grid;
    gap: 8px;
}
.service-group-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px 36px;
    align-items: center;
    gap: 8px;
}
.service-group-item-row select,
.service-group-item-row input {
    min-width: 0;
}

@media (max-width: 780px) {
    .service-group-management-body {
        grid-template-columns: 1fr;
    }
    .service-group-items-panel {
        padding-left: 0;
        padding-top: 15px;
        border-left: 0;
        border-top: 1px solid #e2ebe8;
    }
    .service-group-item-row {
        grid-template-columns: minmax(0, 1fr) 78px 34px;
    }
}


/* DentalPro 3.10.13 — service tabs aligned with Materialno */
.service-module-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-module-tabs a { min-width: 0; }
.service-module-tabs a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 650px) {
    .service-module-tabs { grid-template-columns: 1fr; }
}

/* DentalPro 3.11.2 — unified typography, modal sizing, settings install and MEDIBOX branding */
.brand-mark-logo {
    overflow: hidden;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.brand-mark-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sidebar-brand {
    min-height: 54px;
    margin: 4px 0 2px;
    text-decoration: none;
}
.sidebar-brand .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 14px;
}
.sidebar-brand .brand-copy strong {
    color: #f7fffd;
    font-size: 16px;
    letter-spacing: .01em;
}
.sidebar-brand .brand-copy small {
    color: #9fd1c9;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.brand-login .brand-mark-logo {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 16px;
}

/* One visual rhythm across patient, service and material registries. */
body[data-active-menu="patients"] .content,
body[data-active-menu="services"] .content,
body[data-active-menu="materials"] .content {
    font-size: 15px;
    line-height: 1.45;
}
body[data-active-menu="patients"] .content h2,
body[data-active-menu="services"] .content h2,
body[data-active-menu="materials"] .content h2 {
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -.02em;
}
body[data-active-menu="patients"] .content .eyebrow,
body[data-active-menu="services"] .content .eyebrow,
body[data-active-menu="materials"] .content .eyebrow {
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: .075em;
}
body[data-active-menu="patients"] .content .data-table th,
body[data-active-menu="services"] .content .data-table th,
body[data-active-menu="materials"] .content .data-table th {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 800;
}
body[data-active-menu="patients"] .content .data-table td,
body[data-active-menu="services"] .content .data-table td,
body[data-active-menu="materials"] .content .data-table td,
body[data-active-menu="patients"] .content .data-table td strong,
body[data-active-menu="services"] .content .data-table td strong,
body[data-active-menu="materials"] .content .data-table td strong {
    font-size: 14px;
    line-height: 1.4;
}
body[data-active-menu="patients"] .content .field > span,
body[data-active-menu="services"] .content .field > span,
body[data-active-menu="materials"] .content .field > span,
body[data-active-menu="patients"] .content .field legend,
body[data-active-menu="services"] .content .field legend,
body[data-active-menu="materials"] .content .field legend {
    font-size: 13px;
    font-weight: 800;
}
body[data-active-menu="patients"] .content input,
body[data-active-menu="patients"] .content select,
body[data-active-menu="patients"] .content textarea,
body[data-active-menu="services"] .content input,
body[data-active-menu="services"] .content select,
body[data-active-menu="services"] .content textarea,
body[data-active-menu="materials"] .content input,
body[data-active-menu="materials"] .content select,
body[data-active-menu="materials"] .content textarea,
body[data-active-menu="patients"] .content .btn,
body[data-active-menu="services"] .content .btn,
body[data-active-menu="materials"] .content .btn {
    font-size: 14px;
}

/* All entity edit modals use one consistent professional size. */
.standard-edit-dialog {
    width: min(880px, calc(100vw - 28px)) !important;
    max-width: 880px !important;
    max-height: calc(100dvh - 28px) !important;
    border-radius: 20px;
}
.standard-edit-dialog > form,
.standard-edit-dialog > .modal-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    max-height: calc(100dvh - 28px) !important;
}
.standard-edit-dialog .modal-header,
.standard-edit-dialog .modal-footer {
    padding-left: 24px;
    padding-right: 24px;
}
.standard-edit-dialog .modal-body {
    padding: 22px 24px;
    overflow: auto;
}
.standard-edit-dialog .modal-footer {
    min-height: 72px;
}
.material-receipt-edit-dialog.standard-edit-dialog .modal-card,
.service-group-management-dialog.standard-edit-dialog .modal-card {
    width: 100% !important;
    max-width: none !important;
}

.module-mobile-install {
    border-color: #b7ded7;
    background: linear-gradient(145deg, #f0fffb, #f8fbff);
}
.module-mobile-install .settings-module-icon {
    color: #fff;
    background: linear-gradient(145deg, #18a896, #1769aa);
}
.topbar-brand-logo { display: none; width: 38px; height: 38px; flex: 0 0 38px; }
.topbar-brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }


/* DentalPro 3.11.3 — patient appointments and services register */
.patient-appointments-hero {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-color: #d6e6e2;
    background: linear-gradient(135deg,#ffffff 0%,#f4fbf9 100%);
}
.patient-appointments-person { min-width: 0; display: flex; align-items: center; gap: 14px; }
.patient-appointments-person h2 { margin: 2px 0 4px; color: #173f38; font-size: 22px; }
.patient-appointments-person p:last-child { margin: 0; color: #6b817c; }
.patient-appointments-hero-actions { display: flex; align-items: center; gap: 9px; }
.patient-appointments-summary {
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 10px;
}
.patient-appointments-summary article {
    min-height: 82px;
    padding: 14px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #dce9e5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24,70,62,.055);
}
.patient-appointments-summary article > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border-radius: 12px;
    color: #087d6d;
    background: #e9f7f3;
}
.patient-appointments-summary article > span .ui-icon { width: 19px; height: 19px; }
.patient-appointments-summary article div { min-width: 0; display: grid; gap: 2px; }
.patient-appointments-summary small { color: #718681; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.patient-appointments-summary strong { color: #173f38; font-size: 18px; line-height: 1.15; }
.patient-appointments-register { overflow: hidden; }
.patient-appointments-register-head { align-items: center; gap: 16px; }
.patient-appointments-register-head .section-title-with-icon > div > p:last-child { margin: 4px 0 0; color: #6e827d; font-size: 11px; }
.patient-appointments-filters { min-width: min(100%,520px); display: grid; grid-template-columns: minmax(250px,1fr) 180px; gap: 9px; }
.compact-search-box { min-height: 42px; }
.compact-select select { width: 100%; min-height: 42px; }
.patient-appointments-table { min-width: 1220px; }
.patient-appointments-table th:last-child,
.patient-appointments-table td:last-child { width: 168px; text-align: right; }
.appointment-date-cell,
.appointment-clinician-cell { display: grid; gap: 3px; }
.appointment-date-cell strong,
.appointment-clinician-cell strong { color: #244d46; }
.appointment-date-cell span,
.appointment-clinician-cell span { color: #7a8d88; font-size: 10px; }
.appointment-reason-text { max-width: 190px; display: block; color: #4e6963; white-space: normal; }
.appointment-service-list { min-width: 300px; display: flex; flex-wrap: wrap; gap: 6px; }
.appointment-service-chip {
    max-width: 260px;
    padding: 6px 8px;
    display: grid;
    gap: 2px;
    border: 1px solid #d7e8e3;
    border-radius: 10px;
    background: #f5fbf9;
}
.appointment-service-chip strong { overflow: hidden; color: #1f554b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.appointment-service-chip small { color: #738782; font-size: 8px; }
.appointment-no-services { color: #8a9b97; font-size: 10px; font-style: italic; }
.appointment-service-total { display: block; color: #173f38; white-space: nowrap; }
.patient-appointments-table td:nth-last-child(2) small { display: block; margin-top: 3px; color: #81918d; font-size: 9px; }
.appointment-open-action { min-width: 145px; justify-content: center; white-space: nowrap; }
.appointment-open-action .ui-icon:last-child { width: 14px; height: 14px; }
.appointment-open-action.is-disabled { cursor: not-allowed; opacity: .68; pointer-events: none; }
.patient-appointments-filter-empty { margin: 18px; }

@media (max-width: 1180px) {
    .patient-appointments-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .patient-appointments-register-head { align-items: stretch; flex-direction: column; }
    .patient-appointments-filters { width: 100%; min-width: 0; }
}
@media (max-width: 720px) {
    .patient-appointments-hero { padding: 15px; align-items: stretch; flex-direction: column; }
    .patient-appointments-person h2 { font-size: 19px; }
    .patient-appointments-hero-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .patient-appointments-hero-actions .btn { width: 100%; justify-content: center; }
    .patient-appointments-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .patient-appointments-summary article { min-height: 72px; padding: 11px; }
    .patient-appointments-summary article:last-child { grid-column: 1 / -1; }
    .patient-appointments-filters { grid-template-columns: 1fr; }
}

/* DentalPro 3.11.4 — modern visit services and related clinical records */
.visit-services-modern {
    padding: 0;
    overflow: hidden;
    scroll-margin-top: 96px;
}
.visit-services-head {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #dce9e5;
    background: linear-gradient(135deg, #ffffff 0%, #f3fbf8 100%);
}
.visit-services-title { min-width: 0; display: flex; align-items: center; gap: 14px; }
.visit-services-title-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #087f6f;
    background: #dff6ef;
    box-shadow: inset 0 0 0 1px #c4eadf;
}
.visit-services-title-icon .ui-icon { width: 23px; height: 23px; }
.visit-services-title h2 { margin: 1px 0 3px; color: #153f38; font-size: 22px; }
.visit-services-title p:last-child { margin: 0; color: #71857f; font-size: 12px; }
.visit-service-kpis {
    padding: 14px 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    border-bottom: 1px solid #e2ece9;
    background: #fbfdfc;
}
.visit-service-kpis article {
    min-height: 68px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid #dce9e5;
    border-radius: 13px;
    background: #fff;
}
.visit-service-kpis article > span {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #087f6f;
    background: #e9f8f3;
}
.visit-service-kpis article > span .ui-icon { width: 17px; height: 17px; }
.visit-service-kpis small,
.visit-service-kpis strong { display: block; }
.visit-service-kpis small { color: #758781; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.visit-service-kpis strong { margin-top: 2px; color: #173f38; font-size: 18px; }
.visit-services-body { padding: 20px 22px; }
.visit-services-empty { min-height: 250px; }
.visit-service-list { display: grid; gap: 12px; }
.visit-service-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #d8e6e2;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 81, 70, .06);
}
.visit-service-number {
    display: grid;
    place-items: center;
    color: #087f6f;
    background: #eff9f6;
    border-right: 1px solid #dce9e5;
    font-size: 15px;
    font-weight: 900;
}
.visit-service-content { min-width: 0; padding: 15px 16px 13px; }
.visit-service-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.visit-service-topline > div:first-child { min-width: 0; }
.visit-service-topline h3 { margin: 6px 0 0; color: #183f38; font-size: 17px; line-height: 1.25; }
.visit-service-code {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 8px;
    color: #087f6f;
    background: #e7f7f2;
    font: 800 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.visit-service-price { flex: 0 0 auto; text-align: right; }
.visit-service-price strong,
.visit-service-price small { display: block; }
.visit-service-price strong { color: #153f38; font-size: 19px; }
.visit-service-price small { margin-top: 3px; color: #778883; font-size: 10px; }
.visit-service-meta-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.visit-service-meta-row span {
    min-height: 29px;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 8px;
    color: #526a64;
    background: #f4f8f7;
    font-size: 11px;
}
.visit-service-meta-row .ui-icon { width: 14px; height: 14px; color: #178878; }
.visit-service-note {
    margin: 11px 0 0;
    padding: 10px 12px;
    border-left: 3px solid #b8dfd5;
    border-radius: 0 9px 9px 0;
    color: #556b66;
    background: #f8fbfa;
    font-size: 11px;
}
.visit-service-materials { margin-top: 12px; }
.visit-service-materials > small { display: block; margin-bottom: 6px; color: #7b8d87; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.visit-service-materials > div { display: flex; flex-wrap: wrap; gap: 6px; }
.visit-service-materials span {
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #dde8e5;
    border-radius: 8px;
    color: #526963;
    background: #fff;
    font-size: 10px;
}
.visit-service-materials .ui-icon { width: 13px; height: 13px; }
.visit-service-actions {
    margin: 13px -16px -13px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #e2ece9;
    background: #fbfdfc;
}
.visit-services-footer {
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid #dce9e5;
    background: #f7fbfa;
}
.visit-services-footer > div:first-child span,
.visit-services-footer > div:first-child strong { display: block; }
.visit-services-footer > div:first-child span { color: #71827d; font-size: 11px; font-weight: 750; }
.visit-services-footer > div:first-child strong { margin-top: 2px; color: #153f38; font-size: 25px; letter-spacing: -.025em; }
.visit-services-footer form { min-width: min(100%, 360px); }
.visit-services-footer form .btn { width: 100%; justify-content: center; }

.visit-related-section { display: grid; gap: 12px; }
.visit-related-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.visit-related-heading h2 { margin: 2px 0 0; color: #173f38; font-size: 20px; }
.visit-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.visit-related-card { padding: 0; overflow: hidden; }
.visit-related-card-head {
    min-height: 72px;
    padding: 14px 15px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e0ebe8;
    background: linear-gradient(135deg, #fff, #f6fbf9);
}
.visit-related-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #087f6f;
    background: #e5f7f1;
}
.visit-related-icon .ui-icon { width: 19px; height: 19px; }
.visit-related-card-head small { color: #84938f; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.visit-related-card-head h3 { margin: 1px 0 0; color: #173f38; font-size: 17px; }
.visit-teeth-list,
.visit-document-list { max-height: 360px; padding: 12px; display: grid; gap: 8px; overflow: auto; }
.visit-tooth-record,
.visit-document-row {
    padding: 10px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    border: 1px solid #e0eae7;
    border-radius: 10px;
    background: #fff;
}
.visit-tooth-shape,
.visit-document-row > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #087f6f;
    background: #eef8f5;
}
.visit-tooth-shape .ui-icon,
.visit-document-row > span .ui-icon { width: 17px; height: 17px; }
.visit-tooth-record strong,
.visit-tooth-record small,
.visit-document-row strong,
.visit-document-row small { display: block; }
.visit-tooth-record strong,
.visit-document-row strong { color: #244b44; font-size: 12px; }
.visit-tooth-record small,
.visit-document-row small { margin-top: 2px; color: #7c8d88; font-size: 9px; }
.visit-tooth-record p,
.visit-document-row p { margin: 5px 0 0; color: #647772; font-size: 10px; line-height: 1.4; }
.visit-document-row strong em {
    margin-left: 4px;
    padding: 2px 5px;
    border-radius: 5px;
    color: #087f6f;
    background: #e5f7f1;
    font-size: 8px;
    font-style: normal;
    text-transform: uppercase;
}
.visit-related-link {
    min-height: 42px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e0ebe8;
    color: #087f6f;
    background: #fbfdfc;
    font-size: 11px;
    font-weight: 800;
}
.visit-related-link .ui-icon { width: 15px; height: 15px; }

@media (max-width: 1180px) {
    .visit-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .visit-related-grid > article:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* DentalPro 3.11.5 — persistent visit actions and unified register tables */
.visit-action-footer-spacer { height: 102px; }
.visit-action-footer {
    position: fixed;
    left: calc(var(--sidebar) + 18px);
    right: 18px;
    bottom: 16px;
    z-index: 70;
    min-height: 76px;
    padding: 12px 14px 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #cfe2dc;
    border-radius: 17px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 18px 46px rgba(18,63,54,.18);
    backdrop-filter: blur(18px);
    transition: left .2s ease;
}
.visit-action-footer-summary { min-width: 0; }
.visit-action-footer-summary span,
.visit-action-footer-summary strong { display: block; }
.visit-action-footer-summary span {
    overflow: hidden;
    color: #6d817b;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.visit-action-footer-summary strong { margin-top: 2px; color: #153f38; font-size: 22px; }
.visit-action-footer-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.visit-action-footer-buttons form { margin: 0; }
.visit-action-footer-buttons .btn { min-width: 150px; min-height: 46px; }
.visit-services-summary-footer { min-height: 74px; }
.visit-services-summary-footer .success-banner { margin-left: auto; }

/* One visual language for Patients, Services, Finance, Materials, Suppliers and Invoices. */
.catalog-standard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.catalog-standard-table thead th {
    padding: 11px 13px;
    color: #60756f;
    background: #f3f8f6;
    border-top: 1px solid #e0ebe8;
    border-bottom: 1px solid #dce8e4;
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.catalog-standard-table thead th:first-child { border-left: 1px solid #e0ebe8; }
.catalog-standard-table thead th:last-child { border-right: 1px solid #e0ebe8; }
.catalog-standard-table tbody td {
    padding: 12px 13px;
    border-bottom: 1px solid #e7efec;
    color: #294a43;
    background: #fff;
    font-size: 12px;
    vertical-align: middle;
}
.catalog-standard-table tbody tr:nth-child(even) td { background: #fbfdfc; }
.catalog-standard-table tbody tr:hover td { background: #eff8f5; }
.catalog-standard-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 #0f766e; }
.catalog-standard-table tbody td:last-child,
.catalog-standard-table thead th:last-child { text-align: right; }
.catalog-standard-table .table-action-group { justify-content: flex-end; }
.catalog-standard-table .icon-action {
    width: 35px;
    min-width: 35px;
    height: 35px;
    min-height: 35px;
    border-radius: 10px;
}
.catalog-standard-table .table-subtext { color: #758781; font-size: 10.5px; }

@media (max-width: 980px) {
    .visit-action-footer { left: 12px; right: 12px; }
}


/* DentalPro 3.11.6 — module top actions and compact schedule settings */
.top-actions {
    margin-left: auto;
    justify-content: flex-end;
}
body[data-active-menu="settings"] .topbar-title-block {
    flex: 1;
}
.schedule-settings-modal {
    width: min(820px, calc(100% - 28px));
    max-height: none;
    overflow: visible;
}
.schedule-settings-modal > form {
    width: 100%;
    max-height: none;
    grid-template-rows: auto auto auto;
}
.schedule-settings-modal .modal-header,
.schedule-settings-modal .modal-footer {
    padding: 14px 18px;
}
.schedule-settings-modal .modal-body {
    padding: 14px 18px;
    overflow: visible;
}
.schedule-settings-modal .stack-form { gap: 11px; }
.schedule-settings-modal .settings-modal-lead {
    padding: 10px 12px;
    border-radius: 12px;
}
.schedule-settings-modal .settings-modal-lead > .ui-icon {
    width: 20px;
    height: 20px;
}
.schedule-settings-modal .form-grid { gap: 10px; }
.schedule-settings-modal .field > span,
.schedule-settings-modal .working-days-field legend {
    font-size: 11px;
}
.schedule-settings-modal .working-day-options { gap: 5px; }
.schedule-settings-modal .working-day-options span {
    min-height: 34px;
    padding: 6px 4px;
    border-radius: 9px;
    font-size: 10px;
}
.schedule-settings-modal .calendar-rule-note {
    padding: 9px 11px;
    border-radius: 10px;
}
.schedule-settings-modal .calendar-rule-note span { font-size: 11px; }

@media (max-width: 900px) {
    .schedule-settings-modal {
        width: calc(100vw - 16px) !important;
        max-width: 720px !important;
        height: auto !important;
        max-height: none !important;
        margin: auto !important;
        border-radius: 18px !important;
    }
    .schedule-settings-modal > form {
        height: auto !important;
        max-height: none !important;
        border-radius: 18px !important;
    }
    .schedule-settings-modal .modal-header {
        position: static;
        min-height: auto;
        padding-top: 13px !important;
    }
    .schedule-settings-modal .modal-body {
        padding: 10px 12px !important;
        overflow: visible !important;
    }
    .schedule-settings-modal .modal-footer {
        min-height: auto;
        padding: 10px 12px calc(10px + var(--mobile-safe-bottom)) !important;
    }
    .schedule-settings-modal .form-grid.cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .schedule-settings-modal .working-days-field { grid-column: 1 / -1 !important; }
    .schedule-settings-modal .working-day-options {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
    .schedule-settings-modal input,
    .schedule-settings-modal select {
        min-height: 40px;
        padding: 7px 8px;
        font-size: 14px !important;
    }
    .schedule-settings-modal .settings-modal-lead { display: none; }
    .schedule-settings-modal .calendar-rule-note { padding: 8px 10px; }
    .schedule-settings-modal .calendar-rule-note span { font-size: 10px; }
    .schedule-settings-modal .modal-footer .btn {
        min-height: 42px;
        width: auto;
        flex: 1;
    }
}

/* DentalPro 3.11.8 — cleaner patient visit register and structured service editors */
.patient-appointments-filter-head {
    justify-content: flex-end;
    padding: 16px 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f5faf8 100%);
}
.patient-appointments-filters {
    width: 100%;
    max-width: none;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(220px, 280px);
    gap: 12px;
}
.patient-appointment-filter-control {
    min-width: 0;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 15px;
    border: 1px solid #cfe0dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(27, 73, 65, .045);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.patient-appointment-filter-control:focus-within {
    border-color: #63aa9d;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .10), 0 8px 20px rgba(27, 73, 65, .06);
}
.patient-appointment-filter-control > .ui-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    color: #3f756b;
}
.patient-appointment-filter-control input,
.patient-appointment-filter-control select {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 0;
    border: 0;
    outline: 0;
    color: #244d46;
    background: transparent;
    box-shadow: none !important;
    font-size: 14px;
    font-weight: 700;
}
.patient-appointment-filter-control input::placeholder { color: #879893; font-weight: 600; }
.patient-appointment-status-control select { cursor: pointer; }

.service-edit-dialog .modal-body { background: #fbfdfc; }
.service-edit-form-grid { gap: 17px; }
.service-edit-active-field {
    margin-top: 2px;
    border-color: #d6e5e1;
    background: #f5faf8;
}

.service-group-management-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-content: start;
}
.service-group-details-panel,
.service-group-items-panel {
    min-width: 0;
    display: grid;
    gap: 14px;
    padding: 17px;
    border: 1px solid #dbe8e4;
    border-radius: 15px;
    background: #fff;
}
.service-group-items-panel {
    padding-left: 17px;
    border-left: 1px solid #dbe8e4;
}
.service-group-section-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}
.service-group-section-heading > div { min-width: 0; display: grid; gap: 2px; }
.service-group-section-heading strong { color: #214d45; font-size: 14px; }
.service-group-section-heading small { color: #748883; font-size: 11px; }
.section-icon-green { color: #087d6d; background: #e9f7f3; border-color: #cce9e1; }
.service-group-details-grid { align-items: end; }
.service-group-active-switch {
    min-height: 44px;
    align-self: end;
    justify-content: flex-start;
    padding: 10px 12px;
    border: 1px solid #d6e5e1;
    border-radius: 11px;
    background: #f7fbfa;
}
.service-group-items-heading {
    margin: 0;
    align-items: center;
}
.service-group-entry-table-wrap {
    border: 1px solid #dce8e5;
    border-radius: 13px;
    overflow-x: auto;
    background: #fff;
}
.service-group-entry-table {
    min-width: 760px;
}
.service-group-entry-table th {
    padding-top: 10px;
    padding-bottom: 10px;
    background: #f3f8f6;
}
.service-group-entry-table td {
    padding: 9px 10px;
}
.service-group-entry-table td:nth-child(2) { width: 110px; }
.service-group-entry-table td:nth-child(3),
.service-group-entry-table td:nth-child(4) { width: 145px; }
.service-group-entry-table td:last-child { width: 58px; text-align: right; }
.service-group-entry-table select,
.service-group-entry-table input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d2e0dc;
    border-radius: 9px;
    background: #fff;
    color: #284e47;
    padding: 8px 10px;
    outline: none;
}
.service-group-entry-table select:focus,
.service-group-entry-table input:focus {
    border-color: #65aa9d;
    box-shadow: var(--focus-ring);
}
.service-group-row-money {
    display: inline-block;
    color: #536d67;
    font-size: 12px;
    white-space: nowrap;
}
.service-group-line-total { color: #0f766e; }
.service-group-entry-table tfoot td {
    border-top: 1px solid #d8e6e2;
    border-bottom: 0;
    background: #f5faf8;
    color: #526e68;
    font-size: 12px;
    font-weight: 800;
}
.service-group-entry-table tfoot strong { color: #0b6f62; font-size: 14px; white-space: nowrap; }

@media (max-width: 780px) {
    .patient-appointments-filter-head { padding: 12px; }
    .patient-appointments-filters { grid-template-columns: 1fr; gap: 9px; }
    .patient-appointment-filter-control { min-height: 50px; }
    .service-edit-form-grid,
    .service-group-details-grid { grid-template-columns: 1fr; }
    .service-edit-form-grid .span-2,
    .service-group-details-grid .span-2 { grid-column: auto; }
    .service-group-details-panel,
    .service-group-items-panel { padding: 13px; }
    .service-group-items-heading { align-items: stretch; flex-direction: column; }
    .service-group-items-heading .btn { width: 100%; justify-content: center; }
}

/* DentalPro 3.11.9 — cleaner service headers and a larger compact group editor */
.catalog-toolbar-actions-only {
    justify-content: flex-end;
}
.catalog-toolbar-actions-only > .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
}

.service-group-management-dialog.standard-edit-dialog {
    width: min(1180px, calc(100vw - 28px)) !important;
    max-width: 1180px !important;
}
.service-group-management-dialog .service-group-management-body {
    gap: 14px;
}
.service-group-management-dialog .service-group-details-panel,
.service-group-management-dialog .service-group-items-panel {
    gap: 11px;
    padding: 14px 16px;
}
.service-group-items-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 34px;
}
.service-group-items-toolbar .btn {
    min-height: 32px;
    padding: 5px 11px;
    font-size: 11px;
}
.service-group-entry-table-wrap {
    overflow-x: auto !important;
    overflow-y: visible;
}
.service-group-entry-table {
    width: 100%;
    min-width: 900px;
    table-layout: fixed;
    font-size: 11px;
}
.service-group-entry-table th {
    padding: 7px 8px;
    font-size: 10px !important;
    line-height: 1.2;
    white-space: nowrap;
}
.service-group-entry-table td {
    padding: 6px 8px;
    font-size: 11px !important;
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
}
.service-group-entry-table th:first-child,
.service-group-entry-table td:first-child {
    width: auto;
}
.service-group-entry-table th:nth-child(2),
.service-group-entry-table td:nth-child(2) {
    width: 90px;
}
.service-group-entry-table th:nth-child(3),
.service-group-entry-table td:nth-child(3),
.service-group-entry-table th:nth-child(4),
.service-group-entry-table td:nth-child(4) {
    width: 125px;
}
.service-group-entry-table th:last-child,
.service-group-entry-table td:last-child {
    width: 54px;
}
.service-group-entry-table select,
.service-group-entry-table input {
    min-height: 34px;
    height: 34px;
    padding: 5px 8px;
    font-size: 11px !important;
    line-height: 1.15;
}
.service-group-entry-table select {
    text-overflow: ellipsis;
    white-space: nowrap;
}
.service-group-entry-table .service-group-row-money {
    font-size: 10.5px;
}
.service-group-entry-table .icon-action {
    width: 31px;
    height: 31px;
    min-width: 31px;
}
.service-group-entry-table tfoot td,
.service-group-entry-table tfoot strong {
    font-size: 11px !important;
}

@media (max-width: 780px) {
    .catalog-toolbar-actions-only > .toolbar-actions {
        justify-content: stretch;
    }
    .service-group-management-dialog .service-group-items-panel {
        padding: 12px;
    }
    .service-group-items-toolbar .btn {
        width: auto;
        margin-left: auto;
    }
}
.service-group-entry-table tbody {
    display: table-row-group;
}
.service-group-entry-table .service-group-item-row {
    display: table-row;
}

/* DentalPro 3.11.10 — simplified group header, standalone add action and unified save labels */
.service-group-management-dialog .modal-header > div {
    min-width: 0;
}
.service-group-management-dialog .modal-header h2 {
    margin: 0;
}
.service-group-items-toolbar {
    min-height: 38px;
    padding: 0 1px;
}
.service-group-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: 1px solid #b9d8d1;
    border-radius: 10px;
    color: #0b7567;
    background: #edf8f5;
    font: 800 23px/1 var(--font-family, inherit);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(22, 92, 80, .08);
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.service-group-add-button:hover {
    border-color: #7db9ad;
    background: #e2f4ef;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(22, 92, 80, .12);
}
.service-group-add-button:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}
.service-group-add-button span {
    display: block;
    transform: translateY(-1px);
}
@media (max-width: 780px) {
    .service-group-items-toolbar {
        justify-content: flex-end;
    }
    .service-group-add-button {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
}


/* DentalPro 3.11.11 — simplified service-group totals and scroll-free editor */
.service-group-management-dialog.standard-edit-dialog {
    width: min(1240px, calc(100vw - 20px)) !important;
    max-width: 1240px !important;
    max-height: none !important;
    overflow: visible !important;
}
.service-group-management-dialog .service-group-management-card {
    max-height: none !important;
    grid-template-rows: auto auto auto;
    overflow: visible !important;
}
.service-group-management-dialog .service-group-management-body {
    max-height: none !important;
    overflow: visible !important;
}
.service-group-management-dialog .service-group-entry-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
}
.service-group-management-dialog .service-group-entry-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}
.service-group-management-dialog .service-group-entry-table th:first-child,
.service-group-management-dialog .service-group-entry-table td:first-child { width: auto; }
.service-group-management-dialog .service-group-entry-table th:nth-child(2),
.service-group-management-dialog .service-group-entry-table td:nth-child(2) { width: 88px; }
.service-group-management-dialog .service-group-entry-table th:nth-child(3),
.service-group-management-dialog .service-group-entry-table td:nth-child(3),
.service-group-management-dialog .service-group-entry-table th:nth-child(4),
.service-group-management-dialog .service-group-entry-table td:nth-child(4) { width: 122px; }
.service-group-management-dialog .service-group-entry-table th:last-child,
.service-group-management-dialog .service-group-entry-table td:last-child { width: 52px; }
.service-group-add-button {
    width: auto;
    min-width: 0;
    height: 36px;
    padding: 0 13px;
    gap: 7px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}
.service-group-add-button span:first-child {
    font-size: 19px;
    line-height: 1;
    transform: translateY(-1px);
}
.service-group-add-button span:last-child {
    font-size: 12px;
    font-weight: 800;
    transform: none;
}
@media (max-width: 780px) {
    .service-group-management-dialog.standard-edit-dialog {
        width: calc(100vw - 10px) !important;
    }
    .service-group-management-dialog .modal-header,
    .service-group-management-dialog .modal-footer {
        padding-left: 13px;
        padding-right: 13px;
    }
    .service-group-management-dialog .modal-body {
        padding: 12px;
    }
    .service-group-management-dialog .service-group-details-panel,
    .service-group-management-dialog .service-group-items-panel {
        padding: 10px;
    }
    .service-group-management-dialog .service-group-entry-table {
        font-size: 9px;
    }
    .service-group-management-dialog .service-group-entry-table th,
    .service-group-management-dialog .service-group-entry-table td {
        padding: 5px 3px;
        font-size: 9px !important;
        white-space: normal;
    }
    .service-group-management-dialog .service-group-entry-table th:nth-child(2),
    .service-group-management-dialog .service-group-entry-table td:nth-child(2) { width: 48px; }
    .service-group-management-dialog .service-group-entry-table th:nth-child(3),
    .service-group-management-dialog .service-group-entry-table td:nth-child(3),
    .service-group-management-dialog .service-group-entry-table th:nth-child(4),
    .service-group-management-dialog .service-group-entry-table td:nth-child(4) { width: 61px; }
    .service-group-management-dialog .service-group-entry-table th:last-child,
    .service-group-management-dialog .service-group-entry-table td:last-child { width: 38px; }
    .service-group-management-dialog .service-group-entry-table select,
    .service-group-management-dialog .service-group-entry-table input {
        min-height: 31px;
        height: 31px;
        padding: 3px 4px;
        font-size: 9px !important;
    }
    .service-group-management-dialog .service-group-entry-table .service-group-row-money {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 8.5px !important;
    }
    .service-group-add-button {
        width: auto;
        min-width: 0;
        height: 34px;
        padding: 0 11px;
    }
}

/* DentalPro 3.12.0 — multi-clinic platform */
.platform-overview{display:flex;align-items:stretch;justify-content:space-between;gap:16px;margin-bottom:18px}.platform-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:12px;flex:1}.platform-kpi-card{display:flex;align-items:center;gap:12px;min-height:82px;padding:16px 18px;border:1px solid #dbe9e6;border-radius:16px;background:#fff;box-shadow:0 8px 28px rgba(15,118,110,.06)}.platform-kpi-card>span{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:#e8f8f5;color:#0f766e}.platform-kpi-card .ui-icon{width:21px;height:21px}.platform-kpi-card div{display:grid;gap:2px}.platform-kpi-card small{font-size:12px;color:#6b7f7b;font-weight:700}.platform-kpi-card strong{font-size:24px;line-height:1;color:#143c37}.platform-new-clinic{align-self:stretch;min-width:190px;justify-content:center}.platform-clinics-card .card-header{align-items:flex-start}.platform-clinics-table code,.platform-clinic-dialog code{font-size:11px;background:#eef6f4;border:1px solid #d8e8e4;border-radius:7px;padding:4px 7px;color:#315c56}.platform-clinic-name{display:flex;align-items:center;gap:10px}.platform-clinic-avatar{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;background:linear-gradient(145deg,#0f766e,#2dd4bf);color:#fff;font-size:12px;font-weight:850;flex:0 0 auto}.platform-clinic-name>div,.platform-users-summary,.platform-users-summary span{display:grid}.platform-clinic-name small,.platform-users-summary span{font-size:11px;color:#70837f}.platform-users-summary{gap:5px}.platform-users-summary b{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:#315c56}.platform-data-summary{display:flex;align-items:center;gap:12px}.platform-data-summary span{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:750}.platform-data-summary .ui-icon{width:15px;height:15px;color:#0f766e}.platform-clinic-dialog{width:min(980px,calc(100vw - 32px));max-width:980px}.platform-clinic-dialog .modal-body{max-height:min(72vh,760px);overflow:auto}.platform-clinic-form,.platform-edit-grid{display:grid;gap:14px}.platform-form-section{border:1px solid #dceae7;border-radius:15px;background:#fbfefd;padding:16px}.platform-form-section>header{display:flex;align-items:center;gap:11px;margin-bottom:14px}.platform-form-section>header>span{width:34px;height:34px;border-radius:10px;background:#e5f7f3;color:#0f766e;display:grid;place-items:center;font-size:13px;font-weight:850;flex:0 0 auto}.platform-form-section>header .ui-icon{width:18px;height:18px}.platform-form-section>header>div{display:grid;gap:2px}.platform-form-section>header strong{font-size:14px;color:#193f3a}.platform-form-section>header small{font-size:11px;color:#71817e}.platform-inline-form{display:grid;gap:0}.platform-section-actions{display:flex;justify-content:flex-end;margin-top:13px;padding-top:12px;border-top:1px solid #e1ece9}.platform-edit-grid{grid-template-columns:1fr}.platform-mobile-nav{grid-template-columns:repeat(2,minmax(0,1fr))}.app-body[data-active-menu="platform-clinics"] .top-actions{display:none}

@media(max-width:900px){.platform-overview{align-items:stretch;flex-direction:column}.platform-new-clinic{min-height:48px}.platform-kpi-grid{grid-template-columns:repeat(3,1fr)}.platform-clinics-table td[data-label="Корисници"]{min-width:220px}}
@media(max-width:680px){.platform-kpi-grid{grid-template-columns:1fr}.platform-kpi-card{min-height:68px}.platform-clinic-dialog{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;border-radius:0}.platform-clinic-dialog .modal-form{height:100%;display:flex;flex-direction:column}.platform-clinic-dialog .modal-body{max-height:none;flex:1}.platform-clinics-table thead{display:none}.platform-clinics-table,.platform-clinics-table tbody,.platform-clinics-table tr,.platform-clinics-table td{display:block;width:100%}.platform-clinics-table tr{padding:13px;border-bottom:1px solid #e1ece9}.platform-clinics-table td{display:flex;justify-content:space-between;gap:15px;padding:7px 0!important;border:0!important}.platform-clinics-table td::before{content:attr(data-label);font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:#7c8d89;font-weight:800}.platform-clinics-table td:first-child{display:block}.platform-clinics-table td:first-child::before{display:none}.platform-clinics-table .table-actions{justify-content:flex-end}.platform-clinics-table .table-actions::before{display:none}}

/* DentalPro 3.12.1 — manual clinic registration notice */
.platform-manual-mode {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid #d7e6e2;
    border-radius: 12px;
    background: #f7fbfa;
    color: #345f58;
    font-size: 12px;
    font-weight: 700;
}
.platform-manual-mode .ui-icon { width: 17px; height: 17px; }


/* DentalPro 3.13.5 — patient register status controls and compact dossier header */
.patient-records-search { display: flex; align-items: center; gap: 8px; }
.patient-records-status-filter { width: 148px; flex: 0 0 148px; }
.patient-records-status-filter select {
    width: 100%;
    min-height: 42px;
    padding: 9px 34px 9px 12px;
    color: #244c45;
    border: 1px solid #d6e4e0;
    border-radius: 11px;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
    outline: none;
    cursor: pointer;
}
.patient-records-status-filter select:focus { border-color: #5aa99a; box-shadow: 0 0 0 3px rgba(15,118,110,.11); }
.patient-records-table { min-width: 1420px; }
.patient-record-status-cell { min-width: 132px; }
.patient-status-toggle-form { margin: 0; display: inline-flex; }
.patient-status-toggle { display: inline-flex; align-items: center; gap: 7px; color: #697d78; font-size: 9px; font-weight: 900; cursor: pointer; user-select: none; }
.patient-status-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.patient-status-track { width: 31px; height: 18px; padding: 2px; display: inline-flex; align-items: center; border-radius: 999px; background: #cdd9d5; transition: background .16s ease; }
.patient-status-track i { width: 14px; height: 14px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20,52,46,.22); transition: transform .16s ease; }
.patient-status-toggle.is-active { color: #0f766e; }
.patient-status-toggle.is-active .patient-status-track { background: #14a58f; }
.patient-status-toggle.is-active .patient-status-track i { transform: translateX(13px); }
.patient-record-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; }
.patient-record-actions form { margin: 0; }
.patient-record-inactive { opacity: .72; }
.patient-record-inactive:hover { opacity: 1; }
.patient-workspace-grid { margin-top: 0; }
body[data-active-menu="patients"] .topbar-title-block h1 { max-width: min(920px, 70vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* DentalPro 3.13.6 — modern patient dossier identity and fully visible compact register */
.patient-dossier-topbar { min-width: 0; }
.patient-dossier-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #173f39;
    white-space: nowrap;
}
.patient-dossier-number,
.patient-dossier-meta {
    min-height: 28px;
    padding: 5px 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #d7e7e2;
    border-radius: 999px;
    background: #f5faf8;
    color: #54716a;
    font-size: 9px;
    font-weight: 850;
}
.patient-dossier-number {
    color: #0d7065;
    border-color: #bfe0d7;
    background: #eaf7f3;
    letter-spacing: .02em;
}
.patient-dossier-name {
    min-width: 0;
    max-width: min(390px, 34vw);
    overflow: hidden;
    color: #173f39;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.15;
    text-overflow: ellipsis;
}
.patient-dossier-meta .ui-icon { width: 13px; height: 13px; }
.patient-dossier-age { color: #785a14; border-color: #eadcad; background: #fff9e8; }

@media (min-width: 901px) {
    .patient-records-table-wrap { overflow-x: hidden; }
    .patient-records-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }
    .patient-records-table th,
    .patient-records-table td {
        padding: 7px 5px;
        overflow: hidden;
        font-size: 9px;
        text-overflow: ellipsis;
    }
    .patient-records-table th { font-size: 7.5px; letter-spacing: .035em; }
    .patient-records-table th:nth-child(1), .patient-records-table td:nth-child(1) { width: 3%; }
    .patient-records-table th:nth-child(2), .patient-records-table td:nth-child(2) { width: 18%; }
    .patient-records-table th:nth-child(3), .patient-records-table td:nth-child(3) { width: 10%; }
    .patient-records-table th:nth-child(4), .patient-records-table td:nth-child(4) { width: 11%; }
    .patient-records-table th:nth-child(5), .patient-records-table td:nth-child(5) { width: 9%; }
    .patient-records-table th:nth-child(6), .patient-records-table td:nth-child(6) { width: 6.5%; }
    .patient-records-table th:nth-child(7), .patient-records-table td:nth-child(7) { width: 5%; }
    .patient-records-table th:nth-child(8), .patient-records-table td:nth-child(8) { width: 8.5%; }
    .patient-records-table th:nth-child(9), .patient-records-table td:nth-child(9) { width: 8.5%; }
    .patient-records-table th:nth-child(10), .patient-records-table td:nth-child(10) { width: 11%; }
    .patient-records-table th:nth-child(11), .patient-records-table td:nth-child(11) { width: 9.5%; }
    .patient-record-person { min-width: 0; gap: 6px; }
    .patient-record-photo,
    .patient-record-avatar { width: 29px; height: 29px; flex-basis: 29px; border-radius: 8px; }
    .patient-record-avatar { font-size: 8px; }
    .patient-record-name { min-width: 0; overflow: hidden; }
    .patient-record-name-link,
    .patient-record-name strong { max-width: 100%; overflow: hidden; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
    .patient-record-name small { max-width: 100%; font-size: 7px; }
    .patient-record-code { max-width: 100%; padding: 3px 5px; font-size: 7.5px; }
    .patient-record-embg { font-size: 7.5px; }
    .patient-record-phone { font-size: 8px; }
    .patient-record-date strong { font-size: 8px; }
    .patient-record-date small { font-size: 7px; }
    .patient-records-table .badge { padding: 3px 5px; font-size: 7px; }
    .patient-status-toggle { gap: 4px; font-size: 7.5px; }
    .patient-status-track { width: 27px; height: 16px; }
    .patient-status-track i { width: 12px; height: 12px; }
    .patient-status-toggle.is-active .patient-status-track i { transform: translateX(11px); }
    .patient-record-actions { gap: 3px; }
    .patient-record-actions .icon-action { width: 27px; height: 27px; min-width: 27px; }
    .patient-record-actions .ui-icon { width: 13px; height: 13px; }
}

@media (max-width: 1120px) and (min-width: 901px) {
    .patient-records-table th,
    .patient-records-table td { padding-inline: 3px; font-size: 8px; }
    .patient-record-photo,
    .patient-record-avatar { display: none; }
    .patient-record-name small { display: none; }
    .patient-status-toggle strong { display: none; }
}

/* DentalPro 3.13.7 — patients table aligned with the shared catalog table design */
.patient-register-card { overflow: hidden; }
.patient-register-card .patient-records-toolbar {
    min-height: 0;
    align-items: center;
}
.patient-register-title { min-width: 150px; }
.patient-register-title h2 { margin: 0; color: #173f39; font-size: 17px; }
.patient-register-title .muted { margin: 3px 0 0; font-size: 10.5px; }
.patient-register-toolbar-actions { flex: 1; justify-content: flex-end; }
.patient-register-card .patient-records-search { flex: 1; justify-content: flex-end; }
.patient-register-card .patient-records-search > input[type="search"] { width: min(420px, 100%); }
.patient-register-card .patient-records-table-wrap {
    max-height: none;
    overflow: auto;
}
.patient-register-card .patient-records-table {
    width: 100%;
    min-width: 980px;
    table-layout: auto;
}
.patient-register-card .patient-records-table thead { position: static; }
.patient-register-card .patient-records-table th {
    width: auto !important;
    padding: 11px 13px;
    color: #60756f;
    background: #f3f8f6;
    border-top: 1px solid #e0ebe8;
    border-bottom: 1px solid #dce8e4;
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.patient-register-card .patient-records-table td {
    width: auto !important;
    padding: 12px 13px;
    color: #294a43;
    border-bottom: 1px solid #e7efec;
    background: #fff;
    font-size: 12px;
    vertical-align: middle;
    white-space: nowrap;
}
.patient-register-card .patient-records-table tbody tr:nth-child(even) td { background: #fbfdfc; }
.patient-register-card .patient-records-table tbody tr:hover td { background: #eff8f5; }
.patient-register-card .patient-records-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 #0f766e; }
.patient-register-card .patient-records-table tbody tr:hover { box-shadow: none; }
.patient-register-card .patient-record-index { width: 44px !important; }
.patient-register-card .patient-record-person { min-width: 210px; gap: 9px; }
.patient-register-card .patient-record-photo,
.patient-register-card .patient-record-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
}
.patient-register-card .patient-record-name-link { color: #173f39; font-size: 12px; font-weight: 850; }
.patient-register-card .patient-record-name small { max-width: 210px; font-size: 10px; }
.patient-register-card .patient-record-phone { font-size: 12px; }
.patient-register-card .patient-record-date strong { font-size: 11px; }
.patient-register-card .patient-record-date small { font-size: 10px; }
.patient-register-card .patient-record-status-cell { min-width: 126px; }
.patient-register-card .patient-status-toggle { font-size: 9.5px; }
.patient-register-card .patient-record-actions .icon-action {
    width: 35px;
    min-width: 35px;
    height: 35px;
    min-height: 35px;
    border-radius: 10px;
}

@media (max-width: 900px) {
    .patient-register-toolbar-actions { display: contents; }
    .patient-register-card .patient-records-table { min-width: 0; }
}

/* DentalPro 3.13.8 — unified Reviews register */
.reviews-register-card{overflow:hidden}
.reviews-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px}
.reviews-filter-form{display:grid;grid-template-columns:minmax(320px,1fr) minmax(190px,240px) auto auto;align-items:center;gap:10px;flex:1}
.reviews-search-field,.reviews-status-field{position:relative;display:flex;align-items:center;min-width:0}
.reviews-search-field>.ui-icon,.reviews-status-field>.ui-icon{position:absolute;left:13px;width:17px;height:17px;color:#6a7f7a;pointer-events:none;z-index:1}
.reviews-search-field input,.reviews-status-field select{width:100%;height:44px;border:1px solid #d6e4e1;border-radius:11px;background:#fff;color:#173b36;font-size:13px;font-weight:650;outline:none;transition:border-color .18s ease,box-shadow .18s ease}
.reviews-search-field input{padding:0 14px 0 40px}
.reviews-status-field select{padding:0 36px 0 40px;appearance:auto}
.reviews-search-field input:focus,.reviews-status-field select:focus{border-color:#58a99b;box-shadow:0 0 0 3px rgba(15,118,110,.1)}
.reviews-total-count{display:flex;align-items:baseline;gap:5px;min-width:max-content;padding:8px 11px;border:1px solid #dce9e6;border-radius:11px;background:#f6fbfa;color:#54716b}
.reviews-total-count strong{font-size:18px;color:#123f38}.reviews-total-count small{font-size:11px;font-weight:750}
.reviews-table{table-layout:fixed;width:100%}
.reviews-table th,.reviews-table td{padding:10px 11px;font-size:12px;vertical-align:middle}
.reviews-table th:nth-child(1){width:42px}.reviews-table th:nth-child(2){width:112px}.reviews-table th:nth-child(3){width:190px}.reviews-table th:nth-child(4){width:165px}.reviews-table th:nth-child(5){width:auto}.reviews-table th:nth-child(6){width:105px}.reviews-table th:nth-child(7){width:112px}.reviews-table th:nth-child(8){width:190px}
.review-date{display:grid;gap:1px}.review-date strong{font-size:12px;color:#183d38}.review-date small{font-size:11px;color:#6c7f7b}
.review-patient{display:grid;gap:2px;color:inherit;text-decoration:none;min-width:0}.review-patient strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#153f39}.review-patient small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:#71827e}.review-patient:hover strong{color:#0f766e}
.review-reason{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#425f5a}
.review-services-count{display:inline-flex;align-items:baseline;gap:4px}.review-services-count strong{font-size:14px;color:#173f39}.review-services-count small{font-size:10px;color:#6f827e;font-weight:750}
.review-status-badge{display:inline-flex;align-items:center;justify-content:center;min-height:27px;padding:5px 9px;border-radius:999px;font-size:10px;font-weight:850;white-space:nowrap;border:1px solid transparent}
.review-status-progress{background:#e7f2ff;color:#145aa0;border-color:#c8e1fb}.review-status-waiting{background:#fff7df;color:#91620c;border-color:#f3df9e}.review-status-completed{background:#e6f8ef;color:#14724d;border-color:#bee9d4}.review-status-cancelled{background:#f7f0f0;color:#8c4a4a;border-color:#ead5d5}.review-status-voided{background:#fff0e7;color:#a34716;border-color:#f4cdb7}.review-status-deleted{background:#eef1f3;color:#53626a;border-color:#d8dfe3}.review-status-neutral{background:#eef6f4;color:#42615c;border-color:#dbe9e6}
.review-row-voided td{background:#fffdfa}.review-row-deleted td{background:#f8f9fa;color:#74817f}
.reviews-row-actions{justify-content:flex-end;gap:6px}.reviews-row-actions form{margin:0}.reviews-row-actions .btn{min-height:34px;padding:7px 10px;font-size:10px}.reviews-row-actions .ui-icon{width:14px;height:14px}
.reviews-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 16px;border-top:1px solid #e3ecea;color:#647a75;font-size:11px}.reviews-pagination nav{display:flex;gap:8px}
.reviews-empty-state{padding:48px 20px}
.review-archive-alert{margin-bottom:14px;border-color:#efc8ad;background:#fff8f2;color:#81411d}.review-archive-alert strong{display:flex;align-items:center;gap:7px}.review-archive-alert .ui-icon{width:17px;height:17px}
@media(max-width:1180px){.reviews-filter-form{grid-template-columns:minmax(240px,1fr) 190px auto}.reviews-filter-form>.btn-light{display:none}.reviews-table th:nth-child(5),.reviews-table td:nth-child(5){display:none}.reviews-table th:nth-child(8){width:178px}}


/* DentalPro 3.13.9 — modern material filters and stronger page titles */
.topbar-title-block:not(.patient-dossier-topbar) h1 {
    margin: 0;
    color: #123f39;
    font-size: clamp(24px, 2vw, 30px);
    font-weight: 950;
    line-height: 1;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.material-catalog-toolbar {
    justify-content: flex-end;
    min-height: 72px;
}
.material-catalog-toolbar .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
}
.catalog-inline-filter {
    gap: 9px;
}
.catalog-filter-control {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    height: 46px;
    margin: 0;
    border: 1px solid #d5e4e0;
    border-radius: 13px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
    box-shadow: 0 5px 14px rgba(22, 69, 61, .045);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.catalog-filter-control:focus-within {
    border-color: #53a99a;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .10), 0 8px 20px rgba(22, 69, 61, .07);
    transform: translateY(-1px);
}
.catalog-filter-control > .ui-icon {
    position: absolute;
    left: 13px;
    width: 18px;
    height: 18px;
    color: #648079;
    pointer-events: none;
}
.catalog-filter-control input[type="search"],
.catalog-filter-control select {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0;
    padding: 0 14px 0 42px !important;
    border: 0 !important;
    border-radius: 12px !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #173f39;
    font-size: 13px;
    font-weight: 700;
}
.catalog-filter-search { width: min(360px, 32vw); }
.catalog-filter-select { width: min(205px, 20vw); }
.catalog-filter-select select {
    appearance: none;
    padding-right: 39px !important;
    cursor: pointer;
}
.catalog-filter-control .catalog-filter-chevron {
    right: 12px;
    left: auto;
    width: 16px;
    height: 16px;
}
.catalog-inline-filter > .btn {
    min-height: 46px;
    border-radius: 13px;
}

@media (max-width: 900px) {
    .topbar-title-block:not(.patient-dossier-topbar) h1 {
        font-size: 17px;
        letter-spacing: .03em;
    }
    .material-catalog-toolbar { min-height: 0; }
    .material-catalog-toolbar .toolbar-actions { justify-content: stretch; }
    .catalog-filter-search,
    .catalog-filter-select { width: 100%; }
    .catalog-filter-control { height: 44px; }
    .catalog-filter-control input[type="search"],
    .catalog-filter-control select { height: 42px !important; min-height: 42px !important; font-size: 12px; }
}

/* DentalPro 3.13.10 — compact main titles for core registers */
.app-body[data-active-menu="reviews"] .topbar-title-block:not(.patient-dossier-topbar) h1,
.app-body[data-active-menu="patients"] .topbar-title-block:not(.patient-dossier-topbar) h1,
.app-body[data-active-menu="materials"] .topbar-title-block:not(.patient-dossier-topbar) h1 {
    font-size: clamp(19px, 1.45vw, 22px);
    line-height: 1.08;
    letter-spacing: .025em;
}

@media (max-width: 900px) {
    .app-body[data-active-menu="reviews"] .topbar-title-block:not(.patient-dossier-topbar) h1,
    .app-body[data-active-menu="patients"] .topbar-title-block:not(.patient-dossier-topbar) h1,
    .app-body[data-active-menu="materials"] .topbar-title-block:not(.patient-dossier-topbar) h1 {
        font-size: 15px;
        letter-spacing: .02em;
    }
}

/* DentalPro 3.13.12 — language settings */
.settings-module-card.module-language .settings-module-icon {
    background: linear-gradient(145deg, #e8f5f2, #d7eeea);
    color: #0f766e;
}
.language-settings-modal {
    width: min(720px, calc(100vw - 32px));
}
.language-option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.language-option-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 12px;
    min-height: 88px;
    padding: 16px;
    border: 1px solid #dce8e5;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.language-option-card:hover {
    transform: translateY(-1px);
    border-color: #8fc5bb;
    box-shadow: 0 10px 24px rgba(15, 118, 110, .09);
}
.language-option-card.is-selected,
.language-option-card:has(input:checked) {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .11);
}
.language-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.language-option-code {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #edf7f5;
    color: #0f766e;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .06em;
}
.language-option-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.language-option-copy strong {
    color: #183b35;
    font-size: 15px;
}
.language-option-copy small {
    color: #71847f;
    font-size: 11px;
}
.language-option-check {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dce8e5;
    color: transparent;
}
.language-option-card.is-selected .language-option-check,
.language-option-card:has(input:checked) .language-option-check {
    background: #0f766e;
    color: #fff;
}
@media (max-width: 760px) {
    .language-option-grid { grid-template-columns: 1fr; }
    .language-option-card { min-height: 76px; }
}


/* DentalPro 3.13.16 — Medical Indigo + Mint theme
   Visual refresh only. No layout, modal size or functional changes. */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-soft: #eef2ff;
    --primary-lighter: #f6f4ff;
    --cyan: #0f766e;
    --cyan-soft: #e7fbf6;
    --indigo: #4f46e5;
    --indigo-soft: #eef2ff;
    --success: #10b981;
    --success-soft: #e7faf4;
    --warning: #d97706;
    --warning-soft: #fff7e5;
    --danger: #dc2626;
    --danger-soft: #fff1f2;
    --bg: #f4f7fb;
    --surface-soft: #f8fbff;
    --line: #d8e2ef;
    --text: #1f2a44;
    --muted: #6b7890;
    --shadow: 0 12px 34px rgba(52, 64, 154, .10);
    --focus-ring: 0 0 0 3px rgba(79, 70, 229, .18);
}

body {
    background:
        radial-gradient(circle at 92% 0, rgba(79, 70, 229, .08), transparent 25rem),
        radial-gradient(circle at 10% 100%, rgba(16, 185, 129, .08), transparent 26rem),
        linear-gradient(180deg, #fbfcff 0, var(--bg) 240px);
}

.sidebar {
    background:
        radial-gradient(circle at 15% 0, rgba(110, 231, 183, .16), transparent 26%),
        linear-gradient(180deg, #1f2554 0%, #242b67 58%, #171c45 100%);
    border-right: 1px solid rgba(255,255,255,.08);
    box-shadow: 12px 0 42px rgba(18, 24, 65, .22);
}
.brand-mark {
    background: linear-gradient(145deg, #10b981 0%, #4f46e5 58%, #3730a3 100%);
    box-shadow: 0 10px 24px rgba(59, 56, 157, .36);
}
.brand small,
.nav-item > .ui-icon,
.user-card small,
.logout-button > .ui-icon,
.sidebar-toggle {
    color: #b9c5f2;
}
.sidebar-toggle,
.user-card,
.logout-button {
    border-color: rgba(193, 202, 255, .12);
}
.nav-item.active {
    background: linear-gradient(105deg, #4f46e5 0%, #6366f1 100%);
    box-shadow: 0 10px 24px rgba(41, 48, 119, .34);
}
.nav-item:hover:not(.active),
.logout-button:hover,
.user-card:hover {
    background: rgba(255,255,255,.06);
}

.topbar {
    background: rgba(255,255,255,.92);
    border-bottom-color: #dde5f2;
    box-shadow: 0 6px 22px rgba(46, 57, 122, .05);
}
.topbar-brand-logo,
.topbar-brand-logo img { filter: drop-shadow(0 4px 10px rgba(79, 70, 229, .08)); }
.topbar-title-block h1,
.topbar-subtitle,
.card-header h2,
.card-header h3,
.section-title-with-icon h2,
.section-title-with-icon h3 {
    color: var(--text);
}
.topbar-subtitle,
.eyebrow,
.muted,
.table-subtext,
.field-help {
    color: var(--muted);
}

.card,
.modal-card,
.weekly-calendar-card,
.table-wrap,
.dp-simple-help-card {
    border-color: #dde5f2;
    box-shadow: 0 14px 36px rgba(45, 57, 126, .08);
}
.card:hover { border-color: #d4dff0; }

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    box-shadow: 0 9px 20px rgba(79, 70, 229, .24);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%);
    box-shadow: 0 12px 24px rgba(79, 70, 229, .28);
}
.btn-light {
    border-color: #d7e1ef;
    color: #334155;
    background: linear-gradient(180deg, #fff, #f8fbff);
}
.btn-light:hover {
    border-color: #b8c8e8;
    color: var(--primary);
    background: #f7f9ff;
}
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 9px 20px rgba(16, 185, 129, .22);
}
.icon-button,
.icon-action {
    border-color: #d8e1ee;
    background: linear-gradient(180deg, #fff, #f8fbff);
    color: #4a5a76;
}
.icon-button:hover,
.icon-action:hover {
    color: var(--primary);
    border-color: #bdccee;
    box-shadow: 0 7px 16px rgba(79, 70, 229, .12);
}
.icon-action-primary {
    color: white;
    border-color: transparent;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 7px 16px rgba(79, 70, 229, .20);
}
.icon-action-primary:hover { color:white; border-color:transparent; }

.section-icon {
    color: var(--primary);
    background: linear-gradient(145deg, #f3f4ff, #e8edff);
    border-color: #d8defb;
}
.section-icon-cyan {
    color: var(--success);
    background: var(--success-soft);
    border-color: #c9f0e4;
}
.section-icon-indigo {
    color: var(--indigo);
    background: var(--indigo-soft);
    border-color: #d9dafd;
}
.section-card-blue {
    background: linear-gradient(145deg, #ffffff 0%, #f8faff 100%);
    border-top-color: #6366f1;
}
.patient-hero-blue {
    background:
        linear-gradient(118deg, rgba(79, 70, 229, .06), rgba(16, 185, 129, .028) 42%, #fff 78%),
        #fff;
    border-left-color: var(--primary);
}

.field > span,
.gender-field legend {
    color: #3d4f6a;
}
.field input,
.field select,
.field textarea,
.search-form input,
.search-form select,
.search-form textarea {
    border-color: #d6deea;
    background: #fff;
    color: #24324a;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.search-form input:focus,
.search-form select:focus,
.search-form textarea:focus {
    border-color: #9ea9f4;
    box-shadow: var(--focus-ring);
}

.data-table thead th,
.catalog-standard-table thead th,
.settings-record-table thead th {
    color: #50617b;
    background: #f7f9fd;
    border-bottom-color: #dde4f0;
}
.data-table tbody tr:hover,
.settings-record-table tbody tr:hover {
    background: #fafcff;
}
.code-chip,
.treatment-code,
.pill,
.badge.badge-neutral {
    background: #eef2ff;
    color: var(--primary);
}
.badge-success,
.badge.badge-success {
    background: var(--success-soft);
    color: #0f8a61;
}

.weekly-calendar-card { border-color: #dbe3ef; box-shadow: 0 14px 38px rgba(41, 51, 118, .08); }
.calendar-toolbar-five-days,
.visit-command-header-compact {
    background: linear-gradient(180deg, #fff, #f8fbff);
    border-bottom-color: #dde5f2;
}
.calendar-current-date {
    border-color: #d4ddef;
    background: #fff;
}
.calendar-current-date strong,
.calendar-day-header strong,
.visit-header-fact strong { color: #29395b; }
.calendar-nav-arrow {
    border-color: #d4deef;
    color: #465882;
    background: linear-gradient(180deg, #fff, #f8fbff);
}
.calendar-legend {
    border-top-color: #eef3f8;
    border-bottom-color: #dde5f1;
    background: #fbfcff;
}
.calendar-corner,
.calendar-day-header {
    background: rgba(250, 251, 255, .97);
    border-bottom-color: #d7e0ec;
}
.calendar-day-header strong { color: #405371; }
.calendar-day-header span { color: #7a879c; }
.calendar-day-header.is-today {
    --calendar-today-text: #26375b;
    --calendar-today-muted: #60708d;
    background: linear-gradient(180deg, #f1f4ff, #fcfdff);
    box-shadow: inset 0 3px 0 #4f46e5;
}
.calendar-time-label {
    color: #748199;
    background: #f8fbff;
    border-right-color: #dde5f0;
}
.calendar-slot {
    border-color: #e4ebf4 !important;
    background: rgba(255,255,255,.82);
}
.calendar-slot.is-today { background: #fcfdff; }
.calendar-slot.is-current-slot {
    background: linear-gradient(90deg, rgba(79, 70, 229, .07), rgba(16, 185, 129, .04));
}
.slot-add-button {
    color: var(--primary);
    background: #eff2ff;
    border-color: #cfd7fb;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .12);
}
.calendar-appointment {
    border-color: #d7e1f0;
    background: linear-gradient(145deg, #fff, #f9fbff);
    box-shadow: 0 4px 12px rgba(52, 64, 154, .08);
}
.calendar-appointment:hover,
.calendar-appointment:focus-visible { box-shadow: 0 8px 18px rgba(52, 64, 154, .14); }
.appointment-card-top > strong,
.calendar-appointment h3 { color: #253657; }

.topbar-status-card[aria-pressed="true"] {
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}
.topbar-status-exam {
    border-color: #ccefe3;
    background: linear-gradient(135deg, #fff, #eefcf6);
}
.topbar-status-exam > span {
    color: #0f8a61;
    background: #e0f8ee;
}

.stat-icon,
.summary-icon,
.empty-icon,
.avatar-soft {
    background: linear-gradient(145deg, #f1f4ff, #e8eeff);
    color: var(--primary);
}
.modal-dialog::backdrop { background: rgba(22, 27, 60, .58); }

.mobile-nav,
.mobile-more-sheet,
.mobile-nav-sheet-card {
    border-color: #dde5f2;
    box-shadow: 0 18px 44px rgba(39, 47, 108, .14);
}


/* DentalPro 3.13.17 — complete Medical Indigo + Mint coverage */
.material-module-tabs a.active,
.service-module-tabs a.active {
    color: #fff;
    border-color: #4f46e5;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 8px 20px rgba(79, 70, 229, .20);
}
.material-module-tabs a:not(.active):hover,
.service-module-tabs a:not(.active):hover {
    color: #4f46e5;
    border-color: #cbd3fb;
    background: #f5f7ff;
}
.material-module-tabs a strong,
.service-module-tabs a strong {
    background: rgba(16, 185, 129, .13);
    color: #0f8a61;
}
.material-module-tabs a.active strong,
.service-module-tabs a.active strong {
    color: #fff;
    background: rgba(255,255,255,.18);
}

.payment-installment-button,
.patient-status-toggle.is-active,
.notification-popover-footer a,
.review-patient:hover strong,
.service-group-line-total,
.supplier-avatar,
.manager-appointment-list time,
.manager-debtor-list .avatar,
.platform-data-summary .ui-icon {
    color: #4f46e5;
}
.payment-installment-button,
.supplier-avatar,
.manager-kpi-card > span,
.manager-debtor-list .avatar,
.platform-kpi-card > span,
.platform-form-section > header > span {
    background: #eef2ff;
    border-color: #d8defb;
}
.payment-installment-button:hover,
.patient-status-toggle.is-active:hover {
    color: #3730a3;
    border-color: #bfc8f7;
    background: #e7ebff;
}

.manager-kpi-card,
.platform-kpi-card,
.platform-form-section,
.notification-popover,
.settings-module-card,
.patient-register-card,
.reviews-register-card,
.catalog-table-card {
    border-color: #dde5f2;
    box-shadow: 0 10px 28px rgba(45, 57, 126, .07);
}
.manager-kpi-card:hover,
.platform-kpi-card:hover,
.settings-module-card:hover {
    border-color: #cbd4ef;
    box-shadow: 0 14px 32px rgba(45, 57, 126, .11);
}
.manager-kpi-card:hover .manager-card-arrow,
.manager-chart-link:hover,
.medibox-chart-action:hover {
    color: #fff;
    border-color: #4f46e5;
    background: #4f46e5;
}

.patient-chart-column i,
.manager-health-metrics div i {
    background: linear-gradient(180deg, #34d399, #10b981);
    box-shadow: 0 8px 18px rgba(16,185,129,.18);
}
.legend-realized i,
.medibox-line-visits,
.finance-line-realized { stroke: #4f46e5; background: #4f46e5; }
.medibox-dot-visits,
.finance-dot-realized { fill: #4f46e5; }

.catalog-standard-table tbody tr:hover td:first-child,
.patient-register-card .patient-records-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 #4f46e5;
}
.review-patient strong,
.platform-form-section > header strong,
.platform-clinic-name strong,
.settings-module-card strong {
    color: #253657;
}
.platform-clinic-avatar {
    background: linear-gradient(145deg, #4f46e5, #10b981);
}
.platform-clinics-table code,
.platform-clinic-dialog code {
    color: #414ba3;
    background: #f0f3ff;
    border-color: #dbe0fa;
}

.language-option-card.is-selected {
    border-color: #8f98ee;
    background: linear-gradient(145deg, #f3f4ff, #edfbf6);
    box-shadow: 0 0 0 3px rgba(79,70,229,.10);
}
.language-option-code,
.language-option-check {
    color: #4f46e5;
    background: #eef2ff;
}

.settings-module-card.module-language .settings-module-icon,
.settings-module-card.module-clinic .settings-module-icon,
.settings-module-card.module-dentists .settings-module-icon,
.settings-module-card.module-schedule .settings-module-icon,
.settings-module-card.module-mobile .settings-module-icon {
    color: #4f46e5;
    background: linear-gradient(145deg, #eef2ff, #e8faf4);
    border-color: #d7def7;
}

.notification-trigger.has-notifications,
.patient-notification-trigger.has-notifications {
    color: #4f46e5;
    border-color: #cbd3f5;
    background: #f2f4ff;
}
.notification-count,
.patient-notification-count {
    background: #10b981;
    color: #fff;
}

.service-group-add-button,
.receipt-row-add,
.receipt-add-supplier {
    color: #4f46e5;
    border-color: #cad2f4;
    background: linear-gradient(145deg, #f2f4ff, #ecfbf6);
}
.service-group-add-button:hover,
.receipt-row-add:hover,
.receipt-add-supplier:hover {
    color: #3730a3;
    border-color: #aeb8ed;
    background: #e9edff;
}

.visit-command-modal-maximized,
.clinical-workspace,
.patient-dossier-shell {
    background: #f4f7fb;
}
.visit-module-card,
.visit-record-section,
.tooth-status-module,
.patient-dossier-card {
    border-color: #dde5f2;
    background: #fff;
}
.visit-module-title > span,
.selected-teeth-counter,
.record-count-badge {
    color: #4f46e5;
    background: #eef2ff;
}
.tooth-status-form button.selected,
.multi-tooth-picker button.selected {
    color: #fff;
    border-color: #4f46e5;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.finance-summary-card.is-positive,
.payment-installment-summary span:nth-child(2) {
    border-color: #c8efdf;
    background: #effcf7;
}
.finance-summary-card.is-primary,
.payment-installment-summary span:first-child {
    border-color: #d5daf8;
    background: #f4f5ff;
}

.auth-shell,
.login-page {
    background:
        radial-gradient(circle at 85% 8%, rgba(79,70,229,.12), transparent 25rem),
        radial-gradient(circle at 10% 90%, rgba(16,185,129,.11), transparent 24rem),
        #f4f7fb;
}


/* Medibox 3.13.18 — branding and uppercase module titles */
.topbar-title-block > h1 {
    text-transform: uppercase;
    letter-spacing: .015em;
}
.patient-register-title > h2 {
    text-transform: uppercase;
    letter-spacing: .02em;
}
.login-visual {
    align-items: center;
    justify-content: center;
    text-align: center;
}
.brand-login {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 0;
}
.brand-login .brand-mark-logo {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    border-radius: 22px;
}
.brand-login strong {
    color: #fff;
    font-size: 32px;
    font-weight: 850;
    letter-spacing: -.025em;
}


/* Medibox 3.13.19 — compact login window only
   No other modal, page or functional dimensions are changed. */
.auth-shell {
    padding: 20px;
}
.login-card {
    width: min(690px, 100%);
    min-height: 390px;
    grid-template-columns: 230px minmax(0, 1fr);
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(35, 42, 96, .18);
}
.login-visual {
    min-height: 0;
    padding: 24px;
}
.brand-login {
    gap: 13px;
}
.brand-login .brand-mark-logo {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 18px;
}
.brand-login strong {
    font-size: 26px;
}
.login-form-wrap {
    padding: 36px 38px;
}
.login-form-header {
    margin-bottom: 20px;
}
.login-form-header h1 {
    margin-bottom: 5px;
    font-size: 25px;
}
.login-form-header > p:last-child {
    font-size: 12px;
}
.login-card .stack-form {
    gap: 14px;
}
.login-card .field input {
    min-height: 42px;
}
.login-card .btn-block {
    min-height: 43px;
}

@media (max-width: 720px) {
    .auth-shell {
        padding: 12px;
    }
    .login-card {
        width: min(420px, 100%);
        min-height: 0;
        grid-template-columns: 1fr;
        border-radius: 18px;
    }
    .login-visual {
        min-height: 112px;
        padding: 17px 20px;
    }
    .brand-login {
        flex-direction: row;
        gap: 12px;
    }
    .brand-login .brand-mark-logo {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 15px;
    }
    .brand-login strong {
        font-size: 24px;
    }
    .login-form-wrap {
        padding: 27px 24px 29px;
    }
    .login-form-header {
        margin-bottom: 18px;
    }
    .login-form-header h1 {
        font-size: 23px;
    }
}


/* Medibox 3.13.21 — unified module title typography
   All primary module titles use the same typography as the Patients register. */
.topbar-title-block > h1,
.patient-register-title > h2,
.platform-clinics-card > .card-header h2,
.inventory-page-header h2,
.material-page-header h2,
.payment-page-header h2,
.reviews-page-header h2,
.services-page-header h2,
.settings-page-header h2 {
    margin:0;
    color:#1f2a44;
    font-family:var(--font-family, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    font-size:17px;
    font-weight:850;
    line-height:1.15;
    letter-spacing:.02em;
    text-transform:uppercase;
}
.topbar-title-block > h1 { white-space:nowrap; }
@media (max-width:720px) {
    .topbar-title-block > h1,
    .patient-register-title > h2 { font-size:15px; }
}


/* Medibox 3.13.22 — Services, Inventory and Settings titles match Patients */
.module-page-title.patient-register-title {
    min-width:150px;
    margin:0 0 12px;
    padding:0 2px;
}
.module-page-title.patient-register-title > h2 {
    margin:0;
    color:#1f2a44;
    font-family:var(--font-family, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    font-size:17px;
    font-weight:850;
    line-height:1.15;
    letter-spacing:.02em;
    text-transform:uppercase;
}
@media (max-width:720px) {
    .module-page-title.patient-register-title { margin-bottom:10px; }
    .module-page-title.patient-register-title > h2 { font-size:15px; }
}


/* Medibox 3.13.23 — unified operational titles in top bar only
   Patients, Reviews, Services and Materials share one identical topbar title style. */
body[data-active-menu="patients"] .topbar-title-block > h1,
body[data-active-menu="reviews"] .topbar-title-block > h1,
body[data-active-menu="services"] .topbar-title-block > h1,
body[data-active-menu="materials"] .topbar-title-block > h1 {
    margin:0;
    color:#1f2a44;
    font-family:var(--font-family, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    font-size:17px;
    font-weight:850;
    line-height:1.15;
    letter-spacing:.02em;
    text-transform:uppercase;
    white-space:nowrap;
}
@media (max-width:720px) {
    body[data-active-menu="patients"] .topbar-title-block > h1,
    body[data-active-menu="reviews"] .topbar-title-block > h1,
    body[data-active-menu="services"] .topbar-title-block > h1,
    body[data-active-menu="materials"] .topbar-title-block > h1 { font-size:15px; }
}


/* Medibox 3.13.24 — topbar-only module titles and identical typography */
body[data-active-menu="patients"] .topbar-title-block > h1,
body[data-active-menu="reviews"] .topbar-title-block > h1,
body[data-active-menu="services"] .topbar-title-block > h1,
body[data-active-menu="payments"] .topbar-title-block > h1,
body[data-active-menu="materials"] .topbar-title-block > h1,
body[data-active-menu="settings"] .topbar-title-block > h1 {
    margin:0;
    color:#1f2a44;
    font-family:var(--font-family, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    font-size:17px;
    font-weight:850;
    line-height:1.15;
    letter-spacing:.02em;
    text-transform:uppercase;
    white-space:nowrap;
}
.patient-records-toolbar-titleless { justify-content:flex-end; }
.patient-records-toolbar-titleless .patient-register-toolbar-actions { width:100%; justify-content:flex-end; }
@media (max-width:720px) {
    body[data-active-menu="patients"] .topbar-title-block > h1,
    body[data-active-menu="reviews"] .topbar-title-block > h1,
    body[data-active-menu="services"] .topbar-title-block > h1,
    body[data-active-menu="payments"] .topbar-title-block > h1,
    body[data-active-menu="materials"] .topbar-title-block > h1,
    body[data-active-menu="settings"] .topbar-title-block > h1 { font-size:15px; }
}


/* Medibox 3.13.26 — larger clinic name */
.sidebar-brand .brand-copy strong {
    max-width: 210px;
    font-size: 20px;
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -.015em;
}
html.sidebar-expanded .sidebar .brand-copy {
    max-width: 210px;
}
html.sidebar-expanded .sidebar .brand {
    gap: 13px;
}
@media (max-width: 720px) {
    .sidebar-brand .brand-copy strong {
        font-size: 18px;
    }
}


/* Medibox 3.13.43 — invoice toolbar alignment */
.invoice-register-toolbar {
    width: 100%;
    justify-content: stretch;
}
.invoice-register-filter-form {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: center;
    gap: 14px;
}
.invoice-register-search {
    width: min(390px, 100%);
}
.invoice-register-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-left: auto;
}
.invoice-register-actions .catalog-filter-select {
    width: 205px;
}
.invoice-register-actions .btn,
.invoice-register-actions .icon-action {
    flex: 0 0 auto;
}
@media (max-width: 980px) {
    .invoice-register-filter-form {
        grid-template-columns: 1fr;
    }
    .invoice-register-search {
        width: 100%;
    }
    .invoice-register-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}
@media (max-width: 640px) {
    .invoice-register-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .invoice-register-actions .catalog-filter-select {
        width: 100%;
        grid-column: 1 / -1;
    }
    .invoice-register-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Clinical review header: doctor beside Profile + date card in visit entry */
.clinical-patient-head .patient-identity {
    flex: 1 1 auto;
    min-width: 250px;
}
.clinical-patient-head-actions {
    flex: 0 0 auto;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}
.clinical-doctor-card {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 6px 11px 6px 8px;
    border: 1px solid #d6e8e3;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(239,249,246,.98), rgba(255,255,255,.98));
    box-shadow: 0 4px 14px rgba(28,78,68,.06);
}
.clinical-doctor-card-icon {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 27px;
    border-radius: 9px;
    background: #e0f2ed;
    color: #24695d;
}
.clinical-doctor-card-icon svg { width: 15px; height: 15px; }
.clinical-doctor-card > span:last-child { display: grid; line-height: 1.12; }
.clinical-doctor-card small {
    color: #71867f;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.clinical-doctor-card strong {
    margin-top: 2px;
    color: #214f46;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.clinical-visit-entry-title-date {
    justify-content: flex-start;
}
.clinical-visit-datetime-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 45px;
    padding: 7px 14px 7px 8px;
    border: 1px solid #d2e7e1;
    border-radius: 13px;
    background: linear-gradient(135deg, #f2faf8 0%, #ffffff 100%);
    box-shadow: 0 5px 18px rgba(29,83,72,.07);
}
.clinical-visit-datetime-icon {
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #dff2ed;
    color: #246b5f;
}
.clinical-visit-datetime-icon svg { width: 16px; height: 16px; }
.clinical-visit-datetime-card strong {
    color: #1f5248;
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .01em;
    white-space: nowrap;
}
@media (max-width: 760px) {
    .clinical-patient-head { flex-wrap: wrap; }
    .clinical-patient-head .patient-identity,
    .clinical-patient-head-actions { width: 100%; min-width: 0; }
    .clinical-patient-head-actions { justify-content: space-between; }
    .clinical-doctor-card { min-width: 0; flex: 1 1 auto; }
    .clinical-doctor-card strong { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 460px) {
    .clinical-patient-head-actions { align-items: stretch; flex-direction: column; }
    .clinical-doctor-card { width: 100%; }
    .clinical-patient-head-actions .btn { width: 100%; justify-content: center; }
    .clinical-visit-datetime-card { width: 100%; }
}


/* Current project — new review patient header matches patient profile */
.clinical-profile-hero { margin-bottom: 14px; }
.clinical-profile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    min-width: 0;
}
.clinical-profile-actions .patient-profile-schedule-button { flex: 0 0 auto; }
@media (max-width: 900px) {
    .clinical-profile-hero .patient-profile-v2-main { grid-template-columns: auto minmax(0,1fr); }
    .clinical-profile-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 620px) {
    .clinical-profile-actions { align-items: stretch; flex-direction: column; }
    .clinical-profile-actions .clinical-doctor-card,
    .clinical-profile-actions .patient-profile-schedule-button { width: 100%; justify-content: center; }
}

/* Current project — simplified clinical profile bar */
.clinical-profile-hero .patient-profile-v2-main {
    grid-template-columns: auto minmax(0, 1fr);
}
.clinical-profile-quickbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 12px;
    border-top: 1px solid #e5eeeb;
}
.clinical-profile-link-card,
.clinical-profile-datetime-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid #d7e7e2;
    border-radius: 11px;
    background: #fff;
    color: #245f55;
    box-shadow: 0 3px 12px rgba(29,83,72,.055);
    text-decoration: none;
}
.clinical-profile-link-card {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
}
.clinical-profile-link-card:hover {
    border-color: #bad8d0;
    background: #f5fbf9;
}
.clinical-profile-link-card svg,
.clinical-profile-datetime-card svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}
.clinical-profile-datetime-card {
    background: linear-gradient(135deg, #f3faf8 0%, #ffffff 100%);
}
.clinical-profile-datetime-card strong {
    color: #1f5248;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}
.clinical-profile-hero + .allergy-detail-dialog + .clinical-visit-entry-board,
.clinical-profile-hero + .clinical-visit-entry-board {
    margin-top: 0;
}
@media (max-width: 560px) {
    .clinical-profile-quickbar {
        align-items: stretch;
        flex-direction: column;
    }
    .clinical-profile-link-card,
    .clinical-profile-datetime-card {
        width: 100%;
        justify-content: center;
    }
}


/* Current project — unified invoice entry panel */
#receiptDialog,
#invoiceRegister {
    --invoice-accent: #4f46e5;
    --invoice-accent-dark: #4338ca;
    --invoice-accent-soft: #eef2ff;
    --invoice-accent-line: #d8dcfb;
    --invoice-neutral-line: #dfe5ef;
}

.receipt-modal-header {
    padding-bottom: 12px;
    border-bottom-color: var(--invoice-neutral-line);
    background: #fff;
}
.receipt-modal-header h2 {
    color: #253451;
    font-size: 18px;
    font-weight: 850;
    letter-spacing: -.02em;
}

.receipt-entry-panel {
    overflow: hidden;
    border: 1px solid var(--invoice-neutral-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(39, 50, 112, .06);
}
.receipt-entry-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--invoice-neutral-line);
    background: #f8faff;
}
.receipt-entry-panel-heading > div {
    display: grid;
    gap: 2px;
}
.receipt-entry-panel-heading strong {
    color: #253451;
    font-size: 12px;
    font-weight: 850;
}
.receipt-entry-panel-heading small {
    color: #758197;
    font-size: 9px;
}
.receipt-entry-panel .badge-neutral {
    color: var(--invoice-accent-dark);
    border-color: var(--invoice-accent-line);
    background: var(--invoice-accent-soft);
}
.receipt-entry-panel .receipt-document-line {
    padding: 14px;
    border: 0;
    border-radius: 0;
    background: #fff;
}
.receipt-entry-divider {
    height: 1px;
    margin: 0 14px;
    background: #e7ebf2;
}
.receipt-excel-table-integrated {
    margin-top: 10px;
    border-top: 0;
}
.receipt-entry-panel .receipt-excel-header {
    color: #465a70;
    border-top: 1px solid #e7ebf2;
    border-bottom-color: #e2e7ef;
    background: #f4f7fb;
}
.receipt-entry-panel .receipt-excel-header > span {
    border-right-color: #e2e7ef;
}
.receipt-entry-panel .receipt-excel-row > * {
    border-right-color: #edf0f5;
}
.receipt-entry-panel .receipt-excel-row:nth-child(even) {
    background: #fbfcfe;
}
.receipt-entry-panel .receipt-excel-row:focus-within {
    background: #f5f6ff;
    box-shadow: inset 3px 0 var(--invoice-accent);
}
.receipt-entry-panel .receipt-excel-cell input:hover,
.receipt-entry-panel .receipt-excel-cell select:hover {
    border-color: #d7deea;
}
.receipt-entry-panel .receipt-excel-cell input:focus,
.receipt-entry-panel .receipt-excel-cell select:focus {
    border-color: var(--invoice-accent);
    box-shadow: 0 0 0 3px rgba(79,70,229,.10);
}
.receipt-entry-panel .receipt-item-index {
    color: var(--invoice-accent);
    background: var(--invoice-accent-soft);
}
.receipt-entry-panel .receipt-excel-total {
    color: var(--invoice-accent-dark);
}
.receipt-entry-panel .receipt-add-supplier,
.receipt-entry-panel .receipt-row-add {
    color: #fff;
    border-color: var(--invoice-accent);
    background: var(--invoice-accent);
}
.receipt-entry-panel .receipt-add-supplier:hover,
.receipt-entry-panel .receipt-row-add:hover {
    color: #fff;
    border-color: var(--invoice-accent-dark);
    background: var(--invoice-accent-dark);
}
.receipt-form-summary-integrated {
    margin: 0;
    border-top: 1px solid var(--invoice-neutral-line);
    border-radius: 0;
    background: #fafbfc;
}
.receipt-form-summary-integrated .receipt-summary-total {
    color: #fff;
    background: var(--invoice-accent);
}
#receiptDialog .modal-footer .btn-primary,
#invoiceRegister .btn-primary {
    border-color: var(--invoice-accent);
    background: linear-gradient(135deg, #5b55ea, var(--invoice-accent));
    box-shadow: 0 7px 17px rgba(79,70,229,.18);
}
#receiptDialog .modal-footer .btn-primary:hover,
#invoiceRegister .btn-primary:hover {
    border-color: var(--invoice-accent-dark);
    background: var(--invoice-accent-dark);
}

/* Invoice register uses the same visual language as the current global header. */
#invoiceRegister .invoice-register-table thead th {
    background: #f4f7fb;
}
#invoiceRegister .invoice-number {
    color: var(--invoice-accent-dark);
}
#invoiceRegister .invoice-services-text {
    color: #687386;
}
.material-module-tabs a[href*="tab=invoices"].active {
    color: #fff;
    border-color: #4f46e5;
    background: linear-gradient(135deg,#5b55ea,#4f46e5);
    box-shadow: 0 8px 20px rgba(79,70,229,.18);
}
.material-module-tabs a[href*="tab=invoices"].active strong {
    background: rgba(255,255,255,.16);
}

@media (max-width: 900px) {
    .receipt-entry-panel-heading {
        align-items: flex-start;
    }
}


/* Current project — compact structured clinical review entry */
.clinical-compact-entry-card .clinical-entry-full-head { padding-bottom: 8px; }
.clinical-column1-form,
.clinical-service-inline-form {
    margin: 0 16px 14px 61px;
}
.clinical-column1-form {
    display: grid;
    grid-template-columns: minmax(140px, .42fr) minmax(260px, 1.58fr) 36px;
    align-items: end;
    gap: 9px;
}
.clinical-column1-form.clinical-prescription-form {
    grid-template-columns: minmax(0, 1fr) 36px;
}
.clinical-column1-form.clinical-notification-form {
    grid-template-columns: minmax(240px, 1fr) 170px 36px;
}
.clinical-column1-form .field,
.clinical-service-inline-form .field { gap: 4px; }
.clinical-column1-form .field > span,
.clinical-service-inline-form .field > span {
    color: #748198;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .025em;
    text-transform: uppercase;
}
.clinical-column1-form input,
.clinical-column1-form select,
.clinical-service-inline-form input,
.clinical-service-inline-form select {
    min-height: 34px;
    height: 34px;
    padding: 6px 9px;
    border: 1px solid #dfe4ec;
    border-radius: 9px;
    background: #fff;
    color: #344258;
    font-size: 11px;
    font-weight: 400;
}
.clinical-column1-form input:focus,
.clinical-column1-form select:focus,
.clinical-service-inline-form input:focus,
.clinical-service-inline-form select:focus {
    border-color: #aeb8ee;
    box-shadow: 0 0 0 3px rgba(79,70,229,.08);
    outline: none;
}
.clinical-inline-plus { align-self: end; margin-bottom: 1px; }
.clinical-compact-record-list { padding-top: 2px; }
.clinical-diagnosis-record .clinical-entry-item-text,
.clinical-referral-record .clinical-entry-document-text,
.clinical-notification-record .clinical-entry-document-text {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.clinical-diagnosis-record .clinical-entry-item-text strong,
.clinical-referral-record .clinical-entry-document-text strong,
.clinical-notification-record .clinical-entry-document-text strong {
    flex: 0 0 auto;
    color: #334155;
    font-size: 11px;
    font-weight: 750;
}
.clinical-diagnosis-record .clinical-entry-item-text span,
.clinical-referral-record .clinical-entry-document-text span,
.clinical-notification-record .clinical-entry-document-text span {
    min-width: 0;
    color: #5f6d81;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clinical-report-fields { display: grid; gap: 8px; }
.clinical-report-form { grid-template-columns: minmax(0,1fr) 36px; }
.clinical-service-inline-form {
    padding: 11px 12px 12px;
    border: 1px solid #e2e7ef;
    border-radius: 12px;
    background: #fafbfe;
}
.clinical-service-choice-row { display: grid; grid-template-columns: minmax(260px,1fr); }
.clinical-selected-service-data {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8ebf2;
}
.clinical-selected-service-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}
.clinical-selected-service-heading small { color: #7a8698; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.clinical-selected-service-heading strong { color: #334155; font-size: 12px; }
.clinical-selected-service-heading span { color: #818da0; font-size: 10px; }
.clinical-selected-service-grid {
    display: grid;
    grid-template-columns: minmax(150px,1fr) 100px 120px 100px minmax(180px,1.2fr) 36px;
    align-items: end;
    gap: 8px;
}
.clinical-service-submit { margin-bottom: 1px; }
@media (max-width: 980px) {
    .clinical-selected-service-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .clinical-service-submit { justify-self: end; }
}
@media (max-width: 720px) {
    .clinical-column1-form,
    .clinical-column1-form.clinical-prescription-form,
    .clinical-column1-form.clinical-notification-form,
    .clinical-report-form,
    .clinical-selected-service-grid {
        grid-template-columns: minmax(0,1fr);
    }
    .clinical-column1-form,
    .clinical-service-inline-form { margin-right: 12px; margin-left: 12px; }
    .clinical-inline-plus,
    .clinical-service-submit { justify-self: end; }
    .clinical-diagnosis-record .clinical-entry-item-text,
    .clinical-referral-record .clinical-entry-document-text,
    .clinical-notification-record .clinical-entry-document-text { align-items: flex-start; flex-direction: column; gap: 2px; }
}

.clinical-service-choice-row { grid-template-columns: minmax(260px,1fr) auto; align-items: end; gap: 8px; }
.clinical-service-group-button { height: 34px; white-space: nowrap; }
@media (max-width:720px){ .clinical-service-choice-row { grid-template-columns:minmax(0,1fr); } .clinical-service-group-button{width:100%;} }

/* Clinical review: modal-only service entry + report textareas */
.clinical-report-form {
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: end;
}
.clinical-report-form textarea {
    min-height: 112px;
    resize: vertical;
    line-height: 1.5;
}
.clinical-service-picker-settings textarea {
    min-height: 84px;
    resize: vertical;
}
.clinical-entry-services > .clinical-entry-full-head .clinical-section-plus {
    margin-left: auto;
}
@media (max-width: 720px) {
    .clinical-report-form { grid-template-columns: 1fr; }
    .clinical-report-form .clinical-inline-plus { justify-self: end; }
}

/* Clinical review: all visit inputs are modal-driven */
.clinical-report-records {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.clinical-report-record {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #e4e8f0;
    border-radius: 12px;
    background: #fbfcff;
}
.clinical-report-record-title {
    margin-bottom: 6px;
    color: #35415a;
    font-size: 11px;
    font-weight: 700;
}
.clinical-report-record-text {
    color: #5e6b80;
    font-size: 12px;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
}
.clinical-report-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.clinical-report-modal-grid textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.55;
}
#clinicalDiagnosisDialog .modal-body input,
#clinicalPrescriptionSimpleDialog .modal-body input,
#clinicalReferralSimpleDialog .modal-body input,
#clinicalRecallSimpleDialog .modal-body input {
    min-height: 40px;
}
@media (max-width: 760px) {
    .clinical-report-records,
    .clinical-report-modal-grid { grid-template-columns: minmax(0, 1fr); }
    .clinical-report-modal-grid textarea { min-height: 150px; }
}

/* Current project — profile/new-review mirrored patient header actions */
.clinical-profile-hero .patient-profile-v2-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
}
.clinical-profile-patient-button {
    min-width: 132px;
    justify-content: center;
    white-space: nowrap;
}
.clinical-profile-date-only {
    justify-content: flex-start;
}
@media (max-width: 900px) {
    .clinical-profile-hero .patient-profile-v2-main {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .clinical-profile-patient-button {
        grid-column: 1 / -1;
        justify-self: end;
    }
}
@media (max-width: 620px) {
    .clinical-profile-patient-button {
        width: 100%;
        justify-self: stretch;
    }
}


/* Medibox 2026-08-14 — specialist report modal + appointment visit type */
#clinicalReportsDialog {
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
}
#clinicalReportsDialog > form {
    width: 100%;
    height: min(820px, calc(100dvh - 32px));
    max-height: calc(100dvh - 32px);
}
#clinicalReportsDialog .modal-body {
    min-height: 0;
    overflow: hidden;
}
#clinicalReportsDialog .clinical-report-modal-grid {
    min-height: 0;
    height: 100%;
    align-items: stretch;
}
#clinicalReportsDialog .clinical-report-modal-grid > .field {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}
#clinicalReportsDialog .clinical-report-modal-grid textarea {
    width: 100%;
    height: 100%;
    min-height: min(620px, 58dvh);
    resize: none;
}
#clinicalReportsDialog .clinical-report-modal-single {
    grid-template-columns: minmax(0, 1fr);
}
.appointment-modal-modern .appointment-pro-time-panel {
    grid-template-columns: minmax(0, 1.2fr) minmax(180px, .8fr);
}
.appointment-modal-modern .appointment-visit-type-control {
    grid-column: 1 / -1;
    min-height: 52px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
}
.appointment-modal-modern .appointment-visit-type-label {
    color: #66758c;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.appointment-modal-modern .appointment-visit-type-control select {
    font-weight: 750;
}
.appointment-modal-modern .appointment-notes-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
@media (max-width: 760px) {
    #clinicalReportsDialog {
        width: min(100% - 16px, 1120px);
        max-height: calc(100dvh - 16px);
    }
    #clinicalReportsDialog > form {
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
    }
    #clinicalReportsDialog .modal-body { overflow: auto; }
    #clinicalReportsDialog .clinical-report-modal-grid textarea {
        height: auto;
        min-height: 55dvh;
        resize: vertical;
    }
    .appointment-modal-modern .appointment-pro-time-panel {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Medibox 2026-08-16 — professional specialist report generator v16 */
#clinicalReportsDialog .clinical-specialist-report-column {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
}
#clinicalReportsDialog .clinical-specialist-report-field {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}
#clinicalReportsDialog .clinical-specialist-report-field textarea {
    min-height: 0;
    height: 100%;
    line-height: 1.55;
    font-size: 14px;
    font-weight: 450;
    letter-spacing: 0;
}
#clinicalReportsDialog .clinical-report-generator {
    padding: 12px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 13px;
    background: #f8fafc;
}
#clinicalReportsDialog .clinical-report-generator-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
#clinicalReportsDialog .clinical-report-generator-head > div {
    display: grid;
    gap: 2px;
}
#clinicalReportsDialog .clinical-report-generator-head strong {
    color: #172033;
    font-size: 12.5px;
    font-weight: 650;
}
#clinicalReportsDialog .clinical-report-generator-head span {
    max-width: 880px;
    color: #66758c;
    font-size: 11.5px;
    font-weight: 450;
    line-height: 1.45;
}
#clinicalReportsDialog .clinical-report-generator-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
#clinicalReportsDialog .clinical-report-template-btn {
    appearance: none;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #d7e0ec;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 11.8px;
    font-weight: 520;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
#clinicalReportsDialog .clinical-report-template-btn:hover {
    border-color: #aebdd1;
    background: #f1f5f9;
    color: #172033;
}
#clinicalReportsDialog .clinical-report-template-btn.is-primary,
#clinicalReportsDialog .clinical-report-template-btn.is-selected {
    border-color: #a5b4fc;
    background: #eef2ff;
    color: #3730a3;
}
#clinicalReportsDialog .clinical-report-template-btn:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .16);
    outline-offset: 2px;
}
#clinicalReportsDialog .clinical-report-modal-grid:not(.clinical-report-modal-single) {
    grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr);
}
#clinicalReportsDialog .clinical-echo-report-field textarea {
    line-height: 1.5;
    font-size: 13.5px;
}
@media (max-width: 900px) {
    #clinicalReportsDialog .clinical-report-modal-grid:not(.clinical-report-modal-single) {
        grid-template-columns: minmax(0, 1fr);
        overflow: auto;
    }
    #clinicalReportsDialog .clinical-specialist-report-column { height: auto; }
    #clinicalReportsDialog .clinical-specialist-report-field textarea { min-height: 48dvh; height: auto; }
}
@media (max-width: 620px) {
    #clinicalReportsDialog .clinical-report-generator { padding: 10px; }
    #clinicalReportsDialog .clinical-report-template-btn { flex: 1 1 calc(50% - 7px); }
}

/* Medibox 2026-08-16 — unified GP/Dental visit + separate generated reports v17 */
.clinical-report-entry-card .clinical-entry-full-head h3 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
}
.clinical-report-records-single {
    grid-template-columns: minmax(0, 1fr);
}
.clinical-report-record-clean {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.clinical-report-record-clean .clinical-report-record-text {
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.65;
    color: #475569;
}

.clinical-generated-report-dialog {
    width: min(1500px, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
}
.clinical-generated-report-dialog > form {
    width: 100%;
    height: min(960px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
}
.clinical-generated-report-dialog .modal-header > div {
    display: grid;
    gap: 3px;
}
.clinical-generated-report-dialog .modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -.015em;
}
.clinical-generated-report-dialog .modal-header p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 400;
}
.clinical-generated-report-dialog .modal-body {
    min-height: 0;
    overflow: hidden;
}
.clinical-generated-report-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
}
.clinical-generated-report-dialog .clinical-report-generator {
    padding: 12px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 13px;
    background: #f8fafc;
}
.clinical-generated-report-dialog .clinical-report-generator-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.clinical-generated-report-dialog .clinical-report-generator-head > div {
    display: grid;
    gap: 3px;
}
.clinical-generated-report-dialog .clinical-report-generator-head strong {
    color: #172033;
    font-size: 13px;
    font-weight: 600;
}
.clinical-generated-report-dialog .clinical-report-generator-head span {
    max-width: 920px;
    color: #66758c;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}
.clinical-generated-report-dialog .clinical-report-generator-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.clinical-generated-report-dialog .clinical-report-template-btn {
    appearance: none;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #d7e0ec;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.clinical-generated-report-dialog .clinical-report-template-btn:hover {
    border-color: #aebdd1;
    background: #f1f5f9;
    color: #172033;
}
.clinical-generated-report-dialog .clinical-report-template-btn.is-primary,
.clinical-generated-report-dialog .clinical-report-template-btn.is-selected {
    border-color: #a5b4fc;
    background: #eef2ff;
    color: #3730a3;
}
.clinical-generated-report-dialog .clinical-report-template-btn:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .16);
    outline-offset: 2px;
}
.clinical-generated-report-field {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
}
.clinical-generated-report-field > span {
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}
.clinical-generated-report-field textarea {
    width: 100%;
    height: 100%;
    min-height: min(620px, 58dvh);
    resize: none;
    padding: 15px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.62;
    letter-spacing: 0;
}

/* The same visit context hierarchy is used for general practice and dentistry. */
body.app-body .clinical-visit-context-bar .clinical-visit-type-form,
.embedded-body .clinical-visit-context-bar .clinical-visit-type-form {
    flex: 1 1 460px;
    max-width: 680px;
}
body.app-body .clinical-visit-context-bar .clinical-visit-type-form select,
.embedded-body .clinical-visit-context-bar .clinical-visit-type-form select {
    font-size: 14.5px;
    font-weight: 500;
}

@media (max-width: 760px) {
    .clinical-generated-report-dialog {
        width: min(100% - 16px, 1180px);
        max-height: calc(100dvh - 16px);
    }
    .clinical-generated-report-dialog > form {
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
    }
    .clinical-generated-report-dialog .modal-body {
        overflow: auto;
    }
    .clinical-generated-report-body {
        grid-template-rows: auto auto;
    }
    .clinical-generated-report-field {
        height: auto;
    }
    .clinical-generated-report-field textarea {
        height: auto;
        min-height: 55dvh;
        resize: vertical;
    }
}
@media (max-width: 620px) {
    .clinical-generated-report-dialog .clinical-report-generator {
        padding: 10px;
    }
    .clinical-generated-report-dialog .clinical-report-template-btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }
}

/* Medibox 2026-08-16 — true large report workspace v19
   Make EHO and specialist report dialogs use the available viewport, including embedded clinical view. */
#clinicalEchoReportDialog.clinical-generated-report-dialog,
#clinicalSpecialistReportDialog.clinical-generated-report-dialog,
.embedded-body #clinicalEchoReportDialog.clinical-generated-report-dialog,
.embedded-body #clinicalSpecialistReportDialog.clinical-generated-report-dialog {
    width: min(1600px, calc(100vw - 32px)) !important;
    max-width: none !important;
    height: min(94dvh, 1000px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

#clinicalEchoReportDialog.clinical-generated-report-dialog > form,
#clinicalSpecialistReportDialog.clinical-generated-report-dialog > form,
.embedded-body #clinicalEchoReportDialog.clinical-generated-report-dialog > form,
.embedded-body #clinicalSpecialistReportDialog.clinical-generated-report-dialog > form {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    border-radius: inherit !important;
    overflow: hidden !important;
}

#clinicalEchoReportDialog .modal-body,
#clinicalSpecialistReportDialog .modal-body {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    padding: 16px 18px !important;
}

#clinicalEchoReportDialog .clinical-generated-report-body,
#clinicalSpecialistReportDialog .clinical-generated-report-body {
    min-height: 0 !important;
    height: 100% !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
}

#clinicalEchoReportDialog .clinical-generated-report-field,
#clinicalSpecialistReportDialog .clinical-generated-report-field {
    min-height: 0 !important;
    height: 100% !important;
}

#clinicalEchoReportDialog .clinical-generated-report-field textarea,
#clinicalSpecialistReportDialog .clinical-generated-report-field textarea {
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
    resize: none !important;
}

@media (max-width: 900px) {
    #clinicalEchoReportDialog.clinical-generated-report-dialog,
    #clinicalSpecialistReportDialog.clinical-generated-report-dialog,
    .embedded-body #clinicalEchoReportDialog.clinical-generated-report-dialog,
    .embedded-body #clinicalSpecialistReportDialog.clinical-generated-report-dialog {
        width: calc(100vw - 16px) !important;
        height: calc(100dvh - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 620px) {
    #clinicalEchoReportDialog.clinical-generated-report-dialog,
    #clinicalSpecialistReportDialog.clinical-generated-report-dialog,
    .embedded-body #clinicalEchoReportDialog.clinical-generated-report-dialog,
    .embedded-body #clinicalSpecialistReportDialog.clinical-generated-report-dialog {
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }
    #clinicalEchoReportDialog .modal-body,
    #clinicalSpecialistReportDialog .modal-body {
        overflow: auto !important;
        padding: 12px !important;
    }
    #clinicalEchoReportDialog .clinical-generated-report-body,
    #clinicalSpecialistReportDialog .clinical-generated-report-body {
        height: auto !important;
        grid-template-rows: auto auto !important;
    }
    #clinicalEchoReportDialog .clinical-generated-report-field textarea,
    #clinicalSpecialistReportDialog .clinical-generated-report-field textarea {
        min-height: 55dvh !important;
        height: auto !important;
        resize: vertical !important;
    }
}

/* =========================================================
   Dental visit materials — visible in clinical patient view v21
   ========================================================= */
body.app-body .clinical-entry-materials,
.embedded-body .clinical-entry-materials {
    border-color: #dce6e4;
    background: #fff;
}

body.app-body .clinical-materials-head,
.embedded-body .clinical-materials-head {
    background: linear-gradient(180deg, #fbfefd 0%, #f8fbfa 100%);
}

body.app-body .clinical-material-count,
.embedded-body .clinical-material-count {
    min-width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9e4e2;
    border-radius: 999px;
    background: #f6faf9;
    color: #49635e;
    font-size: 12px;
    font-weight: 500;
}

body.app-body .clinical-material-entry-panel,
.embedded-body .clinical-material-entry-panel {
    margin: 12px;
    padding: 14px;
    border: 1px solid #e1e8ef;
    border-radius: 14px;
    background: #fbfcfd;
}

body.app-body .clinical-material-entry-intro,
.embedded-body .clinical-material-entry-intro {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-bottom: 12px;
}

body.app-body .clinical-material-entry-intro strong,
.embedded-body .clinical-material-entry-intro strong {
    color: #172033;
    font-size: 14px;
    font-weight: 600;
}

body.app-body .clinical-material-entry-intro span,
.embedded-body .clinical-material-entry-intro span {
    color: #6b778a;
    font-size: 12.5px;
    font-weight: 400;
}

body.app-body .clinical-material-add-form,
.embedded-body .clinical-material-add-form {
    display: grid;
    grid-template-columns: minmax(230px, 1.5fr) minmax(220px, 1.25fr) minmax(120px, .55fr) minmax(145px, .65fr) auto;
    gap: 10px;
    align-items: end;
}

body.app-body .clinical-material-add-form .field,
.embedded-body .clinical-material-add-form .field {
    min-width: 0;
    margin: 0;
}

body.app-body .clinical-material-add-form .field > span,
.embedded-body .clinical-material-add-form .field > span {
    display: block;
    margin-bottom: 6px;
    color: #526175;
    font-size: 12px;
    font-weight: 500;
}

body.app-body .clinical-material-add-form select,
body.app-body .clinical-material-add-form input,
.embedded-body .clinical-material-add-form select,
.embedded-body .clinical-material-add-form input {
    min-height: 42px;
    font-size: 13px;
    font-weight: 400;
}

body.app-body .clinical-material-qty-control,
.embedded-body .clinical-material-qty-control {
    position: relative;
}

body.app-body .clinical-material-qty-control input,
.embedded-body .clinical-material-qty-control input {
    width: 100%;
    padding-right: 54px;
}

body.app-body .clinical-material-qty-control > span,
.embedded-body .clinical-material-qty-control > span {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    font-size: 12px;
    pointer-events: none;
}

body.app-body .clinical-material-stock,
.embedded-body .clinical-material-stock {
    min-height: 42px;
    padding: 7px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #e0e7ef;
    border-radius: 9px;
    background: #fff;
}

body.app-body .clinical-material-stock small,
.embedded-body .clinical-material-stock small {
    color: #7b8798;
    font-size: 10.5px;
    font-weight: 400;
}

body.app-body .clinical-material-stock strong,
.embedded-body .clinical-material-stock strong {
    color: #243247;
    font-size: 13px;
    font-weight: 600;
}

body.app-body .clinical-material-stock > span,
.embedded-body .clinical-material-stock > span {
    display: none;
    margin-top: 2px;
    color: #b45309;
    font-size: 10.5px;
}

body.app-body .clinical-material-stock.is-low > span,
.embedded-body .clinical-material-stock.is-low > span {
    display: block;
}

body.app-body .clinical-material-add-button,
.embedded-body .clinical-material-add-button {
    min-height: 42px;
    white-space: nowrap;
}

body.app-body .clinical-material-list,
.embedded-body .clinical-material-list {
    margin: 0 12px 12px;
    display: grid;
    gap: 7px;
}

body.app-body .clinical-material-row,
.embedded-body .clinical-material-row {
    display: grid;
    grid-template-columns: 34px minmax(220px, 1fr) minmax(100px, auto) minmax(105px, auto) 36px;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 9px 10px;
    border: 1px solid #e6ebf1;
    border-radius: 11px;
    background: #fff;
}

body.app-body .clinical-material-icon,
.embedded-body .clinical-material-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #f1f8f6;
    color: #0f8a73;
}

body.app-body .clinical-material-copy,
.embedded-body .clinical-material-copy {
    min-width: 0;
}

body.app-body .clinical-material-copy strong,
.embedded-body .clinical-material-copy strong {
    display: block;
    color: #1e293b;
    font-size: 13.5px;
    font-weight: 500;
}

body.app-body .clinical-material-copy small,
.embedded-body .clinical-material-copy small {
    display: block;
    margin-top: 2px;
    color: #758196;
    font-size: 11.5px;
    font-weight: 400;
}

body.app-body .clinical-material-value,
.embedded-body .clinical-material-value {
    text-align: right;
}

body.app-body .clinical-material-value small,
.embedded-body .clinical-material-value small {
    display: block;
    color: #8a95a6;
    font-size: 10.5px;
    font-weight: 400;
}

body.app-body .clinical-material-value strong,
.embedded-body .clinical-material-value strong {
    color: #334155;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

body.app-body .clinical-material-stock-value.is-low strong,
.embedded-body .clinical-material-stock-value.is-low strong { color: #9a6700; }
body.app-body .clinical-material-stock-value.is-empty strong,
.embedded-body .clinical-material-stock-value.is-empty strong { color: #b42318; }

body.app-body .clinical-material-empty-state,
.embedded-body .clinical-material-empty-state {
    margin: 12px;
    padding: 13px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px dashed #dce3eb;
    border-radius: 12px;
    background: #fafbfd;
    color: #6b778a;
}

body.app-body .clinical-material-empty-state strong,
.embedded-body .clinical-material-empty-state strong {
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
}

body.app-body .clinical-material-empty-state p,
.embedded-body .clinical-material-empty-state p {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    body.app-body .clinical-material-add-form,
    .embedded-body .clinical-material-add-form {
        grid-template-columns: 1fr 1fr 150px 160px;
    }
    body.app-body .clinical-material-add-button,
    .embedded-body .clinical-material-add-button {
        grid-column: 4;
        justify-self: end;
    }
}

@media (max-width: 820px) {
    body.app-body .clinical-material-add-form,
    .embedded-body .clinical-material-add-form { grid-template-columns: 1fr 1fr; }
    body.app-body .clinical-material-add-button,
    .embedded-body .clinical-material-add-button { grid-column: auto; width: 100%; justify-content: center; }
    body.app-body .clinical-material-row,
    .embedded-body .clinical-material-row { grid-template-columns: 32px minmax(0,1fr) auto 36px; }
    body.app-body .clinical-material-stock-value,
    .embedded-body .clinical-material-stock-value { display: none; }
}

@media (max-width: 560px) {
    body.app-body .clinical-material-add-form,
    .embedded-body .clinical-material-add-form { grid-template-columns: 1fr; }
    body.app-body .clinical-material-row,
    .embedded-body .clinical-material-row { grid-template-columns: 30px minmax(0,1fr) 34px; }
    body.app-body .clinical-material-value,
    .embedded-body .clinical-material-value { grid-column: 2; text-align: left; }
    body.app-body .clinical-material-row > form,
    .embedded-body .clinical-material-row > form { grid-column: 3; grid-row: 1 / span 2; }
}


/* Medibox v22 — modal material entry + consistent section actions */
body.app-body .clinical-section-actions,
.embedded-body .clinical-section-actions,
body.app-body .visit-section-header-actions,
body.app-body .visit-review-card-actions {
    display:flex; align-items:center; gap:8px; margin-left:auto;
}
body.app-body .clinical-section-actions form,
.embedded-body .clinical-section-actions form { margin:0; display:flex; }
body.app-body .clinical-section-delete,
.embedded-body .clinical-section-delete { width:34px; height:34px; border-radius:9px; }
body.app-body .clinical-material-dialog .modal-card,
.embedded-body .clinical-material-dialog .modal-card,
body.app-body .dental-material-dialog .modal-card { width:min(820px,94vw); max-height:min(760px,92dvh); }
body.app-body .clinical-material-modal-body,
.embedded-body .clinical-material-modal-body,
body.app-body .dental-material-modal-body { padding:22px 24px 26px; display:grid; gap:18px; }
body.app-body .clinical-material-modal-note,
.embedded-body .clinical-material-modal-note,
body.app-body .dental-material-modal-note { display:flex; gap:12px; align-items:flex-start; padding:14px 16px; border:1px solid #dbe4f0; border-radius:12px; background:#f8fbff; }
body.app-body .clinical-material-modal-note > span,
.embedded-body .clinical-material-modal-note > span,
body.app-body .dental-material-modal-note > span { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; background:#eef2ff; color:#4553d8; flex:0 0 auto; }
body.app-body .clinical-material-modal-note strong,
.embedded-body .clinical-material-modal-note strong,
body.app-body .dental-material-modal-note strong { display:block; font-size:14px; font-weight:650; color:#18243a; }
body.app-body .clinical-material-modal-note p,
.embedded-body .clinical-material-modal-note p,
body.app-body .dental-material-modal-note p { margin:3px 0 0; font-size:12.5px; line-height:1.5; color:#66758f; }
body.app-body .clinical-material-modal-grid,
.embedded-body .clinical-material-modal-grid,
body.app-body .dental-material-modal-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:16px; align-items:end; }
body.app-body .clinical-material-modal-grid .clinical-material-main-field,
.embedded-body .clinical-material-modal-grid .clinical-material-main-field,
body.app-body .dental-material-modal-grid .dental-material-select-field { grid-column:1 / -1; }
body.app-body .clinical-material-modal-grid .clinical-material-stock,
.embedded-body .clinical-material-modal-grid .clinical-material-stock,
body.app-body .dental-material-modal-grid .dental-material-stock-panel { min-height:62px; }
body.app-body .visit-section-plus { display:inline-grid; place-items:center; text-decoration:none; }
body.app-body .visit-review-card-actions .clinical-section-plus { flex:0 0 auto; }
@media (max-width:700px) {
  body.app-body .clinical-material-modal-grid, .embedded-body .clinical-material-modal-grid, body.app-body .dental-material-modal-grid { grid-template-columns:1fr; }
  body.app-body .clinical-material-modal-grid .clinical-material-main-field, .embedded-body .clinical-material-modal-grid .clinical-material-main-field, body.app-body .dental-material-modal-grid .dental-material-select-field { grid-column:auto; }
}

body.app-body .visit-review-record-with-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:start; }
body.app-body .visit-review-record-copy { min-width:0; }
body.app-body .visit-review-record-delete { margin:0; align-self:center; }

/* Medibox v23 — larger material modal + explicit detail actions */
body.app-body .clinical-material-dialog .modal-card,
.embedded-body .clinical-material-dialog .modal-card,
body.app-body .dental-material-dialog .modal-card {
    width: min(1120px, 96vw) !important;
    max-width: 1120px !important;
    min-height: min(560px, 78dvh);
    max-height: min(900px, 94dvh) !important;
}
body.app-body .clinical-material-modal-body,
.embedded-body .clinical-material-modal-body,
body.app-body .dental-material-modal-body {
    padding: 28px 30px 32px;
    gap: 22px;
    overflow: auto;
}
body.app-body .clinical-material-modal-grid,
.embedded-body .clinical-material-modal-grid,
body.app-body .dental-material-modal-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(170px, .62fr) minmax(190px, .72fr);
    gap: 18px;
    align-items: end;
}
body.app-body .clinical-material-modal-grid .clinical-material-main-field,
.embedded-body .clinical-material-modal-grid .clinical-material-main-field,
body.app-body .dental-material-modal-grid .dental-material-select-field {
    grid-column: 1 / -1;
}
body.app-body .clinical-material-modal-grid .field select,
body.app-body .clinical-material-modal-grid .field input,
.embedded-body .clinical-material-modal-grid .field select,
.embedded-body .clinical-material-modal-grid .field input,
body.app-body .dental-material-modal-grid .field select,
body.app-body .dental-material-modal-grid .field input {
    min-height: 48px;
    font-size: 14px;
}
body.app-body .clinical-material-modal-note,
.embedded-body .clinical-material-modal-note,
body.app-body .dental-material-modal-note {
    padding: 17px 18px;
}
body.app-body .clinical-material-modal-note strong,
.embedded-body .clinical-material-modal-note strong,
body.app-body .dental-material-modal-note strong { font-size: 15px; }
body.app-body .clinical-material-modal-note p,
.embedded-body .clinical-material-modal-note p,
body.app-body .dental-material-modal-note p { font-size: 13.5px; }
body.app-body .clinical-material-stock,
.embedded-body .clinical-material-stock,
body.app-body .dental-material-stock-panel {
    min-height: 72px !important;
    padding: 10px 13px;
}

/* Details: keep + in the same place and delete always visible on each saved record. */
body.app-body .clinical-detail-section-actions,
.embedded-body .clinical-detail-section-actions,
body.app-body .clinical-visit-entry-board .clinical-section-actions,
.embedded-body .clinical-visit-entry-board .clinical-section-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
body.app-body .clinical-visit-entry-board .clinical-section-plus,
.embedded-body .clinical-visit-entry-board .clinical-section-plus {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    font-size: 21px;
    font-weight: 500;
}
body.app-body .clinical-visit-entry-board .clinical-entry-item-actions,
.embedded-body .clinical-visit-entry-board .clinical-entry-item-actions,
body.app-body .clinical-visit-entry-board .clinical-service-actions,
.embedded-body .clinical-visit-entry-board .clinical-service-actions {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    opacity: 1 !important;
    visibility: visible !important;
}
body.app-body .clinical-visit-entry-board .clinical-detail-delete,
.embedded-body .clinical-visit-entry-board .clinical-detail-delete,
body.app-body .clinical-visit-entry-board .clinical-section-delete,
.embedded-body .clinical-visit-entry-board .clinical-section-delete {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    opacity: 1 !important;
    visibility: visible !important;
}
body.app-body .clinical-visit-entry-board .clinical-entry-document-item,
.embedded-body .clinical-visit-entry-board .clinical-entry-document-item,
body.app-body .clinical-visit-entry-board .clinical-entry-item,
.embedded-body .clinical-visit-entry-board .clinical-entry-item {
    position: relative;
}
body.app-body .clinical-visit-entry-board .clinical-actions-column,
.embedded-body .clinical-visit-entry-board .clinical-actions-column {
    width: 92px;
    min-width: 92px;
    text-align: center;
}
body.app-body .clinical-visit-entry-board .clinical-spreadsheet-table td:last-child,
.embedded-body .clinical-visit-entry-board .clinical-spreadsheet-table td:last-child {
    width: 92px;
    min-width: 92px;
    text-align: center;
}
body.app-body .clinical-visit-entry-board .clinical-material-row > form,
.embedded-body .clinical-visit-entry-board .clinical-material-row > form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    body.app-body .clinical-material-dialog .modal-card,
    .embedded-body .clinical-material-dialog .modal-card,
    body.app-body .dental-material-dialog .modal-card {
        width: min(96vw, 900px) !important;
        min-height: auto;
    }
    body.app-body .clinical-material-modal-grid,
    .embedded-body .clinical-material-modal-grid,
    body.app-body .dental-material-modal-grid {
        grid-template-columns: 1fr 1fr;
    }
    body.app-body .clinical-material-modal-grid .clinical-material-main-field,
    .embedded-body .clinical-material-modal-grid .clinical-material-main-field,
    body.app-body .dental-material-modal-grid .dental-material-select-field { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
    body.app-body .clinical-material-dialog .modal-card,
    .embedded-body .clinical-material-dialog .modal-card,
    body.app-body .dental-material-dialog .modal-card {
        width: 100vw !important;
        max-width: 100vw !important;
        min-height: 100dvh;
        max-height: 100dvh !important;
        border-radius: 0;
    }
    body.app-body .clinical-material-modal-body,
    .embedded-body .clinical-material-modal-body,
    body.app-body .dental-material-modal-body { padding: 18px; }
    body.app-body .clinical-material-modal-grid,
    .embedded-body .clinical-material-modal-grid,
    body.app-body .dental-material-modal-grid { grid-template-columns: 1fr; }
    body.app-body .clinical-material-modal-grid .clinical-material-main-field,
    .embedded-body .clinical-material-modal-grid .clinical-material-main-field,
    body.app-body .dental-material-modal-grid .dental-material-select-field { grid-column: auto; }
}

/* Medibox v25 — larger dental material modal + specialist report edit action */
body.app-body .clinical-material-dialog .modal-card,
.embedded-body .clinical-material-dialog .modal-card,
body.app-body .dental-material-dialog .modal-card {
    width: min(1360px, 97vw) !important;
    max-width: 1360px !important;
    min-height: min(650px, 84dvh) !important;
    max-height: 95dvh !important;
}
body.app-body .clinical-material-modal-body,
.embedded-body .clinical-material-modal-body,
body.app-body .dental-material-modal-body {
    padding: 32px 36px 36px !important;
    gap: 26px !important;
}
body.app-body .clinical-material-modal-grid,
.embedded-body .clinical-material-modal-grid,
body.app-body .dental-material-modal-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(250px, .82fr) minmax(230px, .72fr) !important;
    gap: 22px !important;
}
body.app-body .clinical-material-modal-grid .field select,
body.app-body .clinical-material-modal-grid .field input,
.embedded-body .clinical-material-modal-grid .field select,
.embedded-body .clinical-material-modal-grid .field input,
body.app-body .dental-material-modal-grid .field select,
body.app-body .dental-material-modal-grid .field input {
    min-height: 52px !important;
    font-size: 14.5px !important;
}
body.app-body .clinical-section-edit,
.embedded-body .clinical-section-edit {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}
@media (max-width: 900px) {
    body.app-body .clinical-material-dialog .modal-card,
    .embedded-body .clinical-material-dialog .modal-card,
    body.app-body .dental-material-dialog .modal-card {
        width: min(97vw, 900px) !important;
        min-height: auto !important;
    }
    body.app-body .clinical-material-modal-grid,
    .embedded-body .clinical-material-modal-grid,
    body.app-body .dental-material-modal-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}
@media (max-width: 650px) {
    body.app-body .clinical-material-dialog .modal-card,
    .embedded-body .clinical-material-dialog .modal-card,
    body.app-body .dental-material-dialog .modal-card {
        width: 100vw !important;
        max-width: 100vw !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
    }
    body.app-body .clinical-material-modal-body,
    .embedded-body .clinical-material-modal-body,
    body.app-body .dental-material-modal-body { padding: 20px !important; }
    body.app-body .clinical-material-modal-grid,
    .embedded-body .clinical-material-modal-grid,
    body.app-body .dental-material-modal-grid { grid-template-columns: 1fr !important; }
}

/* Medibox v26 — material modal fit/readability fix
   Keep the dialog large, but never wider than its actual viewport/embedded clinical frame. */
body.app-body .clinical-material-dialog,
.embedded-body .clinical-material-dialog,
body.app-body .dental-material-dialog {
    width: min(1180px, calc(100vw - 32px)) !important;
    max-width: min(1180px, calc(100vw - 32px)) !important;
    max-height: calc(100dvh - 32px) !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

body.app-body .clinical-material-dialog .modal-card,
.embedded-body .clinical-material-dialog .modal-card,
body.app-body .dental-material-dialog .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 32px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

body.app-body .clinical-material-dialog .modal-header,
.embedded-body .clinical-material-dialog .modal-header,
body.app-body .dental-material-dialog .modal-header,
body.app-body .clinical-material-dialog .modal-footer,
.embedded-body .clinical-material-dialog .modal-footer,
body.app-body .dental-material-dialog .modal-footer {
    flex: 0 0 auto;
}

body.app-body .clinical-material-modal-body,
.embedded-body .clinical-material-modal-body,
body.app-body .dental-material-modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 28px 30px 30px !important;
    gap: 20px !important;
    box-sizing: border-box !important;
}

body.app-body .clinical-material-modal-note,
.embedded-body .clinical-material-modal-note,
body.app-body .dental-material-modal-note {
    min-height: 0 !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;
}

body.app-body .clinical-material-modal-grid,
.embedded-body .clinical-material-modal-grid,
body.app-body .dental-material-modal-grid {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) !important;
    gap: 18px 20px !important;
    align-items: end !important;
    box-sizing: border-box !important;
}

body.app-body .clinical-material-modal-grid > *,
.embedded-body .clinical-material-modal-grid > *,
body.app-body .dental-material-modal-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.app-body .clinical-material-modal-grid .clinical-material-main-field,
.embedded-body .clinical-material-modal-grid .clinical-material-main-field,
body.app-body .dental-material-modal-grid .dental-material-select-field,
body.app-body .clinical-material-modal-grid .clinical-material-service-field,
.embedded-body .clinical-material-modal-grid .clinical-material-service-field {
    grid-column: 1 / -1 !important;
}

body.app-body .clinical-material-modal-grid .field select,
body.app-body .clinical-material-modal-grid .field input,
.embedded-body .clinical-material-modal-grid .field select,
.embedded-body .clinical-material-modal-grid .field input,
body.app-body .dental-material-modal-grid .field select,
body.app-body .dental-material-modal-grid .field input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

body.app-body .clinical-material-qty-control,
.embedded-body .clinical-material-qty-control {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

body.app-body .clinical-material-stock,
.embedded-body .clinical-material-stock,
body.app-body .dental-material-stock-panel {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 72px !important;
    box-sizing: border-box !important;
}

/* Embedded clinical details live in an iframe: size the material dialog to that
   actual viewport instead of forcing the desktop card width through it. */
.embedded-body .clinical-material-dialog {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    margin: 10px auto !important;
}
.embedded-body .clinical-material-dialog .modal-card {
    max-height: calc(100dvh - 20px) !important;
}

@media (max-width: 760px) {
    body.app-body .clinical-material-dialog,
    .embedded-body .clinical-material-dialog,
    body.app-body .dental-material-dialog {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
        margin: 8px auto !important;
        border-radius: 14px !important;
    }
    body.app-body .clinical-material-dialog .modal-card,
    .embedded-body .clinical-material-dialog .modal-card,
    body.app-body .dental-material-dialog .modal-card {
        max-height: calc(100dvh - 16px) !important;
    }
    body.app-body .clinical-material-modal-body,
    .embedded-body .clinical-material-modal-body,
    body.app-body .dental-material-modal-body {
        padding: 20px !important;
    }
    body.app-body .clinical-material-modal-grid,
    .embedded-body .clinical-material-modal-grid,
    body.app-body .dental-material-modal-grid {
        grid-template-columns: 1fr !important;
    }
    body.app-body .clinical-material-modal-grid .clinical-material-main-field,
    .embedded-body .clinical-material-modal-grid .clinical-material-main-field,
    body.app-body .clinical-material-modal-grid .clinical-material-service-field,
    .embedded-body .clinical-material-modal-grid .clinical-material-service-field,
    body.app-body .dental-material-modal-grid .dental-material-select-field {
        grid-column: auto !important;
    }
}
\n\n/* v27 — Clinic report logo settings */\nbody.app-body .settings-module-card.module-report-logo .settings-module-icon {\n    overflow: hidden;\n    background: #fff;\n    border-color: #dbe1ec;\n}\nbody.app-body .settings-logo-card-preview img {\n    display: block;\n    width: 100%;\n    height: 100%;\n    max-width: 30px;\n    max-height: 30px;\n    object-fit: contain;\n}\nbody.app-body .report-logo-settings-modal {\n    width: min(820px, calc(100vw - 40px));\n    max-width: 820px;\n}\nbody.app-body .report-logo-editor {\n    display: grid;\n    gap: 16px;\n}\nbody.app-body .report-logo-preview-card {\n    display: grid;\n    grid-template-columns: 150px minmax(0, 1fr);\n    gap: 20px;\n    align-items: center;\n    padding: 18px;\n    border: 1px solid #dfe5ef;\n    border-radius: 14px;\n    background: linear-gradient(145deg, #ffffff, #f8faff);\n}\nbody.app-body .report-logo-preview {\n    min-height: 112px;\n    display: grid;\n    place-items: center;\n    padding: 14px;\n    border: 1px solid #dce3ef;\n    border-radius: 12px;\n    background: #fff;\n}\nbody.app-body .report-logo-preview img {\n    display: block;\n    max-width: 120px;\n    max-height: 82px;\n    object-fit: contain;\n}\nbody.app-body .report-logo-preview-copy {\n    display: grid;\n    gap: 4px;\n    min-width: 0;\n}\nbody.app-body .report-logo-preview-copy small {\n    color: #7a869a;\n    font-size: 11px;\n    font-weight: 500;\n}\nbody.app-body .report-logo-preview-copy strong {\n    color: #1f2f4a;\n    font-size: 16px;\n    line-height: 1.3;\n    font-weight: 650;\n}\nbody.app-body .report-logo-preview-copy span {\n    color: #667085;\n    font-size: 12px;\n    line-height: 1.55;\n}\nbody.app-body .report-logo-dropzone {\n    min-height: 94px;\n    display: grid;\n    grid-template-columns: 44px minmax(0, 1fr) auto;\n    gap: 14px;\n    align-items: center;\n    padding: 16px 18px;\n    border: 1px dashed #bfc9dc;\n    border-radius: 14px;\n    background: #fbfcff;\n    cursor: pointer;\n    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;\n}\nbody.app-body .report-logo-dropzone:hover {\n    border-color: #7381d8;\n    background: #f7f8ff;\n    box-shadow: 0 8px 24px rgba(64, 86, 161, .08);\n}\nbody.app-body .report-logo-dropzone input[type=\"file\"] {\n    position: absolute;\n    width: 1px;\n    height: 1px;\n    overflow: hidden;\n    opacity: 0;\n    pointer-events: none;\n}\nbody.app-body .report-logo-upload-icon {\n    width: 44px;\n    height: 44px;\n    display: grid;\n    place-items: center;\n    border: 1px solid #d9def5;\n    border-radius: 11px;\n    background: #eef1ff;\n    color: #4056a1;\n}\nbody.app-body .report-logo-upload-icon .ui-icon { width: 19px; height: 19px; }\nbody.app-body .report-logo-upload-copy { display: grid; gap: 3px; min-width: 0; }\nbody.app-body .report-logo-upload-copy strong { color: #263650; font-size: 13px; font-weight: 650; }\nbody.app-body .report-logo-upload-copy small { color: #7a869a; font-size: 11px; line-height: 1.4; }\nbody.app-body .report-logo-select {\n    min-height: 36px;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    padding: 0 13px;\n    border: 1px solid #ccd5e5;\n    border-radius: 9px;\n    background: #fff;\n    color: #344054;\n    font-size: 11.5px;\n    font-weight: 600;\n    white-space: nowrap;\n}\nbody.app-body .report-logo-guidance {\n    display: flex;\n    gap: 11px;\n    padding: 13px 14px;\n    border: 1px solid #e1e6ee;\n    border-radius: 11px;\n    background: #fafbfc;\n}\nbody.app-body .report-logo-guidance > span { color: #667085; padding-top: 1px; }\nbody.app-body .report-logo-guidance .ui-icon { width: 16px; height: 16px; }\nbody.app-body .report-logo-guidance strong { display: block; color: #344054; font-size: 11.5px; font-weight: 650; }\nbody.app-body .report-logo-guidance p { margin: 3px 0 0; color: #667085; font-size: 11px; line-height: 1.5; }\nbody.app-body .report-logo-footer { gap: 9px; }\nbody.app-body .report-logo-footer-spacer { flex: 1 1 auto; }\nbody.app-body .report-logo-remove { color: #b42318; border-color: #efceca; }\nbody.app-body .report-logo-remove:hover { background: #fff5f4; border-color: #e8aaa4; }\n@media (max-width: 680px) {\n    body.app-body .report-logo-settings-modal { width: calc(100vw - 16px); max-width: none; }\n    body.app-body .report-logo-preview-card { grid-template-columns: 1fr; }\n    body.app-body .report-logo-preview { min-height: 96px; }\n    body.app-body .report-logo-dropzone { grid-template-columns: 40px minmax(0, 1fr); }\n    body.app-body .report-logo-select { grid-column: 1 / -1; width: 100%; }\n    body.app-body .report-logo-footer { flex-wrap: wrap; }\n    body.app-body .report-logo-footer-spacer { display: none; }\n    body.app-body .report-logo-footer .btn { flex: 1 1 auto; }\n}\n
/* v28 - Clinic branding lives inside Ordinacija settings */
#clinicSettingsDialog.clinic-settings-modal {
  width: min(1080px, calc(100vw - 32px));
  max-width: min(1080px, calc(100vw - 32px));
}
#clinicSettingsDialog .report-logo-in-clinic {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #dce4ef);
}
#clinicSettingsDialog .settings-subsection-heading {
  margin-bottom: 14px;
}
#clinicSettingsDialog .settings-subsection-heading > div {
  display: grid;
  gap: 3px;
}
#clinicSettingsDialog .settings-subsection-heading small {
  font-size: 11px;
  color: var(--muted, #718096);
  text-transform: uppercase;
  letter-spacing: .04em;
}
#clinicSettingsDialog .settings-subsection-heading strong {
  font-size: 15px;
  font-weight: 650;
}
#clinicSettingsDialog .settings-subsection-heading span {
  font-size: 12.5px;
  color: var(--muted, #718096);
  line-height: 1.5;
}
#clinicSettingsDialog .report-logo-remove-option {
  margin-top: 12px;
}
@media (max-width: 720px) {
  #clinicSettingsDialog.clinic-settings-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }
}


/* v107 — Preferred first screen: Calendar / Waiting room */
body.app-body .settings-module-card.module-home-view .settings-module-icon {
    background: linear-gradient(145deg, #eef2ff, #e4e9ff);
    color: #3f51b5;
}
.home-view-settings-modal {
    width: min(760px, calc(100vw - 32px));
}
.home-view-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.home-view-option-card {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 13px;
    min-height: 96px;
    padding: 17px;
    border: 1px solid #dce3ef;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.home-view-option-card:hover {
    transform: translateY(-1px);
    border-color: #aeb9df;
    box-shadow: 0 10px 24px rgba(63,81,181,.09);
}
.home-view-option-card.is-selected,
.home-view-option-card:has(input:checked) {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,.10);
}
.home-view-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.home-view-option-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eef2ff;
    color: #4338ca;
}
.home-view-option-icon .ui-icon { width: 22px; height: 22px; }
.home-view-option-copy { display: grid; gap: 4px; min-width: 0; }
.home-view-option-copy strong { color: #1f2f4a; font-size: 15px; font-weight: 700; }
.home-view-option-copy small { color: #667085; font-size: 11.5px; line-height: 1.45; }
.home-view-option-check {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8ecf4;
    color: transparent;
}
.home-view-option-card.is-selected .home-view-option-check,
.home-view-option-card:has(input:checked) .home-view-option-check {
    background: #4f46e5;
    color: #fff;
}
.home-view-option-check .ui-icon { width: 14px; height: 14px; }
@media (max-width: 680px) {
    .home-view-option-grid { grid-template-columns: 1fr; }
    .home-view-option-card { min-height: 82px; }
}

/* v108 — Users & privileges settings */
body.app-body .settings-module-card.module-users-permissions .settings-module-icon {
    color: #4f46e5;
    background: linear-gradient(145deg, #eef2ff, #e9faf5);
    border-color: #d7def7;
}
body.app-body .users-permissions-modal {
    width: min(1120px, calc(100vw - 36px));
    max-width: 1120px;
}
body.app-body .users-permissions-shell {
    min-height: min(720px, calc(100vh - 72px));
}
body.app-body .users-permissions-body {
    grid-template-columns: minmax(420px, 1.05fr) minmax(380px, .95fr);
    align-items: stretch;
}
body.app-body .users-permissions-list,
body.app-body .user-access-editor {
    min-width: 0;
}
body.app-body .user-access-records {
    max-height: 570px;
    overflow: auto;
    padding-right: 4px;
}
body.app-body .user-access-row {
    grid-template-columns: 44px minmax(0, 1fr) auto 36px;
    gap: 12px;
    min-height: 78px;
}
body.app-body .user-access-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(145deg, #eef2ff, #e9faf5);
    color: #4056a1;
    border: 1px solid #dbe1f5;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
}
body.app-body .user-access-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 5px;
}
body.app-body .user-role-badge,
body.app-body .user-permission-count {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    font-style: normal;
    background: #f4f6fa;
    color: #64748b;
    border: 1px solid #e2e7ef;
}
body.app-body .user-role-badge.is-admin {
    color: #3f46a8;
    background: #f0f2ff;
    border-color: #d9ddfa;
}
body.app-body .user-permission-count {
    color: #14765f;
    background: #effaf6;
    border-color: #d5eee5;
}
body.app-body .user-access-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    text-align: center;
    color: #7a869a;
    border: 1px dashed #d7deea;
    border-radius: 14px;
    background: #fafbfc;
}
body.app-body .user-access-empty .ui-icon { width: 28px; height: 28px; color: #8d98aa; }
body.app-body .user-access-empty strong { color: #344054; font-size: 13px; }
body.app-body .user-access-empty span { font-size: 11px; max-width: 300px; line-height: 1.5; }
body.app-body .user-account-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
body.app-body .user-account-fields .field:first-child,
body.app-body .user-password-hint,
body.app-body .user-active-switch {
    grid-column: 1 / -1;
}
body.app-body .user-password-hint {
    margin-top: -4px;
    color: #7a869a;
    font-size: 10.5px;
    line-height: 1.45;
}
body.app-body .user-permissions-section {
    display: grid;
    gap: 12px;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid #e6eaf1;
}
body.app-body .user-permissions-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}
body.app-body .user-permissions-heading > div {
    display: grid;
    gap: 2px;
}
body.app-body .user-permissions-heading small {
    color: #8a94a6;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .11em;
}
body.app-body .user-permissions-heading strong {
    color: #253657;
    font-size: 14px;
}
body.app-body .user-permissions-heading > span {
    color: #7a869a;
    font-size: 10.5px;
    text-align: right;
}
body.app-body .permission-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}
body.app-body .permission-card {
    position: relative;
    min-height: 86px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 22px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dfe5ef;
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
body.app-body .permission-card:hover {
    border-color: #bfc8ec;
    background: #fbfcff;
}
body.app-body .permission-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
body.app-body .permission-card:has(input:checked) {
    border-color: #9aa6e8;
    background: linear-gradient(145deg, #f4f5ff, #f2fbf8);
    box-shadow: 0 0 0 2px rgba(79,70,229,.06);
}
body.app-body .permission-card-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #4f46e5;
    background: #eef2ff;
}
body.app-body .permission-card-icon .ui-icon { width: 17px; height: 17px; }
body.app-body .permission-card > span:nth-of-type(2) {
    min-width: 0;
    display: grid;
    gap: 3px;
}
body.app-body .permission-card strong {
    color: #344054;
    font-size: 11.5px;
    line-height: 1.25;
}
body.app-body .permission-card small {
    color: #7a869a;
    font-size: 9.5px;
    line-height: 1.35;
}
body.app-body .permission-card > i {
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: transparent;
    border: 1px solid #d5dbe6;
    background: #fff;
}
body.app-body .permission-card > i .ui-icon { width: 12px; height: 12px; }
body.app-body .permission-card:has(input:checked) > i {
    color: #fff;
    border-color: #4f46e5;
    background: #4f46e5;
}
body.app-body .permission-card.is-locked {
    cursor: default;
    opacity: .78;
}
body.app-body .permission-card-finance {
    grid-column: 1 / -1;
}
body.app-body .admin-access-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 12px;
    border: 1px solid #d9def6;
    border-radius: 11px;
    background: #f5f6ff;
    color: #5261a8;
}
body.app-body .admin-access-note[hidden] { display: none !important; }
body.app-body .admin-access-note .ui-icon { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
body.app-body .admin-access-note strong { display: block; color: #344054; font-size: 11px; }
body.app-body .admin-access-note span { display: block; margin-top: 2px; color: #697386; font-size: 10px; line-height: 1.45; }
@media (max-width: 900px) {
    body.app-body .users-permissions-modal { width: calc(100vw - 20px); max-width: none; }
    body.app-body .users-permissions-body { grid-template-columns: 1fr; }
    body.app-body .user-access-records { max-height: 320px; }
}
@media (max-width: 620px) {
    body.app-body .user-account-fields,
    body.app-body .permission-card-grid { grid-template-columns: 1fr; }
    body.app-body .user-account-fields .field:first-child,
    body.app-body .user-password-hint,
    body.app-body .user-active-switch,
    body.app-body .permission-card-finance { grid-column: auto; }
    body.app-body .user-access-row { grid-template-columns: 40px minmax(0, 1fr) 34px; }
    body.app-body .user-access-row .record-status { grid-column: 2 / 3; grid-row: 2; }
    body.app-body .user-access-row .icon-action { grid-column: 3; grid-row: 1 / span 2; }
}

/* v201 — Visit display settings */
body.app-body .settings-module-card.module-visit-display .settings-module-icon {
    color: #4f46e5;
    background: linear-gradient(145deg, #eef2ff, #eef9f5);
    border-color: #d7def7;
}
.visit-display-settings-modal {
    width: min(820px, calc(100vw - 32px));
}
.visit-display-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.visit-display-option-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 11px;
    min-height: 76px;
    padding: 12px 13px;
    border: 1px solid #dfe5ee;
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.visit-display-option-card:hover {
    border-color: #b8c2dc;
    box-shadow: 0 7px 18px rgba(40, 55, 105, .07);
}
.visit-display-option-card:has(input:checked) {
    border-color: #6366f1;
    background: #fbfbff;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .08);
}
.visit-display-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.visit-display-option-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #f2f4f8;
    color: #596579;
}
.visit-display-option-card:has(input:checked) .visit-display-option-icon {
    background: #eef2ff;
    color: #4f46e5;
}
.visit-display-option-icon .ui-icon { width: 18px; height: 18px; }
.visit-display-option-copy { display: grid; gap: 3px; min-width: 0; }
.visit-display-option-copy strong { color: #25324a; font-size: 13px; font-weight: 700; }
.visit-display-option-copy small { color: #7b8697; font-size: 10.5px; line-height: 1.35; }
.visit-display-option-check {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border: 1px solid #d9e0eb;
    border-radius: 7px;
    background: #fff;
    color: transparent;
}
.visit-display-option-card:has(input:checked) .visit-display-option-check {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}
.visit-display-option-check .ui-icon { width: 13px; height: 13px; }
@media (max-width: 680px) {
    .visit-display-option-grid { grid-template-columns: 1fr; }
    .visit-display-settings-modal { width: calc(100vw - 16px); max-width: none; }
}

/* Medibox v210 — simple service details in payment evidence */
.payment-evidence-services {
    display: grid;
    gap: 10px;
    width: 100%;
}
.payment-evidence-services-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}
.payment-evidence-services-heading h3 {
    margin: 0;
    font-size: 15px;
}
.payment-evidence-services-heading small {
    color: #748092;
    font-size: 11px;
    font-weight: 700;
}
.payment-evidence-services-wrap {
    border: 1px solid #e3e8ef;
    border-radius: 11px;
    overflow: auto;
    background: #fff;
}
.payment-evidence-services-table {
    margin: 0;
    min-width: 620px;
}
.payment-evidence-services-table th {
    padding: 8px 10px;
    font-size: 9px;
    white-space: nowrap;
}
.payment-evidence-services-table td {
    padding: 9px 10px;
    font-size: 12px;
    vertical-align: middle;
}
.payment-evidence-services-table td:first-child {
    font-weight: 700;
}
.payment-evidence-services-table th:nth-child(3),
.payment-evidence-services-table td:nth-child(3) {
    text-align: center;
}
.payment-evidence-services-table th:nth-child(4),
.payment-evidence-services-table th:nth-child(5),
.payment-evidence-services-table td:nth-child(4),
.payment-evidence-services-table td:nth-child(5) {
    text-align: right;
    white-space: nowrap;
}
.payment-evidence-services-empty {
    padding: 18px !important;
    text-align: center !important;
    color: #7c8795;
    font-weight: 600 !important;
}
@media (max-width: 700px) {
    .payment-evidence-services-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
}

/* v212 finance service dashboard */
.finance-service-table-card {
    display: grid;
    gap: 14px;
}
.finance-service-table-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 2px 0;
}
.finance-service-table-header h2 {
    margin: 2px 0 0;
    color: #183b35;
    font-size: 19px;
    letter-spacing: -.02em;
}
.finance-service-table-meta {
    min-width: 118px;
    padding: 12px 14px;
    border: 1px solid #dde9e5;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfefd 0%, #f4f9f7 100%);
    text-align: right;
}
.finance-service-table-meta strong {
    display: block;
    color: #163b34;
    font-size: 23px;
    line-height: 1;
    letter-spacing: -.04em;
}
.finance-service-table-meta span {
    display: block;
    margin-top: 4px;
    color: #6e837d;
    font-size: 10px;
    font-weight: 800;
}
.finance-service-name-stack {
    display: grid;
    gap: 5px;
}
.finance-service-name-stack strong {
    color: #163b34;
    font-size: 15px;
}
.finance-service-name-stack small {
    color: #7b8f89;
    font-size: 10px;
}
.finance-service-summary-table td:nth-child(2),
.finance-service-summary-table td:nth-child(3),
.finance-service-summary-table td:nth-child(4) {
    white-space: nowrap;
}
.finance-service-patient-badge {
    min-width: 38px;
    text-align: center;
}
.finance-service-detail-row > td {
    padding-top: 0 !important;
    background: #f8fbfa;
}
.finance-service-detail-panel {
    border: 1px solid #e2ece8;
    background: #ffffff;
}
.finance-service-patients-table td:nth-child(3),
.finance-service-patients-table td:nth-child(4),
.finance-service-patients-table td:nth-child(5) {
    white-space: nowrap;
}
.finance-service-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.finance-service-chart-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dfeae7;
    border-radius: 19px;
    box-shadow: 0 9px 27px rgba(22,65,57,.06);
}
.finance-service-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #edf3f1;
}
.finance-service-chart-header h2 {
    margin: 3px 0 0;
    color: #183b35;
    font-size: 16px;
    letter-spacing: -.02em;
}
.finance-service-chart-header small {
    color: #728781;
    font-size: 10px;
    font-weight: 800;
}
.finance-service-bar-list {
    display: grid;
    gap: 14px;
    padding: 16px 18px 20px;
}
.finance-service-bar-row {
    display: grid;
    gap: 7px;
}
.finance-service-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.finance-service-bar-meta strong {
    color: #163b34;
    font-size: 13px;
    font-weight: 800;
}
.finance-service-bar-meta span {
    color: #345e56;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.finance-service-bar-track {
    position: relative;
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf3f1;
}
.finance-service-bar-fill {
    height: 100%;
    border-radius: inherit;
}
.finance-service-bar-fill.is-revenue {
    background: linear-gradient(90deg, #0f766e 0%, #22a58a 100%);
}
.finance-service-bar-fill.is-volume {
    background: linear-gradient(90deg, #4f7cff 0%, #758dff 100%);
}
.finance-service-bar-row small {
    color: #758983;
    font-size: 10px;
    font-weight: 700;
}
@media (max-width: 1040px) {
    .finance-service-charts-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 720px) {
    .finance-service-table-header,
    .finance-service-chart-header,
    .finance-service-bar-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    .finance-service-table-meta {
        width: 100%;
        text-align: left;
    }
}

/* v214 — Finance: modern analytics + strict table/header alignment */
.finance-service-table-v214 {
    padding: 0 !important;
    overflow: hidden;
}
.finance-service-table-v214 .finance-service-table-header {
    padding: 18px 18px 12px;
    border-bottom: 1px solid #e8efed;
}
.finance-section-description {
    margin: 5px 0 0;
    color: #748983;
    font-size: 11px;
    line-height: 1.45;
}
.finance-services-table-wrap {
    padding: 0 18px 18px;
}
.finance-service-summary-table-v214 {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}
.finance-service-summary-table-v214 .finance-col-service { width: 38%; }
.finance-service-summary-table-v214 .finance-col-count { width: 17%; }
.finance-service-summary-table-v214 .finance-col-price { width: 17%; }
.finance-service-summary-table-v214 .finance-col-total { width: 18%; }
.finance-service-summary-table-v214 .finance-col-action { width: 10%; }
.finance-service-summary-table-v214 th,
.finance-service-summary-table-v214 td,
.finance-service-patients-table-v214 th,
.finance-service-patients-table-v214 td {
    text-align: left !important;
    vertical-align: middle !important;
}
.finance-service-summary-table-v214 th,
.finance-service-summary-table-v214 td {
    padding-left: 14px !important;
    padding-right: 14px !important;
}
.finance-service-summary-table-v214 thead th {
    height: 42px;
    color: #5f746e;
    background: #f7faf9;
    border-top: 1px solid #e6eeeb;
    border-bottom: 1px solid #e1eae7;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .035em;
    white-space: nowrap;
}
.finance-service-summary-table-v214 thead th:first-child {
    border-top-left-radius: 12px;
}
.finance-service-summary-table-v214 thead th:last-child {
    border-top-right-radius: 12px;
}
.finance-service-summary-table-v214 tbody > tr.finance-service-summary-row > td {
    min-height: 58px;
    border-bottom: 1px solid #edf2f0;
    background: #fff;
}
.finance-service-summary-table-v214 tbody > tr.finance-service-summary-row:hover > td {
    background: #fbfdfc;
}
.finance-service-summary-table-v214 td > strong,
.finance-service-patients-table-v214 td > strong {
    display: inline-block;
    color: #173b35;
    font-size: 13px;
    font-weight: 800;
}
.finance-service-summary-table-v214 .finance-service-name-stack {
    align-items: start;
}
.finance-service-summary-table-v214 .finance-service-name-stack strong {
    font-size: 13.5px;
}
.finance-service-summary-table-v214 .finance-service-name-stack small {
    margin: 0;
    font-size: 9.5px;
}
.finance-service-summary-table-v214 .finance-service-detail-toggle {
    width: 36px;
    height: 34px;
    margin: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid #cfded9;
    border-radius: 10px;
    background: #fbfdfc;
    color: #315e55;
    box-shadow: none;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
}
.finance-service-summary-table-v214 .finance-service-detail-toggle:hover,
.finance-service-summary-table-v214 .finance-service-detail-toggle[aria-expanded="true"] {
    border-color: #9bc9be;
    background: #edf8f5;
    color: #0f766e;
}
.finance-service-detail-row > td {
    padding: 0 14px 12px !important;
    background: #f9fbfa !important;
}
.finance-service-detail-panel {
    margin: 0;
    overflow: hidden;
    border: 1px solid #dfe9e6;
    border-radius: 13px;
    box-shadow: 0 7px 20px rgba(21, 64, 55, .045);
}
.finance-service-detail-heading {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e7efec;
    background: #f8fbfa;
}
.finance-service-detail-heading > div {
    display: grid;
    gap: 3px;
}
.finance-service-detail-heading strong {
    color: #173b35;
    font-size: 12.5px;
}
.finance-service-detail-heading small {
    color: #788b85;
    font-size: 9.5px;
}
.finance-service-patients-table-v214 {
    width: 100%;
    table-layout: fixed;
}
.finance-service-patients-table-v214 th,
.finance-service-patients-table-v214 td {
    padding: 10px 12px !important;
}
.finance-service-patients-table-v214 thead th {
    color: #657a74;
    background: #fbfdfc;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}
.finance-service-patients-table-v214 tbody td {
    font-size: 11px;
}

.finance-modern-charts {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
    gap: 14px;
    margin-top: 14px;
}
.finance-modern-chart-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dde9e5;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(21,64,55,.055);
}
.finance-modern-chart-header {
    min-height: 76px;
    padding: 16px 18px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #edf2f0;
}
.finance-modern-chart-header h2 {
    margin: 2px 0 0;
    color: #173b35;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: -.02em;
}
.finance-modern-chart-header p:not(.eyebrow) {
    margin: 5px 0 0;
    color: #788b85;
    font-size: 10px;
}
.finance-chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    color: #657a74;
    font-size: 9.5px;
    font-weight: 800;
}
.finance-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.finance-chart-legend i,
.finance-payment-share-legend i {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 999px;
}
.finance-chart-legend .is-realized i,
.finance-service-performance-legend .is-revenue i {
    background: #4b65d9;
}
.finance-chart-legend .is-paid i,
.finance-payment-share-legend .is-paid i {
    background: #159776;
}
.finance-service-performance-legend .is-volume i {
    background: #8b6bd6;
}
.finance-monthly-chart-wrap {
    min-height: 270px;
    padding: 12px 12px 4px;
    overflow-x: auto;
}
.finance-monthly-line-chart {
    width: 100%;
    min-width: 620px;
    height: 258px;
    display: block;
}
.finance-monthly-gridline {
    stroke: #e6eeeb;
    stroke-width: 1;
    stroke-dasharray: 3 5;
}
.finance-monthly-axis-label {
    fill: #7b8e88;
    font-size: 9px;
    font-weight: 700;
}
.finance-monthly-line {
    fill: none;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.finance-monthly-line.is-realized {
    stroke: #4b65d9;
}
.finance-monthly-line.is-paid {
    stroke: #159776;
}
.finance-monthly-dot {
    stroke: #fff;
    stroke-width: 2.4;
}
.finance-monthly-dot.is-realized {
    fill: #4b65d9;
}
.finance-monthly-dot.is-paid {
    fill: #159776;
}
.finance-payment-share-body {
    min-height: 270px;
    padding: 20px;
    display: grid;
    align-content: center;
    gap: 20px;
}
.finance-payment-donut {
    position: relative;
    width: min(178px, 68%);
    aspect-ratio: 1;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#159776 0 var(--paid-share), #edf1f0 var(--paid-share) 100%);
    box-shadow: 0 14px 32px rgba(19,82,67,.11);
}
.finance-payment-donut::after {
    content: '';
    position: absolute;
    inset: 25px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e3ece9;
}
.finance-payment-donut > div {
    position: relative;
    z-index: 1;
    display: grid;
    text-align: center;
}
.finance-payment-donut strong {
    color: #173b35;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.04em;
}
.finance-payment-donut span {
    margin-top: 4px;
    color: #748983;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}
.finance-payment-share-legend {
    display: grid;
    gap: 8px;
}
.finance-payment-share-legend > div {
    min-height: 39px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #e5eeeb;
    border-radius: 11px;
    background: #fbfdfc;
}
.finance-payment-share-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6d817b;
    font-size: 10px;
    font-weight: 800;
}
.finance-payment-share-legend strong {
    color: #173b35;
    font-size: 12px;
}
.finance-payment-share-legend .is-outstanding i {
    background: #e0757d;
}
.finance-payment-share-legend .is-total {
    background: #f3f8f6;
}

.finance-service-performance-card {
    margin-top: 14px;
}
.finance-service-performance-list {
    display: grid;
    padding: 4px 18px 16px;
}
.finance-service-performance-row {
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(210px, 1.2fr) minmax(230px, 1fr) minmax(230px, 1fr);
    align-items: center;
    gap: 22px;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f0;
}
.finance-service-performance-row:last-child {
    border-bottom: 0;
}
.finance-service-performance-name {
    display: grid;
    gap: 4px;
}
.finance-service-performance-name strong {
    color: #173b35;
    font-size: 12px;
}
.finance-service-performance-name small {
    color: #7b8e88;
    font-size: 9.5px;
}
.finance-service-performance-metric {
    display: grid;
    gap: 7px;
}
.finance-service-performance-value {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.finance-service-performance-value span {
    color: #788b85;
    font-size: 9px;
    font-weight: 800;
}
.finance-service-performance-value strong {
    color: #294e47;
    font-size: 11px;
    white-space: nowrap;
}
.finance-service-performance-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f0;
}
.finance-service-performance-track span {
    height: 100%;
    display: block;
    border-radius: inherit;
}
.finance-service-performance-track .is-revenue {
    background: linear-gradient(90deg, #435ccf 0%, #7184ea 100%);
}
.finance-service-performance-track .is-volume {
    background: linear-gradient(90deg, #7d60ca 0%, #aa8be7 100%);
}

@media (max-width: 1150px) {
    .finance-modern-charts {
        grid-template-columns: 1fr;
    }
    .finance-payment-share-body {
        grid-template-columns: 180px minmax(0, 1fr);
        align-items: center;
    }
    .finance-service-performance-row {
        grid-template-columns: minmax(180px, .9fr) minmax(200px, 1fr) minmax(200px, 1fr);
        gap: 14px;
    }
}
@media (max-width: 820px) {
    .finance-service-summary-table-v214 {
        table-layout: auto;
        min-width: 760px;
    }
    .finance-service-patients-table-v214 {
        min-width: 800px;
    }
    .finance-service-performance-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
@media (max-width: 620px) {
    .finance-service-table-v214 .finance-service-table-header,
    .finance-modern-chart-header,
    .finance-payment-share-body {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }
    .finance-service-table-meta {
        width: 100%;
        text-align: left;
    }
    .finance-payment-share-body {
        display: grid;
    }
}

/* v217 — modern Reviews analytics */
.reviews-analytics-shell {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}
.reviews-analytics-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 2px 0;
}
.reviews-analytics-heading h2 {
    margin: 2px 0 4px;
    color: #173b35;
    font-size: 21px;
    line-height: 1.15;
    letter-spacing: -.025em;
}
.reviews-analytics-heading > div > p:last-child {
    margin: 0;
    color: #72857f;
    font-size: 11px;
}
.reviews-analytics-scope {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid #dce8e5;
    border-radius: 999px;
    background: #f8fbfa;
    color: #476b63;
    font-size: 10px;
    font-weight: 850;
}
.reviews-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
}
.reviews-kpi-card {
    position: relative;
    min-width: 0;
    min-height: 112px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 15px 16px;
    overflow: hidden;
    border: 1px solid #dfe9e6;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #fbfdfc 100%);
    box-shadow: 0 8px 24px rgba(24, 67, 59, .055);
}
.reviews-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #60756f;
}
.reviews-kpi-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #41645c;
    background: #eef5f3;
}
.reviews-kpi-icon .ui-icon {
    width: 19px;
    height: 19px;
}
.reviews-kpi-card small {
    display: block;
    color: #738781;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.reviews-kpi-card strong {
    display: block;
    margin-top: 3px;
    color: #173b35;
    font-size: 25px;
    line-height: 1;
    letter-spacing: -.045em;
}
.reviews-kpi-card p {
    margin: 6px 0 0;
    color: #7c8d88;
    font-size: 9.5px;
    line-height: 1.3;
}
.reviews-kpi-card.is-total::before { background: #6574d9; }
.reviews-kpi-card.is-total .reviews-kpi-icon { color: #5868cc; background: #f0f1ff; }
.reviews-kpi-card.is-completed::before { background: #22a06b; }
.reviews-kpi-card.is-completed .reviews-kpi-icon { color: #18875a; background: #eaf8f1; }
.reviews-kpi-card.is-active::before { background: #d39b32; }
.reviews-kpi-card.is-active .reviews-kpi-icon { color: #aa771f; background: #fff7e6; }
.reviews-kpi-card.is-services::before { background: #8a67d1; }
.reviews-kpi-card.is-services .reviews-kpi-icon { color: #7352bb; background: #f4efff; }

.reviews-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
    gap: 14px;
}
.reviews-chart-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dfe9e6;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 9px 27px rgba(22, 65, 57, .055);
}
.reviews-services-card {
    grid-column: 1 / -1;
}
.reviews-chart-header {
    min-height: 70px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 17px 11px;
    border-bottom: 1px solid #edf3f1;
}
.reviews-chart-header h3 {
    margin: 2px 0 0;
    color: #173b35;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: -.02em;
}
.reviews-chart-header .eyebrow,
.reviews-analytics-heading .eyebrow {
    margin: 0;
    color: #7c8e88;
    font-size: 8.5px;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.reviews-chart-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6f827c;
    font-size: 9px;
    font-weight: 800;
}
.reviews-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.reviews-chart-legend span::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.reviews-chart-legend .is-total::before { background: #6574d9; }
.reviews-chart-legend .is-completed::before { background: #22a06b; }
.reviews-line-wrap {
    padding: 12px 12px 5px;
    overflow-x: auto;
}
.reviews-line-chart {
    width: 100%;
    min-width: 550px;
    height: auto;
    display: block;
}
.reviews-chart-gridline {
    stroke: #e8efed;
    stroke-width: 1;
    stroke-dasharray: 4 5;
}
.reviews-line {
    fill: none;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.reviews-line-total { stroke: #6574d9; }
.reviews-line-completed { stroke: #22a06b; }
.reviews-dot {
    stroke: #fff;
    stroke-width: 2.5;
}
.reviews-dot-total { fill: #6574d9; }
.reviews-dot-completed { fill: #22a06b; }
.reviews-axis-label {
    fill: #7d908a;
    font-size: 9px;
    font-weight: 700;
}
.reviews-month-label { font-weight: 800; }

.reviews-status-layout {
    min-height: 252px;
    display: grid;
    grid-template-columns: minmax(135px, .82fr) minmax(145px, 1fr);
    align-items: center;
    gap: 18px;
    padding: 20px 18px;
}
.reviews-status-donut {
    position: relative;
    width: min(172px, 100%);
    aspect-ratio: 1;
    margin: auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    box-shadow: 0 13px 30px rgba(40, 73, 66, .12);
}
.reviews-status-donut::after {
    content: '';
    position: absolute;
    inset: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e7efed;
}
.reviews-status-donut > div {
    position: relative;
    z-index: 1;
    display: grid;
    text-align: center;
}
.reviews-status-donut strong {
    color: #173b35;
    font-size: 29px;
    line-height: 1;
    letter-spacing: -.045em;
}
.reviews-status-donut span {
    margin-top: 4px;
    color: #748781;
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
}
.reviews-status-legend {
    display: grid;
    gap: 7px;
}
.reviews-status-legend > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 9px;
    border: 1px solid #e6eeec;
    border-radius: 11px;
    background: #fbfdfc;
}
.reviews-status-legend > div > span,
.reviews-status-legend > div > strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4f6861;
    font-size: 9.5px;
    font-weight: 800;
}
.reviews-status-legend > div > strong { color: #173b35; }
.reviews-status-legend strong small {
    color: #82938e;
    font-size: 8.5px;
    font-weight: 750;
}
.reviews-status-legend i {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 50%;
}
.reviews-status-legend .is-completed i { background: #22a06b; }
.reviews-status-legend .is-progress i { background: #5b6ee1; }
.reviews-status-legend .is-arrived i { background: #d39b32; }
.reviews-status-legend .is-cancelled i { background: #d65c68; }
.reviews-status-legend .is-voided i { background: #8b99a4; }
.reviews-status-legend .is-deleted i { background: #53616c; }

.reviews-service-bars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 22px;
    padding: 17px 18px 20px;
}
.reviews-service-bar-row {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.reviews-service-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.reviews-service-bar-meta strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #173b35;
    font-size: 11px;
    font-weight: 800;
}
.reviews-service-bar-meta span {
    flex: 0 0 auto;
    color: #526e66;
    font-size: 10px;
    font-weight: 850;
}
.reviews-service-bar-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf3f1;
}
.reviews-service-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6574d9 0%, #8a67d1 100%);
}
.reviews-service-bar-row small {
    color: #7a8c87;
    font-size: 9px;
    font-weight: 750;
}
.reviews-chart-empty {
    padding: 35px 18px;
    color: #7d8f89;
    font-size: 11px;
    text-align: center;
}

@media (max-width: 1120px) {
    .reviews-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reviews-chart-grid { grid-template-columns: 1fr; }
    .reviews-services-card { grid-column: auto; }
}
@media (max-width: 760px) {
    .reviews-analytics-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .reviews-kpi-grid,
    .reviews-service-bars,
    .reviews-status-layout {
        grid-template-columns: 1fr;
    }
    .reviews-kpi-card { min-height: 96px; }
    .reviews-status-donut { width: 150px; }
    .reviews-chart-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v218 — login branding: Medibox + */
.brand-login .login-brand-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    line-height: 1;
}
.brand-login .login-brand-name strong {
    color: inherit;
    font-size: 31px;
    font-weight: 850;
    letter-spacing: -.03em;
}
.brand-login .login-brand-name b {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.34);
    color: #fff;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}
@media (max-width: 720px) {
    .brand-login .login-brand-name strong { font-size: 26px; }
    .brand-login .login-brand-name b { width: 27px; height: 27px; font-size: 22px; border-radius: 9px; }
}

/* Medibox+ v232 — Finance realized-turnover period filter */
.finance-period-card {
    margin-bottom: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #dce6f2;
    border-radius: 17px;
    background: linear-gradient(135deg, #ffffff 0%, #f7f9ff 100%);
    box-shadow: 0 9px 24px rgba(38, 54, 96, .06);
}
.finance-period-summary {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.finance-period-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #eef1ff;
    color: #4c4bd8;
}
.finance-period-icon .ui-icon { width: 20px; height: 20px; }
.finance-period-summary > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.finance-period-summary small {
    color: #7b869d;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
}
.finance-period-summary strong {
    color: #202a44;
    font-size: 17px;
    line-height: 1.2;
}
.finance-period-summary span:not(.finance-period-icon) {
    color: #7c879a;
    font-size: 11px;
}
.finance-period-switch {
    display: inline-grid;
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid #dbe2ee;
    border-radius: 13px;
    background: #f3f5f9;
}
.finance-period-option {
    min-height: 36px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #596579;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.finance-period-option:hover {
    background: #fff;
    color: #3639a8;
}
.finance-period-option.is-active {
    background: #fff;
    color: #4038ce;
    box-shadow: 0 3px 10px rgba(55, 51, 158, .12);
}
@media (max-width: 900px) {
    .finance-period-card {
        align-items: stretch;
        flex-direction: column;
    }
    .finance-period-switch {
        width: 100%;
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 560px) {
    .finance-period-switch {
        grid-template-columns: repeat(2, 1fr);
    }
    .finance-period-option { min-width: 0; }
}


/* Medibox+ v233 — compact realized-turnover filter directly above Finance KPI cards */
.finance-turnover-filter {
    margin: 0 0 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #dce4ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(35, 48, 78, .045);
}
.finance-turnover-filter-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.finance-turnover-filter-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f0f2ff;
    color: #4b46d8;
}
.finance-turnover-filter-icon .ui-icon { width: 18px; height: 18px; }
.finance-turnover-filter-copy > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.finance-turnover-filter-copy small {
    color: #7b8699;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .075em;
}
.finance-turnover-filter-copy strong {
    color: #202a44;
    font-size: 14px;
    line-height: 1.2;
}
.finance-turnover-filter-copy span:not(.finance-turnover-filter-icon) {
    color: #7c8798;
    font-size: 11px;
}
.finance-turnover-filter .finance-period-switch {
    flex: 0 0 auto;
}
@media (max-width: 900px) {
    .finance-turnover-filter { align-items: stretch; flex-direction: column; }
    .finance-turnover-filter .finance-period-switch { width: 100%; }
}

/* Medibox+ v234 — day-by-day turnover navigation */
.finance-turnover-filter {
    flex-wrap: wrap;
}
.finance-day-navigation {
    flex: 1 1 100%;
    min-width: 0;
    padding-top: 10px;
    display: grid;
    grid-template-columns: 38px minmax(170px, 240px) 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #edf1f6;
}
.finance-day-nav-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #dbe2ee;
    border-radius: 11px;
    background: #fff;
    color: #4038ce;
    box-shadow: 0 2px 8px rgba(42, 50, 82, .05);
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.finance-day-nav-button:hover {
    border-color: #bbb9f4;
    background: #f7f7ff;
    box-shadow: 0 4px 12px rgba(55, 51, 158, .10);
    transform: translateY(-1px);
}
.finance-day-nav-button.is-disabled {
    color: #b7becb;
    background: #f7f8fa;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}
.finance-day-nav-current {
    min-height: 44px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1px;
    text-align: center;
}
.finance-day-nav-current small {
    color: #8a94a6;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .09em;
}
.finance-day-nav-current strong {
    color: #202a44;
    font-size: 17px;
    line-height: 1.15;
}
.finance-day-nav-current span,
.finance-day-nav-current a {
    color: #5c68a4;
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
}
.finance-day-nav-current a:hover {
    color: #4038ce;
    text-decoration: underline;
}
@media (max-width: 560px) {
    .finance-day-navigation {
        grid-template-columns: 36px minmax(130px, 1fr) 36px;
    }
    .finance-day-nav-button {
        width: 36px;
        height: 36px;
    }
}


/* Medibox+ v235 — minimal modern day navigation above Finance KPI cards */
.finance-day-toolbar {
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.finance-day-navigation-modern {
    flex: 0 1 auto;
    width: auto;
    min-width: 310px;
    padding: 5px;
    display: grid;
    grid-template-columns: 42px minmax(170px, 220px) 42px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #e0e5ef;
    border-radius: 17px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 24px rgba(35, 48, 78, .07);
}
.finance-day-navigation-modern .finance-day-nav-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: #4540c9;
    font-size: 27px;
}
.finance-day-navigation-modern .finance-day-nav-button:hover {
    border: 0;
    background: #f1f2ff;
    box-shadow: none;
    transform: none;
}
.finance-day-navigation-modern .finance-day-nav-button.is-disabled {
    background: transparent;
    color: #c5cad5;
}
.finance-day-navigation-modern .finance-day-nav-current {
    min-height: 42px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f6ff 0%, #fafaff 100%);
    text-align: center;
}
.finance-day-navigation-modern .finance-day-nav-current strong {
    color: #24294a;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: .01em;
    line-height: 1;
}
@media (max-width: 560px) {
    .finance-day-navigation-modern {
        width: 100%;
        min-width: 0;
        grid-template-columns: 40px minmax(120px, 1fr) 40px;
    }
    .finance-day-navigation-modern .finance-day-nav-button {
        width: 40px;
        height: 40px;
    }
}


/* Medibox+ v236 — Finance day navigation aligned right with descriptive copy on the left */
.finance-day-toolbar.finance-day-toolbar-split {
    margin: 0 0 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #e1e6ef;
    border-radius: 18px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 8px 24px rgba(35, 48, 78, .055);
}
.finance-day-toolbar-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.finance-day-toolbar-copy .finance-day-toolbar-eyebrow {
    color: #7a83a5;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .11em;
}
.finance-day-toolbar-copy > strong {
    color: #202a44;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.2;
}
.finance-day-toolbar-copy > small {
    color: #7d8798;
    font-size: 11px;
    line-height: 1.25;
}
.finance-day-toolbar-split .finance-day-navigation-modern {
    margin-left: auto;
    flex: 0 0 auto;
    min-width: 340px;
}
.finance-day-toolbar-split .finance-day-nav-current {
    min-width: 210px;
}
.finance-day-toolbar-split .finance-day-nav-current strong,
.finance-day-toolbar-split .finance-day-nav-current .finance-day-nav-label {
    white-space: nowrap;
}
@media (max-width: 760px) {
    .finance-day-toolbar.finance-day-toolbar-split {
        align-items: stretch;
        flex-direction: column;
    }
    .finance-day-toolbar-split .finance-day-navigation-modern {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }
    .finance-day-toolbar-split .finance-day-nav-current {
        min-width: 0;
    }
}


/* Medibox+ v237 — Finance description locked left, day navigation locked right */
.finance-day-toolbar.finance-day-toolbar-split {
    width: 100%;
}
.finance-day-toolbar-split .finance-day-toolbar-copy {
    flex: 1 1 auto;
    justify-items: start;
    align-items: start;
    text-align: left;
}
.finance-day-toolbar-split .finance-day-toolbar-copy > * {
    width: 100%;
    text-align: left;
}
.finance-day-toolbar-split .finance-day-navigation-modern {
    margin-left: auto;
    margin-right: 0;
    justify-self: end;
}
@media (min-width: 761px) {
    .finance-day-toolbar.finance-day-toolbar-split {
        flex-direction: row;
    }
    .finance-day-toolbar-split .finance-day-toolbar-copy {
        max-width: calc(100% - 380px);
    }
}
@media (max-width: 760px) {
    .finance-day-toolbar-split .finance-day-toolbar-copy {
        width: 100%;
        max-width: none;
    }
    .finance-day-toolbar-split .finance-day-navigation-modern {
        margin-left: auto;
        margin-right: 0;
    }
}

/* Medibox+ v238 — regular-weight date label in Finance day navigation */
.finance-day-navigation-modern .finance-day-nav-current .finance-day-nav-label {
    color: #24294a;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: .01em;
    line-height: 1;
    white-space: nowrap;
}


/* Medibox+ v241 — bold Finance day description */
.finance-day-toolbar-copy .finance-day-toolbar-text {
    display: block;
    color: #4f596d;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
}

/* Medibox v299 — wrap long text in GP EHO and specialist reports only */
body.app-body #echo-report-entry .clinical-report-record,
body.app-body #specialist-report-entry .clinical-report-record,
.embedded-body #echo-report-entry .clinical-report-record,
.embedded-body #specialist-report-entry .clinical-report-record {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

body.app-body #echo-report-entry .clinical-report-record-text,
body.app-body #specialist-report-entry .clinical-report-record-text,
.embedded-body #echo-report-entry .clinical-report-record-text,
.embedded-body #specialist-report-entry .clinical-report-record-text {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

/* Medibox v300 — compact toggle for long GP EHO and specialist reports */
body.app-body .clinical-report-collapsible,
.embedded-body .clinical-report-collapsible {
    min-width: 0;
    max-width: 100%;
}

body.app-body .clinical-report-collapsible.is-collapsed .clinical-report-record-text,
.embedded-body .clinical-report-collapsible.is-collapsed .clinical-report-record-text {
    position: relative;
    max-height: 154px;
    overflow: hidden;
}

body.app-body .clinical-report-collapsible.is-collapsed .clinical-report-record-text::after,
.embedded-body .clinical-report-collapsible.is-collapsed .clinical-report-record-text::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.96) 72%, #fff 100%);
}

body.app-body .clinical-report-toggle,
.embedded-body .clinical-report-toggle {
    margin-top: 8px;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: #3157a6;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

body.app-body .clinical-report-toggle:hover,
body.app-body .clinical-report-toggle:focus-visible,
.embedded-body .clinical-report-toggle:hover,
.embedded-body .clinical-report-toggle:focus-visible {
    color: #1f3f85;
    outline: none;
}

body.app-body .clinical-report-toggle-icon,
.embedded-body .clinical-report-toggle-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    transition: transform .16s ease;
}

body.app-body .clinical-report-toggle-icon svg,
.embedded-body .clinical-report-toggle-icon svg {
    width: 14px;
    height: 14px;
}

body.app-body .clinical-report-collapsible.is-expanded .clinical-report-toggle-icon,
.embedded-body .clinical-report-collapsible.is-expanded .clinical-report-toggle-icon {
    transform: rotate(180deg);
}

/* Medibox v312 — compact duplicate-patient decision dialog */
body.app-body .duplicate-patient-dialog,
.embedded-body .duplicate-patient-dialog {
    width: min(480px, calc(100vw - 24px));
}

body.app-body .duplicate-patient-dialog .modal-body,
.embedded-body .duplicate-patient-dialog .modal-body {
    padding-top: 18px;
    padding-bottom: 18px;
}

body.app-body .duplicate-patient-message,
.embedded-body .duplicate-patient-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 600;
}

body.app-body .duplicate-patient-actions,
.embedded-body .duplicate-patient-actions {
    justify-content: flex-end;
    gap: 10px;
}

/* Medibox v317 — modern minimal patient history timeline */
body.app-body .patient-history-modern-timeline,
.embedded-body .patient-history-modern-timeline {
    position: relative;
    display: grid;
    gap: 0;
    padding: 4px 0 4px 4px;
}

body.app-body .patient-history-modern-timeline::before,
.embedded-body .patient-history-modern-timeline::before {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 10px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(103, 80, 164, .34), rgba(103, 80, 164, .08));
}

body.app-body .patient-history-modern-event,
.embedded-body .patient-history-modern-event {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 44px;
}

body.app-body .patient-history-modern-dot,
.embedded-body .patient-history-modern-dot {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    margin-left: 1px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #6750a4;
    box-shadow: 0 0 0 1px rgba(103, 80, 164, .24), 0 2px 5px rgba(33, 24, 59, .12);
}

body.app-body .patient-history-modern-content,
.embedded-body .patient-history-modern-content {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 8px 11px;
    border: 1px solid #e9e8ef;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(31, 37, 50, .035);
}

body.app-body .patient-history-modern-content strong,
.embedded-body .patient-history-modern-content strong {
    flex: 0 0 auto;
    color: #2a3142;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

body.app-body .patient-history-modern-content span,
.embedded-body .patient-history-modern-content span {
    min-width: 0;
    overflow: hidden;
    color: #70798b;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body .patient-history-modern-event:hover .patient-history-modern-content,
.embedded-body .patient-history-modern-event:hover .patient-history-modern-content {
    border-color: rgba(103, 80, 164, .22);
    box-shadow: 0 5px 14px rgba(31, 37, 50, .055);
}

@media (max-width: 640px) {
    body.app-body .patient-history-modern-content,
    .embedded-body .patient-history-modern-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    body.app-body .patient-history-modern-content span,
    .embedded-body .patient-history-modern-content span {
        width: 100%;
    }
}

/* Medibox v318 — primary dentition in Tooth Status for patients up to age 14 */
body.app-body .odontogram-primary-section,
.embedded-body .odontogram-primary-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border, #e4eaf1);
}

body.app-body .odontogram-primary-title,
.embedded-body .odontogram-primary-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

body.app-body .odontogram-primary-title span,
.embedded-body .odontogram-primary-title span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f6f8fb;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
}

body.app-body .odontogram-primary-jaw-label,
.embedded-body .odontogram-primary-jaw-label {
    width: min(100%, 660px);
    margin: 0 auto 3px;
    color: #7a8799;
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    letter-spacing: .03em;
}

body.app-body .odontogram-primary-jaw-label.is-lower,
.embedded-body .odontogram-primary-jaw-label.is-lower {
    margin-top: 7px;
}

body.app-body .clinical-odontogram-compact .odontogram-chart.odontogram-primary-chart,
.embedded-body .clinical-odontogram-compact .odontogram-chart.odontogram-primary-chart,
body.app-body .odontogram-chart.odontogram-primary-chart,
.embedded-body .odontogram-chart.odontogram-primary-chart {
    width: min(100%, 660px);
    margin: 0 auto;
    grid-template-columns: repeat(10, minmax(34px, 1fr));
    gap: 4px;
    padding: 2px 0;
}

@media (max-width: 720px) {
    body.app-body .clinical-odontogram-compact .odontogram-chart.odontogram-primary-chart,
    .embedded-body .clinical-odontogram-compact .odontogram-chart.odontogram-primary-chart,
    body.app-body .odontogram-chart.odontogram-primary-chart,
    .embedded-body .odontogram-chart.odontogram-primary-chart {
        grid-template-columns: repeat(5, minmax(42px, 1fr));
    }
}


/* Medibox v359 — Debt settings module */
body.app-body .settings-module-card.module-debt .settings-module-icon {
    color: #4f46e5;
    background: linear-gradient(145deg, #eef2ff, #eef9f5);
    border-color: #d7def7;
}
body.app-body .debt-settings-modal { width: min(720px, calc(100vw - 32px)); }
body.app-body .debt-settings-modal .form-grid.cols-2 { align-items: stretch; }
@media (max-width: 700px) { body.app-body .debt-settings-modal .form-grid.cols-2 { grid-template-columns: 1fr; } }


/* Medibox v420 — MKB-10 Albanian + Latin shared catalog */
body.app-body .clinical-mkb-modal-body { gap: 13px; }
body.app-body .clinical-mkb-search-box { position: relative; z-index: 5; }
body.app-body .clinical-mkb-results {
    position: absolute; left: 0; right: 0; top: calc(100% - 2px); max-height: 330px; overflow: auto;
    background: #fff; border: 1px solid #dbe3ed; border-radius: 12px; box-shadow: 0 16px 34px rgba(24,39,75,.14); padding: 6px; z-index: 30;
}
body.app-body .clinical-mkb-result { width: 100%; display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 10px; align-items: start; text-align: left; border: 0; border-radius: 9px; padding: 9px 10px; background: transparent; cursor: pointer; color: inherit; }
body.app-body .clinical-mkb-result:hover, body.app-body .clinical-mkb-result:focus { background: #f3f7fb; outline: none; }
body.app-body .clinical-mkb-result > strong { color: #0f5f94; font-size: 13px; letter-spacing: .02em; }
body.app-body .clinical-mkb-result > span { display: grid; gap: 2px; min-width: 0; }
body.app-body .clinical-mkb-result b { font-size: 13px; font-weight: 700; color: #26384a; }
body.app-body .clinical-mkb-result small { font-size: 11px; color: #748398; font-style: italic; }
body.app-body .clinical-mkb-empty { padding: 12px; color: #7b8797; font-size: 12px; text-align: center; }
body.app-body .clinical-mkb-selected-hint { min-height: 34px; padding: 8px 10px; border-radius: 9px; background: #f7f9fc; color: #67768a; font-size: 11px; line-height: 1.45; }
body.app-body .clinical-mkb-record-text .clinical-mkb-latin { display: block; margin-top: 2px; color: #7a8797; font-style: italic; font-size: 11px; }
body.app-body .mkb-result-row span { display: grid; gap: 2px; }
body.app-body .mkb-result-row span small { color: #77869a; font-style: italic; font-size: 11px; }
body.app-body #modalMkbSelected em { display: block; margin-top: 4px; color: #708096; font-size: 12px; }
@media (max-width: 620px) { body.app-body .clinical-mkb-result { grid-template-columns: 58px minmax(0,1fr); } }


/* Medibox v423 — MKB-10 single-search diagnosis picker */
body.app-body .clinical-mkb-modal-body { gap: 14px; }
body.app-body .clinical-mkb-search-box { position: relative; z-index: 12; }
body.app-body .clinical-mkb-results { top: calc(100% - 1px); max-height: 360px; padding: 5px; }
body.app-body .clinical-mkb-result-inline {
    display: grid;
    grid-template-columns: 64px minmax(180px, 1fr) minmax(150px, .9fr);
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
}
body.app-body .clinical-mkb-result-inline > strong { font-size: 13px; }
body.app-body .clinical-mkb-result-inline > .clinical-mkb-result-primary { display: block; font-size: 13px; font-weight: 650; color: #26384a; line-height: 1.3; }
body.app-body .clinical-mkb-result-inline > small { display: block; font-size: 12px; color: #748398; font-style: italic; line-height: 1.3; }
body.app-body .clinical-mkb-selected-card {
    border: 1px solid #d9e3ee;
    border-radius: 12px;
    background: #f7fafc;
    padding: 11px 13px;
}
body.app-body .clinical-mkb-selected-card > small { display: block; margin-bottom: 6px; color: #728095; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
body.app-body .clinical-mkb-selected-value { display: grid; grid-template-columns: 64px minmax(180px, 1fr) minmax(150px, .9fr); gap: 12px; align-items: center; }
body.app-body .clinical-mkb-selected-value strong { color: #0f5f94; font-size: 13px; }
body.app-body .clinical-mkb-selected-value span { font-size: 13px; font-weight: 700; color: #25384b; }
body.app-body .clinical-mkb-selected-value em { font-size: 12px; color: #718196; font-style: italic; }
body.app-body [data-diagnosis-save]:disabled { opacity: .5; cursor: not-allowed; }
body.app-body .mkb-result-row-inline { grid-template-columns: 64px minmax(180px,1fr) minmax(150px,.9fr); align-items:center; }
body.app-body .mkb-result-row-inline > span { display:block; font-weight:650; }
body.app-body .mkb-result-row-inline > small { display:block; font-style:italic; color:#77869a; }
@media (max-width: 700px) {
    body.app-body .clinical-mkb-result-inline,
    body.app-body .clinical-mkb-selected-value,
    body.app-body .mkb-result-row-inline { grid-template-columns: 58px minmax(0,1fr); }
    body.app-body .clinical-mkb-result-inline > small,
    body.app-body .clinical-mkb-selected-value em,
    body.app-body .mkb-result-row-inline > small { grid-column: 2; }
}


/* Medibox v425 — robust local MKB search + larger diagnosis modal */
body.app-body #clinicalDiagnosisDialog.clinical-focused-entry-dialog .clinical-mkb-picker-card {
    width: min(980px, calc(100vw - 36px));
    max-width: 980px;
    min-height: 560px;
    max-height: min(82vh, 760px);
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-modal-body {
    min-height: 420px;
    padding-top: 18px;
    align-content: start;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-search-box {
    position: static;
    z-index: auto;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-search-field input[data-mkb-search] {
    min-height: 52px;
    font-size: 15px;
    padding: 12px 14px;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-catalog-status {
    margin-top: -8px;
    text-align: right;
    color: #8a97a7;
    font-size: 11px;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-results {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    margin-top: 10px;
    width: 100%;
    max-height: 330px;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #dbe3ed;
    border-radius: 12px;
    box-shadow: none;
    background: #fff;
    padding: 6px;
    z-index: auto;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline {
    grid-template-columns: 90px minmax(260px, 1.2fr) minmax(240px, 1fr);
    gap: 16px;
    min-height: 54px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f6;
    border-radius: 8px;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline:last-child { border-bottom: 0; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline > strong { font-size: 14px; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline > .clinical-mkb-result-primary { font-size: 14px; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline > small { font-size: 13px; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-card { margin-top: 4px; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-value {
    grid-template-columns: 90px minmax(260px,1.2fr) minmax(240px,1fr);
    gap: 16px;
}
@media (max-width: 760px) {
    body.app-body #clinicalDiagnosisDialog.clinical-focused-entry-dialog .clinical-mkb-picker-card {
        width: calc(100vw - 18px);
        min-height: 520px;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-value {
        grid-template-columns: 64px minmax(0,1fr);
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline > small,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-value em { grid-column: 2; }
}

/* Medibox v426 — structured MKB-10 modal + reliable diagnosis delete */
body.app-body #clinicalDiagnosisDialog.clinical-focused-entry-dialog .clinical-mkb-picker-card {
    width: min(1120px, calc(100vw - 42px));
    max-width: 1120px;
    height: min(84vh, 790px);
    min-height: 610px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.app-body #clinicalDiagnosisDialog .modal-header,
body.app-body #clinicalDiagnosisDialog .modal-footer { flex: 0 0 auto; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-search-box {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1 1 auto;
    min-height: 0;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-search-meta {
    display: flex;
    justify-content: flex-end;
    min-height: 16px;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-catalog-status { margin: 0; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-results-panel {
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    border: 1px solid #dbe3ed;
    border-radius: 13px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-columns-header {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    padding: 11px 15px;
    border-bottom: 1px solid #dfe6ef;
    background: #f7f9fc;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-columns-header > span { min-width: 0; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-results {
    position: static;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: none;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-results[hidden] { display: none; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 14px 15px;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    border-radius: 0;
    background: #fff;
    text-align: left;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline:hover,
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline:focus {
    background: #f7f9ff;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-cell {
    display: block;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.45;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-code-cell strong {
    color: #0f5f94;
    font-size: 14px;
    letter-spacing: .02em;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-primary {
    color: #26384a;
    font-size: 13px;
    font-weight: 700;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-latin {
    color: #718096;
    font-size: 13px;
    font-style: italic;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-empty {
    padding: 28px 16px;
    text-align: center;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-card {
    flex: 0 0 auto;
    margin: 0;
    padding: 13px 15px 15px;
    border: 1px solid #cfdbea;
    background: #f8fbff;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-card > small {
    margin-bottom: 9px;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-value {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-cell {
    min-width: 0;
    display: grid;
    gap: 4px;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-cell > small {
    color: #7b8799;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-cell > strong,
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-cell > span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
    font-size: 13px;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-cell > strong { color: #0f5f94; font-size: 14px; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-latin { color: #718096; font-style: italic; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-footer { gap: 10px; }
body.app-body #clinicalDiagnosisDialog .clinical-mkb-delete-btn {
    margin-right: auto;
    color: #b42318;
    border-color: #f1c7c3;
    background: #fff8f7;
}
body.app-body #clinicalDiagnosisDialog .clinical-mkb-delete-btn:hover {
    color: #991b1b;
    border-color: #e6aaa4;
    background: #fff1f0;
}
body.app-body .clinical-diagnosis-record .clinical-detail-delete {
    color: #b42318;
    border-color: #f0c7c3;
    background: #fff8f7;
}
@media (max-width: 760px) {
    body.app-body #clinicalDiagnosisDialog.clinical-focused-entry-dialog .clinical-mkb-picker-card {
        width: calc(100vw - 12px);
        height: calc(100dvh - 12px);
        min-height: 0;
        max-height: none;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-columns-header { display: none; }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-value {
        grid-template-columns: 74px minmax(0, 1fr);
        gap: 8px 12px;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-latin,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-cell:nth-child(3) { grid-column: 2; }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-modal-body { padding: 14px; }
}


/* Medibox v427 — landscape MKB-10 diagnosis modal; delete remains only on diagnosis card */
@media (min-width: 761px) {
    body.app-body #clinicalDiagnosisDialog.clinical-focused-entry-dialog .clinical-mkb-picker-card {
        width: min(92vw, 1280px);
        max-width: 1280px;
        height: min(68vh, 640px);
        min-height: 520px;
        max-height: 640px;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-columns-header,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-value {
        grid-template-columns: 120px minmax(0, 1.25fr) minmax(0, 1fr);
        gap: 22px;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-modal-body {
        padding: 16px 20px;
        gap: 12px;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-search-field input[data-mkb-search] {
        min-height: 48px;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-card {
        padding: 11px 15px 13px;
    }
}

/* Medibox v428 — true landscape MKB-10 dialog; all columns visible without horizontal scrolling */
@media (min-width: 761px) {
    body.app-body #clinicalDiagnosisDialog.modal-dialog {
        width: min(96vw, 1320px) !important;
        max-width: 1320px !important;
        height: min(78vh, 720px);
        max-height: min(78vh, 720px);
        margin: auto;
        padding: 0;
        border: 0;
        overflow: hidden !important;
        box-sizing: border-box;
        background: transparent;
    }
    body.app-body #clinicalDiagnosisDialog.clinical-focused-entry-dialog .clinical-mkb-picker-card {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden !important;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-modal-body,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-search-box,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-results-panel,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-results {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-results-panel,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-results {
        overflow-x: hidden !important;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-columns-header,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-value {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        grid-template-columns: 110px minmax(0, 1.08fr) minmax(0, .92fr) !important;
        gap: 18px !important;
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-cell,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-cell,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-primary,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-latin {
        min-width: 0;
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: break-word;
        word-break: normal;
    }
}

@media (min-width: 761px) and (max-width: 1024px) {
    body.app-body #clinicalDiagnosisDialog.modal-dialog {
        width: calc(100vw - 24px) !important;
        height: min(82vh, 700px);
        max-height: min(82vh, 700px);
    }
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-columns-header,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-result-inline,
    body.app-body #clinicalDiagnosisDialog .clinical-mkb-selected-value {
        grid-template-columns: 90px minmax(0, 1fr) minmax(0, .9fr) !important;
        gap: 12px !important;
    }
}

/* Compact material quantity and available stock fields. */
body.app-body .clinical-material-modal-grid,
.embedded-body .clinical-material-modal-grid {
    grid-template-columns: minmax(0, 150px) minmax(0, 175px) !important;
    justify-content: start !important;
    align-items: end !important;
    gap: 12px 14px !important;
}
body.app-body .clinical-material-modal-grid .clinical-material-qty-field input,
.embedded-body .clinical-material-modal-grid .clinical-material-qty-field input {
    height: 36px !important;
    min-height: 36px !important;
    padding: 6px 9px !important;
    font-size: 12px !important;
}
body.app-body .clinical-material-modal-grid .clinical-material-qty-control,
.embedded-body .clinical-material-modal-grid .clinical-material-qty-control {
    min-height: 36px !important;
}
body.app-body .clinical-material-modal-grid .clinical-material-stock,
.embedded-body .clinical-material-modal-grid .clinical-material-stock {
    min-height: 36px !important;
    padding: 5px 9px !important;
}
@media (max-width: 420px) {
    body.app-body .clinical-material-modal-grid,
    .embedded-body .clinical-material-modal-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }
}
