:root {
    --bg-color: #f4f6f9;
    --primary: #0056b3;
    --primary-hover: #004085;
    --dark: #2d3748;
    --text: #333;
    --card-bg: #ffffff;
    --border-color: #edf2f7;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: Arial, sans-serif; 
    background: var(--bg-color); 
    color: var(--text); 
    height: 100vh; 
    overflow: hidden; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

/* OKNO LOGOWANIA */
.login-box { 
    background: var(--card-bg); 
    padding: 35px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    width: 100%; 
    max-width: 380px; 
    text-align: center; 
}
.form-group { 
    margin-bottom: 15px; 
    text-align: left; 
}
.form-group label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
    font-size: 0.9rem; 
}
.form-group input { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
}
.btn { 
    display: inline-block; 
    width: 100%; 
    padding: 11px; 
    background: var(--primary); 
    color: white; 
    border: none; 
    border-radius: 4px; 
    font-size: 1rem; 
    cursor: pointer; 
    text-decoration: none; 
    text-align: center; 
    font-weight: bold; 
}
.btn:hover { 
    background: var(--primary-hover); 
}
.error-box { 
    color: #b82119; 
    background: #fcebea; 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 15px; 
    font-size: 0.9rem; 
    font-weight: bold; 
}

/* UKŁAD JEDNOEKRANOWY */
.container { 
    width: 100%; 
    max-width: 1200px; 
    height: 90vh; 
    max-height: 900px; 
    display: flex; 
    flex-direction: column; 
    background: var(--card-bg); 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
    padding: 25px; 
    overflow: hidden; 
}

/* NAGŁÓWEK SYSTEMOWY */
header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    border-bottom: 2px solid var(--border-color); 
    padding-bottom: 15px; 
    margin-bottom: 20px; 
    position: relative; 
}
.header-left { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}
header img { 
    max-height: 65px; 
    display: block; 
}
.header-title { 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: var(--dark); 
}

.header-right { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    gap: 8px; 
}
.logout-panel { 
    font-size: 0.85rem; 
    color: #718096; 
}
.logout-panel a { 
    color: #e53e3e; 
    text-decoration: none; 
    font-weight: bold; 
}
.btn-admin { 
    background: #4a5568; 
    color: white; 
    padding: 6px 14px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 0.85rem; 
    font-weight: bold; 
    transition: background 0.2s; 
}
.btn-admin:hover { 
    background: #2d3748; 
}

/* PRZYCISKI NAWIGACJI PODSTRON */
.nav-buttons { 
    display: flex; 
    gap: 10px; 
}
.btn-nav { 
    background: #718096; 
    color: white; 
    padding: 8px 15px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: bold; 
}
.btn-nav:hover { 
    background: #4a5568; 
}
.btn-home { 
    background: var(--primary); 
}
.btn-home:hover { 
    background: var(--primary-hover); 
}

/* OBSZARY ROBOCZE */
.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    gap: 30px; 
}
.welcome-msg { 
    text-align: center; 
    font-size: 1.8rem; 
    color: var(--dark); 
    margin-bottom: 10px; 
}
.sub-content { 
    flex: 1; 
    overflow-y: auto; 
    padding-right: 5px; 
}

/* SIATKA KAFELKÓW NA PULPICIE */
.dashboard-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 20px; 
    width: 100%; 
    max-width: 900px; 
}
.nav-card { 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    padding: 25px; 
    text-align: center; 
    transition: all 0.2s; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    align-items: center; 
    gap: 15px; 
}
.nav-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.05); 
    border-color: var(--primary); 
}
.nav-card h3 { font-size: 1.2rem; color: var(--dark); }
.nav-card p { font-size: 0.85rem; color: #718096; line-height: 1.4; }
.nav-card .btn { width: auto; min-width: 140px; padding: 8px 16px; font-size: 0.9rem; }

/* KARTY I TABELE MODUŁÓW */
.card { 
    background: #fff; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}
.card h2 { font-size: 1.2rem; margin-bottom: 10px; color: var(--dark); }
.meta { font-size: 0.85rem; color: #a0aec0; margin-bottom: 15px; }

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 10px; 
    font-size: 0.95rem; 
}
th, td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #e2e8f0; 
}
th { 
    background: #f8fafc; 
    font-weight: bold; 
    color: var(--dark); 
}
tr:hover { background: #f8fafc; }

.path-box { 
    background: #2d3748; 
    color: #63f287; 
    font-family: monospace; 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 15px; 
    font-size: 0.9rem; 
}
.btn-download { 
    background: #2b6cb0; 
    color: white; 
    padding: 4px 10px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 0.85rem; 
}
.btn-download:hover { background: #2c5282; }

/* MODUŁ UPLOADU I ZARZĄDZANIA ZASOBAMI */
.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: opacity 0.5s ease; /* Płynne wygaszanie alertu */
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.management-zone {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}
.upload-form-box {
    background: #f8fafc;
    border: 2px dashed #cbd5e0;
    padding: 15px;
    border-radius: 6px;
}
.upload-form-box h4 { margin-bottom: 10px; color: var(--dark); }

.flex-inputs {
    display: flex;
    gap: 10px;
}
.flex-inputs input[type="text"], 
.flex-inputs input[type="file"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #fff;
}

.btn-action {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}
.btn-success { background: #2f855a; color: white; }
.btn-success:hover { background: #22543d; }
.btn-danger { background: #e53e3e; color: white; padding: 4px 8px; text-decoration: none; border-radius: 4px; font-size: 0.8rem; }
.btn-danger:hover { background: #9b2c2c; }

/* DYNAMICZNY PASEK POSTĘPU (PROGRESS BAR) */
.progress-container {
    display: none;
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
    position: relative;
    height: 20px;
}
.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #3182ce;
    transition: width 0.1s ease;
}
.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 0;
    left: 0;
    font-size: 0.85rem;
    font-weight: bold;
    color: #2d3748;
    line-height: 20px;
}
/* ==========================================================================
   KLASY DLA SYSTEMOWEJ STOPKI INFORMACYJNEJ (FOOTER)
   ========================================================================== */
body {
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
    flex-direction: column !important;
    padding: 20px 0;
}

.login-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.system-footer {
    width: 100%;
    text-align: center;
    padding: 15px 0;
    font-size: 0.85rem;
    color: #718096;
    font-family: Arial, sans-serif;
}

.system-footer-link {
    color: #4a5568;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.system-footer-link:hover {
    color: #0056b3;
    text-decoration: underline;
}
/* ==========================================================================
   MODYFIKACJA STOPKI SYSTEMOWEJ (WYŚRODKOWANA, POGRUBIONA, MORSKA)
   ========================================================================== */
body {
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
    flex-direction: column !important;
    padding: 20px 0;
}

.login-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.system-footer {
    width: 100%;
    text-align: center !important; /* Wyśrodkowanie stopki */
    padding: 15px 0;
    font-size: 0.85rem;
    color: #008080 !important; /* Kolor morski/turkusowy */
    font-family: Arial, sans-serif;
    font-weight: bold !important; /* Pogrubienie tekstu stopki */
}

.system-footer-link {
    color: #008080 !important; /* Kolor morski/turkusowy */
    text-decoration: none;
    font-weight: bold !important; /* Pogrubienie odnośnika */
    transition: color 0.2s ease;
}

.system-footer-link:hover {
    color: #20b2aa !important; /* Jaśniejszy odcień morskiego przy najechaniu */
    text-decoration: underline;
}

/* Ujednolicony akcent paska ścieżki sieciowej */
.path-accent-box {
    background: #2d3748; 
    color: #008080; 
    font-family: monospace; 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 15px; 
    font-size: 0.95rem; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); 
    text-align: center; 
    font-weight: bold;
}
/* ==========================================================================
   POPRAWKA STRUKTURY I PRZEWIJANIA (USUNIĘCIE BLOKAD WYSOKOŚCI)
   ========================================================================== */
html, body {
    height: auto !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto !important; /* Włączenie globalnego przewijania pionowego */
}

.container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
    box-sizing: border-box;
}

.main-content {
    flex: 1; /* Pozwala treści rozpychać stronę i spychać stopkę na dół */
    height: auto !important;
    overflow: visible !important; /* Usunięcie blokady obcinania tabeli */
    padding-bottom: 30px;
}

/* ==========================================================================
   MODYFIKACJA STOPKI SYSTEMOWEJ (WYŚRODKOWANA, POGRUBIONA, MORSKA)
   ========================================================================== */
.system-footer {
    width: 100%;
    text-align: center !important;
    padding: 20px 0;
    margin-top: auto; /* Gwarantuje, że stopka zawsze będzie na samym dole strony */
    font-size: 0.85rem;
    color: #008080 !important;
    font-family: Arial, sans-serif;
    font-weight: bold !important;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.system-footer-link {
    color: #008080 !important;
    text-decoration: none;
    font-weight: bold !important;
    transition: color 0.2s ease;
}

.system-footer-link:hover {
    color: #20b2aa !important;
    text-decoration: underline;
}

/* Ujednolicony akcent paska ścieżki sieciowej */
.path-accent-box {
    background: #2d3748; 
    color: #008080; 
    font-family: monospace; 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 15px; 
    font-size: 0.95rem; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); 
    text-align: center; 
    font-weight: bold;
}
/* ==========================================================================
   STRUKTURA STRONY I ELIMINACJA BLOKAD PRZEWIJANIA
   ========================================================================== */
html, body {
    height: auto !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto !important; /* Wymuszenie globalnego przewijania pionowego */
}

.container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
    box-sizing: border-box;
}

.main-content {
    flex: 1; /* Rozpycha stronę w pionie i spycha stopkę na sam dół */
    height: auto !important;
    overflow: visible !important; /* Gwarancja, że tabela nie zostanie obcięta */
    padding-bottom: 40px;
}

/* ==========================================================================
   MODYFIKACJA STOPKI SYSTEMOWEJ (WYŚRODKOWANA, POGRUBIONA, MORSKA)
   ========================================================================== */
.system-footer {
    width: 100%;
    text-align: center !important;
    padding: 20px 0;
    margin-top: auto; /* Kluczowe: wymusza pozycję na samym dole kontenera */
    font-size: 0.85rem;
    color: #008080 !important; /* Kolor morski */
    font-family: Arial, sans-serif;
    font-weight: bold !important; /* Pogrubienie tekstu */
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.system-footer-link {
    color: #008080 !important;
    text-decoration: none;
    font-weight: bold !important;
    transition: color 0.2s ease;
}

.system-footer-link:hover {
    color: #20b2aa !important;
    text-decoration: underline;
}

/* Ujednolicony akcent paska ścieżki sieciowej */
.path-accent-box {
    background: #2d3748; 
    color: #008080; 
    font-family: monospace; 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 15px; 
    font-size: 0.95rem; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); 
    text-align: center; 
    font-weight: bold;
}