/* =========================================================
   منصة المقادمة — Shared Base Stylesheet (app.css)
   ---------------------------------------------------------
   يحتوي على كل الستايلات المشتركة بين اللوحات الثلاث.
   ألوان كل لوحة تأتي من theme-{admin|merchant|provider}.css
   شركة أبناء عبد الحميد المقادمة، بالشراكة مع Jawwal Pay.
   ========================================================= */

/* Global: HTML hidden attribute يجب يخفي دائماً (يتجاوز display:* محدد) */
[hidden] { display: none !important; }

/* ====== Design Tokens (defaults) ====== */
:root {
    --cc-bg: #f4f7fb;
    --cc-surface: #ffffff;
    --cc-surface-2: #f8fafc;
    --cc-text: #0f172a;
    --cc-text-muted: #64748b;
    --cc-border: rgba(15, 23, 42, 0.08);

    --cc-danger: #dc2626;
    --cc-danger-bg: #fee2e2;
    --cc-warning: #d97706;
    --cc-warning-bg: #fef3c7;
    --cc-success: #16a34a;
    --cc-success-bg: #dcfce7;
    --cc-info: #0284c7;
    --cc-info-bg: #e0f2fe;

    /* يستبدلها كل theme بالألوان الخاصة فيه */
    --cc-primary: #8bc800;
    --cc-primary-dark: #6f9e00;
    --cc-primary-glow: rgba(139, 200, 0, 0.15);

    --sidebar-width: 260px;
}

/* ====== Reset + Base ====== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
}

.mono { font-family: 'IBM Plex Mono', monospace !important; }

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

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; font-family: inherit; }
img { max-width: 100%; display: block; }

/* ====== Sidebar ====== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--cc-surface);
    border-left: 1px solid var(--cc-border);
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 20px 18px 18px;
    border-bottom: 1px solid var(--cc-border);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, var(--cc-surface-2), #fff);
}

/* صف الشعارين جنب بعض */
.brand-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
}
.brand-logos img {
    height: 48px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.brand-logos .brand-logo-main {
    /* شعار المقادمة - حجم أكبر قليلاً ليبرز كشركة أم */
    height: 50px;
}
.brand-logos .brand-logo-partner {
    height: 46px;
}
/* فاصل بصري ناعم بين الشعارين (× أو خط) */
.brand-logos-sep {
    width: 1px;
    height: 28px;
    background: var(--cc-border);
    flex-shrink: 0;
}

.brand-text {
    text-align: center;
    width: 100%;
    min-width: 0;
}
.brand-text h2 {
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--cc-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-text span {
    font-size: 10px;
    color: var(--cc-primary);
    font-weight: 800;
    letter-spacing: 0.8px;
    margin-top: 4px;
    display: block;
}

/* زر إغلاق الـ sidebar (يظهر فقط على الموبايل، أعلى يسار الـ header) */
.close-sidebar {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--cc-text-muted);
    display: none;
    align-items: center;
    justify-content: center;
}
.close-sidebar:hover { color: var(--cc-danger); background: var(--cc-surface-2); }

.sidebar-nav {
    padding: 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    color: var(--cc-text-muted);
    transition: 0.2s;
}

.nav-link:hover { background: var(--cc-bg); color: var(--cc-primary); }
.nav-link.active { background: var(--cc-primary-glow); color: var(--cc-primary); }

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

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cc-danger);
    font-size: 14px;
    font-weight: 800;
    transition: 0.2s;
}
.logout-btn:hover { opacity: 0.8; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.5);
    z-index: 999;
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

/* ====== Sidebar user block (في sidebar-footer) ====== */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--cc-border);
}
.sidebar-user .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cc-primary-glow);
    color: var(--cc-primary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name {
    font-size: 13px;
    font-weight: 900;
    color: var(--cc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 10px;
    font-weight: 800;
    color: var(--cc-text-muted);
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* ====== Main wrapper ====== */
.main-wrapper {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin 0.3s;
}

.content { padding: 24px; flex: 1; }

/* ====== Mobile Menu FAB (يظهر فقط على الموبايل) ====== */
.mobile-menu-fab {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--cc-surface);
    color: var(--cc-text);
    border: 1px solid var(--cc-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    z-index: 95;
    align-items: center;
    justify-content: center;
}
.mobile-menu-fab:hover { color: var(--cc-primary); border-color: var(--cc-primary); }

/* ====== Impersonation Banner (يظهر للأدمن أثناء انتحال شخصية التاجر) ====== */
.impersonation-bar {
    background: linear-gradient(90deg, #fff7ed, #fef3c7);
    border: 1px solid var(--cc-warning);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}
.impersonation-bar .imp-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 800;
    color: #92400e;
}
.impersonation-bar i { color: var(--cc-warning); flex-shrink: 0; }
.impersonation-bar span { flex: 1; min-width: 200px; }
.impersonation-bar .imp-end-btn {
    background: var(--cc-warning);
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 900;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.impersonation-bar .imp-end-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ====== Breadcrumbs ====== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--cc-text-muted);
    margin-bottom: 12px;
}
.breadcrumb a {
    color: var(--cc-text-muted);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.breadcrumb a:hover { color: var(--cc-primary); }
.breadcrumb .sep { opacity: 0.4; font-weight: 900; }
.breadcrumb .current { color: var(--cc-primary); }

.page-subtitle {
    font-size: 13px;
    color: var(--cc-text-muted);
    font-weight: 700;
    margin-bottom: 16px;
}

/* ====== Page Header (intro inside .content) ====== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.page-header h2 { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.page-header p { color: var(--cc-text-muted); font-size: 13px; font-weight: 700; }

/* ====== Stat Cards ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: 0.3s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--cc-primary); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--cc-primary-glow);
    color: var(--cc-primary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.stat-info h3 { font-size: 13px; color: var(--cc-text-muted); margin-bottom: 6px; font-weight: 800; }
.stat-info p { font-size: 22px; font-weight: 900; color: var(--cc-text); line-height: 1; }

/* ====== Card Panel ====== */
.card-panel {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    width: 100%;
}
.card-panel + .card-panel { margin-top: 20px; }

.card-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.card-panel-header h2 { font-size: 16px; font-weight: 900; }

/* ====== Tables ====== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

table { width: 100%; border-collapse: collapse; min-width: 600px; }

th {
    text-align: right;
    padding: 14px;
    background: var(--cc-surface-2);
    color: var(--cc-text-muted);
    font-size: 13px;
    font-weight: 800;
    border-bottom: 1px solid var(--cc-border);
    white-space: nowrap;
}

td {
    padding: 14px;
    border-bottom: 1px solid var(--cc-border);
    font-size: 14px;
    font-weight: 700;
}

tr:last-child td { border-bottom: 0; }

.empty-row td {
    text-align: center;
    color: var(--cc-text-muted);
    padding: 40px 16px;
    font-weight: 700;
}

/* ====== Empty State ====== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    gap: 14px;
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--cc-surface-2);
    color: var(--cc-text-muted);
    display: grid;
    place-items: center;
    margin-bottom: 4px;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--cc-text);
}
.empty-state-desc {
    font-size: 13px;
    font-weight: 700;
    color: var(--cc-text-muted);
    max-width: 360px;
    line-height: 1.6;
}
.empty-state .btn { margin-top: 8px; }
/* When used inside a table */
td .empty-state { padding: 40px 16px; }

/* ====== Badges ====== */
.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
    display: inline-block;
}
.badge-success { background: var(--cc-success-bg); color: #166534; }
.badge-pending { background: var(--cc-warning-bg); color: #b45309; }
.badge-failed { background: var(--cc-danger-bg); color: #991b1b; }
.badge-info { background: var(--cc-info-bg); color: #075985; }
.badge-neutral { background: var(--cc-surface-2); color: var(--cc-text-muted); border: 1px solid var(--cc-border); }

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    transition: 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--cc-primary);
    color: #fff;
    box-shadow: 0 4px 10px var(--cc-primary-glow);
}
.btn-primary:hover { transform: translateY(-2px); opacity: 0.92; }

.btn-secondary {
    background: var(--cc-surface-2);
    color: var(--cc-text);
    border-color: var(--cc-border);
}
.btn-secondary:hover { background: var(--cc-bg); }

.btn-danger {
    background: var(--cc-danger);
    color: #fff;
}
.btn-danger:hover { opacity: 0.92; }

.btn-ghost { color: var(--cc-text-muted); }
.btn-ghost:hover { background: var(--cc-bg); color: var(--cc-text); }

.btn-block { width: 100%; }

/* ====== Icon Action Buttons (small square inside tables) ====== */
.action-btns { display: flex; gap: 6px; align-items: center; }
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    transition: 0.2s;
    border: 1px solid var(--cc-border);
    background: var(--cc-surface);
    color: var(--cc-text-muted);
}
.btn-icon:hover { opacity: 0.85; transform: scale(1.05); }
.btn-icon.edit     { color: var(--cc-primary); background: var(--cc-primary-glow); border-color: transparent; }
.btn-icon.delete   { color: var(--cc-danger);  background: var(--cc-danger-bg);   border-color: transparent; }
.btn-icon.suspend  { color: var(--cc-warning); background: var(--cc-warning-bg);  border-color: transparent; }
.btn-icon.activate { color: var(--cc-success); background: var(--cc-success-bg);  border-color: transparent; }
.btn-icon.view     { color: var(--cc-info);    background: var(--cc-info-bg);     border-color: transparent; }

/* ====== Forms ====== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    font-size: 13px;
    color: var(--cc-text);
}

.form-control,
input[type="text"].form-control,
input[type="number"].form-control,
input[type="password"].form-control,
input[type="email"].form-control,
select.form-control,
textarea.form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--cc-border);
    background: var(--cc-surface-2);
    font-size: 14px;
    font-weight: 700;
    color: var(--cc-text);
    outline: none;
    transition: 0.3s;
    font-family: inherit;
}
.form-control:focus {
    border-color: var(--cc-primary);
    background: var(--cc-surface);
    box-shadow: 0 0 0 4px var(--cc-primary-glow);
}
.form-control::placeholder { color: #94a3b8; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--cc-text-muted); margin-top: 4px; font-weight: 700; }

/* ====== Flash Messages / Alerts ====== */
.alert {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert-success { background: var(--cc-success-bg); color: #166534; border-color: rgba(22, 163, 74, 0.2); }
.alert-danger  { background: var(--cc-danger-bg);  color: #991b1b; border-color: rgba(220, 38, 38, 0.2); }
.alert-warning { background: var(--cc-warning-bg); color: #92400e; border-color: rgba(217, 119, 6, 0.2); }
.alert-info    { background: var(--cc-info-bg);    color: #075985; border-color: rgba(2, 132, 199, 0.2); }

/* ====== Modals ====== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.55);
    z-index: 2000;
    display: none;
    place-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-overlay.show { display: grid; }

.modal-card {
    background: var(--cc-surface);
    width: 100%;
    max-width: 520px;
    border-radius: 24px;
    padding: 28px;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-card.lg { max-width: 720px; }
.modal-card.sm { max-width: 400px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; font-weight: 900; }
.modal-close { color: var(--cc-text-muted); padding: 4px; }
.modal-close:hover { color: var(--cc-danger); }

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 20px;
}

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

/* ====== Switch (toggle) ====== */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}
.switch .slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    transition: 0.3s;
    border-radius: 50%;
}
.switch input:checked + .slider { background-color: var(--cc-primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ====== Filter Chips ====== */
.filters-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.filters-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    font-size: 13px;
    font-weight: 800;
    color: var(--cc-text-muted);
    white-space: nowrap;
    transition: 0.2s;
}
.filter-chip:hover { color: var(--cc-text); }
.filter-chip.active {
    background: var(--cc-primary-glow);
    color: var(--cc-primary);
    border-color: var(--cc-primary);
}

/* ====== Role Badges (users page) ====== */
.role-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.role-super_admin { background: var(--cc-danger-bg);   color: var(--cc-danger); }
.role-merchant    { background: var(--cc-primary-glow); color: var(--cc-primary); }
.role-provider    { background: var(--cc-warning-bg);   color: var(--cc-warning); }
.role-customer    { background: #f1f5f9;                color: #475569; }

/* ============== PROFESSIONAL SETTINGS CARD PATTERN ============== */
.s-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 18px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.s-card-header {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--cc-border);
    background: linear-gradient(135deg, var(--cc-surface-2) 0%, var(--cc-surface) 100%);
}
.s-card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: grid; place-items: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}
.s-card-icon.blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.s-card-icon.green  { background: linear-gradient(135deg, #10b981, #059669); }
.s-card-icon.amber  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.s-card-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.s-card-icon.red    { background: linear-gradient(135deg, #ef4444, #dc2626); }
.s-card-icon.teal   { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.s-card-header-text { flex: 1; min-width: 0; }
.s-card-header-text h3 { font-size: 16px; font-weight: 900; margin: 0; color: var(--cc-text); }
.s-card-header-text p  { font-size: 12px; color: var(--cc-text-muted); margin-top: 4px; font-weight: 700; line-height: 1.5; }
.s-card-body   { padding: 20px; }
.s-card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--cc-border);
    background: var(--cc-surface-2);
    display: flex; gap: 10px; flex-wrap: wrap;
}
.s-row-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .s-row-2 { grid-template-columns: 1fr 1fr; } }

/* Status pill */
.s-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 900;
}
.s-pill.green { background: rgba(16,185,129,0.12); color: #059669; }
.s-pill.amber { background: rgba(245,158,11,0.14); color: #d97706; }
.s-pill.red   { background: rgba(239,68,68,0.12); color: #dc2626; }
.s-pill.gray  { background: var(--cc-surface-2); color: var(--cc-text-muted); }
.s-pill.blue  { background: rgba(59,130,246,0.12); color: #2563eb; }

/* Toggle switch */
.s-toggle { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.s-toggle input { opacity: 0; width: 0; height: 0; }
.s-toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 999px; transition: 0.25s; }
.s-toggle-slider:before { position: absolute; content: ''; height: 20px; width: 20px; top: 3px; right: 3px; border-radius: 50%; background: #fff; transition: 0.25s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.s-toggle input:checked + .s-toggle-slider { background: var(--cc-primary); }
.s-toggle input:checked + .s-toggle-slider:before { transform: translateX(-22px); }

/* Settings tabs (sidebar + content layout) */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}
.settings-tabs {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    padding: 8px;
    position: sticky; top: 16px;
}
.settings-tab {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--cc-text);
    text-decoration: none;
    font-weight: 800; font-size: 13.5px;
    cursor: pointer;
    transition: 0.18s;
    border: 1px solid transparent;
}
.settings-tab:hover { background: var(--cc-surface-2); }
.settings-tab.active {
    background: var(--cc-primary-glow);
    color: var(--cc-primary);
    border-color: var(--cc-primary);
}
.settings-tab i { flex-shrink: 0; opacity: 0.85; }
.settings-tab.active i { opacity: 1; }
.settings-tab-num {
    margin-inline-start: auto;
    background: var(--cc-surface-2);
    color: var(--cc-text-muted);
    width: 22px; height: 22px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 900;
}
.settings-tab.active .settings-tab-num {
    background: rgba(255,255,255,0.45);
    color: var(--cc-primary);
}
.settings-pane { display: none; }
.settings-pane.active { display: block; animation: paneFade 0.22s ease-out; }
@keyframes paneFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 880px) {
    .settings-layout { grid-template-columns: 1fr; gap: 14px; }
    .settings-tabs {
        position: static;
        padding: 4px;
        display: flex; overflow-x: auto; gap: 4px;
        scrollbar-width: thin;
    }
    .settings-tab { flex-shrink: 0; padding: 9px 14px; font-size: 12.5px; }
    .settings-tab-num { display: none; }
}

/* Period chips (filter) */
.period-chips { display: inline-flex; gap: 4px; background: var(--cc-surface-2); padding: 4px; border-radius: 12px; border: 1px solid var(--cc-border); }
.period-chip {
    padding: 6px 14px; border: 0; background: transparent;
    color: var(--cc-text-muted); font-weight: 800; font-size: 12px;
    border-radius: 8px; cursor: pointer; text-decoration: none;
    transition: 0.18s;
}
.period-chip:hover { color: var(--cc-text); }
.period-chip.active { background: var(--cc-primary); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.10); }

/* ============== SIDEBAR NAV LINK BADGE (red dot for unread) ============== */
.nav-link { position: relative; display: flex; align-items: center; }
.nav-link > span:first-of-type { flex: 1; }
.nav-link-badge {
    background: #ef4444;
    color: #fff;
    min-width: 20px; height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px; font-weight: 900;
    display: grid; place-items: center;
    margin-inline-start: auto;
    animation: navBadgePulse 1.6s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
}
.nav-link-badge[hidden] { display: none !important; }
@keyframes navBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ============== NETWORK SWITCHER (multi-network) ============== */
.network-switcher {
    position: relative;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cc-border);
}
.net-current {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    color: var(--cc-text);
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: 0.18s;
}
.net-current:disabled { cursor: default; }
.network-switcher.has-multiple .net-current:hover {
    border-color: var(--cc-primary);
    background: var(--cc-primary-glow);
}
.net-current-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    gap: 2px;
}
.net-current-label {
    font-size: 10px; font-weight: 800;
    color: var(--cc-text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.net-current-name {
    font-size: 14px; font-weight: 900;
    color: var(--cc-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.net-current-chev { color: var(--cc-text-muted); transition: 0.2s; flex-shrink: 0; }
.network-switcher.open .net-current-chev { transform: rotate(180deg); color: var(--cc-primary); }

.net-menu {
    position: absolute;
    top: calc(100% - 4px);
    inset-inline-start: 16px;
    inset-inline-end: 16px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14);
    overflow: hidden;
    z-index: 50;
    animation: netMenuIn 0.18s ease-out;
}
@keyframes netMenuIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.net-menu-head {
    padding: 8px 12px 6px;
    font-size: 11px; font-weight: 900;
    color: var(--cc-text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--cc-border);
}
.net-menu-item-form { margin: 0; }
.net-menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    text-align: start;
    cursor: pointer;
    font: inherit;
    color: var(--cc-text);
    transition: 0.15s;
}
.net-menu-item:hover:not(:disabled) { background: var(--cc-surface-2); }
.net-menu-item.active {
    background: var(--cc-primary-glow);
    color: var(--cc-primary);
    font-weight: 900;
    cursor: default;
}
.net-menu-item .net-item-name {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.net-menu-item.is-sub {
    padding-inline-start: 28px; /* indent للـ sub */
    font-size: 13px;
}
.net-menu-item.is-sub::before {
    content: ''; position: absolute;
    inset-inline-start: 18px; top: 50%;
    width: 8px; height: 1px;
    background: var(--cc-border);
}
.net-menu-item { position: relative; }
.net-menu-item .net-item-badge {
    font-size: 10px; font-weight: 900;
    padding: 2px 6px; border-radius: 6px;
    background: var(--cc-primary-glow);
    color: var(--cc-primary);
    letter-spacing: 0.3px;
}
.net-menu-item.active .net-item-badge {
    background: rgba(255, 255, 255, 0.4);
    color: var(--cc-primary);
}

/* ====== Money amounts (transactions) ====== */
.amt-gross { font-weight: 900; }
.amt-comm  { color: var(--cc-success); }
.amt-fee   { color: var(--cc-danger); font-size: 12px; opacity: 0.85; }
.amt-net   { color: var(--cc-primary); }

/* ====== Spinner ====== */
@keyframes cc-spin { to { transform: rotate(360deg); } }
.cc-spin { animation: cc-spin 0.8s linear infinite; display: inline-block; }

/* ====== Toasts ====== */
.toast-container {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-right: 4px solid var(--cc-primary);
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 13px;
    animation: toastIn 0.4s ease;
    transition: opacity 0.5s;
}
.toast.danger  { border-right-color: var(--cc-danger); }
.toast.warning { border-right-color: var(--cc-warning); }
.toast.success { border-right-color: var(--cc-success); }
@keyframes toastIn {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ====== Responsive ====== */
@media (max-width: 992px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { opacity: 1; visibility: visible; }
    .close-sidebar { display: flex; }
    .main-wrapper { margin-right: 0; }
    .mobile-menu-fab { display: flex; }
    /* مسافة فوقية لتفادي الـ FAB العائم */
    .content { padding-top: 72px; }
}

@media (max-width: 576px) {
    .content { padding: 72px 16px 16px; }
    .stat-card { padding: 18px; border-radius: 16px; }
    .card-panel { padding: 16px; border-radius: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .modal-card { padding: 22px; border-radius: 20px; }
}
