/* =====================================================================
   التنسيق الجمالي الفخم والحديث لمنصة "لَبّيه" (Labbih Modern CSS Core)
   الثيم المعتمد: Premium Dark Glassmorphism مع تفاصيل باللون الذهبي السعودي الدافئ
   ===================================================================== */

:root {
    /* لوحة الألوان الأساسية */
    --bg-dark: #0a0e17;
    --panel-bg: rgba(18, 25, 41, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --sidebar-bg: #0d1321;
    
    --color-text-main: #f3f4f6;
    --color-text-muted: #9ca3af;
    
    /* درجات التدرج الذهبي والأخضر والبنفسجي */
    --accent-gold: #e5a93c;
    --accent-gold-hover: #f1c26b;
    --gold-gradient: linear-gradient(135deg, #e5a93c 0%, #f6d365 100%);
    --purple-gradient: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    --green-gradient: linear-gradient(135deg, #059669 0%, #34d399 100%);
    
    --color-green: #10b981;
    --color-red: #ef4444;
    --color-pending: #f59e0b;
    
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(229, 169, 60, 0.2);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* التصفير وإعدادات الصفحة الرئيسية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--color-text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
}

/* هيكل التطبيق الكلي (App Layout) */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* =====================================================================
   أولاً: الشريط الجانبي الفخم (Premium Sidebar)
   ===================================================================== */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 1rem;
    z-index: 10;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-logo {
    width: 48px;
    height: 48px;
    background: var(--gold-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon {
    font-size: 1.5rem;
    color: #111;
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.sidebar-nav {
    flex-grow: 1;
    margin-top: 2rem;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    color: var(--color-text-muted);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item:hover, .nav-item.active {
    color: var(--color-text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    border-right: 4px solid var(--accent-gold);
    background-color: rgba(229, 169, 60, 0.1);
    color: var(--accent-gold);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.active-tenant-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.active-tenant-selector label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.active-tenant-selector select {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--color-text-main);
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    outline: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.active-tenant-selector select:hover {
    border-color: var(--accent-gold);
}

/* =====================================================================
   ثانياً: مساحة العمل الرئيسية (Main Workspace)
   ===================================================================== */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    background: radial-gradient(circle at 70% 20%, #151e33 0%, var(--bg-dark) 80%);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    background-color: rgba(10, 14, 23, 0.4);
    position: sticky;
    top: 0;
    z-index: 5;
}

.header-welcome h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.header-welcome p {
    font-size: 0.85rem;
    color: var(--color-green);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.status-pulse-green {
    font-size: 0.5rem;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* الأزرار الفخمة (Buttons) */
.btn {
    padding: 0.65rem 1.4rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--gold-gradient);
    color: #111;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(229, 169, 60, 0.35);
}

.btn-secondary-outline {
    background-color: rgba(229, 169, 60, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(229, 169, 60, 0.3);
}

.btn-secondary-outline:hover {
    background-color: rgba(229, 169, 60, 0.2);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
}

.plan-badge {
    background-color: rgba(229, 169, 60, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(229, 169, 60, 0.3);
}

/* =====================================================================
   ثالثاً: الأقسام والمحتوى (Sections & Panels)
   ===================================================================== */
.content-section {
    display: none;
    padding: 2.5rem;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.4s ease;
}

.content-section.active {
    display: flex;
}

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

/* شبكة الإحصائيات (Stats Grid) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(229, 169, 60, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.purple-bg { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }
.gold-bg { background: rgba(229, 169, 60, 0.15); color: var(--accent-gold); }
.green-bg { background: rgba(16, 185, 129, 0.15); color: var(--color-green); }

.stat-data {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-data h3 {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.value-container {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
}

.stat-limit {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-family: 'Inter', sans-serif;
}

.stat-subtext {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

#statCappingWarn {
    color: var(--color-pending);
    font-weight: 600;
}

/* كرت التنبيه التفاعلي */
.info-alert-card {
    background: linear-gradient(135deg, rgba(229, 169, 60, 0.08) 0%, rgba(229, 169, 60, 0.02) 100%);
    border: 1px solid rgba(229, 169, 60, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.alert-icon i {
    font-size: 2rem;
    color: var(--accent-gold);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

.alert-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alert-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.alert-content p {
    font-size: 0.9rem;
    color: var(--color-text-main);
    line-height: 1.6;
}

.alert-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    width: fit-content;
}

.alert-actions input[type="range"] {
    width: 250px;
    accent-color: var(--accent-gold);
    cursor: pointer;
}

#rangeValueLabel {
    font-family: 'Inter', 'Cairo', sans-serif;
    font-weight: 700;
    color: var(--accent-gold);
}

/* شبكات العرض الثنائية */
.dashboard-grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.panel-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.max-width-card {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.panel-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.panel-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.panel-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

/* حالة Hetzner */
.hetzner-status-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    margin-bottom: 0.8rem;
    transition: var(--transition-smooth);
}

.hetzner-status-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 0.3rem;
    flex-shrink: 0;
}

.status-indicator.connected {
    background-color: var(--color-green);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.status-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.status-details p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
}

.status-details code {
    background-color: rgba(0,0,0,0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    color: var(--accent-gold);
}

/* =====================================================================
   رابعاً: الجداول (Tables)
   ===================================================================== */
.table-container {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.custom-table th {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.custom-table td {
    padding: 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge.pending { background-color: rgba(245, 158, 11, 0.15); color: var(--color-pending); }
.badge.confirmed { background-color: rgba(16, 185, 129, 0.15); color: var(--color-green); }
.badge.ai { background-color: rgba(124, 58, 237, 0.15); color: #a78bfa; }
.badge.keyword { background-color: rgba(229, 169, 60, 0.15); color: var(--accent-gold); }

/* =====================================================================
   خامساً: شاشة التفعيل الفوري (1-Click Onboarding Pane)
   ===================================================================== */
.onboarding-steps-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.step-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.progress-line {
    position: absolute;
    height: 4px;
    background-color: rgba(255,255,255,0.08);
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 1;
}

.step-node {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--sidebar-bg);
    border: 2px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--color-text-muted);
    z-index: 2;
    transition: var(--transition-smooth);
}

.step-node.active {
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #111;
    box-shadow: var(--shadow-glow);
}

.onboarding-step-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.onboarding-step-pane.active {
    display: block;
}

/* النماذج (Forms) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--color-text-main);
    font-weight: 600;
}

.form-group input, .form-group select {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--color-text-main);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(229, 169, 60, 0.15);
}

.form-actions-right {
    display: flex;
    justify-content: flex-end;
}

/* الاقتران بالـ QR Code */
.qr-pairing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.qr-display-card {
    background-color: rgba(0,0,0,0.2);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.qr-container-box {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 20px;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.mock-qr {
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.95);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #111;
    font-weight: 700;
    font-size: 0.9rem;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
}

.pairing-code-box {
    background-color: rgba(255,255,255,0.05);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.pairing-code-box strong {
    font-family: 'Inter', sans-serif;
    color: var(--accent-gold);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.onboarding-details-review {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.review-list li {
    font-size: 0.95rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
}

.success-icon-box {
    margin: 2rem 0;
}

.success-icon {
    color: var(--color-green);
    animation: scaleUp 0.5s ease-out;
}

@keyframes scaleUp {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.onboarding-success-desc {
    max-width: 600px;
    margin: 1rem auto 2rem;
    line-height: 1.8;
    color: var(--color-text-muted);
}

/* =====================================================================
   سادساً: شاشة الشات المباشر وتوجيه البشر (Live Chat & Handover)
   ===================================================================== */
.chat-dashboard-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 180px);
}

.conversations-list-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.conversations-list-wrapper {
    flex-grow: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.conversation-item:hover, .conversation-item.active {
    background-color: rgba(255,255,255,0.04);
}

.conversation-item.active {
    border-right: 4px solid var(--accent-gold);
}

.conv-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.conv-details p {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
}

/* زر التحويل (Handover Toggle Slider) */
.handover-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-main);
    background-color: rgba(0,0,0,0.2);
    padding: 0.5rem 1rem;
    border-radius: 12px;
}

.handover-toggle-label input {
    display: none;
}

.handover-slider {
    width: 44px;
    height: 22px;
    background-color: var(--sidebar-bg);
    border-radius: 20px;
    position: relative;
    transition: var(--transition-smooth);
    border: 1px solid var(--panel-border);
}

.handover-slider::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--color-text-muted);
    position: absolute;
    top: 3px;
    right: 4px;
    transition: var(--transition-smooth);
}

.handover-toggle-label input:checked + .handover-slider {
    background-color: var(--accent-gold);
}

.handover-toggle-label input:checked + .handover-slider::before {
    transform: translateX(-20px);
    background-color: #111;
}

.chat-window-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-window-header {
    padding: 1.2rem 1.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-customer-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.chat-customer-info span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-family: 'Inter', sans-serif;
}

.chat-messages-feed {
    flex-grow: 1;
    padding: 1.8rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: rgba(0,0,0,0.1);
}

/* شارات وبقع الحوار (Chat Bubbles) */
.chat-bubble {
    max-width: 60%;
    padding: 0.9rem 1.2rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.chat-bubble.customer {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--panel-border);
    align-self: flex-start;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
    background-color: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--color-text-main);
    align-self: flex-end;
    border-bottom-left-radius: 4px;
}

.chat-bubble.agent {
    background-color: rgba(229, 169, 60, 0.15);
    border: 1px solid rgba(229, 169, 60, 0.3);
    color: var(--color-text-main);
    align-self: flex-end;
    border-bottom-left-radius: 4px;
}

.chat-input-container {
    padding: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 1rem;
}

.chat-input-container input {
    flex-grow: 1;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    color: var(--color-text-main);
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.chat-input-container input:focus {
    border-color: var(--accent-gold);
}

/* =====================================================================
   سابعاً: الاشتراكات وحسابات الأرباح (SaaS Billing Grid)
   ===================================================================== */
.billing-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.current-plan-card {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.plan-sub {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.current-plan-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 0.5rem;
    color: var(--accent-gold);
}

.billing-price {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 1rem 0;
    font-family: 'Inter', 'Cairo', sans-serif;
}

.billing-price span {
    font-size: 1rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.usage-progress-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.usage-bar-bg {
    height: 10px;
    background-color: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: var(--transition-smooth);
}

.usage-bar-fill.warning {
    background: linear-gradient(90deg, var(--accent-gold) 0%, #ef4444 100%);
}

.usage-bar-fill.normal {
    background: var(--green-gradient);
}

.usage-alert-text {
    font-size: 0.8rem;
    color: var(--color-red);
    line-height: 1.5;
}

.pricing-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.pricing-small-card {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
}

.pricing-small-card.featured {
    border-color: var(--accent-gold);
    background-color: rgba(229, 169, 60, 0.03);
}

.price-badge-popular {
    position: absolute;
    top: -12px;
    left: 1.5rem;
    background: var(--gold-gradient);
    color: #111;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(229, 169, 60, 0.4);
}

.pricing-small-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.price-val {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    color: var(--accent-gold);
}

.price-val span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.pricing-small-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.pricing-small-card ul li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-green {
    color: var(--color-green);
}

/* =====================================================================
   ثامناً: محاكي الواتساب العائم (WOW WhatsApp Simulator)
   ===================================================================== */
.whatsapp-simulator-drawer {
    position: fixed;
    top: 0;
    left: -400px; /* Hidden by default */
    width: 380px;
    height: 100vh;
    background-color: #0b141a; /* WhatsApp Dark Mode Background */
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-smooth);
    border-right: 1px solid var(--panel-border);
}

.whatsapp-simulator-drawer.active {
    left: 0;
}

.sim-header {
    background-color: #1f2c34;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #e9edef;
    position: relative;
}

.sim-avatar {
    width: 40px;
    height: 40px;
    background: var(--gold-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(229, 169, 60, 0.2);
}

.sim-avatar-icon {
    color: #111;
    font-size: 1.1rem;
}

.sim-header-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.sim-status {
    font-size: 0.75rem;
    color: #8696a0;
    margin-top: 0.1rem;
}

.close-sim-btn {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8696a0;
    font-size: 1.3rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
}

.close-sim-btn:hover {
    color: #e9edef;
}

.sim-chat-body {
    flex-grow: 1;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* WhatsApp Official Wallpaper Pattern */
    background-color: #0b141a;
    background-blend-mode: overlay;
    opacity: 0.95;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-system-date {
    background-color: #1f2c34;
    color: #8696a0;
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    width: fit-content;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
}

.chat-bubble-received, .chat-bubble-sent {
    max-width: 80%;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-bubble-received {
    background-color: #202c33;
    color: #e9edef;
    align-self: flex-start;
    border-radius: 12px;
    border-top-right-radius: 0;
}

.chat-bubble-sent {
    background-color: #005c4b; /* WhatsApp Sent Green */
    color: #e9edef;
    align-self: flex-end;
    border-radius: 12px;
    border-top-left-radius: 0;
}

.sim-chat-footer {
    background-color: #1f2c34;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.sim-suggestions-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
}

.sim-suggestions-row::-webkit-scrollbar {
    height: 4px;
}

.sim-suggestions-row::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.suggestion-tag {
    background-color: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e9edef;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
}

.suggestion-tag:hover {
    background-color: var(--accent-gold);
    color: #111;
}

.sim-input-box {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.sim-input-box input {
    flex-grow: 1;
    background-color: #2a3942;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    color: #e9edef;
    outline: none;
    font-size: 0.9rem;
}

.sim-send-btn {
    background-color: #00a884;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    color: #fff;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sim-send-btn:hover {
    background-color: #008f72;
    transform: scale(1.05);
}

/* =====================================================================
   أخيراً: التوافقية مع الموبايل (Responsive Adaptability)
   ===================================================================== */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
    }
    
    .brand-header {
        padding-bottom: 1rem;
    }
    
    .sidebar-nav ul {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .nav-item {
        padding: 0.6rem 1rem;
        white-space: nowrap;
    }
    
    .nav-item.active {
        border-right: none;
        border-bottom: 3px solid var(--accent-gold);
    }
    
    .main-content {
        height: calc(100vh - 180px);
    }
    
    .content-header {
        padding: 1rem 1.5rem;
    }
    
    .content-section {
        padding: 1.5rem;
    }
    
    .qr-pairing-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-dashboard-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .conversations-list-card {
        max-height: 200px;
    }
    
    .billing-overview-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-card-row {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   ز) تنسيق جمالي لصفحة الهبوط ونافذة الـ OTP (Landing Page & OTP Modal Styles)
   ===================================================================== */
.landing-container {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 30%, #151e33 0%, var(--bg-dark) 85%);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(15px);
    background-color: rgba(10, 14, 23, 0.4);
    position: sticky;
    top: 0;
    z-index: 10;
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.landing-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.landing-nav a:hover {
    color: var(--accent-gold);
}

.landing-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    padding: 6rem 4rem;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

.hero-content h2 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.4;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.hero-image {
    display: flex;
    justify-content: center;
    position: relative;
}

/* بطاقة الشات التفاعلية بالبكسل والتفاصيل الفخمة */
.animated-glass {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    border-radius: 24px;
    padding: 1.8rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
    animation: floatCard 4s ease-in-out infinite;
}

@keyframes floatCard {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.card-header-whatsapp {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-header-whatsapp span {
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-feed-mock {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.msg-cust, .msg-bot {
    padding: 0.9rem 1.2rem;
    border-radius: 16px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.6;
}

.msg-cust {
    align-self: flex-start;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-main);
    border-bottom-right-radius: 4px;
}

.msg-bot {
    align-self: flex-end;
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-green);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* قسم المميزات */
.landing-features {
    padding: 4rem;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 3rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.features-grid-landing {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card-landing {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2.2rem 1.8rem;
    transition: var(--transition-smooth);
}

.feature-card-landing:hover {
    transform: translateY(-8px);
    border-color: rgba(229, 169, 60, 0.3);
    box-shadow: 0 15px 35px rgba(229, 169, 60, 0.05);
}

.feature-card-landing h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.2rem 0 0.8rem 0;
    color: var(--color-text-main);
}

.feature-card-landing p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.gold-text {
    color: var(--accent-gold);
}

/* =====================================================================
   ح) واجهة الـ OTP وتأكيد الدخول المودال (WhatsApp OTP Modal Styles)
   ===================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 23, 0.82);
    backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    background: rgba(18, 25, 41, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    padding: 2.2rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(229, 169, 60, 0.05);
    animation: scaleModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleModal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-modal-btn:hover {
    color: var(--accent-gold);
    transform: rotate(90deg);
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.error-msg {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: #f87171;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* إضافات تجاوبية لصفحة الهبوط */
@media (max-width: 900px) {
    .landing-header {
        padding: 1rem 2rem;
    }
    .landing-hero {
        grid-template-columns: 1fr;
        padding: 3rem 2rem;
        gap: 3rem;
        text-align: center;
    }
    .hero-actions {
        justify-content: center;
    }
    .landing-features {
        padding: 3rem 2rem;
    }
}

