* { box-sizing: border-box; }

body {
    font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 16px;
    background: #f4f4f4;
    color: #111;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.page-header form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-header input[type="number"] {
    width: 6em;
    padding: 6px 8px;
    font-size: 1rem;
}

.year-form {
    gap: 4px !important;
}

.btn-step {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 1.3rem;
    line-height: 1;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #444;
    background: #fff;
    color: #111;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn:hover { background: #eee; }

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.grafik-year {
    background: #fff;
    padding: 12px;
    max-width: 100%;
    overflow-x: auto;
}

.grafik-title {
    text-align: center;
    font-size: 1.4rem;
    margin: 4px 0 12px;
}

.grafik-table {
    border-collapse: collapse;
    width: 1240px;
    margin-bottom: 14px;
    font-size: 13.5px;
}

.grafik-table th, .grafik-table td {
    border: 1px solid #333333;
    text-align: center;
    vertical-align: middle;
    padding: 4px 2px;
    white-space: nowrap;
    overflow: hidden;
    font-weight: bold;
}

.col-label { width: 140px; }
.col-day { width: 34px; }
.col-total { width: 46px; }

/* Puste dni (poza danym miesiącem): pojedyncze komórki, ale obramowanie od
   wewnątrz "zamaskowane" (kolor tła), żeby cały blok wyglądał jak jeden
   scalony prostokąt - kolspan/rowspan zawodzi w Dompdf.
   Specyficzność musi być >= ".grafik-table td" (0,1,1), inaczej przegrywa. */
.grafik-table td.empty-days {
    background: #f5f5f5;
    border-color: #f5f5f5;
}
.grafik-table td.empty-edge-left { border-left-color: #333333; }
.grafik-table td.empty-edge-right { border-right-color: #333333; }
.grafik-table td.empty-edge-top { border-top-color: #333333; }
.grafik-table td.empty-edge-bottom { border-bottom-color: #333333; }

.cell-label {
    text-align: left !important;
    padding-left: 4px;
    font-weight: bold;
    text-transform: uppercase;
    background: #fafafa;
    /* Przy przewijaniu tabeli w bok (telefon, powiększenie strony) pierwsza
       kolumna (nazwiska/nazwa miesiąca) zostaje przyklejona do lewej krawędzi.
       Wyłączone w druku/PDF poniżej - tam strona się nie przewija. */
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 2px 0 3px -1px rgba(0, 0, 0, 0.25);
}

.cell-name { font-weight: bold; }

.row-weekday th, .row-month th { background: #eaeaea; }

.sat { background: #f5c518; }
.sun { background: #cf6679; color: #fff; }
.holiday { background: #7cb87c; }
.off { background: #1a1a1a; }

.cell-total {
    background: #5b8fd1;
    color: #fff;
    font-weight: bold;
}

.cell-total-head {
    background: #5b8fd1;
    color: #fff;
    font-weight: bold;
}

footer.app-footer {
    margin-top: 16px;
    font-size: 0.85rem;
    color: #555;
    text-align: center;
}

a.link-muted {
    color: #555;
    font-size: 0.85rem;
}

@media print {
    body { background: #fff; padding: 0; }
    .no-print { display: none !important; }
    .grafik-year { padding: 0; overflow: visible; }
    .grafik-title { font-size: 12px; margin: 0 0 2px; }
    .cell-label { position: static; box-shadow: none; }
    .grafik-table { font-size: 9.3px; margin-bottom: 3.3mm; line-height: 1; width: 197mm; }
    .grafik-table th, .grafik-table td { padding: 1.1px 0.7px; }
    .col-label { width: 26mm; }
    .col-day { width: 5.3mm; }
    .col-total, .cell-total, .cell-total-head { width: 7mm; }

    @page {
        margin: 5mm;
    }
}
