/* Persian date and time pickers (wwwroot/js/jdate.js). The colours come from the page: the panel's variables
   (--panel-solid, --text, --gold…) or the portal's (--surface, --ink, --accent…), light or dark. */
.jd-pop {
    --jd-bg: var(--panel-solid, var(--surface, #fff));
    --jd-text: var(--text, var(--ink, #1c2430));
    --jd-strong: var(--strong, var(--heading, #152238));
    --jd-muted: var(--muted, #677082);
    --jd-line: var(--line-strong, var(--line, #e6dfd1));
    --jd-accent: var(--gold, var(--accent, #a8822f));
    --jd-accent-ink: #1a1408;
    --jd-hover: rgba(127, 127, 127, 0.12);
    --jd-fri: #d0675a;
    position: absolute;
    z-index: 2000;
    width: 300px;
    padding: 12px;
    border: 1px solid var(--jd-line);
    border-radius: 18px;
    background: var(--jd-bg);
    color: var(--jd-text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 24px 48px rgba(0, 0, 0, 0.22);
    direction: rtl;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.jd-pop.is-in { opacity: 1; transform: none; }
.jd-pop button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.jd-pop button:disabled { cursor: default; opacity: 0.3; }
.jd-pop button:focus-visible { outline: 2px solid var(--jd-accent); outline-offset: 1px; }
.jd-pop [hidden] { display: none !important; }

.jd-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.jd-title { flex: 1; height: 36px; border-radius: 10px; font-weight: 700; color: var(--jd-strong) !important; }
.jd-title:hover, .jd-nav:hover:not(:disabled) { background: var(--jd-hover) !important; }
.jd-nav { width: 36px; height: 36px; border-radius: 10px; font-size: 20px !important; display: grid; place-items: center; }
.jd-nav .fa { width: auto; }

.jd-week, .jd-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jd-week span { height: 28px; display: grid; place-items: center; font-size: 12px; color: var(--jd-muted); }
.jd-week .is-fri { color: var(--jd-fri); }
.jd-day { height: 36px; border-radius: 10px; font-variant-numeric: tabular-nums; transition: background 0.12s ease; }
.jd-day:hover:not(:disabled):not(.is-sel) { background: var(--jd-hover) !important; }
.jd-day.is-fri { color: var(--jd-fri) !important; }
.jd-day.is-today { box-shadow: inset 0 0 0 1.5px var(--jd-accent); font-weight: 700; }
.jd-day.is-sel, .jd-cell.is-sel { background: var(--jd-accent) !important; color: var(--jd-accent-ink) !important; font-weight: 700; }

.jd-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.jd-cell { height: 44px; border-radius: 12px; font-size: 13.5px; }
.jd-cell:hover:not(:disabled):not(.is-sel) { background: var(--jd-hover) !important; }
.jd-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--jd-accent); }

.jd-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--jd-line); }
.jd-hint { flex: 1; text-align: center; font-size: 12px; color: var(--jd-muted); }
.jd-link { padding: 6px 10px; border-radius: 9px; font-size: 13px; color: var(--jd-accent) !important; font-weight: 600; }
.jd-link:hover { background: var(--jd-hover) !important; }
.jd-link.is-muted { color: var(--jd-muted) !important; font-weight: 500; }
.jd-ok { margin-inline-start: auto; padding: 7px 18px; border-radius: 10px; background: var(--jd-accent) !important; color: var(--jd-accent-ink) !important; font-weight: 700; }

/* time: hour and minute chips */
.jd-pop.is-time { width: 316px; }
.jd-time-now { flex: 1; text-align: center; font-size: 22px; font-weight: 700; color: var(--jd-strong); font-variant-numeric: tabular-nums; padding: 2px 0 4px; }
.jd-sub { margin: 6px 2px 6px; font-size: 12px; color: var(--jd-muted); }
.jd-hours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; direction: ltr; }
.jd-mins { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; direction: ltr; }
.jd-chip { height: 34px; border-radius: 9px; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.jd-chip:hover:not(.is-sel) { background: var(--jd-hover) !important; }
.jd-chip.is-sel { background: var(--jd-accent) !important; color: var(--jd-accent-ink) !important; font-weight: 700; }

/* phones: a bottom sheet */
.jd-shade { position: fixed; inset: 0; z-index: 1999; background: rgba(5, 9, 20, 0.42); animation: jd-fade 0.18s ease; }
.jd-pop.is-sheet { position: fixed; inset: auto 0 0 0; width: auto; max-width: 480px; margin: 0 auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border-bottom: 0; transform: translateY(24px); transform-origin: bottom center; font-size: 15px; }
.jd-pop.is-sheet.is-in { transform: none; }
.jd-pop.is-sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: -4px auto 10px; border-radius: 4px; background: var(--jd-line); }
.jd-pop.is-sheet .jd-day { height: 44px; }
.jd-pop.is-sheet .jd-chip { height: 40px; }
@keyframes jd-fade { from { opacity: 0; } }

/* the fields: a calendar / clock glyph at their end, and the pointer of a button */
input[data-jdate], input[data-jtime] {
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 38px !important;
    font-variant-numeric: tabular-nums;
}
input[data-jdate] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8822f' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
input[data-jtime] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8822f' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: reduce) { .jd-pop, .jd-shade { transition: none; animation: none; } }
