[hidden] {
  display: none !important;
}

:root {
  --bg: #061226;
  --bg-2: #0b1730;
  --card: #0f1d3a;
  --card-2: #122449;
  --border: rgba(255,255,255,0.08);
  --text: #f5f7fb;
  --muted: #9fb0cc;
  --primary: #2f6df6;
  --primary-hover: #2459cc;
  --danger: #ef2f2f;
  --danger-hover: #c82626;
  --success: #1dbf73;
  --warning: #f59e0b;
  --focus-red: #ef4444;
  --focus-yellow: #f59e0b;
  --focus-cyan: #22d3ee;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(0,0,0,0.28);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(49, 96, 255, 0.18), transparent 26%),
    linear-gradient(180deg, #05101f 0%, #08162c 100%);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

/* LOGIN */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: rgba(10, 21, 43, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.login-card-modern {
  max-width: 760px;
  background:
    radial-gradient(circle at top right, rgba(47,109,246,0.10), transparent 22%),
    rgba(10, 21, 43, 0.94);
}

.login-brand {
  margin-bottom: 22px;
}

.login-brand-centered {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-brand .logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin-bottom: 14px;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  background: rgba(255,255,255,0.04);
  padding: 6px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: #dbe7ff;
  margin-bottom: 14px;
}

.login-brand h1 {
  margin: 0 0 10px;
  font-size: 40px;
  font-weight: 800;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 620px;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.auth-tabs-single {
  justify-content: center;
}

.auth-tab {
  min-width: 140px;
}

.auth-panel {
  margin-top: 6px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-actions-centered {
  justify-content: center;
}

.auth-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.auth-hint-centered {
  text-align: center;
}

.auth-footer-link {
  color: var(--muted);
  text-decoration: none;
  transition: 0.2s ease;
}

.auth-footer-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.auth-inner-card {
  background: rgba(255,255,255,0.03);
}

.choice-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}

.form-group {
  margin-bottom: 16px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.password-toggle:hover {
  color: #fff;
}

/* APP */
#appView {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 250px;
  min-width: 250px;
  background: rgba(7, 18, 40, 0.92);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-bottom {
  margin-top: 20px;
}

.brand {
  font-size: 24px;
  font-weight: 800;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
}

.nav-btn.active {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
}

.content {
  flex: 1;
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.view.hidden {
  display: none;
}

.card,
.stat,
.item {
  background: rgba(12, 24, 49, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 22px;
}

.item {
  padding: 14px;
  margin-bottom: 12px;
}

.item:last-child {
  margin-bottom: 0;
}

.stat {
  padding: 18px;
}

.number {
  font-size: 34px;
  font-weight: 800;
  margin-top: 10px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.photo-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: block;
}

label {
  display: block;
  margin-bottom: 6px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(5, 14, 30, 0.9);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  font-size: 15px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(47,109,246,0.65);
  box-shadow: 0 0 0 3px rgba(47,109,246,0.14);
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s ease;
}

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

.btn.secondary {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: rgba(255,255,255,0.13);
}

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

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

.btn.full {
  width: 100%;
}

.btn-lg {
  min-width: 190px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.ai-chat-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.ai-reply-box {
  min-height: 260px;
  white-space: pre-wrap;
  line-height: 1.65;
  background: rgba(5, 14, 30, 0.62);
}

.ai-tip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* DASHBOARD CLEAN */
.dashboard-tabbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 0;
}

.dashboard-tab-btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.2s ease;
  font-weight: 700;
}

.dashboard-tab-btn:hover {
  background: rgba(255,255,255,0.09);
}

.dashboard-tab-btn.active {
  background: linear-gradient(90deg, rgba(47,109,246,0.95), rgba(34,211,238,0.88));
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(47,109,246,0.18);
}

.dashboard-panel-shell {
  margin-top: 18px;
}

.dashboard-highlight-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-mini-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.dashboard-mini-stat .label {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-mini-stat .value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
}

.body-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: start;
}

.body-rotator-wrap {
  background:
    radial-gradient(circle at center, rgba(47,109,246,0.10), transparent 45%),
    rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  min-height: 520px;
}

.body-rotator-stage {
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.body-rotator-figure {
  width: 300px;
  max-width: 100%;
  transform-style: preserve-3d;
  animation: fitcoachSpin360 12s linear infinite;
  filter: drop-shadow(0 18px 35px rgba(34,211,238,0.10));
}

.body-rotator-wrap:hover .body-rotator-figure {
  animation-play-state: paused;
}

@keyframes fitcoachSpin360 {
  0% {
    transform: rotateY(0deg) rotateX(0deg);
  }
  50% {
    transform: rotateY(180deg) rotateX(1deg);
  }
  100% {
    transform: rotateY(360deg) rotateX(0deg);
  }
}

.body-legend-line {
  margin-top: 10px;
}

.body-meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  margin-top: 6px;
}

.body-meter-fill {
  height: 10px;
  border-radius: 999px;
}

.body-region-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.body-region-chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 13px;
  font-weight: 700;
}

.body-region-chip.active {
  background: linear-gradient(90deg, rgba(47,109,246,0.95), rgba(34,211,238,0.88));
  border-color: transparent;
}

.body-detail-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-top: 14px;
}

.body-focus-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  font-size: 13px;
}

.body-focus-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 18px currentColor;
}

.body-hint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.body-hint-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.body-glow-red {
  filter: drop-shadow(0 0 16px rgba(239,68,68,0.35));
}

.body-glow-yellow {
  filter: drop-shadow(0 0 16px rgba(245,158,11,0.35));
}

.body-glow-cyan {
  filter: drop-shadow(0 0 16px rgba(34,211,238,0.28));
}

.body-click-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-empty {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  color: var(--muted);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1001;
  border: none;
  border-radius: 12px;
  background: rgba(12, 24, 49, 0.96);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

@media (max-width: 1100px) {
  .grid.four,
  .dashboard-highlight-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.three,
  .grid.two,
  .ai-chat-layout,
  .body-hero-grid,
  .body-hint-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .body-rotator-wrap {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  #appView {
    display: block;
  }

  .mobile-menu-btn {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.25s ease;
  }

  .sidebar.sidebar-open {
    left: 0;
  }

  .content {
    padding: 72px 16px 20px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .topbar-actions .btn {
    width: 100%;
  }

  .grid.four,
  .dashboard-highlight-bar {
    grid-template-columns: 1fr;
  }

  .login-screen {
    padding: 14px;
  }

  .login-card {
    padding: 18px;
    border-radius: 20px;
  }

  .login-brand h1 {
    font-size: 34px;
  }

  .auth-tab,
  .btn-lg {
    width: 100%;
  }

  .dashboard-tab-btn {
    width: 100%;
    text-align: center;
  }

  .body-rotator-figure {
    width: 240px;
  }
}