/* ═══════════════════════════════════════════════════════
   przeKM.in – Running Performance Tracker
   Unified Light Design System
   ═══════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99,102,241,0.06);
    --primary-glow: rgba(99,102,241,0.18);

    --bg: #f7f8fa;
    --card: #ffffff;
    --card-hover: #fafbfc;
    --border: #e5e7eb;
    --border-light: #f1f3f5;

    --text: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #94a3b8;
    --text-dim: #b0bec5;

    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Header ─── */
header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(99,102,241,0.25);
}

.header-inner {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 54px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 { font-size: 1.1rem; font-weight: 800; letter-spacing: 0.14em; line-height: 0; }
header h1 a { color: white; text-decoration: none; display: block; }

.header-logo { height: 7.7rem; width: auto; display: block; }

header nav { display: flex; align-items: center; gap: 0.2rem; }

.nav-link {
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    transition: all 0.15s;
}

.nav-link:hover { color: white; background: rgba(255,255,255,0.15); }
.nav-link.active { color: white; background: rgba(255,255,255,0.2); font-weight: 600; }

.nav-separator {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.2);
    margin: 0 0.4rem;
}

.nav-user { color: rgba(255,255,255,0.6); font-size: 0.78rem; }

.btn-logout {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-logout:hover { background: rgba(255,255,255,0.22); }

/* ─── Layout ─── */
.container { max-width: 920px; margin: 0 auto; padding: 1.5rem; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    gap: 0.4rem;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; }

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary::before {
    color: gray;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.btn-delete:hover { background: #fef2f2; }
.inline-form { display: inline; margin-left: 0.35rem; }

/* ─── Flash Messages ─── */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideDown 0.3s ease;
}

.flash-error { background: #fef2f2; color: #dc2626; border-color: #ef4444; }
.flash-success { background: #f0fdf4; color: #16a34a; border-color: #22c55e; }

/* ─── Score Hero ─── */
.score-hero {
    text-align: center;
    padding: 2.5rem 0 2rem;
    background: linear-gradient(180deg, rgba(99,102,241,0.04) 0%, transparent 60%);
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 3rem 1.5rem 2rem;
    border-radius: 0 0 24px 24px;
}

.score-ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 1.25rem;
    filter: drop-shadow(0 4px 16px rgba(99,102,241,0.18));
}

.score-ring svg { width: 100%; height: 100%; }
.score-ring circle:last-of-type { animation: ringDraw 1.2s ease-out forwards; }

.score-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
}

.score-grade-badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.15rem 0.6rem;
    background: var(--primary);
    color: white;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.score-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.55;
}

/* ─── Stats Strip ─── */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.75rem;
}

.stat-pill {
    background: var(--card);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.stat-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border); }

.stat-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }

.stat-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Charts ─── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.chart-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.chart-card h4 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.chart-card canvas { height: 170px !important; }

/* ─── Roast Card ─── */
.roast-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow);
}

.roast-card h3 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.roast-slider-wrap { margin-bottom: 1.25rem; }

.roast-persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.roast-persona-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 0.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.roast-persona-btn:hover { border-color: var(--primary); background: #eef2ff; }
.roast-persona-btn.active { border-color: var(--primary); background: linear-gradient(135deg, #eef2ff, #e0e7ff); box-shadow: 0 2px 8px var(--primary-glow); }

.rp-emoji { font-size: 1.4rem; line-height: 1; }
.rp-name { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-align: center; line-height: 1.2; }
.roast-persona-btn.active .rp-name { color: var(--primary); }

.btn-roast {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 0.75rem;
    font-size: 0.92rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-roast:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px var(--primary-glow); }
.btn-roast:disabled { opacity: 0.65; cursor: wait; transform: none; }

.roast-result {
    margin-top: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    line-height: 1.8;
    animation: fadeSlideUp 0.4s ease;
    position: relative;
}

.roast-result.hidden { display: none; }

.roast-persona {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.roast-quote {
    font-style: italic;
    position: relative;
    padding-left: 0.75rem;
}

.roast-level-1  { background: #fef2f2; border-left: 4px solid #dc2626; color: #991b1b; }
.roast-level-2  { background: #fff7ed; border-left: 4px solid #ea580c; color: #9a3412; }
.roast-level-3  { background: #f5f5f4; border-left: 4px solid #78716c; color: #44403c; }
.roast-level-4  { background: #fef9ee; border-left: 4px solid #f59e0b; color: #92400e; }
.roast-level-5  { background: #f0f9ff; border-left: 4px solid #0ea5e9; color: #0c4a6e; }
.roast-level-6  { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }
.roast-level-7  { background: #faf5ff; border-left: 4px solid #a855f7; color: #6b21a8; }
.roast-level-8  { background: #fdf2f8; border-left: 4px solid #ec4899; color: #9d174d; }
.roast-level-9  { background: #ecfdf5; border-left: 4px solid #10b981; color: #065f46; }
.roast-level-10 { background: #f8fafc; border-left: 4px solid #64748b; color: #334155; }
.roast-level-11 { background: #fdf2f8; border-left: 4px solid #f472b6; color: #831843; }
.roast-error { background: #fef2f2; border-left: 4px solid #ef4444; color: #dc2626; }

/* ─── Runs Card ─── */
.runs-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.runs-card > h3 {
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
}

.run-row {
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.1s;
}

.run-row:last-child { border-bottom: none; }
.run-row:hover:not(.expanded) { background: var(--card-hover); }
.run-row.expanded { background: transparent; }

.run-header {
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.run-left { flex: 1; min-width: 0; }

.run-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.run-date { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; }

.run-right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

.run-badge {
    background: var(--bg);
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.run-chevron {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.25s;
    margin-left: 0.2rem;
}

.run-row.expanded .run-chevron { transform: rotate(180deg); }

.run-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 1.5rem;
}

.run-row.expanded .run-details {
    max-height: 5000px;
    padding: 0 1.5rem 1.25rem;
}

/* ─── Training Detail (light panel) ─── */
.td {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.td-meta {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.td-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

.td-pill {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
}

.td-pill-l { color: var(--text-muted); }
.td-pill strong { color: var(--text); }

/* ─── AI Analysis Block ─── */
.td-ai {
    position: relative;
    background: linear-gradient(135deg, rgba(139,92,246,0.05) 0%, rgba(59,130,246,0.03) 100%);
    border: 1px solid rgba(139,92,246,0.12);
    border-radius: 14px;
    padding: 20px 22px 20px 26px;
    margin-bottom: 18px;
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

.td-ai::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(to bottom, var(--accent-purple), var(--accent-blue));
    border-radius: 4px 0 0 4px;
}

.td-ai-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.td-ai-badge {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.td-ai-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3px;
}

.td-ai-body {
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.td-ai-line {
    padding: 5px 0;
}

.td-ai-line:last-child { border-bottom: none; }
.td-ai-body strong { color: var(--text); font-weight: 600; }

/* AI structured elements */
.td-ai-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 14px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(139,92,246,0.1);
}

.td-ai-section-title:first-child { margin-top: 0; }

.td-ai-list {
    list-style: none;
    padding: 0;
    margin: 6px 0;
}

.td-ai-list li {
    padding: 4px 0 4px 16px;
    position: relative;
    color: var(--text-secondary);
}

.td-ai-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
}

.td-ai-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(59,130,246,0.06));
    border: 1px solid rgba(139,92,246,0.15);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-purple);
    margin: 8px 0;
}

.td-ai-type-label {
    font-weight: 500;
    color: var(--text-muted);
}

.td-ai-tip {
    background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(16,185,129,0.02));
    border: 1px solid rgba(16,185,129,0.15);
    border-left: 3px solid var(--accent-green);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.td-ai::after {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(139,92,246,0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* ─── Timeline ─── */
.td-timeline {
    display: flex;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    gap: 2px;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    background: var(--border-light);
}

.td-tl-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3px;
    opacity: 0.92;
    transition: opacity 0.15s, transform 0.15s;
    cursor: default;
    border-radius: 2px;
}

.td-tl-seg:hover { opacity: 1; transform: scaleY(1.08); }

.td-tl-seg-lbl {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.td-tl-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }

.td-tl-leg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); }

.td-tl-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.td-tl-leg-label { color: var(--text-muted); }
.td-tl-leg-count { color: var(--text-dim); font-size: 10px; }

/* ─── Tabs ─── */
.td-tabs { display: flex; gap: 5px; margin-bottom: 16px; }

.td-tab {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    background: var(--card);
    color: var(--text-muted);
    transition: all 0.15s;
    font-family: inherit;
}

.td-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.td-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Sections ─── */
.td-sec { margin-bottom: 16px; }

.td-sec-t {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* ─── Comparison boxes ─── */
.td-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.td-cmp-box {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-top: 3px solid;
    box-shadow: var(--shadow);
}

.td-cmp-title { font-weight: 700; font-size: 12px; margin-bottom: 12px; }

.td-cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.td-cmp-label {
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.td-cmp-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

/* ─── Tables ─── */
.td-tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--border);
}

.td-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.td-tbl thead tr { color: var(--text-muted); }

.td-tbl th {
    text-align: left;
    padding: 8px 8px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: var(--bg);
}

.td-tbl tbody tr { transition: background 0.1s; color: var(--text-secondary); }
.td-tbl tbody tr:hover { background: var(--card-hover); }

.td-tbl td {
    padding: 7px 8px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-light);
}

.td-tbl tbody tr:last-child td { border-bottom: none; }
.td-fastest { color: #d97706 !important; font-weight: 700; }
.td-hr-high { color: var(--accent-red) !important; }

/* ─── Chart wrap ─── */
.td-chart-wrap {
    background: var(--card);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
}

.td-chart-wrap canvas { height: 200px !important; }

/* ─── HR / Running Dynamics Observations ─── */
.td-obs {
    background: var(--card);
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid var(--border);
}

.td-obs-row {
    font-size: 12.5px;
    line-height: 2;
    color: var(--text-secondary);
    padding: 3px 0;
    border-bottom: 1px solid var(--border-light);
}

.td-obs-row:last-child { border-bottom: none; }
.td-obs-row strong { color: var(--text); }

/* ─── Running Dynamics Grid ─── */
.td-dynamics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.td-dyn-card {
    background: var(--card);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.td-dyn-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.td-dyn-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.td-dyn-unit { font-size: 10px; color: var(--text-muted); font-weight: 500; }

/* ─── Empty / misc ─── */
.td-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ─── Activities Page ─── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }

/* ─── Hero (landing) ─── */
.hero {
    text-align: center;
    padding: 5rem 1rem;
}

.hero h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* ─── Login ─── */
.login-page {
    min-height: calc(100vh - 54px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f7f8fa 0%, #ede9fe 40%, #eef2ff 70%, #f7f8fa 100%);
}

.login-box {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    padding: 2.75rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.login-brand {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
}

.login-logo {
    height: 8rem;
    width: auto;
    background: var(--primary);
    border-radius: var(--radius);
}

.brand-dot { color: var(--text-muted); font-weight: 600; }

.login-box h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; }

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.75rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-form input {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--card);
    font-family: inherit;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ─── Upload ─── */
.upload-page { padding-top: 1.25rem; }
.upload-page h2 { margin-bottom: 0.5rem; font-size: 1.4rem; font-weight: 700; }

.upload-form {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-form h3 { margin-bottom: 0.2rem; font-size: 1rem; font-weight: 600; }
.upload-form p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 0.5rem; }

.info-box {
    background: #eff6ff;
    border-left: 4px solid var(--accent-blue);
    border-radius: var(--radius-xs);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    color: #1e40af;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.info-box a { color: #1e40af; font-weight: 600; text-decoration: underline; }

.url-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.divider {
    text-align: center;
    position: relative;
    margin: 1rem 0;
}

.divider span {
    background: var(--card);
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    border-top: 1px solid var(--border);
}

.file-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-drop:hover, .file-drop.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-drop input { display: none; }

.drop-text { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; }
.drop-text small { color: var(--text-muted); }

/* ─── Admin ─── */
.admin-page h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }

.admin-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.admin-section h3 { font-size: 1rem; margin-bottom: 1rem; }

.admin-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.admin-form input[type="text"],
.admin-form input[type="password"] {
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    transition: border-color 0.15s;
    font-family: inherit;
}

.admin-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.checkbox-label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.88rem; }

.user-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:last-child { border-bottom: none; }

.user-name { font-weight: 600; font-size: 0.92rem; }
.user-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; }

.admin-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ringDraw {
    from { stroke-dasharray: 0 326.7; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 0.65rem 1rem;
        gap: 0.4rem;
    }

    header nav { flex-wrap: wrap; justify-content: center; }
    .container { padding: 1rem; }

    .stats-strip { grid-template-columns: repeat(2, 1fr); }
    .stats-strip .stat-pill:last-child { grid-column: span 2; }

    .charts-grid { grid-template-columns: 1fr; }

    .run-header { padding: 0.75rem 1rem; }
    .run-details { padding: 0 1rem; }
    .run-row.expanded .run-details { padding: 0 1rem 1rem; }
    .run-right { flex-wrap: wrap; justify-content: flex-end; }

    .td-compare { grid-template-columns: 1fr; }
    .td-dynamics { grid-template-columns: repeat(2, 1fr); }
    .td-cmp-value { font-size: 14px; }
    .td-dyn-value { font-size: 17px; }
    .td-tabs { overflow-x: auto; padding-bottom: 2px; }

    .login-box { margin: 1rem; padding: 2rem; }

    .hero h2 { font-size: 1.5rem; }
    .hero p { font-size: 0.92rem; }
}

@media (max-width: 480px) {
    .stats-strip { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .stat-pill { padding: 0.75rem; }
    .stat-val { font-size: 0.95rem; }
    .score-number { font-size: 2.2rem; }
    .score-ring { width: 130px; height: 130px; }
    .td-dynamics { grid-template-columns: 1fr 1fr; }
}
