* {
    box-sizing: border-box;
}
:root{--background:#f2f6fb}
body {
	margin: 0;
	min-height: 100vh;
	color: var(--ink);
	font-family: system-ui,-apple-system,"Segoe UI",sans-serif;
	background: radial-gradient(ellipse at 85% 0%,rgba(196,220,255,.62),transparent 36rem),linear-gradient(180deg,#f9fbff,var(--background));
}

main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

section {
    margin: 30px 0;
}

label {
    display: block;
    margin: 15px 0;
}

input,
button {
    padding: 10px;
}

button {
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    text-align: left;
    vertical-align: middle;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stats > div {
    padding: 18px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.stats strong,
.stats span {
    display: block;
}

.stats span {
    font-size: 24px;
    margin-top: 8px;
}

[role="alert"] {
    padding: 10px;
    border: 1px solid #d00;
    background: #fff5f5;
}

[role="status"] {
    padding: 10px;
    border: 1px solid #198754;
    background: #f3fff7;
}

@media (max-width: 800px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    main {
        margin: 10px;
        padding: 15px;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}


/* =========================================================
   FORMULAIRES
   ========================================================= */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.form-control,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 42px;
    padding: 9px 12px;

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

    background: #fff;
    color: #1f2937;

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

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.form-control:hover,
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #9ca3af;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-help {
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
}


/* =========================================================
   GROUPES DE CHAMPS
   ========================================================= */

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}


/* =========================================================
   CHECKBOX / RADIO
   ========================================================= */

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #2563eb;
}

.form-check label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}


/* =========================================================
   BOUTONS
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 40px;
    padding: 8px 15px;

    border: 1px solid transparent;
    border-radius: 6px;

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

    cursor: pointer;
    text-decoration: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-secondary {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}


/* =========================================================
   FORMULAIRE EN LIGNE
   ========================================================= */

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .form-inline {
        align-items: stretch;
        flex-direction: column;
    }

    .form-inline .form-group {
        width: 100%;
    }

    .form-inline .btn {
        width: 100%;
    }
}

 /*
  * ============================================================
  * MATRICE DE PRÉSENCE - SUIVI HEBDOMADAIRE
  * ============================================================
  */

.attendance-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}

.attendance-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.attendance-table th,
.attendance-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.attendance-table thead th {
    background: #f5f5f5;
    font-weight: 600;
}

.attendance-employee {
    min-width: 180px;
    text-align: left !important;
    background: #fafafa;
}

.attendance-employee strong {
    display: block;
}

.attendance-employee small {
    display: block;
    margin-top: 3px;
    color: #777;
}

.attendance-cell {
    min-width: 90px;
    height: 70px;
    position: relative;
    border-radius: 4px;
}

.attendance-icon {
    font-size: 18px;
    font-weight: bold;
    line-height: 20px;
}

.attendance-worked {
    font-size: 14px;
    font-weight: 600;
    margin-top: 3px;
}

.attendance-label {
    font-size: 12px;
    margin-top: 3px;
}

.attendance-difference {
    font-size: 11px;
    margin-top: 2px;
    opacity: 0.8;
}

.attendance-total {
    min-width: 100px;
    background: #f8f8f8;
}

.attendance-total strong {
    display: block;
}

.attendance-total small {
    display: block;
    margin-top: 3px;
    color: #777;
}


/*
 * ------------------------------------------------------------
 * COULEURS DES STATUTS
 * ------------------------------------------------------------
 */

/* Objectif atteint */
.attendance-complete {
    background: #d9f2d9;
    border-color: #8bc48b;
    color: #1f6b1f;
}

/* Entre 80% et 99% */
.attendance-partial {
    background: #fff1cc;
    border-color: #e5c76b;
    color: #856404;
}

/* Moins de 80% */
.attendance-insufficient {
    background: #f8d7da;
    border-color: #e3a3a8;
    color: #842029;
}

/* Journée en cours */
.attendance-open {
    background: #fff3cd;
    border-color: #e0b94f;
    color: #856404;
}

/* Congé / absence */
.attendance-exception {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

/* Repos / journée future */
.attendance-neutral {
    background: #f1f3f5;
    border-color: #d6d9dc;
    color: #6c757d;
}


/*
 * ------------------------------------------------------------
 * LÉGENDE
 * ------------------------------------------------------------
 */

.attendance-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 15px;
    font-size: 13px;
}

.attendance-legend span {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid;
    border-radius: 5px;
    font-weight: 500;
}

/*
 * ------------------------------------------------------------
 * NAVIGATION SEMAINE
 * ------------------------------------------------------------
 */

.week-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.week-navigation strong {
    font-size: 16px;
}

.week-navigation a {
    text-decoration: none;
}

/* =========================================================
   ACTIONS DE POINTAGE
   ========================================================= */

.pointage-actions {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.pointage-actions form {
    flex: 1;
    margin: 0;
}

.pointage-btn {
    width: 100%;
    min-height: 52px;
    padding: 12px 20px;

    border: 2px solid;
    border-radius: 8px;

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

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
}

.pointage-btn:active {
    transform: translateY(1px);
}


/* Pause déjeuner */

.pointage-btn-break {
	background: #b3dca0;
	border-color: #7fbc43;
	color: #414141;
}

.pointage-btn-break:hover {
    background: #fff7ed;
    border-color: #b8e9b1;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.20);
}


/* Fin de poste */

.pointage-btn-out {
    background: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}

.pointage-btn-out:hover {
    background: #fecaca;
    border-color: #b91c1c;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.20);
}


/* Mobile */

@media (max-width: 600px) {

    .pointage-actions {
        flex-direction: column;
        gap: 12px;
    }

    .pointage-btn {
        min-height: 56px;
        font-size: 16px;
    }

}

/* =========================================================
   NAVIGATION PRINCIPALE
   ========================================================= */

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 0;
    flex-wrap: wrap;
}


/* Bouton */

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: 38px;
    padding: 7px 12px;

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

    background: #fff;
    color: #374151;

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

    text-decoration: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
}

.nav-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.nav-btn:active {
    transform: translateY(1px);
}


/* Icônes */

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;

    font-size: 17px;
    line-height: 1;
}


/* Déconnexion */

.nav-btn-logout {
    margin-left: auto;

    color: #991b1b;
    border-color: #fecaca;
    background: #fff7f7;
}

.nav-btn-logout:hover {
    color: #7f1d1d;
    border-color: #fca5a5;
    background: #fee2e2;
}


/* Mobile */

@media (max-width: 700px) {

    .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-btn {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-btn-logout {
        margin-left: 0;
    }

}


/* Bouton de correction dans la matrice */
.btn-correction {
    margin-top: 6px;
    padding: 5px 10px;
    border: 1px solid #d97706;
    border-radius: 6px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    cursor: pointer;
}

.btn-correction:hover {
    background: #ffedd5;
}

/* Fenêtre modale */
.correction-modal {
    width: min(440px, calc(100% - 32px));
    max-width: 440px;
    padding: 24px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgb(0 0 0 / 25%);
}

.correction-modal::backdrop {
    background: rgb(15 23 42 / 55%);
    backdrop-filter: blur(3px);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
}

.modal-description {
    color: #64748b;
    font-size: 14px;
    margin: 12px 0 20px;
}

.correction-modal form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.correction-modal input,
.correction-modal textarea {
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font: inherit;
}

.correction-modal input:focus,
.correction-modal textarea:focus {
    outline: 2px solid #93c5fd;
    border-color: #2563eb;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.modal-actions button {
    padding: 10px 14px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
}

.btn-cancel {
    background: #e2e8f0;
    color: #334155;
}

.btn-save {
    background: #2563eb;
    color: white;
}

.btn-save:hover {
    background: #1d4ed8;
}


/* =========================================================
   PRESENCE — IDENTITÉ VISUELLE HARMONISÉE (style kiosk)
   ========================================================= */

:root {
    --ink: #17243b;
    --muted: #65748b;
    --line: #e0e7f0;
    --blue: #245db3;
    --blue-dark: #18458b;
    --green: #16803d;
    --background: #f2f6fb;
    --surface: #ffffff;
    --shadow: 0 8px 28px rgba(23, 36, 59, .06);
}

html { min-height: 100%; }

body {
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background:
        radial-gradient(ellipse at 85% 0%, rgba(196,220,255,.62), transparent 36rem),
        linear-gradient(180deg, #f9fbff, var(--background));
}

.app-page {
    width: min(1280px, calc(100% - 40px));
    max-width: 1280px;
    margin: 30px auto 48px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.page-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin: 0 0 24px;
    padding: 0 0 20px;
    border-bottom: 1px solid rgba(210, 222, 238, .9);
}

.page-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -.035em;
    font-weight: 750;
}

h2 {
    margin: 0 0 18px;
    color: var(--ink);
    font-size: 1.2rem;
    letter-spacing: -.02em;
}

.content-panel {
    margin: 20px 0;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--shadow);
}

.dashboard-page > .content-panel:first-of-type {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

/* Filtre de date */
.dashboard-page section:first-of-type form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}
.dashboard-page section:first-of-type label {
    min-width: 210px;
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 650;
}
.dashboard-page input[type="date"] {
    display: block;
    width: 100%;
    margin-top: 6px;
}

/* Cartes statistiques */
.stats {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 13px;
}
.stats > div {
    min-height: 104px;
    padding: 17px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(23,36,59,.035);
}
.stats strong {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 650;
}
.stats span {
    margin-top: 10px;
    color: var(--ink);
    font-size: clamp(1.45rem, 2.5vw, 1.8rem);
    font-weight: 760;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}

/* Tableaux */
.app-page table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 12px;
    font-size: .9rem;
}
.app-page table th {
    padding: 12px 13px;
    color: #52627a;
    background: #f4f7fb;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
.app-page table td {
    padding: 13px;
    color: #26364d;
    border-bottom: 1px solid #edf1f6;
}
.app-page table tbody tr:hover td {
    background: #f8fbff;
}
.app-page table tbody tr:last-child td {
    border-bottom: 0;
}
.attendance-table {
    min-width: 950px;
}
.attendance-table th:first-child,
.attendance-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}
.attendance-table thead th:first-child { z-index: 2; }

/* Navigation semaine */
.week-navigation {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8faff;
}
.week-navigation a {
    color: var(--blue);
    font-weight: 650;
}
.week-navigation a:hover { color: var(--blue-dark); }

/* Formulaires communs */
.app-page label {
    display: block;
    margin: 0 0 14px;
    color: #43536b;
    font-size: .86rem;
    font-weight: 650;
}
.app-page input:not([type="checkbox"]):not([type="radio"]),
.app-page select,
.app-page textarea {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}
.app-page input:focus,
.app-page select:focus,
.app-page textarea:focus {
    outline: none;
    border-color: #78a6e8;
    box-shadow: 0 0 0 3px rgba(36,93,179,.12);
}
.app-page button,
.app-page .btn {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--blue);
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.app-page button:hover,
.app-page .btn:hover {
    background: var(--blue-dark);
    box-shadow: 0 4px 12px rgba(36,93,179,.18);
}
.app-page button:active { transform: translateY(1px); }

/* Gestion des employés */
.employees-page .content-panel:first-of-type form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 16px;
    align-items: end;
}
.employees-page .content-panel:first-of-type form > input[type="hidden"] {
    display: none;
}
.employees-page .content-panel:first-of-type form > label {
    margin-bottom: 12px;
}
.employees-page .content-panel:first-of-type form > button {
    align-self: end;
    margin-bottom: 12px;
}
.employees-page .content-panel:last-of-type {
    overflow: hidden;
}
.employees-page details {
    min-width: 125px;
}
.employees-page details summary {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid #d5deea;
    border-radius: 9px;
    background: #f8faff;
    color: var(--blue);
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    list-style-position: inside;
}
.employees-page details[open] summary {
    margin-bottom: 12px;
    background: #eaf2ff;
}
.employees-page details form {
    min-width: 240px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcff;
}
.employees-page details form label {
    margin-bottom: 10px;
}
.employees-page details form input:not([type="checkbox"]),
.employees-page details form select {
    width: 100%;
}
.employees-page input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--blue);
    vertical-align: middle;
}
.employees-page td:nth-child(5) {
    font-weight: 700;
}

/* Messages */
.app-page [role="status"],
.app-page [role="alert"] {
    margin: 0 0 18px;
    padding: 13px 16px;
    border-radius: 12px;
    font-weight: 650;
}
.app-page [role="status"] {
    border: 1px solid #b9e4c8;
    background: #effaf3;
    color: #17653a;
}
.app-page [role="alert"] {
    border: 1px solid #f2c4c4;
    background: #fff4f4;
    color: #9b2828;
}

/* Matrice : conserver les couleurs métier, avec des angles plus doux */
.attendance-table th,
.attendance-table td {
    border-color: #e3eaf3;
}
.attendance-cell { border-radius: 8px; }
.attendance-legend span {
    border-radius: 999px;
    padding: 7px 11px;
    font-size: .78rem;
}
.attendance-total {
    background: #f4f7fb;
    border-radius: 8px;
}
.btn-correction {
    min-height: 30px !important;
    padding: 5px 10px !important;
    border: 1px solid #e6b45c !important;
    border-radius: 8px !important;
    background: #fff7e8 !important;
    color: #89550a !important;
    font-size: .76rem !important;
}
.btn-correction:hover { background: #ffedc8 !important; }

/* Modale */
.correction-modal {
    color: var(--ink);
    background: #fff;
}
.correction-modal label { margin: 8px 0; }
.correction-modal input,
.correction-modal textarea { width: 100%; }
.correction-break-row {
    margin: 12px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.btn-cancel {
    border: 1px solid #d5deea !important;
    background: #f2f5f9 !important;
    color: #34445b !important;
}
.btn-save {
    border: 1px solid var(--blue) !important;
    background: var(--blue) !important;
    color: #fff !important;
}

@media (max-width: 900px) {
    .employees-page .content-panel:first-of-type form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    .app-page {
        width: calc(100% - 24px);
        margin: 18px auto 30px;
    }
    .content-panel {
        padding: 17px 14px;
        border-radius: 15px;
    }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats > div { min-height: 90px; padding: 14px; }
    .stats span { font-size: 1.45rem; }
    .employees-page .content-panel:first-of-type form {
        grid-template-columns: 1fr;
    }
    .app-page table { font-size: .82rem; }
    .app-page table th,
    .app-page table td { padding: 10px; }
    .week-navigation {
        align-items: stretch;
        flex-direction: column;
    }
    .week-navigation strong { order: -1; }
}


/* Pages manager : absences, congés, horaires, événements et samedis */
.absences-page .content-panel:first-of-type form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    align-items: end;
}
.absences-page .content-panel:first-of-type form label:last-of-type,
.absences-page .content-panel:first-of-type form button {
    grid-column: 1 / -1;
}
.absences-page .content-panel:first-of-type textarea,
.leaves-page textarea {
    width: 100%;
    min-height: 88px;
}
.absences-page .content-panel:nth-of-type(2) > form,
.pointages-page .content-panel:first-of-type form,
.calendar-page .content-panel:first-of-type form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.absences-page .content-panel:nth-of-type(2) > form label,
.pointages-page .content-panel:first-of-type form label,
.calendar-page .content-panel:first-of-type form label {
    min-width: 170px;
}
.absences-page table form,
.leaves-page table form,
.saturdays-page table form {
    margin: 0;
}
.leaves-page table form {
    min-width: 190px;
}
.leaves-page table textarea {
    margin-bottom: 8px;
}
.leaves-page button[value="rejected"] {
    border-color: #c45b5b;
    background: #fff1f1;
    color: #9b3030;
}
.leaves-page button[value="rejected"]:hover {
    background: #ffe2e2;
}
.calendar-page table input[type="time"],
.calendar-page table input[type="number"] {
    width: 100%;
    min-width: 105px;
}
.calendar-page table input[type="checkbox"],
.saturdays-page input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}
.calendar-page table td:first-child {
    font-weight: 700;
}
.pointages-page .content-panel:last-of-type,
.absences-page .content-panel:last-of-type,
.leaves-page .content-panel,
.saturdays-page .content-panel {
    overflow-x: auto;
}
.pointages-page .content-panel:first-of-type form {
    gap: 8px 18px;
}
.pointages-page .content-panel:first-of-type label {
    min-width: 180px;
}
.saturdays-page .planning-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 18px;
    align-items: end;
}
.saturdays-page .planning-form label {
    min-width: 0;
}
.saturdays-page .planning-form .actions {
    grid-column: 1 / -1;
}
.saturdays-page .button-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #f7f9fc;
    color: var(--blue);
    font-size: .88rem;
    font-weight: 700;
}
.saturdays-page .status-planned td:nth-child(5) {
    color: #17653a;
    font-weight: 700;
}
.saturdays-page .status-cancelled td {
    color: #7c8798;
}
.export-page .page-header {
    margin-bottom: 22px;
}
.export-page .page-header p {
    max-width: 720px;
    color: var(--muted);
}
.export-page .content-panel + .content-panel {
    margin-top: 18px;
}
.export-page .content-panel ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 24px;
    padding-left: 22px;
    color: #43536b;
}
@media (max-width: 900px) {
    .saturdays-page .planning-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    .absences-page .content-panel:first-of-type form,
    .saturdays-page .planning-form {
        grid-template-columns: 1fr;
    }
    .absences-page .content-panel:first-of-type form label:last-of-type,
    .absences-page .content-panel:first-of-type form button,
    .saturdays-page .planning-form .actions {
        grid-column: auto;
    }
    .export-page .content-panel ul {
        grid-template-columns: 1fr;
    }
}


/* Espace salarié */
.employee-dashboard-page .page-header > p { margin: -8px 0 0; color: var(--muted); font-size: .96rem; }
.employee-dashboard-page .content-panel:first-of-type { background: linear-gradient(135deg, #fff 0%, #f7faff 100%); }
.employee-dashboard-page .content-panel:first-of-type .stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:18px 0; }
.employee-dashboard-page .content-panel:first-of-type .stats > div { display:flex; flex-direction:column; gap:7px; padding:18px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.employee-dashboard-page .content-panel:first-of-type .stats strong { color:var(--muted); font-size:.82rem; font-weight:650; }
.employee-dashboard-page .content-panel:first-of-type .stats span { color:var(--ink); font-size:1.45rem; font-weight:750; font-variant-numeric:tabular-nums; }
.employee-dashboard-page .pointage-actions { display:flex; flex-wrap:wrap; gap:12px; margin:18px 0 4px; }
.employee-dashboard-page .pointage-btn { min-height:48px; padding:12px 20px; border:0; border-radius:12px; font-weight:750; cursor:pointer; }
.employee-dashboard-page .pointage-btn-break { background:var(--blue); color:#fff; }
.employee-dashboard-page .pointage-btn-out { background:#fff0f0; color:#a33b3b; border:1px solid #f0cccc; }
.employee-dashboard-page .week-navigation { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:18px; padding:13px 15px; border:1px solid var(--line); border-radius:12px; background:#f8faff; }
.employee-dashboard-page .week-navigation a { color:var(--blue); font-weight:650; text-decoration:none; }
.employee-dashboard-page .attendance-legend { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 18px; }
.employee-dashboard-page .attendance-legend > span { display:inline-flex; align-items:center; gap:5px; padding:6px 10px; border:1px solid var(--line); border-radius:999px; background:#fff; color:#536176; font-size:.78rem; font-weight:650; }
.employee-dashboard-page .attendance-table-wrapper { overflow-x:auto; }
.employee-dashboard-page .attendance-table { min-width:650px; }
.employee-dashboard-page .attendance-cell { min-width:78px; text-align:center; vertical-align:middle; }
.employee-dashboard-page .attendance-icon { font-size:1.05rem; font-weight:800; }
.employee-dashboard-page .attendance-worked { margin-top:4px; font-size:.82rem; font-weight:750; font-variant-numeric:tabular-nums; }
.employee-dashboard-page .attendance-label, .employee-dashboard-page .attendance-difference { margin-top:4px; font-size:.72rem; }
.employee-dashboard-page .attendance-total { min-width:100px; background:#f3f6fb; text-align:center; font-variant-numeric:tabular-nums; }
.employee-dashboard-page .planned-saturday-badge { display:inline-flex; align-items:center; justify-content:center; min-width:20px; min-height:20px; border-radius:7px; background:#fff0c2; color:#704900; font-size:.72rem; font-weight:800; }
.employee-absences-page .content-panel, .employee-leaves-page .content-panel { overflow-x:auto; }
.employee-leaves-page .content-panel:first-of-type form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 18px; align-items:end; }
.employee-leaves-page .content-panel:first-of-type form label:nth-of-type(3), .employee-leaves-page .content-panel:first-of-type form button { grid-column:1 / -1; }
.employee-leaves-page textarea { width:100%; min-height:88px; }
.employee-leaves-page .content-panel:first-of-type form button { justify-self:start; }
@media (max-width:700px) {
  .employee-dashboard-page .content-panel:first-of-type .stats { grid-template-columns:1fr; }
  .employee-dashboard-page .week-navigation { justify-content:flex-start; }
  .employee-leaves-page .content-panel:first-of-type form { grid-template-columns:1fr; }
  .employee-leaves-page .content-panel:first-of-type form label:nth-of-type(3), .employee-leaves-page .content-panel:first-of-type form button { grid-column:auto; }
}


/* =========================================================
   PAGE DE CONNEXION
   ========================================================= */
.login-body {
    min-height: 100vh;
}
.login-page {
    width: min(100% - 32px, 460px);
    max-width: 460px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.login-card {
    width: 100%;
    padding: 36px;
    border: 1px solid rgba(218, 228, 241, .95);
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 18px 55px rgba(31, 55, 91, .10);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 38px;
}
.login-brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(145deg, #3476d0, #194b98);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 7px 16px rgba(36,93,179,.22);
}
.login-eyebrow {
    margin: 0 0 3px;
    color: #7b8ba2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
}
.login-brand h1 {
    margin: 0;
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 760;
    letter-spacing: -.025em;
}
.login-heading { margin-bottom: 25px; }
.login-heading h2 {
    margin: 0 0 7px;
    color: var(--ink);
    font-size: 1.65rem;
    letter-spacing: -.04em;
}
.login-heading p {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}
.login-form .form-group { margin-bottom: 19px; }
.login-form .form-group label {
    margin: 0 0 8px;
    color: #43536b;
    font-size: .84rem;
    font-weight: 700;
}
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d5deea;
    border-radius: 11px;
    background: #fbfcfe;
    color: var(--ink);
    font: inherit;
    font-size: .95rem;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.login-form input:hover { border-color: #aabbd1; }
.login-form input:focus {
    outline: none;
    border-color: #78a6e8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(36,93,179,.11);
}
.login-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 49px;
    margin-top: 7px;
    padding: 12px 18px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #2d6fc8, #194b98);
    color: #fff;
    font: inherit;
    font-size: .93rem;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 7px 16px rgba(36,93,179,.18);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.login-form button:hover {
    filter: brightness(1.05);
    box-shadow: 0 10px 20px rgba(36,93,179,.23);
}
.login-form button:active { transform: translateY(1px); }
.login-form button span { font-size: 1.15rem; }
.login-alert {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff5f5;
    color: #b42318;
    font-size: .88rem;
}
.login-footer {
    margin: 25px 0 0;
    padding-top: 18px;
    border-top: 1px solid #edf1f6;
    color: #8794a7;
    font-size: .75rem;
    text-align: center;
}
@media (max-width: 520px) {
    .login-page { width: min(100% - 24px, 460px); padding: 18px 0; }
    .login-card { padding: 27px 22px; border-radius: 18px; }
    .login-brand { margin-bottom: 30px; }
}
