/* ===== Grundlagen ===== */
* { box-sizing: border-box; }
:root {
    --bg: #0b1120;
    --bg-elevated: #131c31;
    --bg-card: #1a2540;
    --border: #263252;
    --text: #e2e8f0;
    --text-dim: #8896b3;
    --text-faint: #5b6785;
    --accent: #4f7cff;
    --accent-hover: #3d64e0;
    --success: #22c55e;
    --success-bg: #0f2e1c;
    --warning: #f59e0b;
    --warning-bg: #3a2a0a;
    --danger: #ef4444;
    --danger-bg: #3a1414;
    --danger-hover: #dc2626;
    --radius: 10px;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

/* ===== Layout mit Sidebar ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.sidebar .brand {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1.5rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.sidebar nav a.active {
    background: rgba(79,124,255,0.12);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 600;
}
.sidebar .nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    padding: 1rem 1.5rem 0.35rem;
}
.sidebar .user-box {
    padding: 1rem 1.5rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
    padding-bottom: 1rem;
    font-size: 0.85rem;
}
.sidebar .user-box .role-pill {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    background: rgba(79,124,255,0.15);
    color: #9db4ff;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.sidebar .user-box a { color: var(--text-faint); font-size: 0.8rem; text-decoration: none; }
.sidebar .user-box a:hover { color: var(--text); }

.main-content { flex: 1; padding: 2rem; max-width: 1400px; }

/* ===== Bausteine (weitgehend kompatibel mit bisherigem Markup) ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 0 0 1.25rem;
}
h1 { margin-top: 0; font-size: 1.4rem; }
h2 { margin-top: 0; font-size: 1.05rem; }
label { display: block; margin: 0.75rem 0 0.25rem; color: var(--text-dim); font-size: 0.85rem; }
input, select, textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
form.edit {	width: 350px; }
summary { cursor: pointer; }
a.edit { text-decoration: none;}

button, .btn {
	margin-top: 12px;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
}
button:hover, .btn:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-approve { background: #059669; }
.btn-approve:hover { background: #047857; }
.btn-remove { background: #d97706; }
.btn-remove:hover { background: #b45309; }

.error { background: var(--danger-bg); border: 1px solid #7f1d1d; padding: 0.8rem; border-radius: 8px; margin-bottom: 1rem; }
.success-msg { background: var(--success-bg); border: 1px solid #14532d; padding: 0.8rem; border-radius: 8px; margin-bottom: 1rem; }

table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
th { color: var(--text-dim); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }

.filesize { color: var(--text-dim); font-size: 0.85rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.publish-log, .sync-log, .upload-report {
    background: var(--bg);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    max-height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-top: 1rem;
    border: 1px solid var(--border);
}
.status-pill { background: var(--warning-bg); color: #fde68a; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 999px; }
section.lib-section { margin-bottom: 2rem; }

/* Login/Install: zentrierte Karte ohne Sidebar */
.centered-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }

@media (max-width: 800px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 0.75rem; }
    .sidebar .brand, .sidebar .user-box { display: none; }
    .sidebar nav { flex-direction: row; }
    .sidebar nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .sidebar nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
    .main-content { padding: 1.25rem; }
}

footer {
  font-size: 0.7rem;
  text-align: center;
  padding: 10px 0 0;
}