:root {
    --primary: #0f3460;
    --primary-dark: #0a2647;
    --gold: #d4a94e;
    --gold-hover: #b8892f;
    --green: #16a34a;
    --red: #dc2626;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --radius: 12px;
    --transition: all 0.2s ease;
    --shadow: 0 2px 10px rgba(15, 52, 96, 0.06);
    --shadow-hover: 0 8px 24px rgba(15, 52, 96, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 480px; margin: 0 auto; padding: 0 1rem; }

/* دکمه‌ها */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.65rem 1.2rem; border-radius: 8px; border: none; font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-hover); }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--gold); }
.btn-danger { background: #fee2e2; color: var(--red); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* هدر */
.topbar { background: var(--primary); color: #fff; padding: 0.7rem 0; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.brand { font-weight: 800; font-size: 1.15rem; }
.brand span { color: var(--gold); }

/* تب‌ها */
.tabs { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.6rem 0; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.tab-btn { flex-shrink: 0; padding: 0.5rem 1rem; border-radius: 20px; border: none; background: var(--bg); color: var(--text-light); font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.tab-btn.active { background: var(--primary); color: #fff; }

/* کارت‌ها */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: var(--transition); border: 1px solid var(--border); }
.card:hover { box-shadow: var(--shadow-hover); }
.card.featured { border: 1.5px solid var(--gold); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; padding: 1rem 1rem 0.5rem; }
.card-title { font-weight: 700; font-size: 1rem; }
.card-subtitle { font-size: 0.8rem; color: var(--text-light); margin-top: 0.2rem; }
.card-body { padding: 0 1rem 0.8rem; }
.card-footer { display: flex; gap: 0.4rem; padding: 0.8rem 1rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.spec-list { list-style: none; font-size: 0.85rem; }
.spec-list li { display: flex; justify-content: space-between; padding: 0.25rem 0; border-bottom: 1px dashed var(--border); }
.price-tag { font-size: 1.1rem; font-weight: 800; color: var(--primary); margin: 0.5rem 0 0.2rem; }

.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.badge-verified { background: #dcfce7; color: #166534; }
.badge-status { background: #f1f5f9; color: var(--text-light); }
.badge-urgent { background: #fef3c7; color: #92400e; }
.badge-category { background: #e0e7ff; color: #3730a3; }
.badge-payment { background: #f0fdfa; color: #0f766e; }
.badge-featured { background: #fff7ed; color: var(--gold-hover); border: 1px solid var(--gold); }

/* بخش‌ها */
.section-title { font-size: 1.4rem; font-weight: 700; margin: 1.8rem 0 1rem; color: var(--primary); }
.section-head-row { display: flex; justify-content: space-between; align-items: center; }
.section-head-row .section-title { margin-bottom: 0; }
.link-more { background: none; border: none; color: var(--gold-hover); font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }

/* جستجو و فیلتر */
.search-box { position: relative; }
.search-box input { width: 100%; padding: 0.75rem 2.5rem 0.75rem 1rem; border-radius: 10px; border: 1.5px solid var(--border); font-family: inherit; font-size: 0.95rem; }
.search-icon { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; margin: 1rem 0; }
.filter-bar select, .filter-bar input { padding: 0.55rem; border-radius: 8px; border: 1px solid var(--border); font-family: inherit; font-size: 0.85rem; }

/* فرم‌ها */
.form-group { margin-bottom: 0.9rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.6rem 0.8rem; border-radius: 8px; border: 1.5px solid var(--border); font-family: inherit; font-size: 0.9rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.radio-group { display: flex; gap: 1rem; font-size: 0.85rem; }
.file-upload { border: 1.5px dashed var(--border); border-radius: 8px; padding: 0.8rem; text-align: center; font-size: 0.85rem; color: var(--text-light); cursor: pointer; display: block; background: #f9fafb; }
.file-upload.has-file { border-color: var(--green); color: var(--green); background: #ecfdf5; }

/* مودال */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.55); align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-light); }
.modal-body { padding: 1.2rem; }
.step-indicator { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: var(--transition); }
.step-dot.active { background: var(--gold); width: 22px; border-radius: 10px; }
.step-label { text-align: center; font-size: 0.8rem; color: var(--text-light); margin-bottom: 1rem; font-weight: 600; }
.form-step { display: none; }
.form-step.active { display: block; }
.modal-nav { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
.modal-nav .btn { flex: 1; justify-content: center; }

/* توست */
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--primary); color: #fff; padding: 0.8rem 1.4rem; border-radius: 10px; font-size: 0.85rem; z-index: 2000; transition: var(--transition); opacity: 0; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

/* آگهی تبلیغاتی */
.ad-slot { background: linear-gradient(135deg, #fff7ed, #fffbeb); border: 1px solid var(--gold); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; display: flex; gap: 1rem; align-items: center; }
.ad-slot img { width: 90px; height: 60px; object-fit: cover; border-radius: 8px; }
.ad-slot .ad-tag { font-size: 0.7rem; color: var(--gold-hover); font-weight: 700; }

/* داشبورد کارتی */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1rem; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--border); }
.stat-card .num { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.stat-card .label { font-size: 0.78rem; color: var(--text-light); margin-top: 0.2rem; }

/* جدول ادمین */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; font-size: 0.85rem; }
.admin-table th, .admin-table td { padding: 0.6rem 0.7rem; text-align: right; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--bg); font-weight: 700; }
.admin-table tr:hover { background: #fafbfc; }
.table-wrap { overflow-x: auto; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-light); }
.loading { text-align: center; padding: 2rem; color: var(--text-light); }

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