/* --- ALGEMENE INSTELLINGEN --- */
:root {
    --primary: #2c3e50;    /* Donkerblauw (Sidebar/Headers) */
    --accent: #27ae60;     /* Groen (Acties/Succes) */
    --warning: #f39c12;    /* Oranje */
    --danger: #e74c3c;     /* Rood */
    --bg: #f4f7f6;         /* Achtergrond Content */
    --text: #333;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR (LINKS) --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    text-align: center;
}

.logo-img {
    max-width: 80%;
    height: auto;
    background: white;
    padding: 5px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: block;
    padding: 15px 25px;
    color: #ecf0f1;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s;
}

.sidebar-menu li a:hover {
    background-color: rgba(255,255,255,0.05);
    border-left-color: var(--accent);
    padding-left: 30px;
}

.sidebar-footer {
    padding: 20px;
    font-size: 0.85rem;
    color: #bdc3c7;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- MAIN CONTENT (RECHTS) --- */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

/* --- KAARTEN & FORMULIEREN --- */
.card, .form-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border-top: 4px solid var(--primary); /* Mooi accentje bovenaan */
}

h3 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; color: var(--primary); }

input[type="text"], input[type="email"], input[type="password"], 
select, textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(44, 62, 80, 0.2);
}

/* --- KNOPPEN --- */
.btn {
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: inline-block;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background-color: #3498db; }
.btn-success, .btn-main { background-color: var(--accent); }
.btn-danger { background-color: var(--danger); }
.btn-scan { background-color: #3498db; width: auto; }

/* --- TABELLEN --- */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}
.styled-table th { background: var(--primary); color: white; padding: 12px; text-align: left; }
.styled-table td { padding: 12px; border-bottom: 1px solid #eee; }
.styled-table tr:hover { background: #f9f9f9; }

/* --- BADGES --- */
.badge { padding: 4px 8px; border-radius: 12px; font-size: 0.8em; font-weight: bold; }
.badge-new { background: #e8f5e9; color: green; }
.badge-gar { background: #fff3e0; color: orange; }
.badge-rep { background: #e3f2fd; color: #2980b9; }

/* --- TOPAZ & SPECIALS --- */
.inname-selector { display: flex; gap: 20px; background: #eef2f3; padding: 15px; border-radius: 8px; margin-bottom: 15px; }
.inname-selector label { font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 8px; }

.status-container { display: flex; align-items: center; gap: 12px; margin: 15px 0; background: #f9f9f9; padding: 10px; border-radius: 8px; border: 1px solid #eee; }
.led-indicator { width: 14px; height: 14px; border-radius: 50%; background-color: #f1c40f; box-shadow: 0 0 5px rgba(0,0,0,0.2); transition: all 0.3s; }
.led-red { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }
.led-green { background-color: var(--accent); box-shadow: 0 0 8px var(--accent); }
.led-yellow { background-color: #f1c40f; }

/* --- LOGIN PAGINA SPECIFIEK --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--primary); /* Blauwe achtergrond voor login */
    margin: 0;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    max-width: 150px;
    margin-bottom: 20px;
}


/* --- TOPAZ TABLET INDICATORS --- */
.status-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
    background: #f9f9f9;
    padding: 5px;
    border-radius: 5px;
}

.led-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #ccc;
    border: 1px solid #999;
    box-shadow: inset 0 -1px 2px rgba(0,0,0,0.2);
    transition: background-color 0.3s, box-shadow 0.3s; /* Mooi effectje */
}

.led-green { 
    background-color: #2ecc71; 
    box-shadow: 0 0 5px #2ecc71; 
}

.led-red { 
    background-color: #e74c3c; 
    box-shadow: 0 0 5px #e74c3c; 
}

.led-yellow { 
    background-color: #f1c40f; 
    box-shadow: 0 0 5px #f1c40f; 
}


/* =========================================
   --- TABLET & RESPONSIVE TWEAKS ---
   ========================================= */

/* Als het scherm kleiner is dan 1100px (Laptops & Tablets liggend) */
@media screen and (max-width: 1100px) {
    
    /* 1. Maak de zijbalk een stuk smaller */
    :root {
        --sidebar-width: 180px; /* Hier passen we de variabele aan als je die gebruikt */
    }

    .sidebar {
        width: 180px !important;
    }

    /* Schuif de content mee terug */
    .main-content {
        margin-left: 180px !important;
        padding: 20px; /* Iets minder witruimte aan de zijkanten */
    }

    /* 2. Maak het menu compacter */
    .sidebar-menu li a {
        padding: 12px 15px; /* Minder vulling */
        font-size: 0.9em;   /* Iets kleinere letters */
    }
    
    /* Logo iets kleiner */
    .logo-img {
        max-width: 60%;
    }

    /* Footer in sidebar (ingelogd als) compacter */
    .sidebar-footer {
        padding: 10px;
        font-size: 0.8em;
    }
    .sidebar-footer strong {
        font-size: 0.9rem !important;
    }
}

/* Als het scherm nóg kleiner is (Tablet rechtop / Grote telefoon - onder 768px) */
@media screen and (max-width: 768px) {
    
    /* 3. Zet kolommen onder elkaar ipv naast elkaar */
    .row {
        flex-direction: column;
    }
    
    /* Zorg dat de kaarten de volle breedte pakken */
    .row > div {
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }

    /* 4. Tabel fix: Zorg dat tabellen kunnen scrollen als ze te breed zijn */
    .card {
        overflow-x: auto; /* Horizontale scrollbalk binnen de kaart */
    }
}


/* =========================================
   --- TABLET FIX: DE "HARDCODED" METHODE ---
   ========================================= */

@media screen and (max-width: 1100px) {

    /* 1. De Sidebar zelf */
    .sidebar {
        width: 180px !important;
        height: 100vh !important;  /* Volledige hoogte scherm */
        position: fixed !important;
        top: 0;
        left: 0;
        overflow-y: auto !important; /* Zorg dat je kunt scrollen in het menu */
        
        /* BELANGRIJK: Maak ruimte aan de onderkant, 
           anders verdwijnt het laatste menu-item achter de footer */
        padding-bottom: 120px !important; 
        z-index: 900;
    }

    /* 2. De Footer vastspijkeren linksonder */
    .sidebar-footer {
        position: fixed !important; /* Plak vast aan het glas van je scherm */
        bottom: 0 !important;
        left: 0 !important;
        width: 180px !important;    /* Even breed als de sidebar */
        height: auto !important;
        
        /* Zorg dat hij een achtergrondkleur heeft, anders zie je het menu er doorheen */
        background-color: var(--primary); 
        border-top: 2px solid rgba(255,255,255,0.2);
        
        z-index: 1000 !important;   /* Bovenop de rest */
        padding: 10px !important;
        text-align: center;
        
        /* Flexbox om alles netjes onder elkaar te zetten */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* 3. Inhoud van de footer finetunen */
    
    /* Verberg 'Ingelogd als' tekst */
    .sidebar-footer small {
        display: none !important;
    }

    /* Forceer avatar en naam onder elkaar */
    .sidebar-footer > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin-bottom: 8px !important;
        width: 100%;
    }

    /* Naam stijl */
    .sidebar-footer strong {
        font-size: 0.8rem !important;
        white-space: normal !important; /* Mag over meerdere regels */
        text-align: center;
        display: block;
    }

    /* 4. Content rechts aanpassen */
    .main-content {
        margin-left: 180px !important;
        width: calc(100% - 180px) !important;
    }
}

/* Voor mobiel (nog kleiner) stapelen we de blokken */
@media screen and (max-width: 768px) {
    .row { flex-direction: column; }
    .row > div { min-width: 100% !important; }
}

