/* ═══════════════════════════════════════════════════════════
   Spielraum Custom Datepicker — shared frontend + admin
   Clean iOS-style calendar
   ═══════════════════════════════════════════════════════════ */

/* ── Trigger button ─────────────────────────────────────── */
.sp-dp-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.sp-dp-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e6ed;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-family: 'TT Norms Pro','DM Sans',-apple-system,sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #9ca3af;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.sp-dp-trigger svg { flex-shrink: 0; color: #9ca3af; }
.sp-dp-trigger:hover,
.sp-dp-trigger:focus {
    border-color: #151d37;
    outline: none;
    box-shadow: 0 0 0 3px rgba(21,29,55,0.08);
}
.sp-dp-trigger.sp-dp-has-value { color: #151d37; }
.sp-dp-trigger.sp-dp-has-value svg { color: #151d37; }

/* Admin variant (inside .sr-input style) */
.sr-dp-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e4e6ea;
    border-radius: 7px;
    background: white;
    cursor: pointer;
    font-family: 'TT Norms Pro','DM Sans',-apple-system,sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #9ca3af;
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.sr-dp-trigger:hover,
.sr-dp-trigger:focus {
    border-color: #151d37;
    outline: none;
    box-shadow: 0 0 0 3px rgba(21,29,55,0.08);
}
.sr-dp-trigger.sp-dp-has-value { color: #151d37; }
.sr-dp-trigger svg { flex-shrink: 0; color: #9ca3af; }
.sr-dp-trigger.sp-dp-has-value svg { color: #151d37; }

/* ── Popup ──────────────────────────────────────────────── */
.sp-dp-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 9999;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(21,29,55,0.16), 0 2px 8px rgba(21,29,55,0.08);
    padding: 20px;
    min-width: 300px;
    width: 320px;
    animation: sp-dp-in 0.15s ease;
}

/* Admin popup — can open left-aligned or right depending on space */
.sr-dp-popup-right { left: auto; right: 0; }

@keyframes sp-dp-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Calendar inside popup ──────────────────────────────── */
.sp-dp-cal { }

/* Month header */
.sp-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.sp-dp-title {
    font-size: 17px;
    font-weight: 700;
    color: #151d37;
    font-family: 'TT Norms Pro','DM Sans',-apple-system,sans-serif;
    letter-spacing: -0.2px;
}
.sp-dp-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    min-width: unset !important;
    min-height: unset !important;
    border: none !important;
    background: none !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    color: #9ca3af !important;
    transition: background 0.15s, color 0.15s !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    font-size: inherit !important;
}
.sp-dp-nav:hover {
    background: #f0f2f5 !important;
    color: #151d37 !important;
    transform: none !important;
}
.sp-dp-nav svg {
    display: block !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

/* Grid */
.sp-dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px 0;
}

/* Day headers */
.sp-dp-dh {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #b0b8c4;
    padding: 4px 0 10px;
    font-family: 'TT Norms Pro','DM Sans',-apple-system,sans-serif;
}

/* Day cells */
.sp-dp-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
}
.sp-dp-dn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 500;
    font-family: 'TT Norms Pro','DM Sans',-apple-system,sans-serif;
    color: #151d37;
    transition: background 0.12s, color 0.12s;
}

/* Past & disabled — greyed out, no interaction */
.sp-dp-past .sp-dp-dn,
.sp-dp-disabled .sp-dp-dn {
    color: #d1d5db;
    font-weight: 400;
    cursor: default;
}

/* Selectable hover */
.sp-dp-selectable { cursor: pointer; }
.sp-dp-selectable:hover .sp-dp-dn {
    background: #f0f2f5;
}

/* Today — bold, no circle */
.sp-dp-today .sp-dp-dn {
    font-weight: 700;
    color: #151d37;
}

/* Selected — filled dark circle, accent text */
.sp-dp-selected .sp-dp-dn {
    background: #151d37 !important;
    color: #aaccda !important;
    font-weight: 700;
}

/* Empty cells */
.sp-dp-empty { }

/* ── Inline calendar (always visible, no trigger button) ─── */
.sp-dp-inline {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(21,29,55,0.10);
    border: 1.5px solid #e2e6ed;
    padding: 20px;
    max-width: 340px;
}



/* ── Mobile datepicker ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .sp-dp-popup {
        position: fixed !important;
        top: 16px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100vw - 32px) !important;
        max-width: 380px !important;
        min-width: unset !important;
        z-index: 99999 !important;
        border-radius: 16px !important;
        box-shadow: 0 8px 40px rgba(21,29,55,0.25) !important;
    }
}
