/* =====================================================
   حسابداری صرافی - استایل اصلی
   ===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --warning: #f59e0b;
    --accent: #f59e0b;
    --info: #0891b2;
    --bg: #eef2f7;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --shadow: 0 1px 4px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 12px;
}

html, body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    /* clip instead of hidden — prevents horizontal scroll without breaking position:sticky */
    overflow-x: clip;
    max-width: 100vw;
    box-sizing: border-box;
}

/* ── بنر اشتراک ─────────────────────────────────────── */
#subBanner {
    position: sticky;
    top: 0;
    z-index: 99;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
#subBanner.sub-warning {
    background: linear-gradient(90deg, #92400e, #b45309, #92400e);
    color: #fef3c7;
    animation: subPulse 3s ease-in-out infinite;
}
#subBanner.sub-expired {
    background: linear-gradient(90deg, #7f1d1d, #dc2626, #7f1d1d);
    color: #fee2e2;
}
@keyframes subPulse {
    0%,100% { opacity:1; } 50% { opacity:0.85; }
}

/* ── پنل ادمین ──────────────────────────────────────── */
#adminPanel .admin-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
#adminPanel .admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
#adminPanel .stat-box {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border);
}
#adminPanel .stat-box .stat-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}
#adminPanel .stat-box .stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
#adminPanel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
#adminPanel th {
    background: #f1f5f9;
    padding: 10px 12px;
    text-align: right;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
#adminPanel td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
#adminPanel tr:hover td { background: #f8fafc; }
.sub-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.sub-badge.active  { background:#d1fae5; color:#065f46; }
.sub-badge.warning { background:#fef3c7; color:#92400e; }
.sub-badge.expired { background:#fee2e2; color:#7f1d1d; }
.sub-badge.trial   { background:#dbeafe; color:#1e40af; }
.sub-badge.owner   { background:#f3e8ff; color:#6b21a8; }

/* =====================================================
   هدر — Professional Fintech Design
   ===================================================== */
.app-header {
    background: #0a0f1e;
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 32px rgba(0,0,0,0.5);
}

/* ── Row 1: Brand ──────────────────────────────────── */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo-mark {
    width: 52px;
    height: 52px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-app-name {
    font-size: 14px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.2px;
    line-height: 1;
}

.header-exchange-badge {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.3px;
}

/* ── Controls row ──────────────────────────────────── */
.header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hdr-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.hdr-icon-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #f1f5f9;
    border-color: rgba(255,255,255,0.2);
}

/* ── Dropdown menu ─────────────────────────────────── */
.hdr-menu-wrap {
    position: relative;
}

.hdr-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    background: #13192e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 6px;
    min-width: 168px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    z-index: 300;
    animation: dropIn 0.15s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hdr-dropdown.open { display: block; }

.hdr-drop-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 13px;
    text-align: right;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.1s, color 0.1s;
    direction: rtl;
}

.hdr-drop-item:hover {
    background: rgba(255,255,255,0.08);
    color: #f1f5f9;
}

.hdr-drop-danger { color: #f87171; }
.hdr-drop-danger:hover { background: rgba(248,113,113,0.12); color: #fca5a5; }

.hdr-drop-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 8px;
}

/* ── Tab navigation ────────────────────────────────── */
.header-tabs {
    display: flex;
    padding: 0 16px;
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.header-tabs::-webkit-scrollbar { display: none; }

/* ── Nav tabs (override) ───────────────────────────── */
.nav-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    letter-spacing: 0.1px;
}

.nav-tab:hover:not(.active) { color: #94a3b8; }

.nav-tab.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
    font-weight: 700;
}

/* Legacy .header-inner / .header-actions not used anymore but keep safe */
.header-inner { display: none; }
.header-actions { display: none; }

/* =====================================================
   ساختار اصلی
   ===================================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.top-section, .bottom-section {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .top-section, .bottom-section {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
}

.card-header {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #fafbfc;
}

.card-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.1px;
}

/* =====================================================
   لیست مشتری‌ها
   ===================================================== */
.customers-panel {
    height: fit-content;
}

.customers-list {
    max-height: 460px;
    overflow-y: auto;
    padding: 10px;
}

.customer-item {
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 6px;
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-item:hover {
    background: #f8fafc;
}

.customer-item.active {
    background: #dbeafe;
    border-color: var(--primary);
}

.customer-name {
    font-weight: 600;
    font-size: 15px;
}

.customer-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.customer-balance-pill {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text-muted);
}

.customer-balance-pill.has-debt {
    background: #fef3c7;
    color: #92400e;
}


/* ── Customer search box ── */
.customer-search-wrap {
    padding: 6px 10px 2px;
}
.customer-search-input {
    width: 100%;
    padding: 7px 12px;
    border: 1.5px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: var(--input-bg, #f8fafc);
    color: var(--text-primary, #1e293b);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    direction: rtl;
}
.customer-search-input:focus {
    border-color: var(--primary, #2563eb);
    background: var(--card-bg, #fff);
}

/* ── Customer item: info + actions layout ── */
.customer-info { flex: 1; min-width: 0; }
.customer-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.customer-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 3px 5px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
}
.customer-item:hover .customer-edit-btn { opacity: 1; }
.customer-edit-btn:hover { background: var(--hover-bg, #f1f5f9); }

/* dark mode */
[data-theme="dark"] .customer-search-input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .customer-search-input:focus {
    border-color: #3b82f6;
    background: #263548;
}
[data-theme="dark"] .customer-edit-btn:hover { background: #334155; }

/* =====================================================
   پنل صدا
   ===================================================== */
.voice-panel .selected-customer {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: opacity .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.voice-panel .selected-customer:hover  { opacity: .8; }
.voice-panel .selected-customer:active { transform: scale(.96); }
.cust-picker-arrow { font-size: 11px; opacity: .7; }

.voice-panel .selected-customer.has-customer {
    background: #d1fae5;
    color: #065f46;
}
[data-theme="dark"] .voice-panel .selected-customer { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .voice-panel .selected-customer.has-customer { background: #064e3b; color: #6ee7b7; }

.voice-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 12px;
}

.mic-button {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
    transition: all 0.2s ease;
}

.mic-button:hover {
    transform: scale(1.05);
}

.mic-button.recording {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(220,38,38,0.4); }
    50% { box-shadow: 0 4px 24px rgba(220,38,38,0.8); }
}

.mic-status {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.mic-status.error {
    color: var(--danger);
}

.mic-status.success {
    color: var(--success);
}

.transcript-area {
    padding: 0 18px 18px;
}

.transcript-area label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
}

.transcript-area textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    direction: rtl;
    resize: vertical;
}

.transcript-area textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.parse-preview {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    min-height: 32px;
    display: none;
}

.parse-preview.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.parse-preview.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.action-buttons {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.examples {
    padding: 0 18px 18px;
    font-size: 13px;
}

.examples summary {
    cursor: pointer;
    padding: 6px 0;
    color: var(--primary);
    font-weight: 500;
}

.examples ul {
    margin: 8px 0 0;
    padding-right: 20px;
}

.examples li {
    margin-bottom: 4px;
    color: var(--text-muted);
}

.examples code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Vazirmatn', monospace;
    direction: rtl;
}

/* =====================================================
   پنل موجودی
   ===================================================== */
.balance-display {
    padding: 16px;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 15px;
    border: 1px solid var(--border);
    transition: filter .15s, transform .1s;
}
.balance-row[data-trace-cur]:hover {
    filter: brightness(.95);
    transform: translateX(-2px);
}

.balance-row.positive {
    background: #fef3c7;
    border-color: #fcd34d;
}

.balance-row.negative {
    background: #dbeafe;
    border-color: #93c5fd;
}

.balance-row.zero {
    background: #f1f5f9;
    color: var(--text-muted);
}

.balance-currency {
    font-weight: 600;
}

.balance-amount {
    font-family: 'Vazirmatn', monospace;
    font-weight: 600;
    direction: ltr;
}

.balance-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
}

.balance-row.positive .balance-status {
    background: #f59e0b;
    color: white;
}

.balance-row.negative .balance-status {
    background: var(--primary);
    color: white;
}

/* =====================================================
   لیست تراکنش‌ها
   ===================================================== */
.transactions-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px 16px;
}

.tx-wrapper[draggable] {
    cursor: default;
    transition: opacity .15s;
}
.tx-wrapper[draggable].drag-over-top {
    border-top: 2px solid #2563eb;
}
.tx-wrapper[draggable].drag-over-bottom {
    border-bottom: 2px solid #2563eb;
}
.tx-drag-handle {
    font-size: 18px;
    user-select: none;
    cursor: grab;
    color: var(--text-muted, #94a3b8);
    transition: opacity .15s;
    flex-shrink: 0;
}
.tx-drag-handle:active { cursor: grabbing; }
.tx-wrapper[draggable]:hover .tx-drag-handle { opacity: 0.85 !important; }

/* انتخاب گروهی */
/* ── چک‌پوینت (تأیید دوگانه) ── */
.tx-wrapper.tx-checkpoint .transaction-item {
    background: linear-gradient(135deg, rgba(34,197,94,.07), rgba(16,185,129,.04));
    border-right: 3px solid #22c55e;
}
.checkpoint-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin: 2px 0;
    color: #16a34a;
    font-size: 12px;
    font-weight: 600;
    direction: rtl;
}
.checkpoint-line {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(90deg, #22c55e 0, #22c55e 4px, transparent 4px, transparent 8px);
    opacity: .5;
}
.checkpoint-label {
    white-space: nowrap;
    padding: 2px 8px;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 20px;
    color: #15803d;
}
.checkpoint-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.checkpoint-clear-btn:hover { color: #dc2626; background: #fee2e2; }
[data-theme="dark"] .tx-wrapper.tx-checkpoint .transaction-item {
    background: linear-gradient(135deg, rgba(34,197,94,.1), rgba(16,185,129,.06));
    border-right-color: #16a34a;
}
[data-theme="dark"] .checkpoint-divider { color: #4ade80; }
[data-theme="dark"] .checkpoint-label { background: #14532d; border-color: #166534; color: #86efac; }

.tx-wrapper.tx-selected {
    background: #fff1f2;
    outline: 2px solid #fca5a5;
    outline-offset: -2px;
    border-radius: 10px;
}
.tx-wrapper.tx-selected .transaction-item {
    background: transparent;
}

/* غیرفعال موقت — برای یافتن خطا */
.tx-wrapper.tx-disabled {
    opacity: 0.38;
    background: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 6px,
        rgba(100,116,139,.07) 6px,
        rgba(100,116,139,.07) 12px
    );
}
.tx-wrapper.tx-disabled .transaction-detail {
    text-decoration: line-through;
    text-decoration-color: #94a3b8;
}
.tx-wrapper.tx-disabled .transaction-type {
    filter: grayscale(1);
}

.transaction-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.transaction-type.sell { background: #dbeafe; color: #1e40af; }
.transaction-type.buy { background: #fce7f3; color: #9f1239; }
.transaction-type.receive { background: #d1fae5; color: #065f46; }
.transaction-type.pay { background: #fef3c7; color: #92400e; }
.transaction-type.opening  { background: #e9d5ff; color: #6b21a8; font-weight: 700; }
.transaction-type.discount { background: #fef9c3; color: #713f12; font-weight: 700; border: 1px dashed #f59e0b; }
.transaction-type.service_agreement { background: #dbeafe; color: #1d4ed8; font-weight: 700; border: 1px dashed #60a5fa; }

/* =====================================================
   پنل داشبورد صندوق — طراحی حرفه‌ای
   ===================================================== */
.cashier-section {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.cashier-panel-content {
    padding: 18px 20px;
}

/* ── کارت‌های موجودی کل (نقد + بانک) ── */
.moj-total-section { margin-bottom: 18px; }

.moj-section-title {
    font-size: 13px; font-weight: 700;
    color: var(--text, #0f172a);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
}
.moj-section-sub {
    font-size: 11px; font-weight: 400;
    color: var(--text-muted, #64748b);
    background: #f1f5f9; padding: 2px 10px;
    border-radius: 20px; border: 1px solid #e2e8f0;
}

.moj-total-grid {
    display: flex; gap: 10px; flex-wrap: wrap;
}

.moj-total-card {
    background: #fff;
    border-radius: 12px;
    padding: 13px 15px;
    min-width: 110px; flex: 1;
    border: 1.5px solid #e2e8f0;
    border-top: 3px solid #e2e8f0;
    transition: transform .18s, box-shadow .18s;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    cursor: default;
}
.moj-total-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.09);
}
.moj-total-card.pos { border-top-color: #10b981; }
.moj-total-card.neg { border-top-color: #ef4444; }

.moj-tc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.moj-tc-flag { font-size: 18px; line-height: 1; }
.moj-tc-cur  { font-size: 12px; color: #64748b; font-weight: 500; }

.moj-tc-amt {
    font-size: 18px; font-weight: 800;
    color: #1e293b; direction: ltr;
    margin-bottom: 7px; letter-spacing: -.3px;
}
.moj-total-card.pos .moj-tc-amt { color: #065f46; }
.moj-total-card.neg .moj-tc-amt { color: #991b1b; }

.moj-tc-breakdown { display: flex; gap: 5px; flex-wrap: wrap; }
.moj-bdg {
    font-size: 10px; color: #64748b;
    background: #f8fafc; padding: 2px 7px;
    border-radius: 10px; border: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* ── شبکه سه‌ستونی ── */
.moj-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 900px) { .moj-grid { grid-template-columns: 1fr; } }

.moj-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.moj-card-hd {
    padding: 10px 14px;
    font-size: 13px; font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
}
.moj-hd-actions { display: flex; gap: 4px; flex-shrink: 0; }
.moj-cash-card .moj-card-hd { background: #fefce8; color: #854d0e; }
.moj-recv-card .moj-card-hd { background: #dcfce7; color: #166534; }
.moj-pay-card  .moj-card-hd { background: #fee2e2; color: #991b1b; }

.moj-card-body { padding: 8px; }
.moj-empty {
    font-size: 12px; color: #94a3b8;
    padding: 12px 6px; text-align: center; line-height: 1.6;
}

.moj-row {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 9px; border-radius: 8px;
    margin-bottom: 4px; font-size: 13px;
}
.moj-row.pos { background: #f0fdf4; }
.moj-row.neg { background: #fff7f7; }
.moj-row.moj-click { cursor: pointer; transition: filter .15s; }
.moj-row.moj-click:hover { filter: brightness(.96); }

.moj-rl { flex: 1; font-weight: 600; }
.moj-row.pos .moj-rl { color: #065f46; }
.moj-row.neg .moj-rl { color: #991b1b; }

.moj-ra { font-weight: 700; direction: ltr; white-space: nowrap; }
.moj-row.pos .moj-ra { color: #065f46; }
.moj-row.neg .moj-ra { color: #991b1b; }

.moj-row-btns { display: flex; gap: 3px; }
.moj-arrow { font-size: 13px; color: #94a3b8; margin-right: 2px; }

.moj-ib {
    width: 26px; height: 26px; border: none; border-radius: 6px;
    cursor: pointer; font-size: 13px; line-height: 1; padding: 0;
    background: #f1f5f9; color: #475569; transition: opacity .15s;
}
.moj-ib:hover { opacity: .8; }
.moj-ib.g { background: #16a34a; color: #fff; font-size: 16px; font-weight: 700; }
.moj-ib.r { background: #dc2626; color: #fff; font-size: 16px; font-weight: 700; }

.moj-mini-btn {
    font-size: 11px; padding: 3px 9px;
    border: 1px solid #cbd5e1; border-radius: 6px;
    background: #f8fafc; cursor: pointer; color: #475569;
    transition: background .15s;
}
.moj-mini-btn:hover { background: #e2e8f0; }
.moj-mini-btn.accent {
    border-color: #a5b4fc; background: #eef2ff;
    color: #4f46e5; font-weight: 600;
}
.moj-mini-btn.accent:hover { background: #e0e7ff; }

.moj-banks-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
}

/* ── Dark mode ── */
[data-theme="dark"] .moj-total-card {
    background: #1e293b; border-color: #334155; border-top-color: #334155;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
[data-theme="dark"] .moj-total-card.pos { border-top-color: #10b981; }
[data-theme="dark"] .moj-total-card.neg { border-top-color: #ef4444; }
[data-theme="dark"] .moj-tc-cur { color: #94a3b8; }
[data-theme="dark"] .moj-tc-amt { color: #f1f5f9; }
[data-theme="dark"] .moj-total-card.pos .moj-tc-amt { color: #6ee7b7; }
[data-theme="dark"] .moj-total-card.neg .moj-tc-amt { color: #fca5a5; }
[data-theme="dark"] .moj-bdg { background: #0f172a; border-color: #475569; color: #94a3b8; }
[data-theme="dark"] .moj-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .moj-card-hd { border-bottom-color: #334155; }
[data-theme="dark"] .moj-cash-card .moj-card-hd { background: #422006; color: #fde68a; }
[data-theme="dark"] .moj-recv-card .moj-card-hd { background: #052e16; color: #86efac; }
[data-theme="dark"] .moj-pay-card  .moj-card-hd { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .moj-row.pos { background: #042f1a; }
[data-theme="dark"] .moj-row.neg { background: #2d0a0a; }
[data-theme="dark"] .moj-row.pos .moj-rl,
[data-theme="dark"] .moj-row.pos .moj-ra { color: #6ee7b7; }
[data-theme="dark"] .moj-row.neg .moj-rl,
[data-theme="dark"] .moj-row.neg .moj-ra { color: #fca5a5; }
[data-theme="dark"] .moj-mini-btn { background: #1e293b; border-color: #475569; color: #94a3b8; }
[data-theme="dark"] .moj-mini-btn.accent { background: #1e1b4b; border-color: #6366f1; color: #a5b4fc; }
[data-theme="dark"] .moj-ib { background: #334155; color: #94a3b8; }
[data-theme="dark"] .moj-banks-section { border-top-color: #334155; }

/* ── legacy kept for compatibility ── */
.cashier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 900px) { .cashier-grid { grid-template-columns: 1fr; } }

.cashier-card {
    background: white; border-radius: var(--radius);
    border: 1px solid var(--border); overflow: hidden;
    display: flex; flex-direction: column;
}
.cashier-card h3 {
    padding: 12px 14px; font-size: 14px; font-weight: 600;
    border-bottom: 1px solid var(--border); background: #f8fafc;
}
.cashier-card.cashier-box h3    { background: #fef3c7; color: #92400e; }
.cashier-card.receivables-box h3 { background: #dcfce7; color: #166534; }
.cashier-card.payables-box h3   { background: #fee2e2; color: #991b1b; }
.cashier-rows { padding: 8px; flex: 1; }

.cash-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; margin-bottom: 4px;
    border-radius: 6px; font-size: 14px; background: #f8fafc;
}
.cash-row.pos { background: #ecfdf5; color: #064e3b; border-right: 3px solid #16a34a; }
.cash-row.neg { background: #fef2f2; color: #7f1d1d; border-right: 3px solid #dc2626; }
.cash-row .amount { font-family: 'Vazirmatn', monospace; font-weight: 600; direction: ltr; }

.transaction-detail {
    font-size: 14px;
    font-weight: 500;
}

.transaction-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.transaction-raw {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

.btn-delete-tx {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
}

.btn-print-tx {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 6px;
    opacity: .55;
    transition: opacity .15s, background .15s;
}
.btn-print-tx:hover {
    opacity: 1;
    background: #e0f2fe;
}
[data-theme="dark"] .btn-print-tx {
    filter: invert(1) brightness(1.4);
    opacity: .7;
}
[data-theme="dark"] .btn-print-tx:hover {
    opacity: 1;
    background: rgba(255,255,255,.08);
}
[data-theme="dark"] .btn-edit-tx,
[data-theme="dark"] .btn-receipts-tx,
[data-theme="dark"] .btn-delete-tx {
    filter: brightness(1.4);
}

/* =====================================================
   خلاصه کلی
   ===================================================== */
.overall-summary {
    padding: 16px;
}

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

.summary-table th,
.summary-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.summary-table th {
    background: #f8fafc;
    font-weight: 600;
}

.summary-table td.amount {
    font-family: 'Vazirmatn', monospace;
    direction: ltr;
    text-align: left;
}

.summary-table .pos { color: var(--warning); font-weight: 600; }
.summary-table .neg { color: var(--primary); font-weight: 600; }

/* =====================================================
   دکمه‌ها و فرم
   ===================================================== */
.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
}

.app-header .btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.app-header .btn-secondary:hover {
    background: rgba(255,255,255,0.25);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    direction: rtl;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
}

/* =====================================================
   مودال
   ===================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
}
.modal.modal-open {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

/* =====================================================
   حالت خالی و اعلان
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 50%;
    transform: translateX(50%);
    background: var(--text);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2000;
    pointer-events: none;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

/* اسکرول‌بار */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ━━━━━━━━━━━━━━ Nav Tabs — defined above in header section ━━━━━━━━━━━━━━ */

/* ━━━━━━━━━━━━━━ Report Tabs ━━━━━━━━━━━━━━ */
.report-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.report-tab:hover { color: #1d4ed8; }
.report-tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; font-weight: 700; }

/* ━━━━━━━━━━━━━━ P&L Card ━━━━━━━━━━━━━━ */
.pnl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}
.pnl-income { background: #ecfdf5; color: #065f46; }
.pnl-expense { background: #fef2f2; color: #991b1b; }
.pnl-net-positive { background: linear-gradient(135deg,#ecfdf5,#d1fae5); color: #065f46; font-weight: 800; font-size: 16px; }
.pnl-net-negative { background: linear-gradient(135deg,#fef2f2,#fee2e2); color: #991b1b; font-weight: 800; font-size: 16px; }
.pnl-section-title { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin: 16px 0 8px; }
.pnl-pair-details summary { list-style: none; }
.pnl-pair-details summary::-webkit-details-marker { display: none; }
.pnl-pair-details[open] summary { border-radius: 10px 10px 0 0; margin-bottom: 0; }
.pnl-pair-details summary::after { content: ' ▸'; font-size: 11px; }
.pnl-pair-details[open] summary::after { content: ' ▾'; }

/* ━━━━━━━━━━━━━━ Expense/Service List Items ━━━━━━━━━━━━━━ */
.expense-item, .service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: background 0.15s;
}
.expense-item:hover, .service-item:hover { background: #f1f5f9; }

/* ━━━━━━━━━━━━━━ Dark Mode ━━━━━━━━━━━━━━ */
[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .card { background: var(--card-bg); border: 1px solid var(--border); }
[data-theme="dark"] .input,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #0f172a;
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .btn-secondary {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}
[data-theme="dark"] .btn-secondary:hover { background: #475569; }
[data-theme="dark"] .transaction-item { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .transaction-item:hover { background: #263548; }
[data-theme="dark"] .transaction-detail,
[data-theme="dark"] .transaction-meta { color: #94a3b8; }
[data-theme="dark"] .customer-item { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .customer-item:hover { background: #263548; }
[data-theme="dark"] .customer-item.selected { background: #1e3a5f; border-color: #3b82f6; }
[data-theme="dark"] .parse-preview.success { background: #14532d22; border-color: #16a34a; color: #86efac; }
[data-theme="dark"] .parse-preview.error { background: #7f1d1d22; border-color: #dc2626; color: #fca5a5; }
[data-theme="dark"] .balance-display { background: var(--card-bg); }
[data-theme="dark"] .balance-row { border-color: #334155; }
[data-theme="dark"] .modal-content { background: #1e293b; color: var(--text); border: 1px solid #334155; }
[data-theme="dark"] .modal-content input,
[data-theme="dark"] .modal-content select,
[data-theme="dark"] .modal-content textarea { background: #0f172a; color: var(--text); border-color: #475569; }
[data-theme="dark"] h2, [data-theme="dark"] h3 { color: var(--text); }
[data-theme="dark"] label { color: var(--text-muted); }
[data-theme="dark"] .examples { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] code { background: #0f172a; color: #7dd3fc; }
[data-theme="dark"] .empty-state { color: #94a3b8; }
[data-theme="dark"] .type-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .pnl-income { background: #14532d44; }
[data-theme="dark"] .pnl-expense { background: #7f1d1d44; }
[data-theme="dark"] .report-tab { color: #94a3b8; }
[data-theme="dark"] .report-tab.active { color: #60a5fa; border-bottom-color: #60a5fa; }

/* Dark mode — card header */
[data-theme="dark"] .card-header { background: #1a2540; border-color: #2d3d5a; }
[data-theme="dark"] .card { border-color: rgba(255,255,255,0.05); }

/* Dark mode toggle button */
#btnDarkMode {
    font-size: 18px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    border-radius: 8px;
    transition: background 0.2s;
    line-height: 1;
}
#btnDarkMode:hover { background: rgba(255,255,255,0.15); }

/* ━━━━━━━━━━━━━━ Live Rates Bar ━━━━━━━━━━━━━━ */
#ratesBar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg,#1e3a8a,#1d4ed8);
    border-radius: 10px;
    margin-bottom: 4px;
}
.rate-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 4px 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s;
}
.rate-chip:hover { background: rgba(255,255,255,0.25); }
.rate-chip .trend-up { color: #86efac; font-size: 11px; }
.rate-chip .trend-down { color: #fca5a5; font-size: 11px; }
.rate-chip .sparkline { display: inline-block; vertical-align: middle; }
[data-theme="dark"] #ratesBar { background: linear-gradient(135deg,#0f172a,#1e293b); border: 1px solid #334155; }

/* ━━━━━━━━━━━━━━ Rate Calculator Widget ━━━━━━━━━━━━━━ */
#rateCalcWidget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 8000;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    padding: 16px;
    min-width: 240px;
    direction: rtl;
    font-family: inherit;
    display: none;
}
[data-theme="dark"] #rateCalcWidget { background: #0f172a; }
#rateCalcWidget h4 { color: #f1f5f9; font-size: 13px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
#rateCalcWidget input, #rateCalcWidget select {
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    margin-bottom: 8px;
    box-sizing: border-box;
    direction: ltr;
    text-align: left;
}
#rateCalcResult {
    background: #0f172a;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    color: #60a5fa;
    font-size: 16px;
    font-weight: 700;
    margin-top: 4px;
}

/* Floating calc toggle button */
#btnCalcToggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 8001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #2563eb;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37,99,235,0.5);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#btnCalcToggle:hover { transform: scale(1.1); }

/* ━━━━━━━━━━━━━━ PIN Lock Overlay ━━━━━━━━━━━━━━ */
#pinOverlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.97);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}
.pin-dots {
    display: flex;
    gap: 14px;
    margin: 8px 0 16px;
}
.pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #475569;
    background: transparent;
    transition: background 0.15s;
}
.pin-dot.filled { background: #3b82f6; border-color: #3b82f6; }
.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.pin-key {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 1px solid #334155;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
}
.pin-key:hover { background: #334155; }
.pin-key:active { background: #3b82f6; }

/* ━━━━━━━━━━━━━━ Keyboard Shortcut Hint ━━━━━━━━━━━━━━ */
.kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid #475569;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    background: #1e293b;
    color: #94a3b8;
    margin: 0 2px;
}
[data-theme="dark"] .kbd { background: #0f172a; }

/* ━━━━━━━━━━━━━━ Undo Toast ━━━━━━━━━━━━━━ */
#undoToast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 9000;
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-size: 13px;
    animation: slideInRight 0.3s ease;
    min-width: 260px;
}
@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
#undoToast .undo-bar {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    background: #3b82f6;
    border-radius: 0 0 12px 12px;
    transition: width linear;
}
#undoToast button {
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    background: #3b82f6;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}


/* ==================== dark mode comprehensive fixes ==================== */
[data-theme="dark"] {
    --primary: #3b82f6;
    --warning: #fbbf24;
    --danger:  #f87171;
    --bg:      #0f172a;
    --card-bg: #1e293b;
    --border:  #334155;
    --text:    #e2e8f0;
}

/* summary table */
.summary-total-row { background: #f1f5f9; font-weight: 700; }
[data-theme="dark"] .summary-total-row { background: #1e3a5f !important; color: #e2e8f0; }
[data-theme="dark"] .summary-table { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .summary-table th { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .summary-table td { color: var(--text); border-color: #334155; }
[data-theme="dark"] .summary-table tr:hover td { background: #263548; }
[data-theme="dark"] .summary-table .pos { color: #fbbf24; }
[data-theme="dark"] .summary-table .neg { color: #60a5fa; }

/* balance rows */
[data-theme="dark"] .balance-display { background: var(--card-bg); }
[data-theme="dark"] .balance-row { border-color: #334155; }
[data-theme="dark"] .balance-row.positive { background: #422006; border-color: #92400e; }
[data-theme="dark"] .balance-row.positive .balance-currency,
[data-theme="dark"] .balance-row.positive .balance-amount { color: #fde68a; }
[data-theme="dark"] .balance-row.negative { background: #172554; border-color: #1e40af; }
[data-theme="dark"] .balance-row.negative .balance-currency,
[data-theme="dark"] .balance-row.negative .balance-amount { color: #93c5fd; }
[data-theme="dark"] .balance-row.zero { background: #1e293b; color: #64748b; border-color: #334155; }

/* balance trace panel dark mode */
[data-theme="dark"] #balanceTrace { border-color: #334155 !important; }
[data-theme="dark"] #balanceTraceHeader { background: #1e293b !important; color: #94a3b8 !important; }
[data-theme="dark"] #balanceTraceBody > div { border-color: #334155 !important; color: #cbd5e1 !important; }
[data-theme="dark"] #balanceTraceBody > div:first-child { background: #0f172a !important; }

/* مودال ردیابی */
#traceModal { animation: fadeIn .15s ease; }
#traceModalBox { animation: slideUp .18s ease; }
@keyframes slideUp { from { transform:translateY(24px); opacity:0; } to { transform:translateY(0); opacity:1; } }
#traceModalBody > div { transition: background .1s; }
#traceModalBody > div:hover { background: rgba(100,116,139,.07) !important; }
[data-theme="dark"] #traceModalBox { background: #1e293b !important; }
[data-theme="dark"] #traceModalBox > div:first-child { background: #0f172a !important; border-color: #334155 !important; }
[data-theme="dark"] #traceModalBody > div { border-color: #334155 !important; color: #cbd5e1 !important; }
[data-theme="dark"] #traceModalBody > div:first-child { background: #0f172a !important; }

/* transactions */
[data-theme="dark"] .transaction-item { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .transaction-item:hover { background: #263548; }
[data-theme="dark"] .transaction-detail { color: #e2e8f0 !important; }
[data-theme="dark"] .transaction-meta { color: #94a3b8 !important; }
[data-theme="dark"] .tx-wrapper { border-color: #334155; }
[data

/* ── Bank Cards ── */
.bank-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
    align-items: flex-start;
}

.bank-card {
    width: 240px;
    flex-shrink: 0;
    border-radius: 16px;
    background: #ffffff;
    border: 1.5px solid rgba(0,0,0,.07);
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.bank-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.16);
    transform: translateY(-3px);
}
.bank-card.terminated { opacity: .5; filter: grayscale(.6); }

/* Coloured gradient header */
.bank-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 12px;
    color: #fff;
    position: relative;
}
.bank-card-flag {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
}
.bank-card-header-info {
    flex: 1;
    min-width: 0;
}
.bank-card-name-h {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.bank-card-type-h {
    font-size: 11px;
    color: rgba(255,255,255,.8);
    margin-top: 2px;
}

/* Status dot */
.bank-status-dot {
    width: 10px; height: 10px;
    border-radius: 50%; flex-shrink: 0;
}
.bank-status-dot.active { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.35); }
.bank-status-dot.closed { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.35); }

/* Body */
.bank-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}

/* Account number */
.bank-card-acct {
    font-size: 11px;
    color: #64748b;
    letter-spacing: .6px;
    background: #f8fafc;
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
}

/* Balances */
.bank-card-balances {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 24px;
    align-items: center;
}
.bank-bal-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 20px;
    direction: ltr;
    display: inline-block;
}
.bank-bal-pill.pos  { background: #dcfce7; color: #15803d; }
.bank-bal-pill.neg  { background: #fee2e2; color: #b91c1c; }
.bank-bal-pill.zero { background: #f1f5f9; color: #94a3b8; font-weight: 400; }

/* Action buttons */
.bank-card-actions {
    display: flex;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
.bba {
    flex: 1;
    padding: 7px 4px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: filter .15s, transform .15s;
    white-space: nowrap;
}
.bba:hover { filter: brightness(.88); transform: scale(.97); }
.bba.log        { background: #e0f2fe; color: #0369a1; }
.bba.terminate  { background: #fff7ed; color: #c2410c; }
.bba.reactivate { background: #dcfce7; color: #166534; }
.bba.delete     { background: #fee2e2; color: #991b1b; flex: 0 0 auto; padding: 7px 12px; }

/* ── Receipt badge in tx row ── */
.tx-receipt-meta {
    font-size: 11px;
    color: #0369a1;
    background: #e0f2fe;
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* dark mode */
[data-theme="dark"] .bank-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .bank-card.terminated { background: #172032; }
[data-theme="dark"] .bank-card-body { background: #1e293b; }
[data-theme="dark"] .bank-card-acct { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .bank-bal-pill.pos { background: #14532d; color: #86efac; }
[data-theme="dark"] .bank-bal-pill.neg { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .bank-bal-pill.zero { background: #1e293b; color: #64748b; }
[data-theme="dark"] .bank-card-actions { border-color: #334155; }
[data-theme="dark"] .bba.log { background: #0c4a6e; color: #7dd3fc; }
[data-theme="dark"] .bba.terminate { background: #431407; color: #fdba74; }
[data-theme="dark"] .bba.reactivate { background: #14532d; color: #86efac; }
[data-theme="dark"] .bba.delete { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .tx-receipt-meta { background: #0c4a6e; color: #7dd3fc; }

/* ── Dashboard Bank Rows ── */
.dashboard-bank-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 7px;
    margin-bottom: 4px;
    background: var(--bg-muted, #f8fafc);
    transition: background .12s;
}
.dashboard-bank-row:hover { background: var(--hover-bg, #f1f5f9); }
.db-bank-name { font-size: 13px; font-weight: 600; color: var(--text-primary, #0f172a); flex: 1; }
.db-bank-type { font-size: 11px; color: var(--text-muted, #64748b); white-space: nowrap; }
.db-bank-bal  { font-size: 13px; font-weight: 700; white-space: nowrap; }
.db-bank-bal.pos  { color: #065f46; }
.db-bank-bal.neg  { color: #991b1b; }
.db-bank-bal.zero { color: #94a3b8; font-weight: 400; }
[data-theme="dark"] .dashboard-bank-row { background: #1e293b; }
[data-theme="dark"] .dashboard-bank-row:hover { background: #263548; }

/* ── Receipt meta fields inside receipt panel ── */
.receipt-meta-fields {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.receipt-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.receipt-field-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    min-width: 130px;
}
.receipt-txno-input,
.receipt-bank-select {
    flex: 1;
    min-width: 160px;
    padding: 6px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: 12px;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
    transition: border-color .15s;
}
.receipt-txno-input:focus,
.receipt-bank-select:focus {
    outline: none;
    border-color: #6366f1;
}
.receipt-txno-status {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.btn-save-tx-meta {
    background: #e0f2fe;
    color: #0369a1;
    border: none;
    border-radius: 7px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: filter .15s;
}
.btn-save-tx-meta:hover { filter: brightness(.9); }

[data-theme="dark"] .receipt-meta-fields { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .receipt-txno-input,
[data-theme="dark"] .receipt-bank-select { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .receipt-field-label { color: #94a3b8; }
[data-theme="dark"] .btn-save-tx-meta { background: #0c4a6e; color: #7dd3fc; }

/* ═══════════════════════════════════════════════════════
   RECEIPT ASSIGNMENT MODAL (RAM) — v5 Pro Redesign
   ═══════════════════════════════════════════════════════ */

/* ── Entry animation ── */
@keyframes ramSlideIn {
    from { opacity: 0; transform: translateY(24px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes ramFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Modal shell ── */
.ram-modal {
    background: #f8fafc;
    border-radius: 20px;
    width: 100%; max-width: 520px;
    max-height: calc(100dvh - 32px);
    display: flex; flex-direction: column;
    box-shadow: 0 32px 80px rgba(0,0,0,.30), 0 0 0 1px rgba(0,0,0,.06);
    overflow: hidden;
    font-family: inherit;
    animation: ramSlideIn 0.28s cubic-bezier(.16,1,.3,1);
}

/* ── Header ── */
.ram-header {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 22px; flex-shrink: 0;
    background: linear-gradient(135deg, #0b1437 0%, #1e1b4b 55%, #312e81 100%);
    color: #fff;
    position: relative; overflow: hidden;
}
.ram-header::before {
    content: '';
    position: absolute; top: -50px; right: -30px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,.05); pointer-events: none;
}
.ram-header::after {
    content: '';
    position: absolute; bottom: -30px; left: 25%;
    width: 100px; height: 100px; border-radius: 50%;
    background: rgba(165,180,252,.07); pointer-events: none;
}
.ram-header-icon {
    font-size: 22px; width: 44px; height: 44px; flex-shrink: 0;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
}
.ram-header-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.ram-title   { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.ram-subtitle{ font-size: 11px; color: #a5b4fc; margin-top: 3px; opacity: .9; }
.ram-close {
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 9px;
    color: #c7d2fe; font-size: 14px; width: 32px; height: 32px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s; flex-shrink: 0;
    position: relative; z-index: 1;
}
.ram-close:hover { background: rgba(255,255,255,.24); color: #fff; }

/* ── Body (scrollable) ── */
.ram-body {
    flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
    padding: 18px 20px;
    background: #f8fafc;
    scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
}
.ram-body::-webkit-scrollbar { width: 4px; }
.ram-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ── Card wrapper (white sections) ── */
.ram-card {
    background: #fff;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* ── Top row: image + info ── */
.ram-top-row {
    display: grid; grid-template-columns: 118px 1fr; gap: 16px;
    background: #fff;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* ── Image column ── */
.ram-img-col { display: flex; flex-direction: column; gap: 8px; }

.ram-image-zone {
    width: 100%; aspect-ratio: 1;
    border: 2.5px dashed #818cf8; border-radius: 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    cursor: pointer; position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
    box-shadow: 0 2px 10px rgba(99,102,241,.10);
}
.ram-image-zone:hover, .ram-image-zone.drag-over {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    box-shadow: 0 6px 20px rgba(79,70,229,.20);
    transform: scale(1.02);
}

.ram-image-hint {
    display: flex; flex-direction: column; align-items: center;
    gap: 5px; pointer-events: none; text-align: center;
    color: #4f46e5;
}
.ram-image-hint span:first-child { font-size: 28px; }
.ram-image-hint span:nth-child(2) {
    font-size: 10px; font-weight: 700;
    background: #fff;
    color: #4f46e5;
    padding: 2px 10px; border-radius: 20px;
    border: 1px solid #c7d2fe;
}
.ram-image-hint span:last-child {
    font-size: 10px; font-weight: 600;
    color: #7c3aed; background: rgba(167,139,250,.15);
    padding: 2px 8px; border-radius: 20px;
}

.ram-image-preview {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
}
.ram-image-preview img { width: 100%; height: 100%; object-fit: cover; }

.ram-img-clear {
    position: absolute; top: 5px; right: 5px;
    background: rgba(15,23,42,.70); color: #fff;
    border: none; border-radius: 50%;
    width: 22px; height: 22px; font-size: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; z-index: 2;
    backdrop-filter: blur(4px); transition: background .15s;
}
.ram-img-clear:hover { background: rgba(239,68,68,.85); }

.ram-clipboard-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 6px; border-radius: 10px;
    border: 1.5px solid #c7d2fe; background: #fff;
    color: #4f46e5; font-size: 10px; font-weight: 600;
    font-family: inherit; cursor: pointer; text-align: center;
    line-height: 1.4; transition: all .15s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ram-clipboard-btn:hover {
    background: #eef2ff; border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,.15);
}

/* ── Info column ── */
.ram-info-col { display: flex; flex-direction: column; gap: 10px; }

/* ── Field labels ── */
.ram-field-label {
    font-size: 11px; font-weight: 700; color: #475569;
    margin-bottom: 5px;
    display: flex; align-items: center; gap: 4px;
}

/* ── Inputs ── */
.ram-input-wrap { position: relative; display: flex; align-items: center; }

.ram-input {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 13px; font-family: inherit;
    background: #fff; color: #0f172a;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box; -webkit-appearance: none;
}
.ram-input:hover { border-color: #a5b4fc; }
.ram-input:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.ram-no-badge {
    position: absolute; left: 10px;
    font-size: 13px; font-weight: 700; pointer-events: none;
}
.ram-dup-warn {
    font-size: 11px; background: #fffbeb; color: #92400e;
    border: 1px solid #fcd34d; border-radius: 8px;
    padding: 5px 10px; margin-top: 5px; font-weight: 600;
    display: flex; align-items: center; gap: 5px;
}

/* ── Divider ── */
.ram-divider {
    display: flex; align-items: center; gap: 8px;
    margin: 4px 0 14px;
}
.ram-divider::before, .ram-divider::after {
    content: ''; flex: 1; height: 1.5px; background: #e2e8f0;
}
.ram-divider span {
    font-size: 11px; font-weight: 700; white-space: nowrap;
    color: #64748b; background: #f8fafc;
    padding: 3px 12px; border-radius: 20px;
    border: 1.5px solid #e2e8f0;
}

/* ── Customer / Tx section cards ── */
.ram-field {
    background: #fff;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.03);
}

/* ── Transaction detail card ── */
.ram-tx-detail-card {
    display: none; align-items: flex-start; gap: 12px;
    padding: 10px 14px; border-radius: 10px;
    border: 1.5px solid #e5e7eb; margin-top: 8px;
    animation: ramFadeIn .18s ease;
}
.ram-tx-detail-card.is-visible { display: flex; }
.ram-tx-detail-card.type-receive { background: #f0fdf4; border-color: #86efac; }
.ram-tx-detail-card.type-receive .rtc-type { color: #166534; }
.ram-tx-detail-card.type-pay     { background: #fef2f2; border-color: #fca5a5; }
.ram-tx-detail-card.type-pay     .rtc-type { color: #991b1b; }
.ram-tx-detail-card.type-buy     { background: #eff6ff; border-color: #93c5fd; }
.ram-tx-detail-card.type-buy     .rtc-type { color: #1e40af; }
.ram-tx-detail-card.type-sell    { background: #f5f3ff; border-color: #c4b5fd; }
.ram-tx-detail-card.type-sell    .rtc-type { color: #5b21b6; }
.ram-tx-detail-card.type-opening { background: #f9fafb; border-color: #d1d5db; }
.ram-tx-detail-card.type-opening .rtc-type { color: #4b5563; }

.rtc-type  { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.rtc-desc  { font-size: 13px; font-weight: 600; color: #111827; }
.rtc-date  { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.rtc-check { font-size: 20px; flex-shrink: 0; margin-top: 2px; }

/* ── Second customer ── */
.ram-add-second {
    width: 100%; background: none;
    border: 1.5px dashed #a5b4fc; border-radius: 20px;
    padding: 9px 14px; font-size: 12px; font-weight: 600;
    color: #4f46e5; cursor: pointer; font-family: inherit;
    transition: all .15s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 14px;
}
.ram-add-second:hover {
    background: #eef2ff; border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(99,102,241,.12);
}
.ram-second-section {
    padding: 14px 16px; border-radius: 13px;
    background: #f0f9ff; border: 1.5px solid #bae6fd;
    margin-top: 10px;
}

/* ── Footer ── */
.ram-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 14px 22px;
    border-top: 1.5px solid #e2e8f0;
    background: #fff; flex-shrink: 0;
}
.ram-btn-cancel {
    padding: 10px 20px; border-radius: 10px;
    border: 1.5px solid #e2e8f0; background: #f8fafc;
    color: #64748b; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all .15s;
}
.ram-btn-cancel:hover { background: #f1f5f9; border-color: #cbd5e1; }

.ram-btn-save {
    padding: 10px 26px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: #fff;
    font-size: 13px; font-weight: 700; font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79,70,229,.35);
    transition: all .15s;
    display: flex; align-items: center; gap: 6px;
}
.ram-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(79,70,229,.40);
}
.ram-btn-save:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Receipt panel trigger ── */
.receipt-panel-clean { padding: 6px 12px 10px; }
/* Redesigned ram-panel-trigger with gradient */
.ram-panel-trigger {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 16px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    cursor: pointer; width: 100%; font-family: inherit;
    font-size: 13px; font-weight: 700; color: #fff;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 15px rgba(79,70,229,.3);
    text-align: right; box-sizing: border-box;
}
.ram-panel-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79,70,229,.5);
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

/* ── Receipt Popup Overlay Backdrop ── */
.rpo-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.65) !important;
    z-index: 99990 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

/* ── Receipt Popup Dialog Backdrop ── */
#receipt-popup-overlay::backdrop {
    background: rgba(0, 0, 0, 0.65);
}

/* ── Receipt Popup Modal ── */
.receipt-modal-popup {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.35);
    width: min(560px, 95vw);
    max-height: 85vh;
    overflow-y: auto;
    animation: rmpIn .2s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes rmpIn { from { opacity:0; transform:scale(0.92) translateY(20px); } to { opacity:1; transform:scale(1) translateY(0); } }

.rmp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    color: #fff; border-radius: 18px 18px 0 0;
    position: sticky; top: 0; z-index: 1;
}
.rmp-header-info { display: flex; align-items: center; gap: 12px; }
.rmp-close {
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
    transition: background .15s; flex-shrink: 0;
}
.rmp-close:hover { background: rgba(239,68,68,.75); }
.rmp-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.rmp-receipts-list { display: flex; flex-direction: column; gap: 8px; }

/* The beautiful "افزودن / ویرایش سند" button */
.rmp-add-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white; border: none; border-radius: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
    transition: transform .2s, box-shadow .2s, background .2s;
    box-shadow: 0 4px 18px rgba(79,70,229,.35);
    letter-spacing: .01em;
}
.rmp-add-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(79,70,229,.55);
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}
.rmp-add-btn:active { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(79,70,229,.4); }

[data-theme="dark"] .receipt-modal-popup { background: #0f172a; }
[data-theme="dark"] .rmp-add-btn { box-shadow: 0 4px 18px rgba(99,102,241,.4); }

/* ── Cross-customer receipt badge ── */
.tx-cross-receipt {
    font-size: 11px; background: #fef3c7; color: #92400e;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 20px;
    margin-top: 2px; font-weight: 600; cursor: pointer;
    border: 1px solid #fcd34d; transition: background .12s;
}
.tx-cross-receipt:hover { background: #fde68a; }

.tx-owner-badge {
    font-size: 11px; font-weight: 600;
    color: #0369a1; background: #e0f2fe;
    padding: 1px 8px; border-radius: 20px;
    border: 1px solid #bae6fd;
    white-space: nowrap; vertical-align: middle;
    margin-right: 5px; display: inline-block;
}
[data-theme="dark"] .tx-owner-badge { background: #0c4a6e; color: #7dd3fc; border-color: #0369a1; }

.tx-inline-link {
    font-size: 11px; font-weight: 600;
    color: #5b21b6; background: #ede9fe;
    padding: 1px 7px; border-radius: 20px;
    border: 1px solid #c4b5fd; cursor: pointer;
    white-space: nowrap; transition: background .12s;
    vertical-align: middle; margin-right: 4px;
}
.tx-inline-link:hover { background: #ddd6fe; }
[data-theme="dark"] .tx-inline-link { background: #2e1065; color: #c4b5fd; border-color: #6d28d9; }
[data-theme="dark"] .tx-inline-link:hover { background: #3b0764; }

.tx-linked-badge {
    font-size: 11px; background: #ede9fe; color: #5b21b6;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 20px;
    font-weight: 600; cursor: pointer;
    border: 1px solid #c4b5fd; transition: background .12s;
}
.tx-linked-badge:hover { background: #ddd6fe; }
[data-theme="dark"] .tx-linked-badge { background: #2e1065; color: #c4b5fd; border-color: #6d28d9; }
[data-theme="dark"] .tx-linked-badge:hover { background: #3b0764; }

/* ══════════════════════════════════════════════════════
   فرم رسید Inline (ثبت رسید زیر هر تراکنش)
══════════════════════════════════════════════════════ */
.ram-inline-form {
    margin: 6px 0 8px;
    background: #fff;
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(99,102,241,.10);
    overflow: hidden;
    animation: ramInlineSlide .18s ease;
}
@keyframes ramInlineSlide {
    from { opacity:0; transform: translateY(-6px); }
    to   { opacity:1; transform: translateY(0); }
}

.ram-inline-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 14px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border-bottom: 1px solid #e0e7ff;
    font-size: 13px; font-weight: 700; color: #4338ca;
}
.ram-inline-close {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 16px; line-height: 1; padding: 2px 4px;
    border-radius: 6px; transition: background .12s, color .12s;
}
.ram-inline-close:hover { background: #fee2e2; color: #dc2626; }

.ram-inline-body { padding: 12px 14px; }

.ram-inline-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

/* ── image upload zone (inline) ── */
.ram-inline-image-zone {
    width: 100%; aspect-ratio: 1;
    border: 2px dashed #a5b4fc; border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    cursor: pointer; position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.ram-inline-image-zone:hover,
.ram-inline-image-zone.drag-over {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    box-shadow: 0 4px 14px rgba(79,70,229,.15);
}
.ram-inline-image-zone.has-image { border-style: solid; border-color: #4f46e5; }

.ram-inline-img-hint {
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; pointer-events: none; text-align: center; color: #6366f1;
    font-size: 10px; font-weight: 600; line-height: 1.3;
}
.ram-inline-img-hint span:first-child { font-size: 22px; }

.ram-inline-img-preview {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 8px;
}
.ram-inline-img-clear {
    position: absolute; top: 4px; left: 4px;
    width: 20px; height: 20px; border: none; border-radius: 50%;
    background: rgba(239,68,68,.85); color: #fff;
    font-size: 11px; cursor: pointer; line-height: 1; padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}
.ram-inline-img-clear:hover { background: #dc2626; }

/* ── fields column ── */
.ram-inline-fields { display: flex; flex-direction: column; gap: 0; }

.ram-inline-field-label {
    font-size: 11px; color: #64748b; font-weight: 600;
    margin-bottom: 4px; margin-top: 2px;
}

/* ── related customer section ── */
.ram-inline-related {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
}
.ram-inline-related-title {
    font-size: 11px; font-weight: 700; color: #92400e;
    margin-bottom: 7px; display: flex; align-items: center; gap: 5px;
}
.ram-inline-related-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

/* ── footer ── */
.ram-inline-footer {
    display: flex; gap: 8px; justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
}

/* Dark mode — inline form */
[data-theme="dark"] .ram-inline-form        { background: #1e293b; border-color: #4338ca; }
[data-theme="dark"] .ram-inline-header      { background: linear-gradient(135deg,#1e1b4b,#312e81); border-bottom-color:#3730a3; color:#a5b4fc; }
[data-theme="dark"] .ram-inline-image-zone  { background: linear-gradient(135deg,#1e1b4b,#312e81); border-color:#4338ca; }
[data-theme="dark"] .ram-inline-img-hint    { color:#a5b4fc; }
[data-theme="dark"] .ram-inline-field-label { color:#94a3b8; }
[data-theme="dark"] .ram-inline-related     { background:#1c1917; border-color:#78350f; }
[data-theme="dark"] .ram-inline-related-title { color:#fcd34d; }
[data-theme="dark"] .ram-inline-footer      { border-top-color:#334155; }

/* ══════════════════
   DARK MODE
══════════════════ */
[data-theme="dark"] .ram-modal     { background: #0c1a2e !important; }
[data-theme="dark"] .ram-header    {
    background: linear-gradient(135deg, #030712 0%, #0f172a 50%, #1e1b4b 100%);
}
[data-theme="dark"] .ram-body      { background: #0c1a2e; }

[data-theme="dark"] .ram-top-row   { background: #0f172a; border-color: #1e293b; }
[data-theme="dark"] .ram-field     { background: #0f172a; border-color: #1e293b; }

[data-theme="dark"] .ram-image-zone {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-color: #4338ca;
}
[data-theme="dark"] .ram-image-zone:hover,
[data-theme="dark"] .ram-image-zone.drag-over {
    background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
    border-color: #6d28d9;
}
[data-theme="dark"] .ram-image-hint          { color: #a5b4fc; }
[data-theme="dark"] .ram-image-hint span:nth-child(2) {
    background: rgba(165,180,252,.12); color: #a5b4fc; border-color: #4338ca;
}
[data-theme="dark"] .ram-image-hint span:last-child {
    color: #c4b5fd; background: rgba(124,58,237,.20);
}

[data-theme="dark"] .ram-clipboard-btn { background: #1e1b4b; border-color: #4338ca; color: #a5b4fc; }
[data-theme="dark"] .ram-clipboard-btn:hover { background: #312e81; border-color: #6d28d9; }

[data-theme="dark"] .ram-field-label { color: #94a3b8; }
[data-theme="dark"] .ram-input     { background: #0f172a; border-color: #334155; color: #f1f5f9; }
[data-theme="dark"] .ram-input:hover { border-color: #475569; }
[data-theme="dark"] .ram-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

[data-theme="dark"] .ram-divider span     { background: #0c1a2e; border-color: #1e293b; color: #94a3b8; }
[data-theme="dark"] .ram-divider::before,
[data-theme="dark"] .ram-divider::after  { background: #1e293b; }

[data-theme="dark"] .rtc-desc      { color: #f1f5f9; }

[data-theme="dark"] .ram-second-section { background: #0c1a2e; border-color: #1e3a5f; }
[data-theme="dark"] .ram-add-second     { border-color: #4338ca; color: #a5b4fc; }
[data-theme="dark"] .ram-add-second:hover { background: #1e1b4b; border-color: #6d28d9; }

[data-theme="dark"] .ram-footer        { background: #0f172a; border-color: #1e293b; }
[data-theme="dark"] .ram-btn-cancel    { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .ram-btn-cancel:hover { background: #263446; }

[data-theme="dark"] .ram-panel-trigger { background: linear-gradient(135deg, #3730a3 0%, #5b21b6 100%); box-shadow: 0 4px 15px rgba(79,70,229,.4); }
[data-theme="dark"] .ram-panel-trigger:hover { background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%); }

/* ── Responsive: small screens (bottom sheet) ── */
@media (max-width: 520px) {
    .modal { align-items: flex-end !important; padding: 0 !important; }
    .ram-modal {
        width: 100vw !important; max-width: 100vw !important;
        border-radius: 18px 18px 0 0 !important;
        align-self: flex-end !important; margin: 0 !important;
        max-height: 92dvh !important;
    }
    .ram-top-row { grid-template-columns: 100px 1fr; gap: 12px; }
    .ram-footer  { padding: 12px 16px 18px; }
}

/* ═══════════════════════════════════════════════════════
   INLINE RECEIPT FORM — باز می‌شود زیر هر تراکنش
   ═══════════════════════════════════════════════════════ */

.ram-inline-form {
    margin: 0 10px 12px;
    background: #fff;
    border: 1.5px solid #c7d2fe;
    border-radius: 14px;
    overflow: hidden;
    animation: ramFadeIn .22s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 6px 24px rgba(79,70,229,.14);
}
.ram-inline-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #fff;
}
.ram-inline-header > span { font-size: 13px; font-weight: 700; }
.ram-inline-close {
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.15);
    border-radius: 7px; color: #c7d2fe; font-size: 12px;
    width: 26px; height: 26px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.ram-inline-close:hover { background: rgba(255,255,255,.28); color: #fff; }

.ram-inline-body { padding: 12px 14px; background: #f8fafc; }

/* دو ستون: تصویر + فیلدها */
.ram-inline-row {
    display: grid; grid-template-columns: 86px 1fr; gap: 12px;
    margin-bottom: 12px;
}

/* ناحیه آپلود تصویر */
.ram-inline-image-zone {
    aspect-ratio: 1; position: relative;
    border: 2.5px dashed #818cf8; border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden;
    transition: border-color .2s, background .2s, transform .15s;
    box-shadow: 0 2px 8px rgba(99,102,241,.08);
}
.ram-inline-image-zone:hover,
.ram-inline-image-zone.drag-over {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(79,70,229,.18);
}
.ram-inline-img-hint {
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; pointer-events: none; text-align: center; color: #4f46e5;
}
.ram-inline-img-hint span:first-child  { font-size: 22px; }
.ram-inline-img-hint span:nth-child(2) {
    font-size: 9px; font-weight: 700;
    background: #fff; color: #4f46e5;
    padding: 2px 8px; border-radius: 20px;
    border: 1px solid #c7d2fe;
}
.ram-inline-img-hint span:last-child {
    font-size: 9px; font-weight: 600; color: #7c3aed;
    background: rgba(167,139,250,.15); padding: 2px 7px; border-radius: 20px;
}
.ram-inline-img-preview {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; pointer-events: none;
}
.ram-inline-img-clear {
    position: absolute; top: 4px; right: 4px;
    background: rgba(15,23,42,.7); color: #fff; border: none; border-radius: 50%;
    width: 20px; height: 20px; font-size: 9px; cursor: pointer;
    display: none; align-items: center; justify-content: center; z-index: 2;
    transition: background .15s;
}
.ram-inline-img-clear:hover { background: rgba(239,68,68,.85); }

/* فیلدها */
.ram-inline-fields { display: flex; flex-direction: column; }
.ram-inline-field-label {
    font-size: 10px; font-weight: 700; color: #475569; margin-bottom: 4px;
}

/* فوتر دکمه‌ها */
.ram-inline-footer {
    display: flex; justify-content: flex-end; align-items: center; gap: 8px;
    padding-top: 10px; border-top: 1.5px solid #e2e8f0;
}

/* ── Dark mode ── */
[data-theme="dark"] .ram-inline-form   { background: #0f172a; border-color: #4338ca; }
[data-theme="dark"] .ram-inline-body   { background: #0c1a2e; }
[data-theme="dark"] .ram-inline-header { background: linear-gradient(135deg, #030712, #1e1b4b); }
[data-theme="dark"] .ram-inline-image-zone {
    background: linear-gradient(135deg, #1e1b4b, #312e81); border-color: #4338ca;
}
[data-theme="dark"] .ram-inline-image-zone:hover,
[data-theme="dark"] .ram-inline-image-zone.drag-over {
    background: linear-gradient(135deg, #312e81, #4c1d95); border-color: #6d28d9;
}
[data-theme="dark"] .ram-inline-img-hint          { color: #a5b4fc; }
[data-theme="dark"] .ram-inline-img-hint span:nth-child(2) {
    background: rgba(165,180,252,.12); color: #a5b4fc; border-color: #4338ca;
}
[data-theme="dark"] .ram-inline-img-hint span:last-child {
    color: #c4b5fd; background: rgba(124,58,237,.2);
}
[data-theme="dark"] .ram-inline-field-label { color: #94a3b8; }
[data-theme="dark"] .ram-inline-footer       { border-color: #1e293b; }

/* ══════════════════════════════════════════════════════
   فرم رسید Inline — طراحی جدید (ril-*)
══════════════════════════════════════════════════════ */
@keyframes rilSlide { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.ril-form {
    margin: 8px 0;
    background: #ffffff;
    border: 1.5px solid #c7d2fe;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(99,102,241,.12);
    overflow: hidden;
    animation: rilSlide .18s ease;
}

/* Header */
.ril-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 100%);
    color: #fff;
}
.ril-header-info { display: flex; align-items: center; gap: 10px; }
.ril-header-icon { font-size: 20px; }
.ril-header-title { font-size: 14px; font-weight: 700; }
.ril-header-sub { font-size: 11px; color: #c7d2fe; margin-top: 2px; }
.ril-close {
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.ril-close:hover { background: rgba(239,68,68,.7); }

/* Body */
.ril-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

/* Top row: image + fields */
.ril-top-row { display: flex; gap: 12px; align-items: flex-start; }
.ril-img-col { display: flex; flex-direction: column; gap: 6px; align-items: center; flex-shrink: 0; }

.ril-paste-btn {
    width: 90px; padding: 5px 0;
    border: 1.5px dashed #c7d2fe; border-radius: 8px;
    background: #eef2ff; color: #4f46e5;
    font-family: inherit; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all .15s; white-space: nowrap;
}
.ril-paste-btn:hover { background: #e0e7ff; border-color: #6366f1; }

.ril-img-zone {
    flex-shrink: 0;
    width: 90px; height: 90px;
    border: 2px dashed #c7d2fe;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
    transition: border-color .15s, background .15s;
}
.ril-img-zone:hover, .ril-img-zone.drag-over {
    border-color: #6366f1; background: linear-gradient(135deg, #e0e7ff, #ede9fe);
}
.ril-img-zone.has-image { border-style: solid; border-color: #4f46e5; }
.ril-img-hint { display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.ril-img-hint-icon { font-size: 22px; }
.ril-img-hint-text { font-size: 10px; font-weight: 600; color: #4f46e5; }
.ril-img-hint-sub  { font-size: 9px; color: #818cf8; }
.ril-img-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.ril-img-clear {
    position: absolute; top: 4px; left: 4px;
    background: rgba(239,68,68,.85); border: none; color: #fff;
    width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
    font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.ril-img-clear:hover { background: #dc2626; }
.ril-img-zoom {
    position: absolute; bottom: 4px; right: 4px;
    background: rgba(79,70,229,.85); border: none; color: #fff;
    width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
    font-size: 12px; display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.ril-img-zoom:hover { background: rgba(67,56,202,1); }

.ril-fields { flex: 1; display: flex; flex-direction: column; gap: 0; }
.ril-label {
    display: block; font-size: 11px; font-weight: 700;
    color: #475569; margin-bottom: 4px;
}
.ril-input {
    width: 100%; padding: 7px 10px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-family: inherit; font-size: 12px;
    color: #1e293b; background: #f8fafc; box-sizing: border-box;
    transition: border-color .15s;
}
.ril-input:focus { outline: none; border-color: #6366f1; background: #fff; }

/* Counterpart section */
.ril-section {
    border: 1.5px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    padding: 10px 12px;
}
.ril-section-title {
    font-size: 12px; font-weight: 700; color: #92400e;
    margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.ril-optional {
    font-size: 10px; font-weight: 400; color: #b45309;
    background: #fef3c7; padding: 1px 6px; border-radius: 4px;
}

/* Tabs */
.ril-tabs {
    display: flex; gap: 4px; margin-bottom: 10px;
    flex-wrap: wrap;
}
.ril-tab {
    padding: 5px 10px; border: 1.5px solid #d1d5db;
    border-radius: 20px; background: #fff;
    font-family: inherit; font-size: 11px; font-weight: 600;
    color: #64748b; cursor: pointer; transition: all .15s;
    white-space: nowrap;
}
.ril-tab:hover { border-color: #6366f1; color: #4f46e5; background: #eef2ff; }
.ril-tab--active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.ril-tab--active:hover { background: #4338ca; border-color: #4338ca; color: #fff; }

/* Panes */
.ril-pane { display: block; }
.ril-pane--hidden { display: none; }

.ril-note {
    font-size: 11px; color: #92400e;
    background: #fef9c3; border: 1px solid #fde047;
    border-radius: 7px; padding: 8px 10px; line-height: 1.6;
}

/* Customer tx dropdown + preview */
.ril-cust-txwrap { margin-top: 8px; }
.ril-tx-preview {
    margin-top: 6px; padding: 7px 10px; border-radius: 8px;
    font-size: 11px; font-weight: 600; display: none;
    border: 1.5px solid #e2e8f0;
}
.ril-tx-preview.ril-preview--receive { background: #f0fdf4; border-color: #86efac; color: #166534; }
.ril-tx-preview.ril-preview--pay     { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.ril-tx-preview.ril-preview--buy     { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
.ril-tx-preview.ril-preview--sell    { background: #f5f3ff; border-color: #c4b5fd; color: #5b21b6; }
.ril-preview-date  { font-weight: 400; opacity: .8; }
.ril-preview-badge { background: #fef3c7; color: #92400e; padding: 1px 5px; border-radius: 4px; font-size: 10px; margin-right: 4px; }

/* Footer */
.ril-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding-top: 10px; border-top: 1.5px solid #e2e8f0;
}
.ril-btn-cancel {
    padding: 7px 16px; border: 1.5px solid #d1d5db; border-radius: 8px;
    background: #fff; color: #64748b; font-family: inherit; font-size: 12px;
    font-weight: 600; cursor: pointer; transition: all .15s;
}
.ril-btn-cancel:hover { background: #f8fafc; border-color: #94a3b8; }
.ril-btn-save {
    padding: 7px 18px; border: none; border-radius: 8px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
    font-family: inherit; font-size: 12px; font-weight: 700;
    cursor: pointer; transition: opacity .15s;
    box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.ril-btn-save:hover { opacity: .9; }
.ril-btn-save:disabled { opacity: .5; cursor: not-allowed; }

/* Dark mode */
[data-theme="dark"] .ril-form            { background: #0f172a; border-color: #4338ca; }
[data-theme="dark"] .ril-body            { background: #0c1a2e; }
[data-theme="dark"] .ril-header          { background: linear-gradient(135deg, #030712, #1e1b4b); }
[data-theme="dark"] .ril-img-zone        { background: linear-gradient(135deg, #1e1b4b, #312e81); border-color: #4338ca; }
[data-theme="dark"] .ril-img-hint-text   { color: #a5b4fc; }
[data-theme="dark"] .ril-img-hint-sub    { color: #c4b5fd; }
[data-theme="dark"] .ril-label           { color: #94a3b8; }
[data-theme="dark"] .ril-input           { background: #1e293b; border-color: #334155; color: #f1f5f9; }
[data-theme="dark"] .ril-input:focus     { border-color: #818cf8; background: #0f172a; }
[data-theme="dark"] .ril-section         { background: #1c1917; border-color: #78350f; }
[data-theme="dark"] .ril-section-title   { color: #fcd34d; }
[data-theme="dark"] .ril-optional        { background: rgba(245,158,11,.15); color: #fcd34d; }
[data-theme="dark"] .ril-tab             { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .ril-tab:hover       { border-color: #818cf8; color: #a5b4fc; background: #1e1b4b; }
[data-theme="dark"] .ril-tab--active     { background: #4f46e5; border-color: #4f46e5; color: #fff; }
[data-theme="dark"] .ril-note            { background: rgba(245,158,11,.1); border-color: #78350f; color: #fcd34d; }
[data-theme="dark"] .ril-footer          { border-color: #1e293b; }
[data-theme="dark"] .ril-btn-cancel      { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .ril-paste-btn      { background: #1e1b4b; border-color: #4338ca; color: #a5b4fc; }
[data-theme="dark"] .ril-paste-btn:hover { background: #312e81; border-color: #6366f1; }

/* ══════════════════════════════════════════════════
   TOOLTIP  — نمایش فوری نام دکمه‌ها هنگام hover
══════════════════════════════════════════════════ */
[data-tip] {
    position: relative;
}
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 9px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s ease, transform .12s ease;
    transform: translateX(-50%) translateY(4px);
    z-index: 9999;
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
}
[data-tip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* Arrow */
[data-tip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s ease;
    z-index: 9999;
}
[data-tip]:hover::before { opacity: 1; }

[data-theme="dark"] [data-tip]::after  { background: #f1f5f9; color: #0f172a; box-shadow: 0 3px 10px rgba(0,0,0,.5); }
[data-theme="dark"] [data-tip]::before { border-top-color: #f1f5f9; }

/* ══════════════════════════════════════════════════
   MOBILE  ≤ 768 px — layout fixes only
══════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Main container ── */
    .container {
        width: 100%;
        box-sizing: border-box;
        padding: 8px 8px 16px !important;
        gap: 10px;
        overflow-x: hidden;
    }

    /* ── Grid layouts: always 1 column ── */
    .top-section, .bottom-section {
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    /* ── Card headers: wrap on small screens ── */
    .card-header {
        flex-wrap: wrap;
        gap: 6px !important;
        padding: 10px 12px !important;
    }
    .card-header h2 { font-size: 14px !important; }

    /* ── Cashier / report grids ── */
    .cashier-grid { grid-template-columns: 1fr !important; }
    .moj-grid     { grid-template-columns: 1fr !important; }

    /* ── Nav tabs: horizontal scroll so all fit ── */
    .header-tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
    .header-tabs::-webkit-scrollbar { display: none; }
}
