:root {
    --bg: #0f1115;
    --surface: #1a1d24;
    --surface-2: #22262f;
    --border: #2c313c;
    --text: #e8e9ec;
    --text-dim: #9aa0ab;
    --accent: #6c8cff;
    --accent-2: #ffb454;
    --ok: #5fd88f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

header.site-header .brand { font-weight: 700; font-size: 1.1rem; }
header.site-header nav a { margin-right: 1rem; color: var(--text-dim); }
header.site-header nav a:hover { color: var(--text); }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

h1, h2, h3 { line-height: 1.2; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card img.cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: var(--surface-2);
}

.card .body { padding: 0.75rem; flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.card .title { font-weight: 600; }
.card .meta { color: var(--text-dim); font-size: 0.85rem; }

.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.badge.complete { color: var(--ok); border-color: var(--ok); }
.badge.repro { color: var(--accent-2); border-color: var(--accent-2); }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 0.85rem; }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.filters select, .filters input { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 0.4rem 0.6rem; border-radius: 6px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    min-width: 150px;
}
.stat-tile .value { font-size: 1.6rem; font-weight: 700; }
.stat-tile .label { color: var(--text-dim); font-size: 0.85rem; }

form.entity-form { display: flex; flex-direction: column; gap: 0.9rem; max-width: 560px; }
form.entity-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--text-dim); }
form.entity-form input, form.entity-form select, form.entity-form textarea {
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    padding: 0.5rem 0.6rem; border-radius: 6px; font: inherit;
}
form.entity-form textarea { min-height: 80px; }

button, .btn {
    background: var(--accent); color: #0b0d12; border: none; padding: 0.55rem 1rem;
    border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
button.secondary, .btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
button.danger, .btn.danger { background: #e05a5a; color: white; }

.autocomplete { position: relative; }
.autocomplete-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
    max-height: 280px; overflow-y: auto; margin-top: 4px;
}
.autocomplete-results .item { display: flex; gap: 0.6rem; padding: 0.5rem; cursor: pointer; align-items: center; }
.autocomplete-results .item:hover { background: var(--surface); }
.autocomplete-results img { width: 36px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--bg); }

.empty { color: var(--text-dim); font-style: italic; padding: 2rem 0; }
.actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; flex-wrap: wrap; }
.section { margin-bottom: 2rem; }
