/* ========================================================================
   Medibox — Senior UX refinement
   Final presentation layer. No routes, forms, actions, data attributes or
   application workflows are changed by this file.
   ======================================================================== */

:root {
    --ui-bg: #f5f7fa;
    --ui-surface: #ffffff;
    --ui-surface-subtle: #f8fafc;
    --ui-surface-hover: #f7f8fc;
    --ui-text: #20293a;
    --ui-text-soft: #667085;
    --ui-text-faint: #8a94a6;
    --ui-line: #e3e8ef;
    --ui-line-strong: #d5dce6;
    --ui-primary: #4b55c7;
    --ui-primary-dark: #3f47ad;
    --ui-primary-soft: #f0f1ff;
    --ui-mint: #1d8f7a;
    --ui-mint-soft: #eef9f6;
    --ui-success: #167c69;
    --ui-warning: #a96813;
    --ui-danger: #bd3d49;
    --ui-radius-xs: 6px;
    --ui-radius-sm: 8px;
    --ui-radius-md: 10px;
    --ui-radius-lg: 12px;
    --ui-shadow-xs: 0 1px 2px rgba(16, 24, 40, .035);
    --ui-shadow-sm: 0 3px 12px rgba(16, 24, 40, .055);
    --ui-shadow-md: 0 14px 36px rgba(16, 24, 40, .12);
    --ui-focus: 0 0 0 3px rgba(75, 85, 199, .12);
}

/* ------------------------------------------------------------------------
   Foundations: calm, compact, consistent
   ------------------------------------------------------------------------ */
html { background: var(--ui-bg); }
body.app-body {
    color: var(--ui-text);
    background: var(--ui-bg) !important;
    font-size: 14px;
    line-height: 1.45;
}

body.app-body h1,
body.app-body h2,
body.app-body h3,
body.app-body h4,
body.app-body h5,
body.app-body h6 {
    color: var(--ui-text);
    font-weight: 650;
}

body.app-body .eyebrow {
    color: var(--ui-text-faint);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .075em;
}

body.app-body .muted,
body.app-body small { color: var(--ui-text-soft); }

body.app-body a,
body.app-body button,
body.app-body summary,
body.app-body input,
body.app-body select,
body.app-body textarea {
    -webkit-tap-highlight-color: transparent;
}

body.app-body :focus-visible {
    outline: 0;
    box-shadow: var(--ui-focus) !important;
}

body.app-body input::selection,
body.app-body textarea::selection,
body.app-body ::selection {
    color: #20204c;
    background: #e5e7ff;
}

/* Consistent content density without changing page structure. */
body.app-body .content {
    padding: 20px 24px 32px;
    background: var(--ui-bg) !important;
}
body.app-body .footer {
    padding: 10px 24px 18px;
    color: #929baa;
    font-size: 10px;
}
body.app-body .stack-column { gap: 14px; }

/* ------------------------------------------------------------------------
   Navigation: preserve locations, reduce visual noise
   ------------------------------------------------------------------------ */
body.app-body .sidebar {
    background: #182135 !important;
    border-right: 1px solid rgba(255,255,255,.045) !important;
    box-shadow: none !important;
}
body.app-body .sidebar .brand-mark,
body.app-body .sidebar .brand-mark-logo {
    border-radius: 9px !important;
    background: transparent !important;
    box-shadow: none !important;
}
body.app-body .sidebar .brand-mark-logo img {
    filter: none !important;
}
body.app-body .sidebar .nav-menu { gap: 6px; }
body.app-body .sidebar .nav-item {
    border-radius: 9px !important;
    color: #aeb9ca;
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: none !important;
}
body.app-body .sidebar .nav-item:hover:not(.active),
body.app-body .sidebar .logout-button:hover,
body.app-body .sidebar .user-card:hover {
    color: #fff;
    background: rgba(255,255,255,.055) !important;
}
body.app-body .sidebar .nav-item.active {
    color: #fff;
    background: rgba(99,102,241,.20) !important;
    box-shadow: inset 3px 0 0 #8b91f3 !important;
}
body.app-body .sidebar-toggle {
    border-radius: 8px !important;
    border-color: rgba(255,255,255,.10) !important;
    color: #c5cede !important;
    background: rgba(255,255,255,.04) !important;
    box-shadow: none !important;
}
body.app-body .sidebar-toggle:hover {
    border-color: rgba(255,255,255,.17) !important;
    background: rgba(255,255,255,.075) !important;
}
body.app-body .sidebar .user-card {
    border-radius: 9px !important;
    border-color: rgba(255,255,255,.075) !important;
    background: rgba(255,255,255,.035) !important;
}
body.app-body .sidebar .avatar {
    border-radius: 8px !important;
    background: #28344b !important;
    font-weight: 650;
}
html.sidebar-expanded body.app-body .sidebar-brand .brand-copy strong {
    font-size: 15px !important;
    font-weight: 650 !important;
}

/* ------------------------------------------------------------------------
   Universal top bar: search first, context second
   ------------------------------------------------------------------------ */
body.app-body .topbar.universal-global-topbar {
    padding: 8px 16px 7px;
    border-bottom: 1px solid var(--ui-line) !important;
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 1px 4px rgba(16,24,40,.025) !important;
    backdrop-filter: none !important;
}
body.app-body .global-patient-search {
    height: 42px !important;
    border: 1px solid var(--ui-line-strong) !important;
    border-radius: 9px !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body .global-patient-search:focus-within {
    border-color: #aeb4ea !important;
    box-shadow: var(--ui-focus) !important;
}
body.app-body .global-patient-search > .ui-icon {
    color: #707b8d !important;
}
body.app-body .global-patient-search input {
    height: 40px !important;
    color: #27344a !important;
    font-size: 12px !important;
}
body.app-body .global-patient-search kbd {
    padding: 3px 6px !important;
    border-color: #e2e6ed !important;
    border-radius: 5px !important;
    color: #7b8596 !important;
    background: #f8fafc !important;
    font-weight: 600 !important;
}
body.app-body .global-patient-search .header-input-method-switch.topbar-language-switch {
    border-left-color: #e5e8ee !important;
}
body.app-body .global-patient-search .header-input-method-switch.topbar-language-switch button {
    min-width: 39px !important;
    height: 30px !important;
    border-radius: 6px !important;
    color: #737e90 !important;
    font-size: 8px !important;
    font-weight: 650 !important;
}
body.app-body .global-patient-search .header-input-method-switch.topbar-language-switch button:hover {
    color: var(--ui-primary) !important;
    background: #f6f6fd !important;
}
body.app-body .global-patient-search .header-input-method-switch.topbar-language-switch button[aria-pressed="true"],
body.app-body .global-patient-search .header-input-method-switch.topbar-language-switch button.is-active {
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
    box-shadow: none !important;
}
body.app-body .global-patient-search-results {
    padding: 5px !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 10px !important;
    box-shadow: var(--ui-shadow-md) !important;
}
body.app-body .global-search-result {
    padding: 9px 10px;
    border-radius: 7px;
}
body.app-body .global-search-result:hover,
body.app-body .global-search-result:focus-visible { background: #f6f7fb !important; }
body.app-body .global-search-result-avatar {
    border-radius: 8px !important;
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
    font-weight: 650 !important;
}
body.app-body .global-search-result-copy strong {
    color: #27344a !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}
body.app-body .global-search-result-copy small {
    font-size: 9px !important;
    font-weight: 400 !important;
}
body.app-body .topbar-practitioner-switch,
body.app-body .topbar-clinic-context {
    height: 42px !important;
    padding-inline: 10px !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 9px !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body .topbar-practitioner-switch:hover {
    border-color: #ccd3df !important;
    box-shadow: none !important;
    transform: none !important;
}
body.app-body .topbar-context-icon {
    width: 26px !important;
    height: 26px !important;
    flex-basis: 26px !important;
    border-radius: 7px !important;
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
}
body.app-body .topbar-practitioner-switch small,
body.app-body .topbar-clinic-context small {
    color: #8b95a6 !important;
    font-size: 7px !important;
    font-weight: 600 !important;
}
body.app-body .topbar-practitioner-copy strong,
body.app-body .topbar-clinic-context strong {
    color: #344054 !important;
    font-weight: 600 !important;
}
body.app-body .topbar-clinic-context strong { font-size: 10px !important; }
body.app-body .topbar-medibox-title,
body.app-body .module-topbar-title {
    color: #344054 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* ------------------------------------------------------------------------
   Cards / sections: lines and spacing instead of decoration
   ------------------------------------------------------------------------ */
body.app-body .card,
body.app-body .reference-register-card,
body.app-body .catalog-table-card,
body.app-body .patient-profile-v2-card,
body.app-body .visit-workspace-section,
body.app-body .visit-review-note-card,
body.app-body .appointment-pro-panel,
body.app-body .settings-module-card,
body.app-body .inventory-overview-card,
body.app-body .payment-kpi-card,
body.app-body .platform-kpi-card {
    border: 1px solid var(--ui-line) !important;
    border-radius: var(--ui-radius-lg) !important;
    background: #fff !important;
    box-shadow: var(--ui-shadow-xs) !important;
}
body.app-body .card { padding: 16px; }
body.app-body .card-header {
    min-height: 38px;
    margin-bottom: 12px;
    gap: 12px;
}
body.app-body .card-header h2 { font-size: 16px; font-weight: 650; }
body.app-body .card-header h3 { font-size: 14px; font-weight: 600; }

/* ------------------------------------------------------------------------
   Controls and actions: one clear hierarchy
   ------------------------------------------------------------------------ */
body.app-body .btn {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 7px !important;
    font-size: 11.5px;
    font-weight: 600;
    box-shadow: none !important;
    transform: none !important;
}
body.app-body .btn-sm {
    min-height: 31px;
    padding: 5px 9px;
    border-radius: 6px !important;
    font-size: 10.5px;
}
body.app-body .btn-primary {
    color: #fff !important;
    border-color: var(--ui-primary) !important;
    background: var(--ui-primary) !important;
}
body.app-body .btn-primary:hover {
    border-color: var(--ui-primary-dark) !important;
    background: var(--ui-primary-dark) !important;
}
body.app-body .btn-light {
    color: #344054 !important;
    border-color: var(--ui-line-strong) !important;
    background: #fff !important;
}
body.app-body .btn-light:hover {
    border-color: #c5ced9 !important;
    background: #f8fafc !important;
}
body.app-body .btn-success {
    border-color: var(--ui-success) !important;
    background: var(--ui-success) !important;
}
body.app-body .btn-danger {
    border-color: var(--ui-danger) !important;
    background: var(--ui-danger) !important;
    box-shadow: none !important;
}
body.app-body .btn:disabled,
body.app-body .icon-button:disabled,
body.app-body .icon-action:disabled {
    cursor: not-allowed;
    opacity: .48;
}
body.app-body .icon-button,
body.app-body .icon-action,
body.app-body .action-icon-button,
body.app-body .reference-filter-button,
body.app-body .reference-add-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid var(--ui-line-strong) !important;
    border-radius: 7px !important;
    color: #5f6b7c !important;
    background: #fff !important;
    box-shadow: none !important;
    transform: none !important;
}
body.app-body .icon-button:hover,
body.app-body .icon-action:hover,
body.app-body .action-icon-button:hover {
    color: var(--ui-primary) !important;
    border-color: #c9ccef !important;
    background: #f9f9ff !important;
}
body.app-body .icon-action-primary,
body.app-body .reference-add-button {
    color: #fff !important;
    border-color: var(--ui-primary) !important;
    background: var(--ui-primary) !important;
}
body.app-body .icon-action-primary:hover,
body.app-body .reference-add-button:hover {
    color: #fff !important;
    border-color: var(--ui-primary-dark) !important;
    background: var(--ui-primary-dark) !important;
}
body.app-body .icon-action-danger,
body.app-body .action-icon-button.danger,
body.app-body .danger-action {
    color: var(--ui-danger) !important;
    border-color: #efc9ce !important;
    background: #fff !important;
}
body.app-body .icon-action-danger:hover,
body.app-body .action-icon-button.danger:hover,
body.app-body .danger-action:hover {
    color: #a92f3b !important;
    border-color: #eab8bf !important;
    background: #fff5f6 !important;
}
body.app-body .action-icon-button.warning { color: #88641b !important; }

/* ------------------------------------------------------------------------
   Forms: compact but comfortable, clearer focus
   ------------------------------------------------------------------------ */
body.app-body .field { gap: 5px; }
body.app-body .field > span,
body.app-body .field > label,
body.app-body label {
    color: #475467;
    font-size: 11px;
    font-weight: 600;
}
body.app-body input:not([type="checkbox"]):not([type="radio"]),
body.app-body select,
body.app-body textarea,
body.app-body .form-control,
body.app-body .reference-search-control input,
body.app-body .reference-select-control select,
body.app-body .appointment-control {
    min-height: 39px;
    border: 1px solid var(--ui-line-strong) !important;
    border-radius: 7px !important;
    color: #344054;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body textarea { line-height: 1.5; }
body.app-body input:not([type="checkbox"]):not([type="radio"]):hover,
body.app-body select:hover,
body.app-body textarea:hover { border-color: #c8d0db !important; }
body.app-body input:not([type="checkbox"]):not([type="radio"]):focus,
body.app-body select:focus,
body.app-body textarea:focus,
body.app-body .form-control:focus,
body.app-body .reference-search-control:focus-within,
body.app-body .reference-select-control:focus-within,
body.app-body .appointment-control:focus-within {
    outline: 0;
    border-color: #aeb4ea !important;
    box-shadow: var(--ui-focus) !important;
}
body.app-body input:disabled,
body.app-body select:disabled,
body.app-body textarea:disabled,
body.app-body input[readonly],
body.app-body textarea[readonly] {
    color: #697586 !important;
    background: #f6f8fa !important;
}
body.app-body input::placeholder,
body.app-body textarea::placeholder { color: #9aa3b2; }
body.app-body .form-grid { gap: 12px; }
body.app-body .stack-form { gap: 12px; }
body.app-body .form-actions { gap: 8px; }
body.app-body .check-field,
body.app-body .switch-field {
    border-color: var(--ui-line) !important;
    border-radius: 8px !important;
    background: #fbfcfd !important;
}
body.app-body input[type="checkbox"],
body.app-body input[type="radio"] { accent-color: var(--ui-primary); }
body.app-body .field-help,
body.app-body .form-hint,
body.app-body .required-note,
body.app-body .autosave-note {
    color: #7c8798 !important;
    font-size: 10px !important;
    font-weight: 400 !important;
}

/* ------------------------------------------------------------------------
   Registers / tables: fast scanning, sticky context and actions
   ------------------------------------------------------------------------ */
body.app-body .reference-register-card,
body.app-body .catalog-table-card { overflow: hidden; }
body.app-body .reference-register-toolbar,
body.app-body .module-list-toolbar,
body.app-body .catalog-toolbar-actions-only {
    min-height: 54px;
    padding-block: 8px !important;
    border-bottom: 1px solid var(--ui-line) !important;
    background: #fff !important;
}
body.app-body .table-wrap,
body.app-body .reference-table-wrap {
    position: relative;
    background: #fff;
    scrollbar-color: #c7ced8 #f4f6f8;
    scrollbar-width: thin;
}
body.app-body .data-table,
body.app-body .reference-data-table,
body.app-body .module-unified-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    color: #344054;
}
body.app-body .data-table thead th,
body.app-body .reference-data-table thead th,
body.app-body .module-unified-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 9px 12px !important;
    color: #697586 !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--ui-line) !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: .045em !important;
    text-transform: uppercase !important;
}
body.app-body .data-table tbody td,
body.app-body .reference-data-table tbody td,
body.app-body .module-unified-table tbody td {
    padding: 10px 12px !important;
    color: #344054;
    border-bottom: 1px solid #edf0f3 !important;
    background: #fff;
    font-size: 11.5px;
    font-weight: 400 !important;
    line-height: 1.35;
}
body.app-body .data-table tbody tr:last-child td,
body.app-body .reference-data-table tbody tr:last-child td { border-bottom: 0 !important; }
body.app-body .data-table tbody tr:hover > td,
body.app-body .reference-data-table tbody tr:hover > td,
body.app-body .reference-record-row:hover td {
    background: #fafbfc !important;
}
body.app-body .reference-record-row:hover td:first-child { box-shadow: inset 2px 0 0 #8c91e5 !important; }
body.app-body .data-table:has(th.actions-column) th.actions-column,
body.app-body .data-table:has(th.actions-column) tbody td:last-child,
body.app-body .reference-data-table:has(th.actions-column) th.actions-column,
body.app-body .reference-data-table:has(th.actions-column) tbody td:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
}
body.app-body .data-table:has(th.actions-column) thead th.actions-column,
body.app-body .reference-data-table:has(th.actions-column) thead th.actions-column { z-index: 6; }
body.app-body .data-table:has(th.actions-column) tbody tr:hover td:last-child,
body.app-body .reference-data-table:has(th.actions-column) tbody tr:hover td:last-child { background: #fafbfc !important; }
body.app-body .actions-column { text-align: right; }
body.app-body .reference-row-actions,
body.app-body .table-action-group,
body.app-body .actions-cell {
    gap: 5px !important;
}
body.app-body .reference-person-avatar,
body.app-body .reference-person-photo {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
    border-radius: 8px !important;
}
body.app-body .reference-person-avatar {
    color: var(--ui-primary) !important;
    border-color: #e0e2f5 !important;
    background: #f2f3ff !important;
    font-weight: 600 !important;
}
body.app-body .reference-person-copy strong,
body.app-body .patient-name-uppercase,
body.app-body .reference-person-copy .patient-name-uppercase {
    color: #263247 !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: .005em;
}
body.app-body .reference-primary-value {
    color: #475467 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
}
body.app-body .reference-secondary-value,
body.app-body .table-subtext {
    color: #858fa0 !important;
    font-size: 9.5px !important;
    font-weight: 400 !important;
}
body.app-body .reference-phone-link:hover,
body.app-body .reference-email-link:hover { color: var(--ui-primary) !important; }
body.app-body .reference-pagination {
    border-top-color: var(--ui-line) !important;
    background: #fbfcfd !important;
}

/* Statuses remain visible without becoming the visual center. */
body.app-body .badge,
body.app-body .reference-status-badge,
body.app-body .pill {
    min-height: 22px;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 9.5px;
    font-weight: 600 !important;
}
body.app-body .reference-status-badge { padding: 4px 7px !important; }
body.app-body .reference-status-badge.is-active,
body.app-body .badge-success {
    color: #136f60 !important;
    border-color: #cfe9e2 !important;
    background: #f0f9f6 !important;
}
body.app-body .reference-status-badge.is-inactive,
body.app-body .badge-neutral {
    color: #667085 !important;
    border-color: #e1e5eb !important;
    background: #f6f7f9 !important;
}
body.app-body .badge-primary,
body.app-body .badge-info {
    color: #4650b7 !important;
    background: #f0f1ff !important;
}
body.app-body .badge-warning {
    color: #946014 !important;
    background: #fff7e8 !important;
}
body.app-body .badge-danger {
    color: #ae3541 !important;
    background: #fff1f2 !important;
}

/* ------------------------------------------------------------------------
   Patient profile: identity first, alerts visible but quiet
   ------------------------------------------------------------------------ */
body.app-body .patient-profile-v2 { gap: 12px; }
body.app-body .patient-profile-v2-hero {
    overflow: visible;
    border: 1px solid var(--ui-line) !important;
    border-radius: var(--ui-radius-lg) !important;
    background: #fff !important;
    box-shadow: var(--ui-shadow-xs) !important;
}
body.app-body .patient-profile-v2-main {
    gap: 14px !important;
    padding: 15px 17px !important;
}
body.app-body .patient-profile-v2-avatar,
body.app-body .patient-detail-avatar {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 10px !important;
    color: var(--ui-primary) !important;
    border-color: #dde1f4 !important;
    background: #f0f2ff !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 650 !important;
}
body.app-body .patient-profile-v2-title-line h1 {
    margin-bottom: 8px !important;
    color: #263247 !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    letter-spacing: -.015em !important;
}
body.app-body .patient-profile-v2-title-line h1 > span {
    color: #7a8596;
    font-size: 12px;
    font-weight: 500;
}
body.app-body .patient-profile-name-uppercase {
    font-weight: 650 !important;
}
body.app-body .patient-profile-meta-chip,
body.app-body .patient-detail-status,
body.app-body .patient-profile-header-state,
body.app-body .patient-profile-header-detail > summary,
body.app-body .patient-profile-header-icon {
    min-height: 28px !important;
    padding: 5px 8px !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 7px !important;
    color: #596579 !important;
    background: #f8fafc !important;
    font-size: 9px !important;
    font-weight: 550 !important;
    box-shadow: none !important;
    transform: none !important;
}
body.app-body .patient-profile-header-icon {
    width: 29px !important;
    min-width: 29px !important;
    padding: 0 !important;
    color: var(--ui-primary) !important;
}
body.app-body .patient-profile-header-state.is-clear,
body.app-body .patient-detail-status.is-active {
    color: #147361 !important;
    border-color: #d2e9e3 !important;
    background: #f1faf7 !important;
}
body.app-body .patient-profile-header-detail.has-alert > summary,
body.app-body .patient-profile-header-detail.has-debt > summary {
    color: #b83a46 !important;
    border-color: #efcfd3 !important;
    background: #fff5f6 !important;
}
body.app-body .patient-profile-header-popover {
    border: 1px solid var(--ui-line) !important;
    border-radius: 9px !important;
    box-shadow: var(--ui-shadow-md) !important;
}
body.app-body .patient-profile-schedule-button {
    min-width: 142px !important;
}
body.app-body .patient-profile-v2-tabs {
    padding: 0 10px !important;
    border-top: 1px solid var(--ui-line) !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body .patient-profile-v2-tab {
    min-height: 42px !important;
    padding: 0 11px !important;
    border-radius: 0 !important;
    color: #667085 !important;
    background: transparent !important;
    font-size: 10.5px !important;
    font-weight: 500 !important;
}
body.app-body .patient-profile-v2-tab:hover { color: #344054 !important; }
body.app-body .patient-profile-v2-tab.is-active,
body.app-body .patient-profile-v2-tab.active,
body.app-body .patient-profile-v2-tab[aria-selected="true"] {
    color: var(--ui-primary) !important;
    background: transparent !important;
    box-shadow: inset 0 -2px 0 var(--ui-primary) !important;
}
body.app-body .patient-profile-v2-panel { padding-top: 0; }
body.app-body .patient-visits-heading h3,
body.app-body .patient-profile-v2-panel-heading h2 {
    font-weight: 600 !important;
}
body.app-body .patient-last-visit-card,
body.app-body .patient-appointment-highlight-card,
body.app-body .patient-profile-detail-card,
body.app-body .patient-xray-professional-card {
    border: 1px solid var(--ui-line) !important;
    border-radius: 9px !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body .patient-last-visit-card:hover,
body.app-body .patient-appointment-highlight-card:hover,
body.app-body .patient-xray-professional-card:hover {
    border-color: #d3d9e3 !important;
    box-shadow: var(--ui-shadow-sm) !important;
}
body.app-body .patient-last-visit-card .patient-visit-primary > strong {
    color: var(--ui-primary) !important;
    font-weight: 650 !important;
}
body.app-body .patient-last-visit-card .patient-visit-reason > strong,
body.app-body .patient-last-visit-card .patient-visit-diagnosis > strong,
body.app-body .patient-last-visit-card .patient-visit-doctor > strong {
    color: #344054 !important;
    font-weight: 400 !important;
}

/* History timeline: less decorative, easier scanning. */
body.app-body .patient-history-timeline::before { background: #e1e5ec !important; }
body.app-body .patient-history-node { box-shadow: none !important; }
body.app-body .patient-history-card {
    border-color: var(--ui-line) !important;
    border-radius: 9px !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body .patient-history-card:hover {
    border-color: #d3d9e3 !important;
    box-shadow: var(--ui-shadow-sm) !important;
}
body.app-body .patient-history-icon {
    border-radius: 7px !important;
    background: var(--ui-primary-soft) !important;
    color: var(--ui-primary) !important;
}

/* ------------------------------------------------------------------------
   Clinical visit: keep the workflow, flatten the chrome
   ------------------------------------------------------------------------ */
body.app-body .visit-workspace-hero,
body.app-body .visit-command-header-compact,
body.app-body .visit-data-header,
body.app-body .visit-simple-section-header,
body.app-body .visit-entry-toolbar-command {
    background: #fff !important;
}
body.app-body .visit-workspace-hero {
    padding: 14px 16px !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 11px !important;
    box-shadow: var(--ui-shadow-xs) !important;
}
body.app-body .visit-workspace-avatar {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 10px !important;
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 650 !important;
}
body.app-body .visit-workspace-section,
body.app-body .visit-review-note-card,
body.app-body .clinical-entry-full-card,
body.app-body .clinical-compact-entry-card {
    border-color: var(--ui-line) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body .visit-horizontal-block { border-bottom-color: #edf0f3 !important; }
body.app-body .visit-horizontal-label > span,
body.app-body .visit-simple-section-header > div > span,
body.app-body .visit-review-note-card > header > span,
body.app-body .clinical-visit-entry-icon {
    border-radius: 7px !important;
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
    box-shadow: none !important;
}
body.app-body .visit-horizontal-label h3,
body.app-body .visit-review-note-card h3,
body.app-body .clinical-entry-full-head h3 {
    color: #344054 !important;
    font-weight: 600 !important;
}
body.app-body .visit-horizontal-label small,
body.app-body .clinical-context-note { color: #7d8797 !important; }
body.app-body .visit-add-service,
body.app-body .visit-service-compact-row,
body.app-body .visit-tooth-card,
body.app-body .visit-document-compact-list article,
body.app-body .visit-finance-compact-grid article {
    border-color: var(--ui-line) !important;
    border-radius: 8px !important;
    background: #fbfcfd !important;
    box-shadow: none !important;
}
body.app-body .visit-service-number {
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
    font-weight: 600 !important;
}

/* ------------------------------------------------------------------------
   Calendar: information density over decoration
   ------------------------------------------------------------------------ */
body.app-body .weekly-calendar-card,
body.app-body .calendar-shell,
body.app-body .weekly-calendar {
    border-color: var(--ui-line) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: var(--ui-shadow-xs) !important;
}
body.app-body .calendar-toolbar,
body.app-body .calendar-toolbar-five-days,
body.app-body .calendar-legend,
body.app-body .calendar-corner,
body.app-body .calendar-day-header {
    background: #fff !important;
    backdrop-filter: none !important;
}
body.app-body .calendar-toolbar-five-days,
body.app-body .calendar-toolbar { border-bottom-color: var(--ui-line) !important; }
body.app-body .calendar-legend {
    border-color: #edf0f3 !important;
    color: #6f7a8b !important;
}
body.app-body .calendar-current-date,
body.app-body .calendar-nav-arrow {
    border-color: var(--ui-line-strong) !important;
    border-radius: 7px !important;
    color: #465266 !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body .calendar-day-header {
    border-bottom-color: var(--ui-line) !important;
}
body.app-body .calendar-day-header strong {
    color: #596579 !important;
    font-weight: 600 !important;
}
body.app-body .calendar-day-header.is-today {
    color: #344054 !important;
    background: #f6f6fd !important;
    box-shadow: inset 0 2px 0 var(--ui-primary) !important;
}
body.app-body .calendar-day-header.is-today strong,
body.app-body .calendar-day-header.is-today span,
body.app-body .calendar-day-header.is-today small { color: #4650b7 !important; }
body.app-body .calendar-time-label {
    color: #818b9b !important;
    border-right-color: #e4e8ee !important;
    background: #fafbfc !important;
}
body.app-body .calendar-slot {
    border-color: #edf0f3 !important;
    background: #fff !important;
}
body.app-body .calendar-slot.is-today { background: #fdfdff !important; }
body.app-body .slot-add-button {
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
}
body.app-body #weeklyCalendarApp .calendar-appointment-simple,
body.app-body .calendar-appointment {
    border-radius: 7px !important;
    box-shadow: var(--ui-shadow-xs) !important;
    transform: none !important;
}
body.app-body #weeklyCalendarApp .calendar-appointment-simple:hover,
body.app-body .calendar-appointment:hover {
    box-shadow: var(--ui-shadow-sm) !important;
    transform: none !important;
}

/* ------------------------------------------------------------------------
   Finance: patient grouping is primary, money states stay restrained
   ------------------------------------------------------------------------ */
body.app-body .payment-kpi-card,
body.app-body .payment-installment-mode-panel,
body.app-body .payment-installment-history-below,
body.app-body .payment-evidence-entry,
body.app-body .patient-finance-all-services-table {
    border-color: var(--ui-line) !important;
    background: #fff !important;
    box-shadow: none !important;
}
body.app-body .payment-kpi-icon {
    border-radius: 8px !important;
    box-shadow: none !important;
}
body.app-body .finance-patient-name,
body.app-body .finance-patient-name strong {
    color: #27344a !important;
    font-weight: 650 !important;
}
body.app-body .summary-success {
    color: #126d5e !important;
    background: #f0f9f6 !important;
}
body.app-body .summary-danger {
    color: #aa3440 !important;
    background: #fff3f4 !important;
}
body.app-body .patient-finance-all-services-table tr.is-group-service {
    background: transparent !important;
}
body.app-body .payment-entry-heading { border-bottom-color: var(--ui-line) !important; }
body.app-body .payment-installment-history-below {
    border-radius: 9px !important;
}
body.app-body .payment-installment-history-heading {
    background: #f8fafc !important;
}

/* ------------------------------------------------------------------------
   Services / materials / inventory / settings
   ------------------------------------------------------------------------ */
body.app-body[data-active-menu="services"] .catalog-standard-table strong,
body.app-body[data-active-menu="services"] .service-groups-table strong,
body.app-body[data-active-menu="services"] .module-unified-table strong,
body.app-body[data-active-menu="materials"] .module-unified-table strong,
body.app-body[data-active-menu="inventory"] .module-unified-table strong {
    font-weight: 500;
}
body.app-body .code-chip {
    padding: 4px 7px;
    border: 1px solid #e3e7ed;
    border-radius: 5px !important;
    color: #5f6b7c !important;
    background: #f6f8fa !important;
    font-size: 10px;
    font-weight: 500 !important;
}
body.app-body .material-module-tabs a,
body.app-body .settings-module-card,
body.app-body .inventory-overview-card {
    box-shadow: none !important;
}
body.app-body .material-module-tabs a.active {
    color: var(--ui-primary) !important;
    border-color: #d8daf4 !important;
    background: var(--ui-primary-soft) !important;
    box-shadow: none !important;
}
body.app-body .settings-module-icon,
body.app-body .inventory-overview-card > span,
body.app-body .platform-kpi-card > span {
    border-radius: 8px !important;
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
    box-shadow: none !important;
}
body.app-body .settings-module-copy strong { font-weight: 600 !important; }

/* ------------------------------------------------------------------------
   Modals: stable frame; the body is the only scrolling area
   ------------------------------------------------------------------------ */
body.app-body dialog.modal-dialog,
body.app-body .appointment-modal-modern,
body.app-body .visit-command-modal,
body.app-body .service-modal-modern {
    border: 1px solid var(--ui-line) !important;
    border-radius: 11px !important;
    background: #fff !important;
    box-shadow: 0 22px 58px rgba(16,24,40,.20) !important;
}
body.app-body dialog.modal-dialog::backdrop,
body.app-body .appointment-modal-modern::backdrop,
body.app-body .visit-command-modal::backdrop,
body.app-body .service-modal-modern::backdrop {
    background: rgba(17,24,39,.44) !important;
    backdrop-filter: none !important;
}
body.app-body .modal-card {
    border-radius: inherit !important;
    background: #fff !important;
}
body.app-body .modal-header {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 56px;
    padding: 12px 15px !important;
    border-bottom: 1px solid var(--ui-line) !important;
    background: #fff !important;
}
body.app-body .modal-header h2 {
    color: #27344a !important;
    font-size: 16px !important;
    font-weight: 650 !important;
}
body.app-body .modal-body {
    padding: 14px 15px !important;
    background: #fff !important;
}
body.app-body .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    min-height: 54px;
    padding: 10px 15px !important;
    border-top: 1px solid var(--ui-line) !important;
    background: #fff !important;
}
body.app-body .patient-modal-header,
body.app-body .receipt-modal-header,
body.app-body .appointment-modal-header-modern { background: #fff !important; }
body.app-body .service-details-compact-status,
body.app-body .service-details-compact-availability,
body.app-body .settings-modal-lead,
body.app-body .platform-form-section {
    border-color: var(--ui-line) !important;
    border-radius: 9px !important;
    background: #fafbfc !important;
    box-shadow: none !important;
}

/* ------------------------------------------------------------------------
   Feedback / empty states
   ------------------------------------------------------------------------ */
body.app-body .empty-state,
body.app-body .unified-empty-message,
body.app-body .patient-profile-empty {
    color: #7b8696 !important;
}
body.app-body .empty-state { min-height: 210px; padding: 24px; }
body.app-body .empty-state h3,
body.app-body .unified-empty-message h3 {
    color: #475467 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}
body.app-body .empty-icon {
    border-radius: 10px !important;
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
}
body.app-body .flash-stack { top: 76px; right: 18px; }
body.app-body .alert {
    padding: 11px 12px;
    border-radius: 8px !important;
    box-shadow: var(--ui-shadow-md) !important;
}

/* ------------------------------------------------------------------------
   Mobile and medium screens: keep controls reachable, not oversized
   ------------------------------------------------------------------------ */
@media (max-width: 1320px) {
    body.app-body .content { padding-inline: 20px; }
}

@media (max-width: 980px) {
    body.app-body .content { padding: 16px 16px 88px; }
    body.app-body .sidebar { box-shadow: 16px 0 34px rgba(16,24,40,.18) !important; }
    body.app-body .data-table:has(th.actions-column) th.actions-column,
    body.app-body .data-table:has(th.actions-column) tbody td:last-child,
    body.app-body .reference-data-table:has(th.actions-column) th.actions-column,
    body.app-body .reference-data-table:has(th.actions-column) tbody td:last-child { position: static; }
}

@media (max-width: 760px) {
    body.app-body { font-size: 14px; }
    body.app-body .topbar.universal-global-topbar { padding: 7px 9px; }
    body.app-body .content { padding: 12px 10px 84px; }
    body.app-body .card { padding: 13px; border-radius: 10px !important; }
    body.app-body .global-patient-search { height: 40px !important; }
    body.app-body .global-patient-search input { height: 38px !important; font-size: 11px !important; }
    body.app-body .topbar-practitioner-switch,
    body.app-body .topbar-clinic-context { height: 39px !important; }
    body.app-body .patient-profile-v2-main { padding: 13px !important; }
    body.app-body .patient-profile-v2-avatar,
    body.app-body .patient-detail-avatar {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
    }
    body.app-body .patient-profile-v2-title-line h1 { font-size: 16px !important; }
    body.app-body .patient-profile-v2-tabs { overflow-x: auto; scrollbar-width: none; }
    body.app-body .patient-profile-v2-tabs::-webkit-scrollbar { display: none; }
    body.app-body .patient-profile-v2-tab { flex: 0 0 auto; min-height: 40px !important; }
    body.app-body .modal-header { padding: 10px 12px !important; }
    body.app-body .modal-body { padding: 12px !important; }
    body.app-body .modal-footer { padding: 9px 12px !important; }
    body.app-body .form-grid.cols-2,
    body.app-body .form-grid.cols-3 { grid-template-columns: 1fr; }
    body.app-body .span-2,
    body.app-body .span-3 { grid-column: auto; }
}

/* Respect reduced-motion preferences without changing behavior. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    body.app-body *,
    body.app-body *::before,
    body.app-body *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Composite inputs own the border on their wrapper, not on the nested input. */
body.app-body .global-patient-search input,
body.app-body .patient-search-input-wrap input,
body.app-body .appointment-form-pro .patient-search-input-wrap input {
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
body.app-body .global-patient-search input:focus,
body.app-body .patient-search-input-wrap input:focus,
body.app-body .appointment-form-pro .patient-search-input-wrap input:focus {
    border: 0 !important;
    box-shadow: none !important;
}

/* ------------------------------------------------------------------------
   Authentication: same product language, still the same two-column flow
   ------------------------------------------------------------------------ */
body.auth-body {
    min-height: 100vh;
    color: var(--ui-text);
    background: #f4f6f9 !important;
}
body.auth-body .auth-shell { padding: 24px; }
body.auth-body .login-card {
    width: min(980px, 100%);
    min-height: 560px;
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 58px rgba(16,24,40,.12);
}
body.auth-body .login-visual {
    padding: 30px;
    color: #fff;
    background: #1a2438 !important;
}
body.auth-body .login-visual .brand-mark {
    background: transparent !important;
    box-shadow: none !important;
}
body.auth-body .login-copy { padding: 24px 6px 14px; }
body.auth-body .login-copy .pill {
    color: #d9dcff;
    background: rgba(139,145,243,.13);
    font-weight: 600;
}
body.auth-body .login-copy h2 {
    margin-top: 14px;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.025em;
}
body.auth-body .login-copy p {
    color: #bbc4d3;
    font-size: 14px;
}
body.auth-body .login-form-wrap { padding: 46px 48px; }
body.auth-body .login-form-header { margin-bottom: 22px; }
body.auth-body .login-form-header h1 {
    color: #20293a;
    font-size: 25px;
    font-weight: 650;
}
body.auth-body .field > span {
    color: #475467;
    font-size: 11px;
    font-weight: 600;
}
body.auth-body .field input {
    min-height: 41px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 8px;
    box-shadow: none;
}
body.auth-body .field input:focus {
    border-color: #aeb4ea;
    box-shadow: var(--ui-focus);
}
body.auth-body .btn-primary {
    border-color: var(--ui-primary);
    border-radius: 8px;
    background: var(--ui-primary);
    box-shadow: none;
}
body.auth-body .btn-primary:hover { background: var(--ui-primary-dark); }
body.auth-body .demo-box {
    border-color: var(--ui-line);
    border-radius: 8px;
    background: #f8fafc;
}
@media (max-width: 760px) {
    body.auth-body .auth-shell { padding: 12px; }
    body.auth-body .login-card { min-height: 0; grid-template-columns: 1fr; border-radius: 14px; }
    body.auth-body .login-visual { display: none; }
    body.auth-body .login-form-wrap { padding: 30px 22px; }
}
\n\n/* Patient profile: visit hierarchy + dental status tab (2026-08-10) */\nbody.app-body .patient-profile-v2-panel .patient-visits-heading h3 {\n    font-weight: 700 !important;\n}\nbody.app-body .patient-profile-v2-panel .patient-latest-visit-heading {\n    margin-top: 11px !important;\n}\nbody.app-body .patient-profile-v2-panel .patient-previous-visits-heading {\n    margin-top: 22px !important;\n}\nbody.app-body .patient-teeth-status-panel {\n    padding-top: 10px !important;\n}\nbody.app-body .patient-teeth-status-heading {\n    align-items: center;\n}\nbody.app-body .patient-teeth-status-heading h2 {\n    font-weight: 700 !important;\n}\nbody.app-body .patient-teeth-summary {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n}\nbody.app-body .patient-teeth-summary > span {\n    min-width: 74px;\n    padding: 7px 10px;\n    display: grid;\n    gap: 1px;\n    border: 1px solid var(--ui-line);\n    border-radius: 8px;\n    background: #fff;\n    text-align: center;\n}\nbody.app-body .patient-teeth-summary strong {\n    color: var(--ui-text);\n    font-size: 15px;\n    line-height: 1.1;\n}\nbody.app-body .patient-teeth-summary small {\n    color: var(--ui-muted);\n    font-size: 9px;\n    font-weight: 600;\n}\nbody.app-body .patient-teeth-summary .is-clear strong { color: #18794e; }\nbody.app-body .patient-teeth-summary .has-findings strong { color: #b54708; }\nbody.app-body .patient-teeth-legend {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 5px;\n    margin: 4px 0 12px;\n}\nbody.app-body .patient-teeth-legend-item {\n    display: inline-flex;\n    align-items: center;\n    gap: 5px;\n    min-height: 24px;\n    padding: 3px 7px;\n    border: 1px solid var(--ui-line) !important;\n    border-radius: 999px;\n    background: #fff !important;\n    font-size: 9px;\n    font-weight: 600;\n}\nbody.app-body .patient-teeth-legend-item i {\n    width: 7px;\n    height: 7px;\n    border-radius: 50%;\n    background: currentColor;\n}\nbody.app-body .patient-teeth-chart {\n    display: grid;\n    grid-template-columns: repeat(16, minmax(46px, 1fr));\n    gap: 6px;\n    padding: 14px;\n    border: 1px solid var(--ui-line);\n    border-radius: 10px;\n    background: #fbfcfe;\n    overflow-x: auto;\n}\nbody.app-body .patient-tooth-status-card {\n    min-width: 46px;\n    min-height: 76px;\n    padding: 7px 4px;\n    display: grid;\n    place-items: center;\n    align-content: center;\n    gap: 2px;\n    border: 1px solid var(--ui-line) !important;\n    border-radius: 8px;\n    box-shadow: none !important;\n    cursor: default;\n}\nbody.app-body .patient-tooth-status-card.patient-teeth-lower-start {\n    grid-column: 1;\n}\nbody.app-body .patient-tooth-status-card .patient-tooth-icon {\n    display: grid;\n    place-items: center;\n    width: 25px;\n    height: 25px;\n}\nbody.app-body .patient-tooth-status-card .ui-icon {\n    width: 21px;\n    height: 21px;\n}\nbody.app-body .patient-tooth-status-card strong {\n    font-size: 11px;\n    font-weight: 700;\n}\nbody.app-body .patient-tooth-status-card small {\n    max-width: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    font-size: 7.5px;\n    font-weight: 600;\n}\nbody.app-body .patient-tooth-status-card em {\n    max-width: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    font-size: 7px;\n    font-style: normal;\n    font-weight: 700;\n}\nbody.app-body .patient-teeth-status-footer {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    margin-top: 10px;\n}\nbody.app-body .patient-teeth-status-footer > span {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    color: var(--ui-muted);\n    font-size: 10px;\n}\nbody.app-body .patient-teeth-status-footer > span .ui-icon {\n    width: 14px;\n    height: 14px;\n}\n@media (max-width: 980px) {\n    body.app-body .patient-teeth-chart { grid-template-columns: repeat(8, minmax(48px, 1fr)); }\n    body.app-body .patient-tooth-status-card.patient-teeth-lower-start { grid-column: auto; }\n}\n@media (max-width: 620px) {\n    body.app-body .patient-teeth-status-heading,\n    body.app-body .patient-teeth-status-footer { align-items: flex-start; flex-direction: column; }\n    body.app-body .patient-teeth-chart { grid-template-columns: repeat(4, minmax(52px, 1fr)); }\n}\n

/* Patient profile odontogram now reuses the exact clinical visit component. */
.patient-teeth-status-panel .patient-profile-odontogram {
    margin: 0;
    box-shadow: none;
}
.patient-teeth-status-panel .odontogram-legend-panel:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
}
.patient-teeth-status-panel .patient-teeth-status-footer {
    margin-top: 12px;
}

/* Service picker: respect the active Services / Service groups filter.
   maticen-reference.css defines .clinical-service-choice with display:grid!important,
   so an explicit author-level hidden rule is required. */
.clinical-service-picker-results .clinical-service-choice[hidden] {
    display: none !important;
}

/* Services + service groups: unified table typography (2026-08-10). */
body.app-body[data-active-menu="services"] .catalog-standard-table thead th,
body.app-body[data-active-menu="services"] .service-groups-table thead th {
    font-family: inherit !important;
    font-weight: 600 !important;
}
body.app-body[data-active-menu="services"] .catalog-standard-table tbody td,
body.app-body[data-active-menu="services"] .service-groups-table tbody td,
body.app-body[data-active-menu="services"] .catalog-standard-table tbody td > strong,
body.app-body[data-active-menu="services"] .service-groups-table tbody td > strong,
body.app-body[data-active-menu="services"] .catalog-standard-table .code-chip,
body.app-body[data-active-menu="services"] .service-groups-table .code-chip,
body.app-body[data-active-menu="services"] .catalog-standard-table .badge,
body.app-body[data-active-menu="services"] .service-groups-table .badge,
body.app-body[data-active-menu="services"] .service-group-service-list > span {
    font-family: inherit !important;
    font-size: 11.5px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
}
body.app-body[data-active-menu="services"] .catalog-standard-table .table-subtext,
body.app-body[data-active-menu="services"] .service-groups-table .table-subtext,
body.app-body[data-active-menu="services"] .service-group-service-list > small {
    font-family: inherit !important;
    font-size: 9.5px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
}

/* Global table hierarchy: bold headers + bold patient names (2026-08-11). */
body.app-body table thead th,
body.embedded-body table thead th {
    font-weight: 700 !important;
}

/* Patient names stay visually prominent across registries, finance and appointment views. */
body.app-body .patient-name-uppercase,
body.app-body .reference-person-cell .reference-person-copy > strong,
body.app-body .payment-patient-name,
body.app-body .finance-patient-name,
body.app-body .patient-record-name > strong,
body.app-body .appointment-record-patient > strong,
body.app-body .review-patient > strong,
body.app-body td[data-label="Пациент"] > strong,
body.app-body td[data-label="Пациент"] > .payment-patient-name,
body.app-body [data-payment-patient],
body.app-body [data-service-patient],
body.app-body [data-entry-patient-name],
body.app-body [data-clinical-patient-name] {
    font-weight: 700 !important;
}


/* Medibox 2026-08-11 — visit report / clinic logo refinement */
body.app-body .clinical-visit-report-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -2px 0 14px;
    padding: 9px 10px 10px;
    border-bottom: 1px solid var(--ui-line, #e4e8ef);
}
body.app-body .clinical-visit-report-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
body.app-body .clinical-visit-report-label > span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid #dce2ef;
    border-radius: 8px;
    background: #f8f9fd;
    color: #4056a1;
}
body.app-body .clinical-visit-report-label .ui-icon { width: 16px; height: 16px; }
body.app-body .clinical-visit-report-label div { display: grid; gap: 1px; }
body.app-body .clinical-visit-report-label small { color: var(--ui-muted, #667085); font-size: 9px; font-weight: 600; }
body.app-body .clinical-visit-report-label strong { color: var(--ui-text, #1f2937); font-size: 11px; font-weight: 700; }
body.app-body .clinical-visit-print-button { min-height: 34px; white-space: nowrap; }
body.app-body .visit-workspace-report-action { display: flex; justify-content: flex-end; margin: 0 0 10px; }
body.app-body .clinic-logo-setting { margin-top: 2px; }
body.app-body .clinic-logo-setting-row {
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--ui-line, #e4e8ef);
    border-radius: 9px;
    background: #fafbfc;
}
body.app-body .clinic-logo-preview {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    display: grid;
    place-items: center;
    border: 1px solid #dde3eb;
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
}
body.app-body .clinic-logo-preview img { display: block; max-width: 56px; max-height: 56px; object-fit: contain; }
body.app-body .clinic-logo-upload { min-width: 0; display: grid; gap: 3px; cursor: pointer; }
body.app-body .clinic-logo-upload strong { color: var(--ui-text, #1f2937); font-size: 11px; font-weight: 700; }
body.app-body .clinic-logo-upload small { color: var(--ui-muted, #667085); font-size: 9px; }
body.app-body .clinic-logo-upload input[type="file"] { margin-top: 5px; max-width: 360px; font-size: 10px; }
@media (max-width: 620px) {
    body.app-body .clinical-visit-report-toolbar { align-items: flex-start; flex-direction: column; }
    body.app-body .clinical-visit-print-button { width: 100%; justify-content: center; }
    body.app-body .clinic-logo-setting-row { align-items: flex-start; flex-direction: column; }
}

/* Icon-only visit print action */
body.app-body .clinical-visit-print-button {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 34px !important;
}
body.app-body .clinical-visit-print-button svg {
    width: 17px;
    height: 17px;
}
