/* DGINL Admin Dashboard — Enhanced Colorful Design */
:root {
    --primary: #1e3a5f;
    --primary-light: #2d6aa6;
    --primary-lighter: #3b82f6;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --success: #10b981;
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --info: #06b6d4;
    --info-bg: #cffafe;
    --info-text: #155e75;
    --bg: #f0f4f8;
    --bg-subtle: #e8edf3;
    --card: #ffffff;
    --text: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #8596a9;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --sidebar-w: 260px;
    --header-h: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-md: 0 6px 12px -2px rgba(0,0,0,.08), 0 3px 7px -3px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.1), 0 4px 10px -5px rgba(0,0,0,.04);
    --transition: .2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: linear-gradient(165deg, #0f172a 0%, #1e293b 40%, #0f172a 100%); color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform var(--transition); overflow: hidden; }
.sidebar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(ellipse at 20% 0%, rgba(99,102,241,.08) 0%, transparent 50%), radial-gradient(ellipse at 80% 100%, rgba(52,211,153,.06) 0%, transparent 50%); pointer-events: none; }
.sidebar-brand { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; position: relative; }
.sidebar-brand-mark { width: 42px; min-width: 42px; height: 42px; padding: 5px; border-radius: 12px; background: rgba(255,255,255,.97); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.sidebar-brand img { width: 32px; height: auto; max-height: 28px; object-fit: contain; display: block; }
.sidebar-brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar-brand-copy strong { font-size: .92rem; font-weight: 800; color: #fff; }
.sidebar-brand-copy small { font-size: .6rem; color: rgba(255,255,255,.5); font-weight: 600; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 6px 8px; position: relative; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
.sidebar-nav .nav-section { font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.28); padding: 16px 14px 6px; font-weight: 700; }
.sidebar-nav .nav-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; color: rgba(255,255,255,.55); font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .15s ease; text-decoration: none; margin-bottom: 4px; position: relative; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.sidebar-nav .nav-item.active { background: rgba(99,102,241,.15); color: #fff; font-weight: 700; }
.sidebar-nav .nav-item.active::before { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 50%; background: var(--accent-light); border-radius: 3px 0 0 3px; }
html[dir="ltr"] .sidebar-nav .nav-item.active::before { right: auto; left: 0; border-radius: 0 3px 3px 0; }
.sidebar-nav .nav-item i { width: 16px; text-align: center; font-size: .76rem; opacity: .65; }
.sidebar-nav .nav-item .badge { margin-left: auto; background: linear-gradient(135deg, var(--accent), var(--primary-lighter)); font-size: .6rem; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.workspace-item { align-items: flex-start; }
.nav-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.nav-copy strong { font-size: .84rem; font-weight: 800; line-height: 1.35; }
.nav-copy small { font-size: .68rem; color: rgba(255,255,255,.52); font-weight: 600; line-height: 1.45; }
.sidebar-nav .nav-item.active .nav-copy small,
.sidebar-nav .nav-item:hover .nav-copy small { color: rgba(255,255,255,.78); }
.sidebar-footer { padding: 8px 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: .62rem; color: rgba(255,255,255,.2); position: relative; text-align: center; letter-spacing: .04em; }
.main-area { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.top-header { height: var(--header-h); background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.header-right { display: flex; align-items: center; gap: 14px; }
.header-right h1 { font-size: 1.05rem; font-weight: 800; color: var(--text); margin: 0; letter-spacing: -.01em; }
.header-date { font-size: .72rem; color: var(--text-muted); font-weight: 600; padding: 4px 10px; background: var(--bg); border-radius: 6px; white-space: nowrap; }
.header-left { display: flex; align-items: center; gap: 10px; }
.top-header .left { display: flex; align-items: center; gap: 14px; }
.top-header .right { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.2rem; color: var(--text); cursor: pointer; padding: 6px; }
.header-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.header-badge { font-size: .65rem; padding: 3px 10px; border-radius: 20px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.header-badge.live { background: var(--success-bg); color: var(--success-text); }
.header-badge.test { background: var(--warning-bg); color: var(--warning-text); }
.btn-icon { background: none; border: 1px solid var(--border); width: 38px; height: 38px; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all var(--transition); }
.btn-icon:hover { background: var(--bg); color: var(--text); border-color: var(--text-muted); }
#menuToggle { display: none; }
.user-menu { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 12px; border-radius: var(--radius-sm); transition: background var(--transition); position: relative; }
.user-menu:hover { background: var(--bg); }
.user-menu-compact { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 10px; border-radius: var(--radius-sm); transition: background .15s; }
.user-menu-compact:hover { background: var(--bg); }
.user-name-compact { font-size: .82rem; font-weight: 700; color: var(--text); }
.user-avatar { width: 34px; height: 34px; background: linear-gradient(135deg, var(--accent), var(--primary-lighter)); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
/* Profile page */
.profile-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.profile-card h3 { font-size: .92rem; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.profile-card h3 i { color: var(--primary); }
.profile-avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 900; cursor: pointer; transition: transform .15s; }
.profile-avatar-lg:hover { transform: scale(1.05); }
.profile-form-group { margin-bottom: 14px; }
.profile-form-group label { font-size: .78rem; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 4px; }
.profile-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-color-options { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-color-opt { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: all .15s; }
.profile-color-opt:hover, .profile-color-opt.active { border-color: var(--text); transform: scale(1.15); }
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: .82rem; font-weight: 600; color: var(--text); }
.user-role { font-size: .65rem; color: var(--text-muted); }
.user-dropdown { position: absolute; top: calc(var(--header-h) - 4px); left: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); min-width: 180px; padding: 6px; z-index: 60; display: none; }
.user-dropdown.open { display: block; }
.user-dropdown a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: .82rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-radius: 6px; transition: all .15s; text-decoration: none; }
.user-dropdown a:hover { background: var(--bg); color: var(--danger); }
.user-dropdown a i { font-size: .85rem; width: 18px; text-align: center; }
.workspace-shell { padding: 22px 28px 0; background: linear-gradient(180deg, rgba(255,255,255,.68) 0%, rgba(240,244,248,0) 100%); border-bottom: 1px solid rgba(226,232,240,.55); }
.workspace-shell-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 20px; align-items: start; margin-bottom: 18px; }
.workspace-shell-copy { min-width: 0; }
.workspace-shell-kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 800; margin-bottom: 8px; }
.workspace-shell-title { font-size: 2rem; line-height: 1.15; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.workspace-shell-description { font-size: .95rem; color: var(--text-muted); line-height: 1.8; max-width: 900px; }
.workspace-shell-side { display: flex; flex-direction: column; gap: 12px; }
.workspace-shell-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shell-meta-item { background: rgba(255,255,255,.82); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-xs); }
.shell-meta-item span { display: block; font-size: .68rem; color: var(--text-muted); font-weight: 700; letter-spacing: .04em; margin-bottom: 4px; }
.shell-meta-item strong { display: block; font-size: .88rem; color: var(--text); font-weight: 800; }
.workspace-shell-actions { min-height: 56px; display: flex; gap: 8px; align-items: center; justify-content: flex-start; flex-wrap: wrap; padding: 10px 12px; background: rgba(255,255,255,.88); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-xs); }
.workspace-shell-actions .page-actions { width: 100%; }
.shell-actions-placeholder { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.workspace-subnav-wrap { position: sticky; top: var(--header-h); z-index: 45; margin: 0 -28px; padding: 0 28px 14px; background: linear-gradient(180deg, rgba(240,244,248,.98) 0%, rgba(240,244,248,.92) 75%, rgba(240,244,248,0) 100%); backdrop-filter: blur(8px); }
.workspace-subnav { display: flex; gap: 10px; align-items: center; overflow-x: auto; padding-bottom: 2px; }
.workspace-subnav-item { display: inline-flex; align-items: center; gap: 10px; padding: 11px 14px; background: rgba(255,255,255,.8); border: 1px solid #dce6f2; color: var(--text-secondary); border-radius: 14px; cursor: pointer; font-family: inherit; font-size: .83rem; font-weight: 700; white-space: nowrap; transition: all var(--transition); box-shadow: var(--shadow-xs); }
.workspace-subnav-item:hover { background: #fff; color: var(--text); border-color: #c7d5e8; box-shadow: var(--shadow-sm); }
.workspace-subnav-item.active { background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(59,130,246,.12)); color: var(--primary); border-color: #b9c8ef; box-shadow: 0 8px 18px rgba(37,99,235,.08); }
.workspace-subnav-item i { font-size: .88rem; color: inherit; }
.workspace-subnav-item .badge { background: #e9efff; color: #3158b6; padding: 2px 8px; border-radius: 999px; font-size: .62rem; font-weight: 800; }
.content { flex: 1; padding: 18px 28px 28px; }
.page-content { display: none; }
.page-content.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page-header { display: none !important; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 14px; }
.page-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.page-header p { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition); }
.card:hover { box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border-light); font-weight: 700; font-size: .9rem; display: flex; align-items: center; justify-content: space-between; color: var(--text); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 24px; }
/* Attention strip - modern compact top bar */
.attention-strip { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; margin-bottom: 14px; overflow-x: auto; white-space: nowrap; }
.attention-strip.has-issues { background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.attention-strip.all-clear { background: #f0fdf4; border: 1px solid #86efac; }
.attention-strip-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; border-radius: 8px; font-weight: 900; font-size: .78rem; color: #fff; flex-shrink: 0; padding: 0 6px; }
.attention-strip.has-issues .attention-strip-badge { background: linear-gradient(135deg, #ef4444, #f97316); }
.attention-strip.all-clear .attention-strip-badge { background: linear-gradient(135deg, #22c55e, #06b6d4); }
.attention-strip-label { font-size: .82rem; font-weight: 700; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.attention-strip-divider { width: 1px; height: 20px; background: #e5e7eb; flex-shrink: 0; }
.attention-strip-items { display: flex; gap: 6px; flex-shrink: 0; }
.attention-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 16px; font-size: .72rem; font-weight: 600; cursor: pointer; transition: all .15s; border: 1px solid transparent; white-space: nowrap; flex-shrink: 0; }
.attention-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.attention-chip.critical { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.attention-chip.warning { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.attention-chip.info { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.attention-chip i { font-size: .65rem; }
.attention-chip .chip-count { font-weight: 900; }
/* Payment grid */
.dash-payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.dash-payment-grid .card-header { font-size: .88rem; gap: 8px; }
.dash-payment-grid .card-header i { color: var(--primary); }
.card-header-link { font-size: .78rem; font-weight: 600; color: var(--primary); text-decoration: none; margin-right: auto; }
.card-header-link:hover { text-decoration: underline; }
.pay-row { display: flex; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border-light); gap: 12px; font-size: .82rem; transition: background .1s; }
.pay-row:last-child { border-bottom: none; }
.pay-row:hover { background: var(--bg-hover); }
.pay-row-status { flex-shrink: 0; }
.pay-row-status .confirmed { color: #22c55e; }
.pay-row-status .pending { color: #f59e0b; }
.pay-row-status .failed { color: #ef4444; }
.pay-row-info { flex: 1; min-width: 0; }
.pay-row-name { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-row-meta { font-size: .73rem; color: var(--text-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pay-row-meta span { white-space: nowrap; }
.pay-row-amount { font-weight: 800; color: var(--text); white-space: nowrap; }
.pay-row-amount.green { color: #16a34a; }
.pay-row-date { font-size: .73rem; color: var(--text-muted); white-space: nowrap; text-align: left; min-width: 70px; }
.pay-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.pay-row-actions .btn-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font-size: .72rem; cursor: pointer; transition: all .15s; }
.pay-row-actions .btn-icon:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.sms-auto-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; font-size: .68rem; font-weight: 600; background: #dbeafe; color: #1d4ed8; }
.sms-auto-badge.sent { background: #dcfce7; color: #15803d; }
@media (max-width: 900px) { .dash-payment-grid { grid-template-columns: 1fr; } }
.dashboard-alert-banner { background: linear-gradient(135deg, #fff7ed 0%, #fff1f2 100%); border: 1px solid #fdba74; border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow-xs); margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.dashboard-alert-banner.success { background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%); border-color: #86efac; }
.dashboard-alert-banner-copy { min-width: 0; }
.dashboard-alert-banner-copy strong { display: block; color: var(--danger-text); font-size: 1rem; font-weight: 900; margin-bottom: 4px; }
.dashboard-alert-banner.success .dashboard-alert-banner-copy strong { color: var(--success-text); }
.dashboard-alert-banner-copy p { color: var(--text-secondary); font-size: .86rem; line-height: 1.8; }
.dashboard-alert-banner-icon { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.82); color: var(--danger-text); font-size: 1.2rem; flex-shrink: 0; }
.dashboard-alert-banner.success .dashboard-alert-banner-icon { color: var(--success-text); }
.dashboard-queue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.queue-card { background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; min-height: 190px; }
.queue-card.is-critical { border-color: #fecaca; background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%); }
.queue-card.is-warning { border-color: #fed7aa; background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%); }
.queue-card.is-info { border-color: #bfdbfe; background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.queue-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.queue-card-icon { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1rem; background: rgba(255,255,255,.92); color: var(--primary); box-shadow: var(--shadow-xs); }
.queue-card-kicker { font-size: .7rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.queue-card-title { font-size: .95rem; color: var(--text); font-weight: 800; line-height: 1.6; }
.queue-card-value { font-size: 2rem; color: var(--text); font-weight: 900; line-height: 1.1; }
.queue-card-note { font-size: .8rem; color: var(--text-secondary); line-height: 1.8; min-height: 48px; }
.queue-card .btn { margin-top: auto; justify-content: center; }
.dashboard-ops-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ops-strip-item { background: rgba(255,255,255,.86); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-xs); }
.ops-strip-label { font-size: .72rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.ops-strip-value { font-size: 1.35rem; color: var(--text); font-weight: 900; margin-top: 4px; }
.ops-strip-sub { font-size: .76rem; color: var(--text-secondary); margin-top: 2px; }
.dashboard-lanes .card { min-height: 100%; }
.dashboard-card-danger { background: var(--danger-bg); color: var(--danger-text); }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: flex-start; gap: 14px; box-shadow: var(--shadow-sm); transition: all var(--transition); position: relative; overflow: hidden; }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-card.tone-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.kpi-card.tone-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.kpi-card.tone-purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.kpi-card.tone-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kpi-card.tone-red::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.kpi-card.tone-cyan::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.kpi-card.tone-indigo::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.kpi-card.tone-pink::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.kpi-icon.blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.green { background: #d1fae5; color: #059669; }
.kpi-icon.amber { background: #fef3c7; color: #d97706; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }
.kpi-icon.purple { background: #ede9fe; color: #7c3aed; }
.kpi-icon.cyan { background: #cffafe; color: #0891b2; }
.kpi-icon.indigo { background: #e0e7ff; color: #4f46e5; }
.kpi-icon.pink { background: #fce7f3; color: #db2777; }
.kpi-info { flex: 1; min-width: 0; }
.kpi-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.2; margin-top: 4px; }
.kpi-sub { font-size: .72rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-mini { text-align: center; padding: 14px 10px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border-light); }
.stat-mini .stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.stat-mini .stat-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-top: 2px; }
.stat-mini.green { background: var(--success-bg); border-color: #a7f3d0; }
.stat-mini.green .stat-value { color: var(--success-text); }
.stat-mini.red { background: var(--danger-bg); border-color: #fecaca; }
.stat-mini.red .stat-value { color: var(--danger-text); }
.stat-mini.amber { background: var(--warning-bg); border-color: #fde68a; }
.stat-mini.amber .stat-value { color: var(--warning-text); }
.stat-mini.blue { background: #dbeafe; border-color: #bfdbfe; }
.stat-mini.blue .stat-value { color: #1e40af; }
.stat-mini.purple { background: #ede9fe; border-color: #ddd6fe; }
.stat-mini.purple .stat-value { color: #5b21b6; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.dash-grid .full { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); box-shadow: var(--shadow-xs); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; min-width: 760px; }
thead th { background: linear-gradient(180deg, #f8fbff 0%, #edf4fb 100%); padding: 13px 16px; font-weight: 800; color: var(--text-secondary); text-align: right; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid #dbe4ef; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
tbody td { padding: 16px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
tbody tr { transition: background var(--transition), box-shadow var(--transition); }
tbody tr:hover { background: #f8fbff; box-shadow: inset 0 0 0 1px #e2ebf6; }
tbody tr:last-child td { border-bottom: none; }
.table-stack { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.table-main { font-size: .88rem; font-weight: 800; color: var(--text); line-height: 1.5; word-break: break-word; }
.table-sub { font-size: .76rem; color: var(--text-secondary); line-height: 1.55; word-break: break-word; }
.table-meta { font-size: .72rem; color: var(--text-muted); line-height: 1.6; word-break: break-word; }
.table-pill-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.table-metric { display: inline-flex; flex-direction: column; gap: 2px; padding: 9px 11px; background: #f8fbff; border: 1px solid #e4edf7; border-radius: 12px; width: fit-content; min-width: 110px; }
.table-metric strong { font-size: .92rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.table-metric span { font-size: .68rem; color: var(--text-muted); font-weight: 700; letter-spacing: .02em; }
.table-metric.success { background: #ecfdf5; border-color: #bbf7d0; }
.table-metric.success strong { color: #166534; }
.table-metric.danger { background: #fef2f2; border-color: #fecaca; }
.table-metric.danger strong { color: #b91c1c; }
tbody td:last-child { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.badge-active, .badge-paid, .badge-connected { background: var(--success-bg); color: var(--success-text); }
.badge-pending { background: var(--warning-bg); color: var(--warning-text); }
.badge-cancelled, .badge-failed { background: var(--danger-bg); color: var(--danger-text); }
.badge-suspended { background: #fce7f3; color: #9d174d; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-refunded { background: #ede9fe; color: #6b21a8; }
.badge-archived { background: #f1f5f9; color: #475569; }
.badge-free { background: #cffafe; color: #155e75; }
.badge-exact { background: #d1fae5; color: #065f46; }
.badge-review { background: #fff7ed; color: #9a3412; }
.badge-none { background: #fee2e2; color: #991b1b; }
.badge-unknown { background: #f1f5f9; color: #64748b; }
.badge-active-free { background: #cffafe; color: #0e7490; }
.badge-inactive { background: #fef3c7; color: #92400e; }
.badge-unmatched { background: #fef3c7; color: #92400e; }
.badge-fund { background: #dbeafe; color: #1d4ed8; }
.badge-membership { background: #ede9fe; color: #7c3aed; }
.badge-donation { background: #fef3c7; color: #92400e; }
.badge-other { background: #f1f5f9; color: #475569; }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-muted { background: #f1f5f9; color: #94a3b8; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.green { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,.4); }
.status-dot.red { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,.4); }
.status-dot.amber { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,.4); }
.status-dot.blue { background: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600; cursor: pointer; transition: all var(--transition); border: 1px solid transparent; font-family: inherit; text-decoration: none; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--primary-lighter)); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,.25); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(99,102,241,.35); transform: translateY(-1px); }
.btn-secondary { background: var(--card); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--text-muted); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,.25); }
.btn-success:hover { box-shadow: 0 4px 12px rgba(16,185,129,.35); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-export { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; box-shadow: 0 2px 8px rgba(139,92,246,.25); }
.btn-export:hover { box-shadow: 0 4px 12px rgba(139,92,246,.35); transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: .75rem; }
.ss-tab { background: var(--bg); color: var(--text-muted); border: 1.5px solid var(--border); cursor: pointer; }
.ss-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ss-tab:hover:not(.active) { background: var(--border); }
.btn-xs { padding: 3px 8px; font-size: .7rem; border-radius: 6px; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .8rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.form-control { width: 100%; height: 42px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px; font-size: .85rem; font-family: inherit; transition: border-color var(--transition), box-shadow var(--transition); background: var(--card); color: var(--text); }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 32px; }
textarea.form-control { height: auto; padding: 10px 14px; resize: vertical; }
.search-box { position: relative; }
.search-box input { padding-right: 38px; }
.search-box i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .85rem; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.health-item { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all var(--transition); }
.health-item:hover { box-shadow: var(--shadow-sm); }
.health-item .status-dot { width: 10px; height: 10px; flex-shrink: 0; }
.health-item .label { font-size: .82rem; font-weight: 600; }
.activity-list { list-style: none; }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); align-items: center; }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.activity-icon.payment { background: #dbeafe; color: #2563eb; }
.activity-icon.refund { background: #fee2e2; color: #dc2626; }
.activity-icon.subscription { background: #d1fae5; color: #059669; }
.activity-text { flex: 1; min-width: 0; }
.activity-title { font-size: .82rem; font-weight: 600; }
.activity-desc { font-size: .75rem; color: var(--text-muted); }
.activity-time { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.quick-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-size: .82rem; font-weight: 500; transition: all var(--transition); }
.quick-link:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.quick-link i { font-size: 1.1rem; color: var(--accent); }
.quick-link-copy { display: flex; flex-direction: column; line-height: 1.3; }
.quick-link-copy strong { font-size: .82rem; }
.quick-link-copy small { font-size: .7rem; color: var(--text-muted); }
.focus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.focus-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 18px; background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%); border: 1px solid var(--border); border-radius: var(--radius); transition: all var(--transition); }
.focus-card:hover { box-shadow: var(--shadow); }
.focus-icon { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, #e0e7ff, #dbeafe); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.focus-copy { min-width: 0; }
.focus-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; }
.focus-value { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 2px; }
.focus-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.focus-card .btn { grid-column: 1 / -1; justify-content: center; }
.page-scope-note { background: linear-gradient(135deg, #fbfdff 0%, #f4f8ff 100%); border-color: #d7e3f4; }
.page-scope-note .card-body { font-size: .84rem; color: var(--text-secondary); line-height: 1.9; }
.page-scope-note span { font-weight: 800; color: var(--accent); }
.member-page-note { background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%); border-color: #dbeafe; }
.member-page-note .card-body { padding: 16px 18px; }
.member-page-note-copy { color: var(--text-secondary); font-size: .84rem; }
.member-page-note-copy strong { display: block; color: var(--primary); font-size: .88rem; margin-bottom: 4px; }
.member-page-note-copy span { font-weight: 700; color: var(--accent); }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.member-card { background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; transition: all var(--transition); position: relative; overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer; }
.member-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #cbd5e1; }
.member-card .member-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.member-kicker { font-size: .68rem; font-weight: 800; letter-spacing: .06em; color: var(--accent); text-transform: uppercase; margin-bottom: 4px; }
.member-card .member-name { font-size: 1.04rem; font-weight: 800; color: var(--text); line-height: 1.35; }
.member-card .member-id { font-size: .72rem; color: var(--text-muted); font-weight: 700; margin-top: 4px; }
.member-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.member-source-row, .source-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.source-pill-row.compact { gap: 6px; }
.source-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: .68rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.source-pill i { font-size: .72rem; }
.source-pill small { font-size: .62rem; opacity: .85; font-weight: 800; }
.source-pill.success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.source-pill.info { background: #e0f2fe; color: #0c4a6e; border-color: #bae6fd; }
.source-pill.warning { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.source-pill.purple { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }
.source-pill.muted { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
.member-card .member-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.member-card .member-detail { padding: 12px; background: #f8fbff; border: 1px solid #e6edf5; border-radius: 12px; }
.member-card .member-detail .detail-label { font-size: .68rem; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.member-card .member-detail .detail-value { font-size: .84rem; font-weight: 700; color: var(--text); line-height: 1.5; }
.member-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: .78rem; font-weight: 600; line-height: 1.7; border: 1px solid transparent; }
.member-note.exact { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.member-note.free { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.member-note.archived { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.member-note.review { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.member-note.none { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.member-card .member-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.member-status-bar { height: 5px; position: absolute; top: 0; left: 0; right: 0; }
.member-status-bar.active { background: linear-gradient(90deg, #10b981, #34d399); }
.member-status-bar.active-free { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.member-status-bar.canceled { background: linear-gradient(90deg, #ef4444, #f87171); }
.member-status-bar.archived { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.member-status-bar.unmatched, .member-status-bar.inactive { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 10px 20px; font-size: .82rem; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); white-space: nowrap; }
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.export-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.export-card { padding: 20px; border-radius: var(--radius); border: 2px dashed var(--border); text-align: center; cursor: pointer; transition: all var(--transition); background: var(--card); }
.export-card:hover { border-color: var(--accent); background: #f5f3ff; transform: translateY(-2px); box-shadow: var(--shadow); }
.export-card i { font-size: 1.8rem; color: var(--accent); margin-bottom: 8px; display: block; }
.export-card .export-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.export-card .export-desc { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 20px; }
.pagination button { width: 34px; height: 34px; border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-sm); font-size: .8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); font-weight: 600; }
.pagination button:hover { background: var(--bg); }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination-info { font-size: .8rem; color: var(--text-muted); margin: 0 12px; }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.42); backdrop-filter: blur(6px); z-index: 200; align-items: stretch; justify-content: flex-end; }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); border-radius: 24px 0 0 24px; box-shadow: var(--shadow-lg); width: min(760px, 94vw); height: 100vh; max-height: 100vh; overflow: hidden; display: flex; flex-direction: column; animation: modalIn .25s ease; border-inline-start: 1px solid var(--border); }
@keyframes modalIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; transition: all var(--transition); }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.profile-shell { display: flex; flex-direction: column; gap: 18px; }
.profile-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px; background: linear-gradient(135deg, #f8fbff 0%, #eef4ff 100%); border: 1px solid #dbeafe; border-radius: 18px; }
.profile-kicker { font-size: .72rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.profile-title { font-size: 1.35rem; font-weight: 800; color: var(--text); line-height: 1.4; }
.profile-meta { font-size: .8rem; color: var(--text-muted); font-weight: 700; margin-top: 4px; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.profile-note { padding: 14px 16px; border-radius: 14px; font-size: .84rem; font-weight: 700; line-height: 1.8; border: 1px solid transparent; }
.profile-note.exact { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.profile-note.free { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.profile-note.archived { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.profile-note.review { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.profile-note.none { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.source-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.source-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 16px; border: 1px solid transparent; }
.source-card.success { background: #f0fdf4; border-color: #bbf7d0; }
.source-card.info { background: #f0f9ff; border-color: #bae6fd; }
.source-card.warning { background: #fff7ed; border-color: #fdba74; }
.source-card.purple { background: #faf5ff; border-color: #e9d5ff; }
.source-card.muted { background: #f8fafc; border-color: #e2e8f0; }
.source-card-icon { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.7); font-size: .9rem; flex-shrink: 0; }
.source-card-copy { min-width: 0; }
.source-card-title { font-size: .86rem; font-weight: 800; color: var(--text); }
.source-card-meta { font-size: .7rem; color: var(--text-muted); font-weight: 800; margin-top: 2px; }
.source-card-detail { font-size: .78rem; color: var(--text-secondary); margin-top: 6px; line-height: 1.6; }
.profile-section { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.profile-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.profile-section-title { font-size: .95rem; font-weight: 800; color: var(--text); }
.profile-section-subtitle { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.section-source { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-field { padding: 12px 14px; background: #f8fbff; border: 1px solid #e6edf5; border-radius: 14px; min-width: 0; }
.profile-value { font-size: .9rem; color: var(--text); font-weight: 600; line-height: 1.7; word-break: break-word; }
.profile-value.strong { font-weight: 800; }
.toast-container { position: fixed; top: 20px; left: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 14px 22px; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; color: #fff; box-shadow: var(--shadow-lg); animation: toastIn .3s ease; min-width: 220px; display: flex; align-items: center; gap: 10px; }
.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast.info { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.toast.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.toast.fade-out { opacity: 0; transform: translateX(40px); transition: opacity .4s ease, transform .4s ease; }
.loading-state, .empty-state, .error-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.loading-state i { font-size: 2.2rem; color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state i { font-size: 2.5rem; color: var(--border); margin-bottom: 12px; display: block; }
.empty-state p { font-size: .9rem; }
.error-state i { font-size: 2.5rem; color: var(--danger); margin-bottom: 12px; display: block; }
.skeleton { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; left: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 200px; z-index: 60; overflow: hidden; }
.dropdown-menu.open { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 11px 18px; font-size: .82rem; color: var(--text); cursor: pointer; transition: background var(--transition); }
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { border-top: 1px solid var(--border-light); margin: 4px 0; }
.progress-bar-bg { background: var(--bg-subtle); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 20px; transition: width .6s ease; }
.progress-bar-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.progress-bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-bar-fill.red { background: linear-gradient(90deg, #ef4444, #f87171); }
@media (max-width: 1024px) { .dash-grid, .workspace-shell-main { grid-template-columns: 1fr; } .member-grid { grid-template-columns: 1fr; } .profile-grid { grid-template-columns: 1fr; } .workspace-shell-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { #menuToggle { display: flex; } .sidebar { transform: translateX(-100%); } .sidebar.open { transform: translateX(0); } .main-area { margin-left: 0; } .menu-toggle { display: block; } .workspace-shell { padding: 18px 16px 0; } .workspace-subnav-wrap { margin: 0 -16px; padding: 0 16px 12px; } .content { padding: 14px 16px 18px; } .kpi-grid, .dashboard-queue-grid, .dashboard-ops-strip { grid-template-columns: 1fr; } .export-panel { grid-template-columns: 1fr 1fr; } .member-card .member-details { grid-template-columns: 1fr; } .member-badges, .profile-badges { align-items: flex-start; } .profile-hero, .profile-section-head, .dashboard-alert-banner { flex-direction: column; } .sidebar-brand { padding: 12px 16px; } .sidebar-brand-mark { width: 70px; min-width: 70px; height: 48px; } .sidebar-brand img { width: 54px; max-height: 30px; } .workspace-shell-title { font-size: 1.55rem; } .workspace-shell-meta { grid-template-columns: 1fr; } .modal { width: 100vw; border-radius: 0; } }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-right { text-align: left; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
html[dir="rtl"] .sidebar { left: auto; right: 0; }
/* RTL active indicator handled in base styles */
html[dir="rtl"] .main-area { margin-left: 0; margin-right: var(--sidebar-w); }
html[dir="rtl"] .sidebar-nav .nav-item .badge { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .nav-subitem.active::before { left: auto; right: 0; border-radius: 3px 0 0 3px; }
html[dir="rtl"] .user-dropdown { left: auto; right: 0; }
html[dir="rtl"] .top-header, html[dir="rtl"] .page-header, html[dir="rtl"] .card-header, html[dir="rtl"] .health-item, html[dir="rtl"] .activity-item, html[dir="rtl"] .quick-link, html[dir="rtl"] .focus-card, html[dir="rtl"] .dropdown-item, html[dir="rtl"] .modal-header, html[dir="rtl"] .user-menu, html[dir="rtl"] .workspace-shell, html[dir="rtl"] .workspace-subnav-item { text-align: right; }
html[dir="rtl"] .activity-time { text-align: left; }
html[dir="rtl"] .modal-footer { justify-content: flex-start; }
html[dir="rtl"] .dropdown-menu { left: 0; right: auto; }
html[dir="rtl"] .toast-container { left: 20px; right: auto; }
html[dir="rtl"] .modal-overlay { justify-content: flex-start; }
html[dir="rtl"] .modal { border-radius: 0 24px 24px 0; border-inline-start: none; border-inline-end: 1px solid var(--border); }
html[dir="ltr"] body { font-family: 'Inter', 'Cairo', system-ui, -apple-system, sans-serif; }
html[dir="ltr"] .sidebar { left: 0; right: auto; }
html[dir="ltr"] .main-area { margin-left: var(--sidebar-w); margin-right: 0; }
html[dir="ltr"] thead th { text-align: left; }
html[dir="ltr"] .search-box input { padding-left: 38px; padding-right: 14px; }
html[dir="ltr"] .search-box i { left: 14px; right: auto; }
html[dir="ltr"] select.form-control { background-position: right 12px center; padding-right: 32px; padding-left: 14px; }
html[dir="ltr"] .toast-container { right: 20px; left: auto; }
html[dir="ltr"] .dropdown-menu { right: 0; left: auto; }
html[dir="ltr"] .text-right { text-align: right; }
@media (max-width: 768px) { html[dir="rtl"] .sidebar { transform: translateX(100%); } html[dir="rtl"] .sidebar.open { transform: translateX(0); } html[dir="rtl"] .main-area { margin-right: 0; } }

/* Accessibility - keyboard focus */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.pagination-controls button {
    padding: 6px 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    background: var(--bg-card, #fff);
    cursor: pointer;
    font-family: inherit;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--bg-hover, #f3f4f6);
}

/* Match confidence badges */
.badge-high { background: #059669; color: white; }
.badge-medium { background: #d97706; color: white; }
.badge-low { background: #dc2626; color: white; }

/* ═══ Forms Page ═══ */
.forms-section { margin-bottom: 24px; }
.forms-section-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.forms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.form-card:hover { border-color: var(--primary-lighter); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.form-card.form-integrated { border-right: 3px solid var(--success); }
html[dir="ltr"] .form-card.form-integrated { border-right: none; border-left: 3px solid var(--success); }
.form-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.form-card-header i { font-size: 1.2rem; color: var(--primary-light); width: 24px; text-align: center; }
.form-card-title { font-weight: 600; font-size: .9rem; flex: 1; }
.form-card-body { display: flex; align-items: flex-end; justify-content: space-between; }
.form-card-stat { display: flex; align-items: baseline; gap: 6px; }
.form-count { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.form-count-label { font-size: .75rem; color: var(--text-muted); }
.form-card-meta { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }

/* ═══ Chargebacks Page ═══ */
.stat-card.stat-danger { background: var(--danger-bg); border-color: var(--danger); }
.stat-card.stat-danger .stat-value { color: var(--danger); }
.reason-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.reason-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-subtle, #f8f9fa); border-radius: var(--radius-sm); }
.reason-label { font-size: .85rem; }
.reason-count { min-width: 28px; text-align: center; }
.chargeback-item { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: .85rem; }
.chargeback-item:last-child { border-bottom: none; }

/* ═══ Enhanced Member Profile Modal ═══ */
.detail-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.detail-section h4 { font-size: .95rem; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.medical-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.medical-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg-subtle, #f8f9fa); border-radius: var(--radius-sm); font-size: .85rem; }
.medical-label { flex: 1; }
.medical-value { width: 24px; text-align: center; }
.mandate-item { display: flex; gap: 12px; align-items: center; padding: 6px 0; font-size: .85rem; }
.files-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.file-thumb {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 16px; background: var(--bg-subtle, #f8f9fa);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text); font-size: .8rem;
    transition: all var(--transition);
}
.file-thumb:hover { border-color: var(--primary-lighter); background: var(--info-bg); }
.file-thumb i { font-size: 1.5rem; color: var(--info); }
.signature-img { max-width: 300px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; background: #fff; }

/* ═══ Alert Boxes ═══ */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.alert-danger { background: var(--danger-bg); border: 1px solid rgba(239,68,68,.2); color: var(--danger-text); }
.alert-danger h4 { color: var(--danger); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(245,158,11,.2); color: var(--warning-text); }
.alert-info { background: var(--info-bg); border: 1px solid rgba(6,182,212,.2); color: var(--info-text); }

/* ═══ Member Badge Icons ═══ */
.member-badges i { font-size: .75rem; opacity: .8; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }

/* ═══ KPI Grid Enhanced ═══ */
.kpi-card { cursor: pointer; transition: all var(--transition); }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card.kpi-danger { border-top: 3px solid var(--danger); }
.kpi-card.kpi-danger .kpi-value { color: var(--danger); }
.kpi-card.kpi-info { border-top: 3px solid var(--info); }

/* ═══ Financial Alerts Dashboard Card ═══ */
#financialAlertsCard .card-header { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* ═══ Stat Row Enhancements ═══ */
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.stat-card {
    flex: 1; min-width: 140px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: center;
}
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* ═══ Communication Hub ═══ */
/* Compose channel buttons */
.compose-channel-btn { border: 1px solid var(--border); background: var(--card); color: var(--text); }
.compose-channel-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.compose-form .form-group { margin-bottom: 14px; }
.compose-form textarea.form-control { resize: vertical; min-height: 120px; font-family: inherit; }

/* Inbox row styles */
.inbox-row { cursor: pointer; transition: background .15s; }
.inbox-row:hover { background: var(--hover); }
.inbox-row.unread td { font-weight: 600; }
.inbox-row .inbox-from { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .inbox-subject { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .inbox-snippet { color: var(--text-muted); font-size: .8rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }

/* Notification sub-tabs */
.notif-tab-panel { min-height: 200px; }
.notif-tab-btn.active { background: var(--primary) !important; color: #fff !important; }

/* Template cards */
.template-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; background: var(--card); }
.template-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.template-card-header strong { font-size: .95rem; }
.template-card-body { font-size: .85rem; color: var(--text-muted); }

/* Schedule job cards */
.schedule-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; background: var(--card); }
.schedule-card-info { flex: 1; }
.schedule-card-info strong { display: block; margin-bottom: 4px; }
.schedule-card-info small { color: var(--text-muted); }
.schedule-card-actions { display: flex; gap: 6px; align-items: center; }

/* Email detail in modal */
.email-detail-header { padding: 16px; border-bottom: 1px solid var(--border); }
.email-detail-header .email-subject { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.email-detail-header .email-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .85rem; color: var(--text-muted); }
.email-detail-body { padding: 16px; line-height: 1.7; }
.email-detail-body iframe { width: 100%; min-height: 400px; border: none; border-radius: var(--radius-sm); background: #fff; }
