/* ═══ اتوماسیون اداری سامان رایان — دیزاین‌سیستم v2 ═══
   توکن‌ها در tokens.css؛ این فایل فقط از لایه معنایی می‌خواند.
   ⚠️ alias های سازگاری (button.ghost و…) تا پایان مهاجرت JS می‌مانند. */

@font-face { font-family: 'Estedad'; font-weight: 400; font-display: swap; src: url('/fonts/Estedad-400.woff2') format('woff2'); }
@font-face { font-family: 'Estedad'; font-weight: 700; font-display: swap; src: url('/fonts/Estedad-700.woff2') format('woff2'); }
@font-face { font-family: 'Estedad'; font-weight: 900; font-display: swap; src: url('/fonts/Estedad-900.woff2') format('woff2'); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: 'Estedad', system-ui, sans-serif;
  color: var(--text); font-size: var(--fs-md); line-height: var(--lh-base);
  overflow-x: hidden;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(57,185,200,.055), transparent 60%),
    radial-gradient(700px 420px at 0% 110%, rgba(43,48,84,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* ── آیکون SVG ── */
.ico-svg {
  width: 18px; height: 18px; flex: none; vertical-align: -3px;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.sb-item .ico .ico-svg { width: 19px; height: 19px; }
.pop-item .ico-svg { width: 16px; height: 16px; margin-inline-end: .35rem; }
.ico-flip { transform: scaleX(-1); }

/* ── پایه ── */
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.error { color: var(--danger-text); margin-top: var(--sp-2); font-size: var(--fs-sm); }
a { color: var(--link); }
kbd {
  font-family: inherit; font-size: var(--fs-2xs); background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--r-xs); padding: .1rem .4rem; color: var(--text-3);
}

/* ── utility (برای حذف استایل‌های inline) ── */
.ltr, .num { direction: ltr; unicode-bidi: embed; }
.num, table td.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row-wrap { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--sp-2); }
.grow { flex: 1; min-width: 0; }
.push-end { margin-inline-start: auto; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }
.fs-xs { font-size: var(--fs-xs); } .fs-sm { font-size: var(--fs-sm); }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.w-10 { max-width: 10rem; } .w-14 { max-width: 14rem; } .w-20 { max-width: 20rem; }

/* اعلان درون‌صفحه‌ای — جایگزین بنرهای border-right دستی */
.callout {
  border-inline-start: 4px solid var(--accent-strong); background: var(--accent-tint);
  border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); margin-block: var(--sp-3);
  font-size: var(--fs-sm);
}
.callout-warn { border-inline-start-color: var(--warn); background: var(--warn-soft); }
.callout-danger { border-inline-start-color: var(--danger); background: var(--danger-soft); }

/* ── فرم‌های پایه ── */
input, select, textarea {
  border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: .52rem .7rem;
  font: inherit; background: var(--surface); color: var(--text); width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
input::placeholder { color: var(--text-3); }

/* ── دکمه‌ها (class-based؛ روی <a> هم کار می‌کند) ── */
button, .btn, a.outline, a.ghost {
  font: inherit; border: 0; border-radius: var(--r-sm); padding: .55rem 1.05rem; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  text-decoration: none; min-height: 36px; line-height: var(--lh-tight);
  transition: filter var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
button:hover, .btn:hover { background: var(--brand-hover); filter: none; }
button:active, .btn:active { transform: translateY(1px); background: var(--brand-active); }
:is(button, .btn, a).accent { background: var(--accent-strong); }
:is(button, .btn, a).accent:hover { background: var(--accent-hover); }
:is(button, .btn, a).ghost {
  background: transparent; color: var(--text-2); font-weight: 600;
  padding: .4rem .7rem; border: 1.5px solid var(--border-2);
}
:is(button, .btn, a).ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-2); }
:is(button, .btn, a).outline { background: transparent; border: 1.5px solid var(--border-2); color: var(--text-2); font-weight: 600; }
:is(button, .btn, a).outline:hover { border-color: var(--accent-strong); color: var(--accent-strong); background: transparent; }
:is(button, .btn, a).danger { background: var(--danger); color: #fff; }
:is(button, .btn, a).danger:hover { background: var(--danger); filter: brightness(1.08); }
:is(button, .btn, a).ghost.danger { background: transparent; color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 40%, var(--border-2)); }
:is(button, .btn, a).ghost.danger:hover { background: var(--danger-soft); }
:is(button, .btn, a).ok { background: var(--ok); color: #fff; }
:is(button, .btn, a).secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); }
:is(button, .btn, a).sm { padding: .3rem .7rem; font-size: var(--fs-sm); min-height: 30px; width: auto; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1.5px solid var(--border-2); color: var(--text-2); font-weight: 600; }
.icon-btn {
  background: transparent; color: var(--text-2); padding: .35rem .55rem; border-radius: var(--r-sm);
  font-size: var(--fs-lg); line-height: 1; min-height: 36px; min-width: 36px; border: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* دکمه در حال کار */
.btn.loading, button.loading { pointer-events: none; opacity: .75; }
.spin {
  display: inline-block; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-inline-start-color: transparent;
  animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── لاگین ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
  background:
    radial-gradient(rgba(255,255,255,.055) 1px, transparent 1.5px),
    radial-gradient(900px 520px at 88% -8%, rgba(57,185,200,.35), transparent 60%),
    radial-gradient(700px 480px at 2% 108%, rgba(57,185,200,.18), transparent 55%),
    linear-gradient(135deg, #20243F 0%, #2B3054 55%, #171B33 100%);
  background-size: 24px 24px, auto, auto, auto;
}
.login-card {
  background: var(--surface); border-radius: var(--r-xl); padding: 2.4rem 2.2rem;
  width: min(390px, 94vw); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; gap: var(--sp-4); position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: var(--grad-brand-x);
}
.login-logo { display: flex; justify-content: center; }
.login-logo img {
  height: 52px; background: var(--teal-50); border-radius: var(--r-md);
  padding: 8px; box-sizing: content-box;
}
.login-card h1 { font-size: var(--fs-xl); font-weight: 900; text-align: center; }
.login-card .sub { text-align: center; color: var(--text-2); font-size: var(--fs-sm); margin-top: -.7rem; }
.login-card label { display: flex; flex-direction: column; gap: .35rem; font-size: var(--fs-sm); color: var(--text-2); font-weight: 700; }
.show-pass { flex-direction: row !important; align-items: center; gap: .4rem; font-weight: 500 !important; color: var(--text-2); cursor: pointer; margin-top: -.4rem; }
.show-pass input { width: auto; }

/* ── اپ‌شل ── */
.app-shell { display: flex; min-height: 100vh; }

/* سایدبار — هویت برند: سرمه گرادیانی در هر دو تم */
.sidebar {
  width: var(--sb-w); flex: none; display: flex; flex-direction: column;
  background: var(--sb-bg); color: var(--sb-text);
  position: sticky; top: 0; height: 100vh; transition: width var(--t-med) var(--ease); z-index: var(--z-sidebar);
}
.sb-header { display: flex; align-items: center; gap: .6rem; padding: 1rem .9rem .8rem; }
.sb-logo { height: 30px; background: #fff; border-radius: var(--r-sm); padding: 3px; box-sizing: content-box; }
.sb-title { font-weight: 900; font-size: var(--fs-lg); flex: 1; color: var(--sb-text-strong); }
.sb-header .icon-btn { color: var(--sb-text); }
.sb-header .icon-btn:hover { background: var(--sb-hover-bg); color: var(--sb-text-strong); }
.sb-nav { flex: 1; overflow-y: auto; padding: .3rem .6rem 1rem; scrollbar-width: thin; }
.sb-section {
  font-size: var(--fs-2xs); font-weight: 700; color: color-mix(in srgb, var(--sb-text) 65%, transparent);
  margin: 1rem .5rem .35rem; letter-spacing: .4px;
}
.sb-item {
  position: relative; display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .5rem .65rem; border-radius: var(--r-sm); color: var(--sb-text);
  text-decoration: none; font-size: var(--fs-md); font-weight: 600; margin-bottom: 2px;
  background: none; cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.sb-item:hover { background: var(--sb-hover-bg); color: var(--sb-text-strong); }
.sb-item.active { background: var(--sb-active-bg); color: var(--sb-active-text); font-weight: 700; }
.sb-item.active::before {
  content: ''; position: absolute; inset-inline-start: -.6rem; top: 20%; bottom: 20%;
  width: 3px; border-radius: var(--r-full); background: var(--grad-brand);
}
.sb-item .ico { width: 20px; text-align: center; font-size: var(--fs-lg); flex: none; }
.sb-item .lbl { flex: 1; white-space: nowrap; overflow: hidden; }
.sb-item .badge-n {
  background: var(--danger); color: #fff; font-size: var(--fs-2xs); font-weight: 700;
  border-radius: var(--r-full); padding: .05rem .42rem; min-width: 18px; text-align: center;
}
.sb-group .sb-group-items { display: none; }
.sb-group.open .sb-group-items { display: block; }
.sb-section-toggle {
  display: flex; align-items: center; justify-content: space-between; width: calc(100% - .4rem);
  background: none; border: 0; cursor: pointer; padding: .3rem .5rem; min-height: 32px;
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .4px;
  color: color-mix(in srgb, var(--sb-text) 65%, transparent);
  margin: 1rem 0 .35rem; border-radius: var(--r-xs); text-align: start;
}
.sb-section-toggle:hover { color: var(--sb-text-strong); background: var(--sb-hover-bg); }
.sb-section-toggle .sb-chevron .ico-svg { width: 13px; height: 13px; transition: transform var(--t-med); }
.sb-group.open .sb-chevron .ico-svg { transform: rotate(180deg); }
.sb-footer { border-top: 1px solid var(--sb-border); padding: .6rem; position: relative; }
.user-card {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  background: none; padding: .45rem .5rem; border-radius: var(--r-sm); text-align: start; min-height: 44px;
}
.user-card:hover { background: var(--sb-hover-bg); }
.uc-info { display: flex; flex-direction: column; overflow: hidden; }
.uc-name { font-size: var(--fs-sm); font-weight: 700; color: var(--sb-text-strong); white-space: nowrap; }
.uc-role { font-size: var(--fs-2xs); color: var(--sb-text); }

/* سایدبار جمع‌شده + tooltip */
.app-shell.sb-collapsed .sidebar { width: var(--sb-w-min); }
.app-shell.sb-collapsed .sb-title, .app-shell.sb-collapsed .sb-item .lbl,
.app-shell.sb-collapsed .sb-section, .app-shell.sb-collapsed .uc-info,
.app-shell.sb-collapsed .sb-item .badge-n { display: none; }
.app-shell.sb-collapsed .sb-item { justify-content: center; }
.app-shell.sb-collapsed .sb-header { justify-content: center; padding-inline: .4rem; }
.app-shell.sb-collapsed #sb-collapse { position: absolute; top: 3.2rem; inset-inline-start: 50%; transform: translateX(50%); }
.app-shell.sb-collapsed .sb-item:is(:hover, :focus-visible)::after {
  content: attr(title); position: absolute; inset-inline-start: calc(100% + 10px); top: 50%;
  transform: translateY(-50%); white-space: nowrap; z-index: var(--z-popover);
  background: var(--navy-800); color: #EDEFF8; font-size: var(--fs-xs); font-weight: 600;
  padding: .3rem .6rem; border-radius: var(--r-xs); box-shadow: var(--shadow-2); pointer-events: none;
}

.popover {
  position: absolute; bottom: calc(100% + 6px); inset-inline: .6rem;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); padding: .35rem; z-index: var(--z-popover);
}
.pop-item {
  display: block; width: 100%; text-align: start; background: none; color: var(--text);
  padding: .5rem .7rem; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; border: 0; min-height: 36px;
}
.pop-item:hover { background: var(--surface-2); }
.pop-item.danger { color: var(--danger-text); background: none; }
.pop-item.danger:hover { background: var(--danger-soft); }

/* بدنه */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .7rem; padding: .65rem 1.4rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: var(--z-topbar);
  border-bottom: 1px solid var(--border);
}
.breadcrumb { display: flex; align-items: center; gap: .45rem; font-size: var(--fs-md); font-weight: 800; color: var(--text); min-width: 0; }
.breadcrumb .crumb-sep { color: var(--text-3); font-weight: 400; }
.breadcrumb .crumb-link { color: var(--text-2); font-weight: 600; cursor: pointer; text-decoration: none; }
.breadcrumb .crumb-link:hover { color: var(--accent-strong); }
.spacer { flex: 1; }
.breadcrumb .crumb-sec { color: var(--text-3); font-weight: 600; font-size: var(--fs-sm); }
.breadcrumb .crumb-page { font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.topbar-bell { position: relative; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.topbar-bell .badge-n {
  position: absolute; top: 2px; inset-inline-start: 2px;
  background: var(--danger); color: #fff; font-size: var(--fs-2xs); font-weight: 700;
  border-radius: var(--r-full); padding: 0 .32rem; min-width: 16px; text-align: center; line-height: 1.5;
}
main { padding: 1.4rem; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ── کارت آماری ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.stat-row { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-1); position: relative; overflow: hidden;
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.stat-card::after {
  content: ''; position: absolute; top: -30px; inset-inline-end: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: radial-gradient(circle, rgba(57,185,200,.14), transparent 70%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.stat-card .lbl { color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; }
.stat-card .num { font-size: var(--fs-3xl); font-weight: 900; margin-top: .25rem; color: var(--text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-card.danger .num { color: var(--danger-text); }
.stat-card.ok .num { color: var(--ok-text); }

/* ── پنل ── */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 1.15rem 1.25rem; margin-bottom: 1.1rem; box-shadow: var(--shadow-1);
}
.panel > h2, .panel h3 {
  font-size: var(--fs-lg); font-weight: 900; margin: 0 0 .9rem;
  display: flex; align-items: center; gap: .5rem;
}
.panel h4 { font-size: var(--fs-md); font-weight: 700; margin: 0 0 .5rem; }
.panel h5 { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); margin: var(--sp-4) 0 var(--sp-2); }
.panel > h2::before, .panel-head h3::before {
  content: ''; width: 4px; height: 18px; border-radius: var(--r-full);
  background: var(--grad-brand); flex: none;
}
.panel > h2 .count {
  background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-2xs);
  padding: .08rem .55rem; border-radius: var(--r-full); font-weight: 700;
}
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; gap: .6rem; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.home-hello { font-size: var(--fs-2xl); font-weight: 700; margin: .2rem .2rem 1rem; }

/* ── جدول ── */
.table-wrap { overflow-x: auto; border-radius: var(--r-sm); overscroll-behavior-x: contain; }
.table-wrap[data-scroll] { max-height: 70vh; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th {
  background: var(--surface-2); color: var(--text-2); font-weight: 700; text-align: start;
  padding: .55rem .7rem; border-bottom: 2px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; cursor: default; user-select: none; z-index: 1;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--accent-strong); }
th .sort-ind { font-size: .65rem; opacity: .7; }
td { padding: .58rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-tint); }
.tbl-divider td { background: var(--surface-2); font-weight: 700; font-size: var(--fs-xs); color: var(--text-2); }
.id {
  font-family: Consolas, monospace; color: var(--text-2); font-size: var(--fs-xs);
  direction: ltr; unicode-bidi: embed; background: var(--surface-2);
  padding: .12rem .42rem; border-radius: var(--r-xs); border: 1px solid var(--border);
}
.diff-tr td { background: var(--bg-soft); font-size: var(--fs-xs); }
.diff-row { cursor: pointer; }
.cp-note { min-width: 180px; }

/* ستون اولویت‌دار — در صفحه باریک از دید می‌رود */
@media (max-width: 760px) { .col-p3 { display: none; } }
@media (max-width: 640px) { .col-p2 { display: none; } }
.row-actions { white-space: nowrap; text-align: end; }
.row-actions button, .row-actions a { min-height: 32px; }
.tbl-pager { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .7rem; }

/* نشانه اسکرول افقی جدول */
.table-wrap { position: relative; }
@media (max-width: 760px) {
  .table-wrap {
    mask-image: linear-gradient(to left, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  }
}

/* ── pill های وضعیت (یک ست واحد) ── */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .62rem; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok, .pill.done, .pill.published, .pill.st-done { background: var(--ok-soft); color: var(--ok-text); }
.pill.warn, .pill.review, .pill.with_client, .pill.st-pending { background: var(--warn-soft); color: var(--warn-text); }
.pill.bad, .pill.overdue, .pill.st-rejected { background: var(--danger-soft); color: var(--danger-text); }
.pill.st-approved, .pill.in_progress { background: var(--info-soft); color: var(--info-text); }
.pill.st-cancelled, .pill.cancelled, .pill.not_started { background: var(--surface-3); color: var(--text-3); }
.pill.paused { background: var(--purple-soft); color: var(--purple-text); }

/* ── آواتار ── */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-2xs); font-weight: 900; color: #fff; letter-spacing: -.5px;
}
.avatar.lg { width: 42px; height: 42px; font-size: var(--fs-lg); }

/* ── chips ── */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; background: var(--accent-soft);
  color: var(--accent-strong); border-radius: var(--r-full); padding: .22rem .7rem;
  font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
}
.chip input { width: auto; }

/* ── progress ── */
.progress-bar { height: 7px; background: var(--border); border-radius: var(--r-full); overflow: hidden; min-width: 80px; flex: 1; }
.progress-fill { height: 100%; background: var(--grad-brand-x); border-radius: var(--r-full); transition: width var(--t-slow); }

/* ── درا (پنل کناری) ── */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(18,21,42,.5); backdrop-filter: blur(2px);
  z-index: var(--z-drawer); display: flex; justify-content: flex-start; /* RTL: درا از لبه چپ */
}
.drawer {
  width: min(480px, 94vw); height: 100%; background: var(--surface);
  box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  animation: drawer-in var(--t-med) var(--ease);
}
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.drawer-head {
  display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.drawer-head .breadcrumb { flex: 1; font-size: var(--fs-md); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.1rem 1.2rem 2rem; }
.drawer-body h3 { font-size: var(--fs-lg); font-weight: 900; margin-bottom: 1rem; line-height: var(--lh-base); }
body.no-scroll { overflow: hidden; }

/* ── مودال تأیید ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(18,21,42,.5); backdrop-filter: blur(2px);
  z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
  animation: fade-in var(--t-fast);
}
.modal {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  width: min(420px, 94vw); padding: 1.4rem 1.5rem; position: relative; overflow: hidden;
}
.modal::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--grad-brand-x); }
.modal h3 { font-size: var(--fs-lg); font-weight: 900; margin-bottom: .6rem; }
.modal-body { color: var(--text-2); line-height: var(--lh-loose); white-space: pre-line; }
.modal-btns { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.2rem; }
.modal-btns button { min-width: 96px; }

/* ── توست ── */
.toasts { position: fixed; bottom: 1.2rem; inset-inline-start: 1.2rem; z-index: var(--z-toast); display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--surface); color: var(--text); border: 1px solid var(--border-2);
  border-inline-start: 4px solid var(--accent-strong); border-radius: var(--r-md);
  padding: .7rem 1rem; box-shadow: var(--shadow-2); font-size: var(--fs-sm); font-weight: 600;
  min-width: 220px; max-width: 340px; animation: toast-in var(--t-med) var(--ease);
}
.toast.error { border-inline-start-color: var(--danger); }
.toast.ok { border-inline-start-color: var(--ok); }
.toast.warn { border-inline-start-color: var(--warn); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── skeleton / empty ── */
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; height: 14px; margin-bottom: .7rem; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { text-align: center; padding: 2rem 1rem; color: var(--text-3); }
.empty .ico {
  font-size: 1.6rem; display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent-tint); margin-bottom: .6rem;
}
.empty .txt { font-size: var(--fs-sm); font-weight: 600; display: block; }

/* ── دیت‌پیکر جلالی ── */
.jal-pop {
  position: absolute; z-index: var(--z-datepicker); background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: .7rem; width: 250px;
}
.jal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; font-weight: 800; font-size: var(--fs-sm); }
.jal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jal-grid .dow { font-size: .62rem; color: var(--text-3); text-align: center; padding: .2rem 0; font-weight: 700; }
.jal-grid button { background: none; color: var(--text); padding: .3rem 0; font-size: var(--fs-xs); border-radius: var(--r-xs); font-weight: 600; min-height: 30px; }
.jal-grid button:hover { background: var(--accent-soft); }
.jal-grid button.today { outline: 1.5px solid var(--accent); }
.jal-grid button.sel { background: var(--accent-strong); color: #fff; }
.jal-head .icon-btn { min-width: 30px; min-height: 30px; }

/* ── تایل فرم‌ها ── */
.form-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.form-tile { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.1rem .8rem;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--r-md);
  text-align: center; transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); min-height: 44px; text-decoration: none; }
.form-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-accent); }
.form-tile .ft-ico { font-size: 1.7rem; }
.form-tile .ft-title { font-weight: 700; color: var(--text); font-size: var(--fs-md); }
.form-tile.lg { padding: 1.5rem 1rem; }
.form-tile .ft-code { font-size: var(--fs-2xs); color: var(--text-3); direction: ltr; }

/* ── کارت‌های کوچک home ── */
.mini-cards { display: flex; flex-direction: column; gap: .5rem; }
.mini-card { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .7rem .9rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.mini-card.clickable { cursor: pointer; }
.mini-card.clickable:hover { border-color: var(--accent); }
.more-link, .back-link, .btn-link { display: inline-block; margin-top: .7rem; color: var(--link); font-weight: 600; font-size: var(--fs-md); text-decoration: none; }
.badge-inline { background: var(--accent-strong); color: #fff; border-radius: 10px; padding: 0 .5rem; font-size: var(--fs-xs); margin-inline-start: .3rem; }

/* ── لیست درخواست‌ها / کارتابل ── */
.req-list, .queue-list { display: flex; flex-direction: column; gap: .55rem; }
.req-list-card, .queue-card { display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .8rem 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--t-fast); }
.req-list-card.clickable, .queue-card.clickable { cursor: pointer; }
.req-list-card:hover, .queue-card:hover { border-color: var(--accent); }
.rlc-main, .qc-main { flex: 1; min-width: 0; }
.rlc-title, .qc-title { font-size: var(--fs-md); }
.rlc-date, .qc-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: .2rem; }

/* ── رندرر فرم ── */
.form-section { margin-bottom: 1.2rem; }
.form-section-title { font-weight: 700; color: var(--accent-strong); font-size: var(--fs-md); margin-bottom: .7rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.field { margin-bottom: .9rem; display: flex; flex-direction: column; }
.field label { font-weight: 600; font-size: var(--fs-md); margin-bottom: .35rem; }
.field > label { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.field .req { color: var(--danger-text); margin-inline-start: .2rem; }
.field-hint { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: .35rem; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field-err { color: var(--danger-text); font-size: var(--fs-xs); margin-top: .3rem; font-weight: 600; }
.money-echo { font-size: var(--fs-sm); color: var(--accent-strong); margin-top: .3rem; font-weight: 600; min-height: 1em; }
.choice-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice-btn { width: auto; background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border-2); font-weight: 600; min-height: 44px; }
.choice-btn:hover { border-color: var(--accent); background: var(--surface-2); }
.choice-btn.active { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.chk { flex-direction: row !important; align-items: center; gap: .4rem; font-weight: 500 !important; cursor: pointer; }
.chk input { width: auto; }

/* جدول فرم */
.form-table { display: flex; flex-direction: column; gap: .5rem; }
.form-table-row { display: flex; gap: .4rem; align-items: center; }
.form-table-row .ft-cell { flex: 1; }
.form-table-row .ft-cell input { width: 100%; }
.ft-del { width: auto; background: var(--danger-soft); color: var(--danger-text); border: none; padding: .3rem .6rem; min-height: 30px; }
.ft-del:hover { background: var(--danger); color: #fff; }
.ft-add { margin-top: .5rem; }
.form-table-foot { margin-top: .5rem; }
.ft-sum { font-weight: 700; color: var(--accent-strong); }
.fb-field-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ── درخواست جدید ── */
.nr-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.nr-head h3 { margin: 0; }
.chain-hint { font-size: var(--fs-sm); color: var(--text-2); background: var(--surface-2); padding: .5rem .8rem; border-radius: var(--r-sm); margin-bottom: 1rem; }
.nr-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }

/* ── فیلترها ──────────────────────────────────────────────
   نظام عرض: پایه عرض هر فیلد از کلاس w-* می‌آید نه از محتوایش، وگرنه
   طول برچسب و متن راهنما عرض‌ها را نامنظم می‌کند. لیبل‌ها هم ارتفاع پایه
   یکسان دارند تا کنترل‌ها روی یک خط بیفتند حتی وقتی یک برچسب دوخطی شود. */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: 1rem; align-items: start; }
.filters > .field { flex: 0 1 200px; max-width: 100%; margin-bottom: 0; }
.filters > .field.w-10 { flex-basis: 120px; }
.filters > .field.w-14 { flex-basis: 170px; }
.filters > .field.w-20 { flex-basis: 260px; }
.filters > .field.w-full { flex-basis: 100%; }
.filters > .field > label { min-height: 2.3em; display: flex; align-items: flex-end; }
.filters > .field .field-hint { margin-bottom: 0; margin-top: .3rem; }
/* فیلدی که فقط یک دکمه است، هم‌تراز کف کنترل‌ها می‌نشیند */
.filters > .field:has(> button:only-child),
.filters > .field:has(> a:only-child),
.filters > .field.f-action { flex: 0 0 auto; align-self: end; }
/* کنترل‌های لخت داخل filters (بایگانی، تاریخچه، فیش حقوقی) */
.filters > input, .filters > select { flex: 0 1 200px; width: auto; min-width: 0; }
.filters > input.grow { flex: 1 1 260px; }
.filters > button, .filters > .btn { flex: 0 0 auto; align-self: end; }
.filters > span { align-self: end; padding-bottom: .55rem; }

/* ── گرید کارت ── */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3); align-items: stretch;
}
.card-grid > .panel { margin: 0; }   /* حاشیه پیش‌فرض پنل داخل گرید مضاعف می‌شود */
.clickable { cursor: pointer; }
.actions-center { justify-content: center; }

/* ── کارت جزئیات درخواست ── */
.req-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.req-no { font-weight: 800; color: var(--accent-strong); direction: ltr; }
.amount-box {
  background: var(--accent-tint); border: 1px solid var(--teal-200); border-radius: var(--r-sm);
  padding: .7rem .9rem; font-weight: 700; color: var(--accent-strong); margin-bottom: 1rem;
}
[data-theme="dark"] .amount-box { border-color: var(--border-2); }
.kv-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.kv-table th, .kv-table td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: start; vertical-align: top; font-size: var(--fs-md); position: static; }
.kv-table th { background: var(--surface-2); width: 38%; font-weight: 700; }
.stepper { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.2rem; }
.step-row { display: flex; gap: .6rem; align-items: flex-start; }
.step-ico { font-size: 1.1rem; }
.step-cmt { font-size: var(--fs-xs); color: var(--text-2); font-style: italic; margin-top: .2rem; }
.req-actions { display: flex; flex-direction: column; gap: .7rem; }
.decide-box { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 1rem; }
.decide-title { font-weight: 700; margin-bottom: .7rem; color: var(--accent-strong); }
.decide-btns { display: flex; gap: .6rem; margin-top: .5rem; }
.decide-btns button { flex: 1; min-height: 44px; }
.decide-btns .ok { background: var(--ok); }
.decide-btns .danger { background: var(--danger); }
.actions { display: flex; gap: .55rem; margin-top: 1.15rem; flex-wrap: wrap; }

/* ── آیین‌نامه‌ها ── */
.reg-card { padding: 0; overflow: hidden; }
.reg-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; cursor: pointer; user-select: none; background: none; border: 0; width: 100%; text-align: start; font: inherit; color: var(--text); min-height: 44px; }
.reg-head:hover { background: var(--accent-tint); }
.reg-ico { font-size: 1.25rem; }
.reg-title { font-weight: 700; color: var(--text); }
.reg-code { font-size: var(--fs-2xs); color: var(--text-3); direction: ltr; background: var(--surface-2); padding: .1rem .4rem; border-radius: var(--r-xs); }
.reg-chevron { margin-inline-start: auto; color: var(--text-3); transition: transform var(--t-med); }
.reg-card.open .reg-chevron { transform: rotate(180deg); }
.reg-body { padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--border); }
.reg-hist-body { font-size: var(--fs-sm); }
.reg-content { line-height: var(--lh-loose); color: var(--text-2); }
.reg-content h4 { color: var(--accent-strong); margin: .9rem 0 .4rem; font-size: var(--fs-lg); }
.reg-content h5 { color: var(--text); margin: .7rem 0 .3rem; font-size: var(--fs-md); }
.reg-content h6 { color: var(--text); margin: .6rem 0 .25rem; font-size: var(--fs-sm); font-weight: 700; }
.reg-content ul { margin: .3rem 0; padding-inline-start: 1.3rem; }
.reg-content ol { margin: .3rem 0; padding-inline-start: 1.4rem; list-style-type: persian; }
.reg-content li { margin: .25rem 0; }
.reg-content p { margin: .4rem 0; }
.reg-content hr { border: 0; border-top: 1px solid var(--border); margin: .9rem 0; }
.reg-content .reg-note { border-inline-start: 3px solid var(--accent); background: var(--surface-2);
  padding: .5rem .7rem; margin: .5rem 0; border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); font-size: var(--fs-md); }
.reg-content code { background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; font-size: .85em; }
.reg-table { width: 100%; border-collapse: collapse; margin: .6rem 0; font-size: var(--fs-md); }
.reg-table th { background: var(--surface-2); font-weight: 700; color: var(--text); position: static; }
.reg-table th, .reg-table td { border: 1px solid var(--border); padding: .4rem .6rem; text-align: start; }
.reg-todo { background: var(--warn-soft); color: var(--warn-text); padding: .05rem .4rem; border-radius: 5px; font-size: var(--fs-xs); font-weight: 600; }
.reg-params { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--border); }
.reg-params h5 { color: var(--text); margin-bottom: .6rem; }
.param { margin-bottom: 1rem; }
.param-label { font-weight: 600; color: var(--text); margin-bottom: .2rem; }
.param-unit { color: var(--text-3); font-weight: 400; font-size: var(--fs-sm); }
.param-value { color: var(--accent-strong); font-weight: 600; }
.reg-badge { font-size: var(--fs-2xs); padding: .08rem .45rem; border-radius: var(--r-xs); font-weight: 600; margin-inline-start: .3rem; }
.reg-badge.enforced { background: var(--ok-soft); color: var(--ok-text); }
.reg-badge.info { background: var(--surface-2); color: var(--text-3); }
.doc-strip { padding: .5rem .1rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .7rem; font-size: var(--fs-sm); }

/* ── ایجنت ناظر قواعد ── */
.agent-box { background: var(--accent-tint); border: 1px solid var(--accent-soft); border-radius: var(--r-sm); padding: 8px 10px; margin-top: 5px; font-size: var(--fs-sm); line-height: var(--lh-loose); }
.agent-verdict { font-weight: 700; display: inline-block; margin-bottom: 3px; }
.agent-verdict.ok { color: var(--ok-text); }
.agent-verdict.no { color: var(--danger-text); }
.agent-check.fail { color: var(--danger-text); }
.agent-check.warn { color: var(--warn-text); }
.agent-check .ac-detail { color: var(--text-3); }
.agent-note { color: var(--text-2); }
.decide-agent { margin: 6px 0 10px; }
.recent-verdicts { display: flex; flex-direction: column; gap: 4px; }
.rv-row { display: flex; justify-content: space-between; padding: 5px 8px; border-radius: var(--r-xs); background: var(--surface-2); font-size: var(--fs-sm); }
.rules-rows { display: flex; flex-direction: column; gap: 8px; }
.rule-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r-md); }
.rule-row.rule-off { opacity: .55; }
.rule-main { flex: 1; }
.rule-label { font-weight: 600; }
.rule-desc { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.rule-acts { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── ارزیابی عملکرد ── */
.meta-row { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; margin-top: .5rem; font-size: var(--fs-sm); color: var(--text-2); }
.sticky-score { position: sticky; top: 8px; z-index: 5; }
.score-strip { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: flex-end; }
.score-strip .sc { display: flex; flex-direction: column; gap: .1rem; min-width: 76px; }
.score-strip .sc span { font-size: var(--fs-xs); color: var(--text-3); }
.score-strip .sc b { font-size: var(--fs-xl); line-height: 1.2; font-variant-numeric: tabular-nums; }
.score-strip .sc i { font-size: var(--fs-2xs); color: var(--text-3); font-style: normal; }
.score-strip .sc.big b { font-size: var(--fs-3xl); font-weight: 900; color: var(--accent-strong); }
.ind-row { padding: .7rem 0; border-top: 1px solid var(--border); }
.ind-row:first-of-type { border-top: 0; }
.ind-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ind-ex { font-size: var(--fs-xs); margin-top: .2rem; }
.likert { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.likert-opt { display: flex; flex-direction: column; align-items: center; gap: .1rem; cursor: pointer;
  padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 10px; min-width: 66px;
  background: var(--surface); transition: background var(--t-fast), border-color var(--t-fast); }
.likert-opt input { display: none; }
.likert-opt .lv { font-weight: 800; font-size: var(--fs-lg); }
.likert-opt .lt { font-size: var(--fs-2xs); color: var(--text-3); }
.likert-opt:hover { border-color: var(--accent); }
.likert-opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-strong); }
.likert-opt:has(input:checked) .lt { color: var(--accent-strong); }
.likert-opt:has(input:disabled) { cursor: default; opacity: .75; }
.kpi-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: .6rem; margin-top: .5rem; }
@media (max-width: 700px) { .kpi-grid { grid-template-columns: 1fr; } }

/* ── موبایل ── */
.mobile-only { display: none; }
.sb-backdrop {
  position: fixed; inset: 0; background: rgba(18,21,42,.5); backdrop-filter: blur(2px);
  z-index: calc(var(--z-sidebar) - 1); animation: fade-in var(--t-med) var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .mobile-only { display: inline-flex; }
  .sidebar {
    /* ⚠️ در RTL «inset-inline-end» یعنی چپ! منو باید به لبه راست بچسبد
       (inline-start) تا translateX(100%) واقعا از صفحه بیرونش ببرد؛
       با inline-end یک نوار سرمه‌ای وسط صفحه موبایل می‌ماند. */
    position: fixed; inset-inline-start: 0; top: 0; transform: translateX(100%);
    transition: transform var(--t-med) var(--ease); box-shadow: var(--shadow-3);
    width: min(320px, 85vw); height: 100dvh;
  }
  .app-shell.sb-mobile-open .sidebar { transform: none; }
  .app-shell.sb-mobile-open .sidebar .lbl { display: inline; }
  #sb-collapse { display: none; }
  main { padding: .9rem; }
  .topbar { padding: .55rem .9rem; }
  .sb-item { min-height: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
}
@media (max-width: 640px) {
  .form-table-row { flex-wrap: wrap; }
  .form-table-row .ft-cell { flex-basis: 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  /* در حالت ستونی، پایه عرض و ارتفاع پایه لیبل معنا ندارند */
  .filters > .field, .filters > input, .filters > select, .filters > span { flex: 0 0 auto; width: 100%; max-width: none; }
  .filters > span { padding-bottom: 0; }
  .filters > .field > label { min-height: 0; }
  .filters > .field:has(> button:only-child), .filters > .field.f-action,
  .filters > button, .filters > .btn { align-self: stretch; }
  .rule-row { flex-wrap: wrap; }
  .rule-acts { width: 100%; }
}

/* ── دسترس‌پذیری ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; } /* ring خودشان را دارند */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* ── ثبت تردد ── */
.att-today { display: flex; flex-direction: column; gap: var(--sp-3); }
.att-punches { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.att-totals { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.row-today td { background: var(--surface-2); }

/* ترددهای همان روز در فرم اصلاح تردد */
.fx-day { background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-3); margin-bottom: var(--sp-3); }
.fx-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0; }
.fx-pick { cursor: pointer; border: 1.5px solid transparent; }
.fx-pick:hover { border-color: var(--accent); }
.fx-pick.sel { outline: 2px solid var(--accent-strong); }

/* ساعت موظفی هفته — هفت خانه هم‌اندازه، نه ردیف فیلدهای درهم */
.dow-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.dow-cell { display: flex; flex-direction: column; gap: .3rem; background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: var(--r-md); padding: .55rem .5rem; text-align: center; }
.dow-cell .dow-name { font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); }
.dow-cell input { text-align: center; padding-inline: .3rem; }
.dow-cell.is-off { background: var(--surface); border-style: dashed; }
.dow-cell.is-off .dow-name { color: var(--text-3); }
.wh-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); align-items: start; }
#wh-sum { font-size: var(--fs-sm); font-weight: 700; }
.bad-text { color: var(--danger, #c33); }
@media (max-width: 760px) {
  .dow-grid { grid-template-columns: repeat(4, 1fr); }
  .wh-row { grid-template-columns: 1fr; }
}

/* انتخابگر ساعت (به‌جای input[type=time] که قالبش تابع زبان مرورگر است) */
.time-pick { display: inline-flex; align-items: center; gap: .25rem; }
.time-pick .tp-sel { width: auto; min-width: 4.2rem; padding-inline: .5rem; text-align: center; }
.time-pick .tp-sep { font-weight: 800; color: var(--text-3); }

/* تقویم تعطیلات */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .cal-dow { text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); padding-bottom: .2rem; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 46px; padding: .3rem .2rem; background: var(--surface-2); color: var(--text);
  border: 1.5px solid transparent; border-radius: var(--r-sm); font-weight: 700; font-size: var(--fs-sm);
  transition: border-color var(--t-fast), background var(--t-fast); }
.cal-day:hover { border-color: var(--accent); }
.cal-day .cd-l { font-size: .6rem; font-weight: 600; opacity: .85; line-height: 1.1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day.fri { background: color-mix(in srgb, var(--text-3) 12%, var(--surface-2)); color: var(--text-2); }
.cal-day.off { background: #fce4ec; color: #6b2740; }
.cal-day.loc { background: #fff2cc; color: #6b5320; }
.cal-day.today { outline: 2px solid var(--accent); }
.cal-day.sel { border-color: var(--accent-strong); box-shadow: var(--shadow-accent); }
.cal-edit { margin-top: var(--sp-3); padding: var(--sp-3); background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: var(--r-md); }
.cal-edit .ce-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.cal-edit .ce-row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.cal-edit .ce-row input { flex: 1 1 14rem; }
.cal-label { font-weight: 800; min-width: 8rem; text-align: center; }
.cal-legend { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-3);
  font-size: var(--fs-xs); color: var(--text-3); }
.cal-legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-inline-end: .3rem; }
.cal-legend .sw.off { background: #fce4ec; }
.cal-legend .sw.loc { background: #fff2cc; }
.cal-legend .sw.fri { background: color-mix(in srgb, var(--text-3) 12%, var(--surface-2)); }

/* ── دکمه نصب PWA در خانه ── */
.install-callout { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.install-callout .ic-acts { display: flex; gap: var(--sp-2); flex: none; }
