/* Büro-Portal: dichte Tabellen, klare Navigation, druckfreundlich. */
body { font-size: 14px; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.loginbox { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.loginbox .lh { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 16px; }
.loginbox .btn { width: 100%; }
.err { color: var(--err); }

.layout { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: 48px 1fr; min-height: 100vh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--bar); color: var(--bar-text); }
.top .sp { flex: 1; }
.top .me { color: inherit; text-decoration: none; font-size: 13px; opacity: .85; }
.top .btn.sm { background: transparent; color: inherit; border-color: rgba(255,255,255,.35); min-height: 30px; padding: 3px 10px; }
.top .langsw { color: var(--bar-text); }
.navtoggle { display: none; background: none; border: 0; color: inherit; padding: 6px; }
.nav { background: var(--surface); border-right: 1px solid var(--border); padding: 10px 0; }
.nav a { display: block; padding: 8px 18px; color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { border-left-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.navsep { margin: 14px 18px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.view { padding: 18px 22px 40px; min-width: 0; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .navtoggle { display: inline-flex; }
  .nav { display: none; position: fixed; top: 48px; left: 0; bottom: 0; width: 240px; z-index: 30; box-shadow: 2px 0 8px rgba(0,0,0,.2); }
  .nav.open { display: block; }
  .view { padding: 14px 12px 40px; }
  .top .me { display: none; }
}

h1 { font-size: 20px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 15px; margin: 22px 0 8px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 16px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input, .row > select { width: auto; min-width: 140px; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin: 6px 0 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 400; }
.meter { height: 6px; background: var(--surface-2); border: 1px solid var(--border); margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); }

.invcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; cursor: pointer; }
.invcard:hover { border-color: var(--border-strong); }
.invcard .t { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.invcard .t b { font-size: 16px; }
.invcard .kpis { margin: 0; }

.tblwrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 230px); }
.tblbar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.tblbar input[type=search] { max-width: 280px; }
.tblbar .cnt { color: var(--muted); font-size: 13px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; padding: 7px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; cursor: pointer; user-select: none; }
table.t th.n, table.t td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; }
table.t th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; }
table.t td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--accent-soft); }
table.t tr.neg td.d { color: var(--err); font-weight: 600; }
table.t tr.pos td.d { color: var(--ok); font-weight: 600; }
table.t tr.muted td { color: var(--muted); }
table.t tr.cancel td { color: var(--muted); text-decoration: line-through; }
table.t td.mono { font-family: var(--mono); }
.more { padding: 8px; text-align: center; }
.details { font-family: var(--mono); font-size: 12px; color: var(--muted); max-width: 520px; word-break: break-word; }
.hist { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; border-top: 1px solid var(--border); }
.hist li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.help { font-size: 13px; color: var(--muted); }
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 4px; border: 1px solid var(--border); border-radius: 2px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.chips label { display: flex; align-items: center; gap: 6px; }
.chips input { width: auto; min-height: 0; }

/* Druck: Etiketten 70 x 37 mm, 3 x 8 auf A4 */
.print { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > *:not(.print) { display: none !important; }
  .print { display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37.125mm; width: 210mm; }
  .lbl { display: flex; align-items: center; gap: 3mm; padding: 3mm 4mm; overflow: hidden; break-inside: avoid; }
  .lbl svg { width: 28mm; height: 28mm; flex: none; }
  .lbl .tx { font: 9pt/1.25 var(--mono); color: #000; }
  .lbl .tx b { display: block; font: 600 8pt var(--font); margin-bottom: 1mm; }
}
