/* ==========================================================================
   Amrit Poshan Vatika - Clean Light Theme Admin Web Panel & Login Gate
   Government of Rajasthan | Department of Women & Child Development
   ========================================================================== */

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

:root {
  /* Color Palette - Forest Emerald & Rajasthan Gold */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: rgba(5, 150, 105, 0.1);
  --primary-glow: rgba(5, 150, 105, 0.22);
  
  --secondary: #10b981;
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-light: rgba(217, 119, 6, 0.1);

  --danger: #dc2626;
  --danger-light: rgba(220, 38, 38, 0.1);
  --success: #059669;
  --info: #2563eb;

  /* Default Tokens: CLEAN LIGHT THEME */
  --bg-main: #f4f6f9;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --border-color: #e2e8f0;
  --text-main: #334155;
  --text-muted: #64748b;
  --text-heading: #0f172a;
  --glass-border: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
  --modal-bg: #ffffff;
}

[data-theme="dark"] {
  --bg-main: #060b17;
  --bg-sidebar: #0b1222;
  --bg-card: rgba(18, 28, 48, 0.85);
  --bg-card-hover: rgba(24, 37, 64, 0.9);
  --bg-input: #131d33;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-heading: #ffffff;
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --modal-bg: #0f172a;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   AUTHENTICATION LOGIN GATEWAY SCREEN (LIGHT THEME)
   ========================================================================== */
.login-screen {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, rgba(5, 150, 105, 0.08), transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(217, 119, 6, 0.06), transparent 50%),
              var(--bg-main);
  padding: 1.5rem;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}



.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem auto;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.login-brand h1 {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.login-brand p {
  font-size: 0.88rem;
  color: var(--text-muted);
}


/* App Container Layout */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  z-index: 100;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-text h2 {
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--text-heading);
}

.brand-text span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-item a:hover,
.nav-item.active a {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.nav-item.active a {
  border-left: 3px solid var(--primary);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}

.govt-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(217, 119, 6, 0.08);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

/* Main Content Area */
.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 2rem 2.5rem;
  min-height: 100vh;
  width: calc(100vw - 280px);
}

/* Top Header Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title h1 {
  font-size: 1.85rem;
  margin-bottom: 0.25rem;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.user-info .user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
}

.user-info .user-role {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

.btn-logout {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
  padding: 0.5rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-logout:hover {
  background: var(--danger);
  color: white;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.kpi-card.accent::before { background: var(--accent); }
.kpi-card.info::before { background: var(--info); }
.kpi-card.success::before { background: var(--success); }

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.kpi-card.accent .kpi-icon {
  background: var(--accent-light);
  color: var(--accent);
}

.kpi-card.info .kpi-icon {
  background: rgba(37, 99, 235, 0.1);
  color: var(--info);
}

.kpi-card.success .kpi-icon {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.kpi-info h3 {
  font-size: 1.75rem;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

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

/* Glass Section Container */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-title h2 {
  font-size: 1.35rem;
}

/* Filters & Search Controls */
.filter-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-input-group {
  position: relative;
  min-width: 260px;
}

.search-input-group input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.88rem;
}

.search-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input-group .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.filter-select {
  padding: 0.65rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.88rem;
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: var(--primary);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  padding: 0.7rem 1.35rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Data Table Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

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

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .data-table th {
  background: rgba(15, 23, 42, 0.6);
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

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

.data-table tbody tr:hover {
  background: #f8fafc;
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-beneficiary {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge-officer {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-admin {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.badge-active {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

/* System Status Grid */
.system-status-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.status-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status-value {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-heading);
}

.dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--success);
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background: var(--modal-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 90%;
  max-width: 520px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

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

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  color: var(--text-heading);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Utility Helpers */
.hidden { display: none !important; }

/* Responsive Adjustments */
@media (max-width: 992px) {
  .sidebar { width: 80px; padding: 1.25rem 0.5rem; }
  .brand-text, .nav-item span, .govt-badge span { display: none; }
  .brand-header { justify-content: center; }
  .nav-item a { justify-content: center; padding: 0.75rem; }
  .main-content { margin-left: 80px; width: calc(100vw - 80px); padding: 1.5rem; }
  .system-status-grid { grid-template-columns: 1fr; }
}
