/* Calendrier maison (mois tunisiens جانفي/فيفري/... + chiffres latins) qui
   remplace visuellement chaque <input type="date"> natif — voir
   assets/js/ar-datepicker.js. Le champ natif reste dans le DOM (valeur/nom
   inchangés, soumission de formulaire inchangée), seulement masqué et
   piloté par ce widget. Design aligné sur tokens.css (partagé public/admin). */
.ar-datepicker {
    position: relative;
    display: inline-block;
    width: 100%;
}

.ar-datepicker__native {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ar-datepicker__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 42px;
    padding: 0.6rem 0.85rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(22, 33, 31, 0.18);
    border-radius: var(--radius-sm, 10px);
    color: var(--ink);
    font: inherit;
    font-size: 0.92rem;
    text-align: start;
    cursor: pointer;
}

.ar-datepicker__trigger.is-empty {
    color: var(--muted);
}

.ar-datepicker__trigger:hover {
    border-color: var(--thermal);
}

.ar-datepicker__trigger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ar-datepicker__trigger svg {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--thermal);
}

/* position:absolute + top/right(ou left) posés en JS (voir positionPanel()) :
   le panneau est porté sur <body> (ou le <dialog> ouvrant englobant), jamais
   sur le wrapper local, pour ne jamais être rogné par un ancêtre quelconque
   avec overflow:hidden (ex. .search-bar et son décor à cercles). */
.ar-datepicker__panel {
    position: absolute;
    z-index: 1000;
    width: max-content;
    min-width: 260px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    background: var(--vapeur, #fff);
    border: 1px solid rgba(22, 33, 31, 0.14);
    border-radius: var(--radius, 14px);
    box-shadow: var(--card-shadow, 0 18px 45px rgba(71, 64, 47, 0.18));
    padding: 0.75rem;
}

.ar-datepicker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.ar-datepicker__label {
    font-weight: 700;
    color: var(--deep-teal, var(--thermal));
    font-size: 0.9rem;
}

.ar-datepicker__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(22, 33, 31, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--thermal);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}

.ar-datepicker__nav:hover {
    background: rgba(31, 110, 106, 0.08);
}

.ar-datepicker__weekdays,
.ar-datepicker__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.ar-datepicker__weekdays span {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    padding-bottom: 0.35rem;
}

.ar-datepicker__day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.ar-datepicker__day:hover:not(:disabled) {
    background: rgba(31, 110, 106, 0.1);
}

.ar-datepicker__day.is-outside {
    color: rgba(22, 33, 31, 0.35);
}

.ar-datepicker__day.is-today {
    box-shadow: inset 0 0 0 1.5px var(--ocre);
}

.ar-datepicker__day.is-selected {
    background: var(--thermal);
    color: #fff;
    font-weight: 700;
}

.ar-datepicker__day:disabled {
    color: rgba(22, 33, 31, 0.25);
    cursor: not-allowed;
}

.ar-datepicker__footer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(22, 33, 31, 0.1);
}

.ar-datepicker__today-btn,
.ar-datepicker__clear-btn {
    border: none;
    background: none;
    font: inherit;
    font-size: 0.78rem;
    color: var(--thermal);
    text-decoration: underline;
    cursor: pointer;
    padding: 0.2rem 0;
}

.ar-datepicker__clear-btn {
    color: var(--muted);
}
