@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    /* ألوان الأساس والوضع الليلي الفخم (Glassmorphism Dark Mode) */
    --bg-main: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(22, 32, 51, 0.75);
    --bg-card-hover: rgba(30, 43, 68, 0.85);
    --bg-glass: rgba(17, 24, 39, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(56, 189, 248, 0.5);

    /* الألوان المميزة للأقسام والأدوار (Vibrant Curated Palette) */
    --accent-primary: #38bdf8; /* أزرق سماوي - المكيفات والرئيسي */
    --accent-primary-gradient: linear-gradient(135deg, #0284c7, #38bdf8);
    --accent-sales: #10b981; /* زمردي - المبيعات */
    --accent-sales-gradient: linear-gradient(135deg, #059669, #34d399);
    --accent-solar: #f59e0b; /* ذهبي شمسي - المنظومات */
    --accent-solar-gradient: linear-gradient(135deg, #d97706, #fbbf24);
    --accent-manager: #8b5cf6; /* بنفسجي ملكي - الإدارة */
    --accent-manager-gradient: linear-gradient(135deg, #6d28d9, #a78bfa);
    --accent-danger: #ef4444; /* أحمر - المتأخرات والديون */
    --accent-danger-gradient: linear-gradient(135deg, #dc2626, #f87171);

    /* النصوص */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* الظلال والحركات */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* الوضع النهاري (Light Theme Support) */
[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-glass: rgba(255, 255, 255, 0.88);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-focus: rgba(2, 132, 199, 0.5);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    padding-bottom: 90px; /* لترك مساحة شريط التنقل السفلي */
}

/* خلفية متدرجة فخمة للـ Body */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: 20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: 10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* حاوية التطبيق الرئيسية */
#app-container {
    max-width: 550px; /* المقاس المثالي والمركز للجوال و PWA */
    margin: 0 auto;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* التمرير المخصص والشريط المبهج */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* التنسيقات المشتركة للأزرار */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
    user-select: none;
}
.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--accent-primary-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
    transform: translateY(-2px);
}

.btn-sales {
    background: var(--accent-sales-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-solar {
    background: var(--accent-solar-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}
.btn-manager {
    background: var(--accent-manager-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}
.btn-danger {
    background: var(--accent-danger-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-secondary);
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1.5px solid var(--accent-primary);
}
.btn-outline:hover {
    background: rgba(56, 189, 248, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}
.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* شاشة تسجيل الدخول الفخمة (Login Screen) */
.login-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.5s ease;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-sales), var(--accent-primary), var(--accent-solar), var(--accent-manager));
}

.app-brand {
    text-align: center;
    margin-bottom: 28px;
}
.app-brand-logo {
    width: 80px;
    height: 80px;
    background: var(--accent-primary-gradient);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: var(--shadow-glow);
    animation: float 3s ease-in-out infinite;
}
.app-brand h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.app-brand p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* أزرار التجربة السريعة للحسابات (Demo Accounts Quick Access) */
.demo-accounts-box {
    margin-bottom: 24px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}
[data-theme="light"] .demo-accounts-box {
    background: rgba(241, 245, 249, 0.8);
}
.demo-accounts-title {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}
.demo-accounts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.demo-badge-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
}
.demo-badge-btn:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}
.demo-badge-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* حقول الإدخال النظيفة (Form Inputs) */
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}
.form-control {
    width: 100%;
    padding: 13px 16px 13px 40px;
    padding-right: 42px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--border-focus);
    background: var(--bg-main);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
textarea.form-control {
    padding-right: 16px;
    min-height: 90px;
    resize: vertical;
}

/* شريط الرأس والترويسة (Top Header) */
.top-header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.user-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background: #10b981;
    border: 2px solid var(--bg-main);
    border-radius: 50%;
}
.user-meta h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-primary);
}
.user-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 2px;
}
.role-badge-sales { background: rgba(16, 185, 129, 0.18); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.role-badge-ac { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.role-badge-solar { background: rgba(245, 158, 11, 0.18); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.role-badge-manager { background: rgba(139, 92, 246, 0.18); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* لوحة القيادة العُليا للمدير (KPI Cards Grid) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}
.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.kpi-card-full {
    grid-column: span 2;
}
.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.kpi-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.kpi-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
}

/* تبويبات الفلترة (Filter Pills Bar) */
.filter-pills-container {
    padding: 0 16px 12px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.filter-pills-container::-webkit-scrollbar {
    display: none;
}
.filter-pill {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-pill.active {
    background: var(--accent-primary-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}
.filter-pill .pill-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* قائمة البطاقات والطلبات (Orders Cards List) */
.orders-list {
    padding: 0 16px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    border-right: 5px solid var(--accent-primary);
    animation: slideUp 0.35s ease;
}
.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.18);
}
.order-card.category-ac { border-right-color: #38bdf8; }
.order-card.category-solar { border-right-color: #f59e0b; }

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.order-customer-info h4 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.order-invoice-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 6px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.status-completed { background: rgba(16, 185, 129, 0.18); color: #10b981; }
.status-waiting { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.status-late { background: rgba(239, 68, 68, 0.18); color: #ef4444; }
.status-delivered { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }

.order-card-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}
.order-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.order-info-row i {
    color: var(--accent-primary);
    width: 18px;
    text-align: center;
}

.remaining-alert-box {
    background: rgba(239, 68, 68, 0.12);
    border: 1px dashed rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.remaining-alert-box span {
    color: #f87171;
    font-weight: 800;
    font-size: 0.88rem;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}
.order-quick-actions {
    display: flex;
    gap: 8px;
}
.btn-quick-call {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}
.btn-quick-call:hover { background: #10b981; color: #fff; }

.btn-quick-map {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}
.btn-quick-map:hover { background: #38bdf8; color: #fff; }

.btn-quick-whatsapp {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}
.btn-quick-whatsapp:hover { background: #22c55e; color: #fff; }

/* شريط التنقل السفلي المتجاوب (Mobile Bottom Navigation Bar) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 550px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 12px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}
.nav-item i {
    font-size: 1.35rem;
    transition: transform 0.2s ease;
}
.nav-item.active {
    color: var(--accent-primary);
}
.nav-item.active i {
    transform: translateY(-2px);
}
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}
.nav-badge {
    position: absolute;
    top: 2px;
    right: 12px;
    background: var(--accent-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: var(--radius-full);
}

/* زر الإضافة العائم في المنتصف (Floating Action Button / Center Nav Button) */
.fab-button {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    background: var(--accent-primary-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.5);
    cursor: pointer;
    z-index: 990;
    border: none;
    transition: var(--transition);
    animation: pulseGlow 2.5s infinite;
}
.fab-button:hover {
    transform: scale(1.08) rotate(90deg);
}

/* النوافذ المنبثقة (Modals / Drawers) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end; /* لفتحها كـ Sheet على الجوال */
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 20px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}
.modal-close-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}
.modal-close-btn:hover {
    background: var(--accent-danger);
    color: #fff;
}

/* محول القسم وأزرار الاختيار (Segmented Switch & Toggle) */
.segmented-control {
    display: flex;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
}
.segmented-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    background: transparent;
    border: none;
}
.segmented-btn.active-ac {
    background: #0284c7;
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.segmented-btn.active-solar {
    background: #d97706;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* خريطة الموقع الوهمية التفاعلية (Interactive Map Location Picker) */
.map-picker-box {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 18px;
    position: relative;
}
.map-preview {
    height: 120px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--accent-primary);
    cursor: pointer;
    border: 1px dashed rgba(56, 189, 248, 0.4);
    position: relative;
    overflow: hidden;
}
.map-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(56, 189, 248, 0.15) 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
}
.map-coords-badge {
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: #fff;
    font-family: monospace;
    z-index: 1;
}

/* مفتاح التفعيل الأنيق (Toggle Switch) */
.switch-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 18px;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .3s;
    border-radius: var(--radius-full);
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background: var(--accent-sales-gradient);
}
input:checked + .slider:before {
    transform: translateX(22px);
}

/* تفاصيل الطلب داخل النافذة (Order Details Sheet) */
.details-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}
.details-section h4 {
    font-size: 0.92rem;
    color: var(--accent-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}
.details-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
}
.details-row:last-child { border-bottom: none; }
.details-label { color: var(--text-secondary); }
.details-val { font-weight: 700; color: var(--text-primary); text-align: left; }

/* شاشة التنبيهات (Alerts Cards) */
.alert-card {
    background: var(--bg-card);
    border-left: 4px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.alert-card.type-solar { border-left-color: var(--accent-solar); }
.alert-card.type-ac { border-left-color: var(--accent-primary); }
.alert-card.type-sales { border-left-color: var(--accent-danger); }
.alert-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.alert-content h4 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.alert-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.alert-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* شاشة إدارة المستخدمين (User Management List) */
.user-card-admin {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.user-info-admin h4 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.user-info-admin p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.user-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 6px;
}
.dot-active { background: #10b981; }
.dot-inactive { background: #ef4444; }

.roles-checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: var(--bg-secondary);
    padding: 14px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

/* رسالة الترحيب الفارغة أو التنبيهات */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 14px;
    color: var(--border-color);
}

/* الحركات (Animations) */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 24px rgba(56, 189, 248, 0.4); }
    50% { box-shadow: 0 8px 32px rgba(56, 189, 248, 0.8); }
}
