/* 
 * TRANSCOM UI - Design System Institutionnel
 * Version: 2.1 (Modernized)
 * Date: 04/01/2026
 */

:root {
    /* Palette Institutionnelle (Valeurs par défaut) */
    --primary-color: #4e73df;      /* Bleu Principal (sera écrasé par PHP) */
    --primary-dark: #2e59d9;       
    --primary-light: #f8f9fc;      
    
    /* Sidebar - Toujours sombre pour le contraste */
    --sidebar-bg: #2c3e50;
    --sidebar-bg-dark: #1a252f;
    --sidebar-text: rgba(255, 255, 255, 0.8);
    --sidebar-text-active: #ffffff;

    /* Couleurs Fonctionnelles */
    --success-color: #1cc88a;      /* Vert plus doux */
    --warning-color: #f6c23e;      /* Jaune plus chaud */
    --danger-color: #e74a3b;       /* Rouge moins agressif */
    --info-color: #36b9cc;         /* Cyan */
    
    /* Neutres */
    --bg-body: #f8f9fc;            /* Gris très clair bleuté */
    --bg-card: #ffffff;            
    --text-main: #5a5c69;          /* Gris foncé (pas noir pur) */
    --text-muted: #858796;         
    --border-color: #e3e6f0;       
    
    /* Dimensions */
    --sidebar-width: 250px;
    --header-height: 70px;
    --border-radius: 0.35rem;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

/* --- RESET & BASE --- */
body {
    font-family: 'Nunito', 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    overflow-x: hidden;
}

a { 
    text-decoration: none; 
    color: var(--primary-color);
    transition: color 0.2s;
}
a:hover { color: var(--primary-dark); }

/* --- LAYOUT STRUCTURE --- */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* --- 1. SIDEBAR (Navigation) --- */
#sidebar {
    width: var(--sidebar-width);
    background: var(--primary-color);
    background: linear-gradient(180deg, var(--primary-color) 10%, var(--primary-dark) 100%);
    color: rgba(255, 255, 255, 0.9);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
}

.sidebar-menu {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-label {
    padding: 0.5rem 1.5rem 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
    letter-spacing: 0.05rem;
}

.nav-link {
    padding: 0.6rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    border-left: 0.25rem solid transparent;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.2);
    border-left-color: #fff;
    font-weight: 700;
}

.nav-link i {
    font-size: 1rem;
    width: 1.5rem;
    text-align: center;
    opacity: 0.8;
}
.nav-link.active i { opacity: 1; }

.sidebar-footer {
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    font-size: 0.75rem;
    text-align: center;
    color: rgba(255,255,255,0.5);
}

/* --- 2. MAIN CONTENT --- */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

/* --- 3. HEADER (Top Bar) --- */
.top-header {
    height: var(--header-height);
    background: #fff;
    box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-main);
    margin: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    display: block;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --- 4. CARDS & WIDGETS --- */
.main-container {
    padding: 1.5rem;
    flex: 1;
}

.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.card-header {
    background: #f8f9fc;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 1.25rem;
}

/* --- 5. FORMS & INPUTS --- */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid #d1d3e2;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #6e707e;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    color: #6e707e;
}

/* --- 6. BUTTONS --- */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: #fff;
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: #fff;
}

/* --- 7. TABLES --- */
.table {
    color: #858796;
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fc;
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    border-top: none;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

/* --- 8. BADGES --- */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 700;
    border-radius: 0.35rem;
    font-size: 75%;
}

.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; color: #fff; }
.bg-info { background-color: var(--info-color) !important; }

/* --- 9. UTILITIES --- */
.text-gray-800 { color: #5a5c69 !important; }
.text-gray-300 { color: #dddfeb !important; }
.border-left-primary { border-left: 0.25rem solid var(--primary-color) !important; }
.border-left-success { border-left: 0.25rem solid var(--success-color) !important; }
.border-left-info { border-left: 0.25rem solid var(--info-color) !important; }
.border-left-warning { border-left: 0.25rem solid var(--warning-color) !important; }
.border-left-danger { border-left: 0.25rem solid var(--danger-color) !important; }

/* --- 10. RESPONSIVE --- */
@media (max-width: 768px) {
    #sidebar { margin-left: calc(-1 * var(--sidebar-width)); }
    #sidebar.active { margin-left: 0; }
    #content { width: 100%; margin-left: 0; }
    .top-header { padding: 0 1rem; }
    .main-container { padding: 1rem; }
}
