/* ===========================================================================
   barox Tech Hub – Stylesheet (barox CI: Navy #0d2a4a / Orange #f39200)
   Schrift: Helvetica Now
   =========================================================================== */

@font-face {
    font-family: "Helvetica Now Text";
    src: url("../fonts/HelveticaNowText-Regular.otf") format("opentype");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Text";
    src: url("../fonts/HelveticaNowText-Medium.otf") format("opentype");
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Text";
    src: url("../fonts/HelveticaNowText-Bold.otf") format("opentype");
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Display";
    src: url("../fonts/HelveticaNowDisplay-Bd.otf") format("opentype");
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Display";
    src: url("../fonts/HelveticaNowDisplay-Md.otf") format("opentype");
    font-weight: 500; font-style: normal; font-display: swap;
}

:root {
    --navy:      #0d2a4a;
    --navy-700:  #103459;
    --navy-600:  #1b4474;
    --orange:    #f39200;
    --orange-600:#d97f00;
    --bg:        #f4f6f9;
    --card:      #ffffff;
    --ink:       #15233a;
    --muted:     #67748a;
    --line:      #e2e7ef;
    --danger:    #c0392b;
    --ok:        #1e8a5a;
    --radius:    12px;
    --shadow:    0 1px 3px rgba(13,42,74,.08), 0 6px 20px rgba(13,42,74,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: "Helvetica Now Text", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Helvetica Now Display", "Helvetica Now Text", sans-serif; color: var(--navy); margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: "SFMono-Regular", Consolas, monospace; background: #eef2f7; padding: .08em .4em; border-radius: 5px; font-size: .9em; }
.muted { color: var(--muted); }

/* ---------- Topbar / Navigation ---------- */
.topbar {
    display: flex; align-items: center; gap: 1.5rem;
    background: var(--navy);
    padding: 0 1.5rem; height: 60px;
    position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: .6rem; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-sub { color: #fff; font-weight: 500; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.mainnav { display: flex; gap: .3rem; margin-left: 1rem; flex: 1; }
.nav-link {
    color: #cdd8e6; padding: .5rem .8rem; border-radius: 8px;
    font-size: .92rem; font-weight: 500; white-space: nowrap;
}
.nav-link:hover { color: #fff; background: var(--navy-700); text-decoration: none; }
.nav-link.active { color: #fff; background: var(--navy-600); }
.userbox { display: flex; align-items: center; gap: .8rem; }
.user-name { color: #e7eef6; font-size: .88rem; }
.badge { background: var(--orange); color: #fff; font-size: .68rem; padding: .1rem .4rem; border-radius: 5px; font-weight: 700; vertical-align: middle; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.langswitch { display: inline-flex; gap: .25rem; align-items: center; font-size: .78rem; color: #8fa3bd; }
.langswitch a { color: #8fa3bd; padding: .1rem .25rem; border-radius: 4px; font-weight: 500; }
.langswitch a:hover { color: #fff; text-decoration: none; }
.langswitch a.active { color: #fff; background: var(--orange); }
.langswitch-login { position: absolute; top: 1rem; right: 1.2rem; color: var(--muted); }
.langswitch-login a { color: var(--muted); }
.langswitch-login a:hover { color: var(--navy); }
.langswitch-login a.active { color: #fff; background: var(--orange); }

/* ---------- Layout ---------- */
.content { max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.5rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.head-actions { display: flex; gap: .5rem; align-items: center; }
.back { display: inline-block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.footer { max-width: 1180px; margin: 0 auto; padding: 1.5rem; display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-ghost, .btn-mini {
    display: inline-flex; align-items: center; gap: .4rem;
    border-radius: 8px; cursor: pointer; font-family: inherit; font-weight: 500;
    border: 1px solid transparent; text-decoration: none;
}
.btn-primary { background: var(--orange); color: #fff; padding: .55rem 1rem; font-size: .92rem; }
.btn-primary:hover { background: var(--orange-600); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); padding: .5rem .9rem; font-size: .9rem; }
.btn-ghost:hover { border-color: var(--navy-600); text-decoration: none; }
.btn-mini { background: #f0f3f8; color: var(--navy); padding: .3rem .6rem; font-size: .8rem; border: 1px solid var(--line); }
.btn-mini:hover { background: #e6ecf4; text-decoration: none; }
.btn-danger { background: #fdecea; color: var(--danger); border-color: #f6d6d2; }
.btn-danger:hover { background: #fbdbd7; }

/* ---------- Flash ---------- */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid; }
.flash-success { background: #e9f7f0; color: var(--ok); border-color: #c4ebd8; }
.flash-error   { background: #fdecea; color: var(--danger); border-color: #f6d6d2; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--card); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; border-left: 4px solid var(--orange); }
.stat:hover { text-decoration: none; transform: translateY(-2px); transition: transform .12s; }
.stat-num { font-family: "Helvetica Now Display"; font-size: 1.9rem; font-weight: 700; color: var(--navy); }
.stat-lbl { color: var(--muted); font-size: .85rem; }

/* ---------- Search ---------- */
.searchbar { margin-bottom: 1.3rem; }
.searchbar input { width: 100%; max-width: 420px; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 9px; font-family: inherit; font-size: .95rem; background: #fff; }
.searchbar input:focus { outline: none; border-color: var(--orange); }

/* ---------- Sections / Cards ---------- */
.link-section { margin-bottom: 2rem; }
.section-title { font-size: 1.05rem; border-bottom: 2px solid var(--line); padding-bottom: .4rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.host-group { margin-bottom: 1.5rem; }
.host-group-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; margin: 0 0 .5rem; }
.host-row-nested td:first-child { padding-left: 1.8rem; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.link-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem; border: 1px solid transparent; transition: border-color .12s, transform .12s; }
.link-card:hover { border-color: var(--orange); transform: translateY(-2px); text-decoration: none; }
.link-card-main { display: flex; flex-direction: column; gap: .2rem; }
.link-title { font-weight: 700; color: var(--navy); }
.link-desc { color: var(--muted); font-size: .87rem; }
.link-url { color: var(--navy-600); font-size: .78rem; word-break: break-all; }
.card-actions { display: flex; gap: .4rem; margin-top: .7rem; flex-wrap: wrap; }
.card-actions form { margin: 0; }
.row-actions { display: flex; gap: .4rem; align-items: center; white-space: nowrap; }
.row-actions form { margin: 0; }
.card-note { font-size: .85rem; color: var(--muted); margin: .6rem 0 0; }

/* ---------- Network / Server cards ---------- */
.net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.net-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; border: 1px solid transparent; }
.net-card:hover { border-color: var(--line); }
.net-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.net-card-head h3 { margin: 0; font-size: 1.1rem; }
.tag { background: #eaf0f7; color: var(--navy-600); font-size: .72rem; padding: .15rem .5rem; border-radius: 6px; font-weight: 500; white-space: nowrap; }

/* ---------- Key/Value ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv-lg { font-size: .98rem; gap: .5rem 1.2rem; background: var(--card); padding: 1.2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 2rem; }
.detail-text { background: var(--card); padding: 1.2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.note-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---------- Secret ---------- */
.secret { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.secret-val { min-width: 90px; }
.copy { cursor: pointer; }
.copy:hover { background: #dde6f1; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1rem; }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.table th { background: #f3f6fa; color: var(--navy); font-weight: 500; }
.table tr:last-child td { border-bottom: 0; }
.table-scan .col-check { width: 2.4rem; text-align: center; }
.table-scan .col-status { width: 9rem; }
.table-scan input[type=text], .table-scan select {
    width: 100%; box-sizing: border-box; font-family: inherit; font-size: .9rem; color: var(--ink);
    padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.table-scan input[type=text]:focus, .table-scan select:focus { outline: none; border-color: var(--orange); }
.host-row-known td { color: var(--muted); }
.host-row-known .tag { opacity: .8; }

/* ---------- Forms ---------- */
.form { background: var(--card); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 760px; display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); font-weight: 500; }
.form input, .form select, .form textarea {
    font-family: inherit; font-size: .95rem; color: var(--ink);
    padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--orange); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.w-sort { max-width: 120px; }
.form-actions { display: flex; gap: .6rem; margin-top: .5rem; }
.form-hint { margin: -.4rem 0 0; font-size: .8rem; color: var(--muted); }
.translate-row { margin: -.2rem 0 .2rem; }
.btn-translate { font-size: .85rem; }
.btn-translate[disabled] { opacity: .6; cursor: progress; }
.row-form { display: flex; gap: .5rem; flex-wrap: wrap; background: var(--card); padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.row-form input, .row-form select {
    flex: 1; min-width: 120px; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px;
    font-family: inherit; font-size: .9rem; color: var(--ink); background: #fff;
}
.row-form input:focus, .row-form select:focus { outline: none; border-color: var(--orange); }
.inline-box { display: flex; gap: .5rem; margin-bottom: 1.2rem; background: var(--card); padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); flex-wrap: wrap; align-items: center; }
.inline-box input, .inline-box select { padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; }
.inline-del { display: inline; margin: 0; }
.link-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.link-del:hover { color: var(--danger); }

/* ---------- Notes ---------- */
.note-list { list-style: none; padding: 0; margin: 0; }
.note-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); }

/* Layout: Baum-Sidebar + Liste */
.notes-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.4rem; align-items: start; }

.cat-sidebar { position: sticky; top: 1rem; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; }
.cat-tree { font-size: .9rem; }
.cat-tree-list { list-style: none; margin: 0; padding: 0; }
.cat-tree .cat-children { padding-left: 1rem; border-left: 1px solid var(--line); margin-left: .5rem; }
.cat-row { display: flex; align-items: center; gap: .15rem; }
.cat-toggle { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .75rem; width: 1.1rem; line-height: 1; transition: transform .12s; padding: .2rem; }
.cat-toggle.open { transform: rotate(90deg); }
.cat-toggle-spacer { display: inline-block; width: 1.1rem; }
.cat-link { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex: 1; padding: .35rem .5rem; border-radius: 7px; color: var(--ink); }
.cat-link:hover { background: #f0f3f8; text-decoration: none; }
.cat-link.is-active { background: var(--navy); color: #fff; font-weight: 600; }
.cat-link.is-active .cat-count { background: rgba(255,255,255,.25); color: #fff; }
.cat-all, .cat-uncat { padding: .4rem .5rem; }
.cat-count { background: #eaf0f7; color: var(--navy-600); font-size: .7rem; padding: .05rem .4rem; border-radius: 20px; font-weight: 600; }

.notes-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.type-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.type-chip { background: #fff; border: 1px solid var(--line); color: var(--navy); padding: .38rem .8rem; border-radius: 20px; font-size: .82rem; cursor: pointer; font-family: inherit; }
.type-chip:hover { border-color: var(--navy-600); }
.type-chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.notes-search { min-width: 220px; flex: 1; max-width: 320px; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 9px; font-family: inherit; font-size: .92rem; background: #fff; }
.notes-search:focus { outline: none; border-color: var(--orange); }

/* Kachel-Grid statt vollständig ausgeklappter Liste */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.note-tile {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem; cursor: pointer; display: flex; flex-direction: column;
    gap: .5rem; transition: transform .12s, box-shadow .12s;
}
.note-tile:hover, .note-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(10,30,60,.12); outline: none; }
.note-tile-head { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.note-titles { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.note-titles h3 { margin: 0; font-size: 1.02rem; }
.note-cat { color: var(--muted); font-size: .78rem; background: #f0f3f8; padding: .12rem .5rem; border-radius: 6px; }
.note-excerpt { color: var(--muted); font-size: .86rem; line-height: 1.5; margin: 0; flex: 1; }
.note-tile .card-actions { margin-top: 0; }

/* Detail-Modal einer Kachel */
.note-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; }
.note-modal[hidden] { display: none; }
.note-modal-backdrop { position: absolute; inset: 0; background: rgba(8,20,40,.55); }
.note-modal-box {
    position: relative; background: var(--card); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.35);
    max-width: 760px; width: calc(100% - 2rem); margin: 4vh 1rem; max-height: 92vh; overflow-y: auto; padding: 1.6rem 1.8rem;
}
.note-modal-close { position: absolute; top: .7rem; right: .9rem; background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; }
.note-modal-close:hover { color: var(--danger); }
.note-modal-head { padding-right: 2rem; margin-bottom: 1rem; }
.note-modal-head .note-tile-head { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
body.modal-open { overflow: hidden; }

/* Typ-Badges & farbige Chips */
.type-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .15rem .5rem; border-radius: 6px; white-space: nowrap; }
.type-badge.type-wiki,   .type-chip.type-wiki.is-active   { background: var(--navy);   color: #fff; }
.type-badge.type-compat, .type-chip.type-compat.is-active { background: var(--orange); color: #fff; }
.type-badge.type-doc,    .type-chip.type-doc.is-active    { background: var(--ok);     color: #fff; }
.type-badge.type-wiki   { background: #e7edf5; color: var(--navy-600); }
.type-badge.type-compat { background: #fdeccc; color: var(--orange-600); }
.type-badge.type-doc    { background: #e3f3ec; color: var(--ok); }

/* ---------- Markdown-Ausgabe ---------- */
.markdown { font-size: .95rem; line-height: 1.6; color: var(--ink); }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { margin: 1.1em 0 .5em; line-height: 1.25; }
.markdown h1 { font-size: 1.5rem; } .markdown h2 { font-size: 1.28rem; border-bottom: 1px solid var(--line); padding-bottom: .25em; }
.markdown h3 { font-size: 1.12rem; } .markdown h4 { font-size: 1rem; }
.markdown p { margin: .6em 0; }
.markdown ul, .markdown ol { margin: .6em 0; padding-left: 1.5rem; }
.markdown li { margin: .2em 0; }
.markdown a { color: var(--navy-600); text-decoration: underline; }
.markdown code { background: #eef1f6; border: 1px solid var(--line); border-radius: 5px; padding: .08em .35em; font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace; font-size: .88em; }
.markdown pre { background: var(--navy); color: #eaf0f7; border-radius: 9px; padding: .9rem 1rem; overflow-x: auto; margin: .8em 0; }
.markdown pre code { background: none; border: 0; padding: 0; color: inherit; font-size: .85rem; }
.markdown blockquote { margin: .8em 0; padding: .4em 1rem; border-left: 3px solid var(--orange); background: #fbf6ee; color: var(--ink); border-radius: 0 8px 8px 0; }
.markdown blockquote p { margin: .3em 0; }
.markdown table { border-collapse: collapse; margin: .8em 0; width: 100%; font-size: .9rem; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: .45rem .7rem; text-align: left; }
.markdown thead th { background: #f0f3f8; color: var(--navy); }
.markdown tbody tr:nth-child(even) { background: #f8fafc; }
.markdown img { max-width: 100%; height: auto; border-radius: 8px; }
.markdown hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.markdown del { color: var(--muted); }
/* Inhaltsverzeichnis (Editor-Funktion „☰") */
.markdown ul.note-toc { list-style: none; margin: .8em 0 1.2em; padding: .7rem 1.1rem; background: #f4f7fa; border: 1px solid var(--line); border-radius: 8px; font-size: .92em; }
.markdown ul.note-toc ul { list-style: none; margin: .15em 0; padding-left: 1.1rem; }
.markdown ul.note-toc li { margin: .18em 0; }
.markdown ul.note-toc a { color: var(--navy-600); text-decoration: none; }
.markdown ul.note-toc a:hover { text-decoration: underline; }
textarea.mono { font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace; font-size: .88rem; line-height: 1.5; }

/* ---------- WYSIWYG-Editor ---------- */
/* Editor-Formular breiter als Standardformulare (zwei Rich-Editoren nebeneinander). */
.rt-form { max-width: 1080px; }
.rt-row { align-items: start; }
/* min-width:0 erlaubt den 1fr-Grid-Spalten zu schrumpfen (sonst sprengen breite
   Inhalte – z. B. Bilder mit langem Alt-Text – die Spalte aus der Box). */
.rt-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.rt-label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.rt-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; padding: .4rem; background: #f0f3f8; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; }
.rt-btn { min-width: 30px; height: 30px; padding: 0 .45rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; color: var(--navy); font-size: .82rem; font-weight: 600; cursor: pointer; line-height: 1; }
.rt-btn:hover { border-color: var(--orange); background: #fff7ec; }
.rt-btn:active { background: var(--orange); color: #fff; }
.rt-editor { min-height: 240px; max-height: 560px; overflow-y: auto; padding: .8rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 0 0 9px 9px; font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
.rt-editor:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 2px rgba(243,146,0,.15); }
.rt-editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rt-editor img { max-width: 100%; height: auto; border-radius: 8px; }
/* Breite Inhalte innerhalb der Spalte halten. */
.rt-editor pre { white-space: pre-wrap; word-break: break-word; }
.rt-editor table { display: block; width: 100%; overflow-x: auto; }

/* ---------- Anhänge ---------- */
.att-section { margin-top: 2rem; }
.att-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.att-item { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; }
.att-dl { color: var(--navy-600); font-weight: 500; word-break: break-word; }
.att-size { color: var(--muted); font-weight: 400; font-size: .82rem; }
.att-upload { margin-top: .5rem; align-items: center; }
.note-attachments { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.att-heading { margin: 0 0 .6rem; font-size: .95rem; color: var(--navy); }

/* ---------- PDF-Export-Warnung ---------- */
.pdf-warn { display: flex; gap: 1.1rem; background: #fff8ef; border: 1px solid #f6d9a8; border-left: 4px solid var(--orange); border-radius: var(--radius); padding: 1.4rem 1.6rem; max-width: 720px; box-shadow: var(--shadow); }
.pdf-warn-icon { font-size: 1.8rem; line-height: 1; color: var(--orange); }
.pdf-warn-lead { margin: 0 0 .6rem; font-weight: 600; color: var(--ink); }
.pdf-warn-words { margin: 0 0 1rem; padding-left: 1.2rem; }
.pdf-warn-words li { font-family: ui-monospace, "Consolas", monospace; color: var(--danger); font-weight: 600; }
.btn-warn { display: inline-block; border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid transparent; background: var(--danger); color: #fff; padding: .55rem 1rem; font-size: .92rem; }
.btn-warn:hover { background: #a5301f; text-decoration: none; }

.empty { color: var(--muted); padding: 2rem 0; }

/* ---------- Login ---------- */
.login-body { background: linear-gradient(135deg, var(--navy) 0%, #081a30 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { position: relative; background: #fff; border-radius: 18px; padding: 2.6rem 2.4rem; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { height: 46px; margin-bottom: 1.4rem; }
.login-card h1 { margin: 0; letter-spacing: .04em; }
.login-sub { color: var(--muted); margin: .3rem 0 1.8rem; font-size: .92rem; }
.btn-ms { width: 100%; justify-content: center; padding: .75rem 1rem; font-size: 1rem; }
.ms-logo { width: 16px; height: 16px; background:
    linear-gradient(to right, #f25022 50%, #7fba00 50%) top / 100% 50% no-repeat,
    linear-gradient(to right, #00a4ef 50%, #ffb900 50%) bottom / 100% 50% no-repeat;
    background-color: #fff; display: inline-block; border-radius: 2px; }
.login-foot { color: var(--muted); font-size: .78rem; margin: 1.8rem 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .detail-grid, .form-row { grid-template-columns: 1fr; }
    .notes-layout { grid-template-columns: 1fr; }
    .cat-sidebar { position: static; }
    .burger { display: block; }
    .mainnav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: var(--navy); padding: .6rem; margin: 0; gap: .2rem; }
    .mainnav.open { display: flex; }
    .userbox .user-name { display: none; }
}

/* --- PDF-Export: Lade-Overlay --- */
.pdf-loading {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(8, 20, 40, .45);
    animation: pdf-fade .15s ease-out;
}
.pdf-loading-box {
    display: flex; align-items: center; gap: .8rem;
    background: #fff; color: var(--navy);
    padding: 1rem 1.4rem; border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(8, 20, 40, .35);
    font-size: .95rem; font-weight: 500;
}
.pdf-spinner {
    width: 22px; height: 22px; flex: 0 0 auto;
    border: 3px solid #e3e9f1;
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: pdf-spin .7s linear infinite;
}
@keyframes pdf-spin { to { transform: rotate(360deg); } }
@keyframes pdf-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .pdf-spinner { animation-duration: 1.6s; }
    .pdf-loading { animation: none; }
}
