:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --primary-light: #a78bfa;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s ease;
    --font: 'Vazirmatn', 'Segoe UI', Tahoma, Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.7;
    direction: rtl;
}

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

img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; border: none;
    cursor: pointer; transition: var(--transition);
    font-family: var(--font); line-height: 1.5;
}
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-success { background: var(--success); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

/* ==================== CARDS ==================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); font-weight: 700; }
.card-body { padding: 20px; }

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 14px; font-weight: 600; color: var(--gray-700);
}
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--gray-300); border-radius: var(--radius);
    font-size: 14px; font-family: var(--font);
    transition: var(--transition); direction: rtl;
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
textarea.form-control { min-height: 100px; resize: vertical; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
select.form-control { cursor: pointer; }

/* ==================== TABLES ==================== */
.table-wrapper { overflow-x: auto; }
.table {
    width: 100%; border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 12px 16px; text-align: right;
    border-bottom: 1px solid var(--gray-200);
}
.table th {
    background: var(--gray-50);
    font-weight: 700; color: var(--gray-600);
    font-size: 13px; text-transform: uppercase;
}
.table tr:hover { background: var(--gray-50); }
.table .actions { white-space: nowrap; }

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex; padding: 3px 10px;
    border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #ede9fe; color: #5b21b6; }

/* ==================== ALERTS ==================== */
.alert {
    padding: 14px 20px; border-radius: var(--radius);
    margin-bottom: 20px; font-size: 14px;
    display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; border-right: 4px solid #10b981; }
.alert-error { background: #fee2e2; color: #991b1b; border-right: 4px solid #ef4444; }
.alert-warning { background: #fef3c7; color: #92400e; border-right: 4px solid #f59e0b; }
.alert-info { background: #dbeafe; color: #1e40af; border-right: 4px solid #3b82f6; }

/* ==================== PAGINATION ==================== */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
}
.pagination a { background: var(--white); border: 1px solid var(--gray-300); color: var(--gray-700); }
.pagination a:hover { background: var(--primary); color: white; border-color: var(--primary); }
.pagination .active { background: var(--primary); color: white; border: 1px solid var(--primary); }

/* ==================== STATS ==================== */
.stat-card {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 24px; box-shadow: var(--shadow);
    border-top: 3px solid var(--primary);
}
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin-bottom: 12px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--gray-900); }
.stat-card .stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* ==================== GRID ==================== */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--white); box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 100;
}
.navbar .container {
    display: flex; align-items: center;
    justify-content: space-between;
    padding-top: 12px; padding-bottom: 12px;
}
.navbar-brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 24px; font-weight: 900; color: var(--primary);
}
.navbar-nav { display: flex; align-items: center; gap: 8px; list-style: none; }
.navbar-nav a {
    padding: 8px 16px; border-radius: var(--radius);
    color: var(--gray-600); font-size: 14px; font-weight: 500;
}
.navbar-nav a:hover, .navbar-nav a.active { background: var(--gray-100); color: var(--primary); }

/* ==================== SIDEBAR ==================== */
.dashboard-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px; background: var(--white);
    border-left: 1px solid var(--gray-200);
    padding: 24px 0; position: fixed;
    top: 0; right: 0; bottom: 0; z-index: 50;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 0 20px 24px; border-bottom: 1px solid var(--gray-200);
    margin-bottom: 16px;
}
.sidebar-brand h2 { font-size: 20px; color: var(--primary); }
.sidebar-brand small { color: var(--gray-400); font-size: 12px; }

.sidebar-nav { list-style: none; padding: 0 12px; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: var(--radius);
    color: var(--gray-600); font-size: 14px; font-weight: 500;
    transition: var(--transition);
}
.sidebar-nav a:hover { background: var(--gray-100); color: var(--primary); }
.sidebar-nav a.active { background: #ede9fe; color: var(--primary); font-weight: 700; }
.sidebar-nav .nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px; margin-top: auto;
    border-top: 1px solid var(--gray-200);
}

.dashboard-content {
    flex: 1; margin-right: 260px; padding: 24px;
}

.dashboard-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.dashboard-header h1 { font-size: 24px; font-weight: 800; }

/* ==================== PRODUCT CARD ==================== */
.product-card {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
    transition: var(--transition);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card .product-image {
    width: 100%; height: 200px; object-fit: cover;
    background: var(--gray-100);
}
.product-card .product-body { padding: 16px; }
.product-card .product-name {
    font-size: 15px; font-weight: 700;
    color: var(--gray-800); margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .product-brand {
    font-size: 12px; color: var(--gray-500); margin-bottom: 8px;
}
.product-card .product-price {
    font-size: 16px; font-weight: 800; color: var(--primary);
}
.product-card .product-price .toman { font-size: 12px; font-weight: 500; }
.product-card .product-actions { padding: 0 16px 16px; }

/* ==================== SALON CARD ==================== */
.salon-card {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
    transition: var(--transition);
}
.salon-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.salon-card .salon-cover {
    width: 100%; height: 160px; object-fit: cover;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.salon-card .salon-info { padding: 16px; }
.salon-card .salon-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.salon-card .salon-city { font-size: 13px; color: var(--gray-500); }
.salon-card .salon-stats {
    display: flex; gap: 16px; padding: 12px 16px;
    border-top: 1px solid var(--gray-200);
    font-size: 12px; color: var(--gray-500);
}

/* ==================== HERO ==================== */
.hero {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    color: white; padding: 80px 0;
    text-align: center;
}
.hero h1 { font-size: 48px; font-weight: 900; margin-bottom: 16px; }
.hero p { font-size: 20px; opacity: 0.9; max-width: 600px; margin: 0 auto 32px; }

/* ==================== FOOTER ==================== */
.footer {
    background: var(--gray-900); color: var(--gray-400);
    padding: 48px 0 24px; margin-top: 80px;
}
.footer h4 { color: var(--white); margin-bottom: 16px; font-size: 16px; }
.footer a { color: var(--gray-400); }
.footer a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 24px; margin-top: 32px;
    text-align: center; font-size: 13px;
}

/* ==================== PROFILE PAGE ==================== */
.salon-profile-hero {
    position: relative; height: 300px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    overflow: hidden;
}
.salon-profile-hero img {
    width: 100%; height: 100%; object-fit: cover; opacity: 0.5;
}
.salon-profile-info {
    position: absolute; bottom: -40px; right: 40px;
    display: flex; align-items: flex-end; gap: 20px;
}
.salon-profile-logo {
    width: 100px; height: 100px; border-radius: 20px;
    border: 4px solid white; object-fit: cover;
    background: white; box-shadow: var(--shadow-lg);
}
.salon-profile-name {
    color: white; font-size: 28px; font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 8px;
}
.salon-profile-desc {
    color: rgba(255,255,255,0.9); font-size: 14px;
    max-width: 400px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { color: var(--gray-600); margin-bottom: 8px; }

/* ==================== UTILITIES ==================== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.fw-bold { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 32px; }
    .hero { padding: 48px 0; }
    .sidebar { width: 220px; }
    .dashboard-content { margin-right: 220px; }
}
@media (max-width: 480px) {
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .navbar .container { flex-direction: column; gap: 12px; }
    .sidebar { display: none; }
    .dashboard-content { margin-right: 0; }
}