:root {
  --aluno-bg: #07070b;
  --aluno-bg-elevated: #111118;
  --aluno-surface: rgba(255, 255, 255, 0.06);
  --aluno-surface-hover: rgba(255, 255, 255, 0.1);
  --aluno-border: rgba(255, 255, 255, 0.08);
  --aluno-text: #f4f4f5;
  --aluno-muted: #a1a1aa;
  --aluno-accent: #ef4444;
  --aluno-accent-2: #f97316;
  --aluno-success: #22c55e;
  --aluno-warning: #eab308;
  --aluno-radius: 1rem;
  --aluno-radius-lg: 1.25rem;
  --aluno-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  --aluno-nav-h: 4.5rem;
  --aluno-top-h: 4rem;
}

* { -webkit-tap-highlight-color: transparent; }

body.aluno-app {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--aluno-bg);
  color: var(--aluno-text);
  min-height: 100dvh;
}

.aluno-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(239, 68, 68, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(249, 115, 22, 0.12), transparent),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(59, 130, 246, 0.08), transparent),
    var(--aluno-bg);
}

.aluno-shell {
  position: relative;
  z-index: 1;
  max-width: 56rem;
  margin: 0 auto;
  padding: 1rem 1rem calc(var(--aluno-nav-h) + 1.5rem);
  padding-top: calc(var(--aluno-top-h) + 1rem);
}

@media (min-width: 768px) {
  .aluno-shell {
    padding-bottom: 2rem;
    max-width: 64rem;
  }
}

/* Top bar */
.aluno-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--aluno-top-h);
  background: rgba(7, 7, 11, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--aluno-border);
}

.aluno-topbar-inner {
  max-width: 64rem;
  margin: 0 auto;
  height: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.aluno-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.aluno-brand img {
  height: 2rem;
  width: auto;
}

.aluno-brand span {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aluno-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--aluno-accent), var(--aluno-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Bottom nav */
.aluno-bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--aluno-nav-h);
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--aluno-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.aluno-bottomnav-inner {
  max-width: 64rem;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding: 0 0.25rem;
}

.aluno-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--aluno-muted);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s, transform 0.2s;
  max-width: 5rem;
}

.aluno-nav-item i {
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.aluno-nav-item.active {
  color: var(--aluno-accent);
}

.aluno-nav-item.active i {
  transform: scale(1.1);
}

.aluno-nav-item:active {
  transform: scale(0.95);
}

/* Cards */
.aluno-glass {
  background: var(--aluno-surface);
  border: 1px solid var(--aluno-border);
  border-radius: var(--aluno-radius-lg);
  backdrop-filter: blur(12px);
}

.aluno-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--aluno-radius-lg);
  background: var(--aluno-surface);
  border: 1px solid var(--aluno-border);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
}

.aluno-card-link:hover {
  transform: translateY(-3px);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: var(--aluno-shadow);
}

.aluno-card-link:active {
  transform: translateY(-1px);
}

/* Page header */
.aluno-page-header {
  margin-bottom: 1.5rem;
}

.aluno-page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.aluno-page-header p {
  color: var(--aluno-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.aluno-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--aluno-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}

.aluno-back:hover { color: var(--aluno-text); }

/* Alerts */
.aluno-alert {
  border-radius: var(--aluno-radius);
  padding: 1rem 1.125rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.aluno-alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.aluno-alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.aluno-alert-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #bfdbfe;
}

/* Forms inside app */
.aluno-app .aluno-input,
.aluno-app input[type="text"],
.aluno-app input[type="email"],
.aluno-app input[type="password"],
.aluno-app input[type="tel"],
.aluno-app select,
.aluno-app textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--aluno-border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--aluno-text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.aluno-app .aluno-input:focus,
.aluno-app input:focus,
.aluno-app select:focus,
.aluno-app textarea:focus {
  outline: none;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.aluno-app label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--aluno-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aluno-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s;
}

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

.aluno-btn-primary {
  background: linear-gradient(135deg, var(--aluno-accent), var(--aluno-accent-2));
  color: white;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

.aluno-btn-primary:hover { filter: brightness(1.08); }

.aluno-btn-ghost {
  background: var(--aluno-surface);
  border: 1px solid var(--aluno-border);
  color: var(--aluno-text);
}

/* Override legacy light pages */
.aluno-app .bg-white {
  background: var(--aluno-surface) !important;
  border: 1px solid var(--aluno-border);
  color: var(--aluno-text);
}

.aluno-app .text-gray-800,
.aluno-app .text-gray-900 { color: var(--aluno-text) !important; }

.aluno-app .text-gray-600,
.aluno-app .text-gray-500,
.aluno-app .text-gray-700 { color: var(--aluno-muted) !important; }

.aluno-app .bg-gray-50,
.aluno-app .bg-gray-100 { background: rgba(255,255,255,0.05) !important; }

.aluno-app .border-gray-200,
.aluno-app .border-gray-300 { border-color: var(--aluno-border) !important; }

.aluno-app table thead { background: rgba(255,255,255,0.04) !important; }

.aluno-app .divide-gray-200 > * + * { border-color: var(--aluno-border) !important; }

.aluno-app .shadow-lg { box-shadow: var(--aluno-shadow) !important; }

/* Treino accordion */
.aluno-app .from-red-600 { --tw-gradient-from: #dc2626; }
.aluno-app .to-red-700 { --tw-gradient-to: #b91c1c; }

@keyframes aluno-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.aluno-animate-in {
  animation: aluno-fade-up 0.45s ease backwards;
}

.aluno-stagger-1 { animation-delay: 0.05s; }
.aluno-stagger-2 { animation-delay: 0.1s; }
.aluno-stagger-3 { animation-delay: 0.15s; }
.aluno-stagger-4 { animation-delay: 0.2s; }
.aluno-stagger-5 { animation-delay: 0.25s; }
.aluno-stagger-6 { animation-delay: 0.3s; }

@media (min-width: 768px) {
  .aluno-bottomnav { display: none; }
  .aluno-shell {
    padding-top: calc(var(--aluno-top-h) + 1.5rem);
    padding-left: 14rem;
  }
  .aluno-sidebar {
    display: flex;
  }
}

.aluno-sidebar {
  display: none;
  position: fixed;
  left: 0;
  top: var(--aluno-top-h);
  bottom: 0;
  width: 13rem;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--aluno-border);
  background: rgba(7, 7, 11, 0.6);
  backdrop-filter: blur(12px);
  flex-direction: column;
  gap: 0.25rem;
  z-index: 40;
}

.aluno-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: var(--aluno-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.aluno-sidebar a:hover {
  background: var(--aluno-surface-hover);
  color: var(--aluno-text);
}

.aluno-sidebar a.active {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.aluno-sidebar a i { width: 1.25rem; text-align: center; }
