﻿/* ==========================================================================
   ZMIENNE I KONFIGURACJA
   ========================================================================== */
:root {
    --ug-blue: #002e77;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 55px;
    --bg-light: #f4f7fa;
    --transition-speed: 0.3s;
    --card-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* ==========================================================================
   PODSTAWOWE STYLE
   ========================================================================== */
body {
    /* Gradient od delikatnej szarości do bieli, zablokowany przy przewijaniu */
    background: linear-gradient(180deg, #e9ecef 0%, #ffffff 100%) no-repeat fixed !important;
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR (PANEL BOCZNY)
   ========================================================================== */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--ug-blue);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    transition: width var(--transition-speed) ease-in-out;
    z-index: 1050;
    overflow-x: hidden;
    /* Mocny cień oddzielający menu od treści */
    box-shadow: 12px 0 25px rgba(0, 0, 0, 0.35);
}

    #sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

.sidebar-header {
    padding: 25px 20px;
    background-color: rgba(0,0,0,0.15);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sidebar-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
    transition: opacity 0.2s;
    display: block;
}

#sidebar.collapsed .sidebar-logo {
    opacity: 0;
    pointer-events: none;
}

.header-text h6 {
    font-weight: 700;
    font-size: 0.85rem;
    margin: 0;
    white-space: nowrap;
}

.academic-year {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

/* Przycisk Hamburger w Sidebarze */
.toggle-btn-container {
    position: absolute;
    right: 12px;
    bottom: 20px;
}

#sidebar.collapsed .toggle-btn-container {
    top: 25px;
    bottom: auto;
    right: 0;
    left: 0;
    text-align: center;
}

.toggle-btn-sidebar {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

    .toggle-btn-sidebar:hover {
        background: rgba(255,255,255,0.2);
    }

/* Nawigacja w Sidebarze */
.nav-list {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.nav-link {
    color: rgba(255,255,255,0.7);
    padding: 10px 25px;
    display: flex;
    align-items: center;
    text-decoration: none !important;
    transition: 0.2s;
    border-left: 4px solid transparent;
}

    .nav-link:hover {
        background-color: rgba(255,255,255,0.05);
        color: white;
    }

    .nav-link.active {
        background-color: rgba(255,255,255,0.12);
        color: white;
        border-left-color: #00aaff;
    }

    .nav-link i {
        font-size: 1.2rem;
        margin-right: 15px;
        width: 20px;
        text-align: center;
    }

#sidebar.collapsed .nav-link span,
#sidebar.collapsed .header-text,
#sidebar.collapsed .nav-section-label {
    display: none !important;
}

.nav-section-label {
    padding: 18px 25px 10px 25px;
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.4;
    letter-spacing: 1px;
}
/* Styl dla elementów podmenu */
.nav-submenu-item {
    padding-left: 3.5rem !important; /* Większe wcięcie niż standardowe 1.5rem-2rem */
    font-size: 0.85rem !important; /* Nieco mniejsza czcionka */
    opacity: 0.85; /* Subtelne wygaszenie */
    border-left: 2px solid rgba(255,255,255,0.1); /* Opcjonalna linia pomocnicza */
    margin-top: -2px; /* Zacieśnienie odstępu pionowego */
}

    .nav-submenu-item:hover {
        opacity: 1;
    }

    .nav-submenu-item i {
        font-size: 1rem !important; /* Mniejsze ikony w podmenu */
    }

/* ==========================================================================
   TOPBAR (GÓRNA BELKA)
   ========================================================================== */
.topbar {
    height: var(--topbar-height);
    background-color: #121d2d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1040;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: left var(--transition-speed) ease-in-out;
}

#sidebar.collapsed ~ .topbar {
    left: var(--sidebar-collapsed-width);
}

.pensum-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.version-text {
    font-size: 0.75rem;
    opacity: 0.7;
    white-space: nowrap;
}

/* Selektor Roku Akademickiego */
.year-selector-container {
    font-size: 1.1rem;
    font-weight: 600;
}

.year-dropdown {
    background-color: #ffc107;
    color: #121d2d;
    border: 2px solid #e6a700;
    border-radius: 8px;
    padding: 5px 15px;
    font-size: 1.2rem;
    font-weight: 800;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

    .year-dropdown:hover {
        background-color: #ffca2c;
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
    }

    .year-dropdown option {
        color: #333;
        font-size: 1rem;
        padding: 10px;
    }

/* Styl bazowy dla odznak */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 10px;
    text-transform: uppercase;
    color: white !important;
}

/* Kolor zielony dla produkcji */
.status-prod-green {
    background-color: #28a745 !important; /* Success green */
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

/* Kolor czerwony dla testu */
.status-test-red {
    background-color: #dc3545 !important; /* Danger red */
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
}

/* Profil i Ikony */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-icon-btn {
    color: rgba(255,255,255,0.6);
    font-size: 1.3rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: 0.2s;
}

    .topbar-icon-btn:hover {
        color: white;
        background-color: rgba(255,255,255,0.1);
    }

/* ==========================================================================
   DROPDOWNS & POPUPS
   ========================================================================== */
.dropdown-profile .dropdown-menu {
    list-style: none !important;
    margin: 15px 0 0 0 !important;
    padding: 10px 0 !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: var(--card-shadow) !important;
    min-width: 260px !important;
    background-color: #ffffff !important;
    z-index: 1100;
}

.dropdown-profile .dropdown-item {
    padding: 12px 24px !important;
    color: #4b5563 !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    text-decoration: none !important;
    transition: background 0.2s;
}

    .dropdown-profile .dropdown-item:hover {
        background-color: #f3f4f6 !important;
        color: var(--ug-blue) !important;
    }

.lang-badge {
    background-color: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   PASKA KOMUNIKATÓW
   ========================================================================== */
.system-message-bar {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    transition: margin-left var(--transition-speed) ease-in-out;
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height); /* Przesunięcie o wysokość fixed topbar */
    /*padding: 10px 40px 10px 40px;*/ /* Zmniejszono dolny padding paska */
    padding: 10px 15px; /* Dopasowano do paddingu main-wrapper */
    display: flex;
    align-items: center;
}

#sidebar.collapsed ~ .system-message-bar {
    margin-left: var(--sidebar-collapsed-width);
}
.alert-custom-red {
    background-color: #f8d7da;
    color: #dc3545;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    padding: 8px 20px;
    width: 100%;
    align-items: center;
    font-weight: 600;
    gap: 10px;
}


    /* ==========================================================================
   OBSZAR TREŚCI (MAIN WRAPPER)
   ========================================================================== */
#main-wrapper {
    margin-left: var(--sidebar-width);
    /* Zbalansowany padding dla głównego obszaru */
    padding: 20px 15px;
    transition: margin-left var(--transition-speed) ease-in-out;
    background: transparent !important;
    display: block;
    width: auto;
}

    #main-wrapper.expanded {
        margin-left: var(--sidebar-collapsed-width);
    }
    /* ==========================================================================
   KOMPONENTY DASHBOARDU
   ========================================================================== */
    .custom-fieldset {
        border: 2px solid #ced4da;
        border-radius: 12px;
        padding: 25px;
        position: relative;
        margin-top: 50px; /* Zwiększono margines górny, aby ramka była niżej */
        background-color: rgba(255, 255, 255, 0.6);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }

        .custom-fieldset:hover {
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
            border-color: var(--ug-blue);
        }

    .custom-legend {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: #f1f3f5; /* Dopasowane do góry gradientu body */
        padding: 0 15px;
        font-size: 0.9rem;
        font-weight: 800;
        color: #495057;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        white-space: nowrap;
    }

    .state-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

        .state-item:last-child {
            border-bottom: none;
        }

    .state-label {
        font-weight: 500;
        color: #666;
    }

    .state-value {
        font-weight: 700;
        color: var(--ug-blue);
    }
.container-fluid {
    width: 100% !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
    margin-right: auto;
    margin-left: auto;
}
/* Standardowy kontener Bootstrapa zachowujący wyśrodkowaną, ograniczoną szerokość */
.container {
    max-width: 1320px; /* Standard dla extra large screens */
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
}

/* Wymuszenie rozciągnięcia kart i tabel */
.card-custom {
    width: 100% !important;
    max-width: none !important;
}

/* Styl dla głównej tabeli - wymuszamy 100% szerokości */
#tblPracownicy {
    width: 100% !important;
    margin-bottom: 2rem;
}

/* Tabela pomocnicza w filtrach - nie wymuszamy szerokości, pozwoli to jej być "jak poprzednio" */
#tblPracownicyUpr {
    width: auto;
    min-width: 100%;
}

/* ==========================================================================
   STYLIZACJA TABELI WNIOSKÓW
   ========================================================================== */
#tblWnioski .main-row {
    transition: background-color 0.2s;
    cursor: pointer;
}

    #tblWnioski .main-row:hover {
        background-color: rgba(0, 46, 119, 0.02);
    }

/* Przyciski statusu (Badge jako przycisk) */
.btn-status-toggle {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    outline: none;
}

.badge-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}

    .badge-status.in-progress {
        background-color: #e7f1ff;
        color: #0d6efd;
        border: 1px solid #cfe2ff;
    }

    .badge-status.draft {
        background-color: #f8f9fa;
        color: #6c757d;
        border: 1px solid #dee2e6;
    }

    /* NOWE STATUSY */
    .badge-status.accepted {
        background-color: #d1e7dd;
        color: #0f5132;
        border: 1px solid #badbcc;
    }

    .badge-status.rejected {
        background-color: #f8d7da;
        color: #842029;
        border: 1px solid #f5c2c7;
    }

    .badge-status:hover {
        filter: brightness(0.95);
        transform: translateY(-1px);
    }

/* Grupa akcji */
.btn-group-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    color: #555;
    transition: all 0.2s;
}

    .btn-icon:hover:not(:disabled) {
        background-color: var(--ug-blue);
        color: white;
        border-color: var(--ug-blue);
    }

    .btn-icon:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Styl rozwiniętego wiersza */
.details-row {
    background-color: #fcfdfe;
}

.details-content {
    animation: slideDown 0.3s ease-out;
    border-left: 4px solid var(--ug-blue);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert wewnątrz detali */
.alert-white {
    background-color: white;
    border-radius: 10px;
    color: #444;
}

/* ==========================================================================
   SCHEMAT AKCEPTACJI (STEPPER)
   ========================================================================== */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    margin-bottom: 20px;
    position: relative;
    isolation: isolate;
}

.stepper-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}


    .stepper-item::before {
        position: absolute;
        content: "";
        border-bottom: 3px solid #dee2e6;
        width: 100%;
        top: 22.5px;
        left: -50%;
        z-index: 1;
    }

    .stepper-item:first-child::before {
        content: none;
    }
/* Styl dla dat i nazwisk pod ikonami */
.step-date, .step-info {
    margin-top: 5px;
    font-size: 0.7rem;
    line-height: 1.2;
    color: #6c757d;
    min-height: 30px; /* Zmieniono z height na min-height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Poprawka linii łączącej dla wyśrodkowanego układu */
.stepper-item::before {
    left: -50%;
    width: 100%;
}

.step-counter {
    position: relative;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff !important;
    border: 3px solid #dee2e6;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    color: #adb5bd;
    z-index: 3;
}

.step-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #495057;
    text-align: center;
}

.step-details {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    margin-top: 4px;
}

.stepper-item.completed .step-counter {
    background-color: #198754 !important;
    border-color: #198754;
    color: #fff;
}

.stepper-item.completed::before {
    border-color: #198754;
}

.stepper-item.active .step-counter {
    border-color: var(--ug-blue);
    background-color: #ffffff !important;
    color: var(--ug-blue);
    box-shadow: 0 0 0 5px rgba(0, 46, 119, 0.1);
    transform: scale(1.1);
}

.stepper-item.active .step-name {
    color: var(--ug-blue);
}

.stepper-item.active .step-counter::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--ug-blue);
    animation: stepper-pulse 2s infinite;
    z-index: 2;
}
/* Styl dla odrzuconego kroku w stepperze */
.stepper-item.rejected .step-counter {
    background-color: #842029 !important; /* Kolor z przycisku ODRZUCONY */
    border-color: #842029 !important;
    color: white !important;
    opacity: 1;
}

/* Wyłączenie animacji pulse dla elementów, które nie powinny migać */
.stepper-item.no-pulse .step-counter::after {
    display: none !important;
    animation: none !important;
}

/* Styl dla ikony X wewnątrz kółka */
.stepper-item.rejected .step-counter::before {
    content: "\F62A"; /* Kod ikony bi-x-lg z Bootstrap Icons */
    font-family: "bootstrap-icons";
    font-size: 1.5rem;
}

@keyframes stepper-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}
/* ==========================================================================
   STYLE DLA OKIEN MODALNYCH (POPUP)
   ========================================================================== */

/* Specjalna klasa dla bardzo szerokich okien (np. Nowy Wniosek) */
@media (min-width: 992px) {
    .modal-wide-custom {
        max-width: 65% !important;
    }
}

/* Standardowe poprawki estetyczne dla wszystkich modeli */
.modal-header.bg-navy {
    background-color: #121d2d !important;
    border-bottom: 0;
}

.modal-content {
    border-radius: 12px;
    overflow: hidden;
    border: 0;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
}

.modal-body {
    padding: 1.5rem !important;
}

    .modal-body label {
        margin-bottom: 5px;
        font-weight: 500;
    }

    .modal-body .form-control:focus,
    .modal-body .form-select:focus {
        border-color: var(--ug-blue);
        box-shadow: 0 0 0 0.25rem rgba(0, 46, 119, 0.1);
    }

.modal-footer {
    padding: 1.2rem 1.5rem;
    background-color: #f8f9fa;
}
/* Ukrywamy domyślną kropkę radio */
.custom-radio-card .form-check-input {
    display: none;
}

/* Kontener karty */
.custom-radio-card {
    border: 2px solid #dee2e6;
    transition: all 0.2s ease;
}

    /* Zmiana ramki karty, gdy input w środku jest zaznaczony */
    .custom-radio-card:has(input:checked) {
        border-color: #198754;
        background-color: #f8fff9;
    }

/* Bazowy styl kwadratu na "ptaszka" */
.custom-checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Zapobiega zgniataniu ikony przy długim tekście */
    background-color: white;
    transition: all 0.2s;
}

/* Styl po zaznaczeniu */
input:checked + .custom-checkmark {
    background-color: #198754;
    border-color: #198754;
}

    /* Dodanie białego ptaszka (Unicode) po zaznaczeniu */
    input:checked + .custom-checkmark::after {
        content: "✓";
        color: white;
        font-weight: bold;
        font-size: 16px;
    }

/* Hover efekt dla całej karty */
.custom-radio-card:hover {
    border-color: #adb5bd;
}