/* SCORM Editor – Stylesheet */

:root {
    --bg:           #f5f5f0;
    --surface:      #ffffff;
    --surface-alt:  #ebebe4;
    --border:       #d6d4cc;
    --text:         #1a1a1a;
    --text-muted:   #6b6a64;
    --accent:       #1f4d3a;
    --accent-soft:  #e3ede8;
    --success:      #2c6f4d;
    --warning:      #b3651a;
    --error:        #a02828;
    --radius:       4px;
    --shadow:       0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Source Serif Pro", Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.55;
}

h1, h2, h3, h4 {
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.6rem;
}

h1 { font-size: 1.3rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }

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

.muted { color: var(--text-muted); font-size: 0.9rem; }

/* Topbar */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.topbar .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: 0.75rem;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.78rem;
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 500;
}

/* Container & Panels */
.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* Upload */
.upload-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.file-drop {
    display: block;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    background: var(--surface-alt);
    transition: border-color 0.15s, background 0.15s;
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-drop input { display: block; margin: 0 auto 0.6rem; }

.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: 0.4rem; }

/* Upload-Fortschritt */
.hidden { display: none !important; }
.upload-progress {
    margin-top: 1.2rem;
    padding: 1rem 1.2rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.progress-phase {
    font-weight: 500;
    font-family: "IBM Plex Sans", sans-serif;
    margin-bottom: 0.6rem;
    color: var(--accent);
}
.progress-bar-wrap {
    height: 10px;
    background: #e6e6df;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 5px;
    transition: width 0.2s ease;
}
.progress-bar.indeterminate {
    width: 30% !important;
    animation: indeterminate 1.4s ease-in-out infinite;
    background: linear-gradient(90deg, var(--accent), #4d8a6d, var(--accent));
    background-size: 200% 100%;
}
@keyframes indeterminate {
    0%   { margin-left: 0%; }
    50%  { margin-left: 70%; }
    100% { margin-left: 0%; }
}
.progress-detail {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: "IBM Plex Mono", monospace;
}

/* Phasen-Liste */
.progress-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    font-size: 0.88rem;
    font-family: "IBM Plex Sans", sans-serif;
}
.progress-steps li {
    padding: 0.35rem 0 0.35rem 1.8rem;
    color: var(--text-muted);
    position: relative;
}
.progress-steps li::before {
    content: "○";
    position: absolute;
    left: 0.4rem;
    color: #c8c8c0;
}
.progress-steps li.active {
    color: var(--accent);
    font-weight: 500;
}
.progress-steps li.active::before {
    content: "●";
    color: var(--accent);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
.progress-steps li.done {
    color: var(--success);
}
.progress-steps li.done::before {
    content: "✓";
    color: var(--success);
}
.progress-note {
    margin-top: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: #fbf3e0;
    border-left: 3px solid var(--warning);
    border-radius: 3px;
    font-size: 0.85rem;
    color: #6e4318;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #d8d8d0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Navigation oben ---- */
.topnav { display: flex; gap: 1.2rem; margin-left: auto; }
.topnav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
}
.topnav a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.topnav a.active { color: #fff; background: rgba(255,255,255,0.12); }
.topnav .reset-link { color: #d49a9a; }

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 0.3rem;
    margin: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 1rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 500;
}

/* ---- Vision-Toolbar ---- */
.vision-toolbar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.vision-toolbar label { font-size: 0.88rem; display: flex; align-items: center; gap: 0.4rem; }
.vision-toolbar select { padding: 0.3rem 0.5rem; font-size: 0.88rem; }
.vision-toolbar #vision-progress { flex: 1; min-width: 200px; font-size: 0.82rem; font-family: monospace; }

/* ---- Galerie ---- */
.asset-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.asset-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.asset-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    background: #f4f4ef;
    overflow: hidden;
    text-align: center;
}
.asset-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.asset-meta {
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}
.asset-name {
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.asset-info { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }
.asset-usages { font-size: 0.76rem; margin-top: 2px; }
.warn-text { color: var(--warning); font-weight: 500; }

/* Hinweis-Banner über ausgeblendete Assets */
.filter-note {
    margin: 0.6rem 0 1rem;
    padding: 0.55rem 0.85rem;
    background: #fbf3e0;
    border-left: 3px solid var(--warning);
    border-radius: 3px;
    font-size: 0.85rem;
}
.filter-note-whitelist {
    background: #e8f1ea;
    border-left-color: var(--accent);
}
.filter-note a {
    color: var(--accent);
    text-decoration: underline;
}
.filter-note code {
    background: rgba(0,0,0,0.04);
    padding: 0 4px;
    border-radius: 2px;
    font-size: 0.78rem;
}
.asset-actions {
    padding: 0.5rem 0.8rem;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}
.asset-actions .btn { width: 100%; }

/* ---- Vision-Ergebnis ---- */
.vision-result {
    padding: 0.7rem 0.8rem;
    border-top: 1px solid var(--border);
    background: #fbf9f0;
    font-size: 0.82rem;
    line-height: 1.45;
}
.vision-result .vision-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.76rem;
}
.vision-result .badge {
    background: var(--accent);
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
}
.vision-result .vision-desc { margin-bottom: 0.4rem; }
.vision-result .vision-ocr {
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: #fff;
    border-left: 3px solid var(--accent);
    border-radius: 3px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.78rem;
    max-height: 100px;
    overflow-y: auto;
}
.vision-result .vision-comments ul { margin: 0.2rem 0 0 1rem; padding: 0; }
.vision-result .vision-comments li { font-size: 0.78rem; color: var(--text-muted); }
.vision-result .err { color: var(--error); font-weight: 500; }

/* ---- Tabelle ---- */
.asset-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.asset-table th {
    background: var(--accent);
    color: #fff;
    text-align: left;
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 500;
}
.asset-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.asset-table tr:hover td { background: #fafaf5; }
.asset-table .path-cell {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.asset-table details summary { cursor: pointer; color: var(--accent); }
.usage-list { margin: 0.3rem 0 0 1rem; padding: 0; font-size: 0.78rem; }
.alt-text { font-style: italic; font-size: 0.78rem; margin-bottom: 2px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.12s;
}
.btn:hover { border-color: var(--accent); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #163a2c; }
.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { background: #7a1f1f; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #21563b; }
.btn-ghost { background: transparent; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.92rem;
}
.alert-error { background: #fbe6e6; color: var(--error); border: 1px solid #f0c0c0; }
.alert-success { background: #e6f1ec; color: var(--success); border: 1px solid #c1d8cc; }

/* Layout: Sidebar + Content */
.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: calc(100vh - 60px);
}
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.2rem;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
    position: sticky;
    top: 0;
}
.sidebar h2 { font-size: 1rem; margin-bottom: 1rem; }
.org { margin-bottom: 1.2rem; }
.org strong { font-family: "IBM Plex Sans", sans-serif; font-size: 0.9rem; }

.tree { list-style: none; padding-left: 0.6rem; margin: 0.4rem 0; border-left: 1px solid var(--border); }
.tree li { padding: 0.1rem 0; }
.tree-link, .tree-section {
    display: block;
    padding: 0.25rem 0.5rem;
    font-size: 0.88rem;
    border-radius: var(--radius);
}
.tree-link { color: var(--text); }
.tree-link:hover { background: var(--surface-alt); text-decoration: none; }
.tree-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.tree-section { color: var(--text-muted); font-style: italic; }

.all-resources {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.all-resources summary { cursor: pointer; font-size: 0.85rem; color: var(--text-muted); }
.all-resources ul { list-style: none; padding-left: 0; margin-top: 0.5rem; font-size: 0.8rem; }
.all-resources li { padding: 0.2rem 0; word-break: break-all; }
.all-resources a.active { font-weight: 600; }

/* Content */
.content {
    padding: 1.5rem 2rem;
    max-width: 900px;
}
.content-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

/* Bulk-Toolbar oberhalb der Blöcke */
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.bulk-toolbar .bulk-spacer { flex: 1; }
.bulk-toolbar .filter-toggle { font-size: 0.85rem; }
.bulk-toolbar #bulk-progress {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    color: var(--text);
    flex: 1;
    min-width: 200px;
}
.bulk-bar-wrap {
    height: 6px;
    background: #e6e6df;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
}
.bulk-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.bulk-stats {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Block */
.block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.block header {
    padding: 0.4rem 0.8rem;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.block .tag { letter-spacing: 0.04em; font-weight: 500; }
.block .ctx { margin-left: 0.6rem; color: var(--text-muted); font-family: "IBM Plex Sans", sans-serif; font-size: 0.72rem; }
.block .ctx.warn { color: var(--warning); }
.block .ctx.html {
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    font-weight: 500;
}
.block .ctx.svg {
    color: #6e4318;
    background: #fbf3e0;
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    font-weight: 500;
}
.svg-hint {
    margin: 0.4rem 0 0.6rem;
    padding: 0.5rem 0.7rem;
    background: #fbf3e0;
    border-left: 3px solid var(--warning);
    border-radius: 3px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #6e4318;
}
.svg-hint code {
    background: rgba(0,0,0,0.05);
    padding: 0 4px;
    border-radius: 2px;
    font-size: 0.78rem;
}
.badge-format { background: #fbf3e0; color: var(--warning); margin-left: 0.4rem; }
.badge-provider { background: #e8edf5; color: #3c4a6b; margin-left: 0.4rem; font-family: "IBM Plex Mono", monospace; }

/* Rich-Editor: HTML-Inhalt darin sichtbar formatieren */
.block-text.rich strong { font-weight: 700; }
.block-text.rich em { font-style: italic; }
.block-text.rich p { margin: 0 0 0.5em; }
.block-text.rich p:last-child { margin-bottom: 0; }
.block-text.rich ul, .block-text.rich ol { margin: 0.4em 0; padding-left: 1.4em; }
.block-text {
    padding: 0.8rem 1rem;
    min-height: 2.4rem;
    outline: none;
    line-height: 1.6;
}
.block-text:focus { background: #fffceb; }

.block-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}
.block-actions .check-type {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.status { margin-left: auto; color: var(--text-muted); font-size: 0.8rem; max-width: 60%; text-align: right; word-break: break-word; }
.status.ok { color: var(--success); }
.status.err { color: var(--error); }

/* Suggestion */
.suggestion {
    padding: 1rem;
    background: #fbf9f0;
    border-top: 1px solid var(--border);
}
.suggestion.fallback-warning {
    background: #fdf2e6;
    border-top: 2px solid var(--warning);
}
.suggestion.fallback-warning h4::before {
    content: "⚠️ ";
}
.suggestion.hidden { display: none; }
.suggestion h4 {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.diff { font-family: "IBM Plex Mono", monospace; font-size: 0.85rem; line-height: 1.6; }
.diff del { background: #fde0e0; color: var(--error); text-decoration: line-through; padding: 0 2px; }
.diff ins { background: #def0e3; color: var(--success); text-decoration: none; padding: 0 2px; }
.comments { margin: 0.7rem 0; font-size: 0.85rem; color: var(--text-muted); }
.comments ul { padding-left: 1.1rem; margin: 0.3rem 0; }
.suggestion-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; }

/* Pipeline-Stages-Anzeige */
.pipeline-stages {
    margin-top: 0.8rem;
    padding: 0.7rem 0.8rem;
    background: #f4f4ef;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.pipeline-stages h5 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}
.pipeline-stages .stage {
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #d8d8d0;
}
.pipeline-stages .stage:last-child { border-bottom: none; margin-bottom: 0; }
.pipeline-stages .stage strong {
    color: var(--accent);
    font-size: 0.82rem;
}
.pipeline-stages .stage-text {
    font-size: 0.82rem;
    margin: 0.25rem 0;
    color: #333;
    font-style: italic;
}
.pipeline-stages .stage-comments {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 1rem;
    padding: 0;
}

/* Responsive */
@media (max-width: 800px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
    .content { padding: 1rem; }
}

/* ============================================================
   LOGIN
   ============================================================ */
body.login-page {
    background: var(--bg-soft, #f6f6f4);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-box {
    background: #fff;
    max-width: 540px;
    width: 100%;
    padding: 2rem 2.4rem;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.06);
}
.login-box h1 {
    margin: 0 0 0.4rem;
    font-size: 1.6rem;
}
.login-box h2 {
    font-size: 1rem;
    margin: 1rem 0 0.6rem;
    color: var(--accent);
}
.login-section { margin-bottom: 1rem; }
.login-divider {
    margin: 1.4rem -2.4rem;
    border: 0;
    border-top: 1px solid #eee;
}
.user-list {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.user-chip {
    background: #f4f4f2;
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    font-size: 0.92rem;
    display: inline-flex; align-items: center; gap: 0.5rem;
    transition: background 0.15s;
}
.user-chip:hover { background: #e8e8e4; }
.user-chip-lektorat { border-left: 3px solid #5d8ea8; }
.user-chip-fach     { border-left: 3px solid #c08651; }
.user-chip .role-tag {
    font-size: 0.7rem; color: #777; text-transform: uppercase; letter-spacing: 0.04em;
}
.new-user-form label { display: block; margin-bottom: 0.7rem; }
.new-user-form input[type=text],
.new-user-form input[type=password] {
    width: 100%; padding: 0.45rem 0.6rem;
    border: 1px solid #ccc; border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.2rem;
}
.new-user-form fieldset {
    border: 0; padding: 0; margin: 0 0 1rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}
.new-user-form fieldset legend { font-size: 0.9rem; margin-bottom: 0.3rem; }
.radio-card {
    border: 1px solid #ddd; border-radius: 6px;
    padding: 0.7rem;
    cursor: pointer; display: flex; flex-direction: column;
    transition: border-color 0.15s, background 0.15s;
}
.radio-card:has(input:checked) {
    border-color: var(--accent);
    background: #f0f6f2;
}
.radio-card input[type=radio] { display: none; }
.radio-card .radio-title { font-weight: 600; }
.radio-card .radio-desc  { font-size: 0.82rem; color: #666; }
.login-admin-link {
    text-align: center; margin-top: 1.4rem;
    font-size: 0.85rem;
}
.login-admin-link a { color: #999; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard {
    max-width: 1200px;
    margin: 1.4rem auto;
    padding: 0 1.4rem;
}
.dashboard h2 { font-size: 1.1rem; margin: 0 0 0.7rem; }
.upload-section, .package-list {
    background: #fff;
    border: 1px solid #e5e5e2;
    border-radius: 6px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
}
.upload-form {
    display: flex; align-items: center; gap: 0.7rem;
}
.upload-form input[type=file] { flex: 1; }
.package-table {
    width: 100%; border-collapse: collapse;
}
.package-table th, .package-table td {
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}
.package-table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
    background: #fafaf8;
}
.package-table th:nth-child(n+3):nth-child(-n+6) { text-align: center; width: 80px; }
.package-table td:nth-child(n+3):nth-child(-n+6) { text-align: center; }
.pkg-link {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.pkg-link:hover { text-decoration: underline; }
.status-cell {
    font-size: 0.8rem;
    position: relative;
}
.status-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%;
    background: #ccc;
    margin-right: 0.3rem;
    vertical-align: middle;
}
.st-pending .status-dot { background: #d44; }
.st-running .status-dot { background: #ea8c00; animation: pulse 1.4s ease-in-out infinite; }
.st-done    .status-dot { background: #45a04a; }
.st-stalled .status-dot { background: #d44; box-shadow: 0 0 0 2px rgba(212,68,68,0.2); }
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}
.mini-progress {
    width: 100%;
    height: 3px;
    background: #f0f0ec;
    margin-top: 0.2rem;
    border-radius: 2px;
    overflow: hidden;
}
.mini-progress-bar {
    height: 100%; background: #ea8c00;
    transition: width 0.4s ease;
}
.lock-tag {
    background: #f6e8d4;
    color: #6e4318;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    font-size: 0.78rem;
}
.btn-link {
    background: none; border: 0; color: var(--accent);
    cursor: pointer; padding: 0; text-decoration: underline;
    font: inherit;
}
.btn-link-danger {
    background: none; border: 0; color: #c62b2b;
    cursor: pointer; padding: 0 4px;
    font: inherit;
}
.user-tag {
    background: #f0f6f2;
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}
.alert-warning {
    background: #fbf3e0;
    border: 1px solid #e8c890;
    color: #6e4318;
    padding: 0.7rem 1rem;
    border-radius: 4px;
    margin: 0.8rem auto;
    max-width: 1200px;
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin-main {
    max-width: 1100px;
    margin: 1.4rem auto;
    padding: 0 1.4rem;
}
.admin-section {
    background: #fff;
    border: 1px solid #e5e5e2;
    border-radius: 6px;
    padding: 1rem 1.4rem;
    margin-bottom: 1.5rem;
}
.admin-section h2 {
    font-size: 1.1rem;
    margin: 0 0 0.6rem;
    color: var(--accent);
}
.admin-table {
    width: 100%; border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}
.admin-table th { font-size: 0.8rem; color: #555; font-weight: 600; }
.flash-box {
    padding: 0.7rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.flash-success {
    background: #e8f1ea;
    border: 1px solid #b8d6c1;
    color: #2a6a3b;
}
.flash-error {
    background: #fde4e4;
    border: 1px solid #ecb5b5;
    color: #8a2424;
}
.prompt-tabs {
    display: flex; flex-wrap: wrap;
    gap: 0.4rem;
}
.prompt-tabs .tab-label {
    background: #f4f4f2;
    border: 1px solid #ddd;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
}
.prompt-tabs .tab-content {
    flex-basis: 100%;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}
.prompt-form label {
    display: block;
    margin: 0.6rem 0;
    font-weight: 600;
    font-size: 0.92rem;
}
.prompt-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.86rem;
    resize: vertical;
}
.prompt-form code {
    background: #f2f2ee;
    padding: 0 4px;
    border-radius: 2px;
    font-size: 0.82rem;
}
.status-mini-list {
    margin: 0.4rem 0; padding-left: 1.2rem;
    font-size: 0.84rem;
}
.error-box {
    background: #fde4e4;
    border-left: 3px solid #c62b2b;
    color: #8a2424;
    padding: 0.6rem 0.8rem;
    margin: 0.8rem 0;
    border-radius: 3px;
}

/* Quellen-Badge im "Alle Blöcke"-Modus */
.block .ctx.source-label {
    background: #f0f6f2;
    color: var(--accent);
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    font-weight: 500;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.78rem;
    margin-left: auto;
}
.tree-link-all {
    font-weight: 600;
    background: #f0f6f2 !important;
}
