body {
    background-color: #f9fafb;
    font-family: 'Roboto', 'Open Sans', Arial, sans-serif;
    position: relative;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scrollbar on body */
}

.container {
    margin: 0 auto;
    padding: 0px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome {
    margin-right: auto;
    margin-left: 24px;
}

.site-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.title-icon {
    width: 32px;
    height: 32px;
    stroke: #333;
}

.logo {
    width: 200px;
    height: auto;
}

.logologin {
    display: block;
    margin: 0 auto; /* Centre horizontalement */
    max-width: 150px; /* Ajuste la taille selon tes besoins */
    margin-bottom: 20px; /* Espace sous le logo */
}

.actions {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.flex {
    display: flex;
    gap: 16px;
    align-items: center;
}

h2.recap-title {
    font-size: 24px;
    font-weight: 700;
    padding-left: 24px;
    color: #1f2937;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.space-x-4 > * + * {
    margin-left: 16px;
}

.mb-4 {
    margin-bottom: 0px;
}

.mb-6 {
    margin-bottom: 24px;
}

.actions.mb-6 {
    margin-left: 24px;
    padding-bottom: 15px;
}

label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    display: block;
    margin-bottom: 4px;
    white-space: nowrap; /* Prevent text from wrapping */
}

select,
input[type="text"],
input[type="password"],
input[type="date"] {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 300px;
    transition: border-color 0.2s;
}

input[type="number"] {
    padding: 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    width: 80px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s;
}

select:focus,
input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.note-container.mt-4 {
    padding-left: 14px;
    padding-bottom: 14px;
}

/* Center form content for single-column layouts */
.centered-form {
    max-width: 600px;
    padding: 24px;
    box-sizing: border-box; /* Ensure padding doesn't affect width */
}

/* Ensure tables within centered-form respect the max-width */
.centered-form .table-container {
    width: 100%;
    table-layout: fixed; /* Prevent table from expanding beyond container */
    overflow-x: auto; /* Allow scrolling if table content is too wide */
}

/* Ensure container doesn't interfere with centering for these pages */
.container:has(.centered-form) {
    padding: 24px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%; /* Prevent container from exceeding viewport */
    box-sizing: border-box;
}

.center-action {
    text-align: center;
    padding: 2px; /* Ajuste l'espacement interne */
}
.center-action a.delete-button {
    display: inline-block; /* Assure que le bouton reste centré */
}

p.no-agents-message {
    text-align: center;
    font-weight: bold;
    margin: 20px 0;
}

/* Responsive adjustments */
@media screen and (max-width: 1919px) {
    .centered-form {
        max-width: 500px;
        padding: 16px;
    }
    .centered-form .table-container {
        font-size: 12px; /* Reduce font size for better fit */
    }
}

/* Couleur de fond pour les recaps */
td.month-total.non-editable {
    background-color: #f1f5f9;
}

.table-container .month-header th {
    background-color: #4f46e5;
    color: white;
    font-weight: bold;
}

.category-header {
    background-color: #f1f5f9!important;
    font-weight: 700;
    font-size: 24px;
    text-align: center;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Style for the month-total column */
.month-total {
    background-color: #f1f5f9; /* Light gray background */
    font-weight: bold; /* Make text bold for emphasis */
}

/* Color for positive and negative values */
.positive {
    color: #16a34a; /* Green for positive values */
}

.negative {
    color: #dc2626; /* Red for negative values */
}

/* Disable editing for non-editable cells */
.non-editable {
    pointer-events: none; /* Prevent clicks from triggering events */
    cursor: default; /* Remove pointer cursor */
}

button,
a.button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.button-icon {
    width: 16px;
    height: 16px;
    stroke: white;
}

button.bg-blue,
a.bg-blue {
    background-color: #4f46e5;
}

button.bg-blue:hover,
a.bg-blue:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button.bg-red,
a.bg-red {
    background-color: #dc2626;
    color: white;
}

button.bg-red:hover,
a.bg-red:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button.bg-green,
a.bg-green {
    background-color: #16a34a;
    color: white;
}

button.bg-green.mt-4 {
    margin-left: 14px;
}

button.bg-green:hover,
a.bg-green:hover {
    background-color: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.error {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.success {
    background-color: #dcfce7;
    color: #15803d;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    position: relative;
}

.container.saisie-heures {
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
    overflow-x: hidden;
    position: relative; /* Allow z-index stacking for children */
}

/* Specific rule for div#saisie-container to overlap padding and align left */
.container.saisie-heures #saisie-container {
    width: 100vw; /* Full viewport width */
    max-width: 100%; /* Prevent overflow */
    z-index: 1; /* Place in foreground to cover white band */
    overflow-x: hidden; /* Prevent scrollbar */
    background-color: #ffffff; /* Ensure background matches table to hide padding */
}

/* Table-specific rule for Saisie des heures */
.container.saisie-heures .annee-table.saisie-heures-table {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
}

.table-container table {
    width: 100%;
    background-color: #ffffff;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.table-container table th,
.table-container table td {
    border: 1px solid #e5e7eb;
    padding: 12px;
    text-align: center;
    vertical-align: top;
    min-width: 100px;
    background-color: #ffffff;
}

.day-cell {
    padding: 0;
}

.day-container {
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

th {
    background-color: #f3f4f6;
    white-space: nowrap;
    font-weight: 600;
    color: #1f2937;
}

.ferie {
    background-color: #4f46e5c2;
}

.weekend {
    background-color: #776868b0;
}

.vacance {
    background-color: #e99010d1;
}

.overflow-x-auto {
    overflow-x: auto;
}

.space-y-4 > * + * {
    margin-top: 16px;
}

.annee-table th {
    white-space: nowrap;
}

.day-label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 12px;
    padding: 4px;
    color: #374151;
}

.month-total {
    font-weight: 600;
    margin-top: 4px;
    font-size: 14px;
}

.month-total.positive {
    color: #16a34a;
}

.month-total.negative {
    color: #dc2626;
}

.hour-cell {
    text-align: center;
    padding: 4px;
}

.hour-cell.positive {
    background-color: #d1fae5;
}

.hour-cell.negative {
    background-color: #fee2e2;
}

.hour-input {
    width: 60px;
    text-align: center;
    padding: 4px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hour-input.positive {
    color: #16a34a;
}

.hour-input.negative {
    color: #dc2626;
}

.recap-table td.positive {
    color: #16a34a;
    font-weight: 600;
}

.recap-table td.negative {
    color: #dc2626;
    font-weight: 600;
}

.recap-table td:not(.positive):not(.negative) {
    color: #1f2937;
    font-weight: 600;
}

body.login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f9fafb;
}

.container.login {
    background-color: #ffffff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.floating-save {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 24px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.notification {
    display: none;
    position: fixed;
    bottom: 70px;
    right: 20px;
    background-color: #16a34a;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media print {
    body {
        background-color: white;
    }
    .container {
        padding: 0;
    }
    .header, .actions, .floating-save, .notification, button, a.button {
        display: none;
    }
    .table-container {
        overflow-x: visible;
    }
    table {
        width: 100%;
        font-size: 10px;
    }
    th, td {
        padding: 2px;
    }
    /* Impression spécifique pour la page saisie_heures.php */
    @page {
        size: landscape;
        margin: 10mm;
    }
    .container.saisie-heures {
        width: 277mm; /* Largeur utile A4 paysage après marges */
        margin: 0;
        padding: 0;
    }
    .container.saisie-heures #saisie-container {
        width: 100%;
        transform: scale(0.9); /* Augmenter l'échelle à 90% */
        transform-origin: top left;
    }
    .container.saisie-heures .annee-table.saisie-heures-table {
        width: 100%;
        font-size: 9px; /* Légère augmentation pour la lisibilité */
    }
}

.month-labels {
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.month-labels span {
    display: inline-block;
    width: calc(100% / 12);
    text-align: center;
}

.button-container {
    margin-left: auto;
}

.button-group {
    width: 100%;
}

.button-group-left {
    display: flex;
    gap: 16px;
    align-items: center;
}

.button-group-left a:first-child {
    margin-left: 16px;
}

.separator {
    margin: 0 16px;
    color: #666;
}

.button-group-right {
    margin-left: auto;
}

.button-group-right button {
    margin-right: 16px;
}

.agent-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 16px;
    color: #333;
}

.footer {
    text-align: center;
    background-color: #f3f4f6;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
    position: block;
    bottom: 0;
    width: 100%;
    font-size: 12px;
    color: #666;
}

/* Légende pour Saisie des heures */
.legend {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 14px;
    color: #374151;
    flex-wrap: nowrap; /* Prevent legend items from wrapping */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* Prevent text from wrapping */
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Deux colonnes pour Configurer jours fériés/vacances */
.config-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.config-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Adjust font sizes for resolutions below 1920px */
@media screen and (max-width: 1919px) {
    /* General text elements */
    body {
        font-size: 14px; /* Reduce default font size (originally ~16px implied) */
    }

    /* Headers */
    h2, h2.recap-title {
        font-size: 20px; /* Reduced from 24px */
    }
    h3 {
        font-size: 18px; /* Reduced from 20px */
    }
    .agent-title {
        font-size: 20px; /* Reduced from 24px */
    }

    /* Labels and form elements */
    label {
        font-size: 12px; /* Reduced from 14px */
    }
    select,
    input[type="text"],
    input[type="password"],
    input[type="date"],
    input[type="number"] {
        font-size: 12px; /* Reduced from implied ~14px */
        padding: 8px; /* Slightly reduce padding for better fit */
    }

    /* Table-specific text */
    .day-label {
        font-size: 10px; /* Reduced from 12px */
    }
    .month-total {
        font-size: 12px; /* Reduced from 14px */
    }
    th {
        font-size: 12px; /* Reduced from implied ~14px */
    }

    /* Buttons */
    button,
    a.button {
        font-size: 12px; /* Reduced from implied ~14px */
        padding: 8px 12px; /* Slightly reduce padding */
    }
    .floating-save {
        font-size: 14px; /* Reduced from 16px */
    }

    /* Legend */
    .legend {
        font-size: 12px; /* Reduced from 14px */
    }

    /* Footer */
    .footer {
        font-size: 10px; /* Reduced from 12px */
    }
}





/* Boîte de confirmation personnalisée */
.custom-confirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.custom-confirm-content {
    background-color: #ffffff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.custom-confirm-content p {
    color: #dc2626; /* Rouge pour le message */
    font-size: 16px;
    margin-bottom: 24px;
}

.custom-confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.custom-confirm-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
}

.custom-confirm-buttons .bg-red:hover {
    background-color: #b91c1c;
}

.custom-confirm-buttons .bg-blue:hover {
    background-color: #4338ca;
}

