/* Kalender-Popover der Datumsfelder — window.ctDatePicker aus
   cybertell-swiss-dates.js, genutzt von dort und von components/_date_input.html. */
.ct-cal {
  position: fixed;
  inset: auto;
  z-index: 1090;
  width: max-content;
  margin: 0;
  padding: var(--pad-2);
  overflow: visible;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.2;
}

.ct-cal-head {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: var(--pad-1);
}
.ct-cal-title {
  flex: 1;
  display: flex;
  gap: 2px;
  min-width: 0;
}
.ct-cal-pick {
  position: relative;
  display: inline-flex;
}
.ct-cal-pick select {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: var(--pad-1) 20px var(--pad-1) var(--pad-1);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 600 13px/1.2 var(--font-sans);
  cursor: pointer;
}
.ct-cal-pick select:hover { background: var(--surface-2); }
.ct-cal-pick::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8px;
  width: 5px;
  height: 5px;
  margin-top: -4px;
  border-right: 1.5px solid var(--ink-4);
  border-bottom: 1.5px solid var(--ink-4);
  transform: rotate(45deg);
  pointer-events: none;
}
.ct-cal-nav {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.ct-cal-nav:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.ct-cal-nav:disabled { color: var(--ink-5); cursor: default; }

.ct-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 32px);
  gap: 2px;
}
.ct-cal-days { display: contents; }
.ct-cal-wd {
  display: grid;
  place-items: center;
  height: 24px;
  color: var(--ink-4);
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ct-cal-day {
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font: 400 13px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ct-cal-day:hover:not(:disabled) { background: var(--surface-3); }
.ct-cal-day.is-out { color: var(--ink-4); }
.ct-cal-day.is-today {
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.ct-cal-day.is-sel,
.ct-cal-day.is-sel:hover {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: none;
}
.ct-cal-day:disabled {
  color: var(--ink-5);
  text-decoration: line-through;
  cursor: not-allowed;
}

.ct-cal-foot {
  display: flex;
  align-items: center;
  gap: var(--pad-1);
  margin-top: var(--pad-1);
  padding-top: var(--pad-1);
  border-top: 1px solid var(--line);
}
.ct-cal-act {
  padding: var(--pad-1);
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-2);
  font: 500 12px/1 var(--font-sans);
  cursor: pointer;
}
.ct-cal-act:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.ct-cal-act:disabled { color: var(--ink-5); cursor: default; }
.ct-cal-act[data-act="clear"] { margin-left: auto; color: var(--ink-3); }
.ct-cal-time {
  width: 64px;
  height: 28px;
  padding: 0 var(--pad-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 500 12px/1 var(--font-mono);
}
.ct-cal-time[aria-invalid="true"] { border-color: var(--danger); }

.ct-cal :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ct-cal .ct-cal-day.is-sel:focus-visible { outline-color: var(--accent-ink); }
