/* =============================================================================
   DESIA PREMIUM DATE PICKER UI
   Input kolom bersih seperti form biasa (format DD-MM-YYYY, mis. 26-11-2026)
   + Popup kalender premium mengambang 3-level (Hari -> Bulan -> Dekade)
   ============================================================================= */

.ds-dp-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-width: 138px;
  vertical-align: middle;
}

.input-group > .ds-dp-wrap {
  flex: 1 1 auto;
  width: 1%;
}

.ds-dp-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
}

/* Tampilan kolom input biasa (seragam dengan .form-control / .ec-input) */
.ds-dp-trigger {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-strong, #d1d5db);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.ds-dp-trigger:hover:not(.is-disabled) {
  border-color: #94a3b8;
}

.ds-dp-trigger:focus-within,
.ds-dp-trigger.is-open {
  border-color: var(--royal-blue, #2563eb);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 37, 99, 235), 0.14);
}

.ds-dp-trigger.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.ds-dp-trigger.is-disabled {
  background: var(--bg-subtle, #f1f5f9);
  border-color: var(--border-soft, #e2e8f0);
  cursor: not-allowed;
}

.ds-dp-input {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  color: var(--text-main, #111827);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  padding: 6px 52px 6px 10px;
  border-radius: 8px;
}

.ds-dp-trigger.is-sm .ds-dp-input {
  font-size: 12.5px;
  padding: 4px 48px 4px 9px;
}

.ds-dp-input::placeholder {
  color: var(--text-muted, #94a3b8);
}

.ds-dp-trigger.is-disabled .ds-dp-input {
  color: var(--text-muted, #64748b);
  cursor: not-allowed;
}

.ds-dp-actions {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ds-dp-clear-mini {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

.ds-dp-clear-mini:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.ds-dp-icon-btn {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

.ds-dp-icon-btn:hover:not(:disabled),
.ds-dp-trigger.is-open .ds-dp-icon-btn {
  background: var(--indigo-soft, #eff6ff);
  color: var(--royal-blue, #2563eb);
}

.ds-dp-icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ds-dp-cal-ico {
  width: 15px;
  height: 15px;
  display: block;
}

/* =============================================================================
   FLOATING CALENDAR POPOVER (COMPACT & CRISP)
   ============================================================================= */
.ds-dp-popover {
  position: fixed;
  z-index: 10680;
  width: 228px;
  background: var(--bg-surface, #ffffff);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16), 0 3px 10px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--border-soft, #e5e7eb);
  font-family: var(--ds-font-family, "Plus Jakarta Sans", "Inter", sans-serif);
  user-select: none;
  animation: dsDpPopIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dsDpPopIn {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ds-dp-popover.is-above {
  animation: dsDpPopInAbove 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dsDpPopInAbove {
  from { opacity: 0; transform: translateY(5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Caret speech-bubble arrow pointing toward input */
.ds-dp-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--bg-surface, #ffffff);
  transform: rotate(45deg);
  top: -5px;
  left: 22px;
  border-left: 1px solid var(--border-soft, #e5e7eb);
  border-top: 1px solid var(--border-soft, #e5e7eb);
  border-top-left-radius: 2px;
  z-index: 0;
}

.ds-dp-popover.is-above .ds-dp-arrow {
  top: auto;
  bottom: -5px;
  border-left: none;
  border-top: none;
  border-right: 1px solid var(--border-soft, #e5e7eb);
  border-bottom: 1px solid var(--border-soft, #e5e7eb);
  border-top-left-radius: 0;
  border-bottom-right-radius: 2px;
}

.ds-dp-card {
  position: relative;
  z-index: 1;
  background: var(--bg-surface, #ffffff);
  border-radius: 9px;
  overflow: hidden;
}

/* Vibrant solid top header */
.ds-dp-head {
  background: linear-gradient(135deg, var(--royal-blue, #2563eb) 0%, var(--indigo-hover, #1d4ed8) 100%);
  color: #ffffff;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.ds-dp-nav-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.ds-dp-nav-btn svg {
  width: 13px;
  height: 13px;
}

.ds-dp-nav-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.ds-dp-nav-btn:active {
  transform: scale(0.94);
}

.ds-dp-title-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: center;
  font-family: inherit;
}

.ds-dp-title-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Body content */
.ds-dp-body {
  padding: 7px 8px 6px;
}

.ds-dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 3px;
}

.ds-dp-weekday {
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--royal-blue, #2563eb);
  padding: 2px 0;
  text-transform: uppercase;
}

.ds-dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.ds-dp-day {
  position: relative;
  height: 25px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-main, #1e293b);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  font-family: inherit;
  padding: 0;
}

.ds-dp-day:hover:not(:disabled) {
  background: var(--indigo-soft, #eff6ff);
  color: var(--royal-blue, #2563eb);
}

.ds-dp-day.is-outside {
  color: #cbd5e1;
  font-weight: 400;
}

body[data-theme-mode="dark"] .ds-dp-day.is-outside,
body[data-theme-mode="dark"] .ds-dp-cell.is-outside {
  color: #475569;
}

.ds-dp-day.is-today:not(.is-selected)::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--royal-blue, #2563eb);
}

/* Selected cell: iconic vibrant bordered square with soft tint */
.ds-dp-day.is-selected,
.ds-dp-cell.is-selected {
  border-color: var(--royal-blue, #2563eb);
  background: var(--indigo-soft, rgba(37, 99, 235, 0.08));
  color: var(--royal-blue, #2563eb);
  font-weight: 700;
}

.ds-dp-day:disabled,
.ds-dp-cell:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

/* Month & Year Decade 4x3 Grid */
.ds-dp-grid-12 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px 4px;
  padding: 4px 2px 2px;
}

.ds-dp-cell {
  height: 32px;
  border: 1.5px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-main, #1e293b);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  font-family: inherit;
  padding: 0;
}

.ds-dp-cell:hover:not(:disabled) {
  background: var(--indigo-soft, #eff6ff);
  color: var(--royal-blue, #2563eb);
}

.ds-dp-cell.is-outside {
  color: #cbd5e1;
  font-weight: 400;
}

/* Compact quick-action footer */
.ds-dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 6px;
  border-top: 1px solid var(--border-soft, #f1f5f9);
  background: var(--bg-subtle, #fafbfd);
}

.ds-dp-foot-btn {
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--royal-blue, #2563eb);
  transition: background 0.14s ease;
  font-family: inherit;
}

.ds-dp-foot-btn:hover {
  background: var(--indigo-soft, #eff6ff);
}

.ds-dp-foot-btn.is-muted {
  color: var(--text-muted, #64748b);
}

.ds-dp-foot-btn.is-muted:hover {
  background: rgba(100, 116, 139, 0.1);
  color: #dc2626;
}

/* =============================================================================
   DESIA COMPACT 24-HOUR TIME PICKER POPOVER (HH:MM)
   ============================================================================= */
.ds-tp-wrap {
  min-width: 105px;
}

.ds-tp-popover {
  width: 196px;
}

.ds-tp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px 8px;
}

.ds-tp-col-lbl {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--royal-blue, #2563eb);
  text-align: center;
  margin-bottom: 4px;
}

.ds-tp-list {
  max-height: 158px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
}

.ds-tp-list::-webkit-scrollbar {
  width: 4px;
}

.ds-tp-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}

.ds-tp-item {
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-main, #1e293b);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ds-tp-item:hover {
  background: var(--indigo-soft, #eff6ff);
  color: var(--royal-blue, #2563eb);
}

.ds-tp-item.is-selected {
  border-color: var(--royal-blue, #2563eb);
  background: var(--indigo-soft, rgba(37, 99, 235, 0.1));
  color: var(--royal-blue, #2563eb);
  font-weight: 700;
}

.ds-tp-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px 8px 6px;
  border-top: 1px solid var(--border-soft, #f1f5f9);
  justify-content: center;
}

.ds-tp-preset-btn {
  border: 1px solid var(--border-soft, #e2e8f0);
  background: var(--bg-subtle, #f8fafc);
  color: var(--text-main, #334155);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  cursor: pointer;
}

.ds-tp-preset-btn:hover {
  border-color: var(--royal-blue, #2563eb);
  color: var(--royal-blue, #2563eb);
  background: var(--indigo-soft, #eff6ff);
}
