/* تحسينات بوابة المساهم — بدون تعارض مع لوحة الإدارة */

.member-portal-layout { display: flex; min-height: 100vh; background: var(--surface-page); }
.member-portal-sidebar { width: 260px; max-width: 88vw; background: linear-gradient(180deg, #1b4332 0%, #142e24 100%); color: #fff; position: fixed; right: 0; top: 0; bottom: 0; z-index: 1050; display: flex; flex-direction: column; transition: transform 0.3s ease; box-shadow: -4px 0 24px rgba(0,0,0,0.15); }
.member-portal-brand { padding: 1.25rem 1rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.member-portal-brand img { max-height: 52px; border-radius: 10px; }
.member-portal-brand h1 { font-size: 0.85rem; font-weight: 800; color: var(--gold-light); margin: 0.6rem 0 0; line-height: 1.4; }
.member-portal-nav { flex: 1; overflow-y: auto; padding: 0.5rem 0 1rem; }
.member-portal-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.1rem; color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.9rem; font-weight: 600; border-right: 3px solid transparent; }
.member-portal-link:hover, .member-portal-link.active { background: rgba(255,255,255,0.08); color: #fff; border-right-color: var(--gold); }
.member-portal-link i { width: 22px; text-align: center; }
.member-portal-main { flex: 1; margin-right: 260px; min-width: 0; }
.member-portal-topbar { background: var(--surface-card); border-bottom: 1px solid var(--surface-border); padding: 0.85rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 1020; box-shadow: var(--shadow-sm); }
.member-portal-body { padding: 1.25rem; }
.member-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.member-kpi { background: var(--surface-card); border: 1px solid var(--surface-border); border-radius: var(--radius-md); padding: 1rem; text-align: center; box-shadow: var(--shadow-sm); }
.member-kpi .val { font-size: 1.2rem; font-weight: 800; color: var(--green); }
.member-kpi .lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-top: 0.2rem; }
.member-welcome-banner { background: linear-gradient(135deg, var(--green-dark), var(--green)); color: #fff; border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-md); }
.member-welcome-banner h2 { font-size: 1.35rem; font-weight: 800; margin: 0 0 0.35rem; }
.member-portal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1040; }
.member-portal-overlay.show { display: block; }
body.member-sidebar-open { overflow: hidden; }

.portal-tabs .nav-link { color: var(--text-secondary); font-weight: 600; border: none !important; }
.portal-tabs .nav-link.active { color: var(--green) !important; border-bottom: 2px solid var(--green) !important; background: transparent !important; }
.portal-alert { border-radius: var(--radius-md); }
.portal-quick-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; padding: 1.1rem; border-radius: var(--radius-md); background: var(--surface-card); border: 1px solid var(--surface-border); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--green-dark); font-weight: 700; font-size: 0.85rem; min-height: 96px; transition: transform 0.2s, box-shadow 0.2s; }
.portal-quick-card i { font-size: 1.5rem; color: var(--green); }
.portal-quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--green-dark); }
.portal-quick-card.accent-gold i { color: var(--gold); }
.portal-quick-card.accent-wa i { color: #25d366; }
.member-chart-wrap { position: relative; width: 100%; min-height: 180px; }
.member-chart-wrap canvas { background: transparent !important; }

/* زر الإشعارات — أسلوب شبكات التواصل */
.member-notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
.member-notif-btn:hover:not(:disabled) {
    background: var(--surface-card);
    color: var(--green);
    transform: scale(1.05);
}
.member-notif-btn i { font-size: 1.05rem; }
.member-notif-btn--empty { opacity: 0.55; cursor: default; }
.member-notif-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e63946;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--surface-card);
    box-shadow: 0 2px 6px rgba(230, 57, 70, 0.45);
}
.member-notif-modal .modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
.member-notif-modal .modal-header { background: linear-gradient(135deg, var(--green-dark), var(--green)); color: #fff; padding: 1rem 1.25rem; }
.member-notif-modal .modal-header .modal-title { color: #fff; font-size: 1rem; }
.member-notif-modal .modal-header .btn-close { filter: invert(1); opacity: 0.85; }
.member-notif-list { display: flex; flex-direction: column; gap: 0; }
.member-notif-item {
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid var(--surface-border);
    transition: background-color 0.2s, transform 0.15s;
}
.member-notif-item:last-child { border-bottom: none; }
.member-notif-item.has-link:hover {
    background-color: rgba(45, 106, 79, 0.05);
    border-radius: var(--radius-md);
}
[data-theme="dark"] .member-notif-item.has-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.member-notif-delete-btn {
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
}
.member-notif-delete-btn:hover {
    opacity: 1 !important;
    transform: scale(1.1);
    color: #e63946;
}
.member-notif-item-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.member-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    margin-top: 0.45rem;
    flex-shrink: 0;
}
.member-notif-item-head strong { flex: 1; font-size: 0.92rem; color: var(--text-primary); }
.member-notif-time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.member-notif-body { margin: 0.35rem 1.25rem 0 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; }

.nav-cta-member { background: var(--brand-orange) !important; color: #fff !important; border-radius: var(--radius-sm); font-weight: 700; padding: 0.45rem 1rem !important; }
.nav-cta-member:hover { background: #d35400 !important; color: #fff !important; }
.theme-toggle-btn--topbar { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); color: #fff; width: 34px; height: 34px; }
.theme-toggle-btn--topbar:hover { background: rgba(255,255,255,0.2); }

@media (max-width: 991.98px) {
    .member-portal-sidebar { transform: translateX(100%); }
    .member-portal-sidebar.open { transform: translateX(0); }
    .member-portal-main { margin-right: 0; }
}

[data-theme="dark"] .member-kpi,
[data-theme="dark"] .portal-quick-card {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--text-primary);
}
[data-theme="dark"] .member-auth-panel { background: var(--surface-page); }
[data-theme="dark"] .member-auth-card { background: var(--surface-card); border: 1px solid var(--surface-border); }
[data-theme="dark"] .member-auth-title { color: var(--text-primary); }
