:root {
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  color: #142e43;
  background: #f3f6f7;
  font-size: 15px;
  --navy: #142e43;
  --teal: #00766e;
  --muted: #516878;
  --line: #d5e0e3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: var(--teal);
  color: white;
  padding: 0.72rem 1rem;
  font-weight: 650;
}
button:hover {
  filter: brightness(0.93);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.secondary,
.link {
  background: #e8f1f1;
  color: #075b56;
}
.link {
  background: transparent;
  padding: 0.42rem 0.5rem;
}
.close {
  font-size: 1.55rem;
  background: transparent;
  color: var(--navy);
  padding: 0.2rem 0.6rem;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}
aside {
  background: var(--navy);
  color: white;
  padding: 2rem 1.15rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.mark {
  width: 43px;
  height: 43px;
  border-radius: 9px;
  background: #1a837d;
  display: grid;
  place-items: center;
  letter-spacing: -0.08em;
  font-size: 1.4rem;
  font-weight: 850;
  color: white;
}
.brand b {
  display: block;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  line-height: 1;
}
.brand small {
  font-size: 0.77rem;
  letter-spacing: 0.035em;
}
.nav {
  display: grid;
  gap: 0.45rem;
  margin-top: 3rem;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-align: left;
  background: transparent;
  color: #d4e4e9;
  padding: 0.9rem;
}
.nav button.active {
  background: #245061;
  color: #fff;
  box-shadow: inset 3px 0 #48c8b7;
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.sidefoot {
  margin-top: auto;
  color: #c2d7dd;
  font-size: 0.86rem;
}
.sidefoot button {
  margin-top: 0.7rem;
  background: #204355;
  color: white;
}
.work {
  min-width: 0;
}
.topbar {
  padding: 1.05rem clamp(1.2rem, 4vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.dot {
  background: #13867a;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 100%;
}
main.content {
  max-width: 1460px;
  margin: auto;
  padding: 2.2rem clamp(1.15rem, 4vw, 4rem) 4rem;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.055em;
}
h2 {
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.55;
}
small,
.sub,
.empty {
  color: var(--muted);
}
.brand small {
  color: #d8e6e9;
}
.heading,
.cardhead,
.row,
.toolbar,
.metrichead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.heading {
  margin-bottom: 1.5rem;
  align-items: end;
}
.heading .sub {
  margin-top: 0.5rem;
}
.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.metricgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.metric,
.card,
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 1.2rem;
}
.metric {
  border-top: 3px solid #6ca9a6;
}
.metric strong {
  display: block;
  margin-top: 0.7rem;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}
.metric .icon {
  color: var(--teal);
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.stack {
  display: grid;
  gap: 1rem;
}
.cardhead {
  padding-bottom: 0.8rem;
}
.row {
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.row .desc {
  min-width: 0;
  flex: 1;
  white-space: pre-line;
}
.row .desc b,
.row small {
  display: block;
}
.row .actions {
  gap: 0.15rem;
}
.empty {
  font-size: 0.91rem;
  padding: 0.7rem 0 0.25rem;
}
.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.quick button,
.tile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  color: var(--navy);
  background: #f2f7f7;
  border: 1px solid #dfe9e8;
  font-size: 0.92rem;
  padding: 0.85rem;
}
.quick .icon {
  color: var(--teal);
}
.tag {
  display: inline-block;
  font-size: 0.8rem;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  background: #e2f0ed;
  color: #146358;
}
.warn {
  background: #fff4d9;
  color: #634d17;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 0.6rem 0;
}
.notice {
  background: #eaf3f3;
  color: #255555;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 0.6rem 0;
}
.tabs {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tabs button {
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 0.8rem;
}
.tabs .active {
  color: #075b56;
  background: #dcece9;
}
.toolbar {
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.toolbar input {
  max-width: 25rem;
}
.scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  text-align: left;
  padding: 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  color: var(--navy);
  width: min(600px, 95vw);
  max-height: 90dvh;
  box-shadow: 0 20px 70px #112c4840;
}
dialog::backdrop {
  background: #102a4099;
}
dialog form {
  padding: 1.35rem;
}
dialog header,
dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
dialog header {
  margin-bottom: 1rem;
}
dialog footer {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
  justify-content: flex-end;
}
label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
  margin: 0.75rem 0;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #9fb3bb;
  border-radius: 7px;
  padding: 0.65rem;
  background: white;
  color: var(--navy);
  min-width: 0;
}
input[type='checkbox'] {
  width: auto;
  margin-right: 0.5rem;
}
.check {
  display: block;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid #55aba3;
  outline-offset: 1px;
}
textarea {
  min-height: 5rem;
  resize: vertical;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.error {
  white-space: pre-line;
  color: #a42e1b;
}
.error:empty {
  display: none;
}
.toast {
  position: fixed;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 15;
  max-width: 90vw;
  background: var(--navy);
  color: white;
  padding: 0.7rem 1rem;
  border-radius: 9px;
  white-space: pre-line;
}
.toast:empty {
  display: none;
}
details {
  margin: 0.8rem 0;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
.lockpage {
  min-height: 100dvh;
  background: linear-gradient(115deg, #112c41 0%, #1b4755 58%, #246762 100%);
  display: grid;
  place-items: center;
  padding: 1.3rem;
}
.lockbox {
  background: #fff;
  border-radius: 18px;
  width: min(460px, 100%);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  box-shadow: 0 20px 65px #0e233f50;
}
.lockbox .brand small {
  color: var(--muted);
}
.lockbox h1 {
  font-size: 2rem;
  margin-top: 1.8rem;
}
.lockbox p {
  margin: 0.65rem 0;
}
.lockbox button {
  width: 100%;
  margin-top: 0.65rem;
}
.skip {
  position: absolute;
  left: -1000px;
}
.skip:focus {
  left: 10px;
  z-index: 12;
  background: white;
  padding: 0.6rem;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.thumb {
  max-height: 160px;
  max-width: 100%;
  object-fit: contain;
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 166px minmax(0, 1fr);
  }
  aside {
    padding: 1.4rem 0.7rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .sidefoot {
    font-size: 0.8rem;
  }
}
@media (max-width: 650px) {
  .shell {
    display: block;
  }
  aside {
    height: auto;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 0 0 env(safe-area-inset-bottom);
    background: white;
    border-top: 1px solid var(--line);
  }
  aside > .brand,
  .sidefoot {
    display: none;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin: 0;
    gap: 0;
  }
  .nav button,
  .nav button.active {
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.71rem;
    padding: 0.55rem 0.1rem;
    border-radius: 0;
    color: var(--muted);
  }
  .nav button.active {
    color: var(--teal);
    background: #eaf3f1;
    box-shadow: inset 0 2px var(--teal);
  }
  main.content {
    padding: 1.25rem 0.8rem 6rem;
  }
  .topbar {
    padding: 0.65rem 0.85rem;
  }
  .metricgrid {
    gap: 0.35rem;
  }
  .metric {
    padding: 0.6rem;
  }
  .metrichead {
    font-size: 0.75rem;
    align-items: start;
  }
  .metrichead .icon {
    display: none;
  }
  .metric strong {
    font-size: 1.16rem;
    overflow-wrap: anywhere;
  }
  .card {
    padding: 0.9rem;
  }
  .heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .pair {
    grid-template-columns: 1fr;
  }
  .quick button {
    padding: 0.7rem;
  }
  .toast {
    bottom: 5rem;
  }
  .row {
    gap: 0.5rem;
  }
  .actions button {
    font-size: 0.82rem;
  }
}

[hidden] {
  display: none !important;
}
.work,
.card,
.stack,
.grid,
.desc,
.metric,
.content,
.row,
.toolbar,
.pair,
details,
summary,
label,
.actions {
  min-width: 0;
  overflow-wrap: anywhere;
}
.toolbar,
.tabs,
.cardhead,
.actions,
.heading,
dialog footer {
  flex-wrap: wrap;
}
.card details summary {
  font-size: 1.13rem;
  color: var(--navy);
  padding: 0.25rem 0;
}
dialog {
  max-width: calc(100vw - 1rem);
  max-height: calc(100dvh - 1rem);
  overflow: auto;
  overscroll-behavior: contain;
}
dialog form,
dialog #fields {
  min-width: 0;
}
.document-view {
  background: #edf1f2;
  overflow: auto;
  max-height: 55dvh;
  padding: 0.35rem;
}
.document-view canvas,
.document-view img {
  display: block;
  height: auto;
  margin: auto;
}
@media (max-width: 480px) {
  .office .metricgrid {
    grid-template-columns: 1fr;
  }
  .office .metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .row,
  .toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .row .desc {
    flex: 1 1 11rem;
  }
  .actions button {
    max-width: 100%;
  }
  .tabs {
    display: flex;
    flex-wrap: wrap;
  }
  .pair,
  .office .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .heading .actions {
    width: 100%;
  }
  dialog {
    padding: 0.8rem;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

.document-view table {
  border-collapse: collapse;
}
.document-view td {
  border: 1px solid var(--line);
  padding: 0.3rem;
  white-space: pre-wrap;
}
.document-view article,
.document-view pre {
  background: white;
  padding: 0.7rem;
}
.extra-row {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0;
}
/* RC4: four equal job actions in the style of the former "Neuen Auftrag erstellen" button. */
.bigactions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.bigactions .big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.6rem;
  width: 100%;
  text-align: center;
}
.bigactions .big .icon {
  color: white;
}
.search {
  max-width: 34rem;
  margin: 0 0 0.8rem;
}
.row.appt {
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 1rem;
  cursor: pointer;
  border-radius: 8px;
}
.row.appt:hover {
  background: #f2f7f7;
}
.row.appt .when {
  flex: 0 0 7.6rem;
  display: grid;
  gap: 0.1rem;
}
.row.appt .when small {
  font-size: 0.8rem;
}
.row.appt .time {
  color: var(--teal);
  font-weight: 650;
  font-size: 0.9rem;
}
.row.appt.today {
  background: #e6f3f1;
  box-shadow: inset 3px 0 var(--teal);
  padding-left: 0.7rem;
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.qr {
  max-width: 340px;
  margin: 0.6rem auto;
  background: white;
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
details.fold {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0.75rem 0 0.25rem;
}
details.fold summary {
  font-size: 1.05rem;
}
.fold-actions {
  margin-bottom: 0.5rem;
}
.count {
  display: inline-block;
  min-width: 1.6rem;
  text-align: center;
  font-size: 0.78rem;
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  background: #e2f0ed;
  color: #146358;
}
fieldset.receipt {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.4rem 0.9rem 0.6rem;
  margin: 0.75rem 0;
  min-width: 0;
}
fieldset.receipt legend {
  font-weight: 650;
  font-size: 0.88rem;
  padding: 0 0.3rem;
}
.choice {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 0.4rem 0;
}
.choice .check {
  margin: 0.3rem 0;
  display: flex;
  align-items: center;
}
input[type='radio'] {
  width: auto;
  margin-right: 0.45rem;
}
@media (max-width: 900px) {
  .bigactions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .bigactions .big {
    font-size: 0.86rem;
    padding: 0.7rem 0.5rem;
    min-height: 4rem;
  }
  .row.appt .when {
    flex-basis: 6.4rem;
  }
}
/* RC5: one place for the job status and receipt status colours. */
.status-anfrage {
  --status: #2563eb;
}
.status-aktiv {
  --status: #d97706;
}
.status-abgeschlossen,
.receipt-ok {
  --status: #16a34a;
}
.receipt-open {
  --status: #d97706;
}
.badge,
button.badge {
  display: inline-block;
  background: var(--status);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  border-radius: 6px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}
button.badge {
  padding: 0.3rem 0.6rem;
}
.statuslink,
.statustab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.statuslink::before,
.statustab::before {
  content: '';
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--status);
}
.tabs .statustab.active {
  background: var(--status);
  color: #fff;
}
.tabs .statustab.active::before {
  background: #fff;
}
details.group {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0.7rem 0;
}
details.group summary small {
  display: block;
  margin-left: 1.05rem;
  font-weight: 400;
  font-size: 0.85rem;
}
details.group[open] > div {
  padding-left: 1.05rem;
}
.foldsum {
  float: right;
  margin-left: 0.6rem;
}
.sync-state {
  border-left: 4px solid #6ca9a6;
  background: #eaf3f3;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin: 0.4rem 0 0.8rem;
}
.sync-state b,
.sync-state small {
  display: block;
}
.sync-state[data-state='error'],
.sync-state[data-state='offline'] {
  border-color: #d97706;
  background: #fff4d9;
}
.center {
  text-align: center;
}
.scanner {
  position: relative;
  background: #0d2233;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
}
.scanner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scanner i {
  position: absolute;
  inset: 16%;
  border: 3px solid #fff;
  border-radius: 14px;
}
/* Pencil and bin beside the entries of a job. */
.iconbtn {
  display: inline-grid;
  place-items: center;
  min-width: 2.6rem;
  min-height: 2.6rem;
  padding: 0.3rem;
}
.row:has(.iconbtn),
.row .actions:has(.iconbtn) {
  flex-wrap: nowrap;
}
.row .actions:has(.iconbtn) {
  flex: none;
}
/* The five capture buttons of a job have the same size. */
.evenactions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.5rem;
  width: 100%;
}
.evenactions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.evenactions .icon {
  flex: none;
}
/* Services and information of a job are edited directly on the page. */
.infobox {
  display: block;
  margin-top: 0.4rem;
  background: #f2f7f7;
  border-color: #dfe9e8;
  line-height: 1.45;
}
.ziplist button {
  max-width: 100%;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
