/* style.css
 * Wersja: v2.9.4
 * Ostatnia zmiana: 2026-08-26
 *
 * Zmiany v2.9.4:
 *   - POPRAWIONO: czytelnosc naglowka — miesiac byl niewidoczny (bialy na bialym pillu),
 *     usunieto bold z napisow naglowka (font-weight 400), zwiekszono kontrast.
 *
 * Zmiany v2.9.3:
 *   - USUNIETO: suwak szerokosci kolumn (col-width-control) i jego obsluga — niepotrzebny, zajmowal miejsce.
 *
 * Zmiany v2.9.2:
 *   - POPRAWIONO: kontrast w naglowku — biale napisy na guzikach byly slabo widoczne,
 *     etykieta SUMA czarna na ciemnym tle niewidoczna — teraz SUMA biala, guziki
 *     w naglowku jasne z ciemnym tekstem (wysoki kontrast).
 *
 * Zmiany v2.9.1:
 *   - PRZYCIEMNIONO: lokalny naglowek #176735 → #0f3d1e (ciemniejsza zielen).
 *
 * Zmiany v2.9.0:
 *   - DODANO: naglowek .top-bar w kolorze #176735 lokalnie i #16206f (granat stare) na produkcji
 *     — klasa body.env-local / body.env-server ustawiana z api?action=environment.
 *
 * Zmiany v2.8.0:
 *   - ZMIENIONO: pierwsza kolumna trybu Godziny — dzień+data wspólne w wierszu
 *     przyjścia, etykiety "przyjście"/"wyjście" niżej (w linii popołudniowej),
 *     bez ikon.
 *   - ZMIENIONO: zmniejszono odstęp między wierszami przyjścia/wyjścia.
 *   - ZMIENIONO: czcionka pól godzin +1px (day-name, day-date, time-select,
 *     day-label, .col-day).
 *   - ZMIENIONO: poszerzono .time-select (56px → 64px, mobile 65px → 72px),
 *     aby godziny mieściły się w całości.
 *
 * Zmiany v2.7.0:
 *   - Dodano .emp-separator z border-left: 2px solid #000 dla rozdzielenia użytkowników.
 *
 * Zmiany v2.2.0:
 *   - DODANO: style dla radio-group (tryb widoku godziny/rozliczenie/nadgodziny).
 *   - DODANO: klasa .emp-col-even (szara co druga kolumna pracownika).
 *   - ZMIENIONO: .time-select z 80px na 56px aby zwinąć kolumny na ekranie.
 */

* {
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', 'Roboto', sans-serif;
}

body {
    background: #eef2f7;
    margin: 0;
    padding: 8px 6px;
}

.app-container {
    max-width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow-x: auto;
    padding: 8px 6px;
}
/* Tryb widoku: radio godziny/rozliczenie/nadgodziny */
.radio-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f8fc;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #1f4e7a;
}
.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
}
.radio-group input[type="radio"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
}
/* Checkbox nadgodziny */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f8fc;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    color: #1f4e7a;
}

.checkbox-label input {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* tryb nadgodzin – minimalna szerokość kol. */
.emp-col-even {
    background: #f5f7fa !important;
}
/* Status WOL (dni wolne od pracy) */
.status-wol-active {
    background: #e8e8e8;
    color: #333;
    font-weight: bold;
}

/* Kolumna nadgodzin – bez owali, tylko liczba */
.overtime-col {
    background: #f9fafb;
    text-align: center;
    min-width: 45px;
}

.overtime-value {
    font-weight: 600;
    font-size: 0.75rem;
    color: #1a4c6e;
}

/* ==================== TOP BAR – ZAKŁADKI + TOOLBAR ==================== */
/* Checkbox rozliczenie */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f8fc;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    color: #1f4e7a;
}

.checkbox-label input {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Kolumna z godzinami pracy (obliczonymi) */
.hours-col {
    background: #f9fafb;
    font-weight: 600;
}

.hours-value {
    font-weight: 600;
    background: #eef2f7;
    border-radius: 12px;
    padding: 2px 4px;
}

.top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 2px;
    transition: background 0.2s ease;
}
/* Kolor naglowka zalezny od srodowiska — lokalnie ciemna zielen #0f3d1e, produkcja granat #16206f (stare) */
body.env-local .top-bar {
    background: #0f3d1e;
    padding: 8px 10px;
    border-radius: 12px;
    margin: -2px -2px 12px -2px;
}
body.env-server .top-bar {
    background: #16206f;
    padding: 8px 10px;
    border-radius: 12px;
    margin: -2px -2px 12px -2px;
}
body.env-local .top-bar #monthLabel,
body.env-server .top-bar #monthLabel {
    color: #111 !important;
    font-weight: 400 !important;
}
body.env-local .tabs,
body.env-server .tabs {
    background: rgba(255,255,255,0.18);
}
body.env-local .tab,
body.env-server .tab {
    color: rgba(255,255,255,0.9);
    font-weight: 400 !important;
}
body.env-local .tab.active,
body.env-server .tab.active {
    background: #fff;
    color: #111;
    font-weight: 400 !important;
}
body.env-local .month-nav,
body.env-server .month-nav {
    background: rgba(255,255,255,0.95);
}
body.env-local .month-nav button,
body.env-server .month-nav button {
    font-weight: 400 !important;
}
/* Kontrast guzikow w ciemnym naglowku — jasne tlo + ciemny tekst, bez bold */
body.env-local .top-bar .toolbar button,
body.env-server .top-bar .toolbar button {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-color: rgba(255,255,255,0.9) !important;
    font-weight: 400 !important;
}
body.env-local .top-bar .toolbar .btn-primary,
body.env-server .top-bar .toolbar .btn-primary {
    background: #ffffff !important;
    color: #0f3d1e !important;
    border-color: #ffffff !important;
}
body.env-server .top-bar .toolbar .btn-primary {
    color: #16206f !important;
}
body.env-local .top-bar .toolbar #printBtn,
body.env-server .top-bar .toolbar #printBtn,
body.env-local .top-bar .toolbar #empFilterBtn,
body.env-server .top-bar .toolbar #empFilterBtn {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-color: rgba(0,0,0,0.08) !important;
}
/* Etykieta SUMA i inne labele w naglowku — biala na ciemnym tle, bez bold */
body.env-local .top-bar label,
body.env-server .top-bar label {
    color: #ffffff !important;
    font-weight: 400 !important;
}
body.env-local .top-bar .radio-group,
body.env-server .top-bar .radio-group {
    background: rgba(255,255,255,0.92) !important;
    color: #1a1a1a !important;
}
body.env-local .top-bar .radio-group label,
body.env-server .top-bar .radio-group label {
    color: #1a1a1a !important;
}

.tabs {
    display: flex;
    gap: 4px;
    background: #f1f6fb;
    border-radius: 40px;
    padding: 3px;
}

.tab {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 400;
    text-decoration: none;
    color: #1f4e7a;
    border-radius: 30px;
    transition: 0.2s;
    white-space: nowrap;
}

.tab.active {
    background: #1f6392;
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab:not(.active):hover {
    background: #e2eaf1;
}

/* pasek narzędzi */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.month-nav {
    background: #f1f6fb;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    padding: 2px 4px;
    gap: 4px;
}

.month-nav button {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 4px;
    color: #1f6392;
}

#monthLabel {
    font-weight: 400;
    font-size: 0.75rem;
    min-width: 110px;
    text-align: center;
    color: #111;
    padding: 2px 6px;
}

button {
    background: white;
    border: 1px solid #cbdde9;
    padding: 4px 8px;
    border-radius: 24px;
    font-weight: 400;
    font-size: 0.65rem;
    cursor: pointer;
    transition: 0.1s;
    color: #1f4e7a;
}

.btn-primary {
    background: #1f6392;
    border-color: #1f6392;
    color: white;
}

button:hover {
    background: #e6f0f9;
}

/* kontener tabeli - ważne dla sticky */
.month-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    max-height: 75vh;
}

/* tabela */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
    min-width: 360px;
}

/* ==================== STICKY HEADER ==================== */
.schedule-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.schedule-table thead tr th {
    background: #f1f8fe;
    position: sticky;
    top: 0;
    z-index: 21;
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
}

.schedule-table td:first-child,
.schedule-table th:first-child {
    position: sticky;
    left: 0;
    background: #fefaf2;
    z-index: 15;
}

.schedule-table thead tr th:first-child {
    z-index: 25;
    background: #f1f8fe;
}

.schedule-table th,
.schedule-table td {
    border: 1px solid #e0eaf1;
    padding: 2px 1px;
    text-align: center;
    vertical-align: middle;
    background: white;
}

.schedule-table th {
    background: #f1f8fe;
    font-weight: 600;
    color: #111;
    font-size: 0.7rem;
    white-space: nowrap;
    padding: 4px 2px;
}

.schedule-table th span {
    font-size: 0.75rem;
    font-weight: 600;
}

/* pierwsza kolumna (dzień) */
.col-day {
    background: #fefaf2;
    font-weight: 500;
    text-align: center;
    width: 52px;
    min-width: 52px;
    font-size: 0.7rem;
    padding: 2px 1px;
    color: #111;
}

.day-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.day-name {
    font-weight: 700;
    font-size: 0.75rem;
    color: #111;
}

.day-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: #111;
}

.day-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #555;
}

/* zwarty układ zmian – 0px odstępu między wierszami przyjścia/wyjścia */
.morning-row td {
    border-bottom: none;
    padding-bottom: 0;
}

.afternoon-row td {
    border-top: none;
    padding-top: 0;
}

@media (min-width: 1900px) {
    .morning-row td {
        padding-bottom: 0;
    }
    .afternoon-row td {
        padding-top: 0;
    }
    .schedule-table td, .schedule-table th {
        font-size: 0.75rem;
    }
}

.schedule-table th.emp-separator,
.schedule-table td.emp-separator {
    border-left: 2px solid #000;
}

/* separatory dni */
.day-separator {
    border-top: 2px solid #bdd4e8 !important;
}

.week-separator {
    border-top: 4px solid #8ba3bc !important;
}

/* statusy – kolory dla ekranu */
.status-compact {
    font-weight: 600;
    font-size: 0.7rem;
    display: inline-block;
    width: 100%;
    text-align: center;
    cursor: pointer;
    padding: 3px 1px;
    border-radius: 14px;
    background: #f0f2f5;
    color: #111;
}

.status-x-active { background: #2e7d64; color: white; }
.status-xx-active { background: #b9dfd3; color: #1a4d2e; }
.status-url-active { background: #c5e0f5; color: #1a4d6e; }
.status-l4-active { background: #f5e6b8; color: #7a5c00; }
.status-uz-active { background: #d4f1f9; color: #006d77; }
.status-nu-active { background: #e2e8f0; color: #2c5282; }
.status-q-active { background: #e2e0f5; color: #3c2e7e; }
.status-empty-active { background: #f9f9fc; color: #aaa; }

/* style dla godzin */
.time-select {
    width: 64px;
    text-align: center;
    font-size: 0.75rem;
    padding: 3px 2px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: #fff;
    font-family: monospace;
    cursor: pointer;
}

/* widok mobilny */
@media (max-width: 680px) {
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .tabs {
        justify-content: center;
    }
    .toolbar {
        justify-content: center;
    }
    .schedule-table th, .schedule-table td {
        padding: 2px 1px;
    }
    .col-day {
        width: 44px;
        min-width: 44px;
    }
    .day-name {
        font-size: 0.65rem;
    }
    .day-date {
        font-size: 0.65rem;
    }
    .schedule-table th span.emp-full {
        display: none;
    }
    .schedule-table th span.emp-short {
        display: inline-block;
        font-size: 0.75rem;
        font-weight: 600;
    }
    .status-compact {
        font-size: 0.65rem;
        padding: 2px 1px;
    }
    .time-select {
        width: 72px;
        font-size: 0.65rem;
        padding: 2px 1px;
    }
    .month-table-wrapper {
        max-height: 70vh;
    }
}

@media (min-width: 681px) {
    .schedule-table th span.emp-short {
        display: none;
    }
    .schedule-table th span.emp-full {
        display: inline-block;
    }
}
