/* ==========================================================================
   Ansh Charitable Trust - Ultra Modern Admin & Dashboard Design System
   Responsive, Fluid, Zero-Overflow NGO Management & Analytics Portal
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Admin Theme Palette */
  --admin-sidebar-bg: #0b1329;
  --admin-sidebar-surface: #131d38;
  --admin-sidebar-border: rgba(255, 255, 255, 0.08);
  
  --admin-bg: #f8fafc;
  --admin-surface: #ffffff;
  --admin-surface-muted: #f1f5f9;
  --admin-border: #e2e8f0;
  --admin-border-subtle: #edf2f7;

  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --admin-text-light: #94a3b8;

  /* Accent Colors */
  --primary-emerald: #059669;
  --primary-emerald-light: #ecfdf5;
  --primary-emerald-glow: rgba(5, 150, 105, 0.25);

  --accent-sapphire: #2563eb;
  --accent-sapphire-light: #eff6ff;

  --accent-violet: #7c3aed;
  --accent-violet-light: #f5f3ff;

  --accent-amber: #d97706;
  --accent-amber-light: #fffbeb;

  --accent-orange: #ea580c;
  --accent-orange-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --accent-emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

  /* Elevations */
  --card-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  --card-shadow-hover: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --sidebar-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

/* Reset for Admin */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.admin-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   Admin Sidebar
   ========================================================================== */
.admin-sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  background: linear-gradient(180deg, #0b1329 0%, #0f172a 100%);
  border-right: 1px solid var(--admin-sidebar-border);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 12px;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: var(--sidebar-shadow);
  overflow-y: auto;
  overflow-x: hidden;
}

.admin-sidebar-logo-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.admin-sidebar-logo-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-sidebar-logo {
  height: 48px;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px;
  border: none;
  box-shadow: none;
  display: inline-block;
  object-fit: contain;
}

.admin-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--admin-text-light);
  padding: 8px 10px 2px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-nav-item i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  transform: translateX(3px);
}

.admin-nav-item:hover i {
  color: #4ade80;
}

.admin-nav-item.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.28) 100%);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.15);
}

.admin-nav-item.active i {
  color: #4ade80;
}

.admin-sidebar-footer {
  border-top: 1px solid var(--admin-sidebar-border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.admin-user-info {
  flex: 1;
  overflow: hidden;
}

.admin-user-name {
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-status {
  font-size: 0.65rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

/* ==========================================================================
   Admin Main Canvas & Topbar (Fluid & Fully Contained)
   ========================================================================== */
.admin-main {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.admin-topbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--admin-border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-sizing: border-box;
  width: 100%;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-topbar-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-page-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--admin-text-main);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal;
  word-break: break-word;
}

.admin-page-subheading {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--admin-surface-muted);
  border: 1px solid var(--admin-border);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  white-space: nowrap;
}

.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  background: var(--accent-orange-gradient);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.4);
  color: #ffffff;
}

.admin-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #ffffff;
  color: var(--admin-text-main);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--admin-border);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-btn-outline:hover {
  background: var(--admin-surface-muted);
  border-color: #cbd5e1;
}

/* ==========================================================================
   Admin Content Body & Metric Grid
   ========================================================================== */
.admin-content-body {
  padding: 20px 24px 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.metrics-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
  max-width: 100%;
}

.metric-card-modern {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px 14px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--card-shadow);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.metric-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent-grad, var(--accent-emerald-gradient));
}

.metric-card-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: #cbd5e1;
}

.metric-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.metric-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.metric-pill-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  white-space: nowrap;
}

.metric-value-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--admin-text-main);
  line-height: 1.1;
  letter-spacing: -0.4px;
  margin-bottom: 2px;
  word-break: break-word;
}

.metric-label-text {
  font-size: 0.74rem;
  color: var(--admin-text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Dashboard Main Split Grid & Table Design
   ========================================================================== */
.admin-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 100%;
}

.admin-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--admin-border);
  padding: 18px;
  box-shadow: var(--card-shadow);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

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

.admin-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--admin-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-card-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-emerald);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.admin-card-link:hover {
  color: #047857;
}

/* Modern Data Table Container */
.modern-table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--admin-border-subtle);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

.modern-table-container::-webkit-scrollbar {
  height: 6px;
}

.modern-table-container::-webkit-scrollbar-track {
  background: #f8fafc;
}

.modern-table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.modern-table {
  width: 100%;
  min-width: 580px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  text-align: left;
}

.modern-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.modern-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--admin-border-subtle);
  color: var(--admin-text-main);
  vertical-align: middle;
}

.modern-table tbody tr:hover td {
  background-color: #f8fafc;
}

.modern-table tbody tr:last-child td {
  border-bottom: none;
}

/* Receipt Monospace Code Badge */
.receipt-code-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap !important;
}

.donor-info-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
}

.donor-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4338ca;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.amount-display {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-emerald);
  white-space: nowrap;
}

/* Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-pill-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.badge-pill-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-pill-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-pill-purple {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

/* Action Button Group */
.action-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-icon-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-icon-action:hover {
  background: var(--admin-surface-muted);
  color: var(--admin-text-main);
  border-color: #94a3b8;
}

.btn-icon-action.whatsapp-btn {
  color: #16a34a;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.btn-icon-action.whatsapp-btn:hover {
  background: #22c55e;
  color: #ffffff;
  border-color: #22c55e;
}

.btn-icon-action.print-btn {
  color: #0284c7;
  border-color: #bae6fd;
  background: #f0f9ff;
}

.btn-icon-action.print-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* Volunteers List Widget */
.volunteer-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--admin-border-subtle);
  margin-bottom: 7px;
  transition: all 0.2s ease;
  gap: 8px;
}

.volunteer-item-row:hover {
  background: #f8fafc;
  border-color: var(--admin-border);
}

/* Search Bar */
.admin-search-form {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--admin-border);
  border-radius: 8px;
  padding: 3px 5px 3px 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.admin-search-form:focus-within {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 2px var(--primary-emerald-glow);
}

.admin-search-input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--admin-text-main);
  background: transparent;
  width: 180px;
}

.admin-search-btn {
  background: var(--primary-emerald);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-search-btn:hover {
  background: #047857;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1300px) {
  .admin-split-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 1100px) {
  .metrics-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body.admin-body {
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow-y: auto;
  }
  .admin-sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--admin-sidebar-border);
  }
  .admin-main {
    max-width: 100%;
    width: 100%;
    height: auto;
    overflow: visible;
  }
  .metrics-grid-4 {
    grid-template-columns: 1fr;
  }
  .admin-topbar {
    padding: 12px 16px;
  }
  .admin-content-body {
    padding: 16px;
  }
}

