/* ============================================================================
   FICHIER : style.css
   DESCRIPTION : Feuille de style unifiée pour les vues administration (HJC)
   DATE DE CRÉATION : initiale
   DATE DE MODIFICATION : 2025-07-11
============================================================================ */

/* RESET & BASE ============================================================ */
:root {
    --year-2023-rgb: 139, 176, 188; /* bleu */
    --year-2024-rgb: 116, 198, 116; /* vert */
    --year-2025-rgb: 255, 165, 0;   /* orange */
    --col1-rgb: 90, 90, 90;         /* gris foncé */
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', sans-serif;
    background-color: #f3f4f6;
    color: #1e293b;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: left;
}

/* Fix bug checkbox switch mode 100% width au clic ------------------------ */
label[for="mode-checkbox"] {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
}

#mode-checkbox {
    margin: 0;
    width: auto;
    flex-shrink: 0;
}

/* HEADER / NAVIGATION ===================================================== */
header {
    width: 100%;
    background-color: #1f2c58;
    color: white;
    padding: 0.4rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header nav a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
}

header nav a:hover {
    text-decoration: underline;
}

/* MENU PRINCIPAL */
.main-menu {
    background-color: #f0f0f0;
    border-bottom: 1px solid #ccc;
}

.menu-links {
    display: flex;
    justify-content: center;
    height: 40px;
}

.menu-links a,
.dropdown > a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    background-color: #eaeaea;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    height: 100%;
    border-right: 1px solid #ccc;
}

.menu-links a:hover,
.dropdown-content a:hover {
    background-color: #95d3ff;
}

.menu-links a.active {
    background-color: #0077cc;
    color: white;
    font-weight: bold;
}

/* DROPDOWN */
.dropdown {
    position: relative;
    flex: 1;
    display: flex;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    min-width: 160px;
    z-index: 100;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.dropdown-content a {
    padding: 0.5rem 1rem;
    text-align: left;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.dropdown:hover .dropdown-content {
    display: flex;
}

/* MAIN & PAGE ============================================================ */
main {
    flex: 1;
    padding: 0.3rem 2rem;
    width: 100%;
}

.titre-page,
.week-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .3rem;
}

.week-nav-buttons {
    display: flex;
    gap: 10px;
}

.date-nav {
    display: flex;
    flex-direction: row;
}

.user-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.dashboard main {
    max-width: 100%;
    margin: 0;
}

.inline-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap; /* utile sur petits écrans */
}

.form-inline-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

/* TABLEAUX =============================================================== */
/* ---------- COULEURS DE FOND (THEAD + TFOOT) ---------- */
/* ----- En-tête (THEAD) et pied de tableau (TFOOT) par année ----- */
.synt-table thead .year-2023,
.synt-table tfoot .year-2023 {
    background-color: rgb(var(--year-2023-rgb));
}

.synt-table thead .year-2024,
.synt-table tfoot .year-2024 {
    background-color: rgb(var(--year-2024-rgb));
}

.synt-table thead .year-2025,
.synt-table tfoot .year-2025 {
    background-color: rgb(var(--year-2025-rgb));
}

/* ----- Corps du tableau (TBODY) avec transparence ----- */
.synt-table tbody .year-2023 {
    background-color: rgba(var(--year-2023-rgb), 0.25);
}

.synt-table tbody .year-2024 {
    background-color: rgba(var(--year-2024-rgb), 0.25);
}

.synt-table tbody .year-2025 {
    background-color: rgba(var(--year-2025-rgb), 0.25);
}

/* ----- Colonne de gauche (thead, tbody, tfoot) : autre couleur + opaque dans thead/tfoot ----- */
.synt-table thead .col1,
.synt-table tfoot .col1 {
    background-color: rgb(var(--col1-rgb));
    color: white;
    font-weight: bold;
}

.synt-table tbody .col1 {
    background-color: rgba(var(--col1-rgb), 0.15);
}

.table-container {
    height: calc(100vh - 220px);
    overflow-y: auto;
    border: 1px solid #ccc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: white;
}

.synt-table {
    width: 100%;
    border-spacing: 0;
    table-layout: fixed;
}

.synt-table thead th {
    background-color: #1f2c58;
    color: #fff;
    font-weight: bold;
}

.synt-table th,
.synt-table td {
    padding: 6px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 14px;
    word-wrap: break-word;
}

/* Première ligne du header */
.synt-table thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 30;
}

/* Deuxième ligne du header */
.synt-table thead tr:nth-child(2) th {
    position: sticky;
    top: 29px;
    z-index: 20;
}

.synt-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}



/* Style global du tfoot */
.synt-table tfoot th,
.synt-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 15;
    font-weight: bold;
    color: #fff;
    border-top: 2px solid #ccc;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.admin-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    margin: 0 auto;
}

.admin-table th,
.admin-table td {
    padding: 0.3rem;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table td {
    background-color: #ffffff;
    font-size: 0.8rem;
}

.admin-table thead,
.TotalTTC td {
    background-color: #1f2c58;
    color: white;
    font-weight: bold;
}

.admin-table tr:hover td {
    background-color: #dbeafe;
    border-color: #fff;
}

.admin-table td.center,
.admin-table th.center,
.admin-table td.actions,
.admin-table th.actions {
    text-align: center;
}

.admin-table td.actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.admin-table td[contenteditable] {
    background-color: #ffffff;
    cursor: text;
}

.admin-table input[type="text"],
.admin-table input[type="email"],
.admin-table input[type="number"],
.admin-table select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.admin-table button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.admin-table .total-row td,
.TotalTVA td,
.TotalHT td,
.totaux {
    font-weight: bolder;
    background-color: #bce1fb;
}

.admin-table .separateur {
    height: 5px;
    background-color: transparent;
    pointer-events: none;
}

/* STYLES SPÉCIAUX ======================================================== */
.btn_modif {
    color: #1f2c58;
    max-width: 100px;
    width: 100%;
}

.locked {
    color: #999;
    font-size: 1.2em;
    cursor: not-allowed;
}

td a {
    text-decoration: none;
    color: black;
}

/* ANIMATIONS & FLASHS ==================================================== */
.flash-inserted {
    animation: highlightRow 1.2s ease-in-out;
    background-color: #e0ffe0 !important;
}

.flash-inserted td[contenteditable] {
    background-color: inherit !important;
}

.flash-inserted td {
    transition: background-color 1s ease;
}

@keyframes highlightRow {
    0%   { background-color: #c8f7c5; }
    50%  { background-color: #e0ffe0; }
    100% { background-color: transparent; }
}

.flash-message {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    max-width: 80%;
    width: fit-content;
    opacity: 1;
    animation: fadeOutFlash 3s forwards;
}

.flash-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.flash-error {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

@keyframes fadeOutFlash {
    0%   { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* FORMULAIRES & BOUTONS ================================================== */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="email"],
input[type="password"],
input:focus,
select:focus {
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    width: 100%;
    outline: 2px solid #4CAF50;
    box-shadow: 0 0 5px #4CAF50;
    transition: all 0.2s ease-in-out;
}

select {
    padding: 0.4rem 0.6rem;
}

button,
.admin-form .btn {
    padding: 0.75rem;
    font-size: 1rem;
    background-color: #3b82f6;
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover,
.admin-form .btn:hover {
    background-color: #2563eb;
}

.switch-vue {
    text-align: right;
    margin-bottom: 1em;
}

.switch-vue .btn-small {
    padding: 4px 8px;
    font-size: 0.9em;
}

.synthese-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5em;
}

.synthese-header h1 {
    margin: 0;
    font-size: 1.6em;
    font-weight: bold;
}

.export-form {
    display: flex;
    justify-content: flex-end;
}

.export-form .btn {
    padding: 4px 12px;
    background: none;
    border: 1px solid #aaa;
    cursor: pointer;
}

.export-form .btn:hover {
    background-color: #bbbbbb;
}
/* ONGLET */
.onglets-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.onglet-btn {
    padding: 0.5rem 3rem;
    font-size: 1.2rem;
    border: 2px solid #ccc;
    border-radius: 30px;
    background-color: #f9f9f9;
    cursor: pointer;
    color: #333;
    min-width: 200px;
    text-align: center;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

.onglet-btn:hover {
    background-color: #eee;
    border-color: #999;
}

.onglet-actif {
    border-color: #208bfe;
    color: #1f2c58;
    background-color: white;
    font-weight: bold;
    box-shadow: 0 0px 10px rgba(51, 146, 255, 0.866);
    transform: scale(1.02);
}

/* PROFIL ================================================================ */
.profile-box {
    max-width: 500px;
    margin: 3rem auto;
    background: #fff;
    padding: 2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.profile-box h1,
.profile-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-box form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-box input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.profile-box button {
    background-color: #0077cc;
}

.profile-box button:hover {
    background-color: #005fa3;
}

.profile-box hr {
    margin: 2rem 0;
}

/* COLONNES D'ADMIN ====================================================== */
.admin-columns {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.admin-col-left,
.admin-col-right {
    width: 48%;
    min-width: 300px;
}

.white-box {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

.box-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 12px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
}

.admin-form .form-group {
    margin-bottom: 12px;
}

.admin-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
}

.admin-form textarea {
    resize: vertical;
}

/* FOOTER ================================================================ */
footer {
    width: 100%;
    background-color: #1e293b;
    color: white;
    text-align: center;
    padding: 0.5rem;
    position: relative;
    bottom: 0;
}

/* =======================================
   Styles généraux pour tous les inputs
   ======================================= */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: #fff;
    box-sizing: border-box;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #4CAF50;
    box-shadow: 0 0 5px #4CAF50;
    transition: all 0.2s ease-in-out;
}