:root {
    --bg: #0b0e1a;
    --panel: #131829;
    --panel-2: #182040;
    --border: #232a47;
    --text: #e6ebf5;
    --muted: #8d97b5;
    --accent: #5b8def;
    --accent-2: #a78bfa;
    --good: #26d07c;
    --bad: #f06292;
    --warn: #ffb74d;
    --shadow: 0 18px 48px -24px rgba(91, 141, 239, 0.45);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(1200px 700px at 12% -10%, rgba(91, 141, 239, 0.18), transparent 60%),
                radial-gradient(900px 600px at 110% 10%, rgba(167, 139, 250, 0.14), transparent 60%),
                var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    border-right: 1px solid var(--border);
    background: rgba(15, 19, 36, 0.65);
    backdrop-filter: blur(14px);
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 700;
    font-size: 16px;
    color: white;
    box-shadow: var(--shadow);
}
.brand-title { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    transition: 0.15s ease;
}
.nav-item:hover { color: var(--text); background: rgba(91, 141, 239, 0.08); }
.nav-item.active {
    color: white;
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.22), rgba(167, 139, 250, 0.18));
    border: 1px solid rgba(91, 141, 239, 0.35);
}

.sidebar-footer {
    margin-top: auto;
    display: flex; align-items: center; gap: 8px;
    color: var(--muted);
    font-size: 12.5px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.online { background: var(--good); box-shadow: 0 0 12px var(--good); }

/* Content */
.content { padding: 32px 44px 56px; max-width: 1280px; }

.topbar {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 28px;
    gap: 16px;
}
.kicker { font-size: 12px; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; }
.page-title { font-size: 28px; margin: 6px 0 0; font-weight: 700; }
.topbar-meta { display: flex; gap: 10px; }

.primary-btn, .ghost-btn {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s ease;
    border: 1px solid transparent;
    display: inline-flex; align-items: center; gap: 8px;
}
.primary-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; }
.primary-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.ghost-btn { background: rgba(91, 141, 239, 0.06); border-color: var(--border); color: var(--text); }
.ghost-btn:hover { background: rgba(91, 141, 239, 0.14); }

/* Hero */
.hero {
    display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px;
    margin-bottom: 32px;
}
.hero-text { padding: 32px; background: linear-gradient(135deg, rgba(91, 141, 239, 0.14), rgba(167, 139, 250, 0.08));
    border: 1px solid var(--border); border-radius: 20px; }
.hero-text h2 { font-size: 32px; margin: 14px 0 10px; line-height: 1.2; }
.hero-text p { color: var(--muted); margin: 0 0 22px; font-size: 15px; line-height: 1.6; }
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(91, 141, 239, 0.14);
    border: 1px solid rgba(91, 141, 239, 0.28);
    letter-spacing: 0.06em;
}
.cta-row { display: flex; gap: 10px; }

.hero-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 26px;
    display: flex; flex-direction: column; gap: 14px;
}
.hero-card-row {
    display: flex; justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
}
.hero-card-row:last-child { border-bottom: none; padding-bottom: 0; }
.muted { color: var(--muted); }

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}
.card {
    position: relative;
    padding: 22px 22px 50px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    transition: 0.18s ease;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(280px 160px at 100% 0%, rgba(91, 141, 239, 0.18), transparent);
    opacity: 0;
    transition: 0.18s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(91, 141, 239, 0.4); }
.card:hover::before { opacity: 1; }
.card-tag {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.card h3 { margin: 8px 0 6px; font-size: 19px; }
.card p { color: var(--muted); margin: 0; font-size: 13.5px; line-height: 1.5; }
.card-arrow {
    position: absolute; right: 22px; bottom: 18px;
    font-size: 22px;
    color: var(--accent);
}

/* Panels */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 26px 28px;
    margin-bottom: 22px;
}
.panel-title {
    font-size: 18px;
    margin: 0 0 18px;
    display: flex; align-items: center; gap: 10px;
}
.panel-title::before {
    content: '';
    width: 4px; height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.sub { font-size: 14.5px; color: var(--muted); margin: 18px 0 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.prose { color: var(--muted); line-height: 1.6; max-width: 820px; }

/* Metrics */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.metric {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 4px;
}
.metric strong { font-size: 22px; font-weight: 700; }
.metric .muted { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: rgba(91, 141, 239, 0.06); color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.data-table tbody tr:hover { background: rgba(91, 141, 239, 0.05); }
.data-table.compact td, .data-table.compact th { padding: 10px 12px; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; }
.ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }

/* Plots */
.plots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
}
.plots-grid.two { grid-template-columns: 1fr 1fr; }
.plot-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    margin: 0;
}
.plot-card img { width: 100%; height: auto; border-radius: 10px; display: block; }
.plot-card figcaption h3 { margin: 14px 0 6px; font-size: 15px; }
.plot-card figcaption p { color: var(--muted); margin: 0; font-size: 13px; line-height: 1.5; }

/* Hypothesis cards */
.hypotheses-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px;
}
.hypothesis-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--muted);
    border-radius: 14px;
    padding: 18px;
}
.hypothesis-card.rejected { border-left-color: var(--bad); }
.hypothesis-card.accepted { border-left-color: var(--good); }
.hypothesis-card h3 { margin: 6px 0 12px; font-size: 16px; }
.hyp-tag {
    font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent); font-weight: 600;
}
.hypothesis-card dl { display: grid; gap: 6px; margin: 0 0 12px; }
.hypothesis-card dl > div { display: grid; grid-template-columns: 90px 1fr; gap: 10px; }
.hypothesis-card dt { color: var(--muted); font-size: 12px; font-weight: 500; }
.hypothesis-card dd { margin: 0; font-size: 13px; }
.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.hypothesis-card.rejected .status-pill { background: rgba(240, 98, 146, 0.16); color: var(--bad); }
.hypothesis-card.accepted .status-pill { background: rgba(38, 208, 124, 0.16); color: var(--good); }
.hypothesis-card footer p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Layout helpers */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin: 18px 0; }
.kv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.kv-list li {
    display: flex; justify-content: space-between;
    padding: 10px 14px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13.5px;
}
.kv-list span { color: var(--muted); }

.bullet-list { padding-left: 20px; color: var(--muted); line-height: 1.7; }
.bullet-list li { margin-bottom: 8px; }

/* Logs */
.method, .status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}
.method.m-GET { background: rgba(91, 141, 239, 0.18); color: var(--accent); }
.method.m-POST { background: rgba(38, 208, 124, 0.18); color: var(--good); }
.method.m-PUT { background: rgba(255, 183, 77, 0.18); color: var(--warn); }
.method.m-DELETE { background: rgba(240, 98, 146, 0.18); color: var(--bad); }
.status.s-2xx { background: rgba(38, 208, 124, 0.18); color: var(--good); }
.status.s-3xx { background: rgba(91, 141, 239, 0.18); color: var(--accent); }
.status.s-4xx { background: rgba(255, 183, 77, 0.18); color: var(--warn); }
.status.s-5xx { background: rgba(240, 98, 146, 0.18); color: var(--bad); }

.inline-form { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.inline-form label { color: var(--muted); font-size: 13px; }
.inline-form input {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 9px 12px;
    width: 120px;
    font: inherit;
}
.inline-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }

@media (max-width: 1100px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; gap: 14px; flex-wrap: wrap; align-items: center; }
    .sidebar-footer { margin-left: auto; margin-top: 0; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .hero { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .plots-grid.two { grid-template-columns: 1fr; }
    .content { padding: 24px; }
}
