/* Belegportal Mobilestar · Buchhaltung · ruhiges Warenwirtschafts-Layout */
:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --line: #e3e7ed;
  --line-2: #eef1f5;
  --text: #1b2432;
  --text-2: #3d4757;
  --muted: #6b7585;
  --side: #17212e;
  --side-2: #1e2b3b;
  --side-txt: #a9b5c4;
  --brand: #e2343c;
  --brand-600: #c7262e;
  --brand-50: #fdeeee;
  --blue: #2f6bd8;
  --blue-50: #eaf1fd;
  --green: #127a57;
  --green-50: #e6f5ee;
  --amber: #a46200;
  --amber-50: #fff3df;
  --violet: #6845c9;
  --violet-50: #f0ebfd;
  --teal: #0f7c86;
  --teal-50: #e3f4f5;
  --radius: 10px;
  --radius-s: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-l: 0 12px 32px rgba(16, 24, 40, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.klein { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.vh, .unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
[hidden] { display: none !important; }
.spacer { flex: 1; }
.umbruch { word-break: break-all; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ic.mini { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.ic.gross { width: 30px; height: 30px; color: var(--brand); }

/* ------------------------------------------------ Buttons + Formulare */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-s); border: 1px solid transparent; font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(47, 107, 216, .35); outline-offset: 1px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(226, 52, 60, .35); }
.btn-primary:hover { background: var(--brand-600); }
.btn-dunkel { background: var(--side); color: #fff; }
.btn-dunkel:hover { background: var(--side-2); }
.btn-ghost { background: #fff; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9d0da; background: #fafbfc; }
.btn-link { background: none; color: var(--blue); padding: 0 8px; }
.btn-gefahr { background: #b42318; color: #fff; }
.btn-gefahr:hover { background: #912018; }
.btn-gefahr-leise { background: #fff; color: #b42318; border-color: #f3c7c3; }
.btn-gefahr-leise:hover { background: #fef3f2; }
.btn-sm { height: 31px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: wait; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-s); border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(127, 140, 160, .14); }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; padding: 6px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-eng { gap: 11px; }
.feld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.feld > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.feld small { font-size: 12px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=email], input:not([type]), select {
  width: 100%; height: 40px; padding: 0 11px; border: 1px solid #d3d9e1; border-radius: var(--radius-s); background: #fff; color: var(--text); font: 14px var(--font);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 107, 216, .15); outline: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7585' stroke-width='2.4' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.code-input { font: 600 26px/1 var(--mono) !important; letter-spacing: .32em; text-align: center; height: 56px !important; }
.code-input.klein { font-size: 20px !important; height: 44px !important; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.segment { display: inline-flex; border: 1px solid #d3d9e1; border-radius: var(--radius-s); overflow: hidden; height: 40px; background: #fff; }
.segment label { flex: 1; display: flex; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span { flex: 1; display: grid; place-items: center; padding: 0 16px; cursor: pointer; font-weight: 600; color: var(--muted); }
.segment label + label span { border-left: 1px solid #d3d9e1; }
.segment input:checked + span { background: var(--side); color: #fff; }
.segment input:focus-visible + span { box-shadow: inset 0 0 0 3px rgba(47, 107, 216, .45); }
.raster-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.feld-breit { grid-column: 1 / -1; }
.form-fuss { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.regeln { margin: -4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------ Meldungen */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-s); margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.flash-ok { background: var(--green-50); color: #0b5e42; border-color: #bfe5d3; }
.flash-fehler { background: #fef3f2; color: #a01b12; border-color: #f7cdc9; }
.flash-info { background: var(--blue-50); color: #1d4e9e; border-color: #c9dbf8; }
.hinweis { display: flex; gap: 8px; align-items: flex-start; background: var(--amber-50); color: #7a4a00; padding: 10px 12px; border-radius: var(--radius-s); margin: 12px 0 0; font-size: 13.5px; }
.hinweis-ok { background: var(--green-50); color: #0b5e42; }

/* ------------------------------------------------ Anmeldung */
.login-body { min-height: 100vh; background: var(--bg); }
.login-wrap { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100vh; }
.login-brand {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px; color: #dfe6ef; overflow: hidden;
  background: radial-gradient(1200px 600px at -10% 110%, rgba(226, 52, 60, .28), transparent 60%), radial-gradient(900px 500px at 120% -10%, rgba(47, 107, 216, .22), transparent 55%), linear-gradient(160deg, #1b2737 0%, #121a25 100%);
}
.login-brand::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.login-brand > * { position: relative; z-index: 1; }
.brand-logo { width: 200px; height: auto; }
.brand-text h1 { color: #fff; font-size: 40px; font-weight: 750; letter-spacing: -.02em; margin-bottom: 16px; }
.brand-text h1 span { display: block; color: #ff8a8f; font-weight: 600; font-size: 26px; letter-spacing: 0; margin-top: 4px; }
.brand-text p { max-width: 440px; font-size: 15.5px; color: #b8c4d3; margin-bottom: 28px; }
.brand-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; max-width: 440px; }
.brand-list li { display: flex; gap: 14px; align-items: flex-start; }
.brand-list .ic { width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: 10px; background: rgba(255, 255, 255, .07); color: #fff; }
.brand-list span { display: flex; flex-direction: column; font-size: 13.5px; color: #9fadbf; }
.brand-list b { color: #fff; font-size: 14.5px; font-weight: 600; }
.brand-foot { font-size: 12.5px; color: #7d8ba0; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 410px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(16, 24, 40, .08); padding: 34px 32px 28px; }
.card-logo { display: block; width: 150px; height: auto; margin: 0 0 26px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login-card > .muted { margin-bottom: 20px; }
.login-help { margin-top: 18px; color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.hilfe { margin-top: 16px; font-size: 13px; color: var(--muted); }
.hilfe summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.hilfe p { margin: 8px 0 0; }
.abbrechen-form { text-align: center; margin-top: 8px; }
.schritt-info { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.schritt-punkt { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--line-2); color: var(--muted); }
.schritt-punkt.aktiv { background: var(--brand); color: #fff; }
.schritt-punkt.fertig { background: var(--green); color: #fff; }
.schritt-punkt .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.schritt-linie { flex: 0 0 40px; height: 2px; background: var(--line); }
.anleitung { padding-left: 20px; margin: 0 0 16px; color: var(--text-2); font-size: 13.5px; display: grid; gap: 6px; }
.qr-box { display: grid; place-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 4px; }
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; }
.recovery { columns: 2; padding-left: 22px; margin: 6px 0 14px; font-size: 15px; }
.recovery li { margin-bottom: 6px; }
.recovery code { background: var(--line-2); padding: 3px 8px; border-radius: 5px; letter-spacing: .05em; }
.erfolg-kopf { width: 54px; height: 54px; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; margin-bottom: 14px; }
.erfolg-kopf .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.fehler-box { max-width: 460px; margin: 12vh auto 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 34px; text-align: center; box-shadow: var(--shadow); }
.fehler-logo { width: 150px; margin-bottom: 20px; }
.fehler-box h1 { font-size: 21px; margin-bottom: 10px; }
.fehler-box p { color: var(--muted); margin-bottom: 20px; }

/* ------------------------------------------------ App-Rahmen */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--side); color: var(--side-txt); display: flex; flex-direction: column; z-index: 40; }
.side-logo { display: flex; flex-direction: column; gap: 6px; padding: 22px 20px 20px; border-bottom: 1px solid rgba(255, 255, 255, .06); text-decoration: none !important; }
.side-logo img { width: 140px; height: auto; }
.side-logo span { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #ff8a8f; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--side-txt); font-weight: 500; text-decoration: none; }
.side-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-nav a.aktiv { background: rgba(255, 255, 255, .09); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.side-sicher { display: flex; gap: 8px; align-items: center; margin: 0 14px 12px; padding: 9px 11px; border-radius: 8px; background: rgba(18, 122, 87, .16); color: #7fd6b2; font-size: 12px; font-weight: 600; }
.side-sicher .ic { width: 16px; height: 16px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 12px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .06); }
.side-user-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-user-txt b { color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-txt small { font-size: 11.5px; }
.side-user .icon-btn { color: var(--side-txt); }
.side-user .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, #e2343c, #a51f26); color: #fff; font-weight: 700; font-size: 13px; }
.avatar.klein { width: 26px; height: 26px; font-size: 11px; vertical-align: middle; }
.side-schatten { display: none; }
.haupt { flex: 1; margin-left: 236px; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 26px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.krumen { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.krumen a { color: var(--muted); }
.krumen span:last-child { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.krumen-sep { width: 14px; height: 14px; color: #b3bcc8; }
.top-aktionen { display: flex; gap: 8px; }
.inhalt { flex: 1; padding: 24px 26px 40px; max-width: 1500px; width: 100%; }
.app-fuss { padding: 14px 26px 22px; color: #98a2b1; font-size: 12px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px 16px; border-bottom: 1px solid var(--line-2); }
.card-kopf h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
section.card > .muted, section.card > .form, section.card > .kv, section.card > .verlauf, section.card > h4, section.card > .hinweis, section.card > .admin-leiste { margin-left: 16px; margin-right: 16px; }
section.card > .form { margin-top: 14px; margin-bottom: 16px; }
section.card > p.muted { margin-top: 12px; }

/* ------------------------------------------------ Ablage */
.ablage { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.ablage > *, .beleg-raster > * { min-width: 0; }
.ablage-baum { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.baum { padding: 8px; font-size: 13.5px; }
.baum ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.baum > ul { padding-left: 0; }
.baum li.hat-kinder:not(.offen) > ul { display: none; }
.baum a { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 6px; color: var(--text-2); text-decoration: none; }
.baum a:hover { background: var(--line-2); }
.baum a.aktiv { background: var(--blue-50); color: #1d4e9e; font-weight: 600; }
.baum a .ic { color: #8a96a8; width: 16px; height: 16px; }
.baum a.aktiv .ic { color: var(--blue); }
.baum-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baum-zahl { font-size: 11.5px; color: var(--muted); background: var(--line-2); border-radius: 10px; padding: 0 7px; }
.baum-intern .ic { width: 13px; height: 13px; color: var(--amber) !important; }
.baum-wurzel { margin-bottom: 2px; font-weight: 600; }
.liste-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.liste-kopf h1 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.liste-kopf h1 > .ic { width: 22px; height: 22px; color: var(--brand); }
.liste-kopf p { margin: 4px 0 0; }
.liste-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin-bottom: 14px; align-items: center; }
.filter select { width: auto; min-width: 150px; height: 36px; font-size: 13.5px; }
.filter .btn { height: 36px; }
.suche { flex: 1 1 260px; position: relative; display: flex; }
.suche .ic { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.suche input { padding-left: 36px; height: 36px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 26px; }
.kachel { position: relative; display: flex; align-items: center; gap: 13px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kachel:hover { border-color: #c4ccd8; box-shadow: 0 6px 16px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.kachel-icon { width: 40px !important; height: 40px !important; padding: 9px; border-radius: 10px; background: var(--blue-50); color: var(--blue); box-sizing: border-box; }
.kachel-txt { display: flex; flex-direction: column; min-width: 0; }
.kachel-txt b { font-size: 14.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.kachel-txt small { color: var(--muted); }
.kachel-intern { position: absolute; top: 10px; right: 10px; color: var(--amber); }
.kachel-intern .ic { width: 14px; height: 14px; }
.kachel-neu { border-style: dashed; box-shadow: none; background: transparent; }
.kachel-neu .kachel-icon { background: var(--brand-50); color: var(--brand); }
.abschnitt { font-size: 14px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.abschnitt-klein { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 16px 6px; }
.unterordner { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.uo { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--text-2); font-weight: 500; }
.uo .ic { color: var(--blue); }
.uo small { color: var(--muted); background: var(--line-2); border-radius: 10px; padding: 0 7px; }
.uo:hover { border-color: #c4ccd8; text-decoration: none; }

.tabelle-wrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.grid th { position: sticky; top: 0; background: #f8f9fb; text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid th:first-child { border-top-left-radius: var(--radius); }
.grid th:last-child { border-top-right-radius: var(--radius); }
.grid th.r { text-align: right; }
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.grid td.mono, .kv dd.mono { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: inherit; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr[data-href] { cursor: pointer; }
.grid tbody tr:hover td { background: #f7f9fc; }
.grid tr.storniert td { opacity: .55; }
.grid tr.storniert .titel-zelle a { text-decoration: line-through; }
.grid tr.warn td { background: #fffaf0; }
.titel-zelle a { color: var(--text); font-weight: 600; }
.titel-zelle .zeile2 { display: block; font-size: 12px; margin-top: 2px; }
.leer { text-align: center; padding: 44px 20px; }
.leer-icon { width: 46px !important; height: 46px !important; color: #b7c0cc; margin-bottom: 8px; }
.leer p { margin-bottom: 6px; }
.leer .btn { margin-top: 10px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--text-2); white-space: nowrap; line-height: 1.6; }
.chip .ic { width: 12px; height: 12px; }
.st-neu { background: var(--blue-50); color: #1d4e9e; }
.st-zugeordnet { background: var(--green-50); color: #0b6646; }
.st-rueckfrage { background: var(--amber-50); color: #8a5200; }
.st-storniert { background: #f2f4f7; color: #8a94a3; }
.art.a1 { background: var(--blue-50); color: #1d4e9e; }
.art.a2 { background: var(--green-50); color: #0b6646; }
.art.a3 { background: var(--amber-50); color: #8a5200; }
.art.a4 { background: var(--teal-50); color: #0b6670; }
.art.a5 { background: var(--violet-50); color: #5235a8; }
.art.a6 { background: var(--brand-50); color: #b0232a; }
.art.a7 { background: #eef0f3; color: #475467; }
.chip-privat { background: #fdf0e6; color: #a2470b; }
.chip-frist { background: var(--brand-50); color: #b0232a; }
.chip-intern { background: var(--amber-50); color: #8a5200; font-size: 11.5px; vertical-align: middle; }
.ft-pdf { color: #d03b3b; }
.ft-img { color: #2f6bd8; }
.ft-xls { color: #1b8a52; }
.ft-doc { color: #3d5a9e; }
.pl { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pl .ic { width: 15px; height: 15px; }
.pl-archiviert { color: var(--green); }
.pl-fehler { color: #b42318; }
.pl-gesendet, .pl-offen { color: var(--amber); }
.pl-link:hover { text-decoration: none; opacity: .8; }

/* ------------------------------------------------ Belegdetail */
.beleg-kopf { margin-bottom: 16px; }
.beleg-kopf h1 { font-size: 22px; margin-bottom: 6px; letter-spacing: -.01em; }
.beleg-raster { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.beleg-verlauf { grid-column: 1 / -1; }
.vorschau { display: block; margin: 14px 16px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8f9fb; text-align: center; }
.vorschau img { max-width: 100%; max-height: 560px; display: block; margin: 0 auto; }
.vorschau-pdf { display: block; width: calc(100% - 32px); height: 620px; margin: 14px 16px 0; border: 1px solid var(--line); border-radius: 8px; background: #f8f9fb; }
.datei-liste { list-style: none; margin: 10px 0 0; padding: 0 8px 8px; }
.datei-liste li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line-2); }
.datei-liste li:last-child { border-bottom: 0; }
.datei-liste li > .ic { width: 26px; height: 26px; }
.dl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dl-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-txt small { font-size: 12px; }
.dl-btns { display: flex; gap: 2px; color: var(--text-2); }
.seite-dazu { padding: 0 16px 16px; }
.seite-dazu p { margin: 6px 0 0; text-align: center; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 14px 16px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.admin-leiste { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding: 12px 0 14px; margin-top: 14px; }
.inline-form select { height: 31px; font-size: 13px; width: auto; }
.verlauf { list-style: none; padding: 0; margin: 10px 16px 14px; font-size: 13px; }
.verlauf li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line-2); flex-wrap: wrap; }
.verlauf li:last-child { border-bottom: 0; }
.raster-konto { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.einladung-box { display: flex; gap: 16px; padding: 18px; margin-bottom: 18px; border-color: #f3c7c3; background: linear-gradient(180deg, #fff, #fff8f8); }
.einladung-box h3 { font-size: 16px; margin-bottom: 6px; }
.einladung-box > div { flex: 1; min-width: 0; }
.kopierzeile { display: flex; gap: 8px; }
.kopierzeile input { font-family: var(--mono); font-size: 12.5px; }
.rechte { display: grid; gap: 8px; padding: 12px; background: #f8f9fb; border-radius: 8px; border: 1px solid var(--line-2); }

/* ------------------------------------------------ Dialoge + Upload */
.dlg { border: 0; padding: 0; border-radius: 14px; box-shadow: var(--shadow-l); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); color: var(--text); }
.dlg-gross { width: min(760px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(15, 23, 34, .45); backdrop-filter: blur(2px); }
.dlg > form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); gap: 0; }
.dlg-kopf { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px 22px; border-bottom: 1px solid var(--line-2); }
.dlg-kopf h2 { font-size: 17px; display: flex; gap: 9px; align-items: center; }
.dlg-kopf h2 .ic { color: var(--brand); }
.dlg-inhalt { padding: 18px 22px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-fuss { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 22px 16px; border-top: 1px solid var(--line-2); background: #fafbfc; border-radius: 0 0 14px 14px; }
.dlg-extra { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--line-2); }
.dropzone { border: 2px dashed #cbd3de; border-radius: 12px; padding: 22px 16px; text-align: center; background: #fafbfd; transition: border-color .15s, background .15s; }
.dropzone.drueber { border-color: var(--brand); background: var(--brand-50); }
.dz-icon { width: 34px !important; height: 34px !important; color: var(--brand); margin-bottom: 6px; }
.dropzone p { margin: 0 0 12px; font-size: 15px; }
.dz-btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.f-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.f-liste:empty { display: none; }
.f-liste li { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.f-liste img, .f-liste .f-typ { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; background: var(--line-2); display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.f-liste .f-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.f-liste .f-groesse { color: var(--muted); font-size: 12px; white-space: nowrap; }
.f-liste .f-zu-gross { color: #b42318; }
.upload-status { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fafbfc; }
.balken { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.balken i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #ff6b72); transition: width .2s; }
.upload-status p { margin: 8px 0 4px; font-weight: 600; }
.upload-status ul { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 3px; }
.upload-status li.ok { color: var(--green); }
.upload-status li.nein { color: #b42318; }

/* ------------------------------------------------ schmalere Bildschirme */
@media (max-width: 1240px) { .nur-breit { display: none; } }
@media (max-width: 1080px) {
  .beleg-raster { grid-template-columns: 1fr; }
  .ablage { grid-template-columns: minmax(0, 1fr); }
  .beleg-raster { grid-template-columns: minmax(0, 1fr); }
  .ablage-baum { position: static; max-height: none; order: 2; }
  .ablage-baum .baum { max-height: 240px; overflow: auto; }
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { padding: 22px 22px 24px; justify-content: flex-start; }
  .brand-text h1 { font-size: 28px; margin-bottom: 8px; }
  .brand-text h1 span { font-size: 19px; }
  .brand-text p, .brand-list, .brand-foot { display: none; }
  .brand-logo { width: 140px; margin-bottom: 14px; }
  .login-panel { justify-content: flex-start; padding: 20px 16px 30px; }
  .login-card { padding: 26px 20px 22px; }
  .card-logo { display: none; }
  .side { transform: translateX(-100%); transition: transform .2s ease; }
  body.side-offen .side { transform: none; }
  body.side-offen .side-schatten { display: block; position: fixed; inset: 0; background: rgba(15, 23, 34, .45); z-index: 30; }
  .haupt { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px 0 8px; }
  .inhalt { padding: 16px 16px 30px; }
  .liste-kopf { align-items: flex-start; }
  .liste-aktionen .btn { padding: 0 11px; }
  .kacheln { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .kachel { padding: 12px; gap: 10px; }
  .kachel-icon { width: 34px !important; height: 34px !important; padding: 7px; }
  .grid th, .grid td { padding: 9px 8px; }
  .nur-gross { display: none; }
  .raster-2 { grid-template-columns: 1fr; }
  .filter select { flex: 1 1 140px; min-width: 0; }
  .liste-kopf h1, .beleg-kopf h1 { font-size: 19px; }
  .recovery { columns: 1; }
  .kv { grid-template-columns: 110px 1fr; }
  .vorschau-pdf { height: 420px; }
  .dlg { width: calc(100vw - 16px); }
  .einladung-box { flex-direction: column; }
  .kopierzeile { flex-direction: column; }
}

/* ------------------------------------------------ Kommentare */
textarea { width: 100%; min-height: 84px; padding: 10px 11px; border: 1px solid #d3d9e1; border-radius: var(--radius-s); font: 14px/1.45 var(--font); color: var(--text); resize: vertical; background: #fff; }
textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 107, 216, .15); outline: none; }
.beleg-kommentare { grid-column: 1 / -1; }
.kommentare { list-style: none; margin: 14px 16px 4px; padding: 0; display: grid; gap: 12px; }
.kommentare li { display: flex; gap: 10px; align-items: flex-start; }
.kommentare li .avatar { margin-top: 2px; }
.kommentare li.eigen .avatar { background: linear-gradient(135deg, #2f6bd8, #1d4e9e); }
.k-blase { flex: 1; min-width: 0; background: #f6f8fa; border: 1px solid var(--line-2); border-radius: 4px 12px 12px 12px; padding: 9px 13px; }
.k-kopf { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 3px; }
.k-blase p { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.k-leer { margin: 14px 16px 0; }
.k-form { margin: 14px 16px 16px !important; }
.k-fuss { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chip-komm { background: var(--blue-50); color: #1d4e9e; }
