/* i-BOK 5 - Własne style */

html {
    scroll-behavior: smooth;
}

::selection {
    background-color: color-mix(in srgb, var(--ibok-accent) 30%, transparent);
    color: var(--ibok-primary);
}

body.dark-mode ::selection {
    background-color: color-mix(in srgb, var(--ibok-accent) 40%, transparent);
    color: #fff;
}

:root {
    --ibok-primary: #1a365d;
    --ibok-primary-light: #2c5282;
    --ibok-accent: #3182ce;
    --ibok-gradient: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #3182ce 100%);
    --ibok-bg: #f0f4f8;
    --ibok-body-bg: linear-gradient(135deg, #eef2f7 0%, #f0f4f8 40%, #e8eef6 100%);
    --ibok-card-shadow: 0 2px 8px rgba(0,0,0,.08);
    --ibok-radius: 0.5rem;
    --ibok-text: #212529;
    --ibok-text-muted: #718096;
    --ibok-card-bg: #fff;
    --ibok-card-header-bg: #fff;
    --ibok-card-border: #e2e8f0;
    --ibok-table-header-bg: #f7fafc;
    --ibok-table-header-color: #4a5568;
    --ibok-table-border: #e2e8f0;

    /* Fix Bootswatch Lux — alerty czytelne w trybie jasnym */
    --bs-danger-bg-subtle: #f8d7da;
    --bs-danger-text-emphasis: #58151c;
    --bs-danger-border-subtle: #f1aeb5;
    --ibok-footer-bg: #fff;
    --ibok-input-bg: #fff;
    --ibok-input-border: #cbd5e0;
    --ibok-input-color: #212529;
    --ibok-dropdown-bg: #fff;
    --ibok-dropdown-border: #e2e8f0;
    --ibok-debt-bg: linear-gradient(135deg, #fff5f5, #fed7d7);
    --ibok-debt-border: #fc8181;
    --ibok-debt-warn-bg: linear-gradient(135deg, #fffff0, #fefcbf);
    --ibok-debt-warn-border: #ecc94b;
}

/* Tło */
body {
    background: var(--ibok-body-bg, var(--ibok-bg));
    background-attachment: fixed;
    color: var(--ibok-text);
    font-family: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
body.login-page {
    background: var(--ibok-gradient);
}

/* Strona logowania */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ibok-gradient);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
    position: relative;
    z-index: 2;
}

.login-card {
    border: none;
    border-radius: var(--ibok-radius);
    overflow: hidden;
    background: color-mix(in srgb, var(--ibok-accent) 12%, #fff);
    border-top: 3px solid color-mix(in srgb, var(--ibok-accent) 35%, transparent);
}
.admin-login .login-card {
    background: #fff;
    border-top: none;
}

.login-icon {
    font-size: 3.5rem;
    color: var(--ibok-primary);
}

.login-logo {
    border-radius: 0.25rem;
}

/* Admin login — ciemnoszare tło + pulsująca czerwona ikona */
.admin-login {
    background: linear-gradient(135deg, #1c1c1c 0%, #2a2a2a 50%, #333333 100%) !important;
}
.admin-login-icon {
    font-size: 5rem !important;
    color: #dc3545 !important;
    animation: admin-icon-pulse 1s ease-in-out infinite;
}
@keyframes admin-icon-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.15); }
}

/* Particles.js — login background */
#particles-login {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Particles.js — navbar background */
.navbar {
    position: relative;
    z-index: 1030;
}
#particles-navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    clip: rect(0, auto, auto, 0);
}
.navbar > .container-fluid {
    position: relative;
    z-index: 1;
}

/* Nawigacja - gradient */
.bg-primary-gradient {
    background: var(--ibok-gradient) !important;
}

.navbar {
    border-bottom: 3px solid rgba(255,255,255,.15);
}

.navbar-brand-sub {
    font-size: 0.7rem;
    opacity: 0.7;
    line-height: 1;
    display: block;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,.85);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255,255,255,.15);
}

/* Menu klienta - pulsujaca ikonka (np. oczekujace umowy) */
.nav-icon-link.nav-icon-pulse i {
    animation: navIconPulse 0.8s ease-in-out infinite;
    color: #ffd700;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7));
}

@keyframes navIconPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-icon-link.nav-icon-pulse i {
        animation: none;
    }
}

/* Menu klienta - duże ikonki z napisami pod spodem */
.nav-icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.4rem 0.7rem !important;
    line-height: 1;
}

.nav-icon-link i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.35rem;
    transition: transform 0.2s ease;
    will-change: transform;
}

.nav-icon-link:hover i,
.nav-icon-link.active i {
    transform: scale(1.25);
}

.nav-icon-link span {
    font-size: 0.65rem;
    display: block;
    white-space: nowrap;
}

@media (max-width: 1199px) {
    .nav-icon-link {
        flex-direction: row;
        align-items: center;
        text-align: left;
    }
    .nav-icon-link i {
        font-size: 1.2rem;
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
    .nav-icon-link span {
        font-size: 0.85rem;
    }
}

/* Karty */
.card {
    border: none;
    border-radius: var(--ibok-radius);
    box-shadow: var(--ibok-card-shadow);
    position: relative;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 0;
}

.card:hover::after {
    opacity: 1;
}

.card-header {
    background-color: var(--ibok-card-header-bg);
    border-bottom: 2px solid var(--ibok-card-border);
    font-weight: 600;
}

/* Statystyki (dashboard) */
.stat-card {
    border-left: 4px solid var(--ibok-accent);
    transition: transform 0.15s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 2rem;
    color: var(--ibok-accent);
    opacity: 0.7;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ibok-primary);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--ibok-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.stat-success { border-left-color: #38a169; }
.stat-card.stat-success .stat-icon { color: #38a169; }
.stat-card.stat-danger { border-left-color: #e53e3e; }
.stat-card.stat-danger .stat-icon { color: #e53e3e; }
.stat-card.stat-warning { border-left-color: #d69e2e; }
.stat-card.stat-warning .stat-icon { color: #d69e2e; }
.stat-card.stat-info { border-left-color: #3182ce; }
.stat-card.stat-info .stat-icon { color: #3182ce; }

/* Tabele */
.table th {
    background-color: var(--ibok-table-header-bg);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--ibok-table-header-color);
    border-bottom: 2px solid var(--ibok-table-border);
}

.table td {
    vertical-align: middle;
}

/* DataTables nadpisania */
.dataTables_wrapper > .row:first-child {
    padding: 0.75rem 1rem 0.5rem;
}

.dataTables_wrapper > .row:last-child {
    padding: 0.25rem 1rem 0.75rem;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--ibok-radius);
    border: 1px solid var(--ibok-input-border);
    padding: 0.375rem 0.75rem;
    background-color: var(--ibok-input-bg);
    color: var(--ibok-input-color);
}

.dataTables_wrapper .dataTables_length select {
    border-radius: var(--ibok-radius);
    border: 1px solid var(--ibok-input-border);
    padding: 0.25rem 0.5rem;
    min-width: 5rem;
    background-color: var(--ibok-input-bg);
    color: var(--ibok-input-color);
}

/* Ikony akcji (druk, płatność, kopiowanie) */
.btn-link.text-primary,
.btn-link.text-success,
.btn-link.text-secondary {
    text-decoration: none;
    font-size: 1.6rem;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.btn-link.text-primary:hover,
.btn-link.text-success:hover,
.btn-link.text-secondary:hover {
    opacity: 1;
    text-decoration: none;
}

/* Badge dla statusów */
.badge {
    font-weight: 500;
    padding: 0.4em 0.65em;
    font-size: 0.8rem;
}

/* Przelew - druk */
.druk-container {
    position: relative;
    width: 610px;
    height: 395px;
    font-family: 'Courier New', monospace;
    font-size: 12pt;
    font-weight: bold;
    letter-spacing: 9.1px;
}

.druk-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 610px;
    height: 395px;
    z-index: 0;
}

.druk-field {
    position: absolute;
    z-index: 1;
}

/* Stopka */
.footer {
    background: var(--ibok-footer-bg);
}

/* Responsywność */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .stat-card .stat-value {
        font-size: 1.2rem;
    }

    .card-header {
        font-size: 0.9rem;
    }

    .druk-container {
        transform: scale(0.6);
        transform-origin: top left;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 0.5rem;
    }

    .card-body.p-md-5 {
        padding: 1.5rem !important;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }
}

/* Animacja fade-in */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================
   EFEKTY WIZUALNE
   ============================= */

/* 1. Pulsujące badge — przyciąga uwagę do oczekujących/zaległych */
.badge.bg-danger,
.badge.bg-warning {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

/* Wyłącz pulsowanie dla statycznych badge (np. w tabelach) */
.table .badge.bg-danger,
.table .badge.bg-warning,
.dropdown-menu .badge {
    animation: none;
}

/* 2. Hover na kartach — unoszenie + pogłębienie cienia (GPU-accelerated) */
.card {
    transition: transform 0.2s ease;
    will-change: transform;
    backface-visibility: hidden;
}

.card:hover {
    transform: translateY(-3px);
}

.card:hover::after {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    opacity: 1;
}

/* Wyłącz hover dla kart wewnątrz modali i formularzy logowania */
.modal .card:hover,
.login-card:hover {
    transform: none;
}

.modal .card::after,
.login-card::after {
    display: none;
}

/* 3. Gradient w nagłówkach kart */
.card-header {
    background: linear-gradient(135deg,
        var(--ibok-card-header-bg) 0%,
        color-mix(in srgb, var(--ibok-accent) 6%, var(--ibok-card-header-bg)) 100%
    );
    border-bottom: 1px solid var(--ibok-card-border);
}

/* 4. Animowane statystyki — wjazd z dołu */
.stat-card {
    animation: statSlideUp 0.35s ease-out both;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-card:nth-child(5) { animation-delay: 0.2s; }
.stat-card:nth-child(6) { animation-delay: 0.25s; }

@keyframes statSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .badge.bg-danger,
    .badge.bg-warning {
        animation: none;
    }
    .card:hover {
        transform: none;
    }
    .stat-card {
        animation: none;
    }
}

/* Form switch — zaokrąglone suwaki */
.form-switch .form-check-input {
    border-radius: 2em;
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(49, 130, 206, 0.25);
}

/* Payment countdown - pulsating urgent badge */
.payment-badge-urgent {
    animation: paymentPulse 1.5s ease-in-out infinite;
}

@keyframes paymentPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
    .payment-badge-urgent {
        animation: none;
    }
}

/* Aktualności / newsy */
.news-card {
    border-left: 4px solid var(--ibok-accent);
}

/* Informacje taryfy */
.tariff-table td:first-child {
    font-weight: 600;
    color: #4a5568;
    width: 55%;
    white-space: nowrap;
}

.tariff-table td:last-child {
    font-weight: 700;
    color: var(--ibok-primary);
    padding-left: 12px;
}

/* =============================
   GLOBAL SEARCH (on dashboard page)
   ============================= */
.global-search-wrapper {
    width: 560px;
    flex-shrink: 1;
    min-width: 280px;
}

.global-search-wrapper .form-control {
    font-size: 0.9rem;
}

.global-search-wrapper .form-control:focus {
    border-color: var(--ibok-accent);
    box-shadow: 0 0 0 0.2rem rgba(49, 130, 206, 0.15);
}

.global-search-wrapper .input-group-text {
    border-color: var(--ibok-input-border);
}

.global-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--ibok-card-bg, #fff);
    border: 1px solid var(--ibok-card-border, #e2e8f0);
    border-radius: 0 0 var(--ibok-radius) var(--ibok-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    max-height: 420px;
    overflow-y: auto;
    margin-top: 2px;
}

.global-search-dropdown.show {
    display: block;
}

.gs-category {
    border-bottom: 1px solid var(--ibok-card-border, #e2e8f0);
}

.gs-category:last-child {
    border-bottom: none;
}

.gs-category-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ibok-text-muted, #718096);
    padding: 0.5rem 0.75rem 0.25rem;
}

.gs-item {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    text-decoration: none;
    color: var(--ibok-text, #212529);
    cursor: pointer;
    transition: background-color 0.15s;
}

.gs-item:hover,
.gs-item:focus {
    background-color: rgba(49, 130, 206, 0.08);
    color: var(--ibok-text, #212529);
    text-decoration: none;
    outline: none;
}

.gs-item-icon {
    font-size: 1rem;
    color: var(--ibok-accent, #3182ce);
    width: 1.5rem;
    flex-shrink: 0;
    text-align: center;
}

.gs-item-text {
    min-width: 0;
    margin-left: 0.5rem;
}

.gs-item-label {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-item-sublabel {
    font-size: 0.75rem;
    color: var(--ibok-text-muted, #718096);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-empty {
    padding: 1rem;
    text-align: center;
    color: var(--ibok-text-muted, #718096);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .global-search-wrapper {
        width: 100%;
    }
}

/* Admin - ciemna nawigacja */
.bg-dark .navbar-nav .nav-link:hover,
.bg-dark .navbar-nav .nav-link.active {
    background-color: rgba(255,255,255,.1);
}

/* Ostrzeżenie o zaległości */
.debt-alert,
.debt-warning {
    overflow: visible;
    position: relative;
    z-index: 2;
}

.debt-alert {
    background: var(--ibok-debt-bg);
    border: 3px solid var(--ibok-debt-border) !important;
    border-radius: var(--ibok-radius);
}
.debt-warning {
    background: var(--ibok-debt-warn-bg);
    border: 3px solid var(--ibok-debt-warn-border) !important;
    border-radius: var(--ibok-radius);
}

.debt-alert > .card-header,
.debt-warning > .card-header {
    background: transparent;
    border-bottom: none;
}

/* Scroll do góry - jak w dużych tabelach */
.table-responsive {
    border-radius: var(--ibok-radius);
}

/* Druk przelewu - pozycje pól */
.druk-odbiorca1 { top: 17px; left: 50px; }
.druk-odbiorca2 { top: 48px; left: 50px; }
.druk-konto { top: 82px; left: 52px; }
.druk-waluta { top: 114px; left: 260px; }
.druk-kwota { top: 114px; left: 338px; }
.druk-slownie { top: 143px; left: 61px; font-size: 10pt; letter-spacing: 0.1px; }
.druk-zlec1 { top: 175px; left: 50px; }
.druk-zlec2 { top: 205px; left: 50px; }
.druk-tytul1 { top: 236px; left: 50px; }
.druk-tytul2 { top: 268px; left: 50px; }

/* Smooth transitions — only for dark mode toggle (scoped via .dm-transition) */
body.dm-transition,
body.dm-transition .card,
body.dm-transition .card-header,
body.dm-transition .table,
body.dm-transition .table th,
body.dm-transition .table td,
body.dm-transition .form-control,
body.dm-transition .form-select,
body.dm-transition .footer,
body.dm-transition .dropdown-menu,
body.dm-transition .stat-card,
body.dm-transition .badge,
body.dm-transition .alert,
body.dm-transition .list-group-item,
body.dm-transition .breadcrumb,
body.dm-transition .nav-tabs .nav-link,
body.dm-transition .input-group-text {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* =============================
   COLOR THEMES
   ============================= */

/* Emerald */
body.theme-emerald {
    --ibok-primary: #064e3b;
    --ibok-primary-light: #065f46;
    --ibok-accent: #10b981;
    --ibok-gradient: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #10b981 100%);
    --ibok-body-bg: linear-gradient(135deg, #ecfdf5 0%, #f0fdf6 40%, #e6f7ed 100%);
}
body.theme-emerald .bg-primary-gradient { background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #10b981 100%) !important; }

/* Violet */
body.theme-violet {
    --ibok-primary: #2e1065;
    --ibok-primary-light: #4c1d95;
    --ibok-accent: #8b5cf6;
    --ibok-gradient: linear-gradient(135deg, #2e1065 0%, #4c1d95 50%, #8b5cf6 100%);
    --ibok-body-bg: linear-gradient(135deg, #f5f0ff 0%, #f3f0fa 40%, #ede8f7 100%);
}
body.theme-violet .bg-primary-gradient { background: linear-gradient(135deg, #2e1065 0%, #4c1d95 50%, #8b5cf6 100%) !important; }

/* Rose */
body.theme-rose {
    --ibok-primary: #881337;
    --ibok-primary-light: #9f1239;
    --ibok-accent: #f43f5e;
    --ibok-gradient: linear-gradient(135deg, #881337 0%, #9f1239 50%, #f43f5e 100%);
    --ibok-body-bg: linear-gradient(135deg, #fff0f3 0%, #fdf2f4 40%, #fce8ec 100%);
}
body.theme-rose .bg-primary-gradient { background: linear-gradient(135deg, #881337 0%, #9f1239 50%, #f43f5e 100%) !important; }

/* Amber */
body.theme-amber {
    --ibok-primary: #78350f;
    --ibok-primary-light: #92400e;
    --ibok-accent: #f59e0b;
    --ibok-gradient: linear-gradient(135deg, #78350f 0%, #92400e 50%, #f59e0b 100%);
    --ibok-body-bg: linear-gradient(135deg, #fffbeb 0%, #fef9ee 40%, #fdf3e0 100%);
}
body.theme-amber .bg-primary-gradient { background: linear-gradient(135deg, #78350f 0%, #92400e 50%, #f59e0b 100%) !important; }

/* Slate */
body.theme-slate {
    --ibok-primary: #1e293b;
    --ibok-primary-light: #334155;
    --ibok-accent: #64748b;
    --ibok-gradient: linear-gradient(135deg, #1e293b 0%, #334155 50%, #64748b 100%);
    --ibok-body-bg: linear-gradient(135deg, #f1f3f5 0%, #f0f2f4 40%, #e9ecef 100%);
}
body.theme-slate .bg-primary-gradient { background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #64748b 100%) !important; }

/* Ocean */
body.theme-ocean {
    --ibok-primary: #134e4a;
    --ibok-primary-light: #0d9488;
    --ibok-accent: #2dd4bf;
    --ibok-gradient: linear-gradient(135deg, #134e4a 0%, #0d9488 50%, #2dd4bf 100%);
    --ibok-body-bg: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 40%, #e4f9f5 100%);
}
body.theme-ocean .bg-primary-gradient { background: linear-gradient(135deg, #134e4a 0%, #0d9488 50%, #2dd4bf 100%) !important; }

/* Crimson */
body.theme-crimson {
    --ibok-primary: #7f1d1d;
    --ibok-primary-light: #b91c1c;
    --ibok-accent: #ef4444;
    --ibok-gradient: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 50%, #ef4444 100%);
    --ibok-body-bg: linear-gradient(135deg, #fef2f2 0%, #fdf2f2 40%, #fce7e7 100%);
}
body.theme-crimson .bg-primary-gradient { background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 50%, #ef4444 100%) !important; }

/* Forest */
body.theme-forest {
    --ibok-primary: #1a2e05;
    --ibok-primary-light: #365314;
    --ibok-accent: #65a30d;
    --ibok-gradient: linear-gradient(135deg, #1a2e05 0%, #365314 50%, #65a30d 100%);
    --ibok-body-bg: linear-gradient(135deg, #f3f9ec 0%, #f4f8ef 40%, #ecf4e2 100%);
}
body.theme-forest .bg-primary-gradient { background: linear-gradient(135deg, #1a2e05 0%, #365314 50%, #65a30d 100%) !important; }

/* Royal */
body.theme-royal {
    --ibok-primary: #1e1b4b;
    --ibok-primary-light: #3730a3;
    --ibok-accent: #c084fc;
    --ibok-gradient: linear-gradient(135deg, #1e1b4b 0%, #3730a3 50%, #c084fc 100%);
    --ibok-body-bg: linear-gradient(135deg, #f5f0ff 0%, #f2f0fa 40%, #ebe4f7 100%);
}
body.theme-royal .bg-primary-gradient { background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 50%, #c084fc 100%) !important; }

/* =============================
   DARK MODE
   ============================= */
body.dark-mode {
    --ibok-bg: #1a1d23;
    --ibok-body-bg: #1a1d23;
    --ibok-text: #e2e8f0;
    --ibok-text-muted: #a0aec0;
    --ibok-card-bg: #2d3748;
    --ibok-card-header-bg: #2d3748;
    --ibok-card-border: #4a5568;
    --ibok-card-shadow: 0 2px 8px rgba(0,0,0,.3);
    --ibok-table-header-bg: #2a2f3a;
    --ibok-table-header-color: #e2e8f0;
    --ibok-table-border: #4a5568;
    --ibok-footer-bg: #2d3748;
    --ibok-input-bg: #374151;
    --ibok-input-border: #6b7280;
    --ibok-input-color: #e2e8f0;
    --ibok-dropdown-bg: #2d3748;
    --ibok-dropdown-border: #4a5568;
    --ibok-debt-bg: linear-gradient(135deg, #3b1a1a, #4a2020);
    --ibok-debt-border: #e53e3e;
    --ibok-debt-warn-bg: linear-gradient(135deg, #3b3a1a, #4a4520);
    --ibok-debt-warn-border: #d69e2e;
}

body.dark-mode {
    color: var(--ibok-text);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--ibok-text);
}

body.dark-mode .card {
    background-color: var(--ibok-card-bg);
    color: var(--ibok-text);
}

body.dark-mode .card-header {
    background: linear-gradient(135deg,
        var(--ibok-card-header-bg) 0%,
        color-mix(in srgb, var(--ibok-accent) 8%, var(--ibok-card-header-bg)) 100%
    );
    color: var(--ibok-text);
}

body.dark-mode .card:hover::after {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    opacity: 1;
}

body.dark-mode .table {
    color: var(--ibok-text);
    --bs-table-color: var(--ibok-text);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,.03);
    --bs-table-striped-color: var(--ibok-text);
    --bs-table-hover-color: var(--ibok-text);
    --bs-table-hover-bg: rgba(255,255,255,.05);
}

body.dark-mode .table th {
    color: var(--ibok-table-header-color);
}

body.dark-mode .table td {
    border-color: var(--ibok-table-border);
    color: var(--ibok-text);
}

body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_paginate,
body.dark-mode .dataTables_wrapper .dataTables_length {
    color: var(--ibok-text);
}

body.dark-mode .dataTables_wrapper .paginate_button {
    color: var(--ibok-text) !important;
}

body.dark-mode .dataTables_wrapper .paginate_button.current {
    background: var(--ibok-accent) !important;
    border-color: var(--ibok-accent) !important;
    color: #fff !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: var(--ibok-input-bg);
    border-color: var(--ibok-input-border);
    color: var(--ibok-input-color);
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #374151;
    border-color: var(--ibok-accent);
    color: var(--ibok-input-color);
}

body.dark-mode .dropdown-menu {
    background-color: var(--ibok-dropdown-bg);
    border-color: var(--ibok-dropdown-border);
}

body.dark-mode .dropdown-item {
    color: var(--ibok-text);
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
    background-color: rgba(255,255,255,.08);
    color: #fff;
}

body.dark-mode .dropdown-item.active {
    background-color: var(--ibok-accent);
}

body.dark-mode .dropdown-divider {
    border-color: var(--ibok-card-border);
}

body.dark-mode .dropdown-item-text {
    color: var(--ibok-text-muted) !important;
}

body.dark-mode .text-muted {
    color: var(--ibok-text-muted) !important;
}

body.dark-mode .border-top {
    border-color: var(--ibok-card-border) !important;
}

body.dark-mode .alert-info {
    background-color: rgba(49, 130, 206, 0.3);
    border-color: rgba(49, 130, 206, 0.5);
    color: #ebf8ff;
}

body.dark-mode .alert-warning {
    background-color: rgba(214, 158, 46, 0.3);
    border-color: rgba(214, 158, 46, 0.5);
    color: #fefcbf;
}

body.dark-mode .alert-danger {
    background-color: rgba(229, 62, 62, 0.35);
    border-color: rgba(229, 62, 62, 0.6);
    color: #fff5f5;
}

body.dark-mode .alert-success {
    background-color: rgba(56, 161, 105, 0.3);
    border-color: rgba(56, 161, 105, 0.5);
    color: #f0fff4;
}

body.dark-mode .badge.bg-light {
    background-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .stat-card .stat-value {
    color: #e2e8f0;
}

body.dark-mode .tariff-table td:first-child {
    color: var(--ibok-text-muted);
}

body.dark-mode .tariff-table td:last-child {
    color: #90cdf4;
}

body.dark-mode .news-card {
    border-left-color: var(--ibok-accent);
}

body.dark-mode .text-primary {
    color: #63b3ed !important;
}

body.dark-mode .text-danger {
    color: #fc8181 !important;
}

body.dark-mode .fw-bold.text-primary {
    color: #63b3ed !important;
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* --- bg-warning text-dark — nadpis text-dark w dark mode --- */
body.dark-mode .text-dark {
    color: var(--ibok-text) !important;
}

body.dark-mode .bg-warning {
    background-color: rgba(214, 158, 46, 0.25) !important;
    color: #fbd38d !important;
}

body.dark-mode .bg-warning.text-dark {
    color: #fbd38d !important;
}

/* --- bg-light / bg-white — ciemne w dark mode --- */
body.dark-mode .bg-light {
    background-color: #2a2f3a !important;
    color: var(--ibok-text) !important;
}

body.dark-mode .bg-white {
    background-color: var(--ibok-card-bg) !important;
    color: var(--ibok-text) !important;
}

/* --- code elementy --- */
body.dark-mode code {
    color: #f0abfc;
    background-color: rgba(255,255,255,.06);
}

body.dark-mode .bg-light code,
body.dark-mode code.bg-light {
    background-color: #2a2f3a !important;
    color: #f0abfc !important;
}

/* --- table-light thead --- */
body.dark-mode .table-light,
body.dark-mode thead.table-light,
body.dark-mode .table-light th,
body.dark-mode .table-light td {
    background-color: #2a2f3a !important;
    color: var(--ibok-text) !important;
    --bs-table-bg: #2a2f3a;
    --bs-table-color: var(--ibok-text);
}

/* --- table-active (total rows, highlighted) --- */
body.dark-mode .table-active,
body.dark-mode .table-active td,
body.dark-mode .table-active th {
    background-color: rgba(255,255,255,.08) !important;
    color: var(--ibok-text) !important;
    --bs-table-active-bg: rgba(255,255,255,.08);
    --bs-table-active-color: var(--ibok-text);
}

/* --- breadcrumb --- */
body.dark-mode .breadcrumb {
    background-color: transparent;
}

body.dark-mode .breadcrumb-item + .breadcrumb-item::before {
    color: var(--ibok-text-muted);
}

body.dark-mode .breadcrumb-item a {
    color: #63b3ed;
}

body.dark-mode .breadcrumb-item.active {
    color: var(--ibok-text-muted);
}

/* --- navbar admina w dark mode --- */
body.dark-mode .navbar.bg-dark {
    background-color: var(--ibok-bg) !important;
    border-bottom: 1px solid var(--ibok-card-border);
}

/* --- linki w dark mode --- */
body.dark-mode a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.page-link) {
    color: #63b3ed;
}

body.dark-mode a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.page-link):hover {
    color: #90cdf4;
}

/* --- list-group --- */
body.dark-mode .list-group-item {
    background-color: var(--ibok-card-bg);
    color: var(--ibok-text);
    border-color: var(--ibok-card-border);
}

body.dark-mode .list-group-item-action:hover,
body.dark-mode .list-group-item-action:focus {
    background-color: rgba(255,255,255,.06);
    color: var(--ibok-text);
}

body.dark-mode .list-group-item.active {
    background-color: var(--ibok-accent);
    border-color: var(--ibok-accent);
    color: #fff;
}

/* --- form-check-label, form-label, form-text --- */
body.dark-mode .form-check-label,
body.dark-mode .form-label,
body.dark-mode label {
    color: var(--ibok-text);
}

body.dark-mode .form-text {
    color: var(--ibok-text-muted) !important;
}

/* --- form-check-input (radio/checkbox) --- */
body.dark-mode .form-check-input {
    background-color: var(--ibok-input-bg);
    border-color: var(--ibok-input-border);
}

body.dark-mode .form-check-input:checked {
    background-color: var(--ibok-accent);
    border-color: var(--ibok-accent);
}

/* --- border utilities --- */
body.dark-mode .border {
    border-color: var(--ibok-card-border) !important;
}

body.dark-mode .border-primary {
    border-color: var(--ibok-accent) !important;
}

body.dark-mode .border-bottom {
    border-color: var(--ibok-card-border) !important;
}

/* --- nav-tabs in dark mode --- */
body.dark-mode .nav-tabs {
    border-bottom-color: var(--ibok-card-border);
}
body.dark-mode .nav-tabs .nav-link {
    color: var(--ibok-text-muted);
}
body.dark-mode .nav-tabs .nav-link:hover {
    border-color: var(--ibok-card-border) var(--ibok-card-border) transparent;
    color: var(--ibok-text);
}
body.dark-mode .nav-tabs .nav-link.active {
    background-color: var(--ibok-card-bg);
    border-color: var(--ibok-card-border) var(--ibok-card-border) var(--ibok-card-bg);
    color: var(--ibok-text);
}

/* --- btn-outline-secondary / btn-outline-primary in dark mode --- */
body.dark-mode .btn-outline-secondary {
    color: var(--ibok-text-muted);
    border-color: var(--ibok-card-border);
}

body.dark-mode .btn-outline-secondary:hover {
    background-color: rgba(255,255,255,.1);
    color: var(--ibok-text);
    border-color: var(--ibok-text-muted);
}

body.dark-mode .btn-outline-primary {
    color: #63b3ed;
    border-color: #63b3ed;
}

body.dark-mode .btn-outline-primary:hover {
    background-color: rgba(99, 179, 237, 0.15);
    color: #90cdf4;
    border-color: #90cdf4;
}

/* --- text-success / text-warning --- */
body.dark-mode .text-success {
    color: #68d391 !important;
}

body.dark-mode .text-warning {
    color: #fbd38d !important;
}

/* --- login-page cards in dark mode --- */
body.dark-mode .login-card {
    background-color: var(--ibok-card-bg);
    color: var(--ibok-text);
}

body.dark-mode .login-icon {
    color: #63b3ed;
}

/* --- modals (if used) --- */
body.dark-mode .modal-content {
    background-color: var(--ibok-card-bg);
    color: var(--ibok-text);
    border-color: var(--ibok-card-border);
}

body.dark-mode .border-danger {
    border-color: #e53e3e !important;
}

body.dark-mode .modal-header {
    border-color: var(--ibok-card-border);
}

body.dark-mode .modal-footer {
    border-color: var(--ibok-card-border);
}

body.dark-mode .offcanvas {
    background-color: var(--ibok-card-bg);
    color: var(--ibok-text);
    border-color: var(--ibok-card-border);
}

body.dark-mode .offcanvas-header {
    border-color: var(--ibok-card-border);
}

/* --- strong / fw-bold default color --- */
body.dark-mode strong,
body.dark-mode .fw-bold {
    color: inherit;
}

/* --- small tag --- */
body.dark-mode small {
    color: inherit;
}

/* --- text-secondary, text-body-secondary — jaśniejsze w dark mode --- */
body.dark-mode .text-secondary {
    color: #94a3b8 !important;
}
body.dark-mode .text-body-secondary {
    color: #94a3b8 !important;
}

/* --- Placeholdery formularzy --- */
body.dark-mode .form-control::placeholder {
    color: #8899a6;
    opacity: 1;
}
body.dark-mode .form-select::placeholder {
    color: #8899a6;
}

/* --- DataTables: search input placeholder + info text --- */
body.dark-mode .dataTables_wrapper .dataTables_filter input::placeholder {
    color: #8899a6;
    opacity: 1;
}

/* --- Chart.js legend / tooltips — nadpisywane przez JS, ale fallback CSS --- */
body.dark-mode canvas {
    color: #e2e8f0;
}

/* --- input-group-text --- */
body.dark-mode .input-group-text {
    background-color: #374151;
    border-color: var(--ibok-input-border);
    color: var(--ibok-text-muted);
}

/* --- payment pages bg-light body --- */
body.dark-mode.bg-light {
    background-color: var(--ibok-bg) !important;
}

/* --- sticky-top headers - proper dark bg so content doesn't bleed through --- */
body.dark-mode .sticky-top {
    background-color: #2a2f3a;
}

body.dark-mode thead.sticky-top th {
    background-color: #2a2f3a !important;
}

/* --- progress bars --- */
body.dark-mode .progress {
    background-color: #4a5568;
}

/* --- badge variants --- */
body.dark-mode .badge.bg-secondary {
    background-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .badge.bg-info {
    background-color: rgba(49, 130, 206, 0.3) !important;
    color: #90cdf4 !important;
}

body.dark-mode .badge.bg-warning {
    background-color: rgba(214, 158, 46, 0.3) !important;
    color: #fbd38d !important;
}

/* --- spinner --- */
body.dark-mode .spinner-border.text-primary {
    color: #63b3ed !important;
}

/* --- Global Search dark mode --- */
body.dark-mode .global-search-wrapper .input-group-text {
    background-color: var(--ibok-input-bg);
    border-color: var(--ibok-input-border);
    color: var(--ibok-text-muted);
}

body.dark-mode .global-search-dropdown {
    background-color: #2d3748;
    border-color: #4a5568;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

body.dark-mode .gs-category {
    border-color: #4a5568;
}

body.dark-mode .gs-item:hover,
body.dark-mode .gs-item:focus {
    background-color: rgba(99, 179, 237, 0.12);
}

body.dark-mode .gs-item {
    color: #e2e8f0;
}

body.dark-mode .gs-item-icon {
    color: #63b3ed;
}

body.dark-mode .gs-item-sublabel {
    color: #a0aec0;
}

body.dark-mode .gs-category-header {
    color: #a0aec0;
}

body.dark-mode .gs-empty {
    color: #a0aec0;
}

/* Help sections & tooltips */
.ibok-help .card-body { line-height: 1.6; }
.ibok-help ul { margin-bottom: 0; }
[data-bs-toggle="tooltip"] { cursor: help; }
body.dark-mode .ibok-help .card-body { background: var(--ibok-card-bg) !important; color: var(--ibok-text); border-color: #2c5282 !important; }

/* =============================
   MODERN UI ENHANCEMENTS (2026)
   ============================= */

/* --- Background patterns per theme --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
    background-image: var(--ibok-bg-pattern, none);
    background-size: var(--ibok-bg-pattern-size, 60px 60px);
    background-repeat: repeat;
    will-change: opacity;
    contain: strict;
}

/* Default theme - subtle dot grid */
:root {
    --ibok-bg-pattern: radial-gradient(circle, #94a3b8 1px, transparent 1px);
    --ibok-bg-pattern-size: 24px 24px;
}

/* Emerald - hexagonal / organic */
body.theme-emerald {
    --ibok-bg-pattern:
        radial-gradient(circle at 25% 25%, rgba(16,185,129,0.12) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(16,185,129,0.08) 1.5px, transparent 1.5px);
    --ibok-bg-pattern-size: 30px 30px;
}

/* Violet - diagonal lines */
body.theme-violet {
    --ibok-bg-pattern: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(139,92,246,0.06) 10px,
        rgba(139,92,246,0.06) 11px
    );
    --ibok-bg-pattern-size: 100% 100%;
}

/* Rose - soft crosses */
body.theme-rose {
    --ibok-bg-pattern:
        linear-gradient(rgba(244,63,94,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244,63,94,0.06) 1px, transparent 1px);
    --ibok-bg-pattern-size: 32px 32px;
}

/* Amber - warm dots */
body.theme-amber {
    --ibok-bg-pattern: radial-gradient(circle, rgba(245,158,11,0.15) 1px, transparent 1px);
    --ibok-bg-pattern-size: 20px 20px;
}

/* Slate - fine grid */
body.theme-slate {
    --ibok-bg-pattern:
        linear-gradient(rgba(100,116,139,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100,116,139,0.08) 1px, transparent 1px);
    --ibok-bg-pattern-size: 40px 40px;
}

/* Ocean - wave-like curves */
body.theme-ocean {
    --ibok-bg-pattern:
        radial-gradient(ellipse at 50% 0%, rgba(45,212,191,0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(13,148,136,0.08) 0%, transparent 60%);
    --ibok-bg-pattern-size: 80px 80px;
}

/* Crimson - subtle diamonds */
body.theme-crimson {
    --ibok-bg-pattern:
        linear-gradient(45deg, rgba(239,68,68,0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(239,68,68,0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(239,68,68,0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(239,68,68,0.05) 75%);
    --ibok-bg-pattern-size: 40px 40px;
}

/* Forest - organic triangles */
body.theme-forest {
    --ibok-bg-pattern:
        linear-gradient(60deg, rgba(101,163,13,0.06) 25%, transparent 25.5%),
        linear-gradient(-60deg, rgba(101,163,13,0.06) 25%, transparent 25.5%);
    --ibok-bg-pattern-size: 50px 44px;
}

/* Royal - elegant grid with accents */
body.theme-royal {
    --ibok-bg-pattern:
        radial-gradient(circle, rgba(192,132,252,0.1) 1px, transparent 1px),
        linear-gradient(rgba(192,132,252,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(192,132,252,0.04) 1px, transparent 1px);
    --ibok-bg-pattern-size: 28px 28px;
}

/* Dark mode — dimmed patterns */
body.dark-mode::before {
    opacity: 0.15;
}

/* --- Subtle glass effect for cards (no backdrop-filter for performance) --- */
.card {
    background: rgba(255, 255, 255, 0.95);
}

body.dark-mode .card {
    background: rgba(45, 55, 72, 0.92);
}

/* --- Refined scrollbar (Webkit) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ibok-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ibok-accent) 40%, var(--ibok-bg));
    border-radius: 4px;
    border: 2px solid var(--ibok-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--ibok-accent) 60%, var(--ibok-bg));
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ibok-accent) 40%, var(--ibok-bg)) var(--ibok-bg);
}

/* --- Focus ring — modern outline --- */
.form-control:focus,
.form-select:focus,
.btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--ibok-accent) 50%, transparent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ibok-accent) 15%, transparent);
}

/* --- Stat cards — frosted glass variant (no backdrop-filter for performance) --- */
.stat-card {
    background: rgba(255, 255, 255, 0.92);
}

body.dark-mode .stat-card {
    background: rgba(45, 55, 72, 0.88);
}

/* --- Subtle grain/noise overlay (optional — add class .ibok-grain to body) --- */
body.ibok-grain::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    contain: strict;
}

/* --- Card header icon glow on hover --- */
.card:hover .card-header i.bi {
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--ibok-accent) 50%, transparent));
}

/* --- Improved badge styling --- */
.badge {
    border-radius: 6px;
    letter-spacing: 0.3px;
}

/* --- Smooth page transitions --- */
.fade-in {
    animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Login page — glass card (backdrop-filter only on login page where it matters) --- */
.login-card {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode .login-card {
    background: rgba(45, 55, 72, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Navbar — no backdrop-filter for scroll performance --- */

/* --- Table row hover — accent tint --- */
.table-hover tbody tr:hover {
    background-color: color-mix(in srgb, var(--ibok-accent) 6%, transparent) !important;
}

body.dark-mode .table-hover tbody tr:hover {
    background-color: color-mix(in srgb, var(--ibok-accent) 10%, transparent) !important;
}

/* --- Smooth button press effect --- */
.btn:active {
    transform: scale(0.97);
    transition: transform 0.1s;
}

/* --- Alert refinement --- */
.alert {
    border-radius: var(--ibok-radius);
    border-left-width: 4px;
}

/* --- Footer — gradient top border + subtle bg --- */
.footer {
    border-top: 1px solid var(--ibok-card-border);
    position: relative;
    background: linear-gradient(180deg, var(--ibok-bg) 0%, color-mix(in srgb, var(--ibok-accent) 4%, var(--ibok-bg)) 100%);
}

.footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ibok-gradient);
    opacity: 0.5;
    border-radius: 2px;
}

/* --- Hamburger → X animacja (mobile) --- */
.navbar-toggler {
    border: none;
    padding: 0.4rem;
    position: relative;
    width: 36px;
    height: 36px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-image: none;
}

.navbar-toggler[aria-expanded="true"]::before,
.navbar-toggler[aria-expanded="true"]::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.navbar-toggler[aria-expanded="true"]::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"]::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* --- Zebra-striping tabel --- */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: color-mix(in srgb, var(--ibok-accent) 3%, transparent);
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Automatyczny zebra na tabelach ibok */
.ibok-table > tbody > tr:nth-of-type(odd) > td,
.ibok-table-date-desc > tbody > tr:nth-of-type(odd) > td {
    background-color: color-mix(in srgb, var(--ibok-accent) 3%, transparent);
}

body.dark-mode .ibok-table > tbody > tr:nth-of-type(odd) > td,
body.dark-mode .ibok-table-date-desc > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(255, 255, 255, 0.03);
}

/* --- Breadcrumbs — ulepszone --- */
.breadcrumb {
    background-color: color-mix(in srgb, var(--ibok-accent) 5%, var(--ibok-bg));
    padding: 0.6rem 1rem;
    border-radius: var(--ibok-radius);
    border: 1px solid color-mix(in srgb, var(--ibok-accent) 10%, var(--ibok-card-border));
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›" !important;
    font-size: 1.1em;
    font-weight: 600;
}

body.dark-mode .breadcrumb {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--ibok-card-border);
}

/* --- Dark mode toggle — obrót ikony --- */
#darkModeIcon {
    display: inline-block;
    transition: transform 0.25s ease;
}

.nav-link:hover #darkModeIcon {
    transform: rotate(20deg);
}
