/* ===================================================================
   RSR TERMINARZ - ZMODERNIZOWANY DESIGN
   Dostosowany do stylu strony https://sztab.rybnik.pl/
   =================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Nunito+Sans:wght@400;500;600;700&display=swap');

/* CSS Variables - Paleta kolorów RSR */
:root {
    --primary-color: #dc2626;      /* Główna czerwień RSR */
    --secondary-color: #233259;    /* Granatowy akcent */
    --text-color: #000000;         /* Czarny tekst */
    --text-light: #3A3A3A;        /* Szary ciemny */
    --bg-color: #ffffff;           /* Białe tło */
    --bg-light: #f8f9fa;          /* Jasne tło sekcji */
    --border-color: #e9ecef;      /* Obramowania */
    --shadow: 0 4px 12px rgba(0,0,0,0.15);
    
    /* Fonty */
    --font-primary: 'Montserrat', sans-serif;
    --font-buttons: 'Nunito Sans', sans-serif;
    
    /* Rozmiary */
    --container-max-width: 1240px;
    --border-radius: 30px;
    --border-radius-small: 8px;
    
    /* Responsive font sizes */
    --font-base: 18px;
    --font-h1: 48px;
    --font-h2: 40px;
    --font-h3: 32px;
    --font-h4: 24px;
    --font-h5: 20px;
    --font-h6: 14px;
}

/* Responsive variables */
@media (max-width: 921px) {
    :root {
        --font-base: 16px;
        --font-h1: 36px;
        --font-h2: 30px;
        --font-h3: 24px;
        --font-h4: 20px;
        --font-h5: 18px;
    }
}

@media (max-width: 544px) {
    :root {
        --font-base: 14px;
        --font-h1: 28px;
        --font-h2: 24px;
        --font-h3: 20px;
        --font-h4: 18px;
        --font-h5: 16px;
    }
}

/* Reset i podstawowe style */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-base);
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0 12px; /* globalny oddech na krawędziach */
    scroll-behavior: smooth;
}

/* Container główny */
.cal {
    max-width: 1200px;
    margin: 24px auto;
    padding: 24px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow);
    min-height: auto;
}

@media (max-width: 921px) {
    .cal {
        padding: 2em 1.5em;
        margin: 1em;
    }
}

@media (max-width: 544px) {
    .cal {
        padding: 1.5em 1em;
        margin: 0.5em;
        border-radius: 0;
    }
}

/* Typografia - Nagłówki */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    margin: 0 0 1em 0;
    color: var(--text-color);
}

h1 {
    font-size: var(--font-h1);
    font-weight: 700;
    line-height: 1.2em;
    color: var(--secondary-color);
    text-align: center;
    margin-top: 8px;
    display: inline-block;
    background: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: var(--shadow);
}

h2 {
    font-size: var(--font-h2);
    line-height: 1.2em;
    color: var(--primary-color);
    max-width: 1200px;          /* wyśrodkuj tytuł sekcji */
    margin: 0.75em auto 0.5em;  /* marginesy poziome zgodne z kontenerem */
    padding: 0 24px;            /* oddech od krawędzi */
}

h3 {
    font-size: var(--font-h3);
    line-height: 1.3em;
}

h4 {
    font-size: var(--font-h4);
    line-height: 1.2em;
}

h5 {
    font-size: var(--font-h5);
    line-height: 1.2em;
}

h6 {
    font-size: var(--font-h6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Logo RSR */
.rsr {
    text-align: center;
    margin-bottom: 2em;
    padding: 1em 0;
}

.rsr img {
    max-width: 150px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.rsr img:hover {
    transform: scale(1.05);
}

/* Przyciski - nowoczesny design RSR */
.login,
input[type="submit"],
button,
.btn {
    font-family: var(--font-buttons);
    font-size: var(--font-base);
    font-weight: 700;
    line-height: 1em;
    padding: 20px 40px;
    background-color: var(--secondary-color);
    color: var(--bg-color);
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid var(--secondary-color);
}

.login:hover,
input[type="submit"]:hover,
button:hover,
.btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(176, 29, 32, 0.3);
}

/* Responsive przyciski */
@media (max-width: 921px) {
    .login,
    input[type="submit"],
    button,
    .btn {
        padding: 14px 28px;
        font-size: 16px;
    }
}

@media (max-width: 544px) {
    .login,
    input[type="submit"],
    button,
    .btn {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
        margin-bottom: 1em;
    }
}

/* Outline button variant */
.btn-outline {
    background-color: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: var(--bg-color);
}

/* Formularze */
.login-form-container {
    max-width: 500px;
    margin: 2em auto;
    padding: 2.5em;
    background-color: var(--bg-light);
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

form {
    margin: 0;
}

label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 16px;
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(176, 29, 32, 0.1);
}

/* Dialogi */
.dialog {
    display: none;
    background-color: var(--bg-color);
    border: none;
    padding: 2em;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 2em auto;
}

/* Modern jQuery UI Dialog Styling */
.ui-dialog {
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
    border: none !important;
    overflow: hidden !important;
}

.ui-dialog .ui-dialog-titlebar {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 16px 20px !important;
    font-family: var(--font-primary) !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    border-radius: 12px 12px 0 0 !important;
}

.ui-dialog .ui-dialog-titlebar-close {
    background: transparent !important;
    border: none !important;
    color: white !important;
    font-size: 20px !important;
    font-weight: bold !important;
    width: 24px !important;
    height: 24px !important;
    top: 50% !important;
    right: 16px !important;
    transform: translateY(-50%) !important;
}

.ui-dialog .ui-dialog-titlebar-close:hover {
    background: rgba(255,255,255,0.2) !important;
    border-radius: 4px !important;
}

.ui-dialog .ui-dialog-content {
    padding: 24px !important;
    background: white !important;
    font-family: var(--font-primary) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.ui-dialog .ui-dialog-buttonpane {
    background: var(--bg-light) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 16px 24px !important;
    margin: 0 !important;
    text-align: right !important;
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
    float: none !important;
    text-align: right !important;
}

.ui-dialog .ui-dialog-buttonpane button {
    background: var(--secondary-color) !important;
    color: white !important;
    border: 2px solid var(--secondary-color) !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-family: var(--font-buttons) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-left: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ui-dialog .ui-dialog-buttonpane button:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

.ui-dialog .ui-dialog-buttonpane button:last-child {
    background: transparent !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

.ui-dialog .ui-dialog-buttonpane button:last-child:hover {
    background: var(--border-color) !important;
    color: var(--text-color) !important;
    transform: translateY(-1px) !important;
}

/* File input styling */
.ui-dialog input[type="file"] {
    width: 100% !important;
    padding: 12px !important;
    border: 2px dashed var(--border-color) !important;
    border-radius: 8px !important;
    background: var(--bg-light) !important;
    font-family: var(--font-primary) !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

.ui-dialog input[type="file"]:focus {
    border-color: var(--primary-color) !important;
    border-style: solid !important;
    outline: none !important;
}

/* Checkbox styling */
.ui-dialog input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin-right: 8px !important;
    accent-color: var(--primary-color) !important;
}

/* Photo preview in dialogs */
.ui-dialog .zdjecie {
    max-width: 200px !important;
    max-height: 200px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    margin: 12px 0 !important;
}

/* Dialog overlay */
.ui-widget-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
}

/* Form elements in dialogs */
.ui-dialog input[type="text"],
.ui-dialog input[type="password"],
.ui-dialog input[type="email"],
.ui-dialog select,
.ui-dialog textarea {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: var(--font-primary) !important;
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    margin-bottom: 12px !important;
}

.ui-dialog input[type="text"]:focus,
.ui-dialog input[type="password"]:focus,
.ui-dialog input[type="email"]:focus,
.ui-dialog select:focus,
.ui-dialog textarea:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* ===============
   Panel kalendarza
   =============== */
.cal-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(440px, 92vw);
    height: 100vh;
    background: #fff;
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 24px rgba(0,0,0,0.1);
    transform: translateX(0);
    transition: transform .25s ease-in-out;
    z-index: 1000;
    padding: 16px 18px;
}
.cal-panel.hidden {
    transform: translateX(100%);
}
.cal-panel__header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.cal-panel__header #cal-panel__title { font-weight: 700; font-size: 18px; }
.cal-panel__header #cal-panel__close { background: transparent; border: none; font-size: 28px; line-height: 1; cursor: pointer; }
.cal-panel__content { overflow-y: auto; height: calc(100vh - 64px); padding-right: 6px; }

/* Czytelność treści w panelu */
.cal-panel__content,
.cal-panel__content p,
.cal-panel__content li,
.cal-panel__content a {
    font-size: 14px;
    line-height: 1.55;
}
.cal-panel__content sup { font-size: 10px; }
.cal-panel__content ol { margin: 8px 0 12px; padding-left: 22px; }
.cal-panel__content p { margin: 8px 0; }
.cal-panel__content a {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
}
.cal-panel__content a:hover { background: #f5f7fb; }

/* Utility classes */
.srodek {
    text-align: center;
}

.italic {
    font-style: italic;
    color: var(--text-light);
}

/* Separatory */
hr {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 2em 0;
}

/* Paragraf */
p {
    margin: 1em 0;
    line-height: 1.6;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Focus states dla accessibility */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px dotted var(--primary-color);
    outline-offset: 2px;
}

/* Selection styling */
::selection {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

/* Ikony */
.icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 0.5em;
    filter: brightness(0) saturate(100%) invert(21%) sepia(45%) saturate(1245%) hue-rotate(202deg) brightness(95%) contrast(91%);
}

/* Footer */
.footer-info {
    text-align: center;
    padding: 2em 0;
    border-top: 1px solid var(--border-color);
    margin-top: 3em;
    color: var(--text-light);
}

.footer-info a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive table - jeśli używane w kalendarzu */
.table-responsive {
    overflow-x: auto;
    margin: 1em 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
    background-color: var(--bg-color);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    box-shadow: var(--shadow);
    table-layout: fixed; /* kompaktowy układ kolumn */
}

/* Apply table-rsr styling to all tables by default */
table:not(.cal table) {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
    background-color: var(--bg-color);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 12px 16px; /* nowoczesne odstępy */
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: rgba(176, 29, 32, 0.05);
}

/* =========================
   Kalendarz - tryb kompakt
   ========================= */
.cal table {
    margin-top: 12px;
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.cal thead th.rsr_cal,
.cal thead th {
    text-align: center;
    width: 14.28%; /* równa szerokość dla 7 kolumn */
    padding: 12px 8px;
    font-weight: 600;
    font-size: 14px;
    background-color: var(--secondary-color);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
}

.cal td {
    vertical-align: top;           /* zawartość do góry */
    font-size: 14px;               /* mniejsza baza tekstu w komórkach */
    line-height: 1.35;
    max-height: 180px;             /* ogranicz wysokość komórki */
    overflow: auto;                /* przewijanie przy nadmiarze treści */
    position: relative;
    width: 14.28%;                 /* równa szerokość dla 7 kolumn */
    padding: 8px 4px;
    border: 1px solid var(--border-color);
    background-color: white;
}

.cal td a {
    display: block;
    margin: 4px 0;
    padding: 10px 12px;              /* czytelniejsze kafelki */
    font-size: 12px;                /* mniejszy tekst wydarzeń */
    border-radius: var(--border-radius-small);
    background: #ffffff !important; /* neutralny domyślny */
    border: 1px solid var(--border-color);
    color: #1f2937;                 /* ciemny tekst */
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Domyślnie ukryj długą treść wydarzeń (span), zostaw skrócone etykiety (small.s) */
.cal td a span { display: none; }
.cal td a:hover span { display: block; position: relative; margin-top: 6px; padding: 8px 10px; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow); }

.cal td small.s {                  /* podpisy wydarzeń w siatce */
    font-size: 11px;
}

/* Dzisiejszy dzień - wyróżnienie zgodnie z legendą */
.cal td.today {
    outline: 3px solid rgba(220, 38, 38, 0.35);
    outline-offset: -3px;
    background: linear-gradient(0deg, rgba(220,38,38,0.04) 0%, rgba(255,255,255,1) 100%);
}

.cal .yellow_bg, .cal .green_bg, .cal .blue_bg, .cal .red_bg {
    padding: 6px 8px !important;   /* ciaśniej w kafelkach */
    margin: 3px 0 !important;
}

.cal .tytul {
    text-align: center;
    margin: 8px 0 12px;
    font-weight: 600;
}

.cal .mth {                        /* strzałki mies./nawigacja */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    background-color: white;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 36px;
}

.cal .mth:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.cal .mth::before {
    content: '';
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 19l-7-7 7-7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 4px;
}

.cal .mth[title*='następny']::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
    margin-right: 0;
    margin-left: 4px;
}

/* Nowoczesna nawigacja kalendarza */
.calendar-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 16px 0;
    padding: 12px 0;
}

.calendar-navigation .month-year {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-color);
    min-width: 200px;
    text-align: center;
}

/* Style dla ikon SVG */
.icon, .icon2 {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}

.icon2 {
    width: 14px;
    height: 14px;
}

/* Hover effects dla ikon w linkach */
a:hover .icon, a:hover .icon2 {
    color: var(--primary-color);
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Pasek filtrów kalendarza */
.cal-filters { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0 12px; }
.cal-filters .pill { padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 999px; font-size: 12px; cursor: pointer; background: #fff; }
.cal-filters .pill.active { background: var(--secondary-color); color: #fff; border-color: var(--secondary-color); }

/* Kompakt na tablet/mobile */
@media (max-width: 921px) {
    .cal td { max-height: 140px; }
    .cal td a { padding: 5px 6px; font-size: 12px; }
}

@media (max-width: 544px) {
    .cal { margin: 12px; padding: 16px; }
    .cal td { max-height: 120px; font-size: 13px; }
    .cal td a { padding: 4px 6px; font-size: 11.5px; }
    th, td { padding: 6px 8px; }
}

/* Badge licznika wydarzeń w rogu dnia */
.cal .day-count { position: absolute; top: 6px; right: 8px; background: var(--secondary-color); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; }

/* Sticky nagłówek kalendarza */
.cal thead th { position: sticky; top: 52px; z-index: 10; }

/* Loading states */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error messages */
.message {
    padding: 1em 1.5em;
    border-radius: var(--border-radius-small);
    margin: 1em 0;
    font-weight: 500;
}

/* =========================
   Profil/Moje dane
   ========================= */
.zdjecie {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

#dane_kontaktowe {
    font-size: 16px;
    color: var(--text-color);
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #cce7ff;
    color: var(--secondary-color);
    border: 1px solid #b3d7ff;
}

/* Utility buttons — aligned with terminarz-rsr-modernized */
.btn-primary { background-color: var(--secondary-color); color: #fff; border: 2px solid var(--secondary-color); border-radius: var(--border-radius); padding: 12px 20px; font-family: var(--font-buttons); font-weight: 700; transition: all .3s ease; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.btn-primary:hover { background-color: var(--primary-color); border-color: var(--primary-color); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(176,29,32,.25); }
.btn-outline { background: transparent; color: var(--secondary-color); border: 2px solid var(--secondary-color); border-radius: var(--border-radius); padding: 12px 20px; font-family: var(--font-buttons); font-weight: 700; transition: all .3s ease; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.btn-outline:hover { background: var(--secondary-color); color: #fff; transform: translateY(-1px); }
.shadow-rsr { box-shadow: var(--shadow); }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.bg-light { background-color: var(--bg-light); }
.border-light { border-color: var(--border-color); }

/* Table parity */
.table-rsr { width: 100%; border-collapse: collapse; margin: .75em 0; background-color: var(--bg-color); border-radius: var(--border-radius-small); overflow: hidden; box-shadow: var(--shadow); }
.table-rsr th { background-color: var(--secondary-color); color: #fff; padding: 12px 16px; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.table-rsr td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
.table-rsr tr:hover { background-color: rgba(176,29,32,.05); }

/* Form fields */
.form-input { width: 100%; padding: 10px 12px; border: 2px solid var(--border-color); border-radius: var(--border-radius-small); font-size: 14px; font-family: var(--font-primary); background: var(--bg-color); color: var(--text-color); transition: border-color .3s ease, box-shadow .3s ease; }
.form-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(176,29,32,.1); }

/* Calendar event palette (parity) */
.calendar-event-training { background-color: #fff9db !important; border-left: 6px solid #f59e0b !important; color: #92400e !important; }
.calendar-event-full { background-color: #e8f6ec !important; border-left: 6px solid #16a34a !important; color: #14532d !important; }
.calendar-event-sufficient { background-color: #e6f0ff !important; border-left: 6px solid #2563eb !important; color: #1e3a8a !important; }
.calendar-event-shortage { background-color: #fee2e2 !important; border-left: 6px solid #dc2626 !important; color: #7f1d1d !important; }

/* Modern action buttons and info boxes */
.modern-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.modern-actions .btn-sm { padding: 8px 12px; font-size: 13px; }
.modern-actions .disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

.modern-info-box { background: var(--bg-light); border: 1px solid var(--border-color); border-radius: var(--border-radius-small); padding: 12px; margin: 12px 0; }

/* Small button variant */
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 6px; }

/* ===================================================================
   KOLORY KALENDARZA - LEGENDA WYDARZEŃ
   =================================================================== */

/* Żółty - Szkolenie */
.yellow_bg {
    background-color: #fff9db !important;
    border-left: 6px solid #f59e0b !important;
    color: #92400e !important;
    font-weight: 600;
}

/* Zielony - Kompletna obsada */
.green_bg {
    background-color: #e8f6ec !important;
    border-left: 6px solid #16a34a !important;
    color: #14532d !important;
    font-weight: 600;
}

/* Niebieski - Wystarczająca z rezerwą */
.blue_bg {
    background-color: #e6f0ff !important;
    border-left: 6px solid #2563eb !important;
    color: #1e3a8a !important;
    font-weight: 600;
}

/* Czerwony - Brakuje osób */
.red_bg {
    background-color: #fee2e2 !important;
    border-left: 6px solid #dc2626 !important;
    color: #7f1d1d !important;
    font-weight: 600;
}

/* Styling dla elementów kalendarza z kolorami */
.yellow_bg, .green_bg, .blue_bg, .red_bg {
    padding: 8px 12px !important;
    margin: 4px 0 !important;
    border-radius: var(--border-radius-small) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* ===================================================================
   MENU NAWIGACYJNE - STYLE RSR
   =================================================================== */

/* Container menu */
.admin-menu {
    position: sticky; top: 12px; z-index: 20; /* sticky pasek modułów */
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    padding: 0.75em 1.1em;
    margin: 1.25em 0 1.25em;
    box-shadow: var(--shadow);
}

/* Lista menu - układanie poziome */
.menu-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Linki menu - nowoczesny design jak na sztab.rybnik.pl - zmniejszone dla lepszego dopasowania */
.menu-nav a {
    display: inline-block;
    padding: 10px 14px;
    background-color: transparent;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-family: var(--font-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.menu-nav a:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(176, 29, 32, 0.2);
}

/* Aktywny element menu */
.menu-nav .active {
    background-color: var(--secondary-color) !important;
    color: var(--bg-color) !important;
    font-weight: 600;
    border-color: var(--secondary-color);
}

.menu-nav .active:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color);
}

/* Separator w menu */
.menu-separator {
    color: var(--border-color);
    margin: 0 0.5em;
    font-weight: 300;
}

/* Info użytkownika */
.user-info {
    background-color: var(--bg-color);
    border-radius: var(--border-radius-small);
    padding: 1em 1.5em;
    margin: 1em 0;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
}

.user1, .user2 {
    font-size: 14px;
}

.user1 {
    color: var(--text-color);
    font-weight: 500;
}

.user2 a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--border-radius-small);
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
}

.user2 a:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

/* Responsive optimizations */

/* Responsive menu */
@media (max-width: 1280px) {
    .menu-nav {
        gap: 0.2em; /* Jeszcze mniejsze odstępy na mniejszych ekranach */
    }
    
    .menu-nav a {
        padding: 6px 10px; /* Jeszcze mniejsze padding */
        font-size: 13px;
    }
}

@media (max-width: 921px) {
    .menu-nav {
        flex-direction: column;
        align-items: center;
        flex-wrap: wrap; /* Przywróć wrap dla mobile */
    }
    
    .menu-nav a {
        padding: 12px 24px;
        margin: 2px 0;
        width: 100%;
        text-align: center;
        max-width: 300px;
        font-size: 14px;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 544px) {
    .menu-nav a {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .admin-menu {
        padding: 1em;
    }
}

/* Nagłówek zalogowanego użytkownika */
.logged {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 1em;
    font-size: var(--font-h2);
}
