/* =========================================================
   فایل کامپوننت‌های رابط کاربری iCh
   کاربرد:
   فقط ساختار و ظاهر کامپوننت‌های NewUi را تعریف می‌کند.
   رنگ، سایه، فونت، فاصله و اندازه باید از فایل‌های Token و Theme خوانده شوند.

   ترتیب بارگذاری:
   ich-tokens.css
   ich-theme-light.css
   ich-theme-dark.css
   ich-ui.css

   قانون:
   هیچ رنگ وابسته به تم نباید مستقیماً در این فایل نوشته شود.
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.ich-ui {
    margin: 0;
    direction: rtl;
    text-align: right;
    font-family: var(--ich-font-family);
    color: var(--ich-color-text);
    background: var(--ich-color-page);
    -webkit-font-smoothing: antialiased;
    transition: color var(--ich-transition-fast), background-color var(--ich-transition-fast);
}

.ich-ui button,
.ich-ui input,
.ich-ui textarea,
.ich-ui select {
    font: inherit;
}

.ich-ui button {
    color: inherit;
}

.ich-ui a {
    color: inherit;
    text-decoration: none;
}

.ich-ui .ich-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

/* =========================================================
   کامپوننت: چیدمان اصلی NewUi
   کاربرد:
   کنار هم قراردادن منوی اصلی و محتوای صفحه و کنترل فاصله‌های عمومی.

   نمونه استفاده:
   <div class="ich-layout">
       <aside class="ich-layout__sidebar">...</aside>
       <main class="ich-layout__main">...</main>
   </div>

   تنظیمات مرکزی:
   --ich-sidebar-width
   --ich-page-padding
   --ich-layout-gap
   ========================================================= */
.ich-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--ich-sidebar-width) minmax(0, 1fr);
}

.ich-layout__sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
}

.ich-layout__main {
    min-width: 0;
    padding: var(--ich-page-padding);
}

.ich-layout__backdrop,
.ich-mobile-menu-button {
    display: none;
}

/* =========================================================
   کامپوننت: منوی اصلی iCh
   کاربرد:
   منوی سراسری دارای آیتم مستقیم، گروه باز و بسته‌شونده، منوی کاربر و تغییر تم.

   نمونه استفاده:
   <partial name="~/Views/NewUi/Shared/_MainMenu.cshtml" model="Model.MainMenu" />

   تنظیمات مرکزی:
   --ich-color-main-menu
   --ich-sidebar-width
   --ich-menu-item-height
   --ich-radius-menu-item
   ========================================================= */
.ich-main-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--ich-color-main-menu);
    border-left: 1px solid var(--ich-color-border);
    box-shadow: var(--ich-shadow-sidebar);
}

.ich-main-menu__brand-row {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px;
    border-bottom: 1px solid var(--ich-color-border);
}

.ich-main-menu__brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 14px;
    color: var(--ich-color-on-primary);
    background: linear-gradient(145deg, var(--ich-color-primary), var(--ich-color-primary-strong));
    box-shadow: var(--ich-shadow-brand);
    font-size: 20px;
    cursor: pointer;
}

.ich-main-menu__brand-mark:hover {
    transform: translateY(-1px);
}

.ich-main-menu__brand-mark:focus-visible {
    outline: 3px solid var(--ich-color-primary-border);
    outline-offset: 3px;
}

.ich-main-menu__brand-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.ich-main-menu__brand-copy > strong {
    display: block;
    margin-bottom: 4px;
    font-size: var(--ich-choice-box-header-font-size);
    font-weight: 850;
}

.ich-main-menu__mobile-close {
    display: none;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--ich-color-border);
    border-radius: 10px;
    background: var(--ich-color-surface);
    cursor: pointer;
}

.ich-main-menu__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 12px;
}

.ich-main-menu__item,
.ich-main-menu__group-title,
.ich-main-menu__subitem {
    min-height: var(--ich-menu-item-height);
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: var(--ich-radius-menu-item);
    transition: color var(--ich-transition-fast), background-color var(--ich-transition-fast), transform var(--ich-transition-fast);
}

.ich-main-menu__item {
    margin-bottom: 5px;
    padding: 0 13px;
    color: var(--ich-color-text-muted);
    font-size: var(--ich-choice-box-option-font-size);
    font-weight: 650;
}

.ich-main-menu__item > i,
.ich-main-menu__group-label > i,
.ich-main-menu__subitem > i {
    width: 20px;
    text-align: center;
    font-size: 17px;
}

.ich-main-menu__item:hover,
.ich-main-menu__subitem:hover,
.ich-main-menu__group-title:hover {
    color: var(--ich-color-primary-strong);
    background: color-mix(in srgb, var(--ich-color-primary-soft) 50%, var(--ich-color-primary-border));
    box-shadow: inset 0 0 0 1px var(--ich-color-primary-border);
}

.ich-main-menu__item:focus-visible,
.ich-main-menu__subitem:focus-visible,
.ich-main-menu__group-title:focus-visible {
    outline: 3px solid var(--ich-color-primary-border);
    outline-offset: 2px;
}

.ich-main-menu__item--active {
    color: var(--ich-color-primary-strong);
    background: color-mix(in srgb, var(--ich-color-primary-soft) 56%, var(--ich-color-primary-border));
    box-shadow:
        inset -3px 0 0 var(--ich-color-primary),
        inset 0 0 0 1px var(--ich-color-primary-border);
    font-weight: 790;
}

.ich-main-menu__item--active > i {
    color: var(--ich-color-primary);
}

.ich-main-menu__item--active:hover {
    color: var(--ich-color-primary-strong);
    background: color-mix(in srgb, var(--ich-color-primary-soft) 50%, var(--ich-color-primary-border));
}

.ich-main-menu__group {
    margin: 4px 0 7px;
}

.ich-main-menu__group-title {
    list-style: none;
    justify-content: space-between;
    padding: 0 13px;
    color: var(--ich-color-text-muted);
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 720;
}

.ich-main-menu__group-title::-webkit-details-marker {
    display: none;
}

.ich-main-menu__group-label {
    display: flex;
    align-items: center;
    gap: 11px;
}

.ich-main-menu__chevron {
    color: var(--ich-color-text-soft);
    font-size: 12px;
    transition: transform var(--ich-transition-fast);
}

.ich-main-menu__group[open] .ich-main-menu__chevron {
    transform: rotate(180deg);
}

.ich-main-menu__group--active > .ich-main-menu__group-title {
    color: var(--ich-color-primary-strong);
    background: color-mix(in srgb, var(--ich-color-primary-soft) 56%, var(--ich-color-primary-border));
    box-shadow: inset 0 0 0 1px var(--ich-color-primary-border);
}

.ich-main-menu__subitems {
    display: grid;
    gap: 4px;
    padding: 7px 18px 3px 5px;
}

.ich-main-menu__subitem {
    min-height: 38px;
    position: relative;
    padding: 0 12px 0 9px;
    color: var(--ich-color-text-muted);
    font-size: 13px;
    font-weight: 580;
}

.ich-main-menu__subitem::before {
    content: "";
    position: absolute;
    right: -9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ich-color-border-strong);
}

.ich-main-menu__subitem--active {
    color: var(--ich-color-primary-strong);
    background: color-mix(in srgb, var(--ich-color-primary-soft) 58%, var(--ich-color-primary-border));
    box-shadow:
        inset -3px 0 0 var(--ich-color-primary),
        inset 0 0 0 1px var(--ich-color-primary-border);
    font-weight: 780;
}

.ich-main-menu__subitem--active::before {
    background: var(--ich-color-primary);
    box-shadow: 0 0 0 3px var(--ich-color-primary-border);
}

.ich-main-menu__item--disabled {
    color: var(--ich-color-disabled-text);
    background: transparent;
    cursor: not-allowed;
    opacity: 0.72;
}

.ich-main-menu__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    border-top: 1px solid var(--ich-color-border);
    color: var(--ich-color-text-muted);
    font-size: 11px;
}

.ich-main-menu__footer a {
    color: var(--ich-color-primary-strong);
    font-weight: 750;
}

/* =========================================================
   کامپوننت: منوی کاربر iCh
   کاربرد:
   نمایش نام کاربر و زیرمنوی مشخصات، تغییر رمز و خروج.

   نمونه استفاده:
   <partial name="~/Views/NewUi/Shared/Components/_UserMenu.cshtml" model="Model.UserMenu" />
   ========================================================= */
.ich-user-menu {
    position: relative;
}

.ich-user-menu__summary {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    list-style: none;
    color: var(--ich-color-text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
}

.ich-user-menu__summary::-webkit-details-marker {
    display: none;
}

.ich-user-menu__avatar {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 7px;
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-primary-soft);
}

.ich-user-menu__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ich-user-menu__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ich-user-menu__chevron {
    margin-right: auto;
    font-size: 10px;
    transition: transform var(--ich-transition-fast);
}

.ich-user-menu[open] .ich-user-menu__chevron {
    transform: rotate(180deg);
}

.ich-user-menu__items {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 70;
    min-width: 190px;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-md);
    background: var(--ich-color-surface);
    box-shadow: var(--ich-shadow-card);
}

.ich-user-menu__item {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--ich-color-text-muted);
    font-size: 12px;
    font-weight: 650;
}

.ich-user-menu__item:hover {
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-primary-soft);
}

/* =========================================================
   کامپوننت: هدر مرکزی صفحه iCh
   کاربرد:
   نمایش عنوان، متن بالایی، توضیح، آیکون و یک یا چند اعلان.

   نمونه استفاده:
   <partial name="~/Views/NewUi/Shared/Components/_PageHeader.cshtml" model="Model.Header" />

   تنظیمات مرکزی:
   --ich-header-min-height
   --ich-content-gap
   --ich-radius-card
   ========================================================= */
.ich-page-header {
    position: sticky;
    top: 0;
    z-index: 45;
    min-height: var(--ich-header-min-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ich-content-gap);
    margin-top: calc(-1 * var(--ich-page-padding));
    margin-inline: calc(-1 * var(--ich-page-padding));
    margin-bottom: var(--ich-content-gap);
    padding: 14px calc(16px + var(--ich-page-padding));
    border: 1px solid var(--ich-color-border);
    border-top: 0;
    border-radius: 0 0 var(--ich-radius-card) var(--ich-radius-card);
    background: var(--ich-color-surface);
    box-shadow: var(--ich-shadow-card);
}

.ich-page-header__identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ich-page-header__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-primary-soft);
    font-size: 21px;
}

.ich-page-header__copy {
    min-width: 0;
}


.ich-page-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 880;
}

.ich-page-header p {
    margin: 3px 0 0;
    color: var(--ich-color-text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.ich-page-header__actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.ich-page-header__notifications {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

/* =========================================================
   کامپوننت: اعلان هدر iCh
   کاربرد:
   نمایش اعلان با آیکون یا تصویر قابل‌تعویض و مقدار مستقل.

   نمونه استفاده:
   اعلان‌ها از NewUiPageHeaderModel.Notifications به هدر داده می‌شوند.
   افزودن اعلان جدید فقط با افزودن یک مدل جدید انجام می‌شود.
   ========================================================= */
.ich-header-notification {
    min-width: 132px;
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border: 1px solid var(--ich-color-primary-border);
    border-radius: 12px;
    background: var(--ich-color-primary-soft);
    transition: transform var(--ich-transition-fast), border-color var(--ich-transition-fast);
}

.ich-header-notification:hover {
    transform: translateY(-1px);
    border-color: var(--ich-color-primary);
}

.ich-header-notification__media {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 10px;
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-surface);
    font-size: 15px;
}

.ich-header-notification__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ich-header-notification__text small,
.ich-header-notification__text strong {
    display: block;
}

.ich-header-notification__text small {
    color: var(--ich-color-text-muted);
    font-size: 10px;
    font-weight: 650;
}

.ich-header-notification__text strong {
    margin-top: 1px;
    font-size: 16px;
    font-weight: 880;
}

.ich-header-notification--warning {
    border-color: color-mix(in srgb, var(--ich-color-warning) 28%, transparent);
    background: var(--ich-color-warning-soft);
}

.ich-header-notification--warning .ich-header-notification__media,
.ich-header-notification--warning .ich-header-notification__text strong {
    color: var(--ich-color-warning);
}

.ich-header-notification--danger {
    border-color: color-mix(in srgb, var(--ich-color-danger) 38%, transparent);
    background: var(--ich-color-danger-soft);
}

.ich-header-notification--danger .ich-header-notification__media,
.ich-header-notification--danger .ich-header-notification__text strong {
    color: var(--ich-color-danger);
}

/* =========================================================
   کامپوننت: منوی داخلی iCh
   کاربرد:
   منوی عمودی یک بخش مانند منوی مشتریان؛ در موبایل به حالت فشرده و بازشونده درمی‌آید.

   نمونه استفاده:
   <partial name="~/Views/NewUi/Shared/_SectionMenu.cshtml" model="Model.SectionMenu" />

   تنظیمات مرکزی:
   --ich-menu-item-height
   --ich-radius-menu-item
   --ich-radius-card
   ========================================================= */
.ich-section-menu {
    overflow: hidden;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-card);
    background: var(--ich-color-surface);
    box-shadow: var(--ich-shadow-card);
}

.ich-section-menu__header {
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--ich-color-border);
    background: transparent;
    text-align: right;
    cursor: default;
}

.ich-section-menu__title-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 13px;
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-primary-soft);
    font-size: 19px;
}

.ich-section-menu__header-copy {
    min-width: 0;
}

.ich-section-menu__header-copy strong,
.ich-section-menu__header-copy small {
    display: block;
}

.ich-section-menu__header-copy strong {
    font-size: 15px;
    font-weight: 840;
}

.ich-section-menu__header-copy small {
    display: none;
    margin-top: 2px;
    color: var(--ich-color-text-muted);
    font-size: 10px;
}

.ich-section-menu__chevron {
    display: none;
    margin-right: auto;
    color: var(--ich-color-text-muted);
    font-size: 12px;
    transition: transform var(--ich-transition-fast);
}

.ich-section-menu__items {
    display: grid;
    gap: 4px;
    padding: 10px;
}

.ich-section-menu__item {
    min-height: var(--ich-menu-item-height);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: var(--ich-radius-menu-item);
    color: var(--ich-color-text-muted);
    font-size: 13px;
    font-weight: 640;
    transition: color var(--ich-transition-fast), background-color var(--ich-transition-fast), border-color var(--ich-transition-fast), transform var(--ich-transition-fast);
}

.ich-section-menu__item > i {
    width: 20px;
    text-align: center;
    color: var(--ich-color-text-soft);
    font-size: 17px;
}

.ich-section-menu__item:hover {
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-primary-soft);
    border-color: var(--ich-color-primary-border);
    transform: translateX(-2px);
}

.ich-section-menu__item:hover > i,
.ich-section-menu__item--active > i {
    color: var(--ich-color-primary);
}

.ich-section-menu__item:focus-visible {
    outline: 3px solid var(--ich-color-primary-border);
    outline-offset: 1px;
}

.ich-section-menu__item--active {
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-primary-soft);
    border-color: var(--ich-color-primary-border);
    box-shadow: inset -3px 0 0 var(--ich-color-primary);
    font-weight: 790;
}

.ich-section-menu__item--disabled {
    color: var(--ich-color-disabled-text);
    background: var(--ich-color-disabled);
    cursor: not-allowed;
    opacity: 0.78;
}

.ich-section-menu__item--disabled > i {
    color: var(--ich-color-disabled-text);
}

/* =========================================================
   چارچوب محتوای صفحات NewUi
   کاربرد:
   ایجاد دو الگوی صفحه: بدون منوی داخلی و دارای منوی داخلی.

   نمونه استفاده بدون منو:
   <section class="ich-content-surface">...</section>

   نمونه استفاده با منو:
   <div class="ich-page-with-section-menu">
       <aside>...</aside>
       <section class="ich-content-surface">...</section>
   </div>
   ========================================================= */
.ich-page-with-section-menu {
    display: grid;
    grid-template-columns: minmax(232px, 264px) minmax(0, 1fr);
    gap: var(--ich-content-gap);
    align-items: start;
}

.ich-content-surface {
    min-height: 500px;
    padding: 24px;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-card);
    background: var(--ich-color-surface);
    box-shadow: var(--ich-shadow-card);
}

.ich-content-surface--dashboard {
    min-height: calc(100vh - var(--ich-page-padding) * 2 - var(--ich-header-min-height) - var(--ich-content-gap));
}

.ich-content-placeholder {
    max-width: 700px;
}

.ich-content-placeholder__icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 14px;
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-primary-soft);
    font-size: 21px;
}

.ich-content-placeholder h2 {
    margin: 0 0 7px;
    font-size: 19px;
    font-weight: 840;
}

.ich-content-placeholder p {
    margin: 0;
    color: var(--ich-color-text-muted);
    font-size: 13px;
    line-height: 1.9;
}


/* =========================================================
   کامپوننت: Button و IconButton در iCh
   کاربرد:
   تولید دکمه متنی، دکمه دارای آیکون، دکمه فقط آیکون و گروه عملیات.

   نمونه استفاده:
   @Html.NewUiButton(new NewUiButtonOptions { Text = "افزودن", Theme = NewUiButtonTheme.Primary })
   @Html.NewUiIconButton(new NewUiButtonOptions { Icon = "bi bi-pencil", AriaLabel = "ویرایش" })

   کلاس‌های پایه:
   ich-btn
   ich-btn--primary | secondary | neutral | success | warning | danger
   ich-btn--solid | outline | soft | ghost | link
   ich-btn--sm | md | lg
   ich-btn--square | circle | icon-only

   تنظیمات مرکزی:
   --ich-button-radius
   --ich-button-height-sm | md | lg
   --ich-icon-button-size-sm | md | lg
   --ich-button-gap
   ========================================================= */
.ich-btn {
    --ich-btn-color: var(--ich-color-primary);
    --ich-btn-color-strong: var(--ich-color-primary-strong);
    --ich-btn-color-soft: var(--ich-color-primary-soft);
    --ich-btn-contrast: var(--ich-color-on-primary);
    min-width: 0;
    height: var(--ich-button-height-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ich-button-gap);
    padding-inline: var(--ich-button-padding-md);
    border: 1px solid transparent;
    border-radius: var(--ich-button-radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    transition: color var(--ich-transition-fast), background-color var(--ich-transition-fast), border-color var(--ich-transition-fast), box-shadow var(--ich-transition-fast), transform var(--ich-transition-fast);
}

.ich-btn:hover:not(.ich-btn--disabled) {
    transform: translateY(-1px);
}

.ich-btn:active:not(.ich-btn--disabled) {
    transform: translateY(0);
}

.ich-btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ich-btn-color) 25%, transparent);
    outline-offset: 2px;
}

.ich-btn--primary {
    --ich-btn-color: var(--ich-color-primary);
    --ich-btn-color-strong: var(--ich-color-primary-strong);
    --ich-btn-color-soft: var(--ich-color-primary-soft);
}

.ich-btn--secondary {
    --ich-btn-color: var(--ich-color-secondary);
    --ich-btn-color-strong: var(--ich-color-secondary-strong);
    --ich-btn-color-soft: var(--ich-color-secondary-soft);
}

.ich-btn--neutral {
    --ich-btn-color: var(--ich-color-neutral);
    --ich-btn-color-strong: var(--ich-color-neutral-strong);
    --ich-btn-color-soft: var(--ich-color-neutral-soft);
}

.ich-btn--success {
    --ich-btn-color: var(--ich-color-success);
    --ich-btn-color-strong: var(--ich-color-success-strong);
    --ich-btn-color-soft: var(--ich-color-success-soft);
}

.ich-btn--warning {
    --ich-btn-color: var(--ich-color-warning);
    --ich-btn-color-strong: var(--ich-color-warning-strong);
    --ich-btn-color-soft: var(--ich-color-warning-soft);
    --ich-btn-contrast: var(--ich-color-on-warning);
}

.ich-btn--danger {
    --ich-btn-color: var(--ich-color-danger);
    --ich-btn-color-strong: var(--ich-color-danger-strong);
    --ich-btn-color-soft: var(--ich-color-danger-soft);
}

.ich-btn--solid {
    color: var(--ich-btn-contrast);
    background: var(--ich-btn-color);
    border-color: var(--ich-btn-color);
    box-shadow: 0 7px 16px color-mix(in srgb, var(--ich-btn-color) 18%, transparent);
}

.ich-btn--solid:hover:not(.ich-btn--disabled) {
    background: var(--ich-btn-color-strong);
    border-color: var(--ich-btn-color-strong);
}

.ich-btn--outline {
    color: var(--ich-btn-color);
    background: transparent;
    border-color: color-mix(in srgb, var(--ich-btn-color) 62%, transparent);
}

.ich-btn--outline:hover:not(.ich-btn--disabled) {
    color: var(--ich-btn-color-strong);
    background: var(--ich-btn-color-soft);
    border-color: var(--ich-btn-color);
}

.ich-btn--soft {
    color: var(--ich-btn-color-strong);
    background: var(--ich-btn-color-soft);
    border-color: transparent;
}

.ich-btn--soft:hover:not(.ich-btn--disabled) {
    color: var(--ich-btn-color-strong);
    border-color: color-mix(in srgb, var(--ich-btn-color) 22%, transparent);
}

.ich-btn--ghost {
    color: var(--ich-btn-color);
    background: transparent;
    border-color: transparent;
}

.ich-btn--ghost:hover:not(.ich-btn--disabled) {
    color: var(--ich-btn-color-strong);
    background: var(--ich-btn-color-soft);
}

.ich-btn--link {
    height: auto;
    padding: 4px;
    color: var(--ich-btn-color);
    background: transparent;
    border: 0;
    border-radius: var(--ich-radius-sm);
    box-shadow: none;
}

.ich-btn--link:hover:not(.ich-btn--disabled) {
    color: var(--ich-btn-color-strong);
    text-decoration: underline;
    transform: none;
}

.ich-btn--sm {
    height: var(--ich-button-height-sm);
    padding-inline: var(--ich-button-padding-sm);
    font-size: 12px;
}

.ich-btn--md {
    height: var(--ich-button-height-md);
    padding-inline: var(--ich-button-padding-md);
    font-size: 13px;
}

.ich-btn--lg {
    height: var(--ich-button-height-lg);
    padding-inline: var(--ich-button-padding-lg);
    font-size: 14px;
}

.ich-btn--square,
.ich-btn--circle,
.ich-btn--icon-only {
    padding: 0;
    flex: 0 0 auto;
}

.ich-btn--sm.ich-btn--icon-only {
    width: var(--ich-icon-button-size-sm);
}

.ich-btn--md.ich-btn--icon-only {
    width: var(--ich-icon-button-size-md);
}

.ich-btn--lg.ich-btn--icon-only {
    width: var(--ich-icon-button-size-lg);
}

.ich-btn--square {
    border-radius: var(--ich-button-radius-square);
}

.ich-btn--circle {
    border-radius: 999px;
}

.ich-btn__icon {
    flex: 0 0 auto;
    font-size: 1.15em;
    line-height: 1;
}

.ich-btn--icon-only .ich-btn__icon {
    font-size: 1.25em;
}

.ich-btn--disabled,
.ich-btn:disabled {
    color: var(--ich-color-disabled-text);
    background: var(--ich-color-disabled);
    border-color: var(--ich-color-border);
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.78;
}

.ich-btn__spinner {
    width: 1.05em;
    height: 1.05em;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-left-color: transparent;
    border-radius: 50%;
    animation: ich-button-spin 700ms linear infinite;
}

@keyframes ich-button-spin {
    to { transform: rotate(360deg); }
}

.ich-button-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--ich-button-gap);
    flex-wrap: wrap;
}

.ich-button-group--compact {
    gap: 6px;
}

.ich-btn--full { width: 100%; }

/* =========================================================
   نمایشگاه کامپوننت دکمه
   کاربرد:
   فقط برای صفحه طراحی NewUi و مقایسه API، کلاس‌ها و حالت‌ها.

   نمونه استفاده:
   <section class="ich-component-demo">...</section>
   ========================================================= */
.ich-component-demo {
    display: grid;
    gap: var(--ich-content-gap);
}

.ich-demo-section {
    padding: 18px;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-card);
    background: var(--ich-color-surface);
}

.ich-demo-section__header {
    display: grid;
    gap: 5px;
    margin-bottom: 16px;
}

.ich-demo-section__header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 820;
}

.ich-demo-section__header p {
    margin: 0;
    color: var(--ich-color-text-muted);
    font-size: 12px;
    line-height: 1.8;
}

.ich-demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.ich-demo-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-md);
    background: var(--ich-color-surface-soft);
}

.ich-demo-card__title {
    font-size: 13px;
    font-weight: 780;
}

.ich-demo-card__sample {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ich-demo-card code,
.ich-demo-code {
    direction: ltr;
    unicode-bidi: isolate;
    display: block;
    overflow-wrap: anywhere;
    padding: 8px 10px;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-sm);
    color: var(--ich-color-text-muted);
    background: var(--ich-color-surface);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    line-height: 1.6;
    text-align: left;
}

.ich-demo-table {
    width: 100%;
    border-collapse: collapse;
}

.ich-demo-table th,
.ich-demo-table td {
    padding: 12px;
    border-bottom: 1px solid var(--ich-color-border);
    text-align: right;
}

.ich-demo-table th {
    color: var(--ich-color-text-muted);
    font-size: 11px;
    font-weight: 760;
}

.ich-demo-table td {
    font-size: 12px;
}

@media (max-width: 1100px) {
    :root {
        --ich-sidebar-width: 244px;
    }
}

@media (max-width: 860px) {
    :root {
        --ich-page-padding: 12px;
        --ich-content-gap: 10px;
        --ich-header-min-height: 78px;
    }

    .ich-layout {
        display: block;
    }

    .ich-layout__sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: min(86vw, 320px);
        height: 100vh;
        transform: translateX(105%);
        transition: transform 220ms ease;
    }

    .ich-main-menu-open .ich-layout__sidebar {
        transform: translateX(0);
    }

    .ich-main-menu__mobile-close {
        display: grid;
    }

    .ich-layout__backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        border: 0;
        background: var(--ich-overlay);
        opacity: 0;
        visibility: hidden;
        transition: opacity 220ms ease, visibility 220ms ease;
    }

    .ich-main-menu-open .ich-layout__backdrop {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .ich-mobile-menu-button {
        width: 46px;
        height: 46px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        padding: 0;
        border: 1px solid var(--ich-color-border);
        border-radius: 13px;
        color: var(--ich-color-text);
        background: var(--ich-color-surface);
        box-shadow: var(--ich-shadow-card);
        font-size: 23px;
        cursor: pointer;
    }

    .ich-page-with-section-menu {
        grid-template-columns: 1fr;
    }

    .ich-section-menu__header {
        cursor: pointer;
    }

    .ich-section-menu__header-copy small,
    .ich-section-menu__chevron {
        display: block;
    }

    .ich-section-menu__items {
        display: none;
    }

    .ich-section-menu--open .ich-section-menu__items {
        display: grid;
    }

    .ich-section-menu--open .ich-section-menu__chevron {
        transform: rotate(180deg);
    }
}

@media (max-width: 900px) {
    .ich-page-header {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr);
        align-items: center;
        gap: 10px 12px;
        padding: 12px calc(12px + var(--ich-page-padding));
        direction: rtl;
    }

    /*
       ترتیب فیزیکی در Mobile/Tablet:
       راست: منوی اصلی
       وسط: آیکون/لوگوی صفحه
       چپ: عنوان + توضیحات
       Wrapper هویت در Grid نقشی ندارد تا آیکون زیر دکمه منو قرار نگیرد.
    */
    .ich-page-header__identity {
        display: contents;
    }

    .ich-page-header__actions {
        display: contents;
    }

    .ich-mobile-menu-button {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        justify-self: end;
        position: relative;
        z-index: 1;
    }

    .ich-page-header__icon {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        position: relative;
        z-index: 0;
    }

    .ich-page-header__copy {
        grid-column: 3;
        grid-row: 1;
        min-width: 0;
        display: flex;
        align-items: baseline;
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        text-align: right;
    }

    .ich-page-header__notifications {
        width: 100%;
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
        gap: 8px;
    }

    .ich-page-header__copy > .ich-breadcrumb {
        flex: 0 0 100%;
    }

    .ich-page-header h1 {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .ich-page-header p {
        min-width: 0;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ich-page-header--has-notifications .ich-page-header__notifications {
        display: grid;
    }

    .ich-page-header--no-notifications {
        grid-template-rows: auto;
    }

    .ich-header-notification {
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .ich-page-header__icon {
        width: 44px;
        height: 44px;
        font-size: 19px;
    }

    .ich-page-header h1 {
        font-size: 18px;
    }

    .ich-page-header p {
        font-size: 11px;
    }

    .ich-content-surface {
        min-height: 360px;
        padding: 18px;
    }
}


@media (max-width: 640px) {
    .ich-btn--mobile-full {
        width: 100%;
    }

    .ich-button-group {
        width: 100%;
    }

    .ich-demo-section {
        padding: 14px;
    }

    .ich-demo-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   کامپوننت: Badgeهای iCh
   کاربرد:
   نمایش وضعیت، دسته‌بندی، نقطه آنلاین/آفلاین و شمارنده‌های کوتاه.

   نمونه استفاده مستقیم CSS:
   <span class="ich-badge ich-badge--success ich-badge--soft ich-badge--md ich-badge--rounded">فعال</span>

   مصرف استاندارد پروژه:
   @Html.NewUiBadge(new NewUiBadgeOptions { Text = "فعال", Theme = NewUiBadgeTheme.Success })

   تنظیمات مرکزی:
   --ich-badge-height-*
   --ich-badge-padding-*
   --ich-badge-radius
   --ich-badge-dot-size
   ========================================================= */
.ich-badge {
    --ich-badge-color: var(--ich-color-neutral);
    --ich-badge-color-strong: var(--ich-color-neutral-strong);
    --ich-badge-color-soft: var(--ich-color-neutral-soft);
    --ich-badge-on-color: var(--ich-color-on-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ich-badge-gap);
    max-width: 100%;
    border: 1px solid transparent;
    font-family: inherit;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.ich-badge[href] {
    text-decoration: none;
}

.ich-badge[href]:focus-visible {
    outline: 3px solid var(--ich-color-primary-soft);
    outline-offset: 2px;
}

.ich-badge--primary {
    --ich-badge-color: var(--ich-color-primary);
    --ich-badge-color-strong: var(--ich-color-primary-strong);
    --ich-badge-color-soft: var(--ich-color-primary-soft);
    --ich-badge-on-color: var(--ich-color-on-primary);
}

.ich-badge--secondary {
    --ich-badge-color: var(--ich-color-secondary);
    --ich-badge-color-strong: var(--ich-color-secondary-strong);
    --ich-badge-color-soft: var(--ich-color-secondary-soft);
    --ich-badge-on-color: var(--ich-color-on-primary);
}

.ich-badge--neutral {
    --ich-badge-color: var(--ich-color-neutral);
    --ich-badge-color-strong: var(--ich-color-neutral-strong);
    --ich-badge-color-soft: var(--ich-color-neutral-soft);
    --ich-badge-on-color: var(--ich-color-on-primary);
}

.ich-badge--info {
    --ich-badge-color: var(--ich-color-info);
    --ich-badge-color-strong: var(--ich-color-info-strong);
    --ich-badge-color-soft: color-mix(in srgb, var(--ich-color-info-soft) 80%, var(--ich-color-info) 20%);
    --ich-badge-on-color: var(--ich-color-on-info);
}

.ich-badge--success {
    --ich-badge-color: var(--ich-color-success);
    --ich-badge-color-strong: var(--ich-color-success-strong);
    --ich-badge-color-soft: var(--ich-color-success-soft);
    --ich-badge-on-color: var(--ich-color-on-primary);
}

.ich-badge--warning {
    --ich-badge-color: var(--ich-color-warning);
    --ich-badge-color-strong: var(--ich-color-warning-strong);
    --ich-badge-color-soft: var(--ich-color-warning-soft);
    --ich-badge-on-color: var(--ich-color-on-warning);
}

.ich-badge--danger {
    --ich-badge-color: var(--ich-color-danger);
    --ich-badge-color-strong: var(--ich-color-danger-strong);
    --ich-badge-color-soft: var(--ich-color-danger-soft);
    --ich-badge-on-color: var(--ich-color-on-primary);
}

.ich-badge.ich-badge--soft {
    color: var(--ich-badge-color-strong);
    background: var(--ich-badge-color-soft);
}

.ich-badge.ich-badge--outline {
    color: var(--ich-badge-color-strong);
    border-color: var(--ich-badge-color);
    background: transparent;
}

.ich-badge.ich-badge--solid {
    color: var(--ich-badge-on-color);
    background: var(--ich-badge-color);
}

.ich-badge--sm {
    min-height: var(--ich-badge-height-sm);
    padding-inline: var(--ich-badge-padding-sm);
    font-size: var(--ich-badge-font-size-sm);
}

.ich-badge--md {
    min-height: var(--ich-badge-height-md);
    padding-inline: var(--ich-badge-padding-md);
    font-size: var(--ich-badge-font-size-md);
}

.ich-badge--lg {
    min-height: var(--ich-badge-height-lg);
    padding-inline: var(--ich-badge-padding-lg);
    font-size: var(--ich-badge-font-size-lg);
}

.ich-badge--rounded {
    border-radius: var(--ich-badge-radius);
}

.ich-badge--pill {
    border-radius: var(--ich-badge-radius-pill);
}

.ich-badge--square,
.ich-badge--circle {
    width: var(--ich-badge-height-md);
    min-width: var(--ich-badge-height-md);
    padding-inline: 0;
    aspect-ratio: 1;
}

.ich-badge--sm.ich-badge--square,
.ich-badge--sm.ich-badge--circle {
    width: var(--ich-badge-height-sm);
    min-width: var(--ich-badge-height-sm);
}

.ich-badge--lg.ich-badge--square,
.ich-badge--lg.ich-badge--circle {
    width: var(--ich-badge-height-lg);
    min-width: var(--ich-badge-height-lg);
}

.ich-badge--square {
    border-radius: var(--ich-badge-radius);
}

.ich-badge--circle {
    border-radius: 50%;
}

.ich-badge--muted {
    opacity: .58;
}

.ich-badge__icon,
.ich-badge__text {
    line-height: 1;
}

.ich-badge__dot {
    width: var(--ich-badge-dot-size);
    height: var(--ich-badge-dot-size);
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

/* =========================================================
   کامپوننت: Card عمومی iCh
   کاربرد:
   قاب استاندارد برای جدول، فرم، گزارش، جزئیات و محتوای صفحه.

   نمونه استفاده:
   <new-ui-card title="فهرست مشتریان" variant="Bordered" padding="Normal">
       <new-ui-card-actions>...</new-ui-card-actions>
       محتوای کارت
       <new-ui-card-footer>...</new-ui-card-footer>
   </new-ui-card>

   تنظیمات مرکزی:
   --ich-card-radius
   --ich-card-padding-*
   --ich-card-header-gap
   ========================================================= */
.ich-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    color: var(--ich-color-text);
    background: var(--ich-card-surface);
    border-radius: var(--ich-card-radius);
    border: 1px solid transparent;
}

.ich-card--default { border-color: var(--ich-card-border); box-shadow: var(--ich-shadow-card); }
.ich-card--bordered { border-color: var(--ich-color-border-strong); }
.ich-card--elevated { border-color: transparent; box-shadow: var(--ich-shadow-card); }
.ich-card--soft { background: var(--ich-card-surface-soft); border-color: var(--ich-card-border); }
.ich-card--flat { background: transparent; border-color: transparent; box-shadow: none; }
.ich-card--compact { --ich-card-current-padding: var(--ich-card-padding-compact); }
.ich-card--normal { --ich-card-current-padding: var(--ich-card-padding-normal); }
.ich-card--comfortable { --ich-card-current-padding: var(--ich-card-padding-comfortable); }

.ich-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ich-card-header-gap);
    padding: var(--ich-card-current-padding);
    border-bottom: 1px solid var(--ich-card-header-border);
}

.ich-card__heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ich-card__heading-copy { min-width: 0; }
.ich-card__icon {
    width: var(--ich-card-icon-size);
    height: var(--ich-card-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--ich-color-primary);
    background: var(--ich-color-primary-soft);
    border-radius: var(--ich-radius-md);
}
.ich-card__title { margin: 0; font-size: 14px; font-weight: 800; }
.ich-card--title-large .ich-card__title { font-size: 16px; }
.ich-card__description { margin: 3px 0 0; color: var(--ich-color-text-muted); font-size: 11px; line-height: 1.75; }
.ich-card__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ich-card__body { min-width: 0; padding: var(--ich-card-current-padding); line-height: 1.9; }
/* Theme اختیاری Card عمومی؛ فقط Cardهایی که Theme صریح دارند رنگ می‌گیرند. */
.ich-card--theme-neutral { --ich-card-theme-color: var(--ich-color-neutral); --ich-card-theme-strong: var(--ich-color-neutral-strong); --ich-card-theme-soft: var(--ich-color-neutral-soft); }
.ich-card--theme-primary { --ich-card-theme-color: var(--ich-color-primary); --ich-card-theme-strong: var(--ich-color-primary-strong); --ich-card-theme-soft: var(--ich-color-primary-soft); }
.ich-card--theme-info { --ich-card-theme-color: var(--ich-color-info); --ich-card-theme-strong: var(--ich-color-info-strong); --ich-card-theme-soft: var(--ich-color-info-soft); }
.ich-card--theme-success { --ich-card-theme-color: var(--ich-color-success); --ich-card-theme-strong: var(--ich-color-success-strong); --ich-card-theme-soft: var(--ich-color-success-soft); }
.ich-card--theme-warning { --ich-card-theme-color: var(--ich-color-warning); --ich-card-theme-strong: var(--ich-color-warning-strong); --ich-card-theme-soft: var(--ich-color-warning-soft); }
.ich-card--theme-danger { --ich-card-theme-color: var(--ich-color-danger); --ich-card-theme-strong: var(--ich-color-danger-strong); --ich-card-theme-soft: var(--ich-color-danger-soft); }
.ich-card[class*="ich-card--theme-"] {
    background: color-mix(in srgb, var(--ich-card-theme-soft) 72%, var(--ich-card-surface));
    border-color: color-mix(in srgb, var(--ich-card-theme-color) 30%, var(--ich-card-border));
}
.ich-card[class*="ich-card--theme-"] .ich-card__description { color: var(--ich-card-theme-strong); }
.ich-card--header-only .ich-card__header { border-bottom: 0; }
.ich-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px var(--ich-card-current-padding);
    color: var(--ich-color-text-muted);
    background: var(--ich-card-footer-surface);
    border-top: 1px solid var(--ich-card-header-border);
    font-size: 11px;
}

/* =========================================================
   کامپوننت: StatCard iCh
   کاربرد:
   نمایش شاخص‌های آماری مانند تعداد شارژ، مبلغ، مشتری و وضعیت جاری.

   نمونه استفاده:
   Partial _StatCard با NewUiStatCardModel و MediaPosition انتخابی.

   موقعیت رسانه:
   LeftTop | LeftCenter | LeftBottom
   ========================================================= */
.ich-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--ich-stat-grid-min-width)), 1fr));
    gap: var(--ich-content-gap);
}

/* Card تعاملی: برای سناریوهایی که کل Card توسط رفتار مصرف‌کننده انتخاب/اجرا می‌شود. */
.ich-card--interactive {
    cursor: pointer;
    transition: transform var(--ich-transition-fast), border-color var(--ich-transition-fast), box-shadow var(--ich-transition-fast);
}
.ich-card--interactive:hover {
    transform: translateY(-1px);
    border-color: var(--ich-card-theme-color, var(--ich-color-primary));
}
.ich-card--interactive:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ich-card-theme-color, var(--ich-color-primary)) 24%, transparent);
    outline-offset: 2px;
}
.ich-card--interactive[aria-disabled="true"],
.ich-card--interactive[aria-busy="true"] {
    cursor: wait;
    opacity: .62;
    pointer-events: none;
    transform: none;
}

/* Card انتخاب‌شده: حالت opt-in و مستقل از Cardهای عادی. */
.ich-card--selected {
    border-color: var(--ich-card-theme-color, var(--ich-color-primary));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ich-card-theme-color, var(--ich-color-primary)) 18%, transparent);
}

.ich-stat-card {
    --ich-stat-color: var(--ich-color-primary);
    --ich-stat-soft: var(--ich-stat-primary-soft);
    position: relative;
    display: flex;
    min-width: 0;
    min-height: var(--ich-stat-card-min-height);
    padding: 16px;
    overflow: hidden;
    color: var(--ich-color-text);
    text-decoration: none;
    background: var(--ich-card-surface);
    border: 1px solid var(--ich-card-border);
    border-radius: var(--ich-card-radius);
    box-shadow: var(--ich-shadow-card);
    transition: transform var(--ich-transition-fast), border-color var(--ich-transition-fast);
}
.ich-stat-card[href]:hover { transform: translateY(-2px); border-color: var(--ich-stat-color); }
.ich-stat-card[href]:focus-visible { outline: 3px solid var(--ich-color-primary-soft); outline-offset: 2px; }
.ich-stat-card--primary { --ich-stat-color: var(--ich-color-primary); --ich-stat-soft: var(--ich-stat-primary-soft); }
.ich-stat-card--secondary { --ich-stat-color: var(--ich-color-secondary); --ich-stat-soft: var(--ich-stat-secondary-soft); }
.ich-stat-card--neutral { --ich-stat-color: var(--ich-color-neutral); --ich-stat-soft: var(--ich-stat-neutral-soft); }
.ich-stat-card--info { --ich-stat-color: var(--ich-color-info); --ich-stat-soft: var(--ich-stat-info-soft); }
.ich-stat-card--success { --ich-stat-color: var(--ich-color-success); --ich-stat-soft: var(--ich-stat-success-soft); }
.ich-stat-card--warning { --ich-stat-color: var(--ich-color-warning); --ich-stat-soft: var(--ich-stat-warning-soft); }
.ich-stat-card--yellow { --ich-stat-color: var(--ich-color-yellow); --ich-stat-soft: var(--ich-stat-yellow-soft); }
.ich-stat-card--orange { --ich-stat-color: var(--ich-color-orange); --ich-stat-soft: var(--ich-stat-orange-soft); }
.ich-stat-card--danger { --ich-stat-color: var(--ich-color-danger); --ich-stat-soft: var(--ich-stat-danger-soft); }
.ich-stat-card--accent::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--ich-stat-color);
    pointer-events: none;
}
.ich-stat-card--selected {
    border-color: var(--ich-stat-color);
    background: color-mix(in srgb, var(--ich-card-surface) 88%, var(--ich-stat-soft) 12%);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--ich-stat-color) 32%, transparent),
        var(--ich-shadow-card);
    transform: translateY(-1px);
}
.ich-stat-card__content { display: flex; flex-direction: column; gap: 14px; width: 100%; padding-left: calc(var(--ich-stat-card-media-size) + 14px); }
.ich-stat-card__heading h3 { margin: 0; font-size: 13px; font-weight: 800; }
.ich-stat-card__heading span { display: block; margin-top: 3px; color: var(--ich-color-text-muted); font-size: 10px; }
.ich-stat-card__values { display: flex; flex-direction: column; gap: 4px; }
.ich-stat-card__values strong { color: var(--ich-stat-color); font-size: 22px; line-height: 1.25; }
.ich-stat-card__values span { color: var(--ich-color-text-muted); font-size: 12px; }
.ich-stat-card__badge { margin-top: auto; }
.ich-stat-card--standard .ich-stat-card__content {
    flex-direction: column;
}
.ich-stat-card--standard .ich-stat-card__heading,
.ich-stat-card--standard .ich-stat-card__values {
    width: 100%;
}
.ich-stat-card--standard .ich-stat-card__values {
    flex-direction: column;
}
.ich-stat-card--standard .ich-stat-card__values strong,
.ich-stat-card--standard .ich-stat-card__values span {
    display: block;
}

.ich-stat-card__media {
    position: absolute;
    left: 16px;
    width: var(--ich-stat-card-media-size);
    height: var(--ich-stat-card-media-size);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--ich-stat-color);
    background: var(--ich-stat-soft);
    border-radius: var(--ich-radius-lg);
    font-size: 24px;
}
.ich-stat-card__media img { width: 100%; height: 100%; object-fit: contain; }

.ich-stat-card--horizontal-compact {
    min-height: 0;
    align-items: center;
    padding-block: 12px;
}
.ich-stat-card--horizontal-compact .ich-stat-card__content {
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}
.ich-stat-card--horizontal-compact.ich-stat-card--has-media .ich-stat-card__content {
    min-height: var(--ich-stat-card-media-size);
    justify-content: center;
}
.ich-stat-card--horizontal-compact .ich-stat-card__heading {
    width: 100%;
    min-width: 0;
}
.ich-stat-card--horizontal-compact .ich-stat-card__heading h3 {
    margin: 0;
}
.ich-stat-card--horizontal-compact .ich-stat-card__values {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.ich-stat-card--horizontal-compact .ich-stat-card__values::before {
    content: none;
}
.ich-stat-card--horizontal-compact .ich-stat-card__values strong {
    display: block;
    font-size: 18px;
    line-height: 1.35;
}
.ich-stat-card--horizontal-compact .ich-stat-card__values span {
    display: block;
    margin-top: 0;
    font-size: 12px;
    line-height: 1.5;
}
.ich-stat-card--horizontal-compact .ich-stat-card__badge {
    margin-top: 2px;
}

.ich-stat-card--media-left-top .ich-stat-card__media { top: 16px; }
.ich-stat-card--media-left-center .ich-stat-card__media { top: 50%; transform: translateY(-50%); }
.ich-stat-card--media-left-bottom .ich-stat-card__media { bottom: 16px; }
.ich-demo-code-block { margin-top: 12px; }

@media (max-width: 640px) {
    .ich-card__header { align-items: flex-start; flex-direction: column; }
    .ich-card__actions { width: 100%; }
    .ich-card__footer { align-items: flex-start; }
    .ich-stat-grid { grid-template-columns: 1fr; }
}
.ich-stat-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}
.ich-stat-card__content {
    position: relative;
    z-index: 2;
    pointer-events: none;
}
.ich-stat-card__media {
    z-index: 2;
    pointer-events: none;
}

/* =========================================================
   کامپوننت: سیستم چیدمان صفحات iCh
   کاربرد:
   ساخت Grid چندستونه، GridItem با Span، Stack عمودی، Inline افقی،
   Section و Container بدون وابستگی View مصرف‌کننده به Bootstrap.

   نمونه استفاده:
   <new-ui-grid columns="4" tablet-columns="2" mobile-columns="1" gap="Normal">
       <new-ui-grid-item>...</new-ui-grid-item>
       <new-ui-grid-item full-width="true">...</new-ui-grid-item>
   </new-ui-grid>

   تنظیمات مرکزی:
   --ich-layout-grid-gap-*
   --ich-container-width-*
   --ich-section-*
   ========================================================= */
.ich-container {
    width: 100%;
    min-width: 0;
    margin-inline: auto;
}

.ich-container--sm { max-width: var(--ich-container-width-sm); }
.ich-container--md { max-width: var(--ich-container-width-md); }
.ich-container--lg { max-width: var(--ich-container-width-lg); }
.ich-container--xl { max-width: var(--ich-container-width-xl); }
.ich-container--full { max-width: none; }

.ich-grid {
    display: grid;
    width: 100%;
    min-width: 0;
}

.ich-grid--desktop-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.ich-grid--desktop-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ich-grid--desktop-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ich-grid--desktop-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ich-grid--desktop-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ich-grid--desktop-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.ich-grid-item {
    min-width: 0;
}

.ich-grid-item--desktop-span-1 { grid-column: span 1; }
.ich-grid-item--desktop-span-2 { grid-column: span 2; }
.ich-grid-item--desktop-span-3 { grid-column: span 3; }
.ich-grid-item--desktop-span-4 { grid-column: span 4; }
.ich-grid-item--desktop-span-5 { grid-column: span 5; }
.ich-grid-item--desktop-span-6 { grid-column: span 6; }
.ich-grid-item--full { grid-column: 1 / -1; }

.ich-stack {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.ich-inline {
    display: flex;
    min-width: 0;
    flex-direction: row;
}

.ich-inline--wrap { flex-wrap: wrap; }
.ich-inline--nowrap { flex-wrap: nowrap; }

.ich-gap--none { gap: 0; }
.ich-gap--sm { gap: var(--ich-layout-grid-gap-sm); }
.ich-gap--md { gap: var(--ich-layout-grid-gap-md); }
.ich-gap--lg { gap: var(--ich-layout-grid-gap-lg); }
.ich-gap--xl { gap: var(--ich-layout-grid-gap-xl); }

.ich-align--start { align-items: flex-start; }
.ich-align--center { align-items: center; }
.ich-align--end { align-items: flex-end; }
.ich-align--stretch { align-items: stretch; }
.ich-self--start { align-self: start; }
.ich-self--center { align-self: center; }
.ich-self--end { align-self: end; }
.ich-self--stretch { align-self: stretch; }
.ich-justify--start { justify-content: flex-start; }
.ich-justify--center { justify-content: center; }
.ich-justify--end { justify-content: flex-end; }
.ich-justify--between { justify-content: space-between; }

.ich-section {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.ich-section__header {
    display: flex;
    align-items: center;
    gap: var(--ich-section-header-gap);
    min-width: 0;
}

.ich-section__icon {
    width: var(--ich-section-icon-size);
    height: var(--ich-section-icon-size);
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: var(--ich-color-primary);
    background: var(--ich-color-primary-soft);
    border-radius: var(--ich-radius-md);
}

.ich-section__copy {
    min-width: 0;
}

.ich-section__copy h2 {
    margin: 0;
    color: var(--ich-color-text);
    font-size: 17px;
    font-weight: 850;
}

.ich-section__copy p {
    margin: 3px 0 0;
    color: var(--ich-color-text-muted);
    font-size: 12px;
    line-height: 1.8;
}

.ich-section__content {
    display: block;
    min-width: 0;
}

@media (max-width: 1024px) {
    .ich-grid--tablet-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .ich-grid--tablet-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ich-grid--tablet-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ich-grid--tablet-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ich-grid--tablet-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ich-grid--tablet-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .ich-grid-item--tablet-span-1 { grid-column: span 1; }
    .ich-grid-item--tablet-span-2 { grid-column: span 2; }
    .ich-grid-item--tablet-span-3 { grid-column: span 3; }
    .ich-grid-item--tablet-span-4 { grid-column: span 4; }
    .ich-grid-item--tablet-span-5 { grid-column: span 5; }
    .ich-grid-item--tablet-span-6 { grid-column: span 6; }
}

@media (max-width: 640px) {
    .ich-grid--mobile-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .ich-grid--mobile-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ich-grid--mobile-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ich-grid--mobile-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ich-grid--mobile-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ich-grid--mobile-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .ich-grid-item--mobile-span-1 { grid-column: span 1; }
    .ich-grid-item--mobile-span-2 { grid-column: span 2; }
    .ich-grid-item--mobile-span-3 { grid-column: span 3; }
    .ich-grid-item--mobile-span-4 { grid-column: span 4; }
    .ich-grid-item--mobile-span-5 { grid-column: span 5; }
    .ich-grid-item--mobile-span-6 { grid-column: span 6; }
    .ich-inline--nowrap { overflow-x: auto; }
    .ich-section__header { align-items: flex-start; }
}

/* =========================================================
   کامپوننت: Toolbar و ActionGroup در iCh
   کاربرد:
   نوار عملیات صفحات، فهرست‌ها، گزارش‌ها و گروه‌بندی دکمه‌های مرتبط.

   نمونه استفاده:
   <new-ui-toolbar variant="Bordered" density="Normal">
       <new-ui-toolbar-start>...</new-ui-toolbar-start>
       <new-ui-toolbar-center>...</new-ui-toolbar-center>
       <new-ui-toolbar-end>...</new-ui-toolbar-end>
   </new-ui-toolbar>

   تنظیمات مرکزی:
   --ich-toolbar-*
   --ich-action-group-*
   ========================================================= */
.ich-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: var(--ich-toolbar-gap);
    border-radius: var(--ich-toolbar-radius);
}

.ich-toolbar--default {
    background: var(--ich-toolbar-surface);
}

.ich-toolbar--bordered {
    background: var(--ich-toolbar-surface);
    border: 1px solid var(--ich-toolbar-border);
}

.ich-toolbar--soft {
    background: var(--ich-toolbar-surface-soft);
    border: 1px solid transparent;
}

.ich-toolbar--transparent {
    background: transparent;
    border: 0;
}

.ich-toolbar--compact {
    min-height: var(--ich-toolbar-min-height-sm);
    padding: var(--ich-toolbar-padding-sm);
}

.ich-toolbar--normal {
    min-height: var(--ich-toolbar-min-height-md);
    padding: var(--ich-toolbar-padding-md);
}

.ich-toolbar--comfortable {
    min-height: var(--ich-toolbar-min-height-lg);
    padding: var(--ich-toolbar-padding-lg);
}

.ich-toolbar__region {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: var(--ich-toolbar-region-gap);
}

.ich-toolbar__region--start {
    grid-column: 1;
    justify-content: flex-start;
}

.ich-toolbar__region--center {
    grid-column: 2;
    justify-content: center;
}

.ich-toolbar__region--end {
    grid-column: 3;
    justify-content: flex-end;
}

.ich-toolbar--wrap .ich-toolbar__region {
    flex-wrap: wrap;
}

.ich-toolbar--nowrap .ich-toolbar__region {
    flex-wrap: nowrap;
}

.ich-action-group {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.ich-action-group--normal {
    gap: var(--ich-action-group-gap);
}

.ich-action-group--compact {
    gap: var(--ich-action-group-gap-compact);
}

.ich-action-group--wrap {
    flex-wrap: wrap;
}

.ich-action-group--nowrap {
    flex-wrap: nowrap;
}

@media (max-width: 900px) {
    .ich-toolbar {
        grid-template-columns: 1fr auto;
    }

    .ich-toolbar__region--start,
    .ich-toolbar__region--end {
        justify-content: flex-start;
    }

    .ich-toolbar__region--center {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .ich-toolbar {
        display: flex;
        align-items: stretch;
        flex-direction: column;
    }

    .ich-toolbar__region,
    .ich-toolbar__region--start,
    .ich-toolbar__region--center,
    .ich-toolbar__region--end {
        width: 100%;
        justify-content: flex-start;
    }

    .ich-toolbar--nowrap {
        overflow-x: auto;
    }

    .ich-action-group--nowrap {
        overflow-x: auto;
    }
}

/* =========================================================
   کامپوننت: Form، Input و Textarea در iCh
   کاربرد:
   فیلدهای متنی دارای عنوان متصل، چیدمان چندستونه فرم و عملیات انتهای فرم.

   نمونه استفاده با عنوان:
   @Html.NewUiInput("title", null, new NewUiInputOptions
   {
       Label = "عنوان",
       LabelWidth = NewUiFieldLabelWidth.Auto,
       Width = NewUiFieldWidth.Full
   })

   نمونه بدون عنوان و با اعتبارسنجی مرورگر:
   @Html.NewUiInput("code", null, new NewUiInputOptions
   {
       Pattern = "[0-9]+",
       IsRequired = true,
       UseBrowserValidationState = true
   })

   تنظیمات مرکزی:
   --ich-field-*
   --ich-form-grid-*
   ========================================================= */
.ich-form-layout {
    width: 100%;
    min-width: 0;
}

.ich-form-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    align-items: start;
}

.ich-form-grid--cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.ich-form-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ich-form-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ich-form-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ich-form-grid--cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ich-form-grid--cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ich-form-grid--gap-sm { gap: var(--ich-form-grid-gap-sm); }
.ich-form-grid--gap-md { gap: var(--ich-form-grid-gap-md); }
.ich-form-grid--gap-lg { gap: var(--ich-form-grid-gap-lg); }
.ich-form-grid__full,
.ich-form-actions--full {
    grid-column: 1 / -1;
}

.ich-field {
    width: 100%;
    min-width: 0;
}

.ich-field--width-full { max-width: none; }
.ich-field--width-sm { max-width: var(--ich-field-width-sm); }
.ich-field--width-md { max-width: var(--ich-field-width-md); }
.ich-field--width-lg { max-width: var(--ich-field-width-lg); }

.ich-field__shell {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--ich-field-text);
    background: var(--ich-field-surface);
    border: var(--ich-field-border-width) solid var(--ich-field-border);
    border-radius: var(--ich-field-radius);
    transition: border-color var(--ich-transition-fast), box-shadow var(--ich-transition-fast), background var(--ich-transition-fast);
}

.ich-field--without-label .ich-field__shell {
    grid-template-columns: minmax(0, 1fr);
}

.ich-field--without-label .ich-field__control {
    grid-column: 1 / -1;
}

.ich-field--sm .ich-field__shell { min-height: var(--ich-field-height-sm); }
.ich-field--md .ich-field__shell { min-height: var(--ich-field-height-md); }
.ich-field--lg .ich-field__shell { min-height: var(--ich-field-height-lg); }

.ich-field__shell:hover {
    border-color: var(--ich-field-border-hover);
}

.ich-field__shell:focus-within {
    border-color: var(--ich-field-border-focus);
    box-shadow: 0 0 0 3px var(--ich-field-focus-ring);
}

.ich-field__label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    padding-inline: var(--ich-field-label-padding-inline);
    color: var(--ich-field-label-text);
    background: var(--ich-field-label-surface);
    border-inline-end: 1px solid var(--ich-field-border);
    font-weight: 800;
    white-space: nowrap;
}

.ich-field--label-auto .ich-field__label { width: max-content; }
.ich-field--label-sm .ich-field__label { width: var(--ich-field-label-width-sm); }
.ich-field--label-md .ich-field__label { width: var(--ich-field-label-width-md); }
.ich-field--label-lg .ich-field__label { width: var(--ich-field-label-width-lg); }
.ich-field--label-xl .ich-field__label { width: var(--ich-field-label-width-xl); }
.ich-field--label-xxl .ich-field__label { width: var(--ich-field-label-width-xxl); }

.ich-field__required {
    margin-inline-start: 4px;
    color: var(--ich-field-error);
}

.ich-field__control {
    display: flex;
    align-items: stretch;
    min-width: 0;
    background: var(--ich-field-surface);
}

.ich-field__input,
.ich-field__textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
    color: var(--ich-field-text);
    background: transparent;
    border: 0;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
    font: inherit;
}

.ich-field__input {
    align-self: stretch;
}

.ich-field--sm .ich-field__input { padding-inline: var(--ich-field-padding-inline-sm); }
.ich-field--md .ich-field__input { padding-inline: var(--ich-field-padding-inline-md); }
.ich-field--lg .ich-field__input { padding-inline: var(--ich-field-padding-inline-lg); }

.ich-field__textarea {
    min-height: var(--ich-textarea-min-height);
    padding: 12px var(--ich-field-padding-inline-md);
    line-height: 1.9;
}

.ich-field__input::placeholder,
.ich-field__textarea::placeholder {
    color: var(--ich-field-placeholder);
    opacity: 1;
}

.ich-field--rtl .ich-field__input,
.ich-field--rtl .ich-field__textarea {
    direction: rtl;
    text-align: right;
}

.ich-field--ltr .ich-field__input,
.ich-field--ltr .ich-field__textarea {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.ich-field__adornment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: var(--ich-field-adornment-gap);
    padding-inline: 11px;
    color: var(--ich-field-help-text);
    background: var(--ich-field-label-surface);
}

.ich-field__adornment--start { border-inline-end: 1px solid var(--ich-field-border); }
.ich-field__adornment--end { border-inline-start: 1px solid var(--ich-field-border); }

.ich-field__meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ich-field-meta-gap);
    margin-top: var(--ich-field-help-margin-top);
    padding-inline: 3px;
    font-size: 12px;
    line-height: 1.7;
}

.ich-field__help { color: var(--ich-field-help-text); }
.ich-field__validation { color: var(--ich-field-error); }

.ich-field--success .ich-field__shell {
    border-color: var(--ich-field-success);
}

.ich-field--success .ich-field__label,
.ich-field--success .ich-field__adornment {
    background: var(--ich-field-success-soft);
}

.ich-field--error .ich-field__shell {
    border-color: var(--ich-field-error);
}

.ich-field--error .ich-field__label,
.ich-field--error .ich-field__adornment {
    color: var(--ich-field-error);
    background: var(--ich-field-error-soft);
}

.ich-field--browser-validation:has(.ich-field__input:user-invalid) .ich-field__shell,
.ich-field--browser-validation:has(.ich-field__textarea:user-invalid) .ich-field__shell {
    border-color: var(--ich-field-error);
}

.ich-field--browser-validation:has(.ich-field__input:user-invalid) .ich-field__label,
.ich-field--browser-validation:has(.ich-field__input:user-invalid) .ich-field__adornment,
.ich-field--browser-validation:has(.ich-field__textarea:user-invalid) .ich-field__label,
.ich-field--browser-validation:has(.ich-field__textarea:user-invalid) .ich-field__adornment {
    background: var(--ich-field-error-soft);
}

.ich-field--browser-validation:has(.ich-field__input:user-valid) .ich-field__shell,
.ich-field--browser-validation:has(.ich-field__textarea:user-valid) .ich-field__shell {
    border-color: var(--ich-field-success);
}

.ich-field--browser-validation:has(.ich-field__input:user-valid) .ich-field__label,
.ich-field--browser-validation:has(.ich-field__input:user-valid) .ich-field__adornment,
.ich-field--browser-validation:has(.ich-field__textarea:user-valid) .ich-field__label,
.ich-field--browser-validation:has(.ich-field__textarea:user-valid) .ich-field__adornment {
    background: var(--ich-field-success-soft);
}

.ich-field__input:disabled,
.ich-field__textarea:disabled {
    cursor: not-allowed;
    color: var(--ich-color-disabled-text);
    background: var(--ich-field-disabled-surface);
}

.ich-field__input[readonly],
.ich-field__textarea[readonly] {
    color: var(--ich-field-help-text);
    background: var(--ich-field-readonly-surface);
}

.ich-field__shell--textarea {
    align-items: stretch;
}

.ich-field__shell--textarea .ich-field__label {
    align-items: center;
}

.ich-textarea--resize-none .ich-field__textarea { resize: none; }
.ich-textarea--resize-vertical .ich-field__textarea { resize: vertical; }
.ich-textarea--resize-both .ich-field__textarea { resize: both; }

.ich-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ich-form-actions-gap);
    padding-top: var(--ich-space-xs);
}

.ich-form-actions--start { justify-content: flex-start; }
.ich-form-actions--center { justify-content: center; }
.ich-form-actions--end { justify-content: flex-end; }
.ich-form-actions--between { justify-content: space-between; }

.ich-demo-code {
    margin: 0;
    overflow: auto;
    direction: ltr;
    text-align: left;
    color: var(--ich-field-text);
    background: var(--ich-field-label-surface);
    border: 1px solid var(--ich-field-border);
    border-radius: var(--ich-radius-md);
    padding: 14px;
    line-height: 1.8;
}

@media (max-width: 1024px) {
    .ich-form-grid--tablet-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .ich-form-grid--tablet-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ich-form-grid--tablet-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ich-form-grid--tablet-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ich-form-grid--tablet-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ich-form-grid--tablet-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .ich-form-grid--mobile-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .ich-form-grid--mobile-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ich-form-grid--mobile-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ich-form-grid--mobile-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ich-form-grid--mobile-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ich-form-grid--mobile-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

    .ich-field--width-sm,
    .ich-field--width-md,
    .ich-field--width-lg {
        max-width: none;
    }

    .ich-field__label {
        padding-inline: 12px;
    }

    .ich-field--label-lg .ich-field__label {
        width: var(--ich-field-label-width-md);
    }

    .ich-field--label-xl .ich-field__label {
        width: var(--ich-field-label-width-lg);
    }

    .ich-field--label-xxl .ich-field__label {
        width: var(--ich-field-label-width-xl);
    }
}

.ich-form-grid-item {
    min-width: 0;
}

.ich-form-grid-item--full {
    grid-column: 1 / -1;
}

.ich-form-grid-item--span-1 { grid-column: span 1; }
.ich-form-grid-item--span-2 { grid-column: span 2; }
.ich-form-grid-item--span-3 { grid-column: span 3; }
.ich-form-grid-item--span-4 { grid-column: span 4; }
.ich-form-grid-item--span-5 { grid-column: span 5; }
.ich-form-grid-item--span-6 { grid-column: span 6; }

@media (max-width: 1024px) {
    .ich-form-grid-item--tablet-span-1 { grid-column: span 1; }
    .ich-form-grid-item--tablet-span-2 { grid-column: span 2; }
    .ich-form-grid-item--tablet-span-3 { grid-column: span 3; }
    .ich-form-grid-item--tablet-span-4 { grid-column: span 4; }
    .ich-form-grid-item--tablet-span-5 { grid-column: span 5; }
    .ich-form-grid-item--tablet-span-6 { grid-column: span 6; }
}

@media (max-width: 640px) {
    .ich-form-grid-item--mobile-span-1 { grid-column: span 1; }
    .ich-form-grid-item--mobile-span-2 { grid-column: span 2; }
    .ich-form-grid-item--mobile-span-3 { grid-column: span 3; }
    .ich-form-grid-item--mobile-span-4 { grid-column: span 4; }
    .ich-form-grid-item--mobile-span-5 { grid-column: span 5; }
    .ich-form-grid-item--mobile-span-6 { grid-column: span 6; }
}

/* =========================================================
   کامپوننت: Select متصل به عنوان
   کاربرد:
   انتخاب مقدار فرم با همان ساختار مرکزی Input؛ عنوان می‌تواند نمایش داده شود
   یا با حذف Label، Select تمام عرض قاب را بگیرد.

   نمونه استفاده:
   @Html.NewUiSelect("scope", items, new NewUiSelectOptions { Label = "اسکوپ" })
   ========================================================= */
.ich-select__control {
    position: relative;
}

.ich-select__input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: var(--ich-field-text);
    font: inherit;
    cursor: pointer;
    padding-inline-end: calc(var(--ich-select-chevron-size) + var(--ich-select-chevron-offset) * 2);
}

.ich-field--sm .ich-select__input { padding-inline-start: var(--ich-field-padding-inline-sm); }
.ich-field--md .ich-select__input { padding-inline-start: var(--ich-field-padding-inline-md); }
.ich-field--lg .ich-select__input { padding-inline-start: var(--ich-field-padding-inline-lg); }

.ich-select__input:disabled {
    cursor: not-allowed;
    color: var(--ich-color-disabled-text);
}

.ich-select__chevron {
    position: absolute;
    inset-inline-end: var(--ich-select-chevron-offset);
    top: 50%;
    width: var(--ich-select-chevron-size);
    height: var(--ich-select-chevron-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: var(--ich-select-chevron);
    pointer-events: none;
}

.ich-select--readonly .ich-field__shell {
    background: var(--ich-field-readonly-surface);
}

.ich-select__readonly-value {
    width: 100%;
    padding-inline: var(--ich-field-padding-inline-md);
    color: var(--ich-field-text);
}

/* =========================================================
   زیرساخت: Overlay و Popup مرکزی iCh
   کاربرد:
   Popupهای Dropdown، تقویم، Tooltip و کامپوننت‌های آینده را خارج از
   Card و ناحیه‌های دارای overflow در یک لایه سراسری رندر می‌کند.

   نمونه استفاده عمومی:
   Trigger: data-ich-overlay-trigger="popup-id"
   Content: data-ich-overlay-content + data-ich-overlay-placement="bottom-start"
   ========================================================= */
.ich-overlay-host {
    position: fixed;
    inset: 0;
    z-index: var(--ich-overlay-z-index);
    pointer-events: none;
    overflow: visible;
}

.ich-overlay-host > [data-ich-overlay-content] {
    pointer-events: auto;
}

.ich-overlay-popup--open {
    position: fixed;
    margin: 0;
}

.ich-overlay-demo-boundary {
    min-height: 150px;
    padding: var(--ich-space-md);
    overflow: hidden;
    border: 1px dashed var(--ich-color-border);
    border-radius: var(--ich-radius-card);
    background: var(--ich-color-surface-soft);
}

.ich-overlay-demo-boundary__note {
    margin-block-end: var(--ich-space-md);
    color: var(--ich-color-text-muted);
    font-size: .88rem;
}

/* =========================================================
   کامپوننت: Dropdown Menu
   کاربرد:
   منوی عملیاتی مستقل برای Toolbar، کارت و ستون عملیات جدول.
   منوی بازشده توسط موتور Overlay به لایه سراسری صفحه منتقل می‌شود.

   نمونه استفاده:
   <partial name="~/Views/NewUi/Shared/Components/_DropdownMenu.cshtml" model="model" />
   ========================================================= */
.ich-dropdown {
    position: relative;
    display: inline-flex;
}

.ich-dropdown__menu {
    min-width: var(--ich-dropdown-min-width);
    max-width: var(--ich-dropdown-max-width);
    padding: var(--ich-dropdown-padding);
    display: grid;
    gap: var(--ich-dropdown-gap);
    background: var(--ich-dropdown-surface);
    border: 1px solid var(--ich-dropdown-border);
    border-radius: var(--ich-dropdown-radius);
    box-shadow: var(--ich-dropdown-shadow);
}

.ich-dropdown__menu[hidden] { display: none; }

.ich-dropdown__item {
    width: 100%;
    min-height: var(--ich-dropdown-item-min-height);
    padding-inline: var(--ich-dropdown-item-padding-inline);
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: calc(var(--ich-dropdown-radius) - 4px);
    background: transparent;
    color: var(--ich-dropdown-text);
    font: inherit;
    text-decoration: none;
    text-align: start;
    cursor: pointer;
}

.ich-dropdown__item:hover,
.ich-dropdown__item:focus-visible {
    background: var(--ich-dropdown-hover);
    outline: none;
}

.ich-dropdown__item--danger { color: var(--ich-dropdown-danger); }
.ich-dropdown__item--danger:hover,
.ich-dropdown__item--danger:focus-visible { background: var(--ich-dropdown-danger-hover); }
.ich-dropdown__item--disabled { color: var(--ich-dropdown-muted); cursor: not-allowed; opacity: .62; }
.ich-dropdown__divider { height: 1px; margin-block: 4px; background: var(--ich-dropdown-divider); }

@media (max-width: 640px) {
    .ich-dropdown__menu {
        min-width: min(var(--ich-dropdown-min-width), calc(100vw - (var(--ich-overlay-viewport-padding) * 2)));
        max-width: calc(100vw - (var(--ich-overlay-viewport-padding) * 2));
    }
}

/* =========================================================
   کامپوننت: Checkbox، RadioButton و Switch
   کاربرد:
   کنترل‌های انتخابی متصل به ModelState با اندازه، توضیح، خطا و حالت Disabled.

   نمونه استفاده:
   @Html.NewUiCheckbox("isActive", true, options)
   @Html.NewUiRadioGroup("type", "person", items, options)
   @Html.NewUiSwitch("sendSms", false, options)
   ========================================================= */
.ich-choice { color: var(--ich-choice-text); }
.ich-choice__label { display: inline-flex; align-items: flex-start; gap: var(--ich-choice-gap-md); cursor: pointer; user-select: none; }
.ich-choice__native { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.ich-choice__content { display: grid; gap: var(--ich-choice-description-gap); min-width: 0; }
.ich-choice__text { line-height: 1.5; }
.ich-choice__description, .ich-choice-group__description { color: var(--ich-choice-description); font-size: .84rem; line-height: 1.65; }
.ich-choice__validation { margin-block-start: 6px; color: var(--ich-choice-error); font-size: .82rem; }
.ich-choice__required { margin-inline-start: 4px; color: var(--ich-choice-error); }
.ich-choice-group__heading { margin-block-end: var(--ich-choice-group-heading-gap); font-weight: 700; }
.ich-choice-group__items { display: flex; gap: var(--ich-choice-group-gap); }
.ich-choice-group--vertical .ich-choice-group__items { flex-direction: column; }
.ich-choice-group--horizontal .ich-choice-group__items { flex-direction: row; flex-wrap: nowrap; }
.ich-radio-group .ich-radio__label { align-items: center; }
.ich-field__control > .ich-radio-group { align-self: center; margin-block-start: var(--ich-space-xs); }

.ich-checkbox__indicator, .ich-radio__indicator {
    flex: 0 0 auto; display: inline-grid; place-items: center;
    inline-size: var(--ich-choice-control-size-md); block-size: var(--ich-choice-control-size-md);
    margin-block-start: 2px; border: 1px solid var(--ich-choice-border); background: var(--ich-choice-surface);
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.ich-checkbox__indicator { border-radius: var(--ich-choice-radius); }
.ich-radio__indicator { border-radius: 50%; }
.ich-choice__native:hover + .ich-checkbox__indicator,
.ich-choice__native:hover + .ich-radio__indicator { border-color: var(--ich-choice-border-hover); }
.ich-choice__native:focus-visible + .ich-checkbox__indicator,
.ich-choice__native:focus-visible + .ich-radio__indicator { box-shadow: 0 0 0 4px var(--ich-choice-focus-ring); }
.ich-choice__native:checked + .ich-checkbox__indicator,
.ich-choice__native:checked + .ich-radio__indicator { border-color: var(--ich-choice-active); background: var(--ich-choice-active); }
.ich-choice__native:checked + .ich-checkbox__indicator::after { content: ""; inline-size: 7px; block-size: 11px; border-right: 2px solid var(--ich-choice-on-active); border-bottom: 2px solid var(--ich-choice-on-active); transform: rotate(45deg) translate(-1px, -1px); transform-origin: center; }
.ich-choice__native:checked + .ich-radio__indicator::after { content: ""; inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--ich-choice-on-active); }
.ich-checkbox--indeterminate .ich-checkbox__indicator { border-color: var(--ich-choice-active); background: var(--ich-choice-active); }
.ich-checkbox--indeterminate .ich-checkbox__indicator::after { content: ""; inline-size: 9px; block-size: 2px; border-radius: 2px; background: var(--ich-choice-on-active); }
.ich-choice__native:disabled + .ich-checkbox__indicator,
.ich-choice__native:disabled + .ich-radio__indicator { border-color: var(--ich-choice-disabled); background: var(--ich-choice-disabled); }
.ich-choice__native:disabled ~ .ich-choice__content { color: var(--ich-choice-disabled-text); }
.ich-choice--error .ich-checkbox__indicator,
.ich-choice--error .ich-radio__indicator { border-color: var(--ich-choice-error); }

.ich-switch__track { position: relative; flex: 0 0 auto; inline-size: var(--ich-switch-width-md); block-size: var(--ich-switch-height-md); margin-block-start: 1px; border: 1px solid var(--ich-choice-border); border-radius: 999px; background: var(--ich-choice-disabled); transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
.ich-switch__thumb { position: absolute; inset-block-start: 50%; inset-inline-start: 3px; inline-size: calc(var(--ich-switch-height-md) - 8px); block-size: calc(var(--ich-switch-height-md) - 8px); border-radius: 50%; background: var(--ich-choice-surface); transform: translateY(-50%); transition: inset-inline-start .16s ease, background-color .16s ease; }
.ich-switch .ich-choice__native:checked + .ich-switch__track { border-color: var(--ich-choice-active); background: var(--ich-choice-active); }
.ich-switch .ich-choice__native:checked + .ich-switch__track .ich-switch__thumb { inset-inline-start: calc(100% - (var(--ich-switch-height-md) - 5px)); background: var(--ich-choice-on-active); }
.ich-switch .ich-choice__native:focus-visible + .ich-switch__track { box-shadow: 0 0 0 4px var(--ich-choice-focus-ring); }
.ich-switch .ich-choice__native:disabled + .ich-switch__track { opacity: .55; }
.ich-switch__state-text { align-self: center; color: var(--ich-choice-description); font-size: .82rem; }
.ich-choice--error .ich-switch__track { border-color: var(--ich-choice-error); }

.ich-choice--sm .ich-checkbox__indicator, .ich-choice--sm .ich-radio__indicator { inline-size: var(--ich-choice-control-size-sm); block-size: var(--ich-choice-control-size-sm); }
.ich-choice--lg .ich-checkbox__indicator, .ich-choice--lg .ich-radio__indicator { inline-size: var(--ich-choice-control-size-lg); block-size: var(--ich-choice-control-size-lg); }
.ich-choice--sm .ich-choice__label { gap: var(--ich-choice-gap-sm); font-size: .88rem; }
.ich-choice--lg .ich-choice__label { gap: var(--ich-choice-gap-lg); font-size: 1rem; }
.ich-choice--sm .ich-switch__track { inline-size: var(--ich-switch-width-sm); block-size: var(--ich-switch-height-sm); }
.ich-choice--sm .ich-switch__thumb { inline-size: calc(var(--ich-switch-height-sm) - 8px); block-size: calc(var(--ich-switch-height-sm) - 8px); }
.ich-choice--sm .ich-choice__native:checked + .ich-switch__track .ich-switch__thumb { inset-inline-start: calc(100% - (var(--ich-switch-height-sm) - 5px)); }
.ich-choice--lg .ich-switch__track { inline-size: var(--ich-switch-width-lg); block-size: var(--ich-switch-height-lg); }
.ich-choice--lg .ich-switch__thumb { inline-size: calc(var(--ich-switch-height-lg) - 8px); block-size: calc(var(--ich-switch-height-lg) - 8px); }
.ich-choice--lg .ich-choice__native:checked + .ich-switch__track .ich-switch__thumb { inset-inline-start: calc(100% - (var(--ich-switch-height-lg) - 5px)); }


/* =========================================================
   کامپوننت: تقویم و ساعت شمسی iCh
   کاربرد:
   فیلد تاریخ، تاریخ‌وساعت و ساعت با عنوان اختیاری و Popup مرکزی.

   نمونه استفاده:
   @Html.NewUiPersianDateTime("StartAt", "1405/05/15 14:30", options)
   ========================================================= */
.ich-persian-datetime__control { position: relative; }
.ich-persian-datetime__input { cursor: pointer; padding-inline-end: 48px; font-variant-numeric: tabular-nums; }
.ich-persian-datetime[data-ich-readonly="true"] .ich-persian-datetime__input { cursor: default; }
.ich-persian-datetime__trigger {
    position: absolute;
    inset-inline-end: 6px;
    inset-block: 6px;
    inline-size: calc(var(--ich-field-height-md) - 12px);
    border: 0;
    border-radius: calc(var(--ich-field-radius) - 4px);
    background: transparent;
    color: var(--ich-field-label-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.ich-field--sm .ich-persian-datetime__trigger { inline-size: calc(var(--ich-field-height-sm) - 10px); inset-block: 5px; }
.ich-field--lg .ich-persian-datetime__trigger { inline-size: calc(var(--ich-field-height-lg) - 12px); }
.ich-persian-datetime__trigger:hover:not(:disabled) { background: var(--ich-datetime-hover); color: var(--ich-datetime-primary); }
.ich-persian-datetime__trigger:disabled { cursor: not-allowed; opacity: .55; }

.ich-persian-datetime__popup {
    position: fixed;
    z-index: var(--ich-overlay-z-index);
    width: min(var(--ich-datetime-popup-width), calc(100vw - 32px));
    padding: var(--ich-datetime-popup-padding);
    border: 1px solid var(--ich-datetime-border);
    border-radius: var(--ich-datetime-popup-radius);
    background: var(--ich-datetime-surface);
    color: var(--ich-datetime-text);
    box-shadow: var(--ich-datetime-shadow);
    direction: rtl;
    font-size: .88rem;
}
.ich-persian-datetime__header,
.ich-persian-datetime__selectors,
.ich-persian-datetime__time,
.ich-persian-datetime__footer { display: flex; align-items: center; }
.ich-persian-datetime__header { justify-content: space-between; gap: 8px; margin-block-end: var(--ich-datetime-popup-gap); }
.ich-persian-datetime__selectors { gap: 6px; flex: 1; }
.ich-persian-datetime__selectors select,
.ich-persian-datetime__time select {
    min-height: var(--ich-datetime-select-height);
    border: 1px solid var(--ich-datetime-border);
    border-radius: 9px;
    background: var(--ich-datetime-surface);
    color: var(--ich-datetime-text);
    padding-inline: 9px;
    font: inherit;
}
.ich-persian-datetime__selectors select:first-child { flex: 1; }
.ich-persian-datetime__nav {
    inline-size: var(--ich-datetime-nav-size);
    block-size: var(--ich-datetime-nav-size);
    border: 1px solid var(--ich-datetime-border);
    border-radius: 10px;
    background: transparent;
    color: var(--ich-datetime-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.ich-persian-datetime__nav:hover { background: var(--ich-datetime-hover); color: var(--ich-datetime-primary); }
.ich-persian-datetime__weekdays,
.ich-persian-datetime__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ich-persian-datetime__weekdays { color: var(--ich-datetime-muted); font-size: .78rem; text-align: center; margin-block-end: 5px; }
.ich-persian-datetime__weekdays span { min-height: 22px; display: grid; place-items: center; }
.ich-persian-datetime__day {
    min-width: 0;
    inline-size: 100%;
    block-size: var(--ich-datetime-day-size);
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ich-datetime-text);
    font: inherit;
    cursor: pointer;
}
.ich-persian-datetime__day:hover:not(:disabled):not(.ich-persian-datetime__day--selected) { background: var(--ich-datetime-hover); }
.ich-persian-datetime__day--today { border-color: var(--ich-datetime-today-border); color: var(--ich-datetime-primary); }
.ich-persian-datetime__day--selected { background: var(--ich-datetime-primary); color: var(--ich-datetime-on-primary); }
.ich-persian-datetime__day:disabled { color: var(--ich-datetime-disabled); cursor: not-allowed; }
.ich-persian-datetime__day--empty { visibility: hidden; }
.ich-persian-datetime__time {
    justify-content: center;
    align-items: stretch;
    gap: 6px;
    margin-block-start: var(--ich-datetime-popup-gap);
    padding-block: 9px;
    border-block: 1px solid var(--ich-datetime-border);
}
.ich-persian-datetime__time-field {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
}
.ich-persian-datetime__time-field .ich-field__shell { width: 100%; min-width: 0; }
.ich-persian-datetime__time-field .ich-field__label {
    width: max-content;
    min-width: 0;
    padding-inline: 8px;
    font-size: .86rem;
}
.ich-persian-datetime__time-field .ich-field__control { min-width: 0; }
.ich-persian-datetime__time-field .ich-field__input {
    min-width: 0;
    padding-inline: 6px;
    text-align: center;
}
.ich-persian-datetime__footer { justify-content: flex-end; gap: 7px; margin-block-start: var(--ich-datetime-popup-gap); }
.ich-persian-datetime__action {
    min-height: 34px;
    padding-inline: 12px;
    border-radius: 9px;
    border: 1px solid transparent;
    font: inherit;
    cursor: pointer;
}
.ich-persian-datetime__action--ghost { background: transparent; color: var(--ich-datetime-text); border-color: var(--ich-datetime-border); }
.ich-persian-datetime__action--primary { background: var(--ich-datetime-primary); color: var(--ich-datetime-on-primary); }
.ich-persian-datetime__action:hover { filter: brightness(.97); }

@media (max-width: 576px) {
    .ich-persian-datetime__popup {
        width: min(var(--ich-datetime-popup-width), calc(100vw - 32px));
        padding: var(--ich-datetime-popup-padding);
    }
    .ich-persian-datetime__day { border-radius: 8px; }
    .ich-persian-datetime__time-field {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
    }
}

/* قاب نمایشی سناریوی Overlay در صفحه Demo تقویم */
.ich-demo-overflow-frame {
    overflow: hidden;
    max-width: 520px;
    padding: 12px;
    border: 1px dashed var(--ich-field-border);
    border-radius: 12px;
}

/* =========================================================
   کامپوننت: جدول iCh
   نمونه استفاده:
   <new-ui-table variant="Management" mobile-cards="true">
       <thead><tr><new-ui-table-header-cell>عنوان</new-ui-table-header-cell></tr></thead>
       <tbody><new-ui-table-row><new-ui-table-cell label="عنوان">مقدار</new-ui-table-cell></new-ui-table-row></tbody>
   در موبایل، هر ردیف به کارت و هر سلول به ساختار دو ستونه «عنوان / مقدار» تبدیل می‌شود.
   ========================================================= */
.ich-table-wrap { width: 100%; overflow: hidden; border: 1px solid var(--ich-color-border); border-radius: var(--ich-table-radius); background: var(--ich-color-surface); }
.ich-table-wrap--mobile-scroll { overflow-x: auto; }

.ich-table--theme-default { --ich-table-theme-soft: var(--ich-color-surface); --ich-table-theme-border: var(--ich-color-border); }
.ich-table--theme-neutral { --ich-table-theme-soft: var(--ich-color-neutral-soft); --ich-table-theme-border: var(--ich-color-neutral); }
.ich-table--theme-info { --ich-table-theme-soft: var(--ich-color-info-soft); --ich-table-theme-border: var(--ich-color-info); }
.ich-table--theme-success { --ich-table-theme-soft: var(--ich-color-success-soft); --ich-table-theme-border: var(--ich-color-success); }
.ich-table--theme-warning { --ich-table-theme-soft: var(--ich-color-warning-soft); --ich-table-theme-border: var(--ich-color-warning); }
.ich-table--theme-danger { --ich-table-theme-soft: var(--ich-color-danger-soft); --ich-table-theme-border: var(--ich-color-danger); }
.ich-table-wrap[class*="ich-table--theme-"]:not(.ich-table--theme-default) {
    border-color: color-mix(in srgb, var(--ich-table-theme-border) 34%, var(--ich-color-border));
    background: color-mix(in srgb, var(--ich-table-theme-soft) 72%, var(--ich-color-surface));
}
.ich-table-wrap[class*="ich-table--theme-"]:not(.ich-table--theme-default) .ich-table thead {
    background: color-mix(in srgb, var(--ich-table-theme-soft) 82%, var(--ich-color-surface));
}
.ich-table-wrap[class*="ich-table--theme-"]:not(.ich-table--theme-default) .ich-table__row:not(.ich-table__row--selected) {
    background: color-mix(in srgb, var(--ich-table-theme-soft) 54%, var(--ich-color-surface));
}
.ich-table { width: 100%; border-collapse: collapse; color: var(--ich-color-text); }
.ich-table thead { background: var(--ich-color-surface-soft); }
.ich-table__head-cell, .ich-table__cell { padding-inline: var(--ich-table-cell-padding-inline); border-bottom: 1px solid var(--ich-color-border); vertical-align: middle; }
.ich-table--density-compact .ich-table__head-cell, .ich-table--density-compact .ich-table__cell { padding-block: var(--ich-table-cell-padding-block-compact); }
.ich-table--density-normal .ich-table__head-cell, .ich-table--density-normal .ich-table__cell { padding-block: var(--ich-table-cell-padding-block-normal); }
.ich-table--density-comfortable .ich-table__head-cell, .ich-table--density-comfortable .ich-table__cell { padding-block: var(--ich-table-cell-padding-block-comfortable); }
.ich-table__head-cell { font-weight: 800; color: var(--ich-color-text-soft); white-space: nowrap; }
.ich-table__row:last-child .ich-table__cell { border-bottom: 0; }
.ich-table__row:hover { background: var(--ich-color-primary-soft); }
.ich-table__row--selected { background: var(--ich-color-primary-soft); }
.ich-table__row--theme-neutral { --ich-table-row-theme-soft: var(--ich-color-neutral-soft); --ich-table-row-theme-border: var(--ich-color-neutral); }
.ich-table__row--theme-info { --ich-table-row-theme-soft: var(--ich-color-info-soft); --ich-table-row-theme-border: var(--ich-color-info); }
.ich-table__row--theme-success { --ich-table-row-theme-soft: var(--ich-color-success-soft); --ich-table-row-theme-border: var(--ich-color-success); }
.ich-table__row--theme-warning { --ich-table-row-theme-soft: var(--ich-color-warning-soft); --ich-table-row-theme-border: var(--ich-color-warning); }
.ich-table__row--theme-danger { --ich-table-row-theme-soft: var(--ich-color-danger-soft); --ich-table-row-theme-border: var(--ich-color-danger); }
.ich-table__row[class*="ich-table__row--theme-"]:not(.ich-table__row--theme-default) {
    background: color-mix(in srgb, var(--ich-table-row-theme-soft) 68%, var(--ich-color-surface));
}
.ich-table__row[class*="ich-table__row--theme-"]:not(.ich-table__row--theme-default):hover {
    background: color-mix(in srgb, var(--ich-table-row-theme-soft) 82%, var(--ich-color-surface));
}
.ich-table__row--disabled { opacity: .55; pointer-events: none; }
.ich-table__cell--start { text-align: start; }
.ich-table__cell--center { text-align: center; }
.ich-table__cell--end { text-align: end; }
.ich-table__cell--ltr { direction: ltr; unicode-bidi: isolate; }
.ich-table__cell--actions .ich-button-group { justify-content: center; }
.ich-table__cell--fit { width: 1%; white-space: nowrap; }
.ich-table__cell--fit .ich-field { width: max-content; max-width: 100%; }
/* Optional 12-unit column sizing for report tables. Apply the same width-units value to the header and body cells. */
.ich-table__cell--w-1 { width: 8.333333%; }
.ich-table__cell--w-2 { width: 16.666667%; }
.ich-table__cell--w-3 { width: 25%; }
.ich-table__cell--w-4 { width: 33.333333%; }
.ich-table__cell--w-5 { width: 41.666667%; }
.ich-table__cell--w-6 { width: 50%; }
.ich-table__cell--w-7 { width: 58.333333%; }
.ich-table__cell--w-8 { width: 66.666667%; }
.ich-table__cell--w-9 { width: 75%; }
.ich-table__cell--w-10 { width: 83.333333%; }
.ich-table__cell--w-11 { width: 91.666667%; }
.ich-table__cell--w-12 { width: 100%; }
.ich-table__cell[class*="ich-table__cell--w-"] .ich-field { width: 100%; max-width: 100%; }
.ich-table__link { color: var(--ich-color-primary); text-decoration: none; font-weight: 700; }
.ich-table__link:hover { text-decoration: underline; }

@media (max-width: 767.98px) {
    .ich-table-wrap--mobile-cards { overflow: visible; border: 0; background: transparent; }
    .ich-table-wrap--mobile-cards .ich-table, .ich-table-wrap--mobile-cards tbody { display: block; }
    .ich-table-wrap--mobile-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .ich-table-wrap--mobile-cards .ich-table__row { display: block; margin-bottom: var(--ich-table-mobile-card-gap); padding: var(--ich-table-mobile-card-padding); border: 1px solid var(--ich-color-border); border-radius: var(--ich-table-radius); background: var(--ich-color-surface); box-shadow: var(--ich-shadow-card); }
    .ich-table-wrap--mobile-cards .ich-table__row[class*="ich-table__row--theme-"]:not(.ich-table__row--theme-default) {
        border-color: color-mix(in srgb, var(--ich-table-row-theme-border) 34%, var(--ich-color-border));
        background: color-mix(in srgb, var(--ich-table-row-theme-soft) 72%, var(--ich-color-surface));
    }
    .ich-table-wrap--mobile-cards[class*="ich-table--theme-"]:not(.ich-table--theme-default) .ich-table__row:not(.ich-table__row--selected) { border-color: color-mix(in srgb, var(--ich-table-theme-border) 34%, var(--ich-color-border)); background: color-mix(in srgb, var(--ich-table-theme-soft) 62%, var(--ich-color-surface)); }
    .ich-table-wrap--mobile-cards .ich-table__cell { display: grid; grid-template-columns: minmax(92px, max-content) minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--ich-color-border); text-align: start; }
    .ich-table-wrap--mobile-cards .ich-table__cell--ltr { direction: rtl; unicode-bidi: normal; text-align: start; }
    .ich-table-wrap--mobile-cards .ich-table__cell--ltr > * { direction: ltr; unicode-bidi: isolate; text-align: start; justify-self: start; }
    .ich-table-wrap--mobile-cards .ich-table__cell:last-child { border-bottom: 0; }
    .ich-table-wrap--mobile-cards .ich-table__cell::before { content: attr(data-label); color: var(--ich-color-text-muted); font-weight: 700; }
    .ich-table-wrap--mobile-cards .ich-table__cell--fit { width: auto; white-space: normal; }
    .ich-table-wrap--mobile-cards .ich-table__cell--actions { grid-template-columns: minmax(92px, max-content) minmax(0, 1fr); }
    .ich-table-wrap--mobile-cards .ich-table__cell--actions::before { margin-bottom: 0; }
    .ich-table-wrap--mobile-cards .ich-table__cell--actions .ich-button-group { justify-content: flex-start; min-width: 0; }
}

/* =========================================================
   کامپوننت: صفحه‌بندی iCh
   نمونه استفاده:
   <new-ui-pagination model="Model.Pagination" />
   صفحات ابتدا، انتها و بازه اطراف صفحه جاری را با فاصله‌گذار نمایش می‌دهد.
   ========================================================= */
.ich-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.ich-pagination__summary { color: var(--ich-color-text-muted); font-size: .92rem; }
.ich-pagination__pages { display: flex; align-items: center; gap: var(--ich-pagination-gap); flex-wrap: wrap; }
.ich-pagination__link { min-width: var(--ich-pagination-control-size); height: var(--ich-pagination-control-size); padding-inline: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--ich-color-border); border-radius: var(--ich-button-radius); background: var(--ich-color-surface); color: var(--ich-color-text); text-decoration: none; font-weight: 700; }
.ich-pagination__link:hover { border-color: var(--ich-color-primary); color: var(--ich-color-primary); }
.ich-pagination__link--active { background: var(--ich-color-primary); border-color: var(--ich-color-primary); color: var(--ich-color-on-primary); }
.ich-pagination__link--disabled { opacity: .45; cursor: not-allowed; }
.ich-pagination__ellipsis { min-width: 24px; text-align: center; color: var(--ich-color-text-muted); }
@media (max-width: 575.98px) { .ich-pagination { align-items: stretch; } .ich-pagination__summary { width: 100%; } .ich-pagination__pages { justify-content: center; } }

/* =========================================================
   کامپوننت: حالت خالی iCh
   نمونه استفاده:
   <partial name="~/Views/NewUi/Shared/Components/_EmptyState.cshtml" model="..." />
   ========================================================= */
.ich-empty-state { min-height: 220px; padding: var(--ich-empty-state-padding); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--ich-color-border-strong); border-radius: var(--ich-table-radius); background: var(--ich-color-surface-soft); }
.ich-empty-state__icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--ich-color-primary-soft); color: var(--ich-color-primary); font-size: 1.7rem; }
.ich-empty-state__title { margin: 14px 0 0; font-size: 1.08rem; }
.ich-empty-state__description { margin: 7px 0 0; color: var(--ich-color-text-muted); max-width: 560px; }
.ich-empty-state__action { margin-top: 16px; }

/* =========================================================
   کامپوننت: Filter Panel و Search Bar در iCh
   کاربرد:
   فیلتر سریع، فیلتر پیشرفته گزارش و فیلتر Inline داخل Toolbar.

   نمونه استفاده:
   <new-ui-filter-panel title="فیلترها" variant="Collapsible">
       ... کنترل‌های NewUi ...
       <new-ui-filter-actions>...</new-ui-filter-actions>
   </new-ui-filter-panel>
   ========================================================= */
.ich-filter {
    border: 1px solid var(--ich-filter-border);
    border-radius: var(--ich-filter-radius);
    background: var(--ich-filter-surface);
    color: var(--ich-filter-text);
    min-width: 0;
}
.ich-filter__header {
    min-height: var(--ich-filter-header-min-height);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-block-end: 1px solid var(--ich-filter-divider);
}
.ich-filter__heading,
.ich-filter__header-actions {
    display: flex;
    align-items: center;
    min-width: 0;
}
.ich-filter__heading { gap: 10px; }
.ich-filter__header-actions { gap: 8px; flex: 0 0 auto; }
.ich-filter__icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ich-filter-icon-surface);
    color: var(--ich-filter-icon);
}
.ich-filter__heading-copy { display: grid; gap: 2px; min-width: 0; }
.ich-filter__title { font-weight: 750; line-height: 1.35; }
.ich-filter__description { color: var(--ich-filter-muted); font-size: .84rem; line-height: 1.5; }
.ich-filter__clear {
    color: var(--ich-filter-muted);
    font-size: .82rem;
    text-decoration: none;
}
.ich-filter__clear:hover { color: var(--ich-filter-icon); }
.ich-filter__content { min-width: 0; }
.ich-filter__body { min-width: 0; }
.ich-filter__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    border-block-start: 1px solid var(--ich-filter-divider);
}
.ich-filter--density-compact .ich-filter__body { padding: var(--ich-filter-padding-compact); }
.ich-filter--density-compact .ich-filter__actions { padding: 9px var(--ich-filter-padding-compact); gap: var(--ich-filter-gap-compact); }
.ich-filter--density-normal .ich-filter__body { padding: var(--ich-filter-padding-normal); }
.ich-filter--density-normal .ich-filter__actions { padding: 11px var(--ich-filter-padding-normal); gap: var(--ich-filter-gap-normal); }
.ich-filter--density-comfortable .ich-filter__body { padding: var(--ich-filter-padding-comfortable); }
.ich-filter--density-comfortable .ich-filter__actions { padding: 14px var(--ich-filter-padding-comfortable); gap: var(--ich-filter-gap-comfortable); }

.ich-filter--collapsible > .ich-filter__header {
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ich-filter--collapsible > .ich-filter__header::-webkit-details-marker { display: none; }
.ich-filter--collapsible > .ich-filter__header:hover { background: var(--ich-filter-hover); }
.ich-filter__chevron { display: inline-flex; transition: transform .18s ease; }
.ich-filter--collapsible[open] .ich-filter__chevron { transform: rotate(180deg); }

.ich-filter--compact { background: var(--ich-filter-surface-soft); }
.ich-filter--compact .ich-filter__header { min-height: 40px; padding-block: 7px; }
.ich-filter--compact .ich-filter__description { display: none; }

.ich-filter--inline {
    border: 0;
    border-radius: 0;
    background: transparent;
}
.ich-filter--inline > .ich-filter__header { display: none; }
.ich-filter--inline .ich-filter__body { padding: 0; }
.ich-filter--inline .ich-filter__actions { border: 0; padding: 0; }

@media (max-width: 768px) {
    .ich-filter__header { align-items: flex-start; }
    .ich-filter__header-actions { flex-wrap: wrap; justify-content: flex-end; }
    .ich-filter__description { font-size: .8rem; }
    .ich-filter--inline { width: 100%; }
    .ich-filter--inline .ich-inline { width: 100%; }
}

@media (max-width: 520px) {
    .ich-filter__header { padding-inline: 10px; }
    .ich-filter__icon { width: 30px; height: 30px; flex-basis: 30px; }
    .ich-filter__actions,
    .ich-filter__actions .ich-button-group { width: 100%; }
    .ich-filter__actions .ich-btn:not(.ich-btn--icon-only) { flex: 1 1 auto; }
}

/* =========================================================
   کامپوننت: Alert، Inline Message و Toast در iCh
   کاربرد:
   پیام داخل صفحه، نتیجه کوتاه کنار کنترل و اعلان موقت سراسری.

   نمونه استفاده Alert:
   @Html.NewUiAlert(new NewUiAlertOptions { Message = "ثبت شد", Theme = NewUiAlertTheme.Success })

   نمونه استفاده Inline Message:
   @Html.NewUiInlineMessage(new NewUiInlineMessageOptions { Text = "مقدار معتبر است", Theme = NewUiAlertTheme.Success })

   نمونه استفاده Toast سمت مرورگر:
   window.iChToast.show({ theme: "success", message: "ثبت شد", position: "topstart" });
   ========================================================= */
.ich-feedback--neutral { --ich-feedback-accent: var(--ich-feedback-neutral); --ich-feedback-soft: var(--ich-feedback-neutral-soft); --ich-feedback-border: var(--ich-feedback-neutral-border); }
.ich-feedback--info { --ich-feedback-accent: var(--ich-feedback-info); --ich-feedback-soft: var(--ich-feedback-info-soft); --ich-feedback-border: var(--ich-feedback-info-border); }
.ich-feedback--success { --ich-feedback-accent: var(--ich-feedback-success); --ich-feedback-soft: var(--ich-feedback-success-soft); --ich-feedback-border: var(--ich-feedback-success-border); }
.ich-feedback--warning { --ich-feedback-accent: var(--ich-feedback-warning); --ich-feedback-soft: var(--ich-feedback-warning-soft); --ich-feedback-border: var(--ich-feedback-warning-border); }
.ich-feedback--danger { --ich-feedback-accent: var(--ich-feedback-danger); --ich-feedback-soft: var(--ich-feedback-danger-soft); --ich-feedback-border: var(--ich-feedback-danger-border); }

.ich-alert {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--ich-feedback-gap);
    padding: var(--ich-feedback-padding);
    border: 1px solid var(--ich-feedback-border);
    border-inline-start: 4px solid var(--ich-feedback-accent);
    border-radius: var(--ich-feedback-radius);
    background: var(--ich-feedback-soft);
    color: var(--ich-feedback-text);
}
.ich-alert--compact { padding: var(--ich-feedback-padding-compact); }
.ich-alert__icon {
    width: var(--ich-feedback-icon-size);
    height: var(--ich-feedback-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--ich-feedback-accent) 12%, transparent);
    color: var(--ich-feedback-accent);
    font-size: 1.05rem;
}
.ich-alert__content { display: grid; gap: 3px; min-width: 0; }
.ich-alert__title { font-size: .94rem; line-height: 1.55; }
.ich-alert__message { color: var(--ich-feedback-muted); font-size: .88rem; line-height: 1.75; }
.ich-alert__action { width: fit-content; margin-top: 4px; color: var(--ich-feedback-accent); font-size: .84rem; font-weight: 700; text-decoration: none; }
.ich-alert__action:hover { text-decoration: underline; }
.ich-alert__close,
.ich-toast__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--ich-feedback-muted);
    cursor: pointer;
}
.ich-alert__close:hover,
.ich-toast__close:hover { background: color-mix(in srgb, var(--ich-feedback-accent) 10%, transparent); color: var(--ich-feedback-accent); }

.ich-inline-message {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ich-feedback-accent);
    font-size: .82rem;
    line-height: 1.6;
}
.ich-inline-message > i { flex: 0 0 auto; }

.ich-toast-stack {
    position: fixed;
    z-index: var(--ich-toast-z-index);
    width: min(var(--ich-toast-width), calc(100vw - (var(--ich-toast-offset) * 2)));
    display: flex;
    flex-direction: column;
    gap: var(--ich-toast-gap);
    pointer-events: none;
}
.ich-toast-stack--top-start { inset-block-start: var(--ich-toast-offset); inset-inline-start: var(--ich-toast-offset); }
.ich-toast-stack--top-end { inset-block-start: var(--ich-toast-offset); inset-inline-end: var(--ich-toast-offset); }
.ich-toast-stack--bottom-start { inset-block-end: var(--ich-toast-offset); inset-inline-start: var(--ich-toast-offset); }
.ich-toast-stack--bottom-end { inset-block-end: var(--ich-toast-offset); inset-inline-end: var(--ich-toast-offset); }

.ich-toast {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--ich-feedback-gap);
    padding: 13px;
    border: 1px solid var(--ich-feedback-border);
    border-inline-start: 4px solid var(--ich-feedback-accent);
    border-radius: var(--ich-feedback-radius);
    background: var(--ich-feedback-surface);
    color: var(--ich-feedback-text);
    box-shadow: var(--ich-feedback-shadow);
    pointer-events: auto;
    animation: ich-toast-enter var(--ich-toast-transition) both;
}
.ich-toast--closing { animation: ich-toast-exit var(--ich-toast-transition) both; }
.ich-toast__icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--ich-feedback-soft);
    color: var(--ich-feedback-accent);
}
.ich-toast__content { min-width: 0; display: grid; gap: 3px; }
.ich-toast__title { font-size: .92rem; line-height: 1.5; }
.ich-toast__message { color: var(--ich-feedback-muted); font-size: .84rem; line-height: 1.65; }
.ich-toast__action { width: fit-content; margin-top: 3px; color: var(--ich-feedback-accent); font-size: .82rem; font-weight: 700; text-decoration: none; }
.ich-toast__progress { position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px; background: var(--ich-feedback-accent); transform-origin: right center; animation: ich-toast-progress 5s linear forwards; }

.ich-toast-stack--preview {
    position: static;
    width: 100%;
    max-width: var(--ich-toast-width);
    pointer-events: auto;
}
.ich-toast-stack--preview .ich-toast { box-shadow: none; }

@keyframes ich-toast-enter { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ich-toast-exit { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes ich-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 520px) {
    .ich-toast-stack { width: calc(100vw - 20px); inset-inline: 10px auto; }
    .ich-toast-stack--top-end { inset-inline: auto 10px; }
    .ich-toast-stack--bottom-start { inset-inline: 10px auto; }
    .ich-toast-stack--bottom-end { inset-inline: auto 10px; }
    .ich-alert { grid-template-columns: auto minmax(0, 1fr) auto; padding: 11px; }
}


/* =========================================================
   ابزار نمایشی: بلوک کد در صفحات Demo iCh
   کاربرد:
   نمایش نمونه API بدون اثرگذاری روی کد اجرایی صفحه.

   نمونه استفاده:
   <pre class="ich-code-block"><code>...</code></pre>
   ========================================================= */
.ich-code-block {
    margin: 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-md);
    background: var(--ich-color-surface-soft);
    color: var(--ich-color-text);
    direction: ltr;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .82rem;
    line-height: 1.7;
}

/* =========================================================
   کامپوننت: Tabs در iCh
   کاربرد:
   ناوبری لینک‌محور بین بخش‌های هم‌سطح یک صفحه با آیکون، Badge و حالت غیرفعال.

   نمونه استفاده:
   <new-ui-tabs variant="Underline" size="Medium">
       <new-ui-tab text="اطلاعات" url="/Customers/15" active="true" />
       <new-ui-tab text="مالی" url="/Customers/15/Finance" badge-text="۳" />
   </new-ui-tabs>
   ========================================================= */
.ich-tabs {
    max-inline-size: 100%;
    color: var(--ich-tabs-text);
}

.ich-tabs__scroller {
    display: flex;
    align-items: center;
    gap: var(--ich-tabs-gap);
    max-inline-size: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--ich-tabs-border) transparent;
    -webkit-overflow-scrolling: touch;
}

.ich-tabs__scroller::-webkit-scrollbar { block-size: var(--ich-tabs-scrollbar-size); }
.ich-tabs__scroller::-webkit-scrollbar-track { background: transparent; }
.ich-tabs__scroller::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--ich-tabs-border); }

.ich-tab {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-inline-size: max-content;
    border: 1px solid transparent;
    border-radius: var(--ich-tabs-item-radius);
    color: var(--ich-tabs-text);
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.ich-tab:hover:not(.ich-tab--disabled) {
    color: var(--ich-tabs-text-active);
    background: var(--ich-tabs-hover);
}

.ich-tab:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--ich-tabs-focus);
}

.ich-tab--active {
    color: var(--ich-tabs-text-active);
}

.ich-tab--disabled {
    color: var(--ich-tabs-disabled);
    cursor: not-allowed;
    opacity: .72;
}

.ich-tab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ich-tab__badge {
    flex: 0 0 auto;
    min-inline-size: 21px;
}

.ich-tabs--sm .ich-tab {
    min-block-size: var(--ich-tabs-height-sm);
    padding-inline: var(--ich-tabs-padding-inline-sm);
    font-size: var(--ich-tabs-font-size-sm);
}

.ich-tabs--md .ich-tab {
    min-block-size: var(--ich-tabs-height-md);
    padding-inline: var(--ich-tabs-padding-inline-md);
    font-size: var(--ich-tabs-font-size-md);
}

.ich-tabs--lg .ich-tab {
    min-block-size: var(--ich-tabs-height-lg);
    padding-inline: var(--ich-tabs-padding-inline-lg);
    font-size: var(--ich-tabs-font-size-lg);
}

.ich-tabs--default .ich-tabs__scroller {
    padding: var(--ich-tabs-padding);
    border: 1px solid var(--ich-tabs-border);
    border-radius: var(--ich-tabs-radius);
    background: var(--ich-tabs-surface);
}

.ich-tabs--default .ich-tab--active {
    border-color: var(--ich-tabs-border);
    background: var(--ich-tabs-active-soft);
}

.ich-tabs--underline .ich-tabs__scroller {
    gap: 2px;
    border-block-end: 1px solid var(--ich-tabs-border);
}

.ich-tabs--underline .ich-tab {
    border-radius: var(--ich-tabs-item-radius) var(--ich-tabs-item-radius) 0 0;
}

.ich-tabs--underline .ich-tab::after {
    content: "";
    position: absolute;
    inset-inline: 10px;
    inset-block-end: -1px;
    block-size: var(--ich-tabs-underline-size);
    border-radius: 999px 999px 0 0;
    background: transparent;
}

.ich-tabs--underline .ich-tab--active::after {
    background: var(--ich-tabs-text-active);
}

.ich-tabs--pill .ich-tabs__scroller {
    padding: var(--ich-tabs-padding);
    border-radius: 999px;
    background: var(--ich-tabs-surface-soft);
}

.ich-tabs--pill .ich-tab { border-radius: 999px; }
.ich-tabs--pill .ich-tab--active {
    border-color: var(--ich-tabs-border);
    background: var(--ich-tabs-active);
    box-shadow: var(--ich-tabs-shadow);
}

.ich-tabs--segmented .ich-tabs__scroller {
    gap: 0;
    padding: 3px;
    border: 1px solid var(--ich-tabs-border);
    border-radius: var(--ich-tabs-radius);
    background: var(--ich-tabs-surface-soft);
}

.ich-tabs--segmented .ich-tab {
    border-radius: calc(var(--ich-tabs-item-radius) - 2px);
}

.ich-tabs--segmented .ich-tab--active {
    border-color: var(--ich-tabs-border);
    background: var(--ich-tabs-active);
    box-shadow: var(--ich-tabs-shadow);
}

@media (max-width: 768px) {
    .ich-tabs__scroller {
        justify-content: flex-start;
        scroll-snap-type: inline proximity;
    }
    .ich-tab { scroll-snap-align: start; }
}

/* =========================================================
   کامپوننت: Loading، Skeleton و Progress در iCh
   کاربرد:
   نمایش انتظار، ساختار موقت محتوا و درصد پیشرفت عملیات.

   نمونه استفاده:
   @Html.NewUiLoading(new NewUiLoadingOptions { Text = "در حال دریافت" })
   <new-ui-skeleton type="Table" rows="5" columns="6"></new-ui-skeleton>
   @Html.NewUiProgress(new NewUiProgressOptions { Value = 42, Max = 100 })
   ========================================================= */
.ich-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ich-loading-gap);
    color: var(--ich-loading-text);
    font: inherit;
}

.ich-loading[hidden] { display: none !important; }
.ich-loading--block { display: flex; inline-size: 100%; padding: var(--ich-loading-block-padding); }
.ich-loading--inline { vertical-align: middle; }
.ich-loading__visual { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ich-loading__spinner {
    display: block;
    inline-size: var(--ich-loading-spinner-md);
    block-size: var(--ich-loading-spinner-md);
    border: 2px solid color-mix(in srgb, var(--ich-loading-indicator) 24%, transparent);
    border-top-color: var(--ich-loading-indicator);
    border-radius: 50%;
    animation: ich-loading-spin .75s linear infinite;
}
.ich-loading--sm .ich-loading__spinner { inline-size: var(--ich-loading-spinner-sm); block-size: var(--ich-loading-spinner-sm); }
.ich-loading--lg .ich-loading__spinner { inline-size: var(--ich-loading-spinner-lg); block-size: var(--ich-loading-spinner-lg); border-width: 3px; }
.ich-loading__text { line-height: 1.5; }
.ich-loading--sm .ich-loading__text { font-size: .78rem; }
.ich-loading--md .ich-loading__text { font-size: .86rem; }
.ich-loading--lg .ich-loading__text { font-size: .94rem; }
.ich-loading--dots .ich-loading__visual { gap: 4px; }
.ich-loading__dot {
    inline-size: 7px;
    block-size: 7px;
    border-radius: 50%;
    background: var(--ich-loading-indicator);
    animation: ich-loading-dot 1s ease-in-out infinite;
}
.ich-loading__dot:nth-child(2) { animation-delay: .14s; }
.ich-loading__dot:nth-child(3) { animation-delay: .28s; }
.ich-loading--sm .ich-loading__dot { inline-size: 5px; block-size: 5px; }
.ich-loading--lg .ich-loading__dot { inline-size: 9px; block-size: 9px; }

.ich-loading-host {
    position: relative;
    min-block-size: 110px;
    overflow: hidden;
    border-radius: var(--ich-loading-overlay-radius);
}
.ich-loading--overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    background: var(--ich-loading-overlay);
    backdrop-filter: blur(var(--ich-loading-overlay-backdrop-blur));
}

@keyframes ich-loading-spin { to { transform: rotate(360deg); } }
@keyframes ich-loading-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.ich-skeleton {
    display: block;
    inline-size: 100%;
    border-radius: var(--ich-skeleton-radius);
}
.ich-skeleton[hidden] { display: none !important; }
.ich-skeleton__line,
.ich-skeleton__value,
.ich-skeleton__media,
.ich-skeleton__cell,
.ich-skeleton__label,
.ich-skeleton__control {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--ich-skeleton-base);
    border-radius: var(--ich-skeleton-radius);
}
.ich-skeleton__line::after,
.ich-skeleton__value::after,
.ich-skeleton__media::after,
.ich-skeleton__cell::after,
.ich-skeleton__label::after,
.ich-skeleton__control::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(100%);
    background: linear-gradient(90deg, transparent, var(--ich-skeleton-highlight), transparent);
    animation: ich-skeleton-shimmer var(--ich-skeleton-animation-duration) infinite;
}
.ich-skeleton__line { block-size: var(--ich-skeleton-line-height); inline-size: 100%; margin-block: 8px; }
.ich-skeleton__line--long { inline-size: 100%; }
.ich-skeleton__line--medium { inline-size: 68%; }
.ich-skeleton__line--short { inline-size: 42%; }
.ich-skeleton__value { block-size: 28px; inline-size: 52%; margin-block: 10px; }
.ich-skeleton__media { inline-size: var(--ich-skeleton-media-size); block-size: var(--ich-skeleton-media-size); border-radius: 16px; flex: 0 0 auto; }
.ich-skeleton__media--square { border-radius: 14px; }
.ich-skeleton__stack { flex: 1 1 auto; min-inline-size: 0; }
.ich-skeleton--card,
.ich-skeleton--statcard {
    display: flex;
    align-items: center;
    gap: 16px;
    min-block-size: 112px;
    padding: 16px;
    border: 1px solid var(--ich-skeleton-base);
}
.ich-skeleton--statcard { justify-content: space-between; }
.ich-skeleton--paragraph { padding-block: 4px; }
.ich-skeleton__table-row {
    display: grid;
    grid-template-columns: repeat(var(--ich-skeleton-columns, 4), minmax(0, 1fr));
    gap: 10px;
    padding: 9px 0;
    border-block-end: 1px solid var(--ich-skeleton-base);
}
.ich-skeleton__table-row--header { opacity: .8; }
.ich-skeleton__cell { block-size: 14px; }
.ich-skeleton__form-row {
    display: grid;
    grid-template-columns: minmax(80px, auto) minmax(0, 1fr);
    gap: 10px;
    margin-block: 10px;
}
.ich-skeleton__label { block-size: var(--ich-skeleton-control-height); inline-size: 92px; }
.ich-skeleton__control { block-size: var(--ich-skeleton-control-height); inline-size: 100%; }
@keyframes ich-skeleton-shimmer { 100% { transform: translateX(-100%); } }

.ich-progress {
    display: grid;
    gap: var(--ich-progress-gap);
    inline-size: 100%;
}
.ich-progress__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ich-progress-text); }
.ich-progress__label { font-size: .84rem; font-weight: 650; }
.ich-progress__value { font-size: .78rem; font-variant-numeric: tabular-nums; }
.ich-progress__track {
    position: relative;
    overflow: hidden;
    inline-size: 100%;
    block-size: var(--ich-progress-height-md);
    border-radius: var(--ich-progress-radius);
    background: var(--ich-progress-track);
}
.ich-progress--sm .ich-progress__track { block-size: var(--ich-progress-height-sm); }
.ich-progress--lg .ich-progress__track { block-size: var(--ich-progress-height-lg); }
.ich-progress__bar {
    block-size: 100%;
    border-radius: inherit;
    background: var(--ich-progress-primary);
    transition: width var(--ich-progress-transition);
}
.ich-progress--info .ich-progress__bar { background: var(--ich-progress-info); }
.ich-progress--success .ich-progress__bar { background: var(--ich-progress-success); }
.ich-progress--warning .ich-progress__bar { background: var(--ich-progress-warning); }
.ich-progress--danger .ich-progress__bar { background: var(--ich-progress-danger); }
.ich-progress--neutral .ich-progress__bar { background: var(--ich-progress-neutral); }
.ich-progress--indeterminate .ich-progress__bar {
    inline-size: 34% !important;
    animation: ich-progress-indeterminate 1.15s ease-in-out infinite;
}
@keyframes ich-progress-indeterminate {
    0% { transform: translateX(130%); }
    100% { transform: translateX(-330%); }
}

.ich-demo-content-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-block-size: 110px;
    padding: 16px;
    border: 1px solid var(--ich-demo-result-border);
    border-radius: var(--ich-card-radius);
    background: var(--ich-demo-result-surface);
    color: var(--ich-demo-result-text);
}
.ich-demo-result {
    padding: var(--ich-choice-box-option-padding-block) var(--ich-choice-box-option-padding-inline);
    border: 1px solid var(--ich-demo-result-border);
    border-radius: 10px;
    background: var(--ich-demo-result-surface);
    color: var(--ich-demo-result-text);
    font-size: .82rem;
}

@media (prefers-reduced-motion: reduce) {
    .ich-loading__spinner,
    .ich-loading__dot,
    .ich-skeleton__line::after,
    .ich-skeleton__value::after,
    .ich-skeleton__media::after,
    .ich-skeleton__cell::after,
    .ich-skeleton__label::after,
    .ich-skeleton__control::after,
    .ich-progress--indeterminate .ich-progress__bar {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (max-width: 767.98px) {
    .ich-loading--block { padding: 18px; }
    .ich-skeleton--card,
    .ich-skeleton--statcard { padding: 13px; min-block-size: 96px; }
    .ich-skeleton__table-row { gap: 7px; }
}

/* =========================================================
   کامپوننت: Modal و Confirm Dialog در iCh
   کاربرد:
   نمایش محتوای متمرکز، فرم کوتاه و تأیید عملیات حساس.

   نمونه استفاده:
   <partial name="~/Views/NewUi/Shared/Components/_Modal.cshtml" model="Model.EditModal" />
   Trigger: data-ich-modal-open="edit-modal"
   Confirm: await window.iChModal.confirm({ title: "حذف", theme: "danger" })
   ========================================================= */
html.ich-modal-open,
body.ich-modal-open { overflow: hidden; }

.ich-modal {
    position: fixed;
    inset: 0;
    z-index: calc(var(--ich-modal-z-index) + var(--ich-modal-stack-index, 0));
    display: grid;
    place-items: center;
    padding: var(--ich-modal-viewport-gap);
}

.ich-modal[hidden] { display: none !important; }

.ich-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--ich-modal-backdrop);
    backdrop-filter: blur(2px);
}

.ich-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    inline-size: min(var(--ich-modal-width-md), calc(100vw - 2 * var(--ich-modal-viewport-gap)));
    max-block-size: var(--ich-modal-max-height);
    overflow: hidden;
    border: 1px solid var(--ich-modal-border);
    border-radius: var(--ich-modal-radius);
    background: var(--ich-modal-surface);
    box-shadow: var(--ich-modal-shadow);
    color: var(--ich-modal-text);
    opacity: 0;
    transform: translateY(10px) scale(.985);
    transition: opacity var(--ich-modal-transition), transform var(--ich-modal-transition);
    outline: none;
}

.ich-modal--open .ich-modal__dialog { opacity: 1; transform: translateY(0) scale(1); }
.ich-modal--sm .ich-modal__dialog { inline-size: min(var(--ich-modal-width-sm), calc(100vw - 2 * var(--ich-modal-viewport-gap))); }
.ich-modal--md .ich-modal__dialog { inline-size: min(var(--ich-modal-width-md), calc(100vw - 2 * var(--ich-modal-viewport-gap))); }
.ich-modal--lg .ich-modal__dialog { inline-size: min(var(--ich-modal-width-lg), calc(100vw - 2 * var(--ich-modal-viewport-gap))); }
.ich-modal--xl .ich-modal__dialog { inline-size: min(var(--ich-modal-width-xl), calc(100vw - 2 * var(--ich-modal-viewport-gap))); }

.ich-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: var(--ich-modal-gap);
    padding: var(--ich-modal-header-padding);
    border-block-end: 1px solid var(--ich-modal-border);
    background: var(--ich-modal-surface-soft);
}

.ich-modal__heading { display: flex; align-items: center; gap: 11px; min-inline-size: 0; flex: 1 1 auto; overflow: hidden; }
.ich-modal__heading-text { min-inline-size: 0; overflow: hidden; }
.ich-modal__header > .ich-button-group { flex: 0 0 auto; flex-wrap: nowrap; margin-inline-start: auto; }
.ich-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: var(--ich-modal-icon-size);
    block-size: var(--ich-modal-icon-size);
    flex: 0 0 var(--ich-modal-icon-size);
    border-radius: 11px;
    background: var(--ich-modal-neutral-soft);
    color: var(--ich-modal-neutral);
    font-size: 1.02rem;
}
.ich-modal--info .ich-modal__icon { background: var(--ich-modal-info-soft); color: var(--ich-modal-info); }
.ich-modal--success .ich-modal__icon { background: var(--ich-modal-success-soft); color: var(--ich-modal-success); }
.ich-modal--warning .ich-modal__icon { background: var(--ich-modal-warning-soft); color: var(--ich-modal-warning); }
.ich-modal--danger .ich-modal__icon { background: var(--ich-modal-danger-soft); color: var(--ich-modal-danger); }

.ich-modal__title { margin: 0; color: var(--ich-modal-text); font-size: 1rem; font-weight: 760; line-height: 1.55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ich-modal__description { margin: 3px 0 0; color: var(--ich-modal-text-muted); font-size: .79rem; line-height: 1.65; }
.ich-modal__body { overflow: auto; padding: var(--ich-modal-body-padding); overscroll-behavior: contain; }
.ich-modal__message { margin: 0; color: var(--ich-modal-text); font-size: .88rem; line-height: 1.9; }
.ich-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: var(--ich-modal-footer-padding);
    border-block-start: 1px solid var(--ich-modal-border);
    background: var(--ich-modal-surface-soft);
}
.ich-modal__footer .ich-button-group { display: flex; flex-wrap: wrap; gap: 8px; }

.ich-confirm .ich-modal__message { font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
    .ich-modal__dialog { transition-duration: .001ms !important; }
}

@media (max-width: 767.98px) {
    .ich-modal { align-items: end; padding: 10px; }
    .ich-modal--fullscreen-mobile { padding: 0; }
    .ich-modal--fullscreen-mobile .ich-modal__dialog {
        inline-size: 100vw;
        max-inline-size: none;
        block-size: 100dvh;
        max-block-size: 100dvh;
        border-width: 0;
        border-radius: 0;
    }
    .ich-modal:not(.ich-modal--fullscreen-mobile) .ich-modal__dialog { max-block-size: calc(100dvh - 20px); }
    .ich-modal__header { padding: 13px 14px; }
    .ich-modal__body { padding: 14px; }
    .ich-modal__footer { padding: 11px 14px; }
}

/* =========================================================
   کامپوننت: Tooltip و Popover در iCh
   کاربرد:
   Tooltip برای توضیح کوتاه و غیرتعاملی؛ Popover برای محتوای چندخطی،
   Badge و Action. هر دو از Host سراسری Overlay استفاده می‌کنند.

   نمونه Tooltip:
   <button data-ich-tooltip="ویرایش رکورد" data-ich-tooltip-placement="top">...</button>

   نمونه Popover:
   Partial مرکزی _Popover.cshtml با NewUiPopoverModel.
   ========================================================= */
.ich-tooltip {
    position: fixed;
    z-index: var(--ich-tooltip-z-index);
    max-inline-size: min(var(--ich-tooltip-max-width), calc(100vw - 20px));
    padding: var(--ich-tooltip-padding);
    border-radius: var(--ich-tooltip-radius);
    font-size: var(--ich-tooltip-font-size);
    line-height: var(--ich-tooltip-line-height);
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: var(--ich-tooltip-shadow);
    opacity: 0;
    transform: translateY(2px) scale(.98);
    transition: opacity var(--ich-tooltip-transition), transform var(--ich-tooltip-transition);
    pointer-events: none;
}

.ich-tooltip--open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.ich-tooltip--dark { background: var(--ich-tooltip-dark-bg); color: var(--ich-tooltip-dark-text); }
.ich-tooltip--light { background: var(--ich-tooltip-light-bg); color: var(--ich-tooltip-light-text); border: 1px solid var(--ich-tooltip-light-border); }
.ich-tooltip--info { background: var(--ich-tooltip-info-bg); color: var(--ich-tooltip-info-text); }
.ich-tooltip--warning { background: var(--ich-tooltip-warning-bg); color: var(--ich-tooltip-warning-text); }
.ich-tooltip--success { background: var(--ich-tooltip-success-bg); color: var(--ich-tooltip-success-text); }
.ich-tooltip--danger { background: var(--ich-tooltip-danger-bg); color: var(--ich-tooltip-danger-text); }

.ich-tooltip::after {
    content: "";
    position: absolute;
    inline-size: 0;
    block-size: 0;
    border: var(--ich-tooltip-arrow-size) solid transparent;
}
.ich-tooltip[data-ich-tooltip-resolved-placement="top"]::after {
    inset-block-start: 100%;
    inset-inline-start: 50%;
    transform: translateX(50%);
    border-block-start-color: currentColor;
    opacity: .22;
}
.ich-tooltip[data-ich-tooltip-resolved-placement="bottom"]::after {
    inset-block-end: 100%;
    inset-inline-start: 50%;
    transform: translateX(50%);
    border-block-end-color: currentColor;
    opacity: .22;
}

.ich-popover { display: inline-flex; max-inline-size: 100%; }
.ich-popover__panel {
    inline-size: min(var(--ich-popover-width), calc(100vw - 2 * var(--ich-popover-viewport-gap)));
    max-inline-size: var(--ich-popover-max-width);
    overflow: hidden;
    border: 1px solid var(--ich-popover-border);
    border-radius: var(--ich-popover-radius);
    background: var(--ich-popover-surface);
    color: var(--ich-popover-text);
    box-shadow: var(--ich-popover-shadow);
}
.ich-popover__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ich-popover-gap);
    padding: var(--ich-popover-header-padding);
    border-block-end: 1px solid var(--ich-popover-border);
    background: var(--ich-popover-surface-soft);
}
.ich-popover__heading { display: flex; align-items: center; gap: 8px; min-inline-size: 0; }
.ich-popover__icon {
    display: inline-grid;
    place-items: center;
    inline-size: var(--ich-popover-icon-size);
    block-size: var(--ich-popover-icon-size);
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--ich-popover-icon-surface);
    color: var(--ich-popover-icon);
}
.ich-popover__title { min-inline-size: 0; font-size: .86rem; font-weight: 750; }
.ich-popover__body { padding: var(--ich-popover-body-padding); color: var(--ich-popover-text); }
.ich-popover__body p { margin: 0; color: var(--ich-popover-muted); font-size: .82rem; line-height: 1.85; }
.ich-popover__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    padding: var(--ich-popover-actions-padding);
    border-block-start: 1px solid var(--ich-popover-border);
    background: var(--ich-popover-surface-soft);
}
.ich-tooltip-demo-text {
    display: inline-block;
    max-inline-size: 260px;
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--ich-color-border);
    border-radius: 9px;
    background: var(--ich-color-surface-soft);
    color: var(--ich-color-text);
}

@media (max-width: 640px) {
    .ich-popover__panel {
        inline-size: min(310px, calc(100vw - 24px));
    }
    .ich-tooltip {
        max-inline-size: min(230px, calc(100vw - 20px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .ich-tooltip { transition: none; }
}

/* =========================================================
   کامپوننت: Breadcrumb مرکزی iCh
   کاربرد:
   نمایش مسیر سلسله‌مراتبی صفحه در هدر مرکزی. در موبایل آیتم‌های
   میانی پنهان می‌شوند و فقط ابتدا و صفحه جاری باقی می‌مانند.

   نمونه استفاده:
   <partial name="~/Views/NewUi/Shared/Components/_Breadcrumb.cshtml" model="Model.Header.Breadcrumb" />

   تنظیمات مرکزی:
   --ich-breadcrumb-gap
   --ich-breadcrumb-item-gap
   --ich-breadcrumb-font-size
   --ich-breadcrumb-margin-bottom
   ========================================================= */
.ich-breadcrumb {
    max-width: 100%;
    margin: 0 0 var(--ich-breadcrumb-margin-bottom);
    color: var(--ich-color-text-muted);
    font-size: var(--ich-breadcrumb-font-size);
    font-weight: 650;
}

.ich-breadcrumb__list {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--ich-breadcrumb-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.ich-breadcrumb__item {
    min-width: 0;
    display: inline-flex;
    align-items: center;
}

.ich-breadcrumb__link,
.ich-breadcrumb__current {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--ich-breadcrumb-item-gap);
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.ich-breadcrumb__link:hover,
.ich-breadcrumb__link:focus-visible {
    color: var(--ich-color-primary-strong);
}

.ich-breadcrumb__link:focus-visible {
    outline: 2px solid var(--ich-color-primary);
    outline-offset: 3px;
    border-radius: 6px;
}

.ich-breadcrumb__item--active .ich-breadcrumb__current {
    color: var(--ich-color-text);
    font-weight: 800;
}

.ich-breadcrumb__separator {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    color: var(--ich-color-text-muted);
    font-size: 9px;
    opacity: .68;
}

@media (max-width: 640px) {
    .ich-breadcrumb__item--middle,
    .ich-breadcrumb__item--middle + .ich-breadcrumb__separator {
        display: none;
    }

    .ich-breadcrumb__item--edge + .ich-breadcrumb__separator {
        display: inline-grid;
    }

    .ich-breadcrumb__item:first-child + .ich-breadcrumb__separator::before {
        content: "…";
        font-size: 12px;
    }

    .ich-breadcrumb__item:first-child + .ich-breadcrumb__separator i {
        display: none;
    }
}

/* =========================================================
   کامپوننت: Accordion و Collapse مرکزی iCh
   کاربرد:
   تقسیم محتوای طولانی به بخش‌های باز و بسته‌شونده. حالت Single فقط
   یک Item باز نگه می‌دارد و Multiple اجازه بازبودن چند Item را می‌دهد.

   نمونه استفاده:
   <new-ui-accordion mode="Single">
       <new-ui-accordion-item title="تنظیمات" open="true">...</new-ui-accordion-item>
   </new-ui-accordion>

   تنظیمات مرکزی:
   --ich-accordion-radius
   --ich-accordion-item-gap
   --ich-accordion-summary-min-height
   --ich-accordion-content-padding
   ========================================================= */
.ich-accordion {
    display: grid;
    gap: var(--ich-accordion-item-gap);
    min-width: 0;
}

.ich-accordion__item {
    min-width: 0;
    overflow: clip;
    background: var(--ich-accordion-surface);
    border: 1px solid var(--ich-accordion-border);
    border-radius: var(--ich-accordion-radius);
}

.ich-accordion__summary {
    min-height: var(--ich-accordion-summary-min-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ich-space-sm);
    padding: var(--ich-accordion-summary-padding-block) var(--ich-accordion-summary-padding-inline);
    color: var(--ich-accordion-title);
    background: transparent;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background var(--ich-transition-fast), color var(--ich-transition-fast);
}

.ich-accordion__summary::-webkit-details-marker { display: none; }
.ich-accordion__summary::marker { content: ""; }

.ich-accordion__summary:hover { background: var(--ich-accordion-surface-hover); }

.ich-accordion__summary:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 2px var(--ich-color-primary), 0 0 0 3px var(--ich-accordion-focus-ring);
}

.ich-accordion__item[open] > .ich-accordion__summary {
    background: var(--ich-accordion-surface-open);
}

.ich-accordion__summary-main,
.ich-accordion__summary-side,
.ich-accordion__copy {
    min-width: 0;
    display: flex;
    align-items: center;
}

.ich-accordion__summary-main {
    flex: 1 1 auto;
    gap: var(--ich-space-sm);
}

.ich-accordion__summary-side {
    flex: 0 0 auto;
    gap: var(--ich-space-xs);
}

.ich-accordion__copy {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ich-accordion-copy-gap);
}

.ich-accordion__title {
    color: var(--ich-accordion-title);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
}

.ich-accordion__description {
    color: var(--ich-accordion-description);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
}

.ich-accordion__icon {
    inline-size: var(--ich-accordion-icon-size);
    block-size: var(--ich-accordion-icon-size);
    flex: 0 0 var(--ich-accordion-icon-size);
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--ich-accordion-icon-text);
    background: var(--ich-accordion-icon-surface);
}

.ich-accordion__chevron {
    inline-size: var(--ich-accordion-chevron-size);
    block-size: var(--ich-accordion-chevron-size);
    display: grid;
    place-items: center;
    color: var(--ich-accordion-chevron);
    border-radius: 9px;
    transition: transform var(--ich-transition-fast), background var(--ich-transition-fast);
}

.ich-accordion__item[open] > .ich-accordion__summary .ich-accordion__chevron {
    transform: rotate(180deg);
}

.ich-accordion__panel {
    border-top: 1px solid var(--ich-accordion-border);
}

.ich-accordion__content {
    min-width: 0;
    padding: var(--ich-accordion-content-padding);
}

.ich-accordion__item--disabled {
    background: var(--ich-accordion-disabled-surface);
    opacity: .62;
}

.ich-accordion__item--disabled > .ich-accordion__summary {
    cursor: not-allowed;
}

.ich-accordion__item--disabled > .ich-accordion__summary:hover {
    background: transparent;
}

@media (max-width: 640px) {
    .ich-accordion__summary {
        align-items: flex-start;
        padding-inline: 12px;
    }

    .ich-accordion__summary-side {
        align-self: center;
    }

    .ich-accordion__description {
        white-space: normal;
    }

    .ich-accordion__content {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ich-accordion__summary,
    .ich-accordion__chevron {
        transition: none;
    }
}

/* =========================================================
   کامپوننت: File Upload iCh
   کاربرد:
   انتخاب فایل تکی/چندفایلی، Drag & Drop، محدودیت نوع/حجم و پیش‌نمایش تصویر.

   نمونه استفاده:
   @Html.NewUiFileUpload("Files", new NewUiFileUploadOptions { Variant = NewUiFileUploadVariant.DropZone })
   ========================================================= */
.ich-file-upload { display:grid; gap:var(--ich-file-upload-gap); color:var(--ich-file-upload-text); }
.ich-file-upload__label { font-size:12px; font-weight:800; }
.ich-file-upload__zone { min-height:var(--ich-file-upload-dropzone-height); display:flex; align-items:center; justify-content:center; gap:12px; padding:18px; border:1.5px dashed var(--ich-file-upload-border); border-radius:var(--ich-radius-card); background:var(--ich-file-upload-soft); transition:border-color var(--ich-transition-fast), background var(--ich-transition-fast); }
.ich-file-upload--default .ich-file-upload__zone { min-height:90px; justify-content:flex-start; }
.ich-file-upload--compact .ich-file-upload__zone { min-height:58px; padding:10px 12px; justify-content:flex-start; border-style:solid; }
.ich-file-upload--dragover .ich-file-upload__zone { border-color:var(--ich-color-primary); background:var(--ich-file-upload-drag); }
.ich-file-upload__icon { width:46px; height:46px; display:grid; place-items:center; flex:0 0 auto; border-radius:13px; color:var(--ich-color-primary-strong); background:var(--ich-color-primary-soft); font-size:22px; }
.ich-file-upload__copy { min-width:0; display:grid; gap:2px; flex:1 1 auto; }
.ich-file-upload__copy strong { font-size:13px; }
.ich-file-upload__copy span { color:var(--ich-file-upload-muted); font-size:11px; }
.ich-file-upload__input { position:absolute !important; width:1px !important; height:1px !important; opacity:0 !important; pointer-events:none; }
.ich-file-upload__select { flex:0 0 auto; cursor:pointer; }
.ich-file-upload__files { display:grid; gap:7px; }
.ich-file-upload__file { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:9px; padding:8px 10px; border:1px solid var(--ich-file-upload-border); border-radius:var(--ich-radius-md); background:var(--ich-file-upload-surface); }
.ich-file-upload__file-media { width:var(--ich-file-upload-preview-size); height:var(--ich-file-upload-preview-size); display:grid; place-items:center; overflow:hidden; border-radius:10px; color:var(--ich-color-primary-strong); background:var(--ich-color-primary-soft); font-size:20px; }
.ich-file-upload__file-media img { width:100%; height:100%; object-fit:cover; }
.ich-file-upload__file-copy { min-width:0; display:grid; gap:1px; }
.ich-file-upload__file-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.ich-file-upload__file-copy small { color:var(--ich-file-upload-muted); font-size:10px; }
.ich-file-upload__remove { width:30px; height:30px; display:grid; place-items:center; border:0; border-radius:9px; color:var(--ich-color-danger); background:var(--ich-color-danger-soft); cursor:pointer; }
.ich-file-upload__error { min-height:0; color:var(--ich-file-upload-error); font-size:11px; }
.ich-file-upload__error:empty { display:none; }
.ich-file-upload__help { color:var(--ich-file-upload-muted); font-size:11px; }
.ich-file-upload--disabled { opacity:.62; pointer-events:none; }
.ich-file-upload--error .ich-file-upload__zone { border-color:var(--ich-file-upload-error); }
.ich-file-upload--success .ich-file-upload__zone { border-color:var(--ich-file-upload-success); }

/* =========================================================
   کامپوننت: Stepper / Wizard iCh
   کاربرد:
   نمایش مراحل Pending/Current/Completed/Error/Disabled و ناوبری Wizard سمت سرور.

   نمونه استفاده:
   <new-ui-stepper orientation="Horizontal"><new-ui-step number="1" title="اطلاعات" state="Completed" /></new-ui-stepper>
   ========================================================= */
.ich-stepper { list-style:none; margin:0; padding:0; display:flex; gap:var(--ich-stepper-gap); }
.ich-stepper__step { position:relative; min-width:0; flex:1 1 0; }
.ich-stepper__step:not(:last-child)::after { content:""; position:absolute; top:17px; right:calc(50% + 24px); left:calc(-50% + 24px); height:2px; background:var(--ich-stepper-line); z-index:0; }
.ich-stepper__link { position:relative; z-index:1; display:flex; align-items:center; gap:9px; color:inherit; text-decoration:none; }
.ich-stepper__marker { width:var(--ich-stepper-marker-size-md); height:var(--ich-stepper-marker-size-md); display:grid; place-items:center; flex:0 0 auto; border:2px solid var(--ich-stepper-pending); border-radius:50%; color:var(--ich-stepper-pending); background:var(--ich-color-surface); font-size:11px; font-weight:900; }
.ich-stepper__copy { min-width:0; display:grid; gap:2px; padding-top:0; }
.ich-stepper--horizontal .ich-stepper__copy--with-description { gap:6px; transform:none; }
.ich-stepper--horizontal .ich-stepper__copy--with-description .ich-stepper__title,
.ich-stepper--horizontal .ich-stepper__copy--with-description .ich-stepper__description { line-height:14px; }
.ich-stepper--horizontal .ich-stepper__copy--single,
.ich-stepper--compact .ich-stepper__copy--single { transform:translateY(-12px); }
.ich-stepper__title { font-size:12px; font-weight:850; }
.ich-stepper__description { color:var(--ich-color-text-muted); font-size:10px; line-height:1.7; }
.ich-stepper__step--current .ich-stepper__marker { border-color:var(--ich-stepper-current); color:var(--ich-color-on-primary); background:var(--ich-stepper-current); }
.ich-stepper__step--completed .ich-stepper__marker { border-color:var(--ich-stepper-completed); color:#fff; background:var(--ich-stepper-completed); }
.ich-stepper__step--error .ich-stepper__marker { border-color:var(--ich-stepper-error); color:#fff; background:var(--ich-stepper-error); }
.ich-stepper__step--disabled { color:var(--ich-stepper-disabled); }
.ich-stepper__step--disabled .ich-stepper__marker { border-color:var(--ich-stepper-disabled); color:var(--ich-stepper-disabled); }
.ich-stepper--small .ich-stepper__marker { width:var(--ich-stepper-marker-size-sm); height:var(--ich-stepper-marker-size-sm); }
.ich-stepper--large .ich-stepper__marker { width:var(--ich-stepper-marker-size-lg); height:var(--ich-stepper-marker-size-lg); }
.ich-stepper--horizontal { direction:ltr; }
.ich-stepper--horizontal .ich-stepper__link { direction:rtl; }
.ich-stepper--horizontal .ich-stepper__step:not(:last-child)::after { left:calc(50% + 24px); right:calc(-50% + 24px); }
.ich-stepper--vertical { display:grid; }
.ich-stepper--vertical .ich-stepper__step { min-height:58px; }
.ich-stepper--vertical .ich-stepper__step:not(:last-child)::after { top:34px; right:17px; left:auto; width:2px; height:calc(100% - 18px); }
.ich-stepper--compact .ich-stepper__description { display:none; }
.ich-wizard-actions { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:var(--ich-wizard-actions-gap); direction:ltr; padding-top:12px; margin-top:14px; border-top:1px solid var(--ich-color-border); }
.ich-wizard-actions .ich-btn { direction:rtl; }
.ich-wizard-actions > .ich-btn:first-child .ich-btn__icon { order:2; }

@media (max-width: 860px) {
    .ich-page-header { top:0; }
    .ich-page-header__actions { justify-content:flex-start; }
    .ich-mobile-menu-button { margin:0; }
    .ich-stepper--horizontal { display:grid; grid-template-columns:1fr; gap:8px; }
    .ich-stepper--horizontal .ich-stepper__copy--with-description,
    .ich-stepper--horizontal .ich-stepper__copy--single { transform:none; }
    .ich-stepper--horizontal .ich-stepper__step { display:none; }
    .ich-stepper--horizontal .ich-stepper__step--current { display:block; }
    .ich-stepper--horizontal .ich-stepper__step--current::after { display:none; }
    .ich-stepper--horizontal .ich-stepper__step--current .ich-stepper__title::before { content:"مرحله جاری: "; color:var(--ich-color-text-muted); font-weight:650; }
}

@media (max-width: 640px) {
    .ich-page-header__actions { align-self:stretch; justify-content:flex-start; }
    .ich-page-header__notifications { flex:1 1 auto; width:auto; min-width:0; grid-template-columns:repeat(auto-fit, minmax(110px,1fr)); }
    .ich-mobile-menu-button { flex:0 0 46px; }
    .ich-file-upload__zone { min-height:120px; flex-wrap:wrap; justify-content:flex-start; }
    .ich-file-upload__copy { flex-basis:calc(100% - 60px); }
    .ich-file-upload__select { margin-inline-start:58px; }
}

/* =========================================================
   زیرساخت: Ajax Region در NewUi
   کاربرد:
   هر بخشی که باید مستقل از سرور Refresh شود یک Region است.
   مثال:
   <new-ui-region id="charges-region" url="/Charges/Region">...</new-ui-region>
   سپس لینک یا فرم با new-ui-ajax و target-region همان شناسه را هدف می‌گیرد.
   ========================================================= */
.ich-ajax-region { position:relative; min-width:0; }
.ich-ajax-region[aria-busy="true"] { cursor:progress; }
.ich-ajax-region__loading { position:absolute; inset:0; z-index:12; display:grid; place-items:center; min-height:64px; padding:12px; border-radius:inherit; background:var(--ich-ajax-loading-backdrop); backdrop-filter:blur(1px); }
.ich-ajax-region__loading[hidden] { display:none !important; }
.ich-demo-ajax-value { display:grid; gap:4px; padding:14px 16px; border:1px solid var(--ich-ajax-demo-border); border-radius:var(--ich-radius-card); background:var(--ich-ajax-demo-surface); color:var(--ich-ajax-demo-text); }
.ich-demo-ajax-value span { font-size:11px; color:var(--ich-ajax-demo-muted); }
.ich-demo-ajax-value strong { font-size:20px; font-weight:900; }
.ich-demo-ajax-value small { font-size:10px; color:var(--ich-ajax-demo-muted); }
.ich-demo-ajax-region-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:10px; color:var(--ich-ajax-demo-text); }
.ich-demo-ajax-region-head small, .ich-demo-note { color:var(--ich-ajax-demo-muted); font-size:11px; line-height:1.9; }
.ich-table__row[aria-busy="true"] { opacity:.58; transition:opacity var(--ich-transition-fast); }


/* =========================================================
   Copy / Clipboard
   ابزار عمومی کپی مستقل از Detail و TechnicalViewer.
   ========================================================= */
.ich-copy-value { display:inline-flex; align-items:center; gap:7px; max-width:100%; padding:4px 8px; border:0; border-radius:var(--ich-button-radius); color:inherit; background:transparent; font:inherit; cursor:pointer; transition:background-color .16s ease,color .16s ease; }
.ich-copy-value:hover { background:var(--ich-color-surface-soft); color:var(--ich-color-primary); }
.ich-copy-value:focus-visible { outline:2px solid var(--ich-color-primary); outline-offset:2px; }
.ich-copy-value__content { min-width:0; overflow-wrap:anywhere; }
.ich-copy-value__icon { flex:0 0 auto; color:var(--ich-color-text-muted); font-size:.9em; }
.ich-copy--copied { color:var(--ich-color-success) !important; }
.ich-copy-button.ich-copy--copied { background:var(--ich-color-success-soft); }

/* =========================================================
   Detail / KeyValue
   نمایش فقط‌خواندنی عنوان و مقدار.
   ========================================================= */
.ich-detail-list { --ich-detail-columns:2; --ich-detail-columns-tablet:2; --ich-detail-columns-mobile:1; display:grid; grid-template-columns:repeat(var(--ich-detail-columns),minmax(0,1fr)); gap:10px; margin:0; }
.ich-detail-item { min-width:0; grid-column:span var(--ich-detail-item-span,1); display:grid; grid-template-columns:minmax(90px,auto) minmax(0,1fr); align-items:stretch; border:1px solid var(--ich-color-border); border-radius:var(--ich-card-radius); background:var(--ich-color-surface); overflow:hidden; }
.ich-detail-item__label { display:flex; align-items:center; gap:7px; margin:0; padding:10px 12px; color:var(--ich-color-text-muted); background:var(--ich-color-surface-soft); font-weight:750; }
.ich-detail-item__value { min-width:0; display:flex; align-items:center; gap:7px; margin:0; padding:10px 12px; color:var(--ich-color-text); overflow-wrap:anywhere; }
.ich-detail-item__value--empty { color:var(--ich-color-text-muted); }
.ich-detail-item__copy { width:100%; min-width:0; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:0; border:0; color:inherit; background:transparent; font:inherit; text-align:inherit; cursor:pointer; }
.ich-detail-item__copy:hover { color:var(--ich-color-primary); }
.ich-detail-item--success { border-color:var(--ich-color-success); }
.ich-detail-item--warning { border-color:var(--ich-color-warning); }
.ich-detail-item--danger { border-color:var(--ich-color-danger); }
.ich-detail-item--muted { opacity:.72; }
.ich-detail-list--separated .ich-detail-item { border-radius:var(--ich-button-radius); }
.ich-detail-list--soft .ich-detail-item { background:var(--ich-color-surface-soft); }
.ich-detail-list--soft .ich-detail-item__label { background:var(--ich-color-surface); }
.ich-detail-list--small .ich-detail-item__label,
.ich-detail-list--small .ich-detail-item__value { padding:7px 9px; font-size:.88rem; }
.ich-detail-list--large .ich-detail-item__label,
.ich-detail-list--large .ich-detail-item__value { padding:13px 15px; }

/* =========================================================
   TechnicalViewer
   JSON / Command / Log / Error / Raw output.
   ========================================================= */
.ich-technical-viewer { border:1px solid var(--ich-color-border); border-radius:var(--ich-card-radius); background:var(--ich-color-surface); overflow:hidden; }
.ich-technical-viewer__header { min-height:48px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; color:var(--ich-color-text); background:var(--ich-color-surface-soft); }
summary.ich-technical-viewer__header { cursor:pointer; list-style:none; }
summary.ich-technical-viewer__header::-webkit-details-marker { display:none; }
.ich-technical-viewer__title-box { min-width:0; display:flex; align-items:center; gap:9px; }
.ich-technical-viewer__title-box > i { color:var(--ich-color-primary); font-size:1rem; }
.ich-technical-viewer__title-box > div { min-width:0; display:grid; gap:2px; }
.ich-technical-viewer__title-box strong { font-size:.92rem; }
.ich-technical-viewer__title-box span { color:var(--ich-color-text-muted); font-size:.78rem; }
.ich-technical-viewer__tools { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
.ich-technical-viewer__meta,
.ich-technical-viewer__actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.ich-technical-viewer__body { min-width:0; border-top:1px solid var(--ich-color-border); }
.ich-technical-viewer__content { max-height:var(--ich-technical-max-height,400px); margin:0; padding:14px; overflow:auto; direction:ltr; text-align:left; white-space:pre; color:var(--ich-color-text); background:var(--ich-color-surface); font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; font-size:.82rem; line-height:1.75; tab-size:4; }
.ich-technical-viewer__content--wrap { white-space:pre-wrap; overflow-wrap:anywhere; }
.ich-technical-viewer__content--lines { counter-reset:ich-technical-line; padding:8px 0; }
.ich-technical-viewer__line { display:block; min-width:max-content; padding:0 14px 0 52px; position:relative; counter-increment:ich-technical-line; }
.ich-technical-viewer__line::before { content:counter(ich-technical-line); position:absolute; left:0; width:40px; padding-right:8px; color:var(--ich-color-text-muted); text-align:right; user-select:none; border-right:1px solid var(--ich-color-border); }
.ich-technical-viewer__empty { min-height:110px; display:flex; align-items:center; justify-content:center; gap:8px; padding:20px; color:var(--ich-color-text-muted); }
.ich-technical-viewer--error { border-color:var(--ich-color-danger); }
.ich-technical-viewer--error .ich-technical-viewer__header { background:var(--ich-color-danger-soft); }
.ich-technical-viewer--error .ich-technical-viewer__title-box > i { color:var(--ich-color-danger); }
.ich-technical-viewer--command .ich-technical-viewer__title-box > i,
.ich-technical-viewer--code .ich-technical-viewer__title-box > i { color:var(--ich-color-info); }

/* =========================================================
   Collection / Repeater
   Add / Remove / Reindex / Reorder فرم‌های Collection.
   ========================================================= */
.ich-repeater { display:grid; gap:10px; }
.ich-repeater__items { display:grid; gap:10px; }
.ich-repeater__item { min-width:0; border:1px solid var(--ich-color-border); border-radius:var(--ich-card-radius); background:var(--ich-color-surface); overflow:hidden; }
.ich-repeater__item-header { min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 10px; background:var(--ich-color-surface-soft); border-bottom:1px solid var(--ich-color-border); }
.ich-repeater__item-title { min-width:0; display:flex; align-items:center; gap:8px; }
.ich-repeater__item-title [data-ich-repeater-number] { color:var(--ich-color-text-muted); font-size:.82rem; }
.ich-repeater__item-actions { display:flex; align-items:center; gap:3px; flex-wrap:nowrap; }
.ich-repeater__item-content { padding:12px; }

.ich-repeater__item--collapsible > .ich-repeater__item-header { cursor:pointer; list-style:none; }
.ich-repeater__item--collapsible > .ich-repeater__item-header::-webkit-details-marker { display:none; }
.ich-repeater__item--collapsible .ich-repeater__item-collapse { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; color:var(--ich-color-text-muted); }
.ich-repeater__item--collapsible[open] .ich-repeater__item-collapse i { transform:rotate(180deg); }
.ich-repeater__footer { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.ich-repeater__counter { color:var(--ich-color-text-muted); font-size:.82rem; }
.ich-repeater__empty { min-height:120px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; padding:18px; border:1px dashed var(--ich-color-border-strong); border-radius:var(--ich-card-radius); color:var(--ich-color-text-muted); background:var(--ich-color-surface-soft); text-align:center; }
.ich-repeater__empty > i { font-size:1.45rem; color:var(--ich-color-primary); }
.ich-repeater[data-ich-repeater-reorder="false"] [data-ich-repeater-move] { display:none; }

@media (max-width: 900px) {
    .ich-detail-list { grid-template-columns:repeat(var(--ich-detail-columns-tablet),minmax(0,1fr)); }
    .ich-detail-item { grid-column:span var(--ich-detail-item-span-tablet,1); }
}

@media (max-width: 640px) {
    .ich-detail-list { grid-template-columns:repeat(var(--ich-detail-columns-mobile),minmax(0,1fr)); }
    .ich-detail-item { grid-column:span var(--ich-detail-item-span-mobile,1); grid-template-columns:minmax(82px,auto) minmax(0,1fr); }
    .ich-detail-item__label,
    .ich-detail-item__value { padding:9px 10px; }
    .ich-technical-viewer__header { align-items:flex-start; flex-direction:column; }
    .ich-technical-viewer__tools { width:100%; justify-content:flex-start; }
    .ich-repeater__item-header { align-items:flex-start; }
    .ich-repeater__item-actions { flex:0 0 auto; }
}


/* =========================================================
   TreeView
   ساختار سلسله‌مراتبی عمومی با Meta/Actions آزاد، Keyboard و ARIA.
   ========================================================= */
.ich-tree {
    --ich-tree-indent: 22px;
    --ich-tree-row-gap: 8px;
    display: grid;
    gap: 4px;
    min-width: 0;
    direction: rtl;
}

.ich-tree-node {
    min-width: 0;
    outline: none;
}

.ich-tree-node__row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--ich-tree-row-gap);
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: var(--ich-button-radius);
    background: transparent;
    direction: rtl;
    transition:
        background-color var(--ich-transition-fast),
        border-color var(--ich-transition-fast),
        box-shadow var(--ich-transition-fast);
}

.ich-tree-node__row:hover {
    background: var(--ich-color-surface-soft);
}

.ich-tree-node:focus > .ich-tree-node__row {
    border-color: var(--ich-color-primary-border);
    box-shadow: 0 0 0 2px var(--ich-color-primary-soft);
}

.ich-tree-node__toggle {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--ich-color-text-muted);
    background: transparent;
    cursor: pointer;
}

.ich-tree-node__toggle:hover {
    color: var(--ich-color-primary);
    background: var(--ich-color-primary-soft);
}

.ich-tree-node__toggle > i {
    transition: transform var(--ich-transition-fast);
}

.ich-tree-node[aria-expanded="true"] > .ich-tree-node__row .ich-tree-node__toggle > i {
    transform: rotate(-90deg);
}

.ich-tree-node__toggle--leaf {
    pointer-events: none;
}

.ich-tree-node__icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border-radius: 9px;
    color: var(--ich-color-primary-strong);
    background: var(--ich-color-primary-soft);
}

.ich-tree-node__content {
    min-width: 0;
    max-width: none;
    display: grid;
    gap: 2px;
    flex: 0 1 auto;
    direction: rtl;
    text-align: right;
}

.ich-tree-node__content[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.ich-tree-node__content[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.ich-tree-node__title {
    min-width: 0;
    color: var(--ich-color-text);
    font-weight: 780;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

a.ich-tree-node__title {
    text-decoration: none;
}

a.ich-tree-node__title:hover {
    color: var(--ich-color-primary);
}

.ich-tree-node__title--segmented {
    display: inline-flex;
    align-items: baseline;
    gap: .32em;
    font-weight: 560;
    white-space: nowrap;
}

.ich-tree-node__title-prefix {
    font-weight: 520;
    color: var(--ich-color-text-muted);
}

.ich-tree-node__title-current {
    font-weight: 850;
    color: var(--ich-color-text);
}

.ich-tree-node__description {
    min-width: 0;
    color: var(--ich-color-text-muted);
    font-size: .78rem;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.ich-tree-node__meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    flex-wrap: wrap;
    direction: rtl;
}

.ich-tree-node__actions {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    direction: rtl;
}

/* فقط اگر Row فضای اضافه داشته باشد، آن فضا بعد از Actions می‌ماند.
   اجزای Node کنار هم و از راست به چپ باقی می‌مانند. */
.ich-tree-node__actions:last-child {
    margin-inline-end: 0;
}

.ich-tree-node__children {
    display: grid;
    gap: 3px;
    min-width: 0;
    margin-inline-start: 0;
    padding-inline-start: var(--ich-tree-indent);
}

.ich-tree-node__children[hidden] {
    display: none !important;
}

.ich-tree--lines .ich-tree-node__children {
    position: relative;
}

.ich-tree--lines .ich-tree-node__children::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-start: calc(var(--ich-tree-indent) / 2);
    border-inline-start: 1px solid var(--ich-color-border);
    pointer-events: none;
}

.ich-tree--lines .ich-tree-node__children > .ich-tree-node {
    position: relative;
}

.ich-tree--lines .ich-tree-node__children > .ich-tree-node::before {
    content: "";
    position: absolute;
    top: 24px;
    inset-inline-start: calc(-1 * var(--ich-tree-indent) / 2);
    width: calc(var(--ich-tree-indent) / 2);
    border-top: 1px solid var(--ich-color-border);
    pointer-events: none;
}

.ich-tree-node--selected > .ich-tree-node__row {
    border-color: var(--ich-color-primary-border);
    background: var(--ich-color-primary-soft);
}

.ich-tree-node--selected > .ich-tree-node__row .ich-tree-node__title {
    color: var(--ich-color-primary-strong);
}

.ich-tree-node--warning > .ich-tree-node__row {
    border-color: var(--ich-color-warning);
    background: var(--ich-color-warning-soft);
}

.ich-tree-node--error > .ich-tree-node__row {
    border-color: var(--ich-color-danger);
    background: var(--ich-color-danger-soft);
}

.ich-tree-node--disabled {
    opacity: .55;
}

.ich-tree-node--disabled > .ich-tree-node__row {
    cursor: not-allowed;
}

.ich-tree--small {
    --ich-tree-row-gap: 6px;
}

.ich-tree--small .ich-tree-node__row {
    padding: 5px 7px;
}

.ich-tree--small .ich-tree-node__toggle {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
}

.ich-tree--small .ich-tree-node__icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
}

.ich-tree--small .ich-tree-node__content {
    min-width: 0;
}

.ich-tree--large .ich-tree-node__row {
    padding: 10px 12px;
}

.ich-tree__empty {
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border: 1px dashed var(--ich-color-border-strong);
    border-radius: var(--ich-card-radius);
    color: var(--ich-color-text-muted);
    background: var(--ich-color-surface-soft);
    text-align: center;
}

.ich-tree__empty > i {
    color: var(--ich-color-primary);
    font-size: 1.6rem;
}

/* Tablet:
   ساختار اصلی Row حفظ می‌شود؛ فقط Meta و Actions در صورت کمبود فضا Wrap می‌شوند. */
@media (max-width: 980px) {
    .ich-tree-node__row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .ich-tree-node__content {
        min-width: 0;
        max-width: calc(100% - 90px);
        flex: 0 1 auto;
    }

    .ich-tree-node__meta {
        flex: 1 1 100%;
        padding-inline-start: calc(30px + 34px + (2 * var(--ich-tree-row-gap)));
    }

    .ich-tree-node__actions {
        flex: 0 0 auto;
        margin-inline-start: calc(30px + 34px + (2 * var(--ich-tree-row-gap)));
    }

    .ich-tree-node__children {
        padding-inline-start: min(var(--ich-tree-indent), 18px);
    }
}

/* Mobile:
   Indent کم می‌شود و Meta/Actions زیر Title می‌آیند، ولی ترتیب RTL عوض نمی‌شود. */
@media (max-width: 640px) {
    .ich-tree {
        --ich-tree-indent: 14px;
        --ich-tree-row-gap: 6px;
    }

    .ich-tree-node__row,
    .ich-tree--small .ich-tree-node__row {
        padding: 7px 6px;
    }

    .ich-tree-node__toggle {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .ich-tree-node__icon,
    .ich-tree--small .ich-tree-node__icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .ich-tree-node__content,
    .ich-tree--small .ich-tree-node__content {
        min-width: 0;
        max-width: calc(100% - 76px);
        flex: 0 1 auto;
    }

    .ich-tree-node__meta,
    .ich-tree-node__actions {
        flex: 1 1 100%;
        margin-inline-start: 0;
        padding-inline-start: calc(28px + 30px + (2 * var(--ich-tree-row-gap)));
    }

    .ich-tree-node__title {
        line-height: 1.45;
    }

    .ich-tree-node__description {
        font-size: .74rem;
    }

    .ich-tree-node__meta,
    .ich-tree-node__actions {
        gap: 5px;
    }
}


/* =========================================================
   ChoiceBox
   پنل انتخاب مرکزی با Header سه‌ناحیه‌ای و 0..10 گزینه.
   ========================================================= */
.ich-choice-box {
    --ich-choice-box-color: var(--ich-color-neutral);
    --ich-choice-box-color-strong: var(--ich-color-neutral-strong);
    --ich-choice-box-color-soft: var(--ich-color-neutral-soft);
    --ich-choice-box-header-min-height: 78px;
    --ich-choice-box-header-padding-block: var(--ich-space-md);
    --ich-choice-box-header-padding-inline: var(--ich-space-lg);
    --ich-choice-box-header-font-size: 16px;
    --ich-choice-box-option-min-height: 56px;
    --ich-choice-box-option-padding-block: 10px;
    --ich-choice-box-option-padding-inline: 12px;
    --ich-choice-box-option-font-size: 14px;
    --ich-choice-box-option-min-width: 96px;
    overflow: hidden;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-lg);
    background: var(--ich-color-surface);
    transition: border-color var(--ich-transition-fast), background-color var(--ich-transition-fast), box-shadow var(--ich-transition-fast);
}


.ich-choice-box--medium {
    --ich-choice-box-header-min-height: 60px;
    --ich-choice-box-header-padding-block: var(--ich-space-sm);
    --ich-choice-box-header-padding-inline: var(--ich-space-md);
    --ich-choice-box-header-font-size: 14px;
    --ich-choice-box-option-min-height: 46px;
    --ich-choice-box-option-padding-block: 8px;
    --ich-choice-box-option-padding-inline: 10px;
    --ich-choice-box-option-font-size: 13px;
    --ich-choice-box-option-min-width: 88px;
}

.ich-choice-box--small {
    --ich-choice-box-header-min-height: 48px;
    --ich-choice-box-header-padding-block: var(--ich-space-xs);
    --ich-choice-box-header-padding-inline: var(--ich-space-sm);
    --ich-choice-box-header-font-size: 13px;
    --ich-choice-box-option-min-height: 38px;
    --ich-choice-box-option-padding-block: 6px;
    --ich-choice-box-option-padding-inline: 8px;
    --ich-choice-box-option-font-size: 12px;
    --ich-choice-box-option-min-width: 80px;
}

.ich-choice-box[data-ich-selection-state="single"] {
    border-color: color-mix(in srgb, var(--ich-choice-box-color) 72%, var(--ich-color-border));
    background: color-mix(in srgb, var(--ich-choice-box-color-soft) 54%, var(--ich-color-surface));
}

.ich-choice-box[data-ich-selection-state="multiple"] {
    border-color: color-mix(in srgb, var(--ich-color-neutral) 46%, var(--ich-color-border));
    background: var(--ich-color-surface);
}

.ich-choice-box[data-ich-active-theme="primary"] { --ich-choice-box-color: var(--ich-color-primary); --ich-choice-box-color-strong: var(--ich-color-primary-strong); --ich-choice-box-color-soft: var(--ich-color-primary-soft); }
.ich-choice-box[data-ich-active-theme="secondary"] { --ich-choice-box-color: var(--ich-color-secondary); --ich-choice-box-color-strong: var(--ich-color-secondary-strong); --ich-choice-box-color-soft: var(--ich-color-secondary-soft); }
.ich-choice-box[data-ich-active-theme="info"] { --ich-choice-box-color: var(--ich-color-info); --ich-choice-box-color-strong: var(--ich-color-info-strong); --ich-choice-box-color-soft: var(--ich-color-info-soft); }
.ich-choice-box[data-ich-active-theme="success"] { --ich-choice-box-color: var(--ich-color-success); --ich-choice-box-color-strong: var(--ich-color-success-strong); --ich-choice-box-color-soft: var(--ich-color-success-soft); }
.ich-choice-box[data-ich-active-theme="warning"] { --ich-choice-box-color: var(--ich-color-warning); --ich-choice-box-color-strong: var(--ich-color-warning-strong); --ich-choice-box-color-soft: var(--ich-color-warning-soft); }
.ich-choice-box[data-ich-active-theme="danger"] { --ich-choice-box-color: var(--ich-color-danger); --ich-choice-box-color-strong: var(--ich-color-danger-strong); --ich-choice-box-color-soft: var(--ich-color-danger-soft); }

.ich-choice-box__header {
    min-height: var(--ich-choice-box-header-min-height);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: var(--ich-space-sm);
    padding: var(--ich-choice-box-header-padding-block) var(--ich-choice-box-header-padding-inline);
    border-bottom: 1px solid var(--ich-color-border);
}

.ich-choice-box[data-ich-selection-state="single"] .ich-choice-box__header {
    border-bottom-color: color-mix(in srgb, var(--ich-choice-box-color) 24%, var(--ich-color-border));
}

.ich-choice-box__header-slot {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--ich-space-sm);
}
.ich-choice-box__header-slot--start { justify-content: flex-start; }
.ich-choice-box__header-slot--center { justify-content: center; text-align: center; }
.ich-choice-box__header-slot--end { justify-content: flex-end; }

.ich-choice-box__header-text {
    color: var(--ich-color-text);
    font-size: var(--ich-choice-box-header-font-size);
    font-weight: 800;
    line-height: 1.5;
}

.ich-choice-box__options-scroll { overflow-x: auto; scrollbar-width: thin; }
.ich-choice-box__options {
    min-width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(var(--ich-choice-box-option-min-width), 1fr);
}

.ich-choice-box__option {
    --ich-choice-option-color: var(--ich-color-neutral);
    --ich-choice-option-color-strong: var(--ich-color-neutral-strong);
    --ich-choice-option-color-soft: var(--ich-color-neutral-soft);
    position: relative;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}
.ich-choice-box__option + .ich-choice-box__option { border-inline-start: 1px solid var(--ich-color-border); }
.ich-choice-box__input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.ich-choice-box__option-body {
    min-height: var(--ich-choice-box-option-min-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ich-choice-box-option-padding-block) var(--ich-choice-box-option-padding-inline);
    color: var(--ich-color-text-muted);
    background: color-mix(in srgb, var(--ich-color-surface-soft) 62%, transparent);
    font-size: var(--ich-choice-box-option-font-size);
    font-weight: 760;
    line-height: 1.4;
    text-align: center;
    transition: color var(--ich-transition-fast), background-color var(--ich-transition-fast);
}
.ich-choice-box__option:hover:not(.ich-choice-box__option--disabled) .ich-choice-box__option-body { background: var(--ich-color-surface-soft); }
.ich-choice-box__input:focus-visible + .ich-choice-box__option-body { outline: 3px solid color-mix(in srgb, var(--ich-choice-option-color) 24%, transparent); outline-offset: -3px; }
.ich-choice-box__input:checked + .ich-choice-box__option-body { color: var(--ich-choice-option-color-strong); background: var(--ich-choice-option-color-soft); }

/* Opt-in dual-state theme: when SelectedTheme is declared, Theme styles the unselected option and SelectedTheme styles the checked option. */
.ich-choice-box__input[data-ich-choice-selected-theme]:not(:checked) + .ich-choice-box__option-body { color: var(--ich-choice-option-color-strong); background: var(--ich-choice-option-color-soft); }

.ich-choice-box__input[data-ich-choice-selected-theme="primary"]:checked + .ich-choice-box__option-body { color: var(--ich-color-primary-strong); background: var(--ich-color-primary-soft); }
.ich-choice-box__input[data-ich-choice-selected-theme="secondary"]:checked + .ich-choice-box__option-body { color: var(--ich-color-secondary-strong); background: var(--ich-color-secondary-soft); }
.ich-choice-box__input[data-ich-choice-selected-theme="info"]:checked + .ich-choice-box__option-body { color: var(--ich-color-info-strong); background: var(--ich-color-info-soft); }
.ich-choice-box__input[data-ich-choice-selected-theme="success"]:checked + .ich-choice-box__option-body { color: var(--ich-color-success-strong); background: var(--ich-color-success-soft); }
.ich-choice-box__input[data-ich-choice-selected-theme="warning"]:checked + .ich-choice-box__option-body { color: var(--ich-color-warning-strong); background: var(--ich-color-warning-soft); }
.ich-choice-box__input[data-ich-choice-selected-theme="danger"]:checked + .ich-choice-box__option-body { color: var(--ich-color-danger-strong); background: var(--ich-color-danger-soft); }

.ich-choice-box__option--primary { --ich-choice-option-color: var(--ich-color-primary); --ich-choice-option-color-strong: var(--ich-color-primary-strong); --ich-choice-option-color-soft: var(--ich-color-primary-soft); }
.ich-choice-box__option--secondary { --ich-choice-option-color: var(--ich-color-secondary); --ich-choice-option-color-strong: var(--ich-color-secondary-strong); --ich-choice-option-color-soft: var(--ich-color-secondary-soft); }
.ich-choice-box__option--info { --ich-choice-option-color: var(--ich-color-info); --ich-choice-option-color-strong: var(--ich-color-info-strong); --ich-choice-option-color-soft: var(--ich-color-info-soft); }
.ich-choice-box__option--success { --ich-choice-option-color: var(--ich-color-success); --ich-choice-option-color-strong: var(--ich-color-success-strong); --ich-choice-option-color-soft: var(--ich-color-success-soft); }
.ich-choice-box__option--warning { --ich-choice-option-color: var(--ich-color-warning); --ich-choice-option-color-strong: var(--ich-color-warning-strong); --ich-choice-option-color-soft: var(--ich-color-warning-soft); }
.ich-choice-box__option--danger { --ich-choice-option-color: var(--ich-color-danger); --ich-choice-option-color-strong: var(--ich-color-danger-strong); --ich-choice-option-color-soft: var(--ich-color-danger-soft); }

.ich-choice-box__option--disabled { cursor: not-allowed; opacity: .48; }
.ich-choice-box--disabled { opacity: .58; }
.ich-choice-box--disabled .ich-choice-box__option { cursor: not-allowed; }
.ich-choice-box--without-header .ich-choice-box__options-scroll { border-radius: inherit; }
.ich-choice-box--header-only .ich-choice-box__header { border-bottom: 0; }

.ich-choice-box--error { border-color: var(--ich-color-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ich-color-danger) 12%, transparent); }
.ich-choice-box__validation { margin-top: var(--ich-space-xs); color: var(--ich-color-danger-strong); font-size: 12px; font-weight: 700; }

@media (max-width: 680px) {
    .ich-choice-box--large {
        --ich-choice-box-header-min-height: 64px;
        --ich-choice-box-header-padding-block: var(--ich-space-sm);
        --ich-choice-box-header-padding-inline: var(--ich-space-md);
        --ich-choice-box-header-font-size: 14px;
        --ich-choice-box-option-min-height: 50px;
        --ich-choice-box-option-font-size: 13px;
    }
    .ich-choice-box--medium {
        --ich-choice-box-header-min-height: 52px;
        --ich-choice-box-header-font-size: 13px;
        --ich-choice-box-option-min-height: 42px;
        --ich-choice-box-option-font-size: 12px;
    }
    .ich-choice-box--small {
        --ich-choice-box-header-min-height: 44px;
        --ich-choice-box-header-font-size: 12px;
        --ich-choice-box-option-min-height: 36px;
        --ich-choice-box-option-font-size: 11px;
    }
}


/* Choice controls rendered in standard field layout */
.ich-field__control > .ich-switch {
    width: 100%;
    display: flex;
    align-items: center;
    padding-inline: var(--ich-field-padding-inline-md);
}
.ich-field__control > .ich-switch > .ich-choice__label {
    width: 100%;
}


/* Field Dependency disabled state
   کاربرد: نمایش فیلدهایی که به واسطه شرط یک فیلد دیگر موقتاً غیرفعال شده‌اند.
   نمونه: فرم وظیفه تکی/دوره‌ای.
   رنگ‌ها فقط از opacity ساختاری استفاده می‌کنند و Theme مستقل ندارند. */
.ich-field--dependency-disabled {
    opacity: .58;
}

/* Table detail / expandable row
   The row owns the structural <tr>/<td>. Consumers only provide detail content.
   ToggleControlled works with the central Ajax toggle contract: a descendant
   target (usually new-ui-region) receives data-ich-toggle-open="true" when open. */
.ich-table__detail-row {
    background: color-mix(in srgb, var(--ich-color-surface-soft) 72%, var(--ich-color-surface));
}
.ich-table__detail-row--toggle-controlled:not(:has([data-ich-toggle-open="true"])) {
    display: none;
}
.ich-table__detail-cell {
    padding: var(--ich-space-md);
    border-bottom: 1px solid var(--ich-color-border);
    vertical-align: top;
}
.ich-table__detail-row:hover {
    background: color-mix(in srgb, var(--ich-color-surface-soft) 72%, var(--ich-color-surface));
}
@media (max-width: 767.98px) {
    .ich-table-wrap--mobile-cards .ich-table__detail-row {
        display: block;
        margin-top: calc(var(--ich-table-mobile-card-gap) * -0.5);
        margin-bottom: var(--ich-table-mobile-card-gap);
        padding: 0;
        border: 1px solid var(--ich-color-border);
        border-radius: var(--ich-table-radius);
        background: var(--ich-color-surface);
        box-shadow: var(--ich-shadow-card);
    }
    .ich-table-wrap--mobile-cards .ich-table__detail-row--toggle-controlled:not(:has([data-ich-toggle-open="true"])) {
        display: none;
    }
    .ich-table-wrap--mobile-cards .ich-table__detail-cell {
        display: block;
        width: 100%;
        padding: var(--ich-table-mobile-card-padding);
        border-bottom: 0;
        text-align: start;
    }
    .ich-table-wrap--mobile-cards .ich-table__detail-cell::before {
        content: none;
    }
}

/* =========================================================
   Card Content Layout
   محتوای ستونی با ناحیه عملیات ثابت و مستقل از تعداد ستون‌های محتوا.
   ========================================================= */
.ich-card-content-layout {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}
.ich-card-content-layout--actions-end > .ich-card-content-layout__content { grid-column: 1; }
.ich-card-content-layout--actions-end > .ich-card-content-layout__actions { grid-column: 2; }
.ich-card-content-layout--actions-start { grid-template-columns: auto minmax(0, 1fr); }
.ich-card-content-layout--actions-start > .ich-card-content-layout__actions { grid-column: 1; }
.ich-card-content-layout--actions-start > .ich-card-content-layout__content { grid-column: 2; }
.ich-card-content-layout__content { min-width: 0; }
.ich-card-content-layout__actions {
    min-width: max-content;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    flex-wrap: nowrap;
}
@media (max-width: 640px) {
    .ich-card-content-layout,
    .ich-card-content-layout--actions-start {
        grid-template-columns: 1fr;
    }
    .ich-card-content-layout--actions-end > .ich-card-content-layout__content,
    .ich-card-content-layout--actions-end > .ich-card-content-layout__actions,
    .ich-card-content-layout--actions-start > .ich-card-content-layout__content,
    .ich-card-content-layout--actions-start > .ich-card-content-layout__actions {
        grid-column: 1;
    }
    .ich-card-content-layout__actions { justify-content: flex-start; }
}

/* =========================================================
   Collapsible Card + Sortable Persistent Grid
   Central NewUi layout behavior. No page-specific CSS.
   ========================================================= */
.ich-card--collapsible > .ich-card__header[data-ich-card-collapse-header] {
    cursor: pointer;
}

.ich-card__collapse-toggle,
.ich-card__layout-handle {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--ich-color-border);
    border-radius: var(--ich-radius-sm);
    background: var(--ich-color-surface);
    color: var(--ich-color-text-muted);
}

.ich-card__collapse-toggle {
    cursor: pointer;
}

.ich-card__layout-handle {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.ich-card__layout-handle:active {
    cursor: grabbing;
}

.ich-card__collapse-toggle:hover,
.ich-card__layout-handle:hover,
.ich-card__collapse-toggle:focus-visible,
.ich-card__layout-handle:focus-visible {
    color: var(--ich-color-text);
    border-color: var(--ich-color-border-strong);
    outline: none;
}

.ich-card__collapse-toggle i {
    transition: transform 160ms ease;
}

.ich-card--collapsed .ich-card__collapse-toggle i {
    transform: rotate(180deg);
}

.ich-card--collapsed > .ich-card__header {
    border-bottom-color: transparent;
}

.ich-grid--sortable > [data-ich-sort-item] {
    min-width: 0;
}

.ich-grid--sortable > [data-ich-sort-item].ich-grid-item--dragging {
    opacity: .55;
}

.ich-grid--sortable > [data-ich-sort-item].ich-grid-item--drop-target {
    outline: 2px dashed var(--ich-color-border-strong);
    outline-offset: 3px;
    border-radius: var(--ich-radius-md);
}
