.dp-wrap {
    width: 100%;
    position: relative;
    box-sizing: border-box;
}
.dp-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    background: #F9FAFB;
    border: 1px solid #F3F4F6;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    user-select: none;
    min-height: 48px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.dp-input:hover {
    background: #fff;
    border-color: #E5E7EB;
}
.dp-input.dp-open {
    outline: none;
    background: #ffffff;
    border-color: rgb(var(--color-primary-500));
    box-shadow: 0 0 0 4px rgba(var(--color-primary-500), 0.1);
}
.dp-input-text {
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #9CA3AF;
}
.dp-input-text.dp-has-val {
    color: #1A1A1A;
}
.dp-input-icon {
    color: #9CA3AF;
    flex-shrink: 0;
    transition: color 0.2s;
}
.dp-input.dp-open .dp-input-icon { color: #1A1A1A; }

/* Calendar dropdown */
.dp-cal {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 18px;
    padding: 1.1rem 1rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.10);
    z-index: 9999;
    display: none; /* Completely removes from layout/scroll bounds */
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
    pointer-events: none;
    transition: opacity 0.18s cubic-bezier(0.16,1,0.3,1), transform 0.18s cubic-bezier(0.16,1,0.3,1);
}
.dp-cal.dp-show {
    display: block; /* Restores to layout */
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}
.dp-cal:not(.dp-show) * {
    pointer-events: none !important;
}

/* Header */
.dp-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}
.dp-cal-month {
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
}
.dp-cal-year-btn {
    all: initial;
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
    cursor: pointer;
    border-radius: 6px;
    padding: 1px 6px;
    transition: background 0.12s, color 0.12s;
}
.dp-cal-year-btn:hover { background: #F3F4F6; }
.dp-cal-nav {
    display: flex;
    gap: 4px;
}
.dp-cal-nav-btn {
    all: initial;
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6B7280;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}
.dp-cal-nav-btn:hover { background: #1A1A1A; color: #fff; }

/* Weekdays */
.dp-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.dp-cal-wd {
    text-align: center;
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    font-size: 9px;
    font-weight: 800;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 3px 0;
}

/* Days grid */
.dp-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.dp-cal-day {
    all: initial;
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    box-sizing: border-box;
    width: 100%;
}
.dp-cal-day:hover:not(.dp-day-disabled):not(.dp-day-other):not(.dp-day-selected) {
    background: #F3F4F6;
    color: #111;
}
.dp-day-other { color: #D1D5DB !important; pointer-events: none; }
.dp-day-today { border: 2px solid #1A1A1A; color: #1A1A1A; }
.dp-day-selected { background: #1A1A1A !important; color: #fff !important; border-color: transparent !important; box-shadow: 0 4px 10px rgba(0,0,0,0.18); }
.dp-day-disabled { color: #E5E7EB !important; cursor: not-allowed; pointer-events: none; }

/* Year grid */
.dp-cal-years {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 2px 0 6px;
}
.dp-cal-year {
    all: initial;
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    box-sizing: border-box;
    width: 100%;
}
.dp-cal-year:hover:not(.dp-year-selected) { background: #F3F4F6; color: #111; }
.dp-year-today { border: 2px solid #1A1A1A; color: #1A1A1A; }
.dp-year-selected { background: #1A1A1A !important; color: #fff !important; box-shadow: 0 4px 10px rgba(0,0,0,0.18); }

/* Footer */
.dp-cal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1.5px solid #F3F4F6;
}
.dp-cal-clear {
    all: initial;
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 800;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 7px;
    transition: color 0.12s, background 0.12s;
}
.dp-cal-clear:hover { color: #EF4444; background: #FEF2F2; }
.dp-cal-today {
    all: initial;
    font-family: 'Sitka Heading', 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 800;
    color: #1A1A1A;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 4px 10px;
    border: 1.5px solid #E5E7EB;
    border-radius: 7px;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.dp-cal-today:hover { background: #1A1A1A; color: #fff; border-color: #1A1A1A; }

/* Dark Mode overrides for Date Picker */
.dark .dp-input {
    background: #1E1E1E !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #F8FAFC !important;
    box-shadow: none !important;
}
.dark .dp-input:hover {
    background: #1E1E1E !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
.dark .dp-input.dp-open {
    background: #09090B !important;
    border-color: rgb(var(--color-primary-500)) !important;
    box-shadow: 0 0 0 4px rgba(var(--color-primary-500), 0.15) !important;
}
.dark .dp-input-text {
    color: #64748B !important;
}
.dark .dp-input-text.dp-has-val {
    color: #F8FAFC !important;
}
.dark .dp-input-icon {
    color: #64748B !important;
}
.dark .dp-input.dp-open .dp-input-icon {
    color: #F8FAFC !important;
}
.dark .dp-cal {
    background: #1E1E1E !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5) !important;
}
.dark .dp-cal-month {
    color: #F8FAFC !important;
}
.dark .dp-cal-year-btn {
    color: #F8FAFC !important;
}
.dark .dp-cal-year-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}
.dark .dp-cal-year {
    color: #F8FAFC !important;
}
.dark .dp-cal-year:hover:not(.dp-year-selected) {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}
.dark .dp-year-today {
    border-color: rgb(var(--color-primary-500)) !important;
    color: rgb(var(--color-primary-500)) !important;
}
.dark .dp-year-selected {
    background: rgb(var(--color-primary-500)) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(var(--color-primary-500), 0.3) !important;
}
.dark .dp-cal-nav-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #9CA3AF !important;
}
.dark .dp-cal-nav-btn:hover {
    background: rgb(var(--color-primary-500)) !important;
    color: #fff !important;
}
.dark .dp-cal-wd {
    color: #64748B !important;
}
.dark .dp-cal-day {
    color: #F8FAFC !important;
}
.dark .dp-cal-day:hover:not(.dp-day-disabled):not(.dp-day-other):not(.dp-day-selected) {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}
.dark .dp-day-other {
    color: rgba(255, 255, 255, 0.2) !important;
}
.dark .dp-day-today {
    border-color: rgb(var(--color-primary-500)) !important;
    color: rgb(var(--color-primary-500)) !important;
}
.dark .dp-day-selected {
    background: rgb(var(--color-primary-500)) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(var(--color-primary-500), 0.3) !important;
}
.dark .dp-day-disabled {
    color: rgba(255, 255, 255, 0.1) !important;
}
.dark .dp-cal-footer {
    border-top-color: rgba(255, 255, 255, 0.05) !important;
}
.dark .dp-cal-clear {
    color: #64748B !important;
}
.dark .dp-cal-clear:hover {
    color: #EF4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}
.dark button.dp-cal-today {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #F8FAFC !important;
}
.dark button.dp-cal-today:hover {
    background: rgb(var(--color-primary-500)) !important;
    color: #fff !important;
    border-color: rgb(var(--color-primary-500)) !important;
}
