/* * KORRIGEO UI FRAMEWORK - v1.1
 * Design System Complet : Couleurs, Typographie, Formulaires, Responsive
 */

/* --- 1. TYPOGRAPHIE --- */
/* Montserrat est chargé via Google Fonts dans le HTML */

/* --- 2. VARIABLES DE DESIGN --- */
:root {
    /* Couleurs de Marque */
    --primary: #0F5A63;
    --secondary: #2F6EA6;
    --text: #002B30;
    --bg-app: #F7FAFB;
    
    /* Palette Étendue */
    --deep: #0F5A63;
    --kelp: #2F6EA6;
    --sand: #E6DCCF;
    --seafoam: #7FCED6;

    /* États & Feedback */
    --success: #2F7D6C;
    --info: #2C8E9B;
    --warning: #E8B351;
    --danger: #C84B4B;

    /* Ombres (Box Concepts) */
    --shadow-flat: 0 2px 4px rgba(0, 43, 48, 0.05);
    --shadow-raised: 0 10px 20px rgba(0, 43, 48, 0.08);
    --shadow-overlay: 0 15px 35px rgba(0, 43, 48, 0.12);

    /* Dimensions */
    --sidebar-width: 280px;
    --header-height: 64px;
    --radius: 12px;
}

/* --- 3. BASE & RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-app);
    color: var(--text);
    overflow: hidden;
}

/* --- 4. LAYOUT APPLICATIF --- */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid rgba(0, 43, 48, 0.08);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-logo {
    width: 100%;
    margin-bottom: 3rem;
    text-align: center;
}

.sidebar-logo img {
    max-width: 180px;
    height: auto;
}

/* Contenu Principal */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Header Mobile */
.mobile-header {
    display: none;
    height: var(--header-height);
    background: white;
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 43, 48, 0.08);
    flex-shrink: 0;
}

/* --- 5. COMPOSANTS UI --- */

/* Navigation */
.nav-link {
    text-decoration: none;
    color: var(--text);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: 0.2s ease;
    cursor: pointer;
}
.nav-link:hover, .nav-link.active {
    background: #F0F4F5;
    color: var(--primary);
}

/* Cartes */
.card { background: white; border-radius: var(--radius); padding: 1.5rem; }
.card-flat { border: 1px solid #EEF2F3; box-shadow: var(--shadow-flat); }
.card-raised { box-shadow: var(--shadow-raised); }
.card-overlay { box-shadow: var(--shadow-overlay); }

/* Boutons */
.btn {
    padding: 1rem 1.6rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.6rem 1rem; font-size: 0.8rem; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.98); }

/* --- 6. FORMULAIRES --- */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--deep); }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    outline: none;
    transition: 0.2s;
}
.form-control:focus {
    border-color: var(--seafoam);
    box-shadow: 0 0 0 3px rgba(127, 206, 214, 0.2);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F5A63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* --- 7. PROGRESSION & INDICATEURS --- */
.progress-container {
    width: 100%; background: #EDF2F7; border-radius: 100px; height: 10px;
    overflow: hidden; margin-top: 10px;
}
.progress-bar {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--seafoam));
    border-radius: 100px; transition: width 0.4s ease;
}

.dot {
    height: 10px; width: 10px; border-radius: 50%;
    display: inline-block; position: relative; margin-right: 10px;
}
.dot-pulse::after {
    content: ""; position: absolute; inset: 0;
    background: inherit; border-radius: 50%;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-ring {
    0% { transform: scale(0.95); opacity: 0.7; }
    70% { transform: scale(2.8); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

/* Couleurs Utility */
.bg-success { background: var(--success); }
.bg-danger { background: var(--danger); }
.bg-warning { background: var(--warning); }
.bg-info { background: var(--info); }
.bg-primary { background: var(--primary); }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-primary { color: var(--primary); }

/* --- 8. RESPONSIVE --- */
@media (max-width: 992px) {
    .app-container { flex-direction: column; height: auto; min-height: 100vh; }
    .mobile-header { display: flex; }
    .sidebar {
        position: fixed; left: -100%; top: 0; bottom: 0;
        transition: 0.3s; box-shadow: var(--shadow-overlay); width: 280px;
    }
    .sidebar.active { left: 0; }
    .main-content { padding: 1.5rem; overflow-y: visible; }
    .overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(0, 43, 48, 0.3); z-index: 999;
    }
    .overlay.active { display: block; }
}

/* --- 9. HELPERS SPECIFIQUE STATUS PAGE --- */
.service-icon {
    width: 48px; height: 48px;
    color: var(--primary);
    background: #F0F4F5;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-right: 1rem;
}
.service-icon svg { width: 24px; height: 24px; }

.status-badge {
    display: inline-flex; align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-size: 0.85rem; font-weight: 600;
}
.status-badge.bg-success { color: white; }
.status-badge.bg-warning { color: white; }
.status-badge.bg-danger { color: white; }
.status-badge.bg-info { color: white; }

.timeline-item {
    border-left: 2px solid #E2E8F0;
    padding-left: 1.5rem;
    padding-bottom: 2rem;
    position: relative;
}
.timeline-item:last-child { border-left: none; }
.timeline-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    position: absolute; left: -7px; top: 0;
}

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid #EEF2F3; }
th { font-weight: 600; color: var(--deep); }

.menu-toggle { font-size: 1.5rem; cursor: pointer; color: var(--primary); }

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}
.alert-success { background: #E6FFFA; color: var(--success); border-color: #B2F5EA; }
.alert-danger { background: #FFF5F5; color: var(--danger); border-color: #FED7D7; }