:root {
    --night: #0B1020;
    --blue: #3568FF;
    --cyan: #17C9D4;
    --violet: #745CFF;
    --cloud: #F4F7FC;
    --slate: #64748B;
    --white: #FFFFFF;
    --green: #22C55E;
    --yellow: #F59E0B;
    --red: #EF4444;
    --critical: #DC2626;
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--cloud); color: var(--night); }
a { color: inherit; }
code { background: #e8edf7; border-radius: 6px; padding: 2px 6px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px clamp(16px, 4vw, 48px);
    background: var(--white);
    border-bottom: 1px solid #dfe7f5;
    position: sticky;
    top: 0;
    z-index: 5;
}
.brand { font-weight: 900; text-decoration: none; font-size: 1.35rem; color: var(--blue); }
nav { display: flex; gap: 14px; align-items: center; }
nav a { text-decoration: none; color: var(--slate); font-weight: 700; }
.page { width: min(1120px, calc(100% - 32px)); margin: 32px auto; }

.hero {
    padding: clamp(32px, 7vw, 84px);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--night), #152556 60%, var(--blue));
    color: var(--white);
}
.hero.compact { padding: clamp(28px, 5vw, 52px); }
.hero h1 { max-width: 820px; margin: 0; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.05; letter-spacing: 0; }
.hero p { max-width: 720px; color: #d8e3ff; font-size: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 900; color: var(--cyan); }

.grid { display: grid; gap: 18px; margin-top: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .card, .authbox {
    background: var(--white);
    border: 1px solid #dfe7f5;
    border-radius: 8px;
    padding: 22px;
    margin-top: 18px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card h2, .card h3, .panel h2 { margin-top: 0; }
.repo-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.repo-spotlight-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid #dfe7f5;
    border-radius: 8px;
    background: #f8fbff;
    text-decoration: none;
}
.repo-spotlight-card strong {
    font-size: 1.08rem;
}
.repo-spotlight-card > span,
.repo-spotlight-card p,
.repo-spotlight-meta small {
    color: var(--slate);
    font-weight: 800;
}
.repo-spotlight-card p {
    margin: 0;
    line-height: 1.45;
}
.repo-spotlight-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.repo-spotlight-meta small {
    border-radius: 999px;
    background: #e8edf7;
    padding: 5px 8px;
}
.dashboard-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.authbox { max-width: 460px; margin: 48px auto; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 18px; }
.stat-card {
    background: var(--white);
    border: 1px solid #dfe7f5;
    border-radius: 8px;
    padding: 18px;
}
.stat-card span, .stat-card small { color: var(--slate); font-weight: 800; }
.stat-card strong { display: block; margin: 8px 0; font-size: 2rem; color: var(--night); }
.metric-list { display: grid; gap: 12px; }
.metric-row {
    display: grid;
    grid-template-columns: minmax(74px, 1fr) minmax(100px, 2fr) auto auto;
    gap: 10px;
    align-items: center;
}
.metric-row span, .metric-row small { color: var(--slate); font-weight: 800; }
.metric-bar { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.metric-bar i { display: block; height: 100%; background: var(--blue); }
.metric-bar i.human, .legend-human, .bar-human { background: var(--green); }
.metric-bar i.crawler, .legend-crawler, .bar-crawler { background: var(--violet); }
.bar-download { background: var(--cyan); }
.stats-hero {
    background: linear-gradient(135deg, #07101f 0%, #13366f 52%, #0e7490 100%);
}
.stats-hero-meta, .stats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.stats-hero-meta span, .stats-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 900;
}
.stats-hero-meta span {
    background: rgba(255,255,255,.14);
    color: #f8fbff;
}
.stats-legend span {
    background: #f8fafc;
    color: var(--slate);
}
.stats-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}
.stat-card {
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--blue);
}
.accent-green::before { background: var(--green); }
.accent-violet::before { background: var(--violet); }
.accent-cyan::before { background: var(--cyan); }
.accent-yellow::before { background: var(--yellow); }
.accent-slate::before { background: #94a3b8; }
.chart-panel {
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.section-head h2, .section-head p {
    margin: 0;
}
.section-head .eyebrow {
    font-size: .78rem;
    color: var(--blue);
}
.split-meter {
    display: flex;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}
.split-human { background: var(--green); min-width: 0; }
.split-crawler { background: var(--violet); min-width: 0; }
.metric-list.roomy { margin-top: 18px; }
.metric-row.compact {
    grid-template-columns: minmax(120px, 1.15fr) minmax(120px, 2fr) auto auto;
}
.timeline {
    display: grid;
    gap: 13px;
}
.timeline-row {
    display: grid;
    grid-template-columns: 58px minmax(120px, 1fr) 48px 148px;
    gap: 12px;
    align-items: center;
}
.timeline-row span, .timeline-row small {
    color: var(--slate);
    font-weight: 800;
}
.timeline-bars {
    display: flex;
    gap: 3px;
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}
.timeline-bars i {
    display: block;
    height: 100%;
    min-width: 0;
}
.rank-list {
    display: grid;
    gap: 14px;
}
.rank-item {
    display: grid;
    gap: 8px;
}
.rank-item > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    min-width: 0;
}
.rank-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.rank-item small {
    color: var(--slate);
    font-weight: 800;
}
.rank-bar {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}
.rank-bar i {
    display: block;
    height: 100%;
    min-width: 3px;
    background: var(--blue);
}
.rank-bar i.ai, .badge.ai { background: #7c3aed; color: #fff; }
.rank-bar i.search, .badge.search { background: #2563eb; color: #fff; }
.rank-bar i.social, .badge.social { background: #db2777; color: #fff; }
.rank-bar i.seo, .badge.seo { background: #ea580c; color: #fff; }
.rank-bar i.archive, .badge.archive { background: #475569; color: #fff; }
.rank-bar i.other, .badge.other { background: #0891b2; color: #fff; }
.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    background: #e8edf7;
    color: var(--night);
    padding: 4px 9px;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}
.badge.human {
    background: #dcfce7;
    color: #166534;
}
.badge.crawler {
    background: #ede9fe;
    color: #5b21b6;
}
.hour-chart {
    display: grid;
    grid-template-columns: repeat(24, minmax(18px, 1fr));
    gap: 6px;
    align-items: end;
    min-height: 190px;
    padding-top: 10px;
}
.hour-col {
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: end;
    gap: 8px;
    min-height: 170px;
}
.hour-col i {
    display: block;
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--cyan), var(--blue));
}
.hour-col span {
    color: var(--slate);
    font-size: .72rem;
    font-weight: 900;
    text-align: center;
}
.stats-table {
    display: grid;
    overflow-x: auto;
}
.stats-tr {
    display: grid;
    grid-template-columns: minmax(240px, 1.7fr) minmax(140px, .85fr) 90px 110px;
    gap: 12px;
    align-items: center;
    min-width: 680px;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
}
.stats-th {
    color: var(--slate);
    font-weight: 900;
}
.stats-tr small {
    display: block;
    margin-top: 5px;
    color: var(--slate);
    font-weight: 800;
}
.event-row strong {
    min-width: 0;
}

form { display: grid; gap: 12px; }
form.inline { display: inline; }
label { display: grid; gap: 6px; color: var(--slate); font-weight: 800; }
input, select, textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    font: inherit;
    background: var(--white);
}
textarea { min-height: 88px; }
button, .button {
    border: 0;
    background: var(--blue);
    color: var(--white);
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.button.ghost, button.ghost { background: #e8edf7; color: var(--night); }
.button.small, button.small { padding: 8px 12px; font-size: .92rem; }
.danger-button { background: var(--critical); }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.actions.wrap { flex-wrap: wrap; }

.notice { padding: 14px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 800; }
.notice.success { background: #dcfce7; color: #166534; }
.notice.danger { background: #fee2e2; color: #991b1b; }
.hint { color: var(--slate); font-weight: 800; }

.status {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 8px;
}
.green { background: var(--green); }
.yellow { background: var(--yellow); }
.red { background: var(--red); }
.blue { background: var(--blue); }
.gray { background: #94a3b8; }

.progress { height: 14px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.progress span { display: block; height: 100%; }
.progress .success { background: var(--green); }
.progress .warning { background: var(--yellow); }
.progress .danger { background: var(--red); }

.list { display: grid; gap: 10px; }
.compact-list .row { gap: 10px; }
.addon-groups {
    display: grid;
    gap: 22px;
}
.addon-group h3 {
    margin: 0 0 8px;
    color: var(--night);
}
.row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid #edf2f7;
}
.addon-summary {
    align-items: flex-start;
}
.addon-summary div {
    min-width: 0;
}
.addon-summary p {
    margin: 6px 0 0;
    color: var(--slate);
    line-height: 1.5;
}
.addon-summary span {
    flex: 0 0 auto;
    color: var(--slate);
    font-weight: 800;
}
.linkrow { text-decoration: none; }
.table { display: grid; gap: 0; overflow-x: auto; }
.tr { display: grid; grid-template-columns: 1.4fr .7fr 1fr .45fr .45fr 1.8fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf2f7; min-width: 980px; }
.th { font-weight: 900; color: var(--slate); }
.admin-actions { display: grid; gap: 8px; }
.review-reject-form {
    min-width: min(100%, 320px);
}
.review-reject-form textarea {
    min-height: 76px;
}
.upload input[type=file] { padding: 28px; border: 2px dashed #b9c6dd; background: #f8fbff; }

@media (max-width: 820px) {
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .topbar { align-items: flex-start; gap: 12px; flex-direction: column; }
    nav { flex-wrap: wrap; }
    .row { align-items: flex-start; flex-direction: column; }
    .metric-row { grid-template-columns: 1fr; }
    .metric-row.compact, .timeline-row { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; }
    .hour-chart { grid-template-columns: repeat(12, minmax(18px, 1fr)); }
    .rank-item > div:first-child { align-items: flex-start; flex-direction: column; }
}
