/* Conteneur pour centrer la barre de progression */
.progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
/* Filtres OG/Vino deux par ligne */
.filters-row .col-6 {
    min-width: 0;
}
/* Overlay de chargement pour filtres OG/Vino */
#filtersLoadingOverlayOG,
#filtersLoadingOverlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10;
    border-radius: 16px;
    transition: opacity 0.5s ease;
}
/* =========================
   VARIABLES GLOBALES
   ========================= */
:root {
    --primary-blue: #3498db;
    --accent-orange: #FF9800;
    --accent-green: #27ae60;
    --accent-turquoise: #1abc9c;
    --danger-red: #e74c3c;

    --light-gray: #F5F5F5;
    --medium-gray: #E0E0E0;
    --dark-gray: #212121;
    --white: #FFFFFF;

    --main-bg: #1b2330;
    --card-bg: #f5f6fa;
    --header-bg: #233046;

    --text-dark: #212121;
    --text-light: #f5f6fa;
}

/* =========================
   BASE / LAYOUT
   ========================= */

html,
body {
    height: 100%;
    margin: 0;
    font-family: 'Open Sans', 'Roboto', 'Montserrat', Arial, sans-serif;
    background: var(--main-bg);
    color: var(--text-light);
    overflow-x: hidden;
}

body {
    /* si tu veux un fond clair au lieu du dark, remplace par background: #f0f0f0; */
}

/* Header / Navbar */

.header,
.navbar {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(35, 48, 70, 0.08);
}

/* Boutons génériques */

button {
    background-color: #1A1263;
    color: #ffffff;
    font-style: italic;
    font-weight: normal;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

button:hover {
    background-color: #1A1263;
    color: #ffffff;
    font-style: italic;
}

button.active {
    background-color: #1A1263;
    font-style: italic;
    color: #ffffff;
    cursor: pointer;
}

button.disabled {
    background-color: #f1f1f1;
    color: gray;
    font-style: normal;
    cursor: not-allowed;
}

/* Boutons Bootstrap-like */

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-accent {
    background: var(--accent-orange);
    color: var(--white);
}

/* Liens */

a {
    color: var(--primary-blue);
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-turquoise);
}

/* Alertes */

.alert-success {
    background: var(--accent-green);
    color: var(--text-light);
}

.alert-danger {
    background: var(--danger-red);
    color: var(--text-light);
}

/* =========================
   CARTES / DASHBOARD
   ========================= */

.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(26, 35, 126, 0.08);
    border: 1px solid var(--medium-gray);
}

/* Header des cards (gradient bleu) */
.card-header {
    background: linear-gradient(90deg, #3498db 0%, #233046 100%);
    color: var(--text-light);
    font-weight: bold;
    border-bottom: 3px solid #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.12);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    letter-spacing: 0.5px;
}

/* Cartes de stats / dashboard */


/* Equal height for dashboard cards */
.scrappy-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 1rem;
}

.scrappy-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
}

.dashboard-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.stat-card {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card .value {
    color: var(--primary-blue);
    font-weight: 700;
}

.stat-card .label {
    color: var(--text-dark);
    opacity: 0.7;
}

.stat-card .text-danger {
    color: var(--danger-red);
}

/* Fond des blocs adouci (optionnel, à appliquer via une classe si besoin) */
/*
.some-block-class {
    background: #f5f7fb;
    color: #212121;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(35, 48, 70, 0.08);
    border: 1.5px solid #e0e4ea;
}
*/

/* =========================
   HEADER OG + TABS "FINAL | ERREUR"
   ========================= */

/* Tabs type Bootstrap nav-tabs (si utilisés ailleurs) */
.nav-tabs .nav-link {
    background: #f5f6fa !important;
    color: #212121 !important;
    border: 1px solid #e0e0e0;
    opacity: 1;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.nav-tabs .nav-link.active {
    background: #232b3a !important;
    color: #f5f6fa !important;
    font-weight: bold;
    border-bottom: 3px solid #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.08);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    letter-spacing: 0.5px;
}

/* Onglet custom "Final | Erreur" */

.tab-txt {
    padding: 0.25rem 0.9rem;
    border-radius: 24px;
    color: #b0b0b0;
    font-weight: 500;
    opacity: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    white-space: nowrap;
    background: none;
    border: none;
}

/* Actif */
.tab-txt.tab-active {
    color: #fff !important;
    background: #232b3a !important;
    font-weight: bold;
    opacity: 1 !important;
    border: none;
}

/* Inactif grisé (si tu ajoutes cette classe en JS) */
.tab-txt.tab-txt-inactive {
    color: #212121 !important;
    background: none !important;
    font-weight: 500 !important;
    opacity: 0.3 !important;
    border: none;
    transition: background 0.2s, color 0.2s;
}

/* Ancien système d’onglets horizontaux (tab / tabs / #tab_2) */

.tabs {
    display: flex;
    justify-content: space-between;
}

.tab {
    width: 45%;
    text-align: center;
    padding: 10px;
    background-color: #f1f1f1;
    font-weight: bold;
    font-style: normal;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    color: rgba(117, 117, 117, 0.777);
}

#tab_2 {
    width: 80%;
    min-width: 200px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    background-color: #f1f1f1;
    font-weight: bold;
    font-style: normal;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    color: rgba(117, 117, 117, 0.777);
}

.tab.active,
#tab_2.active {
    background-color: #1A1263;
    color: #ffffff;
    font-weight: bold;
    font-style: italic;
}

/* =========================
   PROGRESS / SPINNER
   ========================= */

.icon-large {
    font-size: 2.5rem !important;
}

.spinner-large {
    width: 3rem !important;
    height: 3rem !important;
}

/* Variante large du composant progress */
.progress-large {
    max-width: 400px !important;
    height: 25px !important;
}

/* Fond pour toutes les barres de progression */
.progress {
    width: 100%;
    min-width: 200px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    height: 20px;
    background-color: #f3f3f3;
    border-radius: 10px;
    overflow: hidden;
    align-content: center;
}

/* Remplissage de la barre */
.progress-bar {
    height: 100%;
    background-color: #4caf50;
    text-align: center;
    line-height: 20px;
    color: white;
    width: 100%;
}

/* Variante Bootstrap-like */
.progress.bootstrap-like {
    background-color: var(--medium-gray);
}

/* =========================
   CONTENU / TABLES / PAGINATION
   ========================= */

.content {
    display: none;
    position: relative;
    padding-bottom: 60px; /* espace pour pagination */
}

/* Tableaux */

#data-table-container,
#errors-table-container {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #ffffff;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ccc;
    table-layout: fixed;
}

th,
td {
    width: 200px;
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
    word-wrap: break-word;
    white-space: nowrap;
    overflow: hidden;
    background: #f9f9f9;
    color: var(--dark-gray);
}

th {
    position: relative;
    background: #f1f1f1;
    cursor: pointer;
}

th:hover {
    background-color: #f0f0f0;
}

tr:hover {
    background-color: #f9f9f9;
}

/* Pagination */

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination span {
    padding: 8px 15px;
    color: #666;
}

.pagination button {
    padding: 8px 15px;
    color: #212121 !important;
    background: #f9f9f9 !important;
    font-weight: 500;
    opacity: 0.5 !important;
    transition: background 0.2s, color 0.2s;
}

.pagination button:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.pagination button.active {
    background-color: #1A1263;
    color: #ffffff;
    border-color: #1A1263;
    opacity: 1 !important;
}

.pagination button:hover:not(:disabled) {
    background-color: #1A1263;
    color: #ffffff;
}

/* =========================
   UPLOAD / LISTES / DIVERS
   ========================= */

.upload-section {
    margin-top: 20px;
    text-align: center;
}

.upload-section button {
    margin-left: 50px;
}

.divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #ccc;
}

/* Listes de documents */

#documents-list {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 5px;
    list-style: none;
    margin: 0;
}

#documents-list li {
    padding: 3px 0;
}

/* Pagination custom data */

#data-pagination {
    margin-bottom: 20px;
    text-align: center;
}

/* Export boutons */

#database .export-buttons,
#database_errors .export-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

/* Resize handle pour colonnes */

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: ew-resize;
}

/* Test direct : centrage absolu des onglets */

.card-header.og-header {
    position: relative !important;
}

.card-header.og-header .og-header-center {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.card-header.og-header .og-header-left {
    flex: 0 0 auto;
}

.card-header.og-header .og-header-right {
    flex: 0 0 auto;
    margin-left: auto;
}