/* Medibox — table header + calendar day emphasis
   Keeps row typography unchanged; only headers and patient names are emphasized. */

/* Patients: main register header. */
body.app-body[data-active-menu="patients"] .patient-reference-table thead th {
    font-weight: 700 !important;
}

/* Keep patient names prominent in patient-related registers. */
body.app-body[data-active-menu="patients"] .patient-name-uppercase,
body.app-body[data-active-menu="patients"] .reference-person-copy > strong,
body.app-body[data-active-menu="patients"] td[data-label="Пациент"] > strong,
body.app-body[data-active-menu="patients"] .payment-patient-name {
    font-weight: 700 !important;
}

/* Services and service groups: every column header uses the same bold weight. */
body.app-body[data-active-menu="services"] table thead th,
body.app-body[data-active-menu="services"] .catalog-standard-table thead th,
body.app-body[data-active-menu="services"] .service-groups-table thead th,
body.app-body[data-active-menu="services"] .service-group-entry-table thead th {
    font-weight: 700 !important;
}

/* Finance / payments: main, expanded and debt tables. */
body.app-body[data-active-menu="payments"] table thead th,
body.app-body[data-active-menu="payments"] .payments-main-table thead th,
body.app-body[data-active-menu="payments"] .payment-patient-nested-table thead th,
body.app-body[data-active-menu="payments"] .debtors-table thead th,
body.app-body[data-active-menu="payments"] .payment-installment-history-table thead th {
    font-weight: 700 !important;
}

/* Patient names in finance stay bold while other body cells remain unchanged. */
body.app-body[data-active-menu="payments"] .payment-patient-name,
body.app-body[data-active-menu="payments"] td[data-label="Пациент"] > strong,
body.app-body[data-active-menu="payments"] td[data-label="Име и презиме"] > strong {
    font-weight: 700 !important;
}

/* Calendar: emphasize weekday names, not the whole calendar content. */
body.app-body[data-active-menu="dashboard"] .calendar-day-header strong,
body.app-body[data-active-menu="appointments"] .appointments-day-column-header span {
    font-weight: 700 !important;
}

/* Calendar stacking refinement — keep cards above the grid and decorative layers. */
body.app-body #weeklyCalendarApp .reference-calendar-toolbar {
    position: relative;
    z-index: 80;
}

body.app-body #weeklyCalendarApp .reference-calendar-status-cards,
body.app-body #weeklyCalendarApp .reference-calendar-status-card {
    position: relative;
    z-index: 82;
}

body.app-body #weeklyCalendarApp .calendar-slot {
    overflow: visible;
}

body.app-body #weeklyCalendarApp .calendar-slot.is-current-slot::before,
body.app-body #weeklyCalendarApp .calendar-slot.is-current-slot::after {
    z-index: 5 !important;
    pointer-events: none;
}

body.app-body #weeklyCalendarApp .calendar-appointment,
body.app-body #weeklyCalendarApp .calendar-appointment-simple,
body.app-body #weeklyCalendarApp [data-appointment-card] {
    position: relative;
    z-index: 30 !important;
}

body.app-body #weeklyCalendarApp .calendar-appointment:hover,
body.app-body #weeklyCalendarApp .calendar-appointment:focus,
body.app-body #weeklyCalendarApp .calendar-appointment:focus-within,
body.app-body #weeklyCalendarApp [data-appointment-card]:hover,
body.app-body #weeklyCalendarApp [data-appointment-card]:focus-within {
    z-index: 45 !important;
}

/* Functional controls remain clickable above an appointment card. */
body.app-body #weeklyCalendarApp .slot-add-button {
    z-index: 50 !important;
}

/* Sticky headers intentionally stay above cards while the calendar scrolls. */
body.app-body #weeklyCalendarApp .calendar-day-header {
    z-index: 70 !important;
}

body.app-body #weeklyCalendarApp .calendar-time-label {
    z-index: 72 !important;
}

body.app-body #weeklyCalendarApp .calendar-corner {
    z-index: 75 !important;
}

/* Medibox 2026-08-15 — calendar topbar must remain above all calendar layers.
   Keep patient search, active practitioner and PZU context visible while scrolling. */
body.app-body[data-active-menu="dashboard"] .universal-global-topbar,
body.app-body[data-active-menu="appointments"] .universal-global-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 500 !important;
    isolation: isolate;
    background: rgba(255, 255, 255, .97) !important;
    box-shadow: 0 8px 24px rgba(31, 43, 86, .08) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* Calendar cards/toolbars use their own stacking contexts; none may cover the global topbar. */
body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .reference-calendar-toolbar,
body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .weekly-calendar-scroll,
body.app-body[data-active-menu="appointments"] .appointments-five-page {
    z-index: auto;
}

/* Medibox 2026-08-15 v7 — keep calendar status cards permanently visible.
   The full calendar toolbar (status cards + date navigation) sits directly below
   the sticky global topbar. The top offset is measured by global-header.js so
   it remains correct if the header height changes. */
body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .weekly-calendar-card {
    overflow: visible !important;
}

body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .reference-calendar-toolbar {
    position: sticky !important;
    top: var(--medibox-global-topbar-height, 84px) !important;
    z-index: 420 !important;
    isolation: isolate;
    background: rgba(255, 255, 255, .98) !important;
    box-shadow: 0 9px 24px rgba(31, 43, 86, .075) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .reference-calendar-status-cards,
body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .reference-calendar-status-card,
body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .reference-calendar-navigation {
    position: relative;
    z-index: 421 !important;
}

/* Preserve the rounded lower corners now that the outer card must allow sticky overflow. */
body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .weekly-calendar-scroll {
    border-radius: 0 0 16px 16px;
}

@media (max-width: 760px) {
    body.app-body[data-active-menu="dashboard"] #weeklyCalendarApp .reference-calendar-toolbar {
        top: var(--medibox-global-topbar-height, 130px) !important;
    }
}


/* Medibox 2026-08-16 — calendar appointment cards: regular typography + no UI icons inside slots. */
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple strong,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple h3,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple small,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .badge,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple button,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple button span {
    font-weight: 400 !important;
}

/* Keep the information readable while removing the heavy/bold appearance. */
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .appointment-simple-top > strong {
    font-size: 10.5px !important;
}
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .appointment-simple-top .badge {
    font-size: 7.5px !important;
}
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .appointment-simple-person h3 {
    font-size: 11px !important;
}
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .appointment-simple-person small {
    font-size: 8px !important;
}

/* Status controls are text-only inside calendar slots. */
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .status-mini-button,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .status-final-button {
    width: auto !important;
    min-width: 0 !important;
    height: 22px;
    min-height: 22px;
    padding: 0 6px !important;
    font-size: 8px !important;
    line-height: 1;
    white-space: nowrap;
}
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .status-mini-button span,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .status-final-button span {
    display: inline !important;
}
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .appointment-cancel-delete-slot,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .appointment-cancel-delete-slot > button,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .appointment-cancel-delete-slot > form,
body.app-body #weeklyCalendarApp .calendar-slot .calendar-appointment-simple .appointment-cancel-delete-slot > form > button {
    width: auto !important;
    min-width: 0 !important;
}

/* New appointment remains available without the shared .ui-icon SVG. */
body.app-body #weeklyCalendarApp .calendar-slot .slot-add-button .slot-add-symbol {
    display: inline-grid;
    place-items: center;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
}
