/* === SV-Eden-Dashboard =====================================================
   Aufbau und Komponenten wie im schoelzchen-dashboard. Farben von www.sv-eden.de
   (X-Theme, x-generated-css) und aus dem Logo:
     rgb(156,0,0) #9C0000  Links, aktiver Menüpunkt, Akzentflächen der Website
     #CA0809               Rot im Logo (Kreis um das „e“)
     Schwarz #000 / #555   Text und Nebentext, Schrift Arial
   Logo: static/img/logo.png (Original EDEN_Logrot.png der Website). Die Website hat
   kein Site-Icon; favicon.png ist das rote „e“ aus dem Logo auf Weiß.
   Sidebar in Anthrazit passend zum schwarzen Schriftzug, Akzente in Rot.
=========================================================================== */
:root {
    --color-bg: #f5f5f5;
    --color-surface: #ffffff;
    --color-primary: #9c0000;          /* Akzent-Rot der Website */
    --color-primary-dark: #9c0000;     /* Buttons */
    --color-primary-light: #fbeeee;
    --color-accent: #9c0000;           /* Links */
    --color-logo: #ca0809;             /* Rot im Logo */
    --color-text: #1a1a1a;
    --color-text-muted: #555555;
    --color-border: #e1e1e1;
    --color-border-light: #efefef;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #c0392b;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --focus-ring: 0 0 0 3px rgba(156,0,0,0.18);
    /* Layout */
    --header-height: 60px;
    --sidebar-width: 300px;   /* Icon-Leiste 76 px + Panel 224 px */
    /* Dunkle Sidebar in Anthrazit */
    --color-panel: #232323;
    --color-panel-dark: #1a1a1a;
    --color-rail-icon: #b0b0b0;
    --color-nav-text: #dcdcdc;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.45;
}
a { color: var(--color-accent); }
button { font-family: inherit; }

/* === Login ============================================================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(900px 500px at 85% 110%, rgba(202,8,9,0.40) 0%, transparent 60%),
                linear-gradient(135deg, #0d0d0d 0%, #1e1e1e 55%, #3d0000 100%);
}
.login-container { width: 100%; max-width: 440px; padding: 20px; }
.login-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-logo { width: 240px; max-width: 100%; height: auto; }
.login-header h1 { margin: 18px 0 4px; font-size: 20px; font-weight: 700; color: var(--color-primary); letter-spacing: -0.01em; }
.login-header p { color: var(--color-text-muted); margin: 0; font-size: 14px; }
.login-form .form-group { margin-bottom: 18px; }
.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}
.login-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    background: #fff;
}
.login-form input:focus { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.login-form .has-error input { border-color: var(--color-danger); }
.field-error { margin-top: 5px; font-size: 12.5px; color: var(--color-danger); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: none; border-radius: 6px; background: transparent;
    color: var(--color-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pw-toggle:hover, .pw-toggle.is-on { color: var(--color-primary); background: var(--color-primary-light); }
.login-messages { margin-bottom: 18px; }
.error-title { margin: 18px 0 6px; font-size: 20px; color: var(--color-primary); }
.login-hint { margin: 18px 0 0; font-size: 12.5px; color: var(--color-text-muted); text-align: center; }
.login-footer {
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    margin-top: 20px;
}

.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.alert-error { background: #fdf2f1; color: var(--color-danger); border: 1px solid #f3c6c1; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-info { background: var(--color-primary-light); color: var(--color-primary); border: 1px solid #efc6c6; }
.alert-warning { background: #fffbeb; color: #92600a; border: 1px solid #fde68a; }

/* === Buttons ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--color-primary-dark); color: #fff; }
.btn-primary:hover { background: var(--color-logo); }
.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary-light); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* === App-Layout: Kopf oben + Sidebar links ============================== */
.app-header {
    position: fixed;
    top: 0; left: var(--sidebar-width); right: 0;
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; z-index: 100; box-shadow: var(--shadow);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-title { font-size: 18px; font-weight: 700; color: var(--color-primary); letter-spacing: -0.02em; margin: 0; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-right form { margin: 0; }
.header-user { font-size: 13px; color: var(--color-text-muted); }
.sidebar-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: var(--color-text); border-radius: 2px; }

.app-body { display: flex; padding-top: var(--header-height); min-height: 100vh; }

/* Sidebar: Icon-Leiste + Panel (wie schoelzchen-dashboard) */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    display: flex; z-index: 110;
    transition: transform 0.3s ease;
    --rail-bg: #141414;
    --panel-bg: var(--color-panel);
    --nav-accent: #ffffff;
    --nav-bar: var(--color-logo);
    --nav-text-inactive: var(--color-nav-text);
    --nav-icon-inactive: var(--color-rail-icon);
    --nav-hover: rgba(255,255,255,0.07);
}
.sidebar ::-webkit-scrollbar { width: 8px; }
.sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 4px; }
.sidebar ::-webkit-scrollbar-track { background: transparent; }

/* Spalte 1: Icon-Leiste */
.sidebar .rail {
    width: 76px; flex: none;
    background: var(--rail-bg);
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 0;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar .rail-logo { display: block; flex: none; margin-bottom: 14px; border-radius: 10px; }
.sidebar .rail-logo img { width: 40px; height: 40px; border-radius: 10px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,0.25); }
.sidebar .rail-groups {
    flex: 1; width: 100%; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 6px;
}
.sidebar .rail-btn {
    width: 60px; min-height: 56px; padding: 7px 2px 6px; border-radius: 12px; border: none; flex: none;
    cursor: pointer; position: relative; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    background: transparent; color: var(--nav-icon-inactive);
    transition: background 0.12s, color 0.12s;
}
.sidebar .rail-btn:hover { background: var(--nav-hover); color: #ffffff; }
.sidebar .rail-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.7); outline-offset: 1px; }
.sidebar .rail-btn.active { background: rgba(255,255,255,0.18); color: var(--nav-accent); }
.sidebar .rail-btn.active::before {
    content: ''; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--nav-bar);
}
.sidebar .rail-icon { flex: none; }
.sidebar .rail-label { font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: 0.01em; white-space: nowrap; }
.sidebar .rail-system { margin-top: 6px; }

/* Spalte 2: Panel */
.sidebar .panel {
    flex: 1; min-width: 0;
    background: var(--panel-bg);
    display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar .panel-brand {
    flex: none; padding: 14px 18px 0;
    font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--nav-icon-inactive);
}
.sidebar .panel-group { display: none; flex: 1; min-height: 0; flex-direction: column; }
.sidebar .panel-group.is-open { display: flex; }
.sidebar .panel-head {
    display: flex; align-items: center; gap: 11px; flex: none;
    padding: 10px 18px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #ffffff;
}
.sidebar .panel-head span { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.sidebar .panel-items { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar .pn-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border-radius: 8px;
    position: relative; text-decoration: none;
    font-size: 14px; font-weight: 500;
    color: var(--nav-text-inactive);
    transition: background 0.12s, color 0.12s;
}
.sidebar .pn-item:hover { background: var(--nav-hover); color: #ffffff; }
.sidebar .pn-item .pn-icon { flex: none; color: var(--nav-icon-inactive); }
.sidebar .pn-item .pn-extern { flex: none; opacity: 0.6; }
.sidebar .pn-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .pn-item.active { background: rgba(255,255,255,0.16); color: #ffffff; }
.sidebar .pn-item.active .pn-icon { color: #ffffff; }
.sidebar .pn-item.active::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--nav-bar);
}
.sidebar .pn-leer { margin: 4px 12px; font-size: 12.5px; font-style: italic; color: var(--nav-icon-inactive); opacity: 0.85; }

/* Benutzerbereich unten im Panel */
.sidebar .panel-user {
    display: flex; align-items: center; gap: 10px; flex: none;
    padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.1);
    background: var(--color-panel-dark);
}
.sidebar .panel-user form { margin: 0; display: flex; }
.sidebar .panel-user .avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    background: #ffffff; color: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.sidebar .panel-user .meta { line-height: 1.2; flex: 1; min-width: 0; }
.sidebar .panel-user .name { font-size: 12.5px; font-weight: 600; color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .panel-user .sub { font-size: 11px; color: var(--color-rail-icon); }
.sidebar .panel-logout { color: var(--color-rail-icon); display: flex; background: none; border: none; cursor: pointer; padding: 4px; }
.sidebar .panel-logout:hover { color: #fff; }
.abschnitt-titel { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }

.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 28px 32px; min-width: 0; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}
.card h1 { margin: 0 0 8px; font-size: 22px; color: var(--color-primary); }
.muted { color: var(--color-text-muted); }
.center { text-align: center; }
.messages { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }

/* Kacheln (Unteranwendungen) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.tile {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.tile:hover .tile-title { color: var(--color-primary); }
.tile-abbr {
    width: 40px; height: 40px; border-radius: 10px; margin-bottom: 6px;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-primary-light); color: var(--color-primary);
    font-size: 13px; font-weight: 800; letter-spacing: 0.04em;
}
.tile-title { font-size: 17px; font-weight: 700; color: var(--color-text); }
.tile-desc { font-size: 13px; color: var(--color-text-muted); }

/* Seiten-Kopf */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; font-size: 22px; color: var(--color-primary); }

/* Tabellen */
.table-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
    text-align: left; padding: 12px 16px;
    background: var(--color-border-light);
    color: var(--color-text-muted);
    font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.table tbody td { padding: 11px 16px; border-bottom: 1px solid var(--color-border-light); vertical-align: top; }
.table tbody tr:hover { background: var(--color-primary-light); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-success { background: #eafaf1; color: #15803d; }
.badge-muted { background: #f1f5f9; color: #64748b; }
.badge-danger { background: #fdf2f1; color: var(--color-danger); }
.badge-info { background: var(--color-primary-light); color: var(--color-primary); }
.badge-amber { background: #fef3c7; color: #92600a; }

/* Info-Karten + Formulare */
.info-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.info-card > h2 { margin: 0; padding: 13px 18px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text); background: var(--color-border-light); border-bottom: 1px solid var(--color-border); }
.form-card { max-width: 640px; }
.stack-form { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--color-text); }
.form-field input, .form-field select, .form-field textarea {
    width: 100%; padding: 13px 14px; min-height: 50px;
    border: 1px solid var(--color-border); border-radius: var(--radius);
    font-size: 16px; font-family: inherit; color: var(--color-text);
    outline: none; transition: border-color var(--transition), box-shadow var(--transition);
    background: #fff;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.form-field.has-error input { border-color: var(--color-danger); }
.field-hint { font-weight: 400; color: var(--color-text-muted); font-size: 12px; }
.field-hint ul { margin: 4px 0 0; padding-left: 18px; }
textarea { resize: vertical; }
.form-actions { display: flex; flex-direction: column; gap: 10px; }
.form-actions .btn { width: 100%; min-height: 52px; font-size: 16px; }
.form-field select { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 40px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* === Responsive ========================================================= */
@media (max-width: 900px) {
    .sidebar-toggle { display: flex; }
    .app-header { left: 0; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 18px 16px; }
    .header-user { display: none; }
}
@media (max-width: 480px) {
    .login-card { padding: 28px 22px; }
}

/* === Gemeinsame Ergänzungen ============================================= */
.small { font-size: 12.5px; }
.intro { margin: 0 0 18px; max-width: 760px; }
.back-link { display: inline-block; font-size: 13px; text-decoration: none; margin-bottom: 4px; }
.back-link:hover { text-decoration: underline; }
.page-head-main { min-width: 0; }
.page-head-main h1 { overflow-wrap: anywhere; }
.page-head .muted.small { margin: 4px 0 0; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-actions form { margin: 0; }
.inline-form { display: flex; gap: 6px; }
.inline-form input {
    width: 260px; max-width: 60vw; padding: 7px 10px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: var(--radius); outline: none;
}
.inline-form input:focus { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.btn-danger-outline { background: transparent; color: var(--color-danger); border-color: #e6b3ad; }
.btn-danger-outline:hover { background: #fdf2f1; border-color: var(--color-danger); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.tiles-flush { margin-top: 8px; }
.row-link { cursor: pointer; }
.table a { text-decoration: none; }
.form-check label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.form-check input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--color-primary); }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; }
.tab {
    padding: 10px 14px; text-decoration: none; color: var(--color-text-muted); font-weight: 600; font-size: 14px;
    border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--color-primary); }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-count { background: var(--color-primary-light); color: var(--color-primary); border-radius: 999px; padding: 0 8px; font-size: 12px; }

/* Startseite: Bereiche mit Kacheln */
.bereiche { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 24px; align-items: stretch; }
.bereich { display: flex; flex-direction: column; gap: 10px; background: var(--color-surface); border: 1px solid var(--color-border); border-top: 4px solid var(--color-primary); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.bereich-kopf h2 { margin: 0; font-size: 18px; color: var(--color-primary); }
.bereich-kopf p { margin: 2px 0 4px; }
.tile-kompakt { flex-direction: row; align-items: flex-start; gap: 12px; padding: 14px; box-shadow: none; }
.tile-kompakt .tile-abbr { flex: none; margin-bottom: 0; }
.tile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile-kompakt .tile-title { font-size: 15.5px; }
.bereich-leer { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 16px; border: 1px dashed var(--color-border); border-radius: var(--radius); color: var(--color-text-muted); font-size: 13.5px; text-align: center; }
.bereich-leer p { margin: 0; }
.bereich-weitere { margin-top: 28px; }

/* === Gemeinsame Bausteine (aus dem schoelzchen-dashboard) ================== */
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, 'Courier New', monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.angaben-box { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 10px 16px; margin: 4px 0 14px; box-shadow: var(--shadow); }
.angaben-box summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--color-primary); }
.angaben-form.stack-form { padding: 14px 0 6px; max-width: 760px; }

/* Upload-Zone und Upload-Liste */
.dropzone {
    border: 2px dashed #d9b3b3; border-radius: var(--radius-lg); background: #fcf8f8;
    padding: 26px 16px; text-align: center; cursor: pointer; color: var(--color-text-muted);
    transition: background var(--transition), border-color var(--transition);
    outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--color-primary); background: var(--color-primary-light); }
.dropzone.is-over { border-color: var(--color-primary); border-style: solid; background: #f7e1e1; }
.dz-icon { color: var(--color-primary); margin-bottom: 6px; }
.dz-text { font-size: 15px; color: var(--color-text); }
.dz-hint { font-size: 12.5px; margin-top: 4px; }
.doc-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-list:empty { display: none; }
.doc-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff; }
.doc-item.is-error { border-color: #f3c6c1; background: #fdf2f1; }
.doc-type { flex: none; min-width: 44px; padding: 3px 6px; border-radius: 5px; background: var(--color-primary-light); color: var(--color-primary); font-size: 11px; font-weight: 700; text-align: center; }
.doc-item.is-error .doc-type { background: var(--color-danger); color: #fff; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-name { font-size: 14px; font-weight: 600; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 12px; color: var(--color-text-muted); }
.doc-item.is-error .doc-meta { color: var(--color-danger); white-space: normal; }
.doc-progress { height: 4px; background: var(--color-border-light); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.doc-progress span { display: block; height: 100%; width: 0; background: var(--color-primary); transition: width 0.15s; }
.doc-remove { flex: none; width: 32px; height: 32px; border: none; border-radius: 6px; background: transparent; color: var(--color-text-muted); cursor: pointer; font-size: 20px; }
.doc-remove:hover { background: #fdf2f1; color: var(--color-danger); }

/* === Bildübergabe ========================================================== */
.bu-karte { padding: 0 18px 18px; margin-bottom: 16px; }
.bu-karte > h2 { margin: 0 -18px 14px; }
.bu-zeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bu-zeile input[type=text], .bu-zeile input[type=search], .bu-zeile input[type=number], .bu-zeile select,
.bu-verlaengern input, .bu-kopierfeld input, .bu-name-eingabe {
    padding: 9px 11px; font-size: 14px; font-family: inherit; color: var(--color-text);
    border: 1px solid var(--color-border); border-radius: var(--radius); outline: none; background: #fff;
}
.bu-zeile input:focus, .bu-zeile select:focus, .bu-verlaengern input:focus, .bu-name-eingabe:focus { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.bu-zeile input[type=text], .bu-zeile input[type=search] { flex: 1 1 280px; max-width: 520px; }
.bu-zeile input[type=number], .bu-verlaengern input { width: 78px; }
.bu-suche { margin: 0 0 12px; }
.bu-suche label { font-size: 13px; font-weight: 600; }
.bu-fall { font-weight: 600; text-decoration: none; }
.bu-fall:hover { text-decoration: underline; }
.bu-notiz { margin: 6px 0 0; font-size: 13.5px; color: var(--color-text-muted); max-width: 760px; }
.bu-hinweis { margin: 10px 0 0; }
.bu-link-neu span, .bu-link-neu label[for=bu-tage] { font-size: 13.5px; color: var(--color-text-muted); }

/* Links */
.bu-links { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.bu-link { border: 1px solid var(--color-border); border-left: 4px solid var(--color-success); border-radius: var(--radius); padding: 12px 14px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.bu-link.is-abgelaufen { border-left-color: var(--color-warning); background: #fffdf7; }
.bu-link.is-gesperrt { border-left-color: var(--color-danger); background: #fafafa; }
.bu-link.is-neu { box-shadow: 0 0 0 3px rgba(156,0,0,0.22); }
.bu-link-kopf { display: flex; flex-direction: column; gap: 3px; }
.bu-link-kopf .badge { margin-left: 6px; vertical-align: 1px; }
.bu-link-felder { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.bu-kopierfeld { display: flex; align-items: center; gap: 6px; flex: 1 1 420px; min-width: 0; }
.bu-kopierfeld-pw { flex: 0 1 auto; }
.bu-kopierfeld label { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.bu-kopierfeld input { flex: 1; min-width: 0; background: var(--color-bg); }
.bu-kopierfeld-pw input { width: 130px; flex: none; font-size: 15px; font-weight: 700; letter-spacing: 0.03em; }
.bu-link-aktionen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bu-link-aktionen form { margin: 0; }
.bu-link-aktionen .bu-verlaengern { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-right: auto; }
.bu-verlaengern label, .bu-verlaengern span { font-size: 13px; color: var(--color-text-muted); }
.bu-verlaengern input { padding: 6px 8px; }

/* Werkzeugleiste und Bildraster */
.bu-werkzeuge { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--color-border-light); }
.bu-werkzeuge[hidden] { display: none; }
.bu-sortieren, .bu-auswahlleiste { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.bu-auswahlleiste .form-check { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-right: 6px; }
.bu-bilder { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bu-bild { position: relative; display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: #fff; overflow: hidden; transition: box-shadow var(--transition), border-color var(--transition), opacity var(--transition); }
.bu-bild:hover { box-shadow: var(--shadow-md); }
.bu-bild.is-gezogen { opacity: 0.35; }
.bu-bild.is-ausgewaehlt { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(156,0,0,0.25); }
.bu-bild-kopf { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; background: var(--color-border-light); }
.bu-auswahl { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.bu-auswahl input { width: 16px; height: 16px; accent-color: var(--color-primary); margin: 0; }
.bu-nr { font-size: 12px; font-weight: 700; color: var(--color-primary); font-variant-numeric: tabular-nums; }
.bu-griff { color: var(--color-text-muted); cursor: grab; display: flex; }
.bu-bild-vorschau { display: block; aspect-ratio: 4 / 3; background: #1e1e1e; }
.bu-bild-vorschau img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bu-bild-name { padding: 8px 10px 0; min-width: 0; }
.bu-name { width: 100%; border: none; background: none; padding: 2px 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--color-text); text-align: left; cursor: text; overflow-wrap: anywhere; }
.bu-name:hover { color: var(--color-primary); text-decoration: underline dotted; }
.bu-name-eingabe { width: 100%; padding: 5px 7px; font-size: 13.5px; }
.bu-bild-meta { padding: 2px 10px 0; font-size: 11.5px; }
.bu-bild-aktionen { display: flex; gap: 4px; padding: 8px 10px 10px; margin-top: auto; }
.bu-mini { border: 1px solid var(--color-border); background: #fff; color: var(--color-text-muted); border-radius: 6px; min-width: 32px; height: 30px; cursor: pointer; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.bu-mini:hover { border-color: var(--color-primary); color: var(--color-primary); }
.bu-mini-loeschen { margin-left: auto; }
.bu-mini-loeschen:hover { border-color: var(--color-danger); color: var(--color-danger); background: #fdf2f1; }
.bu-leer { margin: 14px 0 0; }

/* Öffentliche Abrufseite */
.abruf-intro { margin: 0 0 16px; }
.abruf-info { text-align: center; margin: 0 0 20px; padding: 16px; border-radius: var(--radius); background: var(--color-bg); display: flex; flex-direction: column; gap: 4px; }
.abruf-fall { font-size: 17px; font-weight: 700; color: var(--color-text); overflow-wrap: anywhere; }
