:root {
  --bg: #080b0a;
  --panel: #111514;
  --panel-2: #171c1a;
  --line: #252b29;
  --text: #f5f7f4;
  --muted: #89928e;
  --lime: #c9ff3d;
  --lime-soft: rgba(201, 255, 61, .12);
  --blue: #75baff;
  --orange: #ff9652;
  --danger: #ff6d6d;
  --radius: 22px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, label:has(input:focus-visible) span { outline: 2px solid var(--lime); outline-offset: 3px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; padding: 30px 20px 24px; border-right: 1px solid var(--line); background: rgba(8, 11, 10, .94); backdrop-filter: blur(20px); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; line-height: 1.05; font-family: "Segoe UI", sans-serif; font-size: .9rem; }
.brand-mark, .coach-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--lime); color: #11180a; font: 800 1.25rem "Segoe UI", sans-serif; transform: rotate(-3deg); box-shadow: 0 0 30px rgba(201,255,61,.16); }
.side-nav { display: grid; gap: 7px; margin-top: 56px; }
.nav-link { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; text-align: left; }
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active { color: var(--text); background: var(--panel-2); }
.nav-link.active::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.nav-link svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 14px 12px; border-top: 1px solid var(--line); color: var(--muted); }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { color: var(--text); font-size: .85rem; }
.sidebar-foot small { margin-top: 2px; font-size: .75rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }

main { margin-left: 224px; padding: 0 4vw 72px; }
.topbar { min-height: 118px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--lime); font-size: .72rem; font-weight: 700; letter-spacing: .14em; }
h1, h2 { margin: 0; font-family: "Segoe UI", sans-serif; letter-spacing: -.035em; }
h1 { font-size: clamp(1.45rem, 2.4vw, 2rem); }
h2 { font-size: 1.25rem; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.connection i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.connection.offline i { background: var(--danger); }
.primary, .icon-btn { border: 0; cursor: pointer; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 13px; background: var(--lime); color: #11150d; font-weight: 800; box-shadow: 0 8px 30px rgba(201,255,61,.12); }
.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.primary.compact { min-height: 42px; }
.primary.full { width: 100%; margin-top: 20px; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--panel); }
.icon-btn svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.page { display: none; animation: page-in .35s ease; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); gap: 18px; }
.goal-card, .coach-card, .stat-card, .chart-card, .recent-card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); }
.goal-card { position: relative; min-height: 285px; padding: 30px; overflow: hidden; background: radial-gradient(circle at 78% 30%, rgba(201,255,61,.12), transparent 32%), linear-gradient(135deg, #151a17, #0e1210); }
.goal-copy { position: relative; z-index: 2; max-width: 65%; }
.pill { display: inline-block; padding: 7px 10px; border: 1px solid rgba(201,255,61,.26); border-radius: 99px; color: var(--lime); background: var(--lime-soft); font-size: .67rem; font-weight: 700; letter-spacing: .12em; }
.goal-card h2 { margin-top: 26px; font-size: clamp(1.75rem, 3.4vw, 3.25rem); line-height: 1.04; }
.goal-card h2 em { color: var(--lime); font-style: normal; }
.goal-card p { color: var(--muted); }
.momentum { position: absolute; right: 4%; top: 50%; width: 210px; height: 210px; transform: translateY(-50%); }
.orbit { position: absolute; inset: 0; border: 1px solid rgba(201,255,61,.2); border-radius: 46% 54% 52% 48%; }
.orbit-one { transform: rotate(18deg); }
.orbit-two { inset: 18px; transform: rotate(61deg); border-style: dashed; border-color: rgba(201,255,61,.34); }
.orbit-three { inset: 42px; transform: rotate(-20deg); background: rgba(201,255,61,.035); }
.momentum-core { position: absolute; inset: 64px; display: grid; place-items: center; align-content: center; border-radius: 50%; background: var(--lime); color: #10150b; box-shadow: 0 0 45px rgba(201,255,61,.16); }
.momentum-core strong { font-size: 1.8rem; line-height: 1; }
.momentum-core span { margin-top: 4px; font-size: .62rem; line-height: 1.15; text-align: center; font-weight: 700; }
.milestone { position: absolute; left: 30px; bottom: 22px; display: flex; gap: 10px; align-items: center; }
.milestone span { color: var(--muted); font-size: .64rem; letter-spacing: .1em; }
.milestone strong { font-size: .78rem; }

.coach-card { padding: 25px; display: flex; min-height: 285px; flex-direction: column; background: linear-gradient(145deg, #171d1a, #101412); }
.coach-head { display: flex; align-items: center; gap: 12px; }
.coach-head .coach-avatar { width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; }
.coach-head small, .coach-head strong { display: block; }
.coach-head small, .card-heading small, .stat-card small { color: var(--muted); font-size: .68rem; letter-spacing: .11em; }
.coach-head strong { margin-top: 2px; }
blockquote { margin: 30px 0 20px; font: 600 clamp(1.05rem, 1.6vw, 1.35rem)/1.45 "Segoe UI", sans-serif; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--lime); font-weight: 700; cursor: pointer; }
.coach-card .text-button { margin-top: auto; text-align: left; }

.stat-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat-card { position: relative; padding: 22px 24px; }
.stat-card strong { display: block; margin: 16px 0 1px; font: 800 clamp(1.8rem, 3vw, 2.5rem) "Segoe UI", sans-serif; }
.stat-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.stat-icon { position: absolute; right: 20px; top: 20px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-weight: 700; }
.stat-icon.lime { background: var(--lime-soft); color: var(--lime); }
.stat-icon.blue { background: rgba(117,186,255,.12); color: var(--blue); }
.stat-icon.orange { background: rgba(255,150,82,.12); color: var(--orange); }

.chart-card, .recent-card { padding: 25px; }
.card-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.card-heading h2 { margin-top: 5px; }
.chart-total { color: var(--lime); font-weight: 700; }
.weekly-chart { height: 186px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 11px; padding-top: 24px; }
.bar-column { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 8px; color: var(--muted); font-size: .7rem; }
.bar-track { position: relative; width: min(34px, 72%); height: 130px; display: flex; align-items: end; border-radius: 9px; background: #1d2320; overflow: hidden; }
.bar { width: 100%; min-height: 3px; border-radius: 9px; background: linear-gradient(to top, #86ad27, var(--lime)); transition: height .7s ease; }
.bar-column.today { color: var(--text); }
.bar-column.today .bar-track { outline: 1px solid rgba(201,255,61,.22); }
.recent-card { min-width: 0; }
.session-list { margin-top: 18px; }
.session-row { display: grid; grid-template-columns: 44px minmax(110px,1fr) repeat(3,minmax(60px,.45fr)) 26px; gap: 13px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.session-row:hover { background: rgba(255,255,255,.015); }
.activity-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--panel-2); font-size: 1.1rem; }
.session-main strong, .session-main small, .metric strong, .metric small { display: block; }
.session-main small, .metric small { color: var(--muted); font-size: .72rem; }
.metric strong { margin-top: 3px; font-size: .88rem; }
.row-arrow { color: var(--muted); font-size: 1.1rem; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.skeleton-row { height: 69px; border-top: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(255,255,255,.025), transparent); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.section-heading { margin: 15px 0 28px; }
.section-heading h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter { padding: 9px 14px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; }
.filter.active { color: #10150b; border-color: var(--lime); background: var(--lime); font-weight: 700; }
.session-list.expanded { padding: 5px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.drop-zone { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px dashed #3b4540; border-radius: var(--radius); background: linear-gradient(135deg, rgba(201,255,61,.04), transparent); cursor: pointer; text-align: center; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--lime); background: var(--lime-soft); }
.drop-zone svg { width: 36px; fill: none; stroke: var(--lime); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone span { color: var(--muted); font-size: .84rem; }
.asset-list { display: grid; gap: 8px; margin-top: 18px; }
.asset-row { display: grid; grid-template-columns: 42px 1fr auto auto; align-items: center; gap: 13px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: inherit; text-decoration: none; }
.asset-row:hover { border-color: #3e4844; }
.file-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--lime-soft); color: var(--lime); font-weight: 800; font-size: .7rem; }
.asset-row strong, .asset-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-row small { margin-top: 3px; color: var(--muted); }
.asset-row > span:last-child { color: var(--muted); }
.asset-status { padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); font-size: .65rem; white-space: nowrap; }
.asset-status.pending { background: var(--lime-soft); color: var(--lime); }

.mobile-nav { display: none; }
dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100vh - 28px); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: #111614; color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
dialog form, #detail-content { padding: 30px; }
dialog h2 { margin-bottom: 24px; font-size: 1.65rem; }
.login-dialog { width: min(430px, calc(100% - 24px)); }
.login-dialog::backdrop { background: #080b0a; }
.login-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 24px; border-radius: 50%; background: var(--lime); color: #11180a; font: 900 1.55rem "Segoe UI", sans-serif; }
.login-dialog label + label, .settings-block label + label { margin-top: 14px; }
.form-error { min-height: 1.2em; margin: 14px 0 0; color: var(--danger); font-size: .8rem; text-align: center; }
.settings-block { display: grid; gap: 12px; margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.settings-block h3 { margin: 0 0 4px; font-size: 1rem; }
.settings-block .primary { justify-self: start; margin-top: 4px; }
.danger-text { margin-top: 22px; color: var(--danger); }
.coach-insight { display: grid; gap: 8px; margin-top: 20px; padding: 18px; border: 1px solid rgba(201,255,61,.2); border-radius: 15px; background: var(--lime-soft); }
.coach-insight small { color: var(--lime); font-weight: 800; letter-spacing: .08em; }
.coach-insight p { margin: 0 0 8px; line-height: 1.5; }
.close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--panel-2); cursor: pointer; font-size: 1.5rem; }
.activity-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.activity-picker input { position: absolute; opacity: 0; }
.activity-picker span { min-height: 70px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 1.25rem; }
.activity-picker small { color: var(--muted); font-size: .73rem; }
.activity-picker input:checked + span { border-color: var(--lime); background: var(--lime-soft); }
.activity-picker input:checked + span small { color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
form label { display: grid; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 600; }
input, textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: #0c100e; color: var(--text); }
textarea { resize: vertical; margin-top: 12px; }
.detail-hero { margin: -30px -30px 24px; padding: 30px; border-radius: 24px 24px 0 0; background: linear-gradient(135deg, var(--lime-soft), transparent); }
.detail-hero .big-icon { font-size: 2.2rem; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-box { padding: 14px; border-radius: 13px; background: var(--panel-2); }
.detail-box small, .detail-box strong { display: block; }
.detail-box small { color: var(--muted); }
.detail-box strong { margin-top: 4px; }
.detail-notes { margin-top: 20px; color: #cbd1ce; line-height: 1.6; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 360px; padding: 13px 17px; border: 1px solid #344039; border-radius: 13px; background: #18201c; opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .sidebar { width: 82px; padding-inline: 14px; }
  .brand > span:last-child, .nav-link:not(.active)::after, .nav-link { font-size: 0; }
  .brand { justify-content: center; }
  .nav-link { justify-content: center; padding: 13px; }
  .nav-link svg { width: 22px; }
  .sidebar-foot span:not(.status-dot) { display: none; }
  .sidebar-foot { justify-content: center; }
  main { margin-left: 82px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .goal-card, .coach-card, .stat-grid { grid-column: 1; }
  .coach-card { min-height: 220px; }
}

@media (max-width: 680px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .sidebar { display: none; }
  main { margin-left: 0; padding: 0 16px 94px; }
  .topbar { min-height: 92px; }
  .topbar h1 { font-size: 1.35rem; }
  .connection span, .primary.compact svg { display: none; }
  .primary.compact { min-height: 40px; padding: 0 13px; }
  .dashboard-grid { gap: 13px; }
  .goal-card { min-height: 305px; padding: 23px; }
  .goal-copy { max-width: 90%; }
  .goal-card h2 { margin-top: 18px; font-size: 2rem; }
  .momentum { right: -25px; top: 65%; width: 175px; height: 175px; opacity: .8; }
  .momentum-core { inset: 54px; }
  .milestone { left: 23px; bottom: 20px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 16px 12px; }
  .stat-icon { display: none; }
  .stat-card strong { font-size: 1.45rem; }
  .stat-card p { display: none; }
  .stat-card small { font-size: .57rem; letter-spacing: .06em; }
  .chart-card, .recent-card { padding: 19px 16px; }
  .session-row { grid-template-columns: 42px 1fr auto 18px; }
  .session-row .metric:nth-of-type(2), .session-row .metric:nth-of-type(3) { display: none; }
  .section-heading { align-items: end; }
  .section-heading .primary { padding-inline: 13px; font-size: .82rem; }
  .session-list.expanded { padding: 4px 13px; }
  .mobile-nav { position: fixed; z-index: 50; left: 10px; right: 10px; bottom: max(9px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; min-height: 67px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 21px; background: rgba(16,21,19,.94); backdrop-filter: blur(18px); box-shadow: 0 15px 50px rgba(0,0,0,.5); }
  .mobile-nav button { display: grid; place-items: center; gap: 2px; border: 0; background: transparent; color: var(--muted); font-size: .62rem; }
  .mobile-nav button span { font-size: 1.05rem; }
  .mobile-nav button.active { color: var(--lime); }
  .mobile-nav .add-mobile { place-self: center; width: 48px; height: 48px; margin-top: -25px; border-radius: 16px; background: var(--lime); color: #10150b; font-size: 1.8rem; box-shadow: 0 8px 25px rgba(201,255,61,.25); }
  dialog { margin: auto auto 8px; width: calc(100% - 16px); max-height: calc(100vh - 20px); border-radius: 22px; }
  dialog form, #detail-content { padding: 24px 18px; }
  .activity-picker { grid-template-columns: repeat(4, 1fr); }
  .activity-picker span { min-height: 64px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .toast { left: 16px; right: 16px; bottom: 90px; }
}

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