* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #222;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.logo {
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 25px;
}

.logo span {
    color: #e30613;
}

h1 {
    text-align: center;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

label {
    display: block;
    margin-top: 18px;
    margin-bottom: 7px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 13px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

input:focus {
    outline: none;
    border-color: #555;
}

button {
    width: 100%;
    margin-top: 25px;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #222;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #000;
}

#login-message {
    min-height: 20px;
    margin-top: 18px;
    text-align: center;
    font-size: 14px;
}

/* =========================================================
   APPLICATION
   ========================================================= */

.hidden {
    display: none !important;
}

.app-page {
    min-height: 100vh;
    background: #f4f6f8;
}

.app-header {
    background: white;
    padding: 18px 25px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #e5e5e5;
}

.app-logo {
    font-size: 24px;
    font-weight: bold;
}

.app-logo span {
    color: #e30613;
}

.app-name {
    margin: 3px 0 0 0;
    color: #777;
    font-size: 13px;
}

.logout-button {
    width: auto;
    margin: 0;
    padding: 10px 15px;

    background: #f1f1f1;
    color: #333;

    font-size: 14px;
}

.logout-button:hover {
    background: #e5e5e5;
}


/* BIENVENUE */

.welcome {
    max-width: 900px;
    margin: 0 auto;
    padding: 45px 25px 25px;
}

.welcome-small {
    margin: 0;
    color: #777;
    font-size: 16px;
}

.welcome h1 {
    text-align: left;
    margin: 5px 0 12px;
    font-size: 32px;
}

.role-badge {
    display: inline-block;

    padding: 6px 12px;

    background: #eeeeee;
    border-radius: 20px;

    font-size: 13px;
    font-weight: 600;
}


/* MENU */

.menu-grid {
    max-width: 900px;
    margin: 0 auto;

    padding: 15px 25px 40px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.menu-card {
    margin: 0;
    width: 100%;
    min-height: 180px;

    padding: 25px;

    background: white;
    color: #222;

    border: 1px solid #e5e5e5;
    border-radius: 14px;

    text-align: left;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.menu-card:hover {
    background: white;
    border-color: #bbb;
}

.menu-icon {
    font-size: 30px;
    margin-bottom: 20px;
}

.menu-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 7px;
}

.menu-description {
    color: #777;
    font-size: 14px;
    line-height: 1.4;
}


/* RESPONSABLE */

.responsable-card {
    border-left: 4px solid #e30613;
}


/* MOBILE */

@media (max-width: 650px) {

    .app-header {
        padding: 15px 18px;
    }

    .welcome {
        padding: 30px 20px 20px;
    }

    .welcome h1 {
        font-size: 27px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        padding: 10px 20px 30px;
    }

    .menu-card {
        min-height: 150px;
    }
}

/* =========================================================
   POINTAGE - CHOIX DU CONTEXTE
   ========================================================= */

.pointage-help {
    margin-top: 5px;
    color: #777;
}

.context-grid {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px 25px 40px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.context-card {
    margin: 0;
    min-height: 230px;
    padding: 25px;

    background: white;
    color: #222;

    border: 2px solid transparent;
    border-radius: 14px;

    text-align: left;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);

    transition: 0.15s;
}

.context-card:hover {
    background: white;
    border-color: #e30613;
    transform: translateY(-2px);
}

.context-icon {
    font-size: 34px;
    margin-bottom: 20px;
}

.context-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.context-description {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 18px;
}

.context-info {
    margin-top: auto;

    font-size: 12px;
    line-height: 1.4;
    color: #888;
}


/* MOBILE */

@media (max-width: 750px) {

    .context-grid {
        grid-template-columns: 1fr;
        padding: 10px 20px 30px;
    }

    .context-card {
        min-height: 180px;
    }
}

/* =========================================================
   JOURNÉE EN COURS
   ========================================================= */

.working-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 25px;
}

.working-status {
    display: flex;
    align-items: center;
    gap: 9px;

    font-size: 14px;
    font-weight: 600;

    margin-bottom: 15px;
}

.status-dot {
    width: 10px;
    height: 10px;

    background: #2e9d50;
    border-radius: 50%;
}

.working-container h1 {
    text-align: left;
    font-size: 32px;

    margin: 0 0 8px;
}

.working-since {
    margin: 0;
    color: #666;
}

.working-duration {
    margin-top: 35px;
    padding: 30px;

    background: white;

    border-radius: 14px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);

    display: flex;
    flex-direction: column;

    text-align: center;
}

.duration-label {
    color: #777;
    font-size: 13px;

    margin-bottom: 8px;
}

#working-duration {
    font-size: 36px;
}

.working-actions {
    margin-top: 25px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.working-actions button {
    margin: 0;
}

.action-secondary {
    background: #eeeeee;
    color: #222;
}

.action-secondary:hover {
    background: #dddddd;
}

.action-danger {
    background: #e30613;
}

.action-danger:hover {
    background: #c9000c;
}


@media (max-width: 600px) {

    .working-container {
        padding: 35px 20px;
    }

    .working-actions {
        grid-template-columns: 1fr;
    }
}

.status-dot.paused {
    background: #e99a22;
}

.locations-actions {
    margin-bottom: 24px;
}

.action-primary {
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    background: #222;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.action-primary:hover {
    opacity: 0.9;
}

.locations-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.location-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.location-card h3 {
    margin: 0 0 6px 0;
}

.location-card p {
    margin: 4px 0;
    color: #666;
}

.location-status {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.location-status.active {
    background: #e6f5ea;
    color: #24763b;
}

.location-status.inactive {
    background: #f1f1f1;
    color: #777;
}

.location-form-container {
    margin-bottom: 24px;
}

.location-form-card {
    background: white;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.location-form-card h2 {
    margin-top: 0;
    margin-bottom: 22px;
}

.location-form-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.location-form-card label {
    margin-top: 8px;
    font-weight: 600;
}

.location-form-card input {
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 9px;
    font-size: 1rem;
}

.coordinates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.radius-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radius-input input {
    max-width: 140px;
}

.location-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 600px) {

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

    .location-form-actions {
        flex-direction: column;
    }
}

.location-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.location-toggle-button {
    border: none;
    border-radius: 9px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
}

.location-toggle-button.deactivate {
    background: #f3eeee;
    color: #a33;
}

.location-toggle-button.activate {
    background: #e6f5ea;
    color: #24763b;
}

.location-toggle-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.location-edit-button {
    border: none;
    border-radius: 9px;
    padding: 10px 14px;
    background: #eeeeee;
    color: #333;
    font-weight: 600;
    cursor: pointer;
}

.location-edit-button:hover {
    background: #e2e2e2;
}

/* =========================================
   HISTORIQUE DES POINTAGES
   ========================================= */

.history-list {
    width: 100%;
    max-width: 900px;
    margin: 30px auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.history-date {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.history-context {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.history-description {
    margin-top: 5px;
    font-size: 14px;
    color: #6b7280;
}

.history-hours {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

#history-page .welcome-section {
    text-align: center;
    margin-bottom: 10px;
}

#history-page .home-container {
    padding: 30px 20px 50px 20px;
}

.history-duration {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eeeeee;
    font-size: 15px;
    color: #4b5563;
}

.history-duration strong {
    color: #1f2937;
    font-size: 17px;
}

.history-duration {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.history-pause {
    color: #6b7280;
}

.history-pause strong {
    color: #1f2937;
}

.history-detail-button {
    width: 100%;
    margin-top: 14px;
    padding: 12px 0 0 0;

    border: none;
    border-top: 1px solid #eeeeee;
    background: transparent;

    text-align: left;

    font-size: 14px;
    font-weight: 600;

    color: #4b5563;

    cursor: pointer;
}

.history-detail-button:hover {
    color: #111827;
}

.history-detail-button span {
    margin-left: 5px;
}

.history-detail {
    margin-top: 14px;
    padding: 14px 16px;

    background: #f8f9fa;
    border-radius: 10px;
}

.history-event {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 7px 0;

    font-size: 14px;
    color: #374151;
}

.history-event-icon {
    width: 20px;
    text-align: center;
}

.history-correction-zone {
    margin-top: 14px;
}

.history-correction-button {
    border: none;
    background: transparent;
    padding: 4px 0;

    font-size: 14px;
    font-weight: 600;

    color: #374151;
    cursor: pointer;
}

.history-correction-button:hover {
    color: #e30613;
}

.correction-form {
    margin-top: 10px;
    padding: 18px;

    background: #f8f9fa;
    border-radius: 10px;
}

.correction-form h4 {
    margin: 0 0 18px 0;
    font-size: 17px;
}

.correction-form label {
    display: block;
    margin: 14px 0 6px 0;

    font-size: 14px;
    font-weight: 600;
}

.correction-form select,
.correction-form input,
.correction-form textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 10px 12px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    font-family: inherit;
    font-size: 14px;

    background: white;
}

.correction-form textarea {
    resize: vertical;
}

.correction-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 18px;
}

.correction-actions button {
    padding: 10px 16px;

    border: none;
    border-radius: 8px;

    font-weight: 600;
    cursor: pointer;
}

.correction-cancel-button {
    background: #e5e7eb;
}

.correction-submit-button {
    background: #111827;
    color: white;
}

.history-pending-corrections {
    margin-top: 14px;
}

.history-pending-correction {
    padding: 14px 16px;

    background: #fff8e6;
    border: 1px solid #f3d58a;
    border-radius: 10px;

    font-size: 14px;
    color: #374151;
}

.history-correction-status {
    margin-bottom: 7px;
}

.history-correction-reason {
    margin-top: 5px;
    color: #6b7280;
}

.responsable-time-section {
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
}

.responsable-time-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pending-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 24px;
    height: 24px;

    padding: 0 7px;

    border-radius: 20px;

    background: #e30613;
    color: white;

    font-size: 13px;
}

.responsable-correction-card {
    margin-top: 12px;
    padding: 18px 20px;

    background: white;

    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.responsable-correction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    font-size: 17px;
}

.correction-pending-badge {
    padding: 5px 10px;

    border-radius: 20px;

    background: #fff8e6;
    border: 1px solid #f3d58a;

    font-size: 12px;
    font-weight: 600;
}

.responsable-correction-date {
    margin-top: 6px;

    color: #6b7280;
    font-size: 14px;

    text-transform: capitalize;
}

.responsable-correction-change {
    margin-top: 14px;
    font-size: 15px;
}

.responsable-correction-reason {
    margin-top: 8px;

    color: #4b5563;
    font-size: 14px;
}

.empty-state {
    padding: 20px;

    background: white;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    color: #6b7280;
}

.responsable-correction-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 18px;
    padding-top: 14px;

    border-top: 1px solid #e5e7eb;
}

.responsable-correction-actions button {
    padding: 9px 16px;

    border: none;
    border-radius: 8px;

    font-weight: 600;
    cursor: pointer;
}

.correction-reject-button {
    background: #e5e7eb;
    color: #374151;
}

.correction-approve-button {
    background: #111827;
    color: white;
}

.responsable-correction-actions button:disabled {
    opacity: 0.5;
    cursor: default;
}

/* =========================================
   CORRECTIONS TRAITÉES
   ========================================= */

.history-reviewed-corrections {
    margin-top: 14px;

    display: flex;
    flex-direction: column;
    gap: 10px;
}


.history-reviewed-correction {
    padding: 14px 16px;

    border-radius: 10px;

    font-size: 14px;
    line-height: 1.45;

    color: #374151;
}


/* Correction acceptée */

.history-reviewed-correction.approved {
    background: #edf8f0;
    border: 1px solid #b9dfc3;
}


/* Correction refusée */

.history-reviewed-correction.rejected {
    background: #fff1f1;
    border: 1px solid #efc1c1;
}


/* Titre */

.history-reviewed-correction .history-correction-status {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 7px;
}


/* Informations secondaires */

.history-reviewed-correction .history-correction-reason {
    margin-top: 5px;
    margin-bottom: 7px;

    color: #6b7280;
}

.history-event-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.history-event-content > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-event-correction {
    font-size: 13px;
    color: #2f7d46;
}

.history-event-correction strong {
    color: #246638;
}

/* =========================================
   HISTORIQUE RESPONSABLE
   ========================================= */

#responsable-time-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.responsable-history-card {
    background: white;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    padding: 18px 20px;
}


.responsable-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}


.responsable-history-employee {
    font-size: 17px;
}


.responsable-history-date {
    margin-top: 3px;

    font-size: 13px;
    color: #6b7280;
}


.responsable-history-context {
    margin-top: 14px;

    font-weight: 600;
}


.responsable-history-description {
    margin-top: 3px;

    font-size: 14px;
    color: #6b7280;
}


.responsable-history-hours {
    margin-top: 12px;

    font-size: 16px;
}


.responsable-history-durations {
    display: flex;
    gap: 30px;

    margin-top: 10px;
    padding-top: 10px;

    border-top: 1px solid #e5e7eb;
}


.responsable-history-corrected {
    padding: 5px 9px;

    border-radius: 20px;

    background: #edf8f0;
    border: 1px solid #b9dfc3;

    color: #246638;

    font-size: 12px;
    font-weight: 600;
}

.responsable-history-detail-button {
    width: 100%;

    margin-top: 14px;
    padding: 12px 0 2px;

    border: 0;
    border-top: 1px solid #e5e7eb;

    background: transparent;

    text-align: left;

    font-weight: 600;
    cursor: pointer;
}


.responsable-history-detail-button span {
    margin-left: 6px;
}


.responsable-history-detail {
    margin-top: 14px;
    padding: 14px 16px;

    background: #f8f9fa;
    border-radius: 10px;
}


.responsable-history-event {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 6px 0;
}


.responsable-history-event-icon {
    flex-shrink: 0;
}


.responsable-history-event-correction {
    margin-top: 3px;

    font-size: 13px;
    color: #2f7d46;
}


.responsable-history-event-correction strong {
    color: #246638;
}

.responsable-history-corrections {
    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid #e5e7eb;
}


.responsable-history-corrections-title {
    margin-bottom: 10px;

    font-weight: 700;
}


.responsable-history-correction {
    margin-top: 8px;
    padding: 12px 14px;

    border-radius: 9px;

    font-size: 13px;
    line-height: 1.45;
}


.responsable-history-correction.approved {
    background: #edf8f0;
    border: 1px solid #b9dfc3;
}


.responsable-history-correction.rejected {
    background: #fff1f1;
    border: 1px solid #efc1c1;
}


.responsable-history-correction.pending {
    background: #fff8e8;
    border: 1px solid #f0cf7b;
}


.responsable-history-correction-title {
    margin-bottom: 5px;

    font-weight: 700;
}


.responsable-history-correction-reason {
    margin-top: 3px;

    color: #6b7280;
}


.responsable-history-correction-review,
.responsable-history-correction-comment {
    margin-top: 4px;
}

/* =========================================
   FILTRES HISTORIQUE
   ========================================= */

.history-filters {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        minmax(120px, 0.7fr)
        minmax(220px, 1.5fr)
        auto;

    align-items: end;
    gap: 14px;

    width: 100%;
    max-width: 900px;

    margin: 22px auto;
    padding: 16px 18px;

    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}


.history-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;

    min-width: 0;
}


.history-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}


.history-filter-group input,
.history-filter-group select {
    width: 100%;
    height: 40px;

    padding: 0 10px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: white;
    font: inherit;
}


.history-filter-reset {
    height: 40px;
    padding: 0 16px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #f8f9fa;
    color: #374151;

    font-weight: 600;
    cursor: pointer;

    white-space: nowrap;
}


@media (max-width: 750px) {

    .history-filters {
        grid-template-columns: 1fr 1fr;
    }

    .history-filter-group:nth-child(3) {
        grid-column: 1 / -1;
    }

    .history-filter-reset {
        grid-column: 1 / -1;
    }

}


@media (max-width: 480px) {

    .history-filters {
        grid-template-columns: 1fr;
    }

    .history-filter-group:nth-child(3),
    .history-filter-reset {
        grid-column: auto;
    }

}

/* =========================================
   FILTRES HISTORIQUE RESPONSABLE
   ========================================= */

.responsable-history-filters {
    max-width: 1000px;

    grid-template-columns:
        minmax(180px, 1.3fr)
        minmax(120px, 0.8fr)
        minmax(110px, 0.7fr)
        minmax(180px, 1.2fr)
        auto;
}


/* TABLETTE */

@media (max-width: 900px) {

    .responsable-history-filters {
        grid-template-columns: 1fr 1fr;
    }

    .responsable-history-filters .history-filter-reset {
        grid-column: 1 / -1;
    }

}


/* MOBILE */

@media (max-width: 480px) {

    .responsable-history-filters {
        grid-template-columns: 1fr;
    }

    .responsable-history-filters .history-filter-reset {
        grid-column: auto;
    }

}

/* =========================================
   FILTRES UTILISATEURS
========================================= */

.users-filters {
    display: grid;
    grid-template-columns:
        minmax(250px, 2fr)
        minmax(150px, 0.8fr)
        minmax(150px, 0.8fr)
        auto;
    gap: 16px;
    align-items: end;
    margin: 24px 0;
}

.users-filters .history-filter-field {
    min-width: 0;
}

.users-filters input,
.users-filters select {
    width: 100%;
    box-sizing: border-box;
}

.users-filters .history-filter-reset {
    width: auto;
    min-width: 140px;
}


/* Tablette */

@media (max-width: 900px) {

    .users-filters {
        grid-template-columns: 1fr 1fr;
    }

    .users-filters .history-filter-reset {
        width: 100%;
    }

}


/* Mobile */

@media (max-width: 600px) {

    .users-filters {
        grid-template-columns: 1fr;
    }

}

/* =========================================
   CARTES UTILISATEURS
========================================= */

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 1100px;
    margin: 0 auto;
}

.user-card {
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 12px;
    padding: 18px 20px;
}

.user-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.user-card-main strong {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
}

.user-card-main p {
    margin: 0;
}

.user-manage-button {
    width: auto !important;
    min-width: 100px;
    padding: 10px 18px;
    margin: 0;
    flex-shrink: 0;
}


/* Mobile */

@media (max-width: 600px) {

    .user-card-main {
        align-items: stretch;
        flex-direction: column;
    }

    .user-manage-button {
        width: 100% !important;
    }

}

/* =========================================================
   HARMONISATION GLOBALE CFS49
   ========================================================= */

:root {
    --ui-content: 1100px;
    --ui-surface: #ffffff;
    --ui-border: #e1e5e9;
    --ui-muted: #6b7280;
    --ui-radius: 12px;
    --ui-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Contenu principal commun */
.home-container {
    width: 100%;
    max-width: var(--ui-content);
    margin: 0 auto;
    padding: 34px 24px 55px;
}

/* Titres / introductions des pages */
.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-section h1 {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.2;
}

.welcome-section p {
    margin: 0;
    color: var(--ui-muted);
}

/* Formulaires */
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #777;
}

.location-form-container,
.locations-actions,
.locations-list,
.users-list {
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.location-form-container {
    margin-bottom: 26px;
}

.locations-actions {
    margin-bottom: 26px;
}

.locations-actions .action-primary {
    width: 100%;
    margin: 0;
}

/* Cartes communes */
.location-card,
.user-card,
.history-card,
.responsable-history-card,
.responsable-correction-card,
.empty-state {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

/* Utilisateurs */
.user-card {
    padding: 18px 22px;
}

.user-card-main strong {
    font-size: 17px;
}

.user-card-main p {
    color: #374151;
}

.user-manage-button {
    min-width: 105px;
}

/* Filtres : base commune */
.history-filters,
.users-filters {
    width: 100%;
    margin: 24px auto 30px;
    padding: 18px;
    align-items: end;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

.history-filters {
    max-width: 900px;
}

.responsable-history-filters {
    max-width: 1000px;
}

.users-filters {
    max-width: 900px;
    grid-template-columns:
        minmax(240px, 1.7fr)
        minmax(150px, 0.8fr)
        minmax(150px, 0.8fr)
        auto;
}

.history-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.history-filter-field label,
.users-filters label {
    margin: 0;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
}

.history-filter-field input,
.history-filter-field select,
.users-filters input,
.users-filters select {
    height: 40px;
    margin: 0;
    padding: 0 10px;
}

.history-filter-reset {
    width: auto;
    min-width: 125px;
    margin: 0;
}

/* Historique */
.history-list {
    margin-top: 0;
}

.responsable-time-section {
    max-width: 1000px;
}

/* =========================================================
   EXPORTS - RELEVÉ MENSUEL
   ========================================================= */

#exports-page #exports-content {
    width: 100%;
}

#exports-page .history-filters {
    max-width: 900px;
    grid-template-columns:
        minmax(220px, 1.3fr)
        minmax(160px, 0.8fr)
        minmax(140px, 0.7fr);
}

#exports-page .locations-actions {
    max-width: 900px;
}


/* Bloc du relevé */

#export-preview {
    max-width: 900px;
    margin: 36px auto 0;
}

#export-preview h2 {
    margin: 0 0 18px;
    font-size: 24px;
}


/* Résumé du relevé */

.export-summary-header {
    display: flex;
    align-items: center;
    gap: 12px 24px;
    flex-wrap: wrap;

    margin-bottom: 16px;
    padding: 16px 18px;

    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);

    color: #374151;
}

.export-summary-header strong {
    color: #222;
    font-size: 17px;
}

.export-summary-header span {
    color: var(--ui-muted);
}


/* Tableau */

.export-table-wrapper {
    width: 100%;
    overflow-x: auto;

    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

.export-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.export-table th,
.export-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--ui-border);
}

.export-table th {
    background: #f8f9fa;

    color: #4b5563;
    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;
}

.export-table td {
    color: #374151;
    font-size: 14px;
}

.export-table tbody tr:last-child td {
    border-bottom: none;
}

.export-table td:nth-child(3),
.export-table td:nth-child(4),
.export-table td:nth-child(5),
.export-table td:nth-child(6) {
    white-space: nowrap;
}


/* Total */

.export-table tfoot td {
    padding-top: 16px;
    padding-bottom: 16px;

    background: #f8f9fa;
    border-top: 2px solid var(--ui-border);
    border-bottom: none;

    color: #222;
}

.export-table tfoot td:last-child {
    font-size: 17px;
}


/* Pointage corrigé */

	.export-corrected {
		display: inline-block;

		margin-left: 7px;
		padding: 3px 7px;

		background: #edf8f0;
		border: 1px solid #b9dfc3;
		border-radius: 20px;

		color: #246638;
		font-size: 11px;
		font-weight: 600;
	}

/* Responsive */
@media (max-width: 900px) {

    .users-filters {
        grid-template-columns: 1fr 1fr;
    }

    .users-filters .history-filter-reset {
        grid-column: 1 / -1;
        width: 100%;
    }

    #exports-page .history-filters {
        grid-template-columns: 1fr 1fr;
    }

    #exports-page .history-filter-group:first-child {
        grid-column: 1 / -1;
    }

}

@media (max-width: 650px) {
    .home-container {
        padding: 28px 18px 40px;
    }

    .welcome-section h1 {
        font-size: 27px;
    }

    .users-filters {
        grid-template-columns: 1fr;
    }

    .users-filters .history-filter-reset {
        grid-column: auto;
    }
	
	    #exports-page .history-filters {
        grid-template-columns: 1fr;
    }

    #exports-page .history-filter-group:first-child {
        grid-column: auto;
    }

    .export-summary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    #export-preview h2 {
        font-size: 21px;
    }
}

/* =========================================================
   MODALE GLOBALE CFS49
   ========================================================= */

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(17, 24, 39, 0.48);
    backdrop-filter: blur(2px);
}

.app-modal-dialog {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 440px;

    padding: 30px;

    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 16px;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.18);

    text-align: center;

    animation: app-modal-open 0.18s ease-out;
}

.app-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    margin: 0 auto 18px;

    border-radius: 50%;

    background: #f1f3f5;

    font-size: 24px;
}

.app-modal-dialog h2 {
    margin: 0 0 10px;

    font-size: 22px;
    color: #1f2937;
}

#app-modal-message {
    margin: 0;

    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;

    white-space: pre-line;
}


/* SAISIE */

.app-modal-input-container {
    margin-top: 22px;

    text-align: left;
}

.app-modal-input-container label {
    margin: 0 0 7px;

    font-size: 14px;
    font-weight: 600;
}

.app-modal-input-container input {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #d1d5db;
    border-radius: 9px;

    font-family: inherit;
    font-size: 15px;

    background: #ffffff;
}

.app-modal-input-container input:focus {
    outline: none;
    border-color: #6b7280;

    box-shadow:
        0 0 0 3px rgba(107, 114, 128, 0.12);
}


/* BOUTONS */

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 26px;
}

.app-modal-actions button {
    width: auto;
    min-width: 100px;

    margin: 0;
    padding: 11px 18px;

    border-radius: 9px;

    font-size: 14px;
}

.app-modal-cancel {
    background: #eeeeee;
    color: #374151;
}

.app-modal-cancel:hover {
    background: #e1e1e1;
}

.app-modal-confirm {
    background: #222222;
    color: #ffffff;
}

.app-modal-confirm:hover {
    background: #000000;
}


/* TYPES DE MODALE */

.app-modal.type-success .app-modal-icon {
    background: #e6f5ea;
}

.app-modal.type-error .app-modal-icon {
    background: #fff0f0;
}

.app-modal.type-warning .app-modal-icon {
    background: #fff8e6;
}

.app-modal.type-danger .app-modal-icon {
    background: #fff0f0;
}

.app-modal.type-danger .app-modal-confirm {
    background: #e30613;
}

.app-modal.type-danger .app-modal-confirm:hover {
    background: #c9000c;
}


/* ANIMATION */

@keyframes app-modal-open {

    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* MOBILE */

@media (max-width: 600px) {

    .app-modal {
        padding: 16px;
    }

    .app-modal-dialog {
        padding: 24px 20px;
        border-radius: 14px;
    }

    .app-modal-actions {
        flex-direction: column-reverse;
    }

    .app-modal-actions button {
        width: 100%;
    }
}

/* =========================================================
   MOT DE PASSE OUBLIÉ
   ========================================================= */

.forgot-password-link {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 0;
    border: none;
    background: none;
    color: #555;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
}

.forgot-password-link:hover {
    text-decoration: underline;
}
