/* ========================================================
   نظام إدارة المنح والشراكات – صناع الحياة الإسكندرية
   Life Makers Alexandria — Full UI Styling V2.1
   Supports: Light Theme / Dark Theme / RTL & LTR / Team Chat / Square Cards
   ======================================================== */

:root {
  /* Light Theme */
  --navy: #00557a;
  --navy-dark: #003e59;
  --navy-light: #eef6fa;
  --navy-border: #b8d7e8;
  
  --gold: #fbae42;
  --gold-dark: #d98f22;
  --gold-light: #fff8ec;
  --gold-border: #fedaa0;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-line: #e2e8f0;
  --border-line-dark: #cbd5e1;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #0284c7;
  --info-bg: #f0f9ff;

  --shadow-sm: 0 1px 2px 0 rgba(0, 85, 122, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 85, 122, 0.07), 0 2px 4px -2px rgba(0, 85, 122, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 85, 122, 0.08), 0 4px 6px -4px rgba(0, 85, 122, 0.03);
  --shadow-card: 0 2px 8px -2px rgba(0, 85, 122, 0.05), 0 1px 3px rgba(0, 85, 122, 0.03);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --sidebar-w: 250px;
  --header-h: 68px;
}

body.dark-theme {
  --navy: #38bdf8;
  --navy-dark: #0ea5e9;
  --navy-light: #0d2942;
  --navy-border: #1a476f;

  --gold: #fbae42;
  --gold-dark: #fbbf24;
  --gold-light: #2b2210;
  --gold-border: #694b15;

  --bg-page: #081624;
  --bg-card: #0d2235;
  --bg-alt: #132d46;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-line: #1c3c5c;
  --border-line-dark: #254d75;

  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--gold-dark);
}

/* Header */
header#mainHeader {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1.5px solid var(--border-line);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.brand-titles h1 {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}

.brand-titles small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-dark);
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-tool-btn {
  background: var(--bg-alt);
  border: 1.5px solid var(--border-line);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.header-tool-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
  transform: translateY(-1px);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}
.user-badge:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--navy);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info b {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.2;
}

.user-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout {
  background: none;
  border: 1px solid var(--border-line);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-logout:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* Layout */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-card);
  border-inline-end: 1.5px solid var(--border-line);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}

.nav-icon {
  font-style: normal;
  font-size: 17px;
  width: 24px;
  text-align: center;
}

.nav-item:hover {
  background: var(--bg-alt);
  color: var(--navy);
}

.nav-item.on {
  background: var(--navy-light);
  border-color: var(--navy-border);
  color: var(--navy);
  font-weight: 800;
}

.pill {
  margin-inline-start: auto;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--navy);
  color: #fff;
}
.pill-gold { background: var(--gold); color: #3c2a00; }
.pill-red { background: var(--danger); color: #fff; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1.5px solid var(--border-line);
}

.sync-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
}
.sync-title {
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 2px;
}
.sync-card p {
  color: var(--text-muted);
  margin-bottom: 8px;
}
.link-drive {
  display: inline-block;
  font-weight: 800;
  color: var(--navy);
}
.link-drive:hover {
  color: var(--gold-dark);
}

/* Main Content */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 24px 32px;
  max-width: 1540px;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.view-title-group h2 {
  font-size: 24px;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.view-title-group p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  padding: 9px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy-dark);
}
.btn-primary:hover {
  background: var(--navy-dark);
}

.btn-gold {
  background: var(--gold);
  color: #3b2a00;
  border-color: var(--gold-dark);
}
.btn-gold:hover {
  background: var(--gold-dark);
  color: #ffffff;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-line-dark);
}
.btn-outline:hover {
  background: var(--bg-alt);
  color: var(--navy);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 13px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--navy-border);
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--navy);
}
.kpi-card.gold::after { background: var(--gold); }
.kpi-card.success::after { background: var(--success); }
.kpi-card.info::after { background: var(--info); }
.kpi-card.danger::after { background: var(--danger); }

.kpi-data span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kpi-data h3 {
  font-size: 26px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.kpi-data small {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.kpi-icon {
  font-size: 24px;
  background: var(--bg-alt);
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Toolbar */
.toolbar-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 240px;
}
.search-box input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}
.search-box input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0, 85, 122, 0.1);
}
.search-icon {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}
.filter-select:focus {
  border-color: var(--navy);
}

.view-toggle {
  display: inline-flex;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}
.toggle-btn {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.toggle-btn.on {
  background: var(--bg-card);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

/* Kanban */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 24px;
  align-items: flex-start;
  min-height: 600px;
}

.kanban-column {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-alt);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 320px);
}

.column-header {
  padding: 14px 16px;
  border-bottom: 1.5px solid var(--border-line);
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.column-title h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
}
.column-badge {
  background: var(--bg-alt);
  border: 1px solid var(--border-line);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}
.column-total {
  font-size: 11px;
  font-weight: 800;
  color: var(--navy-dark);
}

.column-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

/* Grant Card */
.grant-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.grant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--navy-border);
}
.grant-card.excluded-card {
  opacity: 0.7;
  border-style: dashed;
  border-color: var(--danger);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.card-donor {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-dark);
}
.card-deadline {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.card-deadline.urgent {
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 900;
}

.card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.35;
}

.card-amount-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}
.card-amount-label {
  font-size: 11px;
  color: var(--text-muted);
}
.card-amount {
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
}

.card-approval {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  width: fit-content;
}
.approval-pending {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}
.approval-approved {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.approval-edits {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-line);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 12px;
}

.card-nav-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stage-shift-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border-line);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.1s ease;
}
.stage-shift-btn:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ========================================================
   Square Cards for Opportunities (#opps)
   ======================================================== */
.opp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.opp-square-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}
.opp-square-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-dark);
}

.opp-square-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.opp-decision-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.opp-decision-apply { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.opp-decision-watch { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.opp-decision-exclude { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }

.opp-square-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.opp-square-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.opp-square-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border-line);
  padding-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
}

/* ========================================================
   Calendar View
   ======================================================== */
.month-selector-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.month-pill-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.month-pill-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.month-pill-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 800;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.cal-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

/* ========================================================
   Donors Directory View
   ======================================================== */
.donors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.donor-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.donor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--navy);
}
.donor-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.donor-logo-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.donor-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.donor-meta h4 {
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
}
.donor-meta span {
  font-size: 11px;
  color: var(--gold-dark);
  font-weight: 800;
}
.donor-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-alt);
  padding: 10px;
  border-radius: var(--radius-md);
  text-align: center;
}
.donor-stat-val {
  font-size: 16px;
  font-weight: 900;
  color: var(--navy);
}
.donor-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

/* ========================================================
   Team & Live Chat (#team)
   ======================================================== */
.team-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  height: calc(100vh - 320px);
  min-height: 520px;
}

.team-sidebar-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.team-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  font-size: 13px;
}
.team-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 14px;
}

.chat-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header {
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--border-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
}
.chat-messages {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-page);
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  position: relative;
  line-height: 1.4;
}
.chat-bubble.mine {
  align-self: flex-start;
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 2px;
}
body.dark-theme .chat-bubble.mine {
  background: #0284c7;
  color: #fff;
}
.chat-bubble.others {
  align-self: flex-end;
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}
.chat-author {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 3px;
  color: var(--gold);
}
.chat-bubble.others .chat-author {
  color: var(--navy);
}
.chat-attachment-img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  display: block;
}
.chat-time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
  text-align: left;
}

.chat-input-bar {
  padding: 12px 16px;
  border-top: 1.5px solid var(--border-line);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 14px;
  background: var(--bg-page);
  color: var(--text-main);
  outline: none;
}
.chat-input:focus {
  border-color: var(--navy);
}

/* Tasks */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.task-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}
.task-card:hover {
  border-color: var(--navy);
}
.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.task-badge-status {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.task-status-not_started { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border-line); }
.task-status-in_progress { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.task-status-completed { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }

.task-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Modals */
.modal-dialog {
  border: none;
  background: transparent;
  padding: 20px;
  width: min(780px, 94vw);
  max-height: 92vh;
  margin: auto;
}
.modal-dialog::backdrop {
  background: rgba(8, 22, 36, 0.6);
  backdrop-filter: blur(4px);
}
.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--border-line);
  display: flex;
  flex-direction: column;
  max-height: calc(92vh - 40px);
  overflow: hidden;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1.5px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}
.modal-header h3 {
  font-size: 18px;
  font-weight: 900;
  color: var(--navy);
}
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.modal-close:hover {
  background: var(--bg-alt);
  color: var(--danger);
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-group.full {
  grid-column: 1 / -1;
}
.form-group label {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
}
.form-control {
  padding: 10px 14px;
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0, 85, 122, 0.15);
}
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1.5px solid var(--border-line);
}

/* Login View & Toast */
.login-wrapper {
  max-width: 480px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  height: 90px;
  width: auto;
  margin-bottom: 24px;
  object-fit: contain;
}
.login-wrapper h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 8px;
}
.login-wrapper p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 14px;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUp 0.25s ease;
}
.toast.success { background: #065f46; color: #fff; }
.toast.danger { background: var(--danger); color: #fff; }

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.loading-state {
  text-align: center;
  padding: 80px 20px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid var(--navy-light);
  border-top-color: var(--navy);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
  header#mainHeader {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 8px;
  }
  .top-navbar {
    order: 3;
    width: 100%;
    margin: 4px 0 0;
    padding: 4px 0;
    justify-content: flex-start;
    border-top: 1px solid var(--border-line);
  }
  .brand-titles h1 {
    font-size: 15px;
  }
  .brand-titles small {
    display: none;
  }
  .main-content {
    padding: 16px 14px 40px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .team-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}


/* ========================================================
   Short Note Modal & Rich Detail Views
   ======================================================== */
.short-note-sheet {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.short-note-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 2px solid var(--border-line);
  padding-bottom: 14px;
}
.short-note-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1.4;
}
body.dark-theme .short-note-title {
  color: var(--gold-light);
}
.short-note-donor {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-dark);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.short-note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: var(--bg-body);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
}
.short-note-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.short-note-item .label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.short-note-item .value {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 700;
}
.short-note-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  border-right: 4px solid var(--gold);
  padding-right: 8px;
  margin-top: 8px;
}
body.dark-theme .short-note-section-title {
  color: var(--gold);
}
.short-note-box {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-wrap;
}
.project-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(0, 85, 122, 0.08);
  border: 1px solid rgba(0, 85, 122, 0.2);
  color: var(--navy);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin: 4px;
}
body.dark-theme .project-pill-tag {
  background: rgba(251, 174, 66, 0.15);
  border-color: rgba(251, 174, 66, 0.3);
  color: var(--gold-light);
}

/* Profile Edit Box */
.profile-modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}
.profile-avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  object-fit: cover;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.avatar-upload-btn {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-body);
  border: 1.5px dashed var(--gold);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s;
}
body.dark-theme .avatar-upload-btn {
  color: var(--gold-light);
}
.avatar-upload-btn:hover {
  background: var(--gold);
  color: #fff;
}


/* ========================================================
   Top Navigation Bar (Replaces Sidebar)
   ======================================================== */
.top-navbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-navbar::-webkit-scrollbar {
  display: none;
}
.top-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.top-nav-item i {
  font-style: normal;
  font-size: 15px;
}
.top-nav-item:hover {
  color: var(--navy);
  background: var(--bg-alt);
}
.top-nav-item.on {
  color: var(--navy-dark);
  background: rgba(0, 85, 122, 0.08);
  border-color: rgba(0, 85, 122, 0.2);
  font-weight: 800;
}
body.dark-theme .top-nav-item.on {
  color: var(--gold);
  background: rgba(251, 174, 66, 0.12);
  border-color: rgba(251, 174, 66, 0.3);
}

/* Full Width App Layout */
.app-layout {
  display: block;
  width: 100%;
}
.main-content {
  max-width: 1450px;
  margin: 0 auto;
  padding: 24px 28px 60px;
  width: 100%;
}

/* ========================================================
   Clean Stacked Team List (No Side Avatars)
   ======================================================== */
.team-member-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}
.team-member-box:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.team-member-box .t-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
}

.team-member-box .t-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}
.team-member-box .t-email {
  font-size: 11px;
  color: var(--text-muted);
  direction: ltr;
  text-align: right;
  margin-top: 4px;
  opacity: 0.8;
}

/* ========================================================
   Polished Kanban Columns & Cards
   ======================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 20px;
}
.kanban-col {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  box-shadow: var(--shadow-sm);
}
.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-line);
}
.kanban-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  border-right: 4px solid var(--gold);
  padding-right: 8px;
}
.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Delete Button Styles */
.btn-delete-icon {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-delete-icon:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* ========================================================
   PREMIUM UX & MICRO-INTERACTIONS (V2.8 UPGRADE)
   ======================================================== */

/* 1. Header & Executive Nav Dock */
header#mainHeader {
  background: var(--bg-card);
  border-bottom: 1.5px solid var(--border-line);
  box-shadow: 0 4px 20px -2px rgba(0, 85, 122, 0.06);
  padding: 0 28px;
  gap: 16px;
}

.top-navbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  background: var(--bg-alt);
  padding: 5px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-line);
  overflow-x: auto;
  scrollbar-width: none;
}
.top-navbar::-webkit-scrollbar {
  display: none;
}

.top-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}
.top-nav-item i {
  font-size: 15px;
  transition: transform 0.2s ease;
}
.top-nav-item:hover {
  color: var(--navy);
  background: rgba(0, 85, 122, 0.05);
  transform: translateY(-1px);
}
.top-nav-item:hover i {
  transform: scale(1.15);
}
.top-nav-item.on {
  color: #ffffff;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  box-shadow: 0 2px 10px rgba(0, 85, 122, 0.28);
  font-weight: 800;
  border-color: rgba(255, 255, 255, 0.1);
}
body.dark-theme .top-nav-item.on {
  color: var(--navy-dark);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  box-shadow: 0 2px 12px rgba(251, 174, 66, 0.35);
}

/* 2. Stat Cards with Soft Hover Lift */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border-line);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(0, 85, 122, 0.12);
  border-color: var(--navy-border);
}
body.dark-theme .stat-card:hover {
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.4);
  border-color: var(--gold-border);
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}
.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-4deg);
}

/* 3. Horizontal Fluid Kanban Pipeline */
.kanban-board {
  display: flex !important;
  flex-direction: row !important;
  gap: 18px !important;
  overflow-x: auto !important;
  padding-bottom: 24px !important;
  align-items: flex-start !important;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
.kanban-board::-webkit-scrollbar {
  height: 8px;
}
.kanban-board::-webkit-scrollbar-track {
  background: var(--bg-alt);
  border-radius: var(--radius-full);
}
.kanban-board::-webkit-scrollbar-thumb {
  background: var(--border-line-dark);
  border-radius: var(--radius-full);
}

.kanban-col {
  width: 310px !important;
  min-width: 310px !important;
  flex-shrink: 0 !important;
  background: var(--bg-alt) !important;
  border: 1.5px solid var(--border-line) !important;
  border-radius: var(--radius-lg) !important;
  padding: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100vh - 320px);
  box-shadow: var(--shadow-sm);
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-line);
}
.kanban-title {
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  border-right: none !important;
  padding-right: 0 !important;
}

.grant-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grant-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -2px rgba(0, 85, 122, 0.1);
  border-color: var(--navy-border);
}

/* 4. Square Opportunity Cards UX */
.opp-square-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 275px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.opp-square-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px -4px rgba(0, 85, 122, 0.12);
  border-color: var(--gold);
}
.opp-square-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.opp-decision-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pill-apply {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.pill-monitor {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.pill-exclude {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.opp-square-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.opp-square-donor {
  font-size: 12.5px;
  color: var(--navy);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
body.dark-theme .opp-square-donor {
  color: var(--gold);
}
.opp-square-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-alt);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.opp-square-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-line);
  padding-top: 12px;
}

/* 5. Donors Cards with Logo & Quick Contact Actions */
.donor-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.donor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -3px rgba(0, 85, 122, 0.11);
  border-color: var(--navy-border);
}
.donor-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.15s ease;
}
.donor-quick-btn:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* 6. Pulse Online Indicator for Team Members */
.pulse-online {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
  display: inline-block;
}
@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 7. Modal Smooth Glassmorphic Entrance */
@keyframes modalScaleIn {
  0% { opacity: 0; transform: scale(0.95) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-dialog {
  border: none;
  background: transparent;
  padding: 16px;
  width: min(840px, 95vw);
  max-height: 94vh;
  margin: auto;
}
.modal-dialog::backdrop {
  background: rgba(8, 22, 36, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.35);
}

/* 8. Modern Speech Bubbles for Live Chat */
.chat-bubble {
  max-width: 78%;
  padding: 11px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  word-break: break-word;
}
.chat-bubble.mine {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
body.dark-theme .chat-bubble.mine {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
}
.chat-bubble.others {
  align-self: flex-end;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-line);
  border-bottom-left-radius: 4px;
}
.chat-bubble .chat-time {
  font-size: 10.5px;
  opacity: 0.75;
  align-self: flex-end;
  margin-top: 4px;
}


/* ========================================================
   SUB-HEADER NAVIGATION BAR (Tier 2 - All 8 tabs fully visible)
   ======================================================== */
.sub-header-nav {
  width: 100%;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-line);
  box-shadow: 0 3px 12px -2px rgba(0, 85, 122, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 20px;
  position: sticky;
  top: 70px;
  z-index: 90;
  backdrop-filter: blur(10px);
}

.sub-header-nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 1400px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.sub-header-nav-inner::-webkit-scrollbar {
  display: none;
}

/* ========================================================
   3 SQUARE CARDS PER ROW LAYOUT (Grants & Donors)
   ======================================================== */
.cards-grid-3 {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 22px !important;
  margin-top: 20px !important;
  width: 100% !important;
}

@media (max-width: 1100px) {
  .cards-grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 680px) {
  .cards-grid-3 {
    grid-template-columns: 1fr !important;
  }
}

.grant-card-square {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 290px;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
}
.grant-card-square:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px -4px rgba(0, 85, 122, 0.14);
  border-color: var(--navy);
}

.donor-card-square {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 290px;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
}
.donor-card-square:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px -4px rgba(0, 85, 122, 0.14);
  border-color: var(--navy);
}


/* ========================================================
   GLOBAL OVERFLOW & VIEWPORT LOCK (NO HORIZONTAL SCROLL)
   ======================================================== */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

.app-layout {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.main-content {
  width: 100% !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 20px 24px 60px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* ========================================================
   STRICT 3-CARDS PER ROW GRID SYSTEM (DESKTOP & LAPTOP)
   ======================================================== */
.cards-grid-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 20px !important;
}

@media (max-width: 1023px) {
  .cards-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .cards-grid-3 {
    grid-template-columns: 1fr !important;
  }
}

/* 3-Column Stats Grid for Dashboard */
.stats-grid-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1023px) {
  .stats-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .stats-grid-3 {
    grid-template-columns: 1fr !important;
  }
}

/* Calendar Square Card */
.calendar-square-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 290px;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.calendar-square-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px -4px rgba(0, 85, 122, 0.14);
  border-color: var(--navy);
}

.calendar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.calendar-card-donor {
  font-size: 12.5px;
  color: var(--navy);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.calendar-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-alt);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}

.calendar-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-line);
  padding-top: 12px;
}

/* Kanban Horizontal Isolation */
.kanban-board {
  max-width: 100% !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
}

/* ========================================================
   HIGH-CONTRAST DARK MODE OVERHAUL (CRISP & READABLE)
   ======================================================== */
body.dark-theme {
  --bg-page: #081420;
  --bg-card: #0d1e30;
  --bg-alt: #13263d;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --border-line: #1c3856;
  --border-line-dark: #294e75;
}

/* Stat Cards */
body.dark-theme .stat-card {
  background: #0d1e30 !important;
  border-color: #1c3856 !important;
}
body.dark-theme .stat-card small {
  color: #cbd5e1 !important;
  font-weight: 700 !important;
}
body.dark-theme .stat-card h3 {
  color: #ffffff !important;
}
body.dark-theme .stat-card span {
  color: #94a3b8 !important;
}

/* Opportunity Cards */
body.dark-theme .opp-square-card {
  background: #0d1e30 !important;
  border-color: #1c3856 !important;
}
body.dark-theme .opp-square-title {
  color: #ffffff !important;
}
body.dark-theme .opp-square-donor {
  color: #fbae42 !important;
}
body.dark-theme .opp-square-meta {
  background: #13263d !important;
  border: 1px solid #1c3856 !important;
  color: #cbd5e1 !important;
}
body.dark-theme .opp-square-meta b {
  color: #f8fafc !important;
}
body.dark-theme .meta-val-deadline {
  color: #38bdf8 !important;
  font-weight: 700 !important;
}
body.dark-theme .meta-val-amount {
  color: #fbae42 !important;
  font-weight: 800 !important;
}
body.dark-theme .opp-view-sn-link {
  color: #38bdf8 !important;
}

/* Calendar Cards */
body.dark-theme .calendar-square-card {
  background: #0d1e30 !important;
  border-color: #1c3856 !important;
}
body.dark-theme .calendar-card-title {
  color: #ffffff !important;
}
body.dark-theme .calendar-card-donor {
  color: #fbae42 !important;
}
body.dark-theme .calendar-card-meta {
  background: #13263d !important;
  border: 1px solid #1c3856 !important;
  color: #cbd5e1 !important;
}
body.dark-theme .calendar-card-meta b {
  color: #f8fafc !important;
}
body.dark-theme .cal-deadline-highlight {
  color: #f87171 !important;
  font-weight: 800 !important;
}

/* Donor Cards */
body.dark-theme .donor-card,
body.dark-theme .donor-card-square {
  background: #0d1e30 !important;
  border-color: #1c3856 !important;
}
body.dark-theme .donor-name {
  color: #ffffff !important;
}
body.dark-theme .donor-quick-btn {
  background: #13263d !important;
  color: #f8fafc !important;
  border: 1px solid #1c3856 !important;
}
body.dark-theme .donor-quick-btn:hover {
  background: #1e3a5a !important;
  color: #38bdf8 !important;
}

/* Grant Cards */
body.dark-theme .grant-card,
body.dark-theme .grant-card-square {
  background: #0d1e30 !important;
  border-color: #1c3856 !important;
}
body.dark-theme .grant-card-title {
  color: #ffffff !important;
}
body.dark-theme .grant-card-donor {
  color: #fbae42 !important;
}

/* Controls, Inputs & Filters */
body.dark-theme .filter-input,
body.dark-theme .filter-select,
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: #102236 !important;
  color: #ffffff !important;
  border: 1.5px solid #24466b !important;
}
body.dark-theme input::placeholder {
  color: #8899ac !important;
}
body.dark-theme .month-pill-btn {
  background: #102236 !important;
  color: #cbd5e1 !important;
  border-color: #1c3856 !important;
}
body.dark-theme .month-pill-btn.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
  color: #081420 !important;
  font-weight: 800 !important;
}
body.dark-theme .btn-outline {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f1f5f9 !important;
  border-color: #2b4c73 !important;
}
body.dark-theme .btn-outline:hover {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}
body.dark-theme .page-header p {
  color: #cbd5e1 !important;
}

/* Modals & Short Notes in Dark Mode */
body.dark-theme .modal-dialog {
  background: #0d1e30 !important;
  border-color: #24466b !important;
  color: #f8fafc !important;
}
body.dark-theme .short-note-title {
  color: #ffffff !important;
}
body.dark-theme .short-note-donor {
  color: #cbd5e1 !important;
}
body.dark-theme .short-note-item {
  background: #13263d !important;
  border-color: #1c3856 !important;
}
body.dark-theme .short-note-item .label {
  color: #94a3b8 !important;
}
body.dark-theme .short-note-item .value {
  color: #ffffff !important;
}
body.dark-theme .short-note-section-title {
  color: #38bdf8 !important;
}
body.dark-theme .short-note-box {
  background: #13263d !important;
  color: #e2e8f0 !important;
  border-color: #1c3856 !important;
}
body.dark-theme .project-pill-tag {
  background: #162c46 !important;
  color: #ffffff !important;
  border-color: #294e75 !important;
}


/* ========================================================
   V3.1 FIXES: STAT CARDS SMOOTH ROUNDED EDGES & ZERO SHARP ANGLES
   ======================================================== */
.stat-card {
  border-radius: 18px !important;
  overflow: hidden !important;
  border: 1.5px solid var(--border-line) !important;
  border-top: none !important; /* Eliminate sharp rectangular cut at top edge */
}

/* ========================================================
   V3.1 FIXES: REMOVE SCROLLBAR TRACKS (SETTINGS & CHAT)
   ======================================================== */
html, body, #settings, #team, .chat-panel, .chat-messages, .main-content, .team-members-panel, .member-stacked-list {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* Smooth default page scrollbar */
html {
  scrollbar-width: thin;
}

/* ========================================================
   V3.1 FIXES: TEAM MEMBERS HIGH CONTRAST IN DARK MODE
   ======================================================== */
body.dark-theme .team-member-box {
  background: #0d1e30 !important;
  border-color: #1c3856 !important;
}

body.dark-theme .team-member-box .t-name,
body.dark-theme .t-name {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

body.dark-theme .team-member-box .t-role,
body.dark-theme .t-role {
  color: #cbd5e1 !important;
  font-weight: 600 !important;
}

body.dark-theme .team-member-box .t-email,
body.dark-theme .t-email {
  color: #94a3b8 !important;
  opacity: 0.9 !important;
}

/* ========================================================
   V3.1: CHAT AUDIO RECORDER STYLING
   ======================================================== */
.chat-record-btn {
  background: transparent;
  border: 1px solid transparent;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.chat-record-btn:hover {
  background: rgba(0, 85, 122, 0.08);
  transform: scale(1.1);
}

body.dark-theme .chat-record-btn {
  color: #f1f5f9;
}

body.dark-theme .chat-record-btn:hover {
  background: rgba(251, 174, 66, 0.15);
  color: var(--gold);
}


/* ========================================================
   MODAL POSITION FIXED CENTER LOCK (FIX OFF-SCREEN BUG)
   ======================================================== */
dialog.modal-dialog {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  border: none !important;
  z-index: 9999 !important;
  width: min(840px, 95vw) !important;
  max-height: 92vh !important;
  background: transparent !important;
  padding: 0 !important;
  overflow: visible !important;
}

dialog.modal-dialog[open] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

dialog.modal-dialog::backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(8, 20, 32, 0.72) !important;
  backdrop-filter: blur(6px) !important;
  z-index: 9998 !important;
}

.modal-card {
  width: 100% !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  background: var(--bg-card) !important;
  border: 1.5px solid var(--border-line) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
}

.modal-header {
  padding: 16px 22px !important;
  border-bottom: 1.5px solid var(--border-line) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: var(--bg-card) !important;
}

.modal-body {
  padding: 22px !important;
  overflow-y: auto !important;
  max-height: calc(90vh - 70px) !important;
}



/* ======================================================================
   THE MODERN FINTECH / SAAS LUXURY REDESIGN (INSPIRED BY USER MOCKUP)
   Brand Identity: Life Makers Alexandria (Navy #00557a, Gold #fbae42)
   ====================================================================== */

:root {
  --navy: #00557a;
  --navy-dark: #003e59;
  --navy-light: #e6f1f6;
  --navy-border: #b3d4e3;

  --gold: #fbae42;
  --gold-dark: #e59a29;
  --gold-light: #fff7eb;
  --gold-border: #fcd7a1;

  --bg-page: #f6f9fc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  --bg-body: #f8fafc;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-line: rgba(0, 85, 122, 0.09);
  --border-line-dark: rgba(0, 85, 122, 0.16);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 85, 122, 0.04);
  --shadow-card: 0 10px 30px -5px rgba(0, 85, 122, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 14px 34px -4px rgba(0, 85, 122, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 22px 50px -8px rgba(0, 85, 122, 0.14), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Refined component scrollbars */
html, body {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

body.light-theme {
  background: radial-gradient(circle at 50% -20%, rgba(0, 85, 122, 0.06) 0%, rgba(246, 249, 252, 1) 60%), #f6f9fc !important;
  color: var(--text-main) !important;
}

body.dark-theme {
  --navy: #38bdf8;
  --navy-dark: #0ea5e9;
  --navy-light: #0d2235;
  --navy-border: #1a4267;

  --gold: #fbae42;
  --gold-dark: #fbbf24;
  --gold-light: #fff7eb;
  --gold-border: #694b15;

  --bg-page: #08101a;
  --bg-card: #0e1b2d;
  --bg-alt: #13243a;
  --bg-body: #0a1422;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-line: rgba(255, 255, 255, 0.08);
  --border-line-dark: rgba(255, 255, 255, 0.14);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);

  background: radial-gradient(circle at 50% -20%, rgba(0, 85, 122, 0.22) 0%, rgba(8, 16, 26, 1) 70%), #08101a !important;
  color: #f8fafc !important;
}

/* Glassmorphic Brand Header */
header#mainHeader {
  height: 72px !important;
  background: rgba(255, 255, 255, 0.90) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid var(--border-line) !important;
  padding: 0 32px !important;
  box-shadow: 0 4px 20px -4px rgba(0, 85, 122, 0.04) !important;
}
body.dark-theme header#mainHeader {
  background: rgba(14, 27, 45, 0.90) !important;
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.4) !important;
}

/* Glassmorphic Floating Sub-Header Navigation */
.sub-header-nav {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--border-line) !important;
  padding: 8px 24px !important;
  top: 72px !important;
  box-shadow: 0 4px 14px -3px rgba(0, 85, 122, 0.03) !important;
}
body.dark-theme .sub-header-nav {
  background: rgba(14, 27, 45, 0.85) !important;
}

.sub-header-nav-inner {
  background: rgba(0, 85, 122, 0.035) !important;
  border-radius: var(--radius-full) !important;
  padding: 5px 8px !important;
  border: 1px solid var(--border-line) !important;
}
body.dark-theme .sub-header-nav-inner {
  background: rgba(255, 255, 255, 0.03) !important;
}

.top-nav-item {
  border-radius: var(--radius-full) !important;
  padding: 8px 18px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.top-nav-item:hover {
  background: rgba(0, 85, 122, 0.06) !important;
  color: var(--navy) !important;
  transform: translateY(-1px) !important;
}
.top-nav-item.on {
  background: linear-gradient(135deg, var(--navy), #003e59) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 85, 122, 0.28) !important;
}
body.dark-theme .top-nav-item.on {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
  color: #08101a !important;
  box-shadow: 0 4px 16px rgba(251, 174, 66, 0.35) !important;
}

/* Modern Fintech Pill Buttons */
.btn {
  border-radius: var(--radius-full) !important;
  padding: 10px 22px !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}
.btn-primary {
  background: linear-gradient(135deg, var(--navy), #003e59) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 85, 122, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 22px rgba(0, 85, 122, 0.35) !important;
}
body.dark-theme .btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3) !important;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
  color: #00344d !important;
  box-shadow: 0 4px 14px rgba(251, 174, 66, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}
.btn-gold:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 22px rgba(251, 174, 66, 0.42) !important;
}
.btn-outline {
  border: 1.5px solid var(--border-line-dark) !important;
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-sm) !important;
}
.btn-outline:hover {
  border-color: var(--navy) !important;
  color: var(--navy) !important;
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-md) !important;
}
body.dark-theme .btn-outline {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f1f5f9 !important;
}
body.dark-theme .btn-outline:hover {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}

/* Ultra-Clean Modern Stat Cards (Fintech Style) */
.stat-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-line) !important;
  border-radius: var(--radius-lg) !important;
  padding: 24px !important;
  box-shadow: var(--shadow-card) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}
.stat-card > div:first-child[style*="height:4px"] {
  display: none !important;
}
.stat-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--navy-border) !important;
}
body.dark-theme .stat-card:hover {
  border-color: rgba(251, 174, 66, 0.4) !important;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(0, 85, 122, 0.06);
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease;
}
.stat-card:hover .stat-icon-wrapper {
  transform: scale(1.1) rotate(-3deg);
}
body.dark-theme .stat-icon-wrapper {
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold);
}

.stat-big-number {
  font-size: 32px !important;
  font-weight: 900 !important;
  color: var(--navy) !important;
  letter-spacing: -0.5px !important;
  line-height: 1.15 !important;
  margin: 10px 0 4px !important;
}
body.dark-theme .stat-big-number {
  color: #ffffff !important;
}

.stat-card-label {
  font-size: 13.5px !important;
  font-weight: 800 !important;
  color: var(--text-muted) !important;
  letter-spacing: -0.2px !important;
}
body.dark-theme .stat-card-label {
  color: #cbd5e1 !important;
}

/* Fintech Analytics Bar Chart Widget */
.fintech-analytics-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-line) !important;
  border-radius: var(--radius-lg) !important;
  padding: 24px 28px !important;
  box-shadow: var(--shadow-card) !important;
  margin-bottom: 24px !important;
}
.bar-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  height: 160px;
  padding-top: 20px;
  border-bottom: 1.5px solid var(--border-line);
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar-fill {
  width: 100%;
  max-width: 44px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--navy), #003e59);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  min-height: 14px;
  cursor: pointer;
}
.chart-bar-fill:hover {
  transform: scaleY(1.05);
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
}
body.dark-theme .chart-bar-fill {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
}
body.dark-theme .chart-bar-fill:hover {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
}
.chart-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

/* Luxury Square Cards (Donors, Opportunities, Calendar, Grants) */
.donor-card, .donor-card-square,
.opp-square-card,
.calendar-square-card,
.grant-card-square {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-line) !important;
  border-radius: var(--radius-lg) !important;
  padding: 24px !important;
  box-shadow: var(--shadow-card) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  min-height: 290px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}
.donor-card:hover, .donor-card-square:hover,
.opp-square-card:hover,
.calendar-square-card:hover,
.grant-card-square:hover {
  transform: translateY(-5px) !important;
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--navy-border) !important;
}
body.dark-theme .donor-card:hover,
body.dark-theme .opp-square-card:hover,
body.dark-theme .calendar-square-card:hover,
body.dark-theme .grant-card-square:hover {
  border-color: rgba(251, 174, 66, 0.45) !important;
}

/* Inner Metadata Boxes */
.opp-square-meta,
.calendar-card-meta,
.grant-card-meta,
.donor-meta-box {
  background: var(--bg-alt) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 14px !important;
  border: 1px solid var(--border-line) !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
}
body.dark-theme .opp-square-meta,
body.dark-theme .calendar-card-meta,
body.dark-theme .grant-card-meta,
body.dark-theme .donor-meta-box {
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Chat Contrast & Name Rules */
.t-name,
.team-member-box .t-name,
body.light-theme .t-name,
body.light-theme .team-member-box .t-name {
  color: #00557a !important;
  font-weight: 800 !important;
}
body.dark-theme .t-name,
body.dark-theme .team-member-box .t-name {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
body.dark-theme .t-role,
body.dark-theme .team-member-box .t-role {
  color: #cbd5e1 !important;
}
body.dark-theme .t-email,
body.dark-theme .team-member-box .t-email {
  color: #94a3b8 !important;
}
body.dark-theme .team-member-box {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Settings Dark Mode Cards Fix */
body.dark-theme .card,
body.dark-theme .settings-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-line) !important;
  color: var(--text-main) !important;
}
body.dark-theme .card h4,
body.dark-theme .card h3 {
  color: var(--gold) !important;
}

/* Modal Styling - Perfectly Centered & Squircle */
dialog.modal-dialog,
dialog#modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  max-height: 90vh !important;
  max-width: 860px !important;
  width: 92% !important;
  border-radius: 24px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5) !important;
  border: 1px solid var(--border-line-dark) !important;
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  z-index: 99999 !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
}
dialog.modal-dialog::-webkit-scrollbar {
  display: none !important;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}


/* ======================================================================
   CARBON CLOUD DASHBOARD V4 (ENTERPRISE TOKENS & COMPONENTS)
   ====================================================================== */

:root {
  --carbon-gray-100: #161616;
  --carbon-gray-90: #262626;
  --carbon-gray-80: #393939;
  --carbon-gray-70: #525252;
  --carbon-gray-20: #e0e0e0;
  --carbon-gray-10: #f4f4f4;
  --carbon-blue: #0f62fe;
  --carbon-blue-hover: #0353e9;
  --carbon-red: #da1e28;
  --carbon-red-hover: #b81921;
  --carbon-green: #24a148;
}

/* 1. Header Bar Carbon Top Navbar */
header#mainHeader.brand-header {
  background: linear-gradient(135deg, #00557a 0%, #003d58 100%) !important;
  border-bottom: 2.5px solid #fbae42 !important;
  color: #ffffff !important;
  height: 56px !important;
  padding: 0 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

header#mainHeader .brand-titles h1 {
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}

header#mainHeader .brand-titles small {
  color: #94a3b8 !important;
  font-size: 11px !important;
}

/* Recessed Carbon Search Bar in Header */
.header-search-wrapper {
  flex: 0 1 440px;
  position: relative;
  margin: 0 16px;
  display: flex;
  align-items: center;
}

.header-search-icon {
  position: absolute;
  right: 12px;
  color: #8d8d8d;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.header-search-input {
  width: 100%;
  height: 36px;
  background: #262626;
  border: 1px solid #393939;
  border-radius: 4px;
  padding: 0 38px 0 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.header-search-input::placeholder {
  color: #8d8d8d;
}

.header-search-input:focus {
  border-color: var(--carbon-blue);
  background: #1e1e1e;
  box-shadow: 0 0 0 1px var(--carbon-blue);
}

/* Sub-Header Navbar Carbon */
nav#topNav.sub-header-nav {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
}

body.dark-theme nav#topNav.sub-header-nav {
  background: #161616 !important;
  border-bottom: 1px solid #262626 !important;
}

.top-nav-item {
  color: #525252;
  font-weight: 700;
  border-bottom: 2px solid transparent;
}

body.dark-theme .top-nav-item {
  color: #c6c6c6;
}

.top-nav-item:hover,
.top-nav-item.on {
  color: var(--carbon-blue) !important;
  border-bottom-color: var(--carbon-blue) !important;
  background: rgba(15, 98, 254, 0.05) !important;
}

/* 2. Modern Carbon Search Box (Used in All Sections) */
.carbon-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 280px;
  max-width: 520px;
}

.carbon-search-icon {
  position: absolute;
  right: 14px;
  color: #8d8d8d;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.carbon-search-input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 16px;
  background: #f4f4f4;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  color: #161616;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.carbon-search-input:focus {
  border-color: var(--carbon-blue);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(15, 98, 254, 0.2);
}

body.dark-theme .carbon-search-input {
  background: #262626;
  border-color: #393939;
  color: #ffffff;
}

body.dark-theme .carbon-search-input:focus {
  background: #1e1e1e;
  border-color: var(--carbon-blue);
}

/* 3. Carbon Action Buttons */
.carbon-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--carbon-blue);
  color: #ffffff !important;
  border: 1px solid var(--carbon-blue);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.carbon-btn-primary:hover {
  background: var(--carbon-blue-hover);
  border-color: var(--carbon-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 98, 254, 0.3);
}

.carbon-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: transparent;
  color: var(--carbon-blue);
  border: 1px solid var(--carbon-blue);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.carbon-btn-secondary:hover {
  background: rgba(15, 98, 254, 0.08);
}

body.dark-theme .carbon-btn-secondary {
  color: #38bdf8;
  border-color: #38bdf8;
}

.carbon-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--carbon-red);
  color: #ffffff !important;
  border: 1px solid var(--carbon-red);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.carbon-btn-danger:hover {
  background: var(--carbon-red-hover);
  border-color: var(--carbon-red-hover);
}

/* 4. Stat Cards (Squircle & Bidi-Isolated Breakdown) */
.carbon-stat-card {
  border-radius: 12px !important;
  border: 1px solid #e0e0e0;
  background: var(--bg-card);
  transition: all 0.2s ease;
}

body.dark-theme .carbon-stat-card {
  border-color: #334155 !important;
  background: #0d2235 !important;
}

.stat-pills-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  direction: rtl;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 800;
  direction: rtl;
  unicode-bidi: isolate;
}

.stat-pill strong.num {
  font-size: 14.5px;
  font-weight: 900;
  display: inline-block;
  direction: ltr;
}

.stat-pill-apply {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-pill-monitor {
  background: rgba(251, 174, 66, 0.15);
  color: #d97706;
  border: 1px solid rgba(251, 174, 66, 0.3);
}

.stat-pill-exclude {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 5. Complete Donor Cards Full Details Table */
.donor-card-square {
  background: var(--bg-card);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
  transition: all 0.2s ease;
}

body.dark-theme .donor-card-square {
  background: #0d2235;
  border-color: #1c3c5c;
}

.donor-card-square:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--carbon-blue);
}

.donor-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.donor-avatar-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(15, 98, 254, 0.1);
  color: var(--carbon-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.donor-card-meta-table {
  background: var(--bg-page);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12.5px;
}

.donor-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.donor-meta-row .meta-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.donor-meta-row .meta-val {
  font-weight: 700;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 65%;
  text-align: left;
}

.donor-link {
  color: var(--carbon-blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.donor-link:hover {
  text-decoration: underline;
}

.text-muted-inline {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 11.5px;
}

.donor-card-notes {
  background: rgba(251, 174, 66, 0.08);
  border-right: 3px solid var(--gold);
  border-radius: 0 4px 4px 0;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 12px;
}

.donor-card-notes .notes-title {
  font-weight: 800;
  color: var(--gold-dark);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.donor-card-notes .notes-content {
  color: var(--text-main);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.donor-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border-line);
  padding-top: 14px;
  margin-top: auto;
}

/* 6. Settings 3-Column Enterprise Carbon Layout */
.carbon-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 1100px) {
  .carbon-settings-grid {
    grid-template-columns: 1fr;
  }
}

.carbon-panel {
  background: var(--bg-card);
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 24px;
}

body.dark-theme .carbon-panel {
  background: #0d2235;
  border-color: #1c3c5c;
}

.carbon-panel-header {
  border-bottom: 1px solid var(--border-line);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.carbon-panel-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  margin: 0 0 4px;
}

.carbon-panel-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.carbon-panel-section {
  border-bottom: 1px solid var(--border-line);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.carbon-panel-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.carbon-section-subtitle {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.carbon-field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.carbon-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

body.dark-theme .carbon-input {
  background: #132d46;
  border-color: #254d75;
}

.carbon-input:focus {
  border-color: var(--carbon-blue);
}

/* Switches & Sliders */
.carbon-toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.carbon-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.carbon-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.carbon-slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 22px;
}

.carbon-slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .carbon-slider-round {
  background-color: var(--carbon-blue);
}

input:checked + .carbon-slider-round:before {
  transform: translateX(18px);
}

.carbon-checkbox-list,
.carbon-radio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carbon-check-item,
.carbon-radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
}

.carbon-range-slider {
  accent-color: var(--carbon-blue);
  cursor: pointer;
}

.carbon-danger-box {
  background: rgba(218, 30, 40, 0.08);
  border: 1px solid rgba(218, 30, 40, 0.25);
  border-radius: 4px;
  padding: 14px;
}

.carbon-danger-box .danger-title {
  color: var(--carbon-red);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.carbon-sync-status-box {
  background: var(--bg-page);
  border: 1px solid var(--border-line);
  border-radius: 4px;
  padding: 14px;
}

.carbon-team-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.carbon-team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-line);
  border-radius: 4px;
}

/* 7. Team Member High-Contrast Fix */
.carbon-team-row .t-name,
body.light-theme .carbon-team-row .t-name {
  color: #00557a !important;
  font-weight: 800 !important;
}
body.dark-theme .carbon-team-row .t-name {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

body.dark-theme .team-member-box {
  background: #0d2235 !important;
  border-color: #1c3c5c !important;
}

body.dark-theme .team-member-box .t-role {
  color: var(--gold) !important;
}

body.dark-theme .team-member-box .t-email {
  color: #94a3b8 !important;
}

/* 8. Zero Horizontal Overflow Protection */
html, body {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

* {
  box-sizing: border-box;
}


/* ======================================================================
   V4.1 BRAND COLORS & CUSTOM CARD SCROLLBARS (مؤشر الطلوع والنزول)
   ====================================================================== */

/* 1. Header Bar Life Makers Navy (#00557a) & Gold Accent */
header#mainHeader.brand-header {
  background: linear-gradient(135deg, #00557a 0%, #003e59 100%) !important;
  border-bottom: 2.5px solid #fbae42 !important;
  box-shadow: 0 4px 16px rgba(0, 85, 122, 0.25) !important;
}

header#mainHeader .brand-titles h1 {
  color: #ffffff !important;
}

header#mainHeader .brand-titles small {
  color: #fbae42 !important;
  font-weight: 700;
}

.header-search-input {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(251, 174, 66, 0.35) !important;
  color: #ffffff !important;
}

.header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.7) !important;
}

.header-search-icon {
  color: #fbae42 !important;
}

/* 2. Official Brand Footer (Navy #00557a) */
footer#appFooter.brand-footer {
  background: linear-gradient(135deg, #00557a 0%, #003e59 100%) !important;
  border-top: 2.5px solid #fbae42 !important;
  color: #ffffff !important;
  padding: 16px 28px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  padding: 3px;
}

.footer-text {
  display: flex;
  flex-direction: column;
}

.footer-text b {
  color: #ffffff;
  font-size: 13.5px;
}

.footer-text small {
  color: #fbae42;
  font-size: 11px;
}

.footer-badge {
  background: rgba(251, 174, 66, 0.15);
  color: #fbae42;
  border: 1px solid rgba(251, 174, 66, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}

/* 3. Precision Scrollbars: Hidden on Window/Settings/Chat, Sleek on Cards */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
#settings::-webkit-scrollbar,
#team::-webkit-scrollbar,
.chat-panel::-webkit-scrollbar,
.whatsapp-container::-webkit-scrollbar,
.whatsapp-sidebar::-webkit-scrollbar,
.whatsapp-chat-room::-webkit-scrollbar,
.whatsapp-threads-list::-webkit-scrollbar,
.whatsapp-messages-stream::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
html, body, #settings, #team, .chat-panel, .whatsapp-container, .whatsapp-sidebar, .whatsapp-chat-room, .whatsapp-threads-list, .whatsapp-messages-stream {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.donor-card-notes,
.opp-square-meta,
.calendar-card-meta,
.kanban-cards,
.carbon-team-table,
.short-note-box {
  scrollbar-width: thin !important;
  scrollbar-color: #00557a rgba(0, 85, 122, 0.08) !important;
}

.donor-card-notes::-webkit-scrollbar,
.opp-square-meta::-webkit-scrollbar,
.calendar-card-meta::-webkit-scrollbar,
.kanban-cards::-webkit-scrollbar,
.carbon-team-table::-webkit-scrollbar,
.short-note-box::-webkit-scrollbar {
  display: block !important;
  width: 5px !important;
  height: 5px !important;
}

.donor-card-notes::-webkit-scrollbar-track,
.opp-square-meta::-webkit-scrollbar-track,
.calendar-card-meta::-webkit-scrollbar-track,
.kanban-cards::-webkit-scrollbar-track,
.carbon-team-table::-webkit-scrollbar-track,
.short-note-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04) !important;
  border-radius: 4px !important;
}

.donor-card-notes::-webkit-scrollbar-thumb,
.opp-square-meta::-webkit-scrollbar-thumb,
.calendar-card-meta::-webkit-scrollbar-thumb,
.kanban-cards::-webkit-scrollbar-thumb,
.carbon-team-table::-webkit-scrollbar-thumb,
.short-note-box::-webkit-scrollbar-thumb {
  background: #00557a !important;
  border-radius: 4px !important;
  transition: background 0.2s ease;
}

.donor-card-notes::-webkit-scrollbar-thumb:hover,
.opp-square-meta::-webkit-scrollbar-thumb:hover,
.calendar-card-meta::-webkit-scrollbar-thumb:hover,
.kanban-cards::-webkit-scrollbar-thumb:hover,
.carbon-team-table::-webkit-scrollbar-thumb:hover,
.short-note-box::-webkit-scrollbar-thumb:hover {
  background: #fbae42 !important;
}

body.dark-theme .donor-card-notes::-webkit-scrollbar-thumb,
body.dark-theme .opp-square-meta::-webkit-scrollbar-thumb,
body.dark-theme .calendar-card-meta::-webkit-scrollbar-thumb,
body.dark-theme .kanban-cards::-webkit-scrollbar-thumb,
body.dark-theme .carbon-team-table::-webkit-scrollbar-thumb,
body.dark-theme .short-note-box::-webkit-scrollbar-thumb {
  background: #38bdf8 !important;
}

body.dark-theme .donor-card-notes::-webkit-scrollbar-track,
body.dark-theme .opp-square-meta::-webkit-scrollbar-track,
body.dark-theme .calendar-card-meta::-webkit-scrollbar-track,
body.dark-theme .kanban-cards::-webkit-scrollbar-track,
body.dark-theme .carbon-team-table::-webkit-scrollbar-track,
body.dark-theme .short-note-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Card Scrollable Content Area */
.donor-card-notes,
.opp-square-meta,
.calendar-card-meta,
.kanban-cards {
  max-height: 180px;
  overflow-y: auto !important;
  padding-left: 4px;
}

/* Trend Badges on Stat Cards */
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
}

.trend-badge.trend-up {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.trend-badge.trend-neutral {
  background: rgba(251, 174, 66, 0.12);
  color: #d97706;
  border: 1px solid rgba(251, 174, 66, 0.3);
}

/* 6. Precision Scrollbars: Hidden on Window/Settings/Chat, Sleek on Cards */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
#settings::-webkit-scrollbar,
#team::-webkit-scrollbar,
.chat-panel::-webkit-scrollbar,
.whatsapp-container::-webkit-scrollbar,
.whatsapp-sidebar::-webkit-scrollbar,
.whatsapp-chat-room::-webkit-scrollbar,
.whatsapp-threads-list::-webkit-scrollbar,
.whatsapp-messages-stream::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
html, body, #settings, #team, .chat-panel, .whatsapp-container, .whatsapp-sidebar, .whatsapp-chat-room, .whatsapp-threads-list, .whatsapp-messages-stream {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.donor-card-notes,
.opp-square-meta,
.calendar-card-meta,
.kanban-cards,
.carbon-team-table,
.short-note-box {
  scrollbar-width: thin !important;
}

.donor-card-notes::-webkit-scrollbar,
.opp-square-meta::-webkit-scrollbar,
.calendar-card-meta::-webkit-scrollbar,
.kanban-cards::-webkit-scrollbar,
.carbon-team-table::-webkit-scrollbar,
.short-note-box::-webkit-scrollbar {
  display: block !important;
  width: 5px !important;
  height: 5px !important;
}

.donor-card-notes::-webkit-scrollbar-track,
.opp-square-meta::-webkit-scrollbar-track,
.calendar-card-meta::-webkit-scrollbar-track,
.kanban-cards::-webkit-scrollbar-track,
.carbon-team-table::-webkit-scrollbar-track,
.short-note-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04) !important;
  border-radius: 4px !important;
}

.donor-card-notes::-webkit-scrollbar-thumb,
.opp-square-meta::-webkit-scrollbar-thumb,
.calendar-card-meta::-webkit-scrollbar-thumb,
.kanban-cards::-webkit-scrollbar-thumb,
.carbon-team-table::-webkit-scrollbar-thumb,
.short-note-box::-webkit-scrollbar-thumb {
  background: #00557a !important;
  border-radius: 4px !important;
  transition: background 0.2s ease;
}

.donor-card-notes::-webkit-scrollbar-thumb:hover,
.opp-square-meta::-webkit-scrollbar-thumb:hover,
.calendar-card-meta::-webkit-scrollbar-thumb:hover,
.kanban-cards::-webkit-scrollbar-thumb:hover,
.carbon-team-table::-webkit-scrollbar-thumb:hover,
.short-note-box::-webkit-scrollbar-thumb:hover {
  background: #fbae42 !important;
}

body.dark-theme .donor-card-notes::-webkit-scrollbar-thumb,
body.dark-theme .opp-square-meta::-webkit-scrollbar-thumb,
body.dark-theme .calendar-card-meta::-webkit-scrollbar-thumb,
body.dark-theme .kanban-cards::-webkit-scrollbar-thumb,
body.dark-theme .carbon-team-table::-webkit-scrollbar-thumb,
body.dark-theme .short-note-box::-webkit-scrollbar-thumb {
  background: #38bdf8 !important;
}

body.dark-theme .donor-card-notes::-webkit-scrollbar-track,
body.dark-theme .opp-square-meta::-webkit-scrollbar-track,
body.dark-theme .calendar-card-meta::-webkit-scrollbar-track,
body.dark-theme .kanban-cards::-webkit-scrollbar-track,
body.dark-theme .carbon-team-table::-webkit-scrollbar-track,
body.dark-theme .short-note-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* ======================================================================
   WHATSAPP UX & DIRECT 1-ON-1 MESSAGING (AUTHENTIC VECTOR MOCKUP)
   ====================================================================== */

.whatsapp-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 560px;
  max-height: 740px;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-top: 10px;
}

/* WhatsApp Left Sidebar (Threads List) */
.whatsapp-sidebar {
  border-left: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  height: 100%;
}

.whatsapp-sidebar-header {
  padding: 14px 18px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.whatsapp-search-box {
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-line);
}

.whatsapp-filter-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-line);
  background: var(--bg-card);
}

.whatsapp-filter-pill {
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--border-line);
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.whatsapp-filter-pill.active {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
}

body.dark-theme .whatsapp-filter-pill.active {
  background: #00a884;
  color: #ffffff;
  border-color: #00a884;
}

.whatsapp-threads-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.whatsapp-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-line);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.whatsapp-thread-item:hover {
  background: rgba(0, 85, 122, 0.05);
}

body.dark-theme .whatsapp-thread-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.whatsapp-thread-item.active {
  background: rgba(0, 85, 122, 0.1) !important;
}

body.dark-theme .whatsapp-thread-item.active {
  background: #1e293b !important;
}

.whatsapp-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  background: linear-gradient(135deg, var(--navy), #003e59);
  color: #ffffff;
}

.whatsapp-avatar.group-avatar {
  background: linear-gradient(135deg, #00557a, #0284c7);
}

.whatsapp-avatar .online-dot {
  position: absolute;
  bottom: 0px;
  left: 0px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--bg-card);
}

.whatsapp-thread-info {
  flex: 1;
  min-width: 0;
}

.whatsapp-thread-name {
  font-weight: 800;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.whatsapp-thread-name span {
  color: #00557a !important;
  font-weight: 800 !important;
}

body.dark-theme .whatsapp-thread-name span {
  color: #ffffff !important;
  font-weight: 800 !important;
}

.whatsapp-thread-time {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.whatsapp-thread-preview {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}

/* WhatsApp Main Chat Room */
.whatsapp-chat-room {
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
  position: relative;
  height: 100%;
}

body.dark-theme .whatsapp-chat-room {
  background: #0b141a;
}

.whatsapp-room-header {
  padding: 12px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.whatsapp-room-contact {
  display: flex;
  align-items: center;
  gap: 12px;
}

.whatsapp-room-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: var(--text-muted);
}

.whatsapp-room-actions span {
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.whatsapp-room-actions span:hover {
  background: var(--bg-alt);
  color: var(--navy);
}

.whatsapp-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}

.whatsapp-date-pill {
  align-self: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: #54656f;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  margin-bottom: 6px;
}

body.dark-theme .whatsapp-date-pill {
  background: #182229;
  color: #8696a0;
}

.whatsapp-bubble {
  max-width: 72%;
  padding: 9px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.whatsapp-bubble.incoming {
  align-self: flex-start;
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px 12px 12px 2px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-theme .whatsapp-bubble.incoming {
  background: #202c33;
  color: #e9edef;
  border-color: rgba(255, 255, 255, 0.05);
}

.whatsapp-author-name {
  font-size: 11.5px;
  font-weight: 800;
  color: #00557a;
  margin-bottom: 3px;
}

body.dark-theme .whatsapp-author-name {
  color: #fbae42;
}

.whatsapp-bubble.outgoing {
  align-self: flex-end;
  background: #e7f5ea;
  color: #0f172a;
  border-radius: 12px 12px 2px 12px;
  border: 1px solid rgba(37, 211, 102, 0.2);
}

body.dark-theme .whatsapp-bubble.outgoing {
  background: #005c4b;
  color: #e9edef;
  border-color: transparent;
}

.whatsapp-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
  color: #64748b;
}

body.dark-theme .whatsapp-bubble-meta {
  color: rgba(255, 255, 255, 0.6);
}

.whatsapp-double-tick {
  color: #38bdf8;
  display: inline-flex;
}

/* WhatsApp Bottom Input Dock */
.whatsapp-input-dock {
  padding: 10px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-line);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.whatsapp-dock-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.whatsapp-dock-btn:hover {
  background: var(--bg-alt);
  color: var(--navy);
}

.whatsapp-dock-btn.recording {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  animation: pulse-red 1s infinite alternate;
}

@keyframes pulse-red {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

.whatsapp-send-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #00557a;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 85, 122, 0.3);
  transition: transform 0.15s ease, background 0.2s ease;
  flex-shrink: 0;
}

.whatsapp-send-circle:hover {
  transform: scale(1.06);
  background: #003e59;
}

body.dark-theme .whatsapp-send-circle {
  background: #00a884;
}

@media (max-width: 900px) {
  .whatsapp-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}


/* ======================================================================
   TEAM GROUP CHAT & ALWAYS-VISIBLE DOCK (RESPONSIVE LUXURY UX)
   ====================================================================== */

.team-container {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 16px;
  height: calc(100vh - 210px);
  min-height: 480px;
  max-height: calc(100vh - 210px);
  overflow: hidden;
  margin-top: 8px;
}

.team-members-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  scrollbar-width: thin;
}

.team-panel-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-line);
}
body.dark-theme .team-panel-title {
  color: #ffffff;
}

.team-member-box {
  background: var(--bg-alt);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.2s ease;
}

.team-member-box .t-name {
  color: #00557a !important;
  font-weight: 800 !important;
  font-size: 13.5px;
}
body.dark-theme .team-member-box .t-name {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.team-member-box .t-role {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
}
body.dark-theme .team-member-box .t-role {
  color: #fbae42 !important;
}

.team-member-box .t-email {
  color: #94a3b8;
  font-size: 11px;
}

.chat-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.chat-header {
  flex-shrink: 0;
  padding: 12px 20px;
  border-bottom: 1.5px solid var(--border-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  z-index: 10;
}

.chat-messages {
  flex: 1;
  min-height: 0; /* CRUCIAL: enables flex child to scroll and never push input bar down! */
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  scrollbar-width: thin;
}
body.dark-theme .chat-messages {
  background: #0b141a;
}

.chat-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.chat-bubble.mine {
  align-self: flex-start; /* in RTL, flex-start is right */
  background: #e7f5ea;
  color: #0f172a;
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-top-right-radius: 4px;
}
body.dark-theme .chat-bubble.mine {
  background: #005c4b;
  color: #e9edef;
  border-color: transparent;
}

.chat-bubble.others {
  align-self: flex-end; /* in RTL, flex-end is left */
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--border-line);
  border-top-left-radius: 4px;
}
body.dark-theme .chat-bubble.others {
  background: #202c33;
  color: #e9edef;
  border-color: rgba(255, 255, 255, 0.06);
}

.chat-author {
  font-size: 12px;
  font-weight: 800;
  color: #00557a;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
body.dark-theme .chat-author {
  color: #fbae42;
}

.chat-time {
  font-size: 10.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}
body.dark-theme .chat-time {
  color: rgba(255, 255, 255, 0.6);
}

/* Chat Input Bar - ALWAYS LOCKED & VISIBLE AT BOTTOM */
.chat-input-bar {
  flex-shrink: 0 !important;
  padding: 12px 18px;
  border-top: 1.5px solid var(--border-line);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

.chat-dock-action-btn {
  background: transparent;
  border: 1px solid var(--border-line);
  color: var(--text-muted);
  cursor: pointer;
  padding: 9px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
}
.chat-dock-action-btn:hover {
  background: var(--bg-alt);
  color: var(--navy);
  border-color: var(--navy);
}

.chat-dock-action-btn.recording {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border-color: #ef4444 !important;
  animation: pulse-red 1s infinite alternate;
}

.chat-send-btn {
  padding: 10px 22px;
  border-radius: 24px;
  background: #00557a;
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 85, 122, 0.3);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.chat-send-btn:hover {
  background: #003e59;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 85, 122, 0.4);
}
body.dark-theme .chat-send-btn {
  background: #00a884;
}
body.dark-theme .chat-send-btn:hover {
  background: #008f70;
}

@media (max-width: 860px) {
  .team-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}


/* ======================================================================
   UNIVERSAL ELEGANT SCROLLBARS (مؤشر التمرير الاحترافي لكافة أجزاء الموقع)
   ====================================================================== */

/* 1. تفعيل شريط التمرير الرشيق في كافة الأجزاء التفاعلية */
.chat-messages,
.member-stacked-list,
.team-members-panel,
.donor-card-notes,
.opp-square-meta,
.calendar-card-meta,
.kanban-cards,
.kanban-column,
.kanban-board,
.carbon-team-table,
.carbon-panel,
dialog.modal-dialog,
.modal-body,
.short-note-box,
.calendar-months-bar,
.sub-header-nav-inner,
.table-container {
  scrollbar-width: thin !important;
  scrollbar-color: #00557a rgba(0, 85, 122, 0.08) !important;
}

body.dark-theme .chat-messages,
body.dark-theme .member-stacked-list,
body.dark-theme .team-members-panel,
body.dark-theme .donor-card-notes,
body.dark-theme .opp-square-meta,
body.dark-theme .calendar-card-meta,
body.dark-theme .kanban-cards,
body.dark-theme .kanban-column,
body.dark-theme .kanban-board,
body.dark-theme .carbon-team-table,
body.dark-theme .carbon-panel,
body.dark-theme dialog.modal-dialog,
body.dark-theme .modal-body,
body.dark-theme .short-note-box,
body.dark-theme .calendar-months-bar,
body.dark-theme .sub-header-nav-inner,
body.dark-theme .table-container {
  scrollbar-color: #38bdf8 rgba(255, 255, 255, 0.08) !important;
}

/* 2. الأبعاد الهندسية الدقيقة للشريط (عرض 6px) */
.chat-messages::-webkit-scrollbar,
.member-stacked-list::-webkit-scrollbar,
.team-members-panel::-webkit-scrollbar,
.donor-card-notes::-webkit-scrollbar,
.opp-square-meta::-webkit-scrollbar,
.calendar-card-meta::-webkit-scrollbar,
.kanban-cards::-webkit-scrollbar,
.kanban-column::-webkit-scrollbar,
.kanban-board::-webkit-scrollbar,
.carbon-team-table::-webkit-scrollbar,
.carbon-panel::-webkit-scrollbar,
dialog.modal-dialog::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.short-note-box::-webkit-scrollbar,
.calendar-months-bar::-webkit-scrollbar,
.sub-header-nav-inner::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
  display: block !important;
  width: 6px !important;
  height: 6px !important;
}

/* 3. مجرى شريط التمرير (Track) */
.chat-messages::-webkit-scrollbar-track,
.member-stacked-list::-webkit-scrollbar-track,
.team-members-panel::-webkit-scrollbar-track,
.donor-card-notes::-webkit-scrollbar-track,
.opp-square-meta::-webkit-scrollbar-track,
.calendar-card-meta::-webkit-scrollbar-track,
.kanban-cards::-webkit-scrollbar-track,
.kanban-column::-webkit-scrollbar-track,
.kanban-board::-webkit-scrollbar-track,
.carbon-team-table::-webkit-scrollbar-track,
.carbon-panel::-webkit-scrollbar-track,
dialog.modal-dialog::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.short-note-box::-webkit-scrollbar-track,
.calendar-months-bar::-webkit-scrollbar-track,
.sub-header-nav-inner::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track {
  background: rgba(0, 85, 122, 0.04) !important;
  border-radius: 4px !important;
}

body.dark-theme .chat-messages::-webkit-scrollbar-track,
body.dark-theme .member-stacked-list::-webkit-scrollbar-track,
body.dark-theme .team-members-panel::-webkit-scrollbar-track,
body.dark-theme .donor-card-notes::-webkit-scrollbar-track,
body.dark-theme .opp-square-meta::-webkit-scrollbar-track,
body.dark-theme .calendar-card-meta::-webkit-scrollbar-track,
body.dark-theme .kanban-cards::-webkit-scrollbar-track,
body.dark-theme .kanban-column::-webkit-scrollbar-track,
body.dark-theme .kanban-board::-webkit-scrollbar-track,
body.dark-theme .carbon-team-table::-webkit-scrollbar-track,
body.dark-theme .carbon-panel::-webkit-scrollbar-track,
body.dark-theme dialog.modal-dialog::-webkit-scrollbar-track,
body.dark-theme .modal-body::-webkit-scrollbar-track,
body.dark-theme .short-note-box::-webkit-scrollbar-track,
body.dark-theme .calendar-months-bar::-webkit-scrollbar-track,
body.dark-theme .sub-header-nav-inner::-webkit-scrollbar-track,
body.dark-theme .table-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* 4. مقبض التمرير (Thumb) - كحلي صناع الحياة وذهبي عند التمرير في الفاتح، وسماوي في الداكن */
.chat-messages::-webkit-scrollbar-thumb,
.member-stacked-list::-webkit-scrollbar-thumb,
.team-members-panel::-webkit-scrollbar-thumb,
.donor-card-notes::-webkit-scrollbar-thumb,
.opp-square-meta::-webkit-scrollbar-thumb,
.calendar-card-meta::-webkit-scrollbar-thumb,
.kanban-cards::-webkit-scrollbar-thumb,
.kanban-column::-webkit-scrollbar-thumb,
.kanban-board::-webkit-scrollbar-thumb,
.carbon-team-table::-webkit-scrollbar-thumb,
.carbon-panel::-webkit-scrollbar-thumb,
dialog.modal-dialog::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.short-note-box::-webkit-scrollbar-thumb,
.calendar-months-bar::-webkit-scrollbar-thumb,
.sub-header-nav-inner::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
  background: #00557a !important;
  border-radius: 4px !important;
  transition: background 0.2s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.member-stacked-list::-webkit-scrollbar-thumb:hover,
.team-members-panel::-webkit-scrollbar-thumb:hover,
.donor-card-notes::-webkit-scrollbar-thumb:hover,
.opp-square-meta::-webkit-scrollbar-thumb:hover,
.calendar-card-meta::-webkit-scrollbar-thumb:hover,
.kanban-cards::-webkit-scrollbar-thumb:hover,
.kanban-column::-webkit-scrollbar-thumb:hover,
.kanban-board::-webkit-scrollbar-thumb:hover,
.carbon-team-table::-webkit-scrollbar-thumb:hover,
.carbon-panel::-webkit-scrollbar-thumb:hover,
dialog.modal-dialog::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.short-note-box::-webkit-scrollbar-thumb:hover,
.calendar-months-bar::-webkit-scrollbar-thumb:hover,
.sub-header-nav-inner::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
  background: #fbae42 !important;
}

body.dark-theme .chat-messages::-webkit-scrollbar-thumb,
body.dark-theme .member-stacked-list::-webkit-scrollbar-thumb,
body.dark-theme .team-members-panel::-webkit-scrollbar-thumb,
body.dark-theme .donor-card-notes::-webkit-scrollbar-thumb,
body.dark-theme .opp-square-meta::-webkit-scrollbar-thumb,
body.dark-theme .calendar-card-meta::-webkit-scrollbar-thumb,
body.dark-theme .kanban-cards::-webkit-scrollbar-thumb,
body.dark-theme .kanban-column::-webkit-scrollbar-thumb,
body.dark-theme .kanban-board::-webkit-scrollbar-thumb,
body.dark-theme .carbon-team-table::-webkit-scrollbar-thumb,
body.dark-theme .carbon-panel::-webkit-scrollbar-thumb,
body.dark-theme dialog.modal-dialog::-webkit-scrollbar-thumb,
body.dark-theme .modal-body::-webkit-scrollbar-thumb,
body.dark-theme .short-note-box::-webkit-scrollbar-thumb,
body.dark-theme .calendar-months-bar::-webkit-scrollbar-thumb,
body.dark-theme .sub-header-nav-inner::-webkit-scrollbar-thumb,
body.dark-theme .table-container::-webkit-scrollbar-thumb {
  background: #38bdf8 !important;
}

body.dark-theme .chat-messages::-webkit-scrollbar-thumb:hover,
body.dark-theme .member-stacked-list::-webkit-scrollbar-thumb:hover,
body.dark-theme .team-members-panel::-webkit-scrollbar-thumb:hover,
body.dark-theme .donor-card-notes::-webkit-scrollbar-thumb:hover,
body.dark-theme .opp-square-meta::-webkit-scrollbar-thumb:hover,
body.dark-theme .calendar-card-meta::-webkit-scrollbar-thumb:hover,
body.dark-theme .kanban-cards::-webkit-scrollbar-thumb:hover,
body.dark-theme .kanban-column::-webkit-scrollbar-thumb:hover,
body.dark-theme .kanban-board::-webkit-scrollbar-thumb:hover,
body.dark-theme .carbon-team-table::-webkit-scrollbar-thumb:hover,
body.dark-theme .carbon-panel::-webkit-scrollbar-thumb:hover,
body.dark-theme dialog.modal-dialog::-webkit-scrollbar-thumb:hover,
body.dark-theme .modal-body::-webkit-scrollbar-thumb:hover,
body.dark-theme .short-note-box::-webkit-scrollbar-thumb:hover,
body.dark-theme .calendar-months-bar::-webkit-scrollbar-thumb:hover,
body.dark-theme .sub-header-nav-inner::-webkit-scrollbar-thumb:hover,
body.dark-theme .table-container::-webkit-scrollbar-thumb:hover {
  background: #fbae42 !important;
}

/* 5. شريط تمرير الصفحة الرئيسي (النافذة ككل) ناعم وغير مزعج */
html, body {
  scrollbar-width: thin !important;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 7px !important;
  height: 7px !important;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02) !important;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: rgba(0, 85, 122, 0.35) !important;
  border-radius: 4px !important;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: #00557a !important;
}

body.dark-theme::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02) !important;
}
body.dark-theme::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35) !important;
}
body.dark-theme::-webkit-scrollbar-thumb:hover {
  background: #38bdf8 !important;
}

/* ============================================================
   محرك الذكاء الاصطناعي وإدارة المنح (AI Grants Engine & Pipeline)
   ============================================================ */
.ai-dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 10px;
}

.ai-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.ai-pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.ai-pipeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  border-color: #00557a;
}

body.dark-theme .ai-pipeline-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.ai-pipeline-card.tier-1 {
  border-right: 4px solid #fbae42;
}

.ai-pipeline-card.tier-2 {
  border-right: 4px solid #00557a;
}

.ai-pipeline-card.tier-3 {
  border-right: 4px solid #10b981;
}

.ai-pipeline-card.tier-4 {
  border-right: 4px solid #64748b;
}

.ai-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ai-tier-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 85, 122, 0.08);
  color: #00557a;
}

body.dark-theme .ai-tier-tag {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.ai-tier-tag.primary-badge {
  background: rgba(251, 174, 66, 0.15);
  color: #d97706;
}

body.dark-theme .ai-tier-tag.primary-badge {
  background: rgba(251, 174, 66, 0.2);
  color: #fbae42;
}

.ai-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.ai-action-banner {
  background: linear-gradient(135deg, #00557a 0%, #00364d 100%);
  color: #ffffff;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 85, 122, 0.18);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ai-action-banner-text h3 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 6px;
  color: #ffffff;
}

.ai-action-banner-text p {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.6;
  max-width: 650px;
  margin: 0;
}

.ai-action-buttons-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-ai-gold {
  background: #fbae42 !important;
  color: #002b3d !important;
  font-weight: 800 !important;
  padding: 10px 18px !important;
  border-radius: 8px !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 12px rgba(251, 174, 66, 0.3) !important;
}

.btn-ai-gold:hover {
  background: #f59e0b !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(251, 174, 66, 0.4) !important;
}

.btn-ai-outline-white {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  font-weight: 700 !important;
  padding: 10px 18px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-ai-outline-white:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: #ffffff !important;
}

.ai-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.ai-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
}

.ai-stat-num {
  font-size: 26px;
  font-weight: 900;
  color: #00557a;
  margin-bottom: 4px;
}

body.dark-theme .ai-stat-num {
  color: #38bdf8;
}

.ai-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.ai-results-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.ai-report-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border-color);
}

.ai-report-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ai-report-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.ai-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.ai-found-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.ai-found-card:hover {
  border-color: #00557a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

body.dark-theme .ai-found-card:hover {
  border-color: #38bdf8;
}

.ai-found-badge-new {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.ai-copilot-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.ai-prompt-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-shortcut-btn {
  background: rgba(0, 85, 122, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-shortcut-btn:hover {
  background: #00557a;
  color: #ffffff;
  border-color: #00557a;
}

body.dark-theme .ai-shortcut-btn:hover {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

.ai-chat-output {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
}

/* Fix Header and Footer Logo Contrast */
header#mainHeader .brand-logo,
.brand-header .brand-logo {
  height: 42px !important;
  width: auto !important;
  object-fit: contain !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35)) !important;
}

footer#appFooter .footer-logo,
.brand-footer .footer-logo {
  height: 38px !important;
  width: auto !important;
  object-fit: contain !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25)) !important;
}

/* ============================================================
   زر المساعد الذكي العائم ونافذة الشات (Floating AI FAB & Drawer)
   ============================================================ */
.floating-ai-fab {
  position: fixed;
  bottom: 24px;
  left: 28px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #00557a 0%, #00364d 100%);
  color: #ffffff;
  border: 2px solid #fbae42;
  border-radius: 50px;
  padding: 10px 18px 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 85, 122, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-ai-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 85, 122, 0.45);
  border-color: #ffd074;
}

.floating-ai-fab:active {
  transform: translateY(0) scale(0.98);
}

.ai-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fbae42;
}

.ai-fab-pulse {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: aiFabPulse 2s infinite;
}

@keyframes aiFabPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* النافذة العائمة المنبثقة للشات الذكي */
.ai-copilot-drawer {
  position: fixed;
  bottom: 82px;
  left: 28px;
  width: 390px;
  max-width: calc(100vw - 40px);
  height: 540px;
  max-height: calc(100vh - 110px);
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: aiDrawerSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ai-drawer-header {
  background: linear-gradient(135deg, #00557a 0%, #00364d 100%);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #fbae42;
}

.ai-drawer-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-drawer-badge {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #fbae42;
  text-transform: uppercase;
}

.ai-drawer-header h4 {
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}

.ai-drawer-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-drawer-close:hover {
  background: rgba(239, 68, 68, 0.8);
}

.ai-drawer-status-bar {
  background: rgba(0, 85, 122, 0.05);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

body.dark-theme .ai-drawer-status-bar {
  background: rgba(255, 255, 255, 0.03);
}

.ai-drawer-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-main);
}

.ai-chat-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-chat-bubble.ai {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.ai-chat-bubble.user {
  align-self: flex-end;
  background: #00557a;
  color: #ffffff;
  border-bottom-left-radius: 4px;
}

body.dark-theme .ai-chat-bubble.user {
  background: #0284c7;
}

.ai-chat-bubble-engine {
  font-size: 10px;
  font-weight: 800;
  color: #10b981;
  margin-bottom: 4px;
}

.ai-drawer-chips {
  padding: 8px 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.ai-chip-btn {
  background: rgba(0, 85, 122, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-chip-btn:hover {
  background: #00557a;
  color: #ffffff;
  border-color: #00557a;
}

body.dark-theme .ai-chip-btn:hover {
  background: #38bdf8;
  color: #0f172a;
}

.ai-drawer-input-row {
  padding: 10px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-drawer-textarea {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  resize: none;
  outline: none;
  height: 38px;
  line-height: 1.4;
}

.ai-drawer-textarea:focus {
  border-color: #00557a;
}

body.dark-theme .ai-drawer-textarea:focus {
  border-color: #38bdf8;
}

.ai-drawer-send-btn {
  background: #00557a;
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-drawer-send-btn:hover {
  background: #003d58;
}

.ai-drawer-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* زر مسح محادثة الذكاء الاصطناعي */
.ai-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-drawer-action-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 4px 9px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-drawer-action-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fee2e2;
  transform: translateY(-1px);
}

.ai-drawer-action-btn:active {
  transform: translateY(0);
}


/* ==========================================================================
   Search Engine Instant Clear & Focus Enhancements
   ========================================================================== */
.btn-clear-search {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.06);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all 0.15s ease;
  z-index: 2;
}

.btn-clear-search:hover {
  background: var(--danger);
  color: #ffffff;
}

[data-theme="dark"] .btn-clear-search {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

[data-theme="dark"] .btn-clear-search:hover {
  background: var(--danger);
  color: #ffffff;
}

.carbon-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.carbon-search-input {
  padding-left: 36px !important;
}
