/* Mitra Stromlaufplan – Ergänzungen zur gemeinsamen Mitra-Oberfläche (app.css aus Mitra Lager)
   Desktop-App: Reiter oben immer sichtbar, breiterer Arbeitsbereich, Tabellen und Blattvorschau. */
main { max-width: 1400px; }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tabs a { padding: 7px 12px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: 14px; white-space: nowrap; }
.tabs a.on { background: var(--ink); color: var(--ink-fg); font-weight: 600; }
.tabs[hidden] { display: none; }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sp-head .h1 { margin: 0; }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sp-search { position: relative; flex: 1 1 320px; max-width: 520px; display: block; }
.sp-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.sp-search .inp { padding-left: 38px; width: 100%; }

.sp-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14.5px; }
.sp-table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); background: var(--surface2); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sp-table td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.sp-table tbody tr { cursor: pointer; }
.sp-table tbody tr:hover, .sp-table tbody tr:focus { background: var(--accent-soft); outline: none; }
.sp-table tbody tr:last-child td { border-bottom: 0; }
.sp-table td.nr { font-family: 'IBM Plex Mono', monospace; font-weight: 600; white-space: nowrap; }
.sp-table tr.arch td { color: var(--muted); }

.sp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .sp-grid { grid-template-columns: 1fr; } }
.sp-dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 12px; margin: 8px 0 0; font-size: 14.5px; }
.sp-dl dt { color: var(--muted); }
.sp-dl dd { margin: 0; }
.sp-check { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.sp-check li.err { color: var(--err); font-weight: 600; }
.sp-check li.warn { color: var(--warn); }
.sp-steps { padding-left: 20px; line-height: 1.5; }

.sp-sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.sp-sheet { margin: 0; }
.sp-paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; aspect-ratio: 297 / 210; }
.sp-paper svg { display: block; width: 100%; height: 100%; }
.sp-sheet figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---- Editor (0.3): Baum · Live-Blatt · Eigenschaften */
body.ed-mode main { max-width: none; padding-bottom: 8px; }
body.ed-mode .foot { display: none; }
.ed-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ed-head .h1 { margin: 0; font-size: 22px; }
.ed-head .grow { flex: 1; }
.ed-state { font-size: 13px; color: var(--muted); }
.ed-state.saving, .ed-state.dirty { color: var(--accent); }
.ed-state.error, .ed-state.conflict { color: var(--err); font-weight: 600; }
.ed { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.ed-left, .ed-right { position: sticky; top: 64px; max-height: calc(100vh - 140px); overflow: auto; }
.ed-left { padding: 8px; }
.ed-right { gap: 10px; }
.ed-right h3 { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ed-right h3:first-child { margin-top: 0; }
.ed-tree, .ed-tree ul { list-style: none; margin: 0; padding: 0; }
.ed-tree ul { margin-left: 12px; border-left: 1px solid var(--line2); }
.ed-node { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 13.5px; color: var(--fg); cursor: pointer; }
.ed-node span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ed-node b { font-weight: 600; }
.ed-node:hover { background: var(--surface2); }
.ed-node.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ed-add { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ed-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ed-acts .danger { color: var(--err); }
.ed-mid { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ed-pager { display: flex; gap: 6px; align-items: center; }
.ed-pager select { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); font: inherit; font-size: 13.5px; padding: 0 8px; }
.ed-paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; aspect-ratio: 297 / 210; }
.ed-paper svg { display: block; width: 100%; height: 100%; }
.ed-paper .hit { cursor: pointer; }
.ed-paper .hit:hover { fill: rgba(29, 74, 143, .06); }
@media (max-width: 1250px) { .ed { grid-template-columns: 260px minmax(0, 1fr) 280px; } }
#edProps input:not([type=checkbox]), #edProps select, #edProps textarea { min-height: 34px; height: 34px; padding: 5px 9px; font-size: 14px; }
#edProps textarea { height: auto; }
.ed-right .f { font-size: 13px; gap: 4px; }

/* ---- Drucken / PDF (0.4): alle Blätter A4 quer, sonst nichts */
#print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff !important; margin: 0; padding: 0; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
  #print .pg { width: 297mm; height: 210mm; overflow: hidden; break-after: page; page-break-after: always; }
  #print .pg:last-child { break-after: auto; page-break-after: auto; }
  #print svg { display: block; width: 297mm; height: 210mm; }
}
