:root {
    --bg-body: #e9ecef;
    --bg-container: #ffffff;
    --bg-header: #2c3e4e;
    --bg-card: #f8f9fa;
    --bg-table-th: #eef2f5;
    --text-main: #1a2c3e;
    --text-muted: #6c757d;
    --text-header: #f0f3f5;
    --accent: #5d7a8c;
    --border-color: #d4dce2;
    --success: #2c6e2c;
    --danger: #b33c2e;
    --warning: #c28b2c;
    --link-color: #3498db;
}

body.dark-mode {
    --bg-body: #121920;
    --bg-container: #1c262f;
    --bg-header: #0d141b;
    --bg-card: #25313d;
    --bg-table-th: #2d3d4a;
    --text-main: #e2e8ed;
    --text-muted: #a0aec0;
    --text-header: #ffffff;
    --accent: #7f9ab0;
    --border-color: #3e4f5c;
    --link-color: #5dade2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
    line-height: 1.6;
    background: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-container);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--bg-header);
    color: var(--text-header);
    padding: 1rem 2rem;
    border-bottom: 3px solid var(--accent);
}

.header-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subtitle {
    color: #bdc3c7;
    font-size: 0.85rem;
}

.theme-switcher {
    display: flex;
    gap: 0.3rem;
    background: rgba(0,0,0,0.2);
    padding: 0.3rem;
    border-radius: 30px;
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    color: #bdc3c7;
    font-size: 1rem;
}

.theme-btn.active {
    background: var(--accent);
    color: white;
}

/* --- MENU MOBILNE --- */
.tabs-nav {
    display: flex;
    list-style: none;
    gap: 0.2rem;
    margin-top: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

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

.tab-btn {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.8rem 1rem;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 3px solid var(--accent);
}

main {
    flex: 1;
    padding: 2rem;
}

h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.res-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.res-type {
    padding: 15px;
    border-radius: 8px;
    background: rgba(0,0,0,0.03);
    border-left: 4px solid var(--accent);
}

body.dark-mode .res-type {
    background: rgba(255,255,255,0.03);
}

.eip-alert { border-left-color: var(--danger); }
.ic-orange { border-left-color: var(--warning); }
.night-blue { border-left-color: #004494; }

/* --- ZOPTYMALIZOWANE I POWIĘKSZONE LOGOTYPY --- */
.operator-logo {
    height: 45px; /* Zwiększone z 22px (~2x) */
    width: auto;
    margin-right: 12px;
    vertical-align: middle;
    transition: height 0.2s ease;
}

.category-logo {
    height: 35px; /* Zwiększone z 16px (~2x) */
    width: auto;
    vertical-align: middle;
}

.op-logo {
    max-height: 55px; /* Zwiększone z 24px (~2.3x) */
    width: auto;
    object-fit: contain;
}

.logo-wrapper {
    width: 60px; /* Zwiększone z 32px dla pomieszczenia większych logo */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- TABELE I STATUSY --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 8px; /* Większy padding dla czytelności przy dużych logo */
    border: 1px solid var(--border-color);
    text-align: center;
}

th {
    background: var(--bg-table-th);
    font-weight: 700;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    background: var(--accent);
    color: #fff;
}

.badge-mandatory { background: var(--danger); }
.badge-recommended { background: var(--warning); }

.status-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.tag-included { background: var(--success); color: white; }
.tag-warning { background: var(--warning); color: white; }
.tag-excluded { background: var(--danger); color: white; }

.note {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    margin: 1rem 0;
}

/* --- HIGH CONTRAST --- */
body.high-contrast {
    --bg-body: #000;
    --bg-container: #000;
    --bg-header: #000;
    --text-main: #fff;
    --text-header: #fff;
    --accent: #ffff00;
    --border-color: #fff;
    --link-color: #ffff00;
}

body.high-contrast .card, 
body.high-contrast .res-type,
body.high-contrast .note,
body.high-contrast .op-item {
    border: 2px solid #fff !important;
    background: #000 !important;
    color: #fff !important;
    outline: 1px solid #fff;
    margin-bottom: 15px;
}

body.high-contrast th, body.high-contrast td {
    border: 1px solid #fff !important;
    color: #fff !important;
}

body.high-contrast .status-badge,
body.high-contrast .status-tag {
    background: #ffff00 !important;
    color: #000 !important;
    border: 1px solid #000 !important;
}

footer {
    background: var(--bg-header);
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
}

/* --- MEDIA QUERIES (ADAPTACJA MOBILNA) --- */
@media (max-width: 768px) {
    main { padding: 1rem; }
    
    header { padding: 1rem 1rem 0 1rem; }

    .header-brand {
        flex-direction: row;
        justify-content: space-between;
    }

    /* Lekkie zmniejszenie logo na bardzo małych ekranach, by nie rozpychały tabeli */
    .operator-logo { height: 32px; }
    .category-logo { height: 26px; }
    .op-logo { max-height: 40px; }
    .logo-wrapper { width: 45px; }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}
