/* =============================================================
   Taghvimam prototype — shared tokens & base components
   MD3-flavored, fully RTL, light + dark. All colors live here.
   ============================================================= */

/* Dana (FaNum) — local Persian-figure family, weights 400–800 */
@font-face { font-family: 'DanaFaNum'; src: url('../Dana/woff2/DanaFaNum-Regular.woff2') format('woff2'), url('../Dana/woff/DanaFaNum-Regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'DanaFaNum'; src: url('../Dana/woff2/DanaFaNum-Medium.woff2') format('woff2'), url('../Dana/woff/DanaFaNum-Medium.woff') format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'DanaFaNum'; src: url('../Dana/woff2/DanaFaNum-DemiBold.woff2') format('woff2'), url('../Dana/woff/DanaFaNum-DemiBold.woff') format('woff'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'DanaFaNum'; src: url('../Dana/woff2/DanaFaNum-Bold.woff2') format('woff2'), url('../Dana/woff/DanaFaNum-Bold.woff') format('woff'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'DanaFaNum'; src: url('../Dana/woff2/DanaFaNum-ExtraBold.woff2') format('woff2'), url('../Dana/woff/DanaFaNum-ExtraBold.woff') format('woff'); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  /* brand — unified blue (brief §2.1) */
  --brand: #2563EB;
  --brand-deep: #004AC6;
  --link: #004AC6;
  --btn-bg: #2563EB;
  --btn-fg: #FFFFFF;
  --brand-container: color-mix(in oklch, #2563EB 11%, #FFFFFF);
  --on-brand-container: #0B2E6B;

  /* surfaces (5-step ramp, brief §2.1) */
  --bg: #FBFBFC;
  --surface: #FFFFFF;
  --surface-1: #F5F6F8;
  --surface-2: #EFEFF2;
  --surface-3: #E8E9ED;

  /* content */
  --fg: #1B1E24;
  --muted: #565D6A;
  --faint: #8A909C;
  --border: #E3E5EA;
  --border-strong: #CFD3DB;

  /* semantic */
  --holiday: #D41317;          /* brief: distinct from error red */
  --error: #BA1A1A;
  --warn: #9A5B00;
  --warn-container: color-mix(in oklch, #F59E0B 18%, #FFFFFF);
  --warn-border: color-mix(in oklch, #F59E0B 45%, #FFFFFF);
  --ok: #067A57;
  --ok-dot: #059669;

  /* categorical event palette (unified 8) */
  --ev-1: #2563EB;  /* آبی */
  --ev-2: #059669;  /* سبز */
  --ev-3: #0891B2;  /* فیروزه‌ای */
  --ev-4: #D97706;  /* کهربایی */
  --ev-5: #DC2626;  /* قرمز */
  --ev-6: #DB2777;  /* صورتی */
  --ev-7: #7C3AED;  /* بنفش */
  --ev-8: #92400E;  /* قهوه‌ای */

  /* misc */
  --scrim: rgb(12 16 24 / 0.45);
  --focus: color-mix(in oklch, #2563EB 55%, transparent);
  --focus-soft: color-mix(in oklch, #2563EB 16%, transparent);
  --shadow-1: 0 1px 2px rgb(16 24 40 / .06), 0 1px 3px rgb(16 24 40 / .08);
  --shadow-2: 0 4px 12px rgb(16 24 40 / .10), 0 2px 4px rgb(16 24 40 / .06);
  --shadow-3: 0 12px 32px rgb(16 24 40 / .16), 0 4px 10px rgb(16 24 40 / .08);
  --inverse-bg: #1B1E24;
  --inverse-fg: #F4F5F7;

  /* type — single family: data-dense RTL product (charter exception) */
  --font: 'DanaFaNum', 'Segoe UI', Tahoma, system-ui, -apple-system, sans-serif;

  /* shape & motion (brief §2.2) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #8FB4FF;
  --brand-deep: #A8C8FF;
  --link: #9DBBFF;
  --btn-bg: #A8C8FF;
  --btn-fg: #0B2E6B;
  --brand-container: color-mix(in oklch, #8FB4FF 16%, #171B21);
  --on-brand-container: #D6E2FF;

  --bg: #101318;
  --surface: #181C22;
  --surface-1: #1F242B;
  --surface-2: #262B33;
  --surface-3: #2E343D;

  --fg: #E5E7EC;
  --muted: #A6ACB8;
  --faint: #7A8090;
  --border: #333945;
  --border-strong: #454C59;

  --holiday: #FF8A80;          /* brief §2.1 dark holiday token */
  --error: #FFB4AB;
  --warn: #F5C064;
  --warn-container: color-mix(in oklch, #F59E0B 16%, #171B21);
  --warn-border: color-mix(in oklch, #F59E0B 40%, #171B21);
  --ok: #8AD8B4;
  --ok-dot: #57C896;

  --scrim: rgb(0 0 0 / 0.58);
  --focus: color-mix(in oklch, #8FB4FF 60%, transparent);
  --focus-soft: color-mix(in oklch, #8FB4FF 18%, transparent);
  --inverse-bg: #E5E7EC;
  --inverse-fg: #171B21;
  color-scheme: dark;
}

/* ── reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: color-mix(in oklch, var(--brand) 25%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding-inline: 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 14px; font-weight: 600; line-height: 1;
  white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease),
              box-shadow .16s var(--ease), transform .08s var(--ease),
              color .16s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn.primary:hover:not(:disabled) {
  background: color-mix(in oklch, var(--btn-bg) 90%, var(--btn-fg));
  box-shadow: var(--shadow-1);
}
.btn.tonal { background: var(--brand-container); color: var(--on-brand-container); }
.btn.tonal:hover:not(:disabled) { background: color-mix(in oklch, var(--brand) 20%, var(--surface)); }
.btn.outline { border-color: var(--border-strong); color: var(--fg); background: var(--surface); }
.btn.outline:hover:not(:disabled) { background: var(--surface-1); border-color: var(--muted); }
.btn.text { color: var(--link); padding-inline: 10px; }
.btn.text:hover:not(:disabled) { background: var(--brand-container); }
.btn.danger-text { color: var(--holiday); padding-inline: 10px; }
.btn.danger-text:hover:not(:disabled) { background: color-mix(in oklch, var(--holiday) 12%, transparent); }
.btn.sm { height: 32px; padding-inline: 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn svg { width: 17px; height: 17px; flex: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--muted);
  transition: background .15s var(--ease), color .15s var(--ease);
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn svg { width: 20px; height: 20px; }

/* ── fields ───────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--fg);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-soft);
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  padding-inline-end: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A909C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: left 12px center;
  cursor: pointer;
}
.field .err { color: var(--holiday); font-size: 12px; display: none; }
.field.invalid .err { display: block; }
.field.invalid .input, .field.invalid .select { border-color: var(--holiday); }
.field.invalid .input:focus, .field.invalid .select:focus { box-shadow: 0 0 0 3px color-mix(in oklch, var(--holiday) 14%, transparent); }

/* ── dialog / sheet ───────────────────────────────────────── */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 18px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s var(--ease);
}
.dialog-backdrop.open { opacity: 1; pointer-events: auto; }
.dialog {
  width: min(520px, 100%);
  max-height: min(86vh, 780px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  transform: translateY(14px) scale(.985);
  transition: transform .22s var(--ease);
}
.dialog-backdrop.open .dialog { transform: none; }
.dialog::before { content: none; }
.dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px 0;
}
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.dialog-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px 16px;
  border-top: 1px solid var(--border);
}
.dialog-foot .sep { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 719px) {
  .dialog-backdrop { place-items: end stretch; padding: 0; align-items: end; }
  .dialog {
    width: 100%; max-height: 92dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(102%);
    padding-top: 0;
  }
  .dialog::before {
    content: ''; display: block;
    width: 36px; height: 4px; border-radius: 99px;
    background: var(--border-strong);
    margin: 10px auto 2px; flex: none;
  }
  .dialog-backdrop.open .dialog { transform: none; }
}

/* ── chips / badges / tabs ────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding-inline: 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px; font-weight: 500; color: var(--fg);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { background: var(--surface-1); }
.chip.selected {
  background: var(--brand-container); border-color: transparent;
  color: var(--on-brand-container); font-weight: 700;
}
.badge {
  min-width: 20px; height: 20px; padding-inline: 6px;
  border-radius: 99px;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.tabpill {
  height: 36px; padding-inline: 15px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s;
}
.tabpill:hover { background: var(--surface-1); color: var(--fg); }
.tabpill.active {
  background: var(--brand-container); color: var(--on-brand-container); font-weight: 700;
}
.tabpill .badge { background: color-mix(in oklch, var(--brand) 18%, transparent); color: var(--link); }

/* ── checkbox (round, tintable) & switch ──────────────────── */
.ccheck {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid; place-items: center;
  flex: none; cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
  background: var(--surface);
}
.ccheck svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.5); transition: .15s var(--ease); }
.ccheck[aria-checked="true"] { background: var(--c, var(--brand)); border-color: var(--c, var(--brand)); }
.ccheck[aria-checked="true"] svg { opacity: 1; transform: none; }

.switch {
  width: 44px; height: 26px; border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  position: relative; flex: none; cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.switch::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--faint);
  transition: inset-inline-start .18s var(--ease), background .18s var(--ease);
}
.switch[aria-checked="true"] { background: var(--brand); border-color: var(--brand); }
.switch[aria-checked="true"]::after { inset-inline-start: calc(100% - 21px); background: #fff; }

/* ── menu (popover list) ──────────────────────────────────── */
.menu {
  position: fixed; z-index: 95;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: 6px;
  display: flex; flex-direction: column;
}
.menu > button, .menu > a {
  display: flex; align-items: center; gap: 10px;
  min-height: 38px; padding-inline: 11px;
  border-radius: 8px;
  font-size: 13.5px; color: var(--fg);
  text-align: start; width: 100%;
  transition: background .12s;
}
.menu > button:hover, .menu > a:hover { background: var(--surface-1); }
.menu svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.menu .danger, .menu .danger svg { color: var(--holiday); }

/* ── FAB / toast / spinner ────────────────────────────────── */
.fab {
  position: fixed;
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--btn-bg); color: var(--btn-fg);
  box-shadow: var(--shadow-2);
  display: grid; place-items: center;
  z-index: 45;
  transition: box-shadow .16s var(--ease), transform .12s var(--ease);
}
.fab:hover { box-shadow: var(--shadow-3); transform: translateY(-2px); }
.fab:active { transform: scale(.96); }
.fab svg { width: 24px; height: 24px; }

.toast-wrap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 120; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 14px;
  background: var(--inverse-bg); color: var(--inverse-fg);
  border-radius: var(--r-md);
  padding: 11px 18px;
  box-shadow: var(--shadow-2);
  font-size: 13.5px; font-weight: 500;
  animation: toast-in .24s var(--ease);
  pointer-events: auto;
}
.toast .act {
  font-weight: 700; cursor: pointer;
  color: color-mix(in oklch, var(--brand) 72%, var(--inverse-fg));
}
.toast .act:hover { text-decoration: underline; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.spinner {
  width: 19px; height: 19px; border-radius: 50%;
  border: 2px solid color-mix(in oklch, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: spin .8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── mini Jalali month grid (shared: sidebar, pickers, year view) ── */
.wrow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.wrow span { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); padding-block: 3px; }
.wrow span.fri { color: var(--holiday); }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mday {
  aspect-ratio: 1; min-width: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12px; font-weight: 500; color: var(--fg);
  cursor: pointer; position: relative;
  transition: background .12s var(--ease);
}
.mday:hover { background: var(--surface-2); }
.mday.out { opacity: .45; }
.mday.hol span { color: var(--holiday); }
.mday.today { background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; }
.mday.today:hover { background: color-mix(in oklch, var(--btn-bg) 88%, var(--btn-fg)); }
.mday.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.mday .dot {
  position: absolute; bottom: 3px; inset-inline-start: 50%; transform: translateX(50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--dc, var(--muted));
}

/* ── shared components (app + docs render from these exact rules) ── */

/* task list, task row, priority dot — used by tasks view and docs specimens */
.quick-add { position: relative; margin-bottom: 14px; }
.quick-add .input { height: 46px; padding-inline-start: 44px; border-radius: var(--r-md); }
.quick-add > svg { position: absolute; top: 14px; inset-inline-start: 14px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 13px 15px; cursor: pointer; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.task:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.task .ccheck { margin-top: 3px; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.task-notes { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.task.done .task-notes { color: var(--faint); }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.task-due { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.task-due.overdue { color: var(--holiday); }
.pri { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pri-2 { background: var(--brand); }
.pri-3 { background: var(--ev-4); }
.pri-4 { background: var(--ev-5); }

/* form feedback banners — inline messages inside forms (login, future forms) */
@keyframes banner-in { from { opacity: 0; transform: translateY(6px); } }
.error-banner {
  display: none; align-items: center; gap: 9px;
  background: color-mix(in oklch, var(--holiday) 8%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--holiday) 35%, transparent);
  color: var(--holiday);
  border-radius: var(--r-sm);
  padding: 9px 13px; font-size: 13px; font-weight: 600;
}
.error-banner.on { display: flex; animation: banner-in .2s var(--ease); }
.error-banner svg { width: 17px; height: 17px; flex: none; }
.ok-banner {
  display: none; align-items: center; justify-content: center; gap: 9px;
  background: color-mix(in oklch, var(--ok-dot) 10%, var(--surface));
  color: var(--ok);
  border-radius: var(--r-sm); padding: 9px 13px; font-size: 13.5px; font-weight: 700;
}
.ok-banner.on { display: flex; }
.ok-banner svg { width: 17px; height: 17px; }

/* text button — quiet inline action (بازگشت / ارسال مجدد) */
.linkish { color: var(--link); font-weight: 600; cursor: pointer; border-radius: 6px; }
.linkish:hover { background: var(--brand-container); }
.linkish:disabled { color: var(--faint); cursor: default; background: none; }

/* LTR numeric input variant (phone numbers, codes) */
.input.ltr { direction: ltr; text-align: left; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* ── utilities ────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ltr { direction: ltr; }
.num, .tnum { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ── shared component library ───────────────────────────────
   Extracted from calendar.html / login.html so every page
   (app + docs) renders the exact production styles. */

/* conflict / sync banner */
.cf-banner {
  flex: none; display: flex; align-items: center; gap: 10px;
  background: var(--warn-container);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn);
  font-size: 13px; font-weight: 600;
  padding: 7px 16px;
}
.cf-banner[hidden] { display: none; }
.cf-banner svg { width: 17px; height: 17px; flex: none; }
.cf-banner button { margin-inline-start: auto; color: var(--warn); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; border-radius: 8px; padding: 4px 8px; }
.cf-banner button:hover { background: color-mix(in oklch, var(--warn) 12%, transparent); }

/* event chip (month cell) — color comes from --c (calendar color) */
.ev-chip { display: flex; align-items: center; gap: 5px; margin-top: 3px; padding: 1.5px 6px; border-radius: 6px;
  background: color-mix(in oklch, var(--c) 13%, transparent);
  border-inline-start: 3px solid var(--c);
  font-size: 11px; line-height: 1.55; white-space: nowrap; overflow: hidden; }
.ev-chip .tt { overflow: hidden; text-overflow: ellipsis; }
.ev-chip .tm { color: var(--muted); font-size: 10px; flex: none; }

/* Jalali date-picker popover */
.dpop { position: fixed; z-index: 96; width: 272px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-3); padding: 12px 14px 10px; }
.dpop-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.dpop-head b { flex: 1; text-align: center; font-size: 13.5px; }
.dpop .mday { font-size: 12.5px; }
.dpop-foot { display: flex; justify-content: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dpop-foot.split { justify-content: space-between; }

/* joined date-time pill: [ تاریخ | ساعت:دقیقه ] */
.dt-field { display: flex; align-items: stretch; min-height: 44px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.dt-field.open, .dt-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand) 14%, transparent); }
.field.invalid .dt-field, .field.invalid .dt-field.open, .field.invalid .dt-field:focus-within { border-color: var(--holiday); box-shadow: 0 0 0 3px color-mix(in oklch, var(--holiday) 14%, transparent); }
.dt-date { flex: 1; min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 13px; background: none; border: 0; font: inherit; font-size: 14px; color: var(--fg); cursor: pointer; text-align: start; transition: background .14s var(--ease); }
.dt-date svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.dt-date:hover { background: color-mix(in oklch, var(--fg) 4%, transparent); }
.dt-sep { flex: none; width: 1px; margin-block: 8px; background: var(--border); }
.dt-time { display: flex; align-items: center; flex: none; padding: 0 5px; }
.dt-colon { flex: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 0 1px; }
.dt-t { appearance: none; -webkit-appearance: none; flex: none; width: 46px; min-height: 42px; padding: 0 2px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--fg); text-align: center; text-align-last: center; cursor: pointer; border-radius: 8px; transition: background .14s var(--ease); }
.dt-t:hover { background: color-mix(in oklch, var(--fg) 5%, transparent); }
.allday-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-1); border-radius: 10px; padding: 9px 13px; }
.allday-row span { font-size: 13.5px; font-weight: 600; }
.time-off { opacity: .45; pointer-events: none; }

/* OTP boxes (login, future flows) */
.otp-hint {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--warn-container);
  border: 1px solid var(--warn-border);
  color: var(--warn);
  border-radius: var(--r-sm);
  padding: 7px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; width: fit-content; margin: 0 auto;
  transition: filter .15s;
}
.otp-hint:hover { filter: brightness(.97); }
.otp-hint .num { letter-spacing: .18em; }
.otp-boxes { position: relative; display: flex; justify-content: center; gap: 8px; direction: ltr; }
.otp-boxes .box {
  width: 46px; height: 52px;
  border: 1.5px solid var(--border-strong); border-radius: 10px;
  background: var(--surface-1);
  display: grid; place-items: center;
  font-size: 21px; font-weight: 700;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.otp-boxes .box.fill { background: var(--surface); border-color: var(--brand); }
.otp-boxes .box.cur { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-soft); }
.otp-boxes .box.bad { border-color: var(--holiday); background: color-mix(in oklch, var(--holiday) 7%, var(--surface)); }
.otp-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: default; caret-color: transparent;
  font-size: 16px; letter-spacing: 999px; direction: ltr; border: 0; background: none; outline: none;
}
.otp-boxes.shake { animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(6px); } 40%, 80% { transform: translateX(-6px); } }
