/* Kadry — UI v9 */
:root {
    --brand: #07184f;
    --brand-hover: #0a2568;
    --brand-light: #eef2ff;
    --surface: #ffffff;
    --bg: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --success: #15803d;
    --success-bg: #ecfdf5;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --accent: #2563eb;
    --accent-bg: #eff6ff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 35, 70, 0.06);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --topbar-h: 60px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    margin-top: 0;
    color: var(--text);
    letter-spacing: -0.02em;
}

h1 { font-size: 1.35rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }

a {
    color: var(--accent);
}

.wrap {
    max-width: 1380px;
    margin: 0 auto;
    padding: 24px;
}

/* —— Topbar —— */
.topbar {
    background: var(--brand);
    color: #fff;
    padding: 0 24px;
    min-height: var(--topbar-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(7, 24, 79, 0.25);
}

.topbar__brand {
    flex: 0 1 auto;
    min-width: 0;
}

.topbar__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    line-height: var(--topbar-h);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
}

.topbar__role,
.topbar__user {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* Nawigacja administratora */
.app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.app-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-nav__link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-nav__link.is-active {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.app-nav__link--logout {
    margin-left: 4px;
    color: rgba(255, 255, 255, 0.75);
}

.app-nav__link--logout:hover {
    background: rgba(220, 38, 38, 0.25);
    color: #fff;
}

.app-nav__link--logout.is-active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* —— Karty i formularze —— */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    flex: 1;
}

.row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-soft);
}

input,
select,
textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input::placeholder {
    color: var(--muted);
}

/* —— Przyciski —— */
button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 10px 18px;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.1s ease;
}

button:hover,
.btn:hover {
    background: var(--brand-hover);
}

button:active,
.btn:active {
    transform: translateY(1px);
}

button:focus-visible,
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.btn2,
.btn--secondary {
    background: var(--brand-light);
    color: var(--brand);
}

.btn2:hover,
.btn--secondary:hover {
    background: #e0e7ff;
}

.btn--ghost,
.topbar__logout {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn--ghost:hover,
.topbar__logout:hover {
    background: #fff;
    color: var(--brand) !important;
}

.danger {
    background: var(--danger);
}

.danger:hover {
    background: #b91c1c;
}

.btn--danger {
    background: var(--danger);
    color: #fff;
    border: 0;
}

.btn--danger:hover {
    background: #b91c1c;
    color: #fff;
}

.history-clear-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.ok {
    background: var(--success-bg);
    color: var(--success);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid #bbf7d0;
    font-weight: 500;
}

.err {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid #fecaca;
    font-weight: 500;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.pill {
    background: var(--brand-light);
    color: var(--brand);
    border-radius: 999px;
    padding: 5px 10px;
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
}

/* —— Logowanie —— */
.loginWrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.loginBox {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.loginBox h2 {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-soft);
}

.logoBox {
    text-align: center;
    margin-bottom: 22px;
}

.logoBox img {
    max-width: 320px;
    width: 100%;
    height: auto;
}

.mainTitle {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand);
    margin: 0 0 24px;
    letter-spacing: -0.03em;
}

body.login-screen {
    background: #fff;
}

body.login-screen .loginWrap {
    background: #fff;
}

body.login-screen .loginBox .card.login-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

body.login-screen .loginBox .login-panel .footer {
    padding: 16px 0 0;
    margin: 0;
}

.login-panel__lead {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
}

.login-panel--reset {
    margin-top: 14px;
    border-color: #cbd5e1;
    background: #f8fafc;
    padding: 12px;
}

.loginTileReset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--brand);
    background: #fff;
    border: 2px solid var(--brand);
    border-radius: var(--radius-sm, 6px);
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.loginTileReset:hover {
    background: var(--brand-light, #eef2ff);
    transform: translateY(-1px);
}

.login-panel--resetForm {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-light, #e0e7ff);
}

.loginBtnPrimary,
.loginBtnSecondary {
    display: inline-block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    margin-top: 4px;
}

.loginBtnSecondary {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--brand);
    background: #fff;
    border: 2px solid var(--brand);
    border-radius: var(--radius);
    text-decoration: none;
}

.loginBtnSecondary:hover {
    background: var(--brand-light, #eef2ff);
}

.loginInputEmail {
    font-size: 16px !important;
}

/* —— Tabele —— */
.tableWrap {
    overflow-x: auto;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.desktop-table table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    background: var(--surface);
}

.desktop-table th,
.desktop-table td {
    border: 1px solid var(--border);
    padding: 8px;
    text-align: center;
    font-size: 12px;
}

.desktop-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-soft);
}

.nameCell {
    line-height: 1.15;
    white-space: nowrap;
    width: 1%;
    text-align: left !important;
    font-weight: 600;
}

.nameCell span {
    font-weight: 500;
}

.num {
    width: 1%;
    min-width: 32px;
    white-space: nowrap;
}

.sum {
    font-weight: 700;
    background: #f8fafc;
}

.actions {
    min-width: 145px;
}

.actionBtn {
    display: inline-block;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: #fff !important;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    margin: 2px;
}

.editBtn {
    background: var(--accent);
}

.deleteBtn {
    background: var(--danger);
}

.genBtn {
    margin-top: 10px;
    background: #f59e0b;
    color: #111;
    border: 0;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
    font-weight: 700;
    font-family: inherit;
}

.genBtn:hover {
    background: #d97706;
}

.mobile-cards {
    display: none;
}

.emp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.day-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px;
    text-align: center;
    font-size: 12px;
}

.footer {
    text-align: center;
    color: var(--muted);
    padding: 22px;
    font-size: 13px;
}

.footer a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.readonlyField {
    background: #f1f5f9 !important;
    cursor: default !important;
    color: var(--text-soft);
}

.col-name { width: 1%; min-width: 92px; max-width: 118px; text-align: left; line-height: 1.12; white-space: normal; }
.col-group { width: 1%; min-width: 70px; max-width: 92px; white-space: normal; }
.col-total { width: 42px; min-width: 42px; }

th.col-lp, td.col-lp,
th.num, td.num {
    width: 23px !important;
    min-width: 23px !important;
    max-width: 23px !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Formularz pracownika — admin */
.employeeEditSelectRow {
    display: grid !important;
    grid-template-columns: minmax(320px, 1fr) 110px !important;
    gap: 12px !important;
    align-items: end !important;
    margin-bottom: 16px !important;
}

.employeeEditSelectRow .field {
    margin: 0 !important;
}

.employeeEditSelectRow select,
.employeeEditSelectRow button {
    width: 100% !important;
    box-sizing: border-box !important;
}

.employeeOneLine {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr 1.1fr 1.15fr auto .9fr auto !important;
    gap: 12px !important;
    align-items: end !important;
    width: 100% !important;
}

.employeeOneLine .field {
    margin: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
}

.employeeOneLine input,
.employeeOneLine select,
.employeeOneLine button {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.employeeOneLine label {
    white-space: nowrap !important;
}

.employeeOneLine .genBtn {
    margin-top: 0 !important;
}

@media (max-width: 980px) {
    .employeeEditSelectRow,
    .employeeOneLine {
        grid-template-columns: 1fr !important;
    }
}

/* Lokalizacje i słowniki */
.btn--compact {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 13px;
}

.locationsAddBar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    margin: 0 0 18px;
    padding: 12px 14px;
    background: var(--surface-2, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm);
}

.locationsAddBar__type {
    flex: 0 1 200px;
    min-width: 160px;
    margin: 0;
}

.locationsAddBar__name {
    flex: 1 1 220px;
    min-width: 180px;
    margin: 0;
}

.locationsAddBar__submit {
    flex: 0 0 auto;
    margin: 0;
}

.locationsAddBar__submitLabel {
    display: block;
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 6px;
    visibility: hidden;
}

.locationsCol__title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #1e293b);
}

.dict-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 100%;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
    color: var(--brand);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    vertical-align: top;
}

.dict-tag__label {
    word-break: break-word;
}

.dict-tag__removeForm {
    display: inline-flex;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.dict-tag__remove {
    min-height: auto;
    height: auto;
    padding: 0 3px;
    margin: 0;
    background: transparent;
    color: #b91c1c;
    border: 0;
    border-radius: 2px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}

.dict-tag__remove:hover {
    background: #fee2e2;
    color: #991b1b;
    transform: none;
}

.dict-tag__remove:focus-visible {
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.35);
}

.locationsList__empty {
    margin: 0;
    font-size: 13px;
}

/* Zamknięcie kart miesięcznych */
.lockedMonthsYearForm {
    margin-bottom: 14px;
}

.lockedMonthsYearForm__field {
    max-width: 220px;
    margin: 0;
}

.lockedMonthsGrid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
}

.lockedMonthsRow {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 720px) {
    .lockedMonthsRow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.lockedMonthToggle {
    margin: 0;
    padding: 0;
}

.lockedMonthBtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 52px;
    padding: 8px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.lockedMonthBtn:hover {
    transform: translateY(-1px);
}

.lockedMonthBtn.is-open {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.lockedMonthBtn.is-open:hover {
    background: #d1fae5;
}

.lockedMonthBtn.is-locked {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.lockedMonthBtn.is-locked:hover {
    background: #fee2e2;
}

.lockedMonthBtn__name {
    font-size: 13px;
}

.lockedMonthBtn__status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

.lockedMonthsHint {
    margin: 0;
    font-size: 13px;
}

/* Filtr zestawienia — administrator */
.adminSummaryFilter__intro {
    margin: 0 0 14px;
    font-size: 13px;
}

.adminSummaryFilter__month {
    margin-bottom: 16px;
}

.adminSummaryFilter__block {
    margin-bottom: 14px;
}

.adminSummaryFilter__label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 6px;
}

.adminSummaryFilter__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 6px;
    align-items: flex-start;
}

.filterChip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: #334155;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.filterChip:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.filterChip.is-active {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand);
    font-weight: 600;
}

.adminSummaryFilter__actions {
    margin: 12px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}

.adminSummaryFilter__form {
    margin-top: 8px;
}

.adminSummaryFilter__month {
    margin-bottom: 14px;
}

.adminSummaryFilter__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--muted);
}

.adminSummaryFilter__tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Kafelki filtra — jak Zamknięcie kart miesięcznych: biały / zielony */
.filterTile {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.filterTile__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.filterTile__text {
    text-align: center;
    word-break: break-word;
}

.filterTile:hover {
    transform: translateY(-1px);
    border-color: #94a3b8;
}

.filterTile.is-selected,
.filterTile:has(.filterTile__input:checked) {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.filterTile.is-selected:hover,
.filterTile:has(.filterTile__input:checked):hover {
    background: #d1fae5;
}

.filterTile--sample {
    cursor: default;
    pointer-events: none;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
}

.filterTile--sample.is-selected {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.locationsColumns {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    align-items: start !important;
}

.locationsCol {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.locationsAddForm {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
}

.locationsAddForm .field {
    width: 100% !important;
    margin: 0 !important;
}

.locationsAddForm input,
.locationsAddForm select {
    width: 100% !important;
}

.locationsAddForm button {
    width: auto !important;
    align-self: flex-start !important;
}

.locationsList {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px 6px !important;
    margin-top: 4px !important;
    align-items: flex-start !important;
}

@media (max-width: 900px) {
    .locationsColumns {
        grid-template-columns: 1fr !important;
    }
}

/* Tabela zestawienia — wąskie kolumny dni */
.desktop-table th,
.desktop-table td {
    padding-left: 4px !important;
    padding-right: 4px !important;
}

.desktop-table th.dayCol,
.desktop-table td.dayCol {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    white-space: nowrap !important;
}

.desktop-table.summary-kierownik th.dayCol,
.desktop-table.summary-kierownik td.dayCol {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    white-space: normal !important;
    vertical-align: middle !important;
    line-height: 1.1 !important;
    text-align: center !important;
}

.desktop-table.summary-kierownik td.dayCol-stack {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

.desktop-table.summary-kierownik .day-cell-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
}

.desktop-table.summary-kierownik .day-cell-hours {
    display: block;
    width: 100%;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.1;
    text-align: center;
}

.desktop-table.summary-kierownik .day-cell-build {
    display: block;
    width: 100%;
    font-size: 10px;
    color: var(--danger);
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
}

.mobile-cards.summary-kierownik .day-box-build {
    display: block;
    font-size: 10px;
    color: var(--danger);
    font-weight: 600;
    margin-top: 2px;
}

.mobile-cards.summary-kierownik .day-box.supervisor-pick-day {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
}

.mobile-cards.summary-kierownik .day-box.supervisor-pick-day .day-cell-hours {
    font-weight: 600;
    font-size: 13px;
}

.mobile-cards.summary-kierownik .day-box.supervisor-pick-day.day-picked,
.desktop-table td.hours-pick-day.day-picked,
.desktop-table.summary-kierownik td.supervisor-pick-day.day-picked {
    background: #c5dcf7 !important;
    box-shadow: inset 0 0 0 2px #1a5fb4;
}

.hours-pick-day,
.supervisor-pick-day {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.desktop-table td.hours-pick-day:hover,
.desktop-table.summary-kierownik td.supervisor-pick-day:hover {
    background: var(--accent-bg) !important;
}

body.hours-day-drag,
body.supervisor-day-drag {
    user-select: none;
    cursor: crosshair;
    touch-action: none;
}

body.hours-day-drag .hours-pick-day,
body.supervisor-day-drag .supervisor-pick-day {
    cursor: crosshair;
}

.desktop-table th.col-total,
.desktop-table td.col-total {
    width: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
}

.desktop-table .nameCell {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    white-space: normal !important;
    line-height: 1.12 !important;
}

/* Responsywność */
@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        min-height: 0;
    }

    .topbar__title {
        line-height: 1.3;
        padding: 4px 0;
    }

    .topbar__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .app-nav {
        width: 100%;
        gap: 6px;
    }

    .app-nav__link {
        flex: 1 1 auto;
        min-width: calc(50% - 6px);
        font-size: 13px;
        padding: 0 10px;
    }

    .app-nav__link--logout {
        margin-left: 0;
    }

    .topbar__user {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .wrap {
        padding: 16px;
    }

    .mainTitle {
        font-size: 1.5rem;
    }

    .desktop-table {
        display: none;
    }

    .mobile-cards {
        display: block;
    }

    .row {
        display: block;
    }

    .field {
        margin-bottom: 12px;
    }

    .days-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    button,
    .btn {
        width: 100%;
    }

    .topbar__logout {
        width: 100%;
    }
}

/* —— Pomoc / instrukcja —— */
.help-page {
    width: 100%;
    max-width: none;
}

.help-back {
    margin: 0 0 12px;
    font-size: 14px;
}

.help-back a {
    font-weight: 600;
    text-decoration: none;
    color: var(--brand);
}

.help-back a:hover {
    text-decoration: underline;
}

.help-intro {
    margin-bottom: 20px;
}

.help-search-wrap {
    position: relative;
    margin-bottom: 20px;
}

.help-search-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.help-search-input {
    width: 100%;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
}

.help-search-input:focus {
    outline: 2px solid var(--accent-bg);
    border-color: var(--accent);
}

.help-search-results {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    max-width: 100%;
    margin: 4px 0 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    max-height: 280px;
    overflow-y: auto;
}

.help-search-hit {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    cursor: pointer;
}

.help-search-hit:hover {
    background: var(--accent-bg);
    color: var(--accent);
}

.help-toc {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.help-toc-group {
    margin-bottom: 14px;
}

.help-toc-group-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
    margin: 0 0 8px;
}

.help-toc ul {
    margin: 0;
    padding-left: 1.2rem;
}

.help-toc a {
    font-size: 14px;
    text-decoration: none;
}

.help-toc a:hover {
    text-decoration: underline;
}

.help-group-block {
    margin-bottom: 28px;
}

.help-group-heading {
    font-size: 1.25rem;
    color: var(--brand);
    border-bottom: 2px solid var(--brand-light);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.help-section {
    margin-bottom: 14px;
    scroll-margin-top: 80px;
}

.help-section-title {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.help-section-body {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.6;
}

.help-section-body ul {
    margin: 8px 0;
    padding-left: 1.25rem;
}

.help-section--highlight {
    box-shadow: 0 0 0 3px var(--accent);
    transition: box-shadow 0.3s ease;
}

.help-no-results {
    margin-top: 16px;
}

/* Panel administratora — Karta pracy */
.adminWorkspace {
    padding-top: 4px;
}

.adminWorkspace__head {
    margin-bottom: 12px;
}

.adminWorkspace__title {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.adminWorkspace__hint {
    margin: 0;
    font-size: 13px;
}

.adminTabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.adminTab {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.adminTab:hover {
    background: #fff;
    border-color: #94a3b8;
    color: #0f172a;
}

.adminTab.is-active {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand);
}

.adminTab.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.adminTab--summary {
    margin-left: auto;
    font-weight: 500;
    background: #fff;
}

.adminTab__sub {
    font-size: 11px;
    font-weight: 500;
    color: inherit;
    opacity: 0.85;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adminPanel {
    padding-top: 4px;
}

.adminPanelSection__title {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
}

.adminPanelSection__note {
    margin: 0 0 12px;
    font-size: 13px;
}

.adminPanelSection__note.ok {
    color: var(--ok, #15803d);
}

.employeeGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    align-items: end;
    width: 100%;
}

.employeeGrid .field {
    margin: 0;
    min-width: 0;
}

.employeeGrid .field--wide {
    grid-column: 1 / -1;
}

.employeeGrid .field--submit button,
.employeeGrid .field--actions .genBtn {
    width: 100%;
}

.adminHoursToolbar {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #e2e8f0;
}

.adminHoursForm .field--submit button {
    min-width: 140px;
}

.adminSummaryFilter__quick {
    margin: 0 0 14px;
    font-size: 13px;
}

.adminSummaryFilter__quick a {
    font-weight: 600;
    text-decoration: none;
    color: var(--brand);
}

.adminSummaryFilter__quick a:hover {
    text-decoration: underline;
}

.adminSummaryFilter__quickSep {
    margin: 0 6px;
    color: #94a3b8;
}

.adminEmployeePanel__section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.adminEmployeePanel__section--absence {
    background: #f8fafc;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -16px;
    padding: 18px 16px 16px;
    border-radius: 0 0 12px 12px;
}

.adminEmployeePanel__heading {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.adminEmployeePanel__lead {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
}

.adminEmployeePanel__steps {
    margin: 0 0 12px;
    padding-left: 1.2rem;
    font-size: 13px;
    line-height: 1.5;
}

.adminEmployeePanel__warn,
.adminEmployeePanel__ok {
    margin: 0;
    font-size: 13px;
}

.adminEmployeePanel__link {
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

.adminEmployeePanel__link:hover {
    text-decoration: underline;
}

.label--upper {
    letter-spacing: 0.02em;
}

.input--upper {
    text-transform: uppercase;
}

.adminBulkForm {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.adminBulkForm__count {
    margin: 0;
    font-size: 14px;
}

.adminBulkForm__row {
    width: 100%;
}

.adminBulkBlock__label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: #334155;
}

.adminBulkBlock__tiles {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, minmax(40px, auto));
    grid-auto-columns: minmax(120px, 1fr);
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.adminBulkBlock__tiles .filterTile {
    min-height: 40px;
    width: 100%;
}

.adminBulkBlock__hint {
    margin: 8px 0 0;
    font-size: 12px;
}

.adminBulkBlock__hint.err {
    color: #b91c1c;
    font-weight: 600;
}

.adminBulkForm__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
}

.adminBulkForm__actions .btn2,
.adminBulkForm__submit {
    min-height: 40px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

.adminBulkForm__submit {
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
}

.adminBulkForm__submit:hover {
    filter: brightness(1.05);
}

.adminEmployeeBrowse {
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #e2e8f0;
}

.adminEmployeeBrowse select {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 720px) {
    .adminTab--summary {
        margin-left: 0;
        flex: 1 1 100%;
        text-align: center;
        align-items: center;
    }

    .employeeGrid {
        grid-template-columns: 1fr;
    }
}
