/*
 * Kolor przewodni systemu = niebieski z logo DSNET (#009ee1) zamiast domyślnego niebieskiego Bootstrapa.
 * Tła i akcenty mają dokładnie kolor logo; linki i tekst – ciemniejszy odcień (czytelny na białym, kontrast ≥ 4,5:1).
 */
:root,
[data-bs-theme="light"] {
    --bs-primary: #009ee1;
    --bs-primary-rgb: 0, 158, 225;
    --bs-primary-text-emphasis: #00405c;
    --bs-primary-bg-subtle: #cceffc;
    --bs-primary-border-subtle: #99dff8;
    --bs-link-color: #007bb0;
    --bs-link-color-rgb: 0, 123, 176;
    --bs-link-hover-color: #006b99;
    --bs-link-hover-color-rgb: 0, 107, 153;
    --bs-focus-ring-color: rgba(0, 158, 225, .25);
}

[data-bs-theme="dark"] {
    --bs-primary: #009ee1;
    --bs-primary-rgb: 0, 158, 225;
    --bs-link-color: #4cc3f2;
    --bs-link-color-rgb: 76, 195, 242;
    --bs-link-hover-color: #7ad2f5;
    --bs-link-hover-color-rgb: 122, 210, 245;
}

.btn-primary {
    --bs-btn-bg: #009ee1;
    --bs-btn-border-color: #009ee1;
    --bs-btn-hover-bg: #0088c0;
    --bs-btn-hover-border-color: #0082b7;
    --bs-btn-active-bg: #007bb0;
    --bs-btn-active-border-color: #0075a6;
    --bs-btn-disabled-bg: #009ee1;
    --bs-btn-disabled-border-color: #009ee1;
    --bs-btn-focus-shadow-rgb: 0, 158, 225;
}

.btn-outline-primary {
    --bs-btn-color: #007bb0;
    --bs-btn-border-color: #009ee1;
    --bs-btn-hover-bg: #009ee1;
    --bs-btn-hover-border-color: #009ee1;
    --bs-btn-active-bg: #007bb0;
    --bs-btn-active-border-color: #007bb0;
    --bs-btn-disabled-color: #009ee1;
    --bs-btn-disabled-border-color: #009ee1;
    --bs-btn-focus-shadow-rgb: 0, 158, 225;
}

.form-control:focus,
.form-select:focus {
    border-color: #80cff0;
    box-shadow: 0 0 0 .25rem rgba(0, 158, 225, .25);
}

.form-check-input:checked,
.form-check-input[type="checkbox"]:indeterminate {
    background-color: #009ee1;
    border-color: #009ee1;
}

.form-check-input:focus {
    border-color: #80cff0;
    box-shadow: 0 0 0 .25rem rgba(0, 158, 225, .25);
}
.project-choice { border-width: 2px; border-color: transparent; padding: .4rem .75rem; }
.btn-check:not(:checked) + .project-choice { opacity: .8; }
.btn-check:checked + .project-choice { opacity: 1; font-weight: 600; border-color: currentColor; box-shadow: 0 0 0 .15rem rgba(0,0,0,.08); }
.btn-check:checked + .project-choice::before { content: "\2713\00a0"; }
.btn-check:focus-visible + .project-choice { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.project-more.is-selected { border-color: var(--bs-primary); font-weight: 600; }

/* Kolory etykiet projektów (ProjectColorExtension::HUES) */
.project-hue-210 { --h: 210; background-color: hsl(210, 70%, 90%); color: hsl(210, 55%, 26%); border: 1px solid hsl(210, 50%, 78%); }
.project-hue-25 { --h: 25; background-color: hsl(25, 70%, 90%); color: hsl(25, 55%, 26%); border: 1px solid hsl(25, 50%, 78%); }
.project-hue-150 { --h: 150; background-color: hsl(150, 70%, 90%); color: hsl(150, 55%, 26%); border: 1px solid hsl(150, 50%, 78%); }
.project-hue-280 { --h: 280; background-color: hsl(280, 70%, 90%); color: hsl(280, 55%, 26%); border: 1px solid hsl(280, 50%, 78%); }
.project-hue-0 { --h: 0; background-color: hsl(0, 70%, 90%); color: hsl(0, 55%, 26%); border: 1px solid hsl(0, 50%, 78%); }
.project-hue-175 { --h: 175; background-color: hsl(175, 70%, 90%); color: hsl(175, 55%, 26%); border: 1px solid hsl(175, 50%, 78%); }
.project-hue-45 { --h: 45; background-color: hsl(45, 70%, 90%); color: hsl(45, 55%, 26%); border: 1px solid hsl(45, 50%, 78%); }
.project-hue-330 { --h: 330; background-color: hsl(330, 70%, 90%); color: hsl(330, 55%, 26%); border: 1px solid hsl(330, 50%, 78%); }
.project-hue-100 { --h: 100; background-color: hsl(100, 70%, 90%); color: hsl(100, 55%, 26%); border: 1px solid hsl(100, 50%, 78%); }
.project-hue-240 { --h: 240; background-color: hsl(240, 70%, 90%); color: hsl(240, 55%, 26%); border: 1px solid hsl(240, 50%, 78%); }

/* Zastępniki dawnych atrybutów style="..." (CSP bez 'unsafe-inline') */
.min-w-0 { min-width: 0; }
.min-w-10 { min-width: 10rem; }
.min-w-12 { min-width: 12rem; }
.min-w-14 { min-width: 14rem; }
.w-7 { width: 7rem; }
.w-9 { width: 9rem; }
.mw-560 { max-width: 560px; }
.mw-720 { max-width: 720px; }
.mw-760 { max-width: 760px; }
.logo-40 { max-height: 40px; }
.logo-48 { max-height: 48px; max-width: 40%; }
.logo-80 { max-height: 80px; }
.progress-sm { height: 6px; }
.progress-md { height: 14px; }
.duration-input { font-size: 2.25rem; }
.duration-summary { min-height: 1.75rem; }

/* Dostępność */
/* Link „Przejdź do treści” (polska wersja skip-linku AdminLTE; ukryty do sfokusowania klawiaturą) */
.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 2000; padding: .6rem 1rem; background: #fff !important; color: #00405c !important; border: 2px solid var(--bs-primary); border-radius: .375rem; font-weight: 600; }
.skip-link:focus { top: .5rem; outline: none; }
/* Wyraźny wskaźnik fokusu dla nawigacji klawiaturą (także w ciemnym menu bocznym) */
a:focus-visible, button:focus-visible, summary:focus-visible, [role="button"]:focus-visible, .btn:focus-visible { outline: 3px solid #005f87; outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
.app-sidebar a:focus-visible { outline-color: #7ad2f5; box-shadow: none; }
/* Docelowy <main> fokusowany programowo po skip-linku nie potrzebuje ramki */
main:focus { outline: none; }
/* Tekst pomocniczy: ciemniejszy szary (#6c757d ma na szarych tłach kontrast < 4,5:1) */
:root, [data-bs-theme="light"] { --bs-secondary-rgb: 87, 95, 102; --bs-secondary-color: #575f66; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Motyw ciemny (włączany przez /js/theme.js według ustawienia systemu) */
[data-bs-theme="dark"] {
    --bs-secondary-rgb: 173, 181, 189;
    --bs-secondary-color: #adb5bd;
    --bs-primary-text-emphasis: #7ad2f5;
    --bs-primary-bg-subtle: #00364d;
    --bs-primary-border-subtle: #005f87;
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #4cc3f2; }
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-check-input:focus { border-color: #009ee1; box-shadow: 0 0 0 .25rem rgba(0, 158, 225, .35); }
[data-bs-theme="dark"] a:focus-visible,
[data-bs-theme="dark"] button:focus-visible,
[data-bs-theme="dark"] summary:focus-visible,
[data-bs-theme="dark"] [role="button"]:focus-visible,
[data-bs-theme="dark"] .btn:focus-visible { outline-color: #7ad2f5; box-shadow: 0 0 0 5px #000; }
[data-bs-theme="dark"] .btn-check:checked + .project-choice { box-shadow: 0 0 0 .15rem rgba(255, 255, 255, .15); }
/* Etykiety projektów: ciemne tło, jasny tekst */
[data-bs-theme="dark"] [class*="project-hue-"] { background-color: hsl(var(--h), 35%, 20%); color: hsl(var(--h), 70%, 85%); border-color: hsl(var(--h), 30%, 34%); }
/* Klasy „light” Bootstrapa są na sztywno jasne – w ciemnym motywie zastępujemy je kolorami z palety motywu */
[data-bs-theme="dark"] .table-light { --bs-table-bg: var(--bs-tertiary-bg); --bs-table-color: var(--bs-body-color); --bs-table-border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .text-bg-light { background-color: var(--bs-tertiary-bg) !important; color: var(--bs-body-color) !important; }
[data-bs-theme="dark"] .skip-link { background: #212529 !important; color: #7ad2f5 !important; }
