* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-attachment: fixed;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}

#auth-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  padding: 48px;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 480px;
  margin-top: 8vh;
  animation: fadeUp 0.6s ease;
}

#app-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  padding: 40px 48px;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 1200px;
  animation: fadeUp 0.6s ease;
}

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

h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 4px;
  margin-top: 12px;
  margin-bottom: 24px;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
  margin: 24px 0 16px;
}

h4 {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 4px;
}

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

input, select {
  width: 100%;
  padding: 14px 18px;
  margin: 8px 0;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  background: #f7fafc;
  transition: all 0.25s ease;
  outline: none;
}

input:focus, select:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

button {
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
}

#login-btn, #add-student-btn, #add-staff-btn, #save-attendance-btn,
#load-attendance-btn, #save-fee-btn, #load-fees-btn,
#load-exam-students-btn, #save-exam-btn, #load-report-btn, #refresh-stats-btn,
#export-students-btn, #export-staff-btn, #export-fees-btn,
#export-attendance-btn, #export-exams-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

#login-btn:hover, #add-student-btn:hover, #add-staff-btn:hover,
#save-attendance-btn:hover, #load-attendance-btn:hover,
#save-fee-btn:hover, #load-fees-btn:hover,
#load-exam-students-btn:hover, #save-exam-btn:hover, #load-report-btn:hover,
#refresh-stats-btn:hover,
#export-students-btn:hover, #export-staff-btn:hover,
#export-fees-btn:hover, #export-attendance-btn:hover, #export-exams-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(102, 126, 234, 0.45);
}

#signup-btn {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

#signup-btn:hover { background: #667eea; color: white; }

#logout-btn {
  background: #f56565;
  color: white;
  width: auto;
  padding: 10px 24px;
  font-size: 14px;
}

#logout-btn:hover { background: #e53e3e; transform: translateY(-2px); }

#auth-msg, #attendance-msg, #fee-msg, #exam-msg {
  color: #38a169;
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 24px 0 16px;
  border-bottom: 2px solid #e2e8f0;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  color: #4a5568;
  border: none;
  border-radius: 0;
  padding: 12px 20px;
  font-weight: 600;
  width: auto;
  margin: 0;
  border-bottom: 3px solid transparent;
  font-size: 15px;
}

.tab-btn:hover { color: #667eea; }

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

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

ul { list-style: none; padding: 0; margin-top: 16px; }

li {
  background: linear-gradient(135deg, #f7fafc, #edf2f7);
  margin: 10px 0;
  padding: 16px 20px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  color: #2d3748;
  font-weight: 500;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  flex-wrap: wrap;
}

li:hover {
  transform: translateX(6px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.18);
  border-left-color: #764ba2;
}

.btn-group {
  display: flex;
  gap: 6px;
}

.att-select {
  width: auto;
  padding: 8px 14px;
  margin: 0;
  font-size: 13px;
  border-radius: 8px;
}

.del-btn, .del-fee-btn {
  width: auto;
  padding: 8px 16px;
  margin: 0;
  font-size: 13px;
  background: #f56565;
  color: white;
  border-radius: 8px;
  box-shadow: none;
}

.del-btn:hover, .del-fee-btn:hover {
  background: #e53e3e;
  transform: scale(1.05);
}

.wa-btn {
  width: auto;
  padding: 8px 16px;
  margin: 0;
  font-size: 13px;
  background: #25d366;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.wa-btn:hover {
  background: #1ebe5a;
  transform: scale(1.05);
}

span#user-name { color: #667eea; font-weight: 700; font-size: 16px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.stat-card {
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 24px;
  border-radius: 16px;
  color: white;
  box-shadow: 0 10px 24px rgba(102, 126, 234, 0.3);
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(102, 126, 234, 0.45);
}

.stat-label {
  font-size: 13px;
  opacity: 0.85;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.report-card {
  background: linear-gradient(135deg, #f7fafc, #edf2f7);
  padding: 24px;
  border-radius: 16px;
  margin-top: 16px;
  border-left: 4px solid #667eea;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.report-table th, .report-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.report-table th {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 600;
}

.report-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  font-size: 14px;
  color: #2d3748;
  flex-wrap: wrap;
}

.report-total b { color: #667eea; }

@media (min-width: 700px) {
  #app-container { padding: 48px 64px; }
}
