/*
   ============================================
   WhatsApp SaaS Platform - Premium Design
   Phoenix Green + Gold | RTL Arabic
   ============================================ */

:root {
    /* Brand Colors - Phoenix Green (مستخرج من اللوجو) */
    --ws-primary: #10b981;        /* فينيكس أخضر - اللون الرئيسي من اللوجو */
    --ws-primary-light: #34d399;  /* أخضر فاتح للهوفر والتدرجات */
    --ws-primary-dark: #047857;   /* أخضر داكن للنصوص والأزرار المهمة */
    --ws-primary-50: #ecfdf5;     /* خلفية فاتحة جداً للبطاقات المميزة */
    --ws-primary-100: #d1fae5;    /* خلفية متوسطة للتمييز */

    /* Accent - Gold */
    --ws-accent: #d4af37;
    --ws-accent-light: #f0d264;
    --ws-accent-dark: #a8841c;

    /* Neutrals */
    --ws-dark: #0a0e1f;
    --ws-gray-900: #1f2937;
    --ws-gray-800: #374151;
    --ws-gray-700: #4b5563;
    --ws-gray-600: #6b7280;
    --ws-gray-500: #9ca3af;
    --ws-gray-400: #d1d5db;
    --ws-gray-300: #e5e7eb;
    --ws-gray-200: #f3f4f6;
    --ws-gray-100: #f9fafb;
    --ws-white: #ffffff;

    /* Status */
    --ws-success: #10b981;
    --ws-warning: #f59e0b;
    --ws-danger: #ef4444;
    --ws-info: #3b82f6;

    /* WhatsApp Brand */
    --ws-wa-green: #25d366;
    --ws-wa-dark: #075e54;
    --ws-wa-teal: #128c7e;

    /* Shadows */
    --ws-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ws-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --ws-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --ws-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --ws-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.18);

    /* Radii */
    --ws-radius-sm: 6px;
    --ws-radius: 12px;
    --ws-radius-md: 16px;
    --ws-radius-lg: 20px;
    --ws-radius-xl: 28px;

    /* Transitions */
    --ws-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body.ws-app {
    font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
    background: var(--ws-gray-100);
    color: var(--ws-gray-800);
    font-size: 14.5px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===========================
   Top Navigation
   =========================== */
.ws-topnav {
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-primary-dark) 100%);
    color: var(--ws-white);
    padding: 0;
    box-shadow: var(--ws-shadow-md);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.ws-topnav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    gap: 24px;
    max-width: 100%;
}

.ws-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--ws-white);
}

.ws-brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--ws-primary-dark);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    overflow: hidden;
    background: white;
    padding: 4px;
}

.ws-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ws-brand-text {
    display: flex;
    flex-direction: column;
}

.ws-brand-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.ws-brand-sub {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 400;
}

.ws-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.ws-search input {
    width: 100%;
    padding: 10px 18px 10px 44px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    color: var(--ws-white);
    font-size: 13.5px;
    transition: var(--ws-transition);
    backdrop-filter: blur(8px);
}

.ws-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.ws-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--ws-accent);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.ws-search i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
}

.ws-topnav-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ws-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--ws-white);
    position: relative;
    transition: var(--ws-transition);
    cursor: pointer;
}

.ws-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.ws-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    background: var(--ws-accent);
    color: var(--ws-primary-dark);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ws-user-menu {
    position: relative;
}

.ws-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 4px 12px 4px 4px;
    color: var(--ws-white);
    cursor: pointer;
    transition: var(--ws-transition);
}

.ws-user-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
}

.ws-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ws-accent) 0%, var(--ws-accent-light) 100%);
    color: var(--ws-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.ws-user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.2;
}

.ws-user-name {
    font-size: 13px;
    font-weight: 600;
}

.ws-user-role {
    font-size: 11px;
    opacity: 0.7;
}

.ws-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--ws-white);
    border-radius: var(--ws-radius);
    box-shadow: var(--ws-shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--ws-transition);
}

.ws-user-menu:hover .ws-user-dropdown,
.ws-user-menu:focus-within .ws-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ws-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--ws-gray-700);
    text-decoration: none;
    border-radius: 8px;
    font-size: 13.5px;
    transition: var(--ws-transition);
}

.ws-user-dropdown a:hover {
    background: var(--ws-primary-50);
    color: var(--ws-primary);
}

.ws-user-dropdown a.ws-logout {
    color: var(--ws-danger);
}

.ws-user-dropdown hr {
    margin: 6px 0;
    border-color: var(--ws-gray-200);
}

/* ===========================
   Layout & Sidebar
   =========================== */
.ws-layout {
    display: flex;
    min-height: calc(100vh - 75px);
}

.ws-sidebar {
    width: 260px;
    background: var(--ws-dark);
    color: var(--ws-white);
    padding: 24px 14px;
    flex-shrink: 0;
    position: sticky;
    top: 75px;
    height: calc(100vh - 75px);
    overflow-y: auto;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
}

.ws-sidebar::-webkit-scrollbar {
    width: 6px;
}

.ws-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.ws-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ws-nav li {
    margin-bottom: 4px;
}

.ws-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--ws-transition);
    position: relative;
}

.ws-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ws-white);
}

.ws-nav a.active {
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-primary-light) 100%);
    color: var(--ws-white);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.ws-nav a i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.ws-nav-section {
    padding: 18px 14px 6px !important;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-top: 10px !important;
}

.ws-nav-badge {
    margin-right: auto;
    background: var(--ws-accent);
    color: var(--ws-primary-dark);
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    padding: 2px 8px;
}

.ws-sidebar-status {
    margin-top: 24px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ws-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 4px;
}

.ws-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.ws-muted {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* ===========================
   Main Content Area
   =========================== */
.ws-main {
    flex: 1;
    padding: 28px;
    overflow-x: hidden;
    background: var(--ws-gray-100);
}

.ws-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.ws-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ws-gray-900);
    margin: 0;
}

.ws-page-subtitle {
    color: var(--ws-gray-600);
    font-size: 13.5px;
    margin-top: 4px;
}

/* ===========================
   Cards
   =========================== */
.ws-card {
    background: var(--ws-white);
    border-radius: var(--ws-radius-md);
    box-shadow: var(--ws-shadow);
    border: 1px solid var(--ws-gray-200);
    overflow: hidden;
    transition: var(--ws-transition);
}

.ws-card:hover {
    box-shadow: var(--ws-shadow-md);
}

.ws-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--ws-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ws-white);
}

.ws-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ws-gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ws-card-title i {
    color: var(--ws-primary);
}

.ws-card-body {
    padding: 22px;
}

/* ===========================
   Stats Cards
   =========================== */
.ws-stat-card {
    background: var(--ws-white);
    border-radius: var(--ws-radius-md);
    padding: 20px;
    border: 1px solid var(--ws-gray-200);
    transition: var(--ws-transition);
    position: relative;
    overflow: hidden;
}

.ws-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--ws-primary-50) 0%, transparent 70%);
    opacity: 0.6;
}

.ws-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ws-shadow-md);
}

.ws-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.ws-stat-icon.bg-primary {
    background: var(--ws-primary-100);
    color: var(--ws-primary);
}
.ws-stat-icon.bg-success {
    background: #d1fae5;
    color: var(--ws-success);
}
.ws-stat-icon.bg-warning {
    background: #fef3c7;
    color: var(--ws-warning);
}
.ws-stat-icon.bg-danger {
    background: #fee2e2;
    color: var(--ws-danger);
}
.ws-stat-icon.bg-info {
    background: #dbeafe;
    color: var(--ws-info);
}
.ws-stat-icon.bg-accent {
    background: #fef3c7;
    color: var(--ws-accent-dark);
}

.ws-stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--ws-gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.ws-stat-label {
    color: var(--ws-gray-600);
    font-size: 13px;
    font-weight: 500;
}

.ws-stat-trend {
    font-size: 12px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    background: #d1fae5;
    color: var(--ws-success);
    font-weight: 600;
}

/* ===========================
   Buttons
   =========================== */
.btn {
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 14px;
    transition: var(--ws-transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-primary-light) 100%);
    color: var(--ws-white);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ws-primary-dark) 0%, var(--ws-primary) 100%);
    color: var(--ws-white);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.35);
}

.btn-gold {
    background: linear-gradient(135deg, var(--ws-accent) 0%, var(--ws-accent-light) 100%);
    color: var(--ws-primary-dark);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
    font-weight: 700;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--ws-accent-dark) 0%, var(--ws-accent) 100%);
    color: var(--ws-primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--ws-white);
    color: var(--ws-gray-700);
    border: 1px solid var(--ws-gray-300);
}

.btn-outline:hover {
    background: var(--ws-gray-100);
    border-color: var(--ws-gray-400);
}

.btn-danger {
    background: var(--ws-danger);
    color: var(--ws-white);
}

.btn-danger:hover {
    background: #dc2626;
    color: var(--ws-white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 8px;
}

/* ===========================
   Tables
   =========================== */
.ws-table {
    width: 100%;
    border-collapse: collapse;
}

.ws-table th {
    background: var(--ws-gray-100);
    padding: 12px 16px;
    text-align: right;
    font-weight: 700;
    color: var(--ws-gray-700);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--ws-gray-200);
}

.ws-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--ws-gray-200);
    color: var(--ws-gray-800);
    font-size: 13.5px;
    vertical-align: middle;
}

.ws-table tr:hover td {
    background: var(--ws-gray-50);
}

.ws-table tr:last-child td {
    border-bottom: none;
}

/* ===========================
   Badges
   =========================== */
.ws-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
}

.ws-pill-success {
    background: #d1fae5;
    color: #047857;
}
.ws-pill-warning {
    background: #fef3c7;
    color: #b45309;
}
.ws-pill-danger {
    background: #fee2e2;
    color: #b91c1c;
}
.ws-pill-info {
    background: #dbeafe;
    color: #1d4ed8;
}
.ws-pill-secondary {
    background: var(--ws-gray-200);
    color: var(--ws-gray-700);
}
.ws-pill-primary {
    background: var(--ws-primary-100);
    color: var(--ws-primary);
}

/* ===========================
   Forms
   =========================== */
.form-label {
    font-weight: 600;
    color: var(--ws-gray-700);
    font-size: 13.5px;
    margin-bottom: 6px;
}

.form-control, .form-select {
    border: 1.5px solid var(--ws-gray-300);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--ws-transition);
    font-family: 'Tajawal', sans-serif;
}

.form-control:focus, .form-select:focus {
    border-color: var(--ws-primary);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.08);
}

textarea.form-control {
    min-height: 100px;
}

/* ===========================
   Empty States
   =========================== */
.ws-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--ws-gray-600);
}

.ws-empty i {
    font-size: 64px;
    color: var(--ws-gray-400);
    margin-bottom: 16px;
}

.ws-empty h4 {
    color: var(--ws-gray-700);
    margin-bottom: 8px;
}

/* ===========================
   Login & Register Pages
   =========================== */
.ws-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ws-primary-dark) 0%, var(--ws-primary) 50%, var(--ws-primary-light) 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.ws-auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
}

.ws-auth-card {
    background: var(--ws-white);
    border-radius: var(--ws-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--ws-shadow-xl);
    position: relative;
    z-index: 1;
}

.ws-auth-logo {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.25);
    overflow: hidden;
    background: white;
    padding: 8px;
    border: 3px solid var(--ws-primary-50);
}

.ws-auth-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
}

.ws-auth-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--ws-gray-900);
    text-align: center;
    margin-bottom: 8px;
}

.ws-auth-subtitle {
    color: var(--ws-gray-600);
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Legal Links داخل كارت تسجيل الدخول */
.ws-auth-legal {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12.5px;
}
.ws-auth-legal a {
    color: var(--ws-gray-600);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ws-auth-legal a:hover {
    color: var(--ws-primary);
    background: var(--ws-primary-50);
}
.ws-auth-legal a i {
    font-size: 11px;
}
.ws-auth-legal-sep {
    color: #cbd5e1;
    font-weight: bold;
}

/* ===========================
   Connection Banner
   =========================== */
.ws-connection-banner {
    background: linear-gradient(135deg, var(--ws-wa-teal) 0%, var(--ws-wa-dark) 100%);
    color: var(--ws-white);
    border-radius: var(--ws-radius-md);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--ws-shadow-md);
}

.ws-connection-banner.warning {
    background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
}

.ws-connection-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.ws-connection-info h3 {
    font-size: 17px;
    margin: 0 0 4px;
}

.ws-connection-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 13px;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 992px) {
    .ws-sidebar {
        width: 70px;
    }
    .ws-sidebar .ws-nav a span,
    .ws-sidebar .ws-nav-section,
    .ws-sidebar-status {
        display: none;
    }
    .ws-nav a {
        justify-content: center;
    }
    .ws-main {
        padding: 18px;
    }
    .ws-search {
        display: none;
    }
}

@media (max-width: 576px) {
    .ws-topnav-container {
        padding: 12px 16px;
    }
    .ws-brand-text {
        display: none;
    }
    .ws-user-info {
        display: none;
    }
}

/* ===========================
   Inbox Specific
   =========================== */
.ws-inbox-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 0;
    background: var(--ws-white);
    border-radius: var(--ws-radius-md);
    border: 1px solid var(--ws-gray-200);
    height: calc(100vh - 175px);
    overflow: hidden;
}

.ws-inbox-list {
    border-left: 1px solid var(--ws-gray-200);
    overflow-y: auto;
}

.ws-inbox-item {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--ws-gray-200);
    cursor: pointer;
    transition: var(--ws-transition);
    text-decoration: none;
    color: var(--ws-gray-800);
}

.ws-inbox-item:hover {
    background: var(--ws-gray-50);
}

.ws-inbox-item.active {
    background: var(--ws-primary-50);
    border-inline-start: 3px solid var(--ws-primary);
}

.ws-inbox-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-primary-light) 100%);
    color: var(--ws-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.ws-inbox-info {
    flex: 1;
    min-width: 0;
}

/* ============================================
   Test Send Page - صفحة تجربة Meta
   ============================================ */

.ws-hero-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(52, 211, 153, 0.04) 100%);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 16px;
    overflow: hidden;
}

.ws-hero-body {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
}

.ws-hero-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.ws-hero-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.ws-hero-content h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: #064e3b;
    font-family: 'Tajawal', sans-serif;
}

.ws-hero-content p {
    margin: 0 0 16px;
    color: #6b7280;
    font-size: 15px;
}

.ws-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Form Steps */
.ws-form-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px dashed #e5e7eb;
}

.ws-form-step:last-of-type {
    border-bottom: none;
}

.ws-step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-primary-dark) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.ws-step-content {
    flex: 1;
    min-width: 0;
}

.ws-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 8px;
}

.ws-label-required {
    color: #ef4444;
    margin-right: 4px;
}

.ws-help-text {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}

.ws-help-text i {
    margin-left: 4px;
    color: var(--ws-primary);
}

.ws-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.ws-input-group .ws-input {
    padding-left: 48px;
}

.ws-input-action {
    position: absolute;
    left: 8px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.ws-input-action:hover {
    background: #f3f4f6;
    color: var(--ws-primary);
}

/* Radio Cards */
.ws-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.ws-radio-card {
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
    background: white;
    display: block;
}

.ws-radio-card:hover {
    border-color: var(--ws-primary-light);
    background: rgba(16, 185, 129, 0.02);
}

.ws-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ws-radio-card:has(input:checked) {
    border-color: var(--ws-primary);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.ws-radio-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ws-radio-card-body i {
    font-size: 24px;
    color: var(--ws-primary);
    margin-bottom: 8px;
}

.ws-radio-card-body strong {
    color: #1f2937;
    font-size: 15px;
}

.ws-radio-card-body small {
    color: #6b7280;
    font-size: 12px;
}

.ws-form-actions {
    margin-top: 32px;
    text-align: center;
}

.ws-form-actions .btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    transition: all 0.3s;
}

.ws-form-actions .btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4);
}

.ws-form-actions .btn-lg:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.ws-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ws-spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes ws-spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.ws-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid;
}

.ws-alert i {
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 2px;
}

.ws-alert-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    color: #064e3b;
}

.ws-alert-success i {
    color: var(--ws-primary);
}

.ws-alert-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #7f1d1d;
}

.ws-alert-error i {
    color: #ef4444;
}

/* Info Rows */
.ws-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.ws-info-row:last-child {
    border-bottom: none;
}

.ws-info-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.ws-info-value {
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Steps List */
.ws-steps-list {
    padding-right: 24px;
    margin: 0;
}

.ws-steps-list li {
    margin-bottom: 16px;
    line-height: 1.6;
}

.ws-steps-list li strong {
    display: block;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
}

.ws-steps-list li p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

/* Code Blocks */
.ws-code {
    background: #1f2937;
    color: #10b981;
    padding: 16px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.6;
    direction: ltr;
    text-align: left;
    margin: 0;
}

.ws-code code {
    color: #e5e7eb;
    font-family: 'Poppins', monospace;
}

/* Result Cards */
.ws-result-success,
.ws-result-error {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid;
}

.ws-result-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.ws-result-success i {
    color: var(--ws-primary);
    font-size: 28px;
}

.ws-result-success strong {
    color: #064e3b;
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.ws-result-success p {
    margin: 0 0 4px;
    color: #064e3b;
    font-size: 14px;
}

.ws-result-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}

.ws-result-error i {
    color: #ef4444;
    font-size: 28px;
}

.ws-result-error strong {
    color: #7f1d1d;
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.ws-result-error p {
    margin: 0;
    color: #7f1d1d;
    font-size: 13px;
}

/* Details */
.ws-details {
    border-top: 1px dashed #e5e7eb;
    padding-top: 16px;
}

.ws-details summary {
    cursor: pointer;
    color: var(--ws-primary);
    font-weight: 600;
    font-size: 14px;
    user-select: none;
}

.ws-details summary:hover {
    color: var(--ws-primary-dark);
}

.ws-details[open] summary {
    margin-bottom: 12px;
}

/* Pill colors */
.ws-pill-primary {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ws-primary-dark);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ws-pill-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.ws-pill-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ws-primary-dark);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ws-pill-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.ws-pill-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #7f1d1d;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .ws-hero-body {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .ws-hero-content h2 {
        font-size: 22px;
    }

    .ws-form-step {
        flex-direction: column;
        gap: 8px;
    }

    .ws-radio-grid {
        grid-template-columns: 1fr;
    }
}

.ws-inbox-name {
    font-weight: 700;
    color: var(--ws-gray-900);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ws-inbox-preview {
    color: var(--ws-gray-600);
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-unread-badge {
    background: var(--ws-wa-green);
    color: var(--ws-white);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ws-inbox-conversation {
    display: flex;
    flex-direction: column;
    background: #efeae2;
}

.ws-inbox-header {
    background: var(--ws-wa-teal);
    color: var(--ws-white);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ws-inbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-image:
        radial-gradient(circle at 25px 25px, rgba(255, 255, 255, 0.5) 2%, transparent 0%),
        radial-gradient(circle at 75px 75px, rgba(255, 255, 255, 0.4) 2%, transparent 0%);
    background-size: 100px 100px;
}

.ws-message {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.ws-message.incoming {
    background: var(--ws-white);
    align-self: flex-start;
    border-top-right-radius: 0;
}

.ws-message.outgoing {
    background: #d9fdd3;
    align-self: flex-end;
    border-top-left-radius: 0;
}

.ws-message-time {
    font-size: 10.5px;
    color: var(--ws-gray-500);
    margin-top: 4px;
    text-align: left;
}

.ws-message.outgoing .ws-message-time {
    text-align: right;
}

.ws-inbox-input {
    background: var(--ws-gray-100);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--ws-gray-200);
}

.ws-inbox-input input {
    flex: 1;
    border: none;
    background: var(--ws-white);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
}

.ws-inbox-input input:focus {
    outline: none;
}

@media (max-width: 768px) {
    .ws-inbox-layout {
        grid-template-columns: 1fr;
    }
    .ws-inbox-list.hidden-mobile {
        display: none;
    }
}

/* ===========================
   Utility Classes
   =========================== */
.ws-flex { display: flex; }
.ws-flex-between { display: flex; justify-content: space-between; align-items: center; }
.ws-flex-center { display: flex; justify-content: center; align-items: center; }
.ws-gap-2 { gap: 8px; }
.ws-gap-3 { gap: 12px; }
.ws-mb-3 { margin-bottom: 12px; }
.ws-mb-4 { margin-bottom: 16px; }
.ws-text-center { text-align: center; }
.ws-text-muted { color: var(--ws-gray-600); }
.ws-fw-700 { font-weight: 700; }
.ws-fs-12 { font-size: 12px; }
.ws-fs-13 { font-size: 13px; }

/* ===========================
   Tabs (Test-Send Page)
   =========================== */
.ws-tabs-wrapper {
    background: var(--ws-white);
    border-radius: var(--ws-radius);
    padding: 8px;
    box-shadow: var(--ws-shadow);
    border: 1px solid var(--ws-gray-200);
}

.ws-tabs {
    display: flex;
    gap: 8px;
    position: relative;
}

.ws-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--ws-radius);
    color: var(--ws-gray-600);
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    transition: var(--ws-transition);
    position: relative;
    overflow: hidden;
}

.ws-tab i {
    font-size: 18px;
}

.ws-tab:hover:not(.disabled):not(.active) {
    background: var(--ws-gray-100);
    color: var(--ws-primary-dark);
}

.ws-tab.active {
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-primary-dark) 100%);
    color: var(--ws-white);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.ws-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ws-tab-check {
    color: var(--ws-success);
    font-size: 16px;
}

.ws-tab.active .ws-tab-check {
    color: var(--ws-white);
}

.ws-tab-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ws-primary);
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
}

.ws-tab.active .ws-tab-pulse {
    background: var(--ws-white);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ===========================
   Chat Interface
   =========================== */
.ws-chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 280px);
    min-height: 500px;
}

.ws-chat-card .ws-card-header {
    flex-shrink: 0;
}

.ws-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background:
        linear-gradient(rgba(243, 244, 246, 0.5), rgba(243, 244, 246, 0.5)),
        repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(16, 185, 129, 0.02) 20px, rgba(16, 185, 129, 0.02) 40px);
    scroll-behavior: smooth;
}

.ws-chat-thread::-webkit-scrollbar {
    width: 6px;
}

.ws-chat-thread::-webkit-scrollbar-track {
    background: transparent;
}

.ws-chat-thread::-webkit-scrollbar-thumb {
    background: var(--ws-gray-300);
    border-radius: 3px;
}

.ws-chat-thread::-webkit-scrollbar-thumb:hover {
    background: var(--ws-gray-400);
}

.ws-chat-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ws-gray-500);
}

.ws-chat-date-sep {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.ws-chat-date-sep::before,
.ws-chat-date-sep::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--ws-gray-300);
}

.ws-chat-date-sep::before {
    right: 0;
}

.ws-chat-date-sep::after {
    left: 0;
}

.ws-chat-date-sep span {
    background: var(--ws-white);
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--ws-gray-600);
    font-weight: 600;
    box-shadow: var(--ws-shadow-sm);
    border: 1px solid var(--ws-gray-200);
}

.ws-msg {
    display: flex;
    margin-bottom: 12px;
    animation: msgSlideIn 0.3s ease-out;
}

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

.ws-msg-out {
    justify-content: flex-end;
}

.ws-msg-in {
    justify-content: flex-start;
    flex-direction: row;
}

.ws-msg-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 14px;
    position: relative;
    box-shadow: var(--ws-shadow-sm);
    word-wrap: break-word;
}

.ws-msg-out .ws-msg-bubble {
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-primary-dark) 100%);
    color: var(--ws-white);
    border-bottom-right-radius: 4px;
}

.ws-msg-in .ws-msg-bubble {
    background: var(--ws-white);
    color: var(--ws-gray-800);
    border: 1px solid var(--ws-gray-200);
    border-bottom-left-radius: 4px;
}

.ws-msg-text {
    font-size: 14.5px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.ws-msg-template {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    opacity: 0.95;
}

.ws-msg-template i {
    font-size: 18px;
}

.ws-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.85;
}

.ws-msg-time {
    font-family: 'Poppins', sans-serif;
}

.ws-msg-status {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
}

.ws-msg-reply-btn {
    background: var(--ws-primary-50);
    color: var(--ws-primary-dark);
    border: none;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 6px;
    margin-right: 6px;
    transition: var(--ws-transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ws-msg-reply-btn:hover {
    background: var(--ws-primary);
    color: var(--ws-white);
}

.ws-msg-in {
    flex-wrap: wrap;
}

/* Reply Form */
.ws-chat-reply {
    border-top: 2px solid var(--ws-primary-100);
    background: var(--ws-gray-50);
    padding: 16px 20px;
    animation: slideUp 0.3s ease-out;
}

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

.ws-reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--ws-primary-dark);
    font-weight: 600;
}

.ws-reply-header i {
    margin-left: 6px;
}

.ws-btn-close {
    background: transparent;
    border: none;
    color: var(--ws-gray-500);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ws-transition);
}

.ws-btn-close:hover {
    background: var(--ws-danger);
    color: var(--ws-white);
}

.ws-reply-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.ws-reply-input-row .ws-input {
    flex: 1;
    resize: none;
    border-radius: 10px;
    border: 1.5px solid var(--ws-gray-300);
    padding: 10px 14px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    transition: var(--ws-transition);
}

.ws-reply-input-row .ws-input:focus {
    border-color: var(--ws-primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    outline: none;
}

.ws-reply-input-row .btn {
    border-radius: 10px;
    padding: 0 20px;
    white-space: nowrap;
    font-weight: 600;
}

#liveIndicator {
    transition: opacity 0.3s ease;
    opacity: 0.6;
}

/* Spinner */
.ws-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--ws-white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 991.98px) {
    .ws-chat-card {
        height: auto;
        min-height: 400px;
    }
    .ws-chat-thread {
        min-height: 300px;
        max-height: 400px;
    }
    .ws-tab span {
        font-size: 13px;
    }
}

@media (max-width: 575.98px) {
    .ws-tabs {
        flex-direction: column;
    }
    .ws-tab {
        padding: 12px 16px;
    }
    .ws-msg-bubble {
        max-width: 85%;
    }
    .ws-reply-input-row {
        flex-direction: column;
    }
    .ws-reply-input-row .btn {
        padding: 10px 20px;
    }
}