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

:root {
  color-scheme: light;
  --bg: #eef0f6;
  --card: #ffffff;
  --field: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.92);
  --line: #d3d8e6;
  --line-strong: #a6afc6;
  --ink: #222839;
  --muted: #5a6178;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-strong: #4f46e5;
  --accent-ink: #ffffff;
  --accent-2: #8b5cf6;
  --accent-soft: #eef0fe;
  --accent-soft-line: #c9d0fb;
  --ring: rgba(79, 70, 229, 0.22);
  --unscanned: #fbeaea;
  --full: #e4f6ec;
  --dep: #fdf4d7;
  --warn-ink: #a16207;
  --danger: #dc2626;
  --danger-ink: #ffffff;
  --danger-line: #f0baba;
  --danger-soft: #fdeeee;
  --th-bg: #f7f8fc;
  --thead-bg: #565d8f;
  --thead-hover: #4b517d;
  --hover: #f2f4fa;
  --disabled-bg: #e7eaf1;
  --sel: #e3e8fd;
  --sel-hover: #d9dffc;
  --dayrow: #eceef7;
  --tick: #16a34a;
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.1);
  --teal: #0d9488;
  --teal-soft: rgba(13, 148, 136, 0.1);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.1);
  --toast-bg: #232840;
  --toast-ink: #ffffff;
  --toast-ok: #4ade80;
  --toast-warn: #facc15;
  --row-dim: brightness(0.97);
  --shadow-1: 0 1px 2px rgba(30, 35, 60, 0.05), 0 1px 3px rgba(30, 35, 60, 0.07);
  --shadow-2: 0 8px 20px rgba(30, 35, 60, 0.14);
  --shadow-3: 0 16px 40px rgba(30, 35, 60, 0.22);
  --overlay: rgba(24, 28, 45, 0.5);
  --radius: 14px;
  --radius-s: 10px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1017;
  --card: #161a26;
  --field: #1b2030;
  --header-bg: rgba(22, 26, 38, 0.92);
  --line: #333d57;
  --line-strong: #55617f;
  --ink: #e7eaf3;
  --muted: #a6aec4;
  --accent: #6366f1;
  --accent-hover: #5457e8;
  --accent-strong: #a5b4fc;
  --accent-ink: #ffffff;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-soft-line: rgba(129, 140, 248, 0.34);
  --ring: rgba(129, 140, 248, 0.3);
  --unscanned: rgba(244, 110, 110, 0.15);
  --full: rgba(74, 222, 128, 0.13);
  --dep: rgba(250, 204, 21, 0.13);
  --warn-ink: #fde047;
  --danger: #f87171;
  --danger-ink: #450a0a;
  --danger-line: rgba(248, 113, 113, 0.4);
  --danger-soft: rgba(248, 113, 113, 0.12);
  --th-bg: #1a1f2e;
  --thead-bg: #3d4266;
  --thead-hover: #343a58;
  --hover: rgba(255, 255, 255, 0.05);
  --disabled-bg: rgba(255, 255, 255, 0.03);
  --sel: rgba(129, 140, 248, 0.22);
  --sel-hover: rgba(129, 140, 248, 0.3);
  --dayrow: #1d2333;
  --tick: #4ade80;
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --toast-bg: #262d3e;
  --row-dim: brightness(1.15);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 8px 20px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, 0.6);
  --overlay: rgba(0, 0, 0, 0.62);
}

/* "full" effects level — backdrop blur + deeper shadows. Off by
   default (data-fx="lean") so weak machines keep a cheap render path */
html[data-fx="full"] {
  --header-bg: rgba(255, 255, 255, 0.82);
  --shadow-2: 0 10px 28px rgba(30, 35, 60, 0.14);
  --shadow-3: 0 24px 60px rgba(30, 35, 60, 0.22);
}
html[data-fx="full"][data-theme="dark"] {
  --header-bg: rgba(22, 26, 38, 0.82);
  --shadow-2: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.6);
}
html[data-fx="full"] header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html[data-fx="full"] .overlay {
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: ovfade 0.15s ease;
}
html[data-fx="full"] .modal {
  animation: mpop 0.18s ease;
}
/* lean machines also skip the dashboard's decorative animations —
   the staggered card/row entrances, the live-session and attention
   pings — so the «افکت‌های بصری» switch is a full kill switch there */
html[data-fx="lean"] #tab-dashboard *,
html[data-fx="lean"] #tab-dashboard *::before,
html[data-fx="lean"] #tab-dashboard *::after {
  animation-name: none;
}

html {
  font-family: "Vazirmatn", Tahoma, system-ui, sans-serif;
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  transition: background-color 0.25s ease, color 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

/* thin styled scrollbar everywhere */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--card);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}
.logo {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-size: 15px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}
nav {
  display: flex;
  gap: 2px;
  flex: 1;
  background: var(--hover);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
}
.tab {
  border: 0;
  background: transparent;
  padding: 7px 15px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tab .ic {
  width: 14px;
  height: 14px;
  opacity: 0.85;
}
.tab:hover {
  color: var(--ink);
}
.tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-1);
}
/* generic button:hover (0,2,1) outranks .tab.active (0,2,0) — pin the
   active tab's hover so it darkens instead of washing out to --hover */
.tab.active:hover {
  background: var(--accent-hover);
}

main {
  padding: 18px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.panel {
  display: none;
}
.panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#tab-lists {
  overflow-y: auto;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.toolbar input,
.toolbar select,
.toolbar button {
  font-size: 13px;
  padding: 6px 10px;
}
.toolbar button .ic {
  width: 14px;
  height: 14px;
}
.toolbar .pickwrap > input,
.toolbar .dpwrap > input {
  width: 128px;
}
.toolbar .dpwrap > input {
  text-align: center;
}
.toolbar .dstep {
  padding: 5px 9px;
  font-size: 15px;
  line-height: 1;
}
/* joined ‹ | input | › segmented control — only outer corners round */
.dseg {
  display: flex;
  align-items: stretch;
}
.dseg > * + * {
  margin-inline-start: -1px;
}
.dseg > .dpwrap > input {
  border-radius: 0;
}
.dseg > :first-child {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}
.dseg > :last-child {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}
/* the lift must not apply while a calendar is open — a z-indexed .dpwrap
   becomes a stacking context and the popup (z-45) inside it loses to the
   table's sticky day-separator rows (z-4) and header (z-20) */
.dseg > *:hover:not(.dpopen),
.dseg > .dpwrap:focus-within:not(.dpopen) {
  position: relative;
  z-index: 1;
}
.dseg input:focus {
  box-shadow: none;
}
.toolbar input[type="search"] {
  min-width: 160px;
  padding-inline-start: 30px;
  background-position: right 9px center;
  background-size: 14px;
}
/* active filter cue — a toolbar field holding a value gets an accent
   tint so "filter set" vs "filter empty" is obvious at a glance */
/* background-color (not the shorthand) so the search field keeps
   its inline SVG magnifier icon; popover search inputs excluded */
.toolbar
  input[placeholder]:not(:placeholder-shown):not(:disabled):not(.pick-q):not(.dp-timein) {
  background-color: var(--accent-soft);
  border-color: var(--accent-soft-line);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-1);
}

input,
select,
textarea,
button {
  font: inherit;
}
input,
select,
textarea {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--field);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}
textarea {
  resize: vertical;
}
input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--line-strong);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
input.invalid,
input.invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--field);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  vertical-align: -3px;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}
input[type="checkbox"]:hover:not(:disabled) {
  border-color: var(--accent);
}
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}
input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 0.12s ease-in-out;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background: var(--accent-ink);
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::before {
  transform: scale(1);
}
input[type="checkbox"]:indeterminate {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:indeterminate::before {
  transform: scale(1);
  clip-path: none;
  width: 9px;
  height: 2px;
  border-radius: 1px;
}
input[type="checkbox"]:disabled {
  opacity: 0.5;
  filter: saturate(0.3);
  cursor: not-allowed;
}
input[type="search"] {
  min-width: 220px;
  padding-inline-start: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%238b93a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.ic {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--field);
  cursor: pointer;
  color: var(--ink);
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
}
button:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--line-strong);
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}
button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
button.ghost:hover {
  color: var(--ink);
}
button.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-s);
}
button.danger {
  color: var(--danger);
  border-color: var(--danger-line);
}
button.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}
/* universal disabled look — flatten to a uniform muted field and
   desaturate, so colored buttons (primary, danger) also read as
   inert on low-quality displays; must follow the variant hovers
   above so a disabled button can't re-color on hover */
button:disabled,
button:disabled:hover {
  background: var(--disabled-bg);
  border-color: var(--line);
  color: var(--muted);
  opacity: 0.6;
  filter: saturate(0.3);
  cursor: not-allowed;
  box-shadow: none;
}
.i-sun {
  display: none;
}
[data-theme="dark"] .i-sun {
  display: block;
}
[data-theme="dark"] .i-moon {
  display: none;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}
.stats {
  margin-inline-start: auto;
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.stats b {
  color: var(--accent-strong);
}

.tbox {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.tfoot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.tfoot .stats {
  margin-inline-start: auto;
}
.tfoot .pager {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pager .pickwrap {
  width: 66px;
}
.pager .pickwrap > input {
  padding: 3px 8px;
  font-size: 12px;
  text-align: center;
}
.pager .pickpop {
  top: auto;
  bottom: calc(100% + 6px);
}
.pager .pick-it {
  text-align: center;
}
.pager button {
  padding: 2px 10px;
  font-size: 13px;
}
.pager .pinfo {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.colbtn {
  padding: 3px 6px;
  color: var(--muted);
}
/* no-pager footers have no auto-margin element to pull the gear to the
   left edge like the paged lists do — pin it there explicitly */
#tab-courses .tfoot .colbtn,
#tab-staff .tfoot .colbtn {
  margin-inline-start: auto;
}
/* column resize handles — sit on the inline-start edge of the th AFTER each
   resizable boundary, so they work in both LTR and RTL. Kept fully inside
   the cell: .theadwrap th { overflow:hidden } clips whatever sticks out */
.headtable th {
  position: relative;
}
.colsep {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 5;
  touch-action: none;
}
/* a faint line on the boundary makes the drag edge visible without hover —
   the header bg is dark in both themes, so a translucent light line reads
   correctly on either */
.colsep::after {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  inset-inline-start: 0;
  width: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.25);
}
.colsep.end {
  inset-inline-start: auto;
  inset-inline-end: 0;
}
.colsep.end::after {
  inset-inline-start: auto;
  inset-inline-end: 0;
}
.colsep:hover,
.colsep.on {
  background: var(--hover);
}
/* on hover/drag the handle fills with the light --hover color, so the line
   flips dark to stay visible */
.colsep:hover::after,
.colsep.on::after {
  background: var(--muted);
}
body.colresizing {
  cursor: col-resize;
}
body.colresizing * {
  user-select: none !important;
}
body.rowdrag {
  cursor: grabbing;
}
body.rowdrag * {
  user-select: none !important;
}
/* column-settings modal list */
.cclist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow: auto;
}
.cclist li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.cclist li.drag {
  cursor: grabbing;
  position: relative;
  z-index: 6;
  box-shadow: var(--shadow-2);
}
.cclist li.off .ccname {
  color: var(--muted);
  text-decoration: line-through;
}
.cclist li.lock,
.cclist li.lock .ccdrag {
  cursor: default;
}
.cclist li.lock .ccname,
.cclist li.lock .ccdrag {
  color: var(--muted);
}
.ccdrag {
  color: var(--muted);
  cursor: grab;
  display: flex;
}
.cclist li.drag .ccdrag {
  cursor: grabbing;
}
.ccname {
  flex: 1;
  font-size: 13px;
  color: var(--ink);
}
.ccvis {
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  color: var(--accent);
  display: flex;
  border-radius: 6px;
}
.ccvis:hover {
  background: var(--hover);
}
.ccvis .eyeoff {
  display: none;
}
.cclist li.off .ccvis {
  color: var(--muted);
}
.cclist li.off .ccvis .eye {
  display: none;
}
.cclist li.off .ccvis .eyeoff {
  display: block;
}
.theadwrap {
  flex: none;
  overflow: hidden;
  background: var(--thead-bg);
  border-bottom: 1px solid var(--line);
}
/* headers paint compact before the column system settles — keep them
   hidden until colcfg marks the layout ready (kills the reload flicker) */
html:not(.colok) .theadwrap table {
  visibility: hidden;
}
.theadwrap table {
  width: auto;
}
.theadwrap th {
  border-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tablewrap {
  overflow: auto;
  overflow-y: scroll; /* reserve the v-scrollbar lane — appearing/disappearing it would shift every column (scrollbar-gutter breaks RTL horizontal scrolling: scrollLeft never reaches 0) */
  flex: 1;
  min-height: 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
}
th,
td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
td {
  font-variant-numeric: tabular-nums;
  user-select: none;
}
td.clip {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
thead th {
  background: var(--thead-bg);
  font-weight: 600;
  font-size: 12px;
  color: var(--accent-ink);
}
th.num {
  width: 1%;
}
th {
  user-select: none;
}
th[data-sort] {
  cursor: pointer;
}
th[data-sort]:hover {
  background: var(--thead-hover);
}
th[data-sort]::after {
  content: "⇅";
  display: inline-block;
  width: 1em;
  margin-inline-start: 4px;
  font-size: 9px;
  opacity: 0.55;
}
th.s-asc::after {
  content: "↑";
  opacity: 1;
}
th.s-desc::after {
  content: "↓";
  opacity: 1;
}
th.s-asc,
th.s-desc {
  background: var(--thead-hover);
  color: var(--accent-ink);
}
tbody tr {
  transition: background-color 0.12s ease;
}
tbody tr:hover {
  background: var(--hover);
}
tr.unscanned {
  background: var(--unscanned);
}
tr.full {
  background: var(--full);
}
tr.dep {
  background: var(--dep);
}
tr.unscanned:hover,
tr.full:hover,
tr.dep:hover {
  filter: var(--row-dim);
}
td input:not([type="checkbox"]),
td select {
  border-color: transparent;
  background: transparent;
  padding: 4px 6px;
  width: 100%;
}
td input:not([type="checkbox"]):hover,
td select:hover {
  border-color: var(--line);
  background: var(--field);
}
td input:not([type="checkbox"]):focus,
td select:focus {
  background: var(--field);
}
th.center,
td.center {
  text-align: center;
}
th input[type="checkbox"] {
  vertical-align: middle;
}
td .del,
td .edit {
  visibility: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  padding: 0 8px 2px;
  font-size: 14px;
  line-height: 1.6;
}
tr:hover td .del,
tr:hover td .edit {
  visibility: visible;
}
td .del {
  color: var(--danger);
}
td .del:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-ink);
}
td .edit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
td .edit + .del {
  margin-inline-start: 4px;
}

/* sessions */
#sessTable tbody tr[data-sid],
#regTable tbody tr[data-id],
#attTable tbody tr[data-id],
#courseTable tbody tr[data-cid] {
  cursor: pointer;
}
tbody tr.sel {
  background: var(--sel);
}
tbody tr.sel:hover {
  background: var(--sel-hover);
}
tr.dayrow td {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--dayrow);
  font-weight: 600;
  color: var(--ink);
}
tr.dayrow td .muted {
  font-weight: 400;
}
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent-soft-line);
  border-radius: 20px;
  padding: 1px 10px;
  font-size: 12px;
}
/* payments tab — one tone per method; «قسط قرض» rows are violet */
.badge.pos {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.badge.online {
  background: var(--full);
  color: var(--tick);
}
.badge.legacy {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge.loan {
  background: var(--violet-soft);
  color: var(--violet);
}
/* payments tab — two-line cells (name/phone, course/session) */
#payTable td .sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
#payTable td.money {
  font-weight: 600;
}
#paySum {
  color: var(--ink);
  font-weight: 600;
}

/* lists */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.list-card h3 {
  font-size: 14px;
  margin-bottom: 8px;
}
.list-card .items {
  list-style: none;
  margin-bottom: 8px;
}
.list-card .items li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.list-card .items li:last-child {
  border-bottom: 0;
}
.list-card .items li.empty {
  justify-content: center;
  font-size: 12px;
}
.list-card .items .val {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-card .items li .edit,
.list-card .items li .del {
  visibility: hidden;
  border: 0;
  padding: 4px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
}
.list-card .items li .edit .ic,
.list-card .items li .del .ic {
  width: 14px;
  height: 14px;
}
.list-card .items li:hover .edit,
.list-card .items li:hover .del {
  visibility: visible;
}
.list-card .items li .edit:hover {
  color: var(--accent);
}
.list-card .items li .del {
  color: var(--danger);
}
.list-card .items li .del:hover {
  color: var(--danger);
  background: var(--danger-soft);
}
.list-card form {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
  align-items: center;
}
.list-card form input,
.list-card form textarea {
  flex: 1;
  min-width: 0;
}
.list-card form .vbtn {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.list-card form .vbtn .ic {
  width: 15px;
  height: 15px;
}
.list-card form .vbtn.ok {
  color: var(--tick);
}
.list-card form .vbtn.cancel {
  color: var(--danger);
}
.list-card form .vbtn.cancel:hover {
  color: var(--danger);
  background: var(--danger-soft);
}
.add-item {
  width: 100%;
  border-style: dashed;
  color: var(--muted);
}
.add-item:hover {
  color: var(--ink);
}

/* combo dropdown (datalist replacement) */
.combo-pop {
  position: fixed;
  z-index: 90;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}
.combo-it {
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-it:hover,
.combo-it.act {
  background: var(--hover);
}
.combo-it.muted {
  cursor: default;
}

/* modal */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
@keyframes ovfade {
  from {
    opacity: 0;
  }
}
.overlay.hidden,
.hidden {
  display: none !important;
}
/* the confirm dialog must paint above every overlay it guards — the
   ticket modals come after it in the DOM (equal z=50 → later wins),
   and in-modal pickers float as .popfix at 95 */
#atModal {
  z-index: 96;
}
.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 24px 20px;
  width: min(460px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--shadow-3);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* wide variant — two columns of fields (session form) */
.modal.wide {
  width: min(860px, 94vw);
}
.modal .mcols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  align-items: start;
}
.modal .mcol {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}
/* stacked sub-group inside a column (course + supporter, shown together) */
.modal .fsub {
  display: flex;
  flex-direction: column;
  gap: 11px;
}


@media (max-width: 700px) {
  .modal .mcols {
    grid-template-columns: 1fr;
  }
}
@keyframes mpop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
.mhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  /* pinned inside the scrollable modal — pulled edge-to-edge over the
     modal's own padding so it reads as a fixed title bar */
  position: sticky;
  top: -18px;
  margin: -18px -24px 0;
  padding: 18px 24px 12px;
  background: var(--card);
  z-index: 3;
}
.mhead h2 {
  font-size: 16px;
  font-weight: 700;
}
.xbtn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.xbtn:hover {
  background: var(--hover);
  color: var(--ink);
}
.modal label,
.modal .fld {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.modal .trange-box {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.modal .trange-box .tsep {
  font-weight: 500;
  color: var(--muted);
  height: 34px; /* matches .dp-timein height so it centers on the inputs */
  display: flex;
  align-items: center;
}
.modal .trange-box .tpart {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal .trange-box .tpart > span {
  font-size: 11px;
  color: var(--muted);
}
.modal .actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: center;
  /* pinned footer — same edge-to-edge trick as .mhead */
  position: sticky;
  bottom: -20px;
  margin: 10px -24px -20px;
  padding: 14px 24px 20px;
  background: var(--card);
  z-index: 3;
}
.modal .actions .push {
  margin-inline-start: auto;
}

/* ---------- payment panel (ثبت‌نام و پرداخت) ---------- */
/* fx=full: the modal eases between its narrow/wide widths as the panel
   toggles (the column itself fades/slides via el.animate in modals.js) */
html[data-fx="full"] #pForm {
  transition: width 0.22s ease;
}
/* the add-participant modal starts narrow and gains .wide when the
   panel toggles open — until then its two .mcols stack */
.modal:not(.wide) .mcols {
  grid-template-columns: 1fr;
}
.paycol {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}
.paytgl {
  align-self: flex-start;
  font-size: 12.5px;
  padding: 6px 14px;
}
.paytgl.on {
  color: var(--accent);
  border-color: var(--accent);
}
.inrow {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.inrow > * {
  flex: 1;
  min-width: 0;
}
.segrow {
  display: flex;
  gap: 6px;
}
.segrow button {
  flex: 1;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--field);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
  white-space: nowrap;
}
.segrow button:hover {
  border-color: var(--accent);
}
.segrow button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.muted-s {
  font-size: 12px;
  color: var(--muted);
}
.warn-s {
  font-size: 12px;
  color: var(--warn-ink);
  font-weight: 600;
}

/* course-type info pills under the course pick */
.ctinfo {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}
.ctinfo span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-weight: 600;
}
.ctinfo span b {
  color: var(--ink);
}

/* optional blocks — کد تخفیف / هدیهٔ ما / وام بانکی / قرض ما */
.opt {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt.on {
  border-color: var(--accent-soft-line);
  background: var(--accent-soft);
}
.opt > .cc-check {
  font-size: 13px;
  font-weight: 700;
}
.opt > .cc-check small {
  font-weight: 500;
  color: var(--muted);
}
.opt .body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt:not(.on) .body {
  display: none;
}

/* payment rows */
.secbadge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  margin-inline-start: 8px;
}
.pays {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* one payment = one flat line: .pn / .rm are side rails centered on
   the row, .pbody holds amount + method pick + date pick */
.prow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.prow .pbody {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1.2fr auto 1.2fr;
  gap: 6px 8px;
  align-items: center;
}
/* repayment rows: amount + date only */
.prow.rep .pbody {
  grid-template-columns: 1fr 1fr;
}
/* compact method pick replaces the old two-button segrow so the
   payment date sits on the same line — narrow on purpose: the label
   needs only ~6em and the pickpop shows the full text anyway */
.prow .pmw {
  width: 104px;
}
.prow .pmw input {
  font-size: 12px;
  padding: 7px 8px;
}
.prow .pbody > * {
  min-width: 0;
}
.prow .pn {
  width: 22px;
  flex: none;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}
.prow .pickpop {
  font-size: 12.5px;
}
.prow .rm {
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  display: grid;
  place-items: center;
}
/* payment/repayment date — the pickwrap sits on the same line as the
   other fields; no time field (pay-borrow dropped it) */
.prow .pdtw input,
.prow .rdtw input {
  font-size: 12px;
  padding: 7px 8px;
}
.pbtns {
  display: flex;
  gap: 8px;
}
.pbtns button {
  font-size: 12.5px;
  padding: 6px 12px;
}
.pempty {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  padding: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
}

/* suggestion bar under the payments list — shown when part of the
   payments looks like قرض payback money */
.ppc-splitbar:empty {
  display: none;
}
.splitbar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  border: 1px dashed var(--accent-soft-line);
  background: var(--accent-soft);
  border-radius: var(--radius-s);
  padding: 7px 10px;
  font-size: 12.5px;
}
.splitbar .sb-txt { flex: 1 1 100%; min-width: 0; color: var(--accent-strong); }
.splitbar .sb-amt {
  width: 110px; font-size: 12px; padding: 6px 8px;
  background: var(--field);
}
.splitbar .sb-lbl {
  flex: 1; min-width: 90px; font-size: 12px; padding: 6px 8px;
  background: var(--field);
}
.splitbar .sb-go { font-size: 12px; padding: 6px 12px; flex: none; }
/* passive hint variant — no action, just guidance */
.splitbar.pass {
  border-style: dashed;
  background: transparent;
}
.splitbar.pass .sb-txt { color: var(--muted); }

/* per-payment-row «قرض» split button — sits before the ✕ rail */
.prow .psplitbtn {
  width: 30px; height: 30px; flex: none;
  padding: 0; display: grid; place-items: center;
}
.prow .psplitbtn svg { width: 15px; height: 15px; }
/* hidden while there is nothing left to repay */
.prow .psplitbtn.off { visibility: hidden; }

/* inline splitter that opens under a payment row */
.psplit {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin: -2px 30px 4px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card);
  padding: 7px 10px;
  font-size: 12px;
}
.psplit .sl-lbl { color: var(--muted); flex: none; }
.psplit .sl-amt { width: 110px; font-size: 12px; padding: 6px 8px; }
.psplit .sl-max { color: var(--muted); font-size: 11px; flex: 1; min-width: 120px; }
.psplit .sl-go { font-size: 12px; padding: 5px 12px; }
.psplit .sl-no { font-size: 12px; padding: 5px 10px; }

/* labelled extra rows (هزینه‌های دیگر): label + amount */
.prow.xrow .pbody { grid-template-columns: 1.1fr 1fr 1fr; }
.prow.xrow .pbody.xtwo { grid-template-columns: 1.1fr 1fr; }
.prow.xrow .xlabel { font-size: 12px; padding: 7px 8px; }

/* share tag under a split payment — the row keeps its real amount,
   this line shows the قرض allocation carved out of it */
.pshare {
  display: flex; align-items: center; gap: 8px;
  margin: -2px 30px 4px 30px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: var(--radius-s);
}
.pshare .muted-s { flex: 1; }
.pshare .pshare-x {
  width: 22px; height: 22px; padding: 0;
  display: grid; place-items: center;
}
.pshare .pshare-x svg { width: 12px; height: 12px; }

/* linked repayment row — its money is inside the payment's amount,
   shown with its source method as a tag, amount not editable */
.prow.rep.link .pbody { grid-template-columns: 1fr auto 1fr; }
.prow.rep.link .pamt { color: var(--muted); }
.ltag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* live receipt summary */
.rcpt {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}
.rcpt .rr {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}
.rcpt .rr b {
  color: var(--ink);
  font-weight: 600;
}
.rcpt .rr.sub {
  padding-inline-start: 12px;
  font-size: 11.5px;
}
.rcpt .rr.minus b {
  color: var(--warn-ink);
}
.rcpt hr {
  border: 0;
  border-top: 1px dashed var(--line-strong);
  margin: 3px 0;
}
.rcpt .rr.tot {
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
}
.rcpt .rr.tot b {
  font-weight: 800;
}
.rcpt .rr.tot.ok b {
  color: var(--tick);
}
.rcpt .rr.tot.due b {
  color: var(--danger);
}
.stline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.chip.full {
  background: var(--full);
  color: #15803d;
  border-color: color-mix(in srgb, var(--tick) 35%, transparent);
}
.chip.dep {
  background: var(--dep);
  color: var(--warn-ink);
  border-color: color-mix(in srgb, var(--warn-ink) 35%, transparent);
}
.chip.none {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-line);
}
.chip.info {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft-line);
  font-weight: 600;
}
[data-theme="dark"] .chip.full {
  color: var(--tick);
}

/* pay-borrow: section labels inside the receipt, loan info ✓, the
   قرض due-hint chip, the «واریز بانکی» row tag and the payback bar */
.rcpt .rr.sect {
  font-size: 11.5px;
}
.okmark {
  color: var(--tick);
}
.hintchip {
  display: inline-block;
  border-radius: 20px;
  padding: 1px 10px;
  font-size: 12px;
  border: 1px solid transparent;
}
.hintchip.info {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-soft-line);
}
.hintchip.warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber);
}
.hintchip.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-line);
}

/* «قرض» column chips reuse .chip — danger is the overdue variant */
.chip.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-line);
}

/* the loan hover card — one floating singleton under the chip */
.ltip {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-2);
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 2;
  min-width: 200px;
  display: none;
}
.ltip h5 {
  margin: 0 0 4px;
  font-size: 13px;
}
.ltip .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.ltip .row span {
  color: var(--muted);
}
.ltip .row b {
  font-weight: 600;
}
.lbar {
  height: 5px;
  border-radius: 4px;
  background: var(--hover);
  overflow: hidden;
}
.lbar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}
.lbar.done i {
  background: var(--tick);
}
.lbar.overdue i {
  background: var(--danger);
}
.ltip .lbar {
  margin: 4px 0 2px;
}
.ltip .warnline {
  color: var(--danger);
  font-weight: 600;
}
.ltip .okline {
  color: var(--tick);
  font-weight: 600;
}
.ltip .infoline {
  color: var(--accent-strong);
  font-weight: 600;
}
.pb-bar {
  height: 8px;
  border-radius: 6px;
  background: var(--hover);
  overflow: hidden;
  margin: 8px 0 4px;
}
.pb-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.2s;
}
.pb-bar.done i {
  background: var(--tick);
}

/* payment status line in the compact reg modals */
.payline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.payline .ghost {
  font-size: 12.5px;
  padding: 5px 12px;
}

/* «قیمت نامشخص» badge on table rows whose migrated price never resolved */
.pun {
  display: inline-block;
  padding: 1px 8px;
  margin-inline-start: 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--dep);
  color: var(--warn-ink);
  border: 1px solid color-mix(in srgb, var(--warn-ink) 35%, transparent);
  white-space: nowrap;
}

/* confirmation dialog */
.modal.confirm {
  width: min(300px, 92vw);
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 30px 24px 22px;
}
.modal.confirm .cicon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-line);
  color: var(--accent);
}
.modal.confirm .cicon.danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}
.modal.confirm .cicon .ic {
  width: 44px;
  height: 44px;
}
.modal.confirm h2 {
  font-size: 15.5px;
}
.modal.confirm p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink);
}
.modal.confirm .actions {
  border-top: 0;
  margin-top: 6px;
  padding-top: 0;
  width: 100%;
  gap: 10px;
}
.modal.confirm .actions button {
  flex: 1;
  white-space: nowrap;
}
.modal.confirm button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-ink);
}
.modal.confirm button.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  filter: brightness(0.92);
}
/* the disabled confirm must stay inert — its variant rules above
   outrank the generic button:disabled */
.modal.confirm button.danger:disabled,
.modal.confirm button.danger:disabled:hover {
  background: var(--disabled-bg);
  border-color: var(--line);
  color: var(--muted);
  filter: saturate(0.3);
}

/* styled pick dropdown */
.pickwrap {
  position: relative;
}
.pickwrap > input {
  width: 100%;
  caret-color: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pickwrap > input:not(:disabled) {
  cursor: pointer;
}
.pickpop {
  position: absolute;
  top: calc(100% + 6px);
  /* centered under the input; grows for long options, never narrower,
     capped so it can't run off the viewport */
  left: 50%;
  transform: translateX(-50%);
  min-width: 100%;
  width: max-content;
  max-width: min(340px, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 4px;
  z-index: 55;
  max-height: 220px;
  overflow-y: auto;
}
.pick-q {
  width: 100%;
  margin-bottom: 4px;
}
.pick-it {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-it small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.pick-it:hover,
.pick-it.act {
  background: var(--hover);
}
.pick-it.sel {
  background: var(--accent);
  color: var(--accent-ink);
}
/* keyboard-highlighted selected row keeps its accent fill but gets an
   inner ring so the .act position stays visible */
.pick-it.sel.act {
  box-shadow: inset 0 0 0 1.5px var(--accent-ink);
}
.pick-it.sel small {
  color: color-mix(in srgb, var(--accent-ink) 85%, transparent);
}
.pick-it.muted {
  cursor: default;
}

/* canned-note pick — small chip button at the end of a field's title row */
.modal .nrow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal .nrow .notepick {
  margin-inline-start: auto;
}
button.npbtn {
  font-size: 11.5px;
  padding: 3px 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

/* call-center connect — menu status chip + modal steps */
.ccst {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--muted);
}
.ccst i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}
.ccst.on { color: var(--toast-ok); }
.ccst.on i { background: var(--toast-ok); }
.ccst.exp { color: var(--toast-warn); }
.ccst.exp i { background: var(--toast-warn); }
.ccst.unreach { color: var(--muted); }
.ccst.unreach i {
  background: transparent;
  border: 1.5px solid var(--muted);
}
/* staff table — call-center membership: ✓ member / ✗ not a member
   (.tick is shared with other boolean cells; .xtick is its false twin.
   The size bump is scoped to this table so other ✓ cells are untouched) */
.xtick {
  color: var(--danger);
  font-weight: 700;
}
#staffTable .tick,
#staffTable .xtick {
  font-size: 1.35em;
  line-height: 1;
}
/* deactivated staff stay visible in the table, just faded — they can
   be reactivated from the toolbar (they never reach pickers at all) */
#staffTable tr.off td {
  opacity: 0.45;
}
.ccstep {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.cc-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.cc-warn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--warn-ink);
  background: var(--dep);
  border: 1px solid color-mix(in srgb, var(--warn-ink) 30%, transparent);
  border-radius: 10px;
  padding: 8px 12px;
}
.cc-warn .ic {
  width: 15px;
  height: 15px;
  flex: none;
}
.cc-otp {
  text-align: center;
  font-size: 20px;
  letter-spacing: 8px;
  font-weight: 700;
}
.cc-resend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
}
.cc-resend button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  padding: 4px 6px;
  border-radius: 6px;
}
.cc-resend button:hover:not(:disabled) {
  background: var(--accent-soft);
}
.cc-resend button:disabled {
  color: var(--muted);
  opacity: 0.7;
}
.cc-conn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--full);
  border: 1px solid color-mix(in srgb, var(--toast-ok) 35%, transparent);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.cc-conn .ic {
  width: 18px;
  height: 18px;
  color: var(--toast-ok);
  flex: none;
}
.cc-conn small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
button.npbtn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft-line);
}
.notepick .pickpop {
  right: auto;
  left: 0;
  transform: none;
  min-width: 230px;
}

/* toasts — stacked, typed (success / error / warning / info) */
#toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  padding: 9px 18px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  font-size: 13px;
  cursor: pointer;
  max-width: min(90vw, 480px);
  animation: toast-in 0.18s ease-out;
}
.toast .ic {
  width: 17px;
  height: 17px;
  flex: none;
}
.toast.out {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}
.toast.success {
  border-color: color-mix(in srgb, var(--toast-ok) 45%, transparent);
}
.toast.success .ic {
  color: var(--toast-ok);
}
.toast.warning {
  border-color: color-mix(in srgb, var(--toast-warn) 50%, transparent);
}
.toast.warning .ic {
  color: var(--toast-warn);
}
.toast.info .ic {
  color: var(--accent-strong);
}
.toast.error {
  border-color: var(--danger);
}
.toast.error .ic {
  color: var(--danger);
}

/* busy (in-flight) buttons */
button.busy,
button.busy:hover {
  opacity: 0.65;
}
button.busy::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-inline-end: 7px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: busy-spin 0.7s linear infinite;
}
@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

/* selection menu */
#selWrap,
#rBulkWrap {
  position: relative;
  display: inline-block;
}
#selWrap .menu,
#rBulkWrap .menu {
  right: auto;
  left: 0;
}
.selbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
  padding: 6px 10px;
  background: var(--field);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
}
.selbar.on {
  background: var(--sel);
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.selbar button {
  padding: 5px 12px;
  font-size: 13px;
}
.selbar .selbar-info {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0; /* flex item — ellipsis kicks in at the row's real edge, not a fixed cap */
}
.selbar.on .selbar-info {
  color: var(--accent-strong);
  font-weight: 600;
}
.selbar .selbar-hint {
  font-size: 12px;
  color: var(--muted);
}
.selbar.on .selbar-hint {
  display: none;
}
.selbar .selbar-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-inline-start: auto;
}
.selbar-mid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
#selCount,
#rBulkCount {
  display: inline-block;
  min-width: 108px;
  text-align: center;
}
.selbar .vdiv {
  width: 1px;
  align-self: stretch;
  background: var(--line-strong);
  margin: 2px 4px;
}
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 6px;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.menu button {
  border: 0;
  justify-content: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  white-space: nowrap;
}
.menu button .ic {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.menu button.danger .ic {
  color: var(--danger);
}
.menu button:hover:not(:disabled) {
  background: var(--hover);
}
.menu button.danger:hover {
  background: var(--danger-soft);
}
.menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

/* on/off switch inside menu buttons (fxBtn) — the knob lives in the
   pill's flex flow so it can't sit off-track; off hugs inline-start,
   on slides to inline-end (mirrors correctly in RTL) */
/* on/off switch inside menu buttons (fxBtn) — knob in flex flow at
   inline-start; "on" slides it to inline-end via a composited
   transform (no layout rounding at fractional zooms) */
button .sw {
  margin-inline-start: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 20px;
  padding: 2px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 0.15s ease;
}
button .sw::after {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-1);
  /* negative X slides toward inline-end in this RTL-only app */
  transition: transform 0.15s ease;
}
button[role="switch"][aria-checked="true"] .sw {
  background: var(--accent);
}
button[role="switch"][aria-checked="true"] .sw::after {
  transform: translateX(-16px);
}

/* burger / user menu (top-left) */
#userWrap {
  position: relative;
  display: inline-block;
}
#userMenu {
  right: auto;
  left: 0;
  min-width: 230px;
}
.menu-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.menu-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-line);
  color: var(--accent);
}
.menu-avatar svg {
  width: 20px;
  height: 20px;
}
.menu-profile-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.menu-profile-txt b {
  font-size: 14px;
}
.menu-profile-txt small {
  font-size: 12px;
  color: var(--muted);
}

/* read-only flags */
.tick {
  color: var(--tick);
  font-weight: 700;
}
.tick.pend {
  color: var(--warn-ink);
}
.modal .flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.modal .flags label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
}

/* call-center segmented picker (participant add/edit) */
.ccseg {
  display: flex;
  gap: 8px;
}
.ccseg button {
  flex: 1;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--field);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}
.ccseg button:hover {
  border-color: var(--accent);
}
.ccseg button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--ring);
}

/* call-center badge in the attendance table */
.ccb {
  display: inline-block;
  padding: 1px 8px;
  margin-inline-start: 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent-soft-line);
}
.ccb.c1 {
  background: var(--full);
  color: var(--tick);
  border-color: transparent;
}
/* empty cc — shown as a muted dashed chip so "not from a call center"
   is explicit, not just blank */
.ccb.none {
  background: var(--hover);
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  font-weight: 500;
}

/* staff level badge in the مربیان table */
.lv {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--dep);
  color: var(--warn-ink);
  border: 1px solid transparent;
}
.lv.l2 {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-soft-line);
}
.lv.l3 {
  background: var(--full);
  color: var(--tick);
}
/* protected seed staff marker (دفتر، استاد عبدی — organizer = self) */
.ptag {
  display: inline-block;
  padding: 0 8px;
  border-radius: 20px;
  font-size: 11px;
  background: var(--disabled-bg);
  color: var(--muted);
}

/* course lifecycle status badge + dimmed completed rows */
.cst {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 20px;
  font-size: 12px;
}
.cst.upcoming {
  background: var(--dep);
  color: var(--warn-ink);
}
.cst.nodate {
  background: var(--dep);
  color: var(--warn-ink);
}
.cst.running {
  background: var(--full);
  color: var(--tick);
}
.cst.done {
  background: var(--th-bg);
  color: var(--muted);
  border: 1px solid var(--line-strong);
}
tr.cdone {
  opacity: 0.55;
}

/* related-participants group chip + row stripe */
.grb {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  margin-inline-start: 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: color-mix(in srgb, var(--grpc, var(--muted)) 16%, var(--card));
  color: color-mix(in srgb, var(--grpc, var(--muted)) 55%, var(--ink));
  border: 1px solid
    color-mix(in srgb, var(--grpc, var(--muted)) 40%, transparent);
  vertical-align: 1px;
}
.grb svg {
  width: 9px;
  height: 9px;
}
tr.grp > td:first-child {
  box-shadow: inset -3px 0 0 var(--grpc);
}
.modal .grprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--ink);
  font-size: 12.5px;
}
.modal .grprow .ghost {
  flex: none;
}

/* jalali datepicker */
.dpwrap {
  position: relative;
  display: inline-block;
}
#fdate,
#sfdate,
#ddate,
#rFDate,
.modal .dpwrap > input:not(:disabled) {
  cursor: pointer;
  caret-color: transparent;
}
.dppop {
  position: absolute;
  top: calc(100% + 6px);
  /* centered like .pickpop; fitPop nudges it back inside the viewport */
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 12px;
  z-index: 45;
  width: 264px;
  user-select: none;
}
.dp-mode {
  display: flex;
  gap: 2px;
  padding: 2px;
  margin-bottom: 8px;
  background: var(--hover);
  border-radius: var(--radius-s);
}
.dp-mode button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 0;
  border-radius: 8px;
}
.dp-mode button.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dp-head strong {
  font-size: 14px;
}
.dp-head .dp-month {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  border-radius: 8px;
}
.dp-head .dp-month:hover {
  background: var(--hover);
  color: var(--accent);
}
.dp-head .dp-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  border-radius: 8px;
}
.dp-head .dp-title:hover {
  background: var(--hover);
  color: var(--accent);
}
.dp-head button {
  border: 0;
  padding: 2px 10px;
  font-size: 15px;
  background: transparent;
}
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.dp-grid .wd {
  font-size: 11px;
  color: var(--muted);
  padding: 3px 0;
}
.dp-grid .d {
  padding: 5px 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  position: relative;
}
.dp-grid .d:hover {
  background: var(--hover);
}
.dp-grid .d.has {
  font-weight: 700;
}
.dp-grid .d.dis {
  opacity: 0.35;
  cursor: default;
}
.dp-grid .d.dis:hover {
  background: none;
}
.dp-grid .d.has::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 50%;
  transform: translateX(50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-strong);
}
.dp-grid .d.sel {
  background: var(--accent);
  color: var(--accent-ink);
}
.dp-grid .d.rng {
  background: var(--accent-soft);
  border-radius: 4px;
}
/* year/month drill grids (yearNav) reuse the .d cell look */
.dp-ymgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  text-align: center;
}
.dp-ymgrid .d {
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.dp-ymgrid .d:hover {
  background: var(--hover);
}
.dp-ymgrid .d.sel {
  background: var(--accent);
  color: var(--accent-ink);
}
.dp-foot {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
}
.dp-foot button {
  font-size: 12px;
  padding: 5px 10px;
}
.dp-timebox {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.tlbl {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 4px;
}
.dp-twrap {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--field);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dp-twrap:hover {
  border-color: var(--line-strong);
}
.dp-twrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.dp-twrap b {
  color: var(--muted);
  font-size: 15px;
}
.dp-timein {
  flex: 1;
  width: 0;
  text-align: center;
  font-size: 15px;
  letter-spacing: 1px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.dp-timein:focus {
  border: 0;
  box-shadow: none;
}

.dp-grid .d.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

select:disabled,
input:disabled,
textarea:disabled {
  color: var(--muted);
  background: var(--disabled-bg);
  border-color: var(--line);
  cursor: not-allowed;
}

.modal .dpwrap {
  display: block;
}
.modal .dpwrap input {
  width: 100%;
}
.modal .dppop {
  z-index: 55;
  max-height: min(70vh, 540px);
  overflow-y: auto;
}
/* popup re-anchored to <body> at viewport coords — escapes scrollable
   modals so opening it never grows the modal's own scrollbar */
.popfix {
  position: fixed;
  z-index: 95;
  overflow-y: auto;
}

/* fixed-size toolbar filters */
#fsessWrap > input {
  width: 190px;
}
#tab-attendance .toolbar {
  flex-wrap: nowrap;
  gap: 6px;
}
#tab-attendance .toolbar .pickwrap > input,
#tab-attendance .toolbar .dpwrap > input {
  width: 92px;
  text-overflow: ellipsis;
}
#tab-attendance #fsessWrap > input {
  width: 150px;
}
#tab-attendance .toolbar .dpwrap > input {
  width: 104px;
}
#tab-attendance .toolbar input[type="search"] {
  min-width: 110px;
}
#clearFiltersBtn,
#rClearFiltersBtn,
#cClearFiltersBtn {
  font-size: 16px;
}

/* ================= dashboard ================= */
#tab-dashboard {
  overflow: hidden;
}
.dscroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 20px;
}
.dspacer {
  flex: 1;
}

#dStamp {
  font-size: 12px;
}

/* KPI stat band — one surface divided into cells. The 1px grid gap
   draws the hairlines between stats so wrapped rows stay clean;
   each cell keeps its tone via icon chip + ratio bar colors. */
.dkpis {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  margin-bottom: 14px;
}
.dkpi {
  --kc: var(--accent-strong);
  position: relative;
  flex: 1 1 158px;
  background: var(--card);
  padding: 13px 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 112px;
  transition: background-color 0.15s ease;
  animation: din 0.35s ease backwards;
  animation-delay: var(--d, 0s);
}
.dkpi::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(
    270deg,
    var(--kc),
    color-mix(in srgb, var(--kc) 35%, transparent) 70%,
    transparent
  );
}
.dkpi:hover {
  background: var(--hover);
}
@keyframes din {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes barin {
  from {
    transform: scaleX(0);
  }
}
@keyframes ddonut-in {
  from {
    opacity: 0.4;
    transform: rotate(-90deg) scale(0.85);
  }
}
.dkpi-hd {
  display: flex;
  align-items: center;
  gap: 9px;
}
.dkpi-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--kc) 18%, transparent);
}
.dkpi-ic .ic {
  width: 17px;
  height: 17px;
}
.dkpi-lb {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dkpi.ok,
.dkpi.tone-g {
  --kc: var(--tick);
}
.dkpi.tone-v {
  --kc: var(--violet);
}
.dkpi.tone-t {
  --kc: var(--teal);
}
.dkpi.tone-m {
  --kc: var(--amber);
}
.dkpi.warn {
  --kc: var(--danger);
}
.dkpi.ok .dkpi-ic,
.dkpi.tone-g .dkpi-ic {
  background: var(--full);
  color: var(--tick);
}
.dkpi.tone-v .dkpi-ic {
  background: var(--violet-soft);
  color: var(--violet);
}
.dkpi.tone-t .dkpi-ic {
  background: var(--teal-soft);
  color: var(--teal);
}
.dkpi.tone-m .dkpi-ic {
  background: var(--amber-soft);
  color: var(--amber);
}
.dkpi.warn {
  background: linear-gradient(135deg, var(--danger-soft) 0%, var(--card) 55%);
}
.dkpi.warn:hover {
  background: var(--danger-soft);
}
.dkpi.warn .dkpi-ic {
  background: var(--danger-soft);
  color: var(--danger);
  animation: dkpi-ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes dkpi-ping {
  0% {
    box-shadow: 0 0 0 0 var(--danger-line);
  }
  60%,
  100% {
    box-shadow: 0 0 0 8px transparent;
  }
}
.dkpi-v {
  display: block;
  margin-top: 7px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.4px;
  white-space: nowrap;
}
.dkpi-s {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 9px;
}
.ktrack {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--hover);
  overflow: hidden;
}
.ktrack i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(
    270deg,
    var(--kc),
    color-mix(in srgb, var(--kc) 55%, transparent)
  );
  transform-origin: right;
  animation: barin 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--d, 0s) + 0.15s);
}
.kbar em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--kc);
  min-width: 24px;
  text-align: left;
}

/* dashboard body — a fixed ops rail at the start edge (alerts +
   today's sessions, always within reach) beside a free analytics
   column; related widgets share one surface split by hairlines */
.dbody {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
/* rail:main split — 1:2 of the dashboard body */
.drail {
  flex: 1 1 0;
  min-width: 0;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 152px);
}
.dmain {
  flex: 2 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 18px;
  box-shadow: var(--shadow-1);
  min-width: 0;
}
/* rail cards grow/shrink inside the capped rail — their list bodies
   scroll internally instead of pushing the rail past the viewport */
.drail .dcard {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 0 1 auto;
}
.drail .dcard h3 {
  flex-shrink: 0;
}
/* safety net — capped tiles keep the rail short in practice, but a
   very short viewport can still squeeze it; the lists scroll inside
   their cards rather than pushing past the viewport */
#dAttn {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-inline-end: 3px;
}
#dSessions {
  overflow-y: auto;
  padding-inline-end: 3px;
}
/* related widgets inside one card — hairline separators instead of
   separate surfaces so the group reads as a single report */
.dsplit {
  display: flex;
  padding: 0;
}
.dsec {
  flex: 1 1 0;
  min-width: 0;
  padding: 15px 18px;
}
.dsec + .dsec {
  border-inline-start: 1px solid var(--line);
}
/* shorter sections (e.g. the payment donut beside the tall funnel)
   center their body vertically instead of leaving a dead bottom gap */
.dsec:has(.dpay) {
  display: flex;
  flex-direction: column;
}
.dsec .dpay {
  flex: 1;
  align-content: center;
}
/* all-time zone — the course/supporter/ctype reports ignore the
   session-date window, so they sit below the scoped dashboard
   behind their own labeled divider */
.dzone {
  margin-top: 22px;
}
.dzone-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-inline: 4px;
  color: var(--muted);
}
.dzone-hd > .ic {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}
.dzone-hd b {
  font-size: 12.5px;
  font-weight: 700;
}
.dzone-hd .dzone-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.dzone-hd small {
  font-size: 11px;
}
/* «بدون پشتیبان»/unassigned rows in the report tiles — dashed rail
   marks them as open buckets rather than a named group */
.ccrow.none {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--warn-ink) 45%, var(--line));
}
/* «نمایش بیشتر» footer — a capped tile's doorway to the full list */
.dxmore {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 9px;
  padding: 7px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease,
    background-color 0.14s ease;
}
.dxmore:hover {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  background: var(--accent-soft);
}
.dxmore .ic {
  width: 13px;
  height: 13px;
}
/* tile list viewer — every row of a capped tile in one overlay.
   Rows keep their data-nav/data-add hooks: a click inside still
   deep-links (dashboard.js closes the viewer first) */
.dxmodal {
  width: min(620px, 94vw);
  max-height: 82vh;
}
.dxbody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 2px;
  /* the row hover nudge shifts rows 3px toward inline-end — 3px of
     breathing room keeps it inside the scroll box so it never
     flashes a horizontal scrollbar */
  padding-inline-end: 3px;
}
/* rows inside the viewer keep the staggered fade but drop the 6px
   lift — a translated last row briefly overflows the scroll box and
   flashes a phantom scrollbar even when everything fits */
.dxbody [style*="--d:"] {
  animation-name: din-fade;
}
@keyframes din-fade {
  from {
    opacity: 0;
  }
}
/* staggered card entrances — each widget fades up in order */
.drail > .dcard,
.dmain > .dcard,
.dzone > .dcard {
  animation: din 0.4s ease backwards;
}
.drail > .dcard:nth-child(2),
.dmain > .dcard:nth-child(2) {
  animation-delay: 0.05s;
}
.dmain > .dcard:nth-child(3) {
  animation-delay: 0.1s;
}
.dzone > .dcard {
  animation-delay: 0.15s;
}
.dcard h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dcard h3 > .ic {
  width: 15px;
  height: 15px;
  color: var(--muted);
  opacity: 0.85;
}
/* boot state — the grid stays hidden until the first /api/dashboard
   payload lands; one muted line stands in for the whole page so the
   card shells never flash empty */
.dboot-msg {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 140px 0;
  color: var(--muted);
  font-size: 13.5px;
}
.dboot-msg::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: transparent;
  border-radius: 50%;
  animation: busy-spin 0.8s linear infinite;
}
#tab-dashboard.dboot .dscroll {
  display: none;
}
#tab-dashboard.dboot .dboot-msg {
  display: flex;
}
.dempty {
  color: var(--muted);
  text-align: center;
  padding: 26px 10px;
  font-size: 12.5px;
}
.dempty .ic {
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
}
.dempty.dok .ic {
  color: var(--tick);
}

/* conversion funnel — centered silhouette: each stage bar shrinks
   toward the middle so the shape reads as a funnel; drop pills
   between stages carry the step conversion + lost count */
.fchart {
  display: flex;
  flex-direction: column;
}
.fstage {
  animation: din 0.35s ease backwards;
  animation-delay: var(--d, 0s);
}
.fstop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.fstop b {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.fstop b small {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
}
.fswrap {
  display: flex;
  justify-content: flex-start;
}
.fsbar {
  width: var(--w);
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fc1), var(--fc2));
  box-shadow: 0 3px 8px color-mix(in srgb, var(--fc1) 28%, transparent);
  transform-origin: right;
  animation: fgrow 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--d, 0s) + 0.08s);
}
@keyframes fgrow {
  from {
    transform: scaleX(0);
    opacity: 0.4;
  }
}
/* stage hues — indigo → violet → teal → green flow down the funnel */
.fstage.f0 {
  --fc1: var(--accent);
  --fc2: var(--accent-2);
}
.fstage.f1 {
  --fc1: var(--accent-2);
  --fc2: var(--violet);
}
.fstage.f2 {
  --fc1: var(--violet);
  --fc2: var(--teal);
}
.fstage.f3 {
  --fc1: var(--teal);
  --fc2: var(--tick);
}
.fstage.f4 {
  --fc1: var(--tick);
  --fc2: color-mix(in srgb, var(--tick) 55%, #ffffff);
}
.fsdrop {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 6px 0;
  animation: din 0.3s ease backwards;
  animation-delay: var(--d, 0s);
}
.fdp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--tick);
  background: var(--full);
  border-radius: 999px;
  padding: 2px 9px;
}
.fdp .ic {
  width: 10px;
  height: 10px;
}
.fsdrop small {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
}

/* payment donut */
.dpay {
  display: flex;
  align-items: center;
  gap: 20px;
}
.ddonut {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}
.ddonut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 3px 7px rgba(30, 35, 60, 0.14));
  animation: ddonut-in 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
/* faint track under the segments so gaps read as intentional */
.dtrack {
  stroke: var(--hover);
}
.dseg {
  transition: opacity 0.15s ease;
}
/* legend hover → spotlight that segment, dim the rest */
.dpay-svg.dim .dseg:not(.hl) {
  opacity: 0.25;
}
.dseg.hl circle {
  filter: brightness(1.08);
}
.ddonut-c {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ddonut-c b {
  font-size: 20px;
  font-weight: 800;
}
.ddonut-c span {
  font-size: 10.5px;
  color: var(--muted);
}
.ddonut-c small {
  font-size: 9.5px;
  color: var(--muted);
  opacity: 0.8;
  margin-top: 1px;
}
.dlegend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dleg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background-color 0.12s ease;
  animation: din 0.3s ease backwards;
  animation-delay: var(--d, 0s);
}
.dleg:hover {
  background: var(--hover);
}
.dld {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  flex-shrink: 0;
}
.dlt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dlt b {
  font-size: 12px;
  font-weight: 600;
}
.dlbar {
  display: block;
  height: 3px;
  max-width: 130px;
  border-radius: 2px;
  background: var(--hover);
  overflow: hidden;
}
.dlbar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  transform-origin: right;
  animation: barin 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--d, 0s) + 0.1s);
}
.dlv {
  font-size: 15px;
  font-weight: 800;
}
.dlp {
  color: var(--muted);
  font-size: 10.5px;
  width: 32px;
  flex-shrink: 0;
  text-align: left;
}

/* call-center share rows */
.ccrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  animation: din 0.3s ease backwards;
  animation-delay: var(--d, 0s);
  transition: background-color 0.14s ease, border-color 0.14s ease,
    transform 0.14s ease, box-shadow 0.14s ease;
}
.ccrow[data-nav] {
  cursor: pointer;
}
.ccrow[data-nav]:hover {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-1);
  transform: translateX(-3px);
}
.ccic {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cc, var(--accent)) 12%, var(--card));
  color: var(--cc, var(--accent-strong));
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--cc, var(--accent)) 20%, transparent);
}
.ccic .ic {
  width: 15px;
  height: 15px;
}
.ccinfo {
  flex: 1;
  min-width: 0;
}
.ccline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.ccline b {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ccpill {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  color: var(--cc, var(--accent-strong));
  background: color-mix(in srgb, var(--cc, var(--accent)) 10%, var(--card));
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}
.ccpill em {
  font-style: normal;
}
.cctrack {
  height: 6px;
  background: var(--hover);
  border-radius: 4px;
  overflow: hidden;
}
.ccbar {
  position: relative;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(
    270deg,
    var(--cc, var(--accent)),
    color-mix(in srgb, var(--cc, var(--accent)) 55%, transparent)
  );
  transform-origin: right;
  animation: barin 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--d, 0s) + 0.12s);
}
/* darker overlay = paid share within this call center's slice */
.ccbar i {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  background: rgba(0, 0, 0, 0.24);
}
.ccnum {
  flex-shrink: 0;
  text-align: left;
}
.ccnum b {
  font-size: 15px;
  font-weight: 800;
}
.ccnum small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.ccnum small em {
  font-style: normal;
  color: var(--tick);
  font-weight: 700;
}
.ccrow > .ic {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
/* expandable support rows — only inside the «نمایش بیشتر» overlay:
   the row toggles its per-type split instead of deep-linking, and
   the chevron tips down while open */
.ccrow.xrow {
  cursor: pointer;
}
.ccrow.xrow > .ic {
  transition: transform 0.18s ease;
}
.ccrow.xrow.open > .ic {
  transform: rotate(-90deg);
}
.sublist {
  display: none;
  margin: -4px 10px 8px;
  padding-inline-start: 43px;
}
.ccrow.xrow.open + .sublist {
  display: block;
}
.subrow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 11.5px;
  cursor: pointer;
  transition: background-color 0.13s ease, border-color 0.13s ease;
}
.subrow:hover {
  background: var(--hover);
  border-color: var(--line);
}
.subrow > i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.subrow > span {
  width: 130px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subrow .sbtrack {
  flex: 1;
  height: 5px;
  background: var(--hover);
  border-radius: 3px;
  overflow: hidden;
}
.subrow .sbtrack i {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.subrow > b {
  width: 34px;
  text-align: left;
  font-size: 12px;
}
.subrow.pend {
  color: var(--warn-ink);
}
.subrow.pend > i {
  background: repeating-linear-gradient(
    -45deg,
    var(--warn-ink) 0 2px,
    transparent 2px 4px
  );
  border: 1px solid var(--warn-ink);
}
.subrow.allrow {
  color: var(--muted);
  border-top: 1px dashed var(--line);
  border-radius: 0 0 9px 9px;
  margin-top: 2px;
  padding-top: 7px;
}
/* group divider used inside dashboard cards */
.dsgroup {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin: 12px 0 4px;
}
.dsgroup:first-child {
  margin-top: 0;
}
.dsgroup::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
/* attendance trend — stacked column chart, one column per session day.
   x reads right→left (oldest day at the right edge) to match the page's
   reading order; the right gutter holds round-number gridline labels */
.tchart {
  position: relative;
}
.tstats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 4px;
}
.tchip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  background: var(--hover);
  border-radius: 999px;
  padding: 4px 11px;
}
.tchip small {
  font-size: 10px;
}
.tchip b {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}
.tchip em {
  font-style: normal;
  font-size: 9.5px;
}
.tchip.peak {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.tchip.peak b {
  color: var(--accent-strong);
}
/* horizontal scroll strip for long ranges — svg keeps its pixel width
   (inline style) and the strip scrolls; min-width stretches it when the
   range fits inside the card. rtl direction → scroll starts at the
   oldest day on the right */
.tscroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.tscroll svg {
  display: block;
  height: auto;
  min-width: 100%;
}
/* svg text inherits the page's rtl direction, which flips where
   text-anchor "start" lands — force ltr so labels anchor at x and grow
   rightward (persian glyphs still render rtl internally via bidi) */
.tchart text {
  font-family: inherit;
  direction: ltr;
}
.tgrid {
  stroke: var(--line);
  stroke-dasharray: 2 5;
}
.taxis {
  stroke: var(--line-strong);
}
.tavg {
  stroke: var(--muted);
  stroke-dasharray: 5 4;
  opacity: 0.5;
}
.tavg-l {
  fill: var(--muted);
  font-size: 8.5px;
}
.tyl {
  fill: var(--muted);
  font-size: 9px;
}
.txl {
  fill: var(--muted);
  font-size: 9.5px;
  text-anchor: middle;
}
.txl.on {
  fill: var(--accent-strong);
  font-weight: 700;
}
.txw {
  fill: var(--muted);
  font-size: 8.5px;
  text-anchor: middle;
  opacity: 0.75;
}
.tv {
  fill: var(--ink);
  font-size: 9.5px;
  font-weight: 700;
  text-anchor: middle;
}
.tv.peak {
  fill: var(--accent-strong);
  font-size: 11px;
}
.tcol {
  cursor: pointer;
}
.thl {
  fill: transparent;
  transition: fill 0.12s ease;
}
.tcol:hover .thl {
  fill: var(--hover);
}
.tsegs {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: tgrow 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: var(--d, 0s);
}
@keyframes tgrow {
  from {
    transform: scaleY(0);
  }
}
.seg.done {
  fill: var(--tick);
}
.seg.pend {
  fill: var(--warn-ink);
}
.seg.rest {
  fill: url(#tgRest);
}
.tstub {
  fill: var(--line);
}
.ttick {
  fill: var(--accent-strong);
}
.thit {
  fill: transparent;
  pointer-events: all;
}
.tcol:hover .seg {
  filter: brightness(1.08);
}
.ttip {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  transform: translate(-50%, -115%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  min-width: 148px;
  box-shadow: 0 10px 28px rgba(15, 18, 30, 0.18);
  font-size: 11px;
  white-space: nowrap;
}
.ttip .ttd {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
}
.ttip .ttr {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  line-height: 2;
}
.ttip .ttr i {
  width: 8px;
  height: 8px;
  border-radius: 2.5px;
  background: var(--c);
  flex-shrink: 0;
}
.ttip .ttr b {
  margin-inline-start: auto;
  padding-inline-start: 14px;
  color: var(--ink);
}
.ttip .ttt {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed var(--line);
  margin-top: 6px;
  padding-top: 5px;
  color: var(--muted);
}
.ttip .ttt b {
  color: var(--ink);
}
.tlegend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.tlegend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-inline-end: 5px;
  vertical-align: -1px;
}
.tlegend .done {
  background: var(--tick);
}
.tlegend .pend {
  background: var(--warn-ink);
}
.tlegend .rest {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}
.tlegend .avg {
  width: 14px;
  height: 0;
  border-radius: 0;
  border-top: 2px dashed var(--muted);
  vertical-align: 2px;
}

/* today's/upcoming sessions — timeline list: a rail runs down the
   start edge, a node marks each session (solid + pulsing today,
   hollow upcoming), and a micro bar shows each session's paid share */
.dsess {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  padding-inline-start: 27px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  animation: din 0.3s ease backwards;
  animation-delay: var(--d, 0s);
  transition: background-color 0.14s ease, border-color 0.14s ease,
    transform 0.14s ease, box-shadow 0.14s ease;
}
/* the rail — clipped at both ends of the list so it doesn't overshoot */
.dsess::before {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  top: -6px;
  bottom: -6px;
  width: 2px;
  background: var(--line);
}
.dsgroup + .dsess::before {
  top: 50%;
}
#dSessions .dsess:last-child::before,
/* capped tiles end with the «نمایش بیشتر» button — the row before it
   is the visual last one, so the rail still clips at its node */
#dSessions .dsess:has(+ .dxmore)::before {
  bottom: 50%;
}
.snode {
  position: absolute;
  inset-inline-start: 7px;
  top: 50%;
  margin-top: -3.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line-strong);
  z-index: 1;
  transition: border-color 0.14s ease;
}
.dsess.today .snode {
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  inset-inline-start: 6px;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px var(--ring);
}
.dsess.today .snode::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent-strong);
  animation: attn-ping 1.7s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.dsess:hover .snode {
  border-color: var(--accent-strong);
}
.spaid {
  height: 3px;
  margin-top: 5px;
  max-width: 130px;
  border-radius: 2px;
  background: var(--hover);
  overflow: hidden;
}
.spaid i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--teal), var(--tick));
  transform-origin: right;
  animation: barin 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--d, 0s) + 0.12s);
}
.dsess:hover {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-1);
  transform: translateX(-3px);
}
.dsess-time {
  position: relative;
  width: 56px;
  flex-shrink: 0;
  text-align: center;
  border-radius: 10px;
  padding: 6px 2px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.dsess.today .dsess-time {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 4px 12px var(--ring);
}
.slive {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-ink);
}
.slive::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: attn-ping 1.7s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.dsess-time b {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.dsess-time small {
  font-size: 9px;
}
.dsess-info {
  flex: 1;
  min-width: 0;
}
.dsess-info b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsess-info small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsess-n {
  width: 40px;
  flex-shrink: 0;
  text-align: center;
}
.dsess-n b {
  display: block;
  font-size: 15px;
  font-weight: 800;
}
.dsess-n small {
  display: block;
  font-size: 9px;
  color: var(--muted);
}
.dsess > .ic {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.14s ease, color 0.14s ease;
}
.dsess:hover > .ic {
  color: var(--ink);
  transform: translateX(-2px);
}
/* per-session quick-add — opens the participant form locked to that
   session (delegated [data-add] handler wins over the row's data-nav) */
.sadd {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  transition: color 0.14s ease, border-color 0.14s ease,
    background-color 0.14s ease, box-shadow 0.14s ease;
}
.sadd .ic {
  width: 13px;
  height: 13px;
}
.sadd:hover,
.sadd:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  background: var(--hover);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent-strong) 22%, transparent);
}

/* generic list rows (leaderboard, courses) */
.drow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  animation: din 0.3s ease backwards;
  animation-delay: var(--d, 0s);
  transition: background-color 0.14s ease, border-color 0.14s ease,
    transform 0.14s ease, box-shadow 0.14s ease;
}
.drow:hover {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-1);
  transform: translateX(-3px);
}
.drow > .ic {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.14s ease, color 0.14s ease;
}
.drow:hover > .ic {
  color: var(--ink);
  transform: translateX(-2px);
}
.drank {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--hover);
  color: var(--muted);
}
.drank.r1 {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #fff;
  box-shadow: 0 2px 7px rgba(217, 119, 6, 0.35);
}
.drank.r2 {
  background: linear-gradient(135deg, #cbd5e1, #64748b);
  color: #fff;
}
.drank.r3 {
  background: linear-gradient(135deg, #e0a075, #a05c35);
  color: #fff;
}
.dinfo {
  flex: 1;
  min-width: 0;
}
.dinfo b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dinfo small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dnums {
  flex-shrink: 0;
  text-align: left;
}
.dnums b {
  font-size: 14px;
  font-weight: 800;
}
.dnums small {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}
.dprog {
  height: 5px;
  margin-top: 5px;
  background: var(--hover);
  border-radius: 3px;
  overflow: hidden;
}
.dprog i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(
    270deg,
    var(--rc, var(--accent)),
    color-mix(in srgb, var(--rc, var(--accent)) 55%, transparent)
  );
  transform-origin: right;
  animation: barin 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--d, 0s) + 0.12s);
}
/* #1 leaderboard row — subtle gold-tinted podium finish */
.drow.top {
  background: linear-gradient(
    270deg,
    color-mix(in srgb, var(--rc) 10%, transparent),
    transparent 75%
  );
  border-color: color-mix(in srgb, var(--rc) 28%, transparent);
}
.drow .cst {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
}
.cric {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
/* course rows tint their icon chip by lifecycle status */
.drow.st-upcoming .cric,
.drow.st-nodate .cric {
  background: var(--dep);
  color: var(--warn-ink);
}
.drow.st-running .cric {
  background: var(--full);
  color: var(--tick);
}
.drow.st-done .cric {
  background: var(--hover);
  color: var(--muted);
}
.cric .ic {
  width: 16px;
  height: 16px;
}

/* leaderboard mini toggle inside the card header */
.lseg {
  display: flex;
  gap: 2px;
  margin-inline-start: auto;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
}
.lseg button {
  border: 0;
  background: transparent;
  padding: 2px 9px;
  border-radius: 6px;
  font: inherit;
  font-size: 10.5px;
  color: var(--muted);
  cursor: pointer;
}
.lseg button.on {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-1);
}

/* needs-attention card — severity-tinted shell + layered list rows */
.attn-all {
  margin-inline-start: auto;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.75;
}
.attn-card h3 .ic {
  width: 15px;
  height: 15px;
  color: var(--warn-ink);
}
.attn-card.sev-crit {
  border-color: var(--danger-line);
  background: linear-gradient(180deg, var(--danger-soft) 0%, var(--card) 46%);
}
.attn-card.sev-crit h3 .ic {
  color: var(--danger);
}
.attn-card.sev-warn {
  background: linear-gradient(180deg, var(--dep) 0%, var(--card) 46%);
}

/* summary strip: live total + severity breakdown pills */
.attn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 11px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}
.attn-total {
  display: flex;
  align-items: center;
  gap: 9px;
}
.attn-total b {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.attn-total > span {
  font-size: 11px;
  color: var(--muted);
}
.attn-pulse {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn-ink);
  flex-shrink: 0;
}
.attn-pulse.crit {
  background: var(--danger);
}
.attn-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: attn-ping 1.7s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes attn-ping {
  0% {
    transform: scale(1);
    opacity: 0.65;
  }
  75%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}
.attn-sev {
  display: flex;
  gap: 6px;
}
.asev {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 3.5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.asev i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.asev.crit {
  background: var(--danger-soft);
  color: var(--danger);
}
.asev.crit i {
  background: var(--danger);
}
.asev.warn {
  background: var(--dep);
  color: var(--warn-ink);
}
.asev.warn i {
  background: var(--warn-ink);
}

/* item rows: severity rail + tinted icon + label/sub + count/share */
.attn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 9px 12px;
  padding-inline-start: 16px;
  border-radius: 12px;
  cursor: pointer;
  text-align: start;
  transition: background-color 0.14s ease, border-color 0.14s ease,
    transform 0.14s ease, box-shadow 0.14s ease;
  animation: attn-in 0.35s ease backwards;
  animation-delay: var(--d, 0s);
}
@keyframes attn-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}
.attn:hover {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-1);
  transform: translateX(-3px);
}
.attn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}
.attn .arail {
  position: absolute;
  inset-inline-start: 6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
}
.attn.crit .arail {
  background: linear-gradient(180deg, var(--danger), var(--warn-ink) 140%);
}
.attn.warn .arail {
  background: var(--warn-ink);
  opacity: 0.75;
}
.attn .aic {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 11px;
}
.attn .aic .ic {
  width: 17px;
  height: 17px;
}
.attn.crit .aic {
  background: var(--danger-soft);
  color: var(--danger);
}
.attn.warn .aic {
  background: var(--dep);
  color: var(--warn-ink);
}
.attn .atx {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.attn .atx b {
  font-size: 12.5px;
  font-weight: 700;
}
.attn .atx small {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attn .anum {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.attn .anum b {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.attn > .ic {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.14s ease, color 0.14s ease;
}
.attn:hover > .ic {
  color: var(--ink);
  transform: translateX(-2px);
}

/* all-clear state */
.attn-clear {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 12px 24px;
  animation: attn-in 0.35s ease backwards;
}
.attn-clear .ac-ic {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--full);
  color: var(--tick);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  box-shadow: 0 0 0 7px var(--full);
}
.attn-clear .ac-ic .ic {
  width: 26px;
  height: 26px;
}
.attn-clear b {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 3px;
}
.attn-clear small {
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  /* rail can't stay a side column — drop it to a full-width row of
     two cards above the analytics column */
  .dbody {
    flex-direction: column;
  }
  .drail {
    position: static;
    width: auto;
    max-height: none;
    flex-direction: row;
    align-items: stretch;
  }
  .drail .dcard {
    flex: 1 1 0;
  }
  #dAttn {
    flex: none;
    max-height: 360px;
  }
}
@media (max-width: 860px) {
  .drail {
    flex-direction: column;
  }
  .dsplit {
    flex-direction: column;
  }
  .dsec + .dsec {
    border-inline-start: 0;
    border-block-start: 1px solid var(--line);
  }
}

/* ================= call-center session link ================= */
/* status badges in the sessions table — same .ccb pill base as the
   participant badge, one modifier per platform status */
.ccb.local {
  background: var(--hover);
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  font-weight: 500;
}
.ccb.ccs-pend {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: transparent;
}
.ccb.ccs-ok {
  background: var(--full);
  color: var(--tick);
  border-color: transparent;
}
.ccb.ccs-rej {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.ccb.ccs-full {
  background: var(--violet-soft);
  color: var(--violet);
  border-color: transparent;
}
.ccb.ccs-fin {
  background: var(--th-bg);
  color: var(--muted);
  border-color: var(--line-strong);
}
/* «تامین لید» chip next to the badge — sent÷requested percent, amber
   under ٪۵۰, accent ٪۵۰–۹۹, green once the request is fully covered */
.ccfill {
  display: inline-block;
  font-size: 11px;
  border-radius: 8px;
  padding: 0 6px;
  margin-inline-start: 4px;
  cursor: default;
}
.ccfill.lo {
  background: var(--amber-soft);
  color: var(--amber);
}
.ccfill.mid {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.ccfill.hi {
  background: var(--full);
  color: var(--tick);
}
/* session نوع cell — آنلاین a violet chip, حضوری quiet muted text */
.sk {
  color: var(--muted);
}
.sk.on {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--violet-soft);
  color: var(--violet);
}

/* the «☁ مرکز تماس» bordered section inside the session modal */
.cc-sec {
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: 1px dashed var(--accent-soft-line);
  border-radius: var(--radius-s);
  padding: 10px 12px;
}
.cc-sec.off {
  opacity: 0.55;
}
.cc-sec-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
}
.cc-sec-hd .ic {
  width: 15px;
  height: 15px;
}
.cc-sec-hd #sCcBadge {
  margin-inline-start: auto;
}
.cc-check.hidden {
  display: none !important;
}
.cc-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.cc-check input {
  flex: none;
}
/* divider with a centred label — «── آدرس ──» */
.cc-div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.cc-div::before,
.cc-div::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.cc-addr {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
/* branch's stored address shown read-only (آدرس سفارشی off) */
.cc-addr.ro {
  opacity: 0.65;
}
.cc-addr.ro .pickpop {
  display: none;
}

/* inline field warning/hint (e.g. under the session date) */
.fld-warn {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  margin-top: 4px;
}
.fld-warn.ok {
  background: var(--full);
  color: var(--tick);
}
.fld-warn.bad {
  background: var(--dep);
  color: var(--warn-ink);
}

/* mini-calendar: days inside the call-center booking window */
.dp-grid .d.ccw {
  box-shadow: inset 0 -2px 0 var(--tick);
}

/* link picker + diff view (slModal) */
#slModal .modal {
  /* the 4-column diff table needs more room than the default 460px */
  width: min(560px, 92vw);
}
#slModal .dpwrap {
  margin: 8px 0 10px;
}
.sl-diff {
  /* never spill past the modal — scroll the table inside instead */
  max-width: 100%;
  overflow-x: auto;
}
.sl-t td {
  overflow-wrap: break-word;
}

/* online-session join links (sccLinks) */
.cc-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cc-lnk {
  display: block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.cc-lnk:hover {
  background: var(--hover);
}

/* online-session links modal (nbModal) */
.nb-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nb-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nb-t {
  font-size: 12px;
  color: var(--muted);
}
.nb-urow {
  display: flex;
  gap: 6px;
}
.nb-u {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.nb-cp {
  flex: none;
}
.nb-p {
  font-size: 12px;
  color: var(--warn-ink);
}
.sl-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}
.sl-it {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  cursor: pointer;
}
.sl-it:hover {
  background: var(--hover);
}
.sl-it.match {
  border-color: var(--accent-soft-line);
  background: var(--accent-soft);
}
.sl-itm {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sl-itm b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sl-itm small {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sl-t {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.sl-t th,
.sl-t td {
  text-align: start;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
}
.sl-t th {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}
.sl-t tr.mm td {
  background: var(--dep);
}
.sl-t tr.m td:last-child {
  color: var(--tick);
}
.sl-t tr.mm td:last-child {
  color: var(--warn-ink);
}

/* ---------- ticket scan (ثبت حضور با بلیت) ---------- */
.toolbar button.acc,
.selbar-acts button.acc { border-color: var(--accent); color: var(--accent-strong); }
.selbar button.vio { border-color: var(--violet); color: var(--violet); }
.tk-card {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--hover); padding: 10px 12px; font-size: 13px;
  display: flex; flex-direction: column; gap: 6px; margin: 8px 0;
}
.tk-card .row { display: flex; justify-content: space-between; gap: 10px; }
.tk-card .k { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.tk-card .v { font-weight: 500; text-align: left; }
.tk-card .v code {
  direction: ltr; background: var(--card); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 8px; font-size: 12px;
}
.tkcode {
  text-transform: uppercase; font-family: ui-monospace, monospace;
  letter-spacing: 2px;
}
.tkhint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
/* «اطلاعات بلیت» session block — سانس cc + سانس محلی split from the
   ticket rows above by a dashed rule, hint foot under both */
.tk-card .sessblock {
  border-top: 1px dashed var(--line); padding-top: 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.tk-card .sessfoot { border-top: 1px dashed var(--line); padding-top: 6px; }
.tkb {
  display: inline-block; border-radius: 6px; padding: 0 7px; font-size: 11px;
  background: var(--full); color: var(--tick); border: 1px solid var(--tick);
  direction: ltr; font-family: ui-monospace, monospace; letter-spacing: .5px;
  vertical-align: 1px;
}
.tkb.loc {
  background: var(--hover); color: var(--muted);
  border-color: var(--line-strong); border-style: dashed;
}
.dlk { display: inline-flex; align-items: center; color: var(--muted); vertical-align: -2px; }
.dlk .ic { width: 12px; height: 12px; display: block; }
.lockwrap { position: relative; }
.lockwrap input { width: 100%; }
.lockwrap input[disabled] { padding-left: 34px; }
.lockwrap .lk {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.lockwrap .lk .ic { width: 15px; height: 15px; display: block; }
.sesslock { display: flex; gap: 8px; align-items: stretch; }
.sesslock .pickwrap { flex: 1; }
.sesslock .pickwrap.disabled { opacity: .65; }
.sesslock .unlk {
  flex-shrink: 0; border: 1px solid var(--amber); background: var(--amber-soft);
  color: var(--warn-ink); border-radius: var(--radius-s); padding: 0 12px;
  font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.sesslock .unlk .ic { width: 13px; height: 13px; }
.modeb {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 20px;
  padding: 3px 12px; font-size: 12px; font-weight: 600;
}
.modeb.cc { background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent-soft-line); }
.modeb.loc { background: var(--hover); color: var(--muted); border: 1px dashed var(--line-strong); }
.cc-info {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--hover); padding: 9px 12px; font-size: 12px;
  color: var(--muted); line-height: 1.9; margin: 6px 0;
}
.cc-ok {
  border: 1px solid var(--tick); border-radius: var(--radius-s);
  background: var(--full); padding: 9px 12px; font-size: 12.5px;
  color: var(--tick); line-height: 1.8; margin: 6px 0;
}
.cc-err {
  border: 1px solid var(--danger-line); border-radius: var(--radius-s);
  background: var(--danger-soft); padding: 9px 12px; font-size: 12.5px;
  color: var(--danger); line-height: 1.8; margin: 6px 0;
}
.modal .cc-warn { margin: 6px 0; }
#tLocalWarn { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
#tLocalWarn .warnbtns { display: flex; gap: 6px; flex-shrink: 0; }
#tLocalWarn button { padding: 4px 14px; }
.icode { display: flex; gap: 8px; }
.icode input { flex: 1; }
.grow3 { display: flex; gap: 8px; margin: 8px 0; }
.grow3 input { flex: 1; }
.ccseg.ccseglock { pointer-events: none; opacity: .85; }
.ccseg.ccseglock button:not(.on) { opacity: .45; }
.ccb.ok { background: var(--full); color: var(--tick); border-color: var(--tick); }
.ccb.pend { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.ccb.rej { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.ccb.c0 { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-soft-line); }

/* scan-status block inside «اطلاعات بلیت» — locked platform state for
   scanned rows/guests, note + tri-state segment for local records */
.scn {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.scn .scn-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.scn .scn-head b { color: var(--ink); font-size: 13px; }
.scn .scn-head .sp { flex: 1; }
.scn.lock { background: var(--full); border-color: var(--tick); }
.scn.lock .scn-head,
.scn.lock .scn-head b { color: var(--tick); }
.scn .lk { display: inline-flex; align-items: center; }
.scn .lk .ic { width: 13px; height: 13px; display: block; }
.scnseg { display: flex; gap: 6px; }
.scnseg span {
  flex: 1; text-align: center; border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 7px 4px; font-size: 12.5px;
  cursor: pointer; color: var(--muted); background: var(--card);
  transition: all .15s;
}
.scnseg span.on { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-soft-line); font-weight: 600; }
.scnseg span.on.no { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.scnseg span.on.yes { background: var(--full); color: var(--tick); border-color: var(--tick); }
.scnseg span.on.dirty { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.scn-save { align-self: flex-start; }

/* «لید خراب» block inside «اطلاعات بلیت» — .scn variant with a red
   accent while flagged; the table shows it as a flag icon (.dflag)
   whose tooltip carries the reason */
.dty {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.dty.on { background: var(--danger-soft); border-color: var(--danger-line); }
.dty .scn-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dty .scn-head b { color: var(--ink); font-size: 13px; }
.dty.on .scn-head b { color: var(--danger); }
.dflag { color: var(--danger); display: inline-flex; vertical-align: -2px; }
.dflag .ic { width: 14px; height: 14px; display: block; }

/* ---------- جزوه + تست مغز ----------
   statecard = the one-glance status card both modals open with;
   .pam-yes/.pam-no = the «جزوه» column cells; .res-grid = the
   brain-test result form; .bt-block = the pay-panel flag */
.statecard {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; background: var(--field);
}
.statecard .big { font-size: 22px; }
.statecard b { font-size: 14px; }
.statecard .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.statecard.ok { background: var(--full); border-color: var(--tick); }
.statecard.ok .sub { color: var(--tick); }
.pam-yes { color: var(--tick); font-weight: 700; }
.pam-no { color: var(--muted); }
.res-grid { display: flex; flex-direction: column; gap: 11px; }
.res-grid .fld > span { font-size: 12px; }
.score-in { max-width: 130px; }
/* a locked seg option — done=1's «انجام نشده»; not :disabled because
   spans can't be, so it greys + drops the pointer itself */
.scnseg span.dis { opacity: .45; cursor: not-allowed; }
/* pay panel «دارای تست رایگان» block */
.bt-block {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  transition: background .15s, border-color .15s;
}
.bt-block.on { background: var(--violet-soft); border-color: var(--violet); }
.bt-block .bt-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.bt-block .bt-head b { color: var(--ink); font-size: 13px; }
.bt-block .bt-head .sp { flex: 1; }
.bt-block .chk { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; font-weight: 500; }
.bt-block input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--violet); }
.bt-block .bt-hint { font-size: 12px; color: var(--muted); display: none; }
.bt-block.on .bt-hint { display: block; color: var(--violet); }
.bt-block.off .chk { color: var(--muted); }

/* «بیعانه و یادداشت مرکز تماس» block inside «اطلاعات بلیت» — summary
   rows by default, «ویرایش» expands the save/clear form; .stale marks
   the last-known snapshot when the platform can't be reached */
.ccdep {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 10px;
  background: var(--card); margin-top: 10px;
}
.ccdep .scn-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ccdep .scn-head b { color: var(--ink); font-size: 13px; }
.ccdep .scn-head .sp { flex: 1; }
.ccdep.stale { background: var(--hover); border-style: dashed; }
.dep-sum { display: flex; flex-direction: column; gap: 6px; }
.dep-sum .row { display: flex; justify-content: space-between; gap: 10px; }
.dep-sum .k { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.dep-sum .v { font-weight: 500; text-align: left; }
.dep-edit { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.dep-amt { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.dep-amt .fld { flex: 1; min-width: 160px; margin: 0; }
.dep-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dep-foot .sp { flex: 1; }
.ccdep .fld textarea { width: 100%; box-sizing: border-box; }
.dep-ce { font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.dep-loading { font-size: 12.5px; color: var(--muted); padding: 6px 2px; }

/* ---------- bale tab (پنل بله) ---------- */
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.chk input { accent-color: var(--accent); }
.bwarn { color: var(--amber); font-size: 12px; }
.bcards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.bcard { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 12px 14px; }
.bcard-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.binv { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow: auto; }
.invrow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.invrow code { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); direction: ltr; }
.invrow button { margin-inline-start: auto; }
.bout { display: flex; flex-wrap: wrap; gap: 6px; }
.bout-errs { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.outerr { font-size: 12px; color: var(--muted); }
.bcast-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.bpreview-cap { font-size: 12px; margin-bottom: 8px; }
.pv-bubble { background: var(--hover); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.8; min-height: 80px; white-space: pre-wrap; }
.pv-btn { margin-top: 8px; display: inline-block; border: 1px solid var(--accent); color: var(--accent-strong); border-radius: 8px; padding: 5px 12px; font-size: 12px; }
.bbtnrow { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.bbtnrow input { flex: 1; min-width: 140px; }
.invline { background: var(--hover); border-radius: 8px; padding: 8px 10px; margin: 10px 0 6px; }
.invline code { font-size: 11.5px; word-break: break-all; }
/* گروه‌ها card + گزارش پایان روز preview (chat-bubble messages) */
.bcard-wide { grid-column: 1 / -1; }
.gtable td { font-size: 12.5px; }
.rep-scroll { background: var(--hover); border: 1px solid var(--line); border-radius: 12px; padding: 10px; max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
.rep-msg { background: var(--card); border-radius: 12px; padding: 8px 11px; font-size: 12.5px; line-height: 1.9; white-space: pre-wrap; }
.rep-seq { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.grp-pick { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
@media (max-width: 900px) { .bcards, .bcast-grid { grid-template-columns: 1fr; } }

/* ---------- users tab (کاربران و نقش‌ها / RBAC) ---------- */
.usub { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.usub button {
  border: 1px solid var(--line); border-bottom: none; background: transparent;
  color: var(--muted); border-radius: 10px 10px 0 0; padding: 8px 22px;
  font-size: 14px; cursor: pointer; position: relative; top: 1px;
}
.usub button.on {
  background: var(--card); color: var(--ink); font-weight: 700;
  border-bottom: 2px solid var(--card); margin-bottom: -1px;
}
.role-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 20px; padding: 1px 12px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.role-chip.admin { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.role-chip.c0 { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-soft-line); }
.role-chip.c1 { background: var(--violet-soft); color: var(--violet); border-color: var(--violet); }
.role-chip.c2 { background: var(--full); color: var(--tick); border-color: var(--tick); }
.role-chip.off-chip { border-color: var(--line); color: var(--muted); }
tr.off td { opacity: .55; }
.ptag {
  font-size: 10.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 8px;
}
.rowact { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.rowact button { padding: 4px 10px; font-size: 12px; border-radius: 14px; }
.roles-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: start; }
.role-list { display: flex; flex-direction: column; gap: 8px; }
.role-items { display: flex; flex-direction: column; gap: 8px; }
.role-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 14px; cursor: pointer; font-size: 14px;
}
.role-item.on { border-color: var(--accent); box-shadow: var(--shadow-1); }
.role-item .cnt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.role-item .lock { color: var(--amber); }
.matrix { width: 100%; border-collapse: collapse; }
.matrix th, .matrix td {
  border: 1px solid var(--line); padding: 8px 10px; font-size: 13px;
  text-align: center; background: var(--card);
}
.matrix th { background: var(--hover); color: var(--ink); font-weight: 700; }
.matrix td:first-child, .matrix th:first-child { text-align: right; font-weight: 600; }
.matrix td.na { color: var(--muted); background: var(--hover); font-size: 15px; }
.matrix input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.matrix input[type=checkbox]:disabled { accent-color: var(--tick); opacity: .85; cursor: not-allowed; }
.special-block { margin-top: 14px; }
.special-block h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.special-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.spec-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 8px 14px; cursor: pointer;
}
.spec-item input { width: 16px; height: 16px; accent-color: var(--accent); }
.admin-banner {
  display: flex; align-items: center; gap: 8px;
  background: var(--amber-soft); border: 1px solid var(--amber);
  color: var(--amber); border-radius: var(--radius-s);
  padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.urole-fields { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.urole-fields label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.urole-fields input { width: 180px; }
@media (max-width: 900px) { .roles-wrap { grid-template-columns: 1fr; } }
