:root {
    --bg:        #0f1319;
    --surface:   #161b23;
    --surface-2: #1c222c;
    --line:      #29313d;
    --text:      #e7ebf1;
    --muted:     #8a94a4;
    --accent:    #f0a92b;
    --accent-dim:#3a2c10;
    --accent-ink:#1a1206;
    --danger:    #e5646e;
    --ok:        #57c98a;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
    max-width: 940px;
    margin: 0 auto;
    padding: 28px 20px 80px;
}

/* ---- Kopfzeile ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 22px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--line);
}
.brand {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: var(--mono);
    font-size: 20px;
    letter-spacing: -0.02em;
}
.brand .slash { color: var(--accent); }
.brand .name  { font-weight: 600; }
.brand .tag {
    margin-left: 10px;
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.02em;
}
.topbar .logout {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
}

/* ---- Karten ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 22px;
}
.card > h2 {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
}

/* ---- Statistik-Chips ---- */
.stats {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.stat {
    flex: 1 1 140px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
}
.stat .num {
    font-family: var(--mono);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}
.stat .lbl {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- Formulare ---- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--muted);
}
input[type="text"],
input[type="url"],
input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
}
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder { color: #566072; }

.row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.row .grow { flex: 1 1 340px; }
.row .code-field { flex: 0 1 220px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--text);
    font-weight: 500;
}
.btn.ghost:hover { border-color: var(--muted); filter: none; }
.btn.danger {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    padding: 6px 8px;
    font-size: 13px;
}
.btn.danger:hover { color: var(--danger); }

/* ---- Meldungen ---- */
.flash {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 22px;
    font-size: 14px;
    border: 1px solid var(--line);
}
.flash.ok  { border-color: #24583f; background: #10241a; color: var(--ok); }
.flash.err { border-color: #5a2b30; background: #241315; color: var(--danger); }
.flash code { font-family: var(--mono); color: var(--text); }

/* ---- Tabelle ---- */
.links { width: 100%; border-collapse: collapse; }
.links th {
    text-align: left;
    padding: 0 12px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
.links td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.links tr:last-child td { border-bottom: none; }

.code-chip {
    display: inline-flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 14px;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 4px 9px;
    border-radius: 6px;
}
.code-chip .sl { opacity: 0.55; margin-right: 1px; }

.target {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.target:hover { color: var(--text); }

.clicks {
    font-family: var(--mono);
    font-size: 15px;
    text-align: right;
}
.meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.actions { text-align: right; white-space: nowrap; }

.copy {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 12px;
    font-family: var(--mono);
    cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy.done { border-color: var(--ok); color: var(--ok); }

.empty {
    text-align: center;
    color: var(--muted);
    padding: 34px 10px;
    font-size: 14px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 16px;
    line-height: 1.6;
}
.hint code {
    font-family: var(--mono);
    background: var(--surface-2);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--text);
    word-break: break-all;
}

/* ---- Login / Install ---- */
.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.panel {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 30px;
}
.panel.wide { max-width: 620px; }
.panel .brand { justify-content: center; margin-bottom: 4px; font-size: 22px; }
.panel .sub {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 24px;
}
.panel .btn { width: 100%; justify-content: center; margin-top: 6px; }

.step {
    border-left: 2px solid var(--line);
    padding: 2px 0 2px 16px;
    margin: 0 0 18px;
}
.step h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-family: var(--mono);
    color: var(--accent);
}
.step p { margin: 0; font-size: 13px; color: var(--muted); }

.hashbox {
    font-family: var(--mono);
    font-size: 13px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px;
    word-break: break-all;
    color: var(--text);
    margin: 10px 0;
}

@media (max-width: 620px) {
    .target { max-width: 150px; }
    .links .hide-sm { display: none; }
    .stat .num { font-size: 24px; }
}
