/* Local fonts — no CDN */
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/vazirmatn-arabic-400.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/vazirmatn-latin-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/vazirmatn-arabic-500.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/vazirmatn-latin-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/vazirmatn-arabic-600.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/vazirmatn-latin-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/vazirmatn-arabic-700.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/vazirmatn-latin-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/outfit-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/outfit-700.woff2') format('woff2');
}

:root {
    --alpha-bg: #f4f5fb;
    --alpha-bg-elevated: #ffffff;
    --alpha-surface: #ffffff;
    --alpha-surface-2: #f7f8fc;
    --alpha-border: #e8eaf2;
    --alpha-border-strong: #d9dce8;
    --alpha-text: #1c1f2e;
    --alpha-muted: #8b90a5;
    --alpha-purple: #6c5ce7;
    --alpha-purple-2: #7b6cff;
    --alpha-purple-soft: #eeeaff;
    --alpha-purple-active: #f0edff;
    --alpha-green: #20c997;
    --alpha-green-soft: #e6f9f2;
    --alpha-orange: #fd7e14;
    --alpha-orange-soft: #fff1e6;
    --alpha-pink: #e83e8c;
    --alpha-cyan: #0dcaf0;
    --alpha-radius: 20px;
    --alpha-radius-sm: 14px;
    --alpha-shadow: 0 10px 30px rgba(28, 31, 46, 0.06);
    --alpha-sidebar: 272px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--alpha-bg);
    color: var(--alpha-text);
    font-family: 'Vazirmatn', system-ui, sans-serif;
    direction: rtl;
    text-align: right;
}

body {
    background:
        radial-gradient(700px 280px at 15% -5%, rgba(108, 92, 231, 0.08), transparent 55%),
        var(--alpha-bg);
}

a { color: var(--alpha-purple); text-decoration: none; }
a:hover { color: #5646d4; }

.page-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
    color: var(--alpha-text);
}

.page-subtitle {
    color: var(--alpha-muted);
    margin: 0.4rem 0 0;
    font-size: 0.95rem;
}

.alpha-card {
    background: var(--alpha-surface);
    border: 1px solid var(--alpha-border);
    border-radius: var(--alpha-radius);
    box-shadow: var(--alpha-shadow);
}

.alpha-card-pad { padding: 1.25rem 1.35rem; }

.channel-card {
    display: block;
    width: 100%;
    text-align: right;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    font: inherit;
    color: inherit;
    padding: 1.05rem 1.1rem;
    border-radius: var(--alpha-radius-sm);
    border: 1px solid var(--alpha-border);
    background: var(--alpha-surface);
    box-shadow: var(--alpha-shadow);
}

.channel-cards-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 0.35rem 0 0.15rem;
    width: 100%;
}

.channel-card-title {
    display: block;
    margin-top: 0.85rem;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--alpha-text);
}

@media (max-width: 720px) {
    .channel-cards-row {
        grid-template-columns: 1fr;
    }
}

.settings-security-panel {
    margin-top: 0.85rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--alpha-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--alpha-surface) 92%, #eef2ff);
}

.settings-security-panel .channel-card-title {
    margin-top: 0;
}

.settings-security-panel .channel-card-desc {
    margin: 0.35rem 0 0;
}

.settings-security-panel .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 900px) {
    .settings-security-panel .grid-3 {
        grid-template-columns: 1fr;
    }
}

.channel-card:hover {
    border-color: color-mix(in srgb, var(--alpha-purple) 35%, var(--alpha-border));
    box-shadow: 0 10px 28px rgba(20, 22, 35, 0.08);
    transform: translateY(-1px);
}

.channel-card:focus-visible {
    outline: 2px solid var(--alpha-purple);
    outline-offset: 2px;
}

.channel-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.channel-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.1rem;
    height: 2rem;
    padding: 0 .65rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.channel-card-icon.sms {
    background: rgba(84, 209, 255, .14);
    color: #1a6f8c;
}

.channel-card-icon.notif {
    background: rgba(124, 92, 255, .12);
    color: var(--alpha-purple);
}

.channel-status {
    font-size: .78rem;
    font-weight: 700;
    padding: .22rem .65rem;
    border-radius: 999px;
}

.channel-status.on {
    background: rgba(46, 184, 122, .14);
    color: var(--alpha-green);
}

.channel-status.off {
    background: rgba(20, 22, 35, .06);
    color: var(--alpha-muted);
}

.channel-card-desc {
    margin: 0;
    font-size: .88rem;
    line-height: 1.55;
    min-height: 0;
}

.channel-card-action {
    display: inline-block;
    margin-top: .75rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--alpha-purple);
}

.channel-card .switch {
    flex-shrink: 0;
}

.sms-cred-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.15rem;
}

.sms-cred-row {
    display: grid;
    grid-template-columns: 7.2rem 1fr;
    gap: 0.5rem;
    align-items: start;
    font-size: 0.8rem;
    line-height: 1.5;
}

.sms-cred-row > span {
    color: var(--alpha-muted);
    font-weight: 600;
}

.sms-cred-row code,
.sms-cred-row strong {
    font-size: 0.78rem;
    word-break: break-all;
    color: var(--alpha-text);
}

.sms-cred-row code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #f3f5f9;
    border: 1px solid var(--alpha-border);
    border-radius: 8px;
    padding: 0.2rem 0.45rem;
}

.sms-credit-line strong.sms-credit-ok {
    color: #0f9f6e;
    font-size: 0.95rem;
}

.sms-credit-line strong.sms-credit-err {
    color: #c62828;
}

.settings-tree .tree-item-product {
    cursor: pointer;
}

.settings-tree .tree-item-product:hover .tree-item-body {
    border-color: color-mix(in srgb, var(--alpha-purple) 28%, var(--alpha-border));
}

.settings-tree .tree-children:has(.channel-cards-row) {
    padding-inline-start: 0;
    margin-inline-start: 0;
    border: none;
}

.settings-tree .channel-cards-row {
    margin-top: 0.35rem;
}

.sms-credit-ok { color: #0f9f6e; }
.sms-credit-err { color: #c62828; }

.settings-events-panel {
    cursor: default;
}

.settings-events-panel .alpha-table {
    margin: 0;
}

.settings-events-panel .tree-item-body {
    display: block;
    padding: 0.65rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr; }
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.2rem 1.2rem 1rem;
    min-height: 128px;
}

.stat-label {
    color: var(--alpha-muted);
    font-size: 0.86rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    margin-top: 0.4rem;
    line-height: 1.1;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--alpha-green);
}

.stat-trend.down { color: var(--alpha-orange); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--alpha-purple-soft);
    color: var(--alpha-purple);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--alpha-surface-2);
    border: 1px solid var(--alpha-border);
    color: var(--alpha-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.upgrade-card {
    background: linear-gradient(145deg, #7b6cff 0%, #6c5ce7 45%, #5a4bd6 100%);
    border: none;
    color: white;
    border-radius: var(--alpha-radius);
    padding: 1.5rem 1.4rem;
    box-shadow: 0 18px 40px rgba(108, 92, 231, 0.28);
    min-height: 100%;
}

.upgrade-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.upgrade-card p {
    margin: 0 0 1.25rem;
    opacity: 0.92;
    font-size: 0.92rem;
    line-height: 1.65;
}

.btn-alpha {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 0.7rem 1.15rem;
    font-weight: 650;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-alpha:hover { transform: translateY(-1px); }

.btn-alpha-primary {
    background: var(--alpha-purple);
    color: white;
    box-shadow: 0 10px 22px rgba(108, 92, 231, 0.28);
}

.btn-alpha-primary:hover { background: #5b4bd4; }

.btn-alpha-ghost {
    background: #fff;
    color: var(--alpha-text);
    border: 1px solid var(--alpha-border-strong);
}

.btn-alpha-soft {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.28);
}

.btn-alpha-danger {
    background: #ffe8f1;
    color: #d63384;
    border: 1px solid #ffd0e3;
}

.btn-alpha-success {
    background: var(--alpha-green-soft);
    color: #0f9f6e;
    border: 1px solid #c6f0df;
}

.btn-alpha-sm {
    padding: 0.42rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 10px;
}

.alpha-table-wrap {
    overflow: auto;
    border-radius: var(--alpha-radius-sm);
}

.alpha-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.alpha-table th {
    text-align: right;
    color: var(--alpha-muted);
    font-size: 0.78rem;
    font-weight: 650;
    padding: 0.8rem 0.85rem;
    border-bottom: 1px solid var(--alpha-border);
    white-space: nowrap;
    background: #fafbfe;
}

.alpha-table td {
    padding: 0.95rem 0.85rem;
    border-bottom: 1px solid var(--alpha-border);
    vertical-align: middle;
    font-size: 0.92rem;
    text-align: right;
}

.alpha-table tr:last-child td { border-bottom: none; }
.alpha-table tbody tr:hover td { background: #fafbfe; }
.alpha-table tbody tr.row-off td { opacity: 0.72; }

.excel-table {
    position: relative;
}

.excel-table thead th {
    position: relative;
    background: #eef1f7;
    border-bottom: 1px solid #d5dae8;
    padding: 0;
    vertical-align: middle;
}

.excel-th-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    min-height: 38px;
    padding: 0.45rem 0.55rem;
    user-select: none;
}

.excel-th-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #4b5166;
}

.excel-filter-btn {
    width: 22px;
    height: 22px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #7a8196;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.excel-filter-btn:hover {
    background: #fff;
    border-color: #c5cad8;
    color: #3d4358;
}

.excel-filter-btn.active {
    background: #217346;
    border-color: #217346;
    color: #fff;
}

.excel-filter-btn.open {
    background: #fff;
    border-color: #217346;
    color: #217346;
}

.excel-filter-btn svg {
    width: 12px;
    height: 12px;
    display: block;
}

.excel-filter-menu {
    position: absolute;
    top: calc(100% - 1px);
    inset-inline-end: 0;
    z-index: 40;
    width: 240px;
    background: #fff;
    border: 1px solid #b8beca;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(28, 31, 46, 0.18);
    padding: 0.45rem;
    text-align: right;
}

.excel-filter-menu.align-start {
    inset-inline-end: auto;
    inset-inline-start: 0;
}

.excel-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    background: transparent;
    color: #2f3445;
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0.45rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    text-align: right;
}

.excel-menu-item:hover {
    background: #e8f2ec;
}

.excel-menu-item.active {
    background: #d8ebe0;
    font-weight: 650;
}

.excel-menu-divider {
    height: 1px;
    background: #e2e5ee;
    margin: 0.35rem 0;
}

.excel-menu-search {
    width: 100%;
    border: 1px solid #c5cad8;
    border-radius: 3px;
    padding: 0.4rem 0.5rem;
    font-family: inherit;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
    background: #fff;
}

.excel-menu-search:focus {
    outline: none;
    border-color: #217346;
    box-shadow: 0 0 0 2px rgba(33, 115, 70, 0.15);
}

.excel-menu-list {
    max-height: 160px;
    overflow: auto;
    border: 1px solid #e2e5ee;
    border-radius: 3px;
    margin-bottom: 0.4rem;
}

.excel-menu-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    color: #2f3445;
    cursor: pointer;
}

.excel-menu-check:hover {
    background: #f4f6fb;
}

.excel-menu-check input {
    accent-color: #217346;
}

.excel-menu-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.excel-menu-actions .btn-alpha {
    min-width: 72px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.excel-filter-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: transparent;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-card {
    border: 1px solid var(--alpha-border);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.order-card:hover {
    border-color: #d9def0;
    box-shadow: 0 8px 24px rgba(20, 22, 35, 0.05);
}

.order-card.is-open {
    border-color: color-mix(in srgb, #0b4742 28%, var(--alpha-border));
    box-shadow: 0 10px 28px rgba(11, 71, 66, 0.08);
    background: #f7faf9;
}

.order-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.15fr) minmax(140px, 1.1fr) auto minmax(140px, 0.85fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 1rem;
}

.order-row-time {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
    min-width: 88px;
}

.order-row-time strong {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.order-product {
    font-size: 0.95rem;
}

.order-row-actions {
    display: flex;
    justify-content: flex-end;
}

.order-status-select {
    min-width: 140px;
    padding: 0.5rem 0.7rem !important;
    font-weight: 600;
}

.order-status-select.status-pending { color: #c47a12; }
.order-status-select.status-confirmed { color: #2f6fed; }
.order-status-select.status-processing { color: #6c5ce7; }
.order-status-select.status-shipped { color: #0f8a7a; }
.order-status-select.status-delivered { color: #1f9d57; }
.order-status-select.status-cancelled { color: #c62828; }

.order-invoice {
    border-top: 1px solid color-mix(in srgb, #0b4742 16%, #cfd8d5);
    margin: 0;
    padding: 1.05rem 1.1rem 1.2rem;
    background:
        linear-gradient(165deg, #dfecea 0%, #e7f1ee 42%, #e2ebe8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.order-invoice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.order-invoice-head > div {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
}

.order-invoice-head strong {
    color: #0b4742;
}

.order-invoice-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.95rem;
}

.order-invoice-meta > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 252, 247, 0.86);
    border: 1px solid color-mix(in srgb, #0b4742 12%, #d5e0dc);
}

.order-invoice-meta span {
    font-size: 0.75rem;
}

.order-invoice .alpha-table-wrap {
    background: rgba(255, 252, 247, 0.78);
    border: 1px solid color-mix(in srgb, #0b4742 10%, #d5e0dc);
    border-radius: 12px;
    overflow: hidden;
}

.order-invoice-table th,
.order-invoice-table td {
    white-space: nowrap;
}

.order-invoice-table th:nth-child(2),
.order-invoice-table td:nth-child(2) {
    white-space: normal;
    min-width: 160px;
}

.order-invoice-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px dashed color-mix(in srgb, #0b4742 18%, #d9def0);
}

.order-invoice-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.order-invoice-total strong {
    font-size: 1.1rem;
    color: #0f766e;
}

@media (max-width: 900px) {
    .order-row {
        grid-template-columns: 1fr 1fr;
    }

    .order-row-status,
    .order-row-actions {
        grid-column: 1 / -1;
    }

    .order-invoice-meta {
        grid-template-columns: 1fr;
    }

    .order-invoice-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .order-invoice-total {
        align-items: flex-start;
    }
}


.badge-alpha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: max-content;
}

.badge-pending { background: var(--alpha-orange-soft); color: var(--alpha-orange); }
.badge-active { background: var(--alpha-green-soft); color: #0f9f6e; }
.badge-rejected { background: #ffe8f1; color: #d63384; }

.td-status {
    width: 1%;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .badge-alpha {
        font-size: 0.7rem;
        padding: 0.22rem 0.55rem;
    }
}

.form-alpha {
    width: 100%;
    background: #fff;
    border: 1px solid var(--alpha-border-strong);
    color: var(--alpha-text);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
}

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-suffix .form-alpha {
    width: 100%;
    padding-inline-end: 3.6rem;
    padding-inline-start: 0.9rem;
}

.input-with-suffix .money-input {
    direction: ltr;
    text-align: left;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.input-suffix {
    position: absolute;
    inset-inline-end: 0.85rem;
    inset-inline-start: auto;
    color: var(--alpha-muted);
    font-size: 0.85rem;
    font-weight: 650;
    pointer-events: none;
}

/* ریال ثابت بیرون از input تا عدد روی آن نرود */
.input-with-suffix.money-field {
    gap: 0.55rem;
}

.input-with-suffix.money-field .form-alpha {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding-inline-end: 0.9rem;
    padding-inline-start: 0.9rem;
}

.input-with-suffix.money-field .money-input {
    direction: ltr;
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.input-with-suffix.money-field .input-suffix {
    position: static;
    inset: auto;
    flex: 0 0 auto;
    user-select: none;
    white-space: nowrap;
}

.form-alpha:focus {
    border-color: #b7aef5;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.14);
}

.form-alpha::placeholder { color: #a0a5b8; }

select.form-alpha {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%238B90A5' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.9rem center;
    padding-inline-start: 2rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
}

.order-filters {
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--alpha-border);
}

.field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 140px; }
.field label { color: var(--alpha-muted); font-size: 0.8rem; font-weight: 600; text-align: right; }

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field .form-alpha {
    width: 100%;
    padding-inline-end: 2.75rem;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 0.55rem;
    inset-inline-start: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--alpha-muted);
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--alpha-ink, #1f2430);
    background: rgba(15, 23, 42, 0.06);
}

.alert-alpha {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--alpha-border);
    background: #fff;
    color: var(--alpha-text);
}

.alert-alpha.info { border-color: #ddd6ff; background: var(--alpha-purple-soft); }
.alert-alpha.danger { border-color: #ffd0e3; background: #fff0f6; color: #b02a67; }

.alert-alpha.alert-dismissible {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-alpha-text {
    flex: 1;
    min-width: 0;
    line-height: 1.55;
}

.alert-dismiss {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    margin: -0.15rem 0 -0.15rem -0.15rem;
    margin-inline-start: 0;
    margin-inline-end: -0.15rem;
    border: 1px solid rgba(20, 22, 35, 0.18);
    border-radius: 8px;
    background: #fff;
    color: var(--alpha-muted);
    padding: 0;
    cursor: pointer;
    opacity: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(20, 22, 35, 0.06);
}

.alert-dismiss svg {
    display: block;
}

.alert-dismiss:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

.sparkline {
    width: 100%;
    height: 42px;
    margin-top: 0.75rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    height: 180px;
    padding-top: 0.5rem;
    margin-bottom: 1.5rem;
    direction: ltr; /* محور زمان: گذشته ← → اکنون */
}

.chart-bars span {
    flex: 1;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, #8f7fff, rgba(108, 92, 231, 0.25));
    min-width: 0;
    position: relative;
}

.chart-bars span::after {
    content: attr(data-label);
    position: absolute;
    inset-inline: 0;
    bottom: -1.4rem;
    text-align: center;
    color: var(--alpha-muted);
    font-size: 0.7rem;
}

.chart-bars-dense {
    gap: 0.18rem;
}

.chart-bars-dense span {
    border-radius: 6px 6px 2px 2px;
}

.chart-bars-dense span::after {
    font-size: 0.58rem;
    bottom: -1.25rem;
}

.chart-range-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.85rem 0 1.1rem;
}

.chart-range-tab {
    border: 1px solid var(--alpha-border);
    background: #fff;
    color: var(--alpha-muted);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.chart-range-tab:hover {
    color: var(--alpha-text);
    border-color: #cfd3e4;
    background: #f7f8fc;
}

.chart-range-tab.active {
    background: #f4f1ff;
    border-color: #b9aef5;
    color: var(--alpha-purple);
}


.customer-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: var(--alpha-purple-soft);
    color: var(--alpha-purple);
    flex-shrink: 0;
}

.muted { color: var(--alpha-muted); }
.stack-sm { display: flex; flex-direction: column; gap: 0.15rem; }
.gap-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.profile-section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--alpha-text);
}

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

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background:
        radial-gradient(900px 480px at 12% 8%, rgba(11, 71, 66, 0.10), transparent 60%),
        radial-gradient(700px 420px at 90% 90%, rgba(228, 87, 61, 0.06), transparent 55%),
        linear-gradient(160deg, #f7f3ec 0%, #eef2f0 48%, #e8eeec 100%);
}

.login-stage {
    width: min(1080px, 100%);
    min-height: min(640px, calc(100vh - 2.5rem));
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    border-radius: 28px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(213, 224, 220, 0.9);
    box-shadow:
        0 30px 80px rgba(16, 28, 26, 0.10),
        0 8px 24px rgba(16, 28, 26, 0.05);
}

.login-visual {
    position: relative;
    min-height: 100%;
    background: #0b4742;
    overflow: hidden;
}

.login-visual-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1.02);
}

.login-visual-veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 53, 50, 0.18) 0%, rgba(6, 53, 50, 0.55) 55%, rgba(6, 53, 50, 0.82) 100%),
        linear-gradient(90deg, rgba(6, 53, 50, 0.15), transparent 40%);
}

.login-visual-copy {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 2rem 2.1rem 2.2rem;
    color: #fff;
}

.login-visual-mark,
.login-visual-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: block;
    object-fit: contain;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    margin-bottom: 0.35rem;
}

.login-visual-copy h2 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.login-visual-copy p {
    margin: 0;
    max-width: 28ch;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.7;
    font-size: 0.95rem;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
    background:
        linear-gradient(180deg, #fffcf7 0%, #ffffff 100%);
}

.login-panel-inner {
    width: min(360px, 100%);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.login-brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 0;
    display: block;
    object-fit: contain;
    background: transparent !important;
    box-shadow: none !important;
    flex-shrink: 0;
}

.login-brand-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--alpha-text);
    line-height: 1.2;
}

.login-brand-sub {
    color: var(--alpha-muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.login-title {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.login-lead {
    margin: 0 0 1.35rem;
    color: var(--alpha-muted);
    line-height: 1.7;
    font-size: 0.92rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.login-submit {
    width: 100%;
    margin-top: 0.35rem;
    min-height: 46px;
}

@media (max-width: 860px) {
    .login-shell {
        padding: 0;
        background: #fff;
    }

    .login-stage {
        min-height: 100vh;
        border-radius: 0;
        border: 0;
        box-shadow: none;
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 220px;
        max-height: 34vh;
    }

    .login-visual-copy {
        padding: 1.25rem 1.35rem 1.4rem;
    }

    .login-visual-copy h2 {
        font-size: 1.3rem;
    }

    .login-visual-copy p {
        display: none;
    }

    .login-panel {
        place-items: start center;
        padding: 1.5rem 1.25rem 2rem;
    }
}

.login-card {
    width: min(420px, 100%);
    padding: 2rem 1.75rem;
}

.login-card .brand {
    font-family: 'Outfit', 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.check-alpha {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--alpha-muted);
    font-size: 0.9rem;
}

.check-alpha input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--alpha-purple);
}

.content-wrap {
    padding: 0.25rem 0 2rem;
}

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }

.btn-fab {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--alpha-purple), var(--alpha-purple-2));
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(108, 92, 231, 0.28);
    display: grid;
    place-items: center;
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(108, 92, 231, 0.34);
}

.empty-catalog {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--alpha-muted);
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.catalog-search {
    position: relative;
    flex: 1 1 260px;
    max-width: 420px;
}

.catalog-search .search-icon {
    position: absolute;
    inset-inline-start: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    pointer-events: none;
}

.catalog-search .search-input {
    padding-inline-start: 2.4rem !important;
    padding-inline-end: 2.2rem !important;
}

.catalog-search .search-clear {
    position: absolute;
    inset-inline-end: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--alpha-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.catalog-search .search-clear:hover {
    background: var(--alpha-surface-2);
}

.tree-toggle {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--alpha-border);
    background: #fff;
    color: var(--alpha-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .18s ease, background .15s ease, color .15s ease;
}

.tree-toggle.open {
    transform: rotate(90deg);
    color: var(--alpha-purple);
    background: var(--alpha-purple-soft);
    border-color: transparent;
}

html[dir="rtl"] .tree-toggle {
    transform: scaleX(-1);
}

html[dir="rtl"] .tree-toggle.open {
    transform: scaleX(-1) rotate(-90deg);
}

.tree-toggle.spacer {
    visibility: hidden;
    pointer-events: none;
    border: none;
}

.catalog-tree {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tree-node {
    position: relative;
}

.tree-children {
    position: relative;
    margin-inline-start: 1.35rem;
    padding-inline-start: 1.15rem;
}

.tree-children::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0.75rem;
    border-inline-start: 1.5px dashed #c5c9d8;
}

.tree-item {
    position: relative;
    margin: 0.4rem 0;
}

.tree-item > .tree-guide {
    display: none;
}

.tree-children > .tree-item > .tree-guide,
.tree-children > .tree-node > .tree-item-category > .tree-guide {
    display: block;
    position: absolute;
    inset-inline-start: -1.15rem;
    top: 50%;
    width: 1.15rem;
    border-top: 1.5px dashed #c5c9d8;
}

.tree-item-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--alpha-border);
    border-radius: 16px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.tree-item-category > .tree-item-body {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fd 100%);
    box-shadow: 0 6px 18px rgba(28, 31, 46, 0.04);
}

.tree-item-product > .tree-item-body {
    background: #fcfcff;
}

.tree-item-product.is-off > .tree-item-body {
    opacity: 0.72;
    background: #f3f4f8;
}

.tree-item-body:hover {
    border-color: #d4d7e6;
    box-shadow: 0 8px 20px rgba(28, 31, 46, 0.06);
}

.tree-item-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.tree-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    flex-shrink: 0;
}

.tree-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--alpha-purple-soft);
    border: 1px solid var(--alpha-border);
    display: grid;
    place-items: center;
}

.tree-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tree-avatar-fallback {
    color: var(--alpha-purple);
    font-weight: 800;
    font-size: 0.95rem;
}

.tree-avatar-icon {
    color: var(--alpha-purple);
}

.tree-avatar-icon svg {
    display: block;
}

.tree-product-mark {
    width: 10px;
    height: 10px;
    margin-inline: 0.95rem;
    border-radius: 50%;
    background: var(--alpha-purple);
    box-shadow: 0 0 0 4px var(--alpha-purple-soft);
    flex-shrink: 0;
}

.tree-title {
    font-size: 0.95rem;
    line-height: 1.3;
}

.tree-meta {
    color: var(--alpha-muted);
    font-size: 0.8rem;
}

.tree-meta-with-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.tree-meta-badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 0;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.stock-ok {
    color: #166534;
    background: #dcfce7;
}

.stock-warn {
    color: #9a3412;
    background: #ffedd5;
}

.stock-low {
    color: #991b1b;
    background: #fee2e2;
}

.ceiling-badge {
    color: #1e3a5f;
    background: #e2e8f0;
}

.carton-badge {
    color: #0f5c4c;
    background: #d8f3ea;
}

.user-detail-row td {
    background: #faf9f7;
    border-top: none !important;
    padding-top: 0 !important;
}

.user-detail-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
    margin: 0.15rem 0 0.55rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--alpha-border);
    background: #fff;
}

.user-detail-panel > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.user-detail-panel span {
    font-size: 0.75rem;
}

button.linkish {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: inherit;
}

.icon-action {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--alpha-border);
    background: var(--alpha-purple-soft);
    color: var(--alpha-purple);
    font-size: 1.2rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d7dae6;
    position: relative;
    transition: background .18s ease;
    flex-shrink: 0;
}

.switch-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(28, 31, 46, 0.18);
    transition: transform .18s ease;
}

.switch input:checked + .switch-slider {
    background: var(--alpha-green);
}

.switch input:checked + .switch-slider::after {
    transform: translateX(-18px);
}

html[dir="rtl"] .switch input:checked + .switch-slider::after,
:root:dir(rtl) .switch input:checked + .switch-slider::after {
    transform: translateX(-18px);
}

.switch-label {
    font-size: 0.78rem;
    color: var(--alpha-muted);
    min-width: 3.2rem;
}

.switch input:checked ~ .switch-label {
    color: var(--alpha-green);
    font-weight: 600;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 35, 0.45);
    backdrop-filter: blur(4px);
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
    overscroll-behavior: none;
}

/* وقتی مودال باز است صفحهٔ پشت اسکرول نشود */
html:has(.modal-backdrop),
body:has(.modal-backdrop) {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.modal-sheet {
    width: min(560px, 100%);
    height: min(640px, 90vh);
    max-height: min(640px, 90vh);
    overflow: hidden;
    background: #fff;
    border-radius: 22px;
    border: 1px solid var(--alpha-border);
    box-shadow: 0 24px 60px rgba(20, 22, 35, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-sheet.wizard {
    width: min(620px, 100%);
    height: min(680px, 90vh);
    max-height: min(680px, 90vh);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem 0.75rem;
    flex-shrink: 0;
}

.modal-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.modal-body {
    padding: 0.5rem 1.25rem 1rem;
    display: grid;
    gap: 0.85rem;
    align-content: start;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 0.85rem 1.25rem 1.15rem;
    border-top: 1px solid var(--alpha-border);
    flex-shrink: 0;
    background: #fff;
}

.wizard-foot {
    justify-content: space-between;
    align-items: center;
}

.icon-btn {
    border: none;
    background: var(--alpha-surface-2);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--alpha-muted);
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    padding: 0 1.25rem 0.5rem;
    flex-shrink: 0;
}

.wizard-step {
    border: 1px solid var(--alpha-border);
    background: var(--alpha-surface-2);
    border-radius: 12px;
    padding: 0.55rem 0.4rem;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--alpha-muted);
    cursor: pointer;
}

.wizard-step.active {
    background: var(--alpha-purple-soft);
    border-color: transparent;
    color: var(--alpha-purple);
    font-weight: 700;
}

.image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.image-thumb {
    width: 88px;
    height: 88px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--alpha-border);
    background: var(--alpha-surface-2);
}

.image-thumb-logo {
    width: 112px;
    height: 112px;
    border-color: #b9aef5;
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.12);
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-remove {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 9px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    background: rgba(20, 22, 35, 0.55);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(20, 22, 35, 0.18);
    transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.thumb-remove:hover,
.thumb-remove:focus-visible {
    background: #e53935;
    color: #fff;
    transform: scale(1.06);
    outline: none;
}

.thumb-remove svg {
    display: block;
    pointer-events: none;
}

.file-input {
    padding: 0.55rem !important;
}

.review-box {
    margin-top: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: var(--alpha-surface-2);
    border: 1px solid var(--alpha-border);
    display: grid;
    gap: 0.35rem;
    font-size: 0.92rem;
}

.alert-alpha.danger {
    background: #ffe8ec;
    color: #b71c1c;
    border: 1px solid #ffcdd2;
}

.field textarea.form-alpha {
    min-height: 88px;
    resize: vertical;
}

.jalali-picker {
    border: 1px solid var(--alpha-border);
    border-radius: 16px;
    padding: 0.85rem;
    background: var(--alpha-surface-2);
}

.jalali-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.jalali-title {
    font-weight: 700;
    font-family: Outfit, Vazirmatn, sans-serif;
}

.jalali-weekdays,
.jalali-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
    text-align: center;
}

.jalali-weekdays {
    margin-bottom: 0.35rem;
    color: var(--alpha-muted);
    font-size: 0.78rem;
}

.jalali-day {
    border: none;
    background: #fff;
    border-radius: 10px;
    height: 36px;
    cursor: pointer;
    color: var(--alpha-text);
    font-family: Vazirmatn, sans-serif;
}

.jalali-day:hover {
    background: var(--alpha-purple-soft);
}

.jalali-day.selected {
    background: var(--alpha-purple);
    color: #fff;
    font-weight: 700;
}

.jalali-empty {
    height: 36px;
}

.jalali-actions {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.jalali-selected {
    margin-top: 0.55rem;
    font-size: 0.85rem;
}

.confirm-backdrop {
    z-index: 120;
}

.confirm-sheet {
    width: min(440px, 100%);
    height: auto;
    max-height: min(560px, 92vh);
}

.confirm-message {
    margin: 0;
    color: var(--alpha-text);
    line-height: 1.7;
    font-size: 0.95rem;
}

.confirm-prompt {
    margin-top: 0.85rem;
    min-height: 88px;
    resize: vertical;
}

.confirm-prompt-error {
    margin: 0.45rem 0 0;
    color: #c62828;
    font-size: 0.82rem;
    font-weight: 600;
}

.order-cancel-reason {
    margin: 0 1rem 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: #fff0f0;
    border: 1px solid #ffc9c9;
    color: #c62828;
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.55;
}

.order-cancel-reason-invoice {
    margin: 0.85rem 0 0;
}

/* Sidebar nav links (global — NavLink ignores scoped CSS attributes) */
.alpha-sidebar .nav-stack a.side-link {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.75rem;
    height: 48px;
    min-height: 48px;
    padding: 0 0.85rem;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid var(--alpha-border);
    background: #fff;
    color: #5f657a !important;
    text-decoration: none !important;
}

.alpha-sidebar .nav-stack a.side-link:hover {
    background: #f7f8fc;
    border-color: #cfd3e4;
    color: var(--alpha-text) !important;
}

.alpha-sidebar .nav-stack a.side-link.active {
    background: #f4f1ff;
    border-color: #b9aef5;
    color: var(--alpha-purple) !important;
    box-shadow: inset 3px 0 0 var(--alpha-purple);
}

.alpha-sidebar .nav-stack a.side-link .side-ico {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    background: #f3f4f9;
    border: 1px solid #e8eaf2;
    color: #6f758c;
}

.alpha-sidebar .nav-stack a.side-link.active .side-ico {
    background: var(--alpha-purple);
    color: #fff;
    border-color: transparent;
}

.alpha-sidebar .nav-stack a.side-link .side-ico svg {
    width: 16px;
    height: 16px;
    display: block;
}

.alpha-sidebar .nav-stack a.side-link .side-link-title {
    font-weight: 650;
    font-size: 0.92rem;
    line-height: 1;
    white-space: nowrap;
}


/* —— Global loading + toast —— */
.ui-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 5200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 28, 40, 0.38);
    backdrop-filter: blur(2px);
}

.ui-loading-card {
    min-width: 12rem;
    max-width: min(90vw, 22rem);
    padding: 1.35rem 1.6rem;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(20, 30, 50, 0.22);
    text-align: center;
}

.ui-loading-card p {
    margin: 0.85rem 0 0;
    color: var(--alpha-text);
    font-weight: 650;
    font-size: 0.95rem;
}

.ui-loading-spinner {
    width: 2.1rem;
    height: 2.1rem;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid #d7ece8;
    border-top-color: #0f766e;
    animation: ui-spin 0.75s linear infinite;
}

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

.ui-toast-host {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5300;
    width: min(92vw, 28rem);
    pointer-events: none;
}

.ui-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow: 0 14px 40px rgba(20, 30, 50, 0.18);
    font-weight: 650;
    line-height: 1.5;
    animation: ui-toast-in 0.28s ease;
}

.ui-toast.success {
    background: #edfaf6;
    border-color: #b7e6d8;
    color: #0f5f56;
}

.ui-toast.error {
    background: #fff0f4;
    border-color: #f3c0cf;
    color: #a31f55;
}

.ui-toast span {
    flex: 1;
    min-width: 0;
}

.ui-toast-close {
    flex-shrink: 0;
    width: 1.7rem;
    height: 1.7rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.ui-toast-close:hover { opacity: 1; background: rgba(0,0,0,0.06); }

@keyframes ui-toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* —— Not Found (full page) —— */
.nf-shell {
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
    overflow: hidden;
    background:
        radial-gradient(1200px 700px at 12% -10%, rgba(32, 201, 151, 0.16), transparent 55%),
        radial-gradient(900px 600px at 100% 110%, rgba(11, 71, 66, 0.14), transparent 50%),
        linear-gradient(165deg, #f7faf9 0%, #eef5f3 48%, #f8f6f1 100%);
}

.nf-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

.nf-glow-a {
    width: 280px;
    height: 280px;
    top: 12%;
    inset-inline-start: 8%;
    background: rgba(32, 201, 151, 0.28);
    animation: nf-float 8s ease-in-out infinite;
}

.nf-glow-b {
    width: 320px;
    height: 320px;
    bottom: 8%;
    inset-inline-end: 6%;
    background: rgba(11, 71, 66, 0.22);
    animation: nf-float 10s ease-in-out infinite reverse;
}

.nf-card {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    text-align: center;
    padding: 2.4rem 1.75rem 2rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(28, 31, 46, 0.06);
    box-shadow:
        0 24px 60px rgba(11, 71, 66, 0.1),
        0 2px 0 rgba(255, 255, 255, 0.7) inset;
    backdrop-filter: blur(10px);
    animation: nf-rise 0.55s ease-out both;
}

.nf-brand {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.35rem;
    animation: nf-pop 0.7s ease-out both;
}

.nf-code {
    margin: 0;
    font-family: 'Outfit', 'Vazirmatn', sans-serif;
    font-size: clamp(4.5rem, 16vw, 6.5rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.06em;
    color: #0b4742;
    opacity: 0.92;
}

.nf-title {
    margin: 0.65rem 0 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--alpha-text);
}

.nf-lead {
    margin: 0.75rem auto 0;
    max-width: 34ch;
    color: var(--alpha-muted);
    line-height: 1.75;
    font-size: 0.98rem;
}

.nf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
    margin-top: 1.6rem;
}

.nf-btn {
    min-width: 148px;
}

@keyframes nf-rise {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes nf-pop {
    from { opacity: 0; transform: scale(0.86); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes nf-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

/* —— Drag & drop reorder —— */
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    color: var(--alpha-muted);
    font-size: 0.95rem;
    letter-spacing: -0.12em;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

tr.is-dragging,
.tree-item.is-dragging,
.tree-node.is-dragging > .tree-item-category {
    opacity: 0.45;
}

tr.drag-over td {
    background: color-mix(in srgb, var(--alpha-green) 12%, #fff) !important;
}

.tree-item.drag-over > .tree-item-body,
.tree-node.drag-over > .tree-item-category > .tree-item-body {
    outline: 2px solid color-mix(in srgb, var(--alpha-green) 55%, transparent);
    outline-offset: -2px;
    background: color-mix(in srgb, var(--alpha-green) 8%, #fff);
}

.tree-item-category,
.tree-item-product {
    cursor: grab;
}

.tree-item-category:active,
.tree-item-product:active {
    cursor: grabbing;
}

@media (max-width: 520px) {
    .nf-card {
        padding: 2rem 1.25rem 1.65rem;
        border-radius: 22px;
    }

    .nf-actions {
        flex-direction: column;
    }

    .nf-btn {
        width: 100%;
    }
}

