/* ==========================================================================
   سنجاقک — انتخابگر تاریخ شمسی
   ========================================================================== */

.jp {
    display: none;
    position: absolute;
    z-index: 90;
    inset-block-start: calc(100% + 6px);
    inset-inline-start: 0;

    width: 268px;
    padding: 12px;

    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(20, 52, 51, .16);

    animation: jp-in .16s ease;
}
.jp.open { display: block; }

@keyframes jp-in { from { opacity: 0; transform: translateY(-6px); } }

.jp-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.jp-title {
    flex: 1;
    text-align: center;
    font-weight: 900;
    font-size: .92rem;
}
.jp-nav {
    width: 30px; height: 30px;
    border: none;
    border-radius: 9px;
    background: var(--cream);
    color: var(--ink-soft);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.jp-nav:hover { background: var(--teal); color: #fff; }

.jp-dow,
.jp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.jp-dow span {
    text-align: center;
    font-size: .68rem;
    font-weight: 800;
    color: var(--muted);
    padding-bottom: 5px;
}

.jp-day {
    aspect-ratio: 1;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s;
}
.jp-day:hover  { background: var(--teal-bg); }
.jp-day.today  { box-shadow: inset 0 0 0 1.5px var(--teal); font-weight: 900; }
.jp-day.on     { background: var(--teal); color: #fff; font-weight: 900; }

.jp-empty { aspect-ratio: 1; }

/* جمعه کم‌رنگ‌تر — ستون آخر در RTL */
.jp-grid .jp-day:nth-child(7n) { color: var(--coral); }

.jp-time {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}
.jp-time label { font-size: .76rem; font-weight: 800; color: var(--muted); }
.jp-time input {
    width: 54px;
    padding: 6px 8px;
    text-align: center;
    border: 1.5px solid var(--line);
    border-radius: 9px;
    background: var(--cream);
    font-family: inherit;
    font-size: .86rem;
    direction: ltr;
}

.jp-foot {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}
.jp-foot button {
    flex: 1;
    border: none;
    border-radius: 9px;
    padding: 7px;
    font-family: inherit;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--cream);
    color: var(--ink-soft);
}
.jp-foot .jp-today:hover { background: var(--teal); color: #fff; }
.jp-foot .jp-clear:hover { background: var(--coral); color: #fff; }

/* روی موبایل وسط صفحه بیاید تا از لبه بیرون نزند */
@media (max-width: 480px) {
    .jp {
        position: fixed;
        inset-block-start: 50%;
        inset-inline-start: 50%;
        transform: translate(50%, -50%);
        width: min(300px, 92vw);
    }
    [dir='rtl'] .jp { transform: translate(50%, -50%); }
}
