:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-2: rgba(248, 250, 252, 0.78);
  --line: rgba(15, 23, 42, 0.10);
  --line-strong: rgba(15, 23, 42, 0.18);
  --text: #111827;
  --soft: #334155;
  --muted: #64748b;
  --accent: #10b981;
  --accent-2: #2563eb;
  --danger: #e11d48;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.14), transparent 32rem),
    linear-gradient(220deg, rgba(37, 99, 235, 0.10), transparent 34rem),
    linear-gradient(180deg, #fbfdff 0%, #eef4f8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.52), transparent 72%);
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.94));
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(16, 185, 129, 0.22);
}

.login-panel h1 {
  margin: 28px 0 8px;
  font-size: 34px;
  line-height: 1;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.field span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  outline: none;
}

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

input:focus, select:focus, textarea:focus {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.11);
}

select, select option {
  color: var(--text);
  background-color: #ffffff;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
}

.mobile-menu-button,
.mobile-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 34px;
}

.nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav button::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.22);
}

.nav button:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.045);
}

.nav button.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16), rgba(37, 99, 235, 0.06));
}

.nav button.active::before {
  background: var(--accent);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.45);
}

.main {
  min-width: 0;
  width: min(1480px, 100%);
  padding: 30px;
}

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

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1;
}

.workspace {
  display: grid;
  gap: 18px;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(170px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.week-day {
  min-height: 320px;
  min-width: 170px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

.week-day h3 {
  margin: 0;
  text-transform: capitalize;
}

.card, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), rgba(248, 251, 253, 0.90));
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.10);
}

.card { padding: 18px; }
.panel { padding: 20px; }

.hero-panel {
  min-height: 230px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(37, 99, 235, 0.10) 48%, rgba(255, 255, 255, 0.62)),
    #ffffff;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 50%;
}

.section-title {
  margin: 0 0 14px;
  font-size: 18px;
}

.kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-title {
  margin: 10px 0;
  max-width: 680px;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1;
}

.stat-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  background: rgba(255, 255, 255, 0.72);
}

.stat-value {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  font-weight: 850;
}

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

.between { justify-content: space-between; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 13px;
  border-radius: 8px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.045);
  border: 1px solid var(--line);
  text-align: center;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(15, 23, 42, 0.075);
}

.btn.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  font-weight: 820;
}

.btn.danger {
  color: #9f1239;
  background: rgba(225, 29, 72, 0.08);
  border-color: rgba(225, 29, 72, 0.22);
}

.btn.ghost { background: transparent; }

.list {
  display: grid;
  gap: 10px;
}

.item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.workout-card, .exercise-card {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.72));
}

.workout-card:hover, .exercise-card:hover {
  border-color: rgba(16, 185, 129, 0.28);
}

.item-title {
  font-weight: 780;
  color: var(--text);
}

.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.notification-item.unread {
  border-color: rgba(16, 185, 129, 0.32);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.10), rgba(255, 255, 255, 0.80));
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--soft);
  font-size: 12px;
  background: rgba(15, 23, 42, 0.035);
}

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

.full { grid-column: 1 / -1; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.progress > span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.24);
}

.timer {
  padding: 14px 18px;
  border: 1px solid rgba(16, 185, 129, 0.26);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.08);
  font-size: clamp(42px, 8vw, 82px);
  font-weight: 900;
  line-height: 1;
}

.focus {
  min-height: calc(100vh - 130px);
  display: grid;
  align-content: center;
  gap: 18px;
}

.focus .panel:first-of-type {
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(37, 99, 235, 0.08)),
    rgba(255, 255, 255, 0.92);
}

.set-row {
  display: grid;
  grid-template-columns: auto 1fr 108px 118px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.035);
}

.set-check {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.set-check.done {
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.chart {
  width: 100%;
  height: 160px;
}

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(7, minmax(210px, 1fr)); }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }

  .mobile-menu-button {
    position: fixed;
    left: 14px;
    top: 14px;
    z-index: 30;
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: var(--shadow);
  }

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    background: rgba(15, 23, 42, 0.32);
  }

  .mobile-backdrop.show {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 310px);
    height: 100vh;
    z-index: 25;
    padding: 74px 18px 18px;
    border-right: 1px solid var(--line);
    border-top: 0;
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar .brand { display: flex; }

  .nav {
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 22px;
  }

  .nav button {
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .nav button::before { display: block; }

  .main {
    padding: 72px 14px 24px;
  }

  .topbar { align-items: flex-start; }
  .grid, .form-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 34px; }
  .between { align-items: flex-start; }
  .set-row { grid-template-columns: auto 1fr; }
}
