:root {
    --bg: #0f1115;
    --panel: #171a21;
    --border: #2a2f3a;
    --text: #e6e8eb;
    --muted: #9aa2af;
    --accent: #4c8dff;
    --ok: #2e7d5b;
    --warn: #b8862f;
    --danger: #b8433f;
}

* { box-sizing: border-box; }

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

/* --- App shell: sidebar + main content (ingelogde staat) --- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand .brand-logo { width: 28px; height: 28px; }
.sidebar-brand .brand-name { color: var(--text); font-weight: 500; font-size: 1.05rem; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-nav > a {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}
.sidebar-nav > a:hover { background: rgba(76,141,255,0.1); }
.sidebar-nav > a.active { background: rgba(76,141,255,0.18); color: var(--accent); }

.sidebar-section-label {
    margin: 0.75rem 0.5rem 0.25rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.nav-group summary {
    list-style: none; cursor: pointer;
    padding: 0.5rem 0.75rem; border-radius: 6px;
    font-size: 0.9rem; font-weight: 500; color: var(--text);
    display: flex; align-items: center; justify-content: space-between;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '\25BE'; font-size: 0.7rem; color: var(--muted); }
.nav-group:hover summary { background: rgba(76,141,255,0.1); }
.nav-group-items {
    display: flex; flex-direction: column; padding-left: 0.75rem;
}
.nav-group-items a {
    padding: 0.4rem 0.75rem; font-size: 0.85rem; color: var(--muted); border-radius: 6px;
}
.nav-group-items a:hover { background: rgba(76,141,255,0.1); color: var(--text); }

.sidebar-user {
    border-top: 1px solid var(--border);
    padding: 0.9rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.85rem;
}
.sidebar-user .username { color: var(--muted); }

.main-area { flex: 1; min-width: 0; }
.main-area main { max-width: none; padding: 1.75rem 2rem; }

/* --- Login-only topbar (uitgelogde staat) --- */
.topbar-login {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.brand .brand-logo { width: 28px; height: 28px; }
.brand .brand-name { color: var(--text); font-weight: 500; font-size: 1.05rem; }

.link-button {
    background: none; border: none; color: var(--accent);
    cursor: pointer; font-weight: 600; padding: 0; font-size: 0.9rem;
}

.stat-row { display: flex; gap: 1rem; margin: 1rem 0 2rem 0; }
.stat-box {
    background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    padding: 1rem 1.5rem; display: flex; flex-direction: column; min-width: 120px;
}
.stat-box-link { text-decoration: none; transition: border-color 0.15s; }
.stat-box-link:hover { border-color: var(--accent); }
.stat-number { font-size: 1.8rem; font-weight: 600; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.85rem; }

.login-box { max-width: 320px; margin: 3rem auto; }

.doc-item {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.doc-item summary { cursor: pointer; font-weight: 600; }
.doc-item form.scan-form { margin-top: 0.75rem; max-width: 100%; }
.doc-item h3 { margin-top: 1rem; margin-bottom: 0.25rem; font-size: 0.95rem; }

code {
    background: rgba(255,255,255,0.06);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.logo {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

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

a { color: var(--accent); }

h1, h2 { font-weight: 600; }

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

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.card h2 { margin: 0 0 0.25rem 0; font-size: 1.05rem; }
.card p { margin: 0 0 0.5rem 0; color: var(--muted); }

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.badge-ok { background: rgba(46, 125, 91, 0.2); color: #6fd6a8; }
.badge-eol { background: rgba(184, 67, 63, 0.2); color: #ff8f8a; }
.badge-unknown { background: rgba(184, 134, 47, 0.2); color: #f0c26e; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 600; }

section { margin-top: 2rem; }

.site-list { list-style: none; padding: 0; }
.site-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }

.inline-form { display: inline-flex; gap: 0.5rem; margin-top: 0.75rem; }

input[type=text], input[type=number], input[type=password], textarea, select {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-family: inherit;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

button.danger { background: var(--danger); }

.scan-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 480px; }
.scan-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: var(--muted); }
.scan-form label.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
.scan-form hr { border-color: var(--border); width: 100%; }
.button-row { display: flex; gap: 0.75rem; }

.hint { color: var(--muted); font-size: 0.9rem; }

.flash-container { margin-bottom: 1rem; }
.flash { padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 0.5rem; }
.flash-success { background: rgba(46, 125, 91, 0.2); color: #6fd6a8; }
.flash-error { background: rgba(184, 67, 63, 0.2); color: #ff8f8a; }

.log {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    white-space: pre-wrap;
    font-size: 0.85rem;
    max-height: 500px;
    overflow-y: auto;
}
