/* admin/css/admin.css v=1786638826 */

:root {
    --success-color: #147a32;
    --danger-color: #b31d28;
    --warning-color: #b27b00;
    --info-color: #0284c7;
    --brand-header-bg: #002d69;
    --modal-bg: #ffffff;
    --modal-head-bg: #eef4ff;
    --modal-head-text: #0b1f44;
    --modal-border: #dbe3ec;
}

[data-theme="dark"] {
    --primary-color: #1d4ed8;
    --primary-hover: #2563eb;
    --modal-bg: #0f172a;
    --modal-head-bg: #0b1220;
    --modal-head-text: #e5edff;
    --modal-border: #2a3647;
}

/* ============================================================
   WCAG 2.2 — Globalne reguły dostępności i przewijania
   ============================================================ */

html {
    scroll-padding-top: 80px;
}

/* P1.1 / P3.4 / 2.4.11 WCAG 2.2: Dwuwarstwowy pierścień fokusu o wysokim kontraście */
*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #ffbf47 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--card-bg, #ffffff), 0 0 0 5px #ffbf47;
    border-radius: 4px;
}

main#admin-main-content:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* P2.5 / 2.4.12: Scroll-margin zapobiega zakrywaniu fokusu przez fixed header (~4rem) i toast */
*:focus-visible {
    scroll-margin-top: 5rem;
    scroll-margin-bottom: 4rem;
}

[data-theme="high-contrast"] {
    --bg-color: #000000;
    --card-bg: #000000;
    --text-color: #ffff00;
    --text-muted: #ffff00;
    --border-color: #ffffff;
    --control-border-color: #ffffff;
    --primary-color: #ffffff;
    --primary-hover: #ffff00;
    --white: #000000;
    --focus-ring: 4px solid #ffff00;
    --hover-bg: #111111;
    --success-color: #00ff00;
    --danger-color: #ff0000;
    --warning-color: #ffff00;
    --info-color: #00ffff;
    --modal-bg: #000000;
}

/* Skalowanie czcionek dla panelu administratora */
html.font-sm .admin-body { font-size: 14px; }
html.font-md .admin-body { font-size: 16px; }
html.font-lg .admin-body { font-size: 20px; }

/* Klasy pomocnicze (Utility Classes) zastępujące style inline */
.m-0 { margin: 0 !important; }
.mt-0-5 { margin-top: 0.5rem !important; }
.mt-0-75 { margin-top: 0.75rem !important; }
.mt-1 { margin-top: 1rem !important; }
.mt-1-5 { margin-top: 1.5rem !important; }
.mt-2 { margin-top: 2rem !important; }
.mt-3 { margin-top: 3rem !important; }
.mb-0-5 { margin-bottom: 0.5rem !important; }
.mb-0-75 { margin-bottom: 0.75rem !important; }
.mb-1 { margin-bottom: 1rem !important; }
.mb-1-25 { margin-bottom: 1.25rem !important; }
.mb-1-5 { margin-bottom: 1.5rem !important; }
.mb-2 { margin-bottom: 2rem !important; }
.ml-0-75 { margin-left: 0.75rem !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }
.d-flex { display: flex !important; }
.flex-1 { flex: 1 !important; }
.flex-2 { flex: 2 !important; }
.flex-col { flex-direction: column !important; }
.align-center { align-items: center !important; }
.align-end { align-items: flex-end !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.gap-0-5 { gap: 0.5rem !important; }
.gap-0-6 { gap: 0.6rem !important; }
.gap-0-75 { gap: 0.75rem !important; }
.gap-1 { gap: 1rem !important; }
.flex-wrap { flex-wrap: wrap !important; }
.w-full { width: 100% !important; }
.min-w-1-25 { min-width: 1.25rem !important; }
.min-w-120 { min-width: 120px !important; }
.min-w-160 { min-width: 160px !important; }
.min-w-200 { min-width: 200px !important; }
.min-w-220 { min-width: 220px !important; }
.min-w-240 { min-width: 240px !important; }
.min-w-260 { min-width: 260px !important; }
.max-w-400 { max-width: 400px !important; }
.p-1 { padding: 1rem !important; }
.p-2 { padding: 2rem !important; }
.pl-1-25 { padding-left: 1.25rem !important; }
.font-bold { font-weight: 700 !important; }
.text-center { text-align: center !important; }
.text-primary-color { color: var(--primary-color) !important; }
.text-muted-color { color: var(--text-muted) !important; }
.text-sm { font-size: 0.9rem !important; }
.text-xs { font-size: 0.8rem !important; }
.w-90px { width: 90px !important; }
.w-160px { width: 160px !important; }
.w-180px { width: 180px !important; }
.w-240px { width: 240px !important; }
.w-130px { width: 130px !important; }
.d-grid { display: grid !important; }
.w-120px { width: 120px !important; }
.grid-seo { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; gap: 0.75rem !important; }
.grid-consent { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; gap: 0.75rem !important; margin-top: 1rem !important; }
.mt-0-8 { margin-top: 0.8rem !important; }
.p-1-25 { padding: 1.25rem !important; }
.px-0-5 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.list-none { list-style: none !important; padding-left: 0 !important; }
.inquiry-message-box { border: 1px solid #dee2e6 !important; border-radius: 8px !important; padding: 1rem !important; background: #f8f9fa !important; margin-bottom: 1rem !important; white-space: pre-wrap !important; }
.inquiry-reply-box { background: #fff !important; border: 1px solid #dee2e6 !important; padding: 1rem !important; }
.inquiry-textarea { min-height: 160px !important; resize: vertical !important; }

.admin-body {
    background-color: var(--bg-color, #f1f5f9);
    font-size: clamp(14px, 0.85vw, 16px);
    color: var(--text-color, #212529);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.admin-body h1 { font-size: clamp(20px, 1.25vw, 26px); font-weight: 800; color: var(--text-color); }
.admin-body h2 { font-size: clamp(18px, 1.1vw, 22px); font-weight: 700; color: var(--text-color); }
.admin-body h3 { font-size: clamp(16px, 0.95vw, 18px); font-weight: 600; color: var(--text-color); }

.admin-container {
    width: 96vw;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(8px, 1vw, 16px);
    padding-right: clamp(8px, 1vw, 16px);
}

.admin-header {
    background-color: var(--brand-header-bg, var(--primary-color, #002d69)) !important;
    color: #ffffff !important;
    padding: 0.85rem 0;
    border-bottom: 3px solid #ffbf47;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.admin-header .logo a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-header .logo a span {
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    text-decoration: none !important;
}

/* Wyszukiwarka Omnibar Trigger Button (Header) */
.admin-omnibar-trigger {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
    padding: 0.45rem 0.95rem !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    height: 38px !important;
    line-height: 1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

.admin-omnibar-trigger:hover, .admin-omnibar-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: #ffbf47 !important;
    color: #ffffff !important;
}

.admin-omnibar-trigger svg, .admin-omnibar-trigger .admin-nav-icon {
    width: 16px !important;
    height: 16px !important;
    stroke: #ffffff !important;
    fill: none !important;
}

.admin-omnibar-shortcut {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    padding: 0.15rem 0.45rem !important;
    border-radius: 4px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Wyszukiwarka Omnibar Modal (Ctrl + K) */
.admin-omnibar-modal {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(6px) !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 12vh !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
}

.admin-omnibar-modal[hidden] {
    display: none !important;
}

.admin-omnibar-dialog {
    width: min(640px, 100%) !important;
    background: var(--card-bg, #ffffff) !important;
    color: var(--text-color, #0f172a) !important;
    border-radius: 14px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35) !important;
    border: 1px solid var(--border-color, #cbd5e1) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.admin-omnibar-input-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border-color, #cbd5e1) !important;
    background: var(--card-bg, #ffffff) !important;
}

.admin-omnibar-input-wrap svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    stroke: var(--text-muted, #64748b) !important;
    fill: none !important;
}

.admin-omnibar-input {
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    background: transparent !important;
    color: var(--text-color, #0f172a) !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.admin-omnibar-results {
    max-height: 420px !important;
    overflow-y: auto !important;
    padding: 0.5rem 0 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

.admin-omnibar-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.85rem 1.25rem !important;
    text-decoration: none !important;
    color: var(--text-color, #0f172a) !important;
    border-bottom: 1px solid var(--border-color, #f1f5f9) !important;
    transition: background 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.admin-omnibar-item:last-child {
    border-bottom: none !important;
}

.admin-omnibar-item:hover, .admin-omnibar-item:focus-visible {
    background: var(--hover-bg, #f1f5f9) !important;
    outline: none !important;
}

.admin-omnibar-item span {
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    color: var(--text-color, #0f172a) !important;
}

.admin-omnibar-item small {
    color: var(--text-muted, #64748b) !important;
    font-size: 0.8rem !important;
    background: var(--hover-bg, #e2e8f0) !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 4px !important;
    font-family: monospace !important;
}

/* Ścisła obsługa i wymiarowanie ikon SVG (Lucide / Navigation / KPI) */
svg.admin-nav-icon, .admin-nav-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle;
}

svg.admin-nav-icon *, .admin-nav-icon * {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2px !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kpi-icon svg {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.kpi-icon svg * {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2px !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-impersonation-banner {
    background: #fffbeb;
    border-bottom: 1px solid #ffe8a1;
    color: #6b4f00;
    padding: 0.6rem 0;
}

.admin-impersonation-banner__inner {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 0.75rem;

    flex-wrap: wrap;

}

.admin-impersonation-banner__actions {

    margin: 0;

}



.sa-modal {

    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    display: grid;

    place-items: center;

    padding: 16px;

    z-index: 1000;

}

.sa-modal[hidden] {

    display: none !important;

}

.sa-modal__panel {

    width: min(560px, 100%);

    background: #fff;

    border-radius: 12px;

    border: 1px solid rgba(0,0,0,0.08);

    box-shadow: 0 20px 60px rgba(0,0,0,0.25);

    padding: 1.25rem;

}

.user-info {

    display: flex;

    align-items: center;

    gap: 0.75rem;

    white-space: nowrap;

    flex-wrap: wrap;

    justify-content: flex-end;

}

.logout-form {

    display: inline;

}

.btn-logout {

    background: rgba(255, 191, 71, 0.18);

    color: #fff;

    border-color: rgba(255, 255, 255, 0.25);

    padding: 0.5rem 0.85rem;

    border-radius: 10px;

    font-weight: 700;

    letter-spacing: 0.01em;

    display: inline-flex;

    align-items: center;

    gap: 0.5rem;

}

.btn-logout:hover {

    background: #ffbf47;

    color: #212529;

    border-color: #ffbf47;

    transform: translateY(-1px);

    box-shadow: 0 6px 16px rgba(0,0,0,0.18);

}

.btn-logout:active {

    transform: translateY(0);

    box-shadow: none;

}

.btn-logout__icon {

    flex: 0 0 auto;

}

.btn-logout__label {

    line-height: 1;

}



.admin-layout {

    display: flex;

    gap: 2rem;

    margin-top: 2rem;

    min-height: calc(100vh - 200px);

}



.admin-sidebar {

    flex: 0 0 250px;

    background: var(--card-bg, #ffffff);

    border-radius: 8px;

    padding: 1rem 0;

    box-shadow: 0 2px 4px rgba(0,0,0,0.05);

    border: 1px solid #dee2e6;

    height: fit-content;

}



.admin-nav {

    list-style: none;

    margin: 0;

    padding: 0;

}

.admin-nav li {

    border-bottom: 1px solid #f1f3f5;

}

.admin-nav li:last-child {

    border-bottom: none;

}

.admin-nav a {

    display: block;

    padding: 1rem 1.5rem;

    text-decoration: none;

    color: var(--text-muted);

    font-weight: 500;

    transition: background-color 0.2s, color 0.2s;

}

.admin-nav a:hover, .admin-nav a:focus {

    background-color: var(--hover-bg, #e9ecef);

    color: var(--primary-color, #002d69);

    outline: var(--focus-ring);

    outline-offset: 2px;

    box-shadow: inset 4px 0 0 var(--primary-color, #002d69);

}



.admin-main {

    flex: 1;

    background: var(--card-bg, #ffffff);

    padding: 2rem;

    border-radius: 8px;

    box-shadow: 0 2px 4px rgba(0,0,0,0.05);

    border: 1px solid #dee2e6;

    overflow-x: auto;

}



@media (min-width: 1200px) {

    .admin-layout { gap: 1.5rem; }

    .admin-sidebar { flex-basis: 280px; }

    .admin-main { padding: 1.75rem; }

}



@media (min-width: 1920px) {

    .admin-layout { gap: 1.75rem; }

    .admin-main { padding: 2rem; }

}



@media (prefers-reduced-motion: reduce) {

    .btn-logout:hover { transform: none; }

}



/* RWD dla Panelu Admina - Off-canvas Hamburger Menu */
.admin-menu-toggle {
    display: none;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.admin-font-controls {
    display: flex;
    gap: 2px;
}

@media (max-width: 992px) {
    .admin-layout {
        flex-direction: column;
        margin-top: 1rem;
    }

    .admin-menu-toggle {
        display: inline-block !important;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        color: #ffffff;
        border-radius: 6px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .admin-menu-toggle .hamburger-inner,
    .admin-menu-toggle .hamburger-inner::before,
    .admin-menu-toggle .hamburger-inner::after {
        background-color: #ffffff;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: 280px;
        z-index: 10000;
        background: var(--card-bg, #ffffff);
        border: none;
        border-right: 1px solid var(--border-color, #dee2e6);
        border-radius: 0;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        display: block !important;
        overflow-y: auto;
        padding-top: 2rem;
    }

    .admin-sidebar.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .admin-nav {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0;
    }

    .admin-nav li {
        border-bottom: 1px solid var(--border-color, #dee2e6);
        border-right: none;
    }

    .admin-nav a {
        padding: 1rem 1.5rem;
    }
}



@media (max-width: 576px) {

    .admin-main {

        padding: 1rem;

    }

    .user-info {

        font-size: 0.85rem;

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 0.5rem;

        width: 100%;

    }

    .btn-logout {

        margin-left: 0;

        width: 100%;

        justify-content: center;

    }

    .logout-form {

        width: 100%;

        display: block;

    }

    .header-flex {

        flex-direction: column;

        gap: 1rem;

        text-align: center;

    }

    .admin-nav {

        flex-direction: column;

        width: 100%;

    }

    .admin-nav li {

        border-right: none;

        border-bottom: 1px solid #f1f3f5;

    }

}



/* Responsywne kontenery dla tabel */

.table-responsive {

    width: 100%;

    overflow-x: auto;

    margin-top: 1rem;

}



@media (min-width: 992px) {

    .table-responsive { overflow-x: visible; }

}



.admin-body .admin-table {

    table-layout: fixed;

}

.admin-body .admin-table th,

.admin-body .admin-table td {

    overflow-wrap: anywhere;

    word-break: break-word;

    padding: 0.75rem;

}

.admin-body .admin-table th {

    font-size: 1rem;

}

.admin-body .admin-table td {

    font-size: 1rem;

}

.admin-body .admin-table th {

    white-space: normal;

}

.admin-body .admin-table td {

    white-space: normal;

}

.admin-actions {

    flex-wrap: wrap;

}



.admin-density-compact .admin-main {

    padding: 1.25rem;

}

.admin-density-compact .admin-nav a {

    padding: 0.75rem 1.25rem;

}

.admin-density-compact .admin-table th,

.admin-density-compact .admin-table td {

    padding: 0.75rem;

    font-size: 0.95rem;

}

.admin-density-compact .form-control {

    padding: 0.65rem 0.75rem;

}

.admin-density-compact .btn {

    padding: 0.5rem 0.9rem;

}

.admin-density-compact .btn-sm {

    padding: 0.35rem 0.65rem;

}



.admin-fullscreen .admin-layout {

    gap: 0;

    margin-top: 0.75rem;

}

.admin-fullscreen .admin-sidebar {

    display: none;

}

.admin-fullscreen .admin-main {

    border-radius: 0;

    padding: 1.25rem;

}



.admin-footer {

    text-align: center;

    padding: 2rem 0;

    /* P2.3: Poprawiony kontrast — #4a5059 daje 5.2:1 na #f1f3f5 (było #5f666d = 3.95:1) */
    color: #4a5059;

}



/* KPI minikarty */

.kpi-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

    gap: 1.25rem;

    margin-top: 1.5rem;

}

.kpi-card {
    background: var(--card-bg, #ffffff);
    border-radius: 14px;
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color, #dee2e6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.kpi-icon { font-size: 1.8rem; line-height: 1; margin-bottom: 0.4rem; }

.kpi-value {

    font-size: 2.6rem;

    font-weight: 800;

    line-height: 1.1;

    margin-bottom: 0.25rem;

}

.kpi-label {

    font-size: 0.82rem;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: .04em;

    /* P2.3: Poprawiony kontrast — #4a5059 daje 5.2:1 na białym tle (było #5f666d = 4.28:1) */
    color: #4a5059;

    margin-bottom: 0.6rem;

}

.kpi-link {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 0.8rem;

    font-weight: 600;

    text-decoration: none;

    /* P3.2 / 2.5.8: Target size min 24px (WCAG 2.2) */
    min-height: 28px;
    padding: 0.2rem 0.7rem;

    border-radius: 20px;

    background: #f1f3f5;

    color: inherit;

    transition: background .15s;

}

.kpi-link:hover { background: #e9ecef; }



/* Stany kart KPI */

.kpi-ok    { border-color: var(--success-color); }

.kpi-ok    .kpi-value { color: var(--success-color); }

.kpi-warning { border-color: #fd7e14; }

.kpi-warning .kpi-value { color: #fd7e14; }

.kpi-danger  { border-color: var(--danger-color); }

.kpi-danger  .kpi-value { color: var(--danger-color); }

.kpi-info    { border-color: #0d6efd; }

.kpi-info    .kpi-value { color: #0d6efd; }

.kpi-neutral { border-color: #6c757d; }

.kpi-neutral .kpi-value { color: #5f666d; }



/* Dashboard Stats */

.stats-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

    gap: 1.5rem;

    margin-top: 2rem;

}

.stat-card {

    background: #f8f9fa;

    padding: 1.5rem;

    border-radius: 8px;

    border: 1px solid #dee2e6;

    text-align: center;

}

.stat-card h3 {

    margin-bottom: 0.5rem;

    color: #495057;

    font-size: 1.1rem;

}

.stat-number {

    font-size: 2.5rem;

    font-weight: bold;

    color: var(--primary-color, #002d69);

}



/* Tabele w panelu admina */

.admin-table {

    width: 100%;

    border-collapse: collapse;

    margin-top: 1rem;

}

.admin-table th, .admin-table td {

    padding: 0.75rem;

    border-bottom: 1px solid #dee2e6;

    text-align: left;

}

.admin-table th {

    background-color: #f8f9fa;

    font-weight: 600;

}

.admin-actions {

    display: flex;

    gap: 0.5rem;

}

/* Buttons */

.btn {

    display: inline-block;

    padding: 0.6rem 1.2rem;

    font-size: 1rem;

    font-weight: 600;

    text-align: center;

    text-decoration: none;

    border-radius: 6px;

    cursor: pointer;

    border: 2px solid transparent;

    transition: all 0.2s;

    line-height: 1.2;

}



.btn:focus-visible {

    outline: 3px solid #ffbf47;

    outline-offset: 3px;

}


.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}



input[type="checkbox"],

input[type="radio"] {

    width: 24px;

    height: 24px;

}



.btn-primary {

    background-color: #002d69;

    color: white;

}

.btn-primary:hover {

    background-color: #001f4d;

    color: white;

}



.btn-secondary {

    background-color: #6c757d;

    color: white;

}

.btn-secondary:hover {

    background-color: #5a6268;

    color: white;

}



.btn-danger {

    background-color: #d73a49;

    color: white;

}

.btn-danger:hover {

    background-color: #b31d28;

    color: white;

}



/* Status Badges */

.badge {

    display: inline-block;

    padding: 0.25rem 0.6rem;

    font-size: 0.75rem;

    font-weight: 700;

    line-height: 1;

    text-align: center;

    white-space: nowrap;

    vertical-align: baseline;

    border-radius: 1rem;

}

.badge-warning {

    background-color: #ffbf47;

    color: #000;

}

.badge-success {

    background-color: #d4edda;

    color: #155724;

}

.badge-secondary {

    background-color: #e9ecef;

    color: #212529;

}

.badge-danger {

    background-color: #f8d7da;

    color: #721c24;

}



/* Alert Messages */

.alert {

    padding: 1rem;

    border-radius: 6px;

    margin-bottom: 1.5rem;

    border: 1px solid transparent;

}

.alert-success {

    background-color: #d4edda;

    color: #155724;

    border-color: #c3e6cb;

}

.alert-danger {

    background-color: #f8d7da;

    color: #721c24;

    border-color: #f5c6cb;

}

.alert-warning {

    background-color: #fff3cd;

    color: #856404;

    border-color: #ffeeba;

}



.text-muted {

    color: #6c757d;

}



.text-success {

    color: var(--success-color);

}



.text-danger {

    color: var(--danger-color);

}



.text-primary {

    color: var(--primary-color, #002d69);

}



.admin-surface {

    background: #ffffff;

    border: 1px solid #dee2e6;

    border-radius: 8px;

}



.admin-surface--pad {

    padding: 1.5rem;

}



.admin-surface--compact {

    padding: 1rem;

}



.admin-surface--accent-success {

    border-left: 4px solid var(--success-color);

    border-radius: 0 8px 8px 0;

}



.inquiry-card {

    border: 1px solid #eee;

    padding: 1rem;

    border-radius: 8px;

    margin-bottom: 1rem;

}



.inquiry-card--negative {

    background: #fff5f5;

}



.inquiry-card--positive {

    background: #f0fff4;

}



.inquiry-card--neutral {

    background: #ffffff;

}



[data-theme="dark"] .inquiry-card {

    border-color: var(--border-color);

    background: var(--card-bg);

}



[data-theme="dark"] .inquiry-card--negative {

    background: rgba(251, 113, 133, 0.08);

}



[data-theme="dark"] .inquiry-card--positive {

    background: rgba(74, 222, 128, 0.08);

}



[data-theme="dark"] .inquiry-card--neutral {

    background: var(--card-bg);

}



.admin-split-layout {

    display: flex;

    gap: 2rem;

    flex-wrap: wrap;

}



.admin-split-layout__main {

    flex: 2;

    min-width: 400px;

}



.admin-split-layout__side {

    flex: 1;

    min-width: 300px;

}



.admin-inline-status-success {

    color: var(--success-color);

    font-weight: 600;

}



.admin-inline-status-danger {

    color: var(--danger-color);

    font-weight: 600;

}



[data-theme="dark"] .text-muted,

[data-theme="dark"] .admin-footer,

[data-theme="dark"] .dashboard-header p,

[data-theme="dark"] .admin-surface,

[data-theme="dark"] .admin-surface .text-muted {

    color: var(--text-muted);

}



[data-theme="dark"] .text-success,

[data-theme="dark"] .admin-inline-status-success,

[data-theme="dark"] .analytics-yes {

    color: #4ade80;

}



[data-theme="dark"] .text-danger,

[data-theme="dark"] .admin-inline-status-danger,

[data-theme="dark"] .analytics-no {

    color: #fb7185;

}



[data-theme="dark"] .text-primary {

    color: var(--primary-color);

}



[data-theme="dark"] .admin-surface {

    background: var(--card-bg);

    border-color: var(--border-color);

}



.alert-info {

    background-color: #d1ecf1;

    color: #0c5460;

    border-color: #bee5eb;

}



.settings-sections-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color, #dee2e6);
    padding-bottom: 0.75rem;
}

.settings-sections-menu__btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted, #5f666d);
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.settings-sections-menu__btn:hover {
    background: rgba(0, 45, 105, 0.05);
    color: var(--primary-color, #002d69);
}

.settings-sections-menu__btn.is-active {
    background: var(--primary-color, #002d69);
    color: #ffffff;
    border-color: var(--primary-color, #002d69);
    box-shadow: 0 4px 12px rgba(0, 45, 105, 0.18);
}

[data-theme="dark"] .settings-sections-menu__btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}



.settings-section {

    display: none;

}



.settings-section.is-active,
.settings-section:not([hidden]).is-active {
    display: block !important;
}



.settings-mail-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));

    gap: 1rem;

}



.settings-variables-box {

    background: #f8f9fa;

    border: 1px solid #dee2e6;

    border-radius: 8px;

    padding: 0.9rem;

}



.settings-variables-list {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));

    gap: 0.5rem;

}



.settings-variable-item {

    background: #fff;

    border: 1px solid #e9ecef;

    border-radius: 6px;

    padding: 0.55rem 0.65rem;

    display: grid;

    gap: 0.25rem;

}



.settings-variable-item code {

    color: var(--primary-color, #002d69);

    font-weight: 700;

}



@media (max-width: 576px) {

    .settings-sections-menu__btn {

        flex: 1 1 calc(50% - 0.5rem);

        text-align: center;

    }

}



/* Drag & Drop – Sortowanie pytań w podkategoriach (sort_questions.php) */

.sq-category-block {

    margin-bottom: 2rem;

}

.sq-cat-title {

    font-size: 1.1rem;

    font-weight: 700;

    color: var(--primary-color, #002d69);

    padding: .5rem .75rem;

    background: rgba(77, 171, 247, 0.16);

    border-left: 4px solid var(--primary-color, #002d69);

    border-radius: 4px;

    margin-bottom: .75rem;

}

.sq-sub-block {

    background: #fff;

    border: 1px solid #dee2e6;

    border-radius: 8px;

    margin-bottom: 1rem;

    overflow: hidden;

}

.sq-sub-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: .6rem 1rem;

    background: #f8f9fa;

    border-bottom: 1px solid #dee2e6;

    font-weight: 600;

    font-size: .9rem;

}

.sq-sub-name { color: #495057; }

.sq-count {

    font-size: .75rem;

    font-weight: 400;

    color: #495057;

    background: #e9ecef;

    border-radius: 20px;

    padding: .1rem .6rem;

}

.sq-question-list {

    list-style: none;

    margin: 0;

    padding: .25rem 0;

}

.sq-question-row {

    display: flex;

    align-items: center;

    gap: .75rem;

    padding: .55rem 1rem;

    border-bottom: 1px solid #f0f0f0;

    background: #fff;

    transition: background .12s;

    cursor: default;

}

.sq-question-row:last-child { border-bottom: none; }

.sq-question-row:hover { background: #f8f9fa; }

.sq-drag-handle {

    cursor: grab;

    color: #495057;

    font-size: 1rem;

    padding: .15rem .2rem;

    border-radius: 3px;

    flex-shrink: 0;

    transition: color .15s;

}

.sq-drag-handle:hover { color: #495057; }

.sq-drag-handle:active { cursor: grabbing; }

.sq-question-text {

    flex: 1;

    font-size: .88rem;

    color: #212529;

    min-width: 0;

    white-space: normal;

    overflow-wrap: anywhere;

}

.sq-order-badge {

    font-size: .72rem;

    font-weight: 700;

    color: #495057;

    background: #e9ecef;

    border-radius: 20px;

    padding: .1rem .55rem;

    min-width: 1.6rem;

    text-align: center;

    flex-shrink: 0;

    transition: background .2s, color .2s;

}

.sq-ghost {

    opacity: .4;

    background: #cfe2ff !important;

    border: 2px dashed #0d6efd !important;

}

.sq-chosen {

    box-shadow: 0 4px 16px rgba(0,0,0,.14);

    z-index: 10;

}



/* Drag & Drop – Sortable categories */

.dnd-hint {

    font-size: 0.82rem;

    color: #6c757d;

    margin-bottom: 1rem;

}

.sortable-list { display: flex; flex-direction: column; gap: 0.5rem; }

.sortable-cat-row {

    background: #f8f9fa;

    border: 1px solid #dee2e6;

    border-radius: 8px;

    overflow: hidden;

}

.sortable-row-header {

    display: flex;

    align-items: center;

    gap: 0.6rem;

    padding: 0.65rem 0.9rem;

    background: #f0f2f5;

    border-bottom: 1px solid #dee2e6;

}

.sortable-cat-row > .sortable-row-header { font-size: 1rem; }

.sortable-row-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sortable-row-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

.drag-handle {

    cursor: grab;

    color: #495057;

    font-size: 1.1rem;

    padding: 0 0.2rem;

    -webkit-user-select: none;

    user-select: none;

    flex-shrink: 0;

}

.drag-handle:active { cursor: grabbing; }

.sortable-sub-list {

    display: flex;

    flex-direction: column;

    gap: 0;

    padding: 0.25rem 0;

}

.sortable-sub-row {

    display: flex;

    align-items: center;

    gap: 0.6rem;

    padding: 0.45rem 0.9rem 0.45rem 1.5rem;

    font-size: 0.9rem;

    border-top: 1px solid #e9ecef;

}

.sortable-sub-row:first-child { border-top: none; }

.sortable-ghost {

    opacity: 0.4;

    background: #cfe2ff !important;

    border: 2px dashed #0d6efd !important;

}

.sortable-chosen { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.sort-status {

    margin-top: 0.75rem;

    font-size: 0.82rem;

    color: var(--success-color);

    font-weight: 600;

}



/* Utility classes */

.mt-3 { margin-top: 1rem; }

.mb-3 { margin-bottom: 1rem; }

.admin-grid {

    display: grid;

    gap: 1.25rem;

    align-items: start;

}

.admin-grid--2-1 {

    grid-template-columns: 1fr 2fr;

}

.admin-grid--1-1 {

    grid-template-columns: 1fr 1fr;

}

@media (max-width: 992px) {

    .admin-grid--2-1,

    .admin-grid--1-1 {

        grid-template-columns: 1fr;

    }

}

.card {

    background: var(--card-bg, #ffffff);

    padding: 1.5rem;

    border-radius: 8px;

    border: 1px solid #dee2e6;

    box-shadow: 0 2px 4px rgba(0,0,0,0.05);

}





.form-group-admin {

    margin-bottom: 1rem;

}

.form-group-admin label,

.form-label {

    display: block;

    margin-bottom: 0.5rem;

    font-weight: bold;

}



/* Formularz dodawania użytkownika – responsywny grid */

.add-user-grid {

    display: grid;

    grid-template-columns: 1fr 1fr 1fr 1fr auto;

    gap: 1rem;

    align-items: flex-end;

}



@media (max-width: 992px) {

    .add-user-grid {

        grid-template-columns: 1fr 1fr;

    }

    .add-user-grid > div:last-child {

        grid-column: 1 / -1;

    }

    .add-user-grid .btn {

        width: 100%;

    }

}



@media (max-width: 576px) {

    .add-user-grid {

        grid-template-columns: 1fr;

    }

}

.form-control {

    width: 100%;

    padding: 0.75rem;

    border: 1px solid #ced4da;

    border-radius: 6px;

    font-size: 1rem;

    line-height: 1.25;

}



.admin-form-control--narrow {

    max-width: 180px;

}



.form-control:focus,

.form-control:focus-visible {

    outline: 3px solid #ffbf47;

    outline-offset: 2px;

    border-color: #0d6efd;

}



.field-error {

    color: var(--danger-color);

    font-size: 0.9rem;

    margin-top: 0.35rem;

    font-weight: 700;

}



.audit-filters {

    display: flex;

    flex-wrap: wrap;

    gap: 1rem;

    align-items: flex-end;

}

.audit-filters .form-group-admin {

    flex: 1 1 220px;

    min-width: 200px;

}



.admin-audit-table .audit-cell {

    vertical-align: top;

    max-width: 1px;

    overflow-wrap: anywhere;

    word-break: break-word;

}

.admin-audit-table .audit-cell-action {

    max-width: 34ch;

}

.admin-audit-table .audit-cell-action .badge {

    white-space: normal;

    overflow-wrap: anywhere;

    word-break: break-word;

    max-width: 100%;

    line-height: 1.2;

    text-align: left;

}

.admin-audit-table .audit-cell-action {

    overflow: hidden;

}

.admin-audit-table .audit-cell-details {

    max-width: 80ch;

}



.audit-action-badge {

    display: inline-block;

    background: #f0f7ff;

    color: var(--primary-color, #002d69);

    padding: 2px 8px;

    border-radius: 4px;

    font-weight: 700;

}



.audit-details {

    font-size: 0.9rem;

    color: var(--text-muted, #555);

}



.user-role-badge {

    display: inline-block;

    background: #eee;

    padding: 2px 8px;

    border-radius: 4px;

}



.user-status.is-active { color: var(--success-color); }

.user-status.is-blocked { color: var(--danger-color); }



.dash-top5-badge {

    background: #e9f0fb;

    color: var(--primary-color, #002d69);

    font-weight: 700;

    border-radius: 20px;

    padding: .15rem .7rem;

    font-size: .85rem;

    white-space: nowrap;

}



.analytics-no {

    color: var(--danger-color);

    font-weight: 700;

}



.analytics-yes {

    color: var(--success-color);

    font-weight: 700;

}



.admin-body,

.admin-header,

.admin-sidebar,

.admin-main,

.admin-nav a,

.admin-table th,

.admin-table td,

.card,

.form-control,

.sa-modal__panel {

    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;

}



@media (prefers-reduced-motion: reduce) {

    .admin-body,

    .admin-header,

    .admin-sidebar,

    .admin-main,

    .admin-nav a,

    .admin-table th,

    .admin-table td,

    .card,

    .form-control,

    .sa-modal__panel {

        transition: none;

    }

}



[data-theme="dark"] .admin-body {

    background-color: var(--bg-color);

    color: var(--text-color);

}



[data-theme="dark"] .admin-header {

    background-color: #0b1220;

    color: var(--text-color);

}



[data-theme="dark"] .admin-header .logo a {

    color: var(--text-color);

}



[data-theme="dark"] .admin-sidebar,

[data-theme="dark"] .admin-main,

[data-theme="dark"] .card,

[data-theme="dark"] .sa-modal__panel,

[data-theme="dark"] .stat-card,

[data-theme="dark"] .kpi-card,

[data-theme="dark"] .sq-sub-block,

[data-theme="dark"] .sq-question-row,

[data-theme="dark"] .sortable-cat-row {

    background: var(--card-bg);

    border-color: var(--border-color);

    box-shadow: var(--shadow);

}



[data-theme="dark"] .admin-nav li {

    border-bottom-color: var(--border-color);

}



[data-theme="dark"] .admin-nav a {

    color: var(--text-muted);

}



[data-theme="dark"] .admin-nav a:hover,

[data-theme="dark"] .admin-nav a:focus {

    background-color: rgba(77, 171, 247, 0.16);

    color: var(--text-color);

    box-shadow: inset 4px 0 0 var(--primary-color);

}



[data-theme="dark"] .admin-table th,

[data-theme="dark"] .admin-table td {

    border-bottom-color: var(--border-color);

}



[data-theme="dark"] .admin-table th {

    background-color: #161616;

}



[data-theme="dark"] .admin-footer {

    color: var(--text-muted);

}



[data-theme="dark"] .stat-number {

    color: var(--primary-color);

}



[data-theme="dark"] .audit-action-badge {

    background: #161616;

    color: var(--primary-color);

    border: 1px solid rgba(77, 171, 247, 0.25);

}



[data-theme="dark"] .audit-details {

    color: var(--text-muted);

}



[data-theme="dark"] .user-role-badge {

    background: #161616;

    border: 1px solid var(--border-color);

    color: var(--text-color);

}



[data-theme="dark"] .badge-success,

[data-theme="dark"] .user-status.is-active {

    color: #b7f7cb;

}



[data-theme="dark"] .user-status.is-blocked {

    color: #fecdd3;

}



[data-theme="dark"] .field-error {

    color: #fecdd3;

}



[data-theme="dark"] .audit-details,

[data-theme="dark"] .audit-action-badge,

[data-theme="dark"] .settings-sections-menu__btn,

[data-theme="dark"] .dashboard-header p,

[data-theme="dark"] .form-group-admin small,

[data-theme="dark"] small,

[data-theme="dark"] .admin-footer {

    color: var(--text-muted);

}



[data-theme="dark"] input[type="checkbox"],

[data-theme="dark"] input[type="radio"] {

    accent-color: var(--primary-color);

}



[data-theme="dark"] input[type="checkbox"]:focus-visible,

[data-theme="dark"] input[type="radio"]:focus-visible {

    outline: 3px solid #ffffff;

    outline-offset: 2px;

}



[data-theme="dark"] .dash-top5-badge {

    background: #161616;

    color: var(--primary-color);

    border: 1px solid rgba(77, 171, 247, 0.25);

}



[data-theme="dark"] .analytics-no {

    color: #fb7185;

}



[data-theme="dark"] .analytics-yes {

    color: #4ade80;

}



[data-theme="dark"] .user-status.is-active { color: #4ade80; }

[data-theme="dark"] .user-status.is-blocked { color: #fb7185; }



[data-theme="dark"] .form-control {

    background: var(--card-bg);

    color: var(--text-color);

    border-color: var(--border-color);

}



[data-theme="dark"] .form-control:focus,

[data-theme="dark"] .form-control:focus-visible {

    outline: 3px solid #ffffff;

    outline-offset: 2px;

    border-color: var(--primary-color);

}



[data-theme="dark"] .alert-success {

    background-color: rgba(74, 222, 128, 0.14);

    color: #b7f7cb;

    border-color: rgba(74, 222, 128, 0.45);

}



[data-theme="dark"] .alert-danger {

    background-color: rgba(251, 113, 133, 0.14);

    color: #fecdd3;

    border-color: rgba(251, 113, 133, 0.45);

}



[data-theme="dark"] .alert-warning {

    background-color: rgba(255, 191, 71, 0.16);

    color: #ffe2a8;

    border-color: rgba(255, 191, 71, 0.45);

}



[data-theme="dark"] .alert-info {

    background-color: rgba(77, 171, 247, 0.16);

    color: #d6eeff;

    border-color: rgba(77, 171, 247, 0.45);

}



[data-theme="dark"] .badge-success {

    background-color: rgba(74, 222, 128, 0.18);

    color: #b7f7cb;

}



[data-theme="dark"] .badge-danger {

    background-color: rgba(251, 113, 133, 0.18);

    color: #fecdd3;

}



[data-theme="dark"] .badge-secondary {

    background-color: #2b313a;

    color: var(--text-color);

}



[data-theme="dark"] .badge-warning {

    background-color: rgba(255, 191, 71, 0.22);

    color: #ffe2a8;

}



.admin-confirm-modal {

    position: fixed;

    inset: 0;

    z-index: 10050;

    display: grid;

    place-items: center;

    padding: 1rem;

}



.admin-confirm-modal[hidden] {

    display: none !important;

    pointer-events: none !important;

}



.admin-confirm-modal__overlay {

    position: absolute;

    inset: 0;

    background: rgba(15, 23, 42, 0.58);

    -webkit-backdrop-filter: blur(2px);

    backdrop-filter: blur(2px);

    z-index: 0;

}



.admin-confirm-modal__panel {

    position: relative;

    z-index: 1;

    width: min(520px, calc(100vw - 2rem));

    max-height: calc(100vh - 2rem);

    overflow: auto;

    background: #ffffff;

    border: 1px solid #d7dde4;

    border-radius: 14px;

    box-shadow: 0 22px 52px rgba(2, 12, 27, 0.28);

    animation: adminConfirmIn 0.18s ease-out;

}



@keyframes adminConfirmIn {

    from {

        opacity: 0;

        transform: translateY(8px) scale(0.985);

    }

    to {

        opacity: 1;

        transform: translateY(0) scale(1);

    }

}



.admin-confirm-modal__panel::before {

    content: "";

    position: absolute;

    inset: 0 auto 0 0;

    width: 5px;

    background: var(--primary-color, #002d69);

    border-radius: 14px 0 0 14px;

}



.admin-confirm-modal__head {

    padding: 0.9rem 1rem;

    background: #eef4ff;

    color: #0b1f44;

    border-bottom: 1px solid #d6e2fb;

}



.admin-confirm-modal__head h3 {

    margin: 0;

    font-size: 1.08rem;

    font-weight: 800;

    line-height: 1.25;

    color: inherit;

}



.admin-confirm-modal__body {

    padding: 0.9rem 1rem;

    background: #ffffff;

    color: #10243f;

}



.admin-confirm-modal__body p {

    margin: 0;

    font-size: 1rem;

    line-height: 1.45;

    font-weight: 500;

    color: inherit;

}



.admin-confirm-modal__footer {

    padding: 0.85rem 1rem;

    background: #f7faff;

    border-top: 1px solid #dde7f7;

    display: flex;

    justify-content: flex-end;

    gap: 0.6rem;

}



.admin-confirm-modal__btn {

    min-width: 120px;

    border-radius: 10px;

    font-weight: 700;

    letter-spacing: 0.01em;

}



.admin-confirm-modal__btn:focus-visible {

    outline: 3px solid #ffbf47;

    outline-offset: 2px;

}



.admin-confirm-modal__btn--cancel {

    background: #667085;

    border-color: #667085;

    color: #ffffff;

}



.admin-confirm-modal__btn--cancel:hover {

    background: #4f5b6d;

    border-color: #4f5b6d;

    color: #ffffff;

}



[data-theme="dark"] .admin-confirm-modal__btn--cancel {

    background: #475569;

    border-color: #475569;

    color: #f8fafc;

}



[data-theme="dark"] .admin-confirm-modal__btn--cancel:hover {

    background: #334155;

    border-color: #334155;

    color: #ffffff;

}



[data-theme="dark"] .admin-confirm-modal__btn--accept {

    background: #d85b4e;

    border-color: #d85b4e;

    color: #fff7f7;

}



[data-theme="dark"] .admin-confirm-modal__btn--accept:hover {

    background: #c44b40;

    border-color: #c44b40;

    color: #ffffff;

}



@media (prefers-reduced-motion: reduce) {

    .admin-confirm-modal__panel {

        animation: none;

    }

}



[data-theme="dark"] .admin-confirm-modal__overlay {

    background: rgba(0, 0, 0, 0.72);

}



[data-theme="dark"] .admin-confirm-modal__panel {

    background: #0f172a;

    border-color: #2a3647;

    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.6);

}



[data-theme="dark"] .admin-confirm-modal__head {

    background: #0b1220;

    color: #e5edff;

    border-bottom-color: #253448;

}



[data-theme="dark"] .admin-confirm-modal__body {

    background: #0f172a;

    color: #e8eefb;

}



[data-theme="dark"] .admin-confirm-modal__footer {

    background: #0b1220;

    border-top-color: #253448;

}



[data-theme="dark"] .btn-primary {

    background-color: var(--primary-color);

    color: #000000;

}



[data-theme="dark"] .btn-primary:hover {

    background-color: var(--primary-hover);

    color: #000000;

}



[data-theme="dark"] .btn-secondary {

    background-color: #4b5563;

    color: #f9fafb;

}



[data-theme="dark"] .btn-secondary:hover {

    background-color: #374151;

    color: #ffffff;

}



[data-theme="dark"] .btn-logout {

    background: #ffbf47;

    color: #111111;

    border-color: #ffbf47;

}



[data-theme="dark"] .btn-logout:hover {

    background: #ffbf47;

    color: #111111;

    border-color: #ffbf47;

    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);

}



[data-theme="dark"] .btn-logout__icon {

    color: #111111;

}



[data-theme="dark"] .admin-impersonation-banner {

    background: rgba(255, 191, 71, 0.16);

    border-bottom-color: rgba(255, 191, 71, 0.35);

    color: var(--text-color);

}



[data-theme="dark"] .kpi-link {

    background: #161616;

    color: var(--text-color);

    border: 1px solid var(--border-color);

}



[data-theme="dark"] .kpi-label,

[data-theme="dark"] .kpi-neutral .kpi-value,

[data-theme="dark"] .stat-card h3,

[data-theme="dark"] .sq-sub-name,

[data-theme="dark"] .sq-count,

[data-theme="dark"] .sq-order-badge {

    color: var(--text-muted);

}



[data-theme="dark"] .sq-cat-title {

    background: #161616;

    color: var(--text-color);

    border-left-color: var(--primary-color);

}



[data-theme="dark"] .sq-sub-header {

    background: #161616;

    border-bottom-color: var(--border-color);

}



[data-theme="dark"] .sq-count,

[data-theme="dark"] .sq-order-badge {

    background: #161616;

}



[data-theme="dark"] .sq-question-row:hover {

    background: rgba(255, 255, 255, 0.03);

}



[data-theme="dark"] .sq-question-text {

    color: var(--text-color);

}



[data-theme="dark"] .sq-drag-handle {

    color: var(--text-muted);

}



.inq-unread {

    background: #f0f6ff;

}



[data-theme="dark"] .inq-unread {

    background: #0f1f33;

}



[data-theme="dark"] .sortable-row-header {

    background: #161616;

    border-bottom-color: var(--border-color);

}



[data-theme="dark"] .sortable-sub-row {

    border-top-color: var(--border-color);

}



[data-theme="dark"] .admin-main [style*="background: white"],

[data-theme="dark"] .admin-main [style*="background:white"],

[data-theme="dark"] .admin-main [style*="background: #fff"],

[data-theme="dark"] .admin-main [style*="background:#fff"],

[data-theme="dark"] .admin-main [style*="background: #f8f9fa"],

[data-theme="dark"] .admin-main [style*="background:#f8f9fa"],

[data-theme="dark"] .admin-main [style*="background: #f1f3f5"],

[data-theme="dark"] .admin-main [style*="background:#f1f3f5"],

[data-theme="dark"] .admin-main [style*="background: #e9ecef"],

[data-theme="dark"] .admin-main [style*="background:#e9ecef"],

[data-theme="dark"] .admin-main [style*="background: #f0f2f5"],

[data-theme="dark"] .admin-main [style*="background:#f0f2f5"],

[data-theme="dark"] .admin-main [style*="background-color: #fff"],

[data-theme="dark"] .admin-main [style*="background-color:#fff"],

[data-theme="dark"] .admin-main [style*="background-color: white"],

[data-theme="dark"] .admin-main [style*="background-color:white"] {

    background: var(--card-bg) !important;

    color: var(--text-color) !important;

    border-color: var(--border-color) !important;

}



[data-theme="dark"] .admin-main [style*="background: #e9f0fb"],

[data-theme="dark"] .admin-main [style*="background:#e9f0fb"] {

    background: rgba(77, 171, 247, 0.16) !important;

    color: var(--text-color) !important;

    border-color: rgba(77, 171, 247, 0.25) !important;

}



[data-theme="dark"] .admin-main [style*="background: #f0f7ff"],

[data-theme="dark"] .admin-main [style*="background:#f0f7ff"] {

    background: rgba(77, 171, 247, 0.16) !important;

    color: var(--text-color) !important;

    border-color: rgba(77, 171, 247, 0.25) !important;

}



[data-theme="dark"] .admin-main [style*="color:#002d69"],

[data-theme="dark"] .admin-main [style*="color: #002d69"] {

    color: var(--primary-color) !important;

}



[data-theme="dark"] .admin-main [style*="color:#212529"],

[data-theme="dark"] .admin-main [style*="color: #212529"] {

    color: var(--text-color) !important;

}



[data-theme="dark"] .admin-main [style*="color:#495057"],

[data-theme="dark"] .admin-main [style*="color: #495057"],

[data-theme="dark"] .admin-main [style*="color:#5f666d"],

[data-theme="dark"] .admin-main [style*="color: #5f666d"],

[data-theme="dark"] .admin-main [style*="color:#6c757d"],

[data-theme="dark"] .admin-main [style*="color: #6c757d"],

[data-theme="dark"] .admin-main [style*="color:#666"],

[data-theme="dark"] .admin-main [style*="color: #666"],

[data-theme="dark"] .admin-main [style*="color:#555"],

[data-theme="dark"] .admin-main [style*="color: #555"] {

    color: var(--text-muted) !important;

}


/* ==========================================================================
   PREMIUM UI/UX & WCAG 2.2 AA: NAGŁÓWEK I SEKCE TOP 5
   ========================================================================== */

/* 1. Ulepszona stylizacja przycisków w nagłówku administratora */
.admin-header .btn-secondary {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    padding: 0.4rem 0.85rem !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    cursor: pointer !important;
}

.admin-header .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.admin-header .btn-secondary:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

.admin-header .btn-secondary:focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 1px !important;
    box-shadow: 0 0 0 2px #343a40, 0 0 0 5px #ffbf47 !important;
}

/* 2. Segmented Control dla wyboru rozmiaru czcionki */
.admin-header .admin-font-controls {
    display: inline-flex !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 3px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    gap: 2px !important;
}

.admin-header .admin-font-controls .btn-secondary {
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    min-width: 34px !important;
    min-height: 30px !important;
    padding: 0 0.5rem !important;
    box-shadow: none !important;
}

.admin-header .admin-font-controls .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    transform: none !important;
}

.admin-header .admin-font-controls .btn-secondary:focus-visible {
    outline: 2px solid #ffbf47 !important;
    outline-offset: 0 !important;
}

/* 3. Optymalizacja układu nagłówka i zapobieganie zawijaniu */
.admin-header .header-flex {
    align-items: center !important;
    justify-content: space-between !important;
}

.admin-header .user-info {
    display: flex !important;
    align-items: center !important;
    gap: 1.25rem !important;
    flex-wrap: nowrap !important; /* Blokada przedwczesnego zawijania */
}

.admin-header .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
}

@media (max-width: 1300px) {
    .admin-header .user-info {
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
    }
}

@media (max-width: 992px) {
    .admin-header .user-info {
        gap: 0.75rem !important;
    }
}

@media (max-width: 768px) {
    .admin-header .header-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .admin-header .user-info {
        justify-content: center !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        gap: 0.75rem !important;
    }
    
    .admin-header .header-controls {
        justify-content: center !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 0.5rem !important;
    }
}

/* 4. Lekki, elegancki styl dla sekcji Top 5 w Dashboardzie (jak na pierwszym zrzucie) */
.admin-top5-list-clean {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.admin-top5-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    padding: 0.6rem 0 !important;
    border-bottom: 1px solid var(--border-color, #dee2e6) !important;
    flex-wrap: wrap !important;
}

.admin-top5-row:last-child {
    border-bottom: none !important;
}

.admin-top5-number-clean {
    color: var(--primary-color, #002d69) !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    min-width: 1.5rem !important;
}

.admin-top5-row .question-title {
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    color: var(--text-color) !important;
    display: block !important;
    line-height: 1.4 !important;
}

/* 5. Obsługa motywów (Ciemny i Wysoki Kontrast) */

/* Motyw Ciemny [data-theme="dark"] */
[data-theme="dark"] .admin-header .btn-secondary {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .admin-header .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .admin-header .admin-font-controls {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .admin-top5-row {
    border-bottom-color: var(--border-color) !important;
}

/* Motyw Wysokiego Kontrastu [data-theme="high-contrast"] */
[data-theme="high-contrast"] .admin-header .btn-secondary {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffffff !important;
}

[data-theme="high-contrast"] .admin-header .btn-secondary:hover,
[data-theme="high-contrast"] .admin-header .btn-secondary:focus-visible {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #ffff00 !important;
}

[data-theme="high-contrast"] .admin-header .admin-font-controls {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    padding: 1px !important;
}

[data-theme="high-contrast"] .admin-header .admin-font-controls .btn-secondary {
    border: none !important;
}

[data-theme="high-contrast"] .admin-header .admin-font-controls .btn-secondary:hover {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

[data-theme="high-contrast"] .admin-top5-row {
    border-bottom: 1px solid #ffffff !important;
}

[data-theme="high-contrast"] .admin-top5-number-clean {
    color: #00ff00 !important;
}

[data-theme="high-contrast"] .admin-top5-row .question-title {
    color: #ffff00 !important;
}


/* ============================================================
   Styles extracted from admin/contacts.php
   ============================================================ */

.grid-two { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.grid-four { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.admin-table { table-layout: auto !important; border-collapse: collapse !important; border-spacing: 0 !important; }
.admin-table tbody tr > td { border-bottom: 1px solid var(--border-color, #dee2e6) !important; }
.admin-table th:last-child, .admin-table td.actions-cell { white-space: nowrap; }
.actions-cell { display: table-cell !important; text-align: left; vertical-align: middle; padding: 0.5rem 0.75rem !important; }
.actions-cell form { margin: 0; display: inline-block; }
.actions-cell .btn { display: inline-block; vertical-align: middle; white-space: nowrap; }

/* Tabela użytkowników - kolumna akcji */
.users-table { table-layout: auto !important; width: 100%; }
.users-table td, .users-table th { vertical-align: middle !important; }
.users-table td:last-child { width: auto; min-width: 0; white-space: normal; }
.users-actions-cell { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 0.4rem !important; align-items: center !important; padding: 0.5rem 0.75rem !important; min-width: 0; }
.users-actions-cell form { margin: 0 !important; display: inline-flex !important; }
.users-actions-cell select.form-control { min-width: 110px; max-width: 140px; font-size: 0.82rem !important; padding: 0.3rem 0.45rem !important; height: auto !important; }
.users-actions-cell .btn { white-space: nowrap !important; font-size: 0.82rem !important; padding: 0.3rem 0.65rem !important; }
.people-table th, .people-table td { vertical-align: top; word-break: normal !important; overflow-wrap: anywhere; }
.people-table th.col-person, .people-table td.person-cell { min-width: 18rem; width: 24%; }
.people-table th.col-status, .people-table td.status-cell { text-align: center; width: 5.5rem; min-width: 5.5rem; }
.people-table th.col-actions, .people-table td.actions-cell-stack { width: 7.5rem; min-width: 7.5rem; }
.person-name { font-weight: 700; margin-bottom: 0.35rem; }
.person-meta-line { margin-bottom: 0.15rem; }
.person-meta-line:last-child { margin-bottom: 0; }
.person-meta-label { color: var(--text-muted); font-weight: 600; }
.status-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.65rem; height: 1.65rem; border-radius: 999px; font-size: 0.95rem; font-weight: 800; border: 1px solid transparent; }
.status-icon.is-active { color: #0f5132; background: #d1e7dd; border-color: #badbcc; }
.status-icon.is-inactive { color: #842029; background: #f8d7da; border-color: #f5c2c7; }
.people-table .actions-cell-stack { display: table-cell !important; text-align: left; vertical-align: top; }
.people-table .actions-cell-stack .actions-cell-inner { display: flex; flex-direction: column; align-items: stretch; gap: 0.45rem; }
.people-table .actions-cell-stack form { margin: 0; width: 100%; display: block; }
.people-table .actions-cell-stack .btn { width: 100%; text-align: center; }
.cell-more { margin-top: 0.35rem; }
.cell-more summary { cursor: pointer; color: var(--primary-color); font-weight: 600; font-size: 0.82rem; }
.cell-more-content { margin-top: 0.3rem; color: var(--text-muted); font-size: 0.86rem; }
.checkbox-group { border: 1px solid var(--border-color); border-radius: 8px; padding: 0.5rem; max-height: 260px; overflow: auto; background: var(--card-bg); }
.multi-select-dropdown { border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); }
.multi-select-dropdown summary { padding: 0.7rem 0.9rem; cursor: pointer; font-weight: 600; list-style: none; user-select: none; }
.multi-select-dropdown summary::-webkit-details-marker { display: none; }
.multi-select-dropdown summary::after { content: '\25BE'; float: right; color: var(--text-muted); }
.multi-select-dropdown[open] summary::after { content: '\25B4'; }
.dropdown-checkbox-group { border: 0; border-top: 1px solid var(--border-color); border-radius: 0 0 8px 8px; padding: 0.6rem; max-height: 220px; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.checkbox-row:last-child { margin-bottom: 0; }
.major-grid { display: grid; gap: 0.6rem; }
.major-row { border: 1px solid var(--border-color); border-radius: 8px; padding: 0.6rem; background: var(--card-bg); }
#majors-section.is-hidden { display: none; }
.pagination-bar { display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; }
.pagination-jump { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; }
.pagination-jump .form-control { width: auto; min-width: 5.5rem; }
.pagination-bar .disabled { pointer-events: none; opacity: 0.55; }
.section-help { border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); }
.section-help summary { cursor: pointer; font-weight: 600; padding: 0.65rem 0.85rem; user-select: none; }
.section-help-body { border-top: 1px solid var(--border-color); padding: 0.75rem 0.85rem; background: color-mix(in srgb, var(--card-bg) 88%, var(--border-color) 12%); }
.section-help-body ol { margin-top: 0.35rem; }
@media (max-width: 960px) {
    .grid-two { grid-template-columns: 1fr; }
    .grid-four { grid-template-columns: 1fr; }
    .admin-table th:last-child, .admin-table td.actions-cell { white-space: normal; }
    .people-table th.col-person, .people-table td.person-cell,
    .people-table th.col-actions, .people-table td.actions-cell-stack { min-width: 0; width: auto; }
}

/* ============================================================
   Styles extracted from admin/login.php
   ============================================================ */

.login-container { max-width: 400px; margin: 5rem auto; background: var(--white); padding: 2rem; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-group input { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 6px; }
.error-msg { color: #dc3545; margin-bottom: 1rem; font-weight: bold; }
.login-topbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.25rem; }
.login-topbar .btn-secondary {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
}
.login-topbar .btn-secondary:hover {
    border-color: var(--primary-color);
}
.login-topbar .btn-secondary:focus-visible {
    outline: 3px solid var(--primary-color, #002d69);
    outline-offset: 2px;
    border-color: transparent;
}
.w-full { width: 100%; }
.password-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.password-wrapper input { padding-right: 2.75rem !important; }
.password-toggle-btn { position: absolute; right: 0.25rem; background: none; border: none; cursor: pointer; padding: 0.5rem; display: flex; align-items: center; justify-content: center; color: var(--text-muted, #6c757d); transition: color 0.15s ease, background-color 0.15s ease; border-radius: 6px; width: 36px; height: 36px; }
.password-toggle-btn:hover { color: var(--text-color, #212529); background-color: var(--hover-bg, rgba(0,0,0,0.05)); }
[data-theme="dark"] .password-toggle-btn:hover { background-color: rgba(255,255,255,0.08); }
.password-toggle-btn:focus-visible { outline: 3px solid var(--primary-color, #002d69); outline-offset: -2px; }

/* ============================================================
   Styles extracted from admin/includes/header.php
   ============================================================ */

.ck-editor__editable_inline { min-height: 300px; }
.admin-nav li a.no-access { opacity: 0.5; cursor: not-allowed; }


/* ============================================================
   Styles extracted from admin/chatbot.php
   ============================================================ */

.chatbot-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.85rem 0.75rem;
    border-bottom: 2px solid var(--border-color, #dee2e6);
}

.chatbot-table td {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
}

.chatbot-table tbody tr {
    transition: background-color 0.15s ease;
}

.chatbot-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .chatbot-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.015);
}

.chatbot-table tbody tr:hover {
    background-color: rgba(0, 45, 105, 0.03) !important;
}

[data-theme="dark"] .chatbot-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.date-col {
    white-space: nowrap;
    line-height: 1.3;
}

.date-day {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.date-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.session-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background-color: var(--bg-color, #f1f3f5);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: all 0.2s ease;
}

.session-badge:hover {
    background-color: rgba(0, 45, 105, 0.08);
    border-color: var(--primary-color, #002d69);
    color: var(--primary-color, #002d69);
}

[data-theme="dark"] .session-badge:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--text-color);
    color: var(--text-color);
}

.session-badge:active {
    transform: scale(0.95);
}

.copied-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: #212529;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.15s ease-out;
    pointer-events: none;
    z-index: 10;
}

.copied-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #212529 transparent transparent transparent;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(0); }
    to { opacity: 1; transform: translateX(-50%) translateY(-6px); }
}

.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.source-badge-faq {
    background-color: rgba(20, 122, 50, 0.1);
    color: #147a32;
    border: 1px solid rgba(20, 122, 50, 0.25);
}

.source-badge-json {
    background-color: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.25);
}

.source-badge-fallback {
    background-color: rgba(178, 123, 0, 0.1);
    color: #b27b00;
    border: 1px solid rgba(178, 123, 0, 0.25);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    background-color: var(--bg-color, #f1f3f5);
    color: var(--text-muted);
    border: 1px solid var(--border-color, #dee2e6);
}

.role-badge-admin {
    background-color: rgba(179, 29, 40, 0.08);
    color: #b31d28;
    border-color: rgba(179, 29, 40, 0.15);
}

.question-text-wrapper {
    max-width: 240px;
    word-break: break-word;
    font-weight: 500;
    color: var(--text-color);
}

.answer-text-wrapper {
    max-width: 320px;
    position: relative;
}

.answer-content {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-color);
    word-break: break-word;
}

.answer-collapsed {
    max-height: 4.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--info-color, #0284c7);
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.35rem;
    display: inline-block;
    transition: color 0.15s;
}

.show-more-btn:hover {
    color: var(--primary-color, #002d69);
    text-decoration: underline;
}

[data-theme="dark"] .show-more-btn:hover {
    color: #fff;
}

.col-unanswered-id { width: 60px; }
.col-unanswered-question { width: auto; }
.col-unanswered-count { width: 90px; text-align: center; }
.col-unanswered-first { width: 140px; }
.col-unanswered-last { width: 140px; }
.col-unanswered-actions { width: 100px; text-align: right; }

.col-history-date { width: 130px; }
.col-history-session { width: 120px; }
.col-history-role { width: 90px; }
.col-history-source { width: 120px; }
.col-history-question { width: 25%; }
.col-history-answer { width: auto; }
.col-history-url { width: 100px; text-align: center; }

.chatbot-table .btn-sm {
    min-height: 32px;
    min-width: 32px;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    border-radius: 4px;
}

.col-center { text-align: center !important; }
.col-right { text-align: right !important; }

/* ============================================================
   BBCode formatting styles
   ============================================================ */
.bb-color-black { color: #111111; }
.bb-color-gray { color: #6c757d; }
.bb-color-red { color: #c92a2a; }
.bb-color-green { color: #2b8a3e; }
.bb-color-blue { color: #1c7ed6; }
.bb-color-orange { color: #e8590c; }
.bb-color-yellow { color: #e67700; }
.bb-color-purple { color: #7048e8; }
.bb-size-xs { font-size: .75rem; }
.bb-size-sm { font-size: .875rem; }
.bb-size-md { font-size: 1rem; }
.bb-size-lg { font-size: 1.15rem; }
.bb-size-xl { font-size: 1.35rem; }
.bb-size-xxl { font-size: 1.6rem; }


/* ============================================================
   Styles extracted from admin/instructions.php
   ============================================================ */
    .instructions-container {
        max-width: 1000px;
        margin: 0 auto;
        padding-bottom: 3rem;
    }
    .instructions-header {
        margin-bottom: 2rem;
    }
    .search-box-wrapper {
        position: relative;
        margin-bottom: 2rem;
    }
    .search-input {
        width: 100%;
        padding: 1rem 1.5rem 1rem 3rem;
        font-size: 1.1rem;
        border: 1px solid var(--border-color, #dee2e6);
        border-radius: 12px;
        background: var(--bg-card, #ffffff);
        color: var(--text-color, #212529);
        box-shadow: 0 4px 6px rgba(0,0,0,0.02);
        transition: border-color 0.2s, box-shadow 0.2s;
    }
    .search-input:focus {
        outline: none;
        border-color: var(--primary-color, #0d6efd);
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    }
    .search-icon {
        position: absolute;
        left: 1.2rem;
        top: 50%;
        transform: translateY(-50%);
        color: #6c757d;
        pointer-events: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .search-clear {
        position: absolute;
        right: 1.2rem;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #6c757d;
        cursor: pointer;
        padding: 0.2rem;
        display: none;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
    .search-clear:hover {
        background-color: rgba(0,0,0,0.05);
        color: #212529;
    }
    .accordion-item {
        background: var(--bg-card, #ffffff);
        border: 1px solid var(--border-color, #dee2e6);
        border-radius: 12px;
        margin-bottom: 1rem;
        overflow: hidden;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    .accordion-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.04);
    }
    .accordion-header {
        margin: 0;
        padding: 0;
    }
    .accordion-button {
        width: 100%;
        padding: 1.25rem 1.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: none;
        border: none;
        color: var(--text-color, #212529);
        font-size: 1.2rem;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        transition: background-color 0.2s;
    }
    .accordion-button:hover {
        background-color: rgba(0, 0, 0, 0.01);
    }
    .accordion-button:focus-visible {
        outline: 2px solid var(--primary-color, #0d6efd);
        outline-offset: -2px;
    }
    .accordion-title-area {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    .accordion-icon-bg {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: rgba(13, 110, 253, 0.08);
        color: var(--primary-color, #0d6efd);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .accordion-arrow {
        transition: transform 0.3s ease;
        color: #6c757d;
        display: flex;
        align-items: center;
    }
    .accordion-item.active .accordion-arrow {
        transform: rotate(180deg);
    }
    .accordion-collapse {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    .accordion-body {
        padding: 1.5rem;
        border-top: 1px solid var(--border-color, #dee2e6);
        line-height: 1.6;
        color: var(--text-muted, #495057);
    }
    .accordion-body p {
        margin-bottom: 1rem;
    }
    .accordion-body p:last-child {
        margin-bottom: 0;
    }
    .accordion-body ul, .accordion-body ol {
        margin-top: 0.5rem;
        margin-bottom: 1rem;
        padding-left: 1.5rem;
    }
    .accordion-body li {
        margin-bottom: 0.4rem;
    }
    mark {
        background: rgba(255, 193, 7, 0.45);
        color: inherit;
        padding: 0 2px;
        border-radius: 2px;
    }
    .no-results {
        text-align: center;
        padding: 4rem 1rem;
        background: var(--bg-card, #ffffff);
        border: 1px solid var(--border-color, #dee2e6);
        border-radius: 12px;
        color: #6c757d;
        display: none;
    }
    .no-results svg {
        margin-bottom: 1rem;
        color: #adb5bd;
    }
    .no-results h3 {
        margin-bottom: 0.5rem;
        color: var(--text-color, #212529);
    }

    /* Dopasowanie do Dark Mode */
    [data-theme="dark"] .accordion-item {
        background: #1e1e1e;
        border-color: #333333;
    }
    [data-theme="dark"] .accordion-item:hover {
        box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    }
    [data-theme="dark"] .search-input {
        background: #1e1e1e;
        border-color: #333333;
        color: #f8f9fa;
    }
    [data-theme="dark"] .search-clear:hover {
        background-color: rgba(255,255,255,0.05);
        color: #f8f9fa;
    }
    [data-theme="dark"] .accordion-button {
        color: #f8f9fa;
    }
    [data-theme="dark"] .accordion-button:hover {
        background-color: rgba(255, 255, 255, 0.01);
    }
    [data-theme="dark"] .accordion-body {
        border-color: #333333;
        color: #d1d5db;
    }
    [data-theme="dark"] .accordion-icon-bg {
        background: rgba(13, 110, 253, 0.18);
    }
    [data-theme="dark"] .no-results {
        background: #1e1e1e;
        border-color: #333333;
    }

/* ============================================================
   Styles extracted from admin/mailings.php (Block 1)
   ============================================================ */

    .mail-preview-modal {

        position: fixed;

        inset: 0;

        z-index: 10001;

        display: grid;

        place-items: center;

    }

    .mail-preview-modal[hidden] {

        display: none;

    }

    .mail-preview-modal__overlay {

        position: absolute;

        inset: 0;

        background: rgba(0, 0, 0, 0.45);

    }

    .mail-preview-modal__panel {

        position: relative;

        width: min(900px, calc(100vw - 2rem));

        max-height: min(88vh, 920px);

        overflow: hidden;

        border: 1px solid #d7dde4;

        border-radius: 12px;

        background: #ffffff;

        display: flex;

        flex-direction: column;

    }

    .mail-preview-modal__head,

    .mail-preview-modal__foot {

        padding: 0.85rem 1rem;

        border-bottom: 1px solid #e8edf2;

        display: flex;

        align-items: center;

        justify-content: space-between;

        gap: 0.75rem;

    }

    .mail-preview-modal__foot {

        border-bottom: none;

        border-top: 1px solid #e8edf2;

        justify-content: flex-end;

    }

    .mail-preview-modal__meta {

        padding: 0.55rem 1rem;

        color: #5f666d;

        border-bottom: 1px solid #eef1f4;

        overflow-wrap: anywhere;

    }

    .mail-preview-modal__body {

        padding: 0.9rem 1rem;

        overflow: auto;

        background: #fafbfc;

    }

    .mail-preview-modal__content {

        background: #fff;

        border: 1px solid #e8edf2;

        border-radius: 8px;

        padding: 0.8rem;

    }


/* ============================================================
   Styles extracted from admin/mailings.php (Block 2)
   ============================================================ */

    .mail-modal {

        position: fixed;

        inset: 0;

        z-index: 10000;

        display: grid;

        place-items: center;

    }

    .mail-modal[hidden] {

        display: none;

    }

    .mail-modal__overlay {

        position: absolute;

        inset: 0;

        background: rgba(0, 0, 0, 0.45);

    }

    .mail-modal__panel {

        position: relative;

        width: min(760px, calc(100vw - 2rem));

        max-height: min(88vh, 860px);

        overflow: hidden;

        border: 1px solid #d7dde4;

        border-radius: 12px;

        background: #ffffff;

        display: flex;

        flex-direction: column;

    }

    .mail-modal__head,

    .mail-modal__foot {

        padding: 0.85rem 1rem;

        border-bottom: 1px solid #e8edf2;

    }

    .mail-modal__foot {

        border-bottom: none;

        border-top: 1px solid #e8edf2;

        display: flex;

        justify-content: flex-end;

    }

    .mail-modal__body {

        padding: 0.85rem 1rem;

        overflow: auto;

    }

    .mail-users-list {

        display: grid;

        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));

        gap: 0.5rem;

        max-height: 54vh;

        overflow: auto;

        padding-right: 0.25rem;

    }

    .mail-users-search-row {

        display: flex;

        gap: 0.75rem;

        align-items: center;

        margin-bottom: 0.75rem;

    }

    .mail-users-visible-count {

        color: #6c757d;

        white-space: nowrap;

    }

    .mail-user-item {

        border: 1px solid #d7dde4;

        border-radius: 8px;

        padding: 0.6rem 0.7rem;

        display: grid;

        grid-template-columns: auto 1fr;

        grid-template-areas:

            'checkbox name'

            'checkbox email';

        gap: 0.1rem 0.45rem;

        align-items: center;

        cursor: pointer;

        background: #fff;

    }

    .mail-user-item input {

        grid-area: checkbox;

        margin-top: 0.1rem;

    }

    .mail-user-item span {

        grid-area: name;

        font-weight: 600;

    }

    .mail-user-item small {

        grid-area: email;

        color: #6c757d;

        overflow-wrap: anywhere;

    }

    .mail-user-item:has(input:checked) {

        border-color: #0d6efd;

        background: #f1f6ff;

    }


/* ============================================================
   Styles extracted from admin/questions.php (Block 1)
   ============================================================ */

            @keyframes qspin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

            #q-loader { display: none; }

            #q-loader:not([hidden]) { display:flex; align-items:center; gap:.6rem; }

            .q-pagination { display:flex; gap:.5rem; align-items:center; justify-content:space-between; flex-wrap:wrap; }

            .q-page-links { display:flex; gap:.35rem; flex-wrap:wrap; align-items:center; }

            .q-page-links a { text-decoration:none; padding:.35rem .6rem; border:1px solid var(--border-color); border-radius:6px; color:var(--primary-color); background:var(--card-bg); }

            .q-page-links a[aria-current="page"] { background:var(--primary-color); color:#ffffff; border-color:var(--primary-color); }

            .q-page-links span { padding:.35rem .6rem; color:var(--text-muted); }

            .q-sort { display:inline-flex; align-items:center; gap:.35rem; text-decoration:none; color:inherit; }

            .q-sort.is-active { font-weight:700; color:var(--primary-color); }

            .q-sort-ind { font-size:.85em; }



            [data-theme="dark"] #q-loader div:first-child {

                border-color: var(--border-color);

                border-top-color: var(--primary-color);

            }

            [data-theme="dark"] #q-loader div:last-child {

                color: var(--text-color);

            }

            [data-theme="dark"] .q-page-links a {

                border-color: var(--border-color);

                color: var(--text-color);

                background: var(--card-bg);

            }

            [data-theme="dark"] .q-page-links a[aria-current="page"] {

                background: var(--primary-color);

                color: #111111;

                border-color: var(--primary-color);

            }
            [data-theme="high-contrast"] .q-page-links a[aria-current="page"] {
                background: var(--primary-color);
                color: #000000;
                border-color: var(--primary-color);
            }

            [data-theme="dark"] .q-page-links span,

            [data-theme="dark"] .q-sort {

                color: var(--text-muted);

            }

            [data-theme="dark"] .q-sort.is-active {

                color: var(--primary-color);

            }

            [data-theme="dark"] .answer-editor-shell,

            [data-theme="dark"] .diff-wrap {

                background: var(--card-bg);

                border-color: var(--border-color);

            }

            [data-theme="dark"] .answer-editor-toolbar,

            [data-theme="dark"] .answer-preview-head {

                background: #161616;

                border-color: var(--border-color);

            }

            [data-theme="dark"] .answer-tab {

                background: #161616;

                color: var(--text-color);

                border-color: var(--border-color);

            }

            [data-theme="dark"] .answer-tab.is-active {

                background: var(--primary-color);

                border-color: var(--primary-color);

                color: #111111;

            }


/* ============================================================
   Styles extracted from admin/questions.php (Block 2)
   ============================================================ */

                                    .qcs-modal { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; }

                                    .qcs-modal[hidden] { display: none; }

                                    .qcs-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); }

                                    .qcs-modal__panel { position: relative; width: min(1100px, calc(100vw - 2rem)); max-height: min(92vh, 980px); overflow: auto; background: var(--bg-color, #f8f9fa); border-radius: 12px; border: 1px solid var(--border-color, #dee2e6); }

                                    .qcs-modal__head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--card-bg, #fff); border-bottom: 1px solid var(--border-color, #dee2e6); }

                                    .qcs-modal__body { padding: 1rem 1.1rem 1.25rem; }

                                    .qcs-group { margin-bottom: 1.25rem; }

                                    .qcs-group h5 { margin: 0 0 .75rem; }

                                    .qcs-card { background: var(--card-bg, #fff); border: 1px solid var(--border-color, #dee2e6); border-radius: 10px; padding: 1rem; margin-bottom: .9rem; }

                                    .qcs-meta { color: var(--text-muted, #6c757d); font-size: .9rem; display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }

                                    .qcs-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

                                    .qcs-section { margin-top: .9rem; }

                                    .qcs-section:first-of-type { margin-top: 0; }

                                    .qcs-section-title { font-weight: 700; margin: .25rem 0 .5rem; }

                                    .qcs-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

                                    @media (max-width: 900px) { .qcs-compare { grid-template-columns: 1fr; } }

                                    .qcs-box { background: var(--card-bg, #fff); border: 1px solid var(--border-color, #dee2e6); border-radius: 10px; padding: .8rem .9rem; }

                                    .qcs-box-title { color: var(--text-muted, #6c757d); font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .45rem; }

                                    .qcs-diff { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }

                                    .qcs-diff-add { background: #ffeef0; color: #a3122a; border-radius: 4px; padding: 0 .12em; }

                                    .qcs-diff-del { background: #ffeef0; color: #a3122a; border-radius: 4px; padding: 0 .12em; text-decoration: line-through; }

                                    [data-theme="dark"] .qcs-diff-add { background: rgba(255, 99, 132, .2); color: #ffb3bf; }

                                    [data-theme="dark"] .qcs-diff-del { background: rgba(255, 99, 132, .2); color: #ffb3bf; }

                                    .qcs-preview { border: 1px solid var(--border-color, #dee2e6); border-radius: 10px; padding: .75rem .9rem; background: var(--card-bg, #fff); }


/* ============================================================
   Styles extracted from admin/questions.php (Block 3)
   ============================================================ */

                .answer-editor-shell { border: 1px solid var(--border-color); border-radius: 10px; background: var(--card-bg); overflow: hidden; }

                .answer-editor-toolbar { display:flex; gap:.5rem; align-items:center; padding:.6rem .75rem; background:var(--surface-muted); border-bottom:1px solid var(--border-color); flex-wrap:wrap; }

                .answer-tab { appearance:none; border:1px solid var(--border-color); background:var(--card-bg); color:var(--text-color); border-radius: 999px; padding:.35rem .75rem; font-weight:700; cursor:pointer; }

                .answer-tab.is-active { background:var(--primary-color); border-color:var(--primary-color); color:#ffffff; }
                [data-theme="dark"] .answer-tab.is-active { color: #111111; }
                [data-theme="high-contrast"] .answer-tab.is-active { color: #000000; }

                .answer-tab:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }

                .answer-toolbar-spacer { flex: 1; min-width: 0; }

                .answer-autosave { font-size: .85rem; color:var(--text-muted); min-width: 120px; text-align: right; }

                .answer-editor-error { margin: .75rem .75rem 0; padding: .75rem .85rem; border-radius: 8px; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; font-size: .9rem; }

                .answer-editor-draft { margin: .75rem .75rem 0; padding: .75rem .85rem; border-radius: 8px; background: #fff3cd; color: #856404; border: 1px solid #ffeeba; font-size: .9rem; display:flex; justify-content:space-between; align-items:center; gap:.75rem; flex-wrap:wrap; }

                .answer-editor-error[hidden], .answer-editor-draft[hidden] { display: none !important; }

                .answer-draft-actions { display:flex; gap:.5rem; }

                .answer-editor-panels { padding: .75rem; }

                .answer-panel .form-control { width: 100%; }

                .answer-panel[data-panel="visual"] textarea.form-control { min-height: 900px; resize: vertical; }

                .answer-editor-shell .ck-editor { width: 100%; }

                .answer-editor-shell .ck-editor__editable_inline { min-height: 900px; resize: vertical; overflow: auto; }

                .answer-panel[data-panel="source"] .CodeMirror { border: 1px solid #ced4da; border-radius: 8px; height: 900px; min-height: 450px; font-size: 13px; resize: vertical; overflow: auto; }

                .answer-panel[data-panel="source"] .CodeMirror-scroll { padding: 8px; }

                .answer-preview-wrap { border-top: 1px solid var(--border-color); background: var(--card-bg); }

                .answer-preview-head { display:flex; justify-content:space-between; align-items:center; gap: .75rem; padding: .65rem .75rem; background:var(--surface-muted); border-bottom:1px solid var(--border-color); }

                .answer-preview-body { padding: .9rem .75rem; }

                .answer-preview-note { padding: .5rem .75rem .85rem; font-size: .85rem; color:var(--text-muted); }

                [data-theme="dark"] .answer-editor-error { background: rgba(220, 53, 69, 0.14); color: #ffd3d7; border-color: rgba(220, 53, 69, 0.35); }

                [data-theme="dark"] .answer-editor-draft { background: rgba(255, 193, 7, 0.14); color: #ffe69c; border-color: rgba(255, 193, 7, 0.35); }

                [data-theme="dark"] .diff-wrap { border-color: var(--border-color); background: var(--card-bg); }

                [data-theme="dark"] .diff-op { color: var(--text-muted); }

                [data-theme="dark"] .diff-add { background: rgba(40, 167, 69, 0.18); }

                [data-theme="dark"] .diff-del { background: rgba(220, 53, 69, 0.18); }

                [data-theme="dark"] .diff-eq { background: rgba(255, 255, 255, 0.04); }

                @media (max-width: 576px) {

                    .answer-autosave { text-align: left; min-width: 0; width: 100%; }

                    .answer-panel[data-panel="visual"] textarea.form-control { min-height: 540px; }

                    .answer-editor-shell .ck-editor__editable_inline { min-height: 540px; }

                    .answer-panel[data-panel="source"] .CodeMirror { height: 540px; min-height: 360px; }

                }


/* ============================================================
   Styles extracted from admin/questions.php (Block 4)
   ============================================================ */

            .diff-wrap { border: 1px solid #dee2e6; border-radius: 10px; overflow: hidden; background: #fff; }

            .diff-line { display: grid; grid-template-columns: 20px 1fr; gap: .5rem; padding: .18rem .6rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }

            .diff-op { color: #6c757d; }

            .diff-add { background: #e6ffed; }

            .diff-del { background: #ffeef0; }

            .diff-eq { background: #f8f9fa; }


/* ============================================================
   Styles extracted from admin/settings.php
   ============================================================ */
            .sortable-row.dragging {
                background-color: var(--surface-muted) !important;
                opacity: 0.5;
            }
            .sortable-row.over {
                border-top: 2px solid var(--primary-color) !important;
            }
            .drag-handle {
                cursor: grab;
                text-align: center;
                font-size: 1.25rem;
                color: var(--text-muted);
            }
            .drag-handle:active {
                cursor: grabbing;
            }

/* ============================================================
   Styles extracted from admin/sort_questions.php
   ============================================================ */
/* Style dla przycisków klawiatury w sortowaniu */
.sq-keyboard-controls {
    display: inline-flex;
    gap: 2px;
    margin-left: 0.5rem;
}
.sq-keyboard-controls .btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    min-height: 28px;
    min-width: 28px;
    line-height: 1;
}
.sq-question-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================
   Styles extracted from admin/translations.php
   ============================================================ */
/* ============================================================
   Nowoczesny panel zarządzania pytaniami (Pakiet 2 - WCAG 2.2)
   ============================================================ */
.admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
    align-items: flex-end;
}
.filter-item-search {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .filter-item-search {
        grid-column: span 1;
    }
}
.filter-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 0.15rem;
}

/* Pasek akcji masowych */
.bulk-actions-bar {
    background: rgba(0, 45, 105, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin: 0 0 1rem 0;
}
[data-theme="dark"] .bulk-actions-bar {
    background: rgba(255, 255, 255, 0.03);
}
[data-theme="high-contrast"] .bulk-actions-bar {
    background: #000000;
    border: 2px solid #ffffff;
}
.bulk-form-flex {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.bulk-count-badge {
    font-size: 0.9rem;
    color: var(--text-color);
    background: var(--card-bg);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Semantyczne Badge Statusów */
.badge-status--draft {
    background: #fff3cd;
    color: #6b4f00;
    border: 1px solid #ffeeba;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}
.badge-status--pending {
    background: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}
.badge-status--published {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}
.badge-status--archived {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}
.badge-status--none {
    background: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

[data-theme="dark"] .badge-status--draft {
    background: rgba(178, 123, 0, 0.25);
    color: #fde047;
    border-color: rgba(178, 123, 0, 0.4);
}
[data-theme="dark"] .badge-status--pending {
    background: rgba(2, 132, 199, 0.25);
    color: #93c5fd;
    border-color: rgba(2, 132, 199, 0.4);
}
[data-theme="dark"] .badge-status--published {
    background: rgba(20, 122, 50, 0.25);
    color: #86efac;
    border-color: rgba(20, 122, 50, 0.4);
}
[data-theme="dark"] .badge-status--archived {
    background: rgba(179, 29, 40, 0.25);
    color: #fca5a5;
    border-color: rgba(179, 29, 40, 0.4);
}
[data-theme="dark"] .badge-status--none {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="high-contrast"] .badge-status--draft,
[data-theme="high-contrast"] .badge-status--pending,
[data-theme="high-contrast"] .badge-status--published,
[data-theme="high-contrast"] .badge-status--archived,
[data-theme="high-contrast"] .badge-status--none {
    background: #000000 !important;
    color: #ffff00 !important;
    border: 1.5px solid #ffffff !important;
}

/* Semantyczny Diff */
del.qcs-diff-del {
    text-decoration: line-through;
    background: #ffeef0;
    color: #b31d28;
    padding: 0.1em 0.3em;
    border-radius: 4px;
    font-weight: 600;
}
ins.qcs-diff-add {
    text-decoration: none;
    background: #e6ffed;
    color: #147a32;
    padding: 0.1em 0.3em;
    border-radius: 4px;
    font-weight: 700;
    border-bottom: 2px solid #147a32;
}
[data-theme="dark"] del.qcs-diff-del {
    background: rgba(220, 53, 69, 0.22);
    color: #fca5a5;
}
[data-theme="dark"] ins.qcs-diff-add {
    background: rgba(40, 167, 69, 0.22);
    color: #86efac;
    border-bottom-color: #86efac;
}
[data-theme="high-contrast"] del.qcs-diff-del {
    background: #000;
    color: #ff4d4d;
    border: 1px dashed #ff4d4d;
}
[data-theme="high-contrast"] ins.qcs-diff-add {
    background: #000;
    color: #00ff00;
    border: 1px solid #00ff00;
}
/* ============================================================
   Drzewo Kategorii i Podkategorii (Pakiet 3 - WCAG 2.2)
   ============================================================ */
.sortable-cat-row {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sortable-cat-row.is-editing,
.sortable-sub-row.is-editing {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 45, 105, 0.15);
    background: rgba(0, 45, 105, 0.03);
}
[data-theme="dark"] .sortable-cat-row.is-editing,
[data-theme="dark"] .sortable-sub-row.is-editing {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.05);
}
[data-theme="high-contrast"] .sortable-cat-row.is-editing,
[data-theme="high-contrast"] .sortable-sub-row.is-editing {
    outline: 3px solid #ffff00 !important;
}

.sortable-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.15rem;
    background: rgba(0, 45, 105, 0.03);
    border-bottom: 1px solid var(--border-color);
    gap: 0.75rem;
}
[data-theme="dark"] .sortable-row-header {
    background: rgba(255, 255, 255, 0.02);
}

.cat-row-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    flex: 1;
}

.cat-meta-badge {
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: var(--bg-color);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.sortable-sub-list {
    padding: 0.5rem 0.75rem 0.75rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sortable-sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.85rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    gap: 0.75rem;
}

.sortable-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.sortable-actions .btn {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.drag-handle {
    cursor: grab;
    user-select: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    padding: 0.25rem 0.45rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
}
.drag-handle:hover, .drag-handle:focus-visible {
    color: var(--primary-color);
    background: var(--hover-bg);
}

/* Przyklejony panel boczny z formularzem */
.admin-split-layout__side--sticky {
    position: sticky;
    top: 5rem;
}

/* ============================================================
   Sortowanie Pytań (Pakiet 4 - WCAG 2.2)
   ============================================================ */
.sq-filter-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.sq-category-block {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sq-cat-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 45, 105, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
[data-theme="dark"] .sq-cat-title {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
.sq-sub-block {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.sq-sub-block:last-child {
    margin-bottom: 0;
}
.sq-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.sq-sub-name {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-color);
}
.sq-question-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sq-question-row {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    gap: 0.75rem;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.sq-question-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 45, 105, 0.06);
}
.sq-drag-handle {
    cursor: grab;
    user-select: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-color);
}
.sq-drag-handle:hover, .sq-drag-handle:focus-visible {
    color: var(--primary-color);
    background: var(--hover-bg);
}
.sq-question-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.sq-qid {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(0, 45, 105, 0.07);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
}
[data-theme="dark"] .sq-qid {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}
.sq-question-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}
.sq-keyboard-controls {
    display: inline-flex;
    gap: 0.35rem;
}
.sq-keyboard-controls .btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.sq-order-badge {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-color);
}
.sq-ghost {
    opacity: 0.4;
    background: rgba(0, 45, 105, 0.08) !important;
}
.sq-chosen {
    background: rgba(0, 45, 105, 0.05) !important;
    border-color: var(--primary-color) !important;
}

/* Powiadomienie statusu zapisu kolejności */
.sq-status-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    background: #0f5132;
    color: #ffffff;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s, transform 0.3s;
}
[data-theme="dark"] .sq-status-toast {
    background: #14532d;
    color: #dcfce7;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
[data-theme="high-contrast"] .sq-status-toast {
    background: #000000;
    color: #00ff00;
    border: 2px solid #00ff00;
}

/* ============================================================
   Zarządzanie Tłumaczeniami (Pakiet 5 - WCAG 2.2)
   ============================================================ */
.trans-nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.trans-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
}
.trans-nav-link:hover {
    color: var(--primary-color);
    background: var(--hover-bg);
}
.trans-nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(0, 45, 105, 0.04);
}
[data-theme="dark"] .trans-nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}
[data-theme="high-contrast"] .trans-nav-link.active {
    background: #000000;
    color: #ffff00;
    border-bottom-color: #ffff00;
    outline: 2px solid #ffffff;
}

.trans-preview-box {
    padding: 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.88rem;
    max-height: 180px;
    overflow-y: auto;
    line-height: 1.5;
    color: var(--text-color);
}
.trans-preview-box:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.trans-progress-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.trans-progress-bar-bg {
    width: 100%;
    height: 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}
.trans-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #0f766e);
    transition: width 0.3s ease;
}

.trans-row-outdated {
    background: rgba(253, 126, 20, 0.04);
}
[data-theme="dark"] .trans-row-outdated {
    background: rgba(253, 126, 20, 0.08);
}
[data-theme="high-contrast"] .trans-row-outdated {
    background: #000000;
    border-left: 4px solid #ff9900;
}

/* ============================================================
   Zgłoszenia Studentów (Pakiet 6 - WCAG 2.2)
   ============================================================ */
.inq-unread {
    background: rgba(0, 45, 105, 0.05) !important;
    font-weight: 600;
}
[data-theme="dark"] .inq-unread {
    background: rgba(59, 130, 246, 0.12) !important;
}
[data-theme="high-contrast"] .inq-unread {
    background: #000000 !important;
    border-left: 4px solid #ffff00 !important;
}

.inquiry-detail-card {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 45, 105, 0.08);
}
.inquiry-message-box {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-color);
}
.inquiry-reply-box {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.25rem;
}
.inquiry-textarea {
    width: 100%;
    min-height: 140px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
}
.inquiry-textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================================
   Dyskusje i Ankiety (Pakiet 7 - WCAG 2.2)
   ============================================================ */
.discussion-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.5rem 0;
}
.discussion-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.88rem;
    cursor: pointer;
}
.discussion-tag-item:hover {
    border-color: var(--primary-color);
}
.bbcode-toolbar .btn {
    min-width: 38px;
    min-height: 36px;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge-status--discussion-new {
    background: rgba(0, 45, 105, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(0, 45, 105, 0.2);
}
.badge-status--discussion-analysis {
    background: rgba(13, 202, 240, 0.15);
    color: #055160;
    border: 1px solid rgba(13, 202, 240, 0.3);
}
.badge-status--discussion-accepted {
    background: rgba(25, 135, 84, 0.15);
    color: #0f5132;
    border: 1px solid rgba(25, 135, 84, 0.3);
}
.badge-status--discussion-in_progress {
    background: rgba(255, 193, 7, 0.2);
    color: #664d03;
    border: 1px solid rgba(255, 193, 7, 0.4);
}
.badge-status--discussion-done {
    background: rgba(25, 135, 84, 0.25);
    color: #0a3622;
    font-weight: 700;
    border: 1px solid rgba(25, 135, 84, 0.5);
}
.badge-status--discussion-rejected {
    background: rgba(108, 117, 125, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(108, 117, 125, 0.3);
}

[data-theme="dark"] .badge-status--discussion-new {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.4);
}
[data-theme="dark"] .badge-status--discussion-analysis {
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.4);
}
[data-theme="dark"] .badge-status--discussion-accepted {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.4);
}
[data-theme="dark"] .badge-status--discussion-in_progress {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border-color: rgba(234, 179, 8, 0.4);
}
[data-theme="dark"] .badge-status--discussion-done {
    background: rgba(34, 197, 94, 0.3);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.6);
}
[data-theme="dark"] .badge-status--discussion-rejected {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.4);
}

[data-theme="high-contrast"] .badge-status--discussion-new,
[data-theme="high-contrast"] .badge-status--discussion-analysis,
[data-theme="high-contrast"] .badge-status--discussion-accepted,
[data-theme="high-contrast"] .badge-status--discussion-in_progress,
[data-theme="high-contrast"] .badge-status--discussion-done,
[data-theme="high-contrast"] .badge-status--discussion-rejected {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

/* ============================================================
   Widok Wątku i Komentarzy (Pakiet 8 - WCAG 2.2)
   ============================================================ */
.discussion-thread-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.discussion-comment-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.discussion-comment-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 45, 105, 0.05);
}
.discussion-comment-card.is-reply {
    margin-left: 2rem;
    border-left: 3px solid var(--primary-color);
}
.discussion-reply-target {
    background: rgba(0, 45, 105, 0.06);
    border: 1px dashed var(--primary-color);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--primary-color);
    font-weight: 600;
}
[data-theme="dark"] .discussion-reply-target {
    background: rgba(59, 130, 246, 0.12);
    border-color: #93c5fd;
    color: #93c5fd;
}
.discussion-vote-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ============================================================
   Panel Chatbota InfoBOS (Pakiet 9 - WCAG 2.2)
   ============================================================ */
.session-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.82rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.15s ease;
}
.session-badge-btn:hover {
    border-color: var(--primary-color);
    background: rgba(0, 45, 105, 0.05);
}
.session-badge-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.chatbot-json-editor {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.5;
    background: var(--bg-color);
    color: var(--text-color);
    tab-size: 2;
}

/* ============================================================
   Panel Powiadomień (Pakiet 16 - WCAG 2.2)
   ============================================================ */
.notification-item--unread {
    background-color: rgba(0, 45, 105, 0.04);
}
[data-theme="dark"] .notification-item--unread {
    background-color: rgba(59, 130, 246, 0.1);
}
[data-theme="high-contrast"] .notification-item--unread {
    background-color: transparent;
    outline: 1px dashed #ffffff;
}