* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    margin: 0;
    padding: 20px;
}

.container { max-width: 1400px; margin: 0 auto; }

a { color: #a78bfa; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { margin: 0 0 10px; display: flex; align-items: center; gap: 10px; font-size: 28px; }
h2 { margin: 30px 0 15px; color: #a78bfa; }
h3 { margin: 20px 0 10px; color: #c4b5fd; font-size: 16px; }

.tagline { color: #aaa; margin: 0 0 20px; }
.muted { color: #888; font-size: 13px; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-links {
    display: flex;
    gap: 16px;
    font-size: 14px;
    margin-bottom: 24px;
}

/* Stats grid */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.stat { background: #16213e; padding: 20px; border-radius: 12px; }
.stat-value { font-size: 32px; font-weight: bold; color: #7c3aed; }
.stat-label { color: #888; margin-top: 5px; }

/* Dashboard hero stats — same .stat skeleton with bigger numbers */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 8px 0 24px;
}
.stat.hero { padding: 24px; }
.stat.hero .stat-value { font-size: 44px; line-height: 1.05; }
.stat-unit { font-size: 0.5em; font-weight: normal; color: #a78bfa; margin-left: 4px; }

/* Velocity banner */
.velocity {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(90deg, rgba(124,58,237,0.18), rgba(124,58,237,0.04));
    border-left: 3px solid #7c3aed;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 15px;
}
.velocity strong { color: #fff; font-size: 18px; }
.velocity-arrow { color: #22c55e; font-size: 18px; }

/* Chart frames */
.card {
    background: #16213e;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.card h2 { margin: 0 0 16px; font-size: 16px; color: #c4b5fd; }
/* Chart sizing: with maintainAspectRatio:false, Chart.js fills the
   canvas's CSS box. Without a fixed height it grows to fill viewport,
   so we pin each chart to a sensible height. */
.card canvas { display: block; width: 100% !important; height: 240px !important; }
#chart-growth { height: 200px !important; }
#chart-mood   { height: 320px !important; }

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 0;
}
.chart-grid .card { margin-bottom: 0; }

.mood-axes {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 4px;
}

.footnote { margin-top: 32px; line-height: 1.6; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #16213e;
    border-radius: 12px;
    overflow: hidden;
}
th, td { padding: 10px 14px; text-align: left; }
th { background: #0f0f23; color: #7c3aed; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:nth-child(even) { background: #1a1a3e; }

code { background: #0f0f23; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

pre {
    background: #0f0f23;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    max-height: 400px;
}

details { background: #16213e; border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
details > summary { cursor: pointer; color: #a78bfa; user-select: none; }
details[open] > summary { margin-bottom: 12px; }

/* Browse: search + sort controls */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.controls input, .controls select {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0f0f23;
    color: #eee;
    font-size: 14px;
}
.controls input { width: 320px; }
.controls button {
    padding: 8px 16px;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.controls button:hover { background: #6d28d9; }

/* Browse: pagination */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    align-items: center;
    color: #888;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: 6px;
    background: #16213e;
}
.pagination .current { background: #7c3aed; color: white; }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* Browse: misc */
.yes { color: #22c55e; font-weight: bold; }
.no { color: #444; }
.empty {
    background: #16213e;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    color: #888;
}
.vector-row {
    background: #16213e;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}
.vector-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
.vector-meta strong { color: #a78bfa; }
.back-link { display: inline-block; margin-bottom: 16px; }

/* Admin: badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
}
.badge.flagged { background: #fbbf24; color: #000; }

/* Admin: buttons */
.btn-ban {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-unban {
    background: #22c55e;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-logout {
    background: #333;
    color: #eee;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

/* Admin: tabs */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tab {
    padding: 8px 16px;
    background: #16213e;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    color: #888;
}
.tab.active { background: #7c3aed; color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Admin: ban form */
.ban-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #16213e;
    border-radius: 8px;
}
.ban-form input {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #0f0f23;
    color: #eee;
}
.ban-form input[name="ip_address"] { width: 200px; }
.ban-form input[name="reason"] { flex: 1; }
.ban-form button {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Admin: login */
.login-box {
    background: #16213e;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
}
.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0f0f23;
    color: #eee;
    font-size: 16px;
}
.login-box button {
    width: 100%;
    padding: 12px;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}
.login-box button:hover { background: #6d28d9; }
.login-box .error { color: #ef4444; margin-top: 10px; }
