:root {
  --bg-primary: #f6f9ff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fbff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.10);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
  --sidebar-width: 252px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --font-sans:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial,
    sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(
      circle at 80% -10%,
      rgba(37, 99, 235, 0.06),
      transparent 28rem
    ),
    var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  font: inherit;
}
button:focus-visible,
a:focus-visible,
.tracker-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset-block: 0;
  inset-inline-start: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 28px 18px 20px;
  border-inline-end: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-inline: 10px;
}
.brand__mark {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 8px 7px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 10px;
  background: var(--accent-soft);
}
.brand__mark span {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: var(--accent);
}
.brand__mark span:nth-child(1) {
  height: 7px;
  opacity: 0.6;
}
.brand__mark span:nth-child(2) {
  height: 14px;
}
.brand__mark span:nth-child(3) {
  height: 10px;
  opacity: 0.78;
}
.brand__name {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.04em;
}
.brand__name span {
  color: var(--accent);
}

.nav-menu {
  margin-block-start: 52px;
}
.nav-menu__label {
  margin: 0 12px 10px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-link {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  margin-block: 4px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 590;
  text-decoration: none;
  transition: 180ms ease;
}
.nav-link svg,
.topbar svg,
.stat-card svg,
.habit-check svg,
.month-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.nav-link:hover {
  background: rgba(15, 23, 42, 0.035);
  color: var(--text-primary);
}
.nav-link.active {
  border-color: rgba(37, 99, 235, 0.12);
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-link.active::before {
  position: absolute;
  inset-block: 12px;
  inset-inline-start: -19px;
  width: 3px;
  border-radius: 4px;
  background: var(--accent);
  content: "";
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.4);
}

.sidebar-card {
  margin-block-start: auto;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.04),
    rgba(15, 23, 42, 0.015)
  );
}
.sidebar-card__icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  margin-block-end: 15px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}
.sidebar-card__eyebrow {
  margin: 0 0 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sidebar-card strong {
  font-size: 13px;
}
.mini-progress {
  height: 4px;
  margin-block: 14px 8px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.08);
}
.mini-progress span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.sidebar-card small {
  color: var(--text-muted);
  font-size: 11px;
}

.profile {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-block-start: 20px;
  padding: 15px 8px 0;
  border-block-start: 1px solid var(--border);
}
.profile__avatar {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}
.profile strong,
.profile span {
  display: block;
}
.profile strong {
  font-size: 12px;
}
.profile span {
  color: var(--text-muted);
  font-size: 10px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.025);
  cursor: pointer;
  transition: 180ms ease;
}
.icon-button:hover {
  border-color: var(--border-strong);
  background: rgba(15, 23, 42, 0.055);
}
.profile__more {
  width: 30px;
  height: 30px;
  border: 0;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.sidebar-overlay {
  display: none;
}

.main-content {
  width: calc(100% - var(--sidebar-width));
  max-width: 1540px;
  min-height: 100vh;
  margin-inline-start: var(--sidebar-width);
  padding: 34px clamp(24px, 3.2vw, 52px) 28px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-block-end: 28px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.topbar__copy > p:last-child {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button,
.language__trigger {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding-inline: 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  transition: 180ms ease;
}
.button:hover,
.language__trigger:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.11);
}
.button--primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}
.button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.language {
  position: relative;
}
.language__trigger svg {
  width: 17px;
  height: 17px;
}
.language__chevron {
  width: 13px !important;
  transition: transform 180ms ease;
}
.language.is-open .language__chevron {
  transform: rotate(180deg);
}
.language__menu {
  position: absolute;
  z-index: 20;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: 162px;
  padding: 6px;
  visibility: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  opacity: 0;
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: translateY(-6px);
  transition: 160ms ease;
}
.language.is-open .language__menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.language__menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: start;
}
.language__menu button:hover,
.language__menu button[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.language__menu button span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}
.mobile-menu-button {
  display: none;
  flex: 0 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-block-end: 18px;
}
.stat-card,
.panel {
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.012), transparent 42%),
    var(--bg-card);
  box-shadow: var(--shadow);
}
.stat-card {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-md);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}
.stat-card:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
}
.stat-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 22px;
}
.stat-card__icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}
.stat-card__icon svg {
  width: 15px;
  height: 15px;
}
.stat-card__icon--orange {
  background: rgba(255, 165, 89, 0.11);
}
.stat-card__icon--violet {
  background: rgba(169, 139, 255, 0.11);
}
.stat-card__icon--blue {
  background: rgba(89, 171, 255, 0.11);
  color: #3b82f6;
}
.stat-card__trend,
.stat-card__badge {
  padding: 3px 7px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
}
.stat-card__badge--subtle {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-muted);
}
.stat-card > p {
  margin: 0 0 5px;
  color: var(--text-secondary);
  font-size: 11px;
}
.stat-card__value,
.stat-card__value-row strong {
  display: block;
  font-size: 27px;
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.2;
}
.stat-card__value small,
.stat-card__value-row strong span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0;
}
.stat-card__caption {
  display: block;
  margin-block-start: 9px;
  color: var(--text-muted);
  font-size: 9px;
}
.stat-card__value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.progress-ring {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 67%, rgba(15, 23, 42, 0.07) 0);
}
.progress-ring::before {
  grid-area: 1 / 1;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--bg-card);
  content: "";
}
.progress-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  font-size: 8px;
  font-weight: 700;
}

.panel {
  margin-block-end: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-block-end: 18px;
}
.section-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.section-heading > div > p:not(.eyebrow) {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}
.section-heading__badge {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 10px;
}

.habit-list {
  display: grid;
  gap: 7px;
}
.habit-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 13px;
  min-height: 62px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.023);
  transition: 180ms ease;
}
.habit-row:hover {
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.038);
}
.habit-row__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.05);
  font-size: 15px;
  font-weight: 700;
}
.habit-row__icon--green {
  background: rgba(37, 99, 235, 0.09);
  color: var(--accent);
}
.habit-row__icon--violet {
  background: rgba(169, 139, 255, 0.1);
  color: #b9a2ff;
}
.habit-row__icon--amber {
  background: rgba(255, 183, 77, 0.1);
  color: #ffc26a;
}
.habit-row__icon--blue {
  background: rgba(89, 171, 255, 0.1);
  color: #3b82f6;
}
.habit-row__icon--pink {
  background: rgba(255, 118, 177, 0.1);
  color: #ff8fc0;
}
.habit-row__copy h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}
.habit-row__copy p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 9px;
}
.habit-row__time {
  color: var(--text-muted);
  font-size: 10px;
}
.habit-check {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition: 160ms ease;
}
.habit-check svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.7;
}
.habit-check:hover {
  border-color: var(--accent);
}
.habit-check.is-checked {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}
.habit-row.is-complete .habit-row__copy h3 {
  color: var(--text-secondary);
}

.tracker-heading {
  margin-block-end: 12px;
}
.tracker-heading .eyebrow {
  margin-block-end: 3px;
}
.month-nav {
  display: flex;
  align-items: center;
  gap: 9px;
}
.month-nav strong {
  min-width: 112px;
  font-size: 11px;
  text-align: center;
}
.month-nav .icon-button {
  width: 32px;
  height: 32px;
}
.month-nav svg {
  width: 14px;
  height: 14px;
}
.tracker-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 13px;
}
.tracker-meta > p {
  display: none;
  margin: 0;
  color: var(--text-muted);
  font-size: 9px;
}
.tracker-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.tracker-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9px;
}
.legend-dot {
  width: 7px;
  height: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.025);
}
.legend-dot--complete {
  border-color: var(--accent);
  background: var(--accent);
}
.legend-dot--missed {
  border-color: rgba(240, 113, 120, 0.5);
  background: var(--danger-soft);
}

.tracker-scroll {
  overflow-x: auto;
  padding-block-end: 7px;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}
.tracker-scroll::-webkit-scrollbar {
  height: 5px;
}
.tracker-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.tracker-scroll::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #cbd5e1;
}
.tracker-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 4px 6px;
  font-size: 9px;
}
.tracker-table th,
.tracker-table td {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  text-align: center;
}
.tracker-table th {
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 600;
}
.tracker-table th:first-child,
.tracker-table td:first-child {
  position: sticky;
  z-index: 2;
  inset-inline-start: 0;
  width: 122px;
  min-width: 122px;
  padding-inline: 9px 14px;
  background: var(--bg-card);
  text-align: start;
}
.tracker-table th:first-child {
  z-index: 3;
  color: var(--text-secondary);
  font-size: 9px;
}
.tracker-table td:first-child {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 610;
}
.tracker-cell span {
  display: block;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 1px solid rgba(15, 23, 42, 0.065);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.022);
}
.tracker-cell.is-complete span {
  border-color: rgba(37, 99, 235, 0.36);
  background: rgba(37, 99, 235, 0.78);
  box-shadow: inset 0 0 0 3px rgba(17, 21, 13, 0.12);
}
.tracker-cell.is-missed span {
  border-color: rgba(240, 113, 120, 0.25);
  background: rgba(240, 113, 120, 0.09);
}
.tracker-table .is-today {
  color: var(--accent);
}
.tracker-table th.is-today::after {
  display: block;
  width: 3px;
  height: 3px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 3px 2px;
  color: var(--text-muted);
  font-size: 9px;
}
.footer p {
  margin: 0;
}

[dir="rtl"] body {
  font-family: Tahoma, Arial, var(--font-sans);
}
[dir="rtl"] .month-nav svg,
[dir="rtl"] .language__chevron {
  transform: scaleX(-1);
}
[dir="rtl"] .language.is-open .language__chevron {
  transform: scaleX(-1) rotate(180deg);
}

@media (max-width: 1120px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .sidebar {
    width: min(286px, 84vw);
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.20);
    transform: translateX(-110%);
    transition: transform 230ms ease;
  }
  [dir="rtl"] .sidebar {
    transform: translateX(110%);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    visibility: hidden;
    border: 0;
    opacity: 0;
    background: rgba(15, 23, 42, 0.24);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    transition: 220ms ease;
  }
  .sidebar-overlay.is-visible {
    visibility: visible;
    opacity: 1;
  }
  .main-content {
    width: 100%;
    margin-inline-start: 0;
    padding: 24px 20px;
  }
  .mobile-menu-button {
    display: inline-grid;
  }
  .topbar__copy {
    margin-inline-end: auto;
  }
}

@media (max-width: 620px) {
  .main-content {
    padding: 18px 14px 24px;
  }
  .topbar {
    align-items: flex-start;
    gap: 12px;
    margin-block-end: 22px;
  }
  .topbar__copy .eyebrow,
  .topbar__copy > p:last-child {
    display: none;
  }
  .topbar h1 {
    margin-block-start: 6px;
    font-size: 21px;
  }
  .topbar__actions {
    gap: 7px;
  }
  .button--primary {
    width: 43px;
    padding: 0;
  }
  .button--primary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .language__trigger {
    width: 58px;
    padding-inline: 8px;
  }
  .language__trigger > svg:first-child,
  .language__chevron {
    display: none;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .stat-card {
    min-height: 142px;
    padding: 14px;
  }
  .stat-card__header {
    margin-block-end: 17px;
  }
  .stat-card__value,
  .stat-card__value-row strong {
    font-size: 23px;
  }
  .stat-card__caption {
    white-space: nowrap;
  }
  .panel {
    padding: 17px 13px;
    border-radius: 16px;
  }
  .habit-row {
    grid-template-columns: 35px minmax(0, 1fr) 29px;
    min-height: 58px;
    gap: 10px;
    padding-inline: 9px;
  }
  .habit-row__icon {
    width: 35px;
    height: 35px;
  }
  .habit-row__time {
    display: none;
  }
  .habit-check {
    width: 27px;
    height: 27px;
  }
  .tracker-heading {
    align-items: flex-start;
  }
  .tracker-heading .eyebrow {
    display: none;
  }
  .month-nav {
    gap: 4px;
  }
  .month-nav strong {
    min-width: 88px;
    font-size: 9px;
  }
  .month-nav .icon-button {
    width: 29px;
    height: 29px;
  }
  .tracker-meta {
    align-items: flex-end;
  }
  .tracker-meta > p {
    display: block;
    max-width: 110px;
    text-align: end;
  }
  .tracker-table th:first-child,
  .tracker-table td:first-child {
    width: 105px;
    min-width: 105px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  background: rgba(15, 23, 42, 0.34);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: 180ms ease;
}

.modal-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

.modal-card {
  width: min(620px, 100%);
  max-height: 85vh;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(0.98);
  transition: 180ms ease;
}

.modal-overlay.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  padding: 20px;
}

.manage-habits-list {
  display: grid;
  gap: 9px;
}

.manage-habit-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.025);
}

.manage-habit-row__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.manage-habit-row__copy h3 {
  margin: 0;
  font-size: 13px;
}

.manage-habit-row__copy p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 10px;
}

.manage-habit-row__actions {
  display: flex;
  gap: 6px;
}

.manage-habit-row__actions button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.manage-habit-row__actions button:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.manage-habit-row__actions .delete-habit {
  color: var(--danger);
}

.add-habit-button {
  width: 100%;
  margin-top: 16px;
}

@media (max-width: 620px) {
  .modal-card {
    max-height: 90vh;
  }

  .modal-header,
  .modal-body {
    padding: 16px;
  }

  .manage-habit-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .manage-habit-row__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

.habit-form {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.025);
}

.habit-form[hidden] {
  display: none;
}

.habit-form__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.habit-form__header h3 {
  margin: 0;
  font-size: 16px;
}

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

.form-field {
  display: grid;
  gap: 7px;
}

.form-field span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  transition: 160ms ease;
}

.form-field input::placeholder {
  color: var(--text-muted);
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.habit-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

@media (max-width: 620px) {
  .habit-form__grid {
    grid-template-columns: 1fr;
  }

  .habit-form {
    padding: 14px;
  }

  .habit-form__actions {
    flex-direction: column-reverse;
  }

  .habit-form__actions .button {
    width: 100%;
  }
}

.custom-days {
  margin-top: 14px;
}

.custom-days[hidden] {
  display: none;
}

.custom-days__label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.custom-days__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-days__options label {
  position: relative;
  cursor: pointer;
}

.custom-days__options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-days__options span {
  display: grid;
  min-width: 42px;
  height: 34px;
  place-items: center;
  padding-inline: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.025);
  color: var(--text-secondary);
  font-size: 10px;
  transition: 160ms ease;
}

.custom-days__options span:hover {
  border-color: var(--border-strong);
  background: rgba(15, 23, 42, 0.045);
  color: var(--text-primary);
}

.custom-days__options input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.custom-days__options input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 620px) {
  .custom-days__options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .custom-days__options span {
    min-width: 0;
    width: 100%;
  }
}

/* =========================
   ANALYTICS SUMMARY CARDS
========================= */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.analytics-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;

  background: rgba(15, 23, 42, 0.025);
  border: 1px solid var(--border);
  border-radius: 16px;

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.analytics-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(15, 23, 42, 0.035);
}

.analytics-card__label {
  display: block;
  margin-bottom: 14px;

  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.analytics-card strong {
  display: block;
  margin-bottom: 7px;

  color: var(--text-primary);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-card small {
  display: block;

  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.4;
}

.analytics-card::before {
  content: "";

  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;

  height: 1px;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(37, 99, 235, 0.3),
    transparent
  );

  opacity: 0;
  transition: opacity 180ms ease;
}

.analytics-card:hover::before {
  opacity: 1;
}

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

@media (max-width: 560px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-card {
    padding: 17px;
  }

  .analytics-card strong {
    font-size: 22px;
  }
}

.analytics-charts {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.analytics-chart-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.025);
}

.analytics-chart-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.analytics-chart-card__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analytics-chart-card h3 {
  margin: 0;
  font-size: 16px;
}

.weekly-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 220px;
}

.weekly-chart__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.weekly-chart__value {
  color: var(--text-secondary);
  font-size: 10px;
}

.weekly-chart__track {
  position: relative;
  width: 100%;
  max-width: 36px;
  height: 150px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.025);
}

.weekly-chart__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 2px;
  border-radius: 8px;
  background: var(--accent);
  transition: height 250ms ease;
}

.weekly-chart__day {
  color: var(--text-secondary);
  font-size: 10px;
}

.habit-performance-chart {
  display: grid;
  gap: 18px;
}

.habit-performance-chart__row {
  display: grid;
  gap: 8px;
}

.habit-performance-chart__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.habit-performance-chart__top span {
  color: var(--text-primary);
}

.habit-performance-chart__top strong {
  color: var(--text-secondary);
  font-size: 10px;
}

.habit-performance-chart__track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
}

.habit-performance-chart__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 250ms ease;
}

.analytics-empty {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

@media (max-width: 900px) {
  .analytics-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .weekly-chart {
    gap: 6px;
  }

  .weekly-chart__track {
    max-width: 28px;
    height: 120px;
  }

  .weekly-chart__value,
  .weekly-chart__day {
    font-size: 9px;
  }
}

/* =========================
   SETTINGS MODAL
========================= */

.settings-modal-card {
  width: min(520px, calc(100vw - 32px));
}

.settings-section {
  display: grid;
  gap: 20px;
}

.settings-section__heading h3 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 650;
}

.settings-section__heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

/* Profile preview */

.settings-profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 16px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: rgba(15, 23, 42, 0.025);
}

.settings-profile-preview__avatar {
  display: grid;
  place-items: center;

  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  border-radius: 13px;

  background: var(--accent);
  color: #ffffff;

  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.settings-profile-preview > div:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-profile-preview strong {
  overflow: hidden;

  color: var(--text-primary);
  font-size: 14px;
  font-weight: 650;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.settings-profile-preview span {
  color: var(--text-secondary);
  font-size: 10px;
}

/* Form */

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Actions */

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;

  margin-top: 24px;
  padding-top: 18px;

  border-top: 1px solid var(--border);
}

/* Mobile */

@media (max-width: 560px) {
  .settings-modal-card {
    width: calc(100vw - 20px);
  }

  .settings-profile-preview {
    padding: 14px;
  }

  .settings-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .settings-actions .button {
    width: 100%;
  }
}
.settings-preferences {
  display: grid;
  gap: 18px;

  margin-top: 24px;
  padding-top: 22px;

  border-top: 1px solid var(--border);
}

/* =========================================
   Arabic RTL — Settings Modal
========================================= */

html[dir="rtl"] .settings-modal {
  text-align: right;
}

html[dir="rtl"] .settings-section__heading,
html[dir="rtl"] .settings-profile,
html[dir="rtl"] .settings-preferences {
  text-align: right;
}

html[dir="rtl"] .form-field {
  text-align: right;
}

html[dir="rtl"] .form-field input,
html[dir="rtl"] .form-field select {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .settings-actions {
  direction: rtl;
}

html[dir="rtl"] #close-settings-button {
  margin-left: 0;
  margin-right: auto;
}

/* =========================================
   DATA MANAGEMENT
========================================= */

.settings-data {
  display: grid;
  gap: 18px;

  margin-top: 24px;
  padding-top: 22px;

  border-top: 1px solid var(--border);
}

.settings-data__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-data__actions .button {
  width: 100%;
  justify-content: center;
}

.settings-danger-button {
  color: #ff8b8b;
  border-color: rgba(255, 90, 90, 0.18);
  background: rgba(255, 75, 75, 0.06);
}

.settings-danger-button:hover {
  color: #ffaaaa;
  border-color: rgba(255, 90, 90, 0.32);
  background: rgba(255, 75, 75, 0.1);
}

@media (max-width: 560px) {
  .settings-data__actions {
    grid-template-columns: 1fr;
  }
}
/* =========================================
   STEP 17.1 — FINAL UI POLISH
========================================= */

.panel {
  transition:
    border-color 180ms ease,
    background 180ms ease;
}

.panel:hover {
  border-color: var(--border-strong);
}

.button:active,
.icon-button:active,
.habit-check:active {
  transform: scale(0.97);
}

.habit-check:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tracker-scroll {
  scroll-behavior: smooth;
}

@media (max-width: 620px) {
  .section-heading {
    gap: 12px;
  }

  .footer {
    flex-direction: column;
    gap: 4px;
  }
}

/* =========================================
   STEP 17.2 — EMPTY STATES
========================================= */

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;

  min-height: 130px;
  padding: 24px;

  border: 1px dashed var(--border-strong);
  border-radius: 14px;

  background: rgba(15, 23, 42, 0.018);
  text-align: center;
}

.empty-state strong {
  font-size: 13px;
  font-weight: 650;
}

.empty-state p {
  max-width: 320px;
  margin: 0;

  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.6;
}

/* =========================================
   STEP 17.3 — TOAST FEEDBACK
========================================= */

.toast {
  position: fixed;
  z-index: 300;
  inset-inline-end: 24px;
  inset-block-end: 24px;

  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;

  width: min(360px, calc(100vw - 32px));
  padding: 14px;

  visibility: hidden;
  opacity: 0;

  border: 1px solid var(--border-strong);
  border-radius: 14px;

  background: #ffffff;
  box-shadow: var(--shadow);

  transform: translateY(14px);
  transition: 180ms ease;
}

.toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.toast__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;

  border-radius: 10px;

  background: var(--accent-soft);
  color: var(--accent);

  font-size: 14px;
  font-weight: 800;
}

.toast__content {
  min-width: 0;
}

.toast__content strong {
  display: block;
  margin-bottom: 2px;

  font-size: 12px;
}

.toast__content p {
  margin: 0;

  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.5;
}

.toast.is-error .toast__icon {
  background: var(--danger-soft);
  color: var(--danger);
}

@media (max-width: 620px) {
  .toast {
    inset-inline: 16px;
    inset-block-end: 16px;

    width: auto;
  }
}

/* =========================================
   STEP 17.3 — CONFIRM MODAL
========================================= */

.confirm-modal-card {
  width: min(430px, calc(100vw - 32px));
}

.confirm-message {
  margin: 0;

  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  margin-top: 22px;
}

@media (max-width: 560px) {
  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .confirm-actions .button {
    width: 100%;
  }
}

.install-app-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.05);
  color: #2563eb;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.install-app-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.35);
}

.install-app-btn svg {
  stroke: currentColor;
}

/* =========================================================
   HABITFLOW AUTH SCREEN — FINAL
========================================================= */

.auth-screen {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, rgba(59, 130, 246, 0.10), transparent 30%),
    radial-gradient(circle at 72% 25%, rgba(70, 110, 150, 0.08), transparent 28%),
    #f8fbff;
  color: #0f172a;
}


/* =========================================================
   LEFT SHOWCASE
========================================================= */

.auth-showcase {
  position: relative;
  min-height: 100vh;
  padding: 44px 54px 220px;
  overflow: hidden;
  border-right: 1px solid rgba(15, 23, 42, 0.07);
}

.auth-brand {
  position: relative;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #0f172a;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 800;
}

.auth-brand__mark {
  color: #2563eb;
  font-size: 1.45rem;
  filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.45));
}

.auth-brand span span {
  color: #2563eb;
}

.auth-showcase__content {
  position: relative;
  z-index: 5;
  width: min(100%, 520px);
  margin-top: 64px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  padding: 9px 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.055);
  color: #3b82f6;
  font-size: 0.8rem;
}

.auth-title {
  max-width: 560px;
  margin: 0;
  font-size: clamp(3rem, 4.2vw, 4.9rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.auth-title span {
  color: #2563eb;
}

.auth-description {
  max-width: 420px;
  margin: 25px 0 36px;
  color: #64748b;
  font-size: 0.97rem;
  line-height: 1.7;
}

.auth-benefits {
  display: grid;
  gap: 17px;
  width: min(100%, 450px);
}

.auth-benefit {
  display: flex;
  align-items: center;
  gap: 15px;
}

.auth-benefit__icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.04);
  color: #2563eb;
  font-size: 1.15rem;
}

.auth-benefit strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
  font-size: 0.95rem;
}

.auth-benefit p {
  max-width: 330px;
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}


/* =========================================================
   ACHIEVEMENT / STAR
========================================================= */

.auth-achievement {
  position: absolute;
  z-index: 2;
  top: 16%;
  right: 2%;
  width: 320px;
  height: 420px;
  pointer-events: none;
}

.auth-achievement__glow {
  position: absolute;
  top: 25px;
  left: 50%;
  width: 170px;
  height: 170px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.22);
  filter: blur(48px);
}

.auth-achievement__star {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #3b82f6;
  font-size: 6.4rem;
  line-height: 1;
  text-shadow:
    0 0 18px rgba(59, 130, 246, 0.8),
    0 0 55px rgba(37, 99, 235, 0.4);
  animation: authStarFloat 3.6s ease-in-out infinite;
}


/* =========================================================
   STAIRS
========================================================= */

.auth-steps {
  position: absolute;
  right: 0;
  bottom: 15px;
  width: 270px;
  height: 240px;
}

.auth-steps span {
  position: absolute;
  right: 0;
  height: 36px;
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 6px 6px 2px 2px;
  background:
    linear-gradient(
      180deg,
      rgba(59, 130, 246, 0.18),
      rgba(239, 246, 255, 0.96)
    );
  box-shadow:
    inset 0 1px rgba(15, 23, 42, 0.04),
    0 8px 20px rgba(15, 23, 42, 0.08);
}

.auth-steps span:nth-child(1) {
  width: 100px;
  bottom: 160px;
}

.auth-steps span:nth-child(2) {
  width: 130px;
  bottom: 120px;
}

.auth-steps span:nth-child(3) {
  width: 160px;
  bottom: 80px;
}

.auth-steps span:nth-child(4) {
  width: 190px;
  bottom: 40px;
}

.auth-steps span:nth-child(5) {
  width: 220px;
  bottom: 0;
}


/* =========================================================
   BOTTOM STATS
========================================================= */

.auth-stats {
  position: absolute;
  z-index: 10;
  left: 54px;
  bottom: 40px;
  width: 345px;
  min-height: 140px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.auth-stat {
  min-width: 0;
  padding: 19px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(15, 23, 42, 0.055);
  text-align: center;
}

.auth-stat:last-child {
  border-right: none;
}

.auth-stat > span {
  display: block;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 1rem;
}

.auth-stat strong {
  display: block;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 1.45rem;
  line-height: 1;
}

.auth-stat small {
  display: block;
  color: #94a3b8;
  font-size: 0.65rem;
  line-height: 1.25;
  white-space: nowrap;
}


/* =========================================================
   WEEKLY CARD
========================================================= */

.auth-weekly {
  position: absolute;
  z-index: 10;
  right: 3%;
  bottom: 40px;
  width: 340px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.auth-weekly__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
}

.auth-weekly__header strong {
  font-size: 0.82rem;
}

.auth-weekly__header span {
  padding: 5px 8px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.035);
  color: #64748b;
  font-size: 0.65rem;
}

.auth-weekly__chart {
  height: 110px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
}

.auth-weekly__chart div {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.auth-weekly__chart div > span {
  display: block;
  width: 17px;
  min-height: 18px;
  border-radius: 5px;
  background: linear-gradient(180deg, #2563eb, #426d19);
  opacity: 0.7;
}

.auth-weekly__chart .active > span {
  opacity: 1;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.24);
}

.auth-weekly__chart small {
  color: #94a3b8;
  font-size: 0.62rem;
}

.auth-weekly__chart .active small {
  color: #2563eb;
}


/* =========================================================
   RIGHT SIDE
========================================================= */

.auth-form-side {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 46px;
  background:
    radial-gradient(circle at center, rgba(52, 77, 95, 0.11), transparent 45%);
}

.auth-card {
  width: min(100%, 560px);
  padding: 38px 40px 32px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 25px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.99),
      rgba(248, 251, 255, 0.99)
    );
  box-shadow:
    0 35px 80px rgba(15, 23, 42, 0.10),
    inset 0 1px rgba(15, 23, 42, 0.03);
}

.auth-card__header h2 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  letter-spacing: -0.035em;
}

.auth-card__header p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}


/* =========================================================
   TABS
========================================================= */

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 30px 0 27px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.auth-tab {
  appearance: none;
  padding: 14px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.auth-tab.active {
  border-bottom-color: #2563eb;
  color: #0f172a;
}


/* =========================================================
   FORMS
========================================================= */

.auth-form {
  display: grid;
  gap: 19px;
}

.auth-form[hidden],
.auth-verification[hidden],
.auth-screen[hidden],
.app-shell[hidden] {
  display: none !important;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field > span {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-input {
  min-height: 55px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  transition: 0.2s ease;
}

.auth-input:focus-within {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.055);
}

.auth-input__icon {
  width: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  color: #94a3b8;
}

.auth-input input {
  width: 100%;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
}

.auth-input input::placeholder {
  color: #94a3b8;
}

.auth-password-toggle {
  width: 48px;
  height: 54px;
  flex: 0 0 48px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}


/* =========================================================
   OPTIONS
========================================================= */

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 0.8rem;
}

.auth-remember input {
  accent-color: #2563eb;
}

.auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}


/* =========================================================
   SUBMIT BUTTON
========================================================= */

.auth-submit {
  width: 100%;
  min-height: 55px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(90deg, #3b82f6, #2563eb);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.17);
}

.auth-submit:active {
  transform: translateY(0);
}


/* =========================================================
   TERMS / ERRORS / SECURITY
========================================================= */

.auth-terms {
  margin: -3px 0 0;
  color: #64748b;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.5;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 90, 90, 0.18);
  border-radius: 10px;
  background: rgba(255, 70, 70, 0.05);
  color: #ff9d9d;
  font-size: 0.8rem;
}

.auth-security {
  margin-top: 27px;
  padding-top: 19px;
  border-top: 1px solid rgba(15, 23, 42, 0.055);
  color: #64748b;
  text-align: center;
  font-size: 0.74rem;
}


/* =========================================================
   OTP
========================================================= */

.auth-verification {
  text-align: center;
}

.auth-verification__icon {
  width: 62px;
  height: 62px;
  margin: 18px auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 17px;
  background: rgba(37, 99, 235, 0.065);
  color: #2563eb;
  font-size: 1.45rem;
}

.auth-verification h2 {
  margin: 0 0 8px;
}

.auth-verification > p {
  margin: 0;
  color: #64748b;
}

.auth-verification > strong {
  display: block;
  margin: 8px 0 24px;
  color: #3b82f6;
}

.auth-back {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: #64748b;
  cursor: pointer;
}

.verification-form {
  display: grid;
  gap: 18px;
}

.verification-code-input {
  width: 100%;
  height: 68px;
  padding: 0 18px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 14px;
  outline: 0;
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.35em;
}

.verification-code-input:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.055);
}

.auth-resend {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 6px;
  color: #64748b;
  font-size: 0.78rem;
}

.auth-resend button {
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
}


/* =========================================================
   FOOTER
========================================================= */

.auth-footer {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  color: #94a3b8;
  font-size: 0.68rem;
  white-space: nowrap;
}


/* =========================================================
   ANIMATION
========================================================= */

@keyframes authStarFloat {
  0%,
  100% {
    transform: translate(-50%, 0) scale(1);
  }

  50% {
    transform: translate(-50%, -9px) scale(1.04);
  }
}


/* =========================================================
   LAPTOP
========================================================= */

@media (max-width: 1400px) {
  .auth-showcase {
    padding-left: 38px;
    padding-right: 38px;
  }

  .auth-showcase__content {
    width: 470px;
  }

  .auth-title {
    font-size: 3.7rem;
  }

  .auth-achievement {
    right: 0;
    transform: scale(0.88);
    transform-origin: right center;
  }

  .auth-stats {
    left: 38px;
    width: 320px;
  }

  .auth-weekly {
    right: 2%;
    width: 315px;
  }
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {
  .auth-screen {
    grid-template-columns: 0.85fr 1.15fr;
  }

  .auth-achievement {
    opacity: 0.35;
  }

  .auth-weekly {
    display: none;
  }

  .auth-stats {
    width: calc(100% - 76px);
  }

  .auth-form-side {
    padding: 35px;
  }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 850px) {
  .auth-screen {
    display: block;
    min-height: 100vh;
    padding: 22px;
    overflow: visible;
  }

  .auth-showcase {
    min-height: auto;
    padding: 0;
    border-right: 0;
    overflow: visible;
  }

  .auth-showcase__content {
    width: 100%;
    margin-top: 38px;
  }

  .auth-title {
    font-size: clamp(2.35rem, 11vw, 3.8rem);
  }

  .auth-description {
    margin-bottom: 0;
  }

  .auth-benefits,
  .auth-achievement,
  .auth-stats,
  .auth-weekly {
    display: none;
  }

  .auth-form-side {
    min-height: auto;
    display: block;
    padding: 35px 0 55px;
  }

  .auth-card {
    width: 100%;
    padding: 28px 22px;
    border-radius: 22px;
  }

  .auth-card__header h2 {
    font-size: 1.7rem;
  }

  .auth-footer {
    position: static;
    transform: none;
    display: block;
    padding: 0 0 18px;
    text-align: center;
  }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {
  .auth-screen {
    padding: 17px;
  }

  .auth-showcase__content {
    margin-top: 28px;
  }

  .auth-badge {
    font-size: 0.7rem;
  }

  .auth-title {
    font-size: 2.45rem;
  }

  .auth-description {
    font-size: 0.88rem;
  }

  .auth-card {
    padding: 23px 17px;
  }

  .auth-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .verification-code-input {
    font-size: 1.3rem;
    letter-spacing: 0.22em;
  }
}

/* ========================================
   SETTINGS — ACCOUNT / LOGOUT
======================================== */

.settings-account {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
}

.settings-account .settings-section__heading {
  margin-bottom: 16px;
}

.settings-account .settings-section__heading h3 {
  margin: 0 0 5px;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}

.settings-account .settings-section__heading p {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.5;
}


/* LOGOUT BUTTON */

.settings-logout-button {
  min-height: 44px;
  padding: 0 18px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 1px solid rgba(255, 90, 90, 0.18);
  border-radius: 11px;

  background: rgba(255, 70, 70, 0.055);
  color: #ff8585;

  font-weight: 700;
  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.settings-logout-button:hover {
  background: rgba(255, 70, 70, 0.11);
  border-color: rgba(255, 100, 100, 0.32);
  color: #ff9b9b;
  transform: translateY(-1px);
}

.settings-logout-button:active {
  transform: translateY(0);
}

.settings-logout-button:focus-visible {
  outline: 2px solid rgba(255, 110, 110, 0.45);
  outline-offset: 3px;
}

#forgot-password-view[hidden] {
  display: none !important;
}

.auth-success {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.05);
  color: #2563eb;
  font-size: 0.82rem;
}

#new-password-view[hidden] {
  display: none !important;
}

/* =========================
   THEME TOGGLE BUTTON
========================= */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 18px;
  transition: 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}


/* =========================
   DARK MODE
========================= */

html[data-theme="dark"] {
  color-scheme: dark;

  --bg-primary: #090b0d;
  --bg-card: #121519;
  --bg-card-hover: #161a1f;

  --text-primary: #f3f5f1;
  --text-secondary: #adb4ad;
  --text-muted: #737b75;

  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --accent-soft: rgba(96, 165, 250, 0.1);

  --danger: #f07178;
  --danger-soft: rgba(240, 113, 120, 0.12);

  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.13);

  --shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
}


/* Background */

html[data-theme="dark"] body {
  background:
    radial-gradient(
      circle at 80% -10%,
      rgba(96, 165, 250, 0.07),
      transparent 28rem
    ),
    var(--bg-primary);

  color: var(--text-primary);
}


/* Sidebar */

html[data-theme="dark"] .sidebar {
  background: rgba(10, 12, 14, 0.94);
}


/* Navigation */

html[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}


/* Sidebar card */

html[data-theme="dark"] .sidebar-card {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.015)
    );
}

html[data-theme="dark"] .mini-progress {
  background: rgba(255, 255, 255, 0.08);
}


/* Profile */

html[data-theme="dark"] .profile__avatar {
  background: #242a25;
}


/* Buttons */

html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.055);
}


/* Language */

html[data-theme="dark"] .button,
html[data-theme="dark"] .language__trigger {
  background: var(--bg-card);
}

html[data-theme="dark"] .language__menu {
  background: #171a1e;
}


/* Cards + panels */

html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .panel {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.012),
      transparent 42%
    ),
    var(--bg-card);
}


/* Habits */

html[data-theme="dark"] .habit-row {
  background: rgba(255, 255, 255, 0.023);
}

html[data-theme="dark"] .habit-row:hover {
  background: rgba(255, 255, 255, 0.038);
}

html[data-theme="dark"] .habit-row__icon {
  background: rgba(255, 255, 255, 0.05);
}


/* Progress ring */

html[data-theme="dark"] .progress-ring {
  background:
    conic-gradient(
      var(--accent) 67%,
      rgba(255, 255, 255, 0.07) 0
    );
}


/* Tracker */

html[data-theme="dark"] .tracker-cell span {
  border-color: rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.022);
}

html[data-theme="dark"] .tracker-table th:first-child,
html[data-theme="dark"] .tracker-table td:first-child {
  background: var(--bg-card);
}


/* Primary button */

html[data-theme="dark"] .button--primary {
  color: #ffffff;
}

/* =========================
   AUTH THEME TOGGLE
========================= */

.auth-theme-toggle {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  padding: 0;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);

  font-size: 18px;

  cursor: pointer;

  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  transition: 0.2s ease;
}

.auth-theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}


/* DARK MODE */

html[data-theme="dark"] .auth-theme-toggle {
  background: rgba(18, 21, 25, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
/* =========================================================
   AUTH SCREEN — DARK MODE
========================================================= */

html[data-theme="dark"] .auth-screen {
  background:
    radial-gradient(
      circle at 30% 25%,
      rgba(37, 99, 235, 0.12),
      transparent 30%
    ),
    radial-gradient(
      circle at 72% 25%,
      rgba(59, 130, 246, 0.08),
      transparent 28%
    ),
    #090b0d;

  color: #f3f5f1;
}


/* LEFT SIDE */

html[data-theme="dark"] .auth-showcase {
  border-right-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .auth-brand {
  color: #f3f5f1;
}

html[data-theme="dark"] .auth-title {
  color: #f3f5f1;
}

html[data-theme="dark"] .auth-description {
  color: #94a3b8;
}

html[data-theme="dark"] .auth-benefit strong {
  color: #f3f5f1;
}

html[data-theme="dark"] .auth-benefit p {
  color: #94a3b8;
}

html[data-theme="dark"] .auth-benefit__icon {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}


/* STAIRS */

html[data-theme="dark"] .auth-steps span {
  border-color: rgba(96, 165, 250, 0.15);

  background:
    linear-gradient(
      180deg,
      rgba(96, 165, 250, 0.16),
      rgba(15, 23, 30, 0.95)
    );

  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.04),
    0 8px 20px rgba(0, 0, 0, 0.2);
}


/* STATS */

html[data-theme="dark"] .auth-stats,
html[data-theme="dark"] .auth-weekly {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 21, 25, 0.92);
}

html[data-theme="dark"] .auth-stat {
  border-right-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .auth-stat small,
html[data-theme="dark"] .auth-weekly__chart small {
  color: #737b75;
}

html[data-theme="dark"] .auth-weekly__header span {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  color: #adb4ad;
}


/* RIGHT SIDE */

html[data-theme="dark"] .auth-form-side {
  background:
    radial-gradient(
      circle at center,
      rgba(37, 99, 235, 0.08),
      transparent 45%
    );
}


/* LOGIN CARD */

html[data-theme="dark"] .auth-card {
  border-color: rgba(255, 255, 255, 0.08);

  background:
    linear-gradient(
      180deg,
      rgba(18, 21, 25, 0.98),
      rgba(12, 15, 18, 0.99)
    );

  box-shadow:
    0 35px 80px rgba(0, 0, 0, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .auth-card__header h2 {
  color: #f3f5f1;
}

html[data-theme="dark"] .auth-card__header p {
  color: #94a3b8;
}


/* TABS */

html[data-theme="dark"] .auth-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .auth-tab {
  color: #737b75;
}

html[data-theme="dark"] .auth-tab.active {
  color: #f3f5f1;
}


/* FORM LABELS */

html[data-theme="dark"] .auth-field > span {
  color: #d5d9dc;
}


/* INPUTS */

html[data-theme="dark"] .auth-input {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .auth-input:focus-within {
  border-color: rgba(96, 165, 250, 0.5);

  background: rgba(255, 255, 255, 0.055);

  box-shadow:
    0 0 0 4px rgba(96, 165, 250, 0.08);
}

html[data-theme="dark"] .auth-input input {
  color: #f3f5f1;
}

html[data-theme="dark"] .auth-input input::placeholder {
  color: #737b75;
}

html[data-theme="dark"] .auth-input__icon,
html[data-theme="dark"] .auth-password-toggle {
  color: #737b75;
}


/* REMEMBER / LINKS */

html[data-theme="dark"] .auth-remember {
  color: #adb4ad;
}


/* THEME BUTTON */

html[data-theme="dark"] .auth-theme-toggle {
  border-color: rgba(255, 255, 255, 0.1);

  background: rgba(18, 21, 25, 0.9);

  color: #ffffff;
}


/* FOOTER */

html[data-theme="dark"] .auth-footer {
  color: #737b75;
}