/*
 * ═══════════════════════════════════════════════════════════════
 * WhatsAPI — App Styles v2.0 (Mobile-First)
 * All components, layout, animations — uses theme.css variables
 * ═══════════════════════════════════════════════════════════════
 */

/* ══════════════════════════════════
   §1 — RESET & BASE
   ══════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-color);
    font-size: var(--font-size-lg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--text-link); transition: color var(--transition-fast); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-family); }
button:active { transform: scale(0.95); }
input, select, textarea { font-family: var(--font-family); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }


/* ══════════════════════════════════
   §2 — ANIMATIONS
   ══════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }  /* none بدل translateY(0) — يمنع stacking context */
}
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes bounceIn { 0% { opacity:0; transform:scale(0.3); } 50% { opacity:1; transform:scale(1.05); } 70% { transform:scale(0.95); } 100% { transform:scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes ticker { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(-100%,0,0); } }
@keyframes radarScan { 0% { top: 0%; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes pulseGreen { 0% { box-shadow: 0 0 0 0 rgba(0,173,106,0.4); } 70% { box-shadow: 0 0 0 10px rgba(0,173,106,0); } 100% { box-shadow: 0 0 0 0 rgba(0,173,106,0); } }
@keyframes dotPulse { 0%,80%,100% { transform:scale(0); } 40% { transform:scale(1); } }
@keyframes slideShine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.animate-fadeIn { animation: fadeIn var(--transition-base) both; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease both; }
.animate-fadeInDown { animation: fadeInDown 0.4s ease both; }
.animate-fadeInRight { animation: fadeInRight 0.5s ease both; }
.animate-bounceIn { animation: bounceIn 0.6s both; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.pulse-primary { animation: pulseGreen 2s infinite; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Stagger children */
.stagger > * { animation: fadeInUp 0.5s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* Page enter */
.page-enter { animation: fadeInUp 0.4s ease both; }


/* ══════════════════════════════════
   §3 — TOPBAR / OPTIONS STRIP
   ══════════════════════════════════ */
.topbar {
    height: var(--topbar-h);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    box-shadow: var(--shadow-xs);
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform var(--transition-fast);
}
.topbar-brand:active { transform: scale(0.95); }
.topbar-brand-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-lg);
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-white);
    box-shadow: var(--primary-shadow);
    animation: pulseGreen 2s infinite;
}
.topbar-brand-icon i { width: 24px; height: 24px; }
.topbar-brand-name { font-size: var(--font-size-lg); font-weight: 900; line-height: 1; color: var(--text-heading); }
.topbar-brand-status { font-size: var(--font-size-sm); color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* Icon circle buttons */
.icon-circle-btn {
    width: 42px; height: 42px;
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    border: none;
    color: var(--text-color);
    transition: all var(--transition-fast);
}
.icon-circle-btn:hover { background: var(--bg-hover-strong); color: var(--primary); }
.icon-circle-btn i { width: 20px; height: 20px; }
.icon-circle-btn .notif-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-card);
}


/* ══════════════════════════════════
   §4 — STATUS BAR
   ══════════════════════════════════ */
.status-bar {
    background: var(--primary);
    color: var(--text-white);
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 4px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.5px;
}
.status-bar-left { display: flex; align-items: center; gap: 8px; }
.status-bar-right { display: flex; gap: 12px; }
.status-dot {
    width: 6px; height: 6px;
    background: var(--text-white);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}


/* ══════════════════════════════════
   §5 — TICKER (شريط الرسائل المتحرك)
   ══════════════════════════════════ */
.ticker-wrap {
    background: var(--bg-ticker);
    border-radius: var(--radius-xl);
    padding: 10px 0;
    margin: 15px 20px;
    border: 1px dashed rgba(0, 173, 106, 0.2);
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.ticker-content {
    display: inline-block;
    animation: ticker 20s linear infinite;
    padding-right: 100%;
}
.ticker-item {
    display: inline;
    margin: 0 16px;
    font-size: var(--font-size-base);
    font-weight: 700;
}
.ticker-item.green { color: var(--primary); }
.ticker-item.blue { color: var(--info); }
.ticker-item.orange { color: var(--warning); }


/* ══════════════════════════════════
   §6 — ALERT BANNER (تحديثات)
   ══════════════════════════════════ */
.alert-banner {
    background: rgba(0, 173, 106, 0.06);
    border: 1px solid rgba(0, 173, 106, 0.15);
    border-radius: var(--radius-xl);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 20px 16px;
}
.alert-banner-body { display: flex; align-items: center; gap: 12px; }
.alert-banner-icon {
    width: 32px; height: 32px;
    background: rgba(0, 173, 106, 0.1);
    color: var(--primary);
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.alert-banner-icon i { width: 16px; height: 16px; }
.alert-banner-text { font-size: var(--font-size-base); font-weight: 700; color: var(--primary-dark); }
.alert-banner-action {
    font-size: var(--font-size-sm); font-weight: 900;
    color: var(--primary); text-decoration: underline;
    background: none; border: none; white-space: nowrap;
}


/* ══════════════════════════════════
   §7 — WELCOME SECTION
   ══════════════════════════════════ */
.welcome-section { padding: 0 20px; margin-bottom: 8px; }
.welcome-title { font-size: var(--font-size-3xl); font-weight: 900; color: var(--text-heading); }
.welcome-title .accent { color: var(--primary); }
.welcome-subtitle { font-size: var(--font-size-base); color: var(--text-muted); font-weight: 700; }


/* ══════════════════════════════════
   §8 — CARDS CAROUSEL (كروت التمرير)
   ══════════════════════════════════ */
.cards-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding: 10px 20px 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.cards-carousel::-webkit-scrollbar { display: none; }

.scroll-card {
    min-width: 280px;
    height: 160px;
    border-radius: var(--radius-2xl);
    padding: 24px;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-scroll-card);
    transition: transform 0.3s ease;
    color: var(--text-white);
    flex-shrink: 0;
}
.scroll-card:active { transform: scale(0.97); }
.scroll-card-label { font-size: var(--font-size-md); opacity: 0.8; font-weight: 700; }
.scroll-card-value { font-size: var(--font-size-4xl); font-weight: 900; margin-top: 4px; }
.scroll-card-value .unit { font-size: var(--font-size-lg); font-weight: 400; opacity: 0.7; }
.scroll-card-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--font-size-sm);
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    width: fit-content;
}
.scroll-card-badge i { width: 12px; height: 12px; }

/* Background decorations */
.scroll-card .bg-circle {
    position: absolute; right: -20px; bottom: -20px;
    width: 100px; height: 100px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    pointer-events: none;
}
.scroll-card .bg-icon {
    position: absolute; right: 16px; top: 16px;
    opacity: 0.2;
}
.scroll-card .bg-icon i { width: 32px; height: 32px; }

/* Glass effect for status inside card */
.glass-bar {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.glass-bar-label { font-size: var(--font-size-xs); font-weight: 700; }
.glass-bar-bars { display: flex; gap: 3px; }
.glass-bar-bars span {
    width: 3px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.4);
}

/* Color variants */
.scroll-card.card-green { background: var(--card-green); }
.scroll-card.card-blue { background: linear-gradient(135deg, var(--card-blue-from), var(--card-blue-to)); }
.scroll-card.card-dark { background: var(--card-dark); }
.scroll-card.card-orange { background: var(--card-orange); }


/* ══════════════════════════════════
   §9 — QUICK ACTION BUTTONS (أزرار سريعة)
   ══════════════════════════════════ */
.quick-actions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 24px 24px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.quick-actions::-webkit-scrollbar { display: none; }
.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    font-size: var(--font-size-sm);
    font-weight: 700;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-color);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
}
.quick-action-btn i { width: 16px; height: 16px; }
.quick-action-btn:hover { border-color: var(--primary); color: var(--primary); }
.quick-action-primary {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
    box-shadow: var(--primary-shadow);
}
.quick-action-primary:hover { background: var(--primary-hover); }


/* ══════════════════════════════════
   §10 — CARDS (عامة)
   ══════════════════════════════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-3xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
    transition: all var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h6,
.card-header .card-title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-heading);
}
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); }

.oppo-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}

/* Section heading */
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 24px;
}
.section-title {
    font-size: var(--font-size-lg);
    font-weight: 900;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title .bar {
    width: 6px; height: 16px;
    background: var(--primary);
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}
.section-title .bar.blue { background: #3b82f6; }
.section-title .bar.purple { background: var(--purple); }
.section-label {
    font-size: var(--font-size-sm);
    font-weight: 900;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.section-action {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: none;
}


/* ══════════════════════════════════
   §11 — STAT CARDS (كروت الإحصائيات)
   ══════════════════════════════════ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 0 24px;
}
.stat-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ── Page Action Bar ── */
.page-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    margin-bottom: 8px;
}

/* ── Settings Page ── */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-card);
}
.settings-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.settings-section-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.settings-section-icon.green  { background: var(--success-light); color: var(--success); }
.settings-section-icon.orange { background: var(--warning-light); color: var(--warning); }
.settings-section-icon.purple { background: var(--purple-light);  color: var(--purple); }
.settings-section-icon.blue   { background: var(--info-light);    color: var(--info); }
.settings-section-icon.red    { background: var(--danger-light);  color: var(--danger); }
.settings-section-icon.primary { background: var(--primary-light); color: var(--primary); }
.settings-section-icon.warning { background: var(--warning-light); color: var(--warning); }
.settings-section-title {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--text-heading);
    margin: 0;
}
.settings-section-desc {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 2px 0 0;
}
.settings-form .form-group { margin-bottom: 14px; }
.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.settings-option:last-child { border-bottom: none; }
.settings-option-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-option-label {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-heading);
    display: block;
}
.settings-option-value {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}
.settings-toggle-group {
    display: flex;
    gap: 6px;
}
.settings-lang-btn {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-color);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.settings-lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.settings-lang-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.settings-plan-card {
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    color: #fff;
}
.settings-plan-name {
    font-size: var(--font-size-lg);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.settings-plan-price {
    font-size: var(--font-size-xl);
    font-weight: 900;
}
.settings-plan-price small {
    font-size: var(--font-size-xs);
    font-weight: 400;
    opacity: 0.7;
}

/* ── Toggle Switch ── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-color);
    border-radius: var(--radius-pill);
    transition: var(--transition-base);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    right: 3px; bottom: 3px;
    background: #fff;
    border-radius: var(--radius-full);
    transition: var(--transition-base);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(-20px); }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 50px; height: 50px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    transition: transform var(--transition-base);
    flex-shrink: 0;
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(5deg); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.purple { background: var(--purple-light);  color: var(--purple); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.blue   { background: var(--info-light);    color: var(--info); }
.stat-icon.red    { background: var(--danger-light);   color: var(--danger); }
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-info { text-align: center; }
.stat-info h3 { margin: 0; font-size: var(--font-size-3xl); font-weight: 900; color: var(--text-heading); line-height: 1.1; }
.stat-info p  { margin: 4px 0 0; font-size: var(--font-size-sm); color: var(--text-muted); font-weight: 600; }


/* ══════════════════════════════════
   §12 — CHANNELS / PROGRESS BARS
   ══════════════════════════════════ */
.channels-card { padding: 20px; }
.channel-item { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.channel-item:last-child { margin-bottom: 0; }
.channel-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.channel-icon i { width: 16px; height: 16px; }
.channel-icon.green { background: var(--success-light); color: var(--success); }
.channel-icon.blue { background: var(--info-light); color: #3b82f6; }
.channel-body { flex: 1; }
.channel-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.channel-name { font-size: var(--font-size-sm); font-weight: 700; color: var(--text-heading); }
.channel-pct { font-size: var(--font-size-sm); font-weight: 700; }
.channel-bar-track {
    width: 100%;
    height: 4px;
    background: var(--bg-muted);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}
.channel-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 0.8s ease;
}
.channel-bar-fill.green { background: var(--success); }
.channel-bar-fill.blue { background: #3b82f6; }
/* Shine animation */
.progress-glow { position: relative; overflow: hidden; }
.progress-glow::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: slideShine 2s infinite;
}


/* ══════════════════════════════════
   §13 — SERVICES GRID (شبكة الخدمات)
   ══════════════════════════════════ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 24px;
    margin-bottom: 32px;
}
.services-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.services-icon {
    width: 100%; aspect-ratio: 1;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}
.services-icon:active { transform: scale(0.9); }
.services-icon i { width: 24px; height: 24px; }
.services-icon.green  { color: var(--primary); }
.services-icon.blue   { color: #3b82f6; }
.services-icon.purple { color: var(--purple); }
.services-icon.orange { color: var(--warning); }
.services-icon.red    { color: var(--danger); }
.services-label { font-size: var(--font-size-xs); font-weight: 900; color: var(--text-color); text-align: center; }

/* Large services grid (4 cols with bigger icons) */
.services-grid-lg .services-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius-md);
}


/* ══════════════════════════════════
   §14 — TIMELINE (السجل المباشر)
   ══════════════════════════════════ */
.timeline-card { padding: 24px; }
.timeline-list { position: relative; }
.timeline-line {
    position: absolute;
    right: 17px; top: 8px; bottom: 8px;
    width: 1px;
    background: var(--border-color);
}
.timeline-item { position: relative; padding-right: 48px; margin-bottom: 32px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot-wrap {
    position: absolute; right: 0; top: 0;
    width: 36px; height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    box-shadow: var(--shadow-xs);
}
.timeline-dot {
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}
.timeline-dot-wrap i { width: 16px; height: 16px; }
.timeline-header { display: flex; justify-content: space-between; align-items: flex-start; }
.timeline-title { font-size: var(--font-size-base); font-weight: 900; color: var(--text-heading); }
.timeline-time { font-size: var(--font-size-2xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.timeline-desc { font-size: var(--font-size-sm); color: var(--text-muted); margin-top: 4px; line-height: 1.6; }


/* ══════════════════════════════════
   §15 — CIRCLE PROGRESS (الدوائر)
   ══════════════════════════════════ */
.circle-stats { display: flex; justify-content: space-around; align-items: center; padding: 24px; }
.circle-stat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.circle-progress {
    position: relative;
    width: 60px; height: 60px;
}
.circle-progress svg { transform: rotate(-90deg); }
.circle-progress circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.circle-progress .bg-circle { stroke: var(--bg-muted); }
.circle-progress .bar-circle { stroke: var(--primary); transition: stroke-dashoffset 1s ease-out; }
.circle-progress .bar-circle.blue { stroke: #3b82f6; }
.circle-progress .bar-circle.orange { stroke: var(--warning); }
.circle-progress-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--font-size-sm); font-weight: 900; color: var(--text-heading);
}
.circle-stat-text { font-size: var(--font-size-xs); font-weight: 700; color: var(--text-muted); }


/* ══════════════════════════════════
   §16 — CHAT ITEMS (محادثات)
   ══════════════════════════════════ */
.chat-list { overflow: hidden; }
.chat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.chat-item:last-child { border-bottom: none; }
.chat-item:active { background: var(--bg-hover); }
.chat-avatar-wrap { position: relative; flex-shrink: 0; }
.chat-avatar {
    width: 48px; height: 48px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary-light);
    object-fit: cover;
}
.chat-avatar-online {
    position: absolute; bottom: 0; right: 0;
    width: 12px; height: 12px;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    border-radius: var(--radius-full);
}
.chat-body { flex: 1; min-width: 0; }
.chat-name-row { display: flex; justify-content: space-between; align-items: center; }
.chat-name { font-size: var(--font-size-md); font-weight: 900; color: var(--text-heading); }
.chat-time { font-size: var(--font-size-xs); color: var(--text-muted); font-weight: 700; }
.chat-preview-row { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.chat-preview { font-size: var(--font-size-sm); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.chat-unread {
    width: 18px; height: 18px;
    background: var(--primary);
    color: var(--text-white);
    font-size: var(--font-size-2xs);
    font-weight: 900;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.chat-read-icon { color: #3b82f6; display: flex; align-items: center; gap: 4px; }
.chat-read-icon i { width: 12px; height: 12px; }


/* ══════════════════════════════════
   §17 — INVOICE CARDS (فواتير)
   ══════════════════════════════════ */
.invoice-card {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-3xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
    cursor: pointer;
    margin-bottom: 12px;
}
.invoice-card:active { transform: scale(0.98); }
.invoice-card:hover { box-shadow: var(--shadow-sm); }
.invoice-card.pending { border-color: rgba(255, 159, 67, 0.3); }
.invoice-card.pending .notif-dot-abs { display: block; }
.invoice-card.cancelled { background: rgba(0,0,0,0.01); opacity: 0.75; border-style: dashed; }
.invoice-row { display: flex; justify-content: space-between; align-items: flex-start; }
.invoice-left { display: flex; gap: 16px; }
.invoice-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.invoice-icon i { width: 24px; height: 24px; }
.invoice-icon.green { background: var(--success-light); color: var(--primary); }
.invoice-icon.orange { background: var(--warning-light); color: var(--warning); }
.invoice-icon.gray { background: var(--bg-muted); color: var(--text-muted); }
.invoice-title { font-size: var(--font-size-base); font-weight: 900; color: var(--text-heading); }
.invoice-title.cancelled { text-decoration: line-through; color: var(--text-muted); }
.invoice-ref { font-size: var(--font-size-xs); color: var(--text-muted); font-weight: 700; margin-top: 4px; }
.invoice-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.invoice-badge {
    font-size: var(--font-size-2xs);
    font-weight: 900;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.invoice-badge.paid { background: var(--success-light); color: var(--primary); }
.invoice-badge.pending { background: var(--warning-light); color: var(--warning); }
.invoice-badge.cancelled { background: var(--bg-muted); color: var(--text-muted); }
.invoice-sep { color: var(--border-color); font-size: var(--font-size-2xs); }
.invoice-date { font-size: var(--font-size-2xs); color: var(--text-muted); font-weight: 700; }
.invoice-amount { font-size: var(--font-size-md); font-weight: 900; color: var(--text-heading); }
.invoice-amount.warning { color: var(--warning); }


/* ══════════════════════════════════
   §18 — SENDING STATUS (حالة الإرسال)
   ══════════════════════════════════ */
.sending-item {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 12px;
    border-right: 4px solid transparent;
}
.sending-item:active { transform: scale(0.95); }
.sending-item.pending { border-right-color: var(--warning); }
.sending-item.failed { border-right-color: var(--danger); background: rgba(234, 84, 85, 0.03); }
.sending-item.success { border-right-color: var(--success); }
.sending-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sending-icon i { width: 20px; height: 20px; }
.sending-icon.pending { background: var(--warning-light); color: var(--warning); }
.sending-icon.failed { background: var(--danger-light); color: var(--danger); }
.sending-icon.success { background: var(--success-light); color: var(--success); }
.sending-body { flex: 1; }
.sending-header { display: flex; justify-content: space-between; }
.sending-title { font-size: var(--font-size-base); font-weight: 900; color: var(--text-heading); }
.sending-status-text { font-size: var(--font-size-xs); font-weight: 900; font-style: italic; }
.sending-progress { margin-top: 8px; }


/* ══════════════════════════════════
   §19 — IMAGE / MEDIA CARDS
   ══════════════════════════════════ */
.media-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 0 24px 16px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.media-carousel::-webkit-scrollbar { display: none; }
.media-card {
    min-width: 200px; height: 240px;
    border-radius: var(--radius-2xl);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.media-card::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.media-card-body {
    position: absolute; bottom: 16px; left: 16px; right: 16px;
    z-index: 2;
}
.media-card-tag {
    font-size: var(--font-size-2xs);
    font-weight: 700;
    color: var(--text-white);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    display: inline-block;
}
.media-card-tag.green { background: var(--primary); }
.media-card-tag.blue { background: #3b82f6; }
.media-card-title {
    color: var(--text-white);
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-top: 4px;
}


/* ══════════════════════════════════
   §20 — ACTIVITY LOG (نشاطات)
   ══════════════════════════════════ */
.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.activity-icon i { width: 20px; height: 20px; }
.activity-body { flex: 1; }
.activity-text { font-size: var(--font-size-lg); font-weight: 700; color: var(--text-heading); }
.activity-sub { font-size: var(--font-size-sm); color: var(--text-muted); }
.activity-time { font-size: var(--font-size-sm); color: var(--text-muted); white-space: nowrap; }


/* ══════════════════════════════════
   §21 — PROGRESS BARS (حدود الباقة)
   ══════════════════════════════════ */
.limit-bar { margin-bottom: 14px; }
.limit-label { display: flex; justify-content: space-between; font-size: var(--font-size-md); margin-bottom: 6px; }
.limit-label span:first-child { color: var(--text-color); font-weight: 600; }
.limit-label span:last-child { color: var(--text-muted); }
.progress { height: 6px; background: var(--bg-muted); border-radius: var(--radius-pill); overflow: hidden; }
.progress-bar { border-radius: var(--radius-pill); transition: width 0.8s ease; background: var(--primary); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.warning { background: var(--warning); }


/* ══════════════════════════════════
   §22 — BUTTONS
   ══════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: var(--radius-md);
    padding: 10px 20px;
    font-family: var(--font-family); font-weight: 700;
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary-gradient); color: var(--text-white); box-shadow: var(--primary-shadow); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); color: var(--text-white); }
.btn-success { background: var(--success-light); color: var(--success); }
.btn-success:hover { background: var(--success); color: var(--text-white); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--text-white); }
.btn-warning { background: var(--warning-light); color: var(--warning); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-color); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: none; border: none; color: var(--text-muted); padding: 8px; }
.btn-ghost:hover { color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: var(--font-size-md); }
.btn-lg { padding: 14px 32px; font-size: var(--font-size-xl); }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--radius-pill); }
.btn-icon {
    width: 40px; height: 40px; padding: 0;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    border: none; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--primary); color: var(--text-white); }


/* ══════════════════════════════════
   §23 — FORMS
   ══════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; color: var(--text-color); font-size: var(--font-size-lg); font-weight: 600; margin-bottom: 6px; }
.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-heading);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    transition: all var(--transition-fast);
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    outline: none;
}
.form-control::placeholder { color: var(--text-placeholder); }
.input-group { position: relative; }
.input-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; z-index: 3;
    transition: color var(--transition-fast);
}
.input-icon i { width: 20px; height: 20px; }
.input-group .form-control { padding-left: 42px; }
.input-group:focus-within .input-icon { color: var(--primary); }
.toggle-pw {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer; z-index: 3;
}


/* ══════════════════════════════════
   §24 — BADGES
   ══════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-md); font-weight: 700;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: var(--bg-muted); color: var(--text-muted); }

/* Ping dot */
.ping-dot { position: relative; display: inline-flex; width: 8px; height: 8px; }
.ping-dot .ping-ring {
    position: absolute; inset: 0;
    border-radius: var(--radius-full);
    background: var(--primary);
    opacity: 0.75;
    animation: pulse 2s infinite;
}
.ping-dot .ping-core {
    position: relative;
    width: 8px; height: 8px;
    border-radius: var(--radius-full);
    background: var(--primary);
}


/* ══════════════════════════════════
   §25 — ALERTS
   ══════════════════════════════════ */
.alert {
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: var(--font-size-lg);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInDown 0.3s ease;
}
.alert-success { background: var(--success-light); color: var(--success); }
.alert-danger  { background: var(--danger-light);  color: var(--danger); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-info    { background: var(--info-light);    color: var(--info); }


/* ══════════════════════════════════
   §26 — TABLES
   ══════════════════════════════════ */
.table { width: 100%; color: var(--text-color); border-collapse: collapse; }
.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: var(--font-size-md);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: right;
}
.table td { border-bottom: 1px solid var(--border-color); padding: 12px 16px; vertical-align: middle; }
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--bg-hover); }


/* ══════════════════════════════════
   §27 — MODALS
   ══════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: var(--bg-modal-overlay);
    z-index: var(--z-modal);
    contain: strict;  /* isolate stacking context — يجبر المودال يكون independent layer */
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(4px);
    /* padding top = safe area above modal */
    padding: 60px 16px 40px;
}
.modal-overlay.show { display: flex; }
.modal-overlay.show .modal-box { animation: scaleIn 0.3s ease; }
.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 32px;
    width: 90%; max-width: 480px;
    /* let content define height — overlay scrolls */
    height: fit-content;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}
.modal-title {
    font-size: var(--font-size-xl); font-weight: 900;
    color: var(--text-heading); margin-bottom: 24px;
    display: flex; align-items: center; gap: 8px;
}
.modal-close {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    margin-right: auto;
    transition: all var(--transition-fast);
}
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }


/* ══════════════════════════════════
   §28 — BOTTOM SHEET (شاشة من تحت)
   ══════════════════════════════════ */
.bottom-sheet-overlay {
    position: fixed; inset: 0;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    contain: strict;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.bottom-sheet-overlay.show { display: flex; }
.bottom-sheet-body {
    background: var(--bg-card);
    width: 100%; max-width: 480px;
    border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.bottom-sheet-overlay.show .bottom-sheet-body { transform: translateY(0); }
.bottom-sheet-handle {
    width: 48px; height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-pill);
    margin: 0 auto 24px;
}


/* ══════════════════════════════════
   §29 — SPINNER / LOADING
   ══════════════════════════════════ */
.spinner {
    display: inline-block; width: 22px; height: 22px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.loading-dots { display: inline-flex; gap: 4px; }
.loading-dots span {
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: var(--radius-full);
    animation: dotPulse 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }


/* ══════════════════════════════════
   §30 — EMPTY STATE
   ══════════════════════════════════ */
.empty-state { text-align: center; padding: 48px 16px; animation: fadeIn 0.5s ease; }
.empty-state i { font-size: 3.5rem; color: var(--border-color); display: block; margin: 0 auto 12px; animation: float 3s ease-in-out infinite; width: 56px; height: 56px; }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; font-size: var(--font-size-xl); }


/* ══════════════════════════════════
   §31 — LANGUAGE SWITCH
   ══════════════════════════════════ */
.lang-switch {
    display: flex; align-items: center;
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.lang-switch a {
    padding: 4px 10px;
    font-size: var(--font-size-md);
    color: var(--text-muted);
    font-weight: 700;
    transition: all var(--transition-fast);
}
.lang-switch a.active { background: var(--primary); color: var(--text-white); }
.lang-switch a:hover:not(.active) { color: var(--text-heading); }


/* ══════════════════════════════════
   §32 — THEME TOGGLE
   ══════════════════════════════════ */
.theme-toggle i { transition: transform var(--transition-base); }
.theme-toggle:hover i { transform: rotate(30deg); }


/* ══════════════════════════════════
   §33 — FORM CHECK (Checkbox/Radio)
   ══════════════════════════════════ */
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.form-check-label { color: var(--text-muted); font-size: var(--font-size-md); cursor: pointer; }


/* ══════════════════════════════════
   §34 — TOAST NOTIFICATIONS
   ══════════════════════════════════ */
.toast-container {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex; flex-direction: column;
    gap: 8px; pointer-events: none;
}
.toast {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    animation: fadeInDown 0.3s ease;
    pointer-events: all;
    border: 1px solid var(--border-color);
    min-width: 280px;
}
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-text { font-size: var(--font-size-md); font-weight: 700; color: var(--text-heading); }
.toast.success .toast-icon { color: var(--success); }
.toast.danger .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }


/* ══════════════════════════════════
   §35 — SIDEBAR (Desktop)
   ══════════════════════════════════ */
.sidebar {
    position: fixed; top: 0; right: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    display: flex; flex-direction: column;
    z-index: var(--z-sidebar);
    transition: transform var(--transition-bounce);
    border-left: 1px solid rgba(255,255,255,0.05);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand-icon {
    width: 36px; height: 36px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-white);
    transition: transform var(--transition-base);
}
.sidebar-brand-icon i { width: 20px; height: 20px; }
.sidebar-brand:hover .sidebar-brand-icon { transform: rotate(10deg) scale(1.1); }
.sidebar-brand-text { font-size: 1.25rem; font-weight: 900; color: var(--text-sidebar-heading); }

/* Sidebar nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section {
    padding: 12px 24px 6px;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    color: var(--text-sidebar-section);
    letter-spacing: 1.5px;
    font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 24px;
    color: var(--text-sidebar);
    font-size: var(--font-size-lg);
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
    cursor: pointer;
}
.nav-item i { width: 22px; height: 22px; transition: transform var(--transition-fast); flex-shrink: 0; }
.nav-item:hover { color: var(--text-white); background: rgba(255,255,255,0.04); }
.nav-item:hover i { transform: translateX(-2px); }
.nav-item.active {
    color: var(--text-white);
    background: var(--primary-gradient);
    margin: 2px 12px;
    border-radius: var(--radius-md);
    padding-right: 12px;
    box-shadow: var(--primary-shadow);
}
.nav-item.active i { transform: none; }
.nav-item .nav-badge {
    margin-right: auto;
    font-size: var(--font-size-2xs);
    background: var(--danger);
    color: var(--text-white);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-weight: 900;
}

/* Sidebar footer */
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-avatar-sidebar {
    width: 38px; height: 38px; border-radius: var(--radius-full);
    background: var(--primary-gradient);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-white); font-weight: 700;
    transition: transform var(--transition-fast);
}
.user-avatar-sidebar:hover { transform: scale(1.1); }
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: var(--font-size-md); font-weight: 700; color: var(--text-sidebar-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .plan { font-size: var(--font-size-xs); color: var(--text-sidebar-section); }
.user-logout { color: var(--text-sidebar); font-size: 1.1rem; background: none; border: none; transition: color var(--transition-fast); }
.user-logout:hover { color: var(--danger); }


/* ══════════════════════════════════
   §36 — OFFCANVAS MENU (Mobile)
   ══════════════════════════════════ */
.offcanvas-overlay {
    display: none;
    position: fixed; inset: 0;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(4px);
    z-index: var(--z-overlay);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.offcanvas-overlay.show { display: block; opacity: 1; }
.offcanvas-menu {
    position: fixed;
    right: -100%; top: 0;
    width: 85%; max-width: 380px;
    height: 100%;
    background: var(--bg-offcanvas);
    z-index: var(--z-offcanvas);
    transition: right var(--transition-bounce);
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    display: flex; flex-direction: column;
    padding: 24px;
    gap: 24px;
    overflow-y: auto;
}
.offcanvas-menu.open { right: 0; }

/* Offcanvas items animate in */
.side-item {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.offcanvas-menu.open .side-item { opacity: 1; transform: translateX(0); }
.offcanvas-menu.open .side-item.trans-delay-1 { transition-delay: 0.15s; }
.offcanvas-menu.open .side-item.trans-delay-2 { transition-delay: 0.25s; }
.offcanvas-menu.open .side-item.trans-delay-3 { transition-delay: 0.35s; }
.offcanvas-menu.open .side-item.trans-delay-4 { transition-delay: 0.45s; }

/* Offcanvas header */
.offcanvas-header { display: flex; justify-content: space-between; align-items: center; }
.offcanvas-header-live { font-size: var(--font-size-sm); color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; animation: pulse 2s infinite; }
.offcanvas-header-title { font-size: var(--font-size-2xl); font-weight: 900; color: var(--text-heading); }
.offcanvas-close {
    width: 40px; height: 40px;
    background: var(--bg-muted);
    color: var(--text-muted);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    border: none;
    transition: all var(--transition-fast);
}
.offcanvas-close:active { background: var(--danger-light); color: var(--danger); }

/* Radar card inside offcanvas */
.radar-card {
    padding: 20px;
    background: var(--secondary);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}
.radar-line {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(to right, transparent, var(--primary), transparent);
    animation: radarScan 2s infinite linear;
}
.radar-body { position: relative; z-index: 2; display: flex; align-items: center; gap: 16px; color: var(--text-white); }
.radar-icon {
    width: 48px; height: 48px;
    background: rgba(0, 173, 106, 0.2);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0, 173, 106, 0.3);
}
.radar-icon i { width: 24px; height: 24px; color: var(--primary); }
.radar-status { font-size: var(--font-size-sm); color: var(--primary); font-weight: 700; }
.radar-text { font-size: var(--font-size-md); font-weight: 900; }

/* Offcanvas nav items */
.offcanvas-nav { display: flex; flex-direction: column; gap: 8px; }
.offcanvas-nav-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px;
    background: var(--bg-muted);
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
    color: var(--text-color);
    cursor: pointer;
}
.offcanvas-nav-item:hover,
.offcanvas-nav-item:active { background: var(--primary); color: var(--text-white); }
.offcanvas-nav-item:hover i,
.offcanvas-nav-item:active i { color: var(--text-white); }
.offcanvas-nav-left { display: flex; align-items: center; gap: 12px; }
.offcanvas-nav-left i { width: 20px; height: 20px; color: var(--text-muted); transition: all 0.3s ease; }
.offcanvas-nav-left span { font-size: var(--font-size-lg); font-weight: 700; }
.offcanvas-nav-arrow { width: 16px; height: 16px; color: var(--text-muted); transition: all 0.3s ease; }
.offcanvas-nav-item:hover .offcanvas-nav-arrow { color: var(--text-white); transform: translateX(-4px); }

/* Shield card at bottom of offcanvas */
.shield-card {
    padding: 20px;
    background: rgba(0, 173, 106, 0.06);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 173, 106, 0.15);
    margin-top: auto;
}
.shield-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.shield-card-icon {
    width: 40px; height: 40px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-xs);
}
.shield-card-icon i { width: 20px; height: 20px; color: var(--primary); }
.shield-card-badge {
    font-size: var(--font-size-sm); font-weight: 900;
    background: var(--bg-card);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}
.shield-card-title { font-size: var(--font-size-md); font-weight: 900; color: var(--text-heading); margin-bottom: 4px; }
.shield-card-desc { font-size: var(--font-size-sm); color: var(--text-muted); line-height: 1.6; }


/* ══════════════════════════════════
   §37 — BOTTOM NAVIGATION (Mobile)
   ══════════════════════════════════ */
.bottom-nav {
    display: none; /* Hidden by default, shown on mobile */
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: var(--bg-bottom-nav);
    backdrop-filter: blur(20px);
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    z-index: var(--z-bottom-nav);
    padding-bottom: 10px;
}
.bottom-nav-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 700;
    background: none; border: none;
    transition: color var(--transition-fast);
}
.bottom-nav-item i { width: 24px; height: 24px; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item:hover { color: var(--primary); }
.bottom-nav-fab {
    width: 56px; height: 56px;
    background: var(--primary);
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-white);
    box-shadow: var(--primary-shadow);
    margin-top: -24px;
    border: 5px solid var(--bg-body);
    transition: all var(--transition-fast);
}
.bottom-nav-fab i { width: 28px; height: 28px; }
.bottom-nav-fab:active { transform: scale(0.9); }


/* ══════════════════════════════════
   §38 — MAIN CONTENT AREA
   ══════════════════════════════════ */
.main-content {
    margin-right: var(--sidebar-w);
    min-height: 100vh;
    transition: margin var(--transition-base);
}
.content-body { padding: 16px 0 0; }
/* prevent sticky topbar from hiding anchor targets */
html { scroll-padding-top: calc(var(--topbar-h) + var(--status-bar-h, 28px) + 12px); }
.content-padding { padding: 0 12px; } /* 24قبل */


/* ══════════════════════════════════
   §39 — GRID HELPERS
   ══════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }


/* ══════════════════════════════════
   §40 — AUTH PAGES (Login/Register)
   ══════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-body);
    position: relative; overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.08) 0%, transparent 70%);
    top: -200px; right: -200px;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}
.auth-wrapper {
    width: 100%; max-width: 440px;
    padding: 24px;
    position: relative; z-index: 1;
}
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
    border: 1px solid var(--border-light);
}
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; }
.brand-icon {
    width: 46px; height: 46px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-white);
    box-shadow: var(--primary-shadow);
    animation: bounceIn 0.8s both 0.2s;
}
.brand-icon i { width: 24px; height: 24px; }
.brand-name { font-size: 1.75rem; font-weight: 900; color: var(--text-heading); animation: fadeInRight 0.6s both 0.3s; }
.auth-subtitle {
    text-align: center; color: var(--text-muted);
    margin-bottom: 32px; font-size: var(--font-size-xl);
}


/* ══════════════════════════════════
   §41 — SESSIONS GRID
   ══════════════════════════════════ */
.sessions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.session-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-card);
}
.session-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.session-avatar {
    width: 52px; height: 52px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition-base);
}
.session-card:hover .session-avatar { transform: scale(1.1); }
.session-avatar.online { background: var(--success-light); color: var(--success); }
.session-avatar.offline { background: var(--danger-light); color: var(--danger); }
.session-avatar.waiting { background: var(--warning-light); color: var(--warning); }
.session-details { flex: 1; min-width: 0; }
.session-name { font-size: var(--font-size-xl); font-weight: 700; color: var(--text-heading); }
.session-phone { font-size: var(--font-size-md); color: var(--text-muted); direction: ltr; text-align: right; }
.session-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* QR Modal */
.qr-image-wrap {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: inline-block;
    animation: scaleIn 0.4s ease;
}
.qr-image-wrap img { width: 250px; height: 250px; }
.qr-status { text-align: center; margin-top: 16px; font-size: var(--font-size-lg); color: var(--text-muted); }


/* ══════════════════════════════════
   §42 — UTILITIES
   ══════════════════════════════════ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info    { color: var(--info) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-heading { color: var(--text-heading) !important; }
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-900 { font-weight: 900; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-2 { margin-top: 16px; }
.mt-auto { margin-top: auto; }
.me-1 { margin-left: 6px; }
.me-2 { margin-left: 8px; }
.px-section { padding: 0 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.overflow-auto { overflow-x: auto; }
.hidden { display: none !important; }
.block { display: block; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-flex-center { display: flex; align-items: center; justify-content: center; }
.notif-dot-abs { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; background: var(--danger); border: 2px solid var(--bg-card); border-radius: var(--radius-full); display: none; }

/* Body padding when bottom nav visible */
.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + 20px); }


/* ══════════════════════════════════
   §43 — RESPONSIVE
   ══════════════════════════════════ */

/* Tablet: sidebar collapses, no bottom nav */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3 { grid-template-columns: repeat(3, 1fr);  }
}

/* Mobile: sidebar hidden, bottom nav visible, offcanvas active */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-right: 0; }
    .bottom-nav { display: flex; }
    body { padding-bottom: calc(var(--bottom-nav-h) + 20px); }

    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 8px; }
    .page-action-bar { padding: 10px 20px; }
    .sessions-grid { grid-template-columns: 1fr; }
    .topbar h4 { font-size: var(--font-size-lg); }
    .content-body { padding: 8px 0; }
    .content-padding { padding: 0 8px; }  /* 20 قبل */
    .services-grid { padding: 0 20px; gap: 12px; }
    .section-heading { padding: 0 20px; }

    .auth-card { padding: 32px 24px; }
    .auth-wrapper { padding: 16px; }
    .row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .scroll-card { min-width: 260px; height: 150px; padding: 20px; }
}


/* ════════════════════════════════════════
   §UNIFIED SIDEBAR — one element, two behaviors
   Desktop: always visible fixed sidebar
   Mobile:  hidden offcanvas drawer
   ════════════════════════════════════════ */

/* ── Desktop: sidebar always open ── */
@media (min-width: 769px) {
    .app-sidebar {
        position: fixed;
        top: 0; right: 0;
        width: var(--sidebar-w);
        height: 100vh;
        background: var(--bg-sidebar);
        display: flex !important;
        flex-direction: column;
        z-index: var(--z-sidebar);
        border-left: 1px solid rgba(255,255,255,0.05);
        overflow-y: auto;
        transform: none !important;
        /* reset any mobile transition */
        transition: none;
    }
    /* Main content pushed left of sidebar */
    .main-content {
        margin-right: var(--sidebar-w) !important;
    }
    /* Hide mobile-only elements inside sidebar on desktop */
    .app-sidebar .offcanvas-header,
    .app-sidebar .radar-card,
    .app-sidebar .shield-card,
    .app-sidebar .offcanvas-nav-arrow {
        display: none !important;
    }
    /* Show section labels on desktop */
    .app-sidebar .nav-section {
        display: block;
    }
    /* Nav inside sidebar uses sidebar style */
    .app-sidebar .offcanvas-nav {
        flex: 1;
        overflow-y: auto;
        padding: 12px 0;
        gap: 0;
    }
    .app-sidebar .offcanvas-nav-item {
        padding: 10px 20px;
        border-radius: 0;
        margin: 0;
        font-size: var(--font-size-md);
        font-weight: 600;
        gap: 10px;
    }
    /* sidebar brand on desktop */
    .app-sidebar::before {
        content: 'WhatsAPI';
        display: flex;
        align-items: center;
        padding: 20px 24px;
        font-size: 1.2rem;
        font-weight: 900;
        color: var(--text-sidebar-heading);
        border-bottom: 1px solid rgba(255,255,255,0.06);
        background: var(--bg-sidebar);
        flex-shrink: 0;
    }
    /* Hide overlay on desktop */
    .offcanvas-overlay { display: none !important; }
    /* Hide hamburger on desktop */
    .topbar-menu-btn { display: none !important; }
}

/* ── Mobile: offcanvas drawer ── */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        top: 0; right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg-offcanvas, var(--bg-sidebar));
        display: flex !important;
        flex-direction: column;
        z-index: var(--z-offcanvas);
        transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
        overflow-y: auto;
        padding: 20px 16px;
    }
    .app-sidebar.open {
        right: 0;
    }
    .main-content {
        margin-right: 0 !important;
    }
    /* Show all offcanvas elements on mobile */
    .app-sidebar .offcanvas-header,
    .app-sidebar .radar-card,
    .app-sidebar .shield-card {
        display: flex;
    }
    /* Hide desktop section labels on mobile */
    .app-sidebar .nav-section {
        display: none;
    }
    /* Overlay */
    .offcanvas-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: calc(var(--z-offcanvas) - 1);
        backdrop-filter: blur(2px);
    }
    .offcanvas-overlay.show {
        display: block;
    }
    /* Show hamburger on mobile */
    .topbar-menu-btn {
        display: flex !important;
    }
}

/* ══ Topbar actions — أقصى اليسار على الديسكتوب ══ */
@media (min-width: 769px) {
    .topbar {
        justify-content: flex-end;
    }
    .topbar-actions {
        margin-left: 0;
        margin-right: auto;
        /* push to far left */
        order: -1;
    }
}













/* ══ Sessions Page — Enhanced v2 ══ */

/* ── Search & Filter bar ── */
.sess-filter-bar {
    display:flex; align-items:center; gap:8px; padding:0 16px 14px;
    flex-wrap:wrap;
}
.sess-search {
    flex:1; min-width:180px; padding:8px 12px 8px 36px;
    border-radius:10px; border:1px solid var(--border-color);
    background:var(--bg-card); color:var(--text-heading);
    font-size:13px; outline:none; transition:.15s;
}
.sess-search:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(115,103,240,.12); }
.sess-search-wrap { position:relative; flex:1; min-width:180px; }
.sess-search-wrap svg { position:absolute; right:10px; top:50%; transform:translateY(-50%); color:var(--text-muted); width:15px;height:15px; pointer-events:none; }
.filter-pill {
    padding:6px 12px; border-radius:20px; font-size:11px; font-weight:700;
    border:1px solid var(--border-color); background:var(--bg-card);
    color:var(--text-muted); cursor:pointer; transition:.12s; white-space:nowrap;
}
.filter-pill.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.filter-pill:hover:not(.active) { border-color:var(--primary); color:var(--primary); }

/* ── Session Cards ── */
.sess-card {
    background:var(--bg-card); border-radius:16px;
    border:1.5px solid var(--border-color); overflow:hidden;
    transition:border-color .18s, box-shadow .18s; margin-bottom:10px;
    position:relative;
}
.sess-card::before {
    content:''; position:absolute; inset-inline-start:0; top:0; bottom:0;
    width:4px; border-radius:4px 0 0 4px; background:var(--text-muted);
    transition:background .18s;
}
.sess-card.connected::before { background:var(--success); }
.sess-card.connected { border-color:rgba(40,199,111,.25); }
.sess-card.qr::before { background:var(--warning); }
.sess-card.qr { border-color:rgba(255,159,67,.25); }
.sess-card.connecting::before { background:var(--info); animation:pulse-border 1s ease-in-out infinite; }
.sess-card.error::before { background:var(--danger); }
.sess-card.error { border-color:rgba(234,84,85,.25); }
.sess-card:hover { box-shadow:0 4px 18px rgba(0,0,0,.08); }

@keyframes pulse-border { 0%,100%{opacity:.4} 50%{opacity:1} }

.sess-header {
    display:flex; align-items:center; gap:12px; padding:14px 18px 14px 22px;
    cursor:pointer; user-select:none;
}
.sess-header:hover { background:rgba(0,0,0,.02); }

/* ── Status Ring ── */
.status-ring {
    width:40px; height:40px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; position:relative; transition:.2s;
}
.status-ring.on  { background:rgba(40,199,111,.12); }
.status-ring.qr  { background:rgba(255,159,67,.12); }
.status-ring.err { background:rgba(234,84,85,.10); }
.status-ring.off { background:var(--bg-muted); }
.status-ring.on::after {
    content:''; position:absolute; inset:-3px; border-radius:50%;
    border:2px solid rgba(40,199,111,.3); animation:ring-ping 2s ease-out infinite;
}
@keyframes ring-ping { 0%{opacity:1;transform:scale(1)} 100%{opacity:0;transform:scale(1.4)} }

/* ── Quick actions in header ── */
.sess-quick-btns {
    display:flex; align-items:center; gap:4px; margin-inline-end:4px;
    opacity:0; transition:opacity .15s;
}
.sess-card:hover .sess-quick-btns, .sess-card.connected .sess-quick-btns { opacity:1; }
.qbtn {
    width:28px; height:28px; border-radius:8px; border:1px solid var(--border-color);
    background:var(--bg-body); display:flex; align-items:center; justify-content:center;
    cursor:pointer; transition:.12s; color:var(--text-muted);
}
.qbtn:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.qbtn.green:hover { background:var(--success); border-color:var(--success); }
.qbtn.orange:hover { background:var(--warning); border-color:var(--warning); }
.qbtn.red:hover { background:var(--danger); border-color:var(--danger); }

/* ── Body ── */
.sess-body {
    padding:0 18px 16px 22px; border-top:1px solid var(--border-color);
}

/* ── Info strip ── */
.info-strip { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:14px; padding-top:12px; }
.info-chip {
    display:inline-flex; align-items:center; gap:4px;
    background:var(--bg-body); border-radius:20px;
    padding:4px 10px; font-size:11px; color:var(--text-muted);
    border:1px solid var(--border); white-space:nowrap;
}
.info-chip svg { flex-shrink:0; width:11px; height:11px; }
.info-chip .val { font-weight:700; color:var(--text-heading); }
.info-chip.ok   { border-color:rgba(40,199,111,.3); background:rgba(40,199,111,.06); color:var(--success); }
.info-chip.warn { border-color:rgba(255,159,67,.3); background:rgba(255,159,67,.06); color:var(--warning); }
.info-chip.err  { border-color:rgba(234,84,85,.3);  background:rgba(234,84,85,.06);  color:var(--danger); }

/* ── QR box ── */
.qr-container {
    background:var(--bg-body); border:2px dashed var(--border-color);
    border-radius:14px; padding:20px; text-align:center; margin:12px 0;
}
.qr-container img { max-width:190px; border-radius:10px; border:5px solid #fff; box-shadow:0 4px 16px rgba(0,0,0,.15); }

/* ── Test Send Panel ── */
.test-panel {
    background:var(--bg-body); border:1.5px solid var(--border-color);
    border-radius:14px; overflow:hidden; margin-bottom:12px;
}
.test-panel-header {
    padding:10px 14px;
    background:linear-gradient(135deg,rgba(0,207,232,.08) 0%,rgba(115,103,240,.06) 100%);
    border-bottom:1px solid var(--border-color);
    display:flex; align-items:center; justify-content:space-between;
}
.test-result-ok {
    background:rgba(40,199,111,.07); border:1.5px solid rgba(40,199,111,.3);
    border-radius:10px; padding:12px 14px;
}
.test-result-err {
    background:rgba(234,84,85,.06); border:1.5px solid rgba(234,84,85,.25);
    border-radius:10px; padding:12px 14px;
}

/* ── Action buttons row ── */
.sess-actions { display:flex; gap:6px; flex-wrap:wrap; }
.sess-actions .btn { font-size:12px; }

/* ── Log panel ── */
.log-panel {
    background:var(--bg-body); border:1px solid var(--border-color);
    border-radius:12px; overflow:hidden; margin-bottom:12px;
}
.log-body {
    padding:10px; max-height:200px; overflow-y:auto;
    font-size:10.5px; font-family:monospace; direction:ltr; text-align:left;
}

/* ── Spinner keyframe ── */
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Connected pulse dot ── */
.live-dot {
    width:7px; height:7px; border-radius:50%; background:var(--success);
    display:inline-block; animation:blink 2s ease-in-out infinite;
    margin-inline-end:5px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Mobile tweaks ── */
@media(max-width:640px) {
    .sess-header { padding:12px 14px 12px 18px; }
    .sess-quick-btns { opacity:1; }
    .sess-actions { gap:4px; }
    .sess-actions .btn { padding:5px 9px; }
}


