/*
Theme Name: CMMS Minimal
Author: Łukasz Dziubiński
Description: Minimalistyczny motyw dla systemu CMMS.
Version: 1.0
*/

:root {
    --primary: #0073aa; /* Kolor WordPressa/Admina - spójność */
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border: #e0e0e0;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 16px;
}

a { text-decoration: none; color: var(--primary); transition: 0.2s; }
a:hover { color: #005177; text-decoration: underline; }

/* HEADER */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.site-title a {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* MENU */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.main-navigation a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.main-navigation a:hover { color: var(--primary); text-decoration: none; }

/* ROZWIJANE MENU (DROPDOWN) */
.main-navigation li {
    position: relative; /* Kluczowe dla pozycjonowania podmenu */
}

.main-navigation ul ul { /* Styl dla podmenu (zagnieżdżonej listy <ul>) */
    display: none; /* Domyślnie ukryte */
    position: absolute;
    top: 100%; /* Rozpoczyna się tuż pod elementem nadrzędnym */
    left: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
    flex-direction: column; /* Ustawienie elementów w kolumnie */
    gap: 0; /* Usuwamy odstępy z menu głównego */
    padding: 10px 0;
    border-radius: 4px;
}

.main-navigation ul ul a {
    padding: 8px 15px;
    display: block;
    white-space: nowrap;
    font-size: 0.9rem;
}

.main-navigation ul ul a:hover {
    background-color: var(--bg-body);
}

.main-navigation li:hover > ul {
    display: flex; /* Pokazuje podmenu po najechaniu na element nadrzędny */
}

/* MENU MOBILNE */
.menu-toggle {
    display: none; /* Domyślnie ukryj przycisk hamburgera na desktopie */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1001; /* Wyżej niż menu */
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 4px auto;
    background-color: var(--text-main);
    transition: all 0.3s ease-in-out;
}

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

/* CARDS (Wygląd treści) */
.cmms-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

h1, h2, h3 { margin-top: 0; color: #111; }
h1 { font-size: 1.8rem; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--bg-body); }

/* TABELE (Responsywność dla Twoich list) */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
th { background-color: #f9f9f9; font-weight: 600; color: #555; }

/* FORMULARZE */
input[type="text"], input[type="email"], input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 15px;
}

button, input[type="submit"], .button {
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-block;
}
button:hover, input[type="submit"]:hover, .button:hover {
    background-color: #005177; text-decoration: none; color: #fff;
}

/* MOBILE MENU FIX - Zmiana od 768px */
@media (max-width: 768px) {
    .site-header { 
        height: 60px; /* Przywracamy stałą wysokość */
        flex-direction: row; 
        padding: 0 15px;
    }
    
    .menu-toggle {
        display: block; /* Pokaż przycisk hamburgera na mobile */
    }

    .main-navigation {
        display: none; /* Domyślnie ukryj menu na mobile */
        position: absolute;
        top: 60px; /* Pod headerem */
        left: 0;
        width: 100%;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        z-index: 999;
        padding: 10px 0;
    }
    
    /* Pokaż menu, gdy ma klasę toggled */
    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul { 
        flex-direction: column; 
        align-items: flex-start; /* Menu wyrównane do lewej */
        gap: 0;
    }
    
    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid var(--bg-body);
    }
    
    .main-navigation a {
        display: block;
        padding: 12px 20px;
    }
    
    /* Rozwijane menu na telefonie (poprawka dla struktury wertykalnej) */
    .main-navigation ul ul { 
        position: static; 
        box-shadow: none; 
        border: none; 
        background-color: var(--bg-body);
        width: 100%;
        padding: 0; 
        margin-left: 20px;
    }

    .main-navigation ul ul a {
        padding: 8px 20px;
        font-size: 0.9em;
    }
    
    /* Animacja krzyżyka */
    .menu-toggle.toggled .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.toggled .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.toggled .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Przewijanie tabel na telefonie */
    .cmms-card { overflow-x: auto; }
}