/* =========================================
   1. ГЛОБАЛЕН РЕСЕТ (ОСНОВА)
   ========================================= */
* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9; /* Светъл фон */
    color: #333;
    display: flex;
    min-height: 100vh;
}

a { text-decoration: none; }
ul { list-style: none !important; padding: 0; margin: 0; }

/* =========================================
   2. МЕНЮ (SIDEBAR) - ТЪМНО
   ========================================= */
.sidebar {
    width: 250px;
    background-color: #343a40; /* Тъмно сиво */
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

/* Лого */
.sidebar .logo {
    height: 60px;
    display: flex; align-items: center; padding: 0 20px;
    font-size: 1.2rem; font-weight: bold;
    background-color: rgba(0,0,0,0.2);
    border-bottom: 1px solid #4b545c;
    color: #fff;
}

/* Линкове */
.sidebar nav {
    flex: 1; padding-top: 10px; overflow-y: auto;
}

.sidebar nav ul li a {
    display: flex; align-items: center;
    padding: 12px 20px;
    color: #c2c7d0 !important; /* Светъл текст */
    font-size: 1rem;
    border-left: 3px solid transparent;
}

.sidebar nav ul li a:hover {
    background-color: #4b545c;
    color: #fff !important;
}

.sidebar nav ul li a.active {
    background-color: #007bff; /* Синьо за активния */
    color: #fff !important;
    border-left-color: #0056b3;
}

.sidebar i { width: 25px; text-align: center; margin-right: 10px; }

/* Футър на менюто */
.sidebar-footer {
    padding: 15px 20px;
    background-color: rgba(0,0,0,0.2);
    border-top: 1px solid #4b545c;
}
.user-info { margin-bottom: 5px; font-weight: bold; color: #fff; font-size: 0.9rem; }
.logout { color: #ff6b6b !important; font-size: 0.9rem; display: block; }
.logout:hover { color: #ff4c4c !important; }

/* =========================================
   3. ОСНОВНО СЪДЪРЖАНИЕ
   ========================================= */
.content {
    margin-left: 250px;
    padding: 5px;
    width: 100%;
    transition: margin-left 0.3s ease;
}

/* =========================================
   4. ЕЛЕМЕНТИ (Хедър, Таблици, Бутони)
   ========================================= */
.page-header {
    background: #fff; padding: 15px 20px; border-radius: 8px; margin-bottom: 25px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.page-header h1 { margin: 0; font-size: 1.5rem; color: #333; }

.table-container {
    background: #fff; padding: 20px; border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #dee2e6; }
th { background-color: #f8f9fa; font-weight: 600; color: #495057; }

/* Бутони */
.btn {
    display: inline-block; padding: 8px 16px; background-color: #007bff; color: #fff !important;
    border-radius: 4px; border: none; cursor: pointer; font-size: 0.9rem;
}
.btn:hover { opacity: 0.9; }
.btn-danger { background-color: #dc3545; }
.btn-sm { padding: 4px 8px; font-size: 0.8rem; }

/* Статуси */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; color: #fff; font-weight: bold; }
.badge.active { background-color: #28a745; }
.badge.inactive { background-color: #6c757d; }

/* =========================================
   5. ТАБЛО (DASHBOARD) - КАРТИ
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex; align-items: center;
    transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-5px); }

.card-icon {
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff; margin-right: 20px; flex-shrink: 0;
}

/* Цветове за иконите */
.bg-blue { background-color: #007bff; }
.bg-green { background-color: #28a745; }
.bg-purple { background-color: #6f42c1; }

.card-info h3 { margin: 0; font-size: 1.8rem; font-weight: 700; color: #333; }
.card-info p { margin: 0; font-size: 0.9rem; color: #6c757d; text-transform: uppercase; }

.quick-actions {
    background: #fff; padding: 25px; border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.quick-actions h2 { margin-top: 0; margin-bottom: 20px; font-size: 1.2rem; color: #444; }

/* =========================================
   6. МОБИЛНА ВЕРСИЯ - ПОПРАВЕНА
   ========================================= */
.menu-toggle { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
    .sidebar { 
        transform: translateX(-100%); 
        position: fixed !important; /* Сайдбарът да е над съдържанието */
        z-index: 1001; 
        display: flex !important; /* Винаги flex, когато е активен */
    }
    
    .sidebar.active { 
        transform: translateX(0); /* Плъзгане отляво */
    }

    .content { 
        margin-left: 0 !important; 
        padding-top: 70px; /* Място за фиксирания бутон */
    }
    
    .menu-toggle {
        display: block !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1002;
        background: #343a40;
        color: #fff;
        border: none;
        padding: 10px 15px;
        border-radius: 5px;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    .page-header { flex-wrap: wrap; margin-top: 10px; }
    .page-header h1 { font-size: 1.2rem; }
    
    .sidebar-overlay {
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5); 
        z-index: 999;
        display: none;
    }
    .sidebar-overlay.active { display: block; }
}

/* =========================================
   7. ЕЗИКОВ ПАНЕЛ (FIXED & WHITE)
   ========================================= */
.sidebar .sidebar-footer .lang-switcher {
    margin-bottom: 15px;
    padding-left: 20px;
    display: flex;
    align-items: center;
    font-family: sans-serif;
}

.sidebar .sidebar-footer .lang-switcher a {
    color: #ffffff !important; /* ВАЖНО: Прави го бяло */
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    opacity: 0.6;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar .sidebar-footer .lang-switcher a:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .sidebar-footer .lang-switcher a.active {
    opacity: 1;
    color: #ffffff !important;
    background-color: #007bff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.sidebar .sidebar-footer .lang-switcher .sep {
    color: #ffffff !important;
    opacity: 0.3;
    margin: 0 5px;
}
.btn-rules {
    display: inline-block;
    padding: 10px 15px;
    background-color: #e9ecef; /* Сив цвят */
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 5px;
    transition: 0.2s;
}
.btn-rules:hover {
    background-color: #dbe2e8;
    color: #dc3545; /* Червено при ховър като PDF */
}