:root {
    --admin-primary: #4f46e5;
    --admin-accent: #7c3aed;
    --admin-bg: #f5f7fb;
    --admin-text: #172033;
    --admin-muted: #667085;
    --admin-border: #e4e9f1;
    --admin-card: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--admin-bg); color: var(--admin-text); font-family: var(--app-font, "Vazirmatn", Tahoma, Arial, sans-serif); line-height: 1.8; -webkit-font-smoothing: antialiased; }
a { color: var(--admin-primary); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #d8e0ea;
    border-radius: 11px;
    outline: 0;
    background: #fff;
    color: #172033;
    transition: border-color .17s, box-shadow .17s;
}

textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--admin-primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .09); }
input[type="color"] { min-height: 42px; padding: 3px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; accent-color: var(--admin-primary); }
label { display: grid; gap: 6px; color: #475467; font-size: 12px; font-weight: 750; }
label small { color: #8a94a6; font-size: 9px; font-weight: 400; }

.sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 0 0 auto;
    width: 258px;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 15px;
    overflow-y: auto;
    background: linear-gradient(180deg, #101828, #111b2e 60%, #0b1220);
    color: #fff;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 3px 7px 24px; color: #fff; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: linear-gradient(135deg, #7c3aed, #4f46e5); box-shadow: 0 10px 24px rgba(99, 102, 241, .3); font-size: 20px; font-weight: 900; }
.brand b { display: block; font-size: 15px; }
.brand small { display: block; margin-top: 1px; color: #98a2b3; font-size: 8px; }

.main-nav { display: grid; gap: 5px; }
.main-nav a { min-height: 45px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 11px; color: #cfd5df; font-size: 11px; font-weight: 700; }
.main-nav a:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.main-nav a.active { border-color: rgba(129, 140, 248, .2); background: linear-gradient(90deg, rgba(79, 70, 229, .28), rgba(124, 58, 237, .11)); color: #fff; }
.main-nav a.needs-attention { color: #fbd38d; }
.main-nav i { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .065); font-style: normal; font-size: 14px; }
.main-nav em { margin-right: auto; padding: 2px 6px; border-radius: 99px; background: #f79009; color: #fff; font-size: 7px; font-style: normal; }

.sidebar-footer { margin-top: auto; padding-top: 22px; }
.admin-chip { display: flex; align-items: center; gap: 9px; padding: 10px 8px; border-top: 1px solid rgba(255, 255, 255, .09); }
.admin-chip > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #344054; font-weight: 900; }
.admin-chip b { display: block; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.admin-chip small { display: block; color: #98a2b3; font-size: 8px; }
.logout { width: 100%; padding: 9px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .06); color: #d0d5dd; cursor: pointer; font-size: 10px; }
.logout:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.admin-main { min-height: 100vh; margin-right: 258px; padding: 30px; }
.admin-main > * { max-width: 1480px; margin-left: auto; margin-right: auto; }
.hamburger { display: none; }
.sidebar-backdrop { display: none; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.head h1, .head h2 { margin: 0; line-height: 1.45; }
.head h1 { font-size: 26px; letter-spacing: -.5px; }
.head h2 { font-size: 20px; }
.head p, .muted { margin: 4px 0 0; color: var(--admin-muted); font-size: 11px; }
.subhead { margin-top: 33px; }

.actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.actions form { display: inline-flex; }
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 13px; border: 1px solid #d5dde8; border-radius: 10px; background: #fff; color: #344054; font-size: 10px; font-weight: 850; cursor: pointer; transition: transform .15s, box-shadow .15s, filter .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(16, 24, 40, .08); }
.btn.primary { border-color: var(--admin-primary); background: linear-gradient(135deg, var(--admin-primary), var(--admin-accent)); color: #fff; }
.btn.dashed { width: 100%; border-style: dashed; background: #fafbff; color: var(--admin-primary); }
.btn:disabled { opacity: .52; cursor: not-allowed; transform: none; box-shadow: none; }
.link { padding: 0; border: 0; background: none; color: var(--admin-primary); cursor: pointer; font: inherit; font-weight: 750; }
.danger { color: #d92d20 !important; }
.ok { color: #067647 !important; }
.bad { color: #b42318 !important; }

.card,
.table {
    border: 1px solid var(--admin-border);
    border-radius: 17px;
    background: var(--admin-card);
    box-shadow: 0 5px 24px rgba(16, 24, 40, .045);
}

.card { padding: 21px; }
.card > h2 { margin: 0 0 15px; font-size: 16px; }
.card h3 { font-size: 13px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.card-head h2 { margin: 0; font-size: 16px; }
.card-head p { margin: 3px 0 0; color: var(--admin-muted); font-size: 10px; }

.stack { display: grid; gap: 13px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 17px; align-items: start; }
.top { margin-top: 18px !important; }
.inline { display: flex; align-items: center; gap: 8px; }
.align-end { align-items: end; }
.wide { grid-column: 1 / -1; }

.section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.section-title h2 { margin: 0; font-size: 17px; }
.section-title p { margin: 2px 0 0; color: var(--admin-muted); font-size: 10px; }
.section-icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: #eef2ff; color: var(--admin-primary); font-size: 13px; font-weight: 900; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats article { position: relative; overflow: hidden; padding: 17px; border: 1px solid var(--admin-border); border-radius: 15px; background: #fff; }
.stats article::after { content: ""; position: absolute; width: 55px; height: 55px; left: -20px; bottom: -24px; border-radius: 50%; background: #eef2ff; }
.stats span { display: block; color: var(--admin-muted); font-size: 10px; }
.stats strong { display: block; margin-top: 7px; font-size: 24px; line-height: 1.3; }

.table { overflow: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid #edf0f4; text-align: right; vertical-align: middle; font-size: 10px; }
th { position: sticky; top: 0; z-index: 2; background: #fafbfc; color: #667085; font-weight: 850; }
tbody tr:hover { background: #fcfcff; }
td b { font-size: 11px; }
td small, .row small { display: block; max-width: 480px; margin-top: 3px; overflow: hidden; color: #8a94a6; font-size: 8px; text-overflow: ellipsis; }

.badge, .mini-badge, .category-chip { display: inline-flex; align-items: center; width: max-content; padding: 3px 8px; border-radius: 99px; background: #eef2ff; color: var(--admin-primary); font-size: 8px; font-weight: 850; }
.status-active, .status-sent, .status-delivered, .status-completed { background: #ecfdf3; color: #067647; }
.status-pending, .status-processing, .status-queued, .status-paused { background: #fffaeb; color: #b54708; }
.status-failed, .status-cancelled, .status-closed { background: #fff1f0; color: #b42318; }
.status-draft, .status-archived { background: #f2f4f7; color: #475467; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 55px; padding: 10px 0; border-bottom: 1px solid #edf0f4; color: inherit; }
.row:last-child { border-bottom: 0; }
.row-end { display: grid; justify-items: end; gap: 2px; }
.metric { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #edf0f4; font-size: 11px; }
.filter { display: flex; gap: 8px; margin-bottom: 12px; padding: 10px; border: 1px solid var(--admin-border); border-radius: 13px; background: #fff; }
.filter input { max-width: 430px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; font-size: 10px; }
.check { display: flex; align-items: center; gap: 7px; }
.toggle-line { min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--admin-border); border-radius: 12px; background: #fafbfc; cursor: pointer; }
.toggle-line span { display: grid; }
.toggle-line b { color: #344054; font-size: 11px; }
.toggle-line small { font-size: 8px; }
.empty-mini { padding: 28px 12px; color: #98a2b3; text-align: center; font-size: 10px; }
.empty-state { padding: 65px 20px; text-align: center; }
.empty-state h2 { margin: 10px 0 4px; }
.empty-state p { color: var(--admin-muted); font-size: 11px; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: auto; border-radius: 18px; background: #eef2ff; color: var(--admin-primary); font-size: 27px; }

/* مدیریت حرفه‌ای گروه‌های مخاطبان */
.audience-layout { display: grid; grid-template-columns: minmax(410px, .85fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }
.audience-create { border-top: 4px solid var(--admin-primary); }
.audience-editor { gap: 17px; }
.rule-box { padding: 15px; border: 1px solid #e1e7ef; border-radius: 14px; background: #fafbff; }
.rule-box .card-head { margin-bottom: 12px; }
.rule-box h3 { margin: 0; color: #344054; font-size: 13px; }
.rule-box fieldset { min-width: 0; margin-top: 12px; padding: 10px; background: #fff; }
.rule-box legend { padding: 0 7px; color: #475467; font-size: 10px; font-weight: 850; }
.rule-box > label + fieldset,
.rule-box > label + [data-audience-exclude] { margin-top: 12px; }
.audience-form-list { display: grid; max-height: 225px; gap: 5px; padding: 3px; overflow: auto; }
.audience-form-list.compact { max-height: 175px; }
.audience-form-option { min-height: 39px; padding: 7px 9px; border: 1px solid #edf0f4; border-radius: 9px; background: #fff; cursor: pointer; }
.audience-form-option:hover { border-color: #c7d2fe; background: #f8f9ff; }
.audience-form-option span { display: grid; color: #344054; font-size: 9px; }
.audience-form-option small { color: #b42318; }
.audience-form-option.is-deleted { border-color: #fecdca; background: #fff7f6; }
.audience-filters summary { color: var(--admin-primary); cursor: pointer; font-size: 11px; font-weight: 850; }
.audience-savebar { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 13px; border: 1px solid #dfe4ff; border-radius: 13px; background: #f4f5ff; }
.audience-preview-result { color: #475467; font-size: 9px; }
.audience-list-filter { display: grid; grid-template-columns: minmax(180px, 1fr) 105px 115px 112px auto auto; }
.audience-list-filter input { max-width: none; }
.audience-table table { min-width: 920px; }
.audience-title-line { flex-wrap: wrap; }
.audience-title-line h1 { margin-left: 5px; }
.audience-detail-grid { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); }
.rule-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.rule-chip { display: inline-flex; padding: 5px 9px; border: 1px solid #dfe4ff; border-radius: 99px; background: #f4f5ff; color: #4338ca; font-size: 8px; font-weight: 750; }
.rule-chip.is-warning { border-color: #fedf89; background: #fffaeb; color: #93370d; }
.candidate-list { margin-top: 11px; padding: 0 12px; border: 1px solid #e6eaf0; border-radius: 12px; background: #fafbfc; }
.candidate-list form { flex: 0 0 auto; }
.member-manager .card-head { align-items: center; }
.danger-zone { border-color: #fecdca; }
.danger-zone h2 { color: #b42318; }

.alert { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; padding: 11px 13px; border: 1px solid; border-radius: 11px; font-size: 10px; }
.alert span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.alert.success { border-color: #abefc6; background: #ecfdf3; color: #067647; }
.alert.success span { background: #d1fadf; }
.alert.error { border-color: #fecdca; background: #fff1f0; color: #b42318; }
.alert.error span { background: #fee4e2; }
.notice { padding: 11px 13px; border-radius: 11px; font-size: 9px; }
.notice.success { background: #ecfdf3; color: #067647; }
.notice.warning { border: 1px solid #fedf89; background: #fffaeb; color: #93370d; }
.upgrade-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid #fedf89; border-radius: 13px; background: #fffaeb; color: #7a2e0e; }
.upgrade-banner div { display: grid; gap: 2px; }
.upgrade-banner b { font-size: 11px; }
.upgrade-banner span { font-size: 9px; }
.upgrade-banner a { flex: 0 0 auto; color: #93370d; font-size: 9px; font-weight: 900; }
.provider-detail { margin-top: 14px; border: 1px solid var(--admin-border); border-radius: 11px; background: #f8fafc; }
.provider-detail summary { padding: 10px 12px; color: #475467; font-size: 9px; font-weight: 850; cursor: pointer; }
.provider-detail pre { max-height: 260px; margin: 0; padding: 12px; overflow: auto; border-top: 1px solid var(--admin-border); color: #344054; font: 11px/1.7 monospace; white-space: pre-wrap; word-break: break-all; }

/* ایمپورت مخاطبان */
.import-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 17px; align-items: start; }
.import-card { border-top: 4px solid var(--admin-primary); }
.import-card .section-title { margin-bottom: 4px; }
.import-card .section-icon { width: 50px; font-size: 8px; direction: ltr; }
.upload-box { min-height: 205px; place-items: center; align-content: center; gap: 5px; padding: 22px; border: 2px dashed #cbd5e1; border-radius: 15px; background: linear-gradient(145deg, #fafbff, #f8fafc); text-align: center; cursor: pointer; transition: border-color .17s, background .17s; }
.upload-box:hover { border-color: var(--admin-primary); background: #f7f7ff; }
.upload-box .upload-icon { width: 49px; height: 49px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 15px; background: #eef2ff; color: var(--admin-primary); font-size: 23px; font-weight: 900; }
.upload-box b { color: #344054; font-size: 13px; }
.upload-box small { color: #8a94a6; font-size: 8px; font-weight: 500; }
.upload-box input[type="file"] { width: min(430px, 100%); min-height: 42px; margin-top: 10px; padding: 7px; background: #fff; font-size: 9px; }
.upload-box input[type="file"]::file-selector-button { margin-left: 9px; padding: 7px 11px; border: 0; border-radius: 8px; background: #eef2ff; color: var(--admin-primary); font: inherit; font-weight: 850; cursor: pointer; }
.import-submit { width: 100%; min-height: 49px; font-size: 11px; }
.import-guide { position: sticky; top: 18px; }
.column-guide { display: grid; gap: 8px; }
.column-guide > div { padding: 10px 11px; border: 1px solid #e5eaf1; border-radius: 11px; background: #fafbfc; }
.column-guide b { display: block; color: #344054; font-size: 10px; }
.column-guide span { display: block; margin-top: 2px; color: #7c8799; font-size: 8px; line-height: 1.8; }
.import-tips { display: grid; gap: 8px; margin: 14px 0 0; padding-right: 18px; color: #667085; font-size: 9px; }
.import-report .subhead { margin-top: 0; }
.import-stats .stat-created strong { color: #067647; }
.import-stats .stat-updated strong { color: #4f46e5; }
.import-stats .stat-invalid strong { color: #b42318; }
.import-report-title { margin: 0 0 10px; }
.mapping-list { display: flex; gap: 7px; flex-wrap: wrap; }
.mapping-list span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid #dfe5ee; border-radius: 9px; background: #f8fafc; color: #667085; font-size: 8px; }
.mapping-list b { color: #344054; }
.mapping-list i { color: var(--admin-primary); font-style: normal; }
.issue-card { overflow: hidden; }
.issue-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.issue-list > div { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: 9px; background: #f8fafc; }
.issue-list b { flex: 0 0 auto; font-size: 9px; }
.issue-list span { color: #667085; font-size: 9px; }
.error-issues { border-top: 3px solid #f04438; }
.error-issues .issue-list > div { background: #fff6f5; }
.error-issues .issue-list b { color: #b42318; }
.warning-issues { border-top: 3px solid #f79009; }
.warning-issues .issue-list > div { background: #fffaeb; }
.warning-issues .issue-list b { color: #b54708; }

.bars { height: 185px; display: flex; align-items: flex-end; gap: 7px; overflow: hidden; }
.bars > div { min-width: 11px; flex: 1; text-align: center; }
.bars i { display: block; min-height: 4px; border-radius: 6px 6px 2px 2px; background: linear-gradient(#7c3aed, #4f46e5); }
.bars small { color: #98a2b3; font-size: 7px; white-space: nowrap; }

/* ویرایشگر فرم و گالری تم */
.form-editor > .card { scroll-margin-top: 20px; }
.theme-gallery { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 11px; }
.theme-option { position: relative; display: block; min-width: 0; padding: 9px; border: 2px solid #e4e9f1; border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s; }
.theme-option:hover { transform: translateY(-2px); box-shadow: 0 10px 27px rgba(16, 24, 40, .08); }
.theme-option:has(input:checked) { border-color: var(--admin-primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.theme-option > input { position: absolute; opacity: 0; pointer-events: none; }
.theme-check { position: absolute; z-index: 3; top: 14px; right: 14px; width: 21px; height: 21px; display: none; place-items: center; border-radius: 50%; background: var(--admin-primary); color: #fff; font-size: 9px; }
.theme-option:has(input:checked) .theme-check { display: grid; }
.theme-option > strong { display: block; margin-top: 8px; color: #344054; font-size: 10px; }
.theme-option > small { display: block; height: 34px; overflow: hidden; color: #8a94a6; font-size: 7px; line-height: 1.6; }
.theme-previews { height: 88px; display: grid; grid-template-columns: 1fr 38px; gap: 5px; padding: 7px; overflow: hidden; border-radius: 10px; background: #f3f4f8; direction: ltr; }
.theme-previews i { position: relative; display: block; overflow: hidden; border: 1px solid rgba(0, 0, 0, .1); border-radius: 5px; background: #fff; }
.theme-desktop b, .theme-mobile b { position: absolute; inset: 5px 5px auto; height: 22px; border-radius: 3px; background: linear-gradient(135deg, #6366f1, #a855f7); }
.theme-desktop em { position: absolute; top: 31px; right: 5px; bottom: 5px; width: 55%; border-radius: 3px; background: #fff; box-shadow: inset 0 0 0 1px #e5e7eb; }
.theme-desktop small { position: absolute; top: 31px; left: 5px; bottom: 5px; width: 33%; border-radius: 3px; background: #fff; box-shadow: inset 0 0 0 1px #e5e7eb; }
.theme-mobile b { height: 19px; }
.theme-mobile em { position: absolute; inset: 29px 5px 5px; border-radius: 3px; background: #fff; box-shadow: inset 0 0 0 1px #e5e7eb; }
[data-theme-card="luxury"] .theme-previews { background: #0d0c0a; }
[data-theme-card="luxury"] .theme-previews i { background: #171612; border-color: #725a30; }
[data-theme-card="luxury"] .theme-previews b { background: linear-gradient(135deg, #342c1e, #c79a45); }
[data-theme-card="gradient"] .theme-previews { background: linear-gradient(135deg, #7c3aed, #ec4899); }
[data-theme-card="gradient"] .theme-desktop small { right: 5px; left: auto; width: 33%; }
[data-theme-card="gradient"] .theme-desktop em { right: auto; left: 5px; width: 55%; }
[data-theme-card="glass"] .theme-previews { background: radial-gradient(circle at 80% 20%, #5eead4, transparent 35%), #dff7f4; }
[data-theme-card="glass"] .theme-previews i { background: rgba(255, 255, 255, .65); }
[data-theme-card="editorial"] .theme-previews { border: 1px solid #111827; border-radius: 0; background: #f6f1e9; }
[data-theme-card="editorial"] .theme-previews i { border-radius: 0; border-color: #111827; }
[data-theme-card="nature"] .theme-previews { background: #e9f5ea; }
[data-theme-card="nature"] .theme-previews b { background: linear-gradient(135deg, #2f855a, #84cc16); }
[data-theme-card="nature"] .theme-previews i { border-radius: 9px 3px 9px 3px; }
[data-theme-card="corporate"] .theme-previews { background: repeating-linear-gradient(90deg, #eff6ff 0 1px, transparent 1px 10px), #f8fbff; }
[data-theme-card="corporate"] .theme-previews i { border-radius: 2px; }
[data-theme-card="corporate"] .theme-previews b { background: #1d4ed8; }
[data-theme-card="warm"] .theme-previews { background: #fff0df; }
[data-theme-card="warm"] .theme-previews i { border-radius: 11px; border-color: #fdba74; }
[data-theme-card="warm"] .theme-previews b { background: linear-gradient(135deg, #ea580c, #f59e0b); }
[data-theme-card="neon"] .theme-previews { background: #080712; }
[data-theme-card="neon"] .theme-previews i { background: #151127; border-color: #8b5cf6; }
[data-theme-card="neon"] .theme-previews b { background: linear-gradient(135deg, #8b5cf6, #22d3ee); }
[data-theme-card="mobile-first"] .theme-previews { background: #ffe4e9; }
[data-theme-card="mobile-first"] .theme-desktop em { right: 5px; width: 34%; }
[data-theme-card="mobile-first"] .theme-desktop small { left: 5px; width: 52%; }
[data-theme-card="mobile-first"] .theme-mobile em { top: 5px; height: 46px; background: #fff; }
[data-theme-card="mobile-first"] .theme-mobile b { top: 56px; height: 10px; background: #fb7185; }
.theme-controls { margin-top: 17px; padding-top: 17px; border-top: 1px solid #edf0f4; }
.color-control { display: grid; grid-template-columns: 70px 1fr; gap: 8px; }
.color-control code { display: flex; align-items: center; padding: 0 10px; border: 1px solid #e0e5ec; border-radius: 9px; direction: ltr; background: #fafbfc; color: #475467; }
.editor-savebar { position: sticky; z-index: 10; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border: 1px solid #d8dcef; border-radius: 14px; background: rgba(255, 255, 255, .94); box-shadow: 0 15px 45px rgba(16, 24, 40, .14); backdrop-filter: blur(12px); color: var(--admin-muted); font-size: 9px; }
.required-mark { color: #d92d20; }
.tracking-row { align-items: flex-end; }

/* مرکز پیامک */
.subnav { display: flex; gap: 5px; margin: -5px 0 18px; padding: 5px; overflow-x: auto; border: 1px solid var(--admin-border); border-radius: 12px; background: #fff; }
.subnav a { flex: 0 0 auto; padding: 7px 11px; border-radius: 8px; color: #667085; font-size: 9px; font-weight: 750; }
.subnav a.active { background: #eef2ff; color: var(--admin-primary); }
.connection-dot, .status-dot { display: inline-flex; align-items: center; gap: 5px; color: #b42318; font-size: 8px; font-weight: 850; }
.connection-dot::before, .status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f04438; box-shadow: 0 0 0 3px #fee4e2; }
.connection-dot.on, .status-dot.on { color: #067647; }
.connection-dot.on::before, .status-dot.on::before { background: #12b76a; box-shadow: 0 0 0 3px #d1fadf; }
.divider-title { display: flex; align-items: center; gap: 9px; margin: 22px 0 14px; color: #667085; font-size: 9px; }
.divider-title::before, .divider-title::after { content: ""; height: 1px; flex: 1; background: #edf0f4; }
.test-result { display: block; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 17px; }
.quick-links a { display: block; padding: 11px; border: 1px solid #e4e9f1; border-radius: 11px; background: #fafbff; }
.quick-links b { display: block; color: #344054; font-size: 10px; }
.quick-links span { display: block; margin-top: 2px; color: #8a94a6; font-size: 8px; }
.campaign-counts { display: grid; justify-items: end; font-size: 8px; }

.template-layout { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); }
.variable-box { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.variable-box > span { color: #667085; font-size: 9px; }
.variable-box button { padding: 4px 7px; border: 1px solid #cfd7e4; border-radius: 7px; background: #f8fafc; color: var(--admin-primary); direction: ltr; cursor: pointer; font-size: 8px; }
.message-meter { display: flex; gap: 12px; padding: 8px 10px; border-radius: 9px; background: #f8fafc; color: #667085; font-size: 8px; }
.live-preview-card { position: sticky; top: 18px; }
.phone-preview { width: min(245px, 100%); margin: 16px auto; padding: 8px; border: 5px solid #1d2939; border-radius: 31px; background: #1d2939; box-shadow: 0 22px 45px rgba(16, 24, 40, .18); }
.phone-speaker { width: 65px; height: 5px; margin: 3px auto 8px; border-radius: 99px; background: #475467; }
.phone-screen { min-height: 330px; padding: 24px 12px; border-radius: 21px; background: linear-gradient(180deg, #f2f4f7, #fff); }
.sms-sender { display: block; margin-bottom: 22px; color: #344054; text-align: center; font-size: 9px; font-weight: 850; }
.sms-bubble { padding: 11px; border-radius: 13px 13px 4px 13px; background: #d9fdd3; color: #1d2939; font-size: 10px; line-height: 1.8; white-space: pre-wrap; }
.phone-screen > small { display: block; margin-top: 5px; color: #98a2b3; text-align: left; font-size: 7px; }
.template-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.template-item { display: flex; flex-direction: column; min-height: 245px; padding: 14px; border: 1px solid #e4e9f1; border-radius: 13px; background: #fff; }
.template-item.is-disabled { opacity: .62; background: #f8fafc; }
.template-item-head { display: flex; justify-content: space-between; gap: 7px; }
.template-item-head > div { display: flex; gap: 4px; flex-wrap: wrap; }
.template-item h3 { margin: 12px 0 5px; }
.template-item p { max-height: 77px; margin: 0; overflow: hidden; color: #667085; font-size: 9px; }
.template-item code { margin-top: 8px; overflow: hidden; color: #475467; direction: ltr; font-size: 8px; text-overflow: ellipsis; }
.template-meta { display: flex; gap: 8px; margin-top: auto; padding: 10px 0; color: #8a94a6; font-size: 8px; }
.template-item .actions { border-top: 1px solid #edf0f4; padding-top: 10px; }

.sequence-builder { border-top: 4px solid var(--admin-primary); }
.sequence-steps { display: grid; gap: 8px; }
.sequence-step { display: grid; grid-template-columns: 72px minmax(220px, 2fr) minmax(110px, .7fr) minmax(105px, .65fr) 44px; gap: 9px; align-items: end; padding: 12px; border: 1px solid #e3e8f0; border-radius: 12px; background: #fafbfc; }
.step-index { align-self: center; color: var(--admin-primary); font-size: 10px; font-weight: 900; }
.sequence-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mini-progress { width: 90px; height: 5px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: #edf0f4; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--admin-primary); }

.log-filter { margin-bottom: 14px !important; }
.log-filter .actions { margin-top: 12px; }
.log-detail { border-right: 4px solid var(--admin-primary); }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.detail-grid > div { padding: 10px; border-radius: 9px; background: #f8fafc; }
.detail-grid span { display: block; color: #8a94a6; font-size: 8px; }
.detail-grid b { display: block; margin-top: 3px; font-size: 10px; }
.message-box, .error-box { padding: 12px; border-radius: 10px; background: #f8fafc; font-size: 10px; }
.error-box { background: #fff1f0; color: #b42318; direction: ltr; text-align: left; }

/* تنظیمات ظاهر و فونت */
.appearance-selection { border-top: 4px solid var(--admin-primary); }
.appearance-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 17px; border-top: 1px solid #edf0f4; }
.appearance-actions span { color: var(--admin-muted); font-size: 9px; }
.font-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.font-card { min-width: 0; padding: 14px; border: 1px solid #e1e7ef; border-radius: 14px; background: #fff; }
.font-card.is-locked { background: #fafbfc; }
.font-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.font-card-head b { display: block; color: #344054; font-size: 11px; }
.font-card-head small { display: block; margin-top: 2px; color: #98a2b3; font-size: 7px; }
.font-sample { min-height: 142px; margin-top: 13px; padding: 15px; overflow: hidden; border: 1px solid #e6eaf0; border-radius: 12px; background: linear-gradient(145deg, #f8fafc, #fff); }
.font-sample strong { display: block; color: #1d2939; font-size: 17px; line-height: 1.7; }
.font-sample p { margin: 7px 0; color: #475467; font-size: 10px; line-height: 1.9; }
.font-sample span { color: #7c3aed; font-size: 8px; font-weight: 700; }
.font-description { min-height: 33px; margin: 10px 0 0; color: #667085; font-size: 8px; line-height: 1.8; }
.custom-font-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 15px; }
.custom-font-card { display: grid; gap: 14px; padding: 17px; border: 1px solid #e1e7ef; border-radius: 14px; background: #fafbfc; }
.custom-font-card .card-head { margin: 0; }
.custom-font-card h3 { margin: 0; font-size: 14px; }
.custom-font-card .link { width: 100%; padding-top: 11px; border-top: 1px solid #e4e9f1; font-size: 9px; text-align: center; }
.custom-font-card input[type="file"] { padding: 8px; background: #fff; font-size: 9px; }
.custom-font-card input[type="file"]::file-selector-button { margin-left: 9px; padding: 6px 9px; border: 0; border-radius: 7px; background: #eef2ff; color: var(--admin-primary); font: inherit; font-weight: 850; cursor: pointer; }

/* ارتقا، سیستم و ورود */
.upgrade-card { max-width: 840px !important; }
.version-line { display: grid; grid-template-columns: 1fr 50px 1fr; align-items: center; gap: 8px; margin-bottom: 18px; }
.version-line > div:not(.version-arrow) { padding: 16px; border-radius: 12px; background: #f8fafc; text-align: center; }
.version-line span { display: block; color: #667085; font-size: 9px; }
.version-line strong { display: block; margin-top: 3px; font-size: 20px; direction: ltr; }
.version-arrow { color: var(--admin-primary); text-align: center; font-size: 23px; }
.operation-list { padding-right: 20px; color: #475467; font-size: 10px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 20%, #e6e7ff, transparent 34%), radial-gradient(circle at 80% 80%, #f3e8ff, transparent 35%), #f5f7fb; }
.auth-card { width: min(430px, 100%); padding: 31px; border: 1px solid #e3e8f0; border-radius: 23px; background: #fff; box-shadow: 0 30px 75px rgba(16, 24, 40, .15); }
.auth-card h1 { margin: 22px 0 0; font-size: 24px; }
.auth-brand { padding: 0; color: #172033; }
.auth-brand small { color: #667085; }
.logo { font-size: 19px; font-weight: 900; }
.logo b { color: var(--admin-primary); }
.installer { width: min(920px, 100%); padding: 28px; border-radius: 22px; background: #fff; box-shadow: 0 30px 75px rgba(16, 24, 40, .14); }
.installer .section-title h1 { margin: 0; font-size: 23px; }
.installer .section-title p { margin: 2px 0 0; color: #667085; font-size: 10px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 18px 0; }
.checks > div { display: flex; justify-content: space-between; padding: 9px; border-radius: 8px; background: #f8fafc; font-size: 9px; }
fieldset { border: 1px solid var(--admin-border); border-radius: 11px; }
hr { border: 0; border-top: 1px solid #edf0f4; }
code { direction: ltr; }

@media (max-width: 1200px) {
    .theme-gallery { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
    .template-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sequence-step { grid-template-columns: 65px minmax(190px, 1.5fr) 100px 100px 40px; }
    .font-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .audience-layout { grid-template-columns: 1fr; }
    .audience-list-filter { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 980px) {
    .sidebar { transform: translateX(100%); transition: transform .2s ease; }
    .admin-body.sidebar-open .sidebar { transform: none; }
    .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; background: rgba(16, 24, 40, .5); }
    .admin-body.sidebar-open .sidebar-backdrop { display: block; }
    .hamburger { position: fixed; z-index: 35; top: 12px; right: 12px; display: block; width: 42px; height: 42px; border: 0; border-radius: 11px; background: #101828; color: #fff; box-shadow: 0 8px 23px rgba(16, 24, 40, .22); }
    .admin-main { margin-right: 0; padding: 70px 14px 25px; }
    .cols, .template-layout { grid-template-columns: 1fr; }
    .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .live-preview-card { position: static; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .custom-font-grid { grid-template-columns: 1fr; }
    .import-layout { grid-template-columns: 1fr; }
    .import-guide { position: static; }
    .audience-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .admin-main { padding-left: 9px; padding-right: 9px; }
    .upgrade-banner { align-items: flex-start; flex-direction: column; gap: 8px; }
    .head { align-items: flex-start; flex-direction: column; }
    .head h1 { font-size: 22px; }
    .head .actions { width: 100%; }
    .head .actions .btn { flex: 1; }
    .grid, .grid.three { grid-template-columns: 1fr; }
    .card { padding: 16px; border-radius: 14px; }
    .stats, .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stats article { padding: 13px; }
    .stats strong { font-size: 20px; }
    .inline, .filter, .sequence-actions, .editor-savebar, .appearance-actions { align-items: stretch; flex-direction: column; }
    .editor-savebar { bottom: 6px; }
    .theme-gallery { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .theme-option > small { height: 30px; }
    .template-list { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: 1fr; }
    .sequence-step { grid-template-columns: 1fr 1fr; }
    .sequence-step .step-index { grid-column: 1 / -1; }
    .sequence-step label:first-of-type { grid-column: 1 / -1; }
    .sequence-step [data-remove-step] { align-self: center; }
    .detail-grid { grid-template-columns: 1fr; }
    .version-line { grid-template-columns: 1fr; }
    .version-arrow { transform: rotate(90deg); }
    .checks { grid-template-columns: 1fr; }
    .font-gallery { grid-template-columns: 1fr; }
    .issue-list { grid-template-columns: 1fr; }
    .upload-box { min-height: 180px; padding: 17px 11px; }
    .audience-savebar, .member-manager .card-head { align-items: stretch; flex-direction: column; }
    .audience-savebar .actions, .member-manager .actions { width: 100%; }
    .audience-savebar .btn, .member-manager .actions .btn { flex: 1; }
    .audience-list-filter { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
    .theme-gallery { grid-template-columns: 1fr; }
    .stats, .stats.four { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
