/* ==========================================================================
   Egyedi, modern dátumválasztó (a natív böngésző-popup helyett).
   Globálisan minden <input type="date"> mezőre rákerül (datepicker.js).
   ========================================================================== */

/* A natív naptár-ikon elrejtése (mi sajátot teszünk rá). */
input.cdp-input::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: none;
  -webkit-appearance: none;
}

/* Az input a naptár-ikont háttérképként kapja (nincs DOM-wrapper, így semmilyen
   elrendezés nem törik el), és readonly ellenére is normál kinézetű marad. */
input.cdp-input {
  cursor: pointer;
  background-color: #fff;
  padding-right: 2rem;
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 16px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='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");
}
input.cdp-input:read-only {
  background-color: #fff;
  opacity: 1;
}

/* ── A felugró naptár ── */
.cdp-pop {
  position: fixed;
  z-index: 20000;
  width: 300px;
  background: #ffffff;
  border: 1px solid #e6e9ef;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, .20), 0 2px 6px rgba(16, 24, 40, .08);
  padding: 12px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1f2d3d;
  user-select: none;
  animation: cdp-in .12s ease-out;
}
@keyframes cdp-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fejléc: hó/év + navigációs nyilak */
.cdp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cdp-title {
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .2px;
  color: #1f2d3d;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .12s ease;
}
.cdp-title:hover { background: #eef3fb; }
.cdp-nav {
  display: flex;
  gap: 4px;
}
.cdp-nav button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f4f6fa;
  color: #3a4a63;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background-color .12s ease, color .12s ease;
}
.cdp-nav button:hover { background: #2f5597; color: #fff; }

/* Hét napjai fejléc */
.cdp-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cdp-dow span {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: #8a94a6;
  padding: 4px 0;
}
.cdp-dow span.cdp-we { color: #c0607a; }

/* Napok rácsa */
.cdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cdp-day {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  border-radius: 9px;
  cursor: pointer;
  color: #26313f;
  transition: background-color .1s ease, color .1s ease, box-shadow .1s ease;
}
.cdp-day:hover { background: #eef3fb; }
.cdp-day.cdp-out { color: #c2c9d4; }
.cdp-day.cdp-we { color: #c0607a; }
.cdp-day.cdp-today {
  box-shadow: inset 0 0 0 1.5px #3498db;
  font-weight: 700;
}
.cdp-day.cdp-selected {
  background: #2f5597;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(47, 85, 151, .35);
}
.cdp-day.cdp-selected:hover { background: #274a86; }
.cdp-day.cdp-disabled {
  color: #d3d8e0;
  cursor: not-allowed;
  background: transparent;
  text-decoration: line-through;
}
.cdp-day.cdp-disabled:hover { background: transparent; }

/* Lábléc: Törlés / Ma */
.cdp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef0f4;
}
.cdp-foot button {
  border: none;
  background: transparent;
  font-size: .85rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.cdp-clear { color: #8a94a6; }
.cdp-clear:hover { background: #f3f4f6; color: #d64545; }
.cdp-today-btn { color: #2f5597; }
.cdp-today-btn:hover { background: #eef3fb; }

/* Év-választó nézet */
.cdp-years {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 2px;
}
.cdp-year, .cdp-month {
  padding: 10px 4px;
  text-align: center;
  border-radius: 9px;
  cursor: pointer;
  font-size: .85rem;
  transition: background-color .1s ease, color .1s ease;
}
.cdp-year:hover, .cdp-month:hover { background: #eef3fb; }
.cdp-year.cdp-selected, .cdp-month.cdp-selected {
  background: #2f5597;
  color: #fff;
  font-weight: 700;
}
.cdp-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
