/* ===================================
   EURUŚ DASHBOARD - NEXT-GEN MEDICAL UI (2026)
   Style: Sophisticated, Mature, Ultra-Readable
   =================================== */

:root {
    /* 2026 Sophisticated Color Palette */
    --primary-blue: #2c2e4a; /* Navy blue from euromed.tarnow.pl header */
    --primary-blue-light: #f0f4f8;
    --primary-blue-dark: #1a1c2e;

    --accent-blue: #0089cf; /* Light blue from euromed.tarnow.pl logo/buttons */
    --accent-orange: #FF6B35; /* Coral Orange */
    --accent-orange-soft: rgba(255, 107, 53, 0.1);

    /* Neutral Palette - 2026 "Soft UI" */
    --grey-50: #F9FAFB;
    --grey-100: #F3F4F6;
    --grey-200: #E5E7EB;
    --grey-300: #D1D5DB;
    --grey-400: #9CA3AF;
    --grey-500: #6B7280;
    --grey-600: #4a4f59;
    --grey-700: #374151;
    --grey-800: #1F2937;
    --grey-900: #111827;

    /* Semantic Colors */
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: var(--primary-blue);

    /* Czas pracy (RCP) – czytelność dla rejestratorek */
    --remaining-neutral: #6B7280;   /* Pozostało: szary gdy norma do zrobienia (nie wygląda jak błąd) */
    --remaining-urgent: #DC2626;    /* Czerwony tylko gdy mało czasu (< 30 min) */
    --remaining-ok: #10B981;       /* Nadgodziny / norma zrobiona */

    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-card: #FFFFFF;

    /* 2026 "Glass & Soft" Shadows - Lightened */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border */
    --border-color: var(--grey-200);
    --border-radius: 12px; /* More rounded for 2026 */
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Glassmorphism – piękny, spójny zestaw */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bg-strong: rgba(255, 255, 255, 0.82);
    --glass-bg-subtle: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.75);
    --glass-border-strong: rgba(255, 255, 255, 0.95);
    --glass-blur: 14px;
    --glass-blur-strong: 24px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --glass-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --glass-inner: 0 1px 0 0 rgba(255, 255, 255, 0.8) inset;
    /* Przyciski w stylu glass – jeden border-radius wszędzie */
    --glass-btn-radius: 10px;
    --glass-btn-bg: rgba(255, 255, 255, 0.35);
    --glass-btn-border: rgba(255, 255, 255, 0.65);
    --glass-btn-blur: blur(14px) saturate(1.2);
    --glass-btn-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 1px rgba(0, 137, 207, 0.1), 0 4px 16px rgba(0, 0, 0, 0.06);
    --glass-btn-shadow-hover: 0 1px 0 0 rgba(255, 255, 255, 1) inset, 0 0 0 1px rgba(0, 137, 207, 0.18), 0 6px 20px rgba(0, 0, 0, 0.08);

    /* Glass primary / success / danger – spójne z kartami */
    --glass-primary-bg: rgba(0, 137, 207, 0.28);
    --glass-primary-border: rgba(255, 255, 255, 0.6);
    --glass-primary-text: #006399;
    --glass-primary-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.7) inset, 0 0 0 1px rgba(0, 137, 207, 0.2), 0 4px 20px rgba(0, 137, 207, 0.15);
    --glass-success-bg: rgba(16, 185, 129, 0.28);
    --glass-success-border: rgba(255, 255, 255, 0.6);
    --glass-success-text: #047857;
    --glass-success-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.7) inset, 0 0 0 1px rgba(16, 185, 129, 0.25), 0 4px 20px rgba(16, 185, 129, 0.12);
    --glass-danger-bg: rgba(239, 68, 68, 0.2);
    --glass-danger-border: rgba(255, 255, 255, 0.5);
    --glass-danger-text: #B91C1C;
    --glass-danger-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.6) inset, 0 0 0 1px rgba(239, 68, 68, 0.2), 0 4px 20px rgba(239, 68, 68, 0.1);
    --glass-neutral-bg: rgba(241, 245, 249, 0.7);
    --glass-neutral-border: rgba(255, 255, 255, 0.8);
    --glass-neutral-text: var(--grey-600);

    /* Typography - Inter is the 2026 standard */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Optymalne wagi (NIE używaj 300 Light – za słabe dla małych rozmiarów) */
    --fw-regular: 400;   /* Regular - tekst główny */
    --fw-medium: 500;   /* Medium - przyciski, akcenty */
    --fw-semibold: 600; /* SemiBold - nagłówki */

    /* Komfort wielogodzinny – czytelność (punkty 1–2) */
    --text-body-size: 15px;
    --text-body-line: 1.55;
    --text-content-min: 0.95rem;   /* min. dla treści (wiadomości, opisy) */
    --text-label-min: 0.85rem;     /* etykiety, metadane */
    --dashboard-max-width: 1520px;  /* stała szerokość na dużych ekranach */

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles – baza pod wielogodzinną pracę */
body {
    font-family: var(--font-main);
    font-weight: var(--fw-regular); /* 400 - tekst główny */
    color: var(--grey-800);
    background: var(--bg-body);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Tło – neutralne, wysoki kontrast dla kart i tekstu (czytelność).
   background-attachment: scroll – mniej artefaktów przy przewijaniu i szybsze rysowanie. */
.dashboard-container {
    padding: 0.75rem 0;
    min-height: 100vh;
    background: linear-gradient(160deg, #E8EEF4 0%, #F1F5F9 35%, #F8FAFC 70%, #EEF2F7 100%);
    background-attachment: scroll;
    position: relative;
    isolation: isolate;
}

.dashboard-container::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 120% 60% at 50% 0%, rgba(241, 245, 249, 0.9) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 80% 100%, rgba(226, 232, 240, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 20% 90%, rgba(248, 250, 252, 0.6) 0%, transparent 45%);
}
.dashboard-container > .container {
    position: relative;
    z-index: 1;
    max-width: var(--dashboard-max-width);
    margin-left: auto;
    margin-right: auto;
}

/* Modal nad backdrop – naprawa z-index (kontener ma z-index: 1, backdrop Bootstrap 1050) */
body.modal-open .dashboard-container {
    position: relative;
    z-index: 1051;
}

/* ===================================
   NAVBAR GLASS – tylko na stronie pulpitu
   =================================== */
body:has(.dashboard-container) .navbar.bg-dark {
    background: #0d8abc !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1030;
}
body:has(.dashboard-container) .navbar .navbar-nav.ms-auto {
    flex-wrap: nowrap;
}
/* Dropdown nad sąsiednimi linkami (Rejestry, Raporty, itd.) */
body:has(.dashboard-container) .navbar .nav-item.dropdown {
    position: relative;
}
body:has(.dashboard-container) .navbar .nav-item.dropdown.show {
    z-index: 1040;
}
body:has(.dashboard-container) .navbar .dropdown-menu {
    z-index: 1050;
}
body:has(.dashboard-container) .navbar .nav-link {
    color: rgba(255, 255, 255, 0.92) !important;
    padding: 0.5rem 1.25rem !important;
}
body:has(.dashboard-container) .navbar .nav-link:hover,
body:has(.dashboard-container) .navbar .nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-sm);
}
/* User label – ten sam styl co nav-link (desktop) */
body:has(.dashboard-container) .navbar .navbar-user-label {
    padding: 0.5rem 1.25rem !important;
    color: rgba(255, 255, 255, 0.92) !important;
}
/* Form wyloguj – inline na desktop */
body:has(.dashboard-container) .navbar .navbar-logout-form {
    display: inline;
    margin: 0;
}
/* Ten sam hover dla nazwy usera i Wyloguj – nadpisanie stylów btn-link */
body:has(.dashboard-container) .navbar .navbar-nav.ms-auto .nav-link:hover,
body:has(.dashboard-container) .navbar .navbar-nav.ms-auto .nav-link:focus,
body:has(.dashboard-container) .navbar .navbar-nav.ms-auto .navbar-user-label:hover,
body:has(.dashboard-container) .navbar .navbar-nav.ms-auto button.nav-link:hover,
body:has(.dashboard-container) .navbar .navbar-nav.ms-auto button.nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--border-radius-sm);
    text-decoration: none !important;
}
body:has(.dashboard-container) .navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
}
body:has(.dashboard-container) .navbar .dropdown-menu {
    background: #fff;
    border: 1px solid var(--glass-border-strong);
    box-shadow: var(--glass-shadow-lg);
    border-radius: var(--border-radius-sm);
}
body:has(.dashboard-container) .navbar .dropdown-item:hover {
    background: var(--primary-blue-light);
}

/* Navbar brand icon */
body:has(.dashboard-container) .navbar .navbar-brand-icon {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.95);
    flex-shrink: 0;
}

/* Navbar toggler – custom Lucide icon (hide Bootstrap default) */
body:has(.dashboard-container) .navbar .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}
body:has(.dashboard-container) .navbar .navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}
body:has(.dashboard-container) .navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
    outline: none;
}
body:has(.dashboard-container) .navbar .navbar-toggler .navbar-toggler-icon-custom,
body:has(.dashboard-container) .navbar .navbar-toggler [data-lucide] {
    width: 24px;
    height: 24px;
    color: #fff;
}

/* Mobile – collapsed menu */
@media (max-width: 991.98px) {
    body:has(.dashboard-container) .navbar .navbar-collapse {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.25);
    }
    body:has(.dashboard-container) .navbar .navbar-nav {
        flex-direction: column;
        align-items: stretch;
    }
    body:has(.dashboard-container) .navbar .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        min-height: 48px;
        display: flex !important;
        align-items: center;
        border-radius: var(--border-radius-sm);
        margin-bottom: 0.25rem;
    }
    body:has(.dashboard-container) .navbar .navbar-nav.ms-auto {
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    body:has(.dashboard-container) .navbar .navbar-nav.ms-auto .nav-item {
        margin-bottom: 0.25rem;
    }
    /* Damian Romek i Wyloguj – ten sam rozmiar co Panel/Dokumenty */
    body:has(.dashboard-container) .navbar .navbar-nav.ms-auto .nav-link,
    body:has(.dashboard-container) .navbar .navbar-nav.ms-auto .navbar-user-label {
        padding: 0.75rem 1rem !important;
        min-height: 48px;
        display: flex !important;
        align-items: center;
        margin-bottom: 0;
    }
    /* Form pełna szerokość – przycisk rozciąga się jak linki */
    body:has(.dashboard-container) .navbar .navbar-logout-form {
        display: block !important;
        width: 100%;
        margin: 0;
    }
    body:has(.dashboard-container) .navbar .navbar-logout-item .navbar-logout-form {
        margin: 0;
    }
    body:has(.dashboard-container) .navbar .navbar-nav.ms-auto button.nav-link {
        width: 100%;
        min-height: 48px;
        padding: 0.75rem 1rem !important;
        justify-content: flex-start;
        cursor: pointer;
    }
}

/* ===================================
   ANIMATIONS - 2026 Pulse & Blink
   =================================== */

@keyframes pulse-orange {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
}

@keyframes blink-soft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

.pulse-new {
    animation: pulse-orange 2s infinite;
    border: 4px solid var(--accent-orange) !important;
}

.blink-new, .blink_me {
    animation: blink-soft 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .pulse-new,
    .blink-new, .blink_me,
    .glass-counter-unread--has-unread,
    .modern-progress-bar::before,
    .modern-progress-bar.completed,
    .modern-progress-bar.overtime,
    .eurobook-card-new,
    .refresh-indicator.syncing,
    .sync-status-indicator.status-ok,
    .sync-status-indicator.status-error {
        animation: none !important;
    }
}

/* ===================================
   CARDS - 2026 Glassmorphism + Soft Glass
   =================================== */

.modern-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    margin-bottom: 2.75rem;
    isolation: isolate;
}

.modern-card:hover {
    box-shadow: var(--glass-shadow-lg), var(--glass-inner);
    border-color: rgba(255, 255, 255, 1);
}

/* Badge w kartach – spójne z glass (delikatne tło, jasna obwódka) */
.dashboard-container .modern-card .badge.bg-success {
    background: rgba(16, 185, 129, 0.28) !important;
    color: #047857 !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--glass-btn-radius);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.4) inset;
}
.dashboard-container .modern-card .badge.bg-danger {
    background: rgba(239, 68, 68, 0.22) !important;
    color: #B91C1C !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--glass-btn-radius);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.35) inset;
}

/* Nagłówek karty – lekki glassmorphism, przezroczysty i miękki */
.modern-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--grey-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--grey-50);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    position: relative;
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.8) inset;
}

/* Removed the top accent line for maximum lightness */
.modern-card-header::before {
    display: none;
}

.modern-card-header h4 {
    margin: 0;
    font-weight: var(--fw-semibold);
    font-size: 1.12rem;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    letter-spacing: -0.01em;
}

.modern-card-header .btn-modern-outline {
    border-color: var(--grey-200);
    color: var(--grey-600);
    background: transparent;
    box-shadow: 0 4px 12px rgba(0, 137, 207, 0);
}

.modern-card-header .btn-modern-outline:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.modern-card-header h4 i, .modern-card-header h4 svg {
    color: var(--accent-blue) !important; /* Light blue icons for a fresh look */
}

.modern-card-body {
    padding: 1.75rem;
}

/* Zwijane sekcje – Zadania, Komunikaty; rozwinięcie na auto (duża max-height, nie urywa ostatniej wiadomości) */
.dashboard-section-collapsible .modern-card-body {
    transition: max-height 0.45s ease, padding 0.3s ease, opacity 0.25s ease;
    overflow: hidden;
}
.dashboard-section-collapsible.collapsed .modern-card-body {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    pointer-events: none;
}
/* Szklany licznik wiadomości do przeczytania – miga na czerwono gdy > 0 */
.glass-counter-unread {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: var(--fw-semibold);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--grey-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 0 0 rgba(255, 255, 255, 0.6) inset;
    color: var(--grey-700);
    transition: var(--transition);
}
.glass-counter-unread__value {
    min-width: 1.25em;
    text-align: center;
}
.glass-counter-unread__label {
    font-weight: var(--fw-medium);
    font-size: 0.8rem;
    color: var(--grey-600);
}
.glass-counter-unread--has-unread {
    background: rgba(254, 226, 226, 0.75);
    border-color: rgba(239, 68, 68, 0.35);
    color: #B91C1C;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.15), 0 1px 0 0 rgba(255, 255, 255, 0.5) inset;
    animation: glass-counter-blink 2s ease-in-out infinite;
}
.glass-counter-unread--has-unread .glass-counter-unread__label {
    color: #991B1B;
}
@keyframes glass-counter-blink {
    0%, 100% { box-shadow: 0 2px 10px rgba(239, 68, 68, 0.15), 0 1px 0 0 rgba(255, 255, 255, 0.5) inset; opacity: 1; }
    50%  { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25), 0 2px 12px rgba(239, 68, 68, 0.2); opacity: 0.92; }
}

/* Przyciski zwijania – bez backdrop-filter (mniej glitchy) */
.dashboard-section-collapsible .dashboard-section-toggle {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding: 0.45rem 0.6rem;
    margin: -0.25rem 0.25rem -0.25rem -0.25rem;
    border-radius: var(--glass-btn-radius);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--glass-btn-border);
    box-shadow: var(--glass-btn-shadow);
    color: var(--accent-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
}
.dashboard-section-collapsible .dashboard-section-toggle:hover {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: var(--glass-btn-shadow-hover);
    color: #006399;
}
.dashboard-section-collapsible .dashboard-section-toggle:active {
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 137, 207, 0.15) inset;
}
.dashboard-section-collapsible .dashboard-section-toggle i,
.dashboard-section-collapsible .dashboard-section-toggle svg {
    transition: transform 0.25s ease;
    color: inherit;
    stroke: currentColor;
}
.dashboard-section-collapsible.collapsed .dashboard-section-toggle i,
.dashboard-section-collapsible.collapsed .dashboard-section-toggle svg {
    transform: rotate(-90deg);
}

/* Przyciski na belce Zadania / Komunikaty – wtopione w belkę, nie rzucają się w oczy */
.modern-card-header--with-actions .btn-glass,
.modern-card-header .btn-glass,
.modern-card-header .btn-modern-outline.btn-glass {
    border-radius: var(--glass-btn-radius) !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: none !important;
    color: var(--grey-500) !important;
}
.modern-card-header--with-actions .btn-glass:hover,
.modern-card-header .btn-glass:hover,
.modern-card-header .btn-modern-outline.btn-glass:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: none !important;
    color: var(--grey-700) !important;
}
.modern-card-header .btn-glass i,
.modern-card-header .btn-glass svg {
    color: inherit !important;
    stroke: currentColor;
}

/* ===================================
   TABLES - Ultra Readable
   =================================== */

.table-responsive {
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table thead th {
    background: var(--grey-50);
    padding: 1rem;
    font-weight: 600;
    color: var(--grey-600);
    font-size: max(var(--text-label-min), 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--grey-200);
}

.modern-table tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--grey-100);
    transition: var(--transition);
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

.modern-table tbody tr:hover td {
    background: var(--primary-blue-light);
}

/* ===================================
   TASKS & MESSAGES - 2026 Maturity
   =================================== */

.task-card, .message-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--grey-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
    position: relative;
}

.task-card:hover, .message-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.task-card.assigned-to-me, .message-card.unread {
    background: #FFFBF9;
    border-left: 4px solid var(--accent-orange);
}

@keyframes pulse-message {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.3);
        transform: translateX(0);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.1);
        transform: translateX(2px);
    }
}

.task-title, .message-title {
    font-weight: var(--fw-semibold); /* 600 - nagłówki */
    font-size: 1.05rem;
    color: var(--grey-900);
    margin-bottom: 0.5rem;
}

.task-content, .message-content {
    color: var(--grey-700);
    font-size: max(var(--text-content-min), 0.95rem);
    line-height: 1.6;
}

/* Images in message content - responsive & clickable */
.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin: 0.75rem 0;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--grey-200);
}

.message-content img:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

/* Tables in message content - responsive */
.message-content table {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0.75rem 0;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
}

.message-content table thead {
    background: var(--grey-50);
}

.message-content table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--grey-700);
    border-bottom: 2px solid var(--grey-200);
    white-space: nowrap;
}

.message-content table td {
    padding: 0.75rem;
    color: var(--grey-700);
    border-bottom: 1px solid var(--grey-100);
    vertical-align: top;
}

.message-content table tbody tr:hover {
    background: var(--primary-blue-light);
}

.message-content table tbody tr:last-child td {
    border-bottom: none;
}

/* Fix for DataTables in message content */
.message-content table.dataTable {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Make table scrollable on mobile */
@media (max-width: 768px) {
    .message-content table {
        font-size: 0.8125rem;
    }

    .message-content table th,
    .message-content table td {
        padding: 0.5rem;
    }
}

/* ===================================
   BADGES & BUTTONS
   =================================== */

/* Badge – stałe tło (bez backdrop-filter) */
.stats-badge {
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    color: var(--grey-700);
    border: 1px solid var(--grey-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 0 0 rgba(255, 255, 255, 0.6) inset;
}
.stats-badge-primary {
    background: rgba(0, 137, 207, 0.2);
    color: var(--accent-blue);
    border-color: rgba(0, 137, 207, 0.35);
    box-shadow: 0 2px 8px rgba(0, 137, 207, 0.12), 0 1px 0 0 rgba(255, 255, 255, 0.5) inset;
}
.stats-badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #065F46;
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1), 0 1px 0 0 rgba(255, 255, 255, 0.5) inset;
}
.stats-badge-secondary {
    background: var(--glass-bg-strong);
    color: var(--grey-700);
    border-color: var(--glass-border-strong);
}
.stats-badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #92400E;
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1), 0 1px 0 0 rgba(255, 255, 255, 0.5) inset;
}
.stats-badge-info {
    background: rgba(30, 64, 175, 0.12);
    color: #1E40AF;
    border-color: rgba(30, 64, 175, 0.25);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08), 0 1px 0 0 rgba(255, 255, 255, 0.5) inset;
}

/* Przyciski – styl Polka w /assets/css/polka.css (wspólny dla dashboard, login, całej aplikacji) */

/* High contrast for unread badges */
.badge-unread {
    background: #E11D48 !important;
    color: #FFFFFF !important;
    font-weight: 700 !important; /* Bold - mocny akcent, bez 800 */
    padding: 0.35rem 0.7rem !important;
    border-radius: 50px !important;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.2);
}

.comments-count.bg-light {
    background-color: #BE123C !important;
    color: #FFFFFF !important;
    font-weight: 700;
}

/* ===================================
   USER PROFILE 2026
   =================================== */

.user-profile-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.user-avatar {
    width: 110px;
    height: 110px;
    border-radius: 30%; /* Squircle for 2026 */
    object-fit: cover;
    border: 4px solid #FFF;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.user-name {
    font-weight: var(--fw-semibold); /* 600 - nagłówek profilu */
    font-size: 1.4rem;
    color: var(--grey-900);
    margin-bottom: 0.25rem;
}

/* ===================================
   UTILITIES
   =================================== */

.icon-sm { width: 18px; height: 18px; }
.icon-md { width: 22px; height: 22px; }

.text-muted {
    color: var(--grey-600) !important;
    font-size: max(var(--text-label-min), 0.8125rem) !important;
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    .dashboard-container { padding: 1.5rem 0; }
    .modern-card { margin-bottom: 1.5rem; }
}

/* ===================================
   AVATAR GROUP - Fixed & Enhanced
   =================================== */

.avatar-group {
    display: flex;
    align-items: center;
    padding-left: 8px;
}

.avatar-group img {
    width: 32px;
    height: 32px;
    border-radius: 30%; /* Squircle */
    border: 2px solid #FFF;
    margin-left: -10px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
    background: #FFF;
}

.avatar-group img:hover {
    transform: translateY(-4px) scale(1.1);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

/* ===================================
   CHAT SYSTEM - 2026 Odświeżony wygląd
   =================================== */

.chat-card .modern-card-body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chat-card-body {
    min-height: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

/* Chat domyślnie zwinięty – tylko belka z ikoną rozwiń */
.chat-card-collapsible.collapsed .chat-card-body {
    max-height: 0 !important;
    min-height: 0 !important;
    overflow: hidden;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.chat-card-collapsible.collapsed .chat-card-chevron {
    transform: rotate(-90deg);
}
.chat-card-collapsible .chat-card-chevron {
    transition: transform 0.3s ease;
}
.chat-card-collapsible .chat-card-toggle {
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--grey-500);
}
.chat-card-collapsible .chat-card-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
    color: var(--grey-700);
}

.chat-card {
    min-height: 0;
}
.chat-card-collapsible:not(.collapsed) .chat-card {
    min-height: 280px;
}

.chat-messages {
    background: linear-gradient(180deg, var(--grey-50) 0%, #ffffff 100%);
    max-height: 320px;
    min-height: 140px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1.25rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--grey-300) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--grey-300);
    border-radius: 10px;
}

.chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    gap: 0.75rem;
    color: var(--grey-500);
}

.chat-loading-text {
    font-size: 0.875rem;
    margin: 0;
}

.chat-message {
    margin-bottom: 1rem;
    animation: chat-message-in 0.25s ease-out;
}

@keyframes chat-message-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message .chat-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
    max-width: 100%;
}

.chat-message-sent .chat-row {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

.chat-message-bubble-wrap {
    max-width: 78%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-message-received .chat-message-bubble-wrap {
    align-items: flex-start;
}

.chat-sender-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--grey-500);
    margin-bottom: 0.2rem;
    padding-left: 0.25rem;
}

.chat-message-sent .chat-sender-name {
    padding-left: 0;
    padding-right: 0.25rem;
}

.chat-bubble {
    max-width: 100%;
    min-width: 0;
    padding: 0.65rem 1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    position: relative;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Obrazki w bąbelku czatu – nie przycinane */
.chat-bubble img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    margin: 0.5rem 0 0;
    border: none;
    vertical-align: middle;
}

.chat-bubble img:first-child {
    margin-top: 0;
}

.chat-message-received .chat-bubble {
    background: #fff;
    color: var(--grey-800);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--grey-200);
}

.chat-message-sent .chat-bubble {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 137, 207, 0.25);
}

/* Tylko wewnątrz karty czatu – żeby nie wpływać na .message-meta w komunikatach firmowych */
.chat-card .chat-meta {
    font-size: 0.7rem;
    margin-top: 0.35rem;
    color: var(--grey-500);
}

.chat-card .chat-message-received .chat-meta {
    color: white;
}

.chat-card .chat-message-sent .chat-meta {
    color: rgba(255, 255, 255, 0.92);
}

.chat-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--grey-500);
    margin: 0.5rem 0 1rem;
    padding: 0.25rem 0;
    white-space: nowrap;
    width: 100%;
    flex-shrink: 0;
}

/* Obszar wpisywania wiadomości – stałe tło (bez backdrop-filter) */
.chat-input-area {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--grey-200);
    background: var(--grey-50);
    box-shadow: 0 -1px 0 0 rgba(255, 255, 255, 0.5) inset;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
    min-height: 0;
}

.chat-input-area .message-text {
    min-height: 52px;
}

.message-text {
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--grey-200);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
    resize: none;
    font-family: var(--font-main);
}

.message-text:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 137, 207, 0.15);
    outline: none;
}

.chat-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
}

/* Responsywność czatu */
@media (max-width: 768px) {
    .chat-messages {
        max-height: 280px;
        min-height: 160px;
        padding: 0.75rem 1rem;
    }

    .chat-bubble {
        max-width: 90%;
        padding: 0.55rem 0.85rem;
        font-size: 0.875rem;
    }

    .chat-message-bubble-wrap {
        max-width: 85%;
    }
}

/* ===================================
   COMMENTS SECTION - 2026 Style
   =================================== */

.comments-section {
    background: #fff;
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    border: 1px solid var(--grey-200);
}

.comment-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 30%; /* Squircle */
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #FFF;
    box-shadow: var(--shadow-sm);
}

.comment-content {
    background: #FFFFFF;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    border-top-left-radius: 2px;
    border: 1px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    flex-grow: 1;
}

.comment-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--grey-900);
    margin-right: 0.5rem;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--grey-400);
}

.comment-text {
    font-size: 0.9rem;
    color: var(--grey-700);
    line-height: 1.5;
    margin-top: 0.25rem;
}

.comment-input {
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--grey-200);
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.comment-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px var(--primary-blue-light);
    outline: none;
}

/* ===================================
   PROGRESS BAR - RCP (Enhanced 2026)
   =================================== */

.modern-progress {
    height: 40px;
    background: linear-gradient(to right, #f0f4f8 0%, #e8eef4 100%);
    border-radius: 20px;
    overflow: visible;
    position: relative;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.06), 0 1px 0 0 rgba(255, 255, 255, 0.4) inset;
    border: 1px solid var(--grey-200);
}

/* Tekst procentu w środku paska – czytelny przy 40px wysokości */
.modern-progress #progressPercent {
    font-size: 0.9rem;
    font-weight: 700;
}

.modern-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #EF4444 0%, #F87171 50%, #FCA5A5 100%);
    border-radius: 16px;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 0 20px rgba(239, 68, 68, 0.4),
        0 2px 8px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

/* Animated shine effect on progress bar */
.modern-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.4) 50%,
    transparent 100%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* Progress bar states based on percentage */
.modern-progress-bar[style*="width: 0"],
.modern-progress-bar.not-started {
    background: var(--grey-300);
    box-shadow: none;
}

/* Starting (0-50%) - neutral grey when 0%, red gradient when > 0% (see default above) */

/* In progress (50-89%) - orange/yellow transition */
.modern-progress-bar.in-progress {
    background: linear-gradient(90deg, #F59E0B 0%, #FBBF24 50%, #FCD34D 100%);
    box-shadow:
        0 0 20px rgba(245, 158, 11, 0.5),
        0 2px 8px rgba(245, 158, 11, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* When near completion (90%+) - green glow */
.modern-progress-bar.near-complete {
    background: linear-gradient(90deg, #10B981 0%, #34D399 50%, #6EE7B7 100%);
    box-shadow:
        0 0 20px rgba(16, 185, 129, 0.5),
        0 2px 8px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Norm completed (100%) - vibrant green with celebration */
.modern-progress-bar.completed {
    background: linear-gradient(90deg, #10B981 0%, #34D399 50%, #10B981 100%);
    box-shadow:
        0 0 25px rgba(16, 185, 129, 0.7),
        0 4px 12px rgba(16, 185, 129, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.4);
    animation: pulse-completed 2s ease-in-out infinite;
}

@keyframes pulse-completed {
    0%, 100% {
        opacity: 1;
        box-shadow:
            0 0 25px rgba(16, 185, 129, 0.7),
            0 4px 12px rgba(16, 185, 129, 0.5),
            inset 0 1px 0 rgba(255,255,255,0.4);
    }
    50% {
        opacity: 0.95;
        box-shadow:
            0 0 35px rgba(16, 185, 129, 0.9),
            0 4px 16px rgba(16, 185, 129, 0.6),
            inset 0 1px 0 rgba(255,255,255,0.4);
    }
}

/* Overtime - orange glow */
.modern-progress-bar.overtime {
    background: linear-gradient(90deg, #FF6B35 0%, #FF8C42 50%, #FFB380 100%);
    box-shadow:
        0 0 20px rgba(255, 107, 53, 0.5),
        0 2px 8px rgba(255, 107, 53, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
    animation: pulse-progress 2s ease-in-out infinite;
}

@keyframes pulse-progress {
    0%, 100% {
        opacity: 1;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.9;
        transform: scaleY(1.05);
    }
}

/* ===================================
   TASK CARD REDESIGN - 2026
   =================================== */

.task-card {
    padding: 1.5rem !important;
    border: 1px solid var(--grey-200);
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.task-title {
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.task-content {
    line-height: 1.5;
    color: var(--grey-600);
}

.task-footer {
    border-top: 1px solid var(--grey-100);
}

.status-badge .badge {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.icon-xs {
    width: 14px;
    height: 14px;
}

.task-actions .btn {
    padding: 0.4rem;
    border-radius: 8px;
}

/* ===================================
   CATEGORY FILTERS - 2026
   =================================== */

/* ===================================
   CATEGORY BUTTONS – ten sam glass i border-radius
   =================================== */

/* Bez backdrop-filter – przyciski kategorii (Wszystkie, ikony) – zapobiega glitchom przy ruchu kursora */
.btn-category {
    border-radius: var(--glass-btn-radius);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-btn-border);
    color: var(--grey-600);
    padding: 0.6rem 1rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--glass-btn-shadow);
}

.btn-category:hover {
    border-color: rgba(255, 255, 255, 0.85);
    color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--glass-btn-shadow-hover);
}

.btn-category.active {
    background: rgba(0, 137, 207, 0.38) !important;
    color: var(--glass-primary-text) !important;
    border-color: var(--glass-primary-border) !important;
    border-radius: var(--glass-btn-radius);
    box-shadow: var(--glass-primary-shadow);
}

.btn-category.active:hover {
    background: rgba(0, 137, 207, 0.48) !important;
    color: #005a8c !important;
}

.btn-category.active i, .btn-category.active svg {
    color: inherit !important;
    stroke: currentColor !important;
}

/* Komunikaty – filtry kategorii zwarte, mniej rzucające się w oczy */
.message-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.message-category-filters .btn-category {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    min-width: auto;
}
.message-category-filters .btn-category .icon-sm,
.message-category-filters .btn-category i,
.message-category-filters .btn-category svg {
    width: 0.9rem;
    height: 0.9rem;
}
.message-category-filters .btn-category:hover {
    transform: none;
}

/* ===================================
   EUROWIZYTA BOOKINGS - CARD LAYOUT
   =================================== */

/* Grid container – 1 szerokie zgłoszenie, reszta rozwijana (każda karta pełna szerokość) */
.eurobooks-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Card styling – glass */
.eurobook-card {
    background: var(--bg-card);
    border: 1px solid var(--grey-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.eurobook-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-blue);
}

/* Prevent hover from overriding new card animation */
.eurobook-card-new:hover {
    border-color: #10B981 !important;
}

/* Card header */
.eurobook-card-header {
    padding: 0.5rem 1rem;
    background: var(--grey-50);
    border-bottom: 1px solid var(--grey-200);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.5) inset;
}

.eurobook-card-header .badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: var(--glass-btn-radius);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.5) inset;
}
.eurobook-card-header .badge.bg-success {
    background: rgba(16, 185, 129, 0.3) !important;
    color: #047857 !important;
}
.eurobook-card-header .badge.bg-danger {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #B91C1C !important;
}
.eurobook-card-header .badge.bg-warning {
    background: rgba(245, 158, 11, 0.3) !important;
    color: #92400E !important;
}
.eurobook-card-header .badge.bg-info {
    background: rgba(0, 137, 207, 0.25) !important;
    color: #006399 !important;
}

/* Hidden cards */
.eurobook-card-hidden {
    display: none !important;
}

/* New booking animation - medical green pulse */
@keyframes pulse-medical-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        border-color: #10B981;
    }
    50% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
        border-color: #059669;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        border-color: #10B981;
    }
}

.eurobook-card-new {
    animation: pulse-medical-green 2.5s ease-in-out infinite;
    border: 2px solid #10B981 !important;
    position: relative;
    z-index: 1;
}

/* Card body */
.eurobook-card-body {
    padding: 1.25rem;
    flex-grow: 1;
}

/* Desktop layout - two columns */
@media (min-width: 769px) {
    .eurobook-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .eurobook-card-body > div:nth-child(1) {
        /* Specjalista - left top */
        grid-column: 1;
        grid-row: 1;
    }

    .eurobook-card-body > div:nth-child(2) {
        /* Pacjent - right side (spans both rows) */
        grid-column: 2;
        grid-row: 1 / 3;
    }

    .eurobook-card-body > div:nth-child(3) {
        /* Usługi - left bottom */
        grid-column: 1;
        grid-row: 2;
    }
}

/* Labels and values – czytelniejsze etykiety (Specjalista, Pacjent, Usługi) */
.eurobook-label {
    display: block;
    font-size: max(var(--text-label-min), 0.8rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--grey-700);
    margin-bottom: 0.5rem;
}

.eurobook-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--grey-800);
}

.eurobook-value strong {
    font-weight: 700;
    color: var(--grey-900);
}

.eurobook-value [data-lucide] {
    flex-shrink: 0;
}

/* Contact info */
.eurobook-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.eurobook-contact small {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.eurobook-contact [data-lucide] {
    flex-shrink: 0;
}

/* Services */
.eurobook-services {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--grey-700);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.eurobook-services [data-lucide] {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* Card footer */
.eurobook-card-footer {
    padding: 1rem 1.25rem;
    background: var(--grey-50);
    border-top: 1px solid var(--grey-200);
    box-shadow: 0 -1px 0 0 rgba(255, 255, 255, 0.5) inset;
}

.eurobook-card-footer .btn {
    font-size: 0.9rem;
    padding: 0.65rem 1rem;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .eurobooks-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .eurobooks-grid {
        gap: 1rem;
    }

    .eurobook-card-header,
    .eurobook-card-body,
    .eurobook-card-footer {
        padding: 1rem;
    }

    .eurobook-card-header .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .eurobook-value,
    .eurobook-services {
        font-size: 0.85rem;
    }

    .eurobook-contact small {
        font-size: 0.8rem;
    }

    .eurobook-card-footer .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .eurobook-card-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   FLOATING CHAT WIDGET (ikona → rozwijany panel)
   =================================== */

.chat-floating-widget {
    position: fixed;
    bottom: 200px;
    right: 20px;
    z-index: 1000;
}

.chat-floating-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--grey-200);
    background: #fff;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--grey-800);
}

.chat-floating-trigger:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
    background: var(--glass-bg-strong);
}

.chat-floating-trigger i,
.chat-floating-trigger svg {
    color: var(--accent-blue);
    stroke: var(--accent-blue);
}

.chat-floating-trigger-label {
    font-family: var(--font-main);
}

.chat-floating-unread-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: #EF4444;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: chat-dot-pulse 1.5s ease-in-out infinite;
}
@keyframes chat-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50%      { opacity: 0.9; transform: scale(1.1); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

.chat-floating-panel {
    position: fixed;
    right: 20px;
    bottom: 200px;
    width: 380px;
    max-height: 70vh;
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    transform: translateY(10px);
}

.chat-floating-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-floating-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.chat-floating-panel-title {
    font-weight: var(--fw-semibold);
    font-size: 1rem;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-floating-panel-title i,
.chat-floating-panel-title svg {
    color: var(--accent-blue);
    stroke: var(--accent-blue);
}

.chat-floating-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--border-radius-sm);
    background: rgba(0, 0, 0, 0.06);
    color: var(--grey-600);
    cursor: pointer;
    transition: var(--transition);
}

.chat-floating-panel-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--grey-900);
}

.chat-floating-panel-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.chat-floating-panel-body .chat-messages {
    flex: 1;
    min-height: 200px;
    max-height: 320px;
}

.chat-floating-panel-body .chat-input-area {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .chat-floating-widget {
        bottom: 190px;
        right: 15px;
    }

    .chat-floating-trigger-label {
        display: none;
    }

    .chat-floating-trigger {
        padding: 0.75rem;
        border-radius: 50%;
    }

    .chat-floating-panel {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 160px;
        max-height: 60vh;
    }

    .chat-floating-panel-body .chat-messages {
        max-height: 240px;
    }
}

/* ===================================
   DASHBOARD REFRESH WIDGET
   =================================== */

.dashboard-refresh-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    background: #fff;
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--grey-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    font-size: 0.85rem;
}

.dashboard-refresh-widget:hover {
    box-shadow: var(--shadow-xl);
}

/* Przycisk „Pokaż wszystkie” – stałe tło (bez backdrop-filter) */
.btn-show-all-eurobooks {
    border-radius: var(--glass-btn-radius) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    padding: 0.65rem 1.25rem !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid var(--glass-btn-border) !important;
    box-shadow: var(--glass-btn-shadow);
}
.btn-show-all-eurobooks:hover {
    background: rgba(255, 255, 255, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.85) !important;
    box-shadow: var(--glass-btn-shadow-hover);
    color: var(--accent-blue) !important;
}

/* Pomoc techniczna – logo Euruś, wersja, copyright (większe, finezyjne) */
.support-card-body .support-card-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
}
.support-card-logo-img {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.06));
    transition: filter 0.25s ease, transform 0.25s ease;
}
.support-card-body .support-card-logo:hover .support-card-logo-img {
    filter: drop-shadow(0 4px 14px rgba(0, 137, 207, 0.12));
    transform: scale(1.02);
}
.support-card-meta {
    font-size: 0.8rem;
    line-height: 1.45;
}
.support-card-meta div + div {
    margin-top: 0.2rem;
}

.refresh-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    flex-shrink: 0;
}

.refresh-indicator.syncing {
    background: #F59E0B;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    animation: pulse-refresh 1s ease-in-out infinite;
}

@keyframes pulse-refresh {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.refresh-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.refresh-label {
    font-size: 0.7rem;
    color: var(--grey-500);
    font-weight: 500;
}

.refresh-time {
    font-weight: 700;
    color: var(--grey-900);
    font-size: 0.85rem;
}

.refresh-button {
    background: var(--primary-blue-light);
    border: 1px solid var(--grey-200);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    margin-left: auto;
}

.refresh-button:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: rotate(180deg);
}

.refresh-button:hover i,
.refresh-button:hover svg {
    color: white !important;
    stroke: white !important;
}

.refresh-button i,
.refresh-button svg {
    color: var(--accent-blue);
    stroke: var(--accent-blue);
    width: 16px;
    height: 16px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .dashboard-refresh-widget {
        bottom: 70px;
        right: 15px;
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }

    .refresh-button {
        width: 28px;
        height: 28px;
    }
}

/* ===================================
   FLOATING SYNC STATUS WIDGET
   =================================== */

.sync-status-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #fff;
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--grey-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.sync-status-widget:hover {
    box-shadow: var(--shadow-xl);
}

/* Status indicator */
.sync-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sync-status-indicator.status-ok {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse-sync-ok 3s ease-in-out infinite;
}

.sync-status-indicator.status-error {
    background: #EF4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulse-sync-error 2s ease-in-out infinite;
}

.sync-status-indicator.status-warning {
    background: #F59E0B;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

@keyframes pulse-sync-ok {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

@keyframes pulse-sync-error {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Tooltip for details */
.sync-status-widget .sync-tooltip {
    position: absolute;
    bottom: 110%;
    right: 0;
    background: var(--grey-900);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    min-width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.sync-status-widget:hover .sync-tooltip {
    opacity: 1;
}

.sync-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 8px solid transparent;
    border-top-color: var(--grey-900);
}

.sync-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sync-tooltip-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sync-tooltip-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.sync-tooltip-value {
    font-weight: 700;
    font-size: 0.9rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sync-status-widget {
        bottom: 15px;
        right: 15px;
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }

    .sync-status-widget .sync-tooltip {
        min-width: 240px;
        font-size: 0.8rem;
    }
}

/* ===================================
   REPLICATION PAGE - 2026 Medical UI
   =================================== */

.replication-page {
    padding: 2.5rem 0;
}

.replication-header {
    margin-bottom: 2rem;
}

.replication-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.replication-header h1 i,
.replication-header h1 svg {
    color: var(--accent-blue);
}

.replication-header small {
    color: var(--grey-500);
    font-size: 0.875rem;
}

/* Replication Status Card */
.replication-status-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid var(--grey-200);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .status-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
}

.replication-status-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

/* Wyróżnienie przy hover bez podnoszenia (jak na ekranie logowania) */
.replication-status-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-blue);
}

.status-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue-light) 0%, #ffffff 100%);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--grey-200);
}

.status-item-icon i,
.status-item-icon svg {
    width: 16px;
    height: 16px;
    color: var(--accent-blue);
    stroke: var(--accent-blue);
}

.status-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.replication-status-label {
    color: var(--grey-500);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.replication-status-value {
    font-weight: 700;
    color: var(--grey-900);
    font-size: 0.875rem;
    word-break: break-word;
    line-height: 1.3;
}

/* Replication History Table */
.replication-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.replication-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.replication-table thead th {
    background: var(--grey-50);
    padding: 1rem 0.75rem;
    font-weight: 600;
    color: var(--grey-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--grey-200);
    white-space: nowrap;
}

.replication-table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--grey-100);
    transition: var(--transition);
}

.replication-table tbody tr:last-child td {
    border-bottom: none;
}

.replication-table tbody tr:hover td {
    background: var(--primary-blue-light);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.status-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.status-badge.status-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.status-badge.status-warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.status-badge.status-info {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    border: 1px solid var(--grey-200);
}

/* Duration Badge */
.duration-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: var(--border-radius-sm);
    background: var(--grey-100);
    color: var(--grey-700);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Details Section */
.details-wrapper {
    background: var(--grey-50);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-top: 0.5rem;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--grey-200);
}

.details-table td:first-child {
    font-weight: 600;
    color: var(--grey-700);
    width: 40%;
}

.details-table tr:last-child td {
    border-bottom: none;
}

/* Force Sync Button */
.btn-force-sync {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.75rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-force-sync:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-force-sync:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-force-sync i,
.btn-force-sync svg {
    color: white;
    stroke: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .replication-header h1 {
        font-size: 1.5rem;
    }

    .replication-status-card .status-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .replication-table thead th,
    .replication-table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .btn-force-sync {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   RCP TIME BADGES - LARGER SIZE
   =================================== */

/* Time badges in RCP table */
.replication-table .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    letter-spacing: 0.02em;
}

.replication-table .bg-success {
    background-color: var(--success-color) !important;
    color: white;
}

.replication-table .bg-danger {
    background-color: var(--danger-color) !important;
    color: white;
}

.replication-table .bg-warning {
    background-color: var(--warning-color) !important;
    color: white;
}

.list-group-item {
    background: none;
}
