/* ============================================================
   Next Eleven – eigene Auswahl-, Datums- und Zeitfelder (felder.js)
   Verwaltung + Kabine. Farben nur aus der Palette, Schrift Archivo / Archivo Expanded.
   ============================================================ */

.admin-body, .kabine-body { color-scheme: dark; accent-color: var(--gold); }

/* ---------- Feld: Textfeld + Symbol, natives Feld versteckt dahinter ---------- */
.nf-wrap { position: relative; display: inline-block; min-width: 10.5em; vertical-align: middle; }
.nf-wrap--time { min-width: 7.5em; }
.field .nf-wrap, .stack-field .nf-wrap { display: block; width: 100%; }
.nf-wrap > .nf-text { width: 100%; padding-right: 44px; font-variant-numeric: tabular-nums; }
.nf-native {
  position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; clip-path: inset(50%);
}
.nf-wrap__btn {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px; max-height: calc(100% - 4px); padding: 0;
  color: var(--gold); background: none; border: 0; border-radius: 8px; cursor: pointer;
  transition: color .2s, background-color .2s;
}
.nf-wrap__btn:hover { color: var(--gold-soft); background: rgba(255,255,255,.05); }
.nf-wrap__btn:disabled { color: var(--dim); cursor: default; background: none; }
/* kleine Tabellenfelder (Einstellungen › Automatik) */
.cell-input.nf-text { padding-right: 36px; }
.nf-wrap .cell-input ~ .nf-wrap__btn { width: 34px; height: 34px; right: 2px; }
.auto__param .nf-wrap--time { width: 112px; min-width: 0; }

/* Auswahlfeld: Platzhalter „Bitte wählen“ grau */
.field select.nf-placeholder { color: var(--dim); }

/* ---------- Popup-Grundform ---------- */
.nf-pop {
  position: fixed; z-index: 130; box-sizing: border-box;
  font: 400 var(--fs-body, 14px)/1.4 var(--f-text); color: var(--white);
  background: var(--black); border: 1px solid var(--anthracite); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .14s ease, transform .18s cubic-bezier(.2,.7,.1,1);
}
.nf-pop.nf-pop--up { transform: translateY(4px); }
.nf-pop.is-open { opacity: 1; transform: none; }
.nf-pop *, .nf-pop *::before, .nf-pop *::after { box-sizing: border-box; }
.nf-pop :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.nf-pop :focus { outline: none; }
.nf-pop :focus-visible { outline: 2px solid var(--sand); outline-offset: 1px; }

/* Am Handy: Blatt von unten über volle Breite */
.nf-scrim { position: fixed; inset: 0; z-index: 129; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .18s ease; }
.nf-scrim.is-open { opacity: 1; }
.nf-pop.nf-pop--sheet {
  left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto !important; max-width: none;
  border-radius: 16px 16px 0 0; border-width: 1px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%); transition: opacity .1s ease, transform .26s cubic-bezier(.2,.7,.1,1);
}
.nf-pop.nf-pop--sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: 8px auto 2px; border-radius: 4px; background: var(--anthracite); }
.nf-pop.nf-pop--sheet.is-open { transform: none; }
.nf-sheet__title { margin: 6px 16px 4px; font-size: var(--fs-meta, 11.5px); font-weight: 600; font-stretch: 125%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nf-cal .nf-sheet__title { margin-left: 0; margin-right: 0; }

/* ---------- Liste (Auswahl, Uhrzeit) ---------- */
.nf-list { display: flex; flex-direction: column; min-width: 180px; max-width: min(440px, calc(100vw - 16px)); overflow: hidden; }
.nf-list__search { padding: 8px 8px 6px; border-bottom: 1px solid var(--line); }
.nf-list__search input {
  width: 100%; height: 40px; padding: 0 12px 0 36px;
  font: 400 var(--fs-body, 14px)/1 var(--f-text); color: var(--white);
  background: #141414 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9a49a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4 4'/%3E%3C/svg%3E") no-repeat 12px 50% / 16px;
  border: 1px solid var(--anthracite); border-radius: 8px;
}
.nf-list__search input::placeholder { color: var(--dim); }
.nf-list__search input:focus-visible, .nf-list__search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.nf-list__ul { list-style: none; margin: 0; padding: 6px; max-height: min(320px, 46vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--anthracite) transparent; }
.nf-list__ul:focus-visible { outline: none; }
.nf-list__opt {
  position: relative; display: flex; align-items: center; min-height: 38px; padding: 8px 34px 8px 12px; border-radius: 8px;
  color: var(--sand); cursor: pointer; user-select: none; overflow-wrap: anywhere;
}
.nf-list__opt.is-empty { color: var(--muted); }
.nf-list__opt.is-active { background: rgba(255,255,255,.07); color: var(--white); }
.nf-list__ul:focus-visible .nf-list__opt.is-active, .nf-list__search input:focus-visible ~ * .is-active { box-shadow: inset 0 0 0 1px rgba(232,226,214,.35); }
.nf-list__opt[aria-selected="true"] { color: var(--gold); font-weight: 600; }
.nf-list__opt[aria-selected="true"]::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 10px; height: 5px; margin-top: -4px;
  border: solid var(--gold); border-width: 0 0 2px 2px; transform: rotate(-45deg);
}
.nf-list__opt.is-empty[aria-selected="true"] { color: var(--muted); font-weight: 400; }
.nf-list__opt.is-empty[aria-selected="true"]::after { content: none; }
.nf-list__opt[aria-disabled="true"] { color: var(--dim); cursor: default; background: none; }
.nf-list__opt[hidden], .nf-list__group[hidden] { display: none; }
.nf-list__group { padding: 10px 12px 4px; font-size: var(--fs-meta, 11px); font-weight: 600; font-stretch: 125%; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nf-list__none { margin: 0; padding: 14px 14px 16px; color: var(--muted); font-size: var(--fs-body, 13.5px); }
.nf-list--mini .nf-list__opt { min-height: 34px; padding-top: 6px; padding-bottom: 6px; font-size: var(--fs-body, 13.5px); }
.nf-list--time { min-width: 120px; }
.nf-list--time .nf-list__opt { font-variant-numeric: tabular-nums; }
.nf-pop--sheet .nf-list__ul { max-height: 58vh; padding: 6px 10px 12px; }
.nf-pop--sheet .nf-list__opt { min-height: 46px; font-size: var(--fs-md, 15px); }
.nf-pop--sheet .nf-list__search { padding: 6px 12px 8px; }
.nf-pop--sheet .nf-list__search input { height: 44px; font-size: var(--fs-lg, 16px); }

/* ---------- Kalender ---------- */
.nf-cal { width: 312px; padding: 10px 12px 8px; }
.nf-pop--sheet.nf-cal { padding: 4px max(16px, calc((100vw - 380px) / 2)) calc(10px + env(safe-area-inset-bottom, 0px)); }
.nf-cal__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.nf-cal__nav { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--sand); transition: background-color .2s, color .2s; }
.nf-cal__nav:hover:not(:disabled) { background: rgba(255,255,255,.06); color: var(--gold); }
.nf-cal__nav:disabled { color: var(--anthracite); cursor: default; }
.nf-cal__title {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 8px;
  font-size: var(--fs-meta, 12px); font-weight: 650; font-stretch: 125%; letter-spacing: .12em; text-transform: uppercase; color: var(--white);
  transition: background-color .2s;
}
.nf-cal__title:hover { background: rgba(255,255,255,.06); }
.nf-cal__caret { width: 0; height: 0; border: 4px solid transparent; border-top: 5px solid var(--gold); border-bottom: 0; transition: transform .2s; }
.nf-cal__caret.is-up { transform: rotate(180deg); }
.nf-cal__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.nf-cal__grid th { padding: 4px 0 6px; font-size: var(--fs-meta, 11px); font-weight: 600; font-stretch: 125%; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; }
.nf-cal__grid th:nth-child(n+6) { color: var(--dim); }
.nf-cal__grid td { padding: 1px; text-align: center; }
.nf-cal__day {
  position: relative; display: inline-grid; place-items: center; width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 8px;
  font-size: var(--fs-body, 14px); font-variant-numeric: tabular-nums; color: var(--white); transition: background-color .15s, color .15s;
}
.nf-cal__day:hover { background: rgba(255,255,255,.07); }
.nf-cal__day.is-out { color: var(--dim); }
.nf-cal__day.is-today { box-shadow: inset 0 0 0 1px rgba(212,175,55,.55); }
.nf-cal__day.is-today::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); }
.nf-cal__day.is-sel, .nf-cal__day.is-sel:hover { background: var(--gold); color: var(--black); font-weight: 600; box-shadow: none; }
.nf-cal__day.is-sel::after { background: var(--black); }
.nf-cal__day[aria-disabled="true"] { color: var(--anthracite); cursor: default; background: none; text-decoration: line-through; text-decoration-color: rgba(255,255,255,.12); }
.nf-cal__years, .nf-cal__months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.nf-cal__years { max-height: 252px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; scrollbar-width: thin; scrollbar-color: var(--anthracite) transparent; }
.nf-cal__months { padding: 2px; }
.nf-cal__cell { min-height: 44px; border-radius: 8px; font-size: var(--fs-body, 14px); font-variant-numeric: tabular-nums; color: var(--sand); transition: background-color .15s; }
.nf-cal__months .nf-cal__cell { min-height: 56px; }
.nf-cal__cell:hover { background: rgba(255,255,255,.07); color: var(--white); }
.nf-cal__cell.is-today { box-shadow: inset 0 0 0 1px rgba(212,175,55,.55); }
.nf-cal__cell.is-sel, .nf-cal__cell.is-sel:hover { background: var(--gold); color: var(--black); font-weight: 600; box-shadow: none; }
.nf-cal__cell[aria-disabled="true"] { color: var(--anthracite); cursor: default; background: none; }
.nf-cal__foot { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.nf-cal__txt {
  min-height: 36px; padding: 0 10px; border-radius: 8px;
  font-size: var(--fs-sm, 13px); font-weight: 500; color: var(--sand); transition: color .2s, background-color .2s;
}
.nf-cal__txt:hover:not(:disabled) { color: var(--white); background: rgba(255,255,255,.06); }
.nf-cal__txt:disabled { color: var(--dim); cursor: default; }
.nf-pop--sheet .nf-cal__day { max-width: 48px; font-size: var(--fs-md, 15px); }
.nf-pop--sheet .nf-cal__nav { width: 44px; height: 44px; }
.nf-pop--sheet .nf-cal__txt { min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  .nf-pop, .nf-pop.nf-pop--sheet, .nf-scrim, .nf-cal__caret { transition: none; }
  .nf-pop, .nf-pop.nf-pop--up, .nf-pop.nf-pop--sheet { transform: none; }
}
