/* Styles CSS pour améliorer l'apparence */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}


.pdf-iframe:hover {
    width: 500px; /* Largeur agrandie au survol */
    height: auto; /* Ajuste automatiquement la hauteur en fonction de la largeur */
    z-index: 10;  /* Met en avant si nécessaire */
    position: relative; /* Assure que l'iframe ne chevauche pas les autres éléments */
}
.iframe-container {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute; /* Ou autre position adaptée */
    z-index: 10;
}

.iframe-container.visible {
    visibility: visible;
    opacity: 1;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    background-color: #626ba5;
    color: white;
    height: 100vh;
    padding-top: 20px;
    padding-left: 20px;
    font-weight:bold;
    transition: transform 0.3s ease;
}
#iframe-preview {
    position: fixed; /* Fixe l'élément par rapport à la fenêtre du navigateur */
    right: 20px;     /* Positionne la div à 20px du bord droit */
    top: 50%;        /* Centre verticalement la div */
    transform: translateY(-50%); /* Ajuste pour que la div soit centrée par rapport à son milieu */
    border: 1px solid #ccc;
    background: white;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 5px;
}.sidebar a {
    display: block;
    color: white;
    padding: 10px;
    text-decoration: none;
}

.sidebar a:hover {
    background-color: #32587e;
}

.sidebar a.active {
    background-color: #4a90e2 !important;
    border-left: 4px solid #ffffff;
    padding-left: 16px;
    font-weight: bold;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}
.partie_droite{
    margin-left: 310px;
    padding: 20px;
}
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    background-color: #626ba5;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1000;
}


#dropzone {
    width: 500px;
    height: 200px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    text-align: center;
    line-height: 200px;
    color: #aaa;
    margin: 20px auto;
}
#dropzone.dragover {
    border-color: #333;
    color: #333;
}
form {
    width: 500px;
    margin: 20px auto;
}
label {
    display: block;
    margin-bottom: 5px;
}
select, input[type="text"], input[type="date"], input[type="number"], input[type="file"] {
    width: calc(100% - 20px);
    padding: 8px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* Style moderne pour les selects */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-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='currentColor' 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 10px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

select:hover {
    border-color: #4a90e2;
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2);
}

select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}
.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
button {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    flex: 1;
    margin: 0 5px;
}
button:hover {
    background-color: #5a6268;
}
#logout-button {
    background-color: #dc3545;
}
#logout-button:hover {
    background-color: #c82333;
}
#confirm-upload-button {
    display: none; /* Cacher par défaut */
    background-color: #28a745;
}
#confirm-upload-button:hover {
    background-color: #218838;
}
.supplier-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.add-supplier-button {
    padding: 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    position: relative;
}
.add-supplier-button:hover {
    background-color: #218838;
}
.tooltip {
    display: block;
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
}
.add-supplier-button:hover + .tooltip {
    visibility: visible;
}
.file-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
    margin: 15px 0;
}

.file-container:hover {
    border-color: #4a90e2;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

/* Style moderne pour l'input file */
.file-container input[type="file"] {
    flex: 1;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    min-height: 50px;
    line-height: 1.5;
}

.file-container input[type="file"]:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.file-container input[type="file"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Style moderne pour le bouton de confirmation */
#confirm-upload-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

#confirm-upload-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

#confirm-upload-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Style pour la checkbox etat */
#etat {
    transform: scale(1.5);
    margin-right: 10px;
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
    }
}

/* Navigation commune */
:root {
    --nav-bg: #172554;
    --nav-bg-soft: #1e3a8a;
    --nav-accent: #60a5fa;
    --nav-text: #f8fafc;
    --nav-muted: #bfdbfe;
}

body {
    display: block;
    min-width: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 5000;
    width: 100%;
    color: var(--nav-text);
    background: linear-gradient(115deg, var(--nav-bg), #1e3a8a 70%, #1d4ed8);
    box-shadow: 0 5px 22px rgba(15, 23, 42, .2);
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    width: min(1500px, 100%);
    min-height: 68px;
    margin: 0 auto;
    padding: 9px 22px;
    box-sizing: border-box;
}

.app-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
}

.app-brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    color: #172554;
    background: white;
    font-size: 1.25rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
}

.app-brand strong, .app-brand small { display: block; }
.app-brand strong { font-size: 1.05rem; letter-spacing: .02em; }
.app-brand small {
    max-width: 160px;
    overflow: hidden;
    color: var(--nav-muted);
    font-size: .72rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-panel {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
}

.nav-links, .nav-actions { display: flex; align-items: center; gap: 5px; }
.copy-number {
    display: inline-flex;
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 0 11px;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 9px;
    color: white;
    background: rgba(255, 255, 255, .08);
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
}
.copy-number:hover, .copy-number.copied { background: rgba(255, 255, 255, .18); }
.nav-link, .nav-more > summary {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 9px;
    color: #dbeafe;
    font-size: .9rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.nav-link:hover, .nav-more > summary:hover, .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, .14);
}
.nav-link.active { box-shadow: inset 0 -2px var(--nav-accent); }

.nav-more { position: relative; }
.nav-more > summary { list-style: none; gap: 5px; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 245px;
    padding: 7px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 16px 35px rgba(15, 23, 42, .2);
}
.nav-dropdown a {
    display: block;
    padding: 10px 11px;
    border-radius: 8px;
    color: #334155;
    font-size: .88rem;
    text-decoration: none;
}
.nav-dropdown a:hover, .nav-dropdown a.active { color: #1d4ed8; background: #eff6ff; }

.structure-switcher {
    display: flex;
    align-items: center;
    gap: 7px;
    width: auto;
    margin: 0;
}
.structure-switcher label { margin: 0; color: var(--nav-muted); font-size: .72rem; }
.structure-switcher select {
    width: 165px;
    height: 38px;
    margin: 0;
    padding: 0 32px 0 10px;
    border: 1px solid rgba(255, 255, 255, .3);
    color: white;
    background-color: rgba(255, 255, 255, .1);
    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='white' stroke-width='2'%3e%3cpolyline points='6,9 12,15 18,9'/%3e%3c/svg%3e");
    box-shadow: none;
}
.structure-switcher select option { color: #172554; background: white; }
.nav-icon-link, .nav-logout {
    display: inline-grid;
    min-height: 38px;
    box-sizing: border-box;
    place-items: center;
    border-radius: 9px;
    color: white;
    text-decoration: none;
}
.nav-icon-link { width: 38px; background: rgba(255,255,255,.12); font-size: 1.25rem; }
.nav-logout { padding: 0 12px; border: 1px solid rgba(255,255,255,.3); font-size: .82rem; font-weight: 650; }
.nav-icon-link:hover, .nav-logout:hover { background: rgba(255,255,255,.2); }
.nav-toggle { display: none; flex: 0 0 auto; margin: 0; }

.partie_droite {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .app-nav { flex-wrap: wrap; gap: 8px; }
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        flex: 0 0 auto;
        margin-left: auto;
        padding: 9px 12px;
        border: 1px solid rgba(255,255,255,.3);
        background: rgba(255,255,255,.1);
    }
    .nav-panel {
        display: none;
        flex: 1 0 100%;
        align-items: stretch;
        padding: 10px 0 7px;
        border-top: 1px solid rgba(255,255,255,.15);
    }
    .nav-panel.is-open { display: flex; }
    .nav-links { flex-wrap: wrap; }
}

@media (max-width: 720px) {
    .app-header { position: sticky; }
    .app-nav { padding: 8px 14px; }
    .nav-panel.is-open, .nav-links, .nav-actions { flex-direction: column; align-items: stretch; }
    .nav-link, .nav-more > summary { justify-content: space-between; }
    .nav-more { position: static; }
    .nav-dropdown { position: static; width: auto; margin: 4px 0; box-shadow: none; }
    .structure-switcher { align-items: stretch; flex-direction: column; }
    .structure-switcher select { width: 100%; }
    .nav-icon-link { display: none; }
    .nav-logout { display: flex; justify-content: center; }
    .partie_droite { width: min(100% - 24px, 1180px); padding-top: 20px; }
    form { max-width: 100%; }
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin: 18px 0 28px;
    padding: 34px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff, #eff6ff);
    box-shadow: 0 12px 35px rgba(15, 23, 42, .08);
}
.dashboard-hero h1 { margin: 5px 0 8px; color: #0f172a; font-size: clamp(1.65rem, 4vw, 2.35rem); }
.dashboard-hero p { max-width: 640px; margin: 0; color: #64748b; line-height: 1.6; }
.eyebrow { color: #2563eb; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.primary-action {
    flex: 0 0 auto;
    padding: 13px 18px;
    border-radius: 10px;
    color: white;
    background: #2563eb;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 7px 18px rgba(37, 99, 235, .25);
}
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dashboard-card {
    display: flex;
    min-height: 155px;
    padding: 22px;
    box-sizing: border-box;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    color: #0f172a;
    background: white;
    text-decoration: none;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .18s ease;
}
.dashboard-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15, 23, 42, .1); }
.dashboard-card .card-icon { margin-bottom: auto; color: #2563eb; font-size: 1.7rem; }
.dashboard-card strong { margin-bottom: 5px; font-size: 1.05rem; }
.dashboard-card small { color: #64748b; line-height: 1.35; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
    .dashboard-hero { align-items: stretch; padding: 24px; flex-direction: column; }
    .primary-action { text-align: center; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Page d'entrée */
.landing-page { overflow-x: hidden; color: #0f172a; background: #f4f7fb; }
.landing-header .app-nav { justify-content: space-between; }
.landing-header-actions { display: flex; align-items: center; gap: 18px; color: #bfdbfe; font-size: .84rem; }
.landing-header-actions a {
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 9px;
    color: white;
    font-weight: 700;
    text-decoration: none;
}
.landing-header-actions a:hover { background: rgba(255,255,255,.12); }
.landing-main { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 60px; }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); align-items: center; gap: 55px; min-height: 370px; }
.landing-intro h1 { max-width: 680px; margin: 9px 0 16px; color: #0f172a; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -.04em; }
.landing-intro > p { max-width: 650px; margin: 0; color: #64748b; font-size: 1.06rem; line-height: 1.7; }
.landing-features { display: flex; flex-wrap: wrap; gap: 9px 22px; margin-top: 25px; color: #334155; font-size: .88rem; font-weight: 650; }
.landing-features span::first-letter { color: #2563eb; }
.access-card { position: relative; padding: 28px; overflow: hidden; border: 1px solid #dbeafe; border-radius: 20px; background: white; box-shadow: 0 18px 45px rgba(30, 64, 175, .12); }
.access-card::before { position: absolute; top: 0; left: 0; width: 100%; height: 5px; content: ''; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.access-card h2 { margin: 0 0 6px; color: #172554; font-size: 1.35rem; }
.access-card > p { margin: 0 0 22px; color: #64748b; font-size: .9rem; }
.access-icon { display: grid; width: 42px; height: 42px; margin-bottom: 17px; place-items: center; border-radius: 12px; color: #1d4ed8; background: #eff6ff; font-size: 1.3rem; }
.landing-access-form { width: 100%; margin: 0; }
.landing-access-form label { color: #334155; font-size: .8rem; font-weight: 750; }
.landing-access-form select { width: 100%; height: 48px; margin: 5px 0 12px; border-color: #cbd5e1; background-color: white; box-sizing: border-box; }
.landing-access-form button { display: flex; width: 100%; min-height: 48px; margin: 0; align-items: center; justify-content: space-between; border-radius: 10px; background: #2563eb; font-weight: 750; }
.landing-access-form button:hover { background: #1d4ed8; }
.access-secondary { display: block; margin-top: 15px; color: #2563eb; font-size: .84rem; font-weight: 650; text-align: center; text-decoration: none; }
.landing-alert { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; color: #991b1b; background: #fef2f2; font-size: .85rem; }
.pending-section { max-width: 100%; margin-top: 35px; padding: 28px; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 20px; background: white; box-shadow: 0 8px 28px rgba(15,23,42,.06); box-sizing: border-box; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 5px 0 0; color: #0f172a; font-size: 1.45rem; }
.pending-summary { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 1px 7px; padding: 9px 13px; border-radius: 10px; background: #f8fafc; }
.pending-summary strong { color: #1e3a8a; font-size: .92rem; text-align: right; }
.pending-summary span { color: #64748b; font-size: .72rem; }
.landing-table-wrap { overflow-x: auto; }
.landing-table { width: 100%; border-collapse: collapse; }
.landing-table th { padding: 10px 12px; color: #64748b; background: #f8fafc; font-size: .72rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.landing-table td { padding: 14px 12px; border-bottom: 1px solid #eef2f7; color: #475569; font-size: .86rem; }
.landing-table tbody tr:last-child td { border-bottom: 0; }
.structure-badge { display: inline-block; max-width: 220px; padding: 5px 8px; overflow: hidden; border-radius: 6px; color: #1e40af; background: #eff6ff; font-size: .72rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.amount-cell { color: #0f172a !important; font-weight: 750; white-space: nowrap; }
.document-link { color: #2563eb; font-weight: 650; text-decoration: none; white-space: nowrap; }
.delete-link { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: #dc2626; background: #fef2f2; font-size: 1.1rem; text-decoration: none; }
.empty-state { padding: 40px 20px; color: #64748b; text-align: center; }
.empty-state > span { display: grid; width: 48px; height: 48px; margin: auto; place-items: center; border-radius: 50%; color: #15803d; background: #f0fdf4; font-weight: 800; }
.empty-state h3 { margin: 13px 0 4px; color: #334155; }
.empty-state p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
    .landing-hero { grid-template-columns: 1fr; gap: 30px; padding-top: 10px; }
    .landing-header-actions span { display: none; }
    .section-heading { align-items: stretch; flex-direction: column; }
    .pending-summary { align-self: flex-start; }
}
@media (max-width: 520px) {
    .landing-main { width: min(100% - 24px, 1180px); padding-top: 30px; }
    .landing-header-actions a { padding: 8px; font-size: .75rem; }
    .landing-intro h1 { font-size: 2.15rem; }
    .access-card, .pending-section { padding: 20px; border-radius: 15px; }
    .landing-features { align-items: flex-start; flex-direction: column; }
    .landing-table, .landing-table tbody, .landing-table tr, .landing-table td { display: block; width: 100%; box-sizing: border-box; }
    .landing-table thead { display: none; }
    .landing-table tr { position: relative; padding: 10px 38px 10px 0; border-bottom: 1px solid #e2e8f0; }
    .landing-table td { padding: 4px 0; border: 0; }
    .landing-table td:last-child { position: absolute; top: 10px; right: 0; width: 28px; }
    .structure-badge { max-width: 100%; }
}
