/**
 * ============================================
 * Fichier : /timpo_pro/assets/css/dashboard.css
 * Version : 4.2 PRO
 * Date : 2026-04-02
 * Auteur : Jean‑Yves Le Naour & Copilot
 * Description :
 *   Styles du Dashboard Timpo PRO :
 *     - Header WordPress compatible
 *     - Mode DEMO / FULL
 *     - DataTables
 *     - Filtres premium
 *     - Stats cartes
 *     - Vues (tableau, liste, cartes, calendriers)
 *     - Responsive institutionnel
 * ============================================
 */

/* ============================
   GLOBAL
============================ */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 0;
    color: #2c2c2c;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #1a1a1a;
    text-align: center;
}


/* ============================
   LOGIN PAGE (fusion login.css)
============================ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-panel {
    background: #ffffff;
    padding: 40px 35px;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.08);
    border: 1px solid #e5e5e5;
}

.login-title {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 26px;
    text-align: center;
    color: #004a8f;
}

.login-error {
    background: #ffecec;
    border: 1px solid #c0392b;
    color: #a00;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.login-form label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: #34495e;
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 18px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 14px;
    background: #fafbfc;
}

.btn-primary {
    background: #2980b9;
    color: #fff !important;
    margin-top: 10px;
}

.btn-primary:hover {
    background: #1f6fa1;
}

.btn-demo {
    background: #27ae60;
    color: #fff !important;
    margin-top: 10px;
}

.btn-demo:hover {
    background: #1f8b4d;
}

.login-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: #2980b9;
    text-decoration: none;
}

.login-link:hover {
    text-decoration: underline;
}

.login-separator {
    height: 1px;
    background: #e5e5e5;
    margin: 25px 0;
}


/* ============================
   STATUS BAR (top)
============================ */
.timpo-status-bar {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 14px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-label {
    background: #004a8f;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    margin-right: 8px;
}

/* Boutons de la barre de statut */
.timpo-status-actions .btn {
    margin-left: 10px;
}

/* ============================
   BOUTONS GÉNÉRAUX
============================ */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.18s ease-in-out;
    color: #ffffff !important;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-blue {
    background: #004a8f;
}
.btn-blue:hover {
    background: #003b72;
}

.btn-red {
    background: #d9534f;
}
.btn-red:hover {
    background: #c9302c;
}

.btn-orange {
    background: #ff9800;
}
.btn-orange:hover {
    background: #e68900;
}

.btn-green {
    background: #28a745;
}
.btn-green:hover {
    background: #1e7e34;
}

.btn-secondary {
    background: #6c757d;
}
.btn-secondary:hover {
    background: #565e64;
}

.btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================
   WRAPPER
============================ */
.timpo-dashboard-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px 40px;
}

/* ============================
   BANDEAU PRO (mode démo)
============================ */
.timpo-pro-banner {
    background: #004a8f;
    color: #ffffff;
    padding: 12px 25px;
    text-align: center;
    font-size: 15px;
}

.timpo-pro-banner .banner-link {
    color: #ffdd57;
    font-weight: 600;
    margin-left: 10px;
    text-decoration: underline;
}

/* ============================
   BANDEAU LIMITE (quota)
============================ */
.timpo-limit-banner {
    background: #fef3cd;
    border-bottom: 2px solid #e67e22;
    padding: 8px 20px;
    font-size: 13px;
    color: #7d3800;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.timpo-limit-banner strong {
    color: #c0392b;
}
.timpo-limit-banner a {
    color: #2c3e50;
    font-weight: 700;
    text-decoration: underline;
}

/* ============================
   USER SUMMARY
============================ */
.user-summary {
    text-align: center;
    margin-top: -10px;
    margin-bottom: 25px;
    font-size: 17px;
    color: #333333;
}

.user-status {
    color: #004a8f;
    font-weight: 700;
}

/* ============================
   PANELS (filtres, blocs)
============================ */
.panel {
    background: #ffffff;
    border-radius: 14px;
    padding: 25px 30px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    margin-bottom: 35px;
}

/* ============================
   FILTRES — grille + champs
============================ */
.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 12px;
}

/* Champ de filtre (label + input/select) */
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.filter-field label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2c3e50;
}

/* Inputs / selects des filtres */
.filter-field input[type="date"],
.filter-field select {
    border: 1px solid #b2bec3;
    border-radius: 5px;
    padding: 6px 8px;
    font-size: 13px;
    color: #2c3e50;
    background: #ffffff;
    outline: none;
    height: 32px;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.filter-field input[type="date"]:focus,
.filter-field select:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.15);
}

.filter-field input[readonly] {
    background: #f4f6f8;
    color: #888888;
}

/* Options de filtre (checkbox "un seul jalon") */
.filter-options-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.filter-options-field label.chk {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #444444;
    cursor: pointer;
    white-space: nowrap;
}

/* ============================
   BOUTONS UNIFIÉS (tb-*)
   Utilisés pour les actions du dashboard
============================ */
.tb {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 5px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
    transition: filter 0.12s, transform 0.08s;
}

.tb:hover:not(.tb-disabled) {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.tb-blue {
    background: #2c3e50;
    color: #ffffff;
    border-color: #2c3e50;
}
.tb-gray {
    background: #ecf0f1;
    color: #444444;
    border-color: #cccccc;
}
.tb-green {
    background: #27ae60;
    color: #ffffff;
    border-color: #27ae60;
}
.tb-red {
    background: #c0392b;
    color: #ffffff;
    border-color: #c0392b;
}
.tb-orange {
    background: #e67e22;
    color: #ffffff;
    border-color: #e67e22;
}
.tb-teal {
    background: #0e7490;
    color: #ffffff;
    border-color: #0e7490;
}
.tb-purple {
    background: #8e44ad;
    color: #ffffff;
    border-color: #8e44ad;
}
.tb-disabled {
    background: #dce4ec;
    color: #6c7a89;
    border-color: #b2bec3;
    cursor: not-allowed;
    opacity: 0.75;
    font-style: italic;
}

/* ============================
   LIGNES D’ACTIONS
============================ */
.actions-row {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ============================
   BARRE VUES + RECHERCHE
============================ */
.view-search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Champ de recherche global */
.view-search-input {
    display: flex;
    align-items: center;
    background: #fffbf0;
    border: 2px solid #e67e22;
    border-radius: 5px;
    padding: 3px 10px;
    gap: 5px;
    flex: 1;
    min-width: 180px;
    max-width: 360px;
}

.view-search-input label {
    font-weight: 700;
    color: #e67e22;
    font-size: 12px;
    white-space: nowrap;
}

.view-search-input input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    color: #333333;
}

.view-search-input button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: #aaaaaa;
    padding: 0;
    line-height: 1;
}
.view-search-input button:hover {
    color: #e67e22;
}

/* ============================
   STATS CARDS
============================ */
#stats {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 14px;
    text-align: center;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.stat-label {
    font-size: 13px;
    color: #555555;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 6px;
    color: #004a8f;
}

/* ============================
   STATS — nouvelle grille
============================ */
#stats {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

/* Ligne 2 : min / max / moyenne */
#stats.stats-secondary {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 12px;
}

/* Cartes plus compactes */
.stat-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    border: 1px solid #e5e5e5;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.stat-label {
    font-size: 12px;
    color: #555555;
    letter-spacing: 0.02em;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    margin-top: 4px;
    color: #004a8f;
}



/* ============================
   TABLE / CONTAINER
============================ */
.table-container {
    background: #ffffff;
    border-radius: 14px;
    padding: 25px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

/* DataTables search input */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    padding: 6px;
}

/* Inputs de recherche par colonne */
.col-search {
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #cccccc;
}

/* En-têtes du tableau principal (cohérent avec inline CSS) */
#timpoTable thead tr:first-child th {
    background: #2c3e50;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 10px;
    border-right: 1px solid #3d5166;
    white-space: nowrap;
}

#timpoTable thead tr:first-child th.sorting::after,
#timpoTable thead tr:first-child th.sorting_asc::after,
#timpoTable thead tr:first-child th.sorting_desc::after {
    color: #f39c12;
    opacity: 1;
}

/* Pagination DataTables */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 4px !important;
    padding: 3px 9px !important;
    margin: 0 2px !important;
    font-size: 12px !important;
    border: 1px solid #dddddd !important;
    background: #ffffff !important;
    color: #444444 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #2c3e50 !important;
    color: #ffffff !important;
    border-color: #2c3e50 !important;
    font-weight: 700 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #ecf0f1 !important;
    color: #333333 !important;
    border-color: #bbbbbb !important;
}

.dataTables_info {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #555555;
    margin-top: 6px;
}

/* ============================
   ONBOARDING
============================ */
.onboarding-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 25px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin-bottom: 35px;
}

.onboarding-box h3 {
    margin-top: 0;
    color: #004a8f;
    font-size: 22px;
}

/* ============================
   BANDEAU AVERTISSEMENT NAVIGATEUR
============================ */
.browser-warning {
    background: #ffcc00;
    color: #333333;
    text-align: center;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #e0b800;
    line-height: 1.4;
}

/* ============================
   CHIPS (filtres actifs)
============================ */
.chips-bar {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    background: #e0f0ff;
    border: 1px solid #90c2ff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip .remove-chip {
    cursor: pointer;
    font-weight: bold;
    color: #0077cc;
}

/* ============================
   RESPONSIVE MOBILE
============================ */
@media (max-width: 992px) {
    #stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .timpo-dashboard-wrapper {
        margin-top: 20px;
    }

    /* Status bar en colonne */
    .timpo-status-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .timpo-status-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .timpo-status-actions .btn {
        width: 100%;
    }

    /* Filtres en 2 colonnes */
    .filters-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .filter-field {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
    }

    .filter-options-field {
        flex-basis: 100%;
        margin-top: 4px;
    }

    #stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tb,
    .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .table-container {
        padding: 14px;
    }

    .onboarding-box {
        padding: 20px;
    }

    .timpo-pro-banner {
        font-size: 12px;
        padding: 6px 10px;
        line-height: 1.2;
        white-space: normal;
    }

    .timpo-pro-banner .banner-link {
        margin-left: 4px;
        padding: 2px 6px;
        font-size: 12px;
    }

    .view-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .view-search-input {
        max-width: 100%;
    }
}

/* Options supplémentaires (si utilisées ailleurs) */
@media (max-width: 768px) {
    .filter-options {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .filter-options .options-title {
        font-weight: 600;
        margin-bottom: 2px;
    }

    .filter-options .options-item {
        display: flex;
        align-items: center;
        gap: 6px;
        line-height: 1.3;
    }
}
.tp-user-menu {
    position: absolute;
    top: 18px;
    right: 22px;
    font-family: "Segoe UI", sans-serif;
}

.tp-user-btn {
    background: #fff;
    border: 1px solid #d0d7de;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.tp-user-btn:hover {
    background: #f6f8fa;
}

.tp-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    min-width: 220px;
    z-index: 999;
}

.tp-user-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: #2c3e50;
    text-decoration: none;
}

.tp-user-dropdown a:hover {
    background: #f0f4f8;
}

.tp-user-menu.open .tp-user-dropdown {
    display: block;
}
/* ============================
   MENU UTILISATEUR — VERSION FIXÉE
============================ */

/* Le menu doit suivre le flux dans la barre */
.tp-user-menu {
    position: relative;
    top: 0;
    right: 0;
    font-family: "Segoe UI", sans-serif;
    margin-left: 10px;
}

/* Le bouton doit être bleu comme les autres */
.tp-user-btn {
    background: #004a8f;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.tp-user-btn:hover {
    background: #003b72;
}

/* Dropdown */
.tp-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    min-width: 220px;
    z-index: 999;
}

.tp-user-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: #2c3e50;
    text-decoration: none;
}

.tp-user-dropdown a:hover {
    background: #f0f4f8;
}

.tp-user-menu.open .tp-user-dropdown {
    display: block;
}
