/* css/style.css - Pełne style aplikacji LPR Part-145 */

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #f0f2f5; 
    margin: 0; 
    padding: 0; 
    color: #333; 
}

/* ================= EKRAN LOGOWANIA ================= */
#ekranLogowania { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #002b5e; 
    /* To centruje w pionie i poziomie: */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 2000; 
}

.okno-logowania { 
    background: white; 
    padding: 40px; 
    border-radius: 8px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    width: 320px; 
    text-align: center; 
}

.okno-logowania h2 { color: #002b5e; margin-top: 0; margin-bottom: 20px; font-size: 22px; }

.okno-logowania input { 
    width: 100%; 
    padding: 12px; 
    margin-bottom: 15px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 15px; 
}

.btn-login { 
    background-color: #ffcc00; 
    color: #000; 
    padding: 12px; 
    width: 100%; 
    border: none; 
    font-weight: bold; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 16px; 
    transition: background-color 0.2s;
}

.btn-login:hover { background-color: #e6b800; }
.blad-logowania { color: red; font-size: 13px; margin-bottom: 15px; display: none; font-weight: bold; }

/* ================= NAWIGACJA GŁÓWNA I PRZYCISKI ================= */
.top-navbar { 
    background-color: #002b5e; 
    color: white; 
    padding: 15px 30px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border-bottom: 4px solid #ffcc00; 
}

.top-navbar h1 { margin: 0; font-size: 20px; font-weight: 600; }

/* Ujednolicenie przycisków w panelu użytkownika (górne menu) */
.panel-uzytkownika {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 14px;
}

.panel-uzytkownika .btn-admin, .panel-uzytkownika .btn-logout {
    width: 185px !important;
    height: 38px !important;
    padding: 0 5px !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 !important;
}

/* Ujednolicenie przycisków akcji nad główną tabelą */
.przyciski-akcji-tabela {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.przyciski-akcji-tabela button {
    width: 220px !important;
    height: 40px !important;
    padding: 0 5px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    box-sizing: border-box !important;
    text-align: center;
    margin: 0 !important;
}

/* ================= GŁÓWNY KONTENER ================= */
.container { 
    max-width: 1300px; 
    margin: 30px auto; 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
}

.naglowek-sekcji { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; }
.wyszukiwarka { 
    border: 2px solid #002b5e; 
    padding: 12px; 
    font-size: 15px; 
    width: 100%; 
    border-radius: 6px; 
    background-color: #f4f6f9; 
    box-sizing: border-box; 
    margin-bottom: 15px; 
}

/* ================= POZOSTAŁE PRZYCISKI ================= */
button { 
    padding: 10px 15px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
    transition: transform 0.1s, background-color 0.2s; 
}

button:active { transform: scale(0.98); }

.btn-add { background-color: #28a745; color: white; border-bottom: 2px solid #1e7e34; }
.btn-add:hover { background-color: #218838; }

.btn-cancel { background-color: #6c757d; color: white; }
.btn-cancel:hover { background-color: #5a6268; }

.btn-refresh { background-color: #17a2b8; color: white; }
.btn-refresh:hover { background-color: #138496; }

.btn-export { background-color: #0288d1; color: white; }
.btn-export:hover { background-color: #0277bd; }

.btn-logout { background-color: #dc3545; color: white; padding: 6px 12px; }
.btn-logout:hover { background-color: #c82333; }

.btn-admin { background-color: #6c757d; color: white; padding: 6px 12px; border: 1px solid #5a6268; }
.btn-admin:hover { filter: brightness(0.9); }

/* Przyciski wewnątrz tabeli (małe) */
.btn-podglad { background-color: #002b5e; color: white; padding: 6px 10px; font-size: 13px; }
.btn-podglad:hover { background-color: #001a38; }

.btn-edit { background-color: #ffcc00; color: black; padding: 6px 10px; font-size: 13px; }
.btn-edit:hover { background-color: #e6b800; }

.btn-delete { background-color: #dc3545; color: white; padding: 6px 10px; font-size: 13px; }
.btn-delete:hover { background-color: #c82333; }


/* ================= TABELE ================= */
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; background: white; }
th, td { border: 1px solid #e0e0e0; padding: 12px 10px; text-align: left; }
th { background-color: #002b5e; color: white; font-weight: 500; }
th.sortable { cursor: pointer; transition: background 0.2s; }
th.sortable:hover { background-color: #004080; }
tr:nth-child(even) { background-color: #f8f9fa; }
tr:hover { background-color: #e9ecef; }
.wiersz-edytowany { background-color: #fff8e1 !important; border-left: 4px solid #ffcc00; }
#licznikWpisow { margin-top: 15px; font-weight: 600; text-align: right; color: #555; font-size: 14px; }


/* ================= MODALE (WYSKAKUJĄCE OKNA) ================= */
.modal-overlay { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); 
    display: none; 
    justify-content: center; 
    align-items: center; 
    z-index: 1500; 
}

.okno-modalne { 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    max-height: 90vh; 
    overflow-y: auto; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); 
}

.okno-modalne h2 { 
    margin-top: 0; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: #002b5e;
}

/* ================= FORMULARZE W MODALACH ================= */
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-col { display: flex; flex-direction: column; gap: 10px; }
.form-col label { font-size: 12px; font-weight: bold; color: #555; margin-bottom: -5px; margin-top: 5px; }
.form-col input, .form-col select { 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 14px; 
}
.form-col input:focus, .form-col select:focus {
    border-color: #002b5e;
    outline: none;
}

/* ================= PODGLĄD DOKUMENTU ================= */
.tabela-podglad { width: 100%; border-collapse: collapse; }
.tabela-podglad td { padding: 8px; border-bottom: 1px solid #eee; font-size: 14px; }
.tabela-podglad td:first-child { color: #555; width: 35%; }

/* ================= ZNACZNIKI I STATUSY ================= */
.znacznik-audytu { 
    display: inline-block; 
    background-color: #ffebee; 
    color: #c62828; 
    font-size: 10px; 
    padding: 2px 6px; 
    border-radius: 3px; 
    border: 1px solid #ffcdd2; 
    margin-top: 4px; 
    font-weight: bold; 
    cursor: help; 
}

.status-odblokowano {
    display: inline-block;
    white-space: nowrap;
    background-color: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #81c784;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Animacja dla przycisku wniosków */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background-color: #e65100; color: white;}
    100% { transform: scale(1); }
}