* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #1e3a5f 0%, #2c3e50 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h5 {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.sidebar-header small {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #3498db;
}

.sidebar-nav .nav-link.active {
    background: rgba(52, 152, 219, 0.3);
    color: white;
    border-left-color: #3498db;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 20px;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    padding: 0 20px;
    margin-bottom: 5px;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
}

.main-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    padding: 18px 24px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.3);
}

.main-header h1 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c3e50 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h4 {
    font-size: 24px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 5px;
}

.login-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.table-section {
    padding: 16px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8eef5;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar .btn-success {
    background: linear-gradient(135deg, #1e7e34 0%, #28a745 100%);
    border: none;
    padding: 10px 18px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
    transition: all 0.2s ease;
}

.toolbar .btn-success:hover {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
}

.toolbar .btn-outline-secondary {
    background: white;
    border: 1px solid #c5d0dc;
    color: #5a6c7d;
    padding: 10px 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.toolbar .btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #3498db;
    color: #1e3a5f;
}

.search-form .input-group {
    min-width: 300px;
}

.search-form .form-control {
    border: 1px solid #c5d0dc;
    border-radius: 8px 0 0 8px;
    padding: 10px 14px;
    font-size: 13px;
}

.search-form .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.search-form .btn {
    border-radius: 0 8px 8px 0;
    padding: 10px 16px;
}

.search-form .btn-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    border: none;
}

.search-form .btn-secondary {
    background: #f1f5f9;
    border: 1px solid #c5d0dc;
    color: #5a6c7d;
}

.filter-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    border: 1px solid #d1d9e6;
    padding: 20px 24px;
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 11px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.filter-group .form-select {
    background-color: white;
    border: 1px solid #c5d0dc;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #2c3e50;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filter-group .form-select:hover {
    border-color: #3498db;
}

.filter-group .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

.filter-actions {
    display: flex;
    gap: 10px;
    padding-top: 4px;
}

.filter-actions .btn {
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.filter-actions .btn-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    border: none;
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.3);
}

.filter-actions .btn-primary:hover {
    background: linear-gradient(135deg, #2c5282 0%, #1e3a5f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(30, 58, 95, 0.35);
}

.filter-actions .btn-secondary {
    background: white;
    border: 1px solid #c5d0dc;
    color: #5a6c7d;
}

.filter-actions .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #a0aec0;
    color: #2c3e50;
}

.table-container {
    overflow-x: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1400px;
}

.data-table th,
.data-table td {
    border: 1px solid #d0d0d0;
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    filter: brightness(0.92);
}

.data-table td {
    font-size: 12px;
}

.data-table th.col-titre { background-color: #FFFF99; color: #333; min-width: 200px; }
.data-table th.col-type { background-color: #CCE5FF; color: #333; min-width: 90px; }
.data-table th.col-discipline { background-color: #E6D9F2; color: #333; min-width: 100px; }
.data-table th.col-batiment { background-color: #FFE6F0; color: #333; min-width: 100px; }
.data-table th.col-zone { background-color: #E8E8E8; color: #333; min-width: 70px; }
.data-table th.col-niveau { background-color: #E8E8E8; color: #333; min-width: 70px; }
.data-table th.col-remarques { background-color: #D4EDDA; color: #333; min-width: 150px; }
.data-table th.col-date-debut { background-color: #D1F2EB; color: #333; min-width: 100px; }
.data-table th.col-date-fin { background-color: #D1F2EB; color: #333; min-width: 100px; }
.data-table th.col-etat { background-color: #FFF3CD; color: #333; min-width: 130px; }
.data-table th.col-dessinateur { background-color: #E8E8E8; color: #333; min-width: 120px; }
.data-table th.col-indice { background-color: #E8E8E8; color: #333; min-width: 60px; }
.data-table th.col-charge { background-color: #E8E8E8; color: #333; min-width: 100px; }
.data-table th.col-actions { background-color: #f0f0f0; color: #333; min-width: 60px; text-align: center; }

.data-table td.col-titre { background-color: #FFFFD0; }
.data-table td.col-type { background-color: #E6F2FF; }
.data-table td.col-discipline { background-color: #F0E6F7; }
.data-table td.col-batiment { background-color: #FFF0F5; }
.data-table td.col-zone { background-color: #F5F5F5; }
.data-table td.col-niveau { background-color: #F5F5F5; }
.data-table td.col-remarques { background-color: #E8F5E9; }
.data-table td.col-date-debut { background-color: #E0F7F4; }
.data-table td.col-date-fin { background-color: #E0F7F4; }
.data-table td.col-etat { background-color: #FFF8E1; }
.data-table td.col-dessinateur { background-color: #F5F5F5; }
.data-table td.col-indice { background-color: #F5F5F5; }
.data-table td.col-charge { background-color: #F5F5F5; }
.data-table td.col-actions { background-color: #FAFAFA; text-align: center; }

.data-table tr.row-complete td {
    background-color: #e8eef5 !important;
    color: #5a6c7d;
}

.data-table tr.row-complete td.col-etat {
    background-color: #d4edda !important;
    color: #155724;
    font-weight: 600;
}

.data-table tr.row-overdue td {
    background-color: #fff8e1 !important;
    color: #856404;
}

.data-table tr.row-overdue td.col-date-fin {
    background-color: #ffe0e0 !important;
    color: #c62828;
    font-weight: 600;
}

.data-table tbody tr:hover:not(.row-complete):not(.row-overdue) td {
    filter: brightness(0.95);
}

.data-table td.editable {
    cursor: pointer;
    min-width: 50px;
    min-height: 30px;
    position: relative;
}

.data-table td.editable:hover {
    outline: 2px solid #FF8C00;
    outline-offset: -2px;
}

.data-table td.editing {
    padding: 2px;
}

.data-table td.editing input {
    width: 100%;
    padding: 5px;
    border: 2px solid #FF8C00;
    font-size: 12px;
    font-family: inherit;
    border-radius: 3px;
}

.data-table td.col-titre a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
}

.data-table td.col-titre a:hover {
    text-decoration: underline;
}

.empty-row td {
    text-align: center;
    padding: 30px;
    color: #666;
    background-color: #f8f9fa !important;
    font-size: 14px;
}

.kpi-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
}

.kpi-primary .kpi-icon { background: #e3f2fd; color: #1976d2; }
.kpi-warning .kpi-icon { background: #fff3e0; color: #f57c00; }
.kpi-danger .kpi-icon { background: #ffebee; color: #d32f2f; }
.kpi-success .kpi-icon { background: #e8f5e9; color: #388e3c; }

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: #2c3e50;
}

.kpi-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-list {
    max-height: 350px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    color: #7f8c8d;
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-type {
    font-size: 10px;
    text-transform: uppercase;
    color: #95a5a6;
    letter-spacing: 0.5px;
}

.activity-detail {
    font-size: 13px;
    color: #2c3e50;
}

.activity-time {
    font-size: 11px;
    color: #95a5a6;
}

.card {
    background: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 16px;
}

.card-header {
    background: #fafafa;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
}

.card-header h5, .card-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: #fafafa;
    border-top: 1px solid #eee;
    padding: 15px 20px;
    border-radius: 0 0 10px 10px;
}

.progress {
    height: 20px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.btn {
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    border: none;
}

.form-control, .form-select {
    font-size: 13px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 6px;
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 20px 25px;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 15px 25px;
}

.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: none;
    animation: fadeInOut 2s ease-in-out;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 600;
}

.error-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #dc3545;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: none;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 600;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

@media (max-width: 992px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header h5,
    .sidebar-header small,
    .sidebar-nav .nav-link span,
    .nav-section-title,
    .sidebar-footer {
        display: none;
    }
    
    .sidebar-nav .nav-link {
        padding: 15px;
        justify-content: center;
    }
    
    .sidebar-nav .nav-link i {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left, .toolbar-right {
        width: 100%;
    }
    
    .search-form .input-group {
        min-width: auto;
        width: 100%;
    }
}
