/* Wiederverwendbare UI-Komponenten */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.55 var(--font-body); color: var(--text); background: var(--bg); color-scheme: dark; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; color: var(--head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); } h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); } h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; } a { color: var(--green); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .mono { font-family: ui-monospace, Consolas, monospace; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; } .grow { flex: 1; } .right { margin-left: auto; }
.stack > * + * { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .6rem 1.3rem; border-radius: 999px; border: 2px solid var(--green); background: var(--green); color: var(--ink); font: 600 .95rem var(--font-body); cursor: pointer; text-decoration: none; transition: transform .15s, background .2s; }
.btn:hover:not(:disabled) { background: #bcc200; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); } .btn.ghost:hover:not(:disabled) { border-color: var(--green); background: rgba(168,173,0,.08); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 36px; padding: .3rem .9rem; font-size: .85rem; }
.btn.big { min-height: 72px; font-size: 1.2rem; width: 100%; }

.field { display: block; margin-bottom: 1rem; } .field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
input, select, textarea { width: 100%; min-height: 44px; padding: .6rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--ink); color: #fff; font: inherit; }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--green); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.card h3 { margin-bottom: .6rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); color: var(--head); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; } tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }

.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .15rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.badge::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--unknown); }
.badge.ok::before, .badge.approved::before, .badge.resolved::before, .badge.passed::before { background: var(--ok); }
.badge.warn::before, .badge.pending::before, .badge.requested::before, .badge.acknowledged::before { background: var(--warn); }
.badge.error::before, .badge.critical::before, .badge.revoked::before, .badge.failed::before, .badge.denied::before { background: var(--bad); }
.badge.info::before, .badge.active::before { background: var(--info); }
.badge.unknown::before { background: var(--unknown); } .badge.plain::before { display: none; }

.banner { padding: .7rem 1rem; border-radius: var(--radius-sm); background: rgba(217,164,6,.15); border: 1px solid var(--warn); color: #ffe08a; margin-bottom: 1rem; }
.banner.bad { background: rgba(201,67,58,.15); border-color: var(--bad); color: #ffb4ad; } .banner.info { background: rgba(74,143,209,.15); border-color: var(--info); color: #bcdcf7; }
.notice-todo { font-size: .8rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: .6rem .9rem; }

.dialog-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 200; padding: 1rem; }
.dialog { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.dialog.wide { width: min(820px, 100%); }
.toasts { position: fixed; right: 1rem; bottom: calc(1rem + var(--safe-b)); z-index: 300; display: grid; gap: .5rem; max-width: min(380px, calc(100% - 2rem)); }
.toast { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: var(--radius-sm); padding: .7rem 1rem; box-shadow: var(--shadow); }
.toast.ok { border-left-color: var(--ok); } .toast.error { border-left-color: var(--bad); } .toast.warn { border-left-color: var(--warn); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { border: 1px solid var(--bad); background: rgba(201,67,58,.12); border-radius: var(--radius-sm); padding: .8rem 1rem; color: #ffb4ad; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .45rem 1rem; border-radius: 999px; text-decoration: none; color: var(--text); font-family: var(--font-head); font-size: 1.1rem; letter-spacing: .04em; }
.tabs a:hover { background: rgba(255,255,255,.08); } .tabs a[aria-current=page] { background: var(--green); color: var(--ink); }
