/* Nomios: ruhiger Belegarbeitsplatz, kräftige Aktionen, Original stets sichtbar. */
:root {
  --bg: #f3f5f9;
  --paper: #fff;
  --ink: #17263c;
  --muted: #788396;
  --line: #e5eaf1;
  --blue: #3158d9;
  --blue-soft: #edf1ff;
  --green: #13866c;
  --red: #bc4050;
  --amber: #a16b0a;
  --shadow: 0 6px 24px #142b4e06;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  font-size: 13px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s;
}
button:hover:not(:disabled) {
  background: #f4f6fa;
}
button.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
button.primary:hover {
  background: #2546ba;
}
button.danger {
  color: var(--red);
}
button.ghost {
  background: transparent;
  border: 0;
}
button.small {
  padding: 5px 8px;
  font-size: 11px;
}
button.icon {
  padding: 7px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 21px;
  letter-spacing: -0.65px;
  font-weight: 650;
}
h2 {
  font-size: 14px;
  font-weight: 650;
}
h3 {
  font-size: 12px;
  font-weight: 650;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
}
.initial {
  padding: 80px;
  text-align: center;
}
.hidden {
  display: none !important;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.between {
  justify-content: space-between;
}
.grow {
  flex: 1;
  min-width: 0;
}
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scroll {
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #cdd4df transparent;
}
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 78px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  gap: 10px;
  z-index: 20;
}
.brand-icon {
  width: 62px;
  height: 45px;
  object-fit: cover;
}
.rail .brand-icon {
  margin-bottom: 20px;
}
.nav-item {
  width: 60px;
  height: 60px;
  border: 0;
  background: transparent;
  flex-direction: column;
  font-size: 9px;
  gap: 6px;
  color: #788396;
}
.nav-item svg {
  width: 21px;
  height: 21px;
}
.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
}
.rail-bottom {
  margin-top: auto;
}
.workspace {
  margin-left: 78px;
}
.topbar {
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.wordmark {
  font-size: 22px;
  font-weight: 730;
  letter-spacing: -1px;
}
.wordmark span {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2px;
  margin-left: 14px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #e7edf9;
  color: #3d5c91;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.user-name {
  font-size: 11px;
}
.online-dot,
.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8c98a8;
  display: inline-block;
  flex-shrink: 0;
}
.online-dot {
  background: #38a88c;
}
.page-content {
  padding: 22px 22px 88px;
}
.page-heading {
  margin-bottom: 18px;
}
.page-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(125px, 1fr)) minmax(250px, 1.8fr);
  gap: 12px;
  margin-bottom: 20px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 17px;
  box-shadow: var(--shadow);
}
.metric-top {
  color: #7d8999;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.metric-value {
  font-size: 27px;
  letter-spacing: -1px;
  font-weight: 650;
  margin: 8px 0 3px;
}
.metric-note {
  font-size: 10px;
  color: var(--muted);
}
.drop-zone {
  border: 1.5px dashed #aabbec;
  border-radius: 12px;
  background: #edf2ff80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 15px;
  cursor: pointer;
  text-align: left;
}
.drop-zone.drag {
  background: #dce6ff;
  border-color: var(--blue);
}
.drop-icon {
  color: var(--blue);
  background: #fff;
  border: 1px solid #dce4fb;
  border-radius: 10px;
  padding: 11px;
}
.drop-icon svg {
  width: 25px;
  height: 25px;
}
.drop-zone strong {
  font-size: 12px;
}
.drop-zone p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.6;
}
.columns {
  display: grid;
  grid-template-columns: minmax(240px, 0.86fr) minmax(300px, 1.04fr) minmax(
      350px,
      1.35fr
    );
  gap: 16px;
  height: calc(100vh - 306px);
  min-height: 500px;
}
.col-left {
  display: grid;
  grid-template-rows: minmax(190px, 42%) minmax(240px, 58%);
  gap: 14px;
  min-height: 0;
  padding-bottom: 14px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.panel-head .eyebrow {
  margin-bottom: 3px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 4px 6px;
  white-space: nowrap;
  font-size: 10px;
  background: #f0f3f7;
  color: #68778b;
}
.badge.Prüfen {
  background: #fff5df;
  color: #9c6b16;
}
.badge.Prüfen .led {
  background: #d8a13d;
}
.badge.Freigegeben {
  background: #e4f6ef;
  color: #17846a;
}
.badge.Freigegeben .led {
  background: #22a47c;
}
.badge.Fehler {
  background: #ffedf0;
  color: #b43e51;
}
.badge.Fehler .led {
  background: #cc5163;
}
.badge.InArbeit,
.badge.Wartend,
.badge.Upload {
  background: #eef1ff;
  color: #536fbe;
}
.badge.InArbeit .led {
  background: #5c7fe6;
  animation: pulse 1.7s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
.counter {
  font-size: 10px;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 2px 5px;
  border-radius: 4px;
}
.search-line {
  padding: 9px 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.search-line input {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 11px;
  padding: 4px;
}
.search-line svg {
  color: #91a0b2;
  width: 15px;
}
.receipt-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  border-radius: 0;
  display: block;
  text-align: left;
  padding: 13px 14px;
  position: relative;
  background: #fff;
}
.receipt-row.selected {
  background: #f1f4ff;
}
.receipt-row.selected:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--blue);
}
.receipt-row .title {
  font-weight: 650;
  font-size: 12px;
  max-width: 72%;
}
.receipt-row .sub {
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
}
.receipt-row .amount {
  font-size: 12px;
  font-weight: 650;
}
.receipt-row .badge {
  margin-top: 8px;
  font-size: 9px;
}
.empty {
  padding: 32px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
}
.receipt-paper {
  padding: 20px;
}
.paper-brand {
  font-size: 17px;
  letter-spacing: -0.4px;
  font-weight: 650;
  margin: 7px 0;
}
.paper-address {
  font-size: 11px;
  color: #798697;
  line-height: 1.6;
  white-space: pre-line;
}
.paper-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 17px 0;
}
.paper-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  margin: 9px 0;
}
.paper-line span:first-child {
  color: var(--muted);
}
.paper-line span:last-child {
  text-align: right;
}
.paper-line.total {
  font-size: 16px;
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.paper-line.total span:first-child {
  color: var(--ink);
}
.paper-position {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  font-size: 11px;
}
.note {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8f2e5;
  color: #906c25;
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.note.error {
  background: #fff0f2;
  color: #a73d50;
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
  flex-shrink: 0;
}
.tab {
  border: 0;
  background: none;
  border-radius: 0;
  font-size: 11px;
  padding: 13px 8px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}
.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 650;
}
.form-content {
  padding: 17px;
}
.form-section {
  padding-bottom: 19px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.form-section:last-child {
  border: 0;
}
.form-section h3 {
  margin-bottom: 13px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 11px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.field.full {
  grid-column: 1/-1;
}
.field > span {
  font-size: 10px;
  color: #768298;
  line-height: 1.3;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #dfe5ed;
  border-radius: 7px;
  padding: 8px 9px;
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  min-width: 0;
}
.field textarea {
  resize: vertical;
  min-height: 64px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #738ee8;
  box-shadow: 0 0 0 3px #3158d90b;
  outline: 0;
}
.field input:disabled {
  background: #f5f7fa;
}
.field input[type="checkbox"] {
  min-height: 18px;
  height: 18px;
  width: 18px;
  accent-color: var(--blue);
}
.field .derived {
  font-size: 9px;
  color: #a17931;
}
.position-card {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.position-card h3 {
  margin-bottom: 12px;
}
.position-card .fields {
  gap: 10px;
}
.review-notices {
  font-size: 11px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
  line-height: 1.6;
}
.review-notices:empty {
  display: none;
}
.review-notices .error {
  color: #b64554;
}
.form-footer {
  padding: 12px 16px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #fafbfe;
  font-size: 10px;
  color: var(--muted);
}
.pdf-panel {
  background: #e9edf3;
}
.pdf-panel .panel-head {
  background: #fff;
}
.pdf-tools {
  background: #f8f9fc;
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid #dce2eb;
  flex-wrap: wrap;
}
.pdf-tools .sep {
  height: 20px;
  border-left: 1px solid #dce2eb;
  margin: 0 2px;
}
.pdf-tools input {
  width: 38px;
  border: 1px solid #dfe4ed;
  border-radius: 5px;
  text-align: center;
  padding: 6px 2px;
  background: white;
}
.pdf-tools .active {
  background: #dce6ff;
  border-color: #b7c8fa;
  color: #3158d9;
}
.pdf-tools .zoom-label {
  width: 45px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}
.pdf-stage {
  flex: 1;
  overflow: auto;
  position: relative;
  touch-action: none;
  min-height: 0;
  cursor: grab;
  scrollbar-width: thin;
}
.pdf-stage.selecting {
  cursor: crosshair;
}
.pdf-stage.dragging {
  cursor: grabbing;
}
.pdf-surface {
  position: relative;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.pdf-surface canvas {
  display: block;
  background: white;
  box-shadow: 0 4px 18px #25364e24;
}
.pdf-selection {
  position: absolute;
  border: 1.5px solid #3158d9;
  background: #3158d925;
  pointer-events: none;
  z-index: 3;
}
.pdf-status {
  font-size: 10px;
  color: #8290a3;
  padding: 9px 12px;
  background: #f8f9fc;
  border-top: 1px solid var(--line);
}
.approval-bar {
  position: fixed;
  bottom: 20px;
  left: calc(50% + 39px);
  transform: translateX(-50%);
  border: 1px solid #dfe5f0;
  background: #fffefc;
  box-shadow: 0 8px 35px #18335825;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 12px 10px 18px;
  z-index: 25;
  max-width: calc(100vw - 110px);
}
.approval-bar .label {
  font-size: 11px;
  min-width: 140px;
}
.approval-bar .label small {
  display: block;
  font-size: 10px;
  margin-top: 3px;
}
.approval-bar button {
  white-space: nowrap;
}
.approval-bar .approve {
  background: #16834a;
  color: white;
  border: 0;
  padding: 11px 20px;
}
.approval-bar .save {
  border: 0;
  background: #f0f3fa;
}
.page-table {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.table-scroll {
  overflow: auto;
  max-height: 66vh;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
}
th {
  background: #f7f9fc;
  color: #788398;
  font-weight: 600;
  text-align: left;
  position: sticky;
  top: 0;
}
th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
tr:hover td {
  background: #fafbff;
}
.table-toolbar {
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.table-toolbar select,
.table-toolbar input {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
}
.table-footer {
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.read-only {
  font-size: 11px;
  color: var(--muted);
  padding: 12px;
  background: #f7f9fc;
}
.json-view {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  background: #f7f9fc;
  padding: 14px;
  border-radius: 8px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #fff;
}
.login-art {
  background: #101e38;
  color: #fff;
  padding: 60px 10%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-art:before {
  content: "";
  position: absolute;
  width: 650px;
  height: 650px;
  border: 1px solid #6b8ac12b;
  border-radius: 50%;
  left: -130px;
  top: 20%;
  box-shadow:
    0 0 0 70px #6b8ac107,
    0 0 0 140px #6b8ac107;
  pointer-events: none;
}
.login-art > * {
  position: relative;
}
.login-art .brand-icon {
  width: 95px;
  height: 70px;
}
.login-art h1 {
  font-size: 44px;
  letter-spacing: -1.6px;
  line-height: 1.18;
  max-width: 400px;
  margin-bottom: 20px;
}
.login-art h1 span {
  color: #8dabff;
}
.login-art p {
  color: #a5b4cf;
  line-height: 1.9;
  max-width: 330px;
}
.login-art footer {
  color: #8094b4;
  font-size: 11px;
}
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form {
  width: 340px;
}
.login-form h1 {
  font-size: 26px;
  margin: 14px 0 8px;
}
.login-form p {
  color: var(--muted);
  margin-bottom: 30px;
  font-size: 12px;
  line-height: 1.6;
}
.login-form .field {
  margin-bottom: 18px;
}
.login-form .field input {
  padding: 12px;
}
.login-form button {
  width: 100%;
  padding: 12px;
  margin-top: 7px;
}
.login-form footer {
  font-size: 10px;
  color: #939daf;
  margin-top: 30px;
  text-align: center;
}
.login-error {
  color: var(--red);
  font-size: 12px;
  min-height: 20px;
  margin-bottom: 10px;
}
#toast {
  position: fixed;
  right: 25px;
  top: 80px;
  z-index: 100;
  background: #17263c;
  color: white;
  border-radius: 10px;
  max-width: 420px;
  padding: 14px 18px;
  box-shadow: 0 6px 24px #0002;
  display: none;
  line-height: 1.6;
}
#toast.show {
  display: block;
}
#toast.error {
  background: #96334b;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(640px, 90vw);
  max-height: 85vh;
  padding: 0;
  box-shadow: 0 20px 80px #0003;
  color: var(--ink);
}
dialog::backdrop {
  background: #10203a66;
  backdrop-filter: blur(3px);
}
.modal-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body {
  padding: 22px;
  max-height: 60vh;
  overflow: auto;
}
.modal-actions {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.upload-file {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
}
.upload-file .index {
  color: var(--muted);
  font-size: 11px;
  width: 20px;
}
.progress-track {
  height: 4px;
  background: #e9edf7;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-fill {
  height: 100%;
  background: var(--blue);
  transition: width 0.15s;
}
.upload-status {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.upload-stage {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 8px 0;
}
.btn-link {
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  font-size: 11px;
}
@media (min-width: 1700px) {
  .columns {
    grid-template-columns: 0.85fr 1.05fr 1.5fr;
  }
  .page-content {
    padding-left: 28px;
    padding-right: 28px;
  }
  .fields {
    gap: 15px;
  }
  .form-content {
    padding: 22px;
  }
  .receipt-paper {
    padding: 24px;
  }
}
@media (max-width: 1150px) {
  .columns {
    grid-template-columns: minmax(210px, 0.8fr) minmax(260px, 1fr) minmax(
        300px,
        1fr
      );
    gap: 10px;
  }
  .page-content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .dashboard {
    grid-template-columns: repeat(3, 1fr);
  }
  .drop-zone {
    grid-column: 1/-1;
    padding: 9px;
  }
  .drop-icon {
    padding: 6px;
  }
  .columns {
    height: calc(100vh - 370px);
  }
  .topbar {
    padding: 0 16px;
  }
  .fields {
    gap: 10px 8px;
  }
  .form-content {
    padding: 12px;
  }
  .panel-head {
    padding: 12px;
  }
  .approval-bar .label {
    display: none;
  }
}
@media (max-width: 900px) {
  .columns {
    display: flex;
    flex-wrap: wrap;
    height: auto;
  }
  .col-left {
    display: contents;
  }
  .col-left > .panel {
    width: calc(50% - 5px);
    height: 340px;
  }
  .editor-panel,
  .pdf-panel {
    width: calc(50% - 5px);
    height: 620px;
  }
  .login-art {
    display: none;
  }
  .login-page {
    grid-template-columns: 1fr;
  }
  .wordmark span {
    display: none;
  }
}
@media (max-width: 620px) {
  .rail {
    width: 56px;
    padding: 10px 3px;
  }
  .rail .brand-icon {
    width: 48px;
    height: 38px;
  }
  .nav-item {
    width: 48px;
    font-size: 8px;
  }
  .workspace {
    margin-left: 56px;
  }
  .dashboard {
    gap: 6px;
  }
  .metric {
    padding: 11px;
  }
  .metric-value {
    font-size: 23px;
  }
  .metric-note {
    display: none;
  }
  .topbar {
    padding: 0 12px;
  }
  .user-name {
    display: none;
  }
  .page-content {
    padding: 15px 10px 90px;
  }
  .col-left > .panel,
  .editor-panel,
  .pdf-panel {
    width: 100%;
  }
  .col-left > .panel {
    height: 320px;
  }
  .approval-bar {
    left: calc(50% + 28px);
    max-width: calc(100vw - 70px);
    gap: 8px;
    padding: 8px;
  }
  .approval-bar button {
    font-size: 11px;
    padding: 10px;
  }
  .page-heading h1 {
    font-size: 19px;
  }
}

/* Eindeutige Aktionsfarben – auch im Bestätigungsdialog. */
button.delete-invoice {
  background: #c8323e;
  color: #fff;
  border: 0;
}
button.delete-invoice:hover { background: #a5232e; }
.approval-bar .approve:hover { background: #116b3c; }
@media (max-width: 760px) {
  .approval-bar { gap: 6px; flex-wrap: wrap; justify-content: center; }
}

/* 008: kompakter Header und stufenlos einstellbarer Belegarbeitsplatz. */
.topbar { height: 78px; gap: 18px; padding: 8px 16px; }
.topbar > .wordmark, .header-status { flex-shrink: 0; }
#header-dashboard { flex: 1; min-width: 0; max-width: 1000px; margin: 0 auto; }
#header-dashboard:empty { display: none; }
#header-dashboard .dashboard {
  margin: 0; gap: 8px; align-items: stretch;
  grid-template-columns: repeat(3, minmax(72px, 1fr)) minmax(160px, 1.6fr);
}
#header-dashboard .metric { padding: 6px 10px; border-radius: 8px; box-shadow: none; min-width: 0; }
#header-dashboard .metric-top { font-size: 10px; gap: 4px; }
#header-dashboard .metric-top svg { width: 13px; height: 13px; }
#header-dashboard .metric-value { font-size: 22px; line-height: 1.15; margin: 2px 0 0; }
#header-dashboard .metric-note { display: none; }
#header-dashboard .drop-zone { grid-column: auto; padding: 6px 10px; gap: 8px; border-radius: 8px; min-height: 0; }
#header-dashboard .drop-icon { padding: 4px; }
#header-dashboard .drop-zone strong { font-size: 11px; }
#header-dashboard .drop-zone p { display: none; }
.page-content { padding-top: 12px; }
.field.missing-value input,
.field.missing-value select,
.field.missing-value textarea { background: #fff5c9; border-color: #e2ca73; }
.field.missing-value input:focus,
.field.missing-value select:focus,
.field.missing-value textarea:focus { background: #fff9df; }
.panel-divider { display: none; }
@media (min-width: 901px) {
  .columns {
    position: relative;
    grid-template-columns: minmax(0, var(--col-a, .28fr)) minmax(0, var(--col-b, .33fr)) minmax(0, var(--col-c, .39fr));
    gap: 10px; height: calc(100dvh - 178px); min-height: 400px;
  }
  .col-left {
    position: relative; min-width: 0; padding-bottom: 0; gap: 10px;
    grid-template-rows: minmax(0, var(--row-a, .42fr)) minmax(0, var(--row-b, .58fr));
  }
  .panel-divider {
    display: block; position: absolute; z-index: 8;
    touch-action: none; border-radius: 5px; outline-offset: -2px;
  }
  .panel-divider.x { top: 0; bottom: 0; width: 10px; cursor: col-resize; }
  .panel-divider.y { left: 0; right: 0; height: 10px; cursor: row-resize; }
  .panel-divider::after { content: ''; position: absolute; background: #cad3df; border-radius: 4px; }
  .panel-divider.x::after { width: 3px; height: 38px; left: 3.5px; top: calc(50% - 19px); }
  .panel-divider.y::after { height: 3px; width: 38px; top: 3.5px; left: calc(50% - 19px); }
  .panel-divider:hover, .panel-divider:focus-visible { background: #dce5fa; }
  .resizing-panels, .resizing-panels * { user-select: none !important; }
}
@media (max-width: 1200px) {
  .topbar { gap: 10px; }
  .header-status .user-name { display: none; }
  #header-dashboard .metric { padding: 5px 6px; }
  #header-dashboard .metric-top svg { display: none; }
}
@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; }
  #header-dashboard { order: 3; flex-basis: 100%; max-width: none; }
  .columns { height: auto; }
}
@media (max-width: 620px) {
  #header-dashboard .dashboard { grid-template-columns: repeat(3, minmax(0,1fr)); }
  #header-dashboard .drop-zone { grid-column: 1 / -1; }
}

/* Alle Belegseiten direkt in der Werkzeugleiste auswählen. */
.pdf-tools { flex-wrap: wrap; flex-shrink: 0; }
.pdf-thumbnails { display:flex; gap:6px; flex:1 1 180px; min-width:0; overflow-x:auto; padding:3px; }
.pdf-thumbnail { position:relative; flex:0 0 48px; width:48px; height:62px; padding:2px; background:white; border:2px solid transparent; border-radius:5px; }
.pdf-thumbnail canvas { display:block; max-width:100%; max-height:100%; margin:auto; }
.pdf-thumbnail span { position:absolute; bottom:0; right:0; padding:0 3px; background:#eef0ff; color:#333; font-size:10px; border-radius:3px; }
.pdf-thumbnail.active { border-color:#6254ee; background:#eeecff; }
.pdf-thumbnail:focus-visible { outline:2px solid #6254ee; outline-offset:2px; }

/* 013: kompakte Erfassung in der gewohnten Reihenfolge. */
.editor-panel { container-type: inline-size; }
.editor-panel .tabs { flex-shrink: 0; overflow-x: auto; }
.editor-panel .tab { padding: 11px 9px; white-space: nowrap; }
.compact-invoice .form-section { padding-bottom: 12px; margin-bottom: 12px; }
.compact-invoice h3 { margin-bottom: 8px; }
.compact-row { display: grid; gap: 8px; margin-bottom: 9px; align-items: start; }
.compact-row.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.compact-row.three, .compact-row.dates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-invoice .field input, .compact-invoice .field select { padding: 6px; min-height: 32px; font-size: 12px; }
.compact-invoice .field input[data-kind="money"] { text-align: right; font-variant-numeric: tabular-nums; }
.compact-invoice .totals > :first-child input { font-weight: 750; }
.delivery-dates { display: grid; grid-template-columns: 1fr; gap: 4px; min-width: 0; }
.delivery-dates > span { font-size: 10px; color: #768298; line-height: 1.3; }
.delivery-dates .field { position: relative; }
.delivery-dates .field > span { position: absolute; top: 9px; left: 5px; font-size: 9px; }
.delivery-dates .field input { padding-left: 25px; font-size: 11px; }
.compact-invoice .derived { font-size: 9px; line-height: 1.2; }
.recipient-choice select { font-weight: 600; }
.recipient-choice.recipient-environment select { background: #91b512; border-color: #82990a; color: #172400; }
.recipient-choice.recipient-company select { background: #e6d9f6; border-color: #b99ad9; color: #452465; }
.recipient-choice.recipient-private select { background: #edf0f3; border-color: #cdd3da; color: #333c49; }
.recipient-choice option { background: white; color: #182338; }
.booking-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.booking-table th { text-align: left; font-size: 10px; color: #768298; font-weight: 500; padding: 0 4px 5px; }
.booking-table th:first-child { width: 28%; }
.booking-table th:last-child { width: 28px; }
.booking-table td { padding: 3px 3px; vertical-align: top; border-top: 1px solid var(--line); }
.booking-table .field > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.booking-table td:last-child button { padding: 4px 6px; }
.booking-add { margin-top: 6px; gap: 6px; }
.booking-add button { font-size: 10px; padding: 4px 7px; }
.payment-buttons { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:9px; }
.payment-choice { display:inline-flex; align-items:center; gap:4px; border:1px solid var(--payment-border); background:var(--payment-bg); color:var(--payment-ink); padding:5px 7px; font-size:11px; border-radius:6px; }
.payment-choice small { font-size:9px; opacity:.8; }
.payment-choice[aria-pressed="true"] { outline:2px solid var(--payment-ink); outline-offset:1px; font-weight:700; }
.payment-cash { --payment-bg:#edf6d7; --payment-border:#bbd386; --payment-ink:#3d5e0e; }
.payment-card { --payment-bg:#e9e8ff; --payment-border:#c3bdf3; --payment-ink:#4d40a2; }
.payment-bank { --payment-bg:#e2f0fd; --payment-border:#aacde9; --payment-ink:#225f91; }
.payment-debit { --payment-bg:#fff0d9; --payment-border:#e1c498; --payment-ink:#8b5a14; }
.payment-other { --payment-bg:#edf0f3; --payment-border:#cbd2dc; --payment-ink:#4e5a69; }
.ai-information h3 { margin: 4px 0 10px; }
.ai-information p { white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; line-height:1.5; margin-bottom:12px; }
.ai-information .review-notices { margin-bottom:18px; padding:10px; max-height:none; overflow:visible; }
.ai-information .review-notices div { margin-bottom:6px; }
@container (max-width: 410px) {
  .compact-row.dates { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .delivery-dates { grid-column:1/-1; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .delivery-dates > span { grid-column:1/-1; }
  .compact-row.three { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
