/* ============================================================
   InfoBOS UAM – Bento Grid & Redesign Design System
   Rozszerza assets/css/style.css – nie zastępuje go
   WCAG 2.1 AA | Mobile-first | CSS custom properties
   ============================================================ */

/* ── 1. Dodatkowe CSS Custom Properties ─────────────────── */
:root {
    --bento-gap: clamp(0.75rem, 2vw, 1.25rem);
    --bento-radius: 16px;
    --bento-radius-sm: 12px;
    --bento-shadow: 0 1px 4px rgba(0, 45, 105, 0.07), 0 2px 8px rgba(0, 45, 105, 0.04);
    --bento-shadow-hover: 0 6px 24px rgba(0, 45, 105, 0.13), 0 2px 6px rgba(0, 45, 105, 0.06);
    --card-transition: transform 0.18s ease, box-shadow 0.18s ease;
    --accent-blue: #0284c7;
    --accent-blue-light: #e0f2fe;
    --accent-blue-dark: #0c4a6e;
    --accent-green: #15803d;
    --accent-green-light: #dcfce7;
    --accent-orange: #c2410c;
    --accent-orange-light: #ffedd5;
    --accent-violet: #6d28d9;
    --accent-violet-light: #ede9fe;
    --hero-bg: linear-gradient(150deg, #f0f7ff 0%, #e8f4fd 50%, #f8fafc 100%);
    --hero-decoration: #dbeafe;
    --header-height: 64px;
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-border: rgba(203, 213, 225, 0.7);
    --status-open-bg: #dcfce7;
    --status-open-color: #15803d;
    --status-closed-bg: #fee2e2;
    --status-closed-color: #b91c1c;
    --status-soon-bg: #fef9c3;
    --status-soon-color: #854d0e;
    --timeline-line: #cbd5e1;
    --mini-search-bg: #f1f5f9;
}

[data-theme="dark"] {
    --hero-bg: linear-gradient(150deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --hero-decoration: #1e3a5f;
    --header-bg: rgba(15, 23, 42, 0.96);
    --header-border: rgba(51, 65, 85, 0.8);
    --accent-blue-light: #0c2240;
    --accent-green-light: #052e16;
    --accent-orange-light: #431407;
    --accent-violet-light: #2e1065;
    --status-open-bg: #052e16;
    --status-open-color: #4ade80;
    --status-closed-bg: #450a0a;
    --status-closed-color: #f87171;
    --status-soon-bg: #422006;
    --status-soon-color: #fbbf24;
    --timeline-line: #334155;
    --mini-search-bg: #1e293b;
}

[data-theme="high-contrast"] {
    --bento-shadow: none;
    --bento-shadow-hover: none;
    --card-transition: none;
    --accent-blue-light: #000000;
    --hero-bg: #000000;
    --header-bg: #000000;
    --header-border: #ffffff;
}

/* ── 2. Site Header – przebudowany ─────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 12px rgba(0, 45, 105, 0.1);
}

.header-flex {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--header-height);
}

/* Logo */
.logo a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-color);
    flex-shrink: 0;
}

.site-logo-svg {
    height: 38px;
    width: auto;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.logo-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Header actions – prawa strona */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Przycisk zewnętrzny (USOS, itp.) */
.btn-usos {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    background: transparent;
}

.btn-usos:hover, .btn-usos:focus-visible {
    background: var(--primary-color);
    color: #fff;
}

[data-theme="dark"] .btn-usos {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Przycisk dostępności */
.btn-a11y {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-size: 0;
}

.btn-a11y:hover, .btn-a11y:focus-visible {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--accent-blue-light);
}

/* Panel dostępności */
.a11y-panel {
    position: absolute;
    top: calc(var(--header-height) + 4px);
    right: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--bento-radius-sm);
    box-shadow: var(--bento-shadow-hover);
    padding: 1rem;
    z-index: 800;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: dropIn 0.15s ease;
}

.a11y-panel[hidden] {
    display: none;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.a11y-panel-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.a11y-panel-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ── 3. Hero Section ─────────────────────────────────────── */
.search-section {
    position: relative;
    z-index: 100;
    overflow: visible !important;
}

.hero-wrapper {
    background: var(--hero-bg);
    padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
    position: relative;
    overflow: visible;
    z-index: 100;
}

.hero-wrapper::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -80px;
    width: 360px;
    height: 360px;
    background: var(--hero-decoration);
    border-radius: 50%;
    opacity: 0.5;
    pointer-events: none;
    clip-path: inset(0 0 0 0);
}

.hero-wrapper::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 280px;
    height: 280px;
    background: var(--hero-decoration);
    border-radius: 50%;
    opacity: 0.35;
    pointer-events: none;
    clip-path: inset(0 0 0 0);
}

.hero-content {
    position: relative;
    z-index: 100;
    max-width: var(--public-container-max);
    margin: 0 auto;
    padding: 0 var(--public-container-pad);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-heading {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    text-align: center;
}

.hero-sub {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* ── 4. Bento Grid ───────────────────────────────────────── */
.bento-section {
    position: relative;
    z-index: 10;
    padding: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.bento-section-header {
    margin-bottom: 1.25rem;
}

.bento-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.bento-section-title svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.bento-section-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
}

/* Portal grid: left main 3-col, right sidebar */
.bento-portal-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto;
    gap: var(--bento-gap);
    align-items: start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.bento-portal-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bento-gap);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.bento-portal-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--bento-gap);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    /* sticky sidebar */
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    max-height: calc(100vh - var(--header-height) - 2rem);
    overflow-y: auto;
}

/* The existing .bento-card is extended – we override/add styles */
.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--bento-radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    transition: var(--card-transition);
    box-shadow: var(--bento-shadow);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* override existing bento card link hover - keep only our card style */
a.bento-card:hover,
a.bento-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--bento-shadow-hover);
    border-color: rgba(0, 45, 105, 0.2);
    outline: none;
}

.bento-card--accent {
    background: var(--accent-blue-light);
    border-color: rgba(2, 132, 199, 0.2);
}

.bento-card--accent-green {
    background: var(--accent-green-light);
    border-color: rgba(21, 128, 61, 0.2);
}

.bento-card--highlight {
    border-color: var(--primary-color);
    border-width: 2px;
}

/* Portal card: info card (non-link) */
.bento-info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--bento-radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--bento-shadow);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Card header row */
.bento-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    width: 100%;
    min-width: 0;
}

.bento-card-header > div {
    flex: 1;
    min-width: 0;
}

.bento-card-icon-wrap {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    flex-shrink: 0;
}

.bento-card-icon-wrap--green {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

.bento-card-icon-wrap--orange {
    background: var(--accent-orange-light);
    color: var(--accent-orange);
}

.bento-card-icon-wrap--violet {
    background: var(--accent-violet-light);
    color: var(--accent-violet);
}

.bento-card-icon-wrap--primary {
    background: rgba(0, 45, 105, 0.1);
    color: var(--primary-color);
}

.bento-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.3rem;
}

.bento-card-title-new {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.35rem;
    line-height: 1.3;
}

.bento-card-desc {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin: 0;
    flex: 1;
    line-height: 1.5;
}

.bento-card-arrow-new {
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
    margin-top: auto;
    align-self: flex-end;
}

a.bento-card:hover .bento-card-arrow-new,
a.bento-card:focus-visible .bento-card-arrow-new {
    transform: translateX(4px);
    color: var(--primary-color);
}

/* ── 5. Status Badge (godziny BOS) ─────────────────────── */
.bos-live-status-wrap {
    margin-bottom: 0.65rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.85rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    width: fit-content;
    max-width: 100%;
    transition: all 0.25s ease;
}

.status-badge--open {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge--closed {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-badge--neutral {
    background: var(--mini-search-bg, rgba(0, 45, 105, 0.05));
    color: var(--text-muted, #64748b);
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
}

.status-badge--soon {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-badge--afterhours {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

[data-theme="dark"] .status-badge--neutral {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

[data-theme="dark"] .status-badge--open {
    background: #052e16;
    color: #86efac;
    border-color: #14532d;
}

[data-theme="dark"] .status-badge--closed {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

[data-theme="dark"] .status-badge--soon {
    background: #451a03;
    color: #fde68a;
    border-color: #78350f;
}

[data-theme="dark"] .status-badge--afterhours {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

[data-theme="high-contrast"] .status-badge {
    background: #000000;
    color: #ffff00;
    border: 2px solid #ffffff;
}

.status-badge .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-badge--open .status-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

/* ── 5.1 Selektor Biura (Zamiast wielu przycisków) ────────── */
.bos-office-picker-wrap {
    margin-bottom: 0.75rem;
}

.bos-select-custom-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.bos-select-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--primary-color);
    pointer-events: none;
    flex-shrink: 0;
}

.bos-select-chevron {
    position: absolute;
    right: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.bos-office-select {
    width: 100%;
    padding: 0.55rem 2rem 0.55rem 2.25rem;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bos-office-select:hover {
    border-color: var(--primary-color);
}

.bos-office-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 45, 105, 0.12);
}

[data-theme="dark"] .bos-select-icon {
    color: #38bdf8;
}

[data-theme="high-contrast"] .bos-office-select {
    background: #000000;
    color: #ffff00;
    border: 2px solid #ffffff;
}

.bos-hours-item--today {
    background: rgba(0, 45, 105, 0.04);
    border-radius: 6px;
    padding: 0.25rem 0.45rem;
    margin: -0.1rem -0.45rem;
}

[data-theme="dark"] .bos-hours-item--today {
    background: rgba(56, 189, 248, 0.08);
}

.bos-hours-item--today .bos-hours-day {
    color: var(--primary-color);
    font-weight: 800;
}

[data-theme="dark"] .bos-hours-item--today .bos-hours-day {
    color: #38bdf8;
}

.bos-today-indicator {
    color: var(--accent-orange, #f59e0b);
    font-size: 1rem;
    line-height: 0;
    margin-left: 0.2rem;
}

/* ── 6. BOS Hours Card ──────────────────────────────────── */
.bos-hours-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bos-hours-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
    width: 100%;
    min-width: 0;
}

.bos-hours-day {
    color: var(--text-muted);
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

.bos-hours-time {
    font-weight: 600;
    color: var(--text-color);
    text-align: right;
    white-space: nowrap;
}

.bos-hours-time--closed {
    color: var(--status-closed-color);
    font-weight: 500;
}

.bos-hours-time-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.bos-flags-wrap {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.bos-flag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.bos-flag-sessions {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.bos-flag-parttime {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .bos-flag-sessions {
    background: #362203;
    color: #fde68a;
    border-color: #78350f;
}

[data-theme="dark"] .bos-flag-parttime {
    background: #231248;
    color: #ddd6fe;
    border-color: #4c1d95;
}

[data-theme="high-contrast"] .bos-flag-badge {
    background: #000000;
    color: #ffff00;
    border: 1px solid #ffff00;
}

.bos-hours-cta-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.4rem 0.9rem;
    margin-top: 0.5rem;
    background: var(--mini-search-bg, rgba(0, 0, 0, 0.02));
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    gap: 0.6rem;
    color: var(--text-muted);
}

.bos-hours-cta-box svg {
    color: var(--accent-green, #10b981);
    opacity: 0.85;
}

[data-theme="dark"] .bos-hours-cta-box svg {
    color: #34d399;
}

.bos-hours-cta-text {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0;
}

.bos-offices-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.bos-tab-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1.5px solid var(--border-color);
    border-radius: 100px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.bos-tab-btn.active,
.bos-tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 45, 105, 0.06);
}

.bos-office-panel {
    display: none;
}

.bos-office-panel.active {
    display: block;
}

/* ── 7. Timeline – Komunikaty i Terminy ─────────────────── */
.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: var(--timeline-line);
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2.5px solid var(--primary-color);
    background: var(--card-bg);
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.timeline-dot--urgent {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
}

.timeline-dot--info {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.timeline-body {
    flex: 1;
    min-width: 0;
}

.timeline-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.timeline-text {
    font-size: 0.85rem;
    color: var(--text-color);
    line-height: 1.45;
    font-weight: 500;
}

.timeline-text a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s;
}

.timeline-text a:hover {
    text-decoration-color: var(--primary-color);
}

/* ── 8. Mini Contact Search ─────────────────────────────── */
.mini-contact-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mini-contact-search input {
    flex: 1;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--mini-search-bg);
    color: var(--text-color);
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
    min-width: 0;
}

.mini-contact-search input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.mini-contact-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.mini-contact-results {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.mini-contact-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: var(--mini-search-bg);
    font-size: 0.83rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    text-align: left;
    width: 100%;
}

.mini-contact-item:hover, .mini-contact-item:focus-visible {
    background: var(--hover-bg, rgba(0, 45, 105, 0.06));
    border-color: var(--primary-color);
    outline: none;
    transform: translateY(-1px);
}

.mini-contact-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mini-contact-name {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.mini-contact-office {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.mini-contact-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.35rem 0.7rem;
    border: 1.5px solid var(--primary-color);
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    display: inline-block;
    margin-top: 0.5rem;
    align-self: flex-end;
}

.mini-contact-link:hover, .mini-contact-link:focus-visible {
    background: var(--primary-color);
    color: #fff;
}

.bento-card-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
}

.portal-staff-office-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--hover-bg, rgba(0, 45, 105, 0.08));
    border: 1px solid rgba(0, 45, 105, 0.15);
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .portal-staff-office-badge {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.25);
}

.mini-contact-cta-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.1rem 0.75rem;
    background: var(--mini-search-bg, rgba(0, 0, 0, 0.02));
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    gap: 0.45rem;
    color: var(--text-muted);
}

.mini-contact-cta-box svg {
    color: var(--primary-color);
    opacity: 0.75;
}

[data-theme="dark"] .mini-contact-cta-box svg {
    color: #38bdf8;
}

.mini-contact-cta-text {
    font-size: 0.8rem;
    line-height: 1.35;
    margin: 0;
}

.mini-contact-empty {
    font-size: 0.83rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.75rem;
}

/* ── 4.1 Modal Szczegółów Pracownika BOS (<dialog>) ── */
.staff-dialog {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    width: min(92vw, 520px);
    max-height: 90vh;
    padding: 0;
    margin: auto;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    color: var(--text-color);
}

.staff-dialog::backdrop {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.staff-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.staff-modal-close-btn {
    background: var(--hover-bg, #f1f5f9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.staff-modal-close-btn:hover, .staff-modal-close-btn:focus-visible {
    background: #fee2e2;
    color: #ef4444;
    outline: none;
}

.staff-modal-body {
    padding: 1.5rem;
}

.staff-modal-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.staff-modal-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 100%);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 45, 105, 0.2);
}

.staff-modal-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.staff-modal-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.staff-modal-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.staff-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.88rem;
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--hover-bg, #f8fafc);
    border: 1px solid var(--border-color);
}

.staff-info-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

[data-theme="dark"] .staff-info-icon {
    color: #38bdf8;
}

.staff-info-content {
    flex: 1;
    min-width: 0;
}

.staff-info-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.staff-info-val {
    color: var(--text-color);
    font-weight: 600;
    word-break: break-word;
}

.staff-info-val a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.staff-info-val a:hover {
    text-decoration: underline;
}

.staff-majors-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.staff-major-pill {
    display: inline-block;
    font-size: 0.75rem;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: var(--text-color);
    font-weight: 500;
}

/* ── 9. Quick-link list (Wnioski, Stypendia) ────────────── */
.quick-links-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.quick-links-item a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.86rem;
    font-weight: 500;
    transition: background 0.13s, color 0.13s;
}

.quick-links-item a:hover, .quick-links-item a:focus-visible {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.quick-links-item a svg {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.13s;
}

.quick-links-item a:hover svg, .quick-links-item a:focus-visible svg {
    color: var(--primary-color);
}

.quick-links-item-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 100px;
    font-weight: 600;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

/* ── 10. Contact Page Redesign ──────────────────────────── */
.contact-page-header {
    padding: clamp(1.5rem, 4vw, 2.5rem) 0 1rem;
    background: var(--hero-bg);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.contact-page-header .container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-page-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.02em;
    margin: 0 0 0.2rem;
}

.contact-page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Office tabs – redesigned from pills */
.office-tabs-nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border-bottom: 2px solid var(--border-color);
}

.office-tab-link {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0;
    transition: color 0.15s, border-color 0.15s;
}

.office-tab-link.active,
.office-tab-link[aria-pressed="true"],
.office-tab-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

/* Contact card redesign */
.contact-card-new {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--bento-radius-sm);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--bento-shadow);
    transition: var(--card-transition);
}

.contact-card-new:hover {
    box-shadow: var(--bento-shadow-hover);
    transform: translateY(-1px);
}

.contact-card-top-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.contact-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.contact-card-name-block {
    flex: 1;
    min-width: 0;
}

.contact-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.15rem;
    line-height: 1.25;
}

.contact-office-badge-new {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    background: rgba(0, 45, 105, 0.08);
    color: var(--primary-color);
    display: inline-block;
}

/* ── 11. Document pages (regulamin, privacy) ────────────── */
.doc-page-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    align-items: start;
    padding: 2rem 0;
}

.doc-toc {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--bento-radius-sm);
    padding: 1rem;
    box-shadow: var(--bento-shadow);
}

.doc-toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.doc-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.doc-toc-list a {
    display: block;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1.4;
}

.doc-toc-list a:hover, .doc-toc-list a.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: var(--accent-blue-light);
}

.doc-body {
    max-width: 720px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.doc-body h1, .doc-body h2 {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

/* ── 12. Breadcrumb ─────────────────────────────────────── */
.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

.page-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.page-breadcrumb a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.page-breadcrumb .sep {
    color: var(--border-color);
    font-size: 0.75rem;
}

.page-breadcrumb .current {
    color: var(--text-color);
    font-weight: 500;
}

/* ── 13. Footer Update ──────────────────────────────────── */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    padding: 2rem 0 1.5rem;
    align-items: start;
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.site-footer__logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
}

.site-footer__logo {
    height: 30px;
    width: auto;
}

.site-footer__brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
}

.site-footer__tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 340px;
    line-height: 1.5;
}

.site-footer__links-group {
    min-width: 160px;
}

.site-footer__links-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}

.site-footer__links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.site-footer__links-list a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.site-footer__links-list a:hover {
    color: var(--primary-color);
}

.site-footer__bottom {
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer__bottom-copy {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── 14. Admin – BOS Hours module ───────────────────────── */
.bos-hours-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.bos-office-card-admin {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
}

.bos-office-card-admin h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hours-row {
    display: grid;
    grid-template-columns: 110px 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.hours-row label {
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

/* ── 15. Responsive Breakpoints ─────────────────────────── */
@media (max-width: 1024px) {
    .bento-portal-grid {
        grid-template-columns: 1fr 240px;
    }
}

@media (max-width: 860px) {
    .bento-portal-grid {
        grid-template-columns: 1fr;
    }

    .bento-portal-main {
        grid-template-columns: 1fr;
    }

    .bento-portal-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .doc-page-layout {
        grid-template-columns: 1fr;
    }

    .doc-toc {
        position: static;
        order: -1;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
    }

    .office-tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .office-tabs-nav::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 640px) {
    :root {
        --bento-gap: 0.75rem;
    }

    .bento-section {
        padding: 1.25rem 0;
    }

    .bento-card,
    .bento-info-card {
        padding: 1rem 0.85rem;
        border-radius: 12px;
    }

    .bento-card-header {
        gap: 0.4rem;
        margin-bottom: 0.65rem;
    }

    .bento-card-title-new {
        font-size: 0.95rem;
    }

    .bos-hours-day {
        min-width: 0;
        flex: 1;
        font-size: 0.82rem;
    }

    .bos-hours-time-col {
        align-items: flex-end;
        max-width: 70%;
    }

    .bos-hours-time {
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .bos-flags-wrap {
        gap: 0.2rem;
    }

    .bos-flag-badge {
        font-size: 0.62rem;
        padding: 0.1rem 0.35rem;
    }

    .mini-contact-item {
        padding: 0.45rem 0.5rem;
        gap: 0.45rem;
    }

    .mini-contact-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }

    .mini-contact-name {
        font-size: 0.8rem;
    }

    .mini-contact-office {
        font-size: 0.7rem;
        max-width: 90px;
    }

    .quick-links-item a {
        padding: 0.45rem 0.5rem;
        font-size: 0.82rem;
    }

    .timeline-item {
        gap: 0.5rem;
        padding-bottom: 0.75rem;
    }

    .timeline-text {
        font-size: 0.82rem;
    }

    .hero-wrapper::before,
    .hero-wrapper::after {
        display: none;
    }

    .btn-usos {
        display: none; /* skryty na mobile – zastąpiony linkiem w menu */
    }

    .header-flex {
        gap: 0.5rem;
    }

    .logo-text {
        display: flex;
        flex-direction: column;
    }

    .logo-title {
        font-size: 1.05rem;
        font-weight: 800;
        letter-spacing: -0.02em;
        white-space: nowrap;
    }

    .logo-subtitle {
        display: none;
    }

    .contact-page-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .mini-contact-results {
        max-height: 320px;
    }
}

/* ── 16. Microanimations & transitions ───────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .bento-card,
    .bento-info-card,
    .contact-card-new {
        will-change: transform, box-shadow;
    }
}

/* ── 17. High-contrast overrides ─────────────────────────── */
[data-theme="high-contrast"] .bento-card,
[data-theme="high-contrast"] .bento-info-card,
[data-theme="high-contrast"] .contact-card-new {
    border: 2px solid var(--border-color);
    box-shadow: none;
    transform: none !important;
}

[data-theme="high-contrast"] .status-badge {
    border: 2px solid currentColor;
}

[data-theme="high-contrast"] .a11y-panel {
    border: 2px solid var(--border-color);
    box-shadow: none;
}

/* ── 18. Print ───────────────────────────────────────────── */
@media print {
    .site-header,
    .a11y-panel,
    .chatbot-widget,
    .cookie-banner,
    .inquiry-section {
        display: none !important;
    }

    .bento-portal-grid {
        display: block;
    }

    .bento-portal-sidebar {
        position: static;
        margin-top: 1rem;
    }
}
