:root {
    --primary: #2c3e50;
    --secondary: #4c956c;
    --accent: #fefee3;
    --light: #f9f9f9;
    --dark: #1d3557;
    --success: #4CAF50;
    --warning: #FFC107;
    --danger: #F44336;
    --info: #2196F3;
    --setting : #FC4E00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.5;
    overflow-x: hidden; 
}

.container {
    margin: 0 auto;
    padding: 6px;
    width: 100%;
    max-width: 1600px;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 6px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 0 0 10px 10px;
    margin-bottom: 4px;
    z-index: 2000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
        
.logo { 
    width: 45px; 
    height: 45px; 
    background: linear-gradient(45deg, #00c9ff, #92fe9d, #ff9a9e, #a8edea, #00c9ff);
    background-size: 400% 400%;
    animation: holographic 4s ease infinite;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 30px rgba(0, 201, 255, 0.4),
        0 0 60px rgba(146, 254, 157, 0.2),
        0 15px 35px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: perspective(1000px) rotateY(5deg) rotateX(5deg);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
} 
        
.logo-text {
    display: flex;
    flex-direction: column;
}
        
.logo-text h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
    margin: 0;
}
        
.logo-text span {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
} 
.logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent);
    animation: holographicScan 2s linear infinite;
    transform: rotate(45deg);
}

@keyframes holographic {
    0% { 
        background-position: 0% 50%;
        box-shadow: 
            0 0 30px rgba(0, 201, 255, 0.4),
            0 0 60px rgba(146, 254, 157, 0.2),
            0 15px 35px rgba(0, 0, 0, 0.3);
    }
    25% { 
        background-position: 100% 0%;
        box-shadow: 
            0 0 30px rgba(146, 254, 157, 0.4),
            0 0 60px rgba(255, 154, 158, 0.2),
            0 15px 35px rgba(0, 0, 0, 0.3);
    }
    50% { 
        background-position: 100% 100%;
        box-shadow: 
            0 0 30px rgba(255, 154, 158, 0.4),
            0 0 60px rgba(168, 237, 234, 0.2),
            0 15px 35px rgba(0, 0, 0, 0.3);
    }
    75% { 
        background-position: 0% 100%;
        box-shadow: 
            0 0 30px rgba(168, 237, 234, 0.4),
            0 0 60px rgba(0, 201, 255, 0.2),
            0 15px 35px rgba(0, 0, 0, 0.3);
    }
    100% { 
        background-position: 0% 50%;
        box-shadow: 
            0 0 30px rgba(0, 201, 255, 0.4),
            0 0 60px rgba(146, 254, 157, 0.2),
            0 15px 35px rgba(0, 0, 0, 0.3);
    }
}

@keyframes holographicScan {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.logo:hover {
    transform: perspective(1000px) rotateY(-5deg) rotateX(-5deg) scale(1.1);
    box-shadow: 
        0 0 50px rgba(0, 201, 255, 0.6),
        0 0 80px rgba(146, 254, 157, 0.3),
        0 20px 40px rgba(0, 0, 0, 0.4);
}

.logo i {
    font-size: 24px;
    color: white;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(0, 201, 255, 0.5),
        0 0 30px rgba(146, 254, 157, 0.3);
    position: relative;
    z-index: 2;
    animation: iconGlow 2s ease-in-out infinite alternate;
}

@keyframes iconGlow {
    from {
        text-shadow: 
            0 0 10px rgba(255, 255, 255, 0.8),
            0 0 20px rgba(0, 201, 255, 0.5),
            0 0 30px rgba(146, 254, 157, 0.3);
    }
    to {
        text-shadow: 
            0 0 15px rgba(255, 255, 255, 1),
            0 0 25px rgba(0, 201, 255, 0.7),
            0 0 35px rgba(146, 254, 157, 0.5);
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-info > div {
    margin-top: 2px;
}

.tabs-header {
    display: flex;
    background-color: var(--light);
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    height: 100%;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    /* Assure le centrage vertical */
    align-items: center; 
}

.tab-btn {
    padding: 5px 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.90rem;
    font-weight: 500;
    color: #666;
    position: relative;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-bottom: 0px;
    min-width: max-content;
    /* Supprime les marges par défaut qui peuvent causer des problèmes d'alignement */
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    color: white;
    background-color: #FC4E00;
}

.tab-btn.active {
    color: white;
    background-color: var(--info);
    font-weight: 500;
}

.tab-content {
    display: none;
    padding: 0 8px;
}

.tab-content.active {
    display: block;
}

.tab-title {
    color: var(--primary);
    margin-bottom: 0px;
    padding-bottom: 0px;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.tab-title i {
    background-color: rgba(44, 110, 73, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);  
}

.data-table {
    width: 100%;
    border-collapse: separate !important;
    margin-bottom: 2px;
    background: white;
    overflow: hidden;
    font-size: 1.1rem;
    white-space: normal !important;
    border: 1px solid #ddd;
}

.data-table th {
    background-color: var(--primary);
    color: white;
    padding: 6px !important;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 4px !important;
    border-bottom: 1px solid #eee;
    text-align: left !important;
}

.col-text-long {
    white-space: pre-wrap !important; 
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:nth-child(odd) {
    background-color: #F0F0F0;
}

.data-table tr:hover {
    background-color: rgba(76, 149, 108, 0.15);
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    color: white;
}

.btn i {
    font-size: 1.0rem;
}

.btn-primary {
    background-color: var(--primary);
}

.btn-success {
    background-color: var(--success);
}

.btn-warning {
    background-color: var(--warning);
    color: #333;
}

.btn-danger {
    background-color: var(--danger);
}

.btn-info {
    background-color: var(--info);
}

.btn-settings {
    background-color: var(--setting);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.3);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: rgba(240, 240, 240, 0.9);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex; 
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    background-color: var(--primary);
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px;
    background: white;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

.form-control {
    width: 100%;
    padding: 6px;
    font-size: 16px;
    transition: border 0.3s ease;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.1);
    border-width: 2px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
    padding: 12px;
}

.form-inline-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-inline-group .form-control {
    flex: 1;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .form-control {
    padding-left: 40px;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.modal-footer {
    flex-shrink: 0;
    padding: 15px 25px;
    background: #f1f8e9;
    border-top: 1px solid #e8f5e9;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.modal-body-scrollable {
    max-height: 60vh;
    overflow-y: auto;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.bg-success {
    background-color: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.bg-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: var(--warning);
}

.bg-danger {
    background-color: rgba(244, 67, 54, 0.15);
    color: var(--danger);
}

.bg-info {
    background-color: rgba(33, 150, 243, 0.15);
    color: var(--info);
}

.stat-value {
    font-size: 1.8rem !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin: 5px 0 5px 0 !important;
    text-align: center;
}

.stat-label {
    font-size: 1rem !important;
    color: #e0e0e0 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    text-align: center;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-open {
    color: #334155;
}

.status-in-progress {
    color: var(--info);
}

.status-closed {
    color: var(--success);
}

.high-probability {
    background-color: rgba(76, 175, 80, 0.15);
    color: var(--success);
    font-weight: bold;
}

.medium-probability {
    background-color: rgba(255, 193, 7, 0.15);
    color: var(--warning);
    font-weight: bold;
}

.low-probability {
    background-color: rgba(244, 67, 54, 0.15);
    color: var(--danger);
    font-weight: bold;
}

.risk-critical {
    background-color: rgba(244, 67, 54, 0.15);
    color: var(--danger);
}

.risk-high {
    background-color: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.risk-medium {
    background-color: rgba(255, 193, 7, 0.15);
    color: var(--warning);
}

.risk-low {
    background-color: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
}

.action-btn {
    padding: 5px 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.8rem;
    transition: background-color 0.3s, color 0.3s;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.edit-btn {
    background-color: rgba(255, 193, 7, 0.2);
    color: var(--warning);
}

.delete-btn {
    background-color: rgba(244, 67, 54, 0.2);
    color: var(--danger);
}

.probability-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
    display: inline-block;
}

.table-container {
    height: auto;
    min-height: 200px;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 4px;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: relative;
    overflow-anchor: none;
    z-index: 1;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.table-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

@media (max-height: 700px) {
    .table-container {
        max-height: 65vh;
    }
}

@media (max-height: 600px) {
    .table-container {
        max-height: 50vh;
    }
}

@media (max-height: 500px) {
    .table-container {
        max-height: 40vh;
    }
}

#kpis-table, 
#reclamations-table,
#risks-table,
#actions-table {
    height: auto;
}

.data-table thead th,
#kpis-table thead th,
#reclamations-table thead th {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--primary) !important;
    color: white;
    padding: 8px !important;
    border-bottom: 1px solid #ddd;
    transition: none !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
}

.col-processus {
    min-width: 80px;
    width: auto;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-current-value {
    color: #2196F3;
    font-weight: bold;
}

.search-container {
    margin-bottom: 2px;
    margin-top: 0px  !important;
    display: flex;
    align-items: center;
    background: #D2D2D2;
    padding: 4px 8px;
    border-radius: 8px;
    min-width: 250px;
    flex: 1;
}

.search-container input {
    flex: 1;
    padding: 8px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-section {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 14px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
}

.dashboard-section h3 {
    padding-bottom: 8px;
    padding-left: 10px;
}

.dashboard-section h3 i {
    font-size: 1.1rem;
    color: var(--primary);
    padding: 10px;
}

.stat-card-small {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.stat-card-small .stat-value {
    font-size: 1.8rem;
}

.mission-vision-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.mission-vision-box {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.mission-vision-box h3 {
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.target-display {
    display: flex;
    align-items: center;
    gap: 5px;
}

.target-operator {
    font-weight: bold;
    width: 20px;
    text-align: center;
}

.unit-display {
    margin-left: 3px;
    font-size: 0.9em;
}

.historical-values-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.historical-values-container h4 {
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.historical-values-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.historical-values-table th, 
.historical-values-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.historical-values-table th {
    background-color: var(--secondary);
    color: white;
}

.historical-values-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.add-value-btn {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.add-action-btn {
    background-color: rgba(33, 150, 243, 0.2);
    color: var(--info);
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card h3 {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    text-align: center;
}

.summary-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 5px 0;
}

.summary-card .label {
    font-size: 1rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.summary-card h3,
.summary-card .value,
.summary-card .label {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.summary-card .stat-icon i {
    color: #ffffff !important;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-visual2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.dashboard-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.dashboard-visual1 {
    width: 100%;
    margin-bottom: 20px;
}
        
.charts-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.chart-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.45), inset 0 1px 2px rgba(255, 255, 255, 0.15);
    border-color: rgba(106, 130, 229, 0.4);
}

.chart-wrapper {
    flex: 1;
    min-width: 300px;
    background: linear-gradient(135deg, #2a334a, #1a2236);
    color: #ffffff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.chart-wrapper h4 {
    text-align: center;
    margin-bottom: 1px;
    color: white;
    width: 100%;
}

.visual-card h4 {
    color: #ffffff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kpi-status-chart {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 300px;
    margin-top: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-circle {
    width: 110px;
    height: 110px;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: center;
    display: flex;
    border-radius: 50%;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.status-ontarget {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    color: #e8f5e9;
}

.status-offtarget {
    background: linear-gradient(135deg, #ffb300, #f57f17);
    color: #fffde7;
}

.status-critical {
    background: linear-gradient(135deg, #e53935, #b71c1c);
    color: #ffebee;
}

.status-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.login-container {
    max-width: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-header {
    padding: 20px;
    background-color: var(--primary);
    color: white;
    text-align: center;
}

.login-body {
    padding: 25px;
}

.password-strength {
    height: 6px;
    margin-top: 5px;
    border-radius: 3px;
    background-color: #ddd;
}

.password-strength-meter {
    height: 100%;
    border-radius: 3px;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
    z-index: 1001;
}

.year-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.kpi-critical-row {
    background-color: rgba(244, 67, 54, 0.05) !important;
    font-weight: bold;
}

.kpi-good {
    color: #2196F3 !important;
}

.kpi-warning {
    color: #FF9800 !important;
}

.kpi-critical {
    color: #F44336 !important;
}

.col-small {
    min-width: 70px;
    width: auto;
    max-width: 100px;
    text-align: center;
}

.col-small2 {
    min-width: 50px;
    width: auto;
    max-width: 80px;
    text-align: center;
}

.col-medium {
    min-width: 200px;
    width: auto;
    max-width: 400px;
    text-align: left;
}

.col-medium2 {
    min-width: 150px;
    width: auto;
    max-width: 300px;
    text-align: left;
}

.risk-score-low, .priority-low {
    color: var(--success);
    font-weight: bold;
}

.risk-score-high, .priority-high {
    color: var(--danger);
    font-weight: bold;
}

.riskClass-acceptable {
    color: #4ade80 !important;
    font-weight: bold;
    background-color: rgba(74, 222, 128, 0.15);
    padding: 3px 8px;
    border-radius: 12px;
}

.riskClass-unacceptable {
    color: #f87171 !important;
    font-weight: bold;
    background-color: rgba(248, 113, 113, 0.15);
    padding: 3px 8px;
    border-radius: 12px;
}

.stat-card:hover, 
.summary-card:hover, 
.visual-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.45), inset 0 1px 2px rgba(255, 255, 255, 0.15);
    border-color: rgba(106, 130, 229, 0.4);
}

.stat-card, 
.summary-card, 
.visual-card {
    background: linear-gradient(135deg, #2a334a, #1a2236);
    color: #e6eaf2;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.status-label {
    text-align: center;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-weight: 500;
    margin-top: 12px;
    width: 100%;
}

.tab-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    padding-bottom: 5px;
}

.tab-header-controls::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--secondary);
    position: absolute;
    bottom: -1px;
    left: 0;
}

.header-controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#dashboard-year {
    font-size: 1.0rem;
    border: 1px solid #4c956c;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#dashboard-year:hover {
    border-color: #2c6e49;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.1);
}

.btn-cancel {
    background-color: #6c757d !important;
    color: white !important;
}

.btn-purple {
    background-color: #6f42c1;
    color: white;
}

#login-password {
    color: black;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

#login-password::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

#login-password:focus {
    border-color: #64b5f6 !important;
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.3) !important;
}

.refresh-btn {
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%) !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(161, 140, 209, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.refresh-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(161, 140, 209, 0.5);
}

.refresh-btn:active {
    transform: translateY(1px);
}

.refresh-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    transition: all 0.3s ease;
    opacity: 0;
}

.refresh-btn:hover::after {
    opacity: 1;
}

.refresh-btn i {
    margin-right: 8px;
    display: inline-block;
    transition: transform 0.8s ease;
    transform: rotate(0deg);
}

.refresh-btn:hover i {
    transform: rotate(360deg);
}

.refresh-btn:active i {
    transform: rotate(360deg);
}

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    margin-bottom: 0;
}
        
.main-container {
    margin: 130px auto 0;
    padding: 6px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
        
.header-top {
    padding: 4px 0;
}

.table-container thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000;
}
        
.tabs-container {
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 6px;
    position: sticky;
    top: 100px;
    z-index: 1900;
    height: 40px;
}
        
.table-container thead th, #kpis-table thead th, #reclamations-table thead th {
    position: sticky !important;
    top: 0px !important;
    z-index: 1000;
    background-color: var(--primary) !important;
    color: white;
    padding: 6px;
    border-bottom: 1px solid var(--primary) !important;
}

.modal-login {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 25, 35, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2100;
}

#audit-year-title {
    font-size: 0.9rem;
    font-weight: normal;
    color: #7f8c8d;
    margin-left: 5px;
}

.floating-header-container {
    position: relative;
    width: 100%;
}

.floating-header {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: #2c6e49 !important;
    color: white !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

.floating-header th {
    background-color: #2c6e49 !important;
    color: white !important;
    padding: 8px !important;
    font-size: 0.9rem !important;
    border-bottom: 1px solid #2c6e49 !important;
    text-align: left !important;
}

.floating-header {
    pointer-events: none !important;
}

.table-container {
    position: relative;
}

.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.setting-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.setting-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.date-cell {
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    font-weight: 500;
}

.date-ontime {
    color: #2e7d32;
}

.date-late {
    color: #c62828;
}

.progress-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex-grow: 1;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #4caf50;
}
 
.coherence-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
}

.incoherence {
    color: #F44336;
    background: rgba(244, 67, 54, 0.1);
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
}

.recommendation {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
}  

.notification {
    animation: fadeInOut 3s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.past-due {
    color: orange;
    font-weight: bold;
}

.deadline-future {
    color: orange;
    font-weight: bold;
}

.declination-node {
    background-color: #2a334a;
    color: white;
    border-radius: 8px;
    padding: 15px;
    margin: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    min-width: 200px;
    text-align: center;
}

.declination-node::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: #2a334a;
}

.strategy-node { background: linear-gradient(135deg, #1a2236, #2a334a); }
.policy-node { background: linear-gradient(135deg, #2a334a, #3b4a6b); }
.objective-node { background: linear-gradient(135deg, #3b4a6b, #4c618f); }
.kpi-node { background: linear-gradient(135deg, #4c618f, #5d77af); }

.declination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.declination-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 40px;
}

.declination-connector {
    position: absolute;
    height: 40px;
    width: 2px;
    background-color: #4c956c;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
}

.node-connector {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#reclamations-table th,
#reclamations-table td {
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-selector-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    margin-left: 15px;
}

.site-selector-container label {
    color: white;
    font-weight: 500;
}

.site-selector-container select {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #4c956c;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.site-selector-container select:hover {
    background-color: white;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.3);
}

.gradient-spinner {
    margin-left: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #FC4E00 0%, 
        #2c6e49 30%,
        #4c956c 70%,
        #FC4E00 100%
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff 0);
    animation: rotateGradient 1.0s linear infinite;
    display: none;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tab-btn i {
    margin-right: 2px;
    font-size: 13px;
}

/* ===== RESPONSIVE MEDIA QUERIES ===== */

@media (min-width: 1025px) and (max-width: 1440px) {
    .data-table {
        font-size: 0.9rem !important;
    }
    
    .data-table th,
    .data-table td {
        padding: 5px !important;
    }
    
    .data-table thead th {
        font-size: 0.85rem !important;
        padding: 6px !important;
    }
    
    .tab-btn {
        font-size: 0.85rem;
        padding: 4px 3px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .btn i {
        font-size: 0.9rem;
    }
    .table-container {
        max-height: 65vh;
    }
}

/* Tablets & Small Screens (max-width: 1024px) */
@media (max-width: 1024px) {
    .table-container {
        max-height: 65vh;
    }
    
    .main-container {
        margin-top: 120px;
    }
    
    .tabs-container {
        top: 90px;
    }
}

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
    /* 1. Réduction Header */
    header {
        padding: 2px 0;
    }

    .logo {
        width: 35px; 
        height: 35px;
    }

    .logo i {
        font-size: 18px;
    }

    .logo-text h1 {
        font-size: 1.2rem;
    }

    .logo-text span {
        font-size: 0.75rem;
    }

    .header-content {
        gap: 5px;
    }

    /* 2. Ajustement positions */
    .main-container {
        margin-top: 100px; /* Ajusté (Header ~60 + Tabs ~40) */
        padding: 8px;
    }
    
    .tabs-container {
        top: 65px; /* Ajusté */
        height: auto; /* Permet d'adapter la hauteur */
        min-height: 45px; /* Hauteur minimum pour les boutons */
    }
    
    /* 3. Grilles Dashboard (1 par ligne) */
    .dashboard-visual,
    .dashboard-visual2 {
        grid-template-columns: 1fr !important;
    }
    
    .charts-container {
        grid-template-columns: 1fr !important;
    }

    .header-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .logo-container {
        justify-content: center;
        gap: 8px;
    }
    
    .user-info {
        justify-content: center;
        width: 100%;
        font-size: 0.85rem;
    }
    
    .site-selector-container {
        margin-left: 0;
        margin-top: 5px;
        padding: 4px 10px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .tab-header-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header-controls-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .year-selector {
        width: 100%;
        justify-content: center;
        padding: 6px;
	z-index: 2001;
    }
    
    .kpi-status-chart {
        flex-direction: row;
        height: auto;
        gap: 20px;
        justify-content: center;
    }
    
    .status-circle {
        width: 90px;
        height: 90px;
        font-size: 1.5rem;
    }
    
    .col-medium {
        min-width: 180px;
    }
    
    .col-medium2 {
        min-width: 150px;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
    .dashboard-header,
    .tab-header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .year-selector {
        width: 100%;
        justify-content: space-between;
        padding: 6px 10px;
        box-shadow: none;
        border: 1px solid #ddd;
        background: #f9fafb;
        order: 2; /* passe sous le titre */
    }

    .year-selector label {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .year-selector select,
    #dashboard-year {
        width: 100%;
        font-size: 0.95rem;
        padding: 6px 10px;
    }
}

/* Mobile Phones (max-width: 480px) */
@media (max-width: 480px) {
    /* Header compact */
    header {
        padding: 2px 0;
    }

    .logo {
        width: 30px; 
        height: 30px;
    }

    .logo-text h1 {
        font-size: 1.1rem;
    }
    
    .logo-text span {
        display: none; 
    }

    /* Ajustement layout principal */
    .main-container {
        margin-top: 115px; /* Header (60) + Tabs (50) + 5 gap */
        padding: 4px;
    }
    
    /* CORRECTION: Hauteur des onglets augmentée et centrage */
    .tabs-container {
        top: 60px; 
        height: 50px; /* Augmenté de 35px à 50px */
        min-height: 50px;
    }

    .tabs-header {
        height: 100%; /* Remplir le conteneur */
        align-items: center; /* Centrage vertical des boutons */
    }
    
    .tab-btn {
        padding: 10px 15px; /* Plus grand padding pour toucher et visibilité */
        font-size: 0.85rem;
        height: auto; /* Laisser le padding définir la hauteur */
        border: none;
    }
    
    #main-header {
        padding-bottom: 2px;
    }
    
    .logo i {
        font-size: 16px;
    }
    
    .user-info {
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 4px 2px !important;
    }
    
    .col-medium,
    .col-medium2 {
        min-width: 120px;
        max-width: 180px;
    }
    
    .col-small,
    .col-small2 {
        min-width: 40px;
        max-width: 50px;
        padding: 2px !important;
    }
    
    .modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 5px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .tabs-header {
        justify-content: flex-start;
    }
    
    .kpi-status-chart {
        flex-direction: column;
        gap: 15px;
    }
    
    .status-circle {
        width: 70px;
        height: 70px;
        font-size: 1.2rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 8px 10px;
    }
    
    .search-container {
        min-width: 100%;
    }
    
    .dashboard-visual, 
    .dashboard-visual2,
    .charts-container {
        grid-template-columns: 1fr !important;
    }
}

/* Very Small Phones (max-width: 320px) */
@media (max-width: 320px) {
    .logo-text h1 {
        font-size: 1.0rem;
    }
    
    .dashboard-summary {
        gap: 8px;
    }
    
    .summary-card {
        padding: 10px;
    }
    
    .col-medium {
        min-width: 100px;
    }
}

/* Orientation-specific styles */
@media (max-height: 500px) and (orientation: landscape) {
    .main-container {
        margin-top: 70px;
    }
    
    .tabs-container {
        top: 50px;
        height: 30px;
    }
    
    .table-container {
        max-height: 55vh;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* High-resolution displays */
@media (min-resolution: 192dpi) {
    .logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .tabs-header,
    .btn-group,
    .action-buttons,
    .search-container {
        display: none !important;
    }
    
    .main-container {
        margin-top: 0 !important;
    }
    
    #main-header {
        position: static !important;
    }
    
    .tabs-container {
        position: static !important;
    }
    
    .data-table {
        font-size: 10pt;
    }
    
    .stat-card,
    .summary-card,
    .visual-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ===== AMÉLIORATION DE LA VISIBILITÉ DES EN-TÊTES FIXES ===== */
.table-container thead th {
    background-color: var(--primary) !important;
    color: white;
    padding: 8px !important;
    border-bottom: 2px solid #1a4d2e !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== INDICATEUR DE DÉFILEMENT POUR LES TABLEAUX ===== */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== ANIMATION DE CHARGEMENT POUR LES TABLEAUX ===== */
.table-loading {
    position: relative;
    opacity: 0.7;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}