/* ═══════════════════════════════════════════════════════════════
   style.css — استایل کامل سیستم ثبت‌نام و پرداخت v7.0
   ═══════════════════════════════════════════════════════════════
   فهرست:
     1. متغیرها و تنظیمات پایه
     2. تایپوگرافی
     3. فرم ثبت‌نام (کاربر)
     4. باکس قیمت و تخفیف
     5. دکمه‌ها
     6. اعلان‌ها (Alerts)
     7. صفحه نتیجه پرداخت
     8. صفحه ورود ادمین
     9. هدر پنل ادمین
    10. کارت‌های آمار
    11. سیستم تب‌ها
    12. فیلتر و جستجو
    13. جداول داده
    14. مدیریت فیلدها
    15. مدیریت تخفیف‌ها
    16. مدیریت ریفرال
    17. تنظیمات مالی
    18. مودال (Modal)
    19. Toast نوتیفیکیشن
    20. ریسپانسیو
   ═══════════════════════════════════════════════════════════════ */


/* ============================================
   1. متغیرها و تنظیمات پایه
   ============================================ */

:root {
    /* رنگ‌های اصلی */
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #8B83FF;
    --primary-bg: rgba(108, 99, 255, 0.08);
    --primary-border: rgba(108, 99, 255, 0.2);
    --primary-shadow: rgba(108, 99, 255, 0.15);

    /* گرادیان‌ها */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #27ae60, #2ecc71);
    --gradient-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-price: linear-gradient(135deg, #667eea, #764ba2);

    /* رنگ‌های وضعیت */
    --success: #28a745;
    --success-dark: #218838;
    --success-bg: rgba(40, 167, 69, 0.08);
    --success-border: rgba(40, 167, 69, 0.2);
    --success-light: rgba(40, 167, 69, 0.12);

    --danger: #dc3545;
    --danger-dark: #c82333;
    --danger-bg: rgba(220, 53, 69, 0.08);
    --danger-border: rgba(220, 53, 69, 0.2);
    --danger-light: rgba(220, 53, 69, 0.12);

    --warning: #ffc107;
    --warning-dark: #e0a800;
    --warning-bg: rgba(255, 193, 7, 0.08);
    --warning-border: rgba(255, 193, 7, 0.25);

    --info: #17a2b8;
    --info-bg: rgba(23, 162, 184, 0.08);
    --info-border: rgba(23, 162, 184, 0.2);

    /* خاکستری‌ها */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* شعاع گردی */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;

    /* سایه‌ها */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 4px 16px var(--primary-shadow);
    --shadow-success: 0 4px 16px rgba(40, 167, 69, 0.15);
    --shadow-danger: 0 4px 16px rgba(220, 53, 69, 0.15);

    /* انتقال‌ها */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;

    /* فونت */
    --font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    --font-size-xs: 0.9em;
    --font-size-sm: 0.9em;
    --font-size-base: 0.9em;
    --font-size-md: 0.95em;
    --font-size-lg: 1.1em;
    --font-size-xl: 1.3em;
    --font-size-2xl: 1.6em;
    --font-size-3xl: 2em;
}

/* ============================================
   تنظیمات عمومی
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    color: var(--gray-800);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    color: var(--primary-dark);
}

code {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.88em;
    color: var(--primary-dark);
    border: 1px solid var(--gray-200);
}

hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 20px 0;
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}


/* ============================================
   2. تایپوگرافی
   ============================================ */

h1 {
    text-align: center;
    color: var(--gray-800);
    font-size: var(--font-size-xl);
    margin-bottom: 8px;
    font-weight: 800;
}

h2 {
    color: var(--gray-800);
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: 16px;
}

h3 {
    color: var(--gray-800);
    font-size: 1.05em;
    font-weight: 700;
    margin-bottom: 12px;
}

h4 {
    color: var(--gray-700);
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 28px;
    font-size: var(--font-size-md);
}


/* ============================================
   3. فرم ثبت‌نام (کاربر)
   ============================================ */

.container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 520px;
    width: 100%;
    padding: 36px 32px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- گروه فرم --- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: var(--font-size-base);
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    transition: var(--transition-fast);
    outline: none;
    background: var(--white);
    color: var(--gray-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.required {
    color: var(--danger);
    font-weight: 700;
}

/* جداکننده */
.separator {
    text-align: center;
    margin: 22px 0 16px;
    position: relative;
}
.separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-200);
}
.separator span {
    background: var(--white);
    padding: 0 14px;
    position: relative;
    color: var(--gray-500);
    font-size: var(--font-size-base);
    font-weight: 600;
}

/* چک‌باکس‌های سفارشی */
.custom-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.custom-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.custom-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}
.custom-checkbox-item label,
.checkbox-item {
    font-weight: 400 !important;
    color: var(--gray-600) !important;
    font-size: var(--font-size-base);
    cursor: pointer;
}

/* --- قوانین و مقررات --- */
.agreement-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin: 18px 0;
}
.agreement-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--gray-700);
}
.agreement-box a {
    color: var(--primary);
    font-weight: 600;
}
.agreement-box a.read {
    color: var(--success);
}

/* لینک ادمین */
.admin-link {
    text-align: center;
    margin-top: 14px;
}
.admin-link a {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
    text-decoration: none;
}
.admin-link a:hover {
    color: var(--primary);
}

/* بک‌لینک */
.back-link {
    text-align: center;
    margin-top: 16px;
}
.back-link a {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
    text-decoration: none;
}
.back-link a:hover {
    color: var(--primary);
}


/* ============================================
   4. باکس قیمت و تخفیف
   ============================================ */

.price-box {
    background: linear-gradient(135deg, #f5f7ff, #ede7f6);
    border: 2px solid #e0d4f5;
    border-radius: var(--radius-lg);
    padding: 22px;
    text-align: center;
    margin: 20px 0;
}

.price-box .amount {
    display: inline-block;
    background: var(--gradient-price);
    color: var(--white);
    padding: 8px 24px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--font-size-lg);
    margin-top: 10px;
}

/* ردیف تخفیف */
.discount-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.discount-row input {
    flex: 1;
}
.discount-row button {
    padding: 10px 18px;
    background: var(--gray-700);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-fast);
}
.discount-row button:hover {
    background: var(--gray-800);
}

/* لوگوی زیبال */
.zibal-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--gray-500);
    font-size: var(--font-size-sm);
}


/* ============================================
   5. دکمه‌ها
   ============================================ */

/* دکمه Submit اصلی */
button[type="submit"] {
    width: 100%;
    padding: 15px;
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #28a745 0%, #2e9577 100%);
}
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-success);
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* دکمه عمومی */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    background: var(--primary);
    color: var(--white);
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-xs);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}
.btn-success:hover {
    background: var(--success-dark);
    box-shadow: var(--shadow-success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover {
    background: var(--danger-dark);
    box-shadow: var(--shadow-danger);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-800);
}
.btn-warning:hover {
    background: var(--warning-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-600);
    color: var(--white);
}
.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}
.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}


/* ============================================
   6. اعلان‌ها (Alerts)
   ============================================ */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.alert-danger {
    background: #fdeaea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert ul {
    margin: 8px 20px 0;
    padding: 0;
}


/* ============================================
   7. صفحه نتیجه پرداخت
   ============================================ */

.result-container {
    text-align: center;
    padding: 40px 32px;
}

.result-icon {
    font-size: 3em;
    margin-bottom: 16px;
}


/* ============================================
   8. صفحه ورود ادمین
   ============================================ */

/* صفحه ورود از container عمومی استفاده می‌کند */
/* max-width آن 400px خواهد بود (از PHP تنظیم شود) */


/* ============================================
   9. هدر پنل ادمین
   ============================================ */

.admin-header {
    background: var(--gradient-header);
    color: var(--white);
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(102, 126, 234, 0.3);
}

.admin-header h1 {
    font-size: var(--font-size-lg);
    text-align: right;
    margin-bottom: 0;
    color: var(--white);
    font-weight: 700;
}

.admin-header div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: var(--font-size-sm);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.admin-header a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
}

/* وقتی ادمین فعال است، body تنظیمات متفاوتی دارد */
body:has(.admin-header) {
    display: block;
    background: var(--gray-100);
    padding: 0;
    align-items: stretch;
}


/* ============================================
   10. کارت‌های آمار
   ============================================ */

.admin-body {
    max-width: 1300px;
    margin: 0 auto;
    padding: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .number {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 6px;
}

.stat-card .label {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: 500;
}

/* رنگ‌بندی متفاوت برای هر کارت */
.stat-card:nth-child(1)::before {
    background: var(--gradient-primary);
}
.stat-card:nth-child(1) .number {
    color: var(--primary);
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}
.stat-card:nth-child(2) .number {
    color: var(--success);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}
.stat-card:nth-child(3) .number {
    color: #e67e22;
}


/* ============================================
   11. سیستم تب‌ها
   ============================================ */

.tabs {
    display: flex;
    gap: 0;
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0;
    box-shadow: var(--shadow-sm);
    border-bottom: 2px solid var(--gray-200);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 14px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 3px solid transparent;
    transition: var(--transition-fast);
    white-space: nowrap;
    position: relative;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--white);
}

.tab-content {
    background: var(--white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 28px;
    min-height: 200px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ============================================
   12. فیلتر و جستجو
   ============================================ */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    align-items: flex-end;
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
}

.filter-bar input,
.filter-bar select {
    padding: 9px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    width: 100%;
    background: var(--white);
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-bg);
}

.filter-bar .btn {
    align-self: flex-end;
}


/* ============================================
   13. جداول داده
   ============================================ */

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--font-size-sm);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 14px 16px;
    text-align: right;
    font-weight: 700;
    color: var(--gray-700);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 0px;
    text-align: right;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* وضعیت‌ها */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

.status-paid {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.status-pending {
    background: var(--warning-bg);
    color: #856404;
    border: 1px solid var(--warning-border);
}

.status-failed {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}


/* ============================================
   14. مدیریت فیلدها
   ============================================ */

.field-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.field-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.field-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.field-item .field-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field-item .field-name {
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-size-base);
}

.field-item .field-type {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.field-item .field-actions {
    display: flex;
    gap: 5px;
}

/* ردیف گزینه (افزودن فیلد) */
.option-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.option-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
}
.option-row input:focus {
    border-color: var(--primary);
    outline: none;
}
.option-row button {
    padding: 8px 12px;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 1em;
    transition: var(--transition-fast);
    line-height: 1;
}
.option-row button:hover {
    background: var(--danger-light);
}

.add-option-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: 8px;
}
.add-option-btn:hover {
    background: var(--success-light);
}


/* ============================================
   15. مدیریت تخفیف‌ها
   ============================================ */

/* از data-table و btn استفاده می‌شود */
/* استایل‌های خاصی لازم نیست */


/* ============================================
   16. مدیریت ریفرال
   ============================================ */

/* از data-table و btn استفاده می‌شود */


/* ============================================
   17. تنظیمات مالی
   ============================================ */

/* فرم تنظیمات مالی از form-group عمومی استفاده می‌کند */
/* دکمه submit آن هم از btn عمومی */

/* چک‌باکس مالیات */
.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    vertical-align: middle;
    margin-left: 6px;
}

/* رادیو */
.form-group input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    vertical-align: middle;
    margin-left: 4px;
}


/* ============================================
   18. مودال (Modal)
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin-bottom: 0;
    font-size: 1em;
    color: var(--gray-800);
}

.modal-close {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    cursor: pointer;
    color: var(--gray-600);
    transition: var(--transition-fast);
}
.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

/* جدول داخل مودال */
.modal-box table {
    width: 100%;
    border-collapse: collapse;
}
.modal-box table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--font-size-sm);
}
.modal-box table td:first-child {
    font-weight: 700;
    color: var(--gray-700);
    white-space: nowrap;
    width: 35%;
}
.modal-box table tr:last-child td {
    border-bottom: none;
}


/* ============================================
   19. Toast نوتیفیکیشن
   ============================================ */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    border-radius: var(--radius-md);
    color: var(--white);
    font-weight: 600;
    font-size: var(--font-size-sm);
    z-index: 2000;
    display: none;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

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

.toast.show {
    display: block;
    animation: toastIn 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}


/* ============================================
   20. دکمه‌های خروجی (Export)
   ============================================ */

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
}
.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.export-btn.csv {
    color: var(--success);
    border-color: var(--success-border);
}
.export-btn.csv:hover {
    background: var(--success-bg);
}


/* ============================================
   21. حالت تاریک (اختیاری)
   ============================================ */

.dark-toggle {
    position: relative;
    width: 52px;
    height: 28px;
}
.dark-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.dark-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--gray-300);
    border-radius: 28px;
    transition: var(--transition);
}
.dark-toggle .slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}
.dark-toggle input:checked + .slider {
    background: var(--primary);
}
.dark-toggle input:checked + .slider::before {
    transform: translateX(24px);
}


/* ============================================
   22. ریسپانسیو
   ============================================ */

@media (max-width: 1200px) {
    .admin-body {
        padding: 20px;
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table {
        font-size: var(--font-size-xs);
    }

    .data-table th,
    .data-table td {
        padding: 10px 10px;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px;
        text-align: center;
    }

    .admin-header div {
        justify-content: center;
    }

    .admin-body {
        padding: 16px 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 18px 16px;
    }

    .stat-card .number {
        font-size: var(--font-size-2xl);
    }

    .filter-bar {
        flex-direction: column;
        gap: 8px;
    }

    .filter-bar .form-group {
        min-width: 100%;
    }

    .tabs {
        gap: 0;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: var(--font-size-xs);
    }

    .tab-content {
        padding: 18px 14px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 8px;
        font-size: 1.1em;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 0.7em;
    }

    .modal-box {
        padding: 20px 16px;
    }
}

@media (max-width: 500px) {
    .container {
        padding: 28px 18px;
        border-radius: var(--radius-md);
    }

    h1 {
        font-size: var(--font-size-lg);
    }

    .price-box {
        padding: 16px;
    }

    .discount-row {
        flex-direction: column;
    }
    .discount-row button {
        width: 100%;
    }
}

/* ============================================
   23. استایل‌های اضافی و کمکی
   ============================================ */

/* overflow-x برای جداول */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}

/* فاصله‌دهی */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }

.fw-bold { font-weight: 700; }
.fw-normal { font-weight: 400; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.w-100 { width: 100%; }

/* پرینت */
@media print {
    .admin-header,
    .filter-bar,
    .tabs,
    .btn,
    .modal-overlay,
    .toast {
        display: none !important;
    }

    body {
        background: white;
        padding: 0;
    }

    .admin-body {
        padding: 0;
    }

    .tab-content {
        box-shadow: none;
        padding: 0;
    }

    .tab-panel {
        display: block !important;
    }

    .data-table {
        border: 1px solid #333;
    }

    .data-table th,
    .data-table td {
        border: 1px solid #ccc;
    }
}
/* ========== توافق‌نامه ========== */
        .agreement-box {
            background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
            border: 2px solid #ffc107;
            border-radius: 12px;
            padding: 20px;
            margin: 20px 0 10px;
            text-align: center;
        }
        .agreement-header {
            font-size: 1.15em;
            font-weight: 700;
            color: #856404;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .agreement-text {
            color: #664d03;
            font-size: 0.95em;
            margin-bottom: 15px;
            line-height: 1.8;
        }
        .agreement-link {
            display: inline-block;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white !important;
            text-decoration: none;
            padding: 12px 28px;
            border-radius: 10px;
            font-weight: 600;
            font-size: 1em;
            transition: all 0.3s ease;
            margin-bottom: 15px;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }
        .agreement-link:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        }
        .agreement-link.read {
            background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
            box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
        }
        .agreement-checkbox-wrapper {
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px dashed #e0c36a;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }
        .agreement-checkbox-wrapper .custom-checkbox-item {
            display: flex;
            align-items: center;
            gap: 6px;
            justify-content: center;
        }
        .agreement-checkbox-wrapper .custom-checkbox-item label {
            color: #664d03 !important;
            font-weight: 500 !important;
            font-size: 0.93em;
            cursor: pointer;
        }
        .agreement-checkbox-wrapper .custom-checkbox-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: #667eea;
        }
        .agreement-hint {
            font-size: 0.82em;
            color: #dc3545;
            margin: 0;
            transition: all 0.3s ease;
        }
        .agreement-checkbox-wrapper input[type="checkbox"]:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        .agreement-checkbox-wrapper input[type="checkbox"]:disabled + label {
            opacity: 0.5;
            cursor: not-allowed;
        }


/* --- کدهای تکمیلی برای ریسپانسیو شدن موبایل --- */
@media(max-width: 768px) {
    /* 1. اصلاح گریدها و ستون‌های داشبورد */
    .dash-two-col, .dash-three-col, 
    div[style*="grid-template-columns: 2fr 1fr"], 
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* 2. اصلاح فرم‌های بالای صفحه و دکمه‌ها */
    div[style*="display:grid;grid-template-columns:1fr 1fr;gap:15px;margin-bottom:15px;"] {
        grid-template-columns: 1fr !important;
    }
    .dash-range-btn {
        padding: 5px 10px;
        font-size: 14px;
    }

    /* 3. اصلاح هیت‌مپ (Heatmap) 24 ساعته */
    /* اجازه می‌دهیم اسکرول افقی بخورد تا فشرده نشود */
    div[style*="grid-template-columns:repeat(24,1fr)"] {
        min-width: 600px; /* حداقل عرض برای خوانایی */
    }
    /* کانتینر هیت مپ را اسکرول‌پذیر می‌کنیم */
    .dash-chart-card {
        overflow-x: auto;
    }

    /* 4. اصلاح جداول برای جلوگیری از بیرون‌زدگی */
    table {
        width: 100% !important;
        min-width: 400px;
    }
    div.table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    /* 5. فاصله دهی مناسب برای کارت‌های KPI */
    div[style*="grid-template-columns:repeat(auto-fit,minmax(170px,1fr))"] {
        grid-template-columns: 1fr 1fr !important; /* دو ستونه در موبایل */
    }
}

/* برای موبایل‌های خیلی کوچک (زیر 480 پیکسل) */
@media(max-width: 480px) {
    div[style*="grid-template-columns:repeat(auto-fit,minmax(170px,1fr))"] {
        grid-template-columns: 1fr !important; /* تک ستونه در موبایل‌های کوچک */
    }
}
/* ============================================
   اصلاحات نهایی جداول و دکمه‌ها برای موبایل و دسکتاپ
   ============================================ */

/* 1. اصلاح دکمه‌های فرم (تأیید / رد) داخل سلول‌های جدول */
.data-table td form {
    display: inline-block !important;
    margin: 0 !important;
}

.data-table td button[type="submit"],
.data-table td .btn {
    width: auto !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    margin: 2px !important;
    min-height: unset !important;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
}

/* 2. جلوگیری از شکسته شدن خطوط در جدول تا اسکرول افقی درست کار کند */
.data-table td, 
.data-table th {
    white-space: nowrap !important;
    vertical-align: middle !important;
}

/* 3. اصلاح چینش دکمه‌های نوار فیلتر (مخصوصا در موبایل) */
@media(max-width: 768px) {
    .filter-bar {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* دکمه‌های فیلتر، پاک‌سازی و CSV کنار هم یا با سایز مناسب قرار بگیرند */
    .filter-bar button[type="submit"],
    .filter-bar .btn,
    .filter-bar .export-btn {
        width: 100% !important;
        margin-top: 5px !important;
        padding: 10px !important;
        font-size: 14px !important;
        justify-content: center;
    }
}
