/* ═══════════════════════════════════════════════════════════════
   ON SERVER 1 - تصميم احترافي | Light + Dark Mode
   لوحة إدارة منفصلة | أيقونات احترافية | تجربة مستخدم محسّنة
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.98);
    --bg-input: #f8fafc;
    --border-color: #e2e8f0;
    --border-subtle: rgba(226, 232, 240, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #0f766e;
    --accent-hover: #0d5c56;
    --accent-gradient: linear-gradient(135deg, #0f766e, #14b8a6);
    --accent-light: rgba(15, 118, 110, 0.12);
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.12);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
    --radius: 10px;
    --radius-lg: 14px;
    --transition: 0.2s ease;
    --sidebar-width: 260px;
    /* مسافات موحّدة لتجربة مستخدم احترافية */
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 40px;
    --card-padding: 24px;
    --section-gap: 10px;
    /* تذييل: خلفية داكنة خفيفة هادئة */
    --footer-bg: #e2e8f0;
    /* ═══ سلم typography موحد (لوحة الإدارة + الموقع + لوحة المستخدم) ═══ */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 20px;
    --text-3xl: 24px;
    --text-hero: 26px;
    --leading-tight: 1.3;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    /* عناصر واجهة موحدة */
    --input-height: 44px;
    --input-padding-x: 14px;
    --input-padding-y: 12px;
    --btn-height: 44px;
    --btn-padding-x: 20px;
    --btn-font-size: var(--text-base);
    --icon-size-sm: 18px;
    --icon-size-md: 20px;
    --icon-size-lg: 22px;
}

html.dark-mode {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-nav: rgba(15, 23, 42, 0.98);
    --bg-input: #334155;
    --border-color: #334155;
    --border-subtle: rgba(71, 85, 105, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #2dd4bf;
    --accent-hover: #14b8a6;
    --accent-gradient: linear-gradient(135deg, #2dd4bf, #14b8a6);
    --accent-light: rgba(45, 212, 191, 0.15);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
    --footer-bg: #1e293b;
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    background: var(--bg-body);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover { text-decoration: none; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ═══ أيقونات ═══ */
.btn-icon, .nav-link-icon, .sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-inline {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    vertical-align: middle;
}

.brand-logo-icon svg, .btn-icon svg, .sidebar-icon svg {
    flex-shrink: 0;
}

/* ═══ لوحة الإدارة - تخطيط الشريط الجانبي ═══ */
.admin-layout {
    display: flex;
    min-height: 100vh;
    flex: 1;
}

.admin-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: background var(--transition), border-color var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand:hover { text-decoration: none; }

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: var(--accent-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo svg { color: #fff; }

.sidebar-title {
    font-weight: var(--font-bold);
    font-size: var(--text-md);
    color: var(--text-primary);
}

.sidebar-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    transition: all var(--transition);
}

.sidebar-link:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-link.active:hover { color: var(--accent-hover); }

/* تسجيل الخروج — يظهر في أسفل القائمة على سطح المكتب */
.sidebar-link-logout {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-md);
}
.sidebar-link-logout:hover {
    color: var(--danger);
    background: var(--danger-bg);
}


.sidebar-footer {
    flex-shrink: 0;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.sidebar-user-icon { color: var(--text-muted); }

.sidebar-user-name {
    display: block;
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    color: var(--text-primary);
}

.sidebar-user-role {
    font-size: var(--text-sm);
    color: var(--accent);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-actions .btn { justify-content: flex-start; }

/* روابط التذييل: الإعدادات، الوضع الليلي، تسجيل الخروج — بنفس أسلوب القائمة */
.sidebar-action-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    transition: all var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: right;
    font-family: inherit;
}

.sidebar-action-link:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.sidebar-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.sidebar-theme-toggle .theme-icon-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-action-label {
    flex: 1;
}

/* الوضع الليلي: إظهار القمر في الوضع النهاري والنص المناسب */
.sidebar-theme-toggle .icon-moon-wrap { display: inline-flex; }
.sidebar-theme-toggle .icon-sun-wrap { display: none; }
.sidebar-theme-toggle .theme-label-dark { display: inline; }
.sidebar-theme-toggle .theme-label-light { display: none; }

html.dark-mode .sidebar-theme-toggle .icon-moon-wrap { display: none; }
html.dark-mode .sidebar-theme-toggle .icon-sun-wrap { display: inline-flex; }
html.dark-mode .sidebar-theme-toggle .theme-label-dark { display: none; }
html.dark-mode .sidebar-theme-toggle .theme-label-light { display: inline; }

.sidebar-theme-toggle:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.admin-main-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ═══ تخطيط بوابة العملاء (نفس فكرة لوحة الإدارة) ═══ */
.client-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* شريط الموبايل فقط — مثل admin-mobile-header */
.client-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1001;
    min-height: 56px;
    padding: 12px 16px 12px 24px;
    padding-top: max(12px, env(safe-area-inset-top));
    align-items: center;
    gap: 14px;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background var(--transition), border-color var(--transition);
}

.client-mobile-header .client-sidebar-toggle {
    display: inline-flex;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    z-index: 2;
}

.client-mobile-header .client-sidebar-toggle:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.client-mobile-header-title {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-mobile-header-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-right: var(--space-xs);
    flex-shrink: 0;
}

/* ═══ شريط التنقل - العملاء (شاشات كبيرة) ═══ */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition), border-color var(--transition);
}

.client-nav .brand-logo-icon {
    background: var(--accent-gradient);
    color: #fff;
}

.admin-nav-guest .brand-logo-icon {
    background: var(--accent-gradient);
    color: #fff;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    gap: var(--space-lg);
    flex-wrap: wrap;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-logo:not(.brand-logo-icon) {
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-subtitle { font-size: var(--text-sm); color: var(--text-muted); }

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-base);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: var(--font-medium);
    transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-input);
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon.theme-toggle:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

html.dark-mode .theme-toggle .icon-sun { display: inline-flex; }
html.dark-mode .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-flex; }

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
}

.user-badge-icon { color: var(--accent); }

/* ═══ بوابة العملاء — قائمة جانبية موبايل (نفس فكرة لوحة الإدارة) ═══ */
.client-sidebar {
    display: none; /* على سطح المكتب لا تُعرض؛ الشريط العلوي فقط */
}

.client-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1002;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.client-sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.client-main-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

body.client-sidebar-open { overflow: hidden; }

/* شعار القائمة الجانبية للعملاء (يستخدم .sidebar-logo مثل الإدارة) */
.client-sidebar .sidebar-logo {
    background: var(--accent-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

/* ═══ المحتوى والبطاقات ═══ */
.page {
    flex: 1;
    padding: var(--space-xl) 0 var(--space-2xl);
    min-width: 0;
}

.admin-page .container { max-width: 1280px; }

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--card-padding);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

/* عناوين الصفحات والبطاقات — موحدة في الإدارة والعميل والرئيسية */
.page-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 var(--space-sm);
    line-height: var(--leading-tight);
}

.page-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin: 0 0 var(--space-lg);
    line-height: var(--leading-relaxed);
}

.card-form { max-width: 560px; }

.card-welcome { margin-bottom: var(--space-lg); }

.stats-grid-spaced { margin-bottom: var(--space-lg); }

.stat-card-link {
    text-decoration: none;
    color: inherit;
}

.stat-card-link:hover { border-color: var(--accent); }

.card-link {
    text-decoration: none;
    display: block;
    color: inherit;
}

.card-link:hover { border-color: var(--accent); }

.hero-side .btn { margin-top: var(--space-sm); }

.order-form-section { margin-top: var(--space-md); }

.platform-intro {
    margin-bottom: var(--space-lg);
}
.platform-intro-text {
    margin: 0 0 var(--space-md);
    font-size: var(--text-md);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}
.platform-intro .feature-list { margin-bottom: 0; }

.rate-info-inline {
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
    gap: var(--space-lg);
    align-items: stretch;
}

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

.hero-title {
    font-size: var(--text-hero);
    font-weight: var(--font-bold);
    margin: 0 0 var(--space-md);
    line-height: var(--leading-tight);
}

.hero-title span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--text-md);
    color: var(--text-secondary);
    margin: 0 0 var(--space-lg);
    line-height: var(--leading-relaxed);
}

.section-title {
    margin: 0 0 var(--section-gap);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    line-height: var(--leading-tight);
}

.section-title .sidebar-icon,
.section-title svg { flex-shrink: 0; }

.section-subtitle {
    margin: 0 0 var(--space-lg);
    font-size: var(--text-base);
    color: var(--text-muted);
    line-height: var(--leading-normal);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-lg);
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.feature-list li {
    position: relative;
    padding-right: 28px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.feature-list li::before {
    content: "";
    position: absolute;
    right: 0;
    top: 4px;
    width: 18px;
    height: 18px;
    background: var(--success);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

.hero-actions {
    display: flex;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ═══ الأزرار — موحدة في الإدارة والعميل والرئيسية ═══ */
.btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--btn-font-size);
    font-weight: var(--font-semibold);
    min-height: var(--btn-height);
    padding: var(--input-padding-y) var(--btn-padding-x);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition);
    text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.4);
}

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

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-sm {
    min-height: 38px;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-base);
}

.full-width { width: 100%; }

/* ═══ النماذج ═══ */
.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
}

.form-grid.compact { max-width: 400px; }

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-field label {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
}

.label-hint {
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* غلاف حقل كلمة المرور + زر الإظهار/الإخفاء (الزر على اليسار) */
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap input {
    padding-left: 48px;
    padding-inline-end: 16px;
    flex: 1;
    min-width: 0;
}

.password-toggle-btn {
    position: absolute;
    left: 0;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
}

.password-toggle-btn:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.password-toggle-btn .pwd-icon-show,
.password-toggle-btn .pwd-icon-hide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn .pwd-icon-hide {
    display: none;
}

/* مستوى كلمة المرور — خط لكل شرط (رقم، حرف كبير، حرف صغير، رمز) */
.password-criteria-wrap {
    margin-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.password-criterion {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.password-criterion-line {
    display: block;
    width: 56px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    transition: background var(--transition);
    flex-shrink: 0;
}

.password-criterion-line.criterion-met {
    background: var(--success);
}

.password-criterion-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.password-criterion-line.criterion-met + .password-criterion-label {
    color: var(--success);
}

/* تطابق كلمة المرور */
.password-match-msg {
    display: block;
    margin-top: var(--space-sm);
    font-size: var(--text-sm);
    min-height: 1.25em;
}
.password-match-msg.password-match-ok {
    color: var(--success);
}
.password-match-msg.password-match-bad {
    color: var(--danger);
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    min-height: var(--input-height);
    padding: var(--input-padding-y) var(--input-padding-x);
    font-size: var(--text-base);
    outline: none;
    transition: all var(--transition);
}

input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

input::placeholder { color: var(--text-muted); }
select { cursor: pointer; }

/* نموذج بحث المستخدمين */
.users-search-form { margin-bottom: var(--space-lg); }
.users-search-form .search-input-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.users-search-form .search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
}
.users-search-form .search-input::placeholder { color: var(--text-muted); }

.rate-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--space-sm) 0 var(--space-md);
    font-size: var(--text-base);
    color: var(--text-muted);
}

.rate-info strong { color: var(--accent); font-weight: 600; }

.result-box {
    border-radius: var(--radius);
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    margin-bottom: 14px;
}

.result-box span { font-size: var(--text-base); color: var(--text-secondary); }

.result-value {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.result-value span:first-child {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--success);
}

.result-value span:last-child { font-size: var(--text-base); color: var(--text-muted); }

.upload-dropzone {
    border-radius: var(--radius);
    border: 2px dashed var(--border-color);
    background: var(--bg-input);
    padding: 24px;
    text-align: center;
    position: relative;
    transition: all var(--transition);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-content .icon {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--accent);
}

.file-preview { margin-top: 10px; }

.account-box {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    background: var(--bg-input);
    font-size: 13px;
}

.account-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.account-line.wrap { flex-wrap: wrap; }
.account-line .label { color: var(--text-muted); }

/* ═══ كتلة الدفع وتفاصيل الحساب البنكي ═══ */
.payment-block {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: 2px;
}

.payment-block-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.payment-block-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius);
}

.payment-block-title {
    margin: 0 0 var(--space-xs);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.payment-block-desc {
    margin: 0;
    font-size: var(--text-base);
    color: var(--text-muted);
    line-height: var(--leading-normal);
}

.bank-select-wrap {
    margin-bottom: var(--space-lg);
}

.bank-select-wrap select {
    width: 100%;
    font-weight: 500;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-inline-end: 44px;
}

html.dark-mode .bank-select-wrap select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.account-details-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.account-details-card.has-selection {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-light);
}

.account-details-header {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.account-details-label {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
}

.account-details-placeholder {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.account-details-card.has-selection .account-details-placeholder {
    display: none;
}

.account-details-body {
    padding: var(--space-md) var(--space-lg);
}

.account-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.account-detail-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.account-detail-row:first-of-type {
    padding-top: 0;
}

.account-detail-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 90px;
}

.account-detail-value-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

.account-detail-value {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    word-break: break-all;
}

.account-detail-value-mono {
    font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
    letter-spacing: 0.02em;
}

.btn-copy {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-copy:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-copy:active {
    transform: scale(0.96);
}

.btn-copy.copied {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success);
}

.account-details-tip {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--success-bg);
    border-top: 1px solid var(--border-color);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: var(--leading-normal);
}

.account-tip-icon {
    flex-shrink: 0;
    color: var(--success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ═══ التنبيهات ═══ */
.alert {
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.alert-icon { flex-shrink: 0; }

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

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

/* ═══ جداول الأدمن (احترافية منفصلة) ═══ */
.admin-page .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    min-width: 0;
}

.admin-page .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
}

.admin-page .data-table th,
.admin-page .data-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

.admin-page .data-table thead th {
    font-weight: var(--font-bold);
    color: var(--text-muted);
    background: var(--bg-input);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-page .data-table tbody tr {
    transition: background var(--transition);
}

.admin-page .data-table tbody tr:hover {
    background: var(--bg-input);
}

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

.admin-page .user-link { font-weight: 600; color: inherit; }
.admin-page .user-link:hover { color: var(--accent); }

/* ═══ Pagination — شريط واحد، مسافات ثابتة ═══ */
.pagination-bar {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.pagination-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.pagination-info {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.pagination-info .pagination-range strong {
    font-weight: 600;
    color: var(--text-primary);
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.pagination-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.pagination-limit-select {
    height: 28px;
    min-width: 52px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}
.pagination-limit-select:hover,
.pagination-limit-select:focus {
    border-color: var(--accent);
    outline: none;
}
.pagination-divider {
    width: 1px;
    height: 14px;
    background: var(--border-color);
}
.pagination-page-num {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pagination-btn:hover:not(.is-disabled) {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}
.pagination-btn.is-disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
@media (max-width: 640px) {
    .pagination-bar-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .pagination-controls {
        justify-content: center;
    }
}

/* صفحة المستخدمين — قائمة بطاقات على الموبايل */
.users-list-mobile {
    display: none;
}

.user-card-mobile {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    background: var(--bg-input);
    transition: border-color var(--transition);
}

.user-card-mobile:last-child { margin-bottom: 0; }

.user-card-mobile-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.user-card-mobile-name {
    font-weight: var(--font-bold);
    font-size: var(--text-md);
    color: var(--text-primary);
    text-decoration: none;
}

.user-card-mobile-name:hover { color: var(--accent); }

.user-card-mobile-email {
    width: 100%;
    font-size: var(--text-base);
}

.user-card-mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
}

.user-card-mobile-actions .inline-form { margin: 0; }
.user-card-mobile-actions .btn { min-height: 44px; }

/* ═══ جداول العملاء (بسيطة وأنيقة) ═══ */
.client-page .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    min-width: 0;
}

.client-page .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
}

.client-page .data-table th,
.client-page .data-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

.client-page .data-table thead th {
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    background: var(--bg-input);
    font-size: var(--text-sm);
}

.client-page .data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

html.dark-mode .client-page .data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

/* شارات الحالة — موحدة في الإدارة والعميل */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs) var(--space-md);
    border-radius: 999px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-rejected { background: var(--danger-bg); color: var(--danger); }

/* ═══ نظام الطلبات — تصميم مدمج واحترافي ═══ */
.orders-card {
    padding: var(--space-lg);
}

.orders-header {
    margin-bottom: var(--space-md);
}

.orders-title {
    margin: 0 0 var(--space-xs);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.orders-subtitle {
    margin: 0;
    font-size: var(--text-base);
    color: var(--text-muted);
}

.orders-empty {
    font-size: 14px;
    margin: 0;
}

.orders-table-wrap {
    margin-top: 0;
}

.orders-table {
    font-size: var(--text-base) !important;
}

.orders-table th,
.orders-table td {
    padding: var(--space-sm) var(--space-md) !important;
    white-space: nowrap;
    vertical-align: middle;
    font-size: var(--text-base) !important;
}

.orders-table thead th {
    font-size: var(--text-sm) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-sm) var(--space-md) !important;
}

.orders-table .col-id { width: 52px; }
.orders-table .col-date { white-space: nowrap; }
.orders-table .col-amount {
    font-variant-numeric: tabular-nums;
}
.orders-table .col-target { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.orders-table .col-bank {
    white-space: normal;
    min-width: 80px;
}
.orders-table .col-bank .bank-name { display: block; font-size: 12px; }
.orders-table .col-bank .bank-acc { font-size: 11px; }
.orders-table .col-note { max-width: 180px; font-size: 13px; word-break: break-word; }
.orders-table .col-status { white-space: nowrap; }
.orders-table .col-actions { min-width: 140px; }
.orders-table .col-reason { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.orders-table .status-badge {
    padding: 4px 10px;
    font-size: 11px;
}

/* أزرار الإجراءات داخل جدول الطلبات */
.btn-xs {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon-only {
    padding: 6px;
    min-width: 28px;
    min-height: 28px;
}

.order-action-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.order-reject-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}
.order-reject-wrap[hidden] {
    display: none !important;
}

.order-action-btns {
    display: inline-flex;
    gap: 6px;
}

.order-reject-input {
    width: 100%;
    min-width: 90px;
    max-width: 120px;
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
}

.order-reject-input:focus {
    border-color: var(--accent);
    outline: none;
}

.order-reject-input::placeholder {
    color: var(--text-muted);
}

/* عمود الإشعار — زر أيقونة فقط */
.col-proof .btn-icon-only {
    color: var(--accent);
}

.col-proof .btn-icon-only:hover {
    background: var(--accent-light);
    color: var(--accent-hover);
}

/* ═══ الإحصائيات ═══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* شبكة لوحة التحكم: 3 أعمدة على الشاشات الكبيرة لست بطاقات */
.stats-grid-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
}

.stat-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--card-padding);
    background: var(--bg-card);
    transition: all var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    box-shadow: var(--shadow-sm);
}

/* بطاقة بإيقونة داخل شارة ملونة (لوحة التحكم) — موحد مع لوحة العميل */
.stat-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: var(--space-xs);
}

.stat-icon-badge.stat-icon-default {
    background: var(--accent-light);
    color: var(--accent);
}

.stat-icon-badge.stat-icon-success {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon-badge.stat-icon-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon-badge.stat-icon-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-icon-badge.stat-icon-sdg {
    background: rgba(15, 118, 110, 0.15);
    color: var(--accent);
}

.stat-icon-badge.stat-icon-usd {
    background: var(--success-bg);
    color: var(--success);
}

/* لمسة لونية خفيفة لبطاقات المبيعات */
.stat-card-sdg {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(15, 118, 110, 0.05) 100%);
    border-inline-start: 3px solid var(--accent);
}

.stat-card-usd {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(5, 150, 105, 0.05) 100%);
    border-inline-start: 3px solid var(--success);
}

.stat-icon {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    color: var(--text-muted);
    opacity: 0.75;
}

.stat-card .stat-label { margin-bottom: 2px; }

.stat-icon-success { color: var(--success); }
.stat-icon-warning { color: var(--warning); }
.stat-icon-danger { color: var(--danger); }
.stat-icon-default { color: var(--accent); }

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.stat-card-link:hover {
    transform: translateY(-2px);
}

.stat-label {
    font-size: var(--text-base);
    color: var(--text-muted);
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: var(--font-medium);
    letter-spacing: 0.01em;
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
}

.stat-value-currency {
    font-variant-numeric: tabular-nums;
    font-size: var(--text-2xl);
}

.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

.stat-value-sdg { color: var(--accent) !important; font-variant-numeric: tabular-nums; }
.stat-value-usd { color: var(--success) !important; font-variant-numeric: tabular-nums; }

/* إحصائيات ملف المستخدم — لوحة الإدارة */
.user-profile-stats { padding: var(--space-lg); }
.user-profile-stats-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}
.user-profile-stats-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius);
}
.user-profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
}
.user-profile-stats-grid .stat-card {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
}
.user-profile-stats-grid .stat-icon-badge {
    margin-bottom: 2px;
}
.stat-card-success {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(5, 150, 105, 0.04) 100%);
    border-inline-start: 3px solid var(--success);
}
.stat-card-warning {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(217, 119, 6, 0.04) 100%);
    border-inline-start: 3px solid var(--warning);
}
.stat-card-danger {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(220, 38, 38, 0.04) 100%);
    border-inline-start: 3px solid var(--danger);
}
.stat-card-orders {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(15, 118, 110, 0.04) 100%);
    border-inline-start: 3px solid var(--accent);
}

/* ═══ ملخص سريع — لوحة تحكم العميل ═══ */
.quick-summary-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.quick-summary-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.quick-summary-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius);
}

.quick-summary-title {
    margin: 0 0 var(--space-xs);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.quick-summary-desc {
    margin: 0;
    font-size: var(--text-base);
    color: var(--text-muted);
    line-height: var(--leading-normal);
}

.quick-summary-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.quick-stat:hover {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.quick-stat-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.quick-stat-total .quick-stat-icon {
    background: var(--accent-light);
    color: var(--accent);
}

.quick-stat-success .quick-stat-icon {
    background: var(--success-bg);
    color: var(--success);
}

.quick-stat-warning .quick-stat-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.quick-stat-danger .quick-stat-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.quick-stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.quick-stat-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-muted);
}

.quick-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: var(--leading-tight);
}

.quick-stat-success .quick-stat-value { color: var(--success); }
.quick-stat-warning .quick-stat-value { color: var(--warning); }
.quick-stat-danger .quick-stat-value { color: var(--danger); }

.quick-summary-btn {
    margin-top: 2px;
}

/* ═══ التقارير والإحصائيات — لوحة الإدارة ═══ */
.reports-page {
    max-width: 900px;
}

/* سطح المكتب: تخطيط تقارير كامل */
.reports-page-desktop {
    max-width: 1100px;
}

.reports-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.reports-header-text {
    min-width: 0;
}

.reports-header-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius-lg);
}

.reports-title {
    margin: 0 0 var(--space-sm);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.reports-desc {
    margin: 0;
    font-size: var(--text-base);
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
}

/* شريط الفلترة */
.reports-toolbar {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg) !important;
}

.reports-toolbar-title {
    margin: 0 0 var(--space-md);
    font-size: var(--text-md);
    font-weight: var(--font-bold);
    color: var(--text-secondary);
}

.reports-filters {
    margin: 0;
}

.reports-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.reports-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.reports-field label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-muted);
}

.reports-select,
.reports-input {
    padding: var(--input-padding-y) var(--input-padding-x);
    font-size: var(--text-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    min-height: var(--input-height);
}

.reports-select:focus,
.reports-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.reports-dates-group {
    display: none;
    align-items: flex-end;
    gap: var(--space-md);
}
.reports-dates-group.is-visible {
    display: flex;
}
.reports-dates-group .reports-input {
    min-width: 140px;
}

.reports-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-inline-start: auto;
}

.reports-actions .btn {
    white-space: nowrap;
}

.reports-active-filter {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.reports-active-label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* شبكة الطلبات + المبيعات (سطح المكتب) */
.reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.reports-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.reports-grid .reports-block {
    margin-bottom: 0;
}

.reports-block-title {
    margin: 0 0 var(--space-md);
    font-size: var(--text-md);
    font-weight: var(--font-bold);
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.reports-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
}

.reports-block-orders .reports-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-stat {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.report-stat:hover {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.report-stat-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.report-stat-total .report-stat-icon {
    background: var(--accent-light);
    color: var(--accent);
}

.report-stat-success .report-stat-icon {
    background: var(--success-bg);
    color: var(--success);
}

.report-stat-warning .report-stat-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.report-stat-danger .report-stat-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.report-stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.report-stat-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-muted);
}

.report-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: var(--leading-tight);
}

.report-stat-success .report-stat-value { color: var(--success); }
.report-stat-warning .report-stat-value { color: var(--warning); }
.report-stat-danger .report-stat-value { color: var(--danger); }

/* المبيعات — تخطيط inline (سطح المكتب) */
.reports-block-sales .reports-block-title {
    margin-bottom: var(--space-md);
}

.reports-sales-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm) var(--space-lg);
}

.reports-sales-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.reports-sales-item-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.reports-sales-item-value {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.reports-sales-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.reports-sales-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
}

.reports-sales-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    padding: var(--space-lg);
    border-inline-start: 4px solid var(--accent);
}

.reports-sales-card:last-child {
    border-inline-start-color: var(--success);
}

.reports-sales-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.reports-sales-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.reports-sales-card:last-child .reports-sales-icon {
    color: var(--success);
}

.reports-sales-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.reports-sales-row:first-of-type {
    padding-top: 0;
}

.reports-sales-label {
    color: var(--text-muted);
    font-weight: 500;
}

.reports-sales-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

/* جدول التفصيل اليومي */
.reports-block-table {
    margin-bottom: 0;
}

.reports-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
}

.reports-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
}

.reports-data-table th,
.reports-data-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.reports-data-table thead th {
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-card);
}

.reports-data-table tbody tr:hover {
    background: var(--bg-card);
}

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

.reports-block-empty {
    margin: 0;
    padding: var(--space-md);
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.reports-empty-state {
    padding: var(--space-2xl);
    text-align: center;
}
.reports-empty-icon {
    display: inline-flex;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: var(--space-md);
}
.reports-empty-msg {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.reports-data-table tfoot td {
    font-weight: 700;
    background: var(--bg-input);
    border-top: 2px solid var(--border-color);
    padding: var(--space-md) var(--space-lg);
}
.reports-empty {
    margin: 0;
    padding: var(--space-xl);
    text-align: center;
    font-size: 14px;
}

.muted { color: var(--text-muted); }
.small { font-size: var(--text-sm); }
.text-center { text-align: center; }

.hero-side { background: var(--bg-card); }

.auth-section { max-width: 460px; margin: 0 auto; }

.inline-form { display: flex; flex-direction: column; gap: 8px; }

.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.small-input {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
}

.copyable {
    cursor: pointer;
    border-bottom: 1px dashed var(--text-muted);
}

.copyable:hover { color: var(--accent); }

/* أزرار الإجراءات مع أيقونات */
.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ═══ التذييل — Minimal: خلفية هادئة، خط واضح، محاذاة وسط، سطر أو سطرين ═══ */
.footer {
    border-top: 1px solid var(--border-color);
    background: var(--footer-bg);
    transition: background var(--transition), border-color var(--transition);
    text-align: center;
}

.footer-inner {
    display: block;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    text-align: center;
}

.footer-inner .muted.small {
    display: inline-block;
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-muted);
    letter-spacing: 0.01em;
    text-align: center;
}

.admin-footer { margin-right: 0; }

/* ═══ لوحة الإدارة - شريط الهاتف (زر القائمة في الأعلى) ═══ */
.admin-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1001;
    min-height: 56px;
    padding: 12px 16px 12px 24px;
    padding-top: max(12px, env(safe-area-inset-top));
    align-items: center;
    gap: 14px;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background var(--transition), border-color var(--transition);
}

.admin-mobile-header .admin-sidebar-toggle {
    display: inline-flex;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}

.admin-mobile-header .admin-sidebar-toggle:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.admin-mobile-header-title {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-mobile-header-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-right: var(--space-xs);
    flex-shrink: 0;
}

.sidebar-close { display: none; }

/* غطاء (overlay) عند فتح القائمة على الهاتف — مظهر احترافي */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1002;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none; /* لا يمنع النقر على زر القائمة عندما القائمة مغلقة */
}

.admin-sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.sidebar-open { overflow: hidden; }

/* ═══ الاستجابة للشاشات الصغيرة ═══ */
@media (max-width: 1024px) {
    .admin-mobile-header {
        display: flex;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }
    html.dark-mode .admin-mobile-header {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    }

    /* منع المحتوى من الاختفاء تحت الشريط العلوي + مساحة فارغة علوية قليلة */
    .admin-main-wrap {
        margin-right: 0;
        padding-top: calc(56px + 16px + env(safe-area-inset-top, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        min-height: 100vh;
        position: relative;
        z-index: 1;
    }

    /* لوحة تحكم الإدارة على الهاتف: مسافات ووضوح */
    .admin-page .page {
        padding-top: var(--space-lg);
        padding-bottom: var(--space-2xl);
    }
    .admin-page .card {
        padding: var(--space-lg);
        border-radius: 14px;
    }
    .admin-page .card-welcome {
        margin-bottom: var(--space-lg);
    }
    .admin-page .stats-grid,
    .admin-page .stats-grid-spaced {
        gap: var(--space-sm);
        margin-bottom: var(--space-lg);
    }
    .user-profile-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .admin-page .stat-card {
        padding: var(--space-md);
        border-radius: 12px;
    }
    .admin-page .stat-value {
        font-size: 20px;
    }
    .admin-page .grid-2 {
        gap: var(--space-md);
    }
    .admin-page .section-title {
        font-size: 17px;
    }
    .admin-page .section-subtitle {
        margin-bottom: var(--space-md);
    }

    .sidebar-close {
        display: flex !important;
        position: absolute;
        left: 16px;
        top: max(12px, env(safe-area-inset-top));
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        border: none;
        background: var(--bg-input);
        color: var(--text-secondary);
        border-radius: 50%;
        cursor: pointer;
        transition: all var(--transition);
        box-shadow: var(--shadow-sm);
    }
    .sidebar-close:hover { color: var(--text-primary); background: var(--border-color); }

    .admin-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 1003;
        width: min(300px, 92vw);
        max-width: 100%;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s ease;
        box-shadow: -20px 0 56px rgba(0, 0, 0, 0.18);
        border-radius: 20px 0 0 20px;
        border-right: none;
        border-left: 1px solid var(--border-color);
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: var(--bg-card);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: -24px 0 64px rgba(0, 0, 0, 0.22);
    }

    html.dark-mode .admin-sidebar {
        box-shadow: -20px 0 56px rgba(0, 0, 0, 0.45);
    }
    html.dark-mode .admin-sidebar.open {
        box-shadow: -24px 0 64px rgba(0, 0, 0, 0.55);
    }

    .admin-sidebar-overlay { display: block; }

    /* رأس القائمة: زر إغلاق + شعار — مظهر احترافي */
    .admin-sidebar .sidebar-brand {
        padding: var(--space-lg);
        padding-top: calc(52px + env(safe-area-inset-top, 0px));
        padding-right: calc(var(--space-lg) + 48px + 12px);
        padding-bottom: var(--space-lg);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
        background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-input) 100%);
    }
    .admin-sidebar .sidebar-brand .sidebar-logo {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
    .admin-sidebar .sidebar-brand .sidebar-title {
        font-size: 16px;
    }
    .admin-sidebar .sidebar-brand .sidebar-subtitle {
        font-size: 12px;
        margin-top: 2px;
    }

    /* روابط القائمة: واضحة واحترافية مع مساحة لمس مناسبة */
    .admin-sidebar .sidebar-nav {
        padding: var(--space-md);
        gap: 4px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        flex: 1;
        min-height: 0;
    }
    .admin-sidebar .sidebar-link {
        padding: 16px 18px;
        min-height: 52px;
        border-radius: 14px;
        font-size: 15px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 14px;
        transition: background 0.2s ease, color 0.2s ease;
    }
    .admin-sidebar .sidebar-link .sidebar-icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .admin-sidebar .sidebar-link.active {
        background: var(--accent-light);
        color: var(--accent);
        font-weight: 600;
    }
    .admin-sidebar .sidebar-link:active {
        opacity: 0.9;
    }

    /* تذييل القائمة: المستخدم وأزرار الإجراءات */
    .admin-sidebar .sidebar-footer {
        padding: var(--space-lg);
        border-top: 1px solid var(--border-color);
        background: var(--bg-input);
        flex-shrink: 0;
    }
    .admin-sidebar .sidebar-user {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: var(--space-md);
        background: var(--bg-card);
        border: 1px solid var(--border-color);
    }
    .admin-sidebar .sidebar-user .sidebar-user-name {
        font-size: 14px;
    }
    .admin-sidebar .sidebar-actions .btn,
    .admin-sidebar .sidebar-actions .sidebar-action-link {
        min-height: 48px;
        justify-content: flex-start;
        padding: 12px 16px;
        border-radius: 12px;
    }

    /* منع امتداد أفقي في لوحة الإدارة */
    .admin-page .container {
        overflow-x: hidden;
        min-width: 0;
    }
}

/* القائمة الجانبية على الهواتف الصغيرة جداً — استغلال أفضل للمساحة */
@media (max-width: 480px) {
    .reports-stats { grid-template-columns: minmax(0, 1fr); }
    .admin-sidebar {
        width: min(280px, 94vw);
        border-radius: 16px 0 0 16px;
    }
    .admin-sidebar .sidebar-brand {
        padding: var(--space-md);
        padding-top: calc(48px + env(safe-area-inset-top, 0px));
        padding-right: calc(var(--space-md) + 48px + 8px);
    }
    .admin-sidebar .sidebar-nav {
        padding: var(--space-sm);
    }
    .admin-sidebar .sidebar-link {
        padding: 14px 16px;
        min-height: 48px;
        font-size: 14px;
    }
    .admin-sidebar .sidebar-footer {
        padding: var(--space-md);
    }
    .admin-sidebar .sidebar-user {
        padding: 12px;
    }
    .admin-sidebar .sidebar-actions .btn,
    .admin-sidebar .sidebar-actions .sidebar-action-link {
        min-height: 44px;
    }
}

@media (max-width: 900px) {
    .hero, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-profile-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
    .client-sidebar-overlay { display: block; }

    /* جدول الإدارة: خلايا أصغر ومساحة لمس مناسبة */
    .admin-page .data-table th,
    .admin-page .data-table td {
        padding: var(--space-sm) var(--space-md);
        font-size: 13px;
    }
    .admin-page .inline-actions {
        flex-direction: column;
        gap: 8px;
    }
    .admin-page .inline-form .small-input {
        width: 100%;
        min-width: 0;
    }

    /* الطلبات — استجابة للشاشات المتوسطة */
    .orders-table th,
    .orders-table td {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    .orders-table .order-action-form {
        flex-direction: column;
        align-items: flex-start;
    }
    .orders-table .order-reject-input {
        max-width: 100%;
    }

    /* صفحة المستخدمين: إظهار القائمة كبطاقات على الهاتف */
    .users-search-form .search-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .users-search-form .search-input {
        width: 100%;
    }
    .users-section .users-table-wrap {
        display: none;
    }
    .users-section .users-list-mobile {
        display: block;
    }
}

@media (max-width: 640px) {
    html, body { overflow-x: hidden; }
    .container { padding: 0 var(--space-md); max-width: 100%; }
    .card { padding: var(--space-lg); border-radius: var(--radius); min-width: 0; }
    .hero-title { font-size: var(--text-2xl); line-height: var(--leading-tight); }
    .footer-inner { text-align: center; }
    .stats-grid { grid-template-columns: minmax(0, 1fr); }
    .stats-grid-dashboard { grid-template-columns: minmax(0, 1fr); }
    .user-profile-stats-grid { grid-template-columns: minmax(0, 1fr); }
    .admin-mobile-header .admin-mobile-header-subtitle { display: none; }

    /* نموذج طلب الشحن — أحجام متناسقة على الهاتف */
    .order-form-section .section-title { font-size: 16px; margin-bottom: var(--space-sm); }
    .order-form-section .section-subtitle { font-size: 13px; margin-bottom: var(--space-md); }
    .order-form-section .form-grid { gap: var(--space-md); }
    .order-form-section .form-field label { font-size: 12px; }
    .order-form-section input[type="text"],
    .order-form-section input[type="number"],
    .order-form-section select {
        padding: 10px 12px;
        font-size: 14px;
        min-height: 42px;
    }
    .order-form-section .rate-info-inline { margin-bottom: var(--space-md); font-size: 12px; }
    .order-form-section .upload-dropzone { padding: 16px; }
    .order-form-section .dropzone-content .icon { margin-bottom: 8px; }
    .order-form-section .dropzone-content p { font-size: 13px; }
    .order-form-section .dropzone-content .muted.small { font-size: 11px; }

    /* كتلة الدفع وتفاصيل الحساب — موبايل */
    .payment-block {
        padding: var(--space-md);
        border-radius: var(--radius);
    }
    .payment-block-header {
        gap: var(--space-sm);
        margin-bottom: var(--space-md);
    }
    .payment-block-icon {
        width: 36px;
        height: 36px;
    }
    .payment-block-icon svg { width: 18px; height: 18px; }
    .payment-block-title { font-size: 14px; }
    .payment-block-desc { font-size: 12px; }
    .bank-select-wrap { margin-bottom: var(--space-md); }
    .bank-select-wrap select {
        padding: 10px 12px;
        padding-inline-end: 38px;
        font-size: 14px;
        min-height: 42px;
        background-size: 16px;
        background-position: right 10px center;
    }
    .account-details-header {
        padding: var(--space-sm) var(--space-md);
    }
    .account-details-label { font-size: 12px; }
    .account-details-placeholder { font-size: 11px; }
    .account-details-body { padding: var(--space-sm) var(--space-md); }
    .account-detail-row {
        padding: 8px 0;
        gap: var(--space-sm);
    }
    .account-detail-label {
        font-size: 11px;
        min-width: 72px;
    }
    .account-detail-value { font-size: 13px; }
    .btn-copy {
        width: 30px;
        height: 30px;
    }
    .btn-copy svg { width: 14px; height: 14px; }
    .account-details-tip {
        padding: var(--space-sm) var(--space-md);
        font-size: 12px;
        gap: 8px;
    }
    .account-tip-icon svg { width: 12px; height: 12px; }

    /* أزرار وإدخالات بمساحة لمس مناسبة (44px) */
    .btn, .nav-link {
        min-height: 44px;
    }
    .btn-sm { min-height: 38px; padding: 6px 12px; font-size: 12px; }
    input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
        min-height: 44px;
        font-size: 15px; /* يقلل التكبير التلقائي في iOS */
    }
    .order-form-section .btn-primary { padding: 10px 16px; font-size: 14px; }

    /* ملخص سريع — موبايل */
    .quick-summary-header { gap: var(--space-sm); margin-bottom: 0; }
    .quick-summary-icon { width: 36px; height: 36px; }
    .quick-summary-icon svg { width: 18px; height: 18px; }
    .quick-summary-title { font-size: 15px; }
    .quick-summary-desc { font-size: 12px; }
    .quick-summary-stats { gap: var(--space-xs); }
    .quick-stat { padding: var(--space-sm) var(--space-md); gap: var(--space-sm); }
    .quick-stat-icon { width: 36px; height: 36px; }
    .quick-stat-icon svg { width: 18px; height: 18px; }
    .quick-stat-label { font-size: 11px; }
    .quick-stat-value { font-size: 18px; }

    /* التقارير والإحصائيات — موبايل */
    .reports-header { flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-lg); padding-bottom: var(--space-md); }
    .reports-header-icon { width: 44px; height: 44px; }
    .reports-header-icon svg { width: 22px; height: 22px; }
    .reports-title { font-size: 18px; }
    .reports-desc { font-size: 13px; }
    .reports-block { padding: var(--space-md); }
    .reports-block-title { font-size: 14px; margin-bottom: var(--space-sm); }
    .reports-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
    .report-stat { padding: var(--space-sm) var(--space-md); gap: var(--space-sm); }
    .report-stat-icon { width: 38px; height: 38px; }
    .report-stat-icon svg { width: 18px; height: 18px; }
    .report-stat-label { font-size: 11px; }
    .report-stat-value { font-size: 18px; }
    .reports-grid { grid-template-columns: minmax(0, 1fr); }
    .reports-sales-inline { grid-template-columns: minmax(0, 1fr); }
    .reports-sales-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
    .reports-sales-card { padding: var(--space-md); }
    .reports-sales-card-header { font-size: 13px; margin-bottom: var(--space-sm); }
    .reports-filters-row { flex-direction: column; align-items: stretch; }
    .reports-actions { margin-inline-start: 0; }
    .reports-dates-group.is-visible { flex-wrap: wrap; }
    .reports-toolbar-title { font-size: 14px; }
    .reports-data-table th,
    .reports-data-table td { padding: var(--space-sm) var(--space-md); font-size: var(--text-base); }
    .reports-data-table thead th { font-size: var(--text-sm); }

    /* جدول الإدارة على الشاشات الصغيرة جداً */
    .admin-page .data-table th,
    .admin-page .data-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
    .admin-page .data-table thead th { font-size: 10px; }

    /* الطلبات — شاشات صغيرة */
    .orders-card { padding: var(--space-md); }
    .orders-table th,
    .orders-table td {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
    .orders-table .col-target,
    .orders-table .col-reason { max-width: 80px; }
    .orders-table .status-badge { padding: 3px 8px; font-size: 10px; }
    .client-page .data-table th,
    .client-page .data-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .user-card-mobile {
        padding: var(--space-md);
    }
    .user-card-mobile-actions {
        flex-direction: column;
    }
    .user-card-mobile-actions .btn,
    .user-card-mobile-actions .inline-form .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ═══ بوابة العملاء على الموبايل — نفس فكرة لوحة الإدارة ═══ */
@media (max-width: 900px) {
    .client-mobile-header {
        display: flex;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }
    html.dark-mode .client-mobile-header {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    }

    /* إخفاء شريط سطح المكتب */
    .client-nav .nav-inner {
        display: none !important;
    }
    .client-nav {
        position: static;
        border-bottom: none;
        min-height: 0;
        height: 0;
        overflow: visible;
        padding: 0;
    }
    .client-nav .container {
        display: none;
    }

    /* مساحة تحت الشريط (نفس admin-main-wrap) */
    .client-main-wrap {
        padding-top: calc(56px + 16px + env(safe-area-inset-top, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        min-height: 100vh;
        position: relative;
        z-index: 1;
    }

    /* القائمة الجانبية — نفس أسلوب admin-sidebar */
    .client-sidebar {
        display: flex;
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 1003;
        width: min(300px, 92vw);
        max-width: 100%;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s ease;
        box-shadow: -20px 0 56px rgba(0, 0, 0, 0.18);
        border-radius: 20px 0 0 20px;
        border-right: none;
        border-left: 1px solid var(--border-color);
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: var(--bg-card);
        flex-direction: column;
        overflow: hidden;
    }
    .client-sidebar.open {
        transform: translateX(0);
        box-shadow: -24px 0 64px rgba(0, 0, 0, 0.22);
    }
    html.dark-mode .client-sidebar {
        box-shadow: -20px 0 56px rgba(0, 0, 0, 0.45);
    }
    html.dark-mode .client-sidebar.open {
        box-shadow: -24px 0 64px rgba(0, 0, 0, 0.55);
    }
    .client-sidebar .sidebar-close {
        display: flex !important;
        position: absolute;
        left: 16px;
        top: max(12px, env(safe-area-inset-top));
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        border: none;
        background: var(--bg-input);
        color: var(--text-secondary);
        border-radius: 50%;
        cursor: pointer;
        transition: all var(--transition);
        box-shadow: var(--shadow-sm);
    }
    .client-sidebar .sidebar-close:hover {
        color: var(--text-primary);
        background: var(--border-color);
    }
    .client-sidebar .sidebar-brand {
        padding: var(--space-lg);
        padding-top: calc(52px + env(safe-area-inset-top, 0px));
        padding-right: calc(var(--space-lg) + 48px + 12px);
        padding-bottom: var(--space-lg);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
        background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-input) 100%);
    }
    .client-sidebar .sidebar-brand .sidebar-logo {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
    .client-sidebar .sidebar-brand .sidebar-title {
        font-size: 16px;
    }
    .client-sidebar .sidebar-brand .sidebar-subtitle {
        font-size: 12px;
        margin-top: 2px;
    }
    .client-sidebar .sidebar-nav {
        padding: var(--space-md);
        gap: 4px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        flex: 1;
        min-height: 0;
    }
    .client-sidebar .sidebar-link {
        padding: 16px 18px;
        min-height: 52px;
        border-radius: 14px;
        font-size: 15px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 14px;
        transition: background 0.2s ease, color 0.2s ease;
    }
    .client-sidebar .sidebar-link .sidebar-icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .client-sidebar .sidebar-link.active {
        background: var(--accent-light);
        color: var(--accent);
        font-weight: 600;
    }
    .client-sidebar .sidebar-link:active {
        opacity: 0.9;
    }
    .client-sidebar .sidebar-footer {
        padding: var(--space-lg);
        border-top: 1px solid var(--border-color);
        background: var(--bg-input);
        flex-shrink: 0;
    }
    .client-sidebar .sidebar-user {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: var(--space-md);
        background: var(--bg-card);
        border: 1px solid var(--border-color);
    }
    .client-sidebar .sidebar-user .sidebar-user-name {
        font-size: 14px;
    }
    .client-sidebar .sidebar-actions .btn,
    .client-sidebar .sidebar-footer .btn {
        min-height: 48px;
        justify-content: flex-start;
        padding: 12px 16px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .client-mobile-header .client-mobile-header-subtitle {
        display: none;
    }
    .client-main-wrap {
        padding-top: calc(52px + 16px + env(safe-area-inset-top, 0px));
    }
    .client-sidebar {
        width: min(280px, 94vw);
        border-radius: 16px 0 0 16px;
    }
    .client-sidebar .sidebar-brand {
        padding: var(--space-md);
        padding-top: calc(48px + env(safe-area-inset-top, 0px));
        padding-right: calc(var(--space-md) + 48px + 8px);
    }
    .client-sidebar .sidebar-nav {
        padding: var(--space-sm);
    }
    .client-sidebar .sidebar-link {
        padding: 14px 16px;
        min-height: 48px;
        font-size: 14px;
    }
    .client-sidebar .sidebar-footer {
        padding: var(--space-md);
    }
    .client-sidebar .sidebar-footer .btn {
        min-height: 44px;
    }
    .client-sidebar .sidebar-user {
        padding: 12px;
    }
}

/* ═══ نافذة منبثقة (تأكيد حذف وغيرها) ═══ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.modal-overlay .modal {
    width: 100%;
    max-width: 420px;
}

.profile-dl { margin: 0; }
.profile-dl dt { font-weight: var(--font-semibold); color: var(--text-secondary); margin-top: var(--space-md); font-size: var(--text-base); }
.profile-dl dt:first-child { margin-top: 0; }
.profile-dl dd { margin: 4px 0 0; padding: 0; }

/* ═══ الملف الشخصي — بوابة العملاء ═══ */
.profile-section { max-width: 520px; }
.profile-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.profile-header .section-title { margin: 0 0 var(--space-xs); }
.profile-header .section-subtitle { margin: 0; color: var(--text-muted); font-size: 0.95em; }
.profile-form .form-grid { gap: var(--space-md); }
.profile-password-section { margin-top: var(--space-md); }
.profile-password-title {
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}
.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}
.alert-list { margin: 0; padding-right: 1.25rem; list-style: disc; }
