:root {
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --whatsapp: #22c55e;
  --whatsapp-hover: #16a34a;
  --red: #ef4444;
  --yellow: #f59e0b;
  --green: #10b981;
  --border: #334155;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(75px + env(safe-area-inset-bottom));
}

/* Header */
header.app-header {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  font-size: 1.4rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

/* Containers */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-whatsapp {
  background-color: var(--whatsapp);
  color: #ffffff;
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}
.btn-whatsapp:hover { background-color: var(--whatsapp-hover); }

.btn-secondary {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Uniform Pill */
.uniform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}
.uniform-diario { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid #3b82f6; }
.uniform-deportes { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }
.uniform-gala { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #f59e0b; }
.uniform-libre { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid #a855f7; }

/* Special Materials List */
.materials-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.material-item {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--yellow);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Traffic Light Badges */
.traffic-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.traffic-RED { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid var(--red); }
.traffic-YELLOW { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid var(--yellow); }
.traffic-GREEN { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid var(--green); }

/* Task Item */
.task-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.task-item:last-child { border-bottom: none; }

.task-info { flex: 1; }
.task-course { font-size: 0.75rem; font-weight: 600; color: var(--primary); text-transform: uppercase; }
.task-title { font-size: 0.95rem; font-weight: 600; margin: 2px 0 4px 0; }
.task-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Student Selector Tabs */
.student-selector {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.student-tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.student-tab.active {
  background: var(--primary);
  color: #fff;
}

/* Bottom Navigation */
nav.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}
.nav-icon { font-size: 1.3rem; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  max-width: 480px;
  width: 100%;
}
