/* ============================================================
   نظام إدارة المساعدات — التصميم الكامل
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

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

:root {
  --green-950: #052e16;
  --green-900: #0f3d2e;
  --green-800: #155a32;
  --green-700: #166534;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-400: #4ade80;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;

  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;

  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --red-50:  #fef2f2;

  --amber-700: #b45309;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --amber-50:  #fffbeb;

  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --purple-700: #7e22ce;
  --purple-100: #f3e8ff;

  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.16);
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  background: #eef2f7;
  color: var(--gray-800);
  direction: rtl;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  right: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--green-950) 0%, var(--green-900) 60%, #0a2d20 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo h2 {
  font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3;
}

.sidebar-logo p {
  font-size: 10.5px; color: rgba(255,255,255,0.45); margin-top: 3px;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-section { padding: 6px 0; }

.nav-section-label {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  transition: all var(--transition);
  border-right: 3px solid transparent;
  position: relative;
  user-select: none;
}

.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-right-color: var(--green-400);
}

.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item .nav-label { flex: 1; }

.nav-badge {
  background: var(--red-600);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-user-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .u-name { font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .u-role { font-size: 10px; color: rgba(255,255,255,0.45); }

.logout-btn {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.08);
  border: none; border-radius: 7px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { background: rgba(220,50,50,0.3); color: #fff; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrap {
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-900);
}

.topbar-date {
  font-size: 12px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: 99px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}

.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green-600);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--green-700);
  padding: 4px;
}

/* ── Page Content ── */
.content { flex: 1; padding: 22px 24px; }

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--green-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 400;
  margin-top: 2px;
}

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--green-900);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: all var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 0 0 var(--radius-lg);
}

.stat-card.c-green::after  { background: var(--green-600); }
.stat-card.c-teal::after   { background: var(--teal-600); }
.stat-card.c-red::after    { background: var(--red-600); }
.stat-card.c-amber::after  { background: var(--amber-600); }
.stat-card.c-blue::after   { background: var(--blue-600); }
.stat-card.c-purple::after { background: var(--purple-700); }

.stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.stat-num {
  font-size: 30px;
  font-weight: 900;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 3px;
}

.stat-label {
  font-size: 11.5px;
  color: var(--gray-500);
  font-weight: 500;
}

.stat-trend {
  font-size: 11px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-trend.up   { color: var(--green-700); }
.stat-trend.down { color: var(--red-600); }
.stat-trend.neutral { color: var(--gray-500); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary   { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); box-shadow: 0 4px 12px rgba(22,101,52,0.3); }

.btn-secondary { background: #fff; color: var(--green-700); border: 1.5px solid var(--green-700); }
.btn-secondary:hover { background: var(--green-50); }

.btn-danger    { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: var(--red-700); }

.btn-warning   { background: var(--amber-600); color: #fff; }
.btn-warning:hover { background: var(--amber-700); }

.btn-ghost     { background: transparent; color: var(--gray-600); border: 1.5px solid var(--gray-300); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm  { padding: 5px 11px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-xs  { padding: 3px 8px; font-size: 11px; border-radius: var(--radius-sm); }
.btn-lg  { padding: 11px 22px; font-size: 15px; }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  color: var(--gray-600);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--gray-200); color: var(--gray-800); }
.btn-icon.danger:hover { background: var(--red-100); color: var(--red-700); }
.btn-icon.success:hover { background: var(--green-100); color: var(--green-700); }

/* ============================================================
   FORMS
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group.half { grid-column: span 1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

label .required { color: var(--red-600); margin-right: 2px; }

input, select, textarea {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-800);
  background: #fff;
  transition: all var(--transition);
  width: 100%;
  direction: rtl;
}

input:hover, select:hover, textarea:hover { border-color: var(--gray-300); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}

input.error, select.error, textarea.error {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

input::placeholder { color: var(--gray-400); }
textarea { min-height: 80px; resize: vertical; }
input[type="file"] { padding: 6px 10px; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }

.input-group {
  display: flex;
  gap: 0;
}

.input-group input {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  flex: 1;
}

.input-group .input-addon {
  border: 1.5px solid var(--gray-200);
  border-right: none;
  background: var(--gray-50);
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 14px;
  color: var(--gray-500);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead { position: sticky; top: 0; z-index: 1; }

th {
  background: var(--gray-50);
  padding: 10px 13px;
  text-align: right;
  font-weight: 700;
  font-size: 12px;
  color: var(--gray-600);
  border-bottom: 1.5px solid var(--gray-200);
  white-space: nowrap;
  user-select: none;
}

th.sortable { cursor: pointer; }
th.sortable:hover { background: var(--gray-100); color: var(--green-700); }

td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--green-50); }

td .id-code {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
}

.table-empty {
  text-align: center;
  padding: 40px;
  color: var(--gray-400);
}

.table-empty .empty-icon { font-size: 36px; margin-bottom: 8px; display: block; }
.table-empty p { font-size: 13px; }

/* ── Table Toolbar ── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-input-wrap .search-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 15px;
  pointer-events: none;
}

.search-input-wrap input {
  padding-right: 36px;
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green  { background: var(--green-100); color: var(--green-700); }
.badge-red    { background: var(--red-100);   color: var(--red-700); }
.badge-amber  { background: var(--amber-100); color: var(--amber-700); }
.badge-blue   { background: var(--blue-100);  color: var(--blue-700); }
.badge-teal   { background: var(--teal-100);  color: var(--teal-700); }
.badge-gray   { background: var(--gray-100);  color: var(--gray-600); }
.badge-purple { background: var(--purple-100); color: var(--purple-700); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-width: 1px;
  border-style: solid;
}

.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 2px; }
.alert-body { font-size: 12px; opacity: 0.85; }

.alert-success  { background: var(--green-50);  border-color: var(--green-100);  color: var(--green-800); }
.alert-warning  { background: var(--amber-50);  border-color: var(--amber-100);  color: var(--amber-700); }
.alert-danger   { background: var(--red-50);    border-color: var(--red-100);    color: var(--red-700); }
.alert-info     { background: var(--blue-50);   border-color: var(--blue-100);   color: var(--blue-700); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}

.modal-overlay.open {
  display: flex;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn { from { opacity:0; } to { opacity:1; } }

.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlide 0.2s ease;
}

.modal.modal-lg { max-width: 860px; }
.modal.modal-sm { max-width: 440px; }

@keyframes modalSlide { from { transform:translateY(-16px); opacity:0; } to { transform:translateY(0); opacity:1; } }

.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body { padding: 22px; }
.modal-body-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-body-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============================================================
   TABS
   ============================================================ */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-500);
  background: transparent;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--gray-700); }
.tab-btn.active {
  background: #fff;
  color: var(--green-700);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   FILTERS PANEL
   ============================================================ */
.filter-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

/* ============================================================
   CHARTS (custom bar charts)
   ============================================================ */
.bar-chart { display: flex; flex-direction: column; gap: 8px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.bar-label { width: 90px; text-align: right; color: var(--gray-500); font-size: 11px; flex-shrink: 0; }

.bar-track {
  flex: 1;
  background: var(--gray-100);
  border-radius: 99px;
  height: 24px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 24px;
  justify-content: flex-end;
}

.bar-val { width: 36px; color: var(--gray-700); font-weight: 700; font-size: 12px; }

/* ============================================================
   PRIORITY LIST
   ============================================================ */
.priority-list { display: flex; flex-direction: column; gap: 2px; }

.priority-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
  border-right: 3px solid transparent;
}

.priority-item:hover { background: var(--gray-50); }
.priority-item.p-high  { border-right-color: var(--red-600); }
.priority-item.p-med   { border-right-color: var(--amber-600); }
.priority-item.p-low   { border-right-color: var(--green-600); }

.priority-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-500);
  flex-shrink: 0;
}

.priority-info { flex: 1; min-width: 0; }
.priority-info .p-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.priority-info .p-sub  { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.priority-action { flex-shrink: 0; }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-feed { display: flex; flex-direction: column; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
}

.activity-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-dot.dot-green  { background: var(--green-600); }
.activity-dot.dot-amber  { background: var(--amber-600); }
.activity-dot.dot-red    { background: var(--red-600); }
.activity-dot.dot-blue   { background: var(--blue-600); }

.activity-line {
  width: 1px;
  flex: 1;
  background: var(--gray-200);
  margin-top: 4px;
}

.activity-content { flex: 1; }
.activity-content .a-title { font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
.activity-content .a-sub   { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ============================================================
   NOTIFICATION TOAST
   ============================================================ */
.notification {
  position: fixed;
  top: 70px;
  left: 20px;
  z-index: 9999;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.3s ease;
  max-width: 320px;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success { background: var(--green-900); color: #fff; }
.notification-warning { background: var(--amber-600); color: #fff; }
.notification-danger  { background: var(--red-700); color: #fff; }
.notification-info    { background: var(--blue-700); color: #fff; }

/* ============================================================
   APPROVAL BANNER
   ============================================================ */
.approval-banner {
  background: linear-gradient(135deg, var(--amber-50), #fffdf5);
  border: 1.5px solid var(--amber-100);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.approval-banner-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--amber-700);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   BENEFICIARY CARD (in modal)
   ============================================================ */
.bene-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.bene-avatar {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: var(--green-100);
  color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.bene-name { font-size: 18px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.bene-id   { font-family: 'Courier New', monospace; font-size: 12px; color: var(--gray-500); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.info-item { padding: 10px 12px; background: var(--gray-50); border-radius: var(--radius-md); }
.info-item .info-label { font-size: 10.5px; color: var(--gray-400); font-weight: 600; margin-bottom: 3px; }
.info-item .info-val   { font-size: 13px; font-weight: 600; color: var(--gray-800); }

/* ============================================================
   QR CARD
   ============================================================ */
.qr-print-card {
  background: #fff;
  border: 3px solid var(--green-700);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  width: 220px;
  display: inline-block;
}

/* ============================================================
   AUTOCOMPLETE DROPDOWN
   ============================================================ */
.autocomplete-wrap { position: relative; }

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-md);
  display: none;
}

.autocomplete-dropdown.open { display: block; }

.autocomplete-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.autocomplete-item:hover { background: var(--green-50); }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item .ac-name { font-weight: 600; color: var(--gray-800); }
.autocomplete-item .ac-sub  { font-size: 11px; color: var(--gray-500); }

/* ============================================================
   SELECTED BENEFICIARY BOX
   ============================================================ */
.selected-bene-box {
  background: var(--green-50);
  border: 1.5px solid var(--green-100);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-bene-box .sb-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.selected-bene-box .sb-info { flex: 1; }
.selected-bene-box .sb-name { font-weight: 700; font-size: 14px; color: var(--gray-800); }
.selected-bene-box .sb-meta { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-info { font-size: 12px; color: var(--gray-500); }

.pagination-btns { display: flex; gap: 4px; }

.pg-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-family: inherit;
  color: var(--gray-600);
  transition: all var(--transition);
}

.pg-btn:hover { border-color: var(--green-600); color: var(--green-700); }
.pg-btn.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-950) 0%, var(--green-900) 50%, #0a2d20 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  animation: fadeIn 0.4s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-circle {
  width: 70px; height: 70px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--green-950), var(--green-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(22,101,52,0.3);
}

.login-logo h1 { font-size: 20px; font-weight: 900; color: var(--green-900); margin-bottom: 4px; }
.login-logo p  { font-size: 12px; color: var(--gray-500); }

.login-demo {
  margin-top: 16px;
  padding: 12px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--green-800);
}

.login-demo strong { display: block; margin-bottom: 4px; color: var(--green-700); }
.login-demo code {
  display: block;
  font-size: 11px;
  color: var(--gray-600);
  font-family: 'Courier New', monospace;
}

/* ============================================================
   DASHBOARD SPECIFICS
   ============================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dash-grid-3 {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
}

/* ============================================================
   REPORT CHARTS
   ============================================================ */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.donut-legend { flex: 1; min-width: 140px; }
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--gray-700);
}
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(calc(var(--sidebar-w) + 10px));
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .main-wrap { margin-right: 0; }
  .mobile-menu-btn { display: flex; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid-3 { grid-template-columns: 1fr; }
  .content { padding: 14px 14px; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid   { grid-template-columns: 1fr; }
  .filter-panel { grid-template-columns: 1fr; }
  .login-card { padding: 24px 20px; }
  .tab-nav { gap: 2px; }
  .tab-btn { padding: 6px 10px; font-size: 11.5px; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar, .topbar, .page-actions, .btn, .modal-overlay,
  .filter-panel, .table-toolbar, .pagination { display: none !important; }
  .main-wrap { margin-right: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}

