

/* ---------- SMARTGOAL RESPONSIVE & ROUTINE EXTENSIONS ---------- */
:root { --content-gutter: clamp(14px, 2.6vw, 35px); }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, .nav-link, .icon-button { touch-action: manipulation; }
#content, .content-area, .card, .dashboard-grid > *, .stats-grid > *, .store-grid > * { min-width: 0; }
.main-area { padding-left: var(--content-gutter); padding-right: var(--content-gutter); }
.content-area { width: 100%; }
.routine-card { overflow: hidden; }
.routine-list { display: grid; gap: 0; }
.routine-item { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--border); }
.routine-item time { color: var(--primary); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.routine-item-content { display: grid; gap: 4px; min-width: 0; }
.routine-item-content strong { overflow-wrap: anywhere; }
.routine-item-content small { color: var(--text-muted); line-height: 1.5; overflow-wrap: anywhere; }
.routine-item-actions { display: flex; gap: 5px; }
.routine-ai { display: grid; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.routine-ai > div { display: grid; gap: 4px; }
.routine-ai > div strong { display: flex; align-items: center; gap: 7px; }
.routine-ai > div small { color: var(--text-muted); line-height: 1.5; }
.routine-ai textarea { width: 100%; min-width: 0; resize: vertical; }
.routine-ai .primary-button { justify-self: start; }
.ai-message, .card-description, .goal-item, .task-info { overflow-wrap: anywhere; }
@media (min-width: 1600px) {
  .content-area { max-width: 1600px; }
}
@media (max-width: 1180px) {
  .main-area { padding-left: 22px; padding-right: 22px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .store-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .main-area { margin-left: 0; padding: 0 18px; }
  .sidebar { transform: translateX(-105%); width: min(var(--sidebar-width), 86vw); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 0 999px rgba(15,23,42,.42), 12px 0 40px rgba(15,23,42,.16); }
  .content-area { padding-top: 20px; }
  .topbar { gap: 10px; }
  .topbar-left, .topbar-right { gap: 9px; }
}
@media (max-width: 640px) {
  .main-area { padding-left: 13px; padding-right: 13px; }
  .topbar { min-height: 64px; }
  .page-date { display: none; }
  .topbar-left, .topbar-right { min-width: 0; }
  .content-area { min-height: calc(100vh - 100px); padding: 18px 0 28px; }
  .stats-grid, .store-grid { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .dashboard-grid { gap: 13px; }
  .card { padding: 16px; border-radius: 15px; }
  .card-header { align-items: flex-start; flex-wrap: wrap; }
  .page-heading, .page-header { gap: 10px; flex-wrap: wrap; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .form-field.full-width { grid-column: auto; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: min(88dvh, 760px); border-radius: 18px 18px 12px 12px; }
  .modal-body { overflow-y: auto; overscroll-behavior: contain; }
  .profile-main-card { padding-left: 16px; padding-right: 16px; }
  .profile-meta, .profile-actions { flex-wrap: wrap; }
  .routine-item { grid-template-columns: 58px minmax(0,1fr); gap: 9px; }
  .routine-item-actions { grid-column: 2; justify-self: end; }
  .routine-ai .primary-button { width: 100%; }
  .ai-input-row { gap: 8px; }
  .ai-input-row input { min-width: 0; }
  .app-footer { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .main-area { padding-left: 9px; padding-right: 9px; }
  .card { padding: 13px; }
  .primary-button, .secondary-button { min-height: 43px; padding-left: 13px; padding-right: 13px; }
  .stats-grid { grid-template-columns: minmax(0,1fr); }
  .routine-item { grid-template-columns: 52px minmax(0,1fr); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; }
  .modal { max-height: 94dvh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 640px), (prefers-reduced-motion: reduce) {
  .store-item:hover, .primary-button:hover { transform: none; box-shadow: none; }
}

/* =========================================================
   SMARTGOAL — PREMIUM DESIGN SYSTEM
   Version 2.0
========================================================= */

/* ---------- ROOT ---------- */

:root {
  color-scheme: light;

  --font-main: "DM Sans", sans-serif;
  --font-heading: "Manrope", sans-serif;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f7;

  --text: #172033;
  --text-secondary: #68738a;
  --text-muted: #98a1b3;

  --primary: #6658e8;
  --primary-hover: #5547d5;
  --primary-soft: #eeecff;

  --accent: #16b8a6;
  --accent-soft: #e4f8f4;

  --blue: #4187ee;
  --blue-soft: #eaf2ff;

  --orange: #f39b4a;
  --orange-soft: #fff3e7;

  --red: #e45c70;
  --red-soft: #fff0f2;

  --green: #22a879;
  --green-soft: #e7f8f0;

  --border: #e8ebf2;
  --border-strong: #dce1eb;

  --sidebar-width: 264px;
  --topbar-height: 84px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(26, 36, 60, .04);
  --shadow-md: 0 8px 28px rgba(26, 36, 60, .07);
  --shadow-lg: 0 20px 60px rgba(26, 36, 60, .12);

  --transition: .22s ease;
}

/* ---------- DARK THEME ---------- */

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #111522;
  --surface: #191f2f;
  --surface-2: #202739;
  --surface-3: #293247;

  --text: #f1f3fa;
  --text-secondary: #aab3c6;
  --text-muted: #77839a;

  --primary: #9285ff;
  --primary-hover: #a69cff;
  --primary-soft: #302c50;

  --accent: #35cdb9;
  --accent-soft: #183e3c;

  --blue: #71aaff;
  --blue-soft: #233750;

  --orange: #ffb46e;
  --orange-soft: #463324;

  --red: #ff8091;
  --red-soft: #482b38;

  --green: #55d5a2;
  --green-soft: #1d4038;

  --border: #2d3548;
  --border-strong: #3a455c;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .12);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .18);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .28);
}

/* ---------- THEMES ---------- */

[data-color-theme="ocean"] {
  --primary: #2788cb;
  --primary-hover: #1675b8;
  --primary-soft: #e4f3ff;
}

[data-color-theme="emerald"] {
  --primary: #159b78;
  --primary-hover: #0c8062;
  --primary-soft: #e0f7ef;
}

[data-color-theme="sunset"] {
  --primary: #df7957;
  --primary-hover: #c96443;
  --primary-soft: #fff0e9;
}

[data-color-theme="rose"] {
  --primary: #d65c94;
  --primary-hover: #bc467e;
  --primary-soft: #ffedf5;
}

[data-color-theme="violet"] {
  --primary: #6658e8;
  --primary-hover: #5547d5;
  --primary-soft: #eeecff;
}

/* ---------- RESET ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.55;
  transition: background var(--transition), color var(--transition);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(102, 88, 232, .24);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
}

/* ---------- BRAND ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.brand-large {
  font-size: 27px;
}

.brand-accent {
  color: var(--primary);
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--primary);
  color: white;
  box-shadow: 0 7px 18px rgba(102, 88, 232, .24);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

/* ---------- AUTH SCREEN ---------- */

.auth-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

.auth-layout {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-decoration {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
}

.auth-decoration-one {
  width: 460px;
  height: 460px;
  top: -240px;
  left: -180px;
  background: rgba(102, 88, 232, .08);
}

.auth-decoration-two {
  width: 380px;
  height: 380px;
  right: -180px;
  bottom: -200px;
  background: rgba(22, 184, 166, .08);
}

.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 48px clamp(30px, 6vw, 100px);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 85% 20%, rgba(142, 129, 255, .35), transparent 35%),
    radial-gradient(circle at 10% 85%, rgba(22, 184, 166, .20), transparent 35%),
    linear-gradient(145deg, #171b39, #27245d 60%, #343078);
}

.auth-showcase::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  bottom: -180px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -105px;
  bottom: -105px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.auth-showcase .brand {
  position: relative;
  z-index: 2;
  color: white;
}

.auth-showcase .brand-accent {
  color: #a9a0ff;
}

.auth-showcase .brand-mark {
  background: rgba(255,255,255,.15);
  box-shadow: none;
}

.auth-showcase-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
  margin: 50px 0;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.auth-showcase .eyebrow {
  color: #b9b2ff;
}

.auth-showcase h1 {
  max-width: 550px;
  margin-top: 22px;
  font-family: var(--font-heading);
  font-size: clamp(34px, 4.3vw, 58px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -2.2px;
}

.auth-showcase-content > p {
  max-width: 440px;
  margin-top: 20px;
  color: rgba(255,255,255,.72);
  font-size: 15px;
  line-height: 1.8;
}

.auth-feature-list {
  display: grid;
  gap: 24px;
  margin-top: 52px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  background: rgba(255,255,255,.09);
  color: #c6c0ff;
}

.feature-icon svg {
  width: 21px;
  height: 21px;
}

.auth-feature strong,
.auth-feature span {
  display: block;
}

.auth-feature strong {
  font-size: 14px;
  font-weight: 700;
}

.auth-feature div > span {
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
}

.auth-showcase-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255,255,255,.55);
  font-size: 11px;
}

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 55px 35px;
  background: var(--surface);
}

.auth-form-container {
  width: 100%;
  max-width: 430px;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 35px;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
}

.auth-heading h2 {
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.auth-heading p {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 30px 0;
  padding: 5px;
  border-radius: 13px;
  background: var(--surface-2);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 19px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field > label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.form-field small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 49px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  transition: border var(--transition), box-shadow var(--transition);
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 88, 232, .10);
}

.input-wrap > svg {
  width: 17px;
  height: 17px;
  margin-left: 15px;
  color: var(--text-muted);
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  height: 47px;
  padding: 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.input-wrap input::placeholder {
  color: var(--text-muted);
}

.input-wrap input:focus-visible {
  outline: none;
}

.input-action {
  width: 42px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.input-action svg {
  width: 17px;
  height: 17px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
}

.checkbox-label input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.terms-label {
  margin-top: 1px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow: 0 8px 20px rgba(102, 88, 232, .2);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.auth-submit {
  width: 100%;
  margin-top: 5px;
}

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 27px 0 20px;
  color: var(--text-muted);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 14px;
}

.auth-switch-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-legal {
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}

/* ---------- APP SHELL ---------- */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 25px 17px 17px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s ease, background var(--transition);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 25px;
}

.sidebar-close {
  display: none !important;
}

.sidebar-profile {
  padding: 13px 8px;
  margin-bottom: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.profile-mini {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  text-align: left;
}

.avatar {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.avatar svg {
  width: 45%;
  height: 45%;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 37px;
  height: 37px;
}

.avatar-medium {
  width: 42px;
  height: 42px;
}

.avatar-large {
  width: 90px;
  height: 90px;
}

.profile-mini-info {
  min-width: 0;
  flex: 1;
}

.profile-mini-info strong,
.profile-mini-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-mini-info strong {
  font-size: 12px;
  font-weight: 800;
}

.profile-mini-info small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.profile-chevron {
  width: 15px;
  color: var(--text-muted);
}

.main-navigation {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.nav-section-label {
  display: block;
  padding: 12px 12px 9px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.nav-section-spaced {
  margin-top: 15px;
}

.nav-link {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.nav-link > svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.nav-link.active > svg {
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.notification-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--red);
}

.sidebar-bottom {
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.sidebar-points {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--orange-soft);
}

.points-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(243, 155, 74, .17);
  color: var(--orange);
}

.points-icon svg {
  width: 18px;
}

.sidebar-points small,
.sidebar-points strong {
  display: block;
}

.sidebar-points small {
  color: var(--text-secondary);
  font-size: 10px;
}

.sidebar-points strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.sidebar-logout {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}

.sidebar-logout:hover {
  background: var(--red-soft);
  color: var(--red);
}

.sidebar-logout svg {
  width: 17px;
}

/* ---------- MAIN CONTENT ---------- */

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 35px;
  transition: margin var(--transition);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-date {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.page-heading h1 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.topbar-right {
  gap: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  transition: var(--transition);
}

.icon-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.menu-toggle {
  display: none;
}

.notification-button {
  position: relative;
}

.notification-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
}

.topbar-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.topbar-user:hover {
  background: var(--surface-2);
}

.topbar-user-name {
  max-width: 140px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user > svg {
  width: 14px;
  color: var(--text-muted);
}

.global-search {
  position: sticky;
  z-index: 15;
  top: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.global-search > svg {
  width: 18px;
  color: var(--text-muted);
}

.global-search input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.content-area {
  width: 100%;
  max-width: 1500px;
  min-height: calc(100vh - 145px);
  padding: 29px 0 45px;
  margin: 0 auto;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- CARDS ---------- */

.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.card-description {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.card-action svg {
  width: 14px;
}

/* ---------- PAGE HEADINGS ---------- */

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.section-heading p {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.section-label {
  display: block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* ---------- DASHBOARD ---------- */

.welcome-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  min-height: 190px;
  padding: 30px 34px;
  margin-bottom: 23px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(110deg, #5145cf, #7969ef 70%, #9182fa);
  color: white;
}

.welcome-banner::before,
.welcome-banner::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-banner::before {
  width: 290px;
  height: 290px;
  right: 8%;
  top: -180px;
}

.welcome-banner::after {
  width: 210px;
  height: 210px;
  right: 2%;
  bottom: -160px;
}

.welcome-content {
  position: relative;
  z-index: 2;
  max-width: 590px;
}

.welcome-content .eyebrow {
  color: rgba(255,255,255,.7);
}

.welcome-content h2 {
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -.8px;
}

.welcome-content p {
  max-width: 490px;
  margin-top: 8px;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.7;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 19px;
}

.welcome-banner .primary-button {
  background: white;
  color: #5145cf;
}

.welcome-banner .primary-button:hover {
  background: #f2f0ff;
}

.welcome-visual {
  position: relative;
  z-index: 2;
  width: 145px;
  height: 145px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 34px;
  background: rgba(255,255,255,.11);
  transform: rotate(8deg);
}

.welcome-visual svg {
  width: 75px;
  height: 75px;
  color: white;
  stroke-width: 1.4;
  transform: rotate(-8deg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.stat-icon.purple {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.stat-icon.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.stat-label {
  margin-top: 17px;
  color: var(--text-secondary);
  font-size: 11px;
}

.stat-value {
  margin-top: 3px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.stat-change svg {
  width: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr);
  gap: 20px;
}

.dashboard-column {
  display: grid;
  align-content: start;
  gap: 20px;
}

/* ---------- PROGRESS ---------- */

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 30px;
  background: var(--surface-3);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .5s ease;
}

.progress-fill.green {
  background: var(--green);
}

.progress-fill.orange {
  background: var(--orange);
}

.progress-fill.blue {
  background: var(--blue);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.progress-row span {
  color: var(--text-secondary);
  font-size: 11px;
}

.progress-row strong {
  font-size: 11px;
}

/* ---------- TASKS ---------- */

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: var(--transition);
}

.task-item:hover {
  background: var(--surface-2);
}

.task-checkbox {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.task-info {
  min-width: 0;
  flex: 1;
}

.task-info strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.task-completed .task-info strong {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.task-reward svg {
  width: 12px;
  height: 12px;
}

/* ---------- GOALS ---------- */

.goal-list {
  display: grid;
  gap: 14px;
}

.goal-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.goal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 13px;
}

.goal-item-header strong {
  font-size: 12px;
  font-weight: 800;
}

.goal-item-header small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.goal-percentage {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.goal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- CHARTS ---------- */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 210px;
}

.chart-container svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-main);
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#chartGradient);
  opacity: .2;
}

.chart-point {
  fill: var(--primary);
  stroke: var(--surface);
  stroke-width: 3;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 17px;
  margin-top: 15px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 10px;
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* ---------- PROFILE ---------- */

.profile-cover {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.2), transparent 25%),
    linear-gradient(120deg, #5145cf, #9282f6);
}

.profile-cover::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -150px;
  right: 15%;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
}

.profile-main-card {
  position: relative;
  padding: 0 25px 25px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.profile-avatar-wrap {
  position: relative;
  width: fit-content;
  margin-top: -48px;
}

.profile-avatar-wrap .avatar {
  width: 100px;
  height: 100px;
  border: 5px solid var(--surface);
  background: var(--primary-soft);
}

.profile-edit-avatar {
  position: absolute;
  right: 3px;
  bottom: 4px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  color: white;
}

.profile-edit-avatar svg {
  width: 14px;
}

.profile-name {
  margin-top: 13px;
  font-family: var(--font-heading);
  font-size: 23px;
  font-weight: 800;
}

.profile-username {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.profile-bio {
  max-width: 600px;
  margin-top: 13px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 10px;
}

.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-meta svg {
  width: 14px;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  transition: var(--transition);
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.secondary-button svg {
  width: 15px;
}

.level-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.level-number {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 35px;
  font-weight: 800;
}

.level-title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}

.level-description {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.7;
}

/* ---------- BADGES AND ACHIEVEMENTS ---------- */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 13px;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 145px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  text-align: center;
}

.achievement-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.achievement-icon svg {
  width: 23px;
  height: 23px;
}

.achievement-card strong {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 800;
}

.achievement-card small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.achievement-card.locked {
  opacity: .5;
  filter: grayscale(.7);
}

/* ---------- STORE ---------- */

.store-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.store-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.store-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.store-preview {
  position: relative;
  min-height: 135px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
}

.store-preview svg {
  width: 47px;
  height: 47px;
  color: var(--primary);
  stroke-width: 1.5;
}

.store-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-content {
  padding: 15px;
}

.store-content h3 {
  font-size: 12px;
  font-weight: 800;
}

.store-content p {
  min-height: 32px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
}

.store-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
}

.store-price strong {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

/* ---------- COMMUNITY ---------- */

.user-list {
  display: grid;
  gap: 11px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.user-item-info {
  flex: 1;
  min-width: 0;
}

.user-item-info strong {
  display: block;
  font-size: 12px;
}

.user-item-info small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.user-rank {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

/* ---------- FORMS ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  transition: var(--transition);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 88, 232, .1);
}

.field-textarea {
  min-height: 100px;
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- SETTINGS ---------- */

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.settings-nav button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
}

.settings-nav button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.settings-nav button svg {
  width: 16px;
}

.settings-panel {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.settings-section + .settings-section {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 800;
}

.settings-section > p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-info {
  min-width: 0;
}

.setting-info strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.setting-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.toggle {
  position: relative;
  width: 43px;
  height: 24px;
  flex-shrink: 0;
  border: 0;
  border-radius: 30px;
  background: var(--surface-3);
  transition: background var(--transition);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform var(--transition);
}

.toggle.active {
  background: var(--primary);
}

.toggle.active::after {
  transform: translateX(19px);
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
}

.theme-option {
  width: 39px;
  height: 39px;
  border: 3px solid var(--surface);
  border-radius: 12px;
  outline: 1px solid var(--border-strong);
  cursor: pointer;
}

.theme-option.active {
  outline: 2px solid var(--primary);
}

.theme-option[data-color-theme="violet"] {
  background: #6658e8;
}

.theme-option[data-color-theme="ocean"] {
  background: #2788cb;
}

.theme-option[data-color-theme="emerald"] {
  background: #159b78;
}

.theme-option[data-color-theme="sunset"] {
  background: #df7957;
}

.theme-option[data-color-theme="rose"] {
  background: #d65c94;
}

/* ---------- MODAL ---------- */

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 18, 35, .58);
  backdrop-filter: blur(5px);
  animation: fadeIn .2s ease;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(85vh, 750px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 23px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin-top: 4px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
}

.modal-body {
  overflow-y: auto;
  padding: 23px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 23px;
  border-top: 1px solid var(--border);
}

/* ---------- TOAST ---------- */

.toast-container {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  width: min(370px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}

.toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.toast-icon svg {
  width: 18px;
}

.toast-message {
  flex: 1;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.toast-close {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.toast-close svg {
  width: 15px;
}

/* ---------- EMPTY AND LOADING STATES ---------- */

.empty-state,
.loading-state {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-state-icon svg {
  width: 25px;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 800;
}

.empty-state p,
.loading-state p {
  max-width: 330px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.7;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- AI SECTION ---------- */

.ai-panel {
  position: relative;
  padding: 27px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 25%),
    linear-gradient(120deg, #26254f, #5145cf);
  color: white;
}

.ai-panel h2 {
  max-width: 600px;
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
}

.ai-panel p {
  max-width: 550px;
  margin-top: 9px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.8;
}

.ai-chat {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.ai-message {
  max-width: 85%;
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.ai-message.user {
  justify-self: end;
  background: var(--primary-soft);
  color: var(--primary);
}

.ai-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.ai-input-row input {
  flex: 1;
  min-width: 0;
  height: 37px;
  padding: 0 10px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

/* ---------- NOTIFICATIONS ---------- */

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.notification-item.unread {
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
}

.notification-item > div:last-child {
  flex: 1;
}

.notification-item strong {
  display: block;
  font-size: 12px;
}

.notification-item p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.notification-item small {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 9px;
}

/* ---------- CALENDAR ---------- */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.calendar-day {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
}

.calendar-day.today {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.calendar-day small {
  font-size: 9px;
}

/* ---------- ANIMATIONS ---------- */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- RESPONSIVE: TABLET ---------- */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 235px;
  }

  .main-area {
    padding: 0 25px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, .9fr);
  }

  .auth-showcase {
    padding: 40px;
  }
}

/* ---------- RESPONSIVE: SMALL TABLET ---------- */

@media (max-width: 850px) {
  .sidebar {
    z-index: 80;
    transform: translateX(-105%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid !important;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: none;
    background: rgba(10, 15, 30, .45);
    backdrop-filter: blur(2px);
  }

  .sidebar.open ~ .sidebar-backdrop {
    display: block;
  }

  .main-area {
    margin-left: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: .8fr 1fr;
  }

  .auth-showcase {
    padding: 35px 28px;
  }

  .auth-showcase h1 {
    font-size: 36px;
  }

  .auth-feature-list {
    gap: 18px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-nav button {
    justify-content: center;
    padding: 7px;
    font-size: 10px;
  }
}

/* ---------- RESPONSIVE: MOBILE ---------- */

@media (max-width: 600px) {
  body {
    font-size: 13px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    display: none;
  }

  .auth-form-side {
    min-height: 100vh;
    align-items: flex-start;
    padding: 35px 22px;
  }

  .auth-form-container {
    max-width: 450px;
    margin: auto;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-heading h2 {
    font-size: 25px;
  }

  .auth-tabs {
    margin: 24px 0;
  }

  .auth-legal {
    margin-top: 28px;
  }

  .main-area {
    padding: 0 15px;
  }

  .topbar {
    min-height: 70px;
    gap: 8px;
  }

  .topbar-left {
    gap: 9px;
  }

  .topbar-right {
    gap: 7px;
  }

  .page-heading h1 {
    font-size: 16px;
  }

  .page-date {
    font-size: 9px;
  }

  .topbar-user-name,
  .topbar-user > svg,
  .topbar-divider {
    display: none;
  }

  .topbar-user {
    padding: 0;
  }

  .icon-button {
    width: 35px;
    height: 35px;
  }

  .content-area {
    min-height: calc(100vh - 130px);
    padding-top: 20px;
  }

  .welcome-banner {
    min-height: 0;
    padding: 23px;
    border-radius: 19px;
  }

  .welcome-content h2 {
    font-size: 23px;
  }

  .welcome-content p {
    font-size: 11px;
  }

  .welcome-visual {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 10px;
  }

  .card {
    padding: 17px;
    border-radius: 16px;
  }

  .section-heading h2 {
    font-size: 18px;
  }

  .section-heading p {
    font-size: 10px;
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .store-preview {
    min-height: 100px;
  }

  .store-content {
    padding: 11px;
  }

  .store-content h3 {
    font-size: 11px;
  }

  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-cover {
    min-height: 125px;
  }

  .profile-main-card {
    padding: 0 17px 19px;
  }

  .profile-name {
    font-size: 20px;
  }

  .profile-avatar-wrap .avatar {
    width: 83px;
    height: 83px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full-width {
    grid-column: auto;
  }

  .settings-panel {
    padding: 16px;
  }

  .settings-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-nav button {
    justify-content: flex-start;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 52px;
    border-radius: 8px;
    font-size: 10px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 17px;
    padding-right: 17px;
  }

  .app-footer {
    font-size: 9px;
  }
}

/* ---------- VERY SMALL SCREENS ---------- */

@media (max-width: 370px) {
  .main-area {
    padding: 0 11px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 11px;
  }

  .stat-value {
    font-size: 19px;
  }

  .welcome-banner {
    padding: 18px;
  }

  .welcome-content h2 {
    font-size: 20px;
  }

  .topbar-right {
    gap: 5px;
  }
}/* =========================================================
   SMARTGOAL — PREMIUM DESIGN SYSTEM
   Version 2.0
========================================================= */

/* ---------- ROOT ---------- */

:root {
  color-scheme: light;

  --font-main: "DM Sans", sans-serif;
  --font-heading: "Manrope", sans-serif;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f7;

  --text: #172033;
  --text-secondary: #68738a;
  --text-muted: #98a1b3;

  --primary: #6658e8;
  --primary-hover: #5547d5;
  --primary-soft: #eeecff;

  --accent: #16b8a6;
  --accent-soft: #e4f8f4;

  --blue: #4187ee;
  --blue-soft: #eaf2ff;

  --orange: #f39b4a;
  --orange-soft: #fff3e7;

  --red: #e45c70;
  --red-soft: #fff0f2;

  --green: #22a879;
  --green-soft: #e7f8f0;

  --border: #e8ebf2;
  --border-strong: #dce1eb;

  --sidebar-width: 264px;
  --topbar-height: 84px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(26, 36, 60, .04);
  --shadow-md: 0 8px 28px rgba(26, 36, 60, .07);
  --shadow-lg: 0 20px 60px rgba(26, 36, 60, .12);

  --transition: .22s ease;
}

/* ---------- DARK THEME ---------- */

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #111522;
  --surface: #191f2f;
  --surface-2: #202739;
  --surface-3: #293247;

  --text: #f1f3fa;
  --text-secondary: #aab3c6;
  --text-muted: #77839a;

  --primary: #9285ff;
  --primary-hover: #a69cff;
  --primary-soft: #302c50;

  --accent: #35cdb9;
  --accent-soft: #183e3c;

  --blue: #71aaff;
  --blue-soft: #233750;

  --orange: #ffb46e;
  --orange-soft: #463324;

  --red: #ff8091;
  --red-soft: #482b38;

  --green: #55d5a2;
  --green-soft: #1d4038;

  --border: #2d3548;
  --border-strong: #3a455c;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .12);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .18);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .28);
}

/* ---------- THEMES ---------- */

[data-color-theme="ocean"] {
  --primary: #2788cb;
  --primary-hover: #1675b8;
  --primary-soft: #e4f3ff;
}

[data-color-theme="emerald"] {
  --primary: #159b78;
  --primary-hover: #0c8062;
  --primary-soft: #e0f7ef;
}

[data-color-theme="sunset"] {
  --primary: #df7957;
  --primary-hover: #c96443;
  --primary-soft: #fff0e9;
}

[data-color-theme="rose"] {
  --primary: #d65c94;
  --primary-hover: #bc467e;
  --primary-soft: #ffedf5;
}

[data-color-theme="violet"] {
  --primary: #6658e8;
  --primary-hover: #5547d5;
  --primary-soft: #eeecff;
}

/* ---------- RESET ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.55;
  transition: background var(--transition), color var(--transition);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(102, 88, 232, .24);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
}

/* ---------- BRAND ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.brand-large {
  font-size: 27px;
}

.brand-accent {
  color: var(--primary);
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--primary);
  color: white;
  box-shadow: 0 7px 18px rgba(102, 88, 232, .24);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

/* ---------- AUTH SCREEN ---------- */

.auth-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

.auth-layout {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-decoration {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
}

.auth-decoration-one {
  width: 460px;
  height: 460px;
  top: -240px;
  left: -180px;
  background: rgba(102, 88, 232, .08);
}

.auth-decoration-two {
  width: 380px;
  height: 380px;
  right: -180px;
  bottom: -200px;
  background: rgba(22, 184, 166, .08);
}

.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 48px clamp(30px, 6vw, 100px);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 85% 20%, rgba(142, 129, 255, .35), transparent 35%),
    radial-gradient(circle at 10% 85%, rgba(22, 184, 166, .20), transparent 35%),
    linear-gradient(145deg, #171b39, #27245d 60%, #343078);
}

.auth-showcase::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  bottom: -180px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -105px;
  bottom: -105px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.auth-showcase .brand {
  position: relative;
  z-index: 2;
  color: white;
}

.auth-showcase .brand-accent {
  color: #a9a0ff;
}

.auth-showcase .brand-mark {
  background: rgba(255,255,255,.15);
  box-shadow: none;
}

.auth-showcase-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
  margin: 50px 0;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.auth-showcase .eyebrow {
  color: #b9b2ff;
}

.auth-showcase h1 {
  max-width: 550px;
  margin-top: 22px;
  font-family: var(--font-heading);
  font-size: clamp(34px, 4.3vw, 58px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -2.2px;
}

.auth-showcase-content > p {
  max-width: 440px;
  margin-top: 20px;
  color: rgba(255,255,255,.72);
  font-size: 15px;
  line-height: 1.8;
}

.auth-feature-list {
  display: grid;
  gap: 24px;
  margin-top: 52px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  background: rgba(255,255,255,.09);
  color: #c6c0ff;
}

.feature-icon svg {
  width: 21px;
  height: 21px;
}

.auth-feature strong,
.auth-feature span {
  display: block;
}

.auth-feature strong {
  font-size: 14px;
  font-weight: 700;
}

.auth-feature div > span {
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
}

.auth-showcase-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255,255,255,.55);
  font-size: 11px;
}

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 55px 35px;
  background: var(--surface);
}

.auth-form-container {
  width: 100%;
  max-width: 430px;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 35px;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
}

.auth-heading h2 {
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.auth-heading p {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 30px 0;
  padding: 5px;
  border-radius: 13px;
  background: var(--surface-2);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 19px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field > label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.form-field small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 49px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  transition: border var(--transition), box-shadow var(--transition);
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 88, 232, .10);
}

.input-wrap > svg {
  width: 17px;
  height: 17px;
  margin-left: 15px;
  color: var(--text-muted);
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  height: 47px;
  padding: 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.input-wrap input::placeholder {
  color: var(--text-muted);
}

.input-wrap input:focus-visible {
  outline: none;
}

.input-action {
  width: 42px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.input-action svg {
  width: 17px;
  height: 17px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
}

.checkbox-label input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.terms-label {
  margin-top: 1px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow: 0 8px 20px rgba(102, 88, 232, .2);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.auth-submit {
  width: 100%;
  margin-top: 5px;
}

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 27px 0 20px;
  color: var(--text-muted);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 14px;
}

.auth-switch-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-legal {
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}

/* ---------- APP SHELL ---------- */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 25px 17px 17px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s ease, background var(--transition);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 25px;
}

.sidebar-close {
  display: none !important;
}

.sidebar-profile {
  padding: 13px 8px;
  margin-bottom: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.profile-mini {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  text-align: left;
}

.avatar {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.avatar svg {
  width: 45%;
  height: 45%;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 37px;
  height: 37px;
}

.avatar-medium {
  width: 42px;
  height: 42px;
}

.avatar-large {
  width: 90px;
  height: 90px;
}

.profile-mini-info {
  min-width: 0;
  flex: 1;
}

.profile-mini-info strong,
.profile-mini-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-mini-info strong {
  font-size: 12px;
  font-weight: 800;
}

.profile-mini-info small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.profile-chevron {
  width: 15px;
  color: var(--text-muted);
}

.main-navigation {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.nav-section-label {
  display: block;
  padding: 12px 12px 9px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.nav-section-spaced {
  margin-top: 15px;
}

.nav-link {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.nav-link > svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.nav-link.active > svg {
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.notification-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--red);
}

.sidebar-bottom {
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.sidebar-points {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--orange-soft);
}

.points-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(243, 155, 74, .17);
  color: var(--orange);
}

.points-icon svg {
  width: 18px;
}

.sidebar-points small,
.sidebar-points strong {
  display: block;
}

.sidebar-points small {
  color: var(--text-secondary);
  font-size: 10px;
}

.sidebar-points strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.sidebar-logout {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}

.sidebar-logout:hover {
  background: var(--red-soft);
  color: var(--red);
}

.sidebar-logout svg {
  width: 17px;
}

/* ---------- MAIN CONTENT ---------- */

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 35px;
  transition: margin var(--transition);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-date {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.page-heading h1 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.topbar-right {
  gap: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  transition: var(--transition);
}

.icon-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.menu-toggle {
  display: none;
}

.notification-button {
  position: relative;
}

.notification-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
}

.topbar-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.topbar-user:hover {
  background: var(--surface-2);
}

.topbar-user-name {
  max-width: 140px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user > svg {
  width: 14px;
  color: var(--text-muted);
}

.global-search {
  position: sticky;
  z-index: 15;
  top: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.global-search > svg {
  width: 18px;
  color: var(--text-muted);
}

.global-search input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.content-area {
  width: 100%;
  max-width: 1500px;
  min-height: calc(100vh - 145px);
  padding: 29px 0 45px;
  margin: 0 auto;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- CARDS ---------- */

.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.card-description {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.card-action svg {
  width: 14px;
}

/* ---------- PAGE HEADINGS ---------- */

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.section-heading p {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.section-label {
  display: block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* ---------- DASHBOARD ---------- */

.welcome-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  min-height: 190px;
  padding: 30px 34px;
  margin-bottom: 23px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(110deg, #5145cf, #7969ef 70%, #9182fa);
  color: white;
}

.welcome-banner::before,
.welcome-banner::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-banner::before {
  width: 290px;
  height: 290px;
  right: 8%;
  top: -180px;
}

.welcome-banner::after {
  width: 210px;
  height: 210px;
  right: 2%;
  bottom: -160px;
}

.welcome-content {
  position: relative;
  z-index: 2;
  max-width: 590px;
}

.welcome-content .eyebrow {
  color: rgba(255,255,255,.7);
}

.welcome-content h2 {
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -.8px;
}

.welcome-content p {
  max-width: 490px;
  margin-top: 8px;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.7;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 19px;
}

.welcome-banner .primary-button {
  background: white;
  color: #5145cf;
}

.welcome-banner .primary-button:hover {
  background: #f2f0ff;
}

.welcome-visual {
  position: relative;
  z-index: 2;
  width: 145px;
  height: 145px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 34px;
  background: rgba(255,255,255,.11);
  transform: rotate(8deg);
}

.welcome-visual svg {
  width: 75px;
  height: 75px;
  color: white;
  stroke-width: 1.4;
  transform: rotate(-8deg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.stat-icon.purple {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.stat-icon.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.stat-label {
  margin-top: 17px;
  color: var(--text-secondary);
  font-size: 11px;
}

.stat-value {
  margin-top: 3px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.stat-change svg {
  width: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr);
  gap: 20px;
}

.dashboard-column {
  display: grid;
  align-content: start;
  gap: 20px;
}

/* ---------- PROGRESS ---------- */

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 30px;
  background: var(--surface-3);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .5s ease;
}

.progress-fill.green {
  background: var(--green);
}

.progress-fill.orange {
  background: var(--orange);
}

.progress-fill.blue {
  background: var(--blue);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.progress-row span {
  color: var(--text-secondary);
  font-size: 11px;
}

.progress-row strong {
  font-size: 11px;
}

/* ---------- TASKS ---------- */

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: var(--transition);
}

.task-item:hover {
  background: var(--surface-2);
}

.task-checkbox {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.task-info {
  min-width: 0;
  flex: 1;
}

.task-info strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.task-completed .task-info strong {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.task-reward svg {
  width: 12px;
  height: 12px;
}

/* ---------- GOALS ---------- */

.goal-list {
  display: grid;
  gap: 14px;
}

.goal-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.goal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 13px;
}

.goal-item-header strong {
  font-size: 12px;
  font-weight: 800;
}

.goal-item-header small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.goal-percentage {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.goal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- CHARTS ---------- */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 210px;
}

.chart-container svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-main);
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#chartGradient);
  opacity: .2;
}

.chart-point {
  fill: var(--primary);
  stroke: var(--surface);
  stroke-width: 3;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 17px;
  margin-top: 15px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 10px;
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* ---------- PROFILE ---------- */

.profile-cover {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.2), transparent 25%),
    linear-gradient(120deg, #5145cf, #9282f6);
}

.profile-cover::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -150px;
  right: 15%;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
}

.profile-main-card {
  position: relative;
  padding: 0 25px 25px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.profile-avatar-wrap {
  position: relative;
  width: fit-content;
  margin-top: -48px;
}

.profile-avatar-wrap .avatar {
  width: 100px;
  height: 100px;
  border: 5px solid var(--surface);
  background: var(--primary-soft);
}

.profile-edit-avatar {
  position: absolute;
  right: 3px;
  bottom: 4px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  color: white;
}

.profile-edit-avatar svg {
  width: 14px;
}

.profile-name {
  margin-top: 13px;
  font-family: var(--font-heading);
  font-size: 23px;
  font-weight: 800;
}

.profile-username {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.profile-bio {
  max-width: 600px;
  margin-top: 13px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 10px;
}

.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-meta svg {
  width: 14px;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  transition: var(--transition);
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.secondary-button svg {
  width: 15px;
}

.level-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.level-number {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 35px;
  font-weight: 800;
}

.level-title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}

.level-description {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.7;
}

/* ---------- BADGES AND ACHIEVEMENTS ---------- */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 13px;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 145px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  text-align: center;
}

.achievement-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.achievement-icon svg {
  width: 23px;
  height: 23px;
}

.achievement-card strong {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 800;
}

.achievement-card small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.achievement-card.locked {
  opacity: .5;
  filter: grayscale(.7);
}

/* ---------- STORE ---------- */

.store-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.store-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.store-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.store-preview {
  position: relative;
  min-height: 135px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
}

.store-preview svg {
  width: 47px;
  height: 47px;
  color: var(--primary);
  stroke-width: 1.5;
}

.store-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-content {
  padding: 15px;
}

.store-content h3 {
  font-size: 12px;
  font-weight: 800;
}

.store-content p {
  min-height: 32px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
}

.store-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
}

.store-price strong {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

/* ---------- COMMUNITY ---------- */

.user-list {
  display: grid;
  gap: 11px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.user-item-info {
  flex: 1;
  min-width: 0;
}

.user-item-info strong {
  display: block;
  font-size: 12px;
}

.user-item-info small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.user-rank {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

/* ---------- FORMS ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  transition: var(--transition);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 88, 232, .1);
}

.field-textarea {
  min-height: 100px;
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- SETTINGS ---------- */

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.settings-nav button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
}

.settings-nav button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.settings-nav button svg {
  width: 16px;
}

.settings-panel {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.settings-section + .settings-section {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 800;
}

.settings-section > p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-info {
  min-width: 0;
}

.setting-info strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.setting-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.toggle {
  position: relative;
  width: 43px;
  height: 24px;
  flex-shrink: 0;
  border: 0;
  border-radius: 30px;
  background: var(--surface-3);
  transition: background var(--transition);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform var(--transition);
}

.toggle.active {
  background: var(--primary);
}

.toggle.active::after {
  transform: translateX(19px);
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
}

.theme-option {
  width: 39px;
  height: 39px;
  border: 3px solid var(--surface);
  border-radius: 12px;
  outline: 1px solid var(--border-strong);
  cursor: pointer;
}

.theme-option.active {
  outline: 2px solid var(--primary);
}

.theme-option[data-color-theme="violet"] {
  background: #6658e8;
}

.theme-option[data-color-theme="ocean"] {
  background: #2788cb;
}

.theme-option[data-color-theme="emerald"] {
  background: #159b78;
}

.theme-option[data-color-theme="sunset"] {
  background: #df7957;
}

.theme-option[data-color-theme="rose"] {
  background: #d65c94;
}

/* ---------- MODAL ---------- */

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 18, 35, .58);
  backdrop-filter: blur(5px);
  animation: fadeIn .2s ease;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(85vh, 750px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 23px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin-top: 4px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
}

.modal-body {
  overflow-y: auto;
  padding: 23px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 23px;
  border-top: 1px solid var(--border);
}

/* ---------- TOAST ---------- */

.toast-container {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  width: min(370px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}

.toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.toast-icon svg {
  width: 18px;
}

.toast-message {
  flex: 1;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.toast-close {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.toast-close svg {
  width: 15px;
}

/* ---------- EMPTY AND LOADING STATES ---------- */

.empty-state,
.loading-state {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-state-icon svg {
  width: 25px;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 800;
}

.empty-state p,
.loading-state p {
  max-width: 330px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.7;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- AI SECTION ---------- */

.ai-panel {
  position: relative;
  padding: 27px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 25%),
    linear-gradient(120deg, #26254f, #5145cf);
  color: white;
}

.ai-panel h2 {
  max-width: 600px;
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
}

.ai-panel p {
  max-width: 550px;
  margin-top: 9px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.8;
}

.ai-chat {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.ai-message {
  max-width: 85%;
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.ai-message.user {
  justify-self: end;
  background: var(--primary-soft);
  color: var(--primary);
}

.ai-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.ai-input-row input {
  flex: 1;
  min-width: 0;
  height: 37px;
  padding: 0 10px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

/* ---------- NOTIFICATIONS ---------- */

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.notification-item.unread {
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
}

.notification-item > div:last-child {
  flex: 1;
}

.notification-item strong {
  display: block;
  font-size: 12px;
}

.notification-item p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.notification-item small {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 9px;
}

/* ---------- CALENDAR ---------- */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.calendar-day {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
}

.calendar-day.today {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.calendar-day small {
  font-size: 9px;
}

/* ---------- ANIMATIONS ---------- */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- RESPONSIVE: TABLET ---------- */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 235px;
  }

  .main-area {
    padding: 0 25px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, .9fr);
  }

  .auth-showcase {
    padding: 40px;
  }
}

/* ---------- RESPONSIVE: SMALL TABLET ---------- */

@media (max-width: 850px) {
  .sidebar {
    z-index: 80;
    transform: translateX(-105%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid !important;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: none;
    background: rgba(10, 15, 30, .45);
    backdrop-filter: blur(2px);
  }

  .sidebar.open ~ .sidebar-backdrop {
    display: block;
  }

  .main-area {
    margin-left: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: .8fr 1fr;
  }

  .auth-showcase {
    padding: 35px 28px;
  }

  .auth-showcase h1 {
    font-size: 36px;
  }

  .auth-feature-list {
    gap: 18px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-nav button {
    justify-content: center;
    padding: 7px;
    font-size: 10px;
  }
}

/* ---------- RESPONSIVE: MOBILE ---------- */

@media (max-width: 600px) {
  body {
    font-size: 13px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    display: none;
  }

  .auth-form-side {
    min-height: 100vh;
    align-items: flex-start;
    padding: 35px 22px;
  }

  .auth-form-container {
    max-width: 450px;
    margin: auto;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-heading h2 {
    font-size: 25px;
  }

  .auth-tabs {
    margin: 24px 0;
  }

  .auth-legal {
    margin-top: 28px;
  }

  .main-area {
    padding: 0 15px;
  }

  .topbar {
    min-height: 70px;
    gap: 8px;
  }

  .topbar-left {
    gap: 9px;
  }

  .topbar-right {
    gap: 7px;
  }

  .page-heading h1 {
    font-size: 16px;
  }

  .page-date {
    font-size: 9px;
  }

  .topbar-user-name,
  .topbar-user > svg,
  .topbar-divider {
    display: none;
  }

  .topbar-user {
    padding: 0;
  }

  .icon-button {
    width: 35px;
    height: 35px;
  }

  .content-area {
    min-height: calc(100vh - 130px);
    padding-top: 20px;
  }

  .welcome-banner {
    min-height: 0;
    padding: 23px;
    border-radius: 19px;
  }

  .welcome-content h2 {
    font-size: 23px;
  }

  .welcome-content p {
    font-size: 11px;
  }

  .welcome-visual {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 10px;
  }

  .card {
    padding: 17px;
    border-radius: 16px;
  }

  .section-heading h2 {
    font-size: 18px;
  }

  .section-heading p {
    font-size: 10px;
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .store-preview {
    min-height: 100px;
  }

  .store-content {
    padding: 11px;
  }

  .store-content h3 {
    font-size: 11px;
  }

  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-cover {
    min-height: 125px;
  }

  .profile-main-card {
    padding: 0 17px 19px;
  }

  .profile-name {
    font-size: 20px;
  }

  .profile-avatar-wrap .avatar {
    width: 83px;
    height: 83px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full-width {
    grid-column: auto;
  }

  .settings-panel {
    padding: 16px;
  }

  .settings-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-nav button {
    justify-content: flex-start;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 52px;
    border-radius: 8px;
    font-size: 10px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 17px;
    padding-right: 17px;
  }

  .app-footer {
    font-size: 9px;
  }
}

/* ---------- VERY SMALL SCREENS ---------- */

@media (max-width: 370px) {
  .main-area {
    padding: 0 11px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 11px;
  }

  .stat-value {
    font-size: 19px;
  }

  .welcome-banner {
    padding: 18px;
  }

  .welcome-content h2 {
    font-size: 20px;
  }

  .topbar-right {
    gap: 5px;
  }
}
.memory-image { display:block; width:min(100%,360px); max-height:260px; object-fit:cover; margin:10px 0; border-radius:12px; border:1px solid var(--border); }
.store-categories { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
.store-category { min-height:38px; padding:0 14px; border:1px solid var(--border); border-radius:999px; background:var(--surface); color:var(--text-secondary); font-size:12px; font-weight:700; }
.store-category.active { border-color:var(--primary); background:var(--primary); color:#fff; }
.user-profile-link { display:block; padding:0; border:0; background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.user-profile-link:hover strong { color:var(--primary); text-decoration:underline; }
.public-profile-cover { height:110px; margin:-22px -22px 0; border-radius:16px 16px 0 0; }
.public-profile-body { position:relative; padding:0 4px 8px; text-align:center; }
.public-profile-avatar { width:84px; height:84px; display:grid; place-items:center; overflow:hidden; margin:-42px auto 10px; border:4px solid var(--surface); border-radius:50%; background:var(--surface-2); }
.public-profile-avatar img { width:100%; height:100%; object-fit:cover; }
.public-profile-body h2 { margin:5px 0; }
.public-profile-stats { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:18px 0; }
.public-profile-stats > div { display:grid; gap:4px; padding:12px 5px; border:1px solid var(--border); border-radius:12px; }
.public-profile-stats strong { font-size:19px; }
.public-profile-stats small { color:var(--text-muted); font-size:10px; }
.profile-public-stat { display:flex; justify-content:center; gap:7px; align-items:center; color:var(--text-secondary); font-size:12px; }
.avatar-frame-premium { outline:3px solid #a78bfa; outline-offset:2px; }
.avatar-frame-gold { outline:3px solid #d6a83e; outline-offset:2px; box-shadow:0 0 0 5px rgba(214,168,62,.18); }
@media(max-width:900px) { .public-profile-stats { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:520px) { .public-profile-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } .public-profile-cover { margin-left:-16px; margin-right:-16px; } }

.ai-context-pills { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.ai-context-pills span { display:inline-flex; align-items:center; gap:6px; padding:7px 10px; border:1px solid rgba(255,255,255,.22); border-radius:999px; color:inherit; font-size:11px; }
.ai-quick-prompts { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 16px; }
.ai-quick-prompts button { padding:8px 11px; border:1px solid var(--border); border-radius:999px; background:var(--surface-2); color:var(--text-secondary); font-size:11px; font-weight:700; }
.ai-quick-prompts button:hover { border-color:var(--primary); color:var(--primary); }
.goal-progress-detail { display:flex; justify-content:space-between; gap:10px; margin-top:8px; color:var(--text-muted); font-size:11px; line-height:1.5; }
.goal-progress-analytics { display:grid; gap:8px; padding:14px 0; border-top:1px solid var(--border); }
.task-load-more { display:flex; margin:18px auto 0; }
.task-extra-settings { padding:12px; border:1px solid var(--border); border-radius:12px; }
.task-extra-settings summary { color:var(--primary); font-size:12px; font-weight:700; cursor:pointer; }
.task-extra-settings[open] summary { margin-bottom:12px; }
.profile-loading { padding:30px 12px; text-align:center; color:var(--text-muted); }
@media(max-width:640px) { .goal-progress-detail { flex-direction:column; gap:3px; } .ai-quick-prompts { gap:6px; } .ai-quick-prompts button { max-width:100%; } }

html[data-font-size="small"] { zoom: .96; }
html[data-font-size="large"] { zoom: 1.06; }
@supports not (zoom: 1) {
  html[data-font-size="small"] { font-size: 15px; }
  html[data-font-size="large"] { font-size: 18px; }
}
@supports(padding: env(safe-area-inset-left)) {
  .main-area { padding-left: max(var(--content-gutter), env(safe-area-inset-left)); padding-right: max(var(--content-gutter), env(safe-area-inset-right)); }
  .modal-overlay { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

.daily-coach-card { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:15px; margin:18px 0 20px; }
.daily-coach-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; background:var(--primary-soft); color:var(--primary); }
.daily-coach-card h3 { margin:3px 0 5px; font-size:15px; }
.daily-coach-card p { margin:0; color:var(--text-secondary); font-size:12px; line-height:1.6; }
@media(max-width:700px) { .daily-coach-card { grid-template-columns:auto minmax(0,1fr); } .daily-coach-card > button { grid-column:1/-1; width:100%; } }

.profile-active-badge { display:inline-flex; align-items:center; gap:5px; margin:5px 0 8px; padding:5px 10px; border:1px solid var(--border); border-radius:999px; color:var(--primary); background:var(--surface-2); font-size:10px; font-weight:800; }

.task-item, .goal-item, .achievement-card, .notification-item { content-visibility:auto; contain-intrinsic-size:auto 88px; }

[data-color-theme="sky"] { --primary:#3c9ed8; --primary-hover:#2585c0; --primary-soft:#e5f5ff; }

/* ---------- SMARTGOAL DEVICE + PERFORMANCE HARDENING ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body { max-width: 100%; overflow-x: hidden; overscroll-behavior-x: none; }
#app-shell, .main-area, .content-area, .dashboard-grid, .dashboard-column,
.card, .settings-layout, .settings-panel, .profile-main-card { min-width: 0; }
img, video, canvas, svg { max-width: 100%; }
.content-area { overflow-wrap: anywhere; }
.card, .stat-card, .store-item, .goal-item, .routine-item, .notification-item,
.achievement-card { min-width: 0; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full-width { grid-column: 1 / -1; }
.field-input, .field-select, .field-textarea, input, select, textarea { max-width: 100%; }
.modal-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ai-chat { max-width: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.ai-message { max-width: min(88%, 760px); overflow-wrap: anywhere; word-break: break-word; }
.daily-coach-actions { display: grid; gap: 8px; justify-items: stretch; min-width: 0; }
.daily-coach-actions button { white-space: normal; }
.daily-ai-advice-output { margin-top: 12px; }
.daily-ai-advice-output #daily-ai-advice-output { white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.routine-item-content, .task-info, .user-item-info, .store-content { min-width: 0; overflow-wrap: anywhere; }
.task-item { min-width: 0; }
.task-item > * { min-width: 0; }
.store-item, .stat-card, .goal-progress-analytics { content-visibility: auto; contain-intrinsic-size: auto 210px; }
button, .nav-link, .icon-button, input[type="checkbox"] { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 62%, transparent);
  outline-offset: 2px;
}
@media (max-width: 1100px) {
  .main-area { min-width: 0; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-column { min-width: 0; }
  .daily-coach-card { grid-template-columns: auto minmax(0, 1fr); }
  .daily-coach-actions { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .main-area { width: 100%; min-width: 0; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .content-area { width: 100%; min-width: 0; }
  .section-heading, .card-header { align-items: flex-start; flex-wrap: wrap; }
  .card-header > * { min-width: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full-width { grid-column: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: flex; overflow-x: auto; max-width: 100%; padding-bottom: 5px; scrollbar-width: thin; }
  .settings-nav button { flex: 0 0 auto; min-height: 40px; }
  .daily-coach-card { grid-template-columns: auto minmax(0, 1fr); }
  .daily-coach-actions { grid-template-columns: minmax(0, 1fr); }
  .routine-item { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .task-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .task-item .task-reward { grid-column: 2 / -1; }
  .ai-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .ai-input-row input { min-width: 0; width: 100%; }
  .app-footer { flex-wrap: wrap; gap: 6px 12px; }
}
@media (max-width: 430px) {
  .main-area { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .topbar { min-width: 0; }
  .page-heading { min-width: 0; }
  .page-heading h1 { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stats-grid, .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-width: 0; padding: 12px; }
  .stat-value { overflow-wrap: anywhere; }
  .store-content { padding: 10px; }
  .store-price { flex-wrap: wrap; gap: 8px; }
  .store-price button { width: 100%; }
  .public-profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .routine-item { grid-template-columns: 48px minmax(0, 1fr); }
  .routine-item-actions { grid-column: 2; justify-content: flex-end; }
  .task-item { grid-template-columns: auto minmax(0, 1fr); }
  .task-item .task-reward { grid-column: 2; }
  .task-item > .icon-button { grid-row: auto; }
  .modal { width: 100%; max-height: min(92dvh, 900px); }
  .modal-body { max-height: calc(92dvh - 150px); overflow-y: auto; }
  .ai-message { max-width: 94%; }
}
@media (max-width: 340px) {
  .stats-grid, .store-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-right { gap: 3px; }
  .icon-button { flex: 0 0 auto; }
  .card { padding: 13px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .modal { max-height: 96dvh; }
  .modal-body { max-height: calc(96dvh - 140px); overflow-y: auto; }
  .auth-form-side { min-height: 100dvh; }
}
@media (hover: none) and (pointer: coarse) {
  button, .nav-link, .icon-button, .store-category { min-height: 42px; }
  .nav-link { padding-top: 10px; padding-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.community-leaderboard-card { overflow:hidden; }
.leaderboard-row { display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px 3px; border-top:1px solid var(--border); }
.leaderboard-rank { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; background:var(--surface-2); color:var(--primary); font-size:12px; font-weight:900; }
.leaderboard-user { min-width:0; display:grid; gap:4px; }
.leaderboard-user small { color:var(--text-muted); font-size:10px; overflow-wrap:anywhere; }
.leaderboard-xp { color:var(--primary); font-size:12px; white-space:nowrap; }
@media(max-width:420px) { .leaderboard-row { grid-template-columns:34px minmax(0,1fr); } .leaderboard-xp { grid-column:2; justify-self:start; } }

/* Expanded profile customization and level progress */
.avatar-frame-neon { outline:3px solid #67e8f9; outline-offset:3px; box-shadow:0 0 0 6px rgba(103,232,249,.16),0 0 22px rgba(103,232,249,.35); }
.public-profile-level { display:grid; gap:8px; margin:16px auto 8px; max-width:460px; text-align:left; }
.public-profile-level-head { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--text-secondary); font-size:12px; }
.public-profile-level > small { color:var(--text-muted); font-size:11px; }
@media(max-width:520px) {
  .public-profile-level { margin-left:0; margin-right:0; }
  .daily-coach-actions { width:100%; }
}

.profile-decoration-score { display:block; margin:4px 0 8px; color:var(--text-muted); font-size:10px; }

@media (min-width: 761px) { .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }


/* ---------- SmartGoal: additional themes, device coverage and rendering efficiency ---------- */
[data-color-theme="lavender"] { --primary:#8b70d6; --primary-hover:#7659c5; --primary-soft:#f0eaff; }
[data-color-theme="mint"] { --primary:#239b86; --primary-hover:#167d6c; --primary-soft:#e3f7f1; }
[data-theme="dark"][data-color-theme="lavender"] { --primary:#b49af5; --primary-hover:#c2adff; --primary-soft:#332b4c; }
[data-theme="dark"][data-color-theme="mint"] { --primary:#54cbb2; --primary-hover:#70ddc5; --primary-soft:#1d403b; }
.theme-option[data-color-theme="lavender"] { background:linear-gradient(135deg,#8b70d6,#d8c8ff); }
.theme-option[data-color-theme="mint"] { background:linear-gradient(135deg,#239b86,#b3eadb); }

.avatar-frame-crystal { outline:3px solid #b9e5ff; outline-offset:3px; box-shadow:0 0 0 6px rgba(185,229,255,.18),0 0 24px rgba(111,190,255,.42); }
.avatar-frame-flame { outline:3px solid #ff9a5c; outline-offset:3px; box-shadow:0 0 0 6px rgba(255,154,92,.18),0 0 22px rgba(244,92,54,.32); }

.ai-message-error { border:1px solid var(--red); background:var(--red-soft); color:var(--text); }

html, body, #app, .app, .app-shell, .main-area, .content-area, #content {
  min-width:0;
  max-width:100%;
}
html { min-width:280px; }
body { min-width:280px; overflow-x:clip; }
.main-area { width:100%; }
.content-area { width:100%; max-width:1600px; margin-inline:auto; }
.card, .stat-card, .store-item, .task-item, .routine-item, .goal-item,
.notification-item, .achievement-card, .user-item, .leaderboard-row,
.form-field, .setting-row, .page-heading, .card-header {
  min-width:0;
}
.task-info, .setting-info, .user-item-info, .leaderboard-user,
.routine-item-content, .profile-bio, .card-description {
  overflow-wrap:anywhere;
}
.field-input, .field-select, .field-textarea, input, textarea, select { max-width:100%; }
button, .nav-link, .icon-button { touch-action:manipulation; }
.task-item, .routine-item, .goal-progress-analytics, .notification-item,
.achievement-card, .leaderboard-row {
  content-visibility:auto;
  contain-intrinsic-size:auto 88px;
}
.store-item { content-visibility:auto; contain-intrinsic-size:auto 250px; }
.memory-image { width:min(100%,520px); max-height:360px; object-fit:contain; border-radius:12px; margin-top:10px; }

@media (min-width:1440px) {
  .content-area { max-width:1680px; }
  .dashboard-grid { gap:24px; }
}
@media (max-width:1024px) {
  .main-area { min-width:0; }
  .dashboard-grid { grid-template-columns:minmax(0,1fr); }
  .settings-layout { grid-template-columns:minmax(0,1fr); }
  .settings-nav { max-width:100%; overflow-x:auto; }
  .store-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:640px) {
  .main-area { padding-left:max(10px,env(safe-area-inset-left)); padding-right:max(10px,env(safe-area-inset-right)); }
  .content-area { padding-bottom:max(24px,env(safe-area-inset-bottom)); }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .store-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .store-item { min-width:0; }
  .store-content { min-width:0; }
  .store-content h3, .store-content p { overflow-wrap:anywhere; }
  .page-heading h1 { max-width:100%; overflow-wrap:anywhere; }
  .section-heading, .page-header, .card-header { min-width:0; }
  .modal-overlay { padding: max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom)); }
  .modal { width:100%; max-width:100%; max-height:calc(100dvh - 16px); }
  .modal-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
  .ai-chat { max-height:min(52dvh,520px); }
  .ai-input-row { grid-template-columns:minmax(0,1fr) 46px; }
  .ai-input-row input { width:100%; min-width:0; }
}
@media (max-width:390px) {
  .stats-grid, .store-grid { grid-template-columns:minmax(0,1fr); }
  .public-profile-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .topbar-right { gap:4px; }
  .topbar-right > * { min-width:0; }
  .profile-name { overflow-wrap:anywhere; }
  .routine-item { grid-template-columns:48px minmax(0,1fr); }
  .task-item { grid-template-columns:auto minmax(0,1fr); }
  .task-item .task-reward { grid-column:2; }
}
@media (max-width:320px) {
  .main-area { padding-left:7px; padding-right:7px; }
  .card { padding:11px; }
  .topbar { gap:5px; }
  .brand { gap:6px; font-size:17px; }
  .brand-mark { width:32px; height:32px; }
  .modal-overlay { padding-left:5px; padding-right:5px; }
}
@media (orientation:landscape) and (max-height:520px) {
  .sidebar { max-height:100dvh; overflow-y:auto; }
  .modal { max-height:96dvh; }
  .modal-body { max-height:calc(96dvh - 120px); overflow-y:auto; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}


/* SmartGoal routine tracking, readable AI messages and privacy controls */
.auth-retry-status {
  margin: 10px 0 0;
  color: var(--red, #d94b58);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.routine-progress-summary { display:grid; gap:9px; margin:18px 0 8px; padding:14px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.routine-progress-head, .routine-progress-legend { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.routine-progress-head strong { font-size:14px; }
.routine-progress-head span { color:var(--text-secondary); font-size:13px; font-weight:700; }
.routine-progress-track { display:flex; height:10px; width:100%; overflow:hidden; border-radius:99px; background:var(--border); }
.routine-progress-done { display:block; height:100%; background:#20a66a; transition:width .2s ease; }
.routine-progress-missed { display:block; height:100%; background:#dc535d; transition:width .2s ease; }
.routine-progress-legend { color:var(--text-muted); font-size:11px; }
.routine-legend-done { color:#168653; font-weight:700; }
.routine-legend-missed { color:#d34a55; font-weight:700; }
.routine-item { min-width:0; }
.routine-item-done { background:rgba(32,166,106,.035); }
.routine-item-missed { background:rgba(220,83,93,.035); }
.routine-status-pill { display:inline-flex; align-items:center; width:max-content; max-width:100%; margin-top:5px; padding:3px 8px; border-radius:99px; font-size:11px; font-weight:700; }
.routine-status-pill.done { color:#168653; background:rgba(32,166,106,.12); }
.routine-status-pill.missed { color:#d34a55; background:rgba(220,83,93,.12); }
.routine-status-pill.upcoming { color:var(--text-muted); background:var(--surface-2); }
.routine-mark-button { display:inline-grid; place-items:center; width:30px; height:30px; padding:0; border:1px solid var(--border); border-radius:9px; background:var(--surface); color:var(--text-secondary); cursor:pointer; font-size:17px; font-weight:800; }
.routine-mark-done { color:#168653; border-color:rgba(32,166,106,.35); }
.routine-mark-missed, .routine-mark-time { color:#d34a55; border-color:rgba(220,83,93,.35); }
.routine-item-actions { align-items:center; flex-wrap:wrap; }
.public-showcase { display:grid; gap:10px; margin-top:18px; padding:15px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.public-showcase h3 { margin:0; font-size:14px; }
.public-showcase-list { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
.public-showcase-chip { display:inline-flex; align-items:center; gap:6px; max-width:100%; padding:7px 10px; border:1px solid var(--border); border-radius:99px; background:var(--surface); color:var(--text-secondary); font-size:12px; overflow-wrap:anywhere; }
.data-delete-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:16px 0 4px; }
.data-delete-options label { display:flex; align-items:center; gap:9px; min-width:0; padding:10px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); font-size:13px; }
.data-delete-options input { flex:0 0 auto; accent-color:var(--primary); }
.ai-message p { margin:0 0 9px; line-height:1.7; }
.ai-message p:last-child { margin-bottom:0; }
.ai-message h3 { margin:13px 0 7px; font-size:16px; line-height:1.4; }
.ai-message ol, .ai-message ul { display:grid; gap:6px; margin:8px 0 10px; padding-left:23px; line-height:1.65; }
.ai-message li { padding-left:3px; }
.ai-message strong { font-weight:800; color:var(--text); }
.ai-message code { padding:2px 5px; border-radius:5px; background:var(--surface-2); font-size:.9em; overflow-wrap:anywhere; }
.daily-ai-advice-output { min-width:0; overflow-wrap:anywhere; line-height:1.7; }
.daily-ai-advice-output h3 { margin:12px 0 6px; font-size:15px; }
.daily-ai-advice-output ol, .daily-ai-advice-output ul { padding-left:22px; line-height:1.7; }
@media (max-width:560px) {
  .data-delete-options { grid-template-columns:minmax(0,1fr); }
  .routine-progress-legend { justify-content:flex-start; gap:7px 12px; }
  .routine-progress-head { align-items:flex-start; }
  .routine-item-actions { grid-column:2; justify-content:flex-end; }
  .public-showcase-chip { font-size:11px; padding:6px 8px; }
}

.dashboard-routine-list { display:grid; gap:0; }
.dashboard-routine-row { display:grid; grid-template-columns:58px minmax(0,1fr) auto; align-items:center; gap:9px; padding:10px 0; border-top:1px solid var(--border); }
.dashboard-routine-row time { color:var(--primary); font-weight:800; font-size:12px; font-variant-numeric:tabular-nums; }
.dashboard-routine-row strong { min-width:0; font-size:13px; overflow-wrap:anywhere; }
.dashboard-routine-row .routine-status-pill { margin:0; }
@media (max-width:420px) {
  .dashboard-routine-row { grid-template-columns:48px minmax(0,1fr); }
  .dashboard-routine-row .routine-status-pill { grid-column:2; justify-self:start; }
}

.routine-progress-no-time { display:block; height:100%; background:#ef8b55; transition:width .2s ease; }
.routine-legend-time { color:#d8793d; font-weight:700; }


/* ---------- GLOBAL RESPONSIVE SAFETY ---------- */
html, body, #app, .app-shell, .main-area, .content-area {
  min-width: 0;
  max-width: 100%;
}
body { overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }
.settings-layout, .settings-layout > *, .settings-panel, .settings-section,
.setting-row, .setting-info, .form-field, .card, .modal, .modal-body {
  min-width: 0;
}
.settings-panel, .modal-body, .card, .content-area { overflow-wrap: anywhere; }
.setting-info { flex: 1 1 180px; }
.setting-row > :last-child { flex: 0 1 auto; }
.profile-name, .profile-username, .page-heading h1, .card-title,
.goal-title, .task-title, .routine-item-content, .notification-item > div {
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { min-width: 0; max-width: 100%; }
  .settings-panel { padding: clamp(12px, 3vw, 20px); }
  .setting-row { flex-wrap: wrap; align-items: flex-start; gap: 9px 12px; }
  .setting-row > :last-child { max-width: 100%; }
  .modal { width: min(100% - 20px, 560px); max-height: calc(100dvh - 20px); }
  .modal-body { max-height: calc(100dvh - 170px); overflow-y: auto; }
}
@media (max-width: 430px) {
  .settings-nav button { flex: 0 0 auto; white-space: nowrap; }
  .topbar-right { min-width: 0; }
  .topbar-user-name { display: none; }
  .routine-item { min-width: 0; }
  .form-grid, .dashboard-grid, .stats-grid, .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid .full-width { grid-column: 1 / -1; }
}
@media (max-width: 340px) {
  .stats-grid, .store-grid, .public-profile-stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar { gap: 6px; }
  .topbar-right { gap: 4px; }
  .settings-panel { padding: 10px; }
}
