:root {
    --bg: #090d14;
    --surface: #101621;
    --surface2: #172030;
    --border: #233045;
    --border2: #344766;
    --primary: #0084ff;
    --primary-hover: #0070db;
    --primary-glow: rgba(0, 132, 255, 0.2);
    --green: #238636;
    --green-hover: #2ea043;
    --green-glow: rgba(35, 134, 54, 0.2);
    --danger: #da3633;
    --danger-bg: rgba(218, 54, 51, 0.12);
    --warning: #d29922;
    --warning-bg: rgba(210, 153, 34, 0.12);
    --text: #e6edf3;
    --text-muted: #8b949e;
    --text-sub: #6e7681;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 14px;
    --sidebar-w: 230px;
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOM BESPOKE DARK SCROLLBAR (PC & MOBILE)
   ═══════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 132, 255, 0.5);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   0. SPLASH PROGRESS SCREEN
   ═══════════════════════════════════════════════════════════════════ */
.splash-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 90%;
    max-width: 380px;
}

.splash-logo {
    width: 72px;
    height: 72px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 35px var(--primary-glow);
    margin-bottom: 20px;
    animation: pulseLogo 2s infinite ease-in-out;
}

@keyframes pulseLogo {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px var(--primary-glow); }
    50% { transform: scale(1.06); box-shadow: 0 0 50px rgba(0, 132, 255, 0.45); }
}

.splash-title {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.splash-status {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 26px;
}

.splash-progress-track {
    width: 100%;
    height: 7px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.splash-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0062cc, var(--primary), #38bdf8);
    border-radius: 20px;
    transition: width 0.15s ease;
    box-shadow: 0 0 10px var(--primary);
}

.splash-percent {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════════════
   1. LANDING PAGE
   ═══════════════════════════════════════════════════════════════════ */
.landing-view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 20%, rgba(0, 132, 255, 0.08) 0%, transparent 60%), var(--bg);
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 16px var(--primary-glow);
}

.brand-title {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

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

.btn-nav-auth {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-nav-auth:hover {
    background: var(--surface2);
    border-color: var(--border2);
}

.btn-nav-signup {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 0 14px var(--primary-glow);
}

.btn-nav-signup:hover {
    background: var(--primary-hover);
}

/* Landing Hero */
.landing-hero {
    text-align: center;
    padding: 70px 20px 50px;
    max-width: 860px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-glow);
    border: 1px solid rgba(0, 132, 255, 0.35);
    color: var(--primary);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 24px;
}

.hero-headline {
    font-size: 42px;
    font-weight: 900;
    line-height: 1.4;
    margin-bottom: 20px;
}

.hero-headline span {
    color: var(--primary);
    background: linear-gradient(90deg, #38bdf8, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtext {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 34px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 30px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 22px var(--primary-glow);
}

.btn-hero-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-hero-secondary {
    padding: 13px 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-hero-secondary:hover {
    background: var(--surface2);
    border-color: var(--border2);
}

/* Landing Features Grid */
.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    max-width: 1160px;
    margin: 40px auto 70px;
    padding: 0 24px;
    width: 100%;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: var(--border2);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.shield-icon { background: var(--primary-glow); color: var(--primary); border: 1px solid rgba(0, 132, 255, 0.3); }
.zap-icon { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(210, 153, 34, 0.3); }
.lock-icon { background: var(--green-glow); color: var(--green-hover); border: 1px solid rgba(35, 134, 54, 0.3); }
.clock-icon { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }

.feature-card h3 {
    font-size: 16.5px;
    font-weight: 800;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.7;
}

.landing-footer {
    margin-top: auto;
    padding: 24px;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-sub);
}

/* ═══════════════════════════════════════════════════════════════════
   2. DASHBOARD SHELL & TOPBAR
   ═══════════════════════════════════════════════════════════════════ */
.dashboard-view {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 18px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--primary-glow);
}

.sidebar-brand-name {
    font-size: 18px;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 0.5px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: right;
}

.nav-item:hover {
    background: var(--surface2);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: rgba(0, 132, 255, 0.3);
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
}

.bot-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-sub);
    flex-shrink: 0;
}

.bot-status-indicator.online .indicator-dot {
    background: var(--green-hover);
    box-shadow: 0 0 8px var(--green-hover);
}

.bot-status-indicator.online {
    color: var(--green-hover);
}

.main-wrapper {
    margin-right: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 58px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
}

.page-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.user-profile-btn:hover {
    border-color: var(--border2);
}

.user-avatar-mini {
    width: 26px;
    height: 26px;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.user-name-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.content-area {
    padding: 28px;
    flex: 1;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.18s ease;
}

.tab-pane.active {
    display: block;
}

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

/* ═══════════════════════════════════════════════════════════════════
   CONNECT & GROUPS TABS
   ═══════════════════════════════════════════════════════════════════ */
.connect-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: flex-start;
    max-width: 880px;
}

.qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-frame {
    width: 250px;
    height: 250px;
    background: white;
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 25px rgba(0,0,0,0.5);
}

.qr-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spin-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,0,0,0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.qr-spinner p {
    font-size: 12px;
    color: #444;
    text-align: center;
    font-weight: 700;
}

.qr-hint {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-sub);
    margin-top: 10px;
}

.connect-title {
    font-size: 21px;
    font-weight: 900;
    margin-bottom: 8px;
}

.connect-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 24px;
}

.steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.steps-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    color: var(--text);
}

/* Rich Connected Device Card */
.connected-card-container {
    width: 100%;
    animation: fadeInScale 0.3s ease;
}

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

.device-profile-card {
    background: linear-gradient(145deg, #0d111a, #131926);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.device-profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #25d366, #0084ff, transparent);
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.device-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.device-avatar-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.device-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #25d366;
}

.device-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #10b981);
    color: white;
    font-size: 22px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.device-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 13px;
    height: 13px;
    background: #10b981;
    border-radius: 50%;
    border: 2.5px solid #0d111a;
}

.device-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.device-user-name {
    font-size: 18px;
    font-weight: 800;
    color: #f1f5f9;
}

.shield-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.device-platform-label {
    font-size: 12.5px;
    color: #94a3b8;
    margin-top: 3px;
}

.btn-disconnect-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-disconnect-primary:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}

.device-grid-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.metric-box {
    background: rgba(18, 24, 38, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.metric-box:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(22, 30, 48, 0.9);
    transform: translateY(-2px);
}

.metric-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon-box.icon-phone {
    background: rgba(0, 132, 255, 0.12);
    border: 1px solid rgba(0, 132, 255, 0.25);
    color: #38bdf8;
}

.metric-icon-box.icon-shield {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.metric-icon-box.icon-groups {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #a78bfa;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

.metric-value {
    font-size: 15.5px;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: 0.5px;
}

.metric-value.text-green {
    color: #34d399;
    font-size: 13.5px;
}

.session-uid-container {
    background: rgba(0, 132, 255, 0.05);
    border: 1px solid rgba(0, 132, 255, 0.2);
    border-radius: var(--radius);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.session-uid-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.session-uid-title {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.session-uid-code {
    background: var(--surface);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.btn-copy-uid {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-copy-uid:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.device-card-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-cta-groups {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 0 14px var(--primary-glow);
    transition: all 0.15s ease;
}

.btn-cta-groups:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Groups Tab */
.groups-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
}

.groups-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.groups-stat-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
}

.groups-stat-label { color: var(--text-muted); }

.groups-stat-number {
    font-size: 15px;
    font-weight: 900;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid rgba(0, 132, 255, 0.3);
}

.group-filter-pills {
    display: flex;
    gap: 6px;
    background: var(--surface2);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.filter-pill {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-pill:hover {
    color: var(--text);
}

.filter-pill.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary-glow);
}

.groups-search-box {
    flex: 1;
    min-width: 220px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    transition: border-color 0.15s;
}

.groups-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.groups-search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.group-search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
}

.group-search-input::placeholder {
    color: var(--text-sub);
}

.search-clear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

.search-clear-btn:hover {
    color: var(--danger);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
    transition: all 0.15s ease;
}

.btn-action:hover {
    color: var(--text);
    border-color: var(--border2);
    background: var(--border);
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 400px));
    gap: 20px;
    width: 100%;
    align-items: start;
    justify-content: flex-start;
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state span { font-size: 12px; color: var(--text-sub); }

.group-card {
    background: linear-gradient(145deg, #0e1422, #141b2d);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.group-card:hover {
    border-color: rgba(0, 132, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 132, 255, 0.15);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.group-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.group-avatar-fallback,
.group-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.group-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.group-meta-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.group-card-name {
    font-size: 15px;
    font-weight: 800;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.group-sub-tags {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-card-meta {
    font-size: 12px;
    color: #94a3b8;
}

.admin-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-badge.is-admin {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.admin-badge.not-admin {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 0;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-label { font-size: 13px; color: var(--text-muted); }

.switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 22px;
    transition: .25s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    right: 3px;
    bottom: 3px;
    background: var(--text-sub);
    border-radius: 50%;
    transition: .25s;
}

input:checked + .slider { background: var(--primary); border-color: var(--primary); }
input:checked + .slider:before { transform: translateX(-18px); background: white; }

.btn-whitelist {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 132, 255, 0.08);
    border: 1px solid rgba(0, 132, 255, 0.25);
    color: #38bdf8;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-whitelist:hover {
    background: #0084ff;
    color: white;
    box-shadow: 0 0 16px rgba(0, 132, 255, 0.4);
    border-color: #0084ff;
}

/* Logs Table */
.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: right;
}

.data-table th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.empty-row { text-align: center; color: var(--text-sub); padding: 40px !important; }

.event-tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}
.event-promote { background: var(--danger-bg); color: var(--danger); }
.event-demote { background: var(--warning-bg); color: var(--warning); }
.event-remove { background: rgba(137, 87, 229, 0.15); color: #a855f7; }

/* ═══════════════════════════════════════════════════════════════════
   3. AUTH MODAL (تسجيل الدخول / إنشاء حساب)
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.auth-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 32px 28px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.7);
    position: relative;
    animation: scaleUp 0.2s ease;
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.auth-header {
    text-align: center;
    position: relative;
    margin-bottom: 22px;
}

.auth-brand-badge {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
    margin-bottom: 12px;
}

.auth-title {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 4px;
}

.auth-header {
    position: relative;
    text-align: center;
    padding: 10px 0 0;
    margin-bottom: 24px;
}

.auth-header .modal-close-btn {
    position: absolute;
    top: 0;
    left: 0;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    position: static;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.google-auth-wrap { margin-bottom: 18px; }

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 11px;
    background: #ffffff;
    color: #1f1f1f;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-google:hover { background: #f3f4f6; }

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider span {
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-sub);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.field-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 14px;
    font-family: 'Cairo', sans-serif;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s;
}

.field-input:focus { border-color: var(--primary); }

.btn-auth-submit {
    width: 100%;
    padding: 11px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 0 16px var(--primary-glow);
    margin-top: 6px;
}

.btn-auth-submit:hover { background: var(--primary-hover); }

.auth-switch-prompt {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.btn-text-link {
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════
   4. USER PROFILE MODAL
   ═══════════════════════════════════════════════════════════════════ */
.profile-box {
    background: #0d111a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
}

.profile-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 18px;
}

.profile-avatar-large {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #0084ff, #0055cc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: white;
    box-shadow: 0 0 20px rgba(0, 132, 255, 0.35);
    flex-shrink: 0;
}

.profile-user-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: right;
}

.profile-name {
    font-size: 17px;
    font-weight: 800;
    color: #f1f5f9;
}

.profile-email {
    font-size: 13px;
    color: #94a3b8;
    word-break: break-all;
}

.profile-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.info-card {
    background: rgba(18, 24, 38, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
}

.info-card.row-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.info-card-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 700;
}

.info-card-value {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 12px;
    color: #38bdf8;
    background: rgba(0, 132, 255, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 132, 255, 0.2);
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

.info-badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.btn-signout {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-signout:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

/* Whitelist Modal Specifics */
.modal-box {
    background: #0d111a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-head h3 {
    font-size: 16px;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0;
}

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.whitelist-note-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(0, 132, 255, 0.08);
    border: 1px solid rgba(0, 132, 255, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.whitelist-note-banner .modal-note {
    font-size: 12.5px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.6;
}

.add-whitelist-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
}

.btn-add-whitelist {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    background: #0084ff;
    border: none;
    border-radius: 8px;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 0 14px rgba(0, 132, 255, 0.3);
}

.btn-add-whitelist:hover {
    background: #0070db;
}

.sub-label { font-size: 13px; font-weight: 800; margin-bottom: 10px; color: var(--text-muted); }

.wl-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
}

.wl-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(18, 24, 38, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.15s;
}

.wl-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.wl-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wl-avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 132, 255, 0.12);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wl-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wl-item-phone {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0;
}

.wl-item-name {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.wl-delete {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.wl-delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.empty-wl { font-size: 12.5px; color: var(--text-sub); text-align: center; padding: 20px 0; }

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-right: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    min-width: 260px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    animation: slideUp 0.2s ease;
    transition: opacity 0.25s;
}

.toast.danger { border-right-color: var(--danger); }

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

/* ═══════════════════════════════════════════════════════════════════
   5. COMPREHENSIVE LUXURY MOBILE & TABLET RESPONSIVE SYSTEM
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   5. COMPREHENSIVE LUXURY MOBILE & TABLET RESPONSIVE SYSTEM
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* ─── Layout & Navigation ─── */
    .dashboard-view.hidden,
    .dashboard-view[style*="display: none"],
    .landing-view.hidden,
    .landing-view[style*="display: none"] {
        display: none !important;
    }

    .dashboard-view.hidden .sidebar,
    .dashboard-view[style*="display: none"] .sidebar {
        display: none !important;
    }

    .dashboard-view:not(.hidden):not([style*="display: none"]) {
        display: flex !important;
        flex-direction: column !important;
        min-height: 100vh !important;
        width: 100% !important;
        position: relative !important;
        background: #090d16 !important;
    }

    /* Hide desktop sidebar on mobile */
    .sidebar {
        display: none !important;
    }

    /* ─── Liquid Navigation Bar (Mobile Only) ─── */
    .navigation {
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: min(390px, calc(100vw - 28px)) !important;
        height: 70px !important;
        background: #16171b !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 20px !important;
        border: 1px solid rgba(0, 132, 255, 0.3) !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7) !important;
        z-index: 1000 !important;
        direction: rtl !important;
    }

    .navigation ul {
        display: flex !important;
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .navigation ul li.list {
        position: relative !important;
        list-style: none !important;
        width: 33.333% !important;
        height: 70px !important;
        z-index: 2 !important;
        cursor: pointer !important;
    }

    .navigation ul li.list a {
        position: relative !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
        text-align: center !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        user-select: none !important;
    }

    /* الأيقونة */
    .navigation ul li.list a .icon {
        position: absolute !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 70px !important;
        font-size: 26px !important;
        transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        color: #8e8e93 !important;
        z-index: 5 !important;
        top: 0 !important;
    }

    .navigation ul li.list a .icon ion-icon {
        font-size: 26px !important;
        color: inherit !important;
        --color: inherit !important;
    }

    /* عند تنشيط العنصر: ترتفع الأيقونة للأعلى وتستقر مباشرة داخل الدائرة البيضاء */
    .navigation ul li.list.active a .icon {
        transform: translateY(-35px) !important;
        color: #12110d !important; /* لون داكن يظهر بوضوح فائق داخل الدائرة البيضاء */
    }

    .navigation ul li.list.active a .icon ion-icon {
        color: #12110d !important;
        fill: #12110d !important;
        --color: #12110d !important;
    }

    /* النص أسفل الأيقونة */
    .navigation ul li.list a .text {
        position: absolute !important;
        color: #0084ff !important;
        font-weight: 700 !important;
        font-size: 0.75rem !important;
        letter-spacing: 0.03em !important;
        transition: 0.5s ease !important;
        opacity: 0 !important;
        transform: translateY(20px) !important;
        white-space: nowrap !important;
    }

    /* ظهور النص عند التنشيط */
    .navigation ul li.list.active a .text {
        opacity: 1 !important;
        transform: translateY(12px) !important;
    }

    /* ── الدائرة العائمة والانحناءة السائلة ── */
    .indicator {
        position: absolute !important;
        top: -35px !important;
        left: 0;
        width: 70px !important;
        height: 70px !important;
        background: #ffffff !important;
        border-radius: 50% !important;
        border: 5px solid #090d16 !important; /* يندمج مع خلفية الصفحة الداكنة */
        outline: 2px solid #0084ff !important;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5) !important;
        transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }

    /* الجناح المنحني الأيمن للانحناءة السائلة */
    .indicator::before {
        content: '' !important;
        position: absolute !important;
        top: 50% !important;
        left: -22px !important;
        width: 20px !important;
        height: 20px !important;
        background: transparent !important;
        border-top-right-radius: 20px !important;
        box-shadow: 1px -10px 0 0 #16171b !important;
    }

    /* الجناح المنحني الأيسر للانحناءة السائلة */
    .indicator::after {
        content: '' !important;
        position: absolute !important;
        top: 50% !important;
        right: -22px !important;
        width: 20px !important;
        height: 20px !important;
        background: transparent !important;
        border-top-left-radius: 20px !important;
        box-shadow: -1px -10px 0 0 #16171b !important;
    }

    .main-wrapper {
        margin-right: 0 !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
        width: 100% !important;
        min-height: calc(100vh - 62px) !important;
        padding-bottom: 110px !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* ─── Topbar ─── */
    .topbar {
        padding: 0 16px !important;
        height: 56px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 90 !important;
        background: rgba(13, 17, 26, 0.95) !important;
        backdrop-filter: blur(12px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .page-title {
        font-size: 16px !important;
        font-weight: 800 !important;
    }

    .user-profile-btn {
        padding: 4px 10px 4px 6px !important;
        gap: 8px !important;
    }

    .user-avatar-mini {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }

    .user-name-label {
        font-size: 12px !important;
        max-width: 90px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* ─── Content Area ─── */
    .content-area {
        padding: 16px 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex: 1 !important;
    }

    /* ─── Connect Tab / QR View ─── */
    .connect-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .qr-panel {
        padding: 20px 14px !important;
    }

    .qr-frame {
        width: 220px !important;
        height: 220px !important;
    }

    .connect-title {
        font-size: 18px !important;
    }

    .connect-desc {
        font-size: 13px !important;
    }

    .steps-list li {
        font-size: 13px !important;
        gap: 10px !important;
    }

    /* ─── Connected Device Profile Card (Mobile) ─── */
    .device-profile-card {
        padding: 20px 16px !important;
        border-radius: 16px !important;
        gap: 18px !important;
    }

    .device-card-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        padding-bottom: 16px !important;
    }

    .device-user-info {
        gap: 12px !important;
    }

    .device-avatar-wrapper {
        width: 48px !important;
        height: 48px !important;
    }

    .device-avatar-fallback {
        font-size: 18px !important;
    }

    .device-user-name {
        font-size: 16px !important;
    }

    .shield-active-badge {
        font-size: 10.5px !important;
        padding: 2px 8px !important;
    }

    .btn-disconnect-primary {
        width: 100% !important;
        justify-content: center !important;
        padding: 10px !important;
    }

    .device-grid-metrics {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .metric-box {
        padding: 14px 16px !important;
        border-radius: 12px !important;
    }

    .metric-icon-box {
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
    }

    .metric-icon-box svg {
        width: 18px !important;
        height: 18px !important;
    }

    .metric-label {
        font-size: 11px !important;
    }

    .metric-value {
        font-size: 14.5px !important;
    }

    .session-uid-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 12px 14px !important;
    }

    .session-uid-left {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .session-uid-code {
        word-break: break-all !important;
        font-size: 11.5px !important;
        padding: 6px 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .btn-copy-uid {
        width: 100% !important;
        justify-content: center !important;
        padding: 8px !important;
    }

    .btn-cta-groups {
        width: 100% !important;
        justify-content: center !important;
        padding: 12px !important;
        font-size: 13.5px !important;
    }

    /* ─── Groups Tab (Mobile) ─── */
    .groups-header-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .groups-header-right {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .groups-stat-badge {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .group-filter-pills {
        width: 100% !important;
        display: flex !important;
    }

    .filter-pill {
        flex: 1 !important;
        text-align: center !important;
        padding: 8px !important;
        font-size: 12px !important;
    }

    .groups-search-box {
        width: 100% !important;
        max-width: 100% !important;
    }

    .group-search-input {
        width: 100% !important;
        font-size: 13px !important;
        padding: 10px 14px 10px 34px !important;
    }

    .groups-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .group-card {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    .group-name {
        font-size: 14.5px !important;
    }

    .toggle-row {
        padding: 10px 0 !important;
    }

    .toggle-label-text {
        font-size: 12.5px !important;
    }

    /* ─── Audit Logs (Mobile) ─── */
    .logs-table-wrapper {
        border-radius: 12px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .logs-table {
        min-width: 580px !important;
        font-size: 12px !important;
    }

    .logs-table th, 
    .logs-table td {
        padding: 10px 12px !important;
    }

    /* ─── Mobile Bottom Sheet Modal (Never Covered) ─── */
    .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
        z-index: 99999 !important;
        background: rgba(0, 0, 0, 0.82) !important;
        backdrop-filter: blur(12px) !important;
    }

    .modal-box,
    .profile-box,
    .auth-box {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 26px 26px 0 0 !important;
        max-height: 85vh !important;
        animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
        margin: 0 !important;
        padding-bottom: 24px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9) !important;
    }

    @keyframes slideUpModal {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal-body {
        padding: 18px 18px 24px 18px !important;
    }

    .profile-actions {
        margin-top: 14px !important;
        padding-bottom: 12px !important;
    }

    .btn-signout {
        padding: 13px !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        border-radius: 12px !important;
    }

    /* ─── Toast Notifications ─── */
    .toast-container {
        bottom: 74px !important;
        left: 12px !important;
        right: 12px !important;
    }

    .toast {
        min-width: auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 12px 10px !important;
    }

    .page-title {
        font-size: 16px !important;
    }

    .device-user-name {
        font-size: 15px !important;
    }

    .metric-value {
        font-size: 14px !important;
    }
}

