/* --- 1. IMPORT CZCIONEK PREMIUM --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-deep: #050507;
    --glass-panel: rgba(20, 20, 23, 0.6);
    --glass-nav: rgba(5, 5, 7, 0.7); /* Ciemniejsze szkło dla nawigacji */
    --glass-border: rgba(255, 255, 255, 0.08);
    
    /* Neonowa paleta "Cyber-SaaS" */
    --primary: #6366f1;       /* Indigo */
    --primary-light: #818cf8;
    --accent: #ec4899;        /* Pink Glow */
    --success: #10b981;       /* Emerald */
    --warning: #f59e0b;       /* Amber */
    --danger: #ef4444;        /* Red */
    
    --text-main: #ffffff;
    --text-secondary: #94a3b8;
    
    --shadow-glow: 0 0 80px -20px rgba(99, 102, 241, 0.25);
}

/* --- 2. TŁO I STRUKTURA --- */
body {
    background-color: #030305;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 60px;
    overflow-x: hidden;
    position: relative;
}

/* Animowane tło (Aurora) */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.05) 0%, transparent 60%);
    z-index: -2;
    filter: blur(80px); 
    animation: auroraMove 15s ease-in-out infinite alternate;
}

/* --- 3. NAWIGACJA (NOWY STYL - GLASS) --- */
.nav-bar {
    width: 92%;
    max-width: 1200px;
    margin: 30px auto 0 auto; /* Wyśrodkowanie i odstęp od góry */
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    background: var(--glass-panel); /* Tło jak w głównym oknie */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5); /* Cień pod menu */
    
    padding: 12px 20px;
    border-radius: 20px; /* Mocno zaokrąglone rogi */
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
}

.nav-links {
    display: flex;
    gap: 8px; /* Mniejszy odstęp, bo to kapsuła */
    background: rgba(0,0,0,0.2);
    padding: 5px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.03);
}

.nav-btn {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 24px;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Aktywny przycisk lub hover - NEONOWY GLOW */
.nav-btn:hover, .nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px -5px var(--primary);
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* User info i wylogowanie */
.user-panel {
    display: flex;
    align-items: center;
    gap: 15px; /* Odstęp między napisem a przyciskiem */
}

/* Styl dla napisu "User: ..." */
.user-txt {
    font-family: 'Plus Jakarta Sans', sans-serif; /* Ta sama czcionka co reszta strony */
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary); /* Szary kolor etykiety */
    letter-spacing: 0.5px;
}

.user-txt span {
    color: #fff; /* Kolor samej nazwy użytkownika */
    font-weight: 700;
    font-family: 'Outfit', sans-serif; /* Pogrubiona czcionka dla nicku */
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 800;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 8px 18px;
    border-radius: 10px;
    transition: 0.3s;
    background: rgba(239, 68, 68, 0.08);
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-btn:hover { 
    background: var(--danger); 
    color: white; 
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

/* --- 4. TYPOGRAFIA --- */
h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: 0;
}

h1 {
    font-size: 3rem;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #fff 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    left: 50%; bottom: -10px;
    transform: translateX(-50%);
    width: 60px; height: 4px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 20px var(--primary);
}

/* --- 5. GŁÓWNY KONTENER --- */
.container {
    background: var(--glass-panel);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        var(--shadow-glow),
        0 20px 40px rgba(0, 0, 0, 0.4);
    border-radius: 32px;
    padding: 60px;
    width: 92%;
    max-width: 1200px;
    margin-top: 10px; /* Mniejszy margines bo jest nav-bar */
    animation: floatIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
}

/* --- 6. FORMULARZE --- */
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 18px 22px;
    margin: 12px 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

input:focus, textarea:focus, select:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transform: scale(1.01);
}

::placeholder { color: rgba(255, 255, 255, 0.25); }

/* --- 7. PRZYCISKI --- */
.btn {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 100%;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -5px rgba(79, 70, 229, 0.6);
}

.btn-danger { 
    background: linear-gradient(135deg, var(--danger), #b91c1c); 
    width: auto; padding: 10px 24px; font-size: 13px; text-transform: none; letter-spacing: 0;
}
.btn-success { 
    background: linear-gradient(135deg, var(--success), #059669); 
    width: auto; padding: 10px 24px; font-size: 13px; text-transform: none; letter-spacing: 0;
}

/* --- 8. TABELA --- */
table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0 12px; 
    margin-top: 30px; 
}

th { 
    color: var(--text-secondary); 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    padding: 0 24px 10px;
    text-align: left;
    font-weight: 700;
}

th a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}
th a:hover { color: var(--primary-light); text-shadow: 0 0 10px var(--primary); }

tr { transition: 0.3s ease; }
td { 
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 4px; 
    border: 1px solid transparent;
    vertical-align: middle;
    font-weight: 500;
}

tr td:first-child { border-top-left-radius: 16px; border-bottom-left-radius: 16px; }
tr td:last-child { border-top-right-radius: 16px; border-bottom-right-radius: 16px; }

tr:hover td { 
    background: rgba(255, 255, 255, 0.05); 
    border-top-color: rgba(255,255,255,0.1);
    border-bottom-color: rgba(255,255,255,0.1);
    transform: scale(1.01); 
}

/* --- BADGES I AKCJE --- */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 18px;
    margin: 0 6px;
    transition: all 0.3s;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.05);
}

.btn-approve:hover { background: var(--success); color: #fff; transform: scale(1.15); box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4); }
.btn-approve { color: var(--success); }
.btn-reject:hover { background: var(--danger); color: #fff; transform: scale(1.15); box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4); }
.btn-reject { color: var(--danger); }

.badge { padding: 6px 14px; border-radius: 50px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* --- TOASTS --- */
#toast-container {
    position: fixed;
    top: 90px; /* Niżej, żeby nie zasłaniało navbara */
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast {
    min-width: 340px;
    background: rgba(15, 15, 20, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 18px 24px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), fadeOut 0.5s ease 4.5s forwards;
}

.toast::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
    background: currentColor; opacity: 0.5; animation: progress 4.5s linear forwards;
}

.toast.success { color: var(--success); }
.toast.error { color: var(--danger); }
.toast.warning { color: var(--warning); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 5px; border: 2px solid var(--bg-deep); }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Animacje */
@keyframes floatIn { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastSlideIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-20px); pointer-events: none; } }
@keyframes progress { from { width: 100%; } to { width: 0%; } }
@keyframes auroraMove { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.2); opacity: 1; } }
.role-admin { color: #ff4d4d !important; text-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
.role-moderator { color: #00e676 !important; text-shadow: 0 0 10px rgba(0, 230, 118, 0.5); }
.role-user { color: #ffffff !important; }

table.compact {
    border-spacing: 0 6px; /* Mniejszy odstęp między wierszami (było 12px) */
}

table.compact td, table.compact th {
    padding: 10px 15px; /* Mniejsze wypełnienie (było 20px 24px) */
    font-size: 0.85rem; /* Nieco mniejsza czcionka */
}

/* --- PAGINATION CONTROLS --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    user-select: none;
}

.page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.85rem;
    font-weight: bold;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.page-info {
    color: #666;
    font-size: 0.85rem;
    font-family: 'Outfit', sans-serif;
    min-width: 80px;
    text-align: center;
}
.pagination-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Odstęp między strzałkami a tekstem */
}

.page-info {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px; /* Lekko zaokrąglone rogi */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    padding: 0; /* Reset paddingu */
}

/* Hover na strzałki */
.page-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary); /* Neonowy glow */
    transform: translateY(-2px);
}

/* Wyłączone strzałki (np. na 1 stronie) */
.page-btn:disabled {
    opacity: 0.3;
    cursor: default;
    border-color: transparent;
}

/* --- PRZYCISK SEARCH (MNIEJSZY) --- */
.search-btn {
    width: auto !important;      /* Nie rozciągaj na całą szerokość */
    padding: 0 25px !important;  /* Mniejszy padding boczny */
    height: 42px !important;     /* Dopasowanie wysokości do inputa */
    margin: 0 !important;        /* Usuwamy marginesy */
    font-size: 0.85rem !important;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

/* Poprawka dla inputa wyszukiwania, żeby ładnie leżał obok przycisku */
input[name="search"] {
    margin: 0 !important;
    height: 42px !important;
    border-radius: 8px !important; /* Dopasowane rogi */
}

@keyframes fastSlide {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.anim-row {
    opacity: 0; /* Domyślnie ukryte przed startem animacji */
    animation: fastSlide 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}



.tracker-link {
    text-decoration: none;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

.tracker-icon {
    color: rgba(255, 255, 255, 0.2); /* Domyślnie bardzo ciemna/niewidoczna */
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tracker-link:hover .tracker-icon {
    color: #ff4d4d; /* Czerwień Apex */
    transform: scale(1.4) rotate(10deg);
    filter: drop-shadow(0 0 8px #ff4d4d); /* Neonowy glow */
}
.scroll-wrapper {
    max-height: 500px;       /* Wysokość okna */
    overflow-y: auto;        /* Przewijanie */
    padding-right: 5px;
}

/* Nowoczesny pasek przewijania */
.scroll-wrapper::-webkit-scrollbar { width: 8px; }
.scroll-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); border-radius: 4px; }
.scroll-wrapper::-webkit-scrollbar-thumb { background: #00aaff; border-radius: 4px; }
.scroll-wrapper::-webkit-scrollbar-thumb:hover { background: #0088cc; }

/* Przyklejenie nagłówka tabeli przy przewijaniu */
.live-table thead th {
    position: sticky;
    top: 0;
    /* Tło: Ciemne, lekko przezroczyste (efekt szkła) */
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(5px); 
    
    /* Tekst */
    color: #8899a6; /* Lekko szary, nie biały (bardziej elegancki) */
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px; /* Rozstrzelone litery */
    
    /* Odstępy */
    padding: 16px 10px; /* Dużo miejsca góra/dół */
    
    /* Linie */
    border-bottom: 1px solid rgba(0, 170, 255, 0.3); /* Cienka niebieska linia na dole */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); /* Cień rzucany na listę poniżej */
    
    z-index: 10;
    text-align: center; /* Wyrównanie do lewej (z wyjątkiem statusu) */
}

/* Wyrównanie pierwszej kolumny (Status) i kolumny Revealer do środka */
.live-table thead th:first-child,
.live-table thead th:nth-child(6) {
    text-align: center;
}
.live-table tbody tr {
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.03); /* Bardzo delikatna linia oddzielająca */
}

.live-table tbody tr:hover {
    background: rgba(0, 170, 255, 0.05); /* Delikatne niebieskie podświetlenie */
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(20, 20, 25, 0.6); /* Ciemne szkło */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Pasek akcentu z boku */
.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.stat-card.blue::before { background: #00aaff; box-shadow: 0 0 10px #00aaff; }
.stat-card.purple::before { background: #aa00ff; box-shadow: 0 0 10px #aa00ff; }

.stat-title {
    font-size: 0.8rem;
    color: #8899a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.8; /* Zwiększone z 0.1 na 0.8 */
    text-shadow: 0 0 20px rgb(104 159 252);
}
input[type="number"] {
    background: rgba(0,0,0,0.4) !important;
    color: white !important;
    border: 1px solid #444 !important;
    border-radius: 8px;
    padding: 10px;
}

/* PREVIEW STYL */
.live-preview-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.preview-block h4 {
    color: #aaa;
    font-size: 0.8em;
    margin-bottom: 6px;
}

.live-preview {
    background: rgba(0,0,0,0.6);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    color: #00ffaa;
    font-family: monospace;
    font-size: 0.85em;
    min-height: 70px;
    white-space: pre-wrap;
}

/* responsive */
@media (max-width: 900px) {
    .live-preview-wrapper {
        grid-template-columns: 1fr;
    }
}