:root {
    --bg-dark: #0f1115;
    --bg-panel: #181b21;
    --bg-header: #1f232b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #10b981;
    --danger: #ef4444;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --radius: 12px;
    --header-height: 70px;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* --- HEADER --- */
header {
    height: var(--header-height);
    background-color: var(--bg-header);
    border-bottom: 1px solid #2d3748;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.main-nav a:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.05); }

.user-menu { display: flex; align-items: center; gap: 15px; }
.btn-login {
    background: var(--primary); color: white; padding: 8px 20px; border-radius: 6px;
    text-decoration: none; font-weight: 600; font-size: 0.9rem;
    display: flex; align-items: center; gap: 8px;
}

/* Hamburger (Domyślnie ukryty na desktopie) */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
}

/* --- LAYOUT OGÓLNY --- */
.main-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    width: 100%;
}

aside {
    width: var(--sidebar-width);
    background-color: var(--bg-panel);
    border-right: 1px solid #2d3748;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Na desktopie sidebar jest stałym elementem obok treści */
}
aside a { color: var(--text-muted); text-decoration: none; padding: 12px 16px; border-radius: var(--radius); display: flex; align-items: center; gap: 10px; }
aside a:hover, aside a.active { background: rgba(59, 130, 246, 0.1); color: var(--primary); }

main { flex: 1; padding: 20px; overflow-y: auto; width: 100%; }

.hero-section {
    margin-top: var(--header-height);
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #161920 100%);
    border-bottom: 1px solid #2d3748;
}
.hero-title { font-size: 3rem; margin-bottom: 20px; color: #fff; }
.hero-desc { color: var(--text-muted); max-width: 600px; margin: 0 auto 30px; }

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}
.card { background: var(--bg-panel); border: 1px solid #2d3748; border-radius: var(--radius); padding: 20px; }
.card-title { font-size: 1.2rem; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 15px; }

/* =========================================
   MEDIA QUERY: TELEFON (Musi być na końcu!)
   ========================================= */
@media (max-width: 768px) {
    /* Header */
    .mobile-toggle { display: block; }
    .brand span { display: none; }
    .user-info-desktop { display: none; }
    .btn-login span { display: none; }
    .btn-login { padding: 8px; }

    /* Menu Główne (Publiczne) - chowane */
    .main-nav {
        display: none; /* Domyślnie ukryte na mobile */
        position: absolute;
        top: var(--header-height);
        left: 0; width: 100%;
        background-color: var(--bg-header);
        border-bottom: 1px solid #333;
        flex-direction: column;
        padding: 10px 0; gap: 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
        z-index: 950;
    }
    .main-nav.open { /* Nowa klasa: menu otwarte */
        display: flex; /* Pokaż, gdy klasa 'open' jest aktywna */
    }
    .main-nav a { display: block; padding: 15px 20px; width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); }

    /* Sidebar (Panel) - Ukrywamy i robimy wysuwany */
    aside {
        position: fixed;
        left: -280px;    /* Chowamy za lewą krawędź */
        top: var(--header-height);
        bottom: 0;
        width: 260px;
        z-index: 900;
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
        border-right: none;
    }
    aside.open { /* Nowa klasa: sidebar otwarty */
        left: 0 !important; /* Wsuń na ekran, użyj !important dla pewności */
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 800;
        backdrop-filter: blur(2px);
    }
    .sidebar-overlay.active { display: block; }

    /* Layout */
    .main-container { flex-direction: column; }
    main { width: 100%; padding: 15px; }
}
/* --- GLOBALNE ODSUNIĘCIE TREŚCI OD NAGŁÓWKA --- */
/* To odsunięcie dotyczy całego body, pod fixed header */
body {
    padding-top: var(--header-height) !important; /* Odsuń całe body w dół */
}

/* Przykładowo, jeśli main ma swój padding, można go zresetować/dostosować */
main {
    padding-top: 0px !important; /* Zresetuj padding-top main, bo body już ma */
}
