/* ═══════════════════════════════════════════════════════════════════
   تعیین سطح دسترسی — /admin/user-access (پورتِ F_USER_PERMITION_FORMS ِ WPF)
   روی توکن‌ها و کلاس‌های automation.css (.atm-*) و نوارِ بالای treasury.css
   (.trs-bar) ساخته شده؛ این‌جا فقط اجزای خاصِ این صفحه با پیشوندِ .ua-* هستند.
   همه‌ی رنگ‌ها از --atm-* (یعنی تمِ MudBlazor) می‌آیند تا حالت شب هم درست باشد.
   هر دکمه‌ای که disabled می‌شود حالتِ :disabled ِ دیدنی دارد (AGENTS.md بخش ۲).
   ═══════════════════════════════════════════════════════════════════ */

/* دیالوگ‌ها در MudDialogProvider و بیرون از .ua رندر می‌شوند؛ پس متغیرها روی .ua-dlg هم لازم‌اند. */
.ua, .ua-dlg { --ua-ok: #10b981; --ua-bad: #f43f5e; --ua-warn: #f59e0b; }

.ua .trs-bar__stats .ok i { color: #34d399; }
.ua .trs-bar__stats .no { opacity: .55; }

.ua-denied, .ua-loading {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 220px; padding: 24px; text-align: center;
    background: var(--atm-surface); border: 1px solid var(--atm-line); border-radius: var(--atm-radius);
    color: var(--atm-muted);
}
.ua-denied { flex-direction: column; color: var(--atm-text); }
.ua-denied i { font-size: 2.6rem; color: var(--ua-bad); }
.ua-spin {
    width: 18px; height: 18px; border-radius: 50%; display: inline-block; flex: none;
    border: 2px solid color-mix(in srgb, var(--atm-primary) 25%, transparent); border-top-color: var(--atm-primary);
    animation: ua-spin .8s linear infinite;
}
@keyframes ua-spin { to { transform: rotate(360deg); } }

/* ─────────────── تب‌ها ─────────────── */
.ua-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ua-tab {
    display: inline-flex; align-items: center; gap: 7px;
    height: 40px; padding: 0 15px; border-radius: 12px; cursor: pointer;
    font: inherit; font-size: .85rem; font-weight: 700; color: var(--atm-muted);
    background: var(--atm-surface); border: 1px solid var(--atm-line);
    transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.ua-tab:hover { color: var(--atm-primary); border-color: color-mix(in srgb, var(--atm-primary) 55%, transparent); }
.ua-tab.is-on {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, var(--atm-primary), color-mix(in srgb, var(--atm-primary) 70%, #1e1b4b));
    box-shadow: 0 10px 22px -14px var(--atm-primary);
}

/* ─────────────── بدنه: ستونِ کاربران + محتوا ─────────────── */
.ua-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.ua-body.is-wide { grid-template-columns: minmax(0, 1fr); }
.ua-main { min-width: 0; }

.ua-users {
    position: sticky; top: 76px;
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px; max-height: calc(100vh - 110px);
    background: var(--atm-surface); border: 1px solid var(--atm-line); border-radius: var(--atm-radius); box-shadow: var(--atm-shadow);
}
.ua-users__search, .ua-search { position: relative; min-width: 180px; }
.ua-users__search i, .ua-search i {
    position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
    color: var(--atm-muted); pointer-events: none; font-size: .9rem;
}
.ua-users__search .atm-input, .ua-search .atm-input { height: 40px; padding-inline-start: 34px; }
.ua-search.sm .atm-input { height: 34px; font-size: .82rem; }
.ua-users__inactive { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--atm-muted); cursor: pointer; padding: 0 4px; }
.ua-users__list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; margin-inline: -4px; padding-inline: 4px; }
.ua-user {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 7px 9px; border-radius: 12px; cursor: pointer; text-align: start;
    font: inherit; color: var(--atm-text); background: transparent; border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.ua-user:hover { background: var(--atm-soft); }
.ua-user.is-on {
    background: color-mix(in srgb, var(--atm-primary) 12%, transparent);
    border-color: color-mix(in srgb, var(--atm-primary) 35%, transparent);
}
.ua-user.is-off { opacity: .6; }
.ua-user .atm-av, .ua-tile .atm-av, .ua-pickrow .atm-av { width: 32px; height: 32px; font-size: .74rem; }
.ua-user .nm, .ua-tile .nm, .ua-pickrow .nm { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: .86rem; font-weight: 700; line-height: 1.35; }
.ua-user .nm small, .ua-tile .nm small, .ua-pickrow .nm small { font-size: .7rem; font-weight: 400; color: var(--atm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.atm-av.sm { width: 24px; height: 24px; font-size: .62rem; vertical-align: middle; }

.ua-pill {
    display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 999px;
    font-size: .68rem; font-weight: 700; white-space: nowrap;
    color: var(--atm-muted); background: var(--atm-soft); border: 1px solid var(--atm-line);
}
.ua-pill.me { color: var(--atm-primary); background: color-mix(in srgb, var(--atm-primary) 10%, transparent); border-color: color-mix(in srgb, var(--atm-primary) 30%, transparent); }
.ua-pill.ok { color: var(--ua-ok); background: color-mix(in srgb, var(--ua-ok) 12%, transparent); border-color: color-mix(in srgb, var(--ua-ok) 30%, transparent); }
.ua-pill.bad, .ua-pill.off { color: var(--ua-bad); background: color-mix(in srgb, var(--ua-bad) 10%, transparent); border-color: color-mix(in srgb, var(--ua-bad) 28%, transparent); }
.ua-pill.chg { color: var(--ua-warn); background: color-mix(in srgb, var(--ua-warn) 12%, transparent); border-color: color-mix(in srgb, var(--ua-warn) 30%, transparent); }
.ua-pill.grp { color: var(--atm-info); background: color-mix(in srgb, var(--atm-info) 10%, transparent); border-color: color-mix(in srgb, var(--atm-info) 25%, transparent); }
.ua-pill.lvl.l1 { color: #a855f7; background: color-mix(in srgb, #a855f7 10%, transparent); }
.ua-pill.lvl.l2 { color: #0ea5e9; background: color-mix(in srgb, #0ea5e9 10%, transparent); }

.ua-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 260px; padding: 24px; text-align: center; color: var(--atm-muted);
    background: var(--atm-surface); border: 1px dashed var(--atm-line); border-radius: var(--atm-radius);
}
.ua-empty i { font-size: 2.4rem; color: color-mix(in srgb, var(--atm-primary) 60%, transparent); }
.ua-empty b { color: var(--atm-text); }
.ua-empty.sm { min-height: 0; padding: 14px; border: 0; background: transparent; font-size: .82rem; }

/* ─────────────── کارت و نوارِ ابزار ─────────────── */
.ua-card {
    background: var(--atm-surface); border: 1px solid var(--atm-line); border-radius: var(--atm-radius);
    box-shadow: var(--atm-shadow); padding: 14px; animation: atm-rise .35s var(--atm-ease) both;
}
.ua-card__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
.ua-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ua-who > div { display: flex; flex-direction: column; min-width: 0; }
.ua-who b { font-size: 1rem; font-weight: 800; }
.ua-who small { font-size: .76rem; color: var(--atm-muted); }
.ua-who .atm-av { width: 40px; height: 40px; font-size: .85rem; }
.ua-ic {
    width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; font-size: 1.15rem;
    color: var(--atm-primary); background: color-mix(in srgb, var(--atm-primary) 12%, transparent);
}
.ua-ic.danger { color: var(--ua-bad); background: color-mix(in srgb, var(--ua-bad) 12%, transparent); }
.ua-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ua-actions .atm-btn { height: 38px; font-size: .8rem; }
.ua .atm-btn.ua-on:hover:not(:disabled) { color: var(--ua-ok); border-color: color-mix(in srgb, var(--ua-ok) 50%, transparent); }
.ua .atm-btn.ua-off:hover:not(:disabled) { color: var(--ua-bad); border-color: color-mix(in srgb, var(--ua-bad) 50%, transparent); }

.ua-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.ua-toolbar .ua-search { flex: 1 1 260px; max-width: 460px; }
.ua-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ua-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
    font: inherit; font-size: .78rem; color: var(--atm-muted); background: var(--atm-soft); border: 1px solid var(--atm-line);
}
.ua-chip b { font-size: .74rem; font-variant-numeric: tabular-nums; color: var(--atm-text); }
.ua-chip:hover { border-color: var(--atm-primary); color: var(--atm-primary); }
.ua-chip.is-on { color: #fff; background: var(--atm-primary); border-color: var(--atm-primary); }
.ua-chip.is-on b { color: #fff; }

.ua-alert { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: .84rem; margin-bottom: 10px; }
.ua-alert.err { color: var(--ua-bad); background: color-mix(in srgb, var(--ua-bad) 10%, transparent); }
.ua-alert.info { color: var(--atm-info); background: color-mix(in srgb, var(--atm-info) 9%, transparent); }

/* ─────────────── جدول ─────────────── */
.ua-tablewrap { overflow: auto; max-height: calc(100vh - 300px); border: 1px solid var(--atm-line); border-radius: 14px; }
.ua-tablewrap.sm { max-height: 55vh; }
.ua-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.ua-table th, .ua-table td { padding: 7px 10px; text-align: center; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid var(--atm-line); }
.ua-table thead th {
    position: sticky; top: 0; z-index: 1;
    font-size: .74rem; font-weight: 800; color: var(--atm-muted);
    background: color-mix(in srgb, var(--atm-surface) 92%, var(--atm-text) 8%);
}
.ua-table .t { text-align: start; white-space: normal; }
.ua-table td.t { min-width: 220px; }
.ua-table .num { font-variant-numeric: tabular-nums; direction: ltr; }
.ua-table .act { width: 1%; }
.ua-table .pick { width: 1%; }
.ua-table .cap { font-weight: 700; }
/* direction: ltr طرفِ margin-inline-start را برمی‌گرداند؛ فاصله باید سمتِ راست (کنارِ نام) باشد. */
.ua-table .fn { display: inline-block; margin-right: 8px; font-size: .7rem; color: var(--atm-muted); direction: ltr; }
.ua-table tbody tr:hover td { background: var(--atm-soft); }
.ua-table tr.is-none .cap { color: var(--atm-muted); font-weight: 500; }
.ua-table tr.is-changed td { background: color-mix(in srgb, var(--ua-warn) 8%, transparent); }
.ua-table tr.is-changed td:first-child { box-shadow: inset -3px 0 0 var(--ua-warn); }
.ua-table input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--atm-primary); }

.ua-colbtn {
    display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 8px; cursor: pointer;
    font: inherit; font-size: .72rem; font-weight: 800; color: var(--atm-muted); background: transparent; border: 0;
}
.ua-colbtn i { font-size: .9rem; }
.ua-colbtn:hover:not(:disabled) { color: var(--atm-primary); background: color-mix(in srgb, var(--atm-primary) 10%, transparent); }
.ua-colbtn:disabled { cursor: default; opacity: .7; }

/* سوییچ */
.ua-sw {
    position: relative; width: 38px; height: 22px; border-radius: 999px; flex: none; cursor: pointer; padding: 0;
    background: color-mix(in srgb, var(--atm-text) 16%, transparent); border: 0;
    transition: background .18s;
}
.ua-sw .knob {
    position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: inset-inline-start .18s var(--atm-ease);
}
.ua-sw.is-on { background: var(--ua-ok); }
.ua-sw.is-on .knob { inset-inline-start: 19px; }
.ua-sw:focus-visible { outline: 2px solid var(--atm-primary); outline-offset: 2px; }
.ua-sw:disabled { cursor: not-allowed; opacity: .5; }
.ua-sw.sm { width: 32px; height: 19px; }
.ua-sw.sm .knob { width: 13px; height: 13px; }
.ua-sw.sm.is-on .knob { inset-inline-start: 16px; }

.ua-allbtn, .ua-iconbtn {
    width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; cursor: pointer;
    font: inherit; color: var(--atm-muted); background: transparent; border: 1px solid var(--atm-line);
    transition: color .15s, background .15s, border-color .15s;
}
.ua-allbtn.is-on { color: var(--ua-ok); border-color: color-mix(in srgb, var(--ua-ok) 40%, transparent); background: color-mix(in srgb, var(--ua-ok) 10%, transparent); }
.ua-iconbtn { border-color: transparent; }
.ua-allbtn:hover:not(:disabled), .ua-iconbtn:hover:not(:disabled) { color: var(--atm-primary); background: color-mix(in srgb, var(--atm-primary) 10%, transparent); }
.ua-iconbtn.danger:hover:not(:disabled) { color: var(--ua-bad); background: color-mix(in srgb, var(--ua-bad) 10%, transparent); }
.ua-iconbtn.ok:hover:not(:disabled) { color: var(--ua-ok); background: color-mix(in srgb, var(--ua-ok) 10%, transparent); }
.ua-allbtn:disabled, .ua-iconbtn:disabled { cursor: not-allowed; opacity: .4; }
.ua-yes { color: var(--ua-ok); }
.ua-no { color: var(--atm-muted); opacity: .5; }

/* نوارِ شناورِ ذخیره / انتخاب */
.ua-floatbar {
    position: fixed; inset-inline: 0; bottom: 18px; z-index: 30; margin-inline: auto;
    width: max-content; max-width: calc(100vw - 24px);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
    padding: 8px 10px 8px 16px; border-radius: 18px; color: #fff;
    background: linear-gradient(120deg, #0b1224, #1b1640); border: 1px solid rgb(255 255 255 / .1);
    box-shadow: 0 22px 50px -20px rgb(2 6 23 / .8);
    animation: atm-rise .3s var(--atm-ease) both;
}
.ua-floatbar > span { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; }
.ua-floatbar > span i { color: var(--ua-warn); }
.ua-floatbar.is-pick > span i { color: #60a5fa; }
.ua-floatbar .atm-btn { height: 38px; font-size: .82rem; }
.ua-floatbar .atm-btn--ghost { color: #e2e8f0; border-color: rgb(255 255 255 / .2); }
.ua-floatbar .atm-btn--ghost:hover:not(:disabled) { background: rgb(255 255 255 / .1); color: #fff; }

/* ─────────────── دو ستون (انبار، حساب، زیرمجموعه) ─────────────── */
.ua-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ua-pane { border: 1px solid var(--atm-line); border-radius: 16px; padding: 10px; background: var(--atm-soft); min-width: 0; }
.ua-pane > header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: .88rem; margin-bottom: 10px; }
.ua-pane > header b { font-size: .78rem; padding: 0 8px; border-radius: 999px; background: var(--atm-surface); border: 1px solid var(--atm-line); }
.ua-pane > header .ua-search { margin-inline-start: auto; flex: 1 1 160px; max-width: 240px; }
.ua-pane.is-mine { background: color-mix(in srgb, var(--ua-ok) 6%, var(--atm-surface)); border-color: color-mix(in srgb, var(--ua-ok) 25%, transparent); }
.ua-pane.is-mine > header i, .ua-pane.is-allow > header i { color: var(--ua-ok); }
.ua-pane.is-block { background: color-mix(in srgb, var(--ua-bad) 5%, var(--atm-surface)); border-color: color-mix(in srgb, var(--ua-bad) 22%, transparent); }
.ua-pane.is-block > header i { color: var(--ua-bad); }
.ua-pane.is-allow { background: color-mix(in srgb, var(--ua-ok) 5%, var(--atm-surface)); border-color: color-mix(in srgb, var(--ua-ok) 22%, transparent); }
.ua-linkbtn { margin-inline-start: auto; font: inherit; font-size: .76rem; font-weight: 700; color: var(--atm-primary); background: none; border: 0; cursor: pointer; }
.ua-linkbtn:disabled { opacity: .45; cursor: not-allowed; }

.ua-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 60vh; overflow-y: auto; }
.ua-tile {
    display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 10px; border-radius: 12px; text-align: start;
    font: inherit; color: var(--atm-text); background: var(--atm-surface); border: 1px solid var(--atm-line);
}
.ua-tile .code {
    min-width: 32px; height: 32px; padding: 0 6px; border-radius: 10px; flex: none; display: grid; place-items: center;
    font-size: .76rem; font-weight: 800; font-variant-numeric: tabular-nums;
    color: var(--atm-primary); background: color-mix(in srgb, var(--atm-primary) 10%, transparent);
}
.ua-tile.is-all .code { color: #fff; background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.ua-tile.is-add { cursor: pointer; transition: border-color .15s, transform .15s; }
.ua-tile.is-add .add { color: var(--atm-muted); font-size: 1.05rem; }
.ua-tile.is-add:hover:not(:disabled) { border-color: var(--ua-ok); transform: translateY(-1px); }
.ua-tile.is-add:hover:not(:disabled) .add { color: var(--ua-ok); }
.ua-tile.is-add:disabled { cursor: not-allowed; opacity: .55; }

.ua-addrow { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.ua-addrow > :first-child { flex: 1; min-width: 0; }
.ua-addrow .atm-btn { height: 40px; flex: none; }
.ua-acclist { display: flex; flex-direction: column; gap: 4px; max-height: 58vh; overflow-y: auto; }
.ua-acc {
    display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 11px;
    background: var(--atm-surface); border: 1px solid var(--atm-line); font-size: .84rem;
}
.ua-acc .code { direction: ltr; font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--atm-muted); flex: none; }
.ua-acc .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─────────────── حق امضا ─────────────── */
.ua-signgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.ua-sign { border: 1px solid var(--atm-line); border-radius: 15px; padding: 10px; background: var(--atm-soft); transition: border-color .2s, background .2s; }
.ua-sign.is-on { border-color: color-mix(in srgb, var(--ua-ok) 35%, transparent); background: color-mix(in srgb, var(--ua-ok) 6%, var(--atm-surface)); }
.ua-sign > header { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; font-size: .88rem; }
.ua-signrow { display: grid; grid-template-columns: auto 92px minmax(0, 1fr); align-items: center; gap: 8px; padding: 3px 0; border-radius: 8px; }
.ua-signrow.is-changed { background: color-mix(in srgb, var(--ua-warn) 10%, transparent); }
.ua-signrow .lbl { font-size: .8rem; font-weight: 700; }
.atm-input.sm { height: 32px; font-size: .8rem; border-radius: 10px; padding: 0 10px; }
.atm-input:disabled { opacity: .6; cursor: not-allowed; }

/* ─────────────── فرم‌ها و دیالوگ‌ها ─────────────── */
/* دکمه‌ی بستن در RTL روی عنوان می‌افتاد. */
.ua-dialog .mud-dialog-title .mud-button-close { right: auto; left: 8px; }
.ua-dlg { display: flex; flex-direction: column; gap: 10px; color: var(--atm-text); }
.ua-dlg__lead { margin: 0; font-size: .88rem; line-height: 1.8; }
.ua-dlg__lead .danger { color: var(--ua-bad); }
.ua-dlg__sub { direction: ltr; text-align: end; font-size: .74rem; color: var(--atm-muted); margin-top: -6px; }
.ua-applyforms { display: flex; flex-wrap: wrap; gap: 4px; }
.ua-pickhead { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--atm-muted); }
.ua-pickhead label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ua-picklist { display: flex; flex-direction: column; gap: 3px; max-height: 44vh; overflow-y: auto; }
.ua-pickrow { display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; }
.ua-pickrow:hover { background: var(--atm-soft); }
.ua-pickrow.is-on { background: color-mix(in srgb, var(--atm-primary) 10%, transparent); border-color: color-mix(in srgb, var(--atm-primary) 30%, transparent); }
.ua-pickrow input { width: 16px; height: 16px; accent-color: var(--atm-primary); }

.ua-form {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end;
    padding: 12px; margin-bottom: 12px; border-radius: 16px;
    background: color-mix(in srgb, var(--atm-primary) 5%, var(--atm-surface)); border: 1px solid color-mix(in srgb, var(--atm-primary) 22%, transparent);
}
.ua-form.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); background: transparent; border: 0; padding: 0; margin: 0; }
.ua-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ua-field > span { font-size: .75rem; font-weight: 700; color: var(--atm-muted); }
.ua-field.wide { grid-column: span 2; }
.ua-field .atm-input { height: 40px; }
.ua-form .req { color: var(--ua-bad); }
.ua-check { display: flex; align-items: center; gap: 7px; font-size: .84rem; cursor: pointer; grid-column: span 2; }
.ua-check input { width: 17px; height: 17px; accent-color: var(--ua-ok); }
.ua-form__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; grid-column: 1 / -1; }
.ua-form__actions .atm-btn { height: 38px; font-size: .82rem; }

.ua-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--atm-soft); border: 1px solid var(--atm-line); height: 40px; }
.ua-seg button { flex: 1; min-width: 74px; border: 0; border-radius: 9px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--atm-muted); background: transparent; cursor: pointer; }
.ua-seg button.is-on.ok { color: #fff; background: var(--ua-ok); }
.ua-seg button.is-on.off { color: #fff; background: var(--ua-bad); }
.ua-seg button:disabled { cursor: not-allowed; opacity: .45; }

.ua-signbox { margin-top: 14px; padding: 12px; border-radius: 16px; border: 1px dashed var(--atm-line); }
.ua-signbox > header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.ua-signbox > header small { font-size: .74rem; color: var(--atm-muted); }
.ua-signview { min-height: 120px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 1px solid var(--atm-line); margin-bottom: 8px; }
.ua-signview img { max-height: 140px; max-width: 100%; object-fit: contain; }
.ua-signview .ua-empty.sm { color: #64748b; }
.ua-signpad {
    display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; margin-bottom: 8px;
    border-radius: 12px; background: #fff;
    background-image: linear-gradient(to top, transparent 70%, transparent), linear-gradient(#cbd5e1, #cbd5e1);
    background-size: 100% 100%, 82% 1px; background-repeat: no-repeat; background-position: center, center 72%;
    border: 1px solid var(--atm-line);
}
.ua-upload { position: relative; overflow: hidden; cursor: pointer; }
.ua-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.ua-printtbl td.t, .ua-printtbl th.t { text-align: right; }
.ua-printtbl td, .ua-printtbl th { text-align: center; }

/* ─────────────── موبایل ─────────────── */
@media (max-width: 960px) {
    .ua-body { grid-template-columns: minmax(0, 1fr); }
    .ua-users { position: static; max-height: 300px; }
    .ua-split { grid-template-columns: minmax(0, 1fr); }
    .ua-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .ua-tab { height: 36px; padding: 0 11px; font-size: .78rem; }
    .ua-tab span { white-space: nowrap; }
    .ua-form, .ua-form.cols2 { grid-template-columns: minmax(0, 1fr); }
    .ua-field.wide, .ua-check { grid-column: auto; }
    .ua-signrow { grid-template-columns: auto 84px minmax(0, 1fr); }
    .ua-tablewrap { max-height: none; }
}
