/* O1: Inter via Google Fonts, plus explizites Light-Theme.
   color-scheme: light verhindert, dass Chromes "Auto Dark" den
   Hintergrund hinter unseren Komponenten umfaerbt. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    color-scheme: light;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    color: #222;
    /* O3: Hintergrund als Bild-Asset (img/bg.png). Default ist ein
       einfarbiges Pastell-Lila — wer ein Foto oder Pattern will,
       tauscht nur die PNG/JPG aus, kein CSS-Eingriff noetig.
       Fallback-Farbe deckt den Moment vor dem Bild-Load. */
    background: #ece4f3 url('img/bg.png') center/cover fixed;
    min-height: 100vh;
}

main {
    max-width: 60rem;
    margin: 2rem auto;
    padding: 1.5rem 1.8rem 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06),
                0 6px 24px rgba(60, 70, 100, 0.08);
}

/* --------------------------------------------------- Login-Karte */
.login-page {
    /* Background offen lassen, damit der Body-Gradient durchscheint. */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    width: 22rem;
}
.login-card h1 {
    margin-top: 0;
}
.login-card label {
    display: block;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.login-card input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
    font-size: 1rem;
    margin-top: 0.3rem;
}
.login-card button {
    margin-top: 0.5rem;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
}
.error {
    background: #fbe9e7;
    border: 1px solid #d84315;
    color: #b71c1c;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* --------------------------------------------------- Topbar */
.topbar {
    background: #1a3a5c;
    color: #fff;
    padding: 0.6rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar .brand {
    font-weight: bold;
    letter-spacing: 0.05em;
    /* O2: kleines Stack-Logo links vom Brand-Text als Inline-SVG in der
       Background-Image-Property — kein HTML-Touch noetig, Logo erscheint
       ueberall wo .brand steht. Tausch gegen ein eigenes Asset spaeter:
       background-image: url('logo.svg') und background-size anpassen. */
    padding-left: 2rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><rect x='3' y='5' width='18' height='3' rx='1' fill='white' opacity='0.55'/><rect x='3' y='10.5' width='18' height='3' rx='1' fill='white' opacity='0.78'/><rect x='3' y='16' width='18' height='3' rx='1' fill='white'/></svg>");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 1.4rem 1.4rem;
}
.topbar a {
    color: #fff;
    margin-left: 1rem;
}
.user-nav .user {
    margin-right: 1rem;
}
.badge-admin {
    background: #e8b923;
    color: #222;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-left: 0.3rem;
}

/* --------------------------------------------------- Projekt-Tabelle (H4) */
table.projects {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
table.projects col.col-label {
    width: 30%;
}
table.projects tr.section-header th {
    background: #eef2f7;
    color: #1a3a5c;
    text-align: left;
    padding: 0.5rem 0.8rem;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-top: 1px solid #d6dde6;
    border-bottom: 1px solid #d6dde6;
}
table.projects td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
table.projects td.col-label a {
    color: #1a3a5c;
    text-decoration: none;
    font-weight: 500;
}
table.projects td.col-label a:hover {
    text-decoration: underline;
}
table.projects td.col-desc {
    color: #555;
    font-size: 0.92rem;
}

.empty-hint {
    background: #fff8e1;
    border: 1px solid #e6c66b;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    color: #6b5a18;
}

/* --------------------------------------------------- Admin-Maske (H5) */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #d6dde6;
    margin-bottom: 1.2rem;
}
.tab-bar a {
    padding: 0.5rem 1.1rem;
    color: #555;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab-bar a.active {
    color: #1a3a5c;
    font-weight: 600;
    border-bottom-color: #1a3a5c;
}
.tab-bar a:hover {
    color: #1a3a5c;
}

table.admin-list {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}
table.admin-list th {
    text-align: left;
    background: #eef2f7;
    color: #1a3a5c;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #d6dde6;
    font-size: 0.9rem;
}
table.admin-list td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
table.admin-list td.actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
table.admin-list form.inline {
    display: inline;
    margin: 0;
}
table.admin-list form.inline a {
    color: #1a3a5c;
    text-decoration: none;
}
table.admin-list form.inline a:hover {
    text-decoration: underline;
}
.muted {
    color: #999;
    font-size: 0.85rem;
}
.badge-user {
    background: #d6dde6;
    color: #444;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.admin-form {
    background: #f8fafc;
    border: 1px solid #d6dde6;
    border-radius: 6px;
    padding: 1rem 1.2rem;
    max-width: 28rem;
}
.admin-form label {
    display: block;
    margin: 0.7rem 0;
    font-size: 0.9rem;
}
.admin-form label.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="number"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.5rem;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}
.admin-form button {
    margin-top: 0.6rem;
    padding: 0.4rem 1.1rem;
    cursor: pointer;
}
.admin-form a.cancel {
    margin-left: 1rem;
    color: #777;
}

table.admin-list td code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.9em;
    background: #f3f3f3;
    padding: 0 0.3em;
    border-radius: 2px;
}
table.admin-list td.col-desc {
    color: #555;
    font-size: 0.9rem;
    max-width: 24rem;
}

table.acl-matrix {
    width: auto;
}
table.acl-matrix th.user-col {
    text-align: center;
    font-weight: normal;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    background: #eef2f7;
    border-left: 1px solid #d6dde6;
}
table.acl-matrix tr.section-header th {
    background: #dde6f1;
    color: #1a3a5c;
    text-align: left;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-top: 1px solid #b7c5d6;
    border-bottom: 1px solid #b7c5d6;
}
table.acl-matrix td.cell-check {
    text-align: center;
    border-left: 1px solid #eee;
}
table.acl-matrix tbody td:first-child {
    font-weight: 500;
}
form.acl-form button {
    margin-top: 1rem;
    padding: 0.4rem 1.1rem;
    cursor: pointer;
}

.flash {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.flash-ok {
    background: #e8f5e9;
    border: 1px solid #81c784;
    color: #1b5e20;
}
.flash-error {
    background: #fbe9e7;
    border: 1px solid #d84315;
    color: #b71c1c;
}
