/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #f1f5f9;
    --bg2:       #ffffff;
    --bg3:       #f8fafc;
    --border:    #e2e8f0;
    --text:      #1e293b;
    --muted:     #64748b;
    --blue:      #1e40af;
    --blue-lt:   #3b82f6;
    --accent:    #60a5fa;
    --green:     #16a34a;
    --yellow:    #d97706;
    --red:       #dc2626;
    --orange:    #ea580c;
    --cyan:      #0891b2;
    --cyan-lt:   #22d3ee;
    --radius:    14px;
    --shadow:    0 1px 4px rgba(0,0,0,.07);
    --shadow-md: 0 4px 24px rgba(0,0,0,.10);
    /* sidebar */
    --sb-w:      260px;
    --sb-bg:     #1e3a8a;
    --sb-dk:     #1e3069;
    /* topbar */
    --tb-h:      56px;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
}
[dir="rtl"] body, [dir="rtl"] { direction: rtl; }
[dir="ltr"] body, [dir="ltr"] { direction: ltr; }

a { color: var(--blue-lt); text-decoration: none; }
a:hover { text-decoration: underline; }

input, textarea, select {
    width: 100%;
    background: #fff;
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    direction: inherit;
    transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--blue-lt);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
textarea { resize: vertical; }

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 9px 20px; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: none; transition: all .18s; text-decoration: none; line-height: 1.4;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary  { background: var(--blue);    color: #fff; }
.btn-success  { background: var(--green);   color: #fff; }
.btn-danger   { background: var(--red);     color: #fff; }
.btn-warning  { background: var(--yellow);  color: #fff; }
.btn-cyan     { background: var(--blue-lt); color: #fff; }
.btn-outline  { background: #fff; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--blue-lt); color: var(--blue); }
.btn-logout   { background: #fff5f5; color: var(--red); padding: 8px 16px; border-radius: 8px; border: 1px solid #fecaca; }
.btn-logout:hover { background: var(--red); color: #fff; }
.btn-full { width: 100%; }
.btn-sm   { padding: 5px 12px; font-size: 12px; }

/* ─── Container & Layout ───────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
/* Inside sidebar layout — fill available space, left-aligned */
.app-content .container { max-width: none; margin: 0; }
.app-content main.container[style*="max-width"] { margin: 0; }

.page-title {
    font-size: 20px; font-weight: 700; margin-bottom: 22px;
    color: var(--text); letter-spacing: -.2px;
}

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--text); }

/* ─── Stats Grid ───────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px; margin-bottom: 22px;
}
.stat-card {
    background: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 20px; text-align: center;
    transition: all .2s;
    box-shadow: var(--shadow);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon  { font-size: 30px; margin-bottom: 10px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--blue); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ─── Auth ──────────────────────────────────────────────────────── */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #dbeafe 0%, #f1f5f9 50%, #e0f2fe 100%);
}
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
    background: #fff;
    border: none;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 40px rgba(0,0,0,.12);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-icon { font-size: 52px; display: block; margin-bottom: 8px; }
.auth-logo h1 { font-size: 22px; color: var(--text); font-weight: 800; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--muted); font-size: 14px; }

.ref-banner {
    background: #dbeafe; border: 1px solid #93c5fd;
    border-radius: 8px; padding: 10px 14px; margin-bottom: 16px;
    font-size: 14px; color: var(--blue); text-align: center;
}

/* ─── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; margin-bottom: 6px;
    font-size: 13px; color: var(--text); font-weight: 600;
}
.form-select { appearance: none; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.checkbox-label input { width: auto; }

/* ─── Alerts ───────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.info-box {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px; margin-bottom: 16px;
    font-size: 13px; color: var(--muted);
}

/* ─── Badges ───────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-green  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-red    { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-yellow { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-cyan   { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ─── Tables ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    background: var(--bg3); color: var(--muted);
    padding: 10px 14px; text-align: start;
    font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8faff; }
.row-admin td { background: #fff5f5; }
.text-green { color: var(--green); font-weight: 600; }

/* ─── Referral link box ─────────────────────────────────────────── */
.ref-link-box { display: flex; gap: 8px; align-items: center; }
.ref-link-box input { font-size: 13px; background: var(--bg3); }

/* ─── Commission rules ──────────────────────────────────────────── */
.commission-rules { display: flex; flex-direction: column; gap: 8px; }
.rule-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--bg3);
    border-radius: 10px; font-size: 14px;
    border: 1px solid var(--border);
}
.rule-item.rule-admin { background: #fef2f2; border: 1px solid #fecaca; }
.rule-pos {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.pos-normal { background: #dcfce7; color: #16a34a; }
.pos-admin  { background: #fee2e2; color: #dc2626; }
.rule-item span:nth-child(2) { flex: 1; }

/* ─── Subscribe pricing ─────────────────────────────────────────── */
.pricing-card {
    text-align: center; background: #fff;
    border: 2px solid var(--blue);
    border-radius: var(--radius); padding: 28px; margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(30,64,175,.1);
}
.price-amount { font-size: 44px; font-weight: 800; color: var(--blue); }
.price-period { color: var(--muted); margin-bottom: 18px; }
.price-features { list-style: none; text-align: right; }
.price-features li { padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.price-features li:last-child { border: none; }

/* ─── Products grid ─────────────────────────────────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.product-cat {
    display: inline-block; font-size: 11px; font-weight: 700;
    background: #dbeafe; color: var(--blue);
    padding: 3px 10px; border-radius: 20px; margin-bottom: 8px;
    border: 1px solid #93c5fd;
}
.product-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.product-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }
.product-price { font-size: 18px; font-weight: 800; color: var(--blue); display: block; }
.product-commission { font-size: 12px; color: var(--green); font-weight: 600; }
.aff-link-box { background: var(--bg3); border-radius: 8px; padding: 8px; margin-top: 8px; }
.aff-input { font-size: 11px; padding: 6px 8px; }

/* ─── Search bar ────────────────────────────────────────────────── */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-bar input  { flex: 1; min-width: 200px; }
.search-bar select { width: 160px; }

/* ─── Admin products grid ───────────────────────────────────────── */
.products-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.product-admin-card {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px;
    display: flex; gap: 12px; align-items: flex-start;
    transition: box-shadow .2s;
}
.product-admin-card:hover { box-shadow: var(--shadow-md); }
.product-admin-card.inactive { opacity: .55; }
.product-admin-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.product-admin-card .product-no-img {
    width: 64px; height: 64px; font-size: 28px; border-radius: 8px;
    flex-shrink: 0; background: #fff; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
}
.product-admin-info { flex: 1; }
.product-admin-info h4 { font-size: 14px; margin-bottom: 4px; font-weight: 700; }
.product-admin-actions { display: flex; gap: 4px; flex-direction: column; }

/* ─── Empty state ───────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h3 { font-size: 20px; margin: 16px 0 8px; color: var(--text); }

/* ─── Landing page ──────────────────────────────────────────────── */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 40px 20px;
    background: radial-gradient(ellipse at top, rgba(30,64,175,.07) 0%, transparent 60%);
}
.hero h1 { font-size: 52px; font-weight: 800; color: var(--text); line-height: 1.2; margin-bottom: 20px; }
.hero h1 span { color: var(--blue); }
.hero p { font-size: 18px; color: var(--muted); max-width: 600px; margin-bottom: 36px; line-height: 1.7; }
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-btns .btn { padding: 14px 36px; font-size: 16px; }
.btn-ghost { border: 1.5px solid var(--border); color: var(--text); background: #fff; }

.features { padding: 80px 20px; max-width: 1100px; margin: 0 auto; }
.features h2 { text-align: center; font-size: 36px; margin-bottom: 50px; font-weight: 800; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature-card {
    background: #fff; border: none;
    border-radius: var(--radius); padding: 28px; text-align: center;
    box-shadow: var(--shadow); transition: all .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 44px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; margin-bottom: 10px; color: var(--blue); font-weight: 700; }
.feature-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

.how-it-works { padding: 60px 20px; background: #e0e7f9; }
.how-it-works h2 { text-align: center; font-size: 36px; margin-bottom: 40px; font-weight: 800; max-width: 1100px; margin-inline: auto; }
.steps { display: flex; gap: 0; max-width: 900px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.step { flex: 1; min-width: 200px; text-align: center; padding: 20px; }
.step-num {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--blue); color: #fff;
    font-size: 20px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 4px 14px rgba(30,64,175,.3);
}
.step h4 { font-size: 16px; margin-bottom: 8px; font-weight: 700; }
.step p { font-size: 13px; color: var(--muted); }

.cta {
    text-align: center; padding: 80px 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #fff;
}
.cta h2 { font-size: 36px; margin-bottom: 16px; color: #fff; font-weight: 800; }
.cta p  { font-size: 16px; color: rgba(255,255,255,.8); margin-bottom: 30px; }

footer {
    text-align: center; padding: 24px;
    border-top: 1px solid var(--border);
    color: var(--muted); font-size: 13px;
    background: #fff;
}

/* ─── Responsive (non-sidebar pages) ───────────────────────────── */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .hero h1 { font-size: 32px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .search-bar { flex-direction: column; }
    .search-bar select { width: 100%; }
    div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
    .steps { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT — WASHY-STYLE SIDEBAR
═══════════════════════════════════════════════════════════════ */

/* ── Sidebar ── */
.app-sidebar {
    width: var(--sb-w); min-width: var(--sb-w);
    background: var(--sb-dk);
    display: flex; flex-direction: column;
    position: fixed; top: 0; right: 0; left: auto;
    height: 100vh; overflow: hidden;
    z-index: 200;
}
/* LTR: sidebar on left */
[dir="ltr"] .app-sidebar { right: auto; left: 0; }
.app-sidebar nav {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.app-sidebar nav::-webkit-scrollbar { width: 3px; }
.app-sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

/* Brand */
.sb-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 16px;
    font-size: 16px; font-weight: 800; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-decoration: none; flex-shrink: 0;
}
.sb-brand:hover { text-decoration: none; color: #fff; }
.sb-brand .sb-gem { font-size: 22px; }
.sb-brand .b-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}

/* Logo in sidebar */
.sb-logo-img { height: 34px; width: auto; border-radius: 6px; object-fit: contain; }

/* User card */
.sb-user {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.sb-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: #fff;
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-uname  { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.sb-uemail { font-size: 11px; color: rgba(255,255,255,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Balance */
.sb-balance {
    margin: 10px 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}
.sb-bal-lbl { font-size: 11px; color: rgba(255,255,255,.5); font-weight: 600; }
.sb-bal-val { font-size: 15px; font-weight: 900; color: #fff; }

/* Nav sections */
.sb-section { padding: .4rem 0; }
.sb-section + .sb-section { border-top: 1px solid rgba(255,255,255,.07); }
.sb-section-lbl {
    color: rgba(255,255,255,.65); font-size: .63rem; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    padding: .5rem 1.1rem .2rem;
}

/* Nav links */
.sb-nav { padding: 6px 0; }
.sb-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    border-right: 3px solid transparent; border-left: 3px solid transparent;
    color: rgba(255,255,255,.65); font-size: .845rem; font-weight: 500;
    text-decoration: none; transition: all .15s; line-height: 1.3;
}
.sb-link:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.sb-link.active { color: #fff; background: rgba(255,255,255,.1); border-right-color: var(--accent); font-weight: 700; }
[dir="ltr"] .sb-link.active { border-right-color: transparent; border-left-color: var(--accent); }
.sb-icon  { font-size: 1rem; min-width: 18px; text-align: center; flex-shrink: 0; }
.sb-lbl   { flex: 1; }
.sb-sep   { height: 1px; background: rgba(255,255,255,.08); margin: 5px 14px; }

/* Admin badge */
.sb-admin-badge {
    margin: 8px 12px;
    padding: 8px 14px; border-radius: 8px;
    background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.25);
    color: #fde68a; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.sb-badge {
    margin-inline-start: auto; background: var(--red); color: #fff;
    font-size: 10px; font-weight: 800;
    padding: 2px 7px; border-radius: 100px;
    min-width: 18px; text-align: center;
}

/* Language switcher */
.sb-lang { display: flex; gap: 6px; padding: 8px 12px; flex-shrink: 0; }
.sb-lang-btn {
    flex: 1; text-align: center; padding: 6px 4px;
    border-radius: 7px; font-size: 12px; font-weight: 700;
    color: rgba(255,255,255,.5); text-decoration: none;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
    transition: all .2s;
}
.sb-lang-btn:hover { color: #fff; background: rgba(255,255,255,.15); text-decoration: none; }
.sb-lang-btn.active { background: var(--blue-lt); color: #fff; border-color: var(--blue-lt); }

/* Sidebar footer */
.sb-foot { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.sb-logout {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-radius: 8px;
    color: rgba(252,165,165,.85); font-size: .845rem; font-weight: 500;
    text-decoration: none; transition: all .18s;
}
.sb-logout:hover { color: #fff; background: rgba(220,38,38,.2); text-decoration: none; }

/* ── Topbar ── */
.app-topbar {
    position: sticky; top: 0; z-index: 150;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 0 20px; height: var(--tb-h);
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    margin-right: var(--sb-w); margin-left: 0;
}
[dir="ltr"] .app-topbar { margin-right: 0; margin-left: var(--sb-w); }
.tb-brand { font-size: 16px; font-weight: 800; color: var(--blue); display: flex; align-items: center; gap: 8px; }
.tb-page-title { font-weight: 700; font-size: .95rem; color: var(--text); margin: 0; }
.tb-end { display: flex; align-items: center; gap: 10px; }
.tb-burger {
    display: none; align-items: center; justify-content: center;
    width: 36px; height: 36px; background: var(--bg3);
    border: 1px solid var(--border); border-radius: 9px; cursor: pointer; color: var(--text); flex-shrink: 0;
}
.tb-burger i { font-size: 1.2rem; }
.tb-user-chip {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg3); border-radius: 8px;
    padding: 5px 10px; font-size: .78rem; color: var(--muted);
    text-decoration: none;
}
.tb-user-chip i { color: var(--blue); }

/* Language switcher in topbar */
.tb-lang-sw {
    display: flex; align-items: center;
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
    flex-shrink: 0;
}
.tb-lang-sw a {
    padding: 5px 10px; font-size: 11px; font-weight: 700;
    color: var(--muted); text-decoration: none;
    transition: all .15s; line-height: 1;
}
.tb-lang-sw a:hover { color: var(--blue); background: rgba(37,99,235,.06); }
.tb-lang-sw a.active { background: var(--blue); color: #fff; }

/* ── Main content area ── */
.app-content { margin-right: var(--sb-w); margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; }
[dir="ltr"] .app-content { margin-right: 0; margin-left: var(--sb-w); }

/* Overlay */
.sb-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 180;
    backdrop-filter: blur(2px);
}
.sb-overlay.open { display: block; }
.sb-close-btn { display: none; }

/* ── Mobile bottom nav ── */
.mob-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom);
}
.mob-bottom-nav .mob-nav-inner { display: flex; }
.mob-bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: .5rem .3rem .4rem; color: #94a3b8; text-decoration: none;
    font-size: .6rem; gap: .15rem; transition: color .15s;
}
.mob-bottom-nav a i { font-size: 1.25rem; }
.mob-bottom-nav a.active { color: var(--blue); }
.mob-bottom-nav a:hover { color: var(--blue); text-decoration: none; }

/* ═══ MOBILE ≤ 860px ═══ */
@media (max-width: 860px) {
    .app-topbar { margin-right: 0; margin-left: 0; }
    .app-content { margin-right: 0; margin-left: 0; padding-bottom: 64px; }
    .tb-burger { display: flex !important; }
    .tb-user-chip { display: none; }
    .tb-hide-xs { display: none; }
    .tb-lang-sw { display: flex; }
    /* RTL: sidebar slides in from right */
    .app-sidebar {
        transform: translateX(110%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        z-index: 200; width: min(300px, 88vw); min-width: 0;
        box-shadow: -8px 0 40px rgba(0,0,0,.3);
        background: #050d1a;
    }
    .app-sidebar.open { transform: translateX(0); }
    /* LTR: sidebar slides in from left */
    [dir="ltr"] .app-sidebar { right: auto; left: 0; transform: translateX(-110%); box-shadow: 8px 0 40px rgba(0,0,0,.3); }
    [dir="ltr"] .app-sidebar.open { transform: translateX(0); }
    .sb-close-btn {
        display: flex; align-items: center; justify-content: center;
        width: 30px; height: 30px; border-radius: 50%;
        border: none; background: rgba(255,255,255,.12);
        color: #fff; font-size: 1.1rem; cursor: pointer;
        margin-right: auto; transition: background .15s;
        flex-shrink: 0;
    }
    [dir="ltr"] .sb-close-btn { margin-right: 0; margin-left: auto; }
    .sb-close-btn:hover { background: rgba(255,255,255,.22); }
    .mob-bottom-nav { display: block; }
    .sb-lang { display: none; }
    .container { padding: 14px 12px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
    .container { padding: 10px 8px; }
}
