/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ── */
:root {
    --bg-primary:       #0e0e16;
    --bg-secondary:     #13131e;
    --bg-tertiary:      #171724;
    --bg-card:          rgba(255, 255, 255, 0.055);
    --border:           rgba(255, 255, 255, 0.09);
    --borderH:          rgba(255, 255, 255, 0.18);
    --shadow-card:      0 2px 12px rgba(0,0,0,0.3), 0 4px 24px rgba(255,107,53,0.06);
    --text-primary:     #ffffff;
    --text-secondary:   rgba(255, 255, 255, 0.82);
    --text-muted:       rgba(255, 255, 255, 0.5);
    --orange:           #FF6B35;
    --orange-dark:      #E5532B;
    --orange-light:     #FF8A5B;
    --accent-glow:      rgba(255, 107, 53, 0.38);
    --accent-glow-soft: rgba(255, 107, 53, 0.14);
    --glow-blue:        rgba(79, 172, 254, 0.18);
    --glow-purple:      rgba(168, 85, 247, 0.13);
    --gradient-accent:  linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    --green:            #4ADE80;
    --red:              #F87171;
    --blue:             #60A5FA;
    --radius-card:      18px;
    --radius-sm:        12px;
    --sidebar:          248px;
    --topbar:           60px;
    --g300: rgba(255,255,255,0.85);
    --g500: rgba(255,255,255,0.5);
    --g600: rgba(255,255,255,0.35);
    --g700: rgba(255,255,255,0.2);
}

html, body {
    height: 100%;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 16px;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }

/* Noise texture */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.022;
    pointer-events: none;
    z-index: 9998;
}

/* ── Glow orbs ── */
.glow-orb { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: -1; }
.glow-orb-1 { top: -10%; left: -5%; width: 600px; height: 600px; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%); animation: float-slow 12s ease-in-out infinite; }
.glow-orb-2 { top: 30%; right: -10%; width: 500px; height: 500px; background: radial-gradient(circle, var(--glow-blue) 0%, transparent 70%); animation: float-slow 15s ease-in-out infinite reverse; }
.glow-orb-3 { bottom: 10%; left: 20%; width: 400px; height: 400px; background: radial-gradient(circle, var(--glow-purple) 0%, transparent 70%); animation: float-slow 10s ease-in-out infinite 2s; }
.glow-orb-4 { bottom: -15%; right: 10%; width: 550px; height: 550px; background: radial-gradient(circle, var(--accent-glow-soft) 0%, transparent 70%); animation: float-slow 14s ease-in-out infinite 1s; }
@keyframes float-slow {
    0%,100% { transform: translate(0,0) scale(1); }
    33%      { transform: translate(30px,-20px) scale(1.05); }
    66%      { transform: translate(-20px,20px) scale(0.95); }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ══════════════════════════════
   LOADING
══════════════════════════════ */
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); z-index: 9999; }
.spinner { width: 28px; height: 28px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════
   LOGIN
══════════════════════════════ */
#login-screen { display: none; min-height: 100vh; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-logo { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 48px; font-weight: 800; letter-spacing: 2px; line-height: 1; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.login-logo-icon { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: #111; padding: 6px; box-sizing: border-box; }
.logo-forge { color: #0a0a0f; }
.logo-fit   { color: #FF6B35; }
body.light .logo-forge { color: #0a0a0f; }
/* dark mode — forge goes white so it reads on dark bg */
body:not(.light) .logo-forge { color: #ffffff; }
.login-tag  { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-muted); margin-bottom: 48px; letter-spacing: 0.02em; }
.login-box  { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.magic-input { width: 100%; padding: 15px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 15px; outline: none; transition: border-color .2s; }
.magic-input:focus { border-color: var(--orange); }
.magic-input::placeholder { color: var(--text-muted); }
.btn-orange { width: 100%; padding: 15px; background: var(--gradient-accent); color: #0a0a0f; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700; box-shadow: 0 4px 24px var(--accent-glow); transition: transform .15s, box-shadow .15s; }
.btn-orange:hover  { transform: translateY(-2px); box-shadow: 0 8px 32px var(--accent-glow); }
.btn-orange:active { transform: scale(.98); }
.btn-orange:disabled { opacity: .5; pointer-events: none; }
.msg { padding: 12px 16px; border-radius: 10px; font-size: 14px; display: none; }
.msg-error   { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.2); color: var(--red); }
.msg-success { background: rgba(74,222,128,.08);  border: 1px solid rgba(74,222,128,.2);  color: var(--green); }
.login-foot { margin-top: 24px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* Login card */
.login-card { width: 100%; max-width: 380px; background: linear-gradient(145deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 32px 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 8px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.07); margin-bottom: 0; }
.login-card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); text-align: center; margin-bottom: 4px; letter-spacing: -0.01em; }

/* Auth buttons */
.auth-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; border: none; }
.auth-btn:hover  { transform: translateY(-1px); }
.auth-btn:active { transform: scale(.98); opacity: .9; }
.auth-btn:disabled { opacity: .5; pointer-events: none; }

.auth-btn-google { background: #fff; color: #1f1f1f; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.auth-btn-google:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

.auth-btn-apple  { background: #111; color: #fff; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.auth-btn-apple:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }

.auth-btn-magic  { background: var(--gradient-accent); color: #0a0a0f; box-shadow: 0 4px 20px var(--accent-glow); font-weight: 700; }
.auth-btn-magic:hover { box-shadow: 0 6px 28px var(--accent-glow); }

/* Divider */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Light mode overrides */
body.light .login-card { background: linear-gradient(145deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.7) 100%); box-shadow: 0 8px 40px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.9); }
body.light .auth-btn-apple { background: #1d1d1f; }
body.light .auth-btn-google { box-shadow: 0 2px 8px rgba(0,0,0,0.1); border: 1px solid #e0e0e0; }

/* No-data screen */
.no-data-screen { display: none; min-height: 100vh; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.no-data-card { width: 100%; max-width: 420px; background: linear-gradient(145deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 40px 32px; box-shadow: 0 8px 40px rgba(0,0,0,0.4); }
.no-data-icon { width: 64px; height: 64px; background: rgba(255,107,53,0.12); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.no-data-icon svg { color: var(--orange); }
.no-data-title { font-size: 20px; font-weight: 800; color: var(--text-primary); margin-bottom: 10px; letter-spacing: -0.02em; }
.no-data-sub { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 28px; }
.no-data-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.no-data-badge { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 30px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.btn-no-data-logout { padding: 10px 20px; font-size: 13px; color: var(--text-muted); background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif; transition: color .2s, border-color .2s; }
.btn-no-data-logout:hover { color: var(--text-primary); border-color: var(--text-muted); }
body.light .no-data-card { background: linear-gradient(145deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.7) 100%); box-shadow: 0 8px 40px rgba(0,0,0,0.12); }

/* ══════════════════════════════
   APP SHELL
══════════════════════════════ */
#app { display: none; height: 100vh; }

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar); background: rgba(12,12,20,0.88); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 200; }
.sidebar-top { padding: 22px 18px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 11px; }
.brand { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 21px; font-weight: 800; letter-spacing: 1px; background: var(--gradient-accent); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-icon { width: 28px; height: 28px; border-radius: 50%; background: #111; padding: 4px; box-sizing: content-box; }
.light-icon { display: none; }

.sidebar-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; font-size: 0.9375rem; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; user-select: none; letter-spacing: -0.01em; position: relative; }
.nav-link:hover  { background: rgba(255,255,255,.05); color: var(--text-secondary); }
.nav-link.active {
    background: linear-gradient(90deg, rgba(255,107,53,.22) 0%, rgba(255,107,53,.07) 100%);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 2px 16px rgba(255,107,53,.12);
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: var(--gradient-accent);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(255,107,53,.6);
}
.nav-link.active .nav-ic { color: var(--orange); }
.nav-ic { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-foot { padding: 12px 10px; border-top: 1px solid var(--border); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; margin-bottom: 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,107,53,.15); border: 1px solid rgba(255,107,53,.3); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--orange); flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name  { font-size: 13px; font-weight: 600; line-height: 1.3; }
.user-email { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.signout-btn { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; width: 100%; font-size: 13px; font-weight: 500; color: var(--text-muted); transition: background .15s, color .15s; }
.signout-btn:hover { background: rgba(248,113,113,.07); color: var(--red); }

/* Main content */
.main { margin-left: var(--sidebar); min-height: 100vh; overflow-y: auto; height: 100vh; }

/* Mobile topbar */
.topbar { display: none; position: fixed; top: 0; left: 0; right: 0; height: var(--topbar); background: rgba(12,12,20,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); align-items: center; justify-content: space-between; padding: 0 18px; z-index: 200; }
.topbar-brand { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; font-weight: 800; letter-spacing: 1px; background: var(--gradient-accent); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.topbar-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,107,53,.15); border: 1px solid rgba(255,107,53,.3); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--orange); overflow: hidden; }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Bottom nav */
.bottomnav { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: rgba(12,12,20,0.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border); align-items: center; justify-content: space-around; z-index: 200; padding-bottom: env(safe-area-inset-bottom); }
.bnav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 12px; color: var(--text-muted); font-size: 10px; font-weight: 600; letter-spacing: .02em; cursor: pointer; transition: color .15s; }
.bnav-item.active { color: var(--orange); }
.bnav-item svg { width: 20px; height: 20px; }

/* ── Entrance animation ── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Pages ── */
.page { display: none; padding: 40px 44px; max-width: 1100px; }
.page.active { display: block; animation: fadeSlideUp 0.38s cubic-bezier(0.16, 1, 0.3, 1) both; }

.pg-title {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 16px;
    line-height: 1.2;
    position: relative;
}
.pg-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -7px;
    width: 38px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255,107,53,.5);
}
.pg-sub   { font-size: 1.0625rem; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }

/* ── Cards ── */
.card {
    background: linear-gradient(145deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-card);
    padding: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.07) inset, 0 0 0 1px rgba(255,107,53,0.04);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover {
    border-color: rgba(255,107,53,0.35);
    box-shadow: 0 20px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,107,53,0.15), 0 1px 0 rgba(255,255,255,0.08) inset;
    transform: translateY(-2px);
}
.card-label { font-size: 0.75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }

/* ── Grids ── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.g3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }

/* ── Stat cards ── */
.stat-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-card);
    padding: 22px 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.07) inset;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.stat-card:hover { border-color: rgba(255,107,53,0.35); transform: translateY(-2px); box-shadow: 0 20px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,107,53,0.15); }
.stat-num  { font-size: 2.25rem; font-weight: 800; line-height: 1; letter-spacing: -1.5px; }
.stat-unit { font-size: 0.875rem; color: var(--text-muted); margin-left: 3px; font-weight: 500; }
.stat-lbl  { font-size: 0.8125rem; color: var(--text-muted); margin-top: 6px; }

/* ══════════════════════════════
   DASHBOARD
══════════════════════════════ */
.ring-section { display: flex; align-items: center; gap: 28px; padding: 24px; }
.ring-wrap { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.ring-wrap svg { transform: rotate(-90deg); }
.r-bg   { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 8; }
.r-fill { fill: none; stroke: url(#ringGrad); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.ring-info  { flex: 1; }
.ring-title { font-size: 0.6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.ring-desc  { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.55; }
.pillars { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pillar { display: flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--text-muted); transition: all .2s; }
.pillar.on { border-color: rgba(74,222,128,.3); color: var(--green); background: rgba(74,222,128,.06); }
.pillar-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.week-strip { display: flex; gap: 8px; }
.wday { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; transition: border-color .2s; }
.wday.today { border-color: rgba(255,107,53,.4); background: rgba(255,107,53,.05); }
.wday-lbl { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.wday.today .wday-lbl { color: var(--orange); }
.wday-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.12); }
.wday.done  .wday-dot { background: var(--green); box-shadow: 0 0 6px rgba(74,222,128,.5); }
.wday.today .wday-dot { background: var(--orange); box-shadow: 0 0 6px var(--accent-glow); }
.wday-n { font-size: 11px; color: var(--text-muted); }
/* ── Pillar cards ──────────────────────────────────────────── */
.pillars-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.pillar-card {
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: var(--radius-card);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 230px;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    border-top: 3px solid transparent;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.06) inset;
}
.pillar-card:hover { transform: translateY(-3px); box-shadow: 0 20px 48px rgba(0,0,0,0.4); }
.pillar-nut {
    border-top-color: var(--orange);
    border-color: rgba(255,107,53,.2);
    border-top-color: var(--orange);
    background: linear-gradient(160deg, rgba(255,107,53,.1) 0%, rgba(255,107,53,.025) 55%, rgba(14,14,22,.4) 100%);
}
.pillar-wk  {
    border-top-color: #60A5FA;
    border-color: rgba(96,165,250,.2);
    border-top-color: #60A5FA;
    background: linear-gradient(160deg, rgba(96,165,250,.1) 0%, rgba(96,165,250,.025) 55%, rgba(14,14,22,.4) 100%);
}
.pillar-slp {
    border-top-color: #A78BFA;
    border-color: rgba(167,139,250,.2);
    border-top-color: #A78BFA;
    background: linear-gradient(160deg, rgba(167,139,250,.1) 0%, rgba(167,139,250,.025) 55%, rgba(14,14,22,.4) 100%);
}
.pillar-h2o {
    border-top-color: #22D3EE;
    border-color: rgba(34,211,238,.2);
    border-top-color: #22D3EE;
    background: linear-gradient(160deg, rgba(34,211,238,.1) 0%, rgba(34,211,238,.025) 55%, rgba(14,14,22,.4) 100%);
}

.pc-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pc-icon   { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.pillar-nut .pc-icon { color: var(--orange); }
.pillar-wk  .pc-icon { color: #60A5FA; }
.pillar-slp .pc-icon { color: #A78BFA; }
.pillar-h2o .pc-icon { color: #22D3EE; }
.pc-name   { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }

.pc-main   { font-size: 2.2rem; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.pillar-nut .pc-main { color: var(--orange); }
.pillar-wk  .pc-main { color: #60A5FA; }
.pillar-slp .pc-main { color: #A78BFA; }
.pillar-h2o .pc-main { color: #22D3EE; }
.pc-unit   { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); margin-left: 3px; }
.pc-sub    { font-size: 11px; color: var(--text-muted); }
.pc-divider { height: 1px; background: var(--border); margin: 10px 0; }
.pc-row    { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 2px 0; }
.pc-rl     { color: var(--text-muted); font-size: 12px; }
.pc-rv     { font-weight: 700; }
.pc-rv-sub { font-size: 10px; font-weight: 400; color: var(--text-muted); }

@media (max-width: 900px) { .pillars-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pillars-grid { grid-template-columns: 1fr; } }

/* Streak strip */
.week-streak      { display: flex; justify-content: space-between; gap: 4px; }
.streak-day       { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.streak-lbl       { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.streak-ring-wrap { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.streak-ring-wrap svg { position: absolute; inset: 0; }
.streak-score     { position: relative; font-size: 10px; font-weight: 800; letter-spacing: -0.3px; color: var(--text-primary); z-index: 1; }
.streak-date      { font-size: 10px; font-weight: 500; color: var(--text-muted); }
.streak-date-today { color: var(--orange); font-weight: 700; }

.wday-click { cursor: pointer; }
.wday-click:hover { border-color: var(--borderH); transform: translateY(-1px); }

/* Day popup */
.wday-popup { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 10px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 10px 14px; font-size: 13px; animation: fadeIn .15s ease; }
.wday-popup-date { color: var(--text-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.wday-popup-name { font-weight: 600; flex: 1; }
.wday-popup-close { font-size: 12px; color: var(--text-muted); padding: 2px 6px; border-radius: 6px; }
.wday-popup-close:hover { color: var(--text-primary); }

.workout-type-tag { display: inline-block; padding: 4px 12px; background: rgba(255,107,53,.1); border: 1px solid rgba(255,107,53,.2); border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); }
.wk-stats { display: flex; gap: 20px; margin: 12px 0; }
.wk-stat  { font-size: 13px; color: var(--text-muted); }
.wk-stat strong { color: var(--text-primary); font-weight: 600; }
.btn-app { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; background: var(--gradient-accent); color: #0a0a0f; border-radius: 10px; font-size: 13px; font-weight: 700; box-shadow: 0 4px 20px var(--accent-glow-soft); transition: transform .15s, box-shadow .15s; }
.btn-app:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--accent-glow); }

/* ══════════════════════════════
   PROGRAM PAGE
══════════════════════════════ */
.prog-overview {
    display: flex; align-items: center; gap: 28px;
    padding: 28px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
}
.prog-overview-main { flex: 1; }
.prog-plan-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.375rem; font-weight: 700; letter-spacing: -.2px; margin-bottom: 6px; }
.prog-plan-meta { font-size: 0.9375rem; color: var(--text-muted); }
.prog-bar  { height: 4px; background: rgba(255,255,255,.07); border-radius: 2px; margin-top: 16px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--gradient-accent); border-radius: 2px; transition: width 1s ease; }
.prog-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 7px; }
.prog-week-big { font-size: 3.5rem; font-weight: 800; line-height: 1; text-align: right; letter-spacing: -2px; background: var(--gradient-accent); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.prog-week-lbl { font-size: 0.8125rem; color: var(--text-muted); text-align: right; margin-top: 4px; letter-spacing: .02em; }

.phase-item { margin-bottom: 8px; }
.phase-header { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; user-select: none; transition: border-color .2s, background .2s; backdrop-filter: blur(10px); box-shadow: var(--shadow-card); }
.phase-header:hover   { border-color: var(--borderH); background: rgba(255,255,255,.05); }
.phase-header.current { border-color: rgba(255,107,53,.35); background: rgba(255,107,53,.04); }
.phase-num-badge { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.06); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.phase-header.current .phase-num-badge { background: rgba(255,107,53,.15); border-color: rgba(255,107,53,.4); color: var(--orange); }
.phase-header-info { flex: 1; }
.phase-header-name { font-size: 1rem; font-weight: 700; letter-spacing: -.2px; }
.phase-header-meta { font-size: 0.875rem; color: var(--text-muted); margin-top: 3px; }
.phase-current-tag { font-size: 0.6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); background: rgba(255,107,53,.1); padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.phase-chevron { color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.phase-chevron.open { transform: rotate(90deg); }
.phase-body { display: none; padding: 8px 0 4px 0; }
.phase-body.open { display: block; }

.week-item { margin-bottom: 6px; }
.week-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: rgba(255,255,255,.025); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; user-select: none; transition: border-color .2s, background .2s; }
.week-header:hover { border-color: var(--borderH); background: rgba(255,255,255,.04); }
.week-header.current-week { border-color: rgba(255,107,53,.25); background: rgba(255,107,53,.03); }
.week-num-label { font-size: 0.875rem; font-weight: 800; color: var(--text-primary); flex-shrink: 0; width: 52px; letter-spacing: -.3px; }
.week-theme { font-size: 0.875rem; color: var(--text-muted); flex: 1; }
.week-header.current-week .week-theme { color: var(--text-secondary); }
.week-deload { font-size: 11px; font-weight: 600; color: var(--blue); background: rgba(96,165,250,.1); padding: 3px 9px; border-radius: 20px; }
.week-chevron { color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.week-chevron.open { transform: rotate(90deg); }
.week-body { display: none; padding: 4px 0 6px 14px; }
.week-body.open { display: block; }

.wrow { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 5px; cursor: pointer; transition: border-color .2s, background .2s; box-shadow: var(--shadow-card); }
.wrow:hover      { border-color: var(--borderH); background: rgba(255,255,255,.06); }
.wrow.today-row  { border-color: rgba(255,107,53,.3); }
.wrow.rest       { opacity: .35; cursor: default; }
.wrow-day  { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); width: 26px; flex-shrink: 0; }
.wrow.today-row .wrow-day { color: var(--orange); }
.wrow-name { font-size: 1rem; font-weight: 600; letter-spacing: -.1px; }
.wrow-meta { font-size: 0.8125rem; color: var(--text-muted); margin-top: 3px; }
.today-pill { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); background: rgba(255,107,53,.1); padding: 4px 10px; border-radius: 20px; flex-shrink: 0; }
.wrow-chevron { color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.wrow-chevron.open { transform: rotate(90deg); }

.ex-list { display: none; padding: 4px 0 8px 40px; }
.ex-list.open { display: block; }
.ex-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.ex-row:last-of-type { border-bottom: none; }
.ex-num { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,107,53,.1); border: 1px solid rgba(255,107,53,.2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--orange); flex-shrink: 0; margin-top: 1px; }
.ex-content { flex: 1; min-width: 0; }
.ex-name  { font-size: 0.9375rem; font-weight: 600; margin-bottom: 4px; letter-spacing: -.1px; }
.ex-sets  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.55; }
.ex-notes { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; font-style: italic; line-height: 1.55; }
.ex-video-wrap { width: 76px; height: 52px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.05); border: 1px solid var(--border); position: relative; cursor: pointer; }
.ex-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-play-btn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); transition: background .15s; }
.ex-play-btn:hover { background: rgba(255,107,53,.55); }
.ex-play-btn svg { width: 18px; height: 18px; color: #fff; }
.ex-no-video { width: 76px; height: 52px; flex-shrink: 0; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.ex-video-player { display: none; width: 100%; margin-top: 10px; border-radius: 10px; overflow: hidden; }
.ex-video-player.show { display: block; }
.ex-video-player video { width: 100%; display: block; border-radius: 10px; max-height: 240px; }

/* ── Skeleton shimmer ── */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}
.skel {
    background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 6px;
}
body.light .skel {
    background: linear-gradient(90deg, rgba(0,0,0,.05) 25%, rgba(0,0,0,.11) 50%, rgba(0,0,0,.05) 75%);
    background-size: 600px 100%;
}
.skel-line  { height: 13px; margin-bottom: 9px; }
.skel-title { height: 22px; margin-bottom: 12px; }
.skel-card  { padding: 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); margin-bottom: 12px; backdrop-filter: blur(10px); box-shadow: var(--shadow-card); }
.skel-row   { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; box-shadow: var(--shadow-card); }
.skel-circle { flex-shrink: 0; border-radius: 50%; }

/* ── Week pills ──────────────────────────────────────────── */
.wk-pills { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0 14px; }
.wk-pill { padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg-card); cursor: pointer; transition: border-color .15s, color .15s, background .15s; white-space: nowrap; }
.wk-pill:hover { border-color: var(--borderH); color: var(--text-secondary); }
.wk-pill.wk-pill-current { border-color: rgba(255,107,53,.45); color: var(--orange); background: rgba(255,107,53,.08); }

/* ── Week cards ──────────────────────────────────────────── */
.wk-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 14px; backdrop-filter: blur(10px); box-shadow: var(--shadow-card); }
.wk-card-current { border-color: rgba(255,107,53,.3); box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,107,53,.1); }
.wk-card-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: rgba(255,255,255,.025); border-bottom: 1px solid var(--border); }
.wk-card-current .wk-card-head { background: rgba(255,107,53,.04); border-bottom-color: rgba(255,107,53,.18); }
.wk-card-num { font-size: 0.8125rem; font-weight: 800; color: var(--text-primary); letter-spacing: -.2px; flex-shrink: 0; }
.wk-card-theme { font-size: 0.8125rem; color: var(--text-muted); flex: 1; }
.wk-card-cur-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); background: rgba(255,107,53,.1); padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.wk-empty { padding: 16px 18px; font-size: 0.8125rem; color: var(--text-muted); font-style: italic; }

/* ── Day sections ────────────────────────────────────────── */
.day-section { padding: 18px 18px 20px; border-bottom: 1px solid var(--border); }
.day-section:last-child { border-bottom: none; }
.day-section.day-today { background: rgba(255,107,53,.02); }
.day-section.day-rest { opacity: .45; }
.day-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.day-section.day-rest .day-head { margin-bottom: 0; }
.day-badge { width: 38px; height: 38px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; text-transform: uppercase; letter-spacing: .02em; }
.day-today .day-badge { background: rgba(255,107,53,.12); border-color: rgba(255,107,53,.3); color: var(--orange); }
.day-info { flex: 1; min-width: 0; }
.day-name { font-size: 0.9375rem; font-weight: 600; letter-spacing: -.1px; }
.day-name.day-name-today { color: var(--orange); }
.day-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }

/* ── Exercise grid ───────────────────────────────────────── */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

/* ── Exercise cards ──────────────────────────────────────── */
.ex-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,.03); display: flex; flex-direction: column; transition: border-color .2s, transform .15s; }
.ex-card:hover { border-color: var(--borderH); transform: translateY(-2px); }
.ex-card-warmup { border-color: rgba(255,107,53,.25); background: rgba(255,107,53,.03); }
.ex-card-thumb { position: relative; aspect-ratio: 1; background: rgba(255,255,255,.05); overflow: hidden; flex-shrink: 0; }
.ex-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.ex-card-thumb:hover img { transform: scale(1.05); }
.ex-card-nothumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.18); }
.ex-card-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .15s; cursor: pointer; }
.ex-card-thumb:hover .ex-card-play { opacity: 1; }
.ex-card-play svg { color: #fff; }
.ex-warmup-tag { position: absolute; top: 5px; left: 5px; font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; background: var(--orange); color: #fff; border-radius: 4px; }
.ex-card-body { padding: 10px 11px 12px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ex-card-name { font-size: 12px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ex-card-sets { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.ex-card-method { font-size: 10px; color: var(--orange); font-weight: 500; text-transform: capitalize; }
.ex-card-weight { font-size: 10px; color: var(--text-muted); }
.ex-card-thumb-play { cursor: pointer; }

/* ── Video modal ─────────────────────────────────────────── */
#vid-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 9000; align-items: center; justify-content: center; padding: 24px; }
#vid-modal.open { display: flex; }
.vid-modal-box { position: relative; width: 100%; max-width: 780px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: 0 32px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,107,53,.1); animation: modal-in .18s ease; }
@keyframes modal-in { from { transform: scale(.93); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.vid-modal-close { position: absolute; top: 12px; right: 12px; z-index: 1; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; color: #fff; transition: background .15s; }
.vid-modal-close:hover { background: rgba(255,107,53,.7); }
.vid-modal-name { padding: 18px 20px 12px; font-size: 1rem; font-weight: 700; letter-spacing: -.1px; }
#vid-modal-video { width: 100%; display: block; max-height: 60vh; background: #000; }

/* Recommendation card */
.rec-card { padding: 26px 28px; }
.rec-header { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.rec-header-title { font-size: 0.875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange); }
.rec-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.rec-chip { display: flex; align-items: center; gap: 6px; padding: 5px 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 20px; font-size: 0.8125rem; }
.rec-chip-label { color: var(--text-muted); }
.rec-chip-val   { font-weight: 600; color: var(--text-secondary); }
.rec-goal-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.rec-goal-pill { font-size: 0.875rem; font-weight: 600; padding: 6px 16px; border-radius: 20px; }
.rec-goal-pill.recommended { background: rgba(96,165,250,.1); border: 1px solid rgba(96,165,250,.25); color: var(--blue); }
.rec-goal-pill.selected    { background: rgba(255,107,53,.1); border: 1px solid rgba(255,107,53,.25); color: var(--orange); }
.rec-reasoning { font-size: 0.9375rem; line-height: 1.8; color: var(--text-secondary); padding: 18px 22px; background: rgba(255,255,255,.03); border-left: 3px solid rgba(255,107,53,.45); border-radius: 0 12px 12px 0; }

.section-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }

/* Profile hero */
.profile-hero {
    display: flex; align-items: center; gap: 20px;
    background: linear-gradient(145deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-card);
    padding: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.07) inset;
}
.profile-avatar      { flex-shrink: 0; }
.profile-avatar-img  { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.profile-avatar-initials { width: 80px; height: 80px; border-radius: 50%; background: rgba(255,107,53,.12); border: 2px solid rgba(255,107,53,.3); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--orange); }
.profile-hero-info   { flex: 1; min-width: 140px; }
.profile-name        { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
.profile-email       { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.profile-since       { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.profile-hero-stats  { display: flex; gap: 20px; flex-wrap: wrap; }
.profile-hero-stat   { text-align: center; }
.profile-hero-val    { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.3px; }
.profile-hero-lbl    { font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════
   LOGS PAGE
══════════════════════════════ */
.tab-row { display: flex; gap: 3px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 12px; padding: 4px; width: fit-content; margin-bottom: 24px; backdrop-filter: blur(10px); }
.tab-btn { padding: 8px 22px; border-radius: 9px; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); transition: background .15s, color .15s; }
.tab-btn.active { background: rgba(255,255,255,.08); color: var(--text-primary); }

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

#load-more-btn { display: flex; justify-content: center; padding: 16px 0 4px; }
.load-more-btn { padding: 10px 32px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; }
.load-more-btn:hover { border-color: var(--orange); color: var(--orange); background: rgba(255,107,53,.06); }
.log-item { display: flex; align-items: center; gap: 16px; padding: 17px 22px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; transition: border-color .2s; backdrop-filter: blur(10px); box-shadow: var(--shadow-card); }
.log-item:hover { border-color: rgba(255,107,53,0.3); box-shadow: 0 20px 40px rgba(255,107,53,0.12); }
.log-date  { text-align: center; width: 38px; flex-shrink: 0; }
.log-d     { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.log-m     { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: .04em; }
.log-info  { flex: 1; }
.log-name  { font-size: 1rem; font-weight: 600; letter-spacing: -.1px; }
.log-sub   { font-size: 0.8125rem; color: var(--text-muted); margin-top: 3px; }
.log-val   { font-size: 1.5rem; font-weight: 800; text-align: right; letter-spacing: -.5px; }
.log-val-u { font-size: 0.75rem; color: var(--text-muted); text-align: right; }

.empty { text-align: center; padding: 64px 24px; color: var(--text-muted); font-size: 0.9375rem; line-height: 1.6; }
.empty svg { width: 32px; height: 32px; margin: 0 auto 14px; display: block; }

/* ══════════════════════════════
   WORKOUT DRILL-DOWN
══════════════════════════════ */
.log-item-workout { cursor: pointer; }
.drill-chevron { color: var(--text-muted); flex-shrink: 0; transition: transform .2s; margin-left: 8px; }
.drill-chevron.open { transform: rotate(90deg); }
.drill-body { display: none; margin-bottom: 8px; }
.drill-body.open { display: block; }
.drill-loading { padding: 14px 22px; font-size: 13px; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border); border-top: none; border-radius: 0 0 14px 14px; }
.drill-exercise { padding: 17px 22px; background: rgba(255,255,255,.02); border: 1px solid var(--border); border-top: none; }
.drill-exercise:last-child { border-radius: 0 0 14px 14px; }
.drill-ex-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.drill-ex-name   { font-size: 0.9375rem; font-weight: 700; letter-spacing: -.1px; }
.drill-ex-meta   { font-size: 0.8125rem; color: var(--text-muted); }
.drill-sets { display: flex; flex-direction: column; gap: 5px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: rgba(255,255,255,.03); border-radius: 8px; font-size: 0.875rem; }
.set-row.skipped { opacity: .4; }
.set-num  { color: var(--text-muted); width: 44px; flex-shrink: 0; font-size: 12px; }
.set-val  { font-weight: 600; flex: 1; }
.set-skip { font-size: 11px; color: var(--text-muted); font-style: italic; }
.sub-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); background: rgba(96,165,250,.1); padding: 3px 8px; border-radius: 20px; }

/* ══════════════════════════════
   ANALYTICS PAGE
══════════════════════════════ */
/* Program progress summary */
.prog-summary-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.025) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-card);
    padding: 24px;
    margin-top: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.06) inset;
}
.prog-summary-top  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.prog-week-label   { font-size: 1.75rem; font-weight: 800; letter-spacing: -1px; margin-top: 4px; }
.prog-summary-stats { display: flex; gap: 24px; }
.prog-stat         { text-align: center; }
.prog-stat-val     { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
.prog-stat-lbl     { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }
.prog-bar-wrap     { height: 8px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; }
.prog-bar-fill     { height: 100%; background: var(--gradient-accent); border-radius: 99px; transition: width .8s ease; }
.prog-bar-labels   { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); margin-top: 6px; }

/* Custom date range picker */
.custom-range { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.custom-range label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.custom-range input[type="date"] { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-family: inherit; font-size: 13px; padding: 6px 10px; }
.custom-range input[type="date"]:focus { outline: none; border-color: var(--orange); }

.range-row { display: flex; gap: 3px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; padding: 3px; width: fit-content; margin-bottom: 24px; backdrop-filter: blur(10px); }
.range-btn { padding: 7px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); transition: background .15s, color .15s; }
.range-btn.active { background: rgba(255,255,255,.08); color: var(--text-primary); }
.chart-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.025) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-card);
    padding: 26px;
    margin-bottom: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.07) inset;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.chart-card:hover { border-color: rgba(255,107,53,0.35); box-shadow: 0 20px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,107,53,0.12); transform: translateY(-2px); }
.chart-title { font-size: 0.6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 20px; }
.chart-wrap { position: relative; height: 200px; }

/* ══════════════════════════════
   EXPORT PAGE
══════════════════════════════ */
.export-list { display: flex; flex-direction: column; gap: 10px; }
.export-item { display: flex; align-items: center; gap: 18px; padding: 22px 26px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); transition: border-color .2s, transform .2s; backdrop-filter: blur(10px); box-shadow: var(--shadow-card); }
.export-item:hover { border-color: rgba(255,107,53,0.3); transform: translateY(-4px); box-shadow: 0 20px 40px rgba(255,107,53,0.12); }
.export-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,107,53,.08); border: 1px solid rgba(255,107,53,.15); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.export-name { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.1px; }
.export-desc { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; line-height: 1.55; }
.dl-btn { display: flex; align-items: center; gap: 7px; padding: 10px 20px; background: transparent; border: 1px solid var(--border); border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-muted); transition: border-color .15s, color .15s, background .15s; flex-shrink: 0; }
.dl-btn:hover    { border-color: var(--orange); color: var(--orange); background: rgba(255,107,53,.06); }
.dl-btn:disabled { opacity: .4; pointer-events: none; }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 768px) {
    .sidebar   { display: none; }
    .topbar    { display: flex; }
    .bottomnav { display: flex; }
    .main      { margin-left: 0; padding-top: var(--topbar); padding-bottom: 68px; height: auto; }
    .page      { padding: 20px 16px; }
    .g4 { grid-template-columns: 1fr 1fr; }
    .g3 { grid-template-columns: 1fr 1fr; }
    .g2 { grid-template-columns: 1fr; }
    .ring-section { flex-direction: column; gap: 20px; text-align: center; }
    .ring-info { width: 100%; }
    .pillars { justify-content: center; }
    .prog-overview { flex-direction: column; gap: 16px; align-items: flex-start; }
    .prog-week-big, .prog-week-lbl { text-align: left; }
    .ex-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
}
@media (max-width: 480px) {
    .ex-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 7px; }
}
@media (max-width: 480px) {
    .g4 { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════
   LIGHT MODE
══════════════════════════════ */
body.light {
    --bg-primary:       #f0f1f6;
    --g300: rgba(13,13,22,0.85);
    --g500: rgba(13,13,22,0.52);
    --g600: rgba(13,13,22,0.38);
    --g700: rgba(13,13,22,0.25);
    --bg-secondary:     #e8eaf2;
    --bg-tertiary:      #e2e4ee;
    --bg-card:          rgba(255, 255, 255, 0.95);
    --border:           rgba(0, 0, 0, 0.07);
    --borderH:          rgba(0, 0, 0, 0.14);
    --shadow-card:      0 2px 12px rgba(0,0,0,0.05);
    --text-primary:     #0d0d16;
    --text-secondary:   rgba(13, 13, 22, 0.78);
    --text-muted:       rgba(13, 13, 22, 0.52);
    --accent-glow:      rgba(255, 107, 53, 0.22);
    --accent-glow-soft: rgba(255, 107, 53, 0.09);
    --glow-blue:        rgba(79, 172, 254, 0.1);
    --glow-purple:      rgba(168, 85, 247, 0.07);
}
body.light { background: var(--bg-primary); }

body.light .sidebar { background: rgba(255,255,255,0.96); border-right-color: rgba(0,0,0,0.07); }
body.light .topbar, body.light .bottomnav { background: rgba(255,255,255,0.96); border-color: rgba(0,0,0,0.07); }
body.light .nav-link:hover { background: rgba(0,0,0,0.04); }
body.light .nav-link.active {
    background: linear-gradient(90deg, rgba(255,107,53,.12) 0%, rgba(255,107,53,.04) 100%);
    box-shadow: none;
}

body.light .card,
body.light .stat-card,
body.light .chart-card,
body.light .export-item,
body.light .log-item,
body.light .phase-header,
body.light .wrow,
body.light .prog-overview,
body.light .prog-summary-card,
body.light .profile-hero,
body.light .skel-card,
body.light .skel-row {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border-color: rgba(0,0,0,0.07);
}
body.light .pillar-nut { background: rgba(255,107,53,.06); border-color: rgba(255,107,53,.15); }
body.light .pillar-wk  { background: rgba(96,165,250,.06);  border-color: rgba(96,165,250,.15); }
body.light .pillar-slp { background: rgba(167,139,250,.06); border-color: rgba(167,139,250,.15); }
body.light .pillar-h2o { background: rgba(34,211,238,.06);  border-color: rgba(34,211,238,.15); }
body.light .week-header { background: rgba(255,255,255,0.7); }
body.light .tab-row, body.light .range-row { background: rgba(255,255,255,0.7); }
body.light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
body.light .set-row      { background: rgba(0,0,0,0.025); }
body.light .drill-exercise { background: rgba(0,0,0,0.015); }
body.light .drill-loading  { background: #fff; }
body.light .wday { background: rgba(255,255,255,0.85); }
body.light .rec-reasoning  { background: rgba(255,107,53,0.04); }
body.light .rec-chip { background: rgba(0,0,0,0.04); }
body.light .wk-card { background: rgba(255,255,255,0.95); }
body.light .wk-card-head { background: rgba(0,0,0,0.03); border-bottom-color: rgba(0,0,0,0.07); }
body.light .ex-card { background: rgba(255,255,255,0.95); }
body.light .ex-card-thumb { background: rgba(0,0,0,0.06); }
body.light .ex-card-nothumb { color: rgba(0,0,0,0.2); }
body.light .day-badge { background: rgba(0,0,0,0.05); }
body.light .wk-pill { background: rgba(255,255,255,0.9); }

/* ══════════════════════════════
   THEME TOGGLE
══════════════════════════════ */
.theme-toggle { display: flex; align-items: center; gap: 9px; padding: 9px 14px; margin-bottom: 2px; cursor: pointer; border-radius: 10px; transition: background .15s; }
.theme-toggle:hover { background: rgba(255,255,255,.04); }
body.light .theme-toggle:hover { background: rgba(0,0,0,.04); }
.theme-toggle-label { font-size: 13px; font-weight: 500; color: var(--text-muted); flex: 1; }
.toggle-track { position: relative; width: 40px; height: 22px; background: rgba(255,255,255,.1); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; transition: background .2s, border-color .2s; flex-shrink: 0; }
body.light .toggle-track { background: rgba(0,0,0,.08); }
.toggle-track.on { background: var(--gradient-accent); border-color: transparent; }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.toggle-track.on .toggle-thumb { transform: translateX(18px); }
.toggle-icon { font-size: 14px; }

/* ── Utility ── */
.mt12 { margin-top: 12px; }
.mt20 { margin-top: 20px; }
.mt24 { margin-top: 24px; }
.flex    { display: flex; }
.items-c { align-items: center; }
.between { justify-content: space-between; }
