
/* ========================================
   CONFIGURATION GÉNÉRALE
======================================== */

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

body {
    font-family: 'Inter', sans-serif;
    background: #f4f6fa;
    color: #1e293b;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}


/* ========================================
   STRUCTURE PRINCIPALE
======================================== */

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


/* ========================================
   BARRE LATÉRALE
======================================== */

.sidebar {
    width: 255px;
    min-height: 100vh;
    background: #101c36;
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}

.brand {
    margin-bottom: 55px;
}

.brand h2 {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand h2 span {
    color: #4c9aff;
}

.brand p {
    color: #94a3b8;
    font-size: 11px;
    margin-top: 7px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-link {
    text-decoration: none;
    color: #cbd5e1;
    padding: 14px 16px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: #263b60;
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #263b60;
    padding-top: 20px;
}

.sidebar-footer p {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
}

.sidebar-footer span {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
}


/* ========================================
   CONTENU PRINCIPAL
======================================== */

.main-content {
    margin-left: 255px;
    width: calc(100% - 255px);
    padding: 35px;
}

.topbar {
    margin-bottom: 35px;
}

.topbar h1 {
    font-size: 25px;
    font-weight: 800;
    color: #14213d;
}

.topbar p {
    color: #64748b;
    font-size: 13px;
    margin-top: 8px;
}

.content-section {
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 20px;
    color: #14213d;
    font-weight: 700;
}

.section-header p {
    font-size: 13px;
    color: #64748b;
    margin-top: 7px;
}


/* ========================================
   CARTES STATISTIQUES
======================================== */

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

.stat-card {
    background: white;
    border-radius: 13px;
    padding: 25px;
    border: 1px solid #e8edf4;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.03);
}

.stat-info p {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.stat-info h3 {
    color: #14213d;
    font-size: 29px;
    margin-top: 13px;
    font-weight: 800;
}


/* ========================================
   CARTES DE CONTENU
======================================== */

.content-card {
    background: white;
    padding: 25px;
    border-radius: 13px;
    border: 1px solid #e8edf4;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.03);
    margin-bottom: 25px;
}


/* ========================================
   BOUTONS
======================================== */

.primary-button {
    background: #2463eb;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}

.primary-button:hover {
    background: #174cc2;
    transform: translateY(-1px);
}

.secondary-button {
    background: #e9eef6;
    color: #334155;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.secondary-button:hover {
    background: #dce4ef;
}

.delete-button {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 8px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.delete-button:hover {
    background: #fecaca;
}


/* ========================================
   TABLEAUX
======================================== */

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

thead {
    background: #f8fafc;
}

th {
    text-align: left;
    padding: 15px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 16px 15px;
    border-bottom: 1px solid #edf1f6;
    font-size: 13px;
    color: #334155;
}

tbody tr:hover {
    background: #f8fafc;
}

td button {
    margin: 3px;
}



/* ========================================
   BARRE DE RECHERCHE ET FILTRES
======================================== */

.search-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

#document-search {
    flex: 1;
    min-width: 250px;
    max-width: 600px;
    padding: 15px 18px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    background: white;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    transition: 0.2s;
}

#document-search::placeholder {
    color: #94a3b8;
}

#document-search:focus {
    border-color: #2463eb;
    box-shadow: 0 0 0 3px rgba(36, 99, 235, 0.10);
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filters-container select {
    min-width: 160px;
    padding: 14px 15px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    background: white;
    color: #334155;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: 0.2s;
}

.filters-container select:focus {
    border-color: #2463eb;
    box-shadow: 0 0 0 3px rgba(36, 99, 235, 0.10);
}

@media (max-width: 700px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    #document-search {
        max-width: 100%;
        width: 100%;
    }

    .filters-container {
        flex-direction: column;
    }

    .filters-container select {
        width: 100%;
    }
}



/* ========================================
   FENÊTRES MODALES
======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    color: #14213d;
    font-size: 19px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
}

.close-modal:hover {
    color: #dc2626;
}


/* ========================================
   FORMULAIRES
======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 9px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2463eb;
    box-shadow: 0 0 0 3px rgba(36, 99, 235, 0.08);
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 11px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}


/* ========================================
   RESPONSIVE / TABLETTES
======================================== */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 25px;
    }

}


/* ========================================
   RESPONSIVE / MOBILES
======================================== */

@media (max-width: 700px) {

    .sidebar {
        width: 100%;
        min-height: auto;
        height: auto;
        position: relative;
        padding: 18px;
    }

    .app-container {
        flex-direction: column;
    }

    .brand {
        margin-bottom: 20px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-link {
        padding: 10px 12px;
        font-size: 12px;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 20px;
    }

    .topbar h1 {
        font-size: 21px;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-card {
        padding: 15px;
    }

    .modal-content {
        padding: 22px;
    }

}

/* ========================================
   BOUTON MODIFIER
======================================== */

.edit-button {
    background: #dbeafe;
    color: #1d4ed8;
    border: none;
    padding: 8px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: 0.2s;
}

.edit-button:hover {
    background: #bfdbfe;
}

#edit-document-modal {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    z-index: 9999;
    padding: 20px;
}

#edit-document-modal .modal-content {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}


/* ========================================
   IDENTITÉ VISUELLE GEDFLOW
======================================== */

.brand {
    padding: 25px 20px 35px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.brand-symbol {
    color: white;
    font-size: 25px;
    font-weight: 800;
    font-style: normal;
}

.brand-text h2 {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    margin: 0;
}

.brand-text h2 span {
    color: #38bdf8;
}

.brand-text p {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #94a3b8;
    margin: 5px 0 0;
}
