/* ═══════════════════════════════════════════════════
   FITCHALLENGE — PROFESSIONAL DESIGN SYSTEM
   ═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Brand */
    --primary:        #10B981;
    --primary-dark:   #059669;
    --primary-light:  #D1FAE5;
    --primary-glow:   rgba(16,185,129,0.18);
    --primary-dim:    rgba(16,185,129,0.08);

    --secondary:      #6366F1;
    --secondary-light:#EEF2FF;
    --warning:        #F59E0B;
    --danger:         #EF4444;
    --success:        #10B981;

    /* Sidebar (dark) */
    --sidebar-bg:     #0F172A;
    --sidebar-hover:  rgba(255,255,255,0.06);
    --sidebar-active: rgba(16,185,129,0.15);
    --sidebar-border: rgba(255,255,255,0.07);
    --sidebar-text:   #94A3B8;
    --sidebar-active-text: #10B981;

    /* App surfaces */
    --bg-main:    #F1F5F9;
    --bg-card:    #FFFFFF;
    --bg-stat:    #F8FAFC;
    --overlay-bg: rgba(2, 8, 23, 0.75);

    /* Text */
    --text-main:  #0F172A;
    --text-sub:   #334155;
    --text-muted: #64748B;
    --text-faint: #94A3B8;

    /* Borders */
    --border:     #E2E8F0;
    --border-focus: #10B981;

    /* Shadows */
    --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.07);
    --shadow-md:  0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg:  0 12px 40px rgba(0,0,0,0.12);
    --shadow-card:0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
    --shadow-glow:0 0 0 3px var(--primary-glow);

    /* Layout */
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  20px;
    --sidebar-w:  260px;
    --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);

    --font: 'Inter', system-ui, sans-serif;
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
    font-family: var(--font);
    background: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* ─── Utility ─── */
.w-full   { width: 100%; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-main   { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning{ color: var(--warning) !important; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mt-4  { margin-top: 16px; }
.gap-2 { gap: 8px; }
.flex-between { display:flex; justify-content:space-between; align-items:center; }
.flex-end     { display:flex; justify-content:flex-end; align-items:center; }
.justify-center{ display:flex; justify-content:center; align-items:center; }

/* ═══════════════════════════════════════════════════
   OVERLAY & MODALS
   ═══════════════════════════════════════════════════ */
.overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(6px);
}
.overlay.active { opacity: 1; pointer-events: auto; }

.login-card, .modal-card {
    background: var(--bg-card);
    padding: 44px;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.05);
    transform: translateY(24px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-card     { max-width: 520px; }
.modal-card-lg  { max-width: 660px; padding: 36px; }
.overlay.active .login-card,
.overlay.active .modal-card { transform: translateY(0) scale(1); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin-bottom: 0; }

.btn-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--bg-stat);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 17px;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--border); color: var(--text-main); }

/* ─── Login card header ─── */
.login-card .logo {
    gap: 10px;
    margin-bottom: 28px;
}
.login-card h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}
.login-card .text-muted { font-size: 13.5px; }

/* ─── Forms & Inputs ─── */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}
.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 0.01em;
}
.input-group input,
.input-group textarea {
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 14px;
    background: var(--bg-stat);
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
    resize: none;
}
.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: var(--shadow-glow);
}
.input-group input::placeholder { color: var(--text-faint); }

/* ─── Goal Pills ─── */
.goal-options { display: flex; flex-wrap: wrap; gap: 10px; }
.goal-pill { cursor: pointer; }
.goal-pill input[type="checkbox"] { display: none; }
.goal-pill span {
    display: inline-block;
    padding: 7px 15px;
    background: var(--bg-stat);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    user-select: none;
}
.goal-pill:hover span { border-color: var(--primary); color: var(--primary); }
.goal-pill input:checked + span {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
}

/* ─── Buttons ─── */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
    background: linear-gradient(135deg, #12CA8E 0%, var(--primary) 100%);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    padding: 9px 16px;
    border: 1.5px solid var(--border);
    color: var(--text-sub);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font);
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
    display: flex; align-items: center; gap: 7px;
}
.btn-outline:hover {
    background: var(--bg-stat);
    border-color: #CBD5E1;
    color: var(--text-main);
}
.btn-danger-outline { border-color: #FECACA !important; color: var(--danger) !important; }
.btn-danger-outline:hover { background: #FEF2F2 !important; border-color: var(--danger) !important; }

/* ═══════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════ */
.app-container { display: flex; height: 100vh; }
.mobile-header { display: none; }

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 10;
    flex-shrink: 0;
    border-right: 1px solid var(--sidebar-border);
}

.nav-bottom {
    padding: 6px 12px 10px;
    border-top: 1px solid var(--sidebar-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 20px 20px;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 12px;
}
.brand-logo {
    width: 30px; height: 30px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1.5px rgba(16,185,129,0.5);
}
.brand-name { color: #fff; }

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 12px;
    flex-grow: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}
.nav-item i { font-size: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-active-text);
    font-weight: 700;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}
.nav-item.text-danger { color: #F87171 !important; }
.nav-item.text-danger:hover { background: rgba(239,68,68,0.1); color: #EF4444 !important; }

/* Sidebar divider */
.nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 0;
}

.user-info {
    padding: 16px 18px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: auto;
}
.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(16,185,129,0.4);
    flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #E2E8F0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--sidebar-text); }

/* ─── Sidebar nav bottom section ─── */
.nav-bottom {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 12px 4px;
}

/* ═══════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════ */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px 36px;
    scroll-behavior: smooth;
    background: var(--bg-main);
}
.tab-content { display: none; animation: fadeUp 0.38s ease both; }
.tab-content.active { display: block; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.top-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
}
.date-display {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 7px 14px;
    border-radius: 50px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

/* ═══════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card h2 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════
   DASHBOARD GRID
   ═══════════════════════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ─── Goal Widget ─── */
.goal-widget {
    grid-column: 1 / -1;
    background: linear-gradient(120deg, #0F172A 0%, #1E293B 60%, #0F2617 100%);
    border: 1px solid rgba(16,185,129,0.2);
    padding: 24px 28px;
}
.goal-widget h2 { color: #F1F5F9; margin-bottom: 6px; font-size: 16px; }
.goal-text {
    font-size: 15px;
    line-height: 1.6;
    margin-top: 4px;
    color: #94A3B8;
}
.goal-text.text-main { color: #6EE7B7 !important; font-weight: 500; }
.goal-widget .btn-outline {
    border-color: rgba(255,255,255,0.15);
    color: #E2E8F0;
    background: rgba(255,255,255,0.06);
    font-size: 12.5px;
}
.goal-widget .btn-outline:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--primary);
    color: #fff;
}

/* ─── Stats ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.stat-box {
    background: var(--bg-stat);
    border: 1px solid var(--border);
    padding: 18px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    right: 0; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.2s;
}
.stat-box:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-box:hover::before { opacity: 1; }
.stat-label {
    font-size: 11px;
    color: var(--text-faint);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1;
}
.stat-trend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}
.stat-trend.negative { color: var(--primary); }
.stat-trend.positive { color: var(--warning); }

.btn-outline[id="btn-update-stats"] {
    font-size: 12px;
    padding: 7px 14px;
}

/* ─── Task List ─── */
.daily-tasks h2 { margin-bottom: 14px; }
.task-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.task-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    padding: 13px 15px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    transition: var(--transition);
    color: var(--text-sub);
    background: var(--bg-stat);
}
.task-item label:hover { border-color: var(--primary); background: var(--primary-dim); color: var(--text-main); }
.task-item.completed label {
    background: var(--primary-dim);
    border-color: #A7F3D0;
    color: #065F46;
}
.task-item.completed label span.text { text-decoration: line-through; opacity: 0.7; }
.task-item input[type="checkbox"] { display: none; }
.custom-checkbox {
    width: 20px; height: 20px;
    border: 2px solid #CBD5E1;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    background: #fff;
}
.task-item.completed .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.task-item.completed .custom-checkbox::after {
    content: '';
    width: 5px; height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* ─── Day Tracker ─── */
.days-tracker { grid-column: 1 / -1; }
.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.progress-container {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 280px;
}
.progress-bar-wrap {
    flex-grow: 1;
    background: var(--bg-stat);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #34D399 100%);
    border-radius: 8px;
    transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 0 10px rgba(16,185,129,0.4);
}
.progress-container span {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 7px;
}
.day-box {
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--bg-stat);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-faint);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.day-box:hover {
    transform: scale(1.12);
    z-index: 10;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.day-box.completed {
    background: linear-gradient(135deg, var(--primary) 0%, #34D399 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,0.35);
}
.day-box.current {
    border-color: var(--primary);
    background: var(--primary-dim);
    color: var(--primary);
    transform: scale(1.06);
}
.day-box.current.completed {
    background: linear-gradient(135deg, var(--primary) 0%, #34D399 100%);
    color: #fff;
}

/* ═══════════════════════════════════════════════════
   LEADERBOARD & ADMIN TABLES
   ═══════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}
thead tr { border-bottom: 2px solid var(--border); }
th {
    padding: 10px 18px;
    text-align: left;
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
tbody tr {
    border-bottom: 1px solid var(--bg-stat);
    transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr td {
    padding: 13px 18px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-sub);
}
tbody tr:hover { background: var(--bg-stat); }
tbody tr:hover td { color: var(--text-main); }

.flex-align { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.sm-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.rank {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 13px;
}
.rank.gold   { background: linear-gradient(135deg,#FBBF24,#F59E0B); box-shadow: 0 2px 8px rgba(251,191,36,0.5); }
.rank.silver { background: linear-gradient(135deg,#CBD5E1,#94A3B8); }
.rank.bronze { background: linear-gradient(135deg,#D97706,#B45309); }
.rank.default{ background: var(--bg-stat); color: var(--text-muted); border: 1px solid var(--border); }

.progress-pill {
    width: 110px; height: 24px;
    background: var(--bg-stat);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}
.progress-pill .fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    background: var(--primary-dim);
    z-index: 1;
    transition: width 1s ease-in-out;
}
.progress-pill span {
    position: relative;
    z-index: 2;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-sub);
}

/* ═══════════════════════════════════════════════════
   PROGRESS TAB — PHOTOS
   ═══════════════════════════════════════════════════ */
.photos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.photo-card { padding: 20px; }
.photo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.photo-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.before-badge { background: var(--secondary-light); color: var(--secondary); }
.after-badge  { background: #FEF3C7; color: #B45309; }

.photo-upload-zone {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-stat);
    position: relative;
    transition: var(--transition);
    margin-bottom: 14px;
    cursor: pointer;
}
.photo-upload-zone:hover { border-color: var(--primary); background: var(--primary-dim); }
.photo-upload-zone img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-md) - 1px);
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
    pointer-events: none;
}
.upload-placeholder i { font-size: 38px; color: var(--border); }
.upload-placeholder span { font-weight: 700; font-size: 14px; }
.upload-placeholder p { font-size: 12px; color: var(--text-faint); }

.photo-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── Journal Calendar ─── */
.journal-calendar-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 8px;
}
.journal-day-box {
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--bg-stat);
    border: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-faint);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    position: relative;
}
.journal-day-box:hover {
    transform: scale(1.1);
    z-index: 10;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.journal-day-box.has-log {
    background: var(--primary-dim);
    border-color: #A7F3D0;
    color: var(--primary-dark);
}
.journal-day-box.has-log::after {
    content: '';
    width: 5px; height: 5px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    bottom: 5px;
}

/* ─── Workout Log Modal ─── */
#workout-log-text {
    width: 100%;
    min-height: 200px;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.75;
    resize: vertical;
    transition: var(--transition);
    outline: none;
    background: var(--bg-stat);
    color: var(--text-main);
}
#workout-log-text:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: #fff;
}

/* ═══════════════════════════════════════════════════
   LEADERBOARD — highlight me row
   ═══════════════════════════════════════════════════ */
tbody tr[style*="backgroundColor"] td { background: var(--primary-dim) !important; }

/* ═══════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════ */
.main-content::-webkit-scrollbar { width: 5px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.main-content::-webkit-scrollbar-thumb:hover { background: #CBD5E1; }

/* ═══════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════ */

/* KPI Grid */
.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.admin-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.admin-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.kpi-blue   { background: #EEF2FF; color: #6366F1; }
.kpi-green  { background: var(--primary-dim); color: var(--primary-dark); }
.kpi-amber  { background: #FEF3C7; color: #B45309; }
.kpi-purple { background: #F5F3FF; color: #7C3AED; }
.kpi-info { display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 11.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text-main); letter-spacing: -0.03em; line-height: 1.1; }

/* Admin table rows */
.admin-row-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-mini-bar-wrap {
    width: 80px;
    height: 6px;
    background: var(--bg-stat);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.admin-mini-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #34D399);
    border-radius: 4px;
    transition: width 1s ease;
}
.admin-day-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--primary-dim);
    color: var(--primary-dark);
    border: 1px solid #A7F3D0;
}
.streak-badge i { font-size: 13px; color: var(--warning); }

.photo-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}
.photo-dot {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--bg-stat);
    border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    color: var(--text-faint);
    overflow: hidden;
}
.photo-dot img { width: 100%; height: 100%; object-fit: cover; }
.photo-dot.has-photo { border-color: var(--primary); }

/* ── Profile Modal ── */
.profile-modal-card { max-width: 680px; }
.profile-modal-user { display: flex; align-items: center; gap: 14px; }
.pm-avatar { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--primary-light); object-fit: cover; }

.pm-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-stat);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-top: 4px;
}
.pm-stat { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pm-stat-val { font-size: 22px; font-weight: 800; color: var(--text-main); letter-spacing: -0.03em; }
.pm-stat-lbl { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }

.pm-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 4px;
}
.pm-photo-wrap { display: flex; flex-direction: column; }
.pm-photo-zone {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: var(--bg-stat);
    overflow: hidden;
    position: relative;
}
.pm-photo-empty {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px;
    color: var(--text-faint);
    font-size: 13px; font-weight: 600;
}
.pm-photo-empty i { font-size: 32px; color: var(--border); }

.pm-log-item {
    background: var(--bg-stat);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}
.pm-log-item .pm-log-day {
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.pm-log-item .pm-log-text {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    body { overflow-y: auto; }
    .app-container { flex-direction: column; height: auto; }

    .mobile-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 18px;
        background: var(--sidebar-bg);
        border-bottom: 1px solid var(--sidebar-border);
        color: #fff;
        font-weight: 800;
        font-size: 17px;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border-right: none;
        border-top: 1px solid var(--sidebar-border);
        position: fixed;
        bottom: 0; left: 0;
        z-index: 100;
        background: var(--sidebar-bg);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    }
    .logo, .user-info, .nav-divider, .nav-bottom { display: none; }
    .nav-menu {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        padding: 0;
        gap: 0;
    }
    .nav-item {
        flex-direction: column;
        gap: 3px;
        padding: 8px 10px;
        font-size: 10px;
        border-radius: var(--radius-sm);
    }
    .nav-item i { font-size: 22px; }
    .nav-item.active::before { display: none; }
    .nav-item span { display: block; }

    .main-content { padding: 20px 14px 100px; overflow-y: visible; }
    .top-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .photos-grid { grid-template-columns: 1fr; }
    .progress-container { width: 100%; flex-direction: column; align-items: flex-start; gap: 8px; }
    .calendar-grid { grid-template-columns: repeat(7, 1fr); }
    .journal-calendar-grid { grid-template-columns: repeat(7, 1fr); }
    .goal-widget { grid-column: 1; }
    .days-tracker { grid-column: 1; }
    .login-card, .modal-card { padding: 28px 22px; }
}
