:root {
  --bg: #f4f6f5;
  --panel: #ffffff;
  --text: #18211f;
  --muted: #66736f;
  --line: #dfe6e2;
  --primary: #0f766e;
  --primary-dark: #0b5d56;
  --accent: #d97706;
  --danger: #b42318;
  --success: #15803d;
  --shadow: 0 2px 8px rgba(20, 33, 31, 0.04);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.nav a {
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--muted);
}

.nav a:hover,
.nav a[aria-current="page"],
.tabs a.active {
  background: #e7f2ef;
  color: var(--primary-dark);
}

.user-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 42px);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-head > div > p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.page-head h1,
.auth-panel h1 {
  margin: 4px 0 6px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.alert {
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.alert-success {
  border-color: #bbf7d0;
  color: #166534;
}

.alert-error {
  border-color: #fecaca;
  color: var(--danger);
}

.offline-sync-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.offline-sync-panel strong,
.offline-sync-panel small {
  display: block;
}

.offline-sync-panel strong {
  font-size: 14px;
}

.offline-sync-panel small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.sync-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.14);
}

.offline-sync-panel.status-green {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.offline-sync-panel.status-green .sync-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.14);
}

.offline-sync-panel.status-yellow {
  border-color: #fde68a;
  background: #fffbeb;
}

.offline-sync-panel.status-red {
  border-color: #fecaca;
  background: #fff7f7;
}

.offline-sync-panel.status-red .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.offline-queue-review {
  margin: -4px 0 14px;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  box-shadow: var(--shadow);
}

.offline-queue-review > strong {
  display: block;
  margin-bottom: 8px;
}

.offline-queue-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #fecaca;
}

.offline-queue-review-row + .offline-queue-review-row {
  margin-top: 10px;
}

.offline-queue-review-row strong,
.offline-queue-review-row small {
  display: block;
}

.offline-queue-review-row small {
  margin-top: 2px;
  color: var(--danger);
}

.offline-queue-review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.panel,
.form-card,
.job-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.main-admin > .panel {
  margin-bottom: 16px;
}

.narrow {
  max-width: 760px;
  margin-bottom: 18px;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(24px, 7vw, 82px);
  min-height: calc(100vh - 180px);
}

.form-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack > :is(h2, h3, p) {
  margin: 0;
}

label {
  display: grid;
  gap: 7px;
  color: #31403c;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cad5d0;
  border-radius: 7px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field-label {
  color: #31403c;
  font-size: 14px;
  font-weight: 700;
}

.multi-select {
  position: relative;
  width: 100%;
}

.multi-select summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cad5d0;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::marker {
  content: "";
}

.multi-select summary::after {
  width: 9px;
  height: 9px;
  justify-self: end;
  border-right: 2px solid var(--primary-dark);
  border-bottom: 2px solid var(--primary-dark);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}

.multi-select[open] summary {
  border-color: var(--primary);
  border-radius: 7px 7px 0 0;
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.multi-select[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.multi-select summary span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-menu {
  display: grid;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--primary);
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.multi-select-options {
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.multi-select-option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 7px 9px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.multi-select-option:hover {
  background: #eef8f5;
}

.multi-select-option:has(input:checked) {
  background: #e3f3ef;
  color: var(--primary-dark);
}

.multi-select-option input {
  width: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: var(--primary);
}

.multi-select-done {
  width: 100%;
}

.multi-select-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
}

.multi-select-compact {
  min-width: 130px;
}

.drittgeschaeft-list .multi-select-compact {
  width: 190px;
  max-width: 100%;
}

.multi-select-compact summary {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 13px;
}

.multi-select-menu.is-floating {
  position: fixed;
  inset: auto;
  z-index: 2200;
  margin: 0;
  overflow-y: auto;
  border: 1px solid var(--primary);
  border-radius: 7px;
}

.multi-select-menu.is-floating:not(.is-visible) {
  display: none;
}

.multi-select-compact .multi-select-option {
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 32px;
  gap: 7px;
  padding: 5px 7px;
  font-size: 13px;
}

.multi-select-compact .multi-select-option input {
  width: 16px;
  min-height: 16px;
}

.go-date-list {
  display: grid;
  gap: 8px;
}

.go-date-list [data-go-date-rows] {
  display: grid;
  gap: 7px;
}

.go-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.go-date-row input {
  min-width: 0;
}

.check-row {
  display: inline-grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #31403c;
  font-weight: 800;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.date-range-picker {
  position: relative;
  width: 100%;
}

.date-range-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cad5d0;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.date-range-trigger::after {
  width: 9px;
  height: 9px;
  justify-self: end;
  border-right: 2px solid var(--primary-dark);
  border-bottom: 2px solid var(--primary-dark);
  content: "";
  transform: rotate(45deg) translateY(-2px);
}

.date-range-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-range-popover {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 40;
  display: grid;
  gap: 5px;
  width: min(286px, calc(100vw - 40px));
  padding: 8px;
  border: 1px solid #cad5d0;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 33, 31, 0.18);
}

.date-range-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 5px;
  align-items: center;
}

.date-range-head strong {
  font-size: 13px;
  text-align: center;
}

.date-range-head .button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-color: transparent;
  font-size: 19px;
}

.date-range-weekdays,
.date-range-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.date-range-weekdays span {
  padding: 3px 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.date-range-day,
.date-range-placeholder {
  min-width: 0;
  height: 30px;
}

.date-range-day {
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.date-range-day:hover,
.date-range-day.is-today {
  background: #e7f2ef;
  color: var(--primary-dark);
}

.date-range-day.is-between {
  border-radius: 0;
  background: #d8eee9;
  color: var(--primary-dark);
}

.date-range-day.is-start,
.date-range-day.is-end {
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
}

.date-range-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.date-range-actions .button {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 11px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.button:hover {
  background: var(--primary-dark);
}

.button-light {
  background: #fff;
  color: var(--primary-dark);
}

.button-light:hover {
  background: #eef7f4;
}

.button-danger {
  border-color: var(--danger);
  background: var(--danger);
}

.button-danger:hover {
  background: #8f1d14;
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 34px;
  padding: 6px 10px;
}

.button-icon {
  width: 34px;
  min-width: 34px;
  padding: 5px;
  font-size: 18px;
  line-height: 1;
}

.button-compact {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stats-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-link {
  display: block;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stat-link:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 102, 95, 0.1);
  transform: translateY(-1px);
}

.stat-link:focus-visible {
  outline: 3px solid rgba(0, 128, 119, 0.22);
  outline-offset: 2px;
}

.stat-link.is-active {
  border-color: var(--primary);
  background: #e8f7f3;
  box-shadow: inset 0 0 0 2px var(--primary), 0 8px 20px rgba(0, 102, 95, 0.12);
}

.stat-link.is-active span {
  color: var(--primary-dark);
}

.photo-archive-hint {
  display: inline-grid;
  max-width: min(520px, 100%);
  gap: 3px;
  margin: -8px 0 14px;
  padding: 9px 11px;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: 8px;
  background: #fffbeb;
  color: #713f12;
  font-size: 13px;
  line-height: 1.3;
  box-shadow: 0 10px 24px rgba(113, 63, 18, 0.08);
}

.photo-archive-hint strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.photo-archive-hint a {
  color: #854d0e;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.photo-archive-hint span {
  font-weight: 800;
}

.stat {
  padding: 17px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.stat-red {
  border-color: #fecaca;
  background: #fff7f7;
}

.city-overview {
  padding: 0;
  overflow: hidden;
}

.city-overview-head,
.city-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  gap: 22px;
}

.city-overview-head {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #edf3f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.city-row {
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.city-row:last-child {
  border-bottom: 0;
}

.city-name strong,
.city-name small {
  display: block;
}

.city-name strong {
  font-size: 16px;
}

.city-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.city-postal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.city-postal-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 5px 4px 10px;
  border: 1px solid #b7d8d3;
  border-radius: 8px;
  background: #f4fbf9;
  color: var(--primary-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
}

.city-postal-link strong {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
}

.city-postal-link:hover,
.city-postal-link:focus-visible {
  border-color: var(--primary);
  background: #e5f6f2;
}

.city-postal-link:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 2px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr)) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.special-filters {
  grid-template-columns: repeat(2, minmax(140px, 1fr)) auto auto;
  margin-bottom: 4px;
  padding: 12px;
  box-shadow: none;
}

.filter-drawer {
  margin-bottom: 18px;
}

.filter-drawer > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: max-content;
  max-width: 100%;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  list-style: none;
}

.filter-drawer > summary::-webkit-details-marker {
  display: none;
}

.filter-toggle-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.filter-drawer[open] > summary {
  margin-bottom: 0;
}

.filter-shortcuts {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.filter-shortcuts .button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 14px;
}

.filter-drawer > .filters {
  width: 100%;
  margin-top: 10px;
}

.dashboard-stats {
  grid-template-columns: repeat(4, minmax(150px, 0.72fr)) minmax(460px, 1.8fr);
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-page .button:not(.button-icon) {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 14px;
}

.dashboard-stats .stat {
  padding: 10px 12px;
}

.dashboard-stats .stat span {
  font-size: 12px;
  line-height: 1.2;
}

.dashboard-stats .stat strong {
  margin-top: 3px;
  font-size: 24px;
  line-height: 1.1;
}

.dashboard-team-stat {
  min-width: 0;
}

.team-stat-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.team-stat-heading b {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.team-stat-heading small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.team-completion-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 6px 0 0;
}

.team-completion-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 20px;
  padding: 2px 3px 2px 5px;
  border: 1px solid #dfe9e6;
  border-radius: 6px;
  background: #f6faf9;
}

.team-completion-item dt {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-completion-item dd {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin: 0;
}

.team-object-count,
.team-me-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
  padding: 1px 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 14px;
}

.team-object-count {
  min-width: 20px;
  background: #d9f7e8;
  color: var(--primary-dark);
}

.team-me-total {
  min-width: 38px;
  background: #fef3c7;
  color: #92400e;
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.bulkbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 300px) auto;
  gap: 12px;
  align-items: end;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
}

.checkline input,
td input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

.admin-table {
  min-width: 1320px;
}

.audit-table {
  min-width: 980px;
}

.audit-details {
  max-width: 420px;
  white-space: normal;
}

.activity-filter-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.activity-user-filter {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  align-items: end;
  gap: 10px;
  width: min(100%, 560px);
}

.activity-user-summary {
  display: flex;
  align-items: end;
  gap: 12px;
  text-align: right;
}

.activity-user-summary span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.activity-stats {
  margin-bottom: 14px;
}

.activity-table {
  min-width: 1120px;
}

.activity-row-green {
  background: #f6fcf8;
}

.activity-row-red {
  background: #fff7f7;
}

.activity-row-yellow {
  background: #fffdf5;
}

.activity-time {
  width: 145px;
  white-space: nowrap;
}

.activity-subject {
  min-width: 210px;
  max-width: 310px;
}

.activity-photo {
  width: 275px;
}

.activity-photo code {
  display: block;
  max-width: 270px;
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 11px;
}

.activity-delay {
  display: inline-block;
  margin-top: 5px;
  color: #6b5b13;
  font-size: 11px;
  font-weight: 900;
}

.activity-details {
  min-width: 230px;
  max-width: 390px;
  white-space: normal;
}

.activity-device {
  max-width: 360px;
  overflow-wrap: anywhere;
  font-size: 11px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: #52615d;
  background: #f7faf8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.row-done {
  background: #f3fbf6;
}

.row-failed {
  background: #fff1f1;
}

.empty-row {
  text-align: center;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}

.badge-gray {
  background: #edf1ef;
  color: #52615d;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.subline {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}


.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-bar-bottom {
  padding-bottom: 0;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.reset-details[open] {
  min-width: 190px;
}

.user-team-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.user-team-cell span {
  font-weight: 800;
}

.user-actions-cell {
  position: relative;
  width: 1%;
  min-width: 44px;
  overflow: visible;
  white-space: nowrap;
}

.users-table-wrap {
  overflow: visible;
}

.users-table {
  min-width: 760px;
}

.user-action-menu {
  position: relative;
  width: 30px;
  margin-left: auto;
}

.user-action-menu[open] {
  z-index: 100;
}

.user-action-menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-height: 30px;
  margin: 0;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: #fff;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  list-style: none;
}

.user-action-menu > summary::-webkit-details-marker {
  display: none;
}

.user-action-menu[open] > summary,
.user-action-menu > summary:hover {
  background: #eef7f4;
}

.user-action-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 101;
  display: grid;
  gap: 4px;
  width: 136px;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.user-action-menu-list form,
.user-action-menu-list .button {
  width: 100%;
}

.user-action-menu-list .button {
  justify-content: flex-start;
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
}

.user-action-delete {
  border-color: #fecaca;
  background: #fff7f7;
  color: var(--danger);
}

.user-action-delete:hover {
  border-color: var(--danger);
  background: #fee2e2;
}

.reset-details summary {
  list-style: none;
}

.reset-details summary::-webkit-details-marker {
  display: none;
}

.reset-details form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.reset-details input,
.reset-details button {
  margin-top: 8px;
}

.admin-address small {
  display: none;
}

.admin-address-me,
.admin-address-kls {
  display: none;
}

.admin-team-form .list-head {
  position: sticky;
  top: 73px;
  z-index: 4;
  padding: 8px 0;
  background: var(--panel);
}

.list-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-select-cell {
  width: 34px;
  min-width: 34px;
  padding-inline: 6px;
  text-align: center;
}

.admin-select-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  vertical-align: middle;
}

.team-grid,
.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.team-list {
  display: grid;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.team-chip span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.team-edit-form {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) 84px auto;
  gap: 8px;
  align-items: end;
}

.team-swatch {
  align-self: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.maintenance-card {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 170px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.maintenance-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.maintenance-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.maintenance-card-strong {
  border-color: #fecaca;
  background: #fff7f7;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  background: #e8eeeb;
  border-radius: 8px;
}

.special-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.special-entry span {
  color: var(--primary-dark);
  font-weight: 900;
}

.special-entry strong {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7f2ef;
  color: var(--primary-dark);
}

.special-entry small {
  display: grid;
  place-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: #f3f6f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.special-entry small.today-active {
  background: #fff2bf;
  color: #7a4f00;
}

.drittgeschaeft-create {
  margin-bottom: 14px;
}

.drittgeschaeft-create > summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 900;
}

.drittgeschaeft-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  align-items: end;
  margin-top: 14px;
}

.drittgeschaeft-list td:first-child small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.drittgeschaeft-list select {
  min-width: 145px;
}

@media (max-width: 900px) {
  .drittgeschaeft-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drittgeschaeft-form .button {
    width: 100%;
  }
}

.employee-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.employee-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.employee-head-camera {
  flex-direction: column;
  align-items: stretch;
}

.employee-head-main {
  min-width: 0;
}

.employee-open-count {
  margin: 0;
  color: var(--muted);
}

.employee-open-count strong {
  color: var(--ink);
  font-size: 22px;
}

.employee-camera-button {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-color: var(--primary);
  color: var(--primary-dark);
  font-size: 24px;
}

.general-photo-note {
  display: block;
  min-height: 16px;
  margin-top: 3px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.tabs a {
  padding: 9px 14px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}

.job-list {
  display: grid;
  gap: 12px;
}

.job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
}

.compact-jobs {
  gap: 8px;
}

.compact-jobs .job-card {
  padding: 12px;
}

.job-card.done {
  background: #f3fbf6;
}

.job-card.sync-queued,
.job-card.sync-uploading {
  border-color: #fde68a;
  background: #fffdf2;
}

.job-card.sync-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.job-card.sync-uploaded {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.job-sync-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.job-card h2 {
  margin: 10px 0 12px;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.18;
}

.job-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.job-title-row h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 0;
}

.job-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.job-card dl.job-facts-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.job-card dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.job-actions {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 150px;
}

.job-action-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}

.job-action-row form {
  margin: 0;
}

.job-action-row form .button {
  width: 100%;
}

.issue-form {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) auto auto;
  gap: 8px;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 28, 26, 0.54);
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

.confirm-dialog h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.manual-complete-dialog {
  width: min(480px, 100%);
}

.user-edit-dialog {
  width: min(520px, 100%);
}

.manual-complete-address {
  margin-top: 5px !important;
  font-weight: 800;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(17, 28, 26, 0.72);
}

.camera-modal[hidden] {
  display: none;
}

.camera-dialog {
  display: grid;
  gap: 12px;
  width: min(680px, 100%);
  max-height: calc(100vh - 28px);
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.camera-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.camera-head h2 {
  margin: 0;
  font-size: 21px;
}

.camera-close-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.camera-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border-radius: 8px;
  background: #111c1a;
}

.camera-stage video,
.camera-stage img {
  display: block;
  width: 100%;
  max-height: min(62vh, 560px);
  object-fit: contain;
}
.camera-stage [hidden] {
  display: none !important;
}

.camera-count {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 28, 26, 0.82);
  font-size: 18px;
  font-weight: 900;
}

.camera-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.camera-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.done-time {
  color: var(--success);
  font-weight: 800;
}

.empty-state {
  display: grid;
  place-items: start center;
  gap: 10px;
  padding: 54px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state h1,
.empty-state h2 {
  margin: 0;
  color: var(--text);
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-head h2 {
  margin: 0;
}

.special-admin-list,
.special-list {
  display: grid;
  gap: 10px;
}

.special-admin-item,
.special-card,
.special-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.special-card,
.special-detail {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.special-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.order-camera-button {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-color: var(--primary);
  color: var(--primary-dark);
  font-size: 24px;
}

.special-admin-item {
  display: block;
  overflow: hidden;
}

.special-admin-item.row-done {
  background: #f3fbf6;
}

.special-admin-item.row-failed {
  background: #fff1f1;
}

.special-admin-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.special-admin-summary::-webkit-details-marker {
  display: none;
}

.special-admin-summary::marker {
  content: "";
}

.special-admin-address {
  min-width: 0;
  overflow: hidden;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-team-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 220px;
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-meta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 260px;
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid #dfe6e2;
  border-radius: 999px;
  background: #f7faf8;
  color: #52615d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-team-chip.assigned {
  border-color: #b7d8d1;
  background: #e7f2ef;
  color: var(--primary-dark);
}

.special-team-chip.unassigned {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.special-edit-button {
  pointer-events: none;
}

.special-delete-button {
  width: 34px;
  min-width: 34px;
  padding-inline: 0;
}

.special-archive-button {
  min-width: 68px;
  padding-inline: 10px;
}

.special-admin-item[open] .special-admin-summary {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.special-admin-item[open] {
  overflow: visible;
}

.special-admin-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.special-edit-form {
  display: grid;
  gap: 10px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: start;
}

.special-admin-item h3,
.special-card h2,
.special-detail h2 {
  margin: 0;
  line-height: 1.2;
}

.special-admin-item p,
.special-card p,
.special-detail p {
  margin: 0;
  color: #31403c;
  line-height: 1.45;
}

.special-card h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-card small {
  color: var(--primary-dark);
  font-weight: 900;
}

.special-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.special-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.special-admin-item small {
  color: var(--muted);
  font-weight: 700;
}

.calendar-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.calendar-toolbar > div {
  min-width: 0;
  text-align: center;
}

.calendar-toolbar strong,
.calendar-toolbar span {
  display: block;
}

.calendar-toolbar strong {
  font-size: 18px;
}

.calendar-toolbar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-arrow {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 28px;
  line-height: 1;
}

.week-calendar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 510px;
  touch-action: pan-y;
}

.calendar-multiday-layer {
  position: absolute;
  top: 75px;
  right: 0;
  left: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 40px;
  gap: 4px 0;
  padding: 0 4px;
  pointer-events: none;
}

.calendar-multiday-event {
  grid-column: var(--calendar-start) / span var(--calendar-span);
  grid-row: var(--calendar-lane);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  height: 40px;
  margin: 0 2px;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid #efc0bc;
  border-left: 4px solid #c24137;
  border-radius: 5px;
  background: #fff0ef;
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
}

.calendar-multiday-event strong,
.calendar-multiday-event span {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-multiday-event span {
  color: #52615d;
  font-size: 10px;
  font-weight: 800;
}

.calendar-multiday-event.status-done {
  border-color: #a7d9b5;
  border-left-color: var(--success);
  background: #e5f7e9;
}

.calendar-multiday-event.status-failed {
  border-color: #df8c85;
  border-left-color: var(--danger);
  background: #fce4e2;
}

.calendar-multiday-event.status-archived {
  border-color: #cbd5d1;
  border-left-color: #64706c;
  background: #f2f5f3;
}

.calendar-multiday-event.status-absence {
  border-color: #c7d2fe;
  border-left-color: #4f46e5;
  background: #eef2ff;
}

.calendar-day {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fff;
}

.calendar-day:last-child {
  border-right: 0;
}

.calendar-day.is-today {
  background: #f0f9f6;
}

.calendar-day-head {
  position: sticky;
  top: 72px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 6px;
  min-height: 68px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
  background: #f7faf8;
}

.calendar-day.is-today .calendar-day-head {
  background: #dff2ed;
}

.calendar-day-head > div {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.calendar-day-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day-head strong {
  font-size: 22px;
  line-height: 1;
}

.calendar-day-head small {
  grid-column: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-head b {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 24px;
  padding: 3px 5px;
  border-radius: 999px;
  background: #e3e9e6;
  color: #40504b;
  font-size: 11px;
  text-align: center;
}

.calendar-day.is-today .calendar-day-head b {
  background: var(--primary);
  color: #fff;
}

.calendar-events {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: calc(7px + var(--calendar-multiday-lanes, 0) * 44px) 7px 7px;
}

.calendar-event {
  display: grid;
  gap: 2px;
  min-width: 0;
  width: 100%;
  height: 52px;
  padding: 7px 8px;
  overflow: hidden;
  border: 1px solid #efc0bc;
  border-left: 4px solid #c24137;
  border-radius: 6px;
  background: #fff4f3;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.calendar-event:hover {
  border-color: #d9867f;
  background: #ffe9e7;
}

.calendar-event strong,
.calendar-event span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event strong {
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
}

.calendar-event span {
  display: block;
  color: #40504b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.calendar-event.status-done {
  border-color: #a7d9b5;
  border-left-color: var(--success);
  background: #effaf2;
}

.calendar-event.status-failed {
  border-color: #df8c85;
  border-left-color: var(--danger);
  background: #fce4e2;
}

.calendar-event.status-archived {
  border-color: #cbd5d1;
  border-left-color: #64706c;
  background: #f2f5f3;
}

.calendar-event.status-absence {
  border-color: #c7d2fe;
  border-left-color: #4f46e5;
  background: #eef2ff;
}

.calendar-free {
  min-height: 52px;
  padding: 16px 6px;
  border: 1px dashed #cad5d0;
  border-radius: 6px;
  color: #84908c;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #f7faf8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.calendar-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--primary);
}

.calendar-legend .legend-done {
  background: var(--success);
}

.calendar-legend .legend-failed {
  background: var(--danger);
}

.calendar-legend .legend-archived {
  background: #64706c;
}

.calendar-legend .legend-open {
  background: #c24137;
}

.calendar-legend .legend-absence {
  background: #4f46e5;
}

.absence-summary-panel {
  margin-top: 16px;
}

.absence-summary-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.absence-summary-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(90px, 0.8fr) repeat(4, minmax(92px, auto));
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.absence-summary-row strong,
.absence-summary-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.absence-summary-row small {
  color: var(--muted);
  font-weight: 800;
}

.absence-summary-row span {
  display: inline-flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 5px 7px;
  border-radius: 6px;
  background: #f3f7f5;
  color: #40504b;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.absence-summary-row b {
  color: var(--text);
}

.calendar-detail-dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.calendar-detail-head {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.calendar-detail-head > div {
  min-width: 0;
}

.calendar-detail-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.calendar-detail-head h2 {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.calendar-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 0;
}

.calendar-detail-list div {
  min-width: 0;
}

.calendar-detail-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-detail-list dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.calendar-detail-description {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.calendar-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.calendar-detail-actions form {
  display: contents;
}

.calendar-month-dialog {
  width: min(520px, 100%);
}

.calendar-month-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-month-head h2 {
  margin: 0;
  text-align: center;
}

.calendar-month-weekdays,
.calendar-month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-month-weekdays {
  margin-bottom: 6px;
}

.calendar-month-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.calendar-month-day,
.calendar-month-placeholder {
  height: 42px;
}

.calendar-month-day {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.calendar-month-day:hover {
  border-color: var(--primary);
  background: #e7f2ef;
  color: var(--primary-dark);
}

.status-code {
  color: var(--primary);
  font-size: 58px;
  font-weight: 900;
}

.code-line {
  margin-top: 8px;
  padding: 11px 12px;
  overflow-x: auto;
  border-radius: 7px;
  background: #111c1a;
  color: #eafff8;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.hidden {
  display: none;
}

@media (max-width: 1100px) {
  .week-calendar {
    grid-template-columns: repeat(7, minmax(95px, 1fr));
    overflow-x: auto;
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .absence-summary-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .city-overview-head {
    display: none;
  }

  .city-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .city-postal-list {
    gap: 6px;
  }

  .city-postal-link {
    min-height: 32px;
  }

  .calendar-page-head {
    align-items: stretch;
  }

  .calendar-page-head .head-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-page-head .button {
    width: 100%;
  }

  .week-calendar {
    grid-template-columns: 1fr;
    min-height: 0;
    overflow: visible;
  }

  .calendar-multiday-layer {
    position: static;
    grid-column: 1;
    grid-template-columns: 1fr;
    grid-auto-rows: 40px;
    gap: 5px;
    padding: 7px;
    border-bottom: 1px solid var(--line);
  }

  .calendar-multiday-event {
    grid-column: 1 !important;
    grid-row: auto !important;
    margin: 0;
  }

  .calendar-day {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .calendar-day:last-child {
    border-bottom: 0;
  }

  .calendar-day-head {
    position: static;
    min-height: 58px;
  }

  .calendar-events {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 7px;
  }

  .calendar-detail-list {
    grid-template-columns: 1fr;
  }

  .absence-summary-row {
    grid-template-columns: 1fr;
  }

  .calendar-detail-description {
    grid-column: 1;
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 8px 10px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .brand strong {
    display: block;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small {
    display: none;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .tabs {
    width: 100%;
  }

  .user-menu {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    justify-self: end;
    gap: 8px;
    font-size: 13px;
  }

  .user-menu span {
    display: none;
  }

  .user-menu .button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .nav a {
    min-height: 34px;
    padding: 7px 4px;
    overflow: hidden;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabs a {
    flex: 1;
    text-align: center;
  }

  .main {
    padding: 12px 8px 24px;
  }

  .offline-sync-panel {
    grid-template-columns: auto minmax(0, 1fr);
    margin-bottom: 8px;
    padding: 8px 9px;
  }

  .offline-sync-panel .button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .offline-queue-review-row {
    grid-template-columns: 1fr;
  }

  .offline-queue-review-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .offline-queue-review-actions .button {
    width: 100%;
  }

  .head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .stats-grid-four,
  .stats-grid-five,
  .stats-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat {
    padding: 11px;
  }

  .stat strong {
    font-size: 24px;
  }

  .filter-drawer > summary {
    justify-content: center;
    width: 100%;
  }

  .filter-shortcuts {
    margin: 0;
  }

  .filter-shortcuts .button {
    flex: 0 1 auto;
  }

  .employee-head {
    gap: 8px;
    margin-bottom: 8px;
  }

  .employee-head .eyebrow {
    margin-bottom: 5px;
  }

  .employee-open-count {
    font-size: 14px;
  }

  .employee-title-row {
    justify-content: space-between;
    gap: 8px;
  }

  .employee-camera-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    font-size: 21px;
  }

  .special-entry {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
  }

  .employee-entry-actions {
    width: 100%;
    justify-content: stretch;
  }

  .special-admin-summary {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
    padding: 9px 10px;
  }

  .special-meta-chip {
    grid-column: 1 / 2;
    justify-self: start;
    max-width: 100%;
    min-height: 24px;
    padding: 3px 8px;
    font-size: 11px;
  }

  .special-team-chip {
    grid-column: 1 / 2;
    justify-self: start;
    max-width: 100%;
    min-height: 24px;
    padding: 3px 8px;
    font-size: 11px;
  }

  .special-edit-button {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .special-delete-button {
    grid-column: 3;
    grid-row: 1 / span 3;
    width: 32px;
    min-width: 32px;
  }

  .special-archive-button {
    grid-column: 3;
    grid-row: 1 / span 3;
    min-width: 64px;
    padding-inline: 8px;
  }

  .auth-panel,
  .split,
  .bulkbar,
  .filters,
  .maintenance-grid,
  .admin-team-form .list-head {
    grid-template-columns: 1fr;
  }

  .admin-team-form .list-head {
    position: static;
    gap: 8px;
  }

  .table-wrap {
    overflow: visible;
  }

  .activity-filter-panel {
    display: grid;
    align-items: stretch;
  }

  .activity-user-filter {
    grid-template-columns: 1fr;
  }

  .activity-user-summary {
    display: grid;
    justify-items: start;
    text-align: left;
  }

  .activity-table-wrap {
    overflow-x: auto;
  }

  .admin-table {
    min-width: 0;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    margin-bottom: 6px;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
  }

  .admin-table tr.row-done {
    background: #f3fbf6;
  }

  .admin-table tr.row-failed {
    background: #fff1f1;
  }

  .admin-table td {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 6px;
    padding: 3px 0;
    border-bottom: 0;
    font-size: 12px;
  }

  .admin-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .admin-table .admin-mobile-hidden,
  .admin-table .admin-mobile-detail,
  .admin-table .admin-me-cell,
  .admin-table .admin-mobile-note,
  .admin-table .admin-empty-cell {
    display: none;
  }

  .admin-address-me,
  .admin-address-kls {
    display: inline-block;
    width: auto;
    max-width: 94px;
    margin-left: 6px;
    padding: 3px 7px;
    overflow: hidden;
    vertical-align: middle;
    border-radius: 999px;
    background: #edf1ef;
    color: #52615d;
    font-size: 11px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-table .admin-address {
    grid-column: 1 / -1;
    display: block;
    padding: 0 0 2px;
    padding-right: 58px;
    overflow: hidden;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-table .admin-address::before {
    display: none;
  }

  .admin-address small {
    display: inline;
    margin: 0 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .admin-table td[data-label="Team"] {
    grid-column: 1 / 2;
    grid-row: 2;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
  }

  .admin-table:not(.drittgeschaeft-table) td[data-label="Status"] {
    position: absolute;
    top: 7px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 0;
  }

  .admin-table td[data-label="Status"]::before,
  .admin-table .admin-route-cell::before {
    display: none;
  }

  .admin-table .admin-route-cell {
    grid-column: 2 / 3;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    width: auto;
    padding: 0;
  }

  .admin-table .admin-reset-cell {
    grid-column: 1 / -1;
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .admin-table .admin-manual-cell {
    grid-column: 2 / 3;
    grid-row: 3;
    align-self: center;
    justify-self: end;
    width: auto;
    padding: 0;
  }

  .admin-table .admin-manual-cell::before {
    display: none;
  }

  .drittgeschaeft-table td[data-label="Status"] {
    grid-column: 1 / -1;
    display: block;
  }

  .admin-table:not(.drittgeschaeft-table) .subline {
    display: none;
  }

  .admin-table select,
  .admin-table .button {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .job-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .job-card dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .job-card dt {
    font-size: 10px;
  }

  .job-card dd {
    font-size: 13px;
  }

  .job-title-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
  }

  .job-title-row h2 {
    font-size: 18px;
  }

  .badge {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 11px;
  }

  .job-actions {
    min-width: 0;
    gap: 7px;
  }

  .job-action-row {
    gap: 6px;
  }

  .issue-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .issue-form[hidden] {
    display: none !important;
  }

  .button-compact,
  .issue-form .button {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .head-actions,
  .head-actions .button {
    width: 100%;
  }

  .team-row,
  .team-edit-form {
    grid-template-columns: 1fr;
  }

  .team-swatch {
    display: none;
  }

  .confirm-dialog,
  .camera-dialog {
    padding: 18px;
  }

  .camera-modal {
    padding: 8px;
  }

  .camera-dialog {
    align-self: end;
    max-height: calc(100vh - 16px);
  }

  .camera-actions {
    grid-template-columns: 1fr;
  }

  .list-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .list-head {
    align-items: stretch;
  }



  .pagination-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px 0;
    font-size: 12px;
  }

  .pagination {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pagination .button {
    width: 100%;
  }
  .compact-jobs {
    gap: 5px;
  }

  .compact-jobs .job-card {
    padding: 8px 9px;
  }

  .job-card h2 {
    margin: 0;
  }

  .job-card dl {
    margin-top: 6px;
  }

  .job-action-row {
    gap: 4px;
  }

  .job-action-row .button {
    min-height: 32px;
    padding: 5px 6px;
    font-size: 12px;
  }

  .admin-table tr {
    margin-bottom: 4px;
    padding: 6px 7px;
  }

  .admin-table td {
    gap: 4px;
    padding: 2px 0;
    font-size: 11px;
  }

  .admin-table .admin-address {
    font-size: 13px;
    line-height: 1.15;
  }

  .admin-address small {
    font-size: 11px;
  }
  .job-card {
    gap: 5px;
  }

  .job-title-row {
    gap: 5px;
  }

  .job-title-row h2 {
    font-size: 15px;
    line-height: 1.12;
  }

  .job-card dl {
    gap: 4px;
  }

  .job-card dt {
    font-size: 9px;
  }

  .job-card dd {
    font-size: 12px;
  }

  .badge {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .compact-jobs {
    gap: 4px;
  }

  .compact-jobs .job-card {
    gap: 4px;
    padding: 6px 7px;
  }

  .compact-jobs .job-title-row {
    gap: 4px;
  }

  .compact-jobs .job-title-row h2 {
    font-size: 14px;
    line-height: 1.1;
  }

  .compact-jobs .badge {
    min-height: 18px;
    padding: 2px 5px;
    font-size: 9px;
  }

  .compact-jobs .job-card dl {
    gap: 3px;
    margin-top: 4px;
  }

  .compact-jobs .job-card dt {
    font-size: 8px;
  }

  .compact-jobs .job-card dd {
    margin-top: 1px;
    font-size: 11px;
  }

  .compact-jobs .job-actions {
    gap: 4px;
  }

  .compact-jobs .job-action-row {
    gap: 4px;
  }

  .compact-jobs .job-action-row .button,
  .compact-jobs .button-compact {
    min-height: 30px;
    padding: 4px 5px;
    font-size: 11px;
  }

  .special-card,
  .special-detail {
    padding: 12px;
  }
}
