/* ==========================================================================
   BN RECOVERY SERVICES - Upgraded Enterprise Admin Stylesheet
   Modern, Sleek, Professional SaaS Dashboard
   ========================================================================== */

:root {
  --admin-navy: #090e1a;
  --admin-sidebar: #0b1324;
  --admin-sidebar-hover: #131d36;
  --admin-sidebar-active: #1d4ed8;
  --admin-bg: #f4f6fa;
  --admin-card: #ffffff;
  --admin-border: #e2e8f0;
  --admin-border-subtle: #edf2f7;
  --admin-primary: #1d4ed8;
  --admin-primary-hover: #1e40af;
  --admin-gold: #d97706;
  --admin-gold-light: #fbbf24;
  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  display: flex;
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ==================== SIDEBAR ==================== */
.admin-sidebar {
  width: 265px;
  background: linear-gradient(180deg, #090e1a 0%, #0b1324 100%);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  padding: 1.35rem 1.25rem;
  background: rgba(9, 14, 26, 0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title-text {
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.brand-subtitle-badge {
  font-size: 0.65rem;
  color: var(--admin-gold-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0.85rem;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-menu::-webkit-scrollbar {
  width: 5px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sidebar-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #64748b;
  font-weight: 700;
  padding: 0.85rem 0.75rem 0.35rem;
}

.sidebar-menu li {
  margin-bottom: 0.2rem;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-icon {
  font-size: 1.2rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.sidebar-menu a:hover {
  background-color: var(--admin-sidebar-hover);
  color: #ffffff;
}

.sidebar-menu a:hover .sidebar-icon {
  color: #60a5fa;
}

.sidebar-menu a.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.95));
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.sidebar-menu a.active .sidebar-icon {
  color: #ffffff;
}

.sidebar-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.sidebar-badge.danger {
  background: #ef4444;
  color: #ffffff;
}

.sidebar-logout-link {
  color: #f87171 !important;
}
.sidebar-logout-link:hover {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}
.sidebar-logout-link .sidebar-icon {
  color: #f87171 !important;
}

.sidebar-footer {
  padding: 1.1rem 1.25rem;
  background: rgba(9, 14, 26, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-avatar-wrap {
  position: relative;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.online-indicator-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #090e1a;
  border-radius: 50%;
}

.admin-user-meta {
  line-height: 1.25;
}

.admin-user-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-user-role {
  color: #94a3b8;
  font-size: 0.72rem;
  display: block;
  text-transform: capitalize;
}

/* ==================== MAIN CONTENT & TOPBAR ==================== */
.admin-main {
  margin-left: 265px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-toggle-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--admin-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.topbar-toggle-btn:hover {
  background: #e2e8f0;
}

.admin-topbar-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--admin-navy);
  margin: 0;
  letter-spacing: -0.01em;
}

.topbar-meta-date {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2px;
}

.badge-status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-content {
  padding: 2rem;
  flex: 1;
}

/* ==================== EXECUTIVE WELCOME HERO ==================== */
.admin-welcome-banner {
  background: linear-gradient(135deg, #090e1a 0%, #0f1c3f 60%, #1e3a8a 100%);
  border-radius: 16px;
  padding: 1.75rem 2rem;
  color: #ffffff;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-welcome-banner::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.welcome-title-wrap h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 0.35rem 0;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.welcome-title-wrap p {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin: 0;
  max-width: 600px;
  line-height: 1.5;
}

.welcome-kpi-chips {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.kpi-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kpi-chip i {
  color: var(--admin-gold-light);
}

/* ==================== UPGRADED STAT CARDS ==================== */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 1400px) {
  .stats-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 900px) {
  .stats-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .stats-cards-grid {
    grid-template-columns: 1fr;
  }
}

.admin-stat-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.admin-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s ease;
}

.admin-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.admin-stat-card.card-blue:hover::after { background: #2563eb; }
.admin-stat-card.card-amber:hover::after { background: #f59e0b; }
.admin-stat-card.card-purple:hover::after { background: #8b5cf6; }
.admin-stat-card.card-red:hover::after { background: #ef4444; }
.admin-stat-card.card-emerald:hover::after { background: #10b981; }

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.stat-icon-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-icon-gold { background: linear-gradient(135deg, #fbbf24, #d97706); }
.stat-icon-purple { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.stat-icon-red { background: linear-gradient(135deg, #f87171, #dc2626); }
.stat-icon-green { background: linear-gradient(135deg, #34d399, #059669); }

.stat-arrow-indicator {
  color: #94a3b8;
  font-size: 1rem;
  transition: transform 0.2s;
}

.admin-stat-card:hover .stat-arrow-indicator {
  transform: translateX(3px);
  color: var(--admin-primary);
}

.stat-card-data h3 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--admin-navy);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

.stat-card-data h3 small {
  font-size: 1rem;
  color: #94a3b8;
  font-weight: 500;
}

.stat-card-data p {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  margin: 0.25rem 0 0.5rem 0;
  font-weight: 600;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.stat-trend.positive { background: #ecfdf5; color: #047857; }
.stat-trend.neutral { background: #eff6ff; color: #1e40af; }
.stat-trend.purple { background: #f5f3ff; color: #6d28d9; }
.stat-trend.warning { background: #fef2f2; color: #b91c1c; }
.stat-trend.emerald { background: #ecfdf5; color: #059669; }

/* ==================== QUICK OPERATIONS TOOLBAR ==================== */
.admin-quick-toolbar {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 1.15rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.toolbar-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toolbar-info-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.toolbar-title {
  font-weight: 800;
  color: var(--admin-navy);
  font-size: 0.95rem;
  line-height: 1.2;
}

.toolbar-sub {
  font-size: 0.8rem;
  color: #64748b;
}

.toolbar-actions-wrap {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.quick-btn.primary {
  background: var(--admin-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}
.quick-btn.primary:hover {
  background: var(--admin-primary-hover);
  transform: translateY(-1px);
}

.quick-btn.secondary {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}
.quick-btn.secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.quick-btn.accent {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.quick-btn.accent:hover {
  background: #d1fae5;
}

/* ==================== RECENT ACTIVITIES CARD CONTAINERS ==================== */
.admin-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  overflow: hidden;
}

.admin-card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.admin-card-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--admin-navy);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-card-header a {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--admin-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.admin-card-header a:hover {
  text-decoration: underline;
}

.admin-card-body {
  padding: 1.75rem;
}

/* ==================== TABLES ==================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--admin-border);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

.admin-table tr:hover td {
  background-color: #fafbfc;
}

/* Table Avatar Initial */
.table-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.table-avatar.blue { background: #dbeafe; color: #1d4ed8; }
.table-avatar.green { background: #d1fae5; color: #047857; }
.table-avatar.purple { background: #ede9fe; color: #6d28d9; }

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-pill.active { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.status-pill.suspended { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.status-pill.pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.status-pill.resolved { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.status-pill.new { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Action Icon Buttons */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  border: 1px solid #e2e8f0;
}

.btn-icon:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-icon.print:hover { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.btn-icon.delete:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* Filter Pills */
.admin-filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  transition: all 0.2s ease;
}

.filter-pill:hover {
  background: #f8fafc;
  color: #1e293b;
}

.filter-pill.active {
  background: var(--admin-primary);
  color: #ffffff;
  border-color: var(--admin-primary);
}

/* ==================== RESPONSIVE RULES ==================== */
@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.active {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .admin-main {
    margin-left: 0;
  }
  .dashboard-columns-grid {
    grid-template-columns: 1fr !important;
  }
}
