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

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --border-color: rgba(148, 163, 184, 0.12);
  --border-active: rgba(52, 211, 153, 0.4);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #34d399;
  --accent-hover: #6ee7b7;
  --accent-dim: rgba(52, 211, 153, 0.15);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.15);
  --warning: #fbbf24;
  --warning-dim: rgba(251, 191, 36, 0.15);
  --info: #60a5fa;
  --info-dim: rgba(96, 165, 250, 0.15);
  --gradient-1: linear-gradient(135deg, #065f46, #0f766e);
  --gradient-2: linear-gradient(135deg, #1e40af, #7c3aed);
  --gradient-3: linear-gradient(135deg, #9f1239, #be185d);
  --gradient-4: linear-gradient(135deg, #92400e, #b45309);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.35);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

#app { position: relative; z-index: 1; }

/* === Login Screen === */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center;
  animation: slideUp 0.4s ease;
}
.login-logo {
  width: 60px; height: 60px; border-radius: 16px;
  background: var(--gradient-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin-bottom: 20px;
}
.login-title {
  font-size: 1.3rem; font-weight: 700;
  margin-bottom: 6px; text-align: center;
}
.login-subtitle {
  font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: 28px; text-align: center;
}
.btn:disabled {
  opacity: 0.6; cursor: not-allowed;
  transform: none !important;
}

/* === Header === */
.app-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 50;
  padding: 0 24px;
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.app-logo {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 1.2rem;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.header-actions { display: flex; gap: 8px; }

/* === Tab Navigation === */
.tab-nav {
  display: flex; gap: 4px;
  background: rgba(30, 41, 59, 0.5);
  padding: 4px; border-radius: 12px;
}
.tab-btn {
  padding: 8px 20px; border-radius: 8px;
  border: none; background: transparent;
  color: var(--text-secondary); cursor: pointer;
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  transition: all 0.25s ease;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); background: rgba(148, 163, 184, 0.08); }
.tab-btn.active {
  background: var(--accent-dim); color: var(--accent);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2);
}
.tab-icon { font-size: 1rem; }

/* === Main Content === */
.main-content {
  max-width: 1400px; margin: 0 auto;
  padding: 24px;
}

/* === Glass Card === */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s ease;
}
.card:hover { border-color: rgba(148, 163, 184, 0.2); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.card-title { font-size: 1.1rem; font-weight: 600; }

/* === Stat Cards === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  border-radius: var(--radius);
  padding: 20px; color: #fff;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.stat-card .stat-value {
  font-size: 2rem; font-weight: 800;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.8rem; opacity: 0.85;
  margin-top: 4px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-g1 { background: var(--gradient-1); }
.stat-g2 { background: var(--gradient-2); }
.stat-g3 { background: var(--gradient-3); }
.stat-g4 { background: var(--gradient-4); }

/* === Table === */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  background: rgba(15, 23, 42, 0.6);
  padding: 12px 14px; text-align: left;
  font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 2;
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: rgba(148, 163, 184, 0.05); }
tbody tr:nth-child(even) { background: rgba(15, 23, 42, 0.3); }
tbody tr:nth-child(even):hover { background: rgba(148, 163, 184, 0.08); }

/* === Buttons === */
.btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary {
  background: var(--accent); color: #0f172a;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-secondary:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.btn-danger {
  background: var(--danger-dim); color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.25); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; border-radius: 6px; }
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--border-color);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.form-input, .form-select {
  width: 100%; padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit; font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--danger); font-size: 0.78rem; margin-top: 4px; }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px; width: 90%; max-width: 560px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}
.modal-title {
  font-size: 1.2rem; font-weight: 700;
  margin-bottom: 20px; display: flex;
  align-items: center; gap: 10px;
}
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* === Search === */
.search-bar {
  position: relative; margin-bottom: 16px;
}
.search-bar input {
  width: 100%; padding: 10px 14px 10px 40px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: inherit; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar .search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
}

/* === Badge / Pill === */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-info { background: var(--info-dim); color: var(--info); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }

/* === Progress Bar === */
.progress-bar {
  height: 6px; border-radius: 3px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.progress-fill.warn { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* === Editable Cell === */
.editable-cell {
  width: 60px; padding: 6px 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 6px; text-align: center;
  color: var(--text-primary); font-family: inherit; font-size: 0.85rem;
  outline: none; transition: border-color 0.2s;
}
.editable-cell:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.total-cell { font-weight: 700; color: var(--accent); }

/* === Filter Bar === */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; margin-bottom: 16px;
}
.filter-bar .form-select {
  width: auto; min-width: 150px; padding: 8px 36px 8px 12px;
  font-size: 0.82rem;
}

/* === Chip Select for Scheduling === */
.volunteer-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 20px;
  background: var(--accent-dim); color: var(--accent);
  font-size: 0.78rem; font-weight: 500;
  cursor: default; transition: all 0.2s;
}
.volunteer-chip .remove-chip {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(248,113,113,0.2); border: none;
  color: var(--danger); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; transition: background 0.2s;
}
.volunteer-chip .remove-chip:hover { background: rgba(248,113,113,0.4); }

/* === Empty State === */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* === Duplicate Warning === */
.duplicate-warn {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--warning-dim);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--warning); font-size: 0.82rem;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

/* === Toast === */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem; color: var(--text-primary);
  animation: slideUp 0.3s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-color: rgba(52, 211, 153, 0.4); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); }

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-enter { animation: fadeIn 0.25s ease; }

/* === Responsive === */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }
  .tab-nav { overflow-x: auto; width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 16px; }
}

/* === Print === */
@media print {
  body { background: #fff; color: #000; }
  body::before, .app-header, .btn, .modal-overlay, .toast-container,
  .search-bar, .filter-bar, .tab-nav, .header-actions { display: none !important; }
  .card { background: #fff; border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; }
  table { font-size: 11px; }
  thead th { background: #f3f4f6; color: #111; }
  tbody td { color: #333; }
  .stat-card { background: #f3f4f6 !important; color: #111 !important; }
  .stat-card .stat-value, .stat-card .stat-label { color: #111 !important; }
  .badge { border: 1px solid #ccc; }
  .main-content { padding: 0; max-width: 100%; }
}
