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

body {
  background: linear-gradient(135deg, #FAF8F9 0%, #F2A4C4 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.app-container {
  max-width: 480px;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 40px;
  box-shadow: 0 20px 40px rgba(155, 123, 191, 0.15), 0 8px 16px rgba(0, 0, 0, 0.05);
  padding: 1.8rem 1.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.app-container-dashboard {
  max-width: 900px;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 40px;
  box-shadow: 0 20px 40px rgba(155, 123, 191, 0.15), 0 8px 16px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin: 0 auto;
}

#daysList {
  max-height: 400px;
  overflow-y: auto;
}

/* LOGIN */
#loginSection {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo-area i {
  font-size: 2.6rem;
  color: #E86BA8;
  background: white;
  padding: 0.5rem;
  border-radius: 18px;
  box-shadow: 0 6px 12px rgba(232, 107, 168, 0.2);
}

.logo-area h1 {
  font-size: 1.9rem;
  font-weight: 700;
  background: linear-gradient(145deg, #9B7BBF, #E86BA8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card {
  background: white;
  padding: 2rem 1.5rem;
  border-radius: 32px;
  box-shadow: 0 8px 24px rgba(155, 123, 191, 0.08);
}

.input-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.input-group i {
  position: absolute;
  left: 18px;
  top: 18px;
  color: #9B7BBF;
  font-size: 1.1rem;
}

.input-group input {
  width: 100%;
  padding: 1rem 1rem 1rem 3.2rem;
  border: 2px solid #FAF8F9;
  border-radius: 60px;
  font-size: 1rem;
  background: #FAF8F9;
  transition: 0.25s;
  outline: none;
}

.input-group input:focus {
  border-color: #E86BA8;
  background: white;
  box-shadow: 0 0 0 4px rgba(232, 107, 168, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #E86BA8, #9B7BBF);
  border: none;
  border-radius: 60px;
  font-weight: 600;
  font-size: 1.1rem;
  color: white;
  cursor: pointer;
  transition: 0.25s;
  box-shadow: 0 8px 18px rgba(232, 107, 168, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #d95a9a, #8a6ab0);
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(232, 107, 168, 0.4);
}

.btn-secondary {
  background: #FAF8F9;
  color: #1f2937;
  box-shadow: none;
  border: 2px solid transparent;
}

.btn-secondary:hover {
  background: #f0ecee;
  transform: scale(0.98);
}

.btn-danger {
  background: #f23b5c;
  box-shadow: 0 8px 18px rgba(242, 59, 92, 0.25);
}

.btn-danger:hover {
  background: #d92d4e;
}

.btn-success {
  background: #34a853;
  box-shadow: 0 8px 18px rgba(52, 168, 83, 0.25);
}

.btn-success:hover {
  background: #2d9248;
}

.error-msg {
  color: #e53e3e;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* Panel principal */
#mainPanel {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

/* Header usuario */
.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 0.8rem 1.4rem;
  border-radius: 60px;
  box-shadow: 0 4px 12px rgba(155, 123, 191, 0.06);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.user-avatar {
  background: linear-gradient(135deg, #E86BA8, #9B7BBF);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
}

.user-name {
  font-weight: 600;
  color: #1a2639;
}

.user-plan {
  font-size: 0.7rem;
  background: #F2A4C4;
  color: #ffff;
  padding: 0.2rem 0.9rem;
  border-radius: 30px;
  font-weight: 600;
}

.day {
  font-size: 0.7rem;
  background: #C4A8D9;
  color: #ffff;
  padding: 0.2rem 0.9rem;
  border-radius: 30px;
  font-weight: 600;
}

.logout-btn {
  background: none;
  border: none;
  color: #9B7BBF;
  font-size: 1.3rem;
  cursor: pointer;
  transition: 0.2s;
  padding: 0.3rem;
}

.logout-btn:hover {
  color: #E86BA8;
  transform: rotate(10deg);
}

/* Navegación tabs */
.tab-nav {
  display: flex;
  background: white;
  border-radius: 60px;
  padding: 0.3rem;
  box-shadow: 0 4px 12px rgba(155, 123, 191, 0.06);
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.8rem 0.3rem;
  border-radius: 60px;
  font-weight: 600;
  color: #9B7BBF;
  transition: 0.25s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.tab-btn i {
  font-size: 1rem;
}

.tab-btn.active {
  background: linear-gradient(135deg, #E86BA8, #9B7BBF);
  color: white;
  box-shadow: 0 6px 12px rgba(232, 107, 168, 0.2);
}

.tab-content {
  background: white;
  border-radius: 32px;
  padding: 1.2rem;
  box-shadow: 0 8px 20px rgba(155, 123, 191, 0.06);
  min-height: 320px;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .tab-content {
    padding: 1.8rem 1.5rem;
  }
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.2rem;
}

.tab-pane.active {
  display: flex;
}

/* Clases */
.class-card {
  background: #FAF8F9;
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: 0.2s;
  border-left: 6px solid #E86BA8;
  cursor: pointer;
  margin-bottom: 0.6rem;
}

.class-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(155, 123, 191, 0.08);
}

@media (min-width: 768px) {
  .class-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
  }
}

.class-info h4 {
  font-weight: 600;
  color: #1a2639;
  margin-bottom: 0.3rem;
}

.class-info p {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.class-info p i {
  width: 16px;
  color: #E86BA8;
  flex-shrink: 0;
}

.view-days-btn {
  background: linear-gradient(135deg, #E86BA8, #9B7BBF);
  border: none;
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 60px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 4px 8px rgba(232, 107, 168, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .view-days-btn {
    margin-top: 0;
  }
}

.view-days-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 12px rgba(232, 107, 168, 0.3);
}

.view-days-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  background: #C4A8D9;
}

/* Vista de días */
#daysViewOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(155, 123, 191, 0.3);
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

#daysViewOverlay.active {
  display: flex;
}

.days-modal {
  background: white;
  border-radius: 40px;
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 24px 48px rgba(155, 123, 191, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.days-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.days-modal-header h3 {
  font-size: 1.3rem;
  color: #1a2639;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #9B7BBF;
  cursor: pointer;
  transition: 0.2s;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.close-modal-btn:hover {
  background: #FAF8F9;
  color: #E86BA8;
}

.day-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid #FAF8F9;
  transition: 0.2s;
}

.day-item:last-child {
  border-bottom: none;
}

.day-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.day-date {
  font-weight: 600;
  color: #1a2639;
  font-size: 1rem;
}

.day-time {
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.day-capacity {
  font-size: 0.75rem;
  background: #FAF8F9;
  padding: 0.2rem 0.8rem;
  border-radius: 30px;
  color: #9B7BBF;
}

.reserve-day-btn {
  padding: 0.5rem 1.4rem;
  border: none;
  border-radius: 60px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
  background: linear-gradient(135deg, #E86BA8, #9B7BBF);
  color: white;
  box-shadow: 0 4px 12px rgba(232, 107, 168, 0.2);
}

.reserve-day-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(232, 107, 168, 0.3);
}

.reserve-day-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #C4A8D9;
}

.reserve-day-btn.reserved {
  background: #34a853;
}

.reserve-day-btn.reserved:hover {
  background: #2d9248;
}

/* Reservas (mis clases) */
.reservation-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid #FAF8F9;
}

.reservation-item:last-child {
  border-bottom: none;
}

@media (min-width: 768px) {
  .reservation-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.reservation-item .class-info {
  flex: 1;
}

.reservation-detail {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.cancel-btn {
  background: #F2A4C4;
  border: none;
  color: #7a4a8a;
  padding: 0.3rem 1rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .cancel-btn {
    margin-top: 0;
  }
}

.cancel-btn:hover {
  background: #E86BA8;
  color: white;
}

.empty-state {
  color: #9B7BBF;
  text-align: center;
  padding: 2rem 0;
}

.empty-state i {
  font-size: 2.4rem;
  margin-bottom: 0.8rem;
  opacity: 0.5;
  color: #E86BA8;
}

/* Perfil & membresía */
.profile-field {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid #FAF8F9;
}

.profile-field:last-child {
  border-bottom: none;
}

.profile-label {
  color: #9B7BBF;
  font-weight: 500;
}

.profile-value {
  font-weight: 600;
  color: #1a2639;
}

.membership-badge {
  background: linear-gradient(135deg, #F2A4C4, #C4A8D9);
  padding: 1rem;
  border-radius: 20px;
  font-weight: 600;
  color: #5a3a6a;
  align-self: flex-start;
}

.membership-detail {
  background: #FAF8F9;
  padding: 1rem;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.tag {
  background: #FAF8F9;
  padding: 0.2rem 1rem;
  border-radius: 30px;
  font-size: 0.7rem;
  color: #9B7BBF;
}

.back-btn {
  background: #FAF8F9;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 60px;
  font-weight: 600;
  color: #1a2639;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.back-btn:hover {
  background: #F2A4C4;
  transform: scale(0.98);
}

@media (max-width: 767px) {
  .app-container {
    padding: 1.2rem;
  }

  .app-container-dashboard {
    padding: 1.2rem;
    border-radius: 30px;
  }

  .tab-btn {
    font-size: 0.7rem;
    gap: 0.2rem;
    padding: 0.6rem 0.2rem;
  }

  .tab-btn i {
    font-size: 0.8rem;
  }

  .days-modal {
    padding: 1.5rem;
    border-radius: 30px;
  }

  .user-header {
    padding: 0.6rem 1rem;
    border-radius: 50px;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .user-name {
    font-size: 0.9rem;
  }

  .user-plan,
  .day {
    font-size: 0.65rem;
    padding: 0.15rem 0.7rem;
  }

  .logout-btn {
    font-size: 1.1rem;
  }

  .view-days-btn,
  .reserve-day-btn {
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
  }

  .class-card {
    padding: 0.8rem;
  }

  .class-info h4 {
    font-size: 0.95rem;
  }

  .class-info p {
    font-size: 0.75rem;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .app-container-dashboard {
    max-width: 750px;
  }
}

/* Modal de edición de perfil */
#editProfileOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(155, 123, 191, 0.3);
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  border-radius: 40px;
}

#editProfileOverlay.active {
  display: flex;
}

.edit-profile-modal {
  background: white;
  border-radius: 40px;
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 24px 48px rgba(155, 123, 191, 0.2);
  animation: slideUp 0.3s ease;
}

.edit-profile-modal .input-group {
  margin-bottom: 1rem;
}

.edit-profile-modal .input-group input {
  padding-left: 1.2rem;
}

.edit-profile-modal .input-group i {
  display: none;
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.form-actions button {
  flex: 1;
  padding: 0.8rem;
  border: none;
  border-radius: 60px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
}

.form-actions .btn-cancel {
  background: #FAF8F9;
  color: #1f2937;
}

.form-actions .btn-cancel:hover {
  background: #F2A4C4;
}

.form-actions .btn-save {
  background: linear-gradient(135deg, #E86BA8, #9B7BBF);
  color: white;
  box-shadow: 0 4px 12px rgba(232, 107, 168, 0.2);
}

.form-actions .btn-save:hover {
  background: linear-gradient(135deg, #d95a9a, #8a6ab0);
  transform: scale(0.98);
}