/* ==========================================================================
   Smart Sender Partners System — Enterprise RTL Stylesheet (v2.0)
   Default Theme: Light Mode (`:root`, `[data-theme="light"]`)
   Optional Theme: Executive Dark Mode (`[data-theme="dark"]`)
   Mobile-First & Desktop-Optimized Responsive Design
   ========================================================================== */

:root,
[data-theme="light"] {
    color-scheme: light;

    /* Surfaces & Backgrounds */
    --bg-main: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.92);
    --bg-elevated: #f8fafc;
    --bg-input: #f8fafc;
    --bg-table-head: #f8fafc;
    --bg-row-hover: #f8fafc;
    --bg-auth-radial-1: rgba(16, 185, 129, 0.10);
    --bg-auth-radial-2: rgba(37, 99, 235, 0.08);

    /* Borders */
    --border-color: #e2e8f0;
    --border-subtle: #eef2f6;
    --border-strong: #cbd5e1;

    /* Typography Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Brand & Action Accents */
    --accent-emerald: #059669;
    --accent-emerald-hover: #047857;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-amber: #d97706;
    --accent-danger: #dc2626;
    --accent-purple: #7c3aed;

    /* Semantic Text Colors (High Contrast on Light) */
    --color-emerald-text: #047857;
    --color-blue-text: #1d4ed8;
    --color-amber-text: #b45309;
    --color-danger-text: #b91c1c;
    --color-purple-text: #6d28d9;

    /* Semantic Badge Surfaces */
    --badge-success-bg: #ecfdf5;
    --badge-success-text: #047857;
    --badge-success-border: #a7f3d0;

    --badge-warning-bg: #fffbeb;
    --badge-warning-text: #b45309;
    --badge-warning-border: #fde68a;

    --badge-info-bg: #eff6ff;
    --badge-info-text: #1d4ed8;
    --badge-info-border: #bfdbfe;

    --badge-purple-bg: #f5f3ff;
    --badge-purple-text: #6d28d9;
    --badge-purple-border: #ddd6fe;

    --badge-danger-bg: #fef2f2;
    --badge-danger-text: #b91c1c;
    --badge-danger-border: #fecaca;

    --badge-muted-bg: #f1f5f9;
    --badge-muted-text: #475569;
    --badge-muted-border: #cbd5e1;

    /* Navigation Active State */
    --nav-active-bg: linear-gradient(135deg, rgba(5, 150, 105, 0.12), rgba(37, 99, 235, 0.08));
    --nav-active-text: #047857;
    --nav-active-border: rgba(5, 150, 105, 0.30);
    --nav-hover-bg: #f1f5f9;

    /* Shadows & Geometry */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-card-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.09), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
    --shadow-sidebar: -4px 0 24px rgba(15, 23, 42, 0.04);
    --shadow-modal: 0 24px 60px rgba(15, 23, 42, 0.22);
    --font-ar: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
    color-scheme: dark;

    /* Surfaces & Backgrounds */
    --bg-main: #0b1120;
    --bg-panel: #151f32;
    --bg-sidebar: #111827;
    --bg-topbar: rgba(17, 24, 39, 0.90);
    --bg-elevated: #1e293b;
    --bg-input: #0f172a;
    --bg-table-head: rgba(15, 23, 42, 0.65);
    --bg-row-hover: rgba(255, 255, 255, 0.03);
    --bg-auth-radial-1: rgba(16, 185, 129, 0.14);
    --bg-auth-radial-2: rgba(59, 130, 246, 0.14);

    /* Borders */
    --border-color: #26334d;
    --border-subtle: #1e293b;
    --border-strong: #334155;

    /* Typography Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Brand & Action Accents */
    --accent-emerald: #10b981;
    --accent-emerald-hover: #059669;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-amber: #f59e0b;
    --accent-danger: #ef4444;
    --accent-purple: #8b5cf6;

    /* Semantic Text Colors (Luminous on Dark) */
    --color-emerald-text: #34d399;
    --color-blue-text: #38bdf8;
    --color-amber-text: #fbbf24;
    --color-danger-text: #f87171;
    --color-purple-text: #c4b5fd;

    /* Semantic Badge Surfaces */
    --badge-success-bg: rgba(16, 185, 129, 0.15);
    --badge-success-text: #34d399;
    --badge-success-border: rgba(16, 185, 129, 0.32);

    --badge-warning-bg: rgba(245, 158, 11, 0.15);
    --badge-warning-text: #fbbf24;
    --badge-warning-border: rgba(245, 158, 11, 0.32);

    --badge-info-bg: rgba(59, 130, 246, 0.15);
    --badge-info-text: #60a5fa;
    --badge-info-border: rgba(59, 130, 246, 0.32);

    --badge-purple-bg: rgba(139, 92, 246, 0.16);
    --badge-purple-text: #c4b5fd;
    --badge-purple-border: rgba(139, 92, 246, 0.34);

    --badge-danger-bg: rgba(239, 68, 68, 0.15);
    --badge-danger-text: #f87171;
    --badge-danger-border: rgba(239, 68, 68, 0.32);

    --badge-muted-bg: rgba(148, 163, 184, 0.12);
    --badge-muted-text: #cbd5e1;
    --badge-muted-border: rgba(148, 163, 184, 0.25);

    /* Navigation Active State */
    --nav-active-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(59, 130, 246, 0.15));
    --nav-active-text: #ffffff;
    --nav-active-border: rgba(16, 185, 129, 0.35);
    --nav-hover-bg: rgba(255, 255, 255, 0.05);

    /* Shadows */
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.26);
    --shadow-card-hover: 0 14px 36px rgba(0, 0, 0, 0.38);
    --shadow-sidebar: -6px 0 30px rgba(0, 0, 0, 0.35);
    --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   1. Base Reset & Typography
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    direction: rtl;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-ar);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.sidebar-locked {
    overflow: hidden;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
    color: var(--accent-emerald);
}

/* Semantic Color & Utility Classes */
.text-emerald { color: var(--color-emerald-text) !important; }
.text-blue    { color: var(--color-blue-text) !important; }
.text-amber   { color: var(--color-amber-text) !important; }
.text-danger  { color: var(--color-danger-text) !important; }
.text-purple  { color: var(--color-purple-text) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted   { color: var(--text-muted) !important; }
.fw-bold      { font-weight: 700 !important; }
.fw-extrabold { font-weight: 800 !important; }

.mono {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    direction: ltr;
    display: inline-block;
    white-space: nowrap;
}

/* ==========================================================================
   2. Authentication & Status Pages (`login.php`, `admin/login.php`, `payment-status.php`)
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at 15% 15%, var(--bg-auth-radial-1), transparent 45%),
        radial-gradient(circle at 85% 85%, var(--bg-auth-radial-2), transparent 45%),
        var(--bg-main);
    position: relative;
}

.auth-topbar {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 30;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-card);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auth-card .brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--badge-success-bg);
    color: var(--badge-success-text);
    border: 1px solid var(--badge-success-border);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.auth-card .brand-pill.admin-pill {
    background: var(--badge-info-bg);
    color: var(--badge-info-text);
    border-color: var(--badge-info-border);
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 1.32rem;
    font-weight: 800;
    color: var(--text-primary);
}

.auth-card p.subtitle {
    margin: 0 0 22px;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

/* ==========================================================================
   3. App Shell (Sidebar + Main Area + Mobile Backdrop)
   ========================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-sidebar);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease;
}

.sidebar-brand {
    height: 72px;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-brand-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand-info:hover {
    color: inherit;
}

.sidebar-brand .brand-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 6px 16px -2px rgba(5, 150, 105, 0.35);
    transition: transform 0.2s ease;
}

.sidebar-brand-info:hover .brand-logo {
    transform: scale(1.05);
}

.sidebar-brand .brand-logo.brand-logo-partner {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    box-shadow: 0 6px 16px -2px rgba(37, 99, 235, 0.35);
}

.sidebar-brand .brand-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-brand .brand-title {
    font-weight: 800;
    font-size: 0.96rem;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.sidebar-brand .brand-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(5, 150, 105, 0.12);
    color: var(--color-emerald-text);
    border: 1px solid rgba(5, 150, 105, 0.25);
    line-height: 1.4;
}

.sidebar-brand .brand-badge.brand-badge-partner {
    background: rgba(37, 99, 235, 0.12);
    color: var(--color-blue-text);
    border-color: rgba(37, 99, 235, 0.25);
}

.sidebar-brand .brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-close-btn {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sidebar-close-btn:hover {
    background: var(--bg-panel);
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 14px 12px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 14px 10px 4px;
    margin-top: 4px;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-section-label:first-child {
    margin-top: 0;
    padding-top: 4px;
}

.nav-section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
    opacity: 0.8;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.83rem;
    border: 1px solid transparent;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
}

.nav-link .nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.18s ease;
}

.nav-link .nav-icon svg {
    transition: transform 0.18s ease, stroke 0.18s ease;
}

.nav-link .nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link:hover {
    background: var(--nav-hover-bg);
    color: var(--text-primary);
    transform: translateX(-3px);
}

.nav-link:hover .nav-icon {
    background: var(--bg-panel);
    color: var(--accent-emerald);
    border-color: rgba(5, 150, 105, 0.25);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.nav-link:hover .nav-icon svg {
    transform: scale(1.08);
}

.nav-link.active {
    background: #ecfdf5;
    color: #065f46;
    font-weight: 700;
    border-color: #a7f3d0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
}

.nav-link.active::before {
    content: "";
    position: absolute;
    right: -12px;
    top: 7px;
    bottom: 7px;
    width: 4px;
    border-radius: 4px 0 0 4px;
    background: linear-gradient(180deg, #059669, #10b981);
}

.nav-link.active .nav-icon {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.32);
}

[data-theme="dark"] .nav-link.active {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .nav-link.active::before {
    background: linear-gradient(180deg, #10b981, #3b82f6);
}

[data-theme="dark"] .nav-link.active .nav-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.40);
}

.sidebar-footer {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.sidebar-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 13px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}

.sidebar-user-pill:hover {
    border-color: var(--border-strong);
}

.sidebar-user-pill .user-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.sidebar-user-pill .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.sidebar-user-pill .user-avatar.user-avatar-partner {
    background: linear-gradient(135deg, #059669, #0d9488);
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.25);
}

.sidebar-user-pill .user-status-dot {
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid var(--bg-panel);
}

.sidebar-user-pill .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-pill .user-name {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.sidebar-user-pill .user-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.sidebar-user-pill .user-logout-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.18s ease;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-user-pill .user-logout-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
    transform: scale(1.06);
}

[data-theme="dark"] .sidebar-user-pill .user-logout-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.main-area {
    flex: 1;
    margin-right: 280px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ==========================================================================
   4. Topbar & Theme Toggle Button
   ========================================================================== */
.topbar {
    height: 62px;
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 80;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title {
    font-size: 1.02rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-ar);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.theme-toggle-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-panel);
    transform: translateY(-1px);
}

.theme-toggle-btn .theme-icon {
    font-size: 0.98rem;
    line-height: 1;
}

.mobile-menu-btn {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-ar);
    font-weight: 700;
    font-size: 0.95rem;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.content-wrap {
    padding: 28px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   5. Stat Cards & Responsive Layout Grids
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-blue);
}

.stat-card.emerald::before { background: var(--accent-emerald); }
.stat-card.amber::before   { background: var(--accent-amber); }
.stat-card.purple::before  { background: var(--accent-purple); }
.stat-card.danger::before  { background: var(--accent-danger); }

.stat-card .stat-label {
    font-size: 0.80rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-card .stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.stat-card .stat-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ==========================================================================
   6. Panels, Cards & Filter Bars
   ========================================================================== */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.panel.panel-emerald-highlight {
    border-color: var(--badge-success-border);
}

.panel-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--bg-elevated);
}

.panel-header h2 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-primary);
}

.panel-body {
    padding: 20px;
}

.sub-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    transition: border-color 0.15s ease;
}

.sub-card:hover {
    border-color: var(--border-strong);
}

/* ==========================================================================
   6.5 Products & Plans Catalog Executive UI
   ========================================================================== */
.catalog-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-top: 18px;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-emerald), var(--accent-blue));
    opacity: 0.9;
}

.product-card.inactive {
    opacity: 0.72;
    border-style: dashed;
}

.product-card.inactive::before {
    background: var(--border-strong);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(5, 150, 105, 0.35);
}

.product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.product-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.product-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    box-shadow: 0 6px 16px -2px rgba(5, 150, 105, 0.30);
}

.product-icon.product-icon-sms {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    box-shadow: 0 6px 16px -2px rgba(37, 99, 235, 0.30);
}

.product-icon.product-icon-desktop {
    background: linear-gradient(135deg, #0891b2 0%, #059669 100%);
    box-shadow: 0 6px 16px -2px rgba(8, 145, 178, 0.30);
}

.product-name-block {
    min-width: 0;
}

.product-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px;
    line-height: 1.3;
}

.product-slug-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--accent-blue);
    direction: ltr;
}

.product-desc {
    font-size: 0.80rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.product-url-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    font-size: 0.82rem;
}

.product-url-bar a {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-url-bar a:hover {
    color: var(--accent-blue);
}

/* Dual Pricing Matrix */
.pricing-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 480px) {
    .pricing-matrix {
        grid-template-columns: 1fr;
    }
}

.pricing-block {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-block.pricing-egp {
    border-color: rgba(5, 150, 105, 0.22);
    background: linear-gradient(180deg, rgba(5, 150, 105, 0.04) 0%, transparent 100%);
}

.pricing-block.pricing-usd {
    border-color: rgba(37, 99, 235, 0.22);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 100%);
}

.pricing-block-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-primary);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.pricing-block-title .currency-tag {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 5px;
}

.currency-tag.tag-egp {
    background: rgba(5, 150, 105, 0.14);
    color: var(--color-emerald-text);
}

.currency-tag.tag-usd {
    background: rgba(37, 99, 235, 0.14);
    color: var(--color-blue-text);
}

.tier-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.80rem;
    padding: 3px 0;
}

.tier-item .tier-name {
    color: var(--text-secondary);
}

.tier-item .tier-price {
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
    color: var(--text-primary);
}

.tier-item.tier-highlight {
    background: var(--bg-panel);
    padding: 4px 8px;
    border-radius: 7px;
    border: 1px solid var(--border-subtle);
}

.tier-item.tier-highlight .tier-price {
    color: var(--color-emerald-text);
}

.product-metrics-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px;
    background: var(--bg-elevated);
    border-radius: 12px;
    text-align: center;
}

.metric-cell .metric-val {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-cell .metric-lbl {
    font-size: 0.70rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.product-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.product-actions-bar .btn {
    flex: 1;
}

/* Products Classical Table Styling */
table.data-table.products-table {
    min-width: 1120px !important;
}

table.data-table.products-table th,
table.data-table.products-table td {
    padding: 8px 12px;
}

.landing-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--accent-blue);
    font-family: 'Consolas', monospace;
    font-size: 0.77rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    direction: ltr;
    transition: all 0.15s ease;
}

.landing-link-pill:hover {
    background: var(--bg-panel);
    border-color: var(--accent-blue);
    color: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

.pricing-cell-box {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    padding: 5px 9px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    font-size: 0.77rem;
    white-space: nowrap;
}

.pricing-cell-box.egp {
    border-color: rgba(5, 150, 105, 0.22);
    background: rgba(5, 150, 105, 0.04);
}

.pricing-cell-box.usd {
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.04);
}

.pricing-cell-row {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pricing-sep {
    color: var(--border-strong);
    font-size: 0.70rem;
}

.pricing-cell-annual {
    border-top: 1px dashed var(--border-subtle);
    padding-top: 3px;
    margin-top: 1px;
    font-weight: 800;
}

/* Modern Form & Addon Input Groups for Modal */
.input-addon-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-addon-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    text-align: left;
    direction: ltr;
    font-family: 'Consolas', monospace;
    font-weight: 700;
}

.input-addon-group .input-addon {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-right: none;
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--text-muted);
}

.modal-section-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.modal-section-card.section-egp {
    border-color: rgba(5, 150, 105, 0.25);
    background: rgba(5, 150, 105, 0.03);
}

.modal-section-card.section-usd {
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.03);
}

.modal-section-title {
    font-size: 0.88rem;
    font-weight: 800;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* Dynamic Plans Builder in Product Modal */
.region-toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.80rem;
    background: var(--bg-panel);
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    user-select: none;
    transition: all 0.15s ease;
}

.region-toggle-pill:hover {
    border-color: var(--accent-blue);
}

.region-toggle-pill input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-emerald);
}

.plan-presets-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.dynamic-plan-header {
    display: grid;
    grid-template-columns: 1.5fr 1.1fr 1fr 36px;
    gap: 8px;
    padding: 0 4px 6px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.dynamic-plan-row {
    display: grid;
    grid-template-columns: 1.5fr 1.1fr 1fr 36px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    background: var(--bg-panel);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.dynamic-plan-row .form-control {
    height: 34px;
    font-size: 0.82rem;
    padding: 4px 10px;
}

.remove-plan-btn {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.06);
    color: var(--accent-danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.remove-plan-btn:hover {
    background: var(--accent-danger);
    color: #fff;
}

.region-disabled-box {
    padding: 14px;
    border-radius: 10px;
    background: var(--bg-panel);
    border: 1px dashed var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

@media (max-width: 640px) {
    .dynamic-plan-header {
        display: none;
    }
    .dynamic-plan-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
    }
    .remove-plan-btn {
        width: 100%;
        height: 30px;
    }
}

/* ==========================================================================
   7. Data Tables (Compact Enterprise Design - Reduced Height & Optimal Readability)
   ========================================================================== */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.80rem;
    line-height: 1.40;
}

table.data-table th {
    background: var(--bg-table-head);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.74rem;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    letter-spacing: 0.1px;
}

table.data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text-primary);
    font-size: 0.80rem;
    line-height: 1.38;
}

table.data-table tbody tr {
    transition: background-color 0.12s ease;
}

table.data-table tbody tr:hover {
    background: var(--bg-row-hover);
}

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

/* Compact Inner Elements for High-Density Tables */
table.data-table small {
    font-size: 0.72rem;
    line-height: 1.30;
    display: inline-block;
}

table.data-table .mono,
.mono {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.81rem;
    white-space: nowrap !important;
    word-break: keep-all;
    display: inline-block;
}

table.data-table .nowrap,
table.data-table .cell-nowrap,
.nowrap,
.cell-nowrap {
    white-space: nowrap !important;
}

table.data-table .badge {
    padding: 2px 7px;
    font-size: 0.69rem;
    line-height: 1.30;
    gap: 3px;
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
}

table.data-table .btn-sm {
    padding: 3px 8px;
    font-size: 0.72rem;
    border-radius: 6px;
    line-height: 1.32;
    white-space: nowrap !important;
    font-weight: 600;
}

table.data-table .inline-actions,
.inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

table.data-table .inline-actions form,
.inline-actions form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center;
}

/* Modern Dropdown Menus & 3-Dots Action Button */
.dropdown {
    position: relative;
    display: inline-block;
}

.action-dots-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.16s ease;
    user-select: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.action-dots-btn:hover,
.dropdown.open .action-dots-btn {
    background: var(--bg-elevated);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
}

.action-dots-btn svg {
    pointer-events: none;
    display: block;
}

.dropdown-toggle {
    user-select: none;
}

.dropdown-menu {
    display: none !important;
    min-width: 190px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.22), 0 4px 12px -2px rgba(15, 23, 42, 0.12);
    z-index: 99999;
    padding: 6px;
    box-sizing: border-box;
}

[data-theme="dark"] .dropdown-menu {
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.60), 0 6px 16px rgba(0, 0, 0, 0.40);
    border-color: var(--border-strong);
    background: #1e293b;
}

.dropdown.open > .dropdown-menu {
    display: block !important;
    animation: fadeInDropdown 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-primary);
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: right;
    text-decoration: none;
    transition: background-color 0.14s ease, color 0.14s ease;
    font-family: var(--font-ar);
    box-sizing: border-box;
}

.dropdown-item:hover {
    background: var(--bg-elevated);
    color: var(--accent-blue);
}

.dropdown-item.text-danger {
    color: var(--accent-danger) !important;
}

.dropdown-item.text-danger:hover {
    background: rgba(220, 38, 38, 0.08) !important;
    color: var(--accent-danger) !important;
}

.dropdown-item.text-amber {
    color: var(--accent-amber) !important;
}

.dropdown-item.text-amber:hover {
    background: rgba(217, 119, 6, 0.08) !important;
    color: var(--accent-amber) !important;
}

.dropdown-item.text-emerald {
    color: var(--color-emerald-text) !important;
}

.dropdown-item.text-emerald:hover {
    background: rgba(5, 150, 105, 0.08) !important;
    color: var(--accent-emerald) !important;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 5px 0;
}

.dropdown form {
    margin: 0;
    padding: 0;
    display: block;
}

/* ==========================================================================
   8. Badges & Status Pills
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.70rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.35;
}

.badge-success {
    background: var(--badge-success-bg);
    color: var(--badge-success-text);
    border: 1px solid var(--badge-success-border);
}

.badge-warning {
    background: var(--badge-warning-bg);
    color: var(--badge-warning-text);
    border: 1px solid var(--badge-warning-border);
}

.badge-info {
    background: var(--badge-info-bg);
    color: var(--badge-info-text);
    border: 1px solid var(--badge-info-border);
}

.badge-purple {
    background: var(--badge-purple-bg);
    color: var(--badge-purple-text);
    border: 1px solid var(--badge-purple-border);
}

.badge-danger {
    background: var(--badge-danger-bg);
    color: var(--badge-danger-text);
    border: 1px solid var(--badge-danger-border);
}

.badge-muted {
    background: var(--badge-muted-bg);
    color: var(--badge-muted-text);
    border: 1px solid var(--badge-muted-border);
}

/* ==========================================================================
   9. Forms, Inputs & Buttons
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.form-hint {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.45;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-ar);
    font-size: 0.85rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-panel);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.search-input {
    width: 250px;
    max-width: 100%;
}

.status-select {
    width: 180px;
    max-width: 100%;
}

textarea.form-control {
    min-height: 76px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-ar);
    font-weight: 700;
    font-size: 0.83rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.16s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-emerald {
    background: var(--accent-emerald);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.22);
}

.btn-emerald:hover:not(:disabled) {
    background: var(--accent-emerald-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-blue-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-amber {
    background: var(--accent-amber);
    color: #ffffff;
}

.btn-danger {
    background: var(--badge-danger-bg);
    color: var(--badge-danger-text);
    border-color: var(--badge-danger-border);
}

.btn-danger:hover:not(:disabled) {
    background: var(--accent-danger);
    color: #ffffff;
}

.btn-outline-danger {
    background: transparent;
    color: var(--badge-danger-text, #ef4444);
    border: 1px solid var(--badge-danger-border, rgba(239, 68, 68, 0.35));
    transition: all 0.15s ease;
}

.btn-outline-danger:hover:not(:disabled) {
    background: var(--accent-danger, #ef4444);
    color: #ffffff;
    border-color: var(--accent-danger, #ef4444);
}

.btn-outline {
    background: var(--bg-panel);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.73rem;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   10. Alerts, Copy Boxes & Modals
   ========================================================================== */
.alert {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.alert-success {
    background: var(--badge-success-bg);
    border: 1px solid var(--badge-success-border);
    color: var(--badge-success-text);
}

.alert-error {
    background: var(--badge-danger-bg);
    border: 1px solid var(--badge-danger-border);
    color: var(--badge-danger-text);
}

.alert-info {
    background: var(--badge-info-bg);
    border: 1px solid var(--badge-info-border);
    color: var(--badge-info-text);
}

.copy-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.copy-box code {
    flex: 1;
    color: var(--color-emerald-text);
    font-size: 0.80rem;
    font-weight: 700;
    overflow-x: auto;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
    scrollbar-width: thin;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 200;
}

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

.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-modal);
    overflow: hidden;
}

.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-primary);
}

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

.empty-state {
    text-align: center;
    padding: 38px 20px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================================
   10.5 Settings Executive Tabs & Gateway Panels
   ========================================================================== */
.settings-tabs-wrapper {
    margin-bottom: 24px;
}

.settings-tabs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-card);
}

.settings-tabs-nav::-webkit-scrollbar {
    display: none;
}

.settings-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-ar);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.settings-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.settings-tab-btn.active {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
}

[data-theme="dark"] .settings-tab-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}

.settings-tab-pane {
    display: none;
    animation: fadeInTab 0.2s ease-in-out;
}

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

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

/* Gateway Hero & Mode Switcher */
.gateway-hero-card {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(37, 99, 235, 0.06) 100%), var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.gateway-hero-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-emerald), var(--accent-blue));
}

.gateway-hero-info {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.gateway-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 18px -2px rgba(5, 150, 105, 0.35);
}

.gateway-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 540px) {
    .gateway-mode-selector {
        grid-template-columns: 1fr;
    }
}

.gateway-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.18s ease;
}

.gateway-mode-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    cursor: pointer;
}

.gateway-mode-option:hover {
    border-color: var(--border-strong);
    background: var(--bg-panel);
}

.gateway-mode-option.active-mode-test {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.gateway-mode-option.active-mode-live {
    border-color: #059669;
    background: rgba(5, 150, 105, 0.06);
}

/* Developer Console Webhook Box */
.webhook-console-card {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 22px;
    border: 1px solid #1e293b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.webhook-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.webhook-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    display: inline-block;
    animation: pulseDot 2s infinite;
}

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

.webhook-console-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
}

.webhook-console-box code {
    color: #38bdf8;
    font-family: 'Consolas', monospace;
    font-size: 0.88rem;
    font-weight: 700;
    direction: ltr;
    white-space: nowrap;
    overflow-x: auto;
}

/* Feature Shield Cards Grid */
.settings-section-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-card-header h3 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   11. Tablet & Mobile Responsiveness (`<= 1024px` and `<= 640px`)
   ========================================================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(105%);
        width: 285px;
        max-width: 86vw;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    .main-area {
        margin-right: 0;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .topbar {
        padding: 0 16px;
        height: 64px;
    }

    .content-wrap {
        padding: 18px 14px 32px;
    }

    .grid-2-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 0 12px;
        height: auto;
        min-height: 60px;
        padding-top: 8px;
        padding-bottom: 8px;
        flex-wrap: wrap;
    }

    .topbar-title {
        font-size: 1rem;
    }

    .topbar-left .hide-on-mobile {
        display: none !important;
    }

    .theme-toggle-btn .theme-label {
        display: none;
    }

    .theme-toggle-btn {
        padding: 7px 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 18px;
    }

    .stat-card {
        padding: 14px 14px;
        border-radius: 13px;
    }

    .stat-card .stat-label {
        font-size: 0.76rem;
    }

    .stat-card .stat-value {
        font-size: 1.18rem;
    }

    .stat-card .stat-hint {
        font-size: 0.71rem;
        margin-top: 5px;
    }

    .panel-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .panel-header .btn,
    .panel-header .inline-actions {
        width: 100%;
    }

    .panel-header .inline-actions .btn {
        flex: 1;
    }

    .panel-body {
        padding: 16px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .filter-bar .form-control,
    .filter-bar .search-input,
    .filter-bar .status-select,
    .filter-bar .btn {
        width: 100% !important;
    }

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .copy-box {
        flex-wrap: wrap;
    }

    .copy-box code {
        width: 100%;
        padding-bottom: 4px;
    }

    .copy-box .btn {
        width: 100%;
    }

    table.data-table th,
    table.data-table td {
        padding: 7px 9px;
        font-size: 0.79rem;
    }

    .auth-card {
        padding: 26px 20px;
    }

    .auth-card h1 {
        font-size: 1.35rem;
    }

    .modal-backdrop {
        padding: 10px;
        align-items: flex-end;
    }

    .modal-card {
        max-height: 90vh;
        border-radius: 16px 16px 12px 12px;
    }

    .modal-header,
    .modal-body {
        padding: 16px;
    }
}

@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   14. Affiliate Guide, Transparency Charter & FAQ (`partner/guide.php`)
   ========================================================================== */
.guide-dashboard-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.09), rgba(37, 99, 235, 0.07));
    border: 1px solid var(--nav-active-border);
    box-shadow: var(--shadow-card);
}

.guide-callout-text {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.guide-callout-icon {
    font-size: 1.7rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.guide-callout-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.guide-callout-text p {
    margin: 0;
    font-size: 0.87rem;
    color: var(--text-secondary);
}

.guide-hero-panel {
    background:
        radial-gradient(circle at 12% 20%, rgba(16, 185, 129, 0.11), transparent 48%),
        radial-gradient(circle at 88% 80%, rgba(37, 99, 235, 0.09), transparent 48%),
        var(--bg-panel);
    border: 1px solid var(--nav-active-border);
}

.guide-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--badge-success-bg);
    color: var(--badge-success-text);
    border: 1px solid var(--badge-success-border);
    margin-bottom: 12px;
}

.guide-hero-title {
    margin: 0 0 8px 0;
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--text-primary);
}

.guide-hero-subtitle {
    margin: 0 0 18px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 880px;
    line-height: 1.7;
}

.guide-metrics-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.guide-metric-pill {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.guide-metric-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.guide-metric-value {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-primary);
}

.guide-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.guide-section-lead {
    margin: 4px 0 0 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.guide-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.guide-step-card,
.guide-stage-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.guide-step-card:hover,
.guide-stage-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.guide-step-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.guide-step-icon {
    font-size: 1.65rem;
}

.guide-step-num {
    font-size: 0.85rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--badge-info-bg);
    color: var(--badge-info-text);
    border: 1px solid var(--badge-info-border);
}

.guide-step-title {
    margin: 0 0 6px 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
}

.guide-step-desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Payment Detection Method Cards */
.guide-method-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.guide-method-card.method-emerald {
    border-top: 4px solid var(--accent-emerald);
}

.guide-method-card.method-blue {
    border-top: 4px solid var(--accent-blue);
}

.guide-method-header {
    margin-bottom: 10px;
}

.guide-method-title {
    margin: 0 0 8px 0;
    font-size: 0.98rem;
    font-weight: 800;
}

.guide-method-exp {
    margin: 0 0 10px 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.guide-method-list {
    margin: 0;
    padding-right: 20px;
    color: var(--text-primary);
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.guide-method-list li {
    line-height: 1.68;
}

/* Transparency & Edge Cases Panel */
.guide-transparency-panel {
    border: 1px solid var(--badge-warning-border);
}

.guide-cases-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.guide-case-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}

.guide-case-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--badge-warning-bg);
    color: var(--badge-warning-text);
    border: 1px solid var(--badge-warning-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.guide-case-content {
    flex: 1;
}

.guide-case-title {
    margin: 0 0 5px 0;
    font-size: 0.90rem;
    font-weight: 800;
    color: var(--text-primary);
}

.guide-case-scenario {
    margin: 0 0 8px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.guide-case-solution {
    background: var(--badge-success-bg);
    border: 1px solid var(--badge-success-border);
    color: var(--badge-success-text);
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    font-size: 0.80rem;
    line-height: 1.55;
}

.guide-guarantee-box {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.11), rgba(37, 99, 235, 0.08));
    border: 1px solid var(--badge-success-border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.guide-guarantee-box h3 {
    margin: 0 0 6px 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--color-emerald-text);
}

.guide-guarantee-box p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Rights & Duties Checklists */
.guide-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide-check-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.84rem;
    color: var(--text-primary);
    line-height: 1.65;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    padding: 10px 13px;
    border-radius: var(--radius-sm);
}

.guide-check-list .check-icon {
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}

/* FAQ Accordion */
.guide-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide-faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.guide-faq-item.open {
    border-color: var(--accent-emerald);
    background: var(--bg-panel);
}

.guide-faq-question {
    width: 100%;
    border: none;
    background: transparent;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
    font-family: var(--font-ar);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.guide-faq-question:hover {
    color: var(--color-emerald-text);
}

.faq-q-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.faq-q-num {
    color: var(--color-emerald-text);
    font-weight: 800;
    font-size: 0.88rem;
}

.faq-q-arrow {
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.guide-faq-item.open .faq-q-arrow {
    transform: rotate(180deg);
    color: var(--color-emerald-text);
}

.guide-faq-answer {
    display: none;
    padding: 0 16px 14px 16px;
    border-top: 1px solid var(--border-subtle);
}

.guide-faq-item.open .guide-faq-answer {
    display: block;
}

.guide-faq-answer p {
    margin: 10px 0 0 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

@media (max-width: 640px) {
    .guide-dashboard-callout {
        flex-direction: column;
        align-items: stretch;
    }

    .guide-dashboard-callout .btn {
        width: 100%;
        text-align: center;
    }

    .guide-hero-title {
        font-size: 1.22rem;
    }

    .guide-case-item {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==========================================================================
   Admin Impersonation Banner
   ========================================================================== */
.impersonation-banner {
    background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    padding: 10px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 999;
}

.impersonation-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    max-width: 1400px;
    margin: 0 auto;
}

.impersonation-banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
}

.impersonation-banner-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.impersonation-return-btn {
    background: #ffffff !important;
    color: #1e3a8a !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 0.80rem !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    white-space: nowrap !important;
}

.impersonation-return-btn:hover {
    background: #f8fafc !important;
    color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

@media (max-width: 768px) {
    .impersonation-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        text-align: center;
    }
    .impersonation-banner-text {
        justify-content: center;
        font-size: 0.82rem;
    }
    .impersonation-return-btn {
        width: 100%;
        justify-content: center;
    }
}
