/* قالب دوم — افزونهٔ مستقل. هیچ قانون این فایل خارج از data-site-template=modern فعال نیست. */
html[data-site-template="modern"] {
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-card: 18px;
  --radius-lg: 24px;
  --motion-duration: 240ms;
  --motion-fast: 150ms;
  --motion-slow: 300ms;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-ease-out: cubic-bezier(.22, 1, .36, 1);
  --motion-spring: cubic-bezier(.22, 1, .36, 1);
  --sidebar-bg: #183d2e;
  --sidebar-fg: #f0f5eb;
  --sidebar-muted: #b2c7ac;
  --sidebar-hover: rgb(255 255 255 / .065);
  --sidebar-active: #e1ebd6;
  --sidebar-active-fg: #244d35;
  --sidebar-border: rgb(226 238 217 / .1);
  --noise: none;
}

/* قالب با رنگ شخصی کارکنان، تم تیره و هویت مستقل منوی کسب‌وکار اشتباه نمی‌شود. */
html[data-site-template="modern"]:not([data-brand-lock]):not([data-theme="night"]):not([data-theme="luxe"]) {
  --color-primary: #285d49;
  --color-primary-strong: #174733;
  --color-primary-soft: #e8efe2;
  --color-on-primary: #ffffff;
  --color-gold: #7b8d59;
  --color-gold-soft: #edf1e2;
  --color-accent: #2d4938;
  --color-accent-soft: #e9eee4;
  --color-on-accent: #ffffff;
  --color-bg: #f6f8f1;
  --color-bg-elevated: #ffffff;
  --color-surface: #ffffff;
  --color-surface-2: #f0f3e9;
  --color-surface-3: #e6ecdf;
  --color-text: #293d30;
  --color-text-muted: #66745e;
  --color-text-subtle: #78856f;
  --color-border: #e2e8da;
  --color-border-strong: #cbd6c0;
  --color-focus: #2d7051;
  --color-overlay: rgb(25 43 29 / .5);
  --grad-primary: #285d49;
  --grad-gold: #e7eddb;
  --grad-surface: #ffffff;
  --shadow-glow: 0 4px 11px rgb(27 70 45 / .09);
  --shadow-card: 0 2px 3px rgb(39 58 32 / .02), 0 14px 30px -24px rgb(39 58 32 / .18);
  --shadow-raised: 0 8px 22px -12px rgb(32 57 33 / .13), 0 28px 60px -35px rgb(32 57 33 / .2);
  --shadow-overlay: 0 24px 70px -20px rgb(20 43 24 / .25);
  --glass-bg: rgb(249 251 246 / .94);
  --glass-blur: 14px;
  --hero-glow: radial-gradient(70% 90% at 100% 0%, rgb(211 223 189 / .25), transparent 75%);
}

html[data-site-template="modern"] body { letter-spacing: -.005em; }
html[data-site-template="modern"] :is(h1, h2, h3) { letter-spacing: -.025em; }
html[data-site-template="modern"] :is(body[data-shell="business"], body[data-shell="platform"]) { background-image: none; }
html[data-site-template="modern"] :is(.site-header, .topbar, .ops-bar) {
  background-image: none;
  box-shadow: 0 1px 0 var(--color-border);
  border-bottom-color: var(--color-border);
}
html[data-site-template="modern"] .site-header__inner { gap: clamp(20px, 3vw, 44px); }
html[data-site-template="modern"] .site-nav ul a { font-weight: 500; }
html[data-site-template="modern"] .site-footer { border-top-color: var(--color-border); }
html[data-site-template="modern"] .page-hero { background: var(--hero-glow), var(--color-bg); }
html[data-site-template="modern"] .prose { line-height: 2; }
html[data-site-template="modern"] .section__head p { line-height: 2; }

/* کنترل‌ها: بازخورد کوتاه، بدون تکان‌دادن ورودی‌ها و دکمه‌های حساس به لمس. */
html[data-site-template="modern"] .btn {
  letter-spacing: 0;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 180ms ease;
}
html[data-site-template="modern"] .btn--primary { background: var(--color-primary); box-shadow: 0 3px 9px -4px color-mix(in srgb, var(--color-primary) 30%, transparent); }
html[data-site-template="modern"] .btn--primary:hover { background: var(--color-primary-strong); filter: none; transform: none; }
html[data-site-template="modern"] .btn--gold { color: var(--color-text); box-shadow: none; }
html[data-site-template="modern"] .btn--gold:hover { color: var(--color-text); filter: none; transform: none; }
html[data-site-template="modern"] .btn:active:not(:disabled) { transform: none; box-shadow: none; }
html[data-site-template="modern"] :is(.input, .select, .textarea) { box-shadow: none; border-color: var(--color-border-strong); }
html[data-site-template="modern"] :is(.input, .select, .textarea):focus-visible { border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 13%, transparent); }
html[data-site-template="modern"] :is(.field.has-error .input, .field.has-error .select, .field.has-error .textarea, .input[aria-invalid="true"]) { border-color: var(--color-danger); }
html[data-site-template="modern"] :is(.input-group, .lg-phone) { box-shadow: none; }
html[data-site-template="modern"] :is(.field__label, .form-actions .btn) { font-weight: 600; }
html[data-site-template="modern"] .field__hint { line-height: 1.9; }
html[data-site-template="modern"] .segmented { padding: 4px; background: var(--color-surface-2); }
html[data-site-template="modern"] .chip { box-shadow: none; font-weight: 500; }
html[data-site-template="modern"] .option-card { border-width: 1px; }
html[data-site-template="modern"] .option-card:has(input:checked) { box-shadow: 0 0 0 1px var(--color-primary); }
html[data-site-template="modern"] .otp input { border-width: 1px; }

/* سطوح و جدول‌ها؛ رنگ وضعیت‌های عملیاتی از توکن‌های فعلی حفظ می‌شود. */
html[data-site-template="modern"] :is(.card, .kpi, .plan, .feature, .table-wrap, .accordion) { border-color: var(--color-border); box-shadow: var(--shadow-card); }
html[data-site-template="modern"] .card { background-image: none; }
html[data-site-template="modern"] .card--flat { box-shadow: none; }
html[data-site-template="modern"] .page-head { background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: none; padding: clamp(18px, 2.2vw, 27px); }
html[data-site-template="modern"] .page-head::after { display: none; }
html[data-site-template="modern"] .page-head h1 { font-size: clamp(1.4rem, 1.1rem + .8vw, 1.9rem); }
html[data-site-template="modern"] .page-head p { line-height: 1.9; max-width: 70ch; }
html[data-site-template="modern"] .kpi::before { height: 2px; background: var(--color-primary); opacity: .3; }
html[data-site-template="modern"] .kpi__label .icon { background: var(--color-primary-soft); box-shadow: none; }
html[data-site-template="modern"] .kpi__value { font-size: clamp(1.6rem, 1.2rem + 1vw, 2rem); }
html[data-site-template="modern"] .table { font-size: var(--text-sm); }
html[data-site-template="modern"] .table thead th { background: var(--color-surface-2); font-weight: 600; letter-spacing: 0; backdrop-filter: none; }
html[data-site-template="modern"] .table tbody td { padding-block: 15px; border-bottom-color: var(--color-border); }
html[data-site-template="modern"] .table tbody tr:hover { background: color-mix(in srgb, var(--color-primary) 4%, var(--color-surface)); }
html[data-site-template="modern"] .table .badge::before { display: none; }
html[data-site-template="modern"] .tabs { gap: 8px; }
html[data-site-template="modern"] .tab { font-weight: 500; }
html[data-site-template="modern"] :is(.empty, .empty-state) { border-color: var(--color-border); color: var(--color-text-muted); }

/* مدیریت و پلتفرم */
html[data-site-template="modern"] .admin__sidebar { background: var(--sidebar-bg); }
html[data-site-template="modern"] .admin__sidebar::before { display: none; }
html[data-site-template="modern"] .admin__brand { padding-block: 19px; }
html[data-site-template="modern"] .admin__brand small { margin-top: 7px; font-weight: 400; }
html[data-site-template="modern"] .snav { gap: 25px; }
html[data-site-template="modern"] .snav__label { font-weight: 400; font-size: 10px; letter-spacing: 0; }
html[data-site-template="modern"] .snav a { min-height: 43px; font-weight: 500; }
html[data-site-template="modern"] .snav a[aria-current="page"]::before { background: #bdcfaa; width: 3px; }
html[data-site-template="modern"] .snav a[aria-current="page"] .icon { color: var(--sidebar-active-fg); }
html[data-site-template="modern"] .snav a[aria-current="page"] .badge { --badge-bg: rgb(40 75 38 / .1); --badge-fg: #335b36; }
html[data-site-template="modern"] .admin__user .avatar { background: #dfe9d4; color: #355333; }
html[data-site-template="modern"] .topbar { min-height: 72px; }
html[data-site-template="modern"] .topbar__cmd { border-radius: 10px; font-weight: 400; box-shadow: none; background: var(--color-surface-2); }
html[data-site-template="modern"] .admin__main { padding-top: 24px; }
html[data-site-template="modern"] .kbd-hint { border-style: solid; }

/* ورود و ثبت‌نام، مطابق تم رنگ انتخابی کاربر */
html[data-site-template="modern"] :is(body[data-page="auth"], body[data-page="error"]) { background-image: none; }
html[data-site-template="modern"] .au__card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 22px; box-shadow: var(--shadow-raised); }
html[data-site-template="modern"] .au__art { background: #214a35; border-inline-start-color: #315c43; }
html[data-site-template="modern"] .au__art-inner { color: #f3f6ee; }
html[data-site-template="modern"] .au__art-inner p { color: #c4d4bb; }
html[data-site-template="modern"] :is(.au__brand svg, .lg-phone__art) { filter: none; }
html[data-site-template="modern"] .lg-phone { background: var(--color-surface-2); }
html[data-site-template="modern"] .lg-phone__cc { background: var(--color-primary-soft); }
html[data-site-template="modern"] .lg-phone__wave { animation: none; opacity: .7; }
html[data-site-template="modern"] .lg-steps li[aria-current="step"] .lg-steps__dot { background: var(--color-primary); color: var(--color-on-primary); transform: none; box-shadow: none; }
html[data-site-template="modern"] :is(.lg-steps li.is-done + li::before, .lg-steps li[aria-current="step"]:not(:first-child)::before) { background: var(--color-primary); }

/* عملیات: حرکت و رنگ‌بندی تزئینی ملایم، بدون تغییر معنای آماده/دیرکرد/خطا */
html[data-site-template="modern"] .ops-bar { min-height: 68px; }
html[data-site-template="modern"] .ops-hero { background: var(--color-primary-strong); box-shadow: none; }
html[data-site-template="modern"] .ops-hero__art { opacity: .5; }
html[data-site-template="modern"] .ops-hero__art .steam { animation: none; }
html[data-site-template="modern"] .ops-stat { backdrop-filter: none; border-color: rgb(255 255 255 / .15); }
html[data-site-template="modern"] .ops-stat:hover { transform: none; }
html[data-site-template="modern"] .ops-tile { --t1: var(--color-primary); --t2: #92a57c; }
html[data-site-template="modern"] .ops-tile__icon { background: var(--color-primary-soft); color: var(--color-primary); box-shadow: none; }
html[data-site-template="modern"] .ops-tile__glow { display: none; }
html[data-site-template="modern"] .ops-tile__go { background: var(--color-surface-2); color: var(--color-primary); }
html[data-site-template="modern"] :is(.ticket, .bill-row) { box-shadow: var(--shadow-card); }
html[data-site-template="modern"] :is(.ticket:hover, .bill-row:hover) { transform: none; }
html[data-site-template="modern"] .ticket__head { background-image: none; }
html[data-site-template="modern"] .ticket__num { background: none; color: var(--color-text); }
html[data-site-template="modern"] .bills__head { background: var(--color-surface-2); }
html[data-site-template="modern"] .bill-row[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--color-primary); }

/* انتخاب قالب از تم رنگی کسب‌وکار مستقل است. */
html[data-site-template="modern"] .site-template-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
html[data-site-template="modern"] .site-template-option { position: relative; display: grid; align-content: start; gap: 12px; padding: 18px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); cursor: pointer; }
html[data-site-template="modern"] .site-template-option:has(input:checked) { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
html[data-site-template="modern"] .site-template-option:has(input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 3px; }
html[data-site-template="modern"] .site-template-option input { width: 21px; height: 21px; accent-color: var(--color-primary); }
html[data-site-template="modern"] .site-template-option__preview { min-height: 145px; border-radius: 10px; overflow: hidden; border: 1px solid #dce5d2; background: #f4f6ed; color: #2f583d; }
html[data-site-template="modern"] .site-template-option--classic .site-template-option__preview { background: #15130e; color: #d9b66d; border-color: #453c2c; }
html[data-site-template="modern"] .site-template-option__label { font-size: var(--text-md); font-weight: 600; }
html[data-site-template="modern"] .site-template-option__description { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.9; }

/* زمان‌بندی مشترک؛ نام‌های کلیدی از قالب اول کاملاً جدا هستند. */
html[data-site-template="modern"] :is(.admin__content, .launcher, .au__card) { animation: modern-page-enter 280ms var(--motion-ease-out) both; }
html[data-site-template="modern"] :is(.ops-hero, .ops-stats li, .bill-row, .ticket) { animation: modern-page-enter 240ms var(--motion-ease-out) both; }
html[data-site-template="modern"] .ticket[data-late="danger"] { animation: modern-page-enter 240ms var(--motion-ease-out) both; }
html[data-site-template="modern"] .ticket.is-new { animation: modern-page-enter 280ms var(--motion-ease-out) both; }
html[data-site-template="modern"] :is(.dropdown.is-open .dropdown__menu, .site-nav.is-open) { animation: modern-pop-enter 180ms var(--motion-ease-out) both; }
html[data-site-template="modern"] :is(.lg-form, .au--center .lg-form) { animation: modern-page-enter 240ms var(--motion-ease-out) both; }
html[data-site-template="modern"] .overlay__backdrop { animation: modern-fade-enter 180ms ease both; backdrop-filter: blur(4px); }
html[data-site-template="modern"] .overlay.is-closing .overlay__backdrop { animation: modern-fade-exit 140ms ease both; }
html[data-site-template="modern"] .overlay__panel { box-shadow: var(--shadow-overlay); }
html[data-site-template="modern"] .dropdown__menu { padding: 6px; border-radius: 14px; box-shadow: var(--shadow-raised); }
html[data-site-template="modern"] .toast { box-shadow: var(--shadow-raised); }
@keyframes modern-page-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modern-pop-enter { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modern-fade-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes modern-fade-exit { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 767px) {
  html[data-site-template="modern"] .admin__main { padding-top: 16px; }
  html[data-site-template="modern"] .topbar { min-height: 66px; }
  html[data-site-template="modern"] .page-head { padding: 18px; gap: 16px; }
  html[data-site-template="modern"] .page-head .form-actions { width: 100%; }
  html[data-site-template="modern"] .site-template-options { grid-template-columns: 1fr; }
  html[data-site-template="modern"] .overlay__panel { max-inline-size: 100%; }
}
@media (max-width: 480px) {
  html[data-site-template="modern"] .au__panel { padding-inline: 16px; }
  html[data-site-template="modern"] .au__card { padding: 24px 20px; border-radius: 18px; }
  html[data-site-template="modern"] .site-template-option__preview { min-height: 120px; }
  html[data-site-template="modern"] .table tbody td { padding-block: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-site-template="modern"] { --motion-duration: 0ms; --motion-fast: 0ms; --motion-slow: 0ms; --motion-cart: 0ms; }
  html[data-site-template="modern"] *, html[data-site-template="modern"] *::before, html[data-site-template="modern"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html[data-site-template="modern"]::view-transition-old(root), html[data-site-template="modern"]::view-transition-new(root) { animation: none !important; }
}
html[data-site-template="modern"][data-lite="true"] { --motion-duration: 0ms; --motion-fast: 0ms; --motion-slow: 0ms; --motion-cart: 0ms; --glass-blur: 0px; }
html[data-site-template="modern"][data-lite="true"] *, html[data-site-template="modern"][data-lite="true"] *::before, html[data-site-template="modern"][data-lite="true"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html[data-site-template="modern"][data-lite="true"]::view-transition-old(root), html[data-site-template="modern"][data-lite="true"]::view-transition-new(root) { animation: none !important; }
