:root {
  /* Colors */
  --primary: #6366f1; /* Indigo */
  --primary-dark: #4f46e5;
  --secondary: #f59e0b; /* Amber/Orange for specific tags */
  --success: #10b981; /* Green */
  --danger: #ef4444; /* Red */
  --warning: #f59e0b;
  --bg-secondary-light: #fffbeb;
  --bg-danger-light: #fef2f2;
  --bg-success-light: #ecfdf5;
  --bg-primary-light: #eef2ff;
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

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

/* Mobile Container Strategy */
.app-container {
  width: 100%;
  max-width: 480px; /* Mobile width constraint */
  background-color: #fff;
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, p {
  margin: 0;
}

.text-xl { font-size: 24px; font-weight: 700; }
.text-lg { font-size: 18px; font-weight: 600; }
.text-md { font-size: 16px; font-weight: 500; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* Layout Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.w-full { width: 100%; }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.mt-auto { margin-top: auto; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Header */
.header {
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.header-title {
  font-size: 18px;
  font-weight: 600;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background-color: var(--bg-body); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-md);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  padding: 2px;
}

.input-prefix {
  padding: 12px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  outline: none;
}

.otp-container {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.otp-input {
  width: 48px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: var(--spacing-md);
}

/* Badges */
.badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-pending { background: #FFEDD5; color: #C2410C; }
.badge-progress { background: #FEF3C7; color: #B45309; }
.badge-complete { background: #D1FAE5; color: #047857; }
.badge-cancel { background: #FEE2E2; color: #B91C1C; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}
.timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.timeline-dot {
  position: absolute;
  left: -24px; /* Adjust based on padding of timeline */
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  z-index: 1;
}
.dot-success { background: var(--success); box-shadow: 0 0 0 4px #d1fae5; }
.dot-pending { background: var(--text-muted); box-shadow: 0 0 0 4px #f3f4f6; }
.dot-current { background: var(--primary); box-shadow: 0 0 0 4px #e0e7ff; }

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
}
.tab-item.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Student List */
.student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.student-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  margin-right: 12px;
}
.toggle-group {
  display: flex;
  gap: 8px;
}
.toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
}
.toggle-btn.check { color: var(--success); border-color: #d1fae5; }
.toggle-btn.check.active { background: var(--success); color: white; }
.toggle-btn.cross { color: var(--danger); border-color: #fee2e2; }
.toggle-btn.cross.active { background: var(--danger); color: white; }

/* SOS Button */
.sos-btn-large {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 0 0 16px rgba(239, 68, 68, 0.2), 0 0 0 32px rgba(239, 68, 68, 0.1);
  margin: 40px auto;
  border: none;
  cursor: pointer;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Profile */
.profile-header {
  text-align: center;
  padding: 24px 0;
}
.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ddd;
  margin: 0 auto 12px;
}

/* Floating Action Button (SOS) */
.fab-sos {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  text-decoration: none;
  z-index: 100;
}

/* Icons using simple shapes or text for now since no SVG library allowed without list_assets */
.icon { font-style: normal; }

/* Utility for icons */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.nav-box {
  background: #f0f9ff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--primary);
  text-decoration: none;
}

/* Login Page Styles */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
  background: white;
}
.logo-circle {
  width: 80px;
  height: 80px;
  background: #f3f4f6;
  border-radius: 50%;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.google-btn {
  background: #DC2626;
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Modal simulation */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  align-items: flex-end; /* Sheet style */
}
.modal-content {
  background: white;
  width: 100%;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

