/* Zmienne globalne i motyw kolorystyczny */
:root {
    --bg-main: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --text-light: #f1f5f9;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: #e2e8f0;
    --radius: 10px;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- EKRAN LOGOWANIA --- */
.login-body {
    background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-header h2 {
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 700;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #475569;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-block {
    width: 100%;
}

.alert {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.alert-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}


/* --- PANEL GŁÓWNY (ADMIN LAYOUT) --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #1e293b;
}

.brand-icon {
    font-size: 2rem;
}

.brand-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow: scroll;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.sidebar-menu li:hover a, 
.sidebar-menu li.active a {
    color: #ffffff;
    background-color: #1e293b;
}

.sidebar-menu li.active a {
    background-color: var(--primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #1e293b;
    background-color: #0b0f19;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: #334155;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem;
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    background-color: #ef4444;
    color: white;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.main-header {
    background-color: #ffffff;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.current-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.content-container {
    padding: 2rem;
    flex: 1;
}

/* Komponenty typu Card */
.card {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Siatka statystyk (Dashboard widgets) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-blue { background-color: #eff6ff; color: #2563eb; }
.icon-green { background-color: #ecfdf5; color: #059669; }
.icon-purple { background-color: #faf5ff; color: #7c3aed; }

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-top: 0.25rem;
}

/* Szybkie akcje i dodatki */
.action-item-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.action-item-box:hover {
    border-color: var(--primary);
    background-color: #f5f3ff;
}

.action-item-box h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.action-item-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.text-center { text-align: center; }
.p-5 { padding: 3rem; }
.text-muted { color: var(--text-muted); }


/* --- RWD (Mobile) --- */
/* Klasy pomocnicze do formularzy (użyj w add_player.php i verify_account.php) */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    gap: 2rem;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 10px 0;
}


@media (max-width: 768px) {
    /* Przebudowa głównego layoutu */
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: column;
    }

    .sidebar-menu {
        padding: 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar-menu li {
        margin-bottom: 0;
        flex: 1 1 calc(50% - 0.5rem); /* Dwa przyciski menu obok siebie na telefonie */
    }

    .sidebar-menu a {
        justify-content: center;
        text-align: center;
        padding: 0.5rem;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .main-header {
        padding: 1rem;
    }

    .content-container {
        padding: 1rem;
    }

    /* Dopasowanie kart i statystyk */
    .card-header, .card-body {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr; /* Jedna kolumna na telefonie */
    }

    /* Elementy formularzy na Mobile */
    .form-grid {
        grid-template-columns: 1fr; /* Złamanie gridów 2-kolumnowych do 1 kolumny */
    }

    .checkbox-group {
        flex-direction: column;
        gap: 1rem;
    }

    .flex-mobile-col {
        flex-direction: column;
        width: 100%;
    }
    
    .flex-mobile-col > * {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Zmniejszenie marginesów i fontów na mobilkach */
    h2 {
        font-size: 1.25rem;
    }
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-card, #ffffff);
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding: 1rem;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    z-index: 99; /* Upewnia się, że stopka jest nad innymi elementami */
}

.footer p {
    text-align: right;
}

body {
    padding-bottom: 60px; /* Wysokość stopki + mały zapas */
}