@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-950: #081a2c;
  --navy-900: #0b2035;
  --navy-800: #0f2b46;
  --navy-700: #143a5c;
  --navy-600: #1d4d75;
  --blue-700: #22588a;
  --blue-600: #2b6cb0;
  --blue-500: #3c82c4;
  --blue-100: #dbe9f7;
  --blue-50: #eef5fb;
  --ink: #172a3e;
  --muted: #5f7184;
  --muted-2: #8092a6;
  --line: #e3ebf3;
  --line-strong: #cfdbe8;
  --bg: #f3f7fb;
  --white: #ffffff;
  --green: #147a50;
  --green-bg: #e7f6ee;
  --amber: #a9610b;
  --amber-bg: #fdf3e2;
  --red: #b02a20;
  --red-bg: #fdeceb;
  --violet: #6341a5;
  --violet-bg: #f0ebfb;
  --teal: #0e7168;
  --teal-bg: #e6f5f3;
  --indigo: #3b4fa5;
  --indigo-bg: #ebedfa;
  --gray: #5c6b7a;
  --gray-bg: #eef1f5;
  --shadow-sm: 0 1px 2px rgba(15, 43, 70, .05);
  --shadow: 0 8px 28px rgba(15, 43, 70, .09);
  --shadow-lg: 0 20px 50px rgba(8, 26, 44, .18);
  --radius: 14px;
  --radius-lg: 20px;
  --font: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--navy-700); }
img { max-width: 100%; }
h1, h2, h3, h4, h5 { margin: 0 0 .5rem; font-weight: 800; line-height: 1.6; color: var(--navy-800); letter-spacing: -.2px; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.38rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
ul, ol { margin: 0 0 .8rem; padding-inline-start: 1.35rem; }
::selection { background: var(--blue-100); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.icon { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -.22em; flex: 0 0 auto; }
svg.icon-sm { width: 1em; height: 1em; }
svg.icon-lg { width: 1.6em; height: 1.6em; }

.container { width: min(1180px, 100% - 2.4rem); margin-inline: auto; }
.container-narrow { width: min(780px, 100% - 2.4rem); margin-inline: auto; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row-nowrap { display: flex; align-items: center; gap: .6rem; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: .6rem; }
.gap-xs { gap: .3rem; } .gap-sm { gap: .5rem; } .gap-md { gap: 1rem; } .gap-lg { gap: 1.6rem; }
.grow { flex: 1 1 auto; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.strong { font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .4px; direction: ltr; display: inline-block; }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-end { text-align: end; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.6rem; } .mt-4 { margin-top: 2.4rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.6rem; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.desktop-only { display: initial; }
.mobile-only { display: none; }
.divider { height: 1px; background: var(--line); margin: 1.1rem 0; border: 0; }

/* ---------------- buttons ---------------- */
.btn {
  --btn-bg: var(--navy-800);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid transparent; border-radius: 11px;
  padding: .62rem 1.15rem; font-family: inherit; font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: .18s ease; text-decoration: none; line-height: 1.7;
  min-height: 42px; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); color: var(--btn-fg); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { --btn-bg: var(--blue-600); }
.btn-navy { --btn-bg: var(--navy-800); }
.btn-outline { --btn-bg: #fff; --btn-fg: var(--navy-700); border-color: var(--line-strong); }
.btn-outline:hover { --btn-bg: var(--blue-50); color: var(--navy-800); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--navy-700); }
.btn-ghost:hover { --btn-bg: var(--blue-50); color: var(--navy-800); box-shadow: none; }
.btn-soft { --btn-bg: var(--blue-50); --btn-fg: var(--blue-700); }
.btn-success { --btn-bg: var(--green); }
.btn-danger { --btn-bg: var(--red); }
.btn-danger-soft { --btn-bg: var(--red-bg); --btn-fg: var(--red); }
.btn-warn { --btn-bg: var(--amber); }
.btn-sm { padding: .34rem .7rem; font-size: .8rem; border-radius: 9px; min-height: 33px; }
.btn-lg { padding: .85rem 1.7rem; font-size: 1rem; border-radius: 13px; min-height: 50px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 9px; }
.btn-group { display: inline-flex; align-items: center; gap: 4px; }

.alert {
  display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem;
  border-radius: 12px; border: 1px solid; font-size: .87rem; margin-bottom: 1rem; line-height: 1.9;
}
.alert .icon { margin-top: .25rem; }
.alert-info { background: var(--blue-50); border-color: #c5dcef; color: var(--navy-700); }
.alert-success { background: var(--green-bg); border-color: #bfe5d2; color: var(--green); }
.alert-warn { background: var(--amber-bg); border-color: #f1d9ad; color: var(--amber); }
.alert-danger { background: var(--red-bg); border-color: #f3c4c0; color: var(--red); }

.badge {
  display: inline-flex; align-items: center; gap: .28rem; padding: .16rem .55rem;
  border-radius: 7px; font-size: .74rem; font-weight: 600; line-height: 1.9; white-space: nowrap;
  background: var(--gray-bg); color: var(--gray);
}
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-teal { background: var(--teal-bg); color: var(--teal); }
.badge-indigo { background: var(--indigo-bg); color: var(--indigo); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }
.badge-navy { background: var(--navy-800); color: #fff; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem;
  border-radius: 999px; background: #fff; border: 1px solid var(--line-strong);
  color: var(--navy-700); font-size: .78rem; font-weight: 600;
}
.chip.active, .chip:hover { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------------- cards & forms ---------------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-pad { padding: 1.25rem 1.35rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .95rem 1.35rem; border-bottom: 1px solid var(--line); background: #fcfdff; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 1.02rem; display: flex; align-items: center; gap: .5rem; }
.card-head .icon { color: var(--blue-600); }
.card-body { padding: 1.25rem 1.35rem; }
.card-foot { padding: .85rem 1.35rem; border-top: 1px solid var(--line); background: #fbfcfe; }
.card-flush { overflow: visible; }
.section-title { display: flex; align-items: center; gap: .55rem; margin: 0 0 1rem; font-size: 1.05rem; }
.section-title .icon { color: var(--blue-600); }
.section-title .line { flex: 1; height: 1px; background: var(--line); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem 1.1rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .95rem 1.1rem; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .95rem 1.1rem; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

.field { display: flex; flex-direction: column; gap: .32rem; min-width: 0; }
.field > label, .label { font-size: .82rem; font-weight: 600; color: var(--navy-700); display: flex; align-items: center; gap: .3rem; }
.label .req { color: var(--red); font-size: 1rem; line-height: 1; }
.field .hint { font-size: .72rem; color: var(--muted-2); line-height: 1.7; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  border-radius: 10px; padding: .58rem .8rem; font-family: inherit; font-size: .9rem;
  line-height: 1.8; transition: .15s ease; min-height: 43px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 2; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f7184' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left .75rem center; padding-left: 2rem; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(60, 130, 196, .14); }
.input:disabled, .select:disabled { background: #f4f7fa; color: var(--muted); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red); background: #fffafa; }
.field-error { color: var(--red); font-size: .73rem; font-weight: 600; display: none; }
.field.has-error .field-error { display: block; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--red); }
.input-ltr { direction: ltr; text-align: left; font-family: ui-monospace, Menlo, monospace; letter-spacing: .6px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group .btn { border-start-start-radius: 0; border-end-start-radius: 0; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .86rem; cursor: pointer; line-height: 1.9; }
.check input[type=checkbox], .check input[type=radio] { width: 19px; height: 19px; accent-color: var(--blue-600); margin-top: .28rem; flex: 0 0 auto; cursor: pointer; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card span { display: flex; align-items: center; gap: .4rem; border: 1px solid var(--line-strong); border-radius: 10px; padding: .55rem .7rem; font-size: .83rem; cursor: pointer; background: #fff; transition: .15s; }
.radio-card input:checked + span { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-700); font-weight: 700; box-shadow: inset 0 0 0 1px var(--blue-500); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px dashed var(--line-strong); flex-wrap: wrap; }
.form-actions .grow { flex: 1; }

/* ---------------- public ---------------- */
.public-body { background: #fff; }
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--navy-800); }
.brand:hover { color: var(--navy-800); }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(145deg, var(--navy-800), var(--navy-600));
  display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px rgba(15, 43, 70, .22); flex: 0 0 auto;
}
.brand-mark .icon { width: 25px; height: 25px; }
.brand-text strong { display: block; font-size: .95rem; line-height: 1.5; }
.brand-text span { display: block; font-size: .7rem; color: var(--muted); line-height: 1.5; }
.site-nav { display: flex; align-items: center; gap: .2rem; }
.site-nav a { color: var(--navy-700); font-size: .86rem; font-weight: 600; padding: .5rem .8rem; border-radius: 9px; }
.site-nav a:hover, .site-nav a.active { background: var(--blue-50); }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.menu-toggle { display: none; }

.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #f5f9fd 0%, #fff 100%); padding: 3.2rem 0 2.8rem; border-bottom: 1px solid var(--line); }
.hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 15% 20%, rgba(43, 108, 176, .12), transparent 42%), radial-gradient(circle at 85% 70%, rgba(15, 43, 70, .09), transparent 40%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.2fr .8fr; gap: 2.4rem; align-items: center; }
.hero h1 { font-size: 2.25rem; line-height: 1.55; margin-bottom: .8rem; }
.hero h1 span { color: var(--blue-600); }
.hero-lead { font-size: 1rem; color: var(--muted); max-width: 610px; line-height: 2.05; margin-bottom: 1.4rem; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.hero-panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 1.4rem; position: relative; }
.hero-panel::before { content: ''; position: absolute; inset: -10px; border: 1px dashed #c9dcee; border-radius: 26px; z-index: -1; }
.steps-preview { display: grid; gap: .55rem; }
.steps-preview .row { background: #fbfdff; border: 1px solid var(--line); border-radius: 11px; padding: .55rem .75rem; }
.step-num { width: 27px; height: 27px; border-radius: 8px; background: var(--blue-50); color: var(--blue-700); font-size: .78rem; font-weight: 800; display: grid; place-items: center; flex: 0 0 auto; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 1.3rem; }
.hero-stat { text-align: center; border-inline-start: 1px solid var(--line); }
.hero-stat:first-child { border: 0; }
.hero-stat b { display: block; font-size: 1.25rem; color: var(--navy-800); }
.hero-stat span { font-size: .72rem; color: var(--muted); }

.trust-strip { border-bottom: 1px solid var(--line); background: #fff; padding: .8rem 0; }
.trust-strip .row { justify-content: center; gap: 2.2rem; color: var(--muted); font-size: .8rem; }
.trust-strip .row span { display: inline-flex; align-items: center; gap: .4rem; }
.trust-strip .icon { color: var(--green); }

.section { padding: 3rem 0; }
.section.alt { background: #f7fafd; border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2rem; }
.section-head h2 { margin-bottom: .35rem; }
.section-head p { color: var(--muted); font-size: .9rem; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; transition: .18s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; margin-bottom: .7rem; }
.feature h3 { font-size: .95rem; margin-bottom: .25rem; }
.feature p { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.9; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.cat-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; display: flex; align-items: center; gap: .7rem; transition: .16s; color: var(--navy-800); }
.cat-tile:hover { border-color: var(--blue-500); box-shadow: var(--shadow-sm); color: var(--navy-800); }
.cat-tile .icon { color: var(--blue-600); }
.cat-tile span { font-size: .84rem; font-weight: 600; line-height: 1.7; }

.track-box { max-width: 680px; margin: 0 auto; position: relative; z-index: 2; }
.track-form { display: flex; gap: .6rem; }
.track-form .input { flex: 1; min-height: 50px; text-align: center; letter-spacing: 2px; }
.track-result { margin-top: 1.5rem; }

.site-footer { background: var(--navy-900); color: #c5d4e3; padding: 2.2rem 0 1.4rem; margin-top: 3rem; }
.site-footer a { color: #dfeaf5; }
.site-footer .brand-text strong { color: #fff; }
.site-footer .brand-text span { color: #93a9c0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: .9rem; margin-bottom: .6rem; }
.site-footer p, .site-footer li { font-size: .8rem; line-height: 2.05; color: #a9bccf; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 1.6rem; padding-top: 1rem; font-size: .74rem; color: #8fa5bb; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------------- wizard ---------------- */
.wizard-page { background: var(--bg); padding: 1.6rem 0 3rem; min-height: 60vh; }
.wizard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.wizard-head h1 { font-size: 1.5rem; margin: 0; }
.wizard-head p { margin: .2rem 0 0; color: var(--muted); font-size: .84rem; }
.wizard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 1.2rem; align-items: start; }
.wizard-main { min-width: 0; }
.wizard-aside { position: sticky; top: 90px; display: grid; gap: 1rem; }
.progress-track { height: 6px; background: #dfe9f3; border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--navy-700)); border-radius: 99px; transition: width .4s ease; width: 20%; }
.steps-bar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.3rem; gap: .2rem; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: .35rem; flex: 1; position: relative; color: var(--muted-2); font-size: .72rem; text-align: center; }
.step-item::before { content: ''; position: absolute; top: 16px; right: 50%; width: 100%; height: 2px; background: var(--line-strong); z-index: 0; }
.step-item:first-child::before { display: none; }
.step-item .bubble { width: 33px; height: 33px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); display: grid; place-items: center; font-weight: 800; font-size: .8rem; z-index: 1; transition: .2s; }
.step-item.active { color: var(--navy-800); font-weight: 700; }
.step-item.active .bubble { background: var(--navy-800); border-color: var(--navy-800); color: #fff; box-shadow: 0 0 0 4px rgba(15, 43, 70, .1); }
.step-item.done { color: var(--green); }
.step-item.done .bubble { background: var(--green-bg); border-color: #7bc3a2; color: var(--green); }
.step-item.done::before { background: #9fd4ba; }
.step-panel { display: none; animation: fadeUp .28s ease; }
.step-panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step-title { display: flex; align-items: center; gap: .55rem; margin-bottom: .25rem; }
.step-title .icon { color: var(--blue-600); }
.step-sub { color: var(--muted); font-size: .82rem; margin-bottom: 1.2rem; }
.wizard-actions { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.save-state { font-size: .74rem; color: var(--muted-2); display: flex; align-items: center; gap: .3rem; }
.save-state.ok { color: var(--green); }

.summary-card { background: #fff; }
.summary-list { display: grid; gap: .55rem; }
.summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; font-size: .8rem; }
.summary-row span { color: var(--muted); }
.summary-row b { font-weight: 700; color: var(--navy-800); text-align: end; }
.summary-total { border-top: 1px dashed var(--line-strong); padding-top: .6rem; margin-top: .3rem; }
.summary-help { font-size: .78rem; color: var(--muted); background: var(--blue-50); border-radius: 10px; padding: .7rem .8rem; line-height: 1.95; }
.secure-note { display: flex; gap: .5rem; font-size: .74rem; color: var(--muted); line-height: 1.9; }
.secure-note .icon { color: var(--green); margin-top: .2rem; }

/* category tree */
.cat-search { margin-bottom: .8rem; }
.cat-tree { max-height: 430px; overflow: auto; padding-inline-end: .3rem; }
.cat-group { border: 1px solid var(--line); border-radius: 11px; margin-bottom: .5rem; overflow: hidden; background: #fff; }
.cat-group > button { width: 100%; display: flex; align-items: center; gap: .6rem; background: #fbfdff; border: 0; padding: .7rem .8rem; font-family: inherit; font-size: .86rem; font-weight: 700; color: var(--navy-800); cursor: pointer; text-align: start; }
.cat-group > button .icon:last-child { margin-inline-start: auto; transition: .2s; }
.cat-group.open > button .icon:last-child { transform: rotate(180deg); }
.cat-children { display: none; padding: .4rem; gap: .3rem; grid-template-columns: repeat(2, 1fr); }
.cat-group.open .cat-children { display: grid; }
.cat-option { display: flex; align-items: center; gap: .45rem; font-size: .79rem; padding: .45rem .55rem; border-radius: 8px; cursor: pointer; border: 1px solid transparent; line-height: 1.6; }
.cat-option:hover { background: var(--blue-50); }
.cat-option.selected { background: var(--blue-50); border-color: var(--blue-500); color: var(--blue-700); font-weight: 700; }
.cat-option input { accent-color: var(--blue-600); width: 16px; height: 16px; }
.selected-cat { display: flex; align-items: center; gap: .6rem; background: var(--blue-50); border: 1px solid #cbe0f1; border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; font-size: .84rem; }
.selected-cat .icon { color: var(--blue-600); }

/* documents */
.upload-warning { background: #fff9ec; border: 1px solid #f1d9ad; border-radius: 12px; padding: 1rem 1.1rem; font-size: .8rem; color: #7a4c0a; line-height: 2.05; margin-bottom: 1.1rem; }
.upload-warning h4 { color: var(--amber); display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; font-size: .88rem; }
.doc-list { display: grid; gap: .7rem; }
.doc-item { display: flex; align-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; background: #fff; flex-wrap: wrap; }
.doc-item.uploaded { border-color: #c6e3d4; background: #fcfefd; }
.doc-item.needs_fix { border-color: #efc9c5; background: #fffafa; }
.doc-item.quarantined { border-color: #e7c98b; background: #fffbf2; }
.doc-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--gray-bg); color: var(--muted); flex: 0 0 auto; }
.doc-icon.pdf { background: var(--red-bg); color: var(--red); }
.doc-icon.img { background: var(--blue-50); color: var(--blue-700); }
.doc-meta { flex: 1 1 200px; min-width: 0; }
.doc-meta strong { display: block; font-size: .84rem; color: var(--navy-800); }
.doc-meta span { display: block; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-actions { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone { border: 1.5px dashed #b9cfe3; border-radius: 12px; padding: 1.5rem; text-align: center; background: #fbfdff; transition: .18s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { background: var(--blue-50); border-color: var(--blue-500); }
.dropzone .icon { color: var(--blue-600); width: 34px; height: 34px; margin-bottom: .3rem; }
.dropzone strong { display: block; font-size: .86rem; color: var(--navy-800); }
.dropzone span { font-size: .74rem; color: var(--muted); }
.file-preview { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f1f5f9; }
.file-preview img { width: 100%; height: 62px; object-fit: cover; display: block; }
.file-preview .pdf-label { height: 62px; display: grid; place-items: center; color: var(--red); font-weight: 700; font-size: .78rem; }

/* review */
.review-section { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .8rem; overflow: hidden; }
.review-section-head { display: flex; align-items: center; justify-content: space-between; background: #fbfdff; padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-size: .84rem; font-weight: 700; color: var(--navy-800); }
.review-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem .9rem; padding: .8rem .9rem; font-size: .8rem; }
.review-grid .full { grid-column: span 2; }
.review-grid dt { color: var(--muted); font-size: .73rem; margin: 0; }
.review-grid dd { margin: 0 0 .35rem; font-weight: 600; color: var(--navy-800); }
.consent-box { background: #f8fbfe; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: grid; gap: .2rem; }

/* tracking */
.tracking-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.5rem; }
.tracking-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px dashed var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }
.track-code { font-size: 1.1rem; font-weight: 800; letter-spacing: 1px; color: var(--navy-800); }
.timeline { position: relative; display: grid; gap: .9rem; padding-inline-start: 1.2rem; }
.timeline::before { content: ''; position: absolute; inset-block: 6px; inset-inline-start: 5px; width: 2px; background: var(--line-strong); }
.timeline-item { position: relative; }
.timeline-item::before { content: ''; position: absolute; inset-inline-start: -1.2rem; top: .55rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--blue-500); }
.timeline-item.done::before { background: var(--green); border-color: var(--green); }
.timeline-item.reject::before { background: var(--red); border-color: var(--red); }
.timeline-item b { font-size: .82rem; color: var(--navy-800); display: block; }
.timeline-item span { font-size: .73rem; color: var(--muted); }
.timeline-item p { font-size: .78rem; color: var(--muted); margin: .15rem 0 0; }
.status-hero { display: flex; align-items: center; gap: .8rem; background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); color: #fff; border-radius: 14px; padding: 1.1rem 1.2rem; }
.status-hero .icon { color: #9cc4e8; width: 34px; height: 34px; }
.status-hero b { display: block; font-size: 1.05rem; }
.status-hero span { font-size: .75rem; color: #bcd4e8; }
.status-hero .badge { margin-inline-start: auto; }

/* login */
.auth-body { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.auth-side { background: linear-gradient(150deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); inset-inline-end: -140px; bottom: -140px; box-shadow: 0 0 0 60px rgba(255,255,255,.03), 0 0 0 120px rgba(255,255,255,.02); }
.auth-side h2 { color: #fff; font-size: 1.5rem; margin-bottom: .4rem; }
.auth-side p { color: #b9cee1; font-size: .86rem; line-height: 2.1; }
.auth-side .badge { background: rgba(255,255,255,.12); color: #e6f0f9; }
.auth-features { display: grid; gap: .7rem; margin-top: 1.5rem; }
.auth-features div { display: flex; align-items: center; gap: .6rem; font-size: .82rem; color: #d3e2ef; }
.auth-features .icon { color: #7fb2dc; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: min(390px, 100%); }
.auth-card h1 { font-size: 1.4rem; }
.demo-accounts { margin-top: 1.1rem; background: #f7fafd; border: 1px solid var(--line); border-radius: 11px; padding: .75rem .9rem; font-size: .74rem; color: var(--muted); }
.demo-accounts b { color: var(--navy-700); }
.demo-accounts .row { font-family: ui-monospace, Menlo, monospace; direction: ltr; justify-content: space-between; font-size: .7rem; padding: .12rem 0; }

/* ---------------- admin ---------------- */
.admin-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-end: 0; width: 264px; z-index: 60;
  background: linear-gradient(180deg, var(--navy-950), var(--navy-900) 60%, #0d2740);
  color: #c9d8e6; display: flex; flex-direction: column; overflow-y: auto;
  border-inline-start: 1px solid rgba(255,255,255,.06); scrollbar-width: thin;
}
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1.05rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); position: sticky; top: 0; background: var(--navy-950); z-index: 2; }
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.1); box-shadow: none; }
.sidebar-brand strong { color: #fff; font-size: .84rem; display: block; line-height: 1.6; }
.sidebar-brand span { color: #8fa8c0; font-size: .65rem; display: block; }
.sidebar-user { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-100); color: var(--navy-800); display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: 0 0 auto; }
.sidebar-user .avatar { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-user strong { display: block; color: #fff; font-size: .78rem; line-height: 1.6; }
.sidebar-user span { display: block; color: #8fa8c0; font-size: .66rem; }
.nav-scroll { flex: 1; padding: .7rem .6rem 1rem; }
.nav-group-label { font-size: .62rem; color: #6f89a2; padding: .7rem .6rem .25rem; letter-spacing: .3px; }
.nav-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: 9px; color: #c9d8e6; font-size: .79rem; font-weight: 500; margin-bottom: 1px; border: 1px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(60, 130, 196, .2); border-color: rgba(120, 175, 220, .25); color: #fff; font-weight: 700; }
.nav-item .icon { width: 17px; height: 17px; color: #8fb0cb; }
.nav-item.active .icon { color: #7fb9e6; }
.nav-item .count { margin-inline-start: auto; background: rgba(255,255,255,.1); border-radius: 6px; padding: 0 .4rem; font-size: .65rem; color: #d8e6f2; }
.sidebar-foot { padding: .8rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .btn { color: #d6e3ef; }
.admin-main { margin-inline-end: 264px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 45; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 0 1.2rem; height: 62px; display: flex; align-items: center; gap: .9rem; }
.topbar .page-title { font-size: .95rem; font-weight: 700; color: var(--navy-800); margin: 0; }
.topbar .crumb { font-size: .68rem; color: var(--muted); display: block; line-height: 1.5; }
.topbar-search { margin-inline-start: auto; display: flex; align-items: center; gap: .4rem; background: #f3f7fb; border: 1px solid var(--line); border-radius: 9px; padding: .28rem .55rem; width: 250px; }
.topbar-search input { border: 0; background: transparent; font-family: inherit; outline: none; width: 100%; font-size: .78rem; padding: .2rem; }
.topbar-search .icon { color: var(--muted); width: 16px; height: 16px; }
.topbar-actions { display: flex; align-items: center; gap: .35rem; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--navy-700); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--blue-50); }
.icon-btn .dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.admin-content { padding: 1.3rem 1.2rem 2rem; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.28rem; margin: 0; }
.page-head p { margin: .1rem 0 0; color: var(--muted); font-size: .78rem; }
.page-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.mobile-menu-btn { display: none; }

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; inset-block-start: 0; inset-inline-end: 0; width: 4px; height: 100%; background: var(--blue-500); opacity: .8; }
.stat.green::after { background: var(--green); } .stat.amber::after { background: var(--amber); } .stat.red::after { background: var(--red); } .stat.violet::after { background: var(--violet); } .stat.gray::after { background: var(--gray); } .stat.teal::after { background: var(--teal); }
.stat .label { font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; }
.stat b { display: block; font-size: 1.45rem; color: var(--navy-800); line-height: 1.7; }
.stat .sub { font-size: .66rem; color: var(--muted-2); }
.stat .icon { position: absolute; inset-inline-start: .8rem; inset-block-start: .75rem; width: 22px; height: 22px; color: #c1d3e4; }

.chart-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: .9rem; margin-bottom: 1rem; }
.chart-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-bottom: 1rem; }
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.chart-box h3 { font-size: .88rem; margin: 0 0 .2rem; display: flex; align-items: center; gap: .4rem; }
.chart-box .chart-sub { font-size: .68rem; color: var(--muted); margin-bottom: .6rem; }
.chart-box svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin-top: .5rem; font-size: .68rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .85rem .95rem; margin-bottom: .9rem; }
.filter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .55rem; align-items: end; }
.filter-grid .field > label { font-size: .7rem; }
.filter-grid .input, .filter-grid .select { min-height: 38px; padding: .32rem .6rem; font-size: .78rem; }
.filter-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .78rem; min-width: 900px; }
.data-table th, .data-table td { padding: .55rem .65rem; text-align: start; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.data-table thead th { background: #f8fbfe; font-size: .7rem; font-weight: 700; color: var(--muted); white-space: nowrap; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line-strong); }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .actions { white-space: nowrap; }
.data-table a.row-link { font-weight: 700; color: var(--navy-800); }
.table-empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.table-empty .icon { width: 38px; height: 38px; color: var(--line-strong); display: block; margin: 0 auto .5rem; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .9rem; border-top: 1px solid var(--line); background: #fbfcfe; font-size: .74rem; color: var(--muted); flex-wrap: wrap; }
.pagination { display: flex; align-items: center; gap: .25rem; }
.pagination a, .pagination span { min-width: 30px; height: 30px; padding: 0 .4rem; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-size: .74rem; color: var(--navy-700); }
.pagination a:hover { border-color: var(--blue-500); }
.pagination .current { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.pagination .disabled { color: #bdc9d6; pointer-events: none; }

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tab { padding: .55rem .8rem; font-size: .8rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: 0; border-inline: 0; font-family: inherit; cursor: pointer; }
.tab:hover { color: var(--navy-700); }
.tab.active { color: var(--navy-800); border-bottom-color: var(--blue-600); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .2s ease; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1.2rem; }
.kv-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem 1.1rem; }
.kv > div, .kv-3 > div { min-width: 0; }
.kv dt, .kv-3 dt { font-size: .7rem; color: var(--muted); margin: 0 0 .1rem; }
.kv dd, .kv-3 dd { font-size: .82rem; margin: 0; font-weight: 600; color: var(--navy-800); word-break: break-word; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.detail-aside { display: grid; gap: .9rem; position: sticky; top: 76px; }
.info-list { display: grid; gap: .45rem; font-size: .78rem; }
.info-list .row { justify-content: space-between; border-bottom: 1px dashed #eef3f8; padding-bottom: .35rem; }
.info-list .row:last-child { border: 0; }
.info-list span { color: var(--muted); }
.info-list b { font-weight: 700; color: var(--navy-800); text-align: end; }
.doc-status-list { display: grid; gap: .5rem; }
.mini-doc { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--line); border-radius: 9px; padding: .45rem .55rem; font-size: .76rem; }
.mini-doc .doc-icon { width: 30px; height: 30px; border-radius: 8px; }
.mini-doc strong { display: block; font-size: .75rem; line-height: 1.6; }
.mini-doc span { font-size: .66rem; color: var(--muted); }
.mini-doc .badge { margin-inline-start: auto; }
.note { background: #fbfdff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; font-size: .78rem; margin-bottom: .5rem; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .68rem; margin-bottom: .2rem; }
.note p { margin: 0; color: var(--ink); line-height: 1.95; }

.tree { font-size: .84rem; }
.tree-node { border: 1px solid var(--line); border-radius: 10px; margin-bottom: .45rem; background: #fff; }
.tree-head { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; flex-wrap: wrap; }
.tree-head strong { color: var(--navy-800); }
.tree-head .icon { color: var(--blue-600); }
.tree-children { padding: 0 .7rem .55rem 2rem; }
.tree-child { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: 7px; font-size: .79rem; }
.tree-child:hover { background: var(--blue-50); }
.tree-child .actions { margin-inline-start: auto; display: flex; gap: .25rem; }
.tree-actions { margin-inline-start: auto; display: flex; gap: .25rem; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 26, 44, .55); backdrop-filter: blur(3px); }
.modal-panel { position: relative; background: #fff; width: min(900px, calc(100% - 1.5rem)); margin: 3vh auto; border-radius: 16px; box-shadow: var(--shadow-lg); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: .92rem; }
.modal-body { padding: 1rem; overflow: auto; }
.modal-body img { max-width: 100%; border-radius: 10px; display: block; margin: 0 auto; }
.modal-body iframe { width: 100%; height: 70vh; border: 0; border-radius: 8px; background: #f3f7fb; }
.modal-foot { padding: .7rem 1rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .5rem; background: #fbfcfe; }

.toast-wrap { position: fixed; inset-block-start: 1rem; inset-inline-start: 1rem; z-index: 200; display: grid; gap: .5rem; max-width: 360px; }
.toast { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue-500); border-radius: 10px; box-shadow: var(--shadow); padding: .65rem .85rem; font-size: .8rem; display: flex; align-items: flex-start; gap: .5rem; animation: toastIn .25s ease; }
.toast.success { border-inline-start-color: var(--green); }
.toast.error { border-inline-start-color: var(--red); }
.toast.warn { border-inline-start-color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 20%, #eaf3fb, #f7fafd 50%, #eef4fa); padding: 1.5rem; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1.7rem; }
.login-card .brand { justify-content: center; margin-bottom: 1.1rem; }
.login-card h1 { font-size: 1.22rem; text-align: center; margin-bottom: .2rem; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .78rem; margin-bottom: 1.3rem; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { width: 42px; height: 42px; color: #c2d2e1; margin-bottom: .5rem; }
.empty b { display: block; color: var(--navy-700); margin-bottom: .2rem; }
.empty p { font-size: .8rem; margin: 0; }

.print-page { background: #fff; color: #000; padding: 1.5rem; max-width: 900px; margin: 0 auto; }
.print-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--navy-800); padding-bottom: .8rem; margin-bottom: 1rem; }
.print-head h1 { font-size: 1.1rem; margin: 0; }
.print-head p { margin: 0; font-size: .7rem; color: #555; }
.print-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; font-size: .72rem; margin-bottom: .9rem; }
.print-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.print-table th, .print-table td { border: 1px solid #bbb; padding: .35rem .45rem; text-align: start; }
.print-table th { background: #f1f3f5; width: 30%; }
.print-sign { display: flex; justify-content: space-between; margin-top: 3rem; font-size: .75rem; }
.print-note { margin-top: 1rem; font-size: .68rem; color: #444; border-top: 1px dashed #999; padding-top: .5rem; line-height: 2; }
.print-only { display: none; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-grid { grid-template-columns: repeat(4, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .hero-panel { display: none; }
  .wizard-layout { grid-template-columns: 1fr; }
  .wizard-aside { position: static; order: -1; grid-template-columns: 1fr; }
  .wizard-aside .summary-card { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .sidebar { transform: translateX(100%); transition: .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .admin-main { margin-inline-end: 0; }
  .mobile-menu-btn { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(8,26,44,.5); z-index: 55; display: none; }
  .sidebar-backdrop.open { display: block; }
  .chart-grid, .chart-grid-2 { grid-template-columns: 1fr; }
  .auth-body { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .container, .container-narrow { width: calc(100% - 1.6rem); }
  .hero { padding: 2.2rem 0; }
  .hero h1 { font-size: 1.55rem; }
  .hero-lead { font-size: .9rem; }
  .hero-stats { gap: .4rem; }
  .site-nav { display: none; position: absolute; top: 72px; inset-inline: 0; background: #fff; border-bottom: 1px solid var(--line); padding: .6rem .8rem; flex-direction: column; align-items: stretch; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .65rem .8rem; }
  .menu-toggle { display: grid; }
  .header-actions .btn span { display: none; }
  .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: span 1; }
  .form-grid .span-2-mobile { grid-column: span 1; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .cat-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .kv, .kv-3 { grid-template-columns: 1fr; }
  .cat-children { grid-template-columns: 1fr; }
  .steps-bar { display: none; }
  .wizard-head h1 { font-size: 1.2rem; }
  .wizard-aside { order: -1; }
  .step-item .bubble { width: 29px; height: 29px; }
  .topbar-search { display: none; }
  .admin-content { padding: 1rem .8rem 1.5rem; }
  .page-head h1 { font-size: 1.1rem; }
  .review-grid { grid-template-columns: 1fr; }
  .review-grid .full { grid-column: span 1; }
  .doc-actions { width: 100%; justify-content: flex-end; }
  .print-meta { grid-template-columns: 1fr; }
  .modal-panel { margin: 1.5vh auto; max-height: 97vh; }
  .auth-panel { padding: 1rem; }
  .site-footer .brand { margin-bottom: .5rem; }
  .track-form { flex-direction: column; }
}
@media (max-width: 420px) {
  .feature-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .no-print, .site-header, .site-footer, .toast-wrap, .sidebar-backdrop, .wizard-aside { display: none !important; }
  .admin-main { margin: 0 !important; }
  .admin-content { padding: 0 !important; }
  .card { border: 0 !important; box-shadow: none !important; }
  .print-page { padding: 0; max-width: none; }
  .print-only { display: block; }
  .detail-grid { grid-template-columns: 1fr !important; }
  .detail-aside { display: none !important; }
  .data-table { min-width: 0; font-size: 8pt; }
  .data-table th, .data-table td { padding: 3px 4px; }
  a { color: #000; text-decoration: none; }
  @page { size: A4; margin: 12mm; }
}

/* charts (HTML) */
.bars { display: grid; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 64px; gap: .5rem; align-items: center; font-size: .72rem; }
.bar-label { color: var(--navy-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 9px; background: #eef3f8; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.bar-value { font-variant-numeric: tabular-nums; color: var(--muted); text-align: start; font-weight: 700; white-space: nowrap; }
.columns { display: flex; align-items: flex-end; gap: .5rem; height: 190px; padding-top: 1.1rem; border-bottom: 1px solid var(--line); }
.col-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: .25rem; min-width: 0; }
.col-value { font-size: .64rem; color: var(--muted); font-weight: 700; }
.col-track { flex: 1; width: 100%; max-width: 38px; display: flex; align-items: flex-end; background: #f4f8fc; border-radius: 7px 7px 0 0; }
.col-bar { width: 100%; border-radius: 7px 7px 0 0; min-height: 3px; transition: height .6s; }
.col-label { font-size: .64rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.donut-wrap { margin: 0 auto .5rem; }
.chart-legend span { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .bar-row { grid-template-columns: 92px 1fr 54px; } }

/* faq */
.faq details { border-bottom: 1px solid var(--line); padding: .35rem 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--navy-800); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.1rem; color: var(--blue-600); font-weight: 400; }
.faq details[open] summary::after { content: '−'; }
.faq p { font-size: .78rem; color: var(--muted); margin: .2rem 0 .55rem; line-height: 2; }

/* permission & multiselect grids */
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .6rem; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; max-height: 280px; overflow: auto; background: #fbfdff; }
.permission-grid .check { font-size: .74rem; align-items: center; }
.permission-grid .check input { margin-top: 0; width: 16px; height: 16px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .2rem .6rem; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .6rem; background: #fbfdff; }
.check-grid .check { font-size: .78rem; }

/* jalali date picker */
.jalali-picker { position: absolute; z-index: 300; width: 272px; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .55rem; direction: rtl; }
.jp-head { display: flex; align-items: center; justify-content: space-between; gap: .3rem; margin-bottom: .35rem; }
.jp-head strong { font-size: .82rem; color: var(--navy-800); }
.jp-nav { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--navy-700); cursor: pointer; font-size: 1rem; line-height: 1; display: grid; place-items: center; font-family: inherit; }
.jp-nav:hover { background: var(--blue-50); }
.jp-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 2px; }
.jp-week span { text-align: center; font-size: .65rem; color: var(--muted); padding: .15rem 0; }
.jp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jp-day, .jp-empty { aspect-ratio: 1; display: grid; place-items: center; border-radius: 7px; border: 0; background: transparent; font-family: inherit; font-size: .74rem; color: var(--ink); cursor: pointer; }
.jp-day:hover { background: var(--blue-50); }
.jp-day.today { box-shadow: inset 0 0 0 1px var(--blue-500); }
.jp-day.selected { background: var(--navy-800); color: #fff; font-weight: 700; }
.jp-foot { display: flex; justify-content: space-between; gap: .4rem; margin-top: .45rem; border-top: 1px solid var(--line); padding-top: .4rem; }
.jp-foot button { border: 0; background: none; font-family: inherit; font-size: .7rem; color: var(--blue-600); cursor: pointer; padding: .15rem .2rem; }
.jp-foot button:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .permission-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .wizard-aside { order: 2; }
}
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .filter-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr !important; }
  .chart-grid, .chart-grid-2 { grid-template-columns: 1fr !important; }
  .stat-grid[style] { gap: .55rem; }
  .landing-two { grid-template-columns: 1fr !important; }
  .data-table { font-size: .74rem; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr !important; }
  .filter-grid { grid-template-columns: 1fr !important; }
}

/* brand mark inside dark sidebar must stay centered */
.sidebar-brand .brand-mark, .sidebar-user .avatar { display: grid; place-items: center; font-size: initial; }
.sidebar-brand .brand-mark { color: #fff; }
.sidebar-user .avatar { color: #fff; font-size: .85rem; }
.sidebar-user > span:not(.avatar) { display: block; }
.review-grid dd { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .brand-text span { display: none; }
  .brand-text strong { font-size: .84rem; max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* hero credit line */
.hero-credit { margin-top: 1.1rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.hero-credit b { color: var(--navy-700); }
.hero-credit .icon { color: var(--blue-600); width: 1.05em; height: 1.05em; }
