/* Vazirmatn-FD draws ASCII 0-9 as ۰-۹, so every number on screen — typed into a
   form or printed in a report — reads Persian while the data itself stays ASCII
   (scanners, lookups and validation see plain digits). */
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/vazirmatn-fa.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
/* the stock font, for the few places that must keep Latin digits */
@font-face {
  font-family: 'Vazirmatn Latin';
  src: url('fonts/vazirmatn-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
.latin-digits, .badge-label, input[type=email], [lang="en"] { font-family: 'Vazirmatn Latin', Tahoma, sans-serif; }

/* --- tokens ------------------------------------------------------------------ */
:root {
  --bg: #f4f5f9;
  --card: #ffffff;
  --card-soft: #f8f9fc;
  --ink: #0b1020;
  --ink-2: #384056;
  --muted: #6b7389;
  --line: #e7e9f1;
  --line-soft: #eff1f6;
  --track: #eceef5;
  --primary: #635bff;
  --primary-2: #9b6bff;
  --primary-ink: #ffffff;
  --primary-soft: #efeeff;
  --grad: linear-gradient(135deg, #635bff 0%, #9b6bff 100%);
  --success: #0e9f6e;
  --success-soft: #e6f7f0;
  --warn: #d97706;
  --warn-soft: #fff3e2;
  --danger: #e5484d;
  --danger-soft: #fdeced;
  --info: #0b8bd6;
  --info-soft: #e7f3fc;
  --pink: #e0367a;
  --pink-soft: #fdebf2;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-xs: 0 1px 2px rgba(11, 16, 32, .05);
  --shadow: 0 1px 2px rgba(11, 16, 32, .04), 0 4px 14px -6px rgba(11, 16, 32, .08);
  --shadow-lg: 0 20px 44px -18px rgba(11, 16, 32, .28);
  --ring: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
  --btn-hi: inset 0 1px 0 rgba(255, 255, 255, .22);
  /* the sidebar stays dark in both themes */
  --side-bg: linear-gradient(180deg, #0d1124 0%, #090c19 100%);
  --side-ink: #b3bad0;
  --side-muted: #69728e;
  --side-line: rgba(255, 255, 255, .07);
  --dots: rgba(11, 16, 32, .07);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #090c16;
  --card: #10152a;
  --card-soft: #0d1224;
  --ink: #e8ebf5;
  --ink-2: #c2c9db;
  --muted: #858ea8;
  --line: #1d2440;
  --line-soft: #161c34;
  --track: #161d36;
  --primary: #7d76ff;
  --primary-2: #ad86ff;
  --primary-ink: #ffffff;
  --primary-soft: #1d1b46;
  --grad: linear-gradient(135deg, #6f67ff 0%, #a77cff 100%);
  --success: #34d399;
  --success-soft: #072a20;
  --warn: #fbbf24;
  --warn-soft: #2a1d07;
  --danger: #f87171;
  --danger-soft: #2c0f12;
  --info: #38bdf8;
  --info-soft: #08243a;
  --pink: #f472b6;
  --pink-soft: #2c0d1e;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 50px -16px rgba(0, 0, 0, .75);
  --ring: 0 0 0 4px color-mix(in srgb, var(--primary) 30%, transparent);
  --side-bg: linear-gradient(180deg, #080b17 0%, #05070f 100%);
  --dots: rgba(255, 255, 255, .05);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* faint dot grid that fades out down the page */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--dots) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 460px);
  mask-image: linear-gradient(to bottom, #000 0, transparent 460px);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.4; }
.ico { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
::selection { background: color-mix(in srgb, var(--primary) 24%, transparent); }

a, button, input, select, textarea, label, .card, .btn, .icon-btn, .choice, .pill {
  transition: color .16s, background-color .16s, border-color .16s, box-shadow .16s, transform .16s, opacity .16s;
}

/* --- app shell ------------------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  width: 264px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--side-bg); color: var(--side-ink);
  border-inline-start: 1px solid var(--side-line);
  z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; border-bottom: 1px solid var(--side-line); }
.side-brand-text { min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 22px -6px rgba(99, 91, 255, .7), var(--btn-hi);
}
.brand-mark .ico { width: 22px; height: 22px; }
/* an uploaded logo sits on white so any colours read, and is never cropped */
.brand-mark.has-logo { background: #fff; padding: 4px; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.logo-preview .brand-mark { width: 64px; height: 64px; border-radius: 16px; }
.brand-title { font-weight: 800; font-size: 15px; color: #fff; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--side-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* min-height: 0 lets the list shrink inside the column and scroll, instead of spilling out of the panel */
.side-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-sep { height: 1px; margin: 8px 12px; background: var(--side-line); }
.side-label { font-size: 11px; font-weight: 700; color: var(--side-muted); padding: 16px 12px 6px; letter-spacing: .3px; }
/* the items share the panel's height: roomy on a tall screen (up to 50px each), tighter on a
   short one, so the whole menu always shows without scrolling */
.side-nav { display: flex; flex-direction: column; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  flex: 1 1 0; min-height: 30px; max-height: 50px;
  padding: 0 14px; margin-bottom: 3px; border-radius: 11px;
  color: var(--side-ink); font-weight: 600; font-size: 14.5px;
}
.side-sep { flex: none; }
/* each item's icon in its own colour (--ic, set per item in layout.php) on a soft tile of it */
.side-nav .nav-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ic, #8b84ff) 16%, transparent);
}
.side-nav a .ico { width: 18px; height: 18px; color: var(--ic, var(--side-muted)); }
.side-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.side-nav a:hover .nav-ico { background: color-mix(in srgb, var(--ic, #8b84ff) 26%, transparent); }
.side-nav a.active {
  color: #fff; font-weight: 700;
  background: linear-gradient(270deg, rgba(99, 91, 255, .32), rgba(99, 91, 255, .08));
  box-shadow: inset 0 0 0 1px rgba(139, 132, 255, .28);
}
.side-nav a.active .nav-ico { background: var(--ic); }
.side-nav a.active .ico { color: #0b1020; }
.side-nav a.active::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 50%; translate: 0 -50%;
  width: 3px; height: 20px; border-radius: 3px; background: #8f88ff; box-shadow: 0 0 12px #8f88ff;
}

.side-user {
  display: flex; align-items: center; gap: 10px; margin: 12px; padding: 10px;
  border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--side-line);
}
.side-user form { margin: 0 0 0 0; margin-inline-start: auto; }
.side-user-text { min-width: 0; line-height: 1.4; }
.side-user-text b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: var(--side-muted); font-size: 11px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #f59e0b, #ec4899); color: #fff; font-weight: 800; font-size: 14px;
}
.side-user .icon-btn { width: 34px; height: 34px; background: transparent; border-color: var(--side-line); color: var(--side-muted); }
.side-user .icon-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255,255,255,.14); transform: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.crumb-event { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { color: var(--muted); opacity: .5; }
.crumbs b { font-weight: 700; white-space: nowrap; }
.topbar-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.today-box {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 13px; box-shadow: var(--shadow-xs);
}
.today-date { color: var(--ink-2); font-weight: 600; }
.clock { color: var(--success); font-weight: 700; font-variant-numeric: tabular-nums; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow-xs);
}
.icon-btn .ico { width: 18px; height: 18px; }

/* who is signed in, with the way out, at the top-left */
.user-chip {
  display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 5px 0 5px; padding-inline-start: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-xs);
}
.user-chip .avatar { width: 32px; height: 32px; font-size: 13px; }
.user-chip-text { line-height: 1.35; }
.user-chip-text b { display: block; font-size: 13px; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.user-chip form { margin: 0; }
.logout-btn { width: auto; height: 34px; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; box-shadow: none; }
.logout-btn span { font-size: 13px; font-weight: 700; }
.logout-btn:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: var(--danger-soft); }
.icon-btn:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.nav-toggle { display: none; }
.nav-scrim { display: none; }

.main { flex: 1; width: 100%; max-width: 1480px; padding: 28px; }

/* floating panels: the sidebar and the top bar sit off the window edge with rounded
   corners, so the app reads as a set of panels rather than a framed admin template */
@media (min-width: 1081px) {
  .sidebar {
    top: 12px; height: calc(100vh - 24px); margin: 12px; margin-inline-end: 0;
    border-radius: 22px; border: 1px solid var(--side-line);
    box-shadow: 0 24px 60px -24px rgba(8, 10, 30, .6);
  }
  .topbar {
    top: 12px; margin: 12px 12px 0; height: 58px; border-radius: 16px;
    border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 78%, transparent);
    box-shadow: var(--shadow);
  }
  .main { padding: 22px 12px 28px 12px; padding-inline-start: 18px; }
}

/* --- page hero ---------------------------------------------------------------------- */
.page-head {
  --hero: linear-gradient(245deg, #17113f 0%, #3a2c9c 48%, #635bff 100%);
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 26px 30px; margin-bottom: 22px; border-radius: 20px;
  background: var(--hero); color: #fff;
  box-shadow: 0 18px 40px -22px rgba(40, 30, 140, .7);
}
.page-head::before {
  /* fine grid + light bloom */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 120% at 0% 0%, rgba(255, 255, 255, .22), transparent 55%),
    radial-gradient(40% 90% at 100% 110%, rgba(255, 170, 230, .25), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 28px 28px;
  -webkit-mask-image: linear-gradient(to left, #000 20%, rgba(0,0,0,.35));
  mask-image: linear-gradient(to left, #000 20%, rgba(0,0,0,.35));
}
.page-head::after {
  content: ""; position: absolute; inset-inline-end: -60px; top: -90px; width: 260px; height: 260px; z-index: -1;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%); pointer-events: none;
}
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -.4px; }
.page-head p { margin: 4px 0 0; color: rgba(255, 255, 255, .74); }
.page-head [class*="tone-"] { color: #d8d4ff; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .btn, .page-head .btn-ghost {
  background: rgba(255, 255, 255, .13); color: #fff; border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: none; backdrop-filter: blur(8px);
}
.page-head .btn:hover { background: rgba(255, 255, 255, .22); color: #fff; transform: translateY(-1px); }
.page-head h1[class*="tone-"] { color: #fff; }
/* the page's symbol: a glass tile beside the title and a big faint copy in the far corner */
.ph-ico {
  width: 56px; height: 56px; border-radius: 17px; flex: none; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 12px 26px -12px rgba(0, 0, 0, .55);
}
.ph-ico .ico { width: 28px; height: 28px; }
.ph-avatar { font-size: 24px; font-weight: 800; background: linear-gradient(135deg, #fbbf24, #ec4899); }
.ph-wm {
  position: absolute; z-index: -1; pointer-events: none; color: #fff; opacity: .1;
  inset-inline-end: 4%; top: 50%; translate: 0 -50%; rotate: -12deg;
}
.ph-wm .ico { width: 170px; height: 170px; stroke-width: 1.1; }
.page-head .actions { position: relative; }
.station .ph-wm { inset-inline-end: 3%; opacity: .12; }
@media print { .ph-wm, .ph-ico, .stat-ico { display: none !important; } }
.station .ph-wm .ico { width: 190px; height: 190px; }
.page-head.green { --hero: linear-gradient(245deg, #032b22 0%, #0b6e57 50%, #10b981 100%); box-shadow: 0 18px 40px -22px rgba(6, 95, 70, .7); }
.page-head.sky { --hero: linear-gradient(245deg, #06213f 0%, #0b5a9e 50%, #22a6f0 100%); box-shadow: 0 18px 40px -22px rgba(11, 90, 158, .7); }
.page-head.amber { --hero: linear-gradient(245deg, #3a1a03 0%, #a9480a 50%, #f59e0b 100%); box-shadow: 0 18px 40px -22px rgba(169, 72, 10, .7); }
.page-head.pink { --hero: linear-gradient(245deg, #3a0822 0%, #b2185a 50%, #ec4899 100%); box-shadow: 0 18px 40px -22px rgba(178, 24, 90, .7); }
.page-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.3px; }

/* --- cards & layout ------------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card.narrow { max-width: 520px; margin-inline: auto; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head h2 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 10px; letter-spacing: -.2px; }
/* the icon in a card title sits in a tinted tile */
.card-head h2 > .ico, .chart-card h3 > .ico {
  width: 32px; height: 32px; padding: 7px; border-radius: 9px; flex: none;
  background: color-mix(in srgb, currentColor 11%, transparent); color: inherit;
}
.card-head h2:not([class*="tone-"]) > .ico { color: var(--primary); }
.card-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 12px; }

/* --- dashboard: greeting hero ------------------------------------------------------------ */
.hello {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; gap: 28px; align-items: stretch; flex-wrap: wrap;
  padding: 30px 32px; margin-bottom: 18px; border-radius: 26px; color: #fff;
  background: #0d1030;
  box-shadow: 0 30px 60px -30px rgba(25, 20, 90, .8);
}
/* slow-drifting aurora behind the greeting */
.hello::before {
  content: ""; position: absolute; inset: -15%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(32% 55% at 78% 30%, rgba(124, 116, 255, .85), transparent 65%),
    radial-gradient(28% 50% at 40% 15%, rgba(236, 72, 153, .55), transparent 65%),
    radial-gradient(30% 55% at 52% 92%, rgba(14, 165, 233, .55), transparent 65%),
    radial-gradient(22% 45% at 12% 70%, rgba(52, 211, 153, .35), transparent 65%);
  filter: blur(26px);
  animation: aurora 22s ease-in-out infinite alternate;
}
.hello::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 30px 30px,
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 30px 30px;
  -webkit-mask-image: radial-gradient(80% 90% at 30% 40%, #000, transparent 75%);
  mask-image: radial-gradient(80% 90% at 30% 40%, #000, transparent 75%);
}
@keyframes aurora {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(4%, -3%) rotate(8deg) scale(1.08); }
  100% { transform: translate(-4%, 3%) rotate(-6deg) scale(1.02); }
}
.hello-main { flex: 1 1 560px; min-width: 0; }
.hello-status {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 20px; margin: 10px 0 4px;
  border-radius: 99px; font-size: 16px; font-weight: 700; color: #fff;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px);
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; flex: none; }
.hello-status.live .live-dot { background: #34d399; animation: pulse 1.8s ease-out infinite; }
.hello-status.soon .live-dot { background: #fbbf24; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.hello h1 { font-size: 30px; font-weight: 800; letter-spacing: -.7px; line-height: 1.35; }
.hello p { margin: 6px 0 0; color: rgba(255, 255, 255, .66); display: flex; align-items: center; gap: 6px; }
.hello p .ico { width: 16px; height: 16px; }
.hello-side { flex: none; margin-inline-start: auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
.hello-clock {
  font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -2px; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 30%, #b9b3ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hello-date { margin-top: 10px; color: rgba(255, 255, 255, .7); font-size: 13.5px; }

/* launchpad of the desk's everyday jobs */
.quick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 24px; }
.quick-tile {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px; color: #fff;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(10px);
}
.quick-tile:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .24); transform: translateY(-3px); text-decoration: none; }
.quick-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 20px -10px rgba(0, 0, 0, .6);
}
.quick-ico .ico { width: 21px; height: 21px; }
.q-indigo .quick-ico { background: linear-gradient(135deg, #8a83ff, #5145ff); }
.q-sky .quick-ico { background: linear-gradient(135deg, #4fc3f7, #0277bd); }
.q-green .quick-ico { background: linear-gradient(135deg, #4ade80, #059669); }
.q-pink .quick-ico { background: linear-gradient(135deg, #f9a8d4, #db2777); }
.q-amber .quick-ico { background: linear-gradient(135deg, #fcd34d, #d97706); }
/* meal deliveries: a day's row, then its dishes indented under it */
.meal-days .meal-day td { background: var(--card-soft); }
.meal-days .meal-dish td:first-child { padding-inline-start: 30px; font-size: 13px; color: var(--ink-2); }
.meal-days .meal-dish td { padding-top: 8px; padding-bottom: 8px; }
.meal-days .meal-sum td { font-weight: 800; border-bottom: 2px solid var(--line); }
.quick-txt { min-width: 0; line-height: 1.4; }
.quick-txt b { display: block; font-size: 14px; white-space: nowrap; }
.quick-txt small { color: rgba(255, 255, 255, .6); font-size: 12px; white-space: nowrap; }

/* --- dashboard: bento tiles --------------------------------------------------------------- */
.bento { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(156px, auto); margin-bottom: 18px; }
.tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile-label { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tile-label .ico { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--track); color: var(--ink-2); }
.t-indigo .tile-label .ico { background: var(--primary-soft); color: var(--primary); }
.t-sky .tile-label .ico { background: var(--info-soft); color: var(--info); }
.t-amber .tile-label .ico { background: var(--warn-soft); color: var(--warn); }
.t-green .tile-label .ico { background: var(--success-soft); color: var(--success); }
.tile-value { margin-top: 14px; font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.tile-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-inline-start: 5px; letter-spacing: 0; }
.tile-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.delta { display: inline-block; padding: 0 8px; border-radius: 99px; font-weight: 800; color: var(--success); background: var(--success-soft); }
.tile-spark { margin: auto -20px -20px; height: 90px; }
.tile-spark.mini { height: 56px; margin-top: 12px; }
.spark { display: block; width: 100%; height: 100%; }
.tile-ring { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.ring { width: 78px; height: 78px; flex: none; }
.ring-txt { font-size: 8.5px; font-weight: 800; fill: var(--ink); font-family: inherit; }

/* the money tile is the hero of the grid */
.tile-feature {
  grid-column: span 2; grid-row: span 2; color: #fff; border-color: transparent; isolation: isolate;
  background: linear-gradient(150deg, #4f46e5 0%, #7c3aed 55%, #c026d3 125%);
  box-shadow: 0 26px 54px -24px rgba(79, 70, 229, .8);
}
.tile-feature::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 100% 0%, rgba(255, 255, 255, .28), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 26px 26px;
}
.tile-feature .tile-label { color: rgba(255, 255, 255, .82); }
.tile-feature .tile-label .ico { background: rgba(255, 255, 255, .16); color: #fff; }
.tile-feature .tile-value { font-size: 46px; margin-top: 22px; letter-spacing: -1.5px; }
.tile-feature .tile-value small { color: rgba(255, 255, 255, .7); }
.tile-feature .tile-sub { color: rgba(255, 255, 255, .74); }
.tile-feature .tile-spark { height: 160px; }

/* --- KPI tiles -------------------------------------------------------------------------- */
.kpi { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 16px; padding: 20px 22px; }
.kpi::after {
  content: ""; position: absolute; inset-inline-end: -40px; bottom: -60px; width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--kpi, var(--primary)) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.kpi:has(.bg-green) { --kpi: var(--success); }
.kpi:has(.bg-amber) { --kpi: var(--warn); }
.kpi:has(.bg-sky) { --kpi: var(--info); }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .kpi-value { color: var(--ink); font-size: 31px; font-weight: 800; line-height: 1.25; margin: 6px 0 4px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-inline-start: 5px; letter-spacing: 0; }
.kpi-icon {
  margin-inline-start: auto; width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
}
.kpi-icon .ico { width: 23px; height: 23px; }
.tone-indigo { color: var(--primary); } .bg-indigo { background: var(--primary-soft); color: var(--primary); }
.tone-green { color: var(--success); } .bg-green { background: var(--success-soft); color: var(--success); }
.tone-amber { color: var(--warn); } .bg-amber { background: var(--warn-soft); color: var(--warn); }
.tone-sky { color: var(--info); } .bg-sky { background: var(--info-soft); color: var(--info); }
.tone-pink { color: var(--pink); }
.tone-red { color: var(--danger); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--line); }
.stat-card.indigo::before { background: var(--grad); }
.stat-card.green::before { background: linear-gradient(90deg, #34d399, #0e9f6e); }
.stat-card.amber::before { background: linear-gradient(90deg, #fbbf24, #d97706); }
.stat-card.sky::before { background: linear-gradient(90deg, #38bdf8, #0b8bd6); }
.stat-ico {
  position: absolute; top: 18px; inset-inline-end: 18px; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
}
.stat-ico .ico { width: 21px; height: 21px; }
.stat-card.amber .stat-ico { background: var(--warn-soft); color: var(--warn); }
.stat-card.sky .stat-ico { background: var(--info-soft); color: var(--info); }
.stat-card.green .stat-ico { background: var(--success-soft); color: var(--success); }
.stat-card .kpi-value { font-size: 27px; font-weight: 800; letter-spacing: -.6px; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* compact four-up summary strip (reports) */
.bento-4 { grid-auto-rows: auto; }
.bento-4 .tile { padding: 18px 20px; }
.bento-4 .tile-value { font-size: 25px; margin-top: 12px; }

/* --- charts ----------------------------------------------------------------------------- */
.chart-card h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 132px; height: 132px; flex: none; }
.donut-center { font-size: 8px; font-weight: 800; fill: var(--ink); font-family: inherit; }
.legend { flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.legend li:last-child { border-bottom: 0; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.legend .val { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bars { width: 100%; height: auto; display: block; }
.bar-val { font-size: 11px; fill: var(--ink-2); font-family: inherit; font-weight: 700; }
.bar-label { font-size: 11px; fill: var(--muted); font-family: inherit; }
.empty { color: var(--muted); padding: 26px 0; text-align: center; }
.progress { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #34d399, var(--success)); border-radius: 99px; }
.progress.full > span { background: linear-gradient(90deg, #f87171, var(--danger)); }

/* --- forms ---------------------------------------------------------------------------- */
label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 4px; }
input[type=text], input[type=number], input[type=password], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 13px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; outline: none;
  box-shadow: var(--shadow-xs);
}
textarea { height: auto; min-height: 96px; padding: 10px 13px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-inline-end: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7389' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
input.ltr, input[type=email] { direction: ltr; text-align: left; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 18px; height: 18px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin: 0 0 16px; background: var(--card-soft); }
legend { padding: 0 8px; font-weight: 700; }

.choice-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choice {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--card); font-weight: 500; color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.choice:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.choice.disabled { opacity: .5; cursor: not-allowed; }
.choice input { width: 18px; height: 18px; flex: none; }
.choice .meta { margin-inline-start: auto; text-align: left; font-size: 12px; color: var(--muted); line-height: 1.5; }
.choice .meta b { display: block; color: var(--ink); font-size: 13px; }
.role-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.role-list .choice { flex-wrap: wrap; row-gap: 4px; }
.role-list .choice .meta { flex-basis: 100%; margin-inline-start: 28px; text-align: start; }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--track); border-radius: 12px; }
.seg label {
  position: relative; margin: 0; padding: 6px 15px; border-radius: 9px; cursor: pointer;
  font-weight: 600; font-size: 13px; color: var(--muted); background: transparent; border: 0;
}
.seg label:hover { color: var(--ink); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label.off { opacity: .4; cursor: not-allowed; }
.seg label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(11,16,32,.12), 0 1px 1px rgba(11,16,32,.06); }
:root[data-theme="dark"] .seg label:has(input:checked) { background: #222a4a; }
/* the same look for links: the certificate template switch */
.seg > a { padding: 7px 18px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; }
.seg > a:hover { color: var(--ink); }
.seg > a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(11,16,32,.12), 0 1px 1px rgba(11,16,32,.06); }
:root[data-theme="dark"] .seg > a.on { background: #222a4a; }
.cert-tpl-switch { margin-bottom: 10px; }
.seg > button { padding: 7px 16px; border-radius: 9px; border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg > button:hover { color: var(--ink); }
.seg > button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(11,16,32,.12), 0 1px 1px rgba(11,16,32,.06); cursor: default; }
:root[data-theme="dark"] .seg > button.on { background: #222a4a; }
/* meals counter: scan only or scan and pick */
.meal-mode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; font-weight: 700; font-size: 13.5px; }
.station .meal-mode .seg { background: rgba(255, 255, 255, .16); }
.station .meal-mode .seg > button { color: rgba(255, 255, 255, .85); }
.station .meal-mode .seg > button.on { background: #fff; color: #065f46; }
/* plain radio choices that sit in a form row, as tall as an input */
.radio-row { display: flex; gap: 8px; }
.radio-row label {
  flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; margin: 0; padding: 0 13px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-xs);
}
.radio-row input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.radio-row label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-row.radio-col { flex-direction: column; }
.radio-row.radio-col label { flex: none; height: auto; min-height: 42px; padding: 8px 13px; }

/* --- buttons ---------------------------------------------------------------------------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 17px; border-radius: 10px; border: 1px solid transparent;
  background: var(--primary); color: var(--primary-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
  box-shadow: var(--btn-hi), 0 1px 2px rgba(11,16,32,.12), 0 4px 12px -4px color-mix(in srgb, var(--primary) 60%, transparent);
}
.btn:hover { text-decoration: none; filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(.97); }
.btn .ico { width: 18px; height: 18px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-green { background: #0e9f6e; color: #fff; box-shadow: var(--btn-hi), 0 4px 12px -4px rgba(14, 159, 110, .6); }
.btn-amber { background: #e0890b; color: #fff; box-shadow: var(--btn-hi), 0 4px 12px -4px rgba(217, 119, 6, .6); }
.btn-sky { background: #0b8bd6; color: #fff; box-shadow: var(--btn-hi), 0 4px 12px -4px rgba(11, 139, 214, .6); }
.btn-pink { background: #e0367a; color: #fff; box-shadow: var(--btn-hi), 0 4px 12px -4px rgba(224, 54, 122, .6); }
.btn-red { background: #e5484d; color: #fff; box-shadow: var(--btn-hi), 0 4px 12px -4px rgba(229, 72, 77, .6); }
.btn-ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); filter: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; filter: none; }
/* light sweep */
.btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .26), transparent);
  transform: translateX(-200%); pointer-events: none;
}
.btn:hover::after { transform: translateX(330%); transition: transform .7s ease; }
.btn-ghost::after { display: none; }

/* --- tables ---------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  background: var(--card-soft); color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .2px;
  text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink); }
.table tr:last-child td { border-bottom: 0; }
/* many columns (participants list): tighter cells so the row fits a laptop screen */
.table-dense th, .table-dense td { padding-inline: 9px; }
.table tfoot td { background: var(--card-soft); font-weight: 800; border-top: 1px solid var(--line); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.table input[type=text], .table input[type=number], .table select { height: 36px; min-width: 90px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent); }
.pill .ico { width: 14px; height: 14px; }
.pill-green { background: var(--success-soft); color: var(--success); }
.pill-amber { background: var(--warn-soft); color: var(--warn); }
.pill-red { background: var(--danger-soft); color: var(--danger); }
.pill-gray { background: var(--track); color: var(--muted); }
.pill-indigo { background: var(--primary-soft); color: var(--primary); }
.pill-pink { background: var(--pink-soft); color: var(--pink); }
.pill-sky { background: var(--info-soft); color: var(--info); }
/* a status dot leads every pill that has no symbol of its own */
.pill:not(:has(> .ico))::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; opacity: .85; }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid transparent; font-weight: 600; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 28%, transparent); }

/* --- scan stations ------------------------------------------------------------------------- */
.scan-form { display: flex; gap: 10px; flex-wrap: wrap; }
.scan-form input[name=q] { flex: 1; min-width: 220px; height: 52px; font-size: 18px; direction: ltr; text-align: center; letter-spacing: 1px; border-radius: 12px; }
.scan-form .btn-lg { height: 52px; }
.scan-result { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); margin-bottom: 20px; font-size: 16px; font-weight: 700; border: 1px solid transparent; }
.scan-result .ico { width: 40px; height: 40px; }
.scan-result.ok { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.scan-result.fail { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.scan-result.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
/* meal counter: what is left of each dish, and the dish picker shown after an allowed scan */
.dish-stock { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dish-pick { border: 2px solid color-mix(in srgb, var(--success) 45%, transparent); }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.dish-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.dish-btn b { font-size: 18px; }
.dish-btn small { font-size: 13px; color: var(--muted); }
.dish-btn:hover:not(:disabled) { border-color: var(--success); box-shadow: var(--shadow); transform: translateY(-2px); }
.dish-btn:disabled { opacity: .45; cursor: not-allowed; }
.scan-result small { display: block; font-weight: 500; font-size: 13px; color: var(--ink-2); }
/* scan input: barcode glyph on the right, a scan line sweeping across while it waits */
.scan-form input[name=q] {
  padding-right: 52px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a90a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2M7 8v8M11 8v8M15 8v8M18 8v8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 17px center; background-size: 22px;
}
.scan-form input[name=q]:focus {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23635bff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2M7 8v8M11 8v8M15 8v8M18 8v8'/%3E%3C/svg%3E"),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 16%, transparent), transparent);
  background-size: 22px, 24% 100%;
  background-position: right 17px center, -30% 0;
  animation: scanline 1.7s ease-in-out infinite alternate;
}
@keyframes scanline { from { background-position: right 17px center, -30% 0; } to { background-position: right 17px center, 130% 0; } }

/* --- scan stations as heroes ---------------------------------------------------------- */
.station {
  --st: linear-gradient(245deg, #1e1b4b 0%, #4338ca 50%, #8b5cf6 100%);
  --st-ink: #4338ca;
  --st-glow: rgba(67, 56, 202, .55);
  position: relative; overflow: hidden; isolation: isolate;
  padding: 26px 28px 28px; border: 0; border-radius: 24px; color: #fff;
  background: var(--st);
  box-shadow: 0 26px 54px -28px var(--st-glow);
}
.station::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 90% at 100% 0%, rgba(255, 255, 255, .22), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 28px 28px;
  -webkit-mask-image: linear-gradient(to left, #000 30%, rgba(0, 0, 0, .3));
  mask-image: linear-gradient(to left, #000 30%, rgba(0, 0, 0, .3));
}
/* two soft rings drifting off the far corner */
.station::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset-inline-end: -70px; bottom: -110px; width: 280px; height: 280px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 36px rgba(255, 255, 255, .04), 0 0 0 72px rgba(255, 255, 255, .03);
}
.st-amber { --st: linear-gradient(245deg, #451a03 0%, #c2410c 48%, #f59e0b 100%); --st-ink: #c2410c; --st-glow: rgba(194, 65, 12, .6); }
.st-sky { --st: linear-gradient(245deg, #082f49 0%, #0369a1 48%, #22b8f0 100%); --st-ink: #0369a1; --st-glow: rgba(3, 105, 161, .6); }
.st-green { --st: linear-gradient(245deg, #022c22 0%, #047857 48%, #22c55e 100%); --st-ink: #047857; --st-glow: rgba(4, 120, 87, .6); }
.st-pink { --st: linear-gradient(245deg, #4a0727 0%, #be185d 48%, #f472b6 100%); --st-ink: #be185d; --st-glow: rgba(190, 24, 93, .6); }
.st-violet { --st: linear-gradient(245deg, #1e1b4b 0%, #4338ca 48%, #a78bfa 100%); --st-ink: #4338ca; --st-glow: rgba(67, 56, 202, .6); }
.station .card-head { margin-bottom: 4px; }
.station .card-head h2 { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.4px; gap: 14px; }
.station .card-head h2 > .ico {
  width: 50px; height: 50px; padding: 12px; border-radius: 15px; color: #fff;
  background: rgba(255, 255, 255, .17); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 22px -10px rgba(0, 0, 0, .5);
}
.station-sub { margin: 0 0 20px; padding-inline-start: 64px; color: rgba(255, 255, 255, .76); font-size: 13.5px; }
.station .pill {
  padding: 5px 13px; font-size: 12.5px; color: #fff;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24); backdrop-filter: blur(8px);
}
.station select { border: 0; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45); }
.station .empty, .station .muted, .station .small { color: rgba(255, 255, 255, .78); }
.station .muted b, .station .small b { color: #fff; }
.station .scan-form input[name=q] { height: 60px; border: 0; font-size: 19px; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .55); }
.station .scan-form input[name=q]:focus { box-shadow: 0 0 0 4px rgba(255, 255, 255, .35), 0 14px 34px -14px rgba(0, 0, 0, .55); }
.station .scan-form .btn-lg { height: 60px; border-radius: 13px; }
.station .scan-form .btn:not(.btn-ghost) { background: #fff; color: var(--st-ink); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .55); }
.station .scan-form .btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .26); box-shadow: none; }
.station .scan-form .btn-ghost:hover { background: rgba(255, 255, 255, .2); }
.station .camera-box video { box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .6); }
.station .btn-sm.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .26); }

/* a scan result lands with a little pop */
@keyframes pop { 0% { opacity: 0; transform: scale(.96) translateY(-6px); } 100% { opacity: 1; transform: none; } }
.scan-result { animation: pop .32s cubic-bezier(.2, .9, .3, 1.2) both; box-shadow: var(--shadow); }
.scan-result > .ico { width: 52px; height: 52px; padding: 12px; border-radius: 16px; flex: none; background: color-mix(in srgb, currentColor 14%, transparent); }

/* people in lists get a coloured initial */
.who { display: inline-flex; align-items: center; gap: 10px; }
.av {
  width: 32px; height: 32px; border-radius: 10px; flex: none; display: inline-grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13.5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.av0 { background: linear-gradient(135deg, #8a83ff, #5145ff); }
.av1 { background: linear-gradient(135deg, #fbbf24, #ea580c); }
.av2 { background: linear-gradient(135deg, #4ade80, #059669); }
.av3 { background: linear-gradient(135deg, #f9a8d4, #db2777); }
.av4 { background: linear-gradient(135deg, #67e8f9, #0284c7); }
.av5 { background: linear-gradient(135deg, #c4b5fd, #7c3aed); }

/* empty states get an icon instead of a lone line of text */
.empty::before {
  content: ""; display: block; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px;
  background: var(--track) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0b4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.station .empty::before { background-color: rgba(255, 255, 255, .14); }
td.empty { padding: 34px 0; }

.camera-box { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.camera-box video { width: 100%; max-width: 420px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: #000; }
/* aiming frame: where to hold the badge */
.cam-view { position: relative; width: 100%; max-width: 420px; line-height: 0; }
.cam-view video { display: block; }
.cam-view::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none;
}
.cam-view { overflow: hidden; border-radius: 14px; }
.cam-hint { font-size: 13px; color: var(--muted); text-align: center; }
.station .cam-hint { color: rgba(255, 255, 255, .85); }

/* tabs: icon pills on a soft track */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 5px; margin-bottom: 22px; background: var(--track); border-radius: 14px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 13.5px;
}
.tabs a .ico { width: 17px; height: 17px; }
.tabs a:hover { text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--card) 55%, transparent); }
.tabs a.active { color: var(--ink); background: var(--card); box-shadow: 0 1px 3px rgba(11, 16, 32, .1), 0 1px 1px rgba(11, 16, 32, .05); }
.tabs a.active .ico { color: var(--primary); }
:root[data-theme="dark"] .tabs a.active { background: #222a4a; }

.info-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; }

.ws-card .ws-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 8px 0 14px; }
.ws-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ws-meta .ico { width: 15px; height: 15px; color: color-mix(in srgb, var(--muted) 80%, transparent); }
.member-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.member-list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; font-size: 13px; background: var(--card); }
.member-list li:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pager a, .pager span { min-width: 34px; height: 34px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager span { background: var(--primary); color: var(--primary-ink); border-color: transparent; }

/* legacy registration helpers still used by a few pages */
.reg-footer { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.reg-footer .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reg-total { font-size: 20px; font-weight: 800; color: var(--success); margin-top: 4px; }
.reg-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.total-box { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.total-box dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
.total-box dt { color: var(--muted); }
.total-box dd { margin: 0; text-align: left; font-variant-numeric: tabular-nums; }
.total-box .grand { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 6px; font-size: 20px; font-weight: 800; color: var(--success); }

/* --- registration: checkout layout ----------------------------------------------------- */
.reg-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.reg-main { min-width: 0; display: grid; gap: 16px; }
.reg-main > .card, .reg-pair > .card { margin-bottom: 0; }
.reg-pair { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
/* workshops, lunch and the gift side by side; they wrap on narrower screens */
.reg-trio { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
/* narrow columns: the choice switch drops under the title, the price under the workshop name */
.reg-trio .step-head > div:not(.seg) { flex: 1 1 0; min-width: 0; }
.reg-trio .step-head .seg { flex-basis: 100%; margin-inline-start: 0; display: flex; }
.reg-trio .step-head .seg label { flex: 1; text-align: center; }
.reg-trio .opt-row { flex-wrap: wrap; row-gap: 2px; }
.reg-trio .opt-price { flex-basis: 100%; padding-inline-start: 30px; font-size: 12.5px; }

.reg-step { padding: 20px 22px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.step-no {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 14px; box-shadow: var(--btn-hi), 0 6px 14px -6px rgba(99,91,255,.7);
}
.step-head h2 { font-size: 15.5px; font-weight: 800; letter-spacing: -.2px; }
.step-head p { margin: 0; font-size: 12px; color: var(--muted); }
.step-head .seg, .step-head .pill { margin-inline-start: auto; }

/* role tiles */
.role-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.role-card {
  position: relative; display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 13px 14px 12px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--card); cursor: pointer; box-shadow: var(--shadow-xs);
}
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card .role-title { font-weight: 700; font-size: 14px; color: var(--ink); padding-inline-end: 22px; }
.role-card .role-fee { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.role-card .role-fee.paid { color: var(--warn); }
.role-card::after {
  /* selection dot in the corner */
  content: ""; position: absolute; top: 13px; inset-inline-end: 12px; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ink) 22%, var(--line)); background: var(--card);
}
.role-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); transform: translateY(-1px); }
.role-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary), 0 8px 20px -10px rgba(99,91,255,.55); }
.role-card:has(input:checked)::after { border: 5px solid var(--primary); background: #fff; }
.role-card:has(input:focus-visible) { box-shadow: var(--ring); }

/* personal details */
.field-grid { display: grid; gap: 12px 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-grid .field { margin: 0; }
.field-grid .span-2 { grid-column: span 2; }
/* English names read left to right: First Name on the left, labels aligned left */
.en-pair { display: grid; gap: 12px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: left; }
.en-pair .field { margin: 0; }
.en-pair label { text-align: left; }
.en-pair-full { grid-column: 1 / -1; }

/* line items: workshops and meal sittings */
.opt-list { display: grid; gap: 8px; }
.opt-row {
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; box-shadow: var(--shadow-xs);
}
.opt-row input { width: 18px; height: 18px; flex: none; }
.opt-row:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.opt-row:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 70%, transparent); background: var(--primary-soft); }
.opt-row.disabled { opacity: .5; cursor: not-allowed; }
.opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.opt-main b { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.opt-main small { font-size: 12px; color: var(--muted); }
.opt-price { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.opt-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--track); color: var(--muted); white-space: nowrap; }
.opt-tag.full { background: var(--danger-soft); color: var(--danger); }

/* summary: a dark receipt that follows you down the form */
.reg-summary { position: sticky; top: 84px; }
.summary-card {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 20px; padding: 22px; color: #e6e8f2;
  background: linear-gradient(160deg, #141938 0%, #0b0e1f 100%);
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--shadow-lg);
}
.summary-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(80% 60% at 100% 0%, rgba(124, 116, 255, .35), transparent 60%),
              radial-gradient(70% 50% at 0% 100%, rgba(236, 72, 153, .18), transparent 60%);
}
.summary-card h3 { font-size: 13px; font-weight: 700; color: #9aa2c0; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.summary-card h3 .ico { width: 16px; height: 16px; }
.sum-list { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; font-size: 13.5px; }
.sum-list dt { color: #a3abc6; }
.sum-list dd { margin: 0; text-align: left; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.summary-total { margin: 18px 0 18px; padding-top: 16px; border-top: 1px dashed rgba(255, 255, 255, .16); }
.summary-total > span { display: block; font-size: 12.5px; color: #a3abc6; margin-bottom: 2px; }
.summary-total b { display: block; font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.8px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.summary-total small { font-size: 13px; font-weight: 500; color: #a3abc6; margin-inline-start: 4px; letter-spacing: 0; }
.summary-actions { display: grid; gap: 8px; }
.summary-actions .btn { width: 100%; }
.summary-actions .btn-ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #c9cee2; box-shadow: none; }
.summary-actions .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
/* print-this-person shortcut at the end of each participants row */
.row-print { width: 34px; height: 34px; box-shadow: none; }
.row-print:hover { color: var(--primary); }
.row-edit { white-space: nowrap; }
.summary-note { margin-top: 12px; font-size: 12px; color: #8a92b0; text-align: center; }

/* --- badge preview (8x5 cm label) ------------------------------------------------------- */
.badge-label {
  width: 80mm; height: 50mm; margin: 0 auto; overflow: hidden; box-sizing: border-box; background: #fff; color: #000;
  border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5mm; padding: 2.5mm 3mm; text-align: center;
  line-height: 1.2;
}
.badge-label .b-name-en { font-size: 15pt; font-weight: 800; direction: ltr; letter-spacing: .3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* set by app.js when even the shrunk name is wider than the barcode */
.badge-label .b-name-en.b-name-wrap, .badge-label .b-company.b-name-wrap { white-space: normal; line-height: 1.1; text-wrap: balance; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.badge-label .barcode, .badge-label .qr { flex: none; }
.badge-label .b-code { font-size: 11pt; font-weight: 700; direction: ltr; letter-spacing: 1.5px; font-family: ui-monospace, monospace; }
.badge-label .b-name-fa { font-family: 'Vazirmatn', Tahoma, sans-serif; direction: rtl; letter-spacing: 0; }
.badge-label .b-name-second { font-size: 12pt; font-weight: 700; margin-top: -1.5mm; }
.badge-label .b-company { font-family: 'Vazirmatn', Tahoma, sans-serif; font-size: 12pt; font-weight: 700; margin-top: -1mm; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a company name may be long; the label has room for a third line */
.badge-label .b-company.b-name-wrap { -webkit-line-clamp: 3; line-height: 1.3; } /* 1.1 cuts Persian descenders */
.badge-label .b-spec { font-family: 'Vazirmatn', Tahoma, sans-serif; font-size: 10.5pt; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* certificate signers on the certificates page */
.signers { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 10px; }
.signer .field { margin-bottom: 10px; }
.sig-preview { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; margin-bottom: 6px; display: inline-block; }
.sig-preview img { max-height: 56px; max-width: 200px; display: block; }
.print-help { text-align: right; font-size: 12px; color: var(--muted); margin-top: 10px; }
.print-help summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.print-help ol { margin: 8px 0 0; padding-inline-start: 18px; line-height: 2; }

/* --- login --------------------------------------------------------------------------- */
.pass-wrap { position: relative; }
.pass-wrap input { padding-inline-end: 44px; }
.pass-eye {
  position: absolute; inset-inline-end: 5px; top: 50%; transform: translateY(-50%); width: 34px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.pass-eye:hover { background: var(--track); color: var(--ink); }
.pass-eye .ico { width: 18px; height: 18px; }
body.bare { background: #090c19; }
body.bare::before {
  -webkit-mask-image: none; mask-image: none;
  background:
    radial-gradient(50% 60% at 85% 10%, rgba(99, 91, 255, .45), transparent 60%),
    radial-gradient(45% 55% at 10% 90%, rgba(236, 72, 153, .28), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 32px 32px;
}
.bare-main { min-height: 100vh; display: grid; place-content: center; padding: 24px; }
.login-card { width: min(500px, calc(100vw - 32px)); padding: 40px 40px 36px; border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); border-color: rgba(255,255,255,.08); }
.login-card .brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; margin-bottom: 28px; }
.login-card .brand-mark { width: 96px; height: 96px; border-radius: 24px; }
.login-card .brand-mark .ico { width: 44px; height: 44px; }
.login-card .brand-mark.has-logo { padding: 8px; }
.login-card .brand-title { color: var(--ink); font-size: 24px; white-space: normal; }
.login-card .brand-sub { color: var(--muted); font-size: 14px; }
.login-card .field { margin-bottom: 18px; }
.login-card .field label { font-size: 15px; margin-bottom: 8px; }
.login-card input[type=text], .login-card input[type=password] { height: 52px; font-size: 16px; }
.login-card .btn { height: 54px; margin-top: 6px; font-size: 17px; background: var(--grad); }
.login-card .pass-eye { width: 40px; height: 40px; }
.login-card .pass-eye .ico { width: 21px; height: 21px; }

/* --- motion ------------------------------------------------------------------------------ */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.main > .card, .main > .page-head, .main > .grid > .card, .reg-main > .card, .reg-pair > .card, .reg-summary, .hello, .bento > .tile { animation: rise .26s cubic-bezier(.2, .7, .2, 1) both; }
.bento > .tile:nth-child(2) { animation-delay: .04s; }
.bento > .tile:nth-child(3) { animation-delay: .08s; }
.bento > .tile:nth-child(4) { animation-delay: .12s; }
.bento > .tile:nth-child(5) { animation-delay: .16s; }
.quick-tile:hover .quick-ico { transform: rotate(-6deg) scale(1.06); }
.quick-ico { transition: transform .25s cubic-bezier(.34, 1.4, .64, 1); }
.main > .grid > .card:nth-child(2), .reg-main > :nth-child(2) { animation-delay: .03s; }
.main > .grid > .card:nth-child(3), .reg-main > :nth-child(3) { animation-delay: .06s; }
.main > .grid > .card:nth-child(4), .reg-main > :nth-child(4) { animation-delay: .09s; }
@keyframes brandShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.brand-mark { background-size: 200% 200%; animation: brandShift 8s ease-in-out infinite; }
.card:hover .kpi-icon { transform: translateY(-2px) scale(1.05); }
.kpi-icon { transition: transform .25s cubic-bezier(.34, 1.4, .64, 1); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* short windows: tighten the menu so all twelve items still fit without scrolling */
@media (max-height: 780px) {
  .side-brand { padding: 14px 16px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .side-nav { padding-top: 8px; }
  .side-nav a { margin-bottom: 2px; }
  .side-sep { margin: 5px 12px; }
}

/* --- responsive ------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-feature { grid-column: 1 / -1; grid-row: auto; }
  .tile-feature .tile-spark { height: 120px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reg-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .nav-toggle { display: inline-grid; }
  .sidebar { position: fixed; top: 0; bottom: 0; right: 0; height: auto; transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .7, .2, 1); box-shadow: -20px 0 50px rgba(0, 0, 0, .35); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(5, 8, 20, .45); backdrop-filter: blur(2px); }
  .reg-layout { grid-template-columns: minmax(0, 1fr); }
  /* the summary becomes a sticky bar at the bottom of the screen */
  .reg-summary { position: sticky; top: auto; bottom: 12px; z-index: 15; }
  .summary-card { padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-radius: 16px; }
  .summary-card h3, .sum-list, .summary-note { display: none; }
  .summary-total { margin: 0; padding: 0; border: 0; }
  .summary-total b { font-size: 22px; }
  .summary-actions { margin-inline-start: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .summary-actions .btn { width: auto; }
}
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .crumb-event, .crumb-sep { display: none; }
  .user-chip-text { display: none; }
  .total-box { position: static; }
  .reg-grid { grid-template-columns: minmax(0, 1fr); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { padding: 22px; }
  /* scan box gets its own row so the hint is never cut; the buttons share the next one */
  .station .scan-form input[name=q] { flex-basis: 100%; }
  .station .scan-form .btn-lg { flex: 1 1 auto; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .tile-feature .tile-value { font-size: 36px; }
  .hello { padding: 22px 20px; border-radius: 22px; }
  .hello h1 { font-size: 23px; }
  .hello-side { display: none; }
  .quick { gap: 8px; }
  .quick-tile { padding: 10px; gap: 9px; }
  .quick-ico { width: 36px; height: 36px; }
  .quick-txt small { display: none; }
  .today-box .today-date { display: none; }
  .logout-btn span { display: none; }
  .user-chip .avatar { display: none; }
  .user-chip { padding: 0 4px; }
  .today-box .clock { border: 0; padding: 0; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .kpi .kpi-value { font-size: 26px; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .field-grid .span-2 { grid-column: auto; }
  .summary-actions .btn-ghost { display: none; }
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .role-card { padding: 10px 11px; }
  /* the sticky bar stays two short rows on a phone: the total, then the three buttons side by side */
  .summary-card { padding: 10px 12px; gap: 8px; }
  .summary-total { display: flex; align-items: baseline; justify-content: space-between; width: 100%; }
  .summary-total > span { margin: 0; }
  .summary-total b { font-size: 19px; }
  .summary-actions { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); margin: 0; }
  .summary-actions .btn { height: 40px; padding: 0 6px; font-size: 12.5px; white-space: normal; line-height: 1.25; text-align: center; }
  .summary-actions .btn .ico { display: none; }
  .station { padding: 20px 18px 20px; border-radius: 20px; }
  .station .card-head h2 { font-size: 18px; }
  .station .card-head h2 > .ico { width: 42px; height: 42px; padding: 10px; }
  .station-sub { padding-inline-start: 0; }
  .ph-ico { width: 46px; height: 46px; border-radius: 14px; }
  .ph-ico .ico { width: 23px; height: 23px; }
  .ph-wm .ico { width: 120px; height: 120px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; }
  .station .scan-form input[name=q] { min-width: 0; flex-basis: 100%; }
  .station .scan-form .btn-lg { flex: 1; }
  .summary-actions .btn { height: 42px; padding: 0 14px; font-size: 14px; }
}

/* --- print ------------------------------------------------------------------------------- */
@media print {
  body::before, .nav-scrim { display: none !important; }
  .topbar, .sidebar, .no-print, .alert, .tabs { display: none !important; }
  body { background: #fff; color: #000; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  .card, .page-head { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; animation: none !important; }
  .page-head { background: #fff !important; color: #000; }
  .page-head::before, .page-head::after, .stat-card::before, .kpi::after, .station::before, .station::after { display: none !important; }
  .station { background: #fff !important; color: #000; }
  .page-head p, .page-head [class*="tone-"] { color: #333; }
  :root, :root[data-theme="dark"] { --bg: #fff; --card: #fff; --card-soft: #f5f5f5; --ink: #000; --ink-2: #222; --muted: #555; --line: #ccc; }
}

/* --- Jalali date picker -------------------------------------------------------------- */
/* fixed and placed by JS: the picker lives on <body> so a scrolling table never clips it */
.jdp { position: fixed; z-index: 60; width: 268px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px; }
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-head button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--track); color: var(--ink); font-size: 18px; cursor: pointer; }
.jdp-head button:hover { background: var(--primary-soft); color: var(--primary); }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-wd { font-size: 11px; color: var(--muted); padding: 4px 0; }
.jdp-grid button { height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.jdp-grid button:hover:not(:disabled) { background: var(--primary-soft); }
.jdp-grid button:disabled { color: var(--muted); opacity: .4; cursor: not-allowed; }
.jdp-grid .jdp-today { box-shadow: inset 0 0 0 1px var(--primary); }
.jdp-grid .jdp-sel { background: var(--primary); color: var(--primary-ink); }
.jdp-foot { margin-top: 8px; text-align: center; }
.jdp-foot button { border: 0; background: none; color: var(--primary); font: inherit; font-size: 13px; cursor: pointer; }

/* badge page: pick people to print */
.pick-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pick-list { max-height: 480px; overflow: auto; }
.pick-list thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.pick-list tbody tr { cursor: pointer; }
.pick-list tbody tr:has(input:checked) td { background: var(--primary-soft); }
.pick-list input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }


/* settings: irreversible actions */
.danger-zone { border-color: rgba(229, 72, 77, .45); background: rgba(229, 72, 77, .05); }

/* Excel import rows: the sticky top bar must not cover the row we return to */
tr[id^="row-"] { scroll-margin-top: 96px; }
tr[id^="row-"]:target > td { background: rgba(99, 91, 255, .09); }

/* public page where people complete their own record */
.self-card { margin-block: 24px; }
.self-card .seg label { font-size: 15px; }
.login-card select, .login-card input[type=tel], .login-card input[type=email] { height: 52px; font-size: 16px; }
.login-card .btn.self-leave { height: 44px; background: transparent; font-size: 15px; }

/* public signup form: wider than the login card */
.signup-card { width: min(760px, calc(100vw - 32px)); padding: 32px; }
.signup-total { margin: 6px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); font-size: 15px; }
.signup-total b { color: var(--success); font-size: 18px; }


/* participants page: the two public links in one card */
.public-links { display: grid; gap: 0; padding-block: 6px; }
.public-link { padding: 14px 0; }
.public-link + .public-link { border-top: 1px solid var(--line); }
.public-link-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.public-link-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.public-link-head .actions { display: flex; align-items: center; gap: 8px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }
.copy-row .btn { flex: none; height: auto; }
.public-link-help { margin-top: 8px; }
.public-link-help summary { cursor: pointer; font-size: 12.5px; color: var(--muted); width: fit-content; }
.public-link-help p { margin: 6px 0 0; }

/* gate: a program in several halls asks the desk which one it is */
.gate-hall-pick { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; padding: 9px 12px; border-radius: 11px; background: rgba(255, 255, 255, .92); color: #92400e; font-weight: 700; font-size: 13.5px; }
.gate-hall-pick .ico { width: 18px; height: 18px; flex: none; }

/* badge with a photo: the photo at the start, names and code beside it */
.badge-label.has-photo { flex-direction: row; align-items: center; gap: 3mm; padding: 2.5mm 3mm; }
.badge-label .b-photo { flex: none; width: 23mm; height: 30.6mm; object-fit: cover; border-radius: 1.5mm; }
.badge-label .b-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2mm; }
.badge-label.has-photo .b-name-en { font-size: 13pt; }

/* registration: the photo taken for the badge */
.photo-box { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-frame { position: relative; width: 120px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--track); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.photo-frame img, .photo-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame video { transform: scaleX(-1); } /* a mirror, as people expect from a webcam; the saved photo is not mirrored */
.photo-frame span { display: grid; justify-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.photo-frame span .ico { width: 26px; height: 26px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-photo { object-fit: cover; padding: 0; width: 56px; height: 74px; border-radius: 12px; }

/* cash report: which programs it covers */
.cash-programs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 18px; }
.cash-programs .check { margin: 0; }
.print-only { display: none; }
@media print { .print-only { display: block; } }
/* print buttons at the end of a participants row */
.row-actions { display: inline-flex; gap: 4px; align-items: center; margin-inline-start: 4px; }
.row-actions form { display: contents; }
