/* ==========================================================================
   Projektverwaltung – Stylesheet
   Handgeschrieben, ohne Build-Step. System-Schriften (kein externes CDN).
   Eigene Schriften kannst du als woff2 in assets/ legen und hier per
   @font-face einbinden.
   ========================================================================== */

:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1d2230;
    --muted: #6b7280;
    --line: #e2e5ea;
    --primary: #2b5cff;
    --primary-dark: #1f47d6;
    --danger: #d23b3b;
    --ok-bg: #e6f7ed;
    --ok-text: #1a7a45;
    --err-bg: #fdecec;
    --err-text: #b02525;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(20, 30, 60, .08), 0 4px 16px rgba(20, 30, 60, .05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* -------------------------------------------------------------- Topbar */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.topnav { display: flex; align-items: center; gap: 16px; }
.topnav a { text-decoration: none; }
.topnav .logout { color: var(--muted); }

/* -------------------------------------------------------------- Seitenkopf */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 28px 0 18px; }
.page-head h1 { font-size: 1.6rem; margin: 4px 0 0; }
.back { display: inline-block; font-size: .9rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--primary); }

/* -------------------------------------------------------------- Buttons */
.btn {
    display: inline-block; cursor: pointer;
    background: var(--primary); color: #fff; border: 1px solid var(--primary);
    padding: 9px 16px; border-radius: var(--radius); font-size: .95rem;
    text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #f0f2f5; color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b02f2f; border-color: #b02f2f; }

.mini {
    cursor: pointer; background: none; border: 1px solid var(--line);
    border-radius: 6px; padding: 3px 8px; font-size: .8rem; color: var(--text);
    text-decoration: none; display: inline-block;
}
.mini:hover { background: #f0f2f5; }
.mini-danger { color: var(--danger); border-color: #f0c9c9; }
.mini-danger:hover { background: var(--err-bg); }

.inline { display: inline; margin: 0; }

/* -------------------------------------------------------------- Flash */
.flash { border-radius: var(--radius); padding: 10px 14px; margin: 14px 0; font-size: .95rem; }
.flash-ok    { background: var(--ok-bg);  color: var(--ok-text); }
.flash-fehler{ background: var(--err-bg); color: var(--err-text); }
.flash-info  { background: #eef2ff; color: #33408a; }

/* -------------------------------------------------------------- Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card-title { font-size: 1.15rem; margin: 0 0 6px; }
.card-title a { text-decoration: none; color: var(--text); }
.card-title a:hover { color: var(--primary); }
.card-url { margin: 0 0 10px; font-size: .85rem; word-break: break-all; }
.card-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: .8rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.badge { background: #eef2ff; color: #33408a; border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.leer { color: var(--muted); padding: 24px 0; }

/* -------------------------------------------------------------- Blöcke (Detail) */
.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin: 0 0 18px; }
.block h2 { font-size: 1.05rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.big-link { font-size: 1.05rem; word-break: break-all; }

.linkliste { list-style: none; margin: 0; padding: 0; }
.linkliste li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; }
.linkliste li:last-child { border-bottom: 0; }

/* -------------------------------------------------------------- Zugangsdaten */
.cred-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cred-row:last-child { border-bottom: 0; }
.cred-label { font-weight: 600; margin-bottom: 4px; }
.cred-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 3px 0; }
.cred-key { display: inline-block; min-width: 100px; color: var(--muted); font-size: .85rem; }
.cred-item code, .copytext { background: #f0f2f5; padding: 2px 8px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.secret { background: #f0f2f5; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-family: ui-monospace, monospace; min-width: 180px; }

/* -------------------------------------------------------------- Markdown */
.markdown h1, .markdown h2, .markdown h3 { margin: .8em 0 .4em; }
.markdown h1 { font-size: 1.4rem; } .markdown h2 { font-size: 1.2rem; border: 0; padding: 0; }
.markdown h3 { font-size: 1.05rem; }
.markdown p { margin: .5em 0; }
.markdown code { background: #f0f2f5; padding: 2px 6px; border-radius: 5px; font-family: ui-monospace, monospace; font-size: .9em; }
.markdown pre { background: #1d2230; color: #e8ebf2; padding: 14px 16px; border-radius: var(--radius); overflow: auto; }
.markdown pre code { background: none; color: inherit; padding: 0; }
.markdown blockquote { border-left: 3px solid var(--line); margin: .6em 0; padding: .2em 14px; color: var(--muted); }
.markdown ul, .markdown ol { margin: .5em 0; padding-left: 1.4em; }

/* -------------------------------------------------------------- Dateien */
.upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
table.files { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.files th, table.files td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
table.files th { color: var(--muted); font-weight: 600; font-size: .82rem; }
table.files .num { text-align: right; white-space: nowrap; }
table.files td.num { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

/* -------------------------------------------------------------- Formular */
.formular { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.formular label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: .92rem; }
.formular input[type=text], .formular input[type=password], .formular textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
    font-size: .95rem; font-family: inherit; background: #fff;
}
.formular textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.formular fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 20px 0; padding: 12px 16px 16px; }
.formular legend { font-weight: 600; padding: 0 6px; }
.rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; }
.row .mini { flex: 0 0 auto; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }

input:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--primary); outline-offset: 1px;
}

/* -------------------------------------------------------------- Footer */
.footer { color: var(--muted); padding: 30px 0 40px; }

/* -------------------------------------------------------------- Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 360px; }
.login-box h1 { margin: 0 0 18px; font-size: 1.4rem; text-align: center; }
.login-box label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .9rem; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.login-box .btn { margin-top: 22px; }
.login-box .check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 14px; }
.login-box .check input { width: auto; }

/* -------------------------------------------------------------- Mobil */
@media (max-width: 560px) {
    .row, .row-cred { flex-direction: column; align-items: stretch; }
    .page-head { flex-direction: column; }
}
