/* ======================================================
   FitApp Pro — Modern Trainer UI v2
   Top navbar · Animated backgrounds · SVG gym icons
   ====================================================== */

:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --secondary: #10b981;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0a1a14;
    --neon: #39ff85;
    --neon-dim: rgba(57, 255, 133, 0.10);
    --neon-glow: 0 0 12px rgba(57, 255, 133, 0.20);
    --neon-border: rgba(57, 255, 133, 0.18);
    --gray-50: #f0f4f3;
    --gray-100: #e4eae8;
    --gray-200: #d0d9d5;
    --gray-300: #a8b5af;
    --gray-400: #7d8e85;
    --gray-500: #5a6b63;
    --gray-600: #3e4f47;
    --gray-700: #2a3830;
    --gray-800: #1a2520;
    --surface: #ffffff;
    --surface-raised: #f7faf9;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 1px 3px rgba(10,26,20,0.06), 0 1px 2px rgba(10,26,20,0.04);
    --shadow-md: 0 4px 12px rgba(10,26,20,0.07), 0 2px 4px rgba(10,26,20,0.04);
    --shadow-lg: 0 12px 32px rgba(10,26,20,0.10), 0 4px 8px rgba(10,26,20,0.06);
    --shadow-neon: 0 4px 20px rgba(57,255,133,0.06);
    --font-heading: 'Exo 2', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; touch-action: pan-y; }

body {
    font-family: var(--font-body);
    background: linear-gradient(160deg, #0c1a13 0%, #0e1f18 30%, #0a1812 60%, #081510 100%);
    background-attachment: fixed;
    color: var(--gray-200);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); letter-spacing: -0.01em; }

/* ══════════════════════════════════════════════
   TOP NAVBAR
   ══════════════════════════════════════════════ */
.topnav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: linear-gradient(135deg, #0d1f17 0%, #0a1a14 50%, #081510 100%);
    z-index: 100;
    border-bottom: 1px solid var(--neon-border);
    box-shadow: 0 2px 20px rgba(0,0,0,0.15), 0 0 30px rgba(57,255,133,0.03);
}

.topnav-inner {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 6px;
}

/* Logo */
.topnav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: white;
    margin-right: 16px;
    flex-shrink: 0;
}

.topnav-logo img {
    width: 36px; height: 36px;
    object-fit: contain; border-radius: 10px;
}

.topnav-logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
    font-family: var(--font-heading);
    color: white;
    box-shadow: var(--neon-glow);
    border: 1px solid var(--neon-border);
}

.topnav-logo span {
    font-family: var(--font-heading);
    font-weight: 700; font-size: 16px;
    letter-spacing: 0.02em;
}

/* Menu labels */
.topnav-menus {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.topnav-menu { position: relative; }

.topnav-menu-label {
    display: flex; align-items: center;
    padding: 8px 14px;
    color: rgba(255,255,255,0.55);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease);
    user-select: none;
    white-space: nowrap;
    position: relative;
}

.topnav-menu-label:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(57,255,133,0.06);
}

.topnav-menu-label.is-active {
    color: #fff;
}

.topnav-menu-label.is-active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 20px; height: 2px;
    background: var(--neon);
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(57,255,133,0.3);
}

/* Dropdown */
.topnav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 220px;
    background: rgba(12,26,19,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--neon-border);
    box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 30px rgba(57,255,133,0.04);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--ease);
    z-index: 200;
}

/* Corner accents on dropdown */
.topnav-dropdown::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 24px; height: 24px;
    border-top: 2px solid rgba(57,255,133,0.25);
    border-left: 2px solid rgba(57,255,133,0.25);
    border-radius: var(--radius) 0 0 0;
    pointer-events: none;
}

.topnav-dropdown::after {
    content: '';
    position: absolute;
    bottom: -1px; right: -1px;
    width: 24px; height: 24px;
    border-bottom: 2px solid rgba(57,255,133,0.25);
    border-right: 2px solid rgba(57,255,133,0.25);
    border-radius: 0 0 var(--radius) 0;
    pointer-events: none;
}

.topnav-menu.open > .topnav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dd-wide { min-width: 260px; }

.dd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s var(--ease);
    position: relative;
    overflow: hidden;
}

.dd-item svg { color: rgba(255,255,255,0.35); flex-shrink: 0; transition: color 0.15s; }

/* Reflection on hover */
.dd-item::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(57,255,133,0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    pointer-events: none;
}

.dd-item:hover {
    background: rgba(57,255,133,0.08);
    color: #fff;
}

.dd-item:hover svg { color: var(--neon); }
.dd-item:hover::before { opacity: 1; }

.dd-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
}

.dd-item.active svg { color: white; }

.dd-item.locked { opacity: 0.55; }

.dd-divider { height: 1px; background: rgba(57,255,133,0.08); margin: 4px 8px; }

.dd-badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: auto;
    font-family: var(--font-heading);
}

.dd-pro {
    background: #fff7ed;
    color: #ea580c;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 6px;
    margin-left: auto;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

/* Right section */
.topnav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Notifications */
.topnav-notif { position: relative; }

.topnav-notif-btn {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s var(--ease);
    position: relative;
}

.topnav-notif-btn:hover {
    background: rgba(57,255,133,0.08);
    color: white;
    border-color: var(--neon-border);
}

.topnav-notif-badge {
    position: absolute; top: -3px; right: -3px;
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #0a1a14;
    font-family: var(--font-heading);
}

.topnav-notif-panel {
    position: absolute; top: 50px; right: 0;
    width: 380px; max-height: 70vh;
    overflow-y: auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(57,255,133,0.04);
    border: 1px solid var(--neon-border);
}

.topnav-notif-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex; justify-content: space-between; align-items: center;
}

.topnav-notif-header strong { font-size: 15px; font-family: var(--font-heading); }
.topnav-notif-header button { background: none; border: none; color: var(--primary); font-size: 12px; cursor: pointer; font-weight: 700; font-family: var(--font-heading); }

#notif-list { padding: 8px; }

/* User area */
.topnav-user {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 24px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s var(--ease);
}

.topnav-user:hover { background: rgba(57,255,133,0.06); border-color: var(--neon-border); }

.topnav-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: white;
    font-family: var(--font-heading);
    flex-shrink: 0;
}

.topnav-user-name {
    color: white; font-size: 13px; font-weight: 600;
    font-family: var(--font-heading);
}

.topnav-user-plan {
    font-size: 10px; font-weight: 700;
    color: var(--neon);
    background: rgba(57,255,133,0.1);
    padding: 2px 7px; border-radius: 6px;
    font-family: var(--font-heading);
    letter-spacing: 0.03em;
}

.topnav-logout {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.4);
    transition: all 0.2s var(--ease);
}

.topnav-logout:hover { color: #f87171; background: rgba(239,68,68,0.1); }

/* Mobile hamburger */
.topnav-burger {
    display: none;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: white; cursor: pointer;
    align-items: center; justify-content: center;
}

/* ══════════════════════════════════════════════
   ANIMATED BACKGROUND
   ══════════════════════════════════════════════ */
.bg-pattern {
    position: fixed; inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Subtle grid */
.bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(57,255,133,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57,255,133,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 20%, transparent 75%);
}

/* Floating glows */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.bg-glow-1 {
    width: 600px; height: 600px;
    background: rgba(57, 255, 133, 0.06);
    top: 5%; right: -10%;
    animation: glow-drift-1 20s ease-in-out infinite;
}

.bg-glow-2 {
    width: 500px; height: 500px;
    background: rgba(5, 150, 105, 0.05);
    bottom: 5%; left: -10%;
    animation: glow-drift-2 25s ease-in-out infinite;
}

.bg-glow-3 {
    width: 350px; height: 350px;
    background: rgba(16, 185, 129, 0.04);
    top: 45%; left: 35%;
    animation: glow-drift-3 18s ease-in-out infinite;
}

@keyframes glow-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-40px, 30px); }
    66% { transform: translate(20px, -20px); }
}

@keyframes glow-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(50px, -40px); }
}

@keyframes glow-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, 20px) scale(1.15); }
}

/* Floating geometric shapes */
.bg-float {
    position: absolute;
    border: 1px solid rgba(57, 255, 133, 0.08);
    border-radius: 12px;
    opacity: 0.6;
}

.bg-float-1 {
    width: 80px; height: 80px; top: 15%; left: 10%;
    transform: rotate(15deg);
    animation: float-1 22s ease-in-out infinite;
}

.bg-float-2 {
    width: 60px; height: 60px; top: 60%; right: 15%;
    border-radius: 50%;
    animation: float-2 18s ease-in-out infinite;
}

.bg-float-3 {
    width: 100px; height: 100px; bottom: 20%; left: 30%;
    transform: rotate(45deg);
    animation: float-3 25s ease-in-out infinite;
}

.bg-float-4 {
    width: 50px; height: 50px; top: 35%; right: 25%;
    transform: rotate(-20deg);
    animation: float-4 20s ease-in-out infinite;
}

.bg-float-5 {
    width: 70px; height: 70px; bottom: 35%; right: 8%;
    border-radius: 50%;
    border-style: dashed;
    animation: float-5 28s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: rotate(15deg) translate(0, 0); }
    50% { transform: rotate(25deg) translate(15px, -20px); }
}
@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 15px) scale(1.1); }
}
@keyframes float-3 {
    0%, 100% { transform: rotate(45deg) translate(0, 0); }
    50% { transform: rotate(55deg) translate(-20px, -15px); }
}
@keyframes float-4 {
    0%, 100% { transform: rotate(-20deg) translate(0, 0); }
    50% { transform: rotate(-10deg) translate(10px, 12px); }
}
@keyframes float-5 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-15px, -20px) rotate(180deg); }
}

/* ══════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════ */
.main {
    margin-top: var(--nav-h);
    padding: 28px 32px;
    min-height: calc(100vh - var(--nav-h));
    position: relative;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    background: transparent;
}

.main-content { position: relative; z-index: 1; max-width: 100%; overflow-x: hidden; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 26px;
}

.page-header h1 {
    font-size: 26px; font-weight: 800;
    color: #ffffff; font-family: var(--font-heading);
    letter-spacing: -0.02em;
    text-shadow: 0 0 30px rgba(57,255,133,0.1);
}

/* ══════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════ */
.card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    padding: 22px;
    margin-bottom: 18px;
    border: 1px solid rgba(57,255,133,0.10);
    position: relative;
    transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
    color: var(--gray-200);
}

.card::before {
    content: '';
    position: absolute; top: -1px; left: -1px;
    width: 28px; height: 28px;
    border-top: 2px solid var(--neon-border);
    border-left: 2px solid var(--neon-border);
    border-radius: var(--radius) 0 0 0;
    pointer-events: none; transition: all 0.3s var(--ease);
}

.card::after {
    content: '';
    position: absolute; bottom: -1px; right: -1px;
    width: 28px; height: 28px;
    border-bottom: 2px solid var(--neon-border);
    border-right: 2px solid var(--neon-border);
    border-radius: 0 0 var(--radius) 0;
    pointer-events: none; transition: all 0.3s var(--ease);
}

.card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), var(--shadow-neon);
    border-color: rgba(57,255,133,0.20);
}

.card:hover::before, .card:hover::after {
    width: 36px; height: 36px;
    border-color: rgba(57,255,133,0.3);
}

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h3 { font-size: 16px; font-weight: 700; font-family: var(--font-heading); color: #ffffff; }

/* ══════════════════════════════════════════════
   STAT CARDS
   ══════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 26px;
}

.stat-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex; align-items: center; gap: 16px;
    border: 1px solid rgba(57,255,133,0.10);
    transition: all 0.25s var(--ease);
    position: relative; overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(135deg, transparent 40%, rgba(57,255,133,0.04) 50%, transparent 60%);
    transform: rotate(45deg) translateY(100%);
    transition: transform 0.6s var(--ease);
    pointer-events: none;
}

.stat-card:hover::after { transform: rotate(45deg) translateY(-10%); }

.stat-card:hover {
    box-shadow: var(--shadow-md), var(--shadow-neon);
    transform: translateY(-2px);
    border-color: rgba(57,255,133,0.15);
}

.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; position: relative; z-index: 1;
}

.stat-card .stat-icon.blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
.stat-card .stat-icon.green { background: rgba(57,255,133,0.12); color: var(--neon); }
.stat-card .stat-icon.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.stat-card .stat-icon.orange { background: rgba(249,115,22,0.15); color: #fb923c; }

.stat-card .stat-info { position: relative; z-index: 1; }
.stat-card .stat-info h3 { font-size: 24px; font-weight: 800; color: #ffffff; font-family: var(--font-heading); }
.stat-card .stat-info p { font-size: 13px; color: var(--gray-300); margin: 0; }

/* ══════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════ */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

table th {
    text-align: left; padding: 12px 16px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--neon);
    border-bottom: 2px solid rgba(57,255,133,0.12);
    font-family: var(--font-heading);
}

table td {
    padding: 12px 16px; font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s var(--ease);
    color: var(--gray-200);
}

table tr { transition: background 0.15s var(--ease); }
table tr:hover td { background: rgba(57,255,133,0.04); }

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600;
    font-family: var(--font-heading);
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    position: relative; overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.4s var(--ease);
    pointer-events: none;
}

.btn:hover::after { left: 120%; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border-color: var(--neon-border);
    box-shadow: 0 2px 8px rgba(5,150,105,0.2);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 4px 16px rgba(5,150,105,0.3), var(--neon-glow);
    transform: translateY(-1px);
}

.btn-success { background: linear-gradient(135deg, var(--success), #34d399); color: white; border-color: var(--neon-border); }
.btn-success:hover { box-shadow: var(--neon-glow); transform: translateY(-1px); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #f87171); color: white; }
.btn-danger:hover { box-shadow: 0 4px 16px rgba(239,68,68,0.25); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--gray-200); border-color: rgba(255,255,255,0.12); }
.btn-secondary:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.2); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: white; }
.btn-warning:hover { box-shadow: 0 4px 16px rgba(245,158,11,0.25); transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-icon { padding: 8px; width: 38px; height: 38px; justify-content: center; border-radius: 10px; }

/* ══════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block; font-size: 12px; font-weight: 700;
    color: var(--gray-300); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.04em;
    font-family: var(--font-heading);
}

.form-control {
    width: 100%; padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.25s var(--ease);
    font-family: var(--font-body);
    color: #ffffff;
    background: rgba(255,255,255,0.06);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(57,255,133,0.1), var(--neon-glow);
}

.form-control:hover:not(:focus) { border-color: var(--gray-300); }

select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ══════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11.5px; font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

.badge-green { background: rgba(57,255,133,0.12); color: #065f46; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-orange { background: #fff7ed; color: #9a3412; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ══════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10,26,20,0.55);
    backdrop-filter: blur(6px);
    z-index: 200; align-items: center; justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: rgba(14,30,23,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 28px; width: 90%; max-width: 600px;
    max-height: 85vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(57,255,133,0.06);
    border: 1px solid var(--neon-border);
    position: relative;
    color: var(--gray-200);
}

.modal::before {
    content: ''; position: absolute; top: -1px; left: -1px;
    width: 36px; height: 36px;
    border-top: 2px solid rgba(57,255,133,0.3);
    border-left: 2px solid rgba(57,255,133,0.3);
    border-radius: var(--radius-lg) 0 0 0;
    pointer-events: none;
}

.modal::after {
    content: ''; position: absolute; bottom: -1px; right: -1px;
    width: 36px; height: 36px;
    border-bottom: 2px solid rgba(57,255,133,0.3);
    border-right: 2px solid rgba(57,255,133,0.3);
    border-radius: 0 0 var(--radius-lg) 0;
    pointer-events: none;
}

.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; font-family: var(--font-heading); color: #fff; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ══════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════ */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }

.tab {
    padding: 10px 20px; border: none; background: none;
    font-size: 13.5px; font-weight: 600; font-family: var(--font-heading);
    color: var(--gray-400); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: all 0.2s var(--ease); letter-spacing: 0.01em;
}

.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); text-shadow: 0 0 20px rgba(57,255,133,0.2); }

/* ══════════════════════════════════════════════
   GRID LAYOUTS
   ══════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ══════════════════════════════════════════════
   DAY CARD (TRAINING)
   ══════════════════════════════════════════════ */
.day-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px;
    border: 1px solid rgba(57,255,133,0.07);
    transition: all 0.25s var(--ease);
}

.day-card:hover { box-shadow: var(--shadow-md), var(--shadow-neon); border-color: rgba(57,255,133,0.15); }

.day-card-header {
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; font-weight: 700; font-size: 14px;
    font-family: var(--font-heading);
    display: flex; align-items: center; justify-content: space-between;
    letter-spacing: 0.02em; text-transform: uppercase;
}

.day-card-header.rest { background: linear-gradient(135deg, var(--gray-500), var(--gray-400)); }
.day-card-body { padding: 16px 20px; }

.exercise-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--gray-100);
    font-size: 14px; transition: background 0.15s var(--ease);
}

.exercise-row:last-child { border: none; }
.exercise-row:hover { background: rgba(57,255,133,0.02); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.exercise-row .ex-name { font-weight: 600; flex: 1; }
.exercise-row .ex-detail { color: var(--gray-500); margin-left: 12px; font-size: 13px; }

/* ══════════════════════════════════════════════
   NUTRITION
   ══════════════════════════════════════════════ */
.macro-bar {
    display: flex; height: 10px; border-radius: 5px;
    overflow: hidden; background: var(--gray-100); margin: 12px 0;
}

.macro-bar .protein { background: linear-gradient(90deg, #ef4444, #f87171); }
.macro-bar .carbs { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.macro-bar .fat { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.macro-labels { display: flex; gap: 20px; font-size: 13px; }
.macro-labels span { display: flex; align-items: center; gap: 6px; }
.macro-labels .dot { width: 10px; height: 10px; border-radius: 50%; }

.chart-container { width: 100%; height: 300px; position: relative; }

.meal-card {
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px;
    transition: all 0.2s var(--ease);
}

.meal-card:hover { border-color: rgba(57,255,133,0.2); box-shadow: var(--shadow-neon); }

.meal-card h4 {
    font-size: 15px; font-family: var(--font-heading);
    font-weight: 700; margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
}

.meal-card .meal-time { color: var(--gray-400); font-weight: 400; font-size: 13px; }

.food-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.food-item .food-name { flex: 1; }
.food-item .food-qty { color: var(--gray-500); width: 80px; text-align: right; }
.food-item .food-cals { color: var(--gray-500); width: 80px; text-align: right; }

/* ══════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.7; }
.empty-state p { font-size: 15px; font-family: var(--font-heading); }

/* ══════════════════════════════════════════════
   CALENDAR
   ══════════════════════════════════════════════ */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }

.calendar-day {
    aspect-ratio: 1; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 14px; cursor: pointer;
    transition: all 0.2s var(--ease); border: 1px solid transparent;
}

.calendar-day:hover { background: rgba(57,255,133,0.06); border-color: var(--neon-border); }

.calendar-day.today {
    background: rgba(57,255,133,0.12); color: var(--primary);
    font-weight: 700; border-color: var(--neon-border);
    box-shadow: var(--shadow-neon);
}

.calendar-day.has-event { position: relative; }
.calendar-day.has-event::after {
    content: ''; width: 6px; height: 6px;
    background: var(--neon); border-radius: 50%;
    position: absolute; bottom: 6px;
    box-shadow: 0 0 6px rgba(57,255,133,0.4);
}

/* ══════════════════════════════════════════════
   CHAT
   ══════════════════════════════════════════════ */
.chat-container { background: rgba(0,0,0,0.2); border-radius: var(--radius); min-height: 200px; }

.chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: 14px; margin-bottom: 10px; position: relative; word-wrap: break-word; }

.chat-sent {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; margin-left: auto; border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(5,150,105,0.15);
}

.chat-received {
    background: rgba(255,255,255,0.08); color: var(--gray-200);
    border: 1px solid rgba(255,255,255,0.1); margin-right: auto;
    border-bottom-left-radius: 4px;
}

.chat-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.chat-time { font-size: 11px; opacity: 0.7; margin-top: 4px; text-align: right; }

.chat-tag {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 4px; padding: 2px 8px; border-radius: 4px;
    display: inline-block; font-family: var(--font-heading);
}

.chat-sent .chat-tag { background: rgba(255,255,255,0.2); }
.chat-received .chat-tag { background: rgba(57,255,133,0.1); color: var(--primary); }

/* ══════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════ */
.toast {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--dark); color: white;
    padding: 14px 24px; border-radius: var(--radius-sm);
    font-size: 14px; font-family: var(--font-heading);
    box-shadow: var(--shadow-lg); z-index: 300;
    transform: translateY(100px); opacity: 0;
    transition: all 0.35s var(--ease);
    border: 1px solid var(--neon-border);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.toast.error { background: linear-gradient(135deg, #dc2626, #ef4444); border-color: rgba(239,68,68,0.3); }

/* ══════════════════════════════════════════════
   MEDIA
   ══════════════════════════════════════════════ */
.media-thumb {
    width: 50px; height: 50px; object-fit: cover;
    border-radius: 8px; cursor: pointer;
    transition: all 0.2s var(--ease); border: 1px solid var(--gray-200);
}

.media-thumb:hover { transform: scale(1.08); box-shadow: var(--shadow-neon); border-color: var(--neon-border); }

/* ══════════════════════════════════════════════
   PROFILE HEADER
   ══════════════════════════════════════════════ */
.user-profile-header {
    position: relative; border-radius: var(--radius-lg);
    overflow: hidden; margin-bottom: 24px;
    border: 1px solid var(--neon-border);
}

.user-profile-bg {
    height: 160px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--primary-dark));
    background-size: 200% 200%;
    animation: profile-gradient 8s ease infinite;
}

@keyframes profile-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.user-profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    border: 4px solid var(--surface);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800; color: white;
    font-family: var(--font-heading);
    margin-top: -40px; margin-left: 24px; position: relative;
    background-size: cover; background-position: center;
    box-shadow: 0 4px 16px rgba(5,150,105,0.2);
}

.user-profile-info { padding: 12px 24px 20px; background: var(--surface); }

/* ══════════════════════════════════════════════
   THEME OPTIONS
   ══════════════════════════════════════════════ */
.theme-options { display: flex; gap: 10px; flex-wrap: wrap; }

.theme-option {
    cursor: pointer; text-align: center; padding: 8px;
    border: 2px solid var(--gray-200); border-radius: 12px;
    transition: all 0.25s var(--ease); width: 80px;
}

.theme-option.active { border-color: var(--primary); background: rgba(57,255,133,0.06); box-shadow: var(--neon-glow); }
.theme-option:hover { border-color: var(--gray-400); transform: translateY(-2px); }
.theme-option span { font-size: 12px; font-weight: 600; display: block; margin-top: 6px; font-family: var(--font-heading); }

.theme-swatch { width: 100%; height: 40px; border-radius: 8px; }
.theme-classic { background: linear-gradient(135deg, #059669, #10b981); }
.theme-dark { background: linear-gradient(135deg, #1e293b, #334155); }
.theme-neon { background: linear-gradient(135deg, #0f172a, #7c3aed); border: 1px solid #7c3aed; }
.theme-minimal { background: #f8fafc; border: 1px solid #e2e8f0; }
.theme-bold { background: linear-gradient(135deg, #dc2626, #f59e0b); }

/* ══════════════════════════════════════════════
   CHALLENGE CARDS
   ══════════════════════════════════════════════ */
.challenge-card {
    border: 1px solid rgba(57,255,133,0.1); border-radius: var(--radius);
    overflow: hidden; transition: all 0.25s var(--ease);
    background: var(--surface); position: relative;
}

.challenge-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--neon), var(--secondary));
    opacity: 0; transition: opacity 0.25s var(--ease);
}

.challenge-card:hover {
    box-shadow: var(--shadow-md), var(--shadow-neon);
    transform: translateY(-3px); border-color: rgba(57,255,133,0.2);
}

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

/* ══════════════════════════════════════════════
   BODY DIAGRAM
   ══════════════════════════════════════════════ */
.body-diagram-container { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.body-svg-wrapper { max-width: 500px; margin: 0 auto; }
.body-svg { width: 100%; height: auto; }
.body-point { cursor: pointer; opacity: 0.85; transition: all 0.2s var(--ease); }
.body-point:hover { opacity: 1; r: 8; }

.body-tooltip {
    position: absolute; background: var(--dark); color: white;
    padding: 6px 12px; border-radius: 8px;
    font-size: 12px; font-weight: 600; font-family: var(--font-heading);
    pointer-events: none; z-index: 300; transform: translateX(-50%);
    white-space: nowrap; border: 1px solid var(--neon-border);
}

.body-measurements-table table { font-size: 13px; }
.body-measurements-table table td:last-child { font-weight: 600; text-align: right; }

.bf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.bf-card {
    background: var(--surface-raised); border-radius: 10px; padding: 14px;
    text-align: center; border: 1px solid rgba(57,255,133,0.06);
    transition: all 0.2s var(--ease);
}

.bf-card:hover { border-color: rgba(57,255,133,0.15); box-shadow: var(--shadow-neon); }

.bf-label { font-size: 11px; color: var(--gray-400); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; font-family: var(--font-heading); }
.bf-value { font-size: 22px; font-weight: 800; color: var(--gray-800); font-family: var(--font-heading); }
.bf-value small { font-size: 12px; color: var(--gray-500); font-weight: 400; }
.bf-bar { height: 4px; background: var(--gray-200); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.bf-fill { height: 100%; border-radius: 2px; transition: width 0.5s var(--ease); }

/* ══════════════════════════════════════════════
   QUESTIONNAIRE
   ══════════════════════════════════════════════ */
.questionnaire-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.questionnaire-grid .full-width { grid-column: 1 / -1; }

.q-item { background: var(--surface-raised); border-radius: 10px; padding: 14px 16px; border: 1px solid rgba(57,255,133,0.05); }
.q-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); margin-bottom: 4px; font-family: var(--font-heading); }
.q-value { font-size: 14px; color: var(--gray-800); font-weight: 500; }

/* ══════════════════════════════════════════════
   PHOTOS
   ══════════════════════════════════════════════ */
.photo-calendar { display: flex; flex-direction: column; gap: 16px; }

.photo-day-card {
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    overflow: hidden; transition: border-color 0.25s var(--ease);
}

.photo-day-card:hover { border-color: rgba(57,255,133,0.2); }

.photo-day-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--surface-raised);
    border-bottom: 1px solid var(--gray-200);
}

.photo-day-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1px; padding: 0;
}

.photo-thumb-wrapper {
    position: relative; aspect-ratio: 1; border-radius: 0;
    overflow: hidden; border: none;
    transition: all 0.25s var(--ease);
}

.photo-thumb-wrapper:hover { border-color: var(--neon-border); box-shadow: var(--shadow-neon); }

.photo-thumb { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: transform 0.3s var(--ease); }
.photo-thumb:hover { transform: scale(1.05); }
.photo-cat-badge { position: absolute; bottom: 4px; left: 4px; font-size: 10px; padding: 2px 6px; }
.photo-delete { position: absolute; top: 4px; right: 4px; opacity: 0; transition: opacity 0.2s var(--ease); }
.photo-thumb-wrapper:hover .photo-delete { opacity: 1; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ══════════════════════════════════════════════
   PROFILE STAT BOXES — sharp, deep, neon ray
   ══════════════════════════════════════════════ */
.profile-stat-box {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(57,255,133,0.10);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Neon ray border animation */
.profile-stat-box::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(from 0deg, transparent 0%, transparent 70%, var(--neon) 80%, transparent 90%, transparent 100%);
    border-radius: 8px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    animation: none;
}

.profile-stat-box::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: rgba(14,30,23,0.95);
    border-radius: 5px;
    z-index: -1;
}

.profile-stat-box:hover {
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 20px rgba(57,255,133,0.08);
    transform: translateY(-2px);
}

.profile-stat-box:hover::before {
    opacity: 1;
    animation: neon-ray 1s linear 1;
}

@keyframes neon-ray {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.profile-stat-box .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--neon);
    font-family: var(--font-heading);
}

.profile-stat-box .stat-label {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ══════════════════════════════════════════════
   FLOATING CHAT WIDGET
   ══════════════════════════════════════════════ */
.fchat-btn {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(5,150,105,0.35), var(--neon-glow);
    border: 1px solid var(--neon-border);
    z-index: 180;
    transition: all 0.25s var(--ease);
}

.fchat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(5,150,105,0.4), 0 0 20px rgba(57,255,133,0.2);
}

.fchat-badge {
    position: absolute; top: -3px; right: -3px;
    background: #ef4444; color: white;
    font-size: 10px; font-weight: 700;
    min-width: 20px; height: 20px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #0e1e17;
    font-family: var(--font-heading);
}

.fchat-panel {
    position: fixed;
    bottom: 90px; right: 24px;
    width: 360px; height: 500px;
    background: rgba(12,26,19,0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--neon-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 30px rgba(57,255,133,0.04);
    z-index: 180;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fchat-panel::before {
    content: ''; position: absolute; top: -1px; left: -1px;
    width: 32px; height: 32px;
    border-top: 2px solid rgba(57,255,133,0.3);
    border-left: 2px solid rgba(57,255,133,0.3);
    border-radius: var(--radius-lg) 0 0 0;
    pointer-events: none;
}

.fchat-panel::after {
    content: ''; position: absolute; bottom: -1px; right: -1px;
    width: 32px; height: 32px;
    border-bottom: 2px solid rgba(57,255,133,0.3);
    border-right: 2px solid rgba(57,255,133,0.3);
    border-radius: 0 0 var(--radius-lg) 0;
    pointer-events: none;
}

.fchat-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(57,255,133,0.1);
    display: flex; justify-content: space-between; align-items: center;
    color: #fff;
}

.fchat-body { flex: 1; overflow-y: auto; }
.fchat-body::-webkit-scrollbar { width: 4px; }
.fchat-body::-webkit-scrollbar-thumb { background: rgba(57,255,133,0.12); border-radius: 4px; }

@media (max-width: 480px) {
    .fchat-panel { width: calc(100vw - 20px); right: 10px; bottom: 80px; height: 60vh; }
    .fchat-btn { bottom: 16px; right: 16px; width: 50px; height: 50px; }
}

/* Medal filter buttons */
.medal-filter.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important;
    border-color: var(--neon-border) !important;
    box-shadow: var(--neon-glow);
}

/* ══════════════════════════════════════════════
   MEDAL CAROUSEL
   ══════════════════════════════════════════════ */
.medal-carousel::-webkit-scrollbar { height: 4px; }
.medal-carousel::-webkit-scrollbar-track { background: transparent; }
.medal-carousel::-webkit-scrollbar-thumb { background: rgba(57,255,133,0.15); border-radius: 4px; }
.medal-carousel::-webkit-scrollbar-thumb:hover { background: rgba(57,255,133,0.25); }

/* ══════════════════════════════════════════════
   DROPDOWN ITEMS — neon reflection
   ══════════════════════════════════════════════ */
.dd-item::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(57,255,133,0.08), transparent);
    transition: left 0.4s var(--ease);
    pointer-events: none;
}

.dd-item:hover::after { left: 120%; }

/* ══════════════════════════════════════════════
   DARK THEME ELEMENT OVERRIDES
   ══════════════════════════════════════════════ */
.empty-state { color: var(--gray-400); }
.day-card { background: rgba(255,255,255,0.06); backdrop-filter: blur(12px); border: 1px solid rgba(57,255,133,0.10); }
.day-card-body { color: var(--gray-200); }
.meal-card { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: var(--gray-200); }
.meal-card:hover { border-color: rgba(57,255,133,0.2); }
.bf-card { background: rgba(255,255,255,0.04); border-color: rgba(57,255,133,0.08); }
.bf-label { color: var(--gray-400); }
.bf-value { color: #fff; }
.q-item { background: rgba(255,255,255,0.04); border-color: rgba(57,255,133,0.06); }
.q-label { color: var(--gray-400); }
.q-value { color: var(--gray-200); }
.photo-day-card { border-color: rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); }
.photo-day-header { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06); color: var(--gray-200); }
.photo-thumb-wrapper { border-color: rgba(255,255,255,0.08); }
.chat-received { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: var(--gray-200); }
.badge-green { background: rgba(57,255,133,0.15); color: var(--neon); }
.badge-gray { background: rgba(255,255,255,0.08); color: var(--gray-300); }
.challenge-card { background: rgba(255,255,255,0.06); border-color: rgba(57,255,133,0.10); }
.tab { color: var(--gray-400); }
.tab:hover { color: var(--gray-200); }
.exercise-row { color: var(--gray-200); border-color: rgba(255,255,255,0.06); }
.exercise-row .ex-name { color: #fff; }
select.form-control option { background: #0e1e17; color: #fff; }
select.form-control { color: #fff; -webkit-text-fill-color: #fff; }
select.form-control:invalid { color: var(--gray-400); }

/* Notification panel */
.topnav-notif-panel { background: rgba(14,30,23,0.97); backdrop-filter: blur(20px); border: 1px solid var(--neon-border); }
.topnav-notif-header { border-color: rgba(57,255,133,0.1); }
.topnav-notif-header strong { color: #fff; }
#notif-list { color: var(--gray-200); }

/* ══════════════════════════════════════════════
   STORY VIEW — fix close button visibility
   ══════════════════════════════════════════════ */
.story-comments-panel-close {
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: white !important;
    font-size: 22px !important;
    cursor: pointer !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    z-index: 30 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.story-comments-panel-close:hover {
    background: rgba(255,255,255,0.25) !important;
}

/* ══════════════════════════════════════════════
   LEGACY SIDEBAR COMPAT (for pages that reference it)
   ══════════════════════════════════════════════ */
.sidebar { display: none; }
.sidebar-nav a .icon { display: none; }

/* ══════════════════════════════════════════════
   SUBSCRIPTION TIER BORDERS
   ══════════════════════════════════════════════ */
.tier-card-pro {
    border: 2px solid #b0b8c4 !important;
    position: relative;
    overflow: hidden;
}
.tier-card-pro::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(192,192,192,0.12) 45%, rgba(255,255,255,0.2) 50%, rgba(192,192,192,0.12) 55%, transparent 70%);
    background-size: 300% 300%;
    animation: tier-shimmer 4s ease infinite;
    pointer-events: none; z-index: 0;
}

.tier-card-elite {
    border: 3px solid #d4a017 !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(212,160,23,0.1) !important;
}
.tier-card-elite::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 25%, rgba(251,191,36,0.08) 40%, rgba(255,223,100,0.18) 50%, rgba(251,191,36,0.08) 60%, transparent 75%);
    background-size: 300% 300%;
    animation: tier-shimmer 3.5s ease infinite;
    pointer-events: none; z-index: 0;
}

.tier-card-elite-ia {
    border: 3px solid transparent !important;
    position: relative;
    overflow: hidden;
    background-clip: padding-box;
    box-shadow: 0 0 24px rgba(139,92,246,0.12), 0 0 12px rgba(251,191,36,0.08) !important;
}
.tier-card-elite-ia::before {
    content: '';
    position: absolute; inset: -3px;
    background: conic-gradient(from var(--tier-angle, 0deg),
        #fbbf24, #a78bfa, #60a5fa, #34d399, #fbbf24);
    border-radius: inherit;
    z-index: -2;
    animation: tier-rotate 4s linear infinite;
}
.tier-card-elite-ia::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(12,26,19,0.95);
    border-radius: inherit;
    z-index: -1;
}

@keyframes tier-shimmer {
    0% { background-position: 200% 200%; }
    100% { background-position: -200% -200%; }
}

@keyframes tier-rotate {
    0% { --tier-angle: 0deg; transform: rotate(0deg); }
    100% { --tier-angle: 360deg; transform: rotate(360deg); }
}

@property --tier-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Tier badge labels */
.tier-label-pro { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #1e293b; }
.tier-label-elite { background: linear-gradient(135deg, #d4a017, #fbbf24); color: #422006; }
.tier-label-elite-ia { background: linear-gradient(135deg, #7c3aed, #a78bfa); color: white; }

/* Avatar effects */
@keyframes e-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(57,255,133,0.3); }
    50% { box-shadow: 0 0 0 10px rgba(57,255,133,0); }
}

/* Medal shimmer */
@keyframes medal-shimmer {
    0% { opacity: 0.8; }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.8; }
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
/* ══════════════════════════════════════════════
   MOBILE: APP-LIKE EXPERIENCE
   ══════════════════════════════════════════════ */

/* Tablet: hide desktop menus, show hamburger */
@media (max-width: 1024px) {
    .topnav-menus { display: none; }
    .topnav-burger { display: flex; }
    .topnav-user-name { display: none; }
    .topnav-user-plan { display: none; }
}

/* Phone */
@media (max-width: 768px) {
    :root { --nav-h: 50px; --bottom-h: 60px; }

    /* Compact top bar */
    .topnav { height: var(--nav-h); }
    .topnav-inner { padding: 0 12px; }
    .topnav-logo-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
    .topnav-logo img { width: 28px; height: 28px; }
    .topnav-logo span { display: none; }
    .topnav-burger { display: none !important; } /* Hidden: we use bottom bar instead */
    .topnav-menus { display: none !important; }
    .topnav-notif-btn { width: 34px; height: 34px; border-radius: 10px; }
    .topnav-notif-btn svg { width: 18px; height: 18px; }
    .topnav-user { padding: 2px 6px 2px 2px; }
    .topnav-user-avatar { width: 28px; height: 28px; font-size: 11px; }
    .topnav-user-name, .topnav-user-plan { display: none; }
    .topnav-logout { width: 30px; height: 30px; }
    .topnav-logout svg { width: 16px; height: 16px; }
    .topnav-notif-panel { position: fixed; top: var(--nav-h); left: 8px; right: 8px; width: auto; max-height: 70vh; }

    /* Main content */
    .main { padding: 12px 12px 80px; margin-top: var(--nav-h); }
    .page-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
    .page-header h1 { font-size: 18px; }
    .page-header .btn, .page-header a.btn { font-size: 11px; padding: 5px 10px; }

    /* Cards */
    .card { padding: 14px; margin-bottom: 12px; border-radius: 12px; }
    .card::before, .card::after { display: none; } /* Remove corner accents on mobile */
    .card-header { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 10px; }
    .card-header h3 { font-size: 14px; }

    /* Grids */
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 12px; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

    /* Stat cards */
    .stat-card { padding: 10px; gap: 10px; }
    .stat-card .stat-info h3 { font-size: 16px; }
    .stat-card .stat-icon { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }

    /* Tables */
    table { font-size: 11px; }
    table th, table td { padding: 6px 6px; }

    /* Buttons */
    .btn { padding: 8px 14px; font-size: 12px; border-radius: 10px; }
    .btn-sm { padding: 5px 10px; font-size: 11px; }

    /* Forms */
    .form-control { padding: 10px 12px; font-size: 14px; border-radius: 10px; } /* Bigger for touch */
    .form-group label { font-size: 11px; }

    /* Modal - must clear bottom tabs */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal { width: 100%; max-width: 100%; padding: 16px 16px calc(16px + var(--bottom-h)); border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .modal::before, .modal::after { display: none; }
    .modal h2 { font-size: 16px; }
    .modal-actions { flex-direction: column; gap: 8px; }
    .modal-actions .btn { width: 100%; justify-content: center; }

    /* Tabs */
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .tab { white-space: nowrap; padding: 10px 14px; font-size: 12px; flex-shrink: 0; }

    /* Training cards */
    .day-card-header { flex-direction: column; gap: 4px; align-items: flex-start; padding: 10px 14px; font-size: 12px; }
    .day-card-body { padding: 10px 14px; }
    .exercise-row { padding: 8px 0; font-size: 13px; }

    /* Photos - tight grid like instagram */
    .photo-day-grid { grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 0; }
    .photo-day-header { padding: 10px 12px; font-size: 12px; }

    /* Profile - mobile optimized */
    .user-profile-bg { height: 100px; }
    .user-profile-avatar, .pub-avatar { width: 60px !important; height: 60px !important; font-size: 24px !important; margin-top: -30px !important; }
    .theme-options { justify-content: center; }
    .questionnaire-grid { grid-template-columns: 1fr; }
    .bf-grid { grid-template-columns: 1fr 1fr; }
    .body-diagram-container { grid-template-columns: 1fr; }
    .compare-grid { grid-template-columns: 1fr; }

    /* Profile cards - prevent clipping */
    .steam-profile .card, .steam-card { overflow: visible !important; max-width: 100% !important; word-wrap: break-word; }
    .steam-card .card-header { flex-wrap: wrap; }
    /* Public profile header adjustments */
    .steam-profile .card > div:first-child { min-height: 180px !important; }
    .steam-profile .card > div > div[style*="padding:80px"],
    .steam-profile .card > div > div[style*="padding:60px"] { padding: 44px 12px 12px !important; }
    .steam-profile div[style*="width:95px;height:95px"],
    .steam-profile div[style*="width:110px;height:110px"] { width: 64px !important; height: 64px !important; font-size: 24px !important; }
    .steam-profile h1 { font-size: 18px !important; word-break: break-word; }
    .steam-profile div[style*="gap:24px"] { gap: 8px !important; flex-wrap: wrap !important; }
    .steam-profile strong[style*="font-size:22px"],
    .steam-profile strong[style*="font-size:24px"] { font-size: 15px !important; }
    .steam-profile a[style*="top:16px"], .steam-profile button[style*="top:16px"] { top: 6px !important; padding: 4px 8px !important; font-size: 10px !important; }

    /* Profile stat boxes on mobile */
    .profile-stat-box { padding: 8px 4px !important; border-radius: 6px !important; }
    .profile-stat-box .stat-value { font-size: 18px !important; }
    .profile-stat-box .stat-label { font-size: 9px !important; }
    .profile-stat-box::before { display: none !important; } /* Remove neon ray on mobile */
    div[style*="grid-template-columns:repeat(2,1fr)"] { grid-template-columns: repeat(2,1fr) !important; gap: 6px !important; }

    /* Customization - hide preview on mobile */
    .c-preview-col { display: none; }
    .theme-option { width: 52px !important; min-width: 52px !important; padding: 4px !important; }
    .theme-swatch { height: 26px !important; }

    /* Prevent overflow everywhere */
    img { max-width: 100% !important; height: auto; }
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    pre, code { overflow-x: auto; max-width: 100%; }
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Fix tier card animations on mobile */
    .tier-card-elite-ia::before { display: none; }

    /* Game cards on mobile */
    .wheel-container { width: 220px !important; height: 220px !important; }
    .wheel-center { width: 50px !important; height: 50px !important; font-size: 12px !important; }
    .tower-visual { height: 220px !important; }

    /* Workout live on mobile */
    .wo-timer { font-size: 28px !important; }
    .wo-ex-timer { font-size: 22px !important; }
    .wo-rest-count { font-size: 60px !important; }

    /* Chat bubble */
    .chat-bubble { max-width: 85%; }

    /* Empty state */
    .empty-state { padding: 20px 12px; }
    .empty-state .icon { font-size: 32px; }

    /* Badges */
    .badge { font-size: 10px; padding: 2px 7px; }
    h1 { font-size: 18px; }

    /* Floating chat */
    .fchat-btn { width: 48px; height: 48px; bottom: 72px; right: 12px; }
    .fchat-panel { bottom: 128px; right: 8px; width: calc(100vw - 16px); height: 60vh; }

    /* Background */
    .bg-float { display: none; }
    .bg-glow { opacity: 0.5; }

    /* ═══ BOTTOM TAB BAR ═══ */
    .mobile-tabs {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: var(--bottom-h);
        background: rgba(10,20,15,0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--neon-border);
        z-index: 150;
        padding: 0 4px;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .mobile-tabs a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: rgba(255,255,255,0.35);
        font-size: 9px;
        font-weight: 600;
        font-family: var(--font-heading);
        letter-spacing: 0.02em;
        transition: color 0.2s;
        padding: 4px 0;
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }
    .mobile-tabs a svg { width: 22px; height: 22px; }
    .mobile-tabs a.active { color: var(--neon); }
    .mobile-tabs a.active svg { filter: drop-shadow(0 0 6px rgba(57,255,133,0.3)); }

    /* More menu */
    .mobile-more-panel {
        position: fixed;
        bottom: var(--bottom-h);
        left: 0; right: 0;
        background: rgba(10,20,15,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--neon-border);
        padding: 12px 0 16px;
        z-index: 149;
        display: none;
        max-height: 75vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 30px rgba(0,0,0,0.3);
    }
    .mobile-more-panel.open { display: block; }
    .mobile-more-panel a {
        display: flex; align-items: center; gap: 10px;
        padding: 10px 18px; color: rgba(255,255,255,0.7);
        text-decoration: none; border-radius: 0;
        font-size: 14px; font-weight: 500;
        transition: all 0.12s;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-more-panel a:active { background: rgba(57,255,133,0.06); color: white; }
    .mobile-more-panel a svg { width: 20px; height: 20px; color: var(--gray-400); flex-shrink: 0; }
    .mobile-more-panel .mm-divider { height: 1px; background: rgba(255,255,255,0.04); margin: 6px 0; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topnav-right { gap: 6px; }
}

/* ══════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════ */
@media print {
    .topnav, .btn, .modal-overlay, .bg-pattern { display: none !important; }
    .main { margin-top: 0; padding: 20px; }
}
