/* Style général */
body {
    font-family: 'Poppins', Arial, sans-serif;
    color: #333;
    background: linear-gradient(135deg, #f9f9f9, #e3f2fd);
    margin: 0;
    padding: 0;
}

h1 {
    text-align: center;
    color: #444;
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

header + h1,
.navbar + h1,
.user_CupiDose_gestiondesstocks_header + h1 {
    margin-top: 40px;
}

/* User Container Styles */
.user-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.user-info {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
}

.role-badge {
    background-color: #6f42c1;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    margin-left: 10px;
    font-weight: bold;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Role background gradients (support both capitalized and lowercase class names) */
.role-Entreprise, .role-entreprise { background: linear-gradient(135deg, #dc3545, #c82333); }
.role-Dirigeant, .role-dirigeant { background: linear-gradient(135deg, #fd7e14, #e55a00); }
.role-Lieutenant, .role-lieutenant { background: linear-gradient(135deg, #6f42c1, #5a2d91); }
.role-Responsable, .role-responsable { background: linear-gradient(135deg, #20c997, #198754); }
.role-Vendeur, .role-vendeur { background: linear-gradient(135deg, #0d6efd, #0b5ed7); }
.role-Livreur, .role-livreur { background: linear-gradient(135deg, #198754, #146c43); }
.role-Guetteur, .role-guetteur { background: linear-gradient(135deg, #ffc107, #ffca2c); color: #000; }
.role-Préparateur, .role-préparateur, .role-Preparateur, .role-preparateur { background: linear-gradient(135deg, #6610f2, #520dc2); }
.role-Ravitailleur, .role-ravitailleur { background: linear-gradient(135deg, #d63384, #b02a5b); }
.role-Standartdiste, .role-standartdiste { background: linear-gradient(135deg, #495057, #343a40); }


.logout-link {
    color: #dc3545;
    text-decoration: none;
    margin-left: 15px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.logout-link:hover {
    background-color: #dc3545;
    color: white;
    text-decoration: none;
}

/* Formulaire plus gras et marqué */
form {
    max-width: 650px;
    margin: 0 auto 40px auto;
    padding: 24px 40px 40px;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

form > br {
    display: none;
}

form input, 
form textarea,
form select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

form input:focus, 
form textarea:focus,
form select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    transform: translateY(-1px);
}

/* Style spécial pour la référence - EXACTEMENT COMME MATIÈRE PREMIÈRE */
form input[readonly] {
    background-color: #f0f8ff !important;
    border: 2px solid #007bff !important;
    color: #333 !important;
    font-weight: bold !important;
    font-family: monospace !important;
    font-size: 16px !important;
    cursor: not-allowed;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.25) !important;
}

form input[readonly]:focus {
    border-color: #0056b3 !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3) !important;
}

form textarea {
    resize: vertical;
    height: 110px;
    line-height: 1.5;
}

.cds-date-wrap {
    position: relative;
    margin-bottom: 20px;
}

.cds-date-wrap .cds-date-input {
    margin-bottom: 0;
    padding-right: 48px;
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff, #f4f9ff);
    color: #1f2937;
    font-weight: 600;
}

.cds-date-wrap .cds-date-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23055ecf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.cds-date-wrap:focus-within .cds-date-icon {
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}

.cds-date-wrap .cds-date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    right: 0;
    width: 46px;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cds-date-wrap .cds-date-input::-webkit-datetime-edit {
    color: #1f2937;
}

.cds-time-wrap {
    position: relative;
    margin-bottom: 20px;
}

.cds-time-wrap .cds-time-input {
    margin-bottom: 0;
    padding-right: 48px;
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff, #f4f9ff);
    color: #1f2937;
    font-weight: 600;
}

.cds-time-wrap .cds-time-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23055ecf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15.5 14.5'/%3E%3C/svg%3E");
}

.cds-time-wrap:focus-within .cds-time-icon {
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}

.flatpickr-calendar {
    border: 1px solid #d3deea;
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(15, 46, 88, 0.2);
    font-family: 'Poppins', Arial, sans-serif;
    overflow: hidden;
}

.flatpickr-months {
    background: linear-gradient(135deg, #007bff, #0b5ed7);
    color: #fff;
    padding: 6px 8px;
}

.flatpickr-current-month {
    font-size: 15px;
    font-weight: 600;
}

.flatpickr-monthDropdown-months,
.numInput.cur-year {
    color: #fff;
    font-weight: 600;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    fill: #fff;
    color: #fff;
    border-radius: 8px;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: rgba(255, 255, 255, 0.2);
}

.flatpickr-weekdays {
    background: #eef5ff;
}

span.flatpickr-weekday {
    color: #1d3557;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

.flatpickr-day {
    border-radius: 9px;
    color: #1f2937;
    font-weight: 500;
    margin: 2px 0;
}

.flatpickr-day:hover {
    background: #e8f1ff;
    border-color: #d7e7ff;
}

.flatpickr-day.today {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #f0f7ff;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    border-color: #0b5ed7;
    color: #fff;
    box-shadow: 0 6px 12px rgba(13, 110, 253, 0.28);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #b4bcc6;
    background: transparent;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #9aa5b1;
}

.flatpickr-time {
    border-top: 1px solid #dce6f2;
    background: #f7fbff;
    max-height: 52px;
}

.flatpickr-time .numInputWrapper span.arrowUp:after,
.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-bottom-color: #1d4ed8;
    border-top-color: #1d4ed8;
}

.flatpickr-time input.flatpickr-hour,
.flatpickr-time input.flatpickr-minute {
    color: #0f172a;
    font-weight: 700;
}

.flatpickr-time .flatpickr-am-pm {
    display: none;
}

.matiere-details {
    margin: 4px 0 20px;
    padding: 12px 14px;
    border: 1px solid #dde3eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.matiere-row {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f7;
}

.matiere-row:last-child {
    border-bottom: 0;
}

.matiere-row:nth-child(odd) {
    background: #fafcff;
    border-radius: 8px;
}

.matiere-label {
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}

.matiere-value {
    color: #0f172a;
    font-weight: 600;
    font-size: 15px;
    text-align: right;
}

.matiere-row.matiere-row-input {
    padding: 10px 0;
    background: transparent;
}

.matiere-row input[type="number"] {
    width: 100%;
    margin: 0;
}

.qte-unit-wrap {
    position: relative;
    width: 100%;
    --unit-left: 16px;
}

.qte-unit-wrap input[type="number"] {
    padding-left: 14px;
    padding-right: 38px;
}

.qte-unit-label {
    position: absolute;
    left: var(--unit-left);
    top: 50%;
    transform: translateY(-50%);
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.qte-unit-wrap.is-empty .qte-unit-label {
    opacity: 0;
}

.price-euro-wrap {
    position: relative;
    width: 100%;
    --euro-left: 16px;
}

.price-euro-wrap input[type="number"] {
    padding-left: 14px;
    padding-right: 38px;
}

.price-euro-label {
    position: absolute;
    left: var(--euro-left);
    top: 50%;
    transform: translateY(-50%);
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.price-euro-wrap.is-empty .price-euro-label {
    opacity: 0;
}

.matiere-row.matiere-row-total .matiere-value {
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

form select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231f2937' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    background-color: #fff;
}

form select:hover {
    border-color: #0d6efd;
    background-color: #f8fbff;
}

form select:focus {
    background-color: #f3f8ff;
}

form select:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    border-color: #d0d4d9;
    cursor: not-allowed;
}

form select.cds-select-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
}

.cds-select {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.cds-select-trigger {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.cds-select-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 24px);
}

.cds-select-arrow {
    font-size: 13px;
    color: #495057;
    transition: transform 0.2s ease;
}

.cds-select.is-open .cds-select-arrow {
    transform: rotate(180deg);
}

.cds-select-trigger:hover {
    border-color: #9aa0a6;
    background-color: #f8f9fa;
}

.cds-select.is-open .cds-select-trigger,
.cds-select-trigger:focus-visible {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.cds-select.is-disabled .cds-select-trigger {
    background: #e9ecef;
    color: #6c757d;
    border-color: #d0d4d9;
    cursor: not-allowed;
}

.cds-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d9dee3;
    border-radius: 10px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
    max-height: 240px;
    overflow-y: auto;
    z-index: 40;
    padding: 6px;
    display: none;
}

.cds-select.is-open .cds-select-menu {
    display: block;
}

.cds-select-option {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    color: #2f3337;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cds-select-option:hover {
    background: #f1f5f9;
}

.cds-select-option.is-selected {
    background: #e7f1ff;
    color: #0056b3;
    font-weight: 600;
}

.cds-select-option.is-disabled,
.cds-select-option:disabled {
    color: #9aa0a6;
    cursor: not-allowed;
}

.cds-file-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
    border: 2px dashed #85b8ff;
    background: linear-gradient(135deg, #f7fbff, #eef6ff);
    border-radius: 10px;
    padding: 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.cds-file-wrap:hover {
    border-color: #0d6efd;
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.18);
}

.cds-file-wrap.has-file {
    border-style: solid;
    border-color: #198754;
    background: linear-gradient(135deg, #f4fff8, #ebfff4);
}

.cds-file-wrap.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.cds-file-button {
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
    cursor: pointer;
    width: min(560px, 100%);
    white-space: nowrap;
    text-align: center;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cds-file-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(13, 110, 253, 0.3);
    filter: brightness(1.03);
}

.cds-file-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.28);
}

.cds-file-name {
    width: 100%;
    max-width: 560px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.cds-file-wrap.has-file .cds-file-name {
    color: #146c43;
    font-weight: 600;
}

.cds-file-preview {
    width: 100%;
    max-width: 560px;
    display: none;
}

.cds-file-preview.is-video,
.cds-file-preview.is-image {
    max-width: 560px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    justify-items: center;
}

.cds-file-preview.is-visible {
    display: block;
}

.cds-file-preview.is-video.is-visible,
.cds-file-preview.is-image.is-visible {
    display: grid;
}

.cds-video-preview,
.cds-image-preview {
    width: 100%;
    height: 160px;
    display: block;
    border-radius: 10px;
    border: 2px solid #d7e4f6;
    background: #0b1220;
    box-shadow: 0 8px 20px rgba(11, 18, 32, 0.25);
    cursor: zoom-in;
    object-fit: cover;
}

.cds-video-thumb {
    position: relative;
    width: 100%;
    max-width: 130px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    text-align: center;
}

.cds-video-thumb-order {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cds-video-thumb-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.cds-video-thumb-remove:hover {
    background: #dc2626;
}

.cds-video-preview:hover,
.cds-image-preview:hover {
    border-color: #0d6efd;
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.28);
}

.cds-no-scroll {
    overflow: hidden;
}

.cds-video-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(6, 12, 24, 0.82);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cds-video-lightbox.is-open {
    display: flex;
}

.cds-video-lightbox-dialog {
    position: relative;
    width: min(920px, 100%);
    background: #0b1220;
    border: 1px solid #2a3a56;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45);
}

.cds-video-lightbox-player {
    width: 100%;
    max-height: 74vh;
    display: block;
    border-radius: 10px;
    background: #000;
}

.cds-video-lightbox-title {
    color: #dbeafe;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cds-video-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    z-index: 2;
}

.cds-video-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.cds-file-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

form button {
    width: 100%;
    padding: 16px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

form button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

form button:active {
    transform: translateY(0);
}

/* Groupes de champs */
.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* Messages plus marqués et centrés */
.success-message {
    color: #155724;
    font-weight: 600;
    text-align: center;
    margin: 20px auto;
    background: #d4edda;
    padding: 15px 20px;
    border: 2px solid #c3e6cb;
    border-radius: 8px;
    max-width: 650px;
    box-shadow: 0 4px 15px rgba(21, 87, 36, 0.2);
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.error-message {
    color: #721c24;
    font-weight: 600;
    text-align: center;
    margin: 20px auto;
    background: #f8d7da;
    padding: 15px 20px;
    border: 2px solid #f5c6cb;
    border-radius: 8px;
    max-width: 650px;
    box-shadow: 0 4px 15px rgba(114, 28, 36, 0.2);
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.recap-card {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid #dde3eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.recap-title {
    margin: 0 0 10px;
    color: #1f2937;
    font-size: 23px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.recap-row {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid #eef2f7;
}

.recap-row:last-child {
    border-bottom: 0;
}

.recap-row:nth-child(even) {
    background: #fafcff;
    border-radius: 8px;
}

.recap-label {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
}

.recap-value {
    font-size: 18px;
    font-weight: 700;
    text-align: right;
}

.recap-value-qty { color: #0f172a; }
.recap-value-cost { color: #0f172a; }
.recap-value-sale { color: #0f172a; }
.recap-value-benefit { color: #0f172a; }

.recap-row-total .recap-label,
.recap-row-total .recap-value {
    font-size: 20px;
}

.exemplar-card {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid #d9e1ec;
    border-radius: 12px;
    background:
        radial-gradient(circle at 100% 0%, rgba(13, 110, 253, 0.08), transparent 50%),
        linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.exemplar-title {
    color: #1f2937;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.exemplar-input-wrap {
    position: relative;
    width: min(240px, 100%);
    --unit-left: 18px;
}

.exemplar-input-wrap input[type="number"] {
    width: 100%;
    margin-bottom: 0;
    padding-left: 16px;
    padding-right: 40px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
}

.exemplar-unit-label {
    position: absolute;
    left: var(--unit-left);
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    pointer-events: none;
    white-space: nowrap;
}

.exemplar-input-wrap.is-empty .exemplar-unit-label {
    opacity: 0;
}

.exemplar-help {
    display: block;
    margin-top: 10px;
    color: #475569;
    font-size: 15px;
    line-height: 1.35;
}

/* Pied de page - Informations Base de Données centré */
.db-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 25px 30px;
    margin: 50px auto 20px auto;
    max-width: 650px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #2196f3;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.15);
    font-family: 'Poppins', Arial, sans-serif;
    color: #1565c0;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.6;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.db-info strong {
    color: #0d47a1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.db-info code {
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    color: #d32f2f;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-block;
    margin: 0 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    form {
        margin: 0 20px 40px 20px;
        padding: 30px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .user-info {
        padding: 12px 15px;
        font-size: 14px;
        margin: 15px;
    }
    
    .role-badge {
        font-size: 0.75em;
        padding: 3px 8px;
        margin-left: 8px;
    }
    
    .db-info {
        margin: 40px 20px 15px 20px;
        padding: 20px;
        font-size: 13px;
        max-width: calc(100% - 40px);
    }
    
    .success-message,
    .error-message {
        margin: 20px 20px;
        max-width: calc(100% - 40px);
    }

    .flatpickr-calendar {
        width: min(360px, calc(100vw - 24px));
        max-width: min(360px, calc(100vw - 24px));
    }

    .flatpickr-calendar.open {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
    }

    .flatpickr-time input.flatpickr-hour,
    .flatpickr-time input.flatpickr-minute {
        font-size: 18px;
        line-height: 46px;
        height: 46px;
    }

    .recap-title {
        font-size: 22px;
    }

    .recap-label,
    .recap-value {
        font-size: 17px;
    }

    .recap-row-total .recap-label,
    .recap-row-total .recap-value {
        font-size: 19px;
    }

    .exemplar-title {
        font-size: 20px;
    }

    .exemplar-input-wrap input[type="number"] {
        font-size: 18px;
    }

    .exemplar-unit-label {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    form {
        margin: 0 15px 40px 15px;
        padding: 25px;
    }
    
    form input, 
    form textarea,
    form select {
        padding: 10px 14px;
        font-size: 14px;
    }

    form select {
        padding-right: 34px;
        background-position: right 10px center;
    }

    .cds-date-wrap .cds-date-input {
        padding-right: 42px;
    }

    .cds-date-wrap .cds-date-icon {
        right: 10px;
        width: 16px;
        height: 16px;
    }

    .cds-time-wrap .cds-time-input {
        padding-right: 42px;
    }

    .cds-time-wrap .cds-time-icon {
        right: 10px;
        width: 16px;
        height: 16px;
    }

    .cds-select-trigger {
        padding: 10px 14px;
        font-size: 14px;
    }

    .cds-select-menu {
        max-height: 210px;
    }

    .cds-select-option {
        padding: 9px 10px;
        font-size: 13px;
    }

    .matiere-details {
        padding: 12px 10px;
    }

    .matiere-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px 0;
        border-radius: 0;
    }

    .matiere-label,
    .matiere-value {
        font-size: 14px;
    }

    .matiere-value {
        text-align: left;
    }

    .matiere-row.matiere-row-total .matiere-value {
        font-size: 18px;
    }

    .recap-card {
        padding: 12px;
    }

    .recap-title {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .recap-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 8px 6px;
    }

    .recap-label,
    .recap-value {
        font-size: 16px;
        text-align: left;
    }

    .recap-row-total .recap-label,
    .recap-row-total .recap-value {
        font-size: 18px;
    }

    .flatpickr-calendar {
        width: calc(100vw - 30px);
        max-width: 340px;
    }

    .flatpickr-day {
        max-width: 40px;
        line-height: 38px;
        height: 38px;
        font-size: 14px;
    }

    .flatpickr-current-month {
        font-size: 14px;
    }

    span.flatpickr-weekday {
        font-size: 11px;
    }

    .flatpickr-time {
        max-height: 58px;
    }

    .exemplar-card {
        padding: 12px;
    }

    .exemplar-title {
        font-size: 17px;
        margin-bottom: 8px;
    }

    .exemplar-input-wrap {
        width: 100%;
    }

    .exemplar-input-wrap input[type="number"] {
        font-size: 17px;
        padding-right: 38px;
    }

    .exemplar-unit-label {
        font-size: 14px;
    }

    .exemplar-help {
        font-size: 14px;
    }

    .cds-file-wrap {
        gap: 8px;
        padding: 8px;
    }

    .cds-file-button {
        padding: 9px 11px;
        font-size: 13px;
    }

    .cds-file-name {
        font-size: 13px;
    }

    .cds-video-preview {
        border-radius: 8px;
    }

    .cds-file-preview.is-video,
    .cds-file-preview.is-image {
        max-width: 560px;
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 8px;
    }

    .cds-video-thumb {
        max-width: 104px;
    }

    .cds-video-thumb-remove {
        top: 4px;
        right: 4px;
        width: 20px;
        height: 20px;
        font-size: 14px;
    }

    .cds-video-preview,
    .cds-image-preview {
        height: 130px;
    }

    .cds-video-lightbox {
        padding: 10px;
    }

    .cds-video-lightbox-dialog {
        padding: 10px;
        border-radius: 10px;
    }

    .cds-video-lightbox-close {
        top: 6px;
        right: 6px;
        width: 30px;
        height: 30px;
    }
    
    form input[readonly] {
        font-size: 14px !important;
    }
    
    form button {
        padding: 14px 18px;
        font-size: 15px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .user-info {
        padding: 10px;
        font-size: 12px;
        margin: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .role-badge {
        font-size: 0.7em;
        padding: 2px 6px;
        margin: 5px 0 0 0;
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
    
    .logout-link {
        margin-left: 0;
        margin-top: 10px;
        display: block;
    }
    
    .db-info {
        margin: 30px 15px 10px 15px;
        padding: 15px;
        font-size: 12px;
        max-width: calc(100% - 30px);
    }
    
    .db-info code {
        padding: 2px 4px;
        font-size: 11px;
    }
    
    .success-message,
    .error-message {
        margin: 15px 15px;
        padding: 12px 15px;
        max-width: calc(100% - 30px);
        font-size: 14px;
    }
}

/* Animation subtile */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

form {
    animation: slideIn 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.db-info {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.success-message {
    animation: pulse 0.6s ease-in-out;
}