/* ============================================
   Generuj dokument – lightbox + spinner
   ============================================ */
.generuj-lightbox {
    position: fixed;
    top: 0;
    left: 280px; /* fallback; JS ustawia według szerokości sidebara */
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.75);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.generuj-lightbox.generuj-lightbox-visible {
    opacity: 1;
}
.generuj-lightbox-spinner {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
    color: var(--primary);
}
@keyframes generuj-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   POWIADOMIENIA - Toast w prawym górnym rogu
   ============================================ */
.toast-container .toast {
    min-width: 420px;
    max-width: 550px;
}
.anestmed-message-toast {
    background: var(--primary-gradient) !important;
    color: white !important;
    box-shadow: var(--shadow-lg);
}
.anestmed-message-toast .toast-body { color: white !important; }

/* ============================================
   ZMIENNE CSS - Ujednolicone
   ============================================ */
:root {
    /* Kolory Primary - NOWY MOTYW FIOLETOWY */
    --primary: #667eea;
    --primary-hover: #5568d3;
    --primary-dark: #764ba2;
    --primary-light: rgba(102, 126, 234, 0.15);
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Kolory dla ankiet */
    --adult-primary: #667eea;
    --adult-dark: #764ba2;
    --adult-bg: #f8f7ff;
    --child-primary: #20c997;
    --child-dark: #148a66;
    --child-bg: #e6fffa;

    /* Google Blue for Editor */
    --google-blue: #4285f4; 
    --nested-bg: #f8f9ff;
    /* Numer pytania w ankietach publicznych – spójny w wersji dorosłej i dziecięcej */
    --survey-question-num-color: var(--primary);
    
    /* Kolory tła i tekstu */
    --bg-main: #f0f2f5;
    --bg-secondary: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    
    /* Kolory obramowań */
    --border-color: #e0e0e0;
    --border-light: #e9ecef;
    
    /* Border Radius - ZWIĘKSZONE dla nowoczesnego wyglądu */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    
    /* Cienie - ULEPSZONE */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 10px 30px rgba(102, 126, 234, 0.2);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    
    /* Font sizes dla nagłówków */
    --font-section-header: 0.75rem;
    --font-label: 0.75rem;
    
    /* Wysokość paska nagłówka (sidebar + navbar) – stała, równa */
    --header-bar-height: 64px;
}

/* ============================================
   GLOBALNE STYLE
   ============================================ */
html {
    overflow-y: scroll;
}

body.modal-open {
    padding-right: 0 !important;
}

body {
    background-color: var(--bg-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 120px;
}

/* ============================================
   SYSTEM NAGŁÓWKÓW - HIERARCHICZNY
   ============================================ */

/* Nagłówek strony (H1) - Główny tytuł całej strony */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    color: var(--primary);
    font-size: 1.5rem;
}

/* Nagłówki kart (H2) - Nagłówki głównych sekcji/kart */
.card-title-primary {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.card-title-primary i {
    color: var(--primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Pulpit (admin): kafelki statystyk — przewijanie poziome na mobile */
@media (max-width: 767.98px) {
    #page-content-wrapper .survey-dashboard .dashboard-stats-strip {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        padding-bottom: 0.35rem;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    #page-content-wrapper .survey-dashboard .dashboard-stats-strip .dashboard-stats-row {
        flex-wrap: nowrap;
    }
    #page-content-wrapper .survey-dashboard .dashboard-stats-strip .dashboard-stats-row > [class*="col-"] {
        flex: 0 0 auto;
        width: 12rem;
        max-width: min(12rem, 88vw);
    }
}

/* Nagłówki kart na dashboardzie – linia pod tytułem, z paddingiem (nie na całą szerokość) */
.survey-dashboard .dashboard-card-header {
    position: relative;
    text-align: left;
}

.survey-dashboard .dashboard-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 2px;
    background: var(--border-light);
}

.survey-dashboard .dashboard-card-header .card-title-primary {
    justify-content: flex-start;
}

/* Nagłówek karty: tytuł + przycisk — siatka: tytuł zawija się w lewej kolumnie, „Wszystkie” zawsze w prawym górnym rogu (bez drugiej linii tylko pod linkiem) */
.survey-dashboard .dashboard-card-header.dashboard-card-header--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
}

.survey-dashboard .dashboard-card-header--split .card-title-primary {
    min-width: 0;
}

.survey-dashboard .dashboard-card-header--split > .btn,
.survey-dashboard .dashboard-card-header--split > a.btn {
    justify-self: end;
    margin-top: 0.125rem;
    flex-shrink: 0;
    max-width: 100%;
    text-align: center;
    line-height: 1.25;
}

@media (min-width: 768px) {
    .survey-dashboard .dashboard-card-header.dashboard-card-header--split {
        align-items: center;
    }

    .survey-dashboard .dashboard-card-header--split > .btn,
    .survey-dashboard .dashboard-card-header--split > a.btn {
        margin-top: 0;
    }
}

/* Karty z listą (Zgłoszenia, Lekarze, Ostatnia aktywność, Ostatnie logowania): ta sama wysokość listy i nagłówka jak „Ostatnie logowania” */
.survey-dashboard .dashboard-feed-list-body {
    max-height: 280px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .survey-dashboard .dashboard-feed-card .dashboard-card-header.dashboard-card-header--split {
        align-items: center;
    }

    .survey-dashboard .dashboard-feed-card .dashboard-card-header--split > .btn,
    .survey-dashboard .dashboard-feed-card .dashboard-card-header--split > a.btn {
        margin-top: 0;
    }
}

/*
 * Listy na pulpicie: globalne .list-group-item (sidebar) wymusza flex, nowrap i styl menu —
 * tutaj reset do normalnej treści wyrównanej do lewej.
 */
.survey-dashboard .dashboard-feed-list .list-group-item {
    text-align: left;
    white-space: normal;
    color: #6c757d;
    background-color: #fff;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    min-height: 0;
    font-weight: 400;
    line-height: 1.5;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.survey-dashboard .dashboard-feed-list > .list-group-item:last-child {
    border-bottom: none;
}

.survey-dashboard .dashboard-feed-list .list-group-item:not(.d-flex) {
    display: block;
}

/* Ostatnia aktywność: na mobile jedna linia jak na desktop; cała lista przewija się poziomo razem */
@media (max-width: 767.98px) {
    .survey-dashboard .dashboard-feed-activity-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .survey-dashboard .dashboard-feed-activity-scroll .dashboard-feed-list {
        width: max-content;
        min-width: 100%;
    }

    .survey-dashboard .dashboard-feed-activity-scroll .list-group-item.dashboard-feed-item--activity {
        white-space: nowrap;
    }
}

.survey-dashboard .dashboard-feed-list .list-group-item.d-flex {
    display: flex;
    align-items: center;
}

@media (max-width: 767.98px) {
    .survey-dashboard .dashboard-feed-list .list-group-item.dashboard-feed-item--submission.d-flex {
        align-items: stretch;
    }
}

@media (min-width: 768px) {
    .survey-dashboard .dashboard-feed-list .list-group-item.dashboard-feed-item--submission.d-flex {
        align-items: center;
    }
}

.survey-dashboard .dashboard-feed-list .list-group-item:hover {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Zgłoszenia (lista): na mobile kolumna; align-items: stretch — inaczej center z .d-flex wyśrodkowuje wąskie bloki tekstu i badge */
.survey-dashboard .dashboard-feed-list .list-group-item.dashboard-feed-item--submission {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.35rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    text-align: left;
}

@media (min-width: 768px) {
    .survey-dashboard .dashboard-feed-list .list-group-item.dashboard-feed-item--submission {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

.survey-dashboard .dashboard-feed-list .dashboard-feed-item--submission .dashboard-feed-item-main {
    display: block;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.survey-dashboard .dashboard-feed-list .dashboard-feed-item--submission .dashboard-feed-item-main small {
    margin-top: 0.15rem;
    display: block;
    line-height: 1.4;
}

.survey-dashboard .dashboard-feed-list .dashboard-feed-item--submission .dashboard-feed-item-badge {
    align-self: flex-start;
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
    padding: 0.4em 0.65em;
    text-align: left;
    hyphens: auto;
}

@media (min-width: 768px) {
    .survey-dashboard .dashboard-feed-list .dashboard-feed-item--submission .dashboard-feed-item-badge {
        align-self: center;
        flex-shrink: 0;
        text-align: center;
    }
}

/* Lekarze – przypisani pacjenci: na mobile nazwisko na całą szerokość, kafelki z liczbami w rzędzie pod spodem */
.survey-dashboard .dashboard-feed-list .list-group-item.dashboard-feed-item--doctor-stats {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.45rem;
    text-align: left;
}

@media (min-width: 768px) {
    .survey-dashboard .dashboard-feed-list .list-group-item.dashboard-feed-item--doctor-stats {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .survey-dashboard .dashboard-feed-list .list-group-item.dashboard-feed-item--doctor-stats.d-flex {
        align-items: stretch;
    }
}

@media (min-width: 768px) {
    .survey-dashboard .dashboard-feed-list .list-group-item.dashboard-feed-item--doctor-stats.d-flex {
        align-items: center;
    }
}

.survey-dashboard .dashboard-feed-list .dashboard-feed-item--doctor-stats .dashboard-feed-item-main {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (min-width: 768px) {
    .survey-dashboard .dashboard-feed-list .dashboard-feed-item--doctor-stats .dashboard-feed-item-main {
        width: auto;
        flex: 1 1 auto;
    }
}

.survey-dashboard .dashboard-feed-list .dashboard-feed-item-doctor-badges {
    flex-wrap: wrap;
    align-self: flex-start;
}

@media (min-width: 768px) {
    .survey-dashboard .dashboard-feed-list .dashboard-feed-item-doctor-badges {
        flex-wrap: nowrap;
        flex-shrink: 0;
        align-self: center;
    }
}

/* Alerty na pulpicie: treść jako drugi flex item z min-width:0 — naturalne zawijanie na wąskich ekranach */
.survey-dashboard .dashboard-alert .dashboard-alert-body {
    line-height: 1.45;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.survey-dashboard .dashboard-alert .dashboard-alert-body a {
    font-weight: 600;
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .survey-dashboard .dashboard-alerts-stack .dashboard-alert {
        padding-right: 2.75rem;
    }

    .survey-dashboard .dashboard-alert .dashboard-alert-icon {
        margin-top: 0.125rem;
    }
}

.card-title-uppercase {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.card-title-uppercase i {
    color: var(--primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Wrapper dla nagłówków kart */
.card-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

/* Informacje w nagłówku karty */
.card-header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
}

.card-header-info-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-header-info-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Etykiety pól – jednolity styl (jak .data-label): małe, stonowane, pierwsza litera wielka */
.data-label,
.form-label,
.form-label-sm {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    display: block;
}

.data-label::first-letter,
.form-label::first-letter,
.form-label-sm::first-letter {
    text-transform: uppercase;
}

/* Nagłówki kolumn tabel leków (karta informacyjna, premedykacja) – bez wymuszania lowercase */
.med-table-header .data-label {
    text-transform: none;
}
.med-table-header .data-label::first-letter {
    text-transform: none;
}

/* Szablony / ustawienia często mają .fw-bold – etykiety pól pozostają jak wyżej */
.form-label.fw-bold,
.form-label-sm.fw-bold,
label.form-label.fw-bold,
label.form-label-sm.fw-bold {
    font-weight: 500 !important;
}

/* Ankiety publiczne: .fw-semibold z Bootstrapa */
.form-label.fw-semibold,
.form-label-sm.fw-semibold {
    font-weight: 500 !important;
}

/* Etykiety pytań wywiadu (treść z bazy – bez zmiany wielkości liter) */
.survey-question-label {
    display: flex;
    align-items: flex-start;
    gap: 0.2rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0;
    cursor: default;
}

.survey-question-text {
    flex: 1;
    min-width: 0;
    font: inherit;
    color: inherit;
}



/* Ikona ołówka przy etykiecie Forma podania – wyrównanie pionowe */
.align-icon-with-label {
    margin-top: -3px;
}

/* Premedykacja – odstęp między wierszami leków */
#medicationsContainer .med-row,
#premedMedsContainer .med-row,
#painkillerContainer .med-row,
#tplMedsContainer .tpl-med-row {
    margin-bottom: 7px;
}

/* Przycisk usuwania – ikona biała po najechaniu (czerwone tło) */
.btn-outline-danger.btn-circle:hover i,
.btn-outline-danger.btn-circle:focus i {
    color: white !important;
}

/* Ikonka przy etykiecie – pole z ankiety */
.survey-source-icon {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    opacity: 0.7;
    vertical-align: middle;
}

/* Input w stylu read-only */
.readonly-input {
    background-color: #f8f9fa;
    border: 1px solid var(--border-light);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 400;
}

/* Zgoda: „Leki z premedykacji” — jak pojedynczy input przy jednej linii; wyżej z treścią; pionowy resize */
textarea.consent-var-textarea-auto {
    resize: vertical;
    overflow-y: hidden;
    line-height: 1.5;
}

/* Premedykacja: posiłek/płyny zablokowane do momentu godz. zabiegu lub istniejących wartości */
input.form-control.prep-time-locked {
    background-color: #e9ecef;
    cursor: not-allowed;
    color: var(--text-muted, #6c757d);
}

/* Badge pacjenta w nagłówku */
.patient-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.patient-type-badge i {
    font-size: 1rem;
}

/* Badge informacyjny */
.info-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badge w Bootstrap - NOWY MOTYW */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
}

.badge.bg-success {
    background: var(--primary-gradient) !important;
}

.badge.bg-primary {
    background: var(--primary-gradient) !important;
}

/* Alerty - NOWY MOTYW */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

/* Potwierdzenie wysłania publicznej ankiety — nad pierwszym panelem; zaokrąglenie jak .card.survey-panel > .card-header:first-child (12px = .survey-panel) */
.survey-submit-success-banner {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    padding: 1.25rem 1.5rem;
    background: #fff !important;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px;
}
.survey-submit-success-banner .bi-check-circle-fill {
    color: #198754;
    font-size: 1.1rem;
    vertical-align: -0.1em;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(200, 35, 51, 0.1) 100%);
    color: #c82333;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #5568d3;
    border-left: 4px solid var(--primary);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

/* Link w alercie DOB — fiolet (Bootstrap .alert-link w warning jest ciemnobrązowy) */
#dob-age-alert a.alert-link {
    color: var(--primary);
}
#dob-age-alert a.alert-link:hover,
#dob-age-alert a.alert-link:focus {
    color: var(--primary-hover);
}

/* ============================================
   PRZYCISKI - UJEDNOLICONE Z NOWYM MOTYWEM
   ============================================ */
.btn {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    /* Tylko właściwości wizualne — nie „all” (unika skoku przy animacji cienia/obwódki) */
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    border: none;
    transform: none;
}

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    font-size: 0.9375rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    /* Ten sam „zasięg” co domyślny cień — tylko mocniejszy kolor (bez powiększania rozmycia = bez efektu przesunięcia) */
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.42);
}

.btn-success {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success:hover {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.42);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 4px 14px rgba(220, 53, 69, 0.42);
}

.btn-warning {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-warning:hover {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.42);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-success {
    border-width: 2px;
    border-radius: var(--radius-md);
}

.btn-outline-primary,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-success {
    background: transparent !important;
    border-color: var(--primary);
    color: var(--primary) !important;
}

.btn-outline-primary:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover,
.btn-outline-success:hover {
    background: var(--primary-gradient);
    border-color: transparent;
}

.btn-outline-primary:focus,
.btn-outline-info:focus,
.btn-outline-warning:focus,
.btn-outline-success:focus,
.btn-outline-primary:focus-visible,
.btn-outline-info:focus-visible,
.btn-outline-warning:focus-visible,
.btn-outline-success:focus-visible {
    box-shadow: 0 0 0 0.15rem var(--primary-light);
    transform: none;
}

/* Bootstrap / motyw: bez translateY lub innego transform na klik — stabilny układ */
.btn:active,
.btn:focus:active,
.btn-outline-primary:active,
.btn-outline-secondary:active,
.btn-outline-info:active,
.btn-outline-warning:active,
.btn-outline-success:active,
.btn-primary:active,
.btn-success:active,
.btn-danger:active,
.btn-warning:active,
a.btn:active {
    transform: none !important;
}

/* Przytrzymany klik: ten sam rząd wielkości cienia co w stanie spoczynku (bez „migania”/skoku) */
.btn-primary:not(:disabled):active,
.btn-success:not(:disabled):active {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-danger:not(:disabled):active {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}
.btn-warning:not(:disabled):active {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Ikony i teksty – gradient zamiast zielonego/żółtego/niebieskiego */
.text-success {
    color: var(--primary) !important;
}
.text-warning {
    color: var(--primary) !important;
}
.stat-icon.bg-primary,
.stat-icon.bg-success,
.stat-icon.bg-warning {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

.navbar.bg-success {
    background: var(--primary-gradient) !important;
}

.progress-bar.bg-success,
.progress-bar.bg-primary {
    background: var(--primary-gradient) !important;
}

.border-success,
.border-warning,
.border-primary {
    border-color: var(--primary) !important;
}

.text-info {
    color: var(--primary) !important;
}

.badge.bg-info,
.modal-header.bg-info,
.modal-header.bg-secondary {
    background: var(--primary-gradient) !important;
    color: white !important;
}

/* Modale — długi tekst zostaje w oknie; listy słowników (flex + tekst + formularz) zawijają się dzięki siatce */
.modal-content {
    overflow: hidden;
    max-width: 100%;
}
.modal-body {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: min(85vh, calc(100dvh - 10rem));
    overflow-wrap: break-word;
    word-break: break-word;
}
.modal-header .modal-title {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}
/* Zamiast flex: pierwsza kolumna może się kurczyć (minmax(0,1fr)) → zawijanie zamiast wystawania */
.modal .list-group-item.d-flex.justify-content-between {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    white-space: normal;
    line-height: 1.4;
}
.modal .list-group-item.d-flex.justify-content-between > *:first-child {
    min-width: 0;
}
/* Jawny element — anonimowy tekst w siatce nie dostaje min-width:0; długie ciągi bez spacji muszą się łamać */
.modal .modal-dict-text {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
.modal .list-group-item.d-flex.justify-content-between .form-check {
    min-width: 0;
}
.modal .list-group-item.d-flex.justify-content-between .form-check-label.modal-dict-text {
    display: inline-block;
    max-width: 100%;
}
#zalecenieModal .list-group-item.d-flex.justify-content-between {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
}
#zalecenieModal .zalecenie-tpl-apply-btn {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    width: 100%;
    text-align: start;
}

/* Ponad .sticky-bottom (z-index 1100) — modale i backdrop nie chowają się pod paskiem dokumentów */
.modal {
    --bs-modal-zindex: 1200;
}
.modal-backdrop {
    --bs-backdrop-zindex: 1190;
}

/* Karta informacyjna — podgląd szablonu: ograniczona wysokość + miejsce nad pływającym paskiem */
.modal-dialog.modal-preview-template {
    max-height: calc(100dvh - 7rem);
    margin: 1.25rem auto 5.75rem;
}
#previewModal .modal-body {
    max-height: none;
    min-height: 0;
}

/* Małe okrągłe przyciski ikon (np. Podgląd) w modalach — wyśrodkowanie, bez zmiany przy hover/focus/active */
.modal .btn.btn-sm.btn-outline-secondary.rounded-circle {
    width: 2.125rem;
    height: 2.125rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.modal .btn.btn-sm.btn-outline-secondary.rounded-circle > i {
    line-height: 1;
}
.modal .btn.btn-sm.btn-outline-secondary.rounded-circle:hover,
.modal .btn.btn-sm.btn-outline-secondary.rounded-circle:focus,
.modal .btn.btn-sm.btn-outline-secondary.rounded-circle:active,
.modal .btn.btn-sm.btn-outline-secondary.rounded-circle:focus-visible {
    color: var(--bs-btn-color, #6c757d) !important;
    background-color: transparent !important;
    border-color: var(--bs-btn-border-color, #6c757d) !important;
    box-shadow: none !important;
}

.modal .btn.btn-sm.btn-outline-danger.rounded-circle {
    width: 2.125rem;
    height: 2.125rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.modal .btn.btn-sm.btn-outline-danger.rounded-circle > i {
    line-height: 1;
}
.modal .btn.btn-sm.btn-outline-danger.rounded-circle:hover,
.modal .btn.btn-sm.btn-outline-danger.rounded-circle:focus,
.modal .btn.btn-sm.btn-outline-danger.rounded-circle:active,
.modal .btn.btn-sm.btn-outline-danger.rounded-circle:focus-visible {
    color: var(--bs-btn-color, #dc3545) !important;
    background-color: transparent !important;
    border-color: var(--bs-btn-border-color, #dc3545) !important;
    box-shadow: none !important;
}

.spinner-border.text-primary {
    color: var(--primary) !important;
}

.table-warning {
    background-color: var(--primary-light) !important;
}

.btn i {
    font-size: 1em;
}

.btn-submit {
    background-color: var(--primary);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 1rem;
    font-size: 0.9375rem;
}

.btn-submit:hover {
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-submit:active {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.28);
}

/* ============================================
   FORMULARZE - INPUTS & CONTROLS - NOWY MOTYW
   ============================================ */
.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background-color: #fcfcfc;
    font-size: 0.875rem;
    font-weight: 400;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem var(--primary-light);
    background-color: #fff;
    outline: none;
}

.form-control-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

textarea.form-control {
    min-height: auto !important;
    resize: vertical;
}

.form-check-input {
    cursor: pointer;
    border-width: 2px;
}

.form-check-label {
    cursor: pointer;
    font-size: 0.875rem;
}

.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: var(--border-color);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border-width: 2px;
}

/* Ankiety – pola Waga/Wzrost – zapobiegaj ucinaniu jednostek (kg, cm) */
.col-unit-field {
    overflow: visible;
    min-width: 0;
    padding-right: 1rem; /* zapas od prawej krawędzi – jednostki nie są ucinane */
}
.input-group-unit {
    min-width: 0;
    overflow: visible;
    width: 100%;
}
.input-group-unit .form-control {
    flex: 1 1 auto;
    min-width: 0;
}
.input-group-unit .input-group-text {
    flex-shrink: 0;
    min-width: 2.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    white-space: nowrap;
    overflow: visible;
    border: none;
    background: transparent;
}

/* Grupy danych */
.data-group {
    margin-bottom: 1.25rem;
}

/* Odstęp pionowy 0.75rem: .row i kolumny .col-* z klasami mb-2–mb-5 (spójnie w całej aplikacji) */
.row.mb-2,
.row.mb-3,
.row.mb-4,
.row.mb-5 {
    margin-bottom: 0.75rem !important;
}

[class*="col-"].mb-2,
[class*="col-"].mb-3,
[class*="col-"].mb-4,
[class*="col-"].mb-5 {
    margin-bottom: 0.75rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

/* ============================================
   SIDEBAR & NAVIGATION - NOWY MOTYW FIOLETOWY
   ============================================ */
#wrapper {
    transition: none;
    /* Jedna szerokość offsetu dla #page-content-wrapper i .sticky-bottom (wszystkie stany przez tę samą wartość) */
    --sidebar-strip-width: 215px;
}

#wrapper.sidebar-collapsed {
    --sidebar-strip-width: 70px;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: 215px;
    margin-left: 0;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-shadow: 4px 0 20px rgba(102, 126, 234, 0.3);
    display: flex;
    flex-direction: column;
}
#sidebar-wrapper::-webkit-scrollbar {
    display: none;
}

#sidebar-wrapper .list-group {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-top: 0.25rem !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#sidebar-wrapper .list-group::-webkit-scrollbar {
    display: none;
}

.sidebar-logout-wrap {
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

/* Mobile (md-): wylogowanie tuż pod „Ustawienia” / „Moje dane” — lekki odstęp od pozycji menu */
#sidebar-wrapper .list-group .sidebar-logout-wrap--inline {
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Stan schowanego sidebara – wąski pasek z ikonkami */
#wrapper.sidebar-collapsed #sidebar-wrapper {
    width: 70px;
}

/* Transition tylko po załadowaniu – ikony w domyślnym miejscu od razu */
#wrapper.sidebar-ready #sidebar-wrapper {
    transition: width 0.3s ease-in-out;
}
#wrapper.sidebar-ready #page-content-wrapper {
    transition: margin-left 0.3s ease-in-out;
}

/* Ukryj tekst gdy sidebar zwinięty */
#wrapper.sidebar-collapsed .sidebar-item-text,
#wrapper.sidebar-collapsed .sidebar-brand-text {
    display: none !important;
}

/* Sekcje: kreski – ta sama wysokość co rozwinięta */
#wrapper.sidebar-collapsed .section-label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0;
    color: transparent;
    padding: 0.65rem 1rem;
    min-height: 2.25rem;
    letter-spacing: 0.5px;
    visibility: visible !important;
    opacity: 1 !important;
    transition: none !important;
    border-left: none !important;
}

#wrapper.sidebar-collapsed .section-label::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

/* Po schowaniu: ukryj logo, przycisk toggle wyśrodkowany */
#wrapper.sidebar-collapsed .sidebar-heading {
    height: var(--header-bar-height);
    min-height: var(--header-bar-height);
    padding: 0 1rem;
    justify-content: center;
}

#wrapper.sidebar-collapsed .sidebar-heading .sidebar-brand,
#wrapper.sidebar-collapsed .sidebar-brand i {
    display: none !important;
}

#wrapper.sidebar-collapsed .sidebar-toggle-btn {
    margin: 0;
}

/* Ikonki wyśrodkowane, ten sam padding pionowy co rozwinięta — tylko menu boczne (#sidebar-wrapper), nie listy w #page-content-wrapper */
#wrapper.sidebar-collapsed #sidebar-wrapper .list-group-item {
    padding: 0.65rem 1rem;
    min-height: 2.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-left-width: 0 !important;
}

#wrapper.sidebar-collapsed #sidebar-wrapper .list-group-item i {
    margin-right: 0;
    flex-shrink: 0;
    width: 20px;
    min-width: 20px;
    height: 1.25rem;
    font-size: 1.1rem;
}

#wrapper.sidebar-collapsed .sidebar-logout-wrap {
    padding: 1rem !important;
    display: flex;
    justify-content: center;
}

#wrapper.sidebar-collapsed .sidebar-logout-wrap .btn {
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    min-width: 2.5rem;
    border-radius: var(--radius-md);
}
#wrapper.sidebar-collapsed .sidebar-logout-wrap .btn i {
    margin-right: 0 !important;
    flex-shrink: 0;
}

/* Wysokość nagłówka sidebara = wysokość navbara (wyrównanie) */
.sidebar-heading {
    height: var(--header-bar-height);
    min-height: var(--header-bar-height);
    padding: 0 1.25rem;
    font-size: 1.1rem;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-weight: 700;
}
.sidebar-heading .sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    flex-shrink: 0;
}
.sidebar-heading .sidebar-toggle-btn i {
    font-size: 1.5rem;
    line-height: 1;
}

.list-group-item {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: none;
    padding: 0.65rem 1.5rem;
    min-height: 2.25rem;
    font-weight: 500;
    line-height: 1;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    white-space: nowrap;
    border-radius: 0;
    display: flex;
    align-items: center;
}

#sidebar-wrapper .list-group-item {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/*
 * Bootstrap .list-group-flush: border-top tylko przy sąsiednim .list-group-item.
 * Po <div class="section-label"> pierwszy <a> NIE jest „+.list-group-item” → brak 1px bordera;
 * kolejne mają border → inna wysokość treści i wrażenie „skoku” przy przełączaniu.
 * Ten sam 1px z border-top: transparent — niewidoczny, ale utrzymuje jednolitą wysokość.
 */
#sidebar-wrapper .list-group.list-group-flush > .list-group-item {
    box-sizing: border-box;
    margin: 0;
    border-right: none;
    border-bottom: none;
    border-left: 4px solid transparent;
}
#sidebar-wrapper .list-group.list-group-flush > .list-group-item:not(:first-of-type) {
    border-top: 1px solid transparent !important;
}
#sidebar-wrapper .list-group.list-group-flush > .list-group-item:first-of-type {
    border-top: none !important;
}

.list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Aktywna pozycja menu: ta sama czcionka i układ co pozostałe — tylko delikatne tło */
#sidebar-wrapper .list-group-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    border-left: 4px solid transparent;
    box-shadow: none;
}

#sidebar-wrapper .list-group-item.active i {
    color: rgba(255, 255, 255, 0.85);
}

/* Sidebar: Bootstrap ustawia jasne tło na :focus/:active (PPM „Otwórz w nowej karcie” = focus) — zostaw gradient */
#sidebar-wrapper .list-group-item.list-group-item-action:not(.active):focus {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: none;
}
#sidebar-wrapper .list-group-item.list-group-item-action:not(.active):focus-visible {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: none;
    outline: 2px solid rgba(255, 255, 255, 0.45);
    outline-offset: -2px;
}
#sidebar-wrapper .list-group-item.list-group-item-action:focus:not(:focus-visible) {
    outline: none;
}
#sidebar-wrapper .list-group-item.list-group-item-action:not(.active):focus:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}
#sidebar-wrapper .list-group-item.list-group-item-action:not(.active):active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}
#sidebar-wrapper .list-group-item.list-group-item-action.active:focus,
#sidebar-wrapper .list-group-item.list-group-item-action.active:focus-visible,
#sidebar-wrapper .list-group-item.list-group-item-action.active:active {
    background-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    border-left: 4px solid transparent;
    box-shadow: none;
}

#sidebar-wrapper .sidebar-item-text {
    color: #ffffff;
}

.list-group-item i {
    margin-right: 12px;
    width: 20px;
    min-width: 20px;
    height: 1.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

#page-content-wrapper {
    width: 100%;
    margin-left: var(--sidebar-strip-width);
    min-height: 100vh;
    transition: none;
}

/* Przycisk toggle sidebara – wyrównany w nagłówku */
#sidebarToggle {
    border: none;
    background: transparent;
    padding: 0;
    transition: background-color 0.2s ease;
    text-decoration: none;
    transform: none;
}

#sidebarToggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#sidebarToggle:focus,
#sidebarToggle:focus-visible,
#sidebarToggle:active {
    box-shadow: none;
    outline: none;
    transform: none;
}

#sidebarToggle i {
    transition: transform 0.3s ease;
}

.section-label {
    text-transform: uppercase;
    font-size: var(--font-section-header);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.65rem 1rem;
    min-height: 2.25rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    line-height: 1;
}

/* Sidebar: ta sama kolumna co pozycje menu (padding + lewy „pasek” jak u .list-group-item) — bez przesunięcia pod nagłówkami Personel / Konfiguracja */
#sidebar-wrapper .section-label {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-left: 4px solid transparent;
    box-sizing: border-box;
}

/* Przycisk wyloguj w sidebarze – biały */
.sidebar-logout-btn {
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}
.sidebar-logout-btn:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: #fff !important;
}

/* Przycisk toggle w sidebarze – biały */
.sidebar-toggle-btn {
    color: #fff !important;
}
.sidebar-toggle-btn:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px;
}

/* Ikona menu (trzy kreski) w sidebarze — nie kurczyć na mobile */
#sidebar-wrapper .sidebar-toggle-btn {
    flex-shrink: 0;
}
@media (max-width: 768px) {
    #sidebar-wrapper .sidebar-toggle-btn {
        min-width: 2.75rem;
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    #sidebar-wrapper .sidebar-toggle-btn .sidebar-menu-icon {
        font-size: 1.5rem !important;
        line-height: 1;
        flex-shrink: 0;
        display: block;
    }
}

/* Ikona użytkownika w navbarze – bez kółka, kolor motywu, większa */
.user-menu-trigger .user-nav-icon {
    
    color: var(--primary);
    transition: color 0.2s ease;
}
.user-menu-trigger:hover .user-nav-icon,
.user-menu-trigger:focus .user-nav-icon {
    color: var(--primary-dark);
}
.user-menu-trigger {
    font-size: 1.7rem;
    cursor: pointer;
}
.user-menu-trigger:focus {
    box-shadow: none;
}

/* Mobile: w navbarze tylko ikona profilu — stały rozmiar, bez ściskania */
@media (max-width: 768px) {
    #page-content-wrapper .navbar .user-navbar-actions {
        flex-shrink: 0;
        margin-left: auto;
    }
    #page-content-wrapper .navbar .user-menu-trigger {
        font-size: 1.7rem !important;
        line-height: 1;
        flex-shrink: 0;
        min-width: 2.75rem;
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    #page-content-wrapper .navbar .user-menu-trigger .user-nav-icon {
        line-height: 1;
        flex-shrink: 0;
        display: block;
    }
}

.navbar .dropdown-menu {
    z-index: 1050;
}

/* Navbar = dokładnie ta sama wysokość co nagłówek sidebara */
#page-content-wrapper .navbar {
    height: var(--header-bar-height);
    min-height: var(--header-bar-height);
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
}

/* Ikona sekcji / pacjenta w navbarze — jak ikona lekarza (1.7rem, primary) */
#page-content-wrapper .navbar-heading-icon-wrap {
    font-size: 1.7rem;
    line-height: 1;
    cursor: default;
}
#page-content-wrapper .navbar-heading-icon-wrap i {
    color: var(--primary);
    transition: color 0.2s ease;
    display: block;
}
#page-content-wrapper .navbar-heading-label {
    max-width: min(50vw, 22rem);
}
@media (min-width: 992px) {
    #page-content-wrapper .navbar-heading-label {
        max-width: min(38vw, 32rem);
    }
}

/* Tytuł / podtytuł w navbarze: wielokropek przy flex (wymaga min-width: 0 na elemencie z tekstem) */
#page-content-wrapper .navbar-patient-stripe-text {
    min-width: 0;
    overflow: hidden;
}
#page-content-wrapper .navbar-heading-line1,
#page-content-wrapper .navbar-heading-line2 {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Form switch: odstęp tekstu etykiety od przełącznika (ustawienia, karty pacjenta) */
#page-content-wrapper .form-check.form-switch .form-check-label {
    margin-left: 0.5rem;
}

/* Karty pacjenta: ta sama stała wysokość paska co Pulpit / Ustawienia (64px) — wcześniej height:auto rozciągał pasek na 2 linie */
#page-content-wrapper .navbar.navbar-has-patient-stripe {
    height: var(--header-bar-height);
    min-height: var(--header-bar-height);
    max-height: var(--header-bar-height);
}
#page-content-wrapper .navbar-patient-stripe-text > div:first-child {
    line-height: 1.2;
}
#page-content-wrapper .navbar-patient-stripe-text > div:last-child {
    line-height: 1.15;
    margin-top: 0.2rem;
}

/* Ustawienia, zgody, wybór ankiety — stały odstęp 1.5rem między kartami */
#page-content-wrapper .settings-dashboard-cards {
    display: grid;
    gap: 1.5rem;
}

/* Te same karty: na wąskim ekranie „Zarządzaj” pod tytułem i badge (nie ściskany obok) */
@media (max-width: 767.98px) {
    #page-content-wrapper .settings-dashboard-cards .card-body.d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0.75rem;
    }

    #page-content-wrapper .settings-dashboard-cards .card-body.d-flex > div:first-child {
        min-width: 0;
        width: 100%;
    }

    #page-content-wrapper .settings-dashboard-cards .card-body.d-flex > .btn,
    #page-content-wrapper .settings-dashboard-cards .card-body.d-flex > a.btn {
        align-self: flex-start;
    }

    #page-content-wrapper .settings-dashboard-cards .card-body.d-flex > span.text-muted,
    #page-content-wrapper .settings-dashboard-cards .card-body.d-flex > span.text-danger {
        align-self: flex-start;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    #wrapper.sidebar-collapsed #sidebar-wrapper {
        width: 70px;
    }
    
    #wrapper:not(.sidebar-collapsed) #sidebar-wrapper {
        width: 215px;
    }
    
    /* Backdrop tylko po inicjalizacji JS (sidebar-ready) — unika pełnoekranowej warstwy przed DOMContentLoaded */
    #wrapper.sidebar-ready:not(.sidebar-collapsed)::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    /* Sticky footer na mobile zawsze od lewej krawędzi */
    .sticky-bottom {
        left: 0 !important;
    }
}

/* ============================================
   NAWIGACJA PACJENTA - NOWY MOTYW
   ============================================ */
/* ============================================
   PATIENT NAV TABS - ZAKŁADKI PACJENTA
   ============================================ */
.patient-nav {
    margin-bottom: 0;
    border-bottom: none;
}

.patient-nav .nav-link {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.875rem;
    background-color: #e9ecef;
    margin-right: 4px;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s ease;
    position: relative;
}

.patient-nav .nav-link:hover {
    background-color: #d3d9df;
    color: #495057;
}

.patient-nav .nav-link.active {
    color: #212529;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-bottom: 1px solid #ffffff;
    font-weight: 600;
    z-index: 10;
    margin-bottom: -1px;

}

/* Pasek nad zakładką: has-approval = szary (niezatwierdzone/dziennik), is-approved = fioletowy (zatwierdzone/ankieta) */
.patient-nav .nav-link.has-approval {
    border-top: 3px solid #b1b1b1;
}
.patient-nav .nav-link.has-approval.active {
    border-top: 3px solid #b1b1b1;
}
.patient-nav .nav-link.is-approved {
    border-top: 3px solid #667eea;
}
.patient-nav .nav-link.is-approved.active {
    border-top: 3px solid #667eea;
}

.patient-subnav-select {
    border-color: #dee2e6;
    font-weight: 500;
}

/* Karta główna z zakładkami pacjenta - TYLKO PIERWSZA karta - niezaokrąglony lewy górny róg */
/* Przypadek 1: Pierwsza karta wewnątrz form */
.patient-nav ~ form > .card:first-child,
.patient-nav + form > .card:first-child,
.patient-nav ~ form > .card.shadow-sm:first-child,
.patient-nav + form > .card.shadow-sm:first-child,
.patient-nav ~ form > div.card:first-of-type,
.patient-nav + form > div.card:first-of-type,
/* Przypadek 2: Pierwsza karta bezpośrednio po patient-nav (bez form) */
.patient-nav + .card:first-of-type,
.patient-nav + .card.shadow-sm:first-of-type {
    border: 1px solid #dee2e6 !important;
    border-radius: 0 0.5rem 0.5rem 0.5rem !important;
    border-top-left-radius: 0 !important;
    overflow: visible !important;
}

/* DRUGI i kolejne karty bezpośrednio po patient-nav (nie pierwszy) - bez zaokrągleń dla sticky-bottom */
.patient-nav ~ .card:not(:first-of-type):not(.sticky-bottom),
.patient-nav ~ .card.shadow-sm:not(:first-of-type):not(.sticky-bottom) {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
}
.patient-nav ~ .card.sticky-bottom,
.patient-nav ~ .card.sticky-bottom.shadow-sm {
    border-radius: 0 !important;
}

/* DRUGI i kolejne karty wewnątrz form - normalne zaokrąglenie wszystkich rogów */
.patient-nav ~ form > .card:not(:first-child),
.patient-nav + form > .card:not(:first-child) {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
}

/* ============================================
   KARTY & KONTENERY - NOWY MOTYW
   ============================================ */
.file-drop-zone {
    border: 2px dashed rgba(102, 126, 234, 0.4);
    background: rgba(102, 126, 234, 0.06);
    min-height: 4rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.file-drop-zone-icon {
    font-size: 1.75rem !important;
    font-weight: 400;
}
.file-drop-zone:hover,
.file-drop-zone.file-drop-zone-active {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.1);
}

/* Ikony w sekcji Przesłane pliki – jednolity rozmiar */
.patient-attachments-section .bi {
    font-size: 1em;
}

/* Lista przesłanych plików – nie rozciąga karty; ~2 pozycje widoczne, reszta w przewijaniu */
.file-list-area.file-list-area-bordered,
.file-list-area-bordered {
    background: transparent !important;
    border: 1px solid #e0e0e0;
    max-height: 14rem;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.file-list-area-bordered .list-group-item {
    border-bottom-color: #e0e0e0 !important;
}
.file-list-area-bordered .list-group-item:last-child {
    border-bottom: none !important;
}

.file-name-truncate {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.doc-download-btn {
    color: var(--primary) !important;
}
.doc-download-btn:hover {
    color: var(--primary-dark) !important;
}

/* Panel Generuj dokumentację - bez podwyższonego z-index, ma być pod pływającym paskiem jak inne panele */
.doc-gen-card {
    overflow: visible;
    position: relative;
}
.doc-gen-list {
    overflow: visible;
}
/* Linia hr nie może wychodzić poza panel - ograniczamy tylko hr */
.doc-gen-list hr {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
/* Układ wierszy (etykieta / select / ikony): kolumna + siatka — wszystkie szerokości; połowa kolumny md nie mieści poziomego rzędu z 200px+ */
.row.g-3.mb-4 > .col-md-6 {
    min-width: 0;
}

.doc-gen-list .d-flex.align-items-center.justify-content-between {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.doc-gen-list .d-flex.align-items-center.justify-content-between > label,
.doc-gen-list .d-flex.align-items-center.justify-content-between > .data-label {
    min-width: 0;
    width: 100%;
}

.doc-gen-list .d-flex.align-items-center.justify-content-between > div.ms-3 {
    margin-left: 0 !important;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, auto);
    column-gap: 0.75rem;
    row-gap: 0.5rem;
    justify-content: start;
    align-items: center;
}

.doc-gen-list .d-flex.align-items-center.justify-content-between > div.ms-3 > form.d-flex.align-items-center.mb-0,
.doc-gen-list .d-flex.align-items-center.justify-content-between > div.ms-3 > div.d-flex.align-items-center.gap-2.mb-0 {
    display: contents !important;
}

/* CSRF w siatce display:contents nie może zajmować komórki */
.doc-gen-list .d-flex.align-items-center.justify-content-between > div.ms-3 input[type="hidden"] {
    display: none !important;
}

.doc-gen-list .d-flex.align-items-center.justify-content-between > div.ms-3 .doc-snapshot-select,
.doc-gen-list .d-flex.align-items-center.justify-content-between > div.ms-3 .merged-template-select {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
    flex-shrink: 1;
}

.doc-gen-list .doc-gen-template-row > div.ms-3 {
    grid-template-columns: repeat(4, auto);
}

/* Wiersz „Szablon”: max. szerokość selectu także poniżej xl (pełny opis tylko w title opcji) */
.doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row > div.ms-3 .merged-template-select {
    max-width: min(26rem, 100%);
    min-width: 12rem;
    flex: 0 1 26rem;
    width: auto;
}

/* ≥xl: jeden rząd — etykieta po lewej, select + ikony jako zwarta grupa przy prawej krawędzi (jak mockup) */
@media (min-width: 1200px) {
    .doc-gen-list .d-flex.align-items-center.justify-content-between:not(.doc-gen-template-row) {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between:not(.doc-gen-template-row) > label,
    .doc-gen-list .d-flex.align-items-center.justify-content-between:not(.doc-gen-template-row) > .data-label {
        width: auto;
        flex-shrink: 0;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between:not(.doc-gen-template-row) > div.ms-3 {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0.75rem;
        width: auto;
        margin-left: auto !important;
        flex: 0 1 auto;
        min-width: 0;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between:not(.doc-gen-template-row) > div.ms-3 .doc-snapshot-select,
    .doc-gen-list .d-flex.align-items-center.justify-content-between:not(.doc-gen-template-row) > div.ms-3 .merged-template-select {
        grid-column: unset;
        grid-row: unset;
        width: auto;
        max-width: 26rem;
        min-width: 12rem;
        flex: 0 1 26rem;
        justify-self: unset;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between:not(.doc-gen-template-row) > div.ms-3 .doc-download-btn,
    .doc-gen-list .d-flex.align-items-center.justify-content-between:not(.doc-gen-template-row) > div.ms-3 a.doc-download-btn {
        min-width: 2.5rem;
        min-height: 2.5rem;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    /* Wiersz Szablon: ten sam układ poziomy (specyficzność > globalny column dla .d-flex.justify-content-between) */
    .doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row > label,
    .doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row > .data-label {
        width: auto;
        flex-shrink: 0;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row > div.ms-3 {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0.75rem;
        width: auto;
        margin-left: auto !important;
        flex: 0 1 auto;
        min-width: 0;
        grid-template-columns: unset;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row > div.ms-3 .merged-template-select {
        grid-column: unset;
        grid-row: unset;
        width: auto;
        max-width: 26rem;
        min-width: 12rem;
        flex: 0 1 26rem;
        justify-self: unset;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row > div.ms-3 .doc-download-btn,
    .doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row > div.ms-3 a.doc-download-btn {
        min-width: 2.5rem;
        min-height: 2.5rem;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .doc-gen-list .d-flex.align-items-center.justify-content-between.doc-gen-template-row > div.ms-3 > a.btn:not(.doc-download-btn) {
        min-width: 2.5rem;
        min-height: 2.5rem;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
        flex-shrink: 0;
    }
}

/* Padding dla sekcji Szablon */
.doc-gen-template-row {
    padding-top: 0.5rem;
    margin-bottom: 0.25rem;
}
/* Ikona przed tekstem — globalne .data-label (::first-letter) nie dotyczy „Szablon”; pisownia jak w HTML */
.doc-gen-template-row .data-label {
    text-transform: none;
}
.doc-gen-template-row .data-label::first-letter {
    text-transform: none;
}
.doc-gen-list .form-select {
    overflow: visible;
    pointer-events: auto;
    min-height: 2rem;
    cursor: pointer;
    flex-shrink: 1;
    min-width: 0;
    padding-right: 2rem;
}
.merged-template-select {
    min-width: 200px;
    padding-right: 2.25rem;
}

.doc-gen-list .merged-template-select {
    min-width: 0;
    max-width: 100%;
}
/* Ikona przekreślonej drukarki – brak druku dla DOCX */
.printer-icon-crossed {
    position: relative;
    display: inline-block;
}
.printer-icon-crossed::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: currentColor;
    transform: rotate(-45deg);
    opacity: 0.8;
}
.printer-disabled {
    cursor: not-allowed;
    pointer-events: auto;
}

.custom-border {
    background: #fff;
    border: none;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    
}

.card {
    border: none;
    border-radius: var(--radius-lg);
    
    overflow: hidden;
}

/* Karta informacyjna — od tabletów w górę: prosty prawy brzeg (dopasowanie do layoutu obok paska) */
@media (min-width: 768px) {
    .card.card-patient-info-flat-right {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    .card.card-patient-info-flat-right .card-body.custom-border {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
}

/* Nadpisanie .card overflow — panel „Generuj dokumentację” (ikony/selecty nie mogą być obcinane) */
.card.doc-gen-card {
    overflow: visible !important;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid var(--border-light);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   STICKY FOOTER & CONTROL BAR - FIXED DO DOŁU EKRANU
   ============================================ */
.sticky-bottom {
    position: fixed !important;
    bottom: 0;
    left: var(--sidebar-strip-width);
    right: 0;
    z-index: 1100;
    margin: 0;
    background-color: #f8f9fa;
    border-top: 2px solid var(--border-color);
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.08);
    transition: left 0.3s ease-in-out;
    border-radius: 0 !important;
    min-height: 85px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sticky-bottom .card-body {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-top: none;
    min-height: 85px;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    overflow-x: auto;
}

/* Kolumny w pasku (lewo / środek / prawo) — ta sama oś pionowa */
.sticky-bottom > .card-body > .d-flex {
    align-items: center;
}
/* Prawa grupa akcji nie może być ściskana poniżej treści (uniknięcie nachodzenia tekstu na ikony) */
.sticky-bottom > .card-body > .d-flex:last-child {
    flex-shrink: 0;
    flex-wrap: nowrap;
}
/* Zagnieżdżony partial doc_buttons — bez zwężania (inaczej ikony wylewają na sąsiedni link) */
.sticky-bottom > .card-body > .d-flex:last-child > .sticky-bar-doc-buttons-inner {
    flex-shrink: 0;
    min-width: min-content;
}

/* Prawa kolumna: ikonki 44×44 (bez submit[form], .sticky-bar-text-action, .sticky-print-default-template-btn — ten ma napis „Druk szablonu”) */
.sticky-bottom > .card-body > .d-flex:last-child .btn:not(button[type="submit"][form]):not(.sticky-bar-text-action):not(.sticky-print-default-template-btn),
.sticky-bottom > .card-body > .d-flex:last-child a.btn:not(.sticky-bar-text-action):not(.sticky-print-default-template-btn) {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    padding: 0 !important;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    line-height: 1;
    flex-shrink: 0;
}
/* „Druk szablonu” — pill z ikoną + tekstem (nie 44×44) */
.sticky-bottom > .card-body > .d-flex:last-child .sticky-print-default-template-btn {
    width: auto;
    height: auto;
    min-width: min-content;
    min-height: 2.75rem;
    max-width: none;
    max-height: none;
    padding: 0.5rem 1.1rem !important;
    border-radius: 50rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1.25;
    flex-shrink: 0;
    white-space: nowrap;
    box-sizing: border-box;
}
.sticky-bottom > .card-body > .d-flex:last-child .sticky-print-default-template-btn > i {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}
.sticky-bottom > .card-body > .d-flex:last-child .btn:not(button[type="submit"][form]):not(.sticky-bar-text-action):not(.sticky-print-default-template-btn) > i,
.sticky-bottom > .card-body > .d-flex:last-child a.btn:not(.sticky-bar-text-action):not(.sticky-print-default-template-btn) > i {
    line-height: 1;
    display: block;
    font-size: 1.1rem;
}
/* „Zapisz” (powiązanie z formularzem przez atrybut form) — pill, nie 44×44 */
.sticky-bottom > .card-body > .d-flex:last-child button[type="submit"][form] {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 2.75rem;
    max-width: none;
    max-height: none;
    padding: 0.5rem 1.15rem !important;
    border-radius: 50rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.25;
}
/* Przycisk/link z tekstem w prawej kolumnie (np. Zgoda: „Użyj aktualnego szablonu”) — poza regułą 44×44 */
.sticky-bottom > .card-body > .d-flex:last-child .sticky-bar-text-action {
    width: auto;
    height: auto;
    min-width: max-content;
    max-width: none;
    min-height: 2.75rem;
    max-height: none;
    padding: 0.5rem 1rem !important;
    border-radius: 50rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1.25;
    flex-shrink: 0;
    white-space: nowrap;
}
.sticky-bottom > .card-body > .d-flex:last-child .sticky-bar-text-action > i {
    font-size: 1em;
    display: inline;
}
/* Wyślij (samolot) na pasku — bez zmiany wyglądu przy hover / myszowym focus */
.sticky-bottom .sticky-send-btn-wrap .btn.sticky-bar-send-icon-btn:hover,
.sticky-bottom .sticky-send-btn-wrap .btn.sticky-bar-send-icon-btn:focus:not(:focus-visible) {
    filter: none !important;
    box-shadow: none !important;
}
.sticky-bottom .sticky-send-btn-wrap .btn-outline-primary.sticky-bar-send-icon-btn:hover,
.sticky-bottom .sticky-send-btn-wrap .btn-outline-primary.sticky-bar-send-icon-btn:focus:not(:focus-visible) {
    background-color: transparent !important;
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}
.sticky-bottom .sticky-bar-btn-fill-primary {
    background: var(--primary-gradient) !important;
    border: 1px solid transparent !important;
    color: #fff !important;
    box-shadow: none;
}
.sticky-bottom .sticky-bar-btn-fill-primary:hover,
.sticky-bottom .sticky-bar-btn-fill-primary:focus {
    color: #fff !important;
    filter: brightness(0.93);
    border-color: transparent !important;
}
.sticky-bottom a.sticky-bar-btn-fill-primary:focus-visible {
    color: #fff !important;
    outline: 2px solid rgba(118, 75, 162, 0.45);
    outline-offset: 2px;
}

.sticky-bottom .sticky-bar-generated-at,
.sticky-bottom .sticky-bar-no-doc {
    flex-wrap: nowrap;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: min-content;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

/* Usunięto margin-bottom - zawartość może dochodzić do footera */

/* Kontener dla kart pacjenta - dodatkowy wrapper */
.patient-card-container {
    position: relative;
    min-height: 100vh;
}

/* Zapewnienie, że sticky footer nie wychodzi poza ekran */
#page-content-wrapper {
    position: relative;
    overflow-x: hidden;
}

/* Padding dla kart pacjenta */
.container-fluid.px-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.container-fluid.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* Separatory kolumn */
.col-md-4.border-end,
.col-md-6.border-end {
    border-right: 1px solid var(--border-light) !important;
    padding-right: 1.5rem;
}

/* ============================================
   SIATKA BOOTSTRAP (.row / .col-*) – jednolity odstęp pionowy
   ============================================ */
.row {
    margin-bottom: 0.75rem;
}

.row > [class*="col-"],
.row > .col {
    margin-bottom: 0.75rem;
}

/* Gdy są kolumny, odstęp daje się tylko na nich – bez podwójnego marginesu z .row */
.row:has(> [class*="col-"]),
.row:has(> .col) {
    margin-bottom: 0;
}

/* Formularz placówki (Zarządzaj placówkami) – grupa select + przyciski modali */
.clinic-input-group-actions .form-select {
    min-width: 0;
}

/* ============================================
   NAGŁÓWKI SEKCJI I PODSEKCJI
   ============================================ */
.section-header {
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    margin-top: 2rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.section-header:first-child {
    margin-top: 0;
}

.section-header i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* Karta pacjenta – wyrównanie pustego nagłówka w 4. kolumnie do pozostałych */
.section-header-placeholder {
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    min-height: 2.25rem;
    border-bottom: 1px solid transparent;
    visibility: hidden;
}

/* Data urodzenia + wiek: ta sama wysokość i typografia co zwykłe .form-control (nie jak kg/cm) */
.patient-dob-input-group {
    flex-wrap: nowrap;
    align-items: stretch;
}

.patient-dob-input-group .patient-dob-date-input {
    flex: 1 1 50%;
    min-width: 0;
    line-height: 1.5;
    box-sizing: border-box;
}

.patient-dob-input-group .patient-dob-age-addon {
    flex: 1 1 50%;
    min-width: 5.5rem;
    box-sizing: border-box;
    /* drugi segment jak pole tekstowe: bez stylu .input-group-text (kg/cm) */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -2px;
    position: relative;
    z-index: 1;
    cursor: default;
    user-select: none;
}

/* Karta pacjenta – prawa połowa (inf. dodatkowe + placówka + uwagi w jednym bloku, bez „luzu” pod sekcją) */
.patient-card-right-block > .row {
    margin-bottom: 0;
}

/* Wyrównanie z rzędem Kod pocztowy / Miejscowość w kolumnie Kontakt */
.patient-card-right-block .patient-notes-wrap {
    margin-top: 0.6rem;
}

.patient-card-right-block .patient-notes-above {
    margin-top: 0.35rem;
}

/* Uwagi / Komentarz lekarza – domyślna wysokość jak jeden wiersz inputu; rozciąganie w pionie (resize) */
.patient-notes-wrap textarea.patient-notes-input,
.doctor-comment-wrap textarea.patient-notes-input {
    min-height: calc(0.875rem * 1.5 + 1.5rem) !important;
    resize: vertical !important;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.5;
}

/* Godzina podania leków w jednym rzędzie ze „Zalecenia dodatkowe” */
.premed-med-time-col {
    flex: 0 0 auto;
    min-width: 8.75rem;
    max-width: 11rem;
}

/* Premedykacja — „Znieczulenie”: zamknięte pole bez nachodzenia na strzałkę (padding-end); opcje w HTML pełne = pełny tekst na rozwiniętej liście. Elipsy na zamkniętym polu działają w Chromium/Edge/WebKit — Firefox bywa inny. */
.input-group > select.form-select.premed-anesthesia-type-select {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Strzałka selectu (tło Bootstrap) nie może być przez niego „wczytywana” wizualnie przez tekst */
    padding-inline-end: 3rem;
    padding-right: 3rem;
}

/* ============================================
   TABELE - UJEDNOLICONE I KOMPAKTOWE
   ============================================ */
.table {
    font-size: 0.8125rem;
}

.table th {
    font-size: 0.688rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
    padding: 0.625rem 0.5rem;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    font-size: 0.8125rem;
    vertical-align: middle;
    padding: 0.625rem 0.5rem;
}

.table td.small {
    font-size: 0.75rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table-header-icon {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 2px;
}

/* Kompaktowa tabela - optymalizacja szerokości */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doctor-select {
    font-size: 0.75rem;
    padding: 0.5rem;
    height: auto;
    border-color: var(--border-color);
    background-color: var(--bg-secondary);
    width: 100%;
    max-width: 135px;
    color: #212529;
}

/* Select lekarza w tabeli – więcej miejsca, bez strzałki */
.table tbody .doctor-select {
    max-width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    padding-right: 0.5rem;
}

.doctor-select option {
    color: #212529;
    background-color: #fff;
}

.doctor-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem var(--primary-light);
}

/* ============================================
   PRZYCISKI AKCJI W TABELI - ZAOKRĄGLONE KAFELKI
   ============================================ */
.status-btn {
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0 6px;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.95;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1;
    border: 1px solid;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.status-btn:hover {
    opacity: 1;
    box-shadow: var(--shadow-md);
}

.status-btn i {
    font-size: 0.75rem;
}

/* Niegotowe – delikatny outline, bez wypełnienia */
.bg-gray {
    background-color: transparent;
    border-color: #c0c0c0;
    color: #8a8a8a;
}
.status-btn.bg-gray:hover {
    border-color: #a0a0a0;
    color: #6a6a6a;
    background-color: rgba(0, 0, 0, 0.04);
}

/* Zatwierdzone – wypełnione gradientem */
.bg-green {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}
.status-btn.bg-green:hover {
    color: white;
}

.bg-brown {
    background-color: transparent;
    border-color: #667eea;
    color: #667eea;
}
.status-btn.bg-brown:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

.bg-red {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}
.status-btn.bg-red:hover {
    color: white;
}

.action-buttons-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    justify-content: flex-end;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
}

/* Zielona kropka: wysłano e-mail do pacjenta z premedykacji (sticky + lista) */
.email-to-patient-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #198754;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.35);
    pointer-events: none;
    z-index: 2;
}

.sticky-send-btn-wrap .email-to-patient-dot {
    top: 7px;
    right: 8px;
}

.status-btn-p-wrap {
    display: inline-block;
    vertical-align: middle;
}

.email-to-patient-dot--list {
    width: 7px;
    height: 7px;
    top: 24px;
    right: 15px;
}

.email-to-patient-dot--tab {
    width: 7px;
    height: 7px;
    top: 6px;
    right: 18px;
    z-index: 100;
    background: #b1b1b1;
}
.nav-item:has(.nav-link.active) > .email-to-patient-dot--tab {
    background: #198754;
}
.nav-item:has(.nav-link.active) > .email-to-patient-dot--tab-clinic {
    background: #0015ff;
}
.email-to-patient-dot--tab-clinic {
    right: 8px;
    z-index: 100!important;
    background: #b1b1b1;
}

/* Kropki przy zakładce Premedykacja: natywne title + niebieski pierścień placówki */
.email-to-patient-dot.email-to-patient-dot--tab,
.email-to-clinic-dot.email-to-patient-dot--tab-clinic {
    pointer-events: auto;
    cursor: help;
}
.email-to-clinic-dot.email-to-patient-dot--tab-clinic {
    box-shadow: 0 0 0 1px rgba(0, 21, 255, 0.35);
}

/* Niebieska kropka – e-mail wysłany do placówki (lista + zakładka aktywna) */
.email-to-clinic-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #b1b1b1;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px rgba(253, 126, 20, 0.35);
    pointer-events: none;
    z-index: 2;
}
.email-to-clinic-dot--list {
    width: 7px;
    height: 7px;
    top: 24px;
    right: 5px;
    background: #0015ff;
    box-shadow: 0 0 0 1px rgba(0, 21, 255, 0.35);
}

/* ============================================
   PAGINACJA LISTY ANKIET – spójna ze stroną
   ============================================ */
.survey-list-pagination {
    border-top: 1px solid var(--border-light);
    background: linear-gradient(180deg, #fafbff 0%, var(--bg-secondary) 100%);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.survey-list-pagination-label,
.survey-list-pagination-count {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.survey-list-pagination-select {
    width: 80px !important;
    min-width: 80px;
    height: 35px;
    min-height: 35px;
    font-size: 0.8125rem;
    font-weight: 400;
    padding: 0.35rem 0.6rem;
    line-height: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.survey-list-pagination-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem var(--primary-light);
}

.survey-list-pagination-nav .page-link {
    min-width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0 8px;
    background-color: transparent;
    border: 1px solid #c0c0c0;
    color: #8a8a8a;
    border-radius: var(--radius-md) !important;
    margin: 0 0.2rem;
    transition: all 0.15s ease;
}

.survey-list-pagination-nav .page-item:not(.active) .page-link:hover {
    border-color: #a0a0a0;
    color: #6a6a6a;
    background-color: rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-md);
}

.survey-list-pagination-nav .page-item.active .page-link {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

.survey-list-pagination-nav .page-item.disabled .page-link {
    color: var(--text-muted);
    border-color: transparent;
    background: transparent;
    cursor: default;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hover-shadow:hover {
    box-shadow: var(--shadow-hover);
}

.transition {
    transition: all 0.2s ease;
}

#validationAlert {
    display: none;
}

.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

/* ============================================
   RESPONSIVE DESIGN - UJEDNOLICONY
   ============================================ */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .card-title-primary,
    .card-title-uppercase {
        font-size: 1.1rem;
    }
    
    .card-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .card-header-info {
        align-items: flex-start;
    }
    
    .col-md-4.border-end,
    .col-md-6.border-end {
        border-right: none !important;
        border-bottom: 1px solid var(--border-light) !important;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .patient-nav .nav-link {
        font-size: 0.8125rem;
        padding: 0.625rem 0.75rem;
    }
    
    .sticky-bottom .card-body {
        padding: 0.875rem 1rem;
        min-height: 85px;
    }

    /* Pływający pasek: więcej miejsca na akcje — bez napisu zatwierdzenia */
    .sticky-bottom .approval-label {
        display: none !important;
    }

    .custom-border {
        padding: 1.5rem;
    }
    
    .status-btn {
        font-size: 0.6rem;
        min-width: 26px;
        height: 26px;
        padding: 0 5px;
    }

    /* Tylko bezpośredni wrapper treści — bez zagnieżdżonych .container-fluid */
    #page-content-wrapper:has(.patient-subnav-mobile) > .container-fluid {
        padding-bottom: 6rem;
    }

    /* „Zapisz” / „Druk szablonu” — tylko ikona (tekst ukryty) */
    .sticky-bottom button[type="submit"][form].btn-success.rounded-pill {
        font-size: 0;
        line-height: 0;
        padding: 0 !important;
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        height: 44px;
        min-height: 44px;
        max-height: 44px;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .sticky-bottom button[type="submit"][form].btn-success.rounded-pill i {
        font-size: 1.1rem;
        line-height: 1;
        margin: 0 !important;
    }

    .sticky-bottom .sticky-print-default-template-btn {
        font-size: 0;
        line-height: 0;
        padding: 0 !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 44px;
        min-height: 44px;
        max-height: 44px;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .sticky-bottom .sticky-print-default-template-btn > i {
        font-size: 1.1rem;
        line-height: 1;
        margin: 0 !important;
    }
}

@media (max-width: 1199.98px) {
    .sticky-bottom .sticky-bar-back {
        display: none !important;
    }
}

/* ============================================
   SURVEY EDITOR (Edytor Ankiet) - poprzednia wersja
   ============================================ */
body:has(.survey-editor-container) {
    background-color: #f0f2f5;
    padding-bottom: 120px;
}

.survey-editor-container .question-wrapper {
    position: relative;
}

.survey-editor-container .question-card {
    border-radius: 8px;
    border-left: 6px solid #ccc;
    background: white;
    transition: 0.2s;
    border-top: 1px solid #eee;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 1;
}

.survey-editor-container .question-card.is-sub {
    border-left: 6px solid var(--google-blue);
    margin-left: 45px;
    background: var(--nested-bg);
}

.survey-editor-container .question-card.is-sub .drag-handle {
    display: none !important;
    pointer-events: none;
}

.survey-editor-container .sortable-ghost .question-card {
    background-color: #e8f0fe !important;
    border: 2px dashed var(--google-blue) !important;
    opacity: 0.8;
}

.survey-editor-container .question-card.is-invalid {
    border: 2px solid #dc3545 !important;
    background-color: #fff8f8;
}

/* Delikatny przycisk usuwania */
.survey-editor-container .delete-btn,
.survey-editor-container .delete-btn .delete-icon {
    color: #94a3b8;
}
.survey-editor-container .delete-btn:hover,
.survey-editor-container .delete-btn:hover .delete-icon {
    color: #dc2626;
}
.survey-editor-container .delete-option,
.survey-editor-container .delete-option .bi {
    color: #94a3b8;
}
.survey-editor-container .delete-option {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}
.survey-editor-container .delete-option:hover,
.survey-editor-container .delete-option:hover .bi {
    color: #dc2626;
}

/* --- SEPARATOR I PLUSIK (zawsze widoczny, szary, na środku linii) --- */
.survey-editor-container .add-separator {
    min-height: 24px;
    height: 24px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    gap: 6px;
    opacity: 1;
    position: relative;
    z-index: 5;
    margin: 0;
    padding: 8px 0;
}

.survey-editor-container .add-separator::before {
    content: '';
    position: absolute;
    width: 90%;
    border-top: 2px dashed #ccc;
    z-index: -1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.survey-editor-container .add-separator.hidden-sep {
    display: none !important;
}

.survey-editor-container .plus-btn {
    z-index: 101;
    background: #e2e8f0;
    color: #94a3b8;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.survey-editor-container .plus-btn:hover {
    background: #cbd5e1;
    color: #64748b;
}

/* Menu główny (w add-separator) - w normalnym flow, nad przyciskiem plus */
.survey-editor-container .add-separator > .insert-menu {
    position: static;
    left: auto;
    transform: none;
}

/* Style wspólne dla obu typów menu */
.survey-editor-container .insert-menu {
    background: transparent;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    z-index: 1000;
    gap: 0.5rem;
    border: none;
    min-width: 280px;
}

.survey-editor-container .insert-menu.insert-menu-list {
    flex-direction: column;
}

.survey-editor-container .insert-menu .insert-type-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.survey-editor-container .insert-menu .insert-type-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.12) !important;
}

/* Menu zagnieżdżone (w opcji) - overlay pod przyciskiem nest */
.survey-editor-container .insert-menu-nested {
    position: absolute;
    left: 0;
    top: 100%;
    transform: translateY(6px);
}

.survey-editor-container .option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.survey-editor-container .option-input {
    border: 0;
    border-bottom: 1px solid #ddd;
    outline: none;
    flex-grow: 1;
    background: transparent;
}

.survey-editor-container .option-input:focus {
    border-bottom-color: var(--google-blue);
}

.survey-editor-container .nest-btn {
    color: #ccc;
    cursor: pointer;
    transition: 0.2s;
}

.survey-editor-container .nest-btn:hover {
    color: var(--google-blue);
}

.survey-editor-container .is-sub .nest-btn {
    display: none !important;
}

.survey-editor-container .trigger-label {
    font-size: 0.75rem;
    background: #eef2ff;
    color: #4338ca;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: inline-block;
    border: 1px solid #c7d2fe;
}

.survey-editor-container .question-type-icon {
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    align-items: center;
    min-width: 20px;
}

.row-deleted {
    display: none !important;
}

.survey-editor-container .q-num {
    font-weight: 800;
    color: #555;
    min-width: 25px;
    display: inline-block;
}

.survey-editor-container .is-sub .q-num {
    color: var(--google-blue);
}

/* Overlay na całą stronę */
.saving-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

/* Inputy tekstowe */
.survey-editor-container .text-col input[type="text"],
.survey-editor-container .text-col textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

/* Survey Editor Responsive */
@media (max-width: 768px) {
    .survey-editor-container .question-card.is-sub {
        margin-left: 1rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.875rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .btn {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.8125rem;
    }
    
    .table {
        font-size: 0.8125rem;
    }
    
    .custom-border {
        padding: 1rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .patient-nav,
    .patient-subnav-mobile,
    .sticky-bottom,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .custom-border,
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    body {
        background-color: white;
    }
}

/* ============================================
   ANKIETY PUBLICZNE (dla pacjentów)
   ============================================ */
.survey-public-body {
    background: linear-gradient(160deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
    min-height: 100vh;
    overflow-x: visible; /* zapobiega ucinaniu jednostek kg/cm w polach Waga/Wzrost */
}

.survey-public-wrapper {
    max-width: 720px;
    margin: 0 auto;
}

.survey-public-wrapper.survey-full-width {
    max-width: none;
}

.survey-header-logo img {
    margin-bottom: 1rem;
}

.survey-public-header {
    padding: 2rem 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.survey-header-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.survey-child-theme .survey-header-icon {
    background: linear-gradient(135deg, var(--child-primary) 0%, var(--child-dark) 100%);
}

.survey-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.survey-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.survey-notice {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
}

.survey-notice-small {
    font-size: 0.75rem;
}

/* Panele ankiet */
.survey-panel {
    border-radius: 12px;
    overflow: visible;
}
/* Nadpisanie .card overflow – zapobiega ucinaniu jednostek kg/cm w polach Waga/Wzrost */
.card.survey-panel {
    overflow: visible !important;
}

.survey-panel-header {
    background: linear-gradient(135deg, var(--adult-primary) 0%, var(--adult-dark) 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 1.25rem;
    border: none;
}

.survey-panel-child .survey-panel-header {
    background: linear-gradient(135deg, var(--child-primary) 0%, var(--child-dark) 100%);
}

.survey-panel-body {
    padding: 1.5rem 1.25rem;
    padding-right: 1.5rem; /* zapas na jednostki (kg, cm) w polach Waga/Wzrost */
    background: white;
    overflow: visible;
}

/* Pytania ankiety z numeracją */
.survey-question-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.survey-question-item:last-child {
    border-bottom: none;
}

.survey-question-item.nested-question {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--adult-primary);
    display: none; /* Pokazywane przez JS po zaznaczeniu odpowiedniej opcji rodzica */
}

.survey-child-theme .survey-question-item.nested-question {
    border-left-color: var(--child-primary);
}

.survey-question-header {
    margin-bottom: 0.5rem;
}

.survey-question-num {
    flex-shrink: 0;
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    color: var(--survey-question-num-color);
}

.survey-question-num-nested {
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    color: var(--survey-question-num-color);
}

.survey-scale-value {
    color: var(--adult-primary);
    font-size: 1.2rem;
}

.survey-scale-value-child {
    color: var(--child-primary);
}

/* Skala liniowa – cienki pasek, pionowe kreski, 1 i 10 na brzegach */
.survey-scale-wrapper {
    padding: 0.5rem 0;
}

.survey-scale-track-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.survey-scale-track-wrap.survey-scale-with-value {
    flex-direction: row;
    align-items: center;
}

.survey-scale-track-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.survey-scale-ticks {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.survey-scale-tick {
    width: 2px;
    height: 10px;
    background: #b0b0b0;
    border-radius: 1px;
    flex-shrink: 0;
}

.survey-scale-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.survey-scale-track-area .survey-scale-slider {
    width: 100%;
}

/* Track – cienki szary pasek */
.survey-scale-slider::-webkit-slider-runnable-track {
    height: 3px;
    background: #d0d0d0;
    border-radius: 2px;
    border: none;
}

.survey-scale-slider::-moz-range-track {
    height: 3px;
    background: #d0d0d0;
    border-radius: 2px;
    border: none;
}

/* Thumb – fioletowe kółko */
.survey-scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    margin-top: -10px;
}

.survey-scale-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    cursor: pointer;
}

.survey-scale-slider::-webkit-slider-thumb:hover,
.survey-scale-slider::-moz-range-thumb:hover {
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.5);
}

/* Checkboxy i zgody */
.big-checkbox {
    width: 1.5em;
    height: 1.5em;
    cursor: pointer;
}

.consent-label {
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 8px;
}

/* Przycisk wysłania */
.btn-submit-survey {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-submit-survey:hover {
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit-survey:disabled,
.btn-submit-survey.disabled {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
}

.survey-sending-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(1px);
}

.survey-sending-card {
    width: min(520px, 100%);
    overflow: hidden;
    border-radius: 1.25rem;
}

.survey-sending-header {
    padding: 1rem 1.25rem;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
}

.survey-sending-body {
    padding: 2rem 1.5rem;
    background: #fff;
    text-align: center;
}

.survey-sending-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.survey-sending-overlay-spinner {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.survey-sending-overlay-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.survey-sending-overlay-text {
    margin-top: 0.35rem;
    color: #495057;
    line-height: 1.55;
}

.survey-success-icon {
    color: #198754;
    font-size: 2.8rem;
    line-height: 1;
}

.survey-overlay-close-btn {
    width: auto;
    min-width: 140px;
}

/* ============================================
   ODPOWIEDZI Z ANKIETY - przejrzysty układ (kompaktowy)
   ============================================ */
.qa-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qa-group {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}

/* Odstępstwo od normy: cała ramka (pytanie + górny rząd + dolna odpowiedź) — fiolet / primary */
.qa-group.qa-group-abnormal {
    border-left: 3px solid var(--primary);
    background: var(--nested-bg, #f8f9ff);
}
.qa-group.qa-group-abnormal .qa-question {
    background: transparent;
}

.qa-group.qa-group-conditional {
    margin-top: -0.25rem;
    margin-left: 1rem;
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: none;
    background: var(--nested-bg, #f8f9ff);
}

.qa-question {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

/* Pytanie pierwszego poziomu (pełna szerokość); odpowiedź w .qa-answer-wrapper poniżej */
.qa-main-row {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 0;
    box-sizing: border-box;
    border-bottom: 1px solid #ddd;
    background: var(--bg-secondary);
}
.qa-main-row .qa-question {
    flex: 1 1 100%;
    min-width: 0;
    margin: 0;
    border-bottom: none;
}
/* Główna odpowiedź: standard — zwykła czcionka; poza normą — czarny, pogrubiony */
.qa-answer-main-part {
    font-weight: 400;
}
.qa-answer-main-part-abnormal {
    color: #000;
    font-weight: 700;
}
/* Sekcja „odpowiedzi odbiegające od normy”: cała treść .qa-answer (główne + podpytania) — czarny, pogrubiony */
.qa-answer.qa-answer-all-abnormal {
    color: #000;
    font-weight: 700;
}
.qa-answer.qa-answer-all-abnormal .text-muted.fst-italic {
    font-weight: 400;
    color: var(--text-muted);
}
.qa-answer-main-part .text-muted.fst-italic {
    font-weight: 400;
    color: inherit;
}
@media (max-width: 576px) {
    .qa-main-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.qa-question-num {
    font-weight: 700;
    color: var(--primary);
    margin-right: 0.25rem;
}

.qa-answer-wrapper {
    padding: 0.2rem 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    background: #fff;
}

.qa-answer-wrapper.qa-answer-abnormal {
    background: var(--nested-bg, #f8f9ff);
    border-left: 3px solid var(--primary);
}

.qa-warning-icon {
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.qa-answer {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--text-primary);
    line-height: 1.35;
}

/* ============================================
   EDYTOR ZGÓD (adult/child) - zaokrąglone pola
   ============================================ */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 992px) {
    .editor-layout { grid-template-columns: 1fr; }
}

.custom-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

/* Ujednolicony styl treści podglądu – visual editor, zgoda, karta informacyjna */
.content-preview-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Pole treści szablonu (edytor zgód, szablon maila) – używa .content-preview-text */
#visual-editor {
    min-height: 350px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: pre-wrap; /* entery + wiele spacji + wcięcia na początku linii */
    tab-size: 4;
}
/* Potomkowie (p, div z execCommand itd.) — domyślnie HTML zwija spacje przy white-space: normal */
#visual-editor *:not(br) {
    white-space: inherit;
}
#visual-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Edytor z paskiem formatowania (zgody – jak lista szablonów maili) */
#visual-editor.visual-editor-with-toolbar {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Edytor treści – zalecenia ogólne (karta info); ten sam UX co zgody / szablony maili */
#igVisualEditor {
    min-height: 350px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: pre-wrap;
    tab-size: 4;
}
#igVisualEditor *:not(br) {
    white-space: inherit;
}
#igVisualEditor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
#igVisualEditor.visual-editor-with-toolbar {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/*
 * Karta informacyjna — wyłącznie podgląd „Informacje ogólne” (#afterAnesthesiaPreview).
 * Ta sama logika białych znaków i odstępów co w #igVisualEditor (treść z tego samego HTML div/p).
 */
.karta-info-general-preview-wrap {
    overflow: hidden;
}
#afterAnesthesiaPreview.karta-info-general-preview {
    white-space: inherit;
    tab-size: 4;
    padding: 1rem 1.25rem;
}
#afterAnesthesiaPreview.karta-info-general-preview *:not(br) {
    white-space: inherit;
}
#afterAnesthesiaPreview.karta-info-general-preview p,
#afterAnesthesiaPreview.karta-info-general-preview div {
    margin-bottom: 0.5rem;
}
#afterAnesthesiaPreview.karta-info-general-preview p:last-child,
#afterAnesthesiaPreview.karta-info-general-preview div:last-child {
    margin-bottom: 0;
}

/* Uwagi operacyjne — edytor w szablonie karty znieczuleń (jak zgody / karta info) */
.anesthesia-or-remark-editor {
    min-height: 140px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: pre-wrap;
    tab-size: 4;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.anesthesia-or-remark-editor *:not(br) {
    white-space: inherit;
}
.anesthesia-or-remark-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.anesthesia-or-remark-editor.visual-editor-with-toolbar {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Zalecenia dodatkowe — edytor HTML (karta informacyjna) */
#recAdditionalEditor.karta-rec-additional-editor {
    min-height: 100px;
    padding: 0.75rem 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: pre-wrap;
    tab-size: 4;
}
#recAdditionalEditor.karta-rec-additional-editor *:not(br) {
    white-space: inherit;
}
#recAdditionalEditor.karta-rec-additional-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Podgląd uwag operacyjnych na karcie pacjenta */
.anesthesia-remark-preview {
    min-height: 5rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.anesthesia-remark-preview *:not(br) {
    white-space: inherit;
}

/* Kafelki zmiennych w treści — font-weight: inherit, żeby widać było pogrubienie/kursywę z execCommand / Ctrl+B itd. */
#visual-editor .tag-pill {
    display: inline-block;
    padding: 0.2em 0.5em;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-weight: inherit;
    font-style: inherit;
    text-decoration: inherit;
    margin: 0 0.1em;
}
#visual-editor .tag-pill b,
#visual-editor .tag-pill strong {
    font-weight: 700 !important;
}
#visual-editor .tag-pill i,
#visual-editor .tag-pill em {
    font-style: italic !important;
}
#visual-editor .tag-pill u {
    text-decoration: underline !important;
}

/* Zaznaczony kafelek zmiennej (klik → formatowanie z paska) */
#visual-editor .tag-pill.tag-pill--selected,
#email-content-editor .tag-pill.tag-pill--selected,
#email-subject-editor .tag-pill.tag-pill--selected {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Dostępne zmienne - zaokrąglone kafelki */
.sidebar-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 1rem 0 0.5rem 0;
}
.sidebar-section-title:first-child { margin-top: 0; }

.tag-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.5rem;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.tag-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-hover);
}
.tag-btn code {
    font-size: 0.85rem;
    color: var(--primary);
    background: none;
    padding: 0;
}

/* Zmienne w edytorze karty znieczuleń */
.variable-badge {
    font-size: 0.8rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Ikony usuwania – gradient strony tylko poza standardowymi przyciskami .btn
   (np. status-btn na liście, .delete-option); w .btn ikona dziedziczy kolory Bootstrap (hover outline-danger). */
button:not(.btn) .bi-trash,
button:not(.btn) .bi-trash2,
a:not(.btn) .bi-trash,
a:not(.btn) .bi-trash2 {
    background: var(--primary-gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* ============================================
   STYLE PRZENIESIONE Z SZABLONÓW HTML
   ============================================ */

/* --- Szablony druku --- */
.saved-templates-list .list-group-item,
.saved-templates-list .list-group-item * { color: #212529 !important; }
#docOrderList .list-group-item,
#docOrderList .list-group-item * { color: #212529 !important; }
.saved-templates-list .list-group-item,
.saved-templates-list .list-group-item * {
    font-family: inherit !important;
}
.saved-templates-list .list-group-item .form-label.fw-bold {
    font-weight: 700 !important;
}
.saved-templates-list .list-group-item .form-text {
    margin-top: .25rem;
    font-size: .875em;
    color: var(--bs-secondary-color, var(--text-muted));
    line-height: 1.6;
    font-weight: 400;
}
.saved-templates-list .list-group-item,
#docOrderList .list-group-item {
    transition: none !important;
    border-left: none !important;
    padding-left: 0 !important;
}
.saved-templates-list .list-group-item:hover,
#docOrderList .list-group-item:hover {
    background-color: transparent !important;
    padding-left: 0 !important;
    border-left: none !important;
    color: inherit !important;
}
#docOrderList .form-check-inline .form-check-input {
    margin-top: 0;
}
#docOrderList .form-check-inline.d-inline-flex {
    gap: 10px;
}
.saved-templates-list .list-group-item {
    align-items: flex-start;
}
.saved-templates-list .list-group-item > div:first-child {
    flex: 1 1 0%;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

/* --- Modal Dodaj zalecenie: nadpisanie białego tekstu z .list-group-item (sidebar) --- */
#zalecenieModal .zalecenie-tpl-apply-btn {
    color: #212529 !important;
}
#zalecenieModal .zalecenie-tpl-apply-btn .text-muted {
    color: #6c757d !important;
}

/* --- Modal słownika zaleceń: ciemny tekst --- */
#recCommentModal .list-group-item {
    color: #212529 !important;
}

/* --- Edytuj nagłówki (header media grid) --- */
.header-media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.header-media-item {
    flex: 0 0 calc(25% - 0.75rem);
    display: flex;
    flex-direction: column;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}
.header-media-item.is-active {
    border-color: #6f42c1;
    box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.3);
}
.header-media-item .header-media-bottom {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: #fff;
    border-top: 1px solid #dee2e6;
}
.header-media-item .btn-header-active {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}
.header-media-item .btn-header-active:hover {
    background-color: #5a32a3;
    border-color: #5a32a3;
    color: #fff;
}
.header-media-item .thumb-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.header-media-item .thumb-info {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-media-item .thumb-wrap {
    flex: 1;
    min-height: 80px;
    max-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
}
.header-media-item .thumb-wrap:hover {
    background: #f8f9fa;
}
.header-media-item .thumb-wrap img {
    max-width: 100%;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.header-media-item .thumb-wrap .thumb-placeholder {
    font-size: 1.5rem;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}
@media (max-width: 1200px) {
    .header-media-item { flex: 0 0 calc(50% - 0.5rem); }
}
@media (max-width: 576px) {
    .header-media-item { flex: 0 0 100%; }
}

/* --- Badanie przedmiotowe – układ jak w druku, minimalne przewijanie --- */
.badanie-print-layout {
    width: 100%;
}
.badanie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.badanie-row {
    border-bottom: 1px solid var(--border-light, #dee2e6);
}
.badanie-row td {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}
.badanie-row.qa-group-conditional {
    background: var(--nested-bg, #f8f9ff);
}
.badanie-row.qa-group-conditional td:first-child {
    padding-left: 1.5rem;
    border-left: 3px solid var(--primary);
}
.badanie-question-cell {
    width: 25%;
    vertical-align: middle;
    padding: 0.45rem 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}
.badanie-q-num {
    font-weight: 700;
    color: var(--primary);
    margin-right: 0.25rem;
}
.badanie-answer-cell {
    width: 75%;
    padding: 0.45rem 0.75rem;
    vertical-align: middle;
}
.badanie-question-cell.qa-question-abnormal {
    background: rgba(var(--primary-rgb, 13, 110, 253), 0.06);
    border-left: 2px solid var(--primary);
}
.badanie-answer-cell.qa-answer-abnormal {
    background: rgba(var(--primary-rgb, 13, 110, 253), 0.06);
}
/* Pozycje poza normą: tylko tło/obramowanie — bez dodatkowego pogrubienia ani podkreślenia tekstu */
.badanie-print-layout .badanie-question-cell.qa-question-abnormal,
.badanie-print-layout .badanie-answer-cell.qa-answer-abnormal {
    font-weight: 500;
    text-decoration: none;
}
.badanie-print-layout .badanie-option-label.abnormal-label {
    font-weight: 400;
    text-decoration: none;
}
.badanie-print-layout select.form-select.abnormal-alert {
    font-weight: 400;
    text-decoration: none;
}
.badanie-options-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}
.badanie-option-touch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    margin: 0;
    min-height: 44px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.badanie-option-touch:hover {
    background: rgba(0, 0, 0, 0.04);
}
.badanie-option-touch input {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    cursor: pointer;
}
/* Bootstrap .form-check .form-check-input ma float + margin-left:-1.5em — wyższa specyficzność niż reguła wyżej */
.badanie-option-touch.form-check .form-check-input {
    float: none;
    margin-left: 0;
    margin-top: 0;
}
.badanie-option-label {
    font-weight: 400;
}
.badanie-scale-inline {
    max-width: 280px;
}
.badanie-scale-val {
    min-width: 1.5rem;
    font-size: 1rem;
}
@media (max-width: 768px) {
    .badanie-table { display: block; }
    .badanie-row { display: block; border-bottom: 1px solid var(--border-light); padding: 0.5rem 0; }
    .badanie-question-cell, .badanie-answer-cell { display: block; width: 100%; padding: 0.25rem 0; }
    .badanie-question-cell { padding-bottom: 0.35rem; border: none; }
}
.conditional-hidden {
    display: none !important;
}

/* --- Baza dashboard (sidebar init) --- */
html.sidebar-collapsed-init #wrapper {
    --sidebar-strip-width: 70px !important;
}
html.sidebar-collapsed-init #sidebar-wrapper {
    width: 70px !important;
    transition: none !important;
}
html.sidebar-collapsed-init #page-content-wrapper {
    transition: none !important;
}
html.sidebar-collapsed-init .sidebar-item-text,
html.sidebar-collapsed-init .sidebar-brand-text {
    display: none !important;
}
html.sidebar-collapsed-init .sidebar-heading .sidebar-brand,
html.sidebar-collapsed-init .sidebar-heading .sidebar-brand i {
    display: none !important;
}
html.sidebar-collapsed-init .section-label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0;
    color: transparent;
    padding: 0.65rem 1rem !important;
    min-height: 2.25rem;
    border-left: none !important;
}
html.sidebar-collapsed-init .section-label::before {
    content: '';
    display: block;
    width: 20px;
    min-width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
}
html.sidebar-collapsed-init #sidebar-wrapper .list-group-item {
    padding: 0.65rem 1rem !important;
    min-height: 2.25rem;
    display: flex !important;
    justify-content: center;
    align-items: center;
    border-left-width: 0 !important;
}
html.sidebar-collapsed-init #sidebar-wrapper .list-group-item i {
    margin-right: 0 !important;
    flex-shrink: 0;
}
html.sidebar-collapsed-init #wrapper,
#wrapper.sidebar-state-loading {
    transition: none !important;
}
#wrapper.sidebar-state-loading #sidebar-wrapper,
#wrapper.sidebar-state-loading #page-content-wrapper {
    transition: none !important;
}

/* --- Edytor ankiet (edytuj_pytania_ankiety) --- */
.add-separator .plus-btn {
    z-index: 101;
    background: #e2e8f0;
    color: #94a3b8 !important;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    box-shadow: none;
    font-size: 0.75rem;
}
.add-separator {
    padding: 8px 0;
    min-height: 24px;
    height: 24px;
    opacity: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.add-separator .insert-menu,
.insert-menu-nested.insert-menu {
    background: transparent;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0.5rem;
    border: none;
    min-width: 280px;
}

/* --- Strona logowania --- */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.login-container {
    max-width: 450px;
    width: 100%;
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}
.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: white;
}
.login-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
    color: white;
}
.login-body {
    padding: 40px 30px;
}
.login-body .form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: normal;
}
.login-body .form-label::first-letter {
    text-transform: none;
}
.login-body .form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    font-size: 0.95rem;
}
/* Nadpisuje globalne .form-control:focus (sekcja FORMULARZE) – /login/ i /admin/login/ */
body.login-page .login-body .form-control:focus,
body.login-page .login-body .form-control:focus-visible {
    border-color: #e0e0e0;
    box-shadow: none;
    outline: none;
    background-color: #fcfcfc;
}
.btn-login {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}
/* Tylko formularz logowania (addon po lewej, pole po prawej) – nie globalnie, bo psuje sufiksy kg/cm itd. */
.login-body .input-group-text {
    background: white;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 10px 0 0 10px;
}
.login-body .input-group .form-control {
    border-left: none;
    border-radius: 0 10px 10px 0;
}
body.login-page .login-body .input-group:focus-within .input-group-text,
body.login-page .login-body .input-group:focus-within .form-control {
    border-color: #e0e0e0;
}
.login-body .alert {
    border-radius: 10px;
    border: none;
    padding: 12px 16px;
}
.login-body .alert-danger {
    background: #fee;
    color: #c33;
}
.security-notice {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-left: 4px solid #667eea;
}
.security-notice i {
    color: #667eea;
    margin-right: 8px;
}

/* ============================================
   STYLE PRZENIESIONE Z SZABLONÓW HTML
   ============================================ */

/* Contenteditable placeholder (dane_pacjenta, send_email_modal) */
#patientEmailBodyPreview:empty::before,
#sendEmailModalBodyPreview:empty::before {
    content: attr(data-placeholder);
    color: var(--bs-secondary);
}

/* Snapshot select – szerokość w Generuj dokumentację */
.doc-snapshot-select {
    width: auto;
    min-width: 180px;
}

/* Email body preview (dane pacjenta) */
.patient-email-body-preview {
    min-height: 100px;
    overflow-y: auto;
    outline: none;
}

/* Approval switch (zatwierdzanie) – wspólny styl */
.approval-switch {
    cursor: pointer;
    width: 3em;
    height: 1.5em;
}

.approval-label {
    cursor: pointer;
    min-width: 120px;
}

/* Filter panel (lista ankiet) */
#filterPanel {
    display: none;
    border-bottom: 1px solid #dee2e6;
}

#toggleFilters {
    cursor: pointer;
}

/* Lista ankiet – filtry i tabela */
.doctor-select { max-width: 100%; }
.filter-btn-compact { font-size: 0.75rem; padding: 0.25rem 0.5rem; }

/* Lista ankiet – przewidywalne szerokości kolumn (tylko ta tabela) */
.table-submissions-list {
    table-layout: fixed;
    width: 100%;
}
/* Ikony statusu / typ — wystarczająco szeroko na bi-square / check-square + padding (ps-3/ps-4) */
.table-submissions-list th.th-icon { width: 3.5rem; min-width: 3.5rem; }
.table-submissions-list tbody td:nth-child(1),
.table-submissions-list tbody td:nth-child(2) {
    overflow: visible;
}
.table-submissions-list th.th-reg { width: 6rem; }
.table-submissions-list th.th-name { width: 5.5rem; }
/* Nazwisko: ~30 znaków bez ellipsis (szerokość „0” w czcionce tabeli) */
.table-submissions-list th.th-surname { width: 30ch; min-width: 30ch; }
.table-submissions-list th.th-born { width: 5.25rem; }
.table-submissions-list th.th-pesel { width: 6rem; }
.table-submissions-list th.th-phone { width: 6rem; }
/* Nagłówki: nowrap + overflow — inaczej tekst z „Miejsce” maluje się na kolumnę „Uwagi” (domyślne overflow: visible). */
.table-submissions-list th.th-place {
    width: 9rem;
    min-width: 8rem;
    max-width: 14rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table-submissions-list th.th-notes {
    width: 4.75rem;
    min-width: 4.75rem;
    max-width: 5.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table-submissions-list td.td-notes {
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
    max-width: 5rem;
}
.table-submissions-list th.th-doctor { width: 10rem; }
/* Jedna linia przycisków D A P Z K B KZ I (~8×28px + szczeliny) */
.table-submissions-list th.th-actions { width: 19rem; }
.table-submissions-list td:last-child {
    overflow: visible;
}

.table-submissions-list td.td-pesel {
    font-variant-numeric: tabular-nums;
}
.table-submissions-list td.td-submission-txt {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-submissions-list td.td-surname {
    min-width: 30ch;
    overflow: visible;
    white-space: nowrap;
}
.table-submissions-list td.td-place {
    min-width: 0;
}
.table-submissions-list .text-truncate-110 {
    max-width: 100%;
    display: inline-block;
    vertical-align: bottom;
}

@media (max-width: 1400px) {
    .table-submissions-list th.th-surname {
        width: 20ch;
        min-width: 20ch;
    }
    .table-submissions-list td.td-surname {
        min-width: 20ch;
    }
}

@media (max-width: 1200px) {
    .table-submissions-list th.th-surname {
        width: 16ch;
        min-width: 16ch;
    }
    .table-submissions-list td.td-surname {
        min-width: 16ch;
    }
    .table-submissions-list th.th-actions {
        width: 17rem;
        min-width: 17rem;
    }
}

/* Survey header logo */
.survey-header-logo img {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
}

/* Edytor pytań ankiety */
.survey-editor-spinner { width: 3rem; height: 3rem; }
.toast-z-index { z-index: 3000; }

/* Szablony maili: toast ostrzeżenia o niezapisanych zmianach (żółte tło) */
.toast-unsaved-warning .toast-body {
    color: #000;
}
.toast-unsaved-warning-close {
    opacity: 1 !important;
    filter: brightness(0);
}
.survey-editor-container { max-width: 900px; }
.drag-handle { cursor: grab; color: #ccc; }
.options-ui-hidden { display: none; }

/* Szablony maili – ikona gradient */
.template-icon-gradient {
    font-size: 0.95rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#email-content-editor {
    min-height: 280px;
    padding: 0.75rem 1rem;
    outline: none;
    line-height: 1.6;
}

#email-content-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Temat wiadomości szablonu maila — jedna linia, kafelki jak treść */
#email-subject-editor.email-subject-editor {
    min-height: calc(1.5em + 1.5rem);
    max-height: 4.5rem;
    overflow-x: auto;
    overflow-y: auto;
    white-space: nowrap;
    padding: 0.75rem 1rem;
    outline: none;
    line-height: 1.5;
}
#email-subject-editor.email-subject-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
#email-subject-editor.email-subject-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--bs-secondary-color, #6c757d);
    opacity: 0.75;
    pointer-events: none;
}
#email-subject-editor .tag-pill {
    display: inline-block;
    padding: 0.15em 0.45em;
    vertical-align: middle;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-weight: inherit;
    font-style: inherit;
    text-decoration: inherit;
    margin: 0 0.08em;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: normal;
}
#email-subject-editor .tag-pill b,
#email-subject-editor .tag-pill strong {
    font-weight: 700 !important;
}
#email-subject-editor .tag-pill i,
#email-subject-editor .tag-pill em {
    font-style: italic !important;
}
#email-subject-editor .tag-pill u {
    text-decoration: underline !important;
}

#email-content-editor .tag-pill {
    display: inline-block;
    padding: 0.2em 0.5em;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-weight: inherit;
    font-style: inherit;
    text-decoration: inherit;
    margin: 0 0.1em;
    font-family: 'Consolas', 'Monaco', monospace;
}
#email-content-editor .tag-pill b,
#email-content-editor .tag-pill strong {
    font-weight: 700 !important;
}
#email-content-editor .tag-pill i,
#email-content-editor .tag-pill em {
    font-style: italic !important;
}
#email-content-editor .tag-pill u {
    text-decoration: underline !important;
}

/* Ustawienia – ikona gradient */
.settings-icon-gradient {
    font-size: 0.95rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Logo preview (ustawienia ankiet) */
.logo-preview {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
}

/* Podgląd globalnej stopki maila */
.email-footer-preview {
    max-width: 400px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Badge gradient (ustawienia) */
.badge-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Ikonowy link otwierania publicznej ankiety bez efektu hover */
.survey-open-icon-link,
.survey-open-icon-link:hover,
.survey-open-icon-link:focus,
.survey-open-icon-link:active,
.survey-open-icon-link:focus-visible,
.survey-open-icon-link.btn:hover,
.survey-open-icon-link.btn:focus,
.survey-open-icon-link.btn:active {
    color: var(--secondary) !important;
    background-color: transparent !important;
    background-image: none !important;
    border-color: var(--secondary) !important;
    box-shadow: none !important;
}

/* Custom card sticky (edytor szablonu maila) */
.custom-card-sticky {
    top: 20px;
    max-height: 85vh;
    overflow-y: auto;
}

/* Przycisk primary (edytor szablonu) */
.btn-template-save {
    background-color: var(--primary);
    border-color: var(--primary);
}

.template-name-input { font-size: 1.1rem; }
.template-name-input-lg { font-size: 1.2rem; }
.summernote-min-height { min-height: 350px; }

/* Hidden content textarea */
.hidden-content-field { display: none; }

/* Send email modal – body preview */
#sendEmailModalBodyPreview {
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    outline: none;
}

/* Karta informacyjna – pola i tabela */
.karta-input-200 { width: 200px; }
.karta-input-flex { flex: 1; min-width: 250px; }

/* Karta informacyjna: przebieg znieczulenia / obserwacja — wyrównanie kolumn w dwóch wierszach */
.karta-anes-dual-grid {
    display: grid;
    grid-template-columns: max-content minmax(200px, 17rem) 1fr;
    gap: 0.5rem 0.75rem;
    align-items: center;
}
.karta-anes-dual-grid > label {
    margin-bottom: 0;
    line-height: 1.2;
}
.karta-anes-dual-grid .input-group {
    max-width: 17rem;
}
.karta-anes-dual-grid .karta-anes-text-input {
    min-width: 0;
}
/* Odstęp nad „Stan przy wypisie” = jak row-gap między wierszami przebiegu/obserwacji */
.karta-info-discharge-row {
    margin-top: 0.5rem;
}
.karta-info-discharge-row > label {
    margin-bottom: 0;
    line-height: 1.2;
}
.karta-input-150 { width: 150px; }
.karta-input-130 { width: 130px; }
.karta-input-100 { width: 100px; }
.karta-th-180 { min-width: 180px; }
.karta-th-120 { min-width: 120px; }
.karta-th-80 { min-width: 80px; }
.karta-th-100 { min-width: 100px; }
.karta-th-40 { width: 40px; }

.karta-mb-250 { width: 250px; }
.vr-30 { height: 30px; }

/* Zgoda – podgląd treści (spacje / wcięcia jak w edytorze) */
.consent-content-min { min-height: 400px; }
.consent-rich-body,
.consent-rich-body p,
.consent-rich-body div {
    white-space: pre-wrap;
    tab-size: 4;
}
.consent-rich-body p { margin-bottom: 0.5rem; }
.consent-rich-body p:last-child { margin-bottom: 0; }
.consent-rich-body ul, .consent-rich-body ol { margin-bottom: 0.5rem; padding-left: 1.25rem; }

/* Ustawienia SMTP */
.smtp-port-input { max-width: 120px; }
.smtp-flex-min { min-width: 200px; }

/* Kwalifikacja */

/* Admin 2FA / backup codes */
.admin-content-narrow { max-width: 480px; margin: 0 auto; }
.admin-content-400 { max-width: 400px; margin: 0 auto; }
.admin-qr-img { max-width: 200px; }
.admin-token-input { width: 100%; padding: 8px; }
.admin-mt-1 { margin-top: 1rem; }
.admin-codes-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}
.admin-codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.admin-code-item {
    padding: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}
.admin-buttons-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.admin-btn-flex { flex: 1; }
.admin-errornote {
    background: #fff3cd;
    color: #856404;
}

.admin-form-row-center {
    text-align: center;
    margin: 1rem 0;
}

/* Login backup codes */
.login-card-narrow { max-width: 480px; }

/* Setup 2FA (surveys) */
.setup-qr-img { max-width: 220px; }

/* Sidebar role icons */
.sidebar-icon-white { color: #fff; }
.sidebar-role-icon { color: #667eea; }
.sidebar-small-text {
    font-size: 0.85rem;
}

/* Approval toast */
.approval-toast-hidden { display: none; }

/* Zarządzaj placówkami */
.placowki-th-notify { width: 150px; }
.placowki-th-actions { min-width: 7.25rem; width: 1%; white-space: nowrap; }
.placowki-switch { cursor: pointer; width: 3rem; height: 1.5rem; }
.form-inline-block { display: inline-block; }

/* Edytuj nagłówki */
.flex-min-200 { min-width: 200px; }

/* Szablony druku */
.doc-type-select { max-width: 220px; }
.doc-order-list { min-height: 60px; }

/* Szablony karty (partial) */
.quick-template-input-group { width: 360px; }
@media (max-width: 767.98px) {
    .quick-template-input-group {
        width: 180px;
        max-width: 100%;
    }
}
/* Moduł szablonu na pasku zakładek — jak .patient-nav .nav-link (biała „zakładka”, górne zaokrąglenia) */
.patient-nav .patient-nav-quick-template-tab {
    width: min(180px, 20vw);
    max-width: 100%;
    max-height: 40px;
    min-height: 0;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: 1px solid #ffffff;
    margin-bottom: -1px;
    position: relative;
    z-index: 10;
    /* 1px góra + 1px dół + 6px padding pion + 32px kontrolki = 40px (border-box) */
    padding: 3px 8px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.patient-nav .patient-nav-quick-template-tab .quick-template-nav-input-group {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}
.patient-nav .patient-nav-quick-template {
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    align-self: flex-end;
}
.patient-nav .quick-template-nav-input-group .form-select.quick-template-select,
.patient-nav .quick-template-nav-input-group .quick-template-manage-btn {
    height: 32px;
    max-height: 32px;
    min-height: 0;
}
.patient-nav .quick-template-nav-input-group .form-select.quick-template-select {
    padding: 0.15rem 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    color: #212529;
    border: none;
    box-shadow: none;
    background-color: transparent;
}
.patient-nav .quick-template-nav-input-group .quick-template-manage-btn {
    padding: 0 0.4rem;
    flex-shrink: 0;
    border-color: #dee2e6;
    background-color: #fff;
}
.patient-nav .quick-template-nav-input-group .quick-template-manage-btn i {
    font-size: 0.8rem;
    line-height: 1;
    color: #495057;
}
.patient-nav .quick-template-nav-input-group .form-select:focus,
.patient-nav .quick-template-nav-input-group .quick-template-manage-btn:focus {
    box-shadow: none;
}
.patient-nav .quick-template-nav-input-group .form-select:focus {
    border: none;
    outline: none;
    box-shadow: none;
}
.patient-nav .quick-template-nav-input-group .form-select.quick-template-select:focus-visible {
    outline: none;
    box-shadow: none;
}
.patient-nav .quick-template-nav-input-group .form-select.quick-template-select:active {
    background-color: transparent;
    border: none;
    box-shadow: none;
    color: #212529;
    filter: none;
}
.quick-template-input-group:not(.quick-template-nav-input-group) .form-select.quick-template-select:active {
    border-color: var(--border-color);
    background-color: #fcfcfc;
    box-shadow: none;
    color: var(--bs-body-color);
    filter: none;
}
.quick-template-select { cursor: pointer; }
.quick-template-input-group .form-select.quick-template-select,
.quick-template-input-group .quick-template-manage-btn {
    height: 39px;
    max-height: 39px;
    min-height: 0;
    box-sizing: border-box;
}
.quick-template-input-group .form-select.quick-template-select {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    line-height: 1.25;
    font-size: 0.875rem;
}
/* Przycisk ołówka — Bootstrap 5 używa --bs-btn-hover-*; bez tego hover nadal „wypełnia” przycisk */
.quick-template-manage-btn.btn-outline-secondary {
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: var(--bs-secondary);
    --bs-btn-hover-color: var(--bs-secondary);
    --bs-btn-active-bg: transparent;
    --bs-btn-active-border-color: var(--bs-secondary);
    --bs-btn-active-color: var(--bs-secondary);
}
.template-name-truncate { max-width: 200px; }
.template-label-small { font-size: 0.7rem; }

/* Modal zarządzania szablonami karty — zakładki w kolorach aplikacji (zamiast domyślnego niebieskiego Bootstrap) */
#templateModal .template-modal-tabs .nav-link {
    color: var(--primary);
    background-color: transparent;
    border: none;
}
#templateModal .template-modal-tabs .nav-link:hover:not(.active) {
    color: var(--primary-hover);
    background-color: var(--primary-light);
    border: none;
}
#templateModal .template-modal-tabs .nav-link.active {
    background: var(--primary-gradient) !important;
    color: #fff !important;
    border: none;
}
#templateModal .template-load-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    font-size: 1.1rem;
    line-height: 1;
    border: 0;
    box-shadow: none;
    text-decoration: none;
    color: var(--primary) !important;
}
#templateModal .template-load-btn i {
    color: inherit;
}
#templateModal .template-load-btn:hover,
#templateModal .template-load-btn:focus {
    color: var(--primary-hover) !important;
    background: transparent !important;
    text-decoration: none;
}

/* Edytuj nagłówki – miniatury */
.thumb-img-cover { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder-min { min-height: 100%; }

/* ——— Czytelność wartości pól (karty pacjenta, Ustawienia ogólne) ——— */
body.patient-card-layout.patient-card-readable-baseline input.form-control:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body.patient-card-layout.patient-card-readable-baseline textarea.form-control,
body.patient-card-layout.patient-card-readable-baseline select.form-select,
body.patient-card-layout.patient-card-readable-baseline [contenteditable="true"].form-control,
body.patient-card-layout.patient-card-readable-baseline #recAdditionalEditor[contenteditable="true"],
body.patient-card-layout.patient-card-readable-baseline .patient-email-body-preview[contenteditable="true"],
body.patient-card-layout.patient-card-readable-baseline #sendEmailModalBodyPreview[contenteditable="true"],
body.patient-card-layout.patient-card-readable-baseline .qa-answer {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--bs-body-color);
}

body.patient-card-layout.patient-card-readable-enhanced input.form-control:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body.patient-card-layout.patient-card-readable-enhanced textarea.form-control,
body.patient-card-layout.patient-card-readable-enhanced select.form-select,
body.patient-card-layout.patient-card-readable-enhanced [contenteditable="true"].form-control,
body.patient-card-layout.patient-card-readable-enhanced #recAdditionalEditor[contenteditable="true"],
body.patient-card-layout.patient-card-readable-enhanced .patient-email-body-preview[contenteditable="true"],
body.patient-card-layout.patient-card-readable-enhanced #sendEmailModalBodyPreview[contenteditable="true"],
body.patient-card-layout.patient-card-readable-enhanced .qa-answer {
    font-size: 0.95rem;
    font-weight: 500;
    color: #000;
}

/* Quick „Szablon” (karta informacyjna): bez powiększenia mimo włączonej czytelności */
body.patient-card-layout.patient-card-readable-enhanced select.form-select.quick-template-select {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--bs-body-color);
}

/* Dane pacjenta: temat maila, podgląd treści, modal wysyłki, „Generuj dokumentację” — baseline przy włączonej czytelności */
body.patient-card-layout.patient-card-readable-enhanced #patientEmailForm input.form-control[name="email_subject"],
body.patient-card-layout.patient-card-readable-enhanced #sendEmailModalForm input.form-control[name="email_subject"],
body.patient-card-layout.patient-card-readable-enhanced #patientEmailBodyPreview.patient-email-body-preview,
body.patient-card-layout.patient-card-readable-enhanced #sendEmailModalBodyPreview[contenteditable="true"],
body.patient-card-layout.patient-card-readable-enhanced .doc-gen-list select.form-select {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--bs-body-color);
}
