/* Contrôles maison aux jetons Anneau : liste déroulante, calendrier, confirmation, défilement, champs numériques. */

/* ---------- Défilement : barre fine aux jetons, partout ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--chev) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--chev); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--label2); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ---------- Champs : plus de flèches, d'icônes ni de remplissage du navigateur ---------- */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input::-ms-reveal, input::-ms-clear { display: none; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--label);
  caret-color: var(--label);
  -webkit-box-shadow: 0 0 0 1000px var(--fill) inset;
  transition: background-color 9999s ease-out;
}

/* Curseur d'objectif : poignée aux jetons (la piste garde son dégradé de zones) */
.deficit-slider::-webkit-slider-thumb { background: var(--card); border: 2px solid var(--label3); box-shadow: 0 1px 4px var(--shadow-color); }
.deficit-slider::-moz-range-thumb { background: var(--card); border: 2px solid var(--label3); box-shadow: 0 1px 4px var(--shadow-color); }
.deficit-slider:focus-visible { outline: 2px solid var(--tint); outline-offset: 4px; }

/* ---------- Liste déroulante <dk-select> ---------- */
dk-select { display: block; position: relative; min-width: 0; }
dk-select > option { display: none; }
.dk-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px 8px 12px;
  background: var(--fill);
  color: var(--label);
  border: none;
  border-radius: 10px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dk-select-trigger:focus-visible, dk-select.open .dk-select-trigger { outline: none; box-shadow: 0 0 0 2px var(--tint); }
.dk-select-trigger:disabled { opacity: 0.5; cursor: default; }
.dk-select-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-select-chevron { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: var(--label2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
dk-select.open .dk-select-chevron { transform: rotate(180deg); }

.dk-menu {
  position: fixed;
  overflow-y: auto;
  padding: 4px;
  background: var(--card);
  color: var(--label);
  border-radius: 12px;
  box-shadow: 0 8px 30px var(--shadow-color), 0 0 0 0.5px var(--sep);
  animation: dk-pop 0.12s ease-out;
}
.dk-menu-item { padding: 9px 12px; border-radius: 8px; font-size: 15px; cursor: pointer; white-space: nowrap; }
.dk-menu-item.active { background: var(--fill); }
.dk-menu-item[aria-selected="true"] { color: var(--tint); font-weight: 600; }
@keyframes dk-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Champ de date et calendrier ---------- */
.dk-date { display: inline-flex; align-items: center; gap: 4px; position: relative; min-width: 0; }
.dk-date-input { width: 108px; min-width: 0; padding: 6px 10px; font-size: 0.85rem; }
.dk-date-input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--red); }
.dk-date-open { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: transparent; color: var(--label2); }
.dk-date-open:hover { background: var(--fill); color: var(--label); }
.dk-date-open:focus-visible { outline: 2px solid var(--tint); }
.dk-date-open svg { width: 18px; height: 18px; }
.custom-range .dk-date { flex: 1; }
.custom-range .dk-date-input { flex: 1; width: auto; padding: 6px 6px 6px 8px; font-size: 0.8rem; }
.custom-range .dk-date-open { width: 28px; height: 28px; }

.dk-cal {
  position: fixed;
  z-index: 300;
  width: 292px;
  max-width: calc(100vw - 16px);
  padding: 12px;
  background: var(--card);
  color: var(--label);
  border-radius: 16px;
  box-shadow: 0 8px 30px var(--shadow-color), 0 0 0 0.5px var(--sep);
  animation: dk-pop 0.12s ease-out;
}
.dk-cal-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.dk-cal-title { flex: 1; text-align: center; font-weight: 600; font-size: 15px; text-transform: capitalize; }
.dk-cal-nav { width: 32px; height: 32px; border-radius: 50%; background: transparent; color: var(--tint); font-size: 18px; line-height: 1; }
.dk-cal-nav:hover { background: var(--tint-bg); }
.dk-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dk-cal-dow { text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--label2); padding: 4px 0; }
.dk-cal-day { aspect-ratio: 1; min-height: 34px; border-radius: 50%; background: transparent; color: var(--label); font-size: 15px; font-variant-numeric: tabular-nums; }
.dk-cal-day:hover:not(:disabled) { background: var(--fill); }
.dk-cal-day.today { color: var(--tint); font-weight: 700; }
.dk-cal-day.selected { background: var(--tint); color: #fff; }
.dk-cal-day:disabled { color: var(--chev); cursor: default; }
.dk-cal-day:focus-visible, .dk-cal-nav:focus-visible, .dk-cal-today:focus-visible { outline: 2px solid var(--tint); outline-offset: 1px; }
.dk-cal-today { display: block; margin: 8px auto 0; padding: 6px 14px; border-radius: 999px; background: transparent; color: var(--tint); font-weight: 500; }
.dk-cal-today:hover { background: var(--tint-bg); }

/* ---------- Confirmation ---------- */
.confirm-message { margin: 0 0 var(--sp-md); font-size: 15px; line-height: 1.4; }
.confirm-actions { display: flex; gap: var(--sp-sm); justify-content: flex-end; }
@media (max-width: 480px) {
  .confirm-actions .btn { flex: 1; }
  .dk-date-input { width: 96px; }
}

/* Le conteneur porte .input pour la mise en page : le style de champ vit sur le bouton */
dk-select.input { padding: 0; background: none; border: none; box-shadow: none; }
