/* ============================================
   STYLE PRINCIPAL - DJULNAR PLUS ISO PLATFORM
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f0f2f5;
    overflow-x: hidden;
    min-height: 100vh;
}

#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -280px;
    width: 280px;
    transition: margin 0.3s ease-in-out;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 1000;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

#sidebar-wrapper::-webkit-scrollbar {
    width: 4px;
}
#sidebar-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}
#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-heading {
    padding: 1.5rem 1rem;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.list-group-flush {
    padding: 0.5rem 0;
}

.list-group-item {
    border: none;
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff;
    padding-left: 2.2rem;
    border-left-color: #6c8bff;
}
.list-group-item.active {
    background: rgba(108, 139, 255, 0.15) !important;
    color: #fff;
    border-left-color: #6c8bff;
}
.list-group-item i {
    width: 22px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    margin-top: auto;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

@media (min-width: 992px) {
    #sidebar-wrapper {
        margin-left: 0;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: -280px;
    }
}

#page-content-wrapper {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
}

.navbar {
    padding: 0.8rem 1.5rem;
    background: #fff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

#menu-toggle {
    border-radius: 10px;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
}

.stat-card {
    border: none;
    border-radius: 16px;
    padding: 1.5rem 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 4.5rem;
    opacity: 0.1;
}

.stat-card .stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #1a1a2e;
}
.stat-card .stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
}

.stat-card.blue { background: linear-gradient(135deg, #e8f0fe, #d0e0ff); }
.stat-card.green { background: linear-gradient(135deg, #e6f7ed, #c8f0d9); }
.stat-card.orange { background: linear-gradient(135deg, #fef3e2, #fde4c8); }
.stat-card.red { background: linear-gradient(135deg, #fde8e8, #fcd0d0); }
.stat-card.purple { background: linear-gradient(135deg, #f0e6ff, #e0d0ff); }
.stat-card.teal { background: linear-gradient(135deg, #e6f7f5, #c8f0ec); }

.table-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.table-container .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 10px;
}
.table-container .table-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
}
.table-container .table-title i {
    color: #0d6efd;
    margin-right: 10px;
}

.table thead th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
    padding: 0.8rem 1rem;
}
.table tbody td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background-color: #f0f7ff;
}

.badge-status {
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.7rem;
    display: inline-block;
    white-space: nowrap;
}
.badge-status.en-cours { background: #fff3cd; color: #856404; }
.badge-status.realise { background: #d4edda; color: #155724; }
.badge-status.bloque { background: #f8d7da; color: #721c24; }
.badge-status.planifie { background: #cce5ff; color: #004085; }
.badge-status.termine { background: #d4edda; color: #155724; }
.badge-status.draft { background: #e2e3e5; color: #383d41; }
.badge-status.valide { background: #d4edda; color: #155724; }
.badge-status.approuve { background: #cce5ff; color: #004085; }

.form-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}
.form-container .form-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f2f5;
}

.chart-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.btn {
    border-radius: 10px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.4);
    color: #fff;
}
.btn-success {
    background: linear-gradient(135deg, #198754, #157347);
    border: none;
    color: #fff;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(25, 135, 84, 0.4);
    color: #fff;
}

@media (max-width: 768px) {
    .stat-card .stat-number { font-size: 1.6rem; }
    .table-container { padding: 1rem; overflow-x: auto; }
    .form-container { padding: 1.2rem; }
}

@media print {
    #sidebar-wrapper { display: none !important; }
    #page-content-wrapper { margin-left: 0 !important; width: 100% !important; }
    .navbar { display: none !important; }
    .stat-card { break-inside: avoid; }
    .btn { display: none !important; }
}