/* ============================================================
   SOCIALMM NGO PLATFORM — MAIN CSS
   Theme: White + Emerald Green + Dark Gray | Dark Mode Ready
   ============================================================ */

:root {
  --emerald: #059669;
  --emerald-dark: #047857;
  --emerald-light: #d1fae5;
  --emerald-xlight: #f0fdf4;
  --dark: #111827;
  --dark-2: #1f2937;
  --dark-3: #374151;
  --gray: #6b7280;
  --gray-light: #e5e7eb;
  --gray-xlight: #f9fafb;
  --white: #ffffff;
  --red: #dc2626;
  --red-light: #fee2e2;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.12), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition: .2s ease;
  --page-bg: #f3f4f6;
  --card-bg: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --input-bg: #ffffff;
  --sidebar-bg: #111827;
  --topbar-bg: #ffffff;
}

/* ============================================================
   DARK MODE — data-theme="dark" on <html>
   ============================================================ */
[data-theme="dark"] {
  --page-bg: #0f172a;
  --card-bg: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --input-bg: #1e293b;
  --sidebar-bg: #0f172a;
  --topbar-bg: #1e293b;
  --gray-xlight: #1e293b;
  --gray-light: #334155;
  --white: #1e293b;
  --dark: #f1f5f9;
  --dark-2: #e2e8f0;
  --dark-3: #cbd5e1;
  --gray: #94a3b8;
  --emerald-xlight: rgba(5,150,105,.1);
  --emerald-light: rgba(5,150,105,.2);
  --blue-light: rgba(37,99,235,.15);
  --amber-light: rgba(217,119,6,.15);
  --red-light: rgba(220,38,38,.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { transition: background .3s, color .3s; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--page-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
ul, ol { list-style: none; }

.hidden { display: none !important; }

/* ============================================================
   PAGE TRANSITION ANIMATION
   ============================================================ */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
@keyframes shimmer {
  0% { background-position: -700px 0; }
  100% { background-position: 700px 0; }
}

.animate-page { animation: pageIn .35s cubic-bezier(.22,1,.36,1) both; }
.animate-fade { animation: fadeIn .3s ease both; }
.animate-up  { animation: fadeUp .4s cubic-bezier(.22,1,.36,1) both; }
.stagger-1 { animation-delay: .05s; }
.stagger-2 { animation-delay: .1s; }
.stagger-3 { animation-delay: .15s; }
.stagger-4 { animation-delay: .2s; }
.stagger-5 { animation-delay: .25s; }
.stagger-6 { animation-delay: .3s; }

/* Ripple on click */
.ripple { position: relative; overflow: hidden; }
.ripple::after {
  content: ''; position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: rippleAnim .5s linear;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* Skeleton Loader */
.skeleton-box {
  background: linear-gradient(90deg, var(--gray-light) 25%, #f0f0f0 50%, var(--gray-light) 75%);
  background-size: 700px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
[data-theme="dark"] .skeleton-box {
  background: linear-gradient(90deg, #1e293b 25%, #2d3f55 50%, #1e293b 75%);
  background-size: 700px 100%;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto; overflow-x: hidden;
  transition: width .3s cubic-bezier(.4,0,.2,1);
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }

.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .brand-name-sm,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-search { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 14px 8px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-logo-sm {
  width: 32px; height: 32px;
  background: var(--emerald);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 15px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(5,150,105,.4);
}
.brand-name-sm { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: .3px; flex: 1; transition: opacity .2s; }
.sidebar-collapse-btn { color: #6b7280; font-size: 13px; padding: 4px; border-radius: 4px; transition: color .2s; }
.sidebar-collapse-btn:hover { color: white; }

.sidebar-search {
  margin: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  transition: border-color .2s;
}
.sidebar-search:focus-within { border-color: var(--emerald); }
.sidebar-search i { color: #6b7280; font-size: 12px; }
.sidebar-search input { background: none; border: none; outline: none; color: #fff; font-size: 13px; flex: 1; }
.sidebar-search input::placeholder { color: #6b7280; }

.sidebar-nav { flex: 1; padding: 4px 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 600;
  color: #4b5563; letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 8px 6px;
  transition: opacity .2s;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  color: #9ca3af; font-size: 13px; font-weight: 500;
  margin-bottom: 2px;
  transition: background .2s, color .2s, transform .15s;
  cursor: pointer; position: relative;
  white-space: nowrap; overflow: hidden;
}
.nav-item i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.nav-item span:first-of-type { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav-item.active { background: var(--emerald); color: #fff; }
.nav-item.active:hover { background: var(--emerald-dark); transform: none; }

.nav-badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 20px; line-height: 1.4; }
.nav-badge.hot { background: #ef4444; color: white; }
.nav-badge.urgent { background: var(--amber); color: white; }
.nav-badge.warn { background: var(--amber); color: white; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.user-avatar {
  width: 34px; height: 34px; background: var(--emerald);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 11px; color: #6b7280; }
.logout-btn { color: #6b7280; font-size: 14px; padding: 6px; border-radius: 6px; transition: color .2s; }
.logout-btn:hover { color: #ef4444; }

/* ---- MAIN CONTENT ---- */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0;
  box-shadow: var(--shadow);
  transition: background .3s;
  gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.page-breadcrumb { font-size: 15px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.topbar-ngo-selector {
  display: flex; align-items: center; gap: 6px;
  background: var(--gray-xlight); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px;
  transition: border-color .2s;
}
.topbar-ngo-selector:focus-within { border-color: var(--emerald); }
.topbar-ngo-selector i { color: var(--emerald); font-size: 12px; }
.topbar-ngo-selector select { border: none; background: none; outline: none; font-size: 13px; font-weight: 500; color: var(--text-primary); cursor: pointer; }

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

.quick-action-btn {
  background: var(--emerald); color: white;
  font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 6px;
  transition: background .2s, box-shadow .2s, transform .15s;
  box-shadow: 0 2px 8px rgba(5,150,105,.3);
}
.quick-action-btn:hover { background: var(--emerald-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(5,150,105,.4); }
.quick-action-btn:active { transform: translateY(0); }

/* Dark mode toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: var(--gray-xlight);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.theme-toggle:hover { background: var(--emerald-light); color: var(--emerald); border-color: var(--emerald); }
.theme-toggle .moon { display: block; }
.theme-toggle .sun  { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun  { display: block; }

.topbar-notif {
  position: relative; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); cursor: pointer;
  background: var(--gray-xlight); border: 1px solid var(--border);
  transition: all .2s;
}
.topbar-notif:hover { background: var(--emerald-light); border-color: var(--emerald); }
.topbar-notif i { font-size: 15px; color: var(--text-secondary); }
.notif-dot {
  position: absolute; top: 4px; right: 4px;
  background: var(--red); color: white;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: pulse 2s infinite;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius);
  cursor: pointer; border: 1px solid var(--border);
  background: var(--gray-xlight);
  transition: all .2s;
}
.topbar-user:hover { background: var(--emerald-light); border-color: var(--emerald); }
.user-avatar-sm { width: 26px; height: 26px; background: var(--emerald); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 11px; }
.topbar-user span { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.topbar-user i { font-size: 10px; color: var(--text-secondary); }

/* ---- PAGE CONTENT ---- */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.page-content::-webkit-scrollbar { width: 6px; }
.page-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================================================
   REUSABLE COMPONENTS
   ============================================================ */

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background .3s, border-color .3s, box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--emerald); }
.card-body { padding: 20px; }
.card-actions { display: flex; align-items: center; gap: 8px; }

/* Stat Cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s, transform .2s, background .3s, border-color .3s;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  transition: background .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card:hover::before { background: var(--emerald); }
.stat-card:active { transform: translateY(0); }

.stat-card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 12px;
  transition: transform .2s;
}
.stat-card:hover .stat-card-icon { transform: scale(1.08); }
.stat-card-icon.green { background: var(--emerald-light); color: var(--emerald); }
.stat-card-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-card-icon.amber { background: var(--amber-light); color: var(--amber); }
.stat-card-icon.red { background: var(--red-light); color: var(--red); }

.stat-card-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 4px; letter-spacing: -.5px; }
.stat-card-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.stat-card-change { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 20px; }
.stat-card-change.up { background: var(--emerald-light); color: var(--emerald); }
.stat-card-change.down { background: var(--red-light); color: var(--red); }
.stat-card-sub { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gray-xlight);
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  transition: background .3s;
}
tbody td {
  padding: 12px 14px; font-size: 13px; color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle; transition: background .15s;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-xlight); }
tbody tr { transition: background .15s; cursor: pointer; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--emerald-light); color: var(--emerald-dark); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-gray { background: var(--gray-light); color: var(--text-secondary); }
.badge-dark { background: var(--dark-2); color: #fff; }
.tier-principal { background: #1e1b4b; color: #a5b4fc; }
.tier-major { background: #064e3b; color: #6ee7b7; }
.tier-mid { background: #1e3a5f; color: #93c5fd; }
.tier-small { background: #78350f; color: #fcd34d; }
.tier-prospect { background: var(--gray-light); color: var(--text-secondary); }

/* Buttons */
.btn-primary {
  background: var(--emerald); color: white;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s, box-shadow .2s, transform .15s;
  border: none; cursor: pointer;
}
.btn-primary:hover { background: var(--emerald-dark); box-shadow: 0 4px 12px rgba(5,150,105,.3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--gray-xlight); color: var(--text-primary);
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  transition: all .2s; cursor: pointer;
}
.btn-secondary:hover { background: var(--gray-light); transform: translateY(-1px); }

.btn-ghost {
  background: none; color: var(--text-secondary);
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  transition: all .2s; cursor: pointer;
}
.btn-ghost:hover { background: var(--gray-xlight); color: var(--text-primary); }

.btn-danger {
  background: var(--red-light); color: var(--red);
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .2s; cursor: pointer;
}
.btn-danger:hover { background: var(--red); color: white; transform: translateY(-1px); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
  width: 32px; height: 32px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; border: 1px solid var(--border);
  color: var(--text-secondary); background: var(--card-bg);
  transition: all .2s; cursor: pointer;
}
.btn-icon:hover { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-light); transform: scale(1.08); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--text-primary);
  background: var(--input-bg); outline: none;
  transition: border-color .2s, box-shadow .2s, background .3s;
}
.form-control:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(5,150,105,.12); }
.form-group input:not([type=checkbox]):not([type=file]), .form-group select, .form-group textarea,
.modal-card input:not([type=checkbox]):not([type=file]), .modal-card select, .modal-card textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--text-primary);
  background: var(--input-bg); outline: none;
  transition: border-color .2s, box-shadow .2s, background .3s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus {
  border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(5,150,105,.12);
}
.form-group textarea, .modal-card textarea { resize: vertical; min-height: 60px; line-height: 1.5; font-family: inherit; }
.form-group input[type=file] { width: 100%; padding: 8px 0; }
/* .field-icon-wrap fields need left padding cleared for the icon — the
   generic .form-group/.modal-card input rule above resets padding to
   12px all round. Its :not([type=...]) clauses each add specificity, so
   a plain ".modal-card .field-icon-wrap input" override (lower specificity)
   was silently losing to it despite coming later — matching the :not()
   clauses here is what actually wins. */
.form-group .field-icon-wrap input:not([type=checkbox]):not([type=file]), .form-group .field-icon-wrap select, .form-group .field-icon-wrap textarea,
.modal-card .field-icon-wrap input:not([type=checkbox]):not([type=file]), .modal-card .field-icon-wrap select, .modal-card .field-icon-wrap textarea {
  padding-left: 38px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* Score bar */
.score-bar-wrap { display: flex; align-items: center; gap: 8px; }
.score-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 3px; transition: width .8s ease; }
.score-fill.hot { background: var(--emerald); }
.score-fill.warm { background: var(--amber); }
.score-fill.cold { background: var(--gray); }
.score-num { font-size: 12px; font-weight: 700; min-width: 28px; text-align: right; }

/* Progress */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--emerald); border-radius: 4px; transition: width 1s cubic-bezier(.22,1,.36,1); }

/* Stage Pills */
.stage-pipeline { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.stage-pill {
  padding: 5px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--gray-xlight); color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.stage-pill.active { background: var(--emerald); color: white; border-color: var(--emerald); }
.stage-pill:hover:not(.active) { border-color: var(--emerald); color: var(--emerald); }

/* Page Header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 800; color: var(--text-primary); letter-spacing: -.3px; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* Tabs */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .2s;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.tab-btn.active { color: var(--emerald); border-bottom-color: var(--emerald); font-weight: 600; }
.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* Filter Row */
.filter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-search {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 8px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  transition: border-color .2s;
}
.filter-search:focus-within { border-color: var(--emerald); }
.filter-search i { color: var(--text-secondary); font-size: 13px; }
.filter-search input { border: none; outline: none; flex: 1; font-size: 13px; color: var(--text-primary); background: none; }
.filter-select {
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; color: var(--text-primary);
  background: var(--card-bg); outline: none; cursor: pointer;
  transition: border-color .2s, background .3s;
}
.filter-select:focus { border-color: var(--emerald); }

/* Timeline */
.timeline { padding: 0; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 17px; top: 34px; width: 2px; height: calc(100% - 18px); background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; z-index: 1; transition: transform .2s; }
.timeline-item:hover .timeline-icon { transform: scale(1.1); }
.timeline-icon.call { background: var(--emerald-light); color: var(--emerald); }
.timeline-icon.email { background: var(--blue-light); color: var(--blue); }
.timeline-icon.donation { background: var(--amber-light); color: var(--amber); }
.timeline-icon.meeting { background: #ede9fe; color: #7c3aed; }
.timeline-icon.note { background: var(--gray-light); color: var(--text-secondary); }
.timeline-body { flex: 1; padding-top: 6px; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.timeline-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.timeline-note { font-size: 12px; color: var(--text-secondary); margin-top: 6px; background: var(--gray-xlight); padding: 8px 10px; border-radius: var(--radius); border-left: 3px solid var(--emerald); }

/* KPI Alerts */
.kpi-alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 12px; border-left: 4px solid; }
.kpi-alert.warn { background: var(--amber-light); border-color: var(--amber); }
.kpi-alert.danger { background: var(--red-light); border-color: var(--red); }
.kpi-alert.info { background: var(--blue-light); border-color: var(--blue); }
.kpi-alert.success { background: var(--emerald-light); border-color: var(--emerald); }
.kpi-alert i { margin-top: 1px; font-size: 14px; }
.kpi-alert.warn i { color: var(--amber); }
.kpi-alert.danger i { color: var(--red); }
.kpi-alert.info i { color: var(--blue); }
.kpi-alert.success i { color: var(--emerald); }
.kpi-alert-content strong { display: block; font-size: 13px; margin-bottom: 2px; color: var(--text-primary); }
.kpi-alert-content span { font-size: 12px; color: var(--text-secondary); }

/* Kanban */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.kanban-col { min-width: 220px; max-width: 220px; background: var(--gray-xlight); border-radius: var(--radius-lg); border: 1px solid var(--border); display: flex; flex-direction: column; transition: background .3s; }
.kanban-col-header { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.kanban-col-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.kanban-col-count { background: var(--card-bg); color: var(--text-primary); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--border); }
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kanban-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  animation: scaleIn .25s ease both;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--emerald); }
.kanban-card:active { transform: translateY(0); }
.kanban-card-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.kanban-card-meta { font-size: 11px; color: var(--text-secondary); display: flex; gap: 8px; flex-wrap: wrap; }

/* Donor Profile Hero */
.donor-profile-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  border-radius: var(--radius-lg); padding: 24px; color: white;
  margin-bottom: 20px; display: flex; align-items: center; gap: 20px;
  position: relative; overflow: hidden;
}
.donor-profile-hero::after {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(5,150,105,.1); pointer-events: none;
}
[data-theme="dark"] .donor-profile-hero { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
.donor-avatar-lg { width: 64px; height: 64px; background: var(--emerald); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; box-shadow: 0 4px 16px rgba(5,150,105,.4); }
.donor-hero-info h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.donor-hero-meta { display: flex; gap: 16px; font-size: 12px; color: #9ca3af; margin-top: 8px; flex-wrap: wrap; }
.donor-hero-meta span { display: flex; align-items: center; gap: 5px; }
.donor-hero-stats { margin-left: auto; display: flex; gap: 28px; }
.donor-hero-stat { text-align: right; }
.donor-hero-stat .val { font-size: 20px; font-weight: 700; }
.donor-hero-stat .lbl { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* Next Action Box */
.next-action-box {
  background: var(--emerald); border-radius: var(--radius);
  padding: 14px 18px; color: white;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(5,150,105,.3);
  animation: fadeUp .4s ease both;
}
.next-action-box i { font-size: 18px; flex-shrink: 0; }
.next-action-body strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.next-action-body span { font-size: 12px; opacity: .85; }
.next-action-btn {
  margin-left: auto; background: rgba(255,255,255,.2); color: white;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background .2s; cursor: pointer; border: none;
}
.next-action-btn:hover { background: rgba(255,255,255,.35); }

/* Notification Panel */
.notif-panel {
  position: fixed; top: 60px; right: 16px; z-index: 500;
  width: 340px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-height: 480px; overflow-y: auto;
  animation: fadeUp .2s ease;
  transition: background .3s;
}
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.notif-header button { font-size: 12px; color: var(--emerald); font-weight: 500; cursor: pointer; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; transition: background .2s; cursor: pointer; }
.notif-item:hover { background: var(--gray-xlight); }
.notif-item:last-child { border-bottom: none; }
.notif-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.notif-body strong { display: block; font-size: 12px; color: var(--text-primary); }
.notif-body span { font-size: 11px; color: var(--text-secondary); }
.notif-unread { background: var(--emerald-xlight); }

/* Smart Popup — REMOVED (replaced by workflow modal) */
#smartPopup { display: none !important; }

/* Quick Add Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 700; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-card { background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 480px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; animation: scaleIn .2s ease; border: 1px solid var(--border); }
.modal-card > div[style*="padding"] { overflow-y: auto; }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.modal-header button { color: var(--text-secondary); font-size: 16px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; }
.modal-header button:hover { background: var(--gray-light); }
.quick-add-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 20px; }
.quick-add-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 8px;
  background: var(--gray-xlight); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 11px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  transition: all .2s;
}
.quick-add-item i { font-size: 18px; color: var(--emerald); }
.quick-add-item:hover { background: var(--emerald-light); border-color: var(--emerald); color: var(--emerald); transform: translateY(-2px); }

/* Row alerts */
.row-overdue td { background: rgba(220,38,38,.05) !important; }
.row-overdue:hover td { background: rgba(220,38,38,.1) !important; }

/* Misc */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: .25; display: block; }
.empty-state p { font-size: 14px; }
.text-emerald { color: var(--emerald); }
.text-gray { color: var(--text-secondary); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-11 { font-size: 11px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* Campaign Goal */
.campaign-goal { margin-bottom: 8px; }
.campaign-goal-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; color: var(--text-secondary); }
.campaign-goal-pct { font-weight: 700; color: var(--emerald); }

/* Lead NGO Tag */
.lead-ngo-tag { font-size: 10px; padding: 2px 7px; border-radius: 20px; background: var(--emerald-light); color: var(--emerald-dark); font-weight: 600; margin-bottom: 4px; display: inline-block; }

/* NGO Filter Banner */
.ngo-filter-banner {
  background: linear-gradient(90deg, var(--emerald) 0%, var(--emerald-dark) 100%);
  color: white; border-radius: var(--radius); padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; font-size: 13px; font-weight: 600;
  animation: fadeUp .3s ease;
}
.ngo-filter-banner button { margin-left: auto; background: rgba(255,255,255,.2); color: white; border: none; padding: 4px 10px; border-radius: 20px; font-size: 11px; cursor: pointer; font-weight: 600; transition: background .2s; }
.ngo-filter-banner button:hover { background: rgba(255,255,255,.35); }

/* ============================================================
   DASHBOARD — hero, panel grid, channel split, leaderboard
   ============================================================ */
.dash-hero {
  background: linear-gradient(135deg, var(--dark-2, #0f172a), #064e3b);
  border-radius: var(--radius-lg); padding: 24px 28px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  color: #fff;
}
.dash-hero h2 { color: #fff; }
.dash-hero-eyebrow { font-size: 12px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.dash-hero-sub { font-size: 13px; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 8px; }
.dash-hero-figure { text-align: right; }
.dash-hero-figure-value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.dash-hero-figure-label { font-size: 11px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .5px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.dash-col-main, .dash-col-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; min-width: 0; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.panel-header h3 { margin: 0; font-size: 15px; }

.channel-bar-row { margin-bottom: 14px; }
.channel-bar-row:last-child { margin-bottom: 0; }
.channel-bar-label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.channel-bar-track { height: 8px; background: var(--gray-light); border-radius: 20px; overflow: hidden; }
.channel-bar-fill { height: 100%; border-radius: 20px; transition: width .4s ease; }
.channel-bar-fill.blue { background: var(--blue); }
.channel-bar-fill.green { background: var(--emerald); }

.leaderboard-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--gray-light); color: var(--text-secondary); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.leaderboard-rank.gold { background: #fde68a; color: #92400e; }
.leaderboard-rank.silver { background: #e5e7eb; color: #374151; }
.leaderboard-rank.bronze { background: #fdba74; color: #7c2d12; }
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-info strong { font-size: 13px; }
.leaderboard-amount { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }

.visit-queue-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.visit-queue-row:last-child { border-bottom: none; }
.visit-queue-main { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; }
.visit-queue-main strong { font-size: 14px; }
.visit-queue-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.visit-queue-meta i { margin-right: 4px; }
.visit-queue-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.perf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.perf-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.perf-value { font-size: 20px; font-weight: 800; color: var(--text-primary); letter-spacing: -.3px; }
.perf-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* Telecaller dashboard: My Performance / Quick Actions side-by-side row */
.perf-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.perf-grid .perf-value { font-size: 22px; }
.quick-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-actions-grid button { justify-content: flex-start; }
.disposition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 768px) {
  .perf-actions-row, .quick-actions-grid, .disposition-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   FIELD WITH ICON (app-theme forms — login.css's .input-icon-wrap
   is dark-only and scoped to the login page; this is the light/
   dark-aware equivalent for modals elsewhere in the app)
   ============================================================ */
.field-icon-wrap { position: relative; display: flex; align-items: center; }
.field-icon-wrap > i:first-child { position: absolute; left: 13px; color: var(--text-secondary); font-size: 13px; pointer-events: none; }
.field-icon-wrap input, .field-icon-wrap select, .field-icon-wrap textarea {
  width: 100%; padding: 11px 14px 11px 38px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); color: var(--text-primary); font-size: 14px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.field-icon-wrap input:focus, .field-icon-wrap select:focus, .field-icon-wrap textarea:focus {
  border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(5,150,105,.18);
}
.field-hint { font-size: 11px; color: var(--text-secondary); margin-top: 5px; line-height: 1.5; }

.modal-icon-header { display: flex; align-items: center; gap: 12px; padding: 20px 20px 0; }
.modal-icon-header .modal-icon-badge {
  width: 40px; height: 40px; border-radius: 50%; background: var(--emerald-light); color: var(--emerald);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.modal-icon-header .modal-icon-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.modal-icon-header .modal-icon-sub { font-size: 12px; color: var(--text-secondary); margin: 2px 0 0; }

.dedup-info-box {
  display: flex; gap: 10px; align-items: flex-start; background: var(--blue-light); color: var(--blue);
  border-radius: var(--radius); padding: 10px 12px; font-size: 12px; line-height: 1.5; margin-bottom: 16px;
}
.dedup-info-box i { margin-top: 2px; }

/* ============================================================
   VIEW TOGGLE (cards / table)
   ============================================================ */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-toggle-btn { background: var(--card-bg); border: none; padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all .15s; }
.view-toggle-btn.active { background: var(--emerald); color: #fff; }
.view-toggle-btn:not(.active):hover { background: var(--gray-xlight); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 14px; }
.filter-search i { color: var(--text-secondary); font-size: 13px; }
.filter-search input { border: none; background: none; outline: none; font-size: 13px; width: 100%; color: var(--text-primary); }
.filter-bar select { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; font-size: 13px; color: var(--text-primary); cursor: pointer; }

/* ============================================================
   DONOR CARDS
   ============================================================ */
.donor-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.donor-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; gap: 10px; }
.donor-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--emerald); }
.donor-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.donor-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--emerald), var(--blue)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.donor-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.donor-card-phone { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.donor-card-meta { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.meta-label { display: block; font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.donor-card-footer { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); }
.donor-card-actions { display: flex; gap: 6px; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--card-bg); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; text-decoration: none; transition: all .15s; }
.icon-btn:hover { background: var(--gray-xlight); color: var(--text-primary); }
.icon-btn.whatsapp:hover { background: #25D36622; color: #25D366; }

/* ============================================================
   DONOR PROFILE PAGE
   ============================================================ */
.profile-header-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.profile-header-info { flex: 1; min-width: 200px; }
.profile-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.detail-field span { display: block; font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.detail-field strong { font-size: 14px; color: var(--text-primary); font-weight: 600; }

.activity-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--emerald-light); color: var(--emerald); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.activity-body { flex: 1; }

.note-item { background: var(--gray-xlight); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; font-size: 13px; color: var(--text-primary); }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.file-item i.fa-file-lines { color: var(--text-secondary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-2, .grid-3-1 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; width: 260px; transition: left .3s ease; z-index: 200; }
  .sidebar.open { left: 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .donor-hero-stats { display: none; }
  .donor-card-grid { grid-template-columns: 1fr; }
  .profile-header-card { flex-direction: column; align-items: flex-start; }
  .profile-header-actions { width: 100%; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-hero-figure { text-align: left; }
}

/* Telecalling Team Lead dashboard */
.tl-period-tabs { display: flex; gap: 6px; margin: 14px 0 18px; }
.tl-period-tab { padding: 7px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-bg); color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.tl-period-tab:hover { border-color: var(--emerald); color: var(--emerald); }
.tl-period-tab.active { background: var(--emerald); color: #fff; border-color: var(--emerald); }

.tl-chart-toggle { display: flex; gap: 4px; margin-left: auto; }
.tl-chart-btn { padding: 5px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-bg); color: var(--text-secondary); font-size: 11px; font-weight: 600; cursor: pointer; }
.tl-chart-btn.active { background: var(--emerald-light); color: var(--emerald-dark); border-color: var(--emerald); }

.tl-bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 12px 4px 0; overflow-x: auto; }
.tl-bar-col { flex: 1 0 28px; min-width: 28px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.tl-bar-value { font-size: 11px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.tl-bar-track { width: 100%; max-width: 34px; flex: 1; display: flex; align-items: flex-end; background: var(--gray-xlight); border-radius: 6px 6px 0 0; overflow: hidden; }
.tl-bar-fill { width: 100%; background: linear-gradient(180deg, var(--emerald) 0%, var(--emerald-dark) 100%); border-radius: 6px 6px 0 0; transition: height .4s ease; min-height: 2px; }
.tl-bar-label { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }

.tl-funnel { padding: 4px 0; }
.tl-funnel-step { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 10px; }
.tl-funnel-label { font-size: 12px; color: var(--text-secondary); }
.tl-funnel-value { font-size: 13px; font-weight: 700; text-align: right; }
.tl-funnel-rates { display: flex; gap: 18px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.tl-funnel-rates div { display: flex; flex-direction: column; }
.tl-funnel-rates strong { font-size: 16px; color: var(--emerald-dark); }
.tl-funnel-rates span { font-size: 11px; color: var(--text-secondary); }

.tl-bucket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tl-bucket-card { background: var(--gray-xlight); border-radius: var(--radius); padding: 12px; cursor: pointer; transition: transform .15s; }
.tl-bucket-card:hover { transform: translateY(-2px); }
.tl-bucket-card.danger { background: var(--red-light); }
.tl-bucket-card.warn { background: var(--amber-light); }
.tl-bucket-value { font-size: 20px; font-weight: 800; }
.tl-bucket-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.tl-status-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.tl-status-row:last-child { border-bottom: none; }
.tl-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tl-status-dot.green { background: var(--emerald); }
.tl-status-dot.red { background: var(--red); }

.tl-attention-item { font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.tl-attention-item:last-of-type { border-bottom: none; }
.tl-attention-item strong { color: var(--text-primary); }

.tl-quick-actions { display: flex; flex-direction: column; gap: 8px; }

.tl-checklist { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; }
.tl-checklist-row { display: flex; align-items: center; gap: 8px; padding: 7px 2px; font-size: 13px; border-bottom: 1px solid var(--border); }
.tl-checklist-row:last-child { border-bottom: none; }
.tl-checklist-row input { width: auto; }

.tl-progress-row { display: flex; align-items: center; gap: 12px; }
.tl-progress-track { flex: 1; height: 14px; background: var(--gray-light); border-radius: 20px; overflow: hidden; }
.tl-progress-fill { height: 100%; background: linear-gradient(90deg, var(--emerald) 0%, var(--emerald-dark) 100%); border-radius: 20px; transition: width .5s ease; }
.tl-progress-pct { font-size: 15px; font-weight: 800; color: var(--emerald-dark); min-width: 44px; text-align: right; }
.tl-progress-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }

.tl-collection-summary { display: flex; gap: 20px; margin-bottom: 12px; flex-wrap: wrap; }
.tl-collection-summary div { display: flex; flex-direction: column; gap: 2px; }
.tl-collection-summary span { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; }
.tl-collection-summary strong { font-size: 18px; }

.tl-verify-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.tl-verify-row:last-child { border-bottom: none; }

/* Super Admin control-center dashboard */
.sa-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 22px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 20px; }
.sa-status-pill { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.sa-status-pill.ok { background: var(--emerald-light); color: var(--emerald-dark); }
.sa-status-pill.warn { background: var(--amber-light); color: var(--amber); }
.sa-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.sa-status-dot.green { background: var(--emerald); }
.sa-status-dot.amber { background: var(--amber); }
.sa-matrix { font-size: 12px; }
.sa-matrix th, .sa-matrix td { white-space: nowrap; padding: 8px 12px; }
.sa-matrix td:first-child { font-family: monospace; font-size: 11px; color: var(--text-secondary); white-space: normal; }
