/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* CSS Variables for Premium Theme */
:root {
  --font-family: 'Outfit', sans-serif;
  
  /* Color Palette - Modern Dark Theme */
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-card: rgba(20, 30, 54, 0.65);
  --bg-card-hover: rgba(28, 41, 72, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.2);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Accent/Status Colors */
  --color-blue: #38bdf8;
  --color-green: #10b981;
  --color-rose: #f43f5e;
  --color-amber: #f59e0b;
  --color-purple: #8b5cf6;
  --color-pink: #ec4899;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #8b5cf6 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-rose: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --gradient-amber: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --gradient-dark: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  
  /* Shadows & Glassmorphism */
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --card-border: 1px solid rgba(255, 255, 255, 0.06);
  --glass-blur: blur(12px);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Layout Wrapper */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================
   SIDEBAR STYLING
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: var(--card-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: var(--card-border);
}

.sidebar-brand .logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.sidebar-brand .brand-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-brand .brand-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item-link i {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.nav-item-link:hover, .nav-item-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item-link.active {
  background: var(--gradient-primary);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--color-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--color-blue);
}

.user-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================
   MAIN CONTENT STYLING
   ========================================== */
.main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: 40px;
  min-height: 100vh;
  transition: var(--transition);
  width: calc(100% - var(--sidebar-width));
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
}

.page-title h1 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-title p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: var(--font-family);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
}

.btn-success {
  background: var(--gradient-green);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: var(--gradient-rose);
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
}

.mobile-menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

/* ==========================================
   DASHBOARD OVERVIEW CARD GRID
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--card-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--card-shadow);
}

.stat-card.blue::before { background: var(--color-blue); }
.stat-card.green::before { background: var(--color-green); }
.stat-card.purple::before { background: var(--color-purple); }
.stat-card.amber::before { background: var(--color-amber); }

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-card.blue .stat-icon { background: rgba(56, 189, 248, 0.15); color: var(--color-blue); }
.stat-card.green .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--color-green); }
.stat-card.purple .stat-icon { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.stat-card.amber .stat-icon { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }

.stat-info h3 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================
   CHARTS & SECTIONS
   ========================================== */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
  margin-bottom: 30px;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--card-shadow);
}

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

.chart-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

/* ==========================================
   NGO PROGRESS WATCH STYLING
   ========================================== */
.ngo-watch-section {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: var(--card-shadow);
}

.ngo-watch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
}

.search-filter-row {
  display: flex;
  gap: 15px;
  width: 100%;
  max-width: 600px;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-input-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrapper input {
  width: 100%;
  padding: 10px 10px 10px 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-family);
  transition: var(--transition);
}

.search-input-wrapper input:focus {
  border-color: var(--color-blue);
  background: rgba(255, 255, 255, 0.08);
}

.ngo-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.ngo-progress-card {
  background: rgba(255, 255, 255, 0.02);
  border: var(--card-border);
  border-radius: 16px;
  padding: 20px;
  transition: var(--transition);
  position: relative;
}

.ngo-progress-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-blue);
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.1);
}

.ngo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.ngo-card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ngo-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.1);
  color: var(--color-blue);
}

.ngo-card-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.progress-metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.metric-label {
  color: var(--text-secondary);
}

.metric-value {
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 1s ease-in-out;
}

.progress-bar-fill.blue { background: var(--gradient-primary); }
.progress-bar-fill.green { background: var(--gradient-green); }
.progress-bar-fill.purple { background: var(--gradient-purple); }

.ngo-card-footer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================
   EPI IMMUNIZATION GRID & REGISTER
   ========================================== */
.epi-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
}

@media (max-width: 1024px) {
  .epi-container {
    grid-template-columns: 1fr;
  }
}

.vaccination-antigens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin: 15px 0;
}

.antigen-stat {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  transition: var(--transition);
}

.antigen-stat:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(56, 189, 248, 0.3);
}

.antigen-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
}

.antigen-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-top: 4px;
}

/* ==========================================
   TABLES & CRUD VIEWS
   ========================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 15px;
}

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

.custom-table th {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-weight: 500;
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.actions-cell {
  display: flex;
  gap: 10px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.btn-edit {
  background: rgba(56, 189, 248, 0.1);
  color: var(--color-blue);
}

.btn-edit:hover {
  background: var(--color-blue);
  color: #000;
}

.btn-delete {
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-rose);
}

.btn-delete:hover {
  background: var(--color-rose);
  color: #fff;
}

/* Tab Content Visibility */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

/* ==========================================
   MODALS & FORMS
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-secondary);
  border: var(--card-border);
  border-radius: 20px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* Forms Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .form-group.full-width {
    grid-column: span 1;
  }
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-control option {
  background-color: #0f172a;
  color: #f8fafc;
}

.form-control:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px var(--border-glow);
  background: rgba(255, 255, 255, 0.07);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-section-title {
  grid-column: span 2;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-blue);
  margin-top: 15px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

@media (max-width: 600px) {
  .form-section-title {
    grid-column: span 1;
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
  border-top: var(--card-border);
  padding-top: 20px;
}

/* ==========================================
   DOCUMENT/REPORT CARD VIEW
   ========================================== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.report-card {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.report-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
}

.report-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.report-icon {
  font-size: 1.8rem;
  color: var(--color-rose);
}

.report-badge-status {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.report-badge-status.approved { background: rgba(16, 185, 129, 0.15); color: var(--color-green); }
.report-badge-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }

.report-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.report-info-row {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.report-actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
}

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .top-bar {
    flex-wrap: wrap;
  }
  
  .search-filter-row {
    flex-direction: column;
  }
}
