:root {
    --bg: #F0F2F5; --card: #fff; --border: #e2e8f0; --text: #1e293b;
    --muted: #64748b; --accent: #5CC8E3; --accent-light: #E0F4FA;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif;
       background: var(--bg); color: var(--text); line-height: 1.6; font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

.container { max-width: 1280px; margin: 0 auto; padding: 20px 24px; }

/* ── Top Nav (pixel-perfect with Hub/SDR) ── */
.top-nav {
    position: sticky; top: 0; left: 0; right: 0; height: 60px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,.07);
    display: flex; align-items: center; padding: 0 24px; gap: 0; z-index: 200;
}
.top-nav-brand {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    font-size: 15px; font-weight: 700; color: #111827; letter-spacing: -.3px;
    padding-right: 28px; border-right: 1px solid rgba(0,0,0,.07);
    min-width: 200px; position: relative;
}
.brand-subtitle {
    font-weight: 400; color: #6B7280; font-size: 13px;
}
.top-nav-links {
    display: flex; align-items: center; gap: 2px; margin-left: 20px; margin-right: auto;
}
.top-nav-links a {
    color: #6B7280; text-decoration: none; font-weight: 500; font-size: 13px;
    padding: 7px 14px; border-radius: 8px; transition: all .18s;
    font-family: 'Inter', sans-serif; display: flex; align-items: center; gap: 7px;
}
.top-nav-links a i { font-size: 12px; }
.top-nav-links a:hover { color: #111827; background: rgba(0,0,0,.04); text-decoration: none; }
.top-nav-links a.active { color: #5CC8E3; background: #E0F4FA; text-decoration: none; }
.top-nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Brand dropdown */
.brand-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0;
    background: white; border: 1px solid rgba(0,0,0,.07); border-radius: 12px;
    box-shadow: 0 10px 25px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    min-width: 220px; z-index: 600; overflow: hidden; display: none;
}
.brand-dropdown.open { display: block; }
.brand-dropdown-label {
    padding: 10px 16px 6px; font-size: 11px; font-weight: 600; color: #6B7280;
    text-transform: uppercase; letter-spacing: .5px;
}
.brand-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; font-size: 13px; color: #374151;
    text-decoration: none; transition: background .12s;
}
.brand-dropdown a:hover { background: #F8FAFC; }
.brand-dropdown a i { width: 16px; color: #6B7280; text-align: center; font-size: 12px; }
.brand-dropdown a.active-app { color: #5CC8E3; font-weight: 600; }
.brand-dropdown a.active-app i { color: #5CC8E3; }

/* User menu */
.user-menu-wrap { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 9px;
    background: none; border: none; cursor: pointer; padding: 5px 8px;
    border-radius: 8px; transition: background .15s; font-family: 'Inter', sans-serif;
}
.user-btn:hover { background: rgba(0,0,0,.04); }
.user-btn-name { font-size: 13px; font-weight: 500; color: #374151; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #F59E0B, #EF4444);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 12px; font-weight: 600;
}
.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: white; border: 1px solid rgba(0,0,0,.07); border-radius: 12px;
    box-shadow: 0 10px 25px -3px rgba(0,0,0,.1); min-width: 200px;
    z-index: 600; overflow: hidden; display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-header { padding: 14px 16px 12px; border-bottom: 1px solid rgba(0,0,0,.07); }
.user-dropdown-name { font-size: 14px; font-weight: 600; color: #111827; }
.user-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; font-size: 13px; color: #374151;
    cursor: pointer; transition: background .12s; text-decoration: none;
}
.user-dropdown-item:hover { background: #F8FAFC; text-decoration: none; }
.user-dropdown-item.danger { color: #DC2626; }
.user-dropdown-item.danger i { color: #DC2626; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
        padding: 20px 24px; margin-bottom: 16px; }
.card h2 { font-size: 18px; margin-bottom: 12px; }
.card h3 { font-size: 15px; color: var(--muted); margin-bottom: 8px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
             padding: 16px; text-align: center; }
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-link { display: block; text-decoration: none; color: inherit; }
.stat-link:hover { text-decoration: none; }
.stat-card:has(.stat-link):hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(92,200,227,0.15); cursor: pointer; }
.table-link { color: inherit; font-weight: 600; }
.table-link:hover { text-decoration: underline; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { background: #f1f5f9; text-align: left; padding: 10px 12px; font-weight: 600;
                 border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: #f8fafc; }
.data-table .score-cell { font-weight: 700; text-align: center; min-width: 40px; }
.data-table .nowrap { white-space: nowrap; }

/* Filters */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters select, .filters input { padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
                                    font-size: 13px; background: #fff; font-family: 'Inter', sans-serif; }
.filters input[type="text"] { width: 240px; }
.filters input[type="date"] { width: 160px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; background: var(--accent); color: #fff; border: none;
       border-radius: 8px; font-size: 13px; cursor: pointer; font-weight: 500; font-family: 'Inter', sans-serif; }
.btn:hover { background: #4AB5D0; text-decoration: none; color: #fff; }
.btn-secondary { background: #94A3B8; }
.btn-secondary:hover { background: #64748b; }

/* Detail page */
.score-big { font-size: 48px; font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }
.skill-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.skill-bar .bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.skill-bar .fill { height: 100%; border-radius: 4px; }
.skill-bar .lbl { font-size: 13px; width: 160px; }
.skill-bar .val { font-size: 13px; font-weight: 600; width: 40px; text-align: right; }

.transcript-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
                   padding: 16px; font-size: 13px; line-height: 1.8; max-height: 500px; overflow-y: auto; white-space: pre-wrap; }
.transcript-box .sdr { color: #2563eb; font-weight: 600; }
.transcript-box .lead { color: #dc2626; font-weight: 600; }
.transcript-box .ts { color: #94a3b8; font-size: 12px; }

.section-title { font-size: 15px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
.notes-text { font-size: 14px; color: #475569; margin-bottom: 12px; }
.tag { display: inline-block; background: #f1f5f9; border-radius: 6px; padding: 2px 8px;
       font-size: 12px; margin: 2px; color: #475569; }
.tag.good { background: #dcfce7; color: #166534; }
.tag.bad { background: #fee2e2; color: #991b1b; }

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }

h1 { font-size: 22px; margin: 20px 0 10px; }
h2 { font-size: 18px; margin: 16px 0 8px; }
h3 { font-size: 15px; margin: 12px 0 6px; }
p { margin: 6px 0; font-size: 14px; }
li { margin-left: 24px; font-size: 14px; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Weekly comparison */
.weekly-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 768px) { .weekly-compare-grid { grid-template-columns: 1fr; } }

/* Login */
.login-container { max-width: 400px; margin: 100px auto; }
.login-container input { width: 100%; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--border);
                          border-radius: 8px; font-size: 14px; }
.login-container .btn { width: 100%; }
.error-msg { color: #dc2626; font-size: 14px; margin-bottom: 12px; }

/* Tech banner */
.tech-banner { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 12px 16px;
               margin-bottom: 12px; color: #991b1b; font-size: 14px; }

/* Summary content */
.summary-content { font-size: 14px; line-height: 1.8; }
.summary-content h1 { font-size: 20px; margin-top: 24px; }
.summary-content h2 { font-size: 17px; margin-top: 20px; }
.summary-content h3 { font-size: 15px; margin-top: 16px; }
.summary-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.summary-content th, .summary-content td { padding: 8px 12px; border: 1px solid var(--border); font-size: 13px; }
.summary-content th { background: #f1f5f9; font-weight: 600; }
.summary-content ul, .summary-content ol { margin-left: 24px; margin-bottom: 12px; }
