/* =============================================================================
   سبک سامانه — فونت محلی Vazirmatn، رنگ‌ها از تنظیمات سایت (/branding/theme.css)، بدون CDN.
   ============================================================================= */
@font-face { font-family: "Vazirmatn"; src: url("../vendor/vazirmatn/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../vendor/vazirmatn/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap; }

:root {
  /* مقادیر پیش‌فرض؛ theme.css (تنظیمات مدیر) آن‌ها را بازنویسی می‌کند */
  --ffc-primary: #0b4f8a;
  --ffc-accent: #f2a900;
  --ffc-sidebar: #0d2847;
  --ffc-bg: #f3f5f9;
  --ffc-surface: #ffffff;
  --ffc-border: #e4e8ef;
  --ffc-text: #1d2433;
  --ffc-muted: #6b7486;
  --ffc-radius: 14px;
  --ffc-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --ffc-sidebar-w: 16.5rem;
  --bs-body-font-family: "Vazirmatn", Tahoma, sans-serif;
  --bs-body-bg: var(--ffc-bg);
  --bs-body-color: var(--ffc-text);
  --bs-border-color: var(--ffc-border);
  --bs-border-radius: 10px;
  --bs-primary: var(--ffc-primary);
  --bs-link-color: var(--ffc-primary);
}

html { font-size: 15px; }
body.app { background: var(--ffc-bg); min-height: 100vh; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.xsmall { font-size: .72rem; }
.min-w-0 { min-width: 0; }
[dir="ltr"] { unicode-bidi: isolate; }
.text-break { word-break: break-word; }
.skip-link { position: absolute; inset-inline-start: -999px; top: 0; z-index: 2000; background: #fff; padding: .5rem 1rem; }
.skip-link:focus { inset-inline-start: 1rem; }

/* نماد */
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; vertical-align: -.2em; flex-shrink: 0; }

/* ---------------------------------------------------------------- منوی کناری (سمت راست) */
.sidebar { background: var(--ffc-sidebar); color: rgba(255, 255, 255, .78); width: var(--ffc-sidebar-w); }
.sidebar.offcanvas-lg { --bs-offcanvas-width: var(--ffc-sidebar-w); --bs-offcanvas-bg: var(--ffc-sidebar);
  /* Bootstrap در lg به بالا پس‌زمینه offcanvas-lg را با !important شفاف می‌کند */
  background-color: var(--ffc-sidebar) !important; }
@media (min-width: 992px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; display: flex; flex-direction: column; z-index: 1030; }
  .main-wrap { margin-inline-start: var(--ffc-sidebar-w); }
  .main-wrap.no-sidebar { margin-inline-start: 0; }
}
.sidebar { display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-link { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none !important; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ffc-accent), #ff7a00); color: #fff; font-size: 1.3rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { font-size: .72rem; color: rgba(255, 255, 255, .7); }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: .5rem .6rem 1rem; scrollbar-width: thin; }
.nav-group-title { font-size: .7rem; font-weight: 700; letter-spacing: .02em; color: rgba(255, 255, 255, .66);
  padding: 1rem .7rem .35rem; }
.side-link { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; margin: 1px 0; border-radius: 10px;
  color: rgba(255, 255, 255, .78); font-size: .92rem; text-decoration: none !important; transition: background .15s, color .15s; }
.side-link .ic { opacity: .85; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700;
  box-shadow: inset -3px 0 0 var(--ffc-accent); }
.sidebar-foot { padding: .8rem 1rem; border-top: 1px solid rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .5); }

/* ---------------------------------------------------------------- نوار بالا */
.main-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1.5rem; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--ffc-border); }
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.topbar-sub { font-size: .75rem; color: var(--ffc-muted); }
.btn-icon { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--ffc-border);
  background: #fff; color: var(--ffc-text); }
.btn-icon:hover { background: var(--ffc-bg); }
.badge-dot { position: absolute; top: -4px; inset-inline-end: -4px; background: #e5484d; color: #fff; border-radius: 999px;
  font-size: .65rem; padding: .05rem .38rem; }
.user-chip { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--ffc-border); background: #fff;
  border-radius: 999px; padding: .25rem .35rem .25rem .8rem; }
.user-chip::after { margin-inline-start: .2rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  color: #fff; background: linear-gradient(135deg, var(--ffc-primary), var(--ffc-sidebar)); }
.dropdown-item .ic { margin-inline-end: .35rem; opacity: .7; }

/* ---------------------------------------------------------------- محتوا */
.content { flex: 1 0 auto; padding: 1.5rem; max-width: 1440px; width: 100%; margin-inline: auto; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.page-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-head .lead-sub { color: var(--ffc-muted); font-size: .85rem; margin-top: .2rem; }
h1.h4 { font-weight: 700; }

.card { border: 1px solid var(--ffc-border); border-radius: var(--ffc-radius); box-shadow: var(--ffc-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--ffc-border); font-weight: 700; padding: .85rem 1.1rem; }
.card-header:first-child { border-radius: var(--ffc-radius) var(--ffc-radius) 0 0; }
.card-footer { background: #fafbfd; }
.card.card-body, .card > .card-body { padding: 1.1rem 1.25rem; }

/* نوار فیلتر فشرده (D-110) */
.card.card-body.filter-bar { padding: .6rem .75rem; }
.filter-bar .form-label { font-size: .75rem; color: var(--ffc-muted); margin-bottom: .15rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; display: block; }
.filter-bar .form-control, .filter-bar .form-select { padding-top: .3rem; padding-bottom: .3rem; font-size: .85rem;
  min-height: calc(1.5em + .6rem + 2px); }
.filter-bar .btn-sm { padding-top: .35rem; padding-bottom: .35rem; white-space: nowrap; }
.filter-bar [class*="col-"] { min-width: 0; }
@media (min-width: 1200px) { .filter-bar .fb-wide { flex: 1.6 0 0; } }
.applicant-filter .idp-kinds { gap: .25rem; margin-bottom: .4rem; }
.applicant-filter .idp-kind span { padding: .2rem .6rem; font-size: .78rem; }
.applicant-filter .idp-hint { display: none; }
.applicant-filter .idp-preview { min-height: 0; margin-top: .2rem; font-size: .8rem; }
.applicant-filter .idp-preview:empty { display: none; }
.applicant-filter .plate { zoom: .8; }
.filter-bar details.filter-more { margin-top: .5rem; border-top: 1px dashed var(--ffc-border); padding-top: .4rem; }
.filter-bar details.filter-more > summary { font-size: .8rem; color: var(--ffc-primary); cursor: pointer; width: max-content; }

.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--ffc-primary); --bs-btn-border-color: var(--ffc-primary);
  --bs-btn-hover-bg: var(--ffc-sidebar); --bs-btn-hover-border-color: var(--ffc-sidebar);
  --bs-btn-active-bg: var(--ffc-sidebar); --bs-btn-disabled-bg: var(--ffc-primary); }
.btn-outline-primary { --bs-btn-color: var(--ffc-primary); --bs-btn-border-color: var(--ffc-primary);
  --bs-btn-hover-bg: var(--ffc-primary); --bs-btn-hover-border-color: var(--ffc-primary); }
.btn .ic { margin-inline-end: .25rem; }
.form-control, .form-select { border-radius: 10px; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--ffc-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15); }
.form-label { font-weight: 500; font-size: .9rem; }

/* جدول‌ها */
.table-responsive.card, .card > .table-responsive { overflow: auto; }
.table { margin-bottom: 0; }
.table > thead th { background: #f7f9fc; color: var(--ffc-muted); font-size: .8rem; font-weight: 700; white-space: nowrap;
  border-bottom-color: var(--ffc-border); padding: .7rem .75rem; }
.table > tbody td { padding: .65rem .75rem; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f4f7fc; }
.badge { font-weight: 500; border-radius: 999px; padding: .38em .7em; }

/* اطلاعیه */
.announce { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; margin-bottom: .6rem;
  border: 1px solid; background: #fff; }
.announce > .ic { margin-top: .15rem; font-size: 1.15rem; }
.announce-info { border-color: #b6d4fe; background: #eef5ff; color: #0b3a75; }
.announce-success { border-color: #a3e3c1; background: #ecfbf3; color: #0d5c35; }
.announce-warning { border-color: #ffd98a; background: #fff8e6; color: #6b4b00; }
.announce-danger { border-color: #f5b3b5; background: #fff0f0; color: #7d1a1d; }
.alert { border-radius: 12px; }

/* شاخص‌ها */
.kpi { border: 1px solid var(--ffc-border); height: 100%; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--ffc-primary); }
.kpi-label { font-size: .78rem; color: var(--ffc-muted); }
.kpi-value { font-size: 1.45rem; font-weight: 700; margin-top: .2rem; }
.kpi-sub { font-size: .74rem; color: var(--ffc-muted); }
.chart-box { position: relative; height: 280px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
  background: rgba(var(--bs-primary-rgb), .1); color: var(--ffc-primary); }

/* پاورقی */
.site-footer { margin-top: auto; background: #fff; border-top: 1px solid var(--ffc-border); color: var(--ffc-muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; padding: 1.5rem; max-width: 1440px; margin-inline: auto; }
.footer-brand { color: var(--ffc-text); font-weight: 700; margin-bottom: .4rem; }
.footer-title { color: var(--ffc-text); font-weight: 700; font-size: .85rem; margin-bottom: .5rem; }
.site-footer a { color: var(--ffc-muted); }
.site-footer a:hover { color: var(--ffc-primary); }
.footer-contact li { display: flex; gap: .4rem; align-items: center; margin-bottom: .3rem; }
.footer-bottom { border-top: 1px solid var(--ffc-border); padding: .8rem 1.5rem; font-size: .78rem; text-align: center; }
@media (max-width: 767.98px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- صفحه ورود */
body.auth { background: var(--ffc-bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 110% -10%, rgba(255, 255, 255, .14), transparent 60%),
              linear-gradient(150deg, var(--ffc-primary), var(--ffc-sidebar)); overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; inset-inline-end: -140px;
  bottom: -160px; background: rgba(255, 255, 255, .06); }
.auth-hero h1 { font-size: 2rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.auth-hero p { color: rgba(255, 255, 255, .8); max-width: 34rem; }
.auth-features { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.auth-features li { display: flex; gap: .6rem; align-items: center; margin-bottom: .7rem; }
.auth-features .ic { background: rgba(255, 255, 255, .16); border-radius: 50%; padding: .2rem; width: 1.6em; height: 1.6em; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; border: 0; box-shadow: 0 10px 40px rgba(16, 24, 40, .10); }
.auth-card .card-body { padding: 2rem; }
.auth-links { margin-top: 1.5rem; font-size: .8rem; color: var(--ffc-muted); display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: center; }
.auth-links a { color: var(--ffc-muted); }
.auth-hero .announce { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }
@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 1.75rem 1.5rem; }
  .auth-hero h1 { font-size: 1.4rem; margin-top: 1rem; }
  .auth-features { display: none; }
}

/* ---------------------------------------------------------------- اجزای موجود */
/* فهرست جست‌وجوپذیر چندانتخابی (D-096) */
.ss-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.ss-chips:empty { display: none; }
.ss-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .25rem .15rem .6rem; border-radius: 999px;
  background: var(--ffc-bg, #eef2f7); border: 1px solid var(--ffc-border, #d6dde6); font-size: .85rem; }
.ss-chip-x { border: 0; background: transparent; color: inherit; width: 1.4rem; height: 1.4rem; line-height: 1; border-radius: 50%;
  font-size: 1rem; padding: 0; }
.ss-chip-x:hover, .ss-chip-x:focus-visible { background: rgba(220, 53, 69, .15); color: #dc3545; }
.org-picker-list { position: absolute; z-index: 1050; inset-inline: 0; max-height: 260px; overflow-y: auto;
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12); }
.progress { height: 1.25rem; }
.table-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #dee2e6; padding: .5rem; }
.pwt-datepicker { font-family: "Vazirmatn", Tahoma, sans-serif; }
.prose p { line-height: 2; margin-bottom: 1rem; }

/* جدول ریسپانسیو: در عرض کمتر از ۵۷۶ پیکسل هر ردیف به کارت تبدیل می‌شود */
@media (max-width: 575.98px) {
  .content { padding: 1rem .75rem; }
  .topbar { padding: .6rem .75rem; }
  .responsive-table thead { display: none; }
  .responsive-table tr { display: block; border-bottom: 1px solid var(--ffc-border); padding: .5rem 0; }
  .responsive-table td { display: flex !important; justify-content: space-between; gap: 1rem; border: 0; }
  .responsive-table td::before { content: attr(data-label); font-weight: 700; color: var(--ffc-muted); }
}

@media print {
  .sidebar, .topbar, .site-footer, .btn, form { display: none !important; }
  .main-wrap { margin: 0 !important; }
}
.auth-hero-foot { position: relative; z-index: 1; }

/* کارت خوشامد و دسترسی سریع */
.hero-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #fff; border-radius: 18px;
  padding: 1.5rem 1.75rem; background: radial-gradient(800px 300px at 0% 0%, rgba(255, 255, 255, .15), transparent 60%),
  linear-gradient(135deg, var(--ffc-primary), var(--ffc-sidebar)); box-shadow: var(--ffc-shadow); }
.hero-icon { font-size: 2.8rem; opacity: .35; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.quick-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center;
  padding: 1.1rem .5rem; border-radius: 12px; border: 1px solid var(--ffc-border); color: var(--ffc-text); font-size: .88rem;
  background: #fff; text-decoration: none !important; transition: transform .12s, box-shadow .12s, border-color .12s; }
.quick-tile .ic { font-size: 1.5rem; color: var(--ffc-primary); }
.quick-tile:hover { transform: translateY(-2px); border-color: var(--ffc-primary); box-shadow: var(--ffc-shadow); }

/* شاخص با نماد */
.kpi .kpi-ic { position: absolute; inset-inline-end: 1rem; top: 1rem; color: var(--ffc-primary); opacity: .18; font-size: 2rem; }
.kpi-green::before { background: #1f9d55; } .kpi-amber::before { background: var(--ffc-accent); }
.kpi-red::before { background: #e5484d; } .kpi-violet::before { background: #7c5cff; } .kpi-teal::before { background: #0ea5a4; }

/* ---------------------------------------------------------------- ورودی ساختاریافته پلاک (D-064) */
.idp { margin-bottom: .5rem; }
.idp-kinds { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.idp-kind { position: relative; cursor: pointer; }
.idp-kind input { position: absolute; opacity: 0; pointer-events: none; }
.idp-kind span { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .85rem; border-radius: 999px;
  border: 1px solid var(--ffc-border); background: #fff; font-size: .88rem; transition: all .12s; }
.idp-kind input:checked + span { background: var(--ffc-primary); border-color: var(--ffc-primary); color: #fff; }
.idp-kind input:focus-visible + span { outline: 3px solid rgba(var(--bs-primary-rgb), .3); }
.idp-panel { margin-bottom: .35rem; }
.idp.js-ready .idp-panel { display: none; }
.idp.js-ready .idp-panel.active { display: block; }
.idp-hint { font-size: .78rem; color: var(--ffc-muted); margin-top: .45rem; }
.idp-preview { min-height: 1.6rem; margin-top: .4rem; font-weight: 700; color: var(--ffc-primary); }
.idp-preview.bad { color: #b42318; font-weight: 500; }

.plate { display: inline-flex; align-items: stretch; gap: .35rem; border: 3px solid #1d2433; border-radius: 10px;
  background: #fff; padding: .35rem; box-shadow: inset 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .08); max-width: 100%; }
.plate .idp-box { width: 3.2rem; text-align: center; font-size: 1.45rem; font-weight: 700; letter-spacing: .08em;
  border: 1px dashed #c3cad6; border-radius: 6px; padding: .2rem .1rem; background: #fbfcfe; font-family: inherit; }
.plate .idp-box[data-len="3"] { width: 4.2rem; }
.plate .idp-box[data-len="5"], .plate .idp-box[data-len="6"] { width: 6.6rem; }
.plate .idp-box[data-len="10"] { width: 13rem; letter-spacing: .25em; }
.plate .idp-wide { width: 11rem; font-size: 1.2rem; }
.plate .idp-box:focus { outline: none; border-style: solid; border-color: var(--ffc-primary); background: #fff;
  box-shadow: 0 0 0 .18rem rgba(var(--bs-primary-rgb), .15); }
.plate .idp-box.is-invalid, .plate select.is-invalid { border-color: #dc3545; background: #fff5f5; }
.plate select[name$="idp_letter"] { width: 5.4rem; font-size: 1.25rem; font-weight: 700; text-align: center;
  border: 1px dashed #c3cad6; border-radius: 6px; background: #fbfcfe; padding: 0 .2rem; }
.plate-flag { width: 2.3rem; border-radius: 5px; background: #1d4fbf; color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between; padding: .2rem 0; font-size: .5rem; font-weight: 700; line-height: 1.1; text-align: center; }
.flag-strip { width: 1.3rem; height: .9rem; border-radius: 2px; background: linear-gradient(#239f40 33%, #fff 33% 66%, #da0000 66%); }
.plate-region { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  border-inline-start: 3px solid #1d2433; padding-inline-start: .35rem; font-size: .72rem; font-weight: 700; }
.plate-moto { flex-direction: column; align-items: center; }
.plate-moto .moto-row + .moto-row { border-top: 2px solid #1d2433; padding-top: .3rem; }
.plate-fz, .plate-foreign { align-items: center; flex-wrap: wrap; }
.plate-fz select, .plate-foreign select { width: auto; min-width: 11rem; }
@media (max-width: 575.98px) {
  .plate .idp-box { width: 2.6rem; font-size: 1.15rem; }
  .plate .idp-box[data-len="3"] { width: 3.4rem; }
  .plate select[name$="idp_letter"] { width: 4.4rem; font-size: 1rem; }
  .plate .idp-box[data-len="10"] { width: 100%; }
}

/* نمایش/پنهان کردن رمز */
.pw-wrap { position: relative; }
/* فضای دکمه چشم در انتهای کادر رزرو می‌شود تا روی متن نیفتد؛ نماد خطای Bootstrap (is-invalid) هم حذف می‌شود تا با دکمه هم‌پوشانی نکند */
/* سامانه راست‌چین است؛ دکمه همیشه سمت چپ کادر (فیزیکی) تا چه رمز چپ‌چین تایپ شود چه راست‌چین، روی متن نیفتد */
.pw-wrap input, .pw-wrap input.form-control.is-invalid { padding-left: 2.75rem; padding-right: .75rem; background-image: none; }
.pw-wrap input::-ms-reveal, .pw-wrap input::-ms-clear { display: none; }
.pw-toggle { position: absolute; left: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  color: var(--ffc-muted, #6b7280); width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.pw-toggle .ic { width: 1.15rem; height: 1.15rem; }
.pw-toggle:hover, .pw-toggle:focus-visible { background: var(--ffc-bg); color: var(--ffc-primary); }
.pw-toggle .pw-hide, .pw-toggle.on .pw-show { display: none; }
.pw-toggle.on .pw-hide { display: inline-block; }

/* فرم تخصیص سهمیه */
.qf-section { border: 1px solid var(--ffc-border, #e5e7eb); border-radius: 12px; padding: .9rem 1rem 1rem; margin-bottom: 1rem; }
.qf-section legend { float: none; width: auto; font-size: .95rem; font-weight: 700; padding: 0 .4rem; margin-bottom: .4rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-group .btn { border-radius: 999px; min-width: 4.6rem; }
.quota-help { position: sticky; top: 5rem; }
.quota-help details { border: 1px solid var(--ffc-border, #e5e7eb); border-radius: 10px; padding: .5rem .75rem; margin-bottom: .5rem; }
.quota-help details summary { cursor: pointer; font-weight: 600; }
.quota-help details.active { border-color: var(--ffc-primary); background: var(--ffc-bg); }
.quota-help details p { margin: .4rem 0; }
.quota-help .example { color: var(--ffc-muted, #6b7280); border-inline-start: 3px solid var(--ffc-primary); padding-inline-start: .5rem; }

/* کارت آمار کوچک (جزئیات نامه) */
.stat-mini { background: var(--ffc-bg); border-radius: 10px; padding: .5rem .25rem; }
.stat-mini .v { font-weight: 700; font-size: 1.05rem; }
.stat-mini .l { color: var(--ffc-muted); font-size: .75rem; }

/* مراحل ثبت نامه‌محور */
.steps { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; }
.steps li { background: var(--ffc-bg); border: 1px solid var(--ffc-border); border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; color: var(--ffc-muted); }
.steps li.active { background: var(--ffc-primary); border-color: var(--ffc-primary); color: #fff; }
.steps li.done { border-color: var(--ffc-primary); }
.steps li.done a { color: var(--ffc-primary); text-decoration: none; }
.letter-card { border-inline-start: 4px solid var(--ffc-primary); }

/* کانال‌های دسترسی کاربر */
.ch-toggle, .ch-state { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem;
  border-radius: 8px; border: 1px solid var(--ffc-border); background: #fdecec; color: #b42318; font-weight: 700; }
.ch-toggle.on, .ch-state.on { background: #e7f6ec; color: #1a7f37; }
.ch-toggle:hover { border-color: var(--ffc-primary); }

/* گروه‌های جمع‌شونده منو */
details.nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  user-select: none; }
details.nav-group > summary::-webkit-details-marker { display: none; }
details.nav-group > summary:hover { color: rgba(255, 255, 255, .8); }
details.nav-group .nav-chev { width: .8rem; height: .8rem; transition: transform .15s; transform: rotate(90deg); opacity: .6; }
details.nav-group[open] .nav-chev { transform: rotate(-90deg); }

/* عرض نوار پیشرفت بدون style درون‌خطی (CSP) */
.progress-bar.pw-0 { width: 0%; }
.progress-bar.pw-1 { width: 1%; }
.progress-bar.pw-2 { width: 2%; }
.progress-bar.pw-3 { width: 3%; }
.progress-bar.pw-4 { width: 4%; }
.progress-bar.pw-5 { width: 5%; }
.progress-bar.pw-6 { width: 6%; }
.progress-bar.pw-7 { width: 7%; }
.progress-bar.pw-8 { width: 8%; }
.progress-bar.pw-9 { width: 9%; }
.progress-bar.pw-10 { width: 10%; }
.progress-bar.pw-11 { width: 11%; }
.progress-bar.pw-12 { width: 12%; }
.progress-bar.pw-13 { width: 13%; }
.progress-bar.pw-14 { width: 14%; }
.progress-bar.pw-15 { width: 15%; }
.progress-bar.pw-16 { width: 16%; }
.progress-bar.pw-17 { width: 17%; }
.progress-bar.pw-18 { width: 18%; }
.progress-bar.pw-19 { width: 19%; }
.progress-bar.pw-20 { width: 20%; }
.progress-bar.pw-21 { width: 21%; }
.progress-bar.pw-22 { width: 22%; }
.progress-bar.pw-23 { width: 23%; }
.progress-bar.pw-24 { width: 24%; }
.progress-bar.pw-25 { width: 25%; }
.progress-bar.pw-26 { width: 26%; }
.progress-bar.pw-27 { width: 27%; }
.progress-bar.pw-28 { width: 28%; }
.progress-bar.pw-29 { width: 29%; }
.progress-bar.pw-30 { width: 30%; }
.progress-bar.pw-31 { width: 31%; }
.progress-bar.pw-32 { width: 32%; }
.progress-bar.pw-33 { width: 33%; }
.progress-bar.pw-34 { width: 34%; }
.progress-bar.pw-35 { width: 35%; }
.progress-bar.pw-36 { width: 36%; }
.progress-bar.pw-37 { width: 37%; }
.progress-bar.pw-38 { width: 38%; }
.progress-bar.pw-39 { width: 39%; }
.progress-bar.pw-40 { width: 40%; }
.progress-bar.pw-41 { width: 41%; }
.progress-bar.pw-42 { width: 42%; }
.progress-bar.pw-43 { width: 43%; }
.progress-bar.pw-44 { width: 44%; }
.progress-bar.pw-45 { width: 45%; }
.progress-bar.pw-46 { width: 46%; }
.progress-bar.pw-47 { width: 47%; }
.progress-bar.pw-48 { width: 48%; }
.progress-bar.pw-49 { width: 49%; }
.progress-bar.pw-50 { width: 50%; }
.progress-bar.pw-51 { width: 51%; }
.progress-bar.pw-52 { width: 52%; }
.progress-bar.pw-53 { width: 53%; }
.progress-bar.pw-54 { width: 54%; }
.progress-bar.pw-55 { width: 55%; }
.progress-bar.pw-56 { width: 56%; }
.progress-bar.pw-57 { width: 57%; }
.progress-bar.pw-58 { width: 58%; }
.progress-bar.pw-59 { width: 59%; }
.progress-bar.pw-60 { width: 60%; }
.progress-bar.pw-61 { width: 61%; }
.progress-bar.pw-62 { width: 62%; }
.progress-bar.pw-63 { width: 63%; }
.progress-bar.pw-64 { width: 64%; }
.progress-bar.pw-65 { width: 65%; }
.progress-bar.pw-66 { width: 66%; }
.progress-bar.pw-67 { width: 67%; }
.progress-bar.pw-68 { width: 68%; }
.progress-bar.pw-69 { width: 69%; }
.progress-bar.pw-70 { width: 70%; }
.progress-bar.pw-71 { width: 71%; }
.progress-bar.pw-72 { width: 72%; }
.progress-bar.pw-73 { width: 73%; }
.progress-bar.pw-74 { width: 74%; }
.progress-bar.pw-75 { width: 75%; }
.progress-bar.pw-76 { width: 76%; }
.progress-bar.pw-77 { width: 77%; }
.progress-bar.pw-78 { width: 78%; }
.progress-bar.pw-79 { width: 79%; }
.progress-bar.pw-80 { width: 80%; }
.progress-bar.pw-81 { width: 81%; }
.progress-bar.pw-82 { width: 82%; }
.progress-bar.pw-83 { width: 83%; }
.progress-bar.pw-84 { width: 84%; }
.progress-bar.pw-85 { width: 85%; }
.progress-bar.pw-86 { width: 86%; }
.progress-bar.pw-87 { width: 87%; }
.progress-bar.pw-88 { width: 88%; }
.progress-bar.pw-89 { width: 89%; }
.progress-bar.pw-90 { width: 90%; }
.progress-bar.pw-91 { width: 91%; }
.progress-bar.pw-92 { width: 92%; }
.progress-bar.pw-93 { width: 93%; }
.progress-bar.pw-94 { width: 94%; }
.progress-bar.pw-95 { width: 95%; }
.progress-bar.pw-96 { width: 96%; }
.progress-bar.pw-97 { width: 97%; }
.progress-bar.pw-98 { width: 98%; }
.progress-bar.pw-99 { width: 99%; }
.progress-bar.pw-100 { width: 100%; }

/* مقایسه دوره‌ای داشبورد */
.cmp-box { border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: .9rem; height: 100%; }
.cmp-title { font-size: .85rem; color: var(--bs-secondary-color); }
.cmp-value { font-size: 1.5rem; font-weight: 700; }
.cmp-sub { font-size: .8rem; color: var(--bs-secondary-color); }
.chg { font-weight: 600; white-space: nowrap; }
.chg-up { color: #1b5e20; }
.chg-down { color: #b71c1c; }

/* عرض حداقل ستون‌های دارای فرم (بدون style درون‌خطی؛ CSP) */
.cell-wide { min-width: 15rem; }
.cell-mid { min-width: 9rem; }

.totp-secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; background: var(--bs-tertiary-bg); border-radius: .5rem; padding: .6rem .8rem; display: inline-block; user-select: all; }

/* ---------------------------------------------------------------- جست‌وجوی سراسری */
.search-results { max-height: 60vh; overflow-y: auto; }
.search-hint { padding: 1rem 1.25rem; color: var(--ffc-muted); font-size: .9rem; }
.search-group { padding: .6rem 1.25rem .25rem; font-size: .72rem; font-weight: 700; color: var(--ffc-muted); }
.search-item { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 1.25rem; color: var(--ffc-text);
  text-decoration: none !important; border-inline-start: 3px solid transparent; }
.search-item small { color: var(--ffc-muted); }
.search-item:hover, .search-item.active { background: var(--bs-tertiary-bg); border-inline-start-color: var(--ffc-primary); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--ffc-primary) 55%, white); outline-offset: 2px; }

/* ---------------------------------------------------------------- حالت تاریک (D-086) */
.theme-ic-light { display: none; }
[data-bs-theme="dark"] .theme-ic-light { display: inline; }
[data-bs-theme="dark"] .theme-ic-dark { display: none; }
[data-bs-theme="dark"] {
  --ffc-bg: #0f1520; --ffc-surface: #171f2c; --ffc-border: #2a3445; --ffc-text: #e6e9ef; --ffc-muted: #a3adbe;
  --ffc-shadow: 0 1px 2px rgba(0, 0, 0, .4); --bs-link-color: #8ab4f8; --bs-link-hover-color: #aecbfa;
  --bs-secondary-color: #a3adbe; --bs-tertiary-bg: #1e2836; color-scheme: dark;
}
[data-bs-theme="dark"] .card, [data-bs-theme="dark"] .modal-content, [data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .list-group { --bs-card-bg: var(--ffc-surface); --bs-modal-bg: var(--ffc-surface);
  --bs-dropdown-bg: var(--ffc-surface); --bs-list-group-bg: var(--ffc-surface); background-color: var(--ffc-surface); }
[data-bs-theme="dark"] .topbar { background: rgba(23, 31, 44, .92); }
[data-bs-theme="dark"] .btn-icon, [data-bs-theme="dark"] .user-chip, [data-bs-theme="dark"] .site-footer,
[data-bs-theme="dark"] .table-actions, [data-bs-theme="dark"] .skip-link, [data-bs-theme="dark"] .idp-kind span,
[data-bs-theme="dark"] .quick-link, [data-bs-theme="dark"] .ch-toggle { background: var(--ffc-surface); color: var(--ffc-text); }
[data-bs-theme="dark"] .card-footer, [data-bs-theme="dark"] .table > thead th, [data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > * { --bs-table-bg: #1c2533; background: #1c2533; color: var(--ffc-muted); }
[data-bs-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-color: var(--ffc-text); --bs-table-hover-bg: #1e2836; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #111926; border-color: #33405a;
  color: var(--ffc-text); }
[data-bs-theme="dark"] .announce-info { background: #10243f; color: #b6d4fe; border-color: #24467a; }
[data-bs-theme="dark"] .announce-success { background: #0e2a1d; color: #a3e3c1; border-color: #1e5a3c; }
[data-bs-theme="dark"] .announce-warning { background: #2e2408; color: #ffd98a; border-color: #5e4a12; }
[data-bs-theme="dark"] .announce-danger { background: #33141a; color: #f5b3b5; border-color: #6b2830; }
[data-bs-theme="dark"] .chg-up { color: #7bd88f; }
[data-bs-theme="dark"] .chg-down { color: #ff8a80; }
[data-bs-theme="dark"] .cmp-box { background: var(--ffc-surface); }
[data-bs-theme="dark"] .text-muted { color: var(--ffc-muted) !important; }

/* ---------------------------------------------------------------- پلاک در هر دو حالت روشن/تاریک (D-087)
   پلاک تصویر یک پلاک واقعی (زمینه سفید) است؛ رنگ متن و کادرهایش نباید از حالت تاریک ارث ببرد. */
.plate { color: #1d2433; color-scheme: light; }
.plate .idp-box, .plate select, .plate .form-select, .plate .form-control { color: #1d2433; background-color: #fbfcfe;
  border-color: #c3cad6; }
.plate .idp-box::placeholder { color: #9aa3b2; }
.plate select option { color: #1d2433; background: #fff; }
.idp-driver { margin-top: .6rem; padding: .6rem .8rem; border: 1px dashed var(--ffc-border); border-radius: 10px; }
.idp.js-ready .idp-driver .idp-driver-code { display: none; }
.idp.js-ready .idp-driver.with-code .idp-driver-code { display: block; margin-top: .5rem; }
[data-bs-theme="dark"] .idp-preview { color: #8ab4f8; }
[data-bs-theme="dark"] .idp-preview.bad { color: #ff8a80; }
[data-bs-theme="dark"] .idp-kind span { border-color: #33405a; }
[data-bs-theme="dark"] .idp-kind input:checked + span { background: var(--ffc-primary); color: #fff; }
/* حالت تاریک: اجزایی که رنگ ثابت روشن داشتند (D-087) */
[data-bs-theme="dark"] { --ffc-primary-text: #8ab4f8; }
[data-bs-theme="dark"] .quick-tile, [data-bs-theme="dark"] .announce { background: var(--ffc-surface); }
[data-bs-theme="dark"] .quick-tile .ic, [data-bs-theme="dark"] .stat-icon, [data-bs-theme="dark"] .text-primary,
[data-bs-theme="dark"] .steps li.done a, [data-bs-theme="dark"] .site-footer a:hover { color: var(--ffc-primary-text) !important; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--ffc-primary-text); --bs-btn-border-color: #4c7fc4;
  --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #c3cad6; --bs-btn-border-color: #4a556a; }
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #1e2836; --bs-table-hover-color: var(--ffc-text); }
[data-bs-theme="dark"] .ch-toggle, [data-bs-theme="dark"] .ch-state { background: #3a1a1d; color: #ff9b94; border-color: #5a2a2e; }
[data-bs-theme="dark"] .ch-toggle.on, [data-bs-theme="dark"] .ch-state.on { background: #133824; color: #7bd88f; border-color: #1e5a3c; }
[data-bs-theme="dark"] .steps li { background: var(--ffc-surface); }
[data-bs-theme="dark"] .steps li.active { background: var(--ffc-primary); color: #fff; }
[data-bs-theme="dark"] .stat-mini { background: #111926; }
[data-bs-theme="dark"] .form-check-input:not(:checked) { background-color: #111926; border-color: #4a556a; }
[data-bs-theme="dark"] .pwt-datepicker, [data-bs-theme="dark"] .pwt-datepicker * { color: #1d2433; }
[data-bs-theme="dark"] .org-picker-list { background: var(--ffc-surface); }
[data-bs-theme="dark"] .auth-card { background: var(--ffc-surface); }
/* رنگ‌های سیستمی (دکمه، ورودی، نوار پیمایش) از تم انتخابی پیروی کنند، نه از تنظیم سیستم‌عامل (D-087) */
:root, [data-bs-theme="light"] { color-scheme: light; }
[data-bs-theme="dark"] { color-scheme: dark; }
.user-chip { color: var(--ffc-text); }
/* پیوندها در حالت تاریک: theme.css رنگ پیوند را با رنگ اصلی (تیره) بازنویسی می‌کند؛ این‌جا روشن می‌شود (D-087) */
[data-bs-theme="dark"] a:not(.btn):not(.side-link):not(.dropdown-item):not(.search-item):not(.brand-link):not(.page-link) {
  color: var(--ffc-primary-text); }
[data-bs-theme="dark"] .page-link { --bs-pagination-color: var(--ffc-primary-text); }

/* مورد منوی غیرفعال (فقط برای مدیر سیستمی دیده می‌شود؛ D-089) */
.side-link.is-disabled { opacity: .6; }
.side-off { margin-inline-start: auto; font-size: .65rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  padding: 0 .4rem; }

/* فرم یکپارچه نامه (D-104): فشرده‌تر */
.form-compact .accordion-body { padding: .75rem; }
.form-compact .accordion-button { padding: .6rem .9rem; font-weight: 600; }
.form-compact .form-label { margin-bottom: .15rem; font-size: .85rem; }
.form-compact .form-control, .form-compact .form-select { padding-top: .25rem; padding-bottom: .25rem; font-size: .9rem; }
.form-compact .form-text { margin-top: .1rem; font-size: .78rem; }
.form-compact .qf-section { margin-bottom: .5rem; padding: .5rem .75rem; }
.form-compact .qf-section legend { font-size: .9rem; }
.form-compact .accordion-button:disabled { opacity: .55; }

/* کد یک‌بارمصرف: شش کادر جدا (ورود دومرحله‌ای و بازیابی رمز) */
.otp-boxes { display: flex; gap: .5rem; justify-content: center; }
.otp-box { width: 3rem; height: 3.4rem; padding: 0; text-align: center; font-size: 1.6rem; font-weight: 700;
           font-family: ui-monospace, Consolas, monospace; border-width: 2px; border-radius: .6rem; caret-color: transparent; }
.otp-box:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .2); }
.otp-box.filled { background: var(--bs-tertiary-bg); }
@media (max-width: 380px) { .otp-boxes { gap: .3rem; } .otp-box { width: 2.5rem; height: 3rem; font-size: 1.35rem; } }
