:root {
    --bg: #0d1117;
    --panel: #151b23;
    --panel-2: #1d2630;
    --text: #e6edf3;
    --muted: #8b949e;
    --line: rgba(255,255,255,.1);
    --accent: #7aa36f;
    --danger: #d05c5c;
    --warn: #c9a227;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(122,163,111,.15), transparent 36%), var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a { color: inherit; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: rgba(21,27,35,.94);
    border-right: 1px solid var(--line);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}
.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2f4c35, #111820);
    border: 1px solid rgba(122,163,111,.45);
    display: grid;
    place-items: center;
    font-weight: 800;
}
.brand span { display: block; color: var(--muted); font-size: 12px; }
nav { display: grid; gap: 8px; }
nav a, .logout {
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: var(--muted);
}
nav a:hover, .logout:hover {
    color: var(--text);
    background: var(--panel-2);
    border-color: var(--line);
}
.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 8px;
    color: var(--muted);
}
.main {
    margin-left: 260px;
    padding: 28px 28px 18px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.topbar {
    margin-bottom: 22px;
}
h1 { margin: 0; font-size: 28px; }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}
.card, .table-card, form.panel {
    background: rgba(21,27,35,.92);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 18px 40px rgba(0,0,0,.22);
}
.card strong { font-size: 28px; display: block; }
.card span { color: var(--muted); }
.table-card { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; font-weight: 650; }
tr:last-child td { border-bottom: 0; }
label { display: block; color: var(--muted); margin-bottom: 6px; font-size: 13px; }
input, select, textarea {
    width: 100%;
    background: #0b1016;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(122,163,111,.75); }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button, .button {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    background: var(--accent);
    color: #071108;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
button.secondary, .button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--danger); color: #fff; }
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    background: var(--panel-2);
    color: var(--muted);
    border: 1px solid var(--line);
    margin: 2px;
}
.badge.ok { color: #b6f3b6; border-color: rgba(122,163,111,.45); }
.badge.off { color: #ffb3b3; border-color: rgba(208,92,92,.45); }
.flash {
    padding: 13px 16px;
    border-radius: 14px;
    background: rgba(122,163,111,.16);
    border: 1px solid rgba(122,163,111,.35);
    margin-bottom: 16px;
}
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card { width: min(430px, 100%); }
.small { color: var(--muted); font-size: 13px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 8px; }
.check-item {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #0b1016;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
}
.check-item input { width: auto; }
code { color: #d4d4aa; }
@media (max-width: 860px) {
    .sidebar { position: static; width: auto; }
    .main { margin-left: 0; padding: 18px; min-height: auto; }
    .app-page .cookie-notice { right: 18px; max-width: calc(100vw - 36px); }
}

.secret-field summary {
    cursor: pointer;
    color: var(--muted);
    user-select: none;
}
.secret-field[open] summary {
    margin-bottom: 6px;
    color: var(--text);
}
.user-protected-note {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}


/* Globaler Footer + CSS-Tooltip */
.global-footer {
    width: min(980px, calc(100vw - 36px));
    margin: 30px auto 18px;
    padding: 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.global-footer-inner {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 10px;
    max-width: 100%;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(21,27,35,.92), rgba(13,17,23,.78));
    box-shadow: 0 14px 34px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.03);
    backdrop-filter: blur(8px);
}
.app-page .main > .global-footer {
    margin-top: auto;
    margin-bottom: 0;
    width: 100%;
}
.global-footer .footer-link,
.global-footer .footer-made-by {
    color: var(--text);
    text-decoration: none;
    font-weight: 650;
}
.global-footer .footer-link:hover {
    text-decoration: underline;
}
.footer-text,
.footer-made-by,
.footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
}
.footer-separator {
    opacity: .45;
    margin: 0 1px;
}
.footer-made-by.has-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted rgba(230,237,243,.38);
    outline: none;
}
.footer-made-by.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: min(340px, calc(100vw - 42px));
    padding: 8px 10px;
    border-radius: 10px;
    background: #0b1016;
    color: var(--text);
    border: 1px solid rgba(122,163,111,.45);
    box-shadow: 0 14px 34px rgba(0,0,0,.42);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
    z-index: 80;
}
.footer-made-by.has-tooltip::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%) translateY(4px) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #0b1016;
    border-right: 1px solid rgba(122,163,111,.45);
    border-bottom: 1px solid rgba(122,163,111,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
    z-index: 79;
}
.footer-made-by.has-tooltip:hover::after,
.footer-made-by.has-tooltip:focus-visible::after,
.footer-made-by.has-tooltip:hover::before,
.footer-made-by.has-tooltip:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.footer-made-by.has-tooltip:hover::before,
.footer-made-by.has-tooltip:focus-visible::before {
    transform: translateX(-50%) translateY(0) rotate(45deg);
}
.cookie-notice {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: min(560px, calc(100vw - 44px));
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    background: rgba(21,27,35,.98);
    border: 1px solid rgba(122,163,111,.45);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,.48);
}
.app-page .cookie-notice {
    right: 28px;
    max-width: calc(100vw - 260px - 56px);
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.cookie-notice button {
    white-space: nowrap;
}
.public-page .global-footer,
.login-wrap + .global-footer {
    width: min(980px, calc(100vw - 36px));
    margin: 0 auto 18px;
}

.public-wrap {
    min-height: calc(100vh - 90px);
    display: grid;
    place-items: start center;
    padding: 32px 18px 18px;
}
.legal-card {
    width: min(920px, 100%);
}
.legal-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 18px;
}
.legal-card h2 {
    margin: 20px 0 8px;
    font-size: 18px;
}
.legal-card p { line-height: 1.6; }
.legal-note {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(201,162,39,.42);
    background: rgba(201,162,39,.12);
    color: var(--text);
}

@media (max-width: 700px) {
    .global-footer-inner {
        border-radius: 18px;
        padding: 12px 14px;
    }
    .has-tooltip::after {
        min-width: 220px;
    }
    .cookie-notice { grid-template-columns: 1fr; }
    .cookie-notice button { width: 100%; }
    .legal-head { display: grid; }
}
