/* assets/css/admin.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: #1e2a3a;
    color: #cbd5e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    padding: 0 20px 30px;
    border-bottom: 1px solid #2d3748;
    margin-bottom: 20px;
}

.sidebar-brand small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #a0aec0;
    margin-top: 4px;
}

.sidebar .menu-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #718096;
    padding: 10px 20px 5px;
    margin-top: 10px;
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #cbd5e0;
    text-decoration: none;
    transition: 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.sidebar a:hover {
    background: #2d3748;
    color: #fff;
    border-left-color: #2c7be5;
}

.sidebar a.active {
    background: #2d3748;
    color: #fff;
    border-left-color: #2c7be5;
}

.sidebar a .icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar .user-info {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid #2d3748;
    font-size: 14px;
    color: #a0aec0;
}

.sidebar .user-info .name {
    font-weight: 600;
    color: #fff;
}

/* Burger menu pour mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: #1e2a3a;
    color: #fff;
    border: none;
    font-size: 28px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* MAIN CONTENT */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 20px 30px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 25px;
}

.top-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1e2a3a;
}

.top-header .user-badge {
    font-size: 14px;
    color: #4a5568;
}

/* WIDGETS */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.widget {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: 0.2s;
}
.widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

.widget .value {
    font-size: 32px;
    font-weight: 700;
    color: #1e2a3a;
}
.widget .label {
    font-size: 14px;
    color: #718096;
    margin-top: 4px;
}
.widget .action {
    margin-top: 10px;
}
.widget .action a {
    font-size: 13px;
    color: #2c7be5;
    text-decoration: none;
}

/* CARDS */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 25px;
}
.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e2a3a;
    margin-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 10px;
}

/* TABLEAUX */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}
table th {
    background: #f7fafc;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}
table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
}
table tr:hover td {
    background: #f7fafc;
}

/* BOUTONS */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-primary { background: #2c7be5; color: #fff; }
.btn-primary:hover { background: #1a68c7; }
.btn-success { background: #38a169; color: #fff; }
.btn-success:hover { background: #2f855a; }
.btn-danger { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-warning { background: #d69e2e; color: #fff; }
.btn-warning:hover { background: #b7791f; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

/* FORMULAIRES */
.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d2dce8;
    border-radius: 6px;
    font-size: 16px; /* 16px pour éviter le zoom automatique sur iOS */
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c7be5;
    box-shadow: 0 0 0 3px rgba(44,123,229,0.1);
}

/* ALERTES */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.alert-success { background: #c6f6d5; color: #22543d; }
.alert-danger { background: #fed7d7; color: #742a2a; }
.alert-warning { background: #fefcbf; color: #744210; }
.alert-info { background: #bee3f8; color: #2a4365; }

/* RESPONSIVE */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: block;
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-content {
        margin-left: 0;
        padding: 70px 15px 20px;
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px 20px;
    }
    .top-header h1 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .widget-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    .widget .value {
        font-size: 24px;
    }
    table {
        font-size: 13px;
        min-width: 500px;
    }
    table th,
    table td {
        padding: 8px 10px;
    }
    .btn {
        font-size: 13px;
        padding: 6px 14px;
    }
    .card {
        padding: 15px;
    }
    .card h3 {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .widget-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .widget {
        padding: 15px;
    }
    .widget .value {
        font-size: 20px;
    }
    .widget .label {
        font-size: 12px;
    }
    table {
        font-size: 12px;
        min-width: 400px;
    }
    .btn-sm {
        font-size: 11px;
        padding: 3px 8px;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* toujours 16px sur mobile */
        padding: 8px 12px;
    }
    .top-header h1 {
        font-size: 18px;
    }
    .sidebar-toggle {
        font-size: 24px;
        padding: 4px 12px;
        top: 10px;
        left: 10px;
    }
    .main-content {
        padding: 60px 10px 15px;
    }
}