:root {
  --ath-red: #e30613;
  --ath-red-dark: #b8000a;
  --ath-red-soft: rgba(227, 6, 19, .08);

  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;

  --text: #18212b;
  --muted: #667085;
  --line: #e5e8ee;

  --green: #22a06b;
  --blue: #2672c9;
  --orange: #d98b00;
  --danger: #e30613;

  --radius: 16px;
  --shadow: 0 12px 34px rgba(16, 24, 40, .07);
  --shadow-soft: 0 4px 14px rgba(16, 24, 40, .05);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fff 0, #f4f6f8 240px, #f4f6f8 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
.btn {
  font-family: inherit;
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: .16s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(16, 24, 40, .08);
}

.btn.primary,
.primary {
  background: var(--ath-red) !important;
  color: #fff !important;
  border-color: var(--ath-red) !important;
  font-weight: 900;
}

.btn.primary:hover,
.primary:hover {
  background: var(--ath-red-dark) !important;
}

.btn.secondary,
.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

/* Layout */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: rgba(255, 255, 255, .96);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
  box-shadow: 8px 0 26px rgba(16, 24, 40, .04);
  backdrop-filter: blur(14px);
}

.brand {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: 72px;
  height: auto;
}

.brand strong {
  font-size: 16px;
  letter-spacing: -.02em;
}

nav {
  padding: 14px 10px;
  display: grid;
  gap: 5px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #344054;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  transition: .16s ease;
}

nav a:hover {
  background: var(--ath-red-soft);
  color: var(--ath-red);
}

nav a.active {
  background: linear-gradient(90deg, var(--ath-red-soft), rgba(227, 6, 19, .025));
  color: var(--ath-red);
  box-shadow: inset 3px 0 0 var(--ath-red);
}

nav a.disabled {
  opacity: .42;
  cursor: not-allowed;
  pointer-events: none;
}

body.viewer-self-service .sidebar nav a.viewer-hidden,
.sidebar nav a[hidden] {
  display: none !important;
}

/* Mitarbeiter */

.employee-directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 0 28px 28px;
}

.employee-directory-loading {
  grid-column: 1 / -1;
}

.employee-directory-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.employee-directory-card:hover {
  transform: translateY(-3px);
  border-color: rgba(227, 6, 19, .28);
  box-shadow: var(--shadow);
}

.employee-directory-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
}

.employee-directory-head img,
.employee-directory-avatar {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.employee-directory-avatar {
  display: grid;
  place-items: center;
  background: var(--ath-red-soft);
  color: var(--ath-red);
  font-weight: 900;
  font-size: 17px;
}

.employee-directory-name {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.employee-directory-name small,
.employee-directory-contact small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.employee-directory-name strong {
  font-size: 18px;
  line-height: 1.2;
}

.employee-directory-contact {
  display: grid;
  gap: 12px;
  padding: 0 20px 18px;
}

.employee-directory-contact > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.employee-directory-contact b {
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-directory-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ath-red);
}

.employee-directory-action b {
  font-size: 12px;
  font-weight: 900;
}

.employee-directory-action i {
  font-size: 20px;
  font-style: normal;
  transition: transform .16s ease;
}

.employee-directory-card:hover .employee-directory-action i {
  transform: translateX(4px);
}

.employee-dashboard-link {
  color: var(--text);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(227, 6, 19, .35);
  text-underline-offset: 3px;
}

.employee-dashboard-link:hover {
  color: var(--ath-red);
  text-decoration-color: var(--ath-red);
}

.employee-dashboard-status {
  margin: 0 28px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.employee-dashboard-status.error {
  border-color: #ffccd0;
  background: #fff5f5;
  color: var(--danger);
}

.employee-detail-kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(135px, 1fr));
  gap: 10px;
  padding: 0 28px 12px;
}

.employee-detail-kpi {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.employee-detail-kpi span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.employee-detail-kpi strong {
  font-size: 18px;
}

.employee-detail-kpi.positive strong {
  color: var(--green);
}

.employee-detail-kpi.neutral strong {
  color: var(--orange);
}

.employee-detail-kpi.negative strong {
  color: var(--danger);
}

.employee-detail-charts {
  display: grid;
  grid-template-columns: minmax(500px, 2.2fr) repeat(3, minmax(190px, 1fr));
  gap: 10px;
  padding: 0 28px 12px;
}

.employee-detail-charts .panel {
  min-width: 0;
  padding: 14px;
}

.employee-chart-selector {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.employee-chart-selector:hover,
.employee-chart-selector:focus-visible {
  border-color: var(--blue);
  outline: none;
  transform: translateY(-1px);
}

.employee-chart-selector.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(38, 114, 201, .12), var(--shadow-soft);
}

.employee-detail-charts h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.employee-chart-wrap {
  height: 260px;
}

.employee-donut-wrap {
  height: 155px;
}

.employee-chart-legend {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.employee-chart-legend span {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.employee-chart-legend i {
  width: 9px;
  height: 9px;
}

.employee-chart-legend b {
  color: var(--text);
}

.employee-orders-panel {
  margin: 0 28px 28px;
  padding: 0;
  overflow: hidden;
}

.employee-orders-panel .panel-head {
  padding: 14px 16px;
}

.employee-orders-table {
  min-width: 1260px;
}

.employee-multi-day-table {
  min-width: 900px;
}

.employee-orders-table td,
.employee-orders-table th {
  padding: 10px 12px;
  font-size: 11px;
}

.employee-orders-table td:first-child a {
  color: var(--blue);
  font-weight: 900;
}

.employee-distance-warning td {
  background: rgba(227, 6, 19, .06);
}

.employee-distance-warning td:first-child {
  box-shadow: inset 4px 0 0 var(--danger);
}

.employee-distance-badge {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(227, 6, 19, .12);
  color: var(--danger);
  font-weight: 800;
  white-space: nowrap;
}

.employee-orders-empty {
  padding: 28px !important;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1500px) {
  .employee-directory {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .employee-detail-kpis {
    grid-template-columns: repeat(4, 1fr);
  }

  .employee-detail-charts {
    grid-template-columns: repeat(3, 1fr);
  }

  .employee-profit-chart {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1150px) {
  .employee-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .employee-detail-kpis,
  .employee-detail-charts {
    grid-template-columns: 1fr;
  }

  .employee-profit-chart {
    grid-column: auto;
  }

  .employee-directory {
    grid-template-columns: 1fr;
  }
}

/* Einstellungen */

.settings-access-message {
  margin: 0 28px 18px;
}

.settings-access-message.denied {
  padding: 16px 18px;
  border: 1px solid #ffd891;
  border-radius: 12px;
  background: #fff8e6;
  color: #8a5700;
  font-weight: 800;
}

.settings-status {
  display: none;
  margin: 0 28px 18px;
  padding: 11px 14px;
  border: 1px solid #bde8cb;
  border-radius: 10px;
  background: #e8f8ee;
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
}

.settings-status.visible {
  display: block;
}

.settings-status.error {
  border-color: #ffc4c8;
  background: #fff0f0;
  color: var(--danger);
}

.settings-layout {
  display: grid;
  gap: 18px;
}

.settings-view {
  overflow: hidden;
}

.settings-track {
  display: flex;
  width: 200%;
  align-items: flex-start;
  transition: transform .42s cubic-bezier(.22, .8, .25, 1);
}

.settings-track > section {
  flex: 0 0 50%;
  min-width: 0;
}

.settings-view.show-detail .settings-track {
  transform: translateX(-50%);
}

.settings-cost-panel {
  max-width: 720px;
}

.settings-cost-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.settings-cost-form label,
.settings-employee-form label,
.settings-holiday-toolbar label,
.settings-holiday-form label {
  display: grid;
  gap: 7px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.settings-currency-input {
  display: flex;
  align-items: center;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.settings-currency-input input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 0;
  font: inherit;
}

.settings-currency-input span {
  padding: 0 14px;
  color: var(--muted);
  font-weight: 900;
}

.settings-osrm-monitor {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.settings-osrm-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #98a2b3;
  box-shadow: 0 0 0 5px rgba(152, 162, 179, .14);
}

.settings-osrm-monitor.online .settings-osrm-dot {
  background: #22a06b;
  box-shadow: 0 0 0 5px rgba(34, 160, 107, .14);
}

.settings-osrm-monitor.offline .settings-osrm-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(227, 6, 19, .12);
}

.settings-osrm-monitor.checking .settings-osrm-dot {
  background: #d98b00;
  box-shadow: 0 0 0 5px rgba(217, 139, 0, .14);
}

.settings-osrm-monitor strong,
.settings-osrm-monitor small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-osrm-monitor strong {
  font-size: 13px;
  font-weight: 950;
}

.settings-osrm-monitor small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.settings-employee-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.settings-employee-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 13px;
  min-height: 88px;
  padding: 13px;
  text-align: left;
}

.settings-employee-card.inactive {
  opacity: .48;
  filter: grayscale(.75);
  cursor: not-allowed;
}

.settings-employee-card.inactive:hover {
  transform: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.settings-employee-card img,
.settings-employee-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.settings-employee-avatar {
  display: grid;
  place-items: center;
  background: var(--ath-red-soft);
  color: var(--ath-red);
  font-weight: 950;
}

.settings-employee-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-employee-main strong,
.settings-employee-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-employee-main small {
  color: var(--muted);
  font-size: 11px;
}

.settings-edit-label {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.settings-empty {
  color: var(--muted);
}

.settings-dialog-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(16, 24, 40, .44);
}

.settings-dialog-backdrop.open {
  display: block;
}

.settings-dialog {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 81;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .22);
  transform: translate(-50%, -50%);
  overflow-y: auto;
}

.settings-dialog.open {
  display: block;
}

.settings-confirm-dialog {
  width: min(520px, calc(100vw - 32px));
}

.settings-confirm-dialog p {
  color: #475467;
  line-height: 1.55;
}

.settings-dialog .panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-dialog .panel-head h2 {
  margin-top: 3px;
}

.settings-employee-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.settings-employee-form input,
.settings-employee-form select,
.settings-holiday-toolbar select,
.settings-holiday-toolbar input,
.settings-holiday-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.settings-holidays-page {
  display: grid;
  gap: 18px;
}

.settings-holidays-page .panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-holiday-toolbar,
.settings-holiday-form {
  display: grid;
  align-items: end;
  gap: 14px;
}

.settings-holiday-toolbar {
  grid-template-columns: minmax(220px, 320px) minmax(150px, 180px);
}

.settings-holiday-form {
  grid-template-columns: minmax(180px, 220px) minmax(240px, 1fr) auto;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-holiday-table-wrap {
  margin-top: 16px;
}

.settings-holiday-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.settings-holiday-table th,
.settings-holiday-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.settings-holiday-table th {
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-holiday-table td:last-child {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.settings-holiday-date {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}

.settings-holiday-date strong {
  color: var(--text);
  font-weight: 950;
  white-space: nowrap;
}

.settings-holiday-date span {
  color: #475467;
  font-weight: 800;
}

.settings-holiday-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  font-size: 11px;
  font-weight: 900;
}

.settings-holiday-badge.custom {
  background: #e8f8ee;
  color: #15803d;
}

button.compact {
  min-height: 32px;
  padding: 0 10px;
}

.settings-image-field,
.settings-checkbox-field,
.settings-form-actions {
  grid-column: 1 / -1;
}

.settings-checkbox-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.settings-checkbox-field input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.settings-checkbox-field small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 600;
}

.settings-image-field input {
  height: auto;
  padding: 10px;
}

.settings-image-field small {
  color: var(--muted);
  font-weight: 500;
}

.settings-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.danger-button {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

@media (max-width: 850px) {
  .settings-access-message {
    margin-left: 16px;
    margin-right: 16px;
  }

  .settings-status {
    margin-left: 16px;
    margin-right: 16px;
  }

  .settings-cost-form {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-currency-input {
    width: 100%;
  }

  .settings-employee-form {
    grid-template-columns: 1fr;
  }

  .settings-holiday-toolbar,
  .settings-holiday-form {
    grid-template-columns: 1fr;
  }

  .settings-image-field,
  .settings-form-actions {
    grid-column: auto;
  }
}

.main {
  margin-left: 220px;
  min-height: 100vh;
}

.topbar {
  height: 78px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.menu {
  height: 42px;
  width: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  font-size: 22px;
  color: var(--text);
}

.env {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.02em;
}

.auth-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  font-size: 13px;
  color: #475467;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

/* Page Head */

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 28px 28px 16px;
}

.page-head h1 {
  margin: 0 0 5px;
  font-size: 28px;
  letter-spacing: -.03em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.filters label {
  font-size: 12px;
  color: #475467;
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.filters select,
.filters button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
  color: var(--text);
  font-weight: 700;
}

/* KPI */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 28px;
  margin: 24px 0;
}

.kpi-card,
.kpi {
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .04);
}

.kpi-card span,
.kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.kpi-card strong,
.kpi strong {
  display: block;
  font-size: 28px;
  color: #111827;
  letter-spacing: -.03em;
}

.kpi-card small,
.kpi small {
  color: var(--muted);
}

.kpi-card.primary {
  background: var(--ath-red);
  border-color: var(--ath-red);
  color: #fff;
}

.kpi-card.primary span,
.kpi-card.primary strong,
.kpi-card.primary small {
  color: #fff;
}

.kpi-card.success strong {
  color: var(--ath-red);
}

/* Employee Cards */

.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding: 0 28px 28px;
  margin-top: 24px;
}

.employee-card {
  display: block;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .04);
  overflow: hidden;
}

.employee-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #eef2f7;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--ath-red);
}

.employee-card-head strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.employee-card-head span {
  color: var(--muted);
  font-size: 13px;
}

.employee-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.employee-metrics div {
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}

.employee-metrics span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 4px;
}

.employee-metrics strong {
  display: block;
  font-size: 15px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-delta {
  margin: 10px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.employee-delta strong {
  color: var(--green);
}

.employee-delta.bad strong {
  color: var(--danger);
}

.employee-orders-btn {
  width: 100%;
}

/* Panels / Tables */

.panel,
.orders-panel {
  margin: 0 28px 28px;
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .04);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0 0 4px;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.service-order-view {
  overflow: hidden;
}

.service-order-track {
  display: flex;
  width: 200%;
  align-items: flex-start;
  transition: transform .42s cubic-bezier(.22, .8, .25, 1);
}

.service-order-track > .panel {
  flex: 0 0 calc(50% - 56px);
}

.service-order-view.show-detail .service-order-track {
  transform: translateX(-50%);
}

.service-order-detail {
  min-height: 420px;
}

.service-detail-head {
  display: grid;
  grid-template-columns: auto minmax(110px, auto) 1fr;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.service-detail-head span,
.service-summary-item span,
.service-detail-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.service-detail-head h2 {
  margin: 3px 0 0;
}

.service-detail-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.service-summary-item {
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.service-summary-item strong {
  display: inline-flex;
  margin-top: 7px;
  font-size: 16px;
}

.service-summary-item .order-type,
.service-summary-item .status-badge,
.service-summary-item .invoice-badge {
  font-size: 12px;
}

.service-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.service-detail-field {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.service-detail-field strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.service-time-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.service-time-section h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.service-time-table tbody tr:nth-child(even) td {
  background: var(--surface-soft);
}

.time-type-badge {
  display: inline-flex;
  min-width: 76px;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(38, 114, 201, .1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.filters.detail-disabled {
  opacity: .52;
}

.filters.detail-disabled::before {
  content: "In der Detailansicht nicht verfügbar";
  align-self: flex-end;
  margin-right: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.filters.detail-disabled select,
.filters.detail-disabled button {
  cursor: not-allowed;
}

.service-action-column {
  width: 48px;
  padding-left: 6px;
  padding-right: 6px;
  text-align: center;
}

.service-inspect {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  color: var(--ath-red);
}

.service-inspect svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.service-order-row td {
  transition: background-color .18s ease, box-shadow .18s ease;
}

.service-order-row:has(.service-inspect:hover) td {
  background: #fff2f3;
  box-shadow: inset 0 1px 0 rgba(227, 6, 19, .08),
    inset 0 -1px 0 rgba(227, 6, 19, .08);
}

.service-order-row:has(.service-inspect:hover) td:first-child {
  box-shadow: inset 4px 0 0 var(--ath-red),
    inset 0 1px 0 rgba(227, 6, 19, .08),
    inset 0 -1px 0 rgba(227, 6, 19, .08);
}

.service-number-link {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  box-shadow: none;
}

.service-number-link:hover {
  color: var(--ath-red);
  transform: none;
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 900;
  background: #f8fafc;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.table-sort span {
  min-width: 10px;
  color: #98a2b3;
  font-size: 10px;
}

.table-sort.active,
.table-sort.active span {
  color: var(--ath-red);
}

.table-filter-row th {
  padding: 7px 6px;
  background: #fff;
  overflow: visible;
}

.column-filter {
  position: relative;
}

.column-filter-toggle {
  width: 100%;
  min-width: 105px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.column-filter-toggle::after {
  content: "▾";
  float: right;
  color: #667085;
}

.column-filter-toggle.active {
  color: var(--ath-red);
  border-color: var(--ath-red);
  background: var(--ath-red-soft);
}

.column-filter-toggle:focus {
  outline: 2px solid rgba(227, 6, 19, .15);
  border-color: var(--ath-red);
}

.column-filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  width: max-content;
  min-width: 210px;
  max-width: 320px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(16, 24, 40, .16);
}

.column-filter.open .column-filter-menu {
  display: block;
}

.column-filter-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.column-filter-menu label:hover {
  background: #f8fafc;
}

.column-filter-menu input {
  margin: 0;
}

.column-filter-all {
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.column-filter-options {
  max-height: 260px;
  overflow-y: auto;
}

.column-filter-options span {
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody tr:hover {
  background: rgba(227, 6, 19, .025);
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(227, 6, 19, .08);
  color: var(--ath-red);
  font-weight: 800;
}

/* Empty Pages */

.empty-state {
  text-align: center;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.empty-state h2 {
  font-size: 24px;
  color: var(--text);
  margin: 12px 0 8px;
}

.empty-icon {
  font-size: 54px;
  line-height: 1;
}

/* Calendar */

.calendar-page {
  padding: 28px;
}

.calendar-page::before,
.calendar-page::after {
  display: none !important;
}

.calendar-page .toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-soft);
}

.calendar-page .title {
  font-weight: 950;
  margin-left: 16px;
  font-size: 18px;
  letter-spacing: -.02em;
}

.calendar-view-toggle {
  margin-left: auto;
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.calendar-view-toggle button {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.calendar-view-toggle button.active {
  color: var(--ath-red);
  box-shadow: inset 0 -2px 0 var(--ath-red);
}

.calendar-page #status {
  padding: 10px 16px !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  background: #fff;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.calendar-page .board-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  box-shadow: var(--shadow);
  overflow: auto;
}

/* Calendar Week */

.week-board {
  min-width: 1100px;
}

.week-grid {
  display: grid;
  grid-template-columns: 230px repeat(7, minmax(150px, 1fr));
}

.week-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.tech-col-head,
.day-col-head {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 900;
  color: #475467;
  border-right: 1px solid var(--line);
}

.day-col-head.is-today {
  color: var(--ath-red);
}

.tech-week-row {
  border-bottom: 1px solid var(--line);
}

.tech-profile-cell,
.week-day-cell {
  min-height: 120px;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.tech-profile-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tech-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
  background: #eef2f7;
}

.tech-avatar.initials {
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--ath-red);
}

.tech-profile-text strong {
  display: block;
  font-size: 14px;
}

.tech-profile-text span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.availability {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--green);
}

.availability.limited {
  color: var(--orange);
}

.week-day-cell {
  background: #fff;
  cursor: pointer;
}

.week-day-cell:hover {
  background: #fffafa;
}

.week-day-cell.is-weekend {
  background: #fafafa;
}

.week-day-cell.is-today {
  box-shadow: inset 0 0 0 2px rgba(227, 6, 19, .3);
}

.empty-slot {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.appointment-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(38, 114, 201, .08);
  color: #122033;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}

.appointment-card strong {
  font-size: 12px;
}

.appointment-card span {
  font-weight: 900;
}

.appointment-card small {
  color: #475467;
}

.appointment-card.service {
  background: rgba(34, 160, 107, .10);
}

.appointment-card.repair,
.appointment-card.mount {
  background: rgba(38, 114, 201, .10);
}

.appointment-card.check {
  background: rgba(217, 139, 0, .14);
}

.appointment-card.absence,
.appointment-card.danger {
  background: rgba(227, 6, 19, .10);
}

.more-events {
  height: auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

/* Calendar Stats */

.calendar-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.calendar-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.calendar-stat i {
  font-style: normal;
  display: block;
  margin-bottom: 8px;
}

.calendar-stat strong {
  display: block;
  font-size: 26px;
}

.calendar-stat span {
  color: var(--muted);
}

.calendar-stat small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

/* Calendar Month */

.month-board {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.month-tech-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .05);
}

.month-tech-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  background: linear-gradient(90deg, rgba(227, 6, 19, .05), transparent);
}

.month-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
}

.month-weekday-row {
  display: contents;
}

.month-weekday-row div {
  padding: 10px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.month-day-cell {
  min-height: 120px;
  border-right: 1px solid rgba(0, 0, 0, .06);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  padding: 10px;
  cursor: pointer;
  background: #fff;
}

.month-day-cell:hover {
  background: rgba(227, 6, 19, .025);
}

.month-day-cell.is-weekend {
  background: #fafafa;
}

.month-day-spacer {
  cursor: default;
  background: #fbfcfd;
}

.month-day-spacer:hover {
  background: #fbfcfd;
}

.month-day-cell.is-today {
  box-shadow: inset 0 0 0 2px rgba(227, 6, 19, .3);
}

.month-day-cell > strong {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #1f2937;
  font-size: 13px;
}

.month-day-events {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.month-event-pill {
  border: 0;
  border-radius: 9px;
  padding: 6px 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  color: #243044;
  background: rgba(227, 6, 19, .08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-event-pill.service {
  background: rgba(34, 160, 107, .10);
}

.month-event-pill.repair,
.month-event-pill.mount {
  background: rgba(38, 114, 201, .10);
}

.month-event-pill.check {
  background: rgba(217, 139, 0, .14);
}

.month-event-pill.absence,
.month-event-pill.danger {
  background: rgba(227, 6, 19, .10);
}

/* Modal */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 100;
  backdrop-filter: blur(3px);
}

.modal {
  display: none;
  position: fixed;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 32px));
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  color: var(--text);
  border-radius: 18px;
  padding: 20px;
  z-index: 110;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
  border: 1px solid var(--line);
}

.modal h3 {
  margin: 10px 0 14px;
  font-size: 22px;
}

.modal input,
.modal select,
.modal textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
}

.modal pre {
  white-space: pre-wrap;
  background: #f8fafc;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: #344054;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

/* Responsive */

@media (max-width: 1300px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .calendar-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 850px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .page-head {
    display: block;
    padding: 20px 16px 12px;
  }

  .filters {
    margin-top: 16px;
  }

  .kpi-grid,
  .employee-grid,
  .calendar-stats {
    grid-template-columns: 1fr;
    padding-left: 16px;
    padding-right: 16px;
  }

  .calendar-page {
    padding: 12px;
  }

  .calendar-page .toolbar {
    flex-wrap: wrap;
  }

  .week-board {
    min-width: 980px;
  }

  .month-days-grid {
    grid-template-columns: repeat(7, minmax(110px, 1fr));
  }

  .panel,
  .orders-panel {
    margin-left: 16px;
    margin-right: 16px;
  }

  .service-order-track > .panel {
    flex-basis: calc(50% - 32px);
  }

  .service-detail-head {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .service-detail-summary {
    width: 100%;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .service-detail-grid {
    grid-template-columns: 1fr;
  }

  .filters.detail-disabled::before {
    width: 100%;
    margin: 0 0 4px;
  }
}
/* Übersicht BI-Style */

.kpi-grid {
  grid-template-columns: repeat(6, minmax(160px, 1fr));
}

.overview-kpi {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
  min-height: 86px;
}

.overview-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f3f5f7;
  color: var(--ath-red);
  font-size: 18px;
}

.overview-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.overview-kpi strong {
  display: block;
  font-size: 22px;
  color: var(--text);
  margin-top: 4px;
}

.overview-kpi small {
  color: var(--muted);
  font-size: 11px;
}

.mini-progress {
  height: 5px;
  background: #edf0f3;
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.mini-progress i {
  display: block;
  height: 100%;
  background: #2faa3f;
  border-radius: 999px;
}

.employee-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
}

.employee-util-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.employee-util-card:hover,
.employee-util-card:focus-within {
  z-index: 30;
}

.employee-util-card.active {
  z-index: 2;
  border-color: var(--ath-red);
  box-shadow: 0 0 0 1px rgba(227,6,19,.35), var(--shadow-soft);
}

.employee-util-card.active:hover,
.employee-util-card.active:focus-within {
  z-index: 40;
}

.employee-util-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ath-red);
  font-weight: 900;
  margin-bottom: 8px;
}

.employee-mini-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: #f3f5f7;
  border-radius: 6px;
  font-size: 12px;
}

.employee-util-body {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 14px;
  align-items: center;
}

.util-chart {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.util-donut {
  position: relative;
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
}

.util-donut svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.util-donut-segment {
  cursor: help;
  transition: opacity .16s ease, stroke-width .16s ease;
}

.util-donut-segment:hover {
  opacity: .82;
  stroke-width: 25;
}

.util-donut-inner {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
}

.util-donut-inner strong {
  font-size: 24px;
  line-height: 1;
}

.util-donut-inner span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.util-absence-legend {
  display: flex;
  justify-content: center;
  min-height: 20px;
  position: relative;
}

.util-info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  min-height: 19px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  cursor: help;
  box-shadow: none;
  transform: none;
}

.util-info:hover,
.util-info:focus-visible {
  color: var(--ath-red);
  border-color: rgba(227, 6, 19, .35);
  box-shadow: 0 6px 18px rgba(16, 24, 40, .12);
  transform: none;
}

.util-info-popover {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 100;
  width: 215px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(16, 24, 40, .18);
  color: var(--text);
  transform: translateX(-50%);
  pointer-events: none;
}

.util-info:hover .util-info-popover,
.util-info:focus-visible .util-info-popover {
  display: grid;
  gap: 6px;
}

.util-info-popover > span {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.util-info-popover b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: currentColor;
  font-weight: 950;
}

.util-info-popover b::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.util-info-popover strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 950;
}

.util-info-popover .vacation {
  color: #2672c9;
}

.util-info-popover .sick {
  color: #8b5cf6;
}

.util-info-popover .off-duty {
  color: #0ea5e9;
}

.util-info-popover .shared-order {
  color: #2faa3f;
}

.util-info-popover .central {
  color: #7c3aed;
}

.util-info-popover .holiday {
  color: #14b8a6;
}

.util-info-popover .extra {
  color: #d98b00;
}

.util-info-popover .weekend {
  color: #c2410c;
}

.employee-util-facts {
  display: grid;
  gap: 7px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.employee-util-facts span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.employee-util-facts strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.employee-util-facts strong.good {
  color: var(--green);
}

.employee-util-facts strong.warning {
  color: #d98200;
}

.employee-util-facts strong.bad {
  color: var(--danger);
}

.employee-card-toggle {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  border: 0;
  box-shadow: none;
  min-height: 20px;
  height: 20px;
  padding: 0;
  color: var(--ath-red);
  background: transparent;
  font-size: 18px;
}

/* Zeiterfassung */

.time-tracking-layout {
  display: block;
}

.time-tracking-view {
  overflow: hidden;
}

.time-tracking-track {
  display: flex;
  width: 300%;
  align-items: flex-start;
  transition: transform .42s cubic-bezier(.22, .8, .25, 1);
}

.time-tracking-view.show-status-vacation .time-tracking-track {
  transform: translateX(-33.3333%);
}

.time-tracking-view.show-hour-account .time-tracking-track {
  transform: translateX(-66.6667%);
}

.time-tracking-card-list,
.time-tracking-detail {
  flex: 0 0 calc(33.3333% - 56px);
  margin-left: 28px;
  margin-right: 28px;
  min-width: 0;
  max-width: calc(33.3333% - 56px);
}

.time-tracking-detail[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
}

.time-tracking-detail[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}

.time-tracking-card-list .analytics-card-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.time-tracking-card-list .analytics-card.disabled,
.time-tracking-card-list .analytics-card:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.25);
}

.time-tracking-card-list .analytics-card.disabled .analytics-card-arrow,
.time-tracking-card-list .analytics-card:disabled .analytics-card-arrow {
  color: #98a2b3;
}

.time-tracking-panel {
  min-width: 0;
  max-width: 100%;
}

.vacation-balance-panel,
.vacation-journal-panel {
  min-width: 0;
  max-width: 100%;
}

.time-tracking-panel-head {
  align-items: center;
}

.time-tracking-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.time-tracking-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.time-tracking-table th,
.time-tracking-table td {
  min-width: 52px;
  height: 28px;
  padding: 4px 6px;
  border-right: 1px solid #d7dbe2;
  border-bottom: 1px solid #d7dbe2;
  text-align: center;
  white-space: nowrap;
}

.time-tracking-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  color: #344054;
  font-weight: 800;
}

.time-tracking-table thead th span,
.time-tracking-table thead th small {
  display: block;
  font-weight: 700;
}

.time-tracking-table thead th strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.time-tracking-table .time-employee-head,
.time-tracking-table .time-employee-name {
  position: sticky;
  left: 0;
  z-index: 8;
  min-width: 190px;
  text-align: left;
  background: #fff;
}

.time-tracking-table thead .time-employee-head {
  z-index: 12;
}

.time-tracking-table th.non-workday {
  background: #f1f3f5;
}

.time-cell.non-workday.missing-future,
.time-cell.off {
  background: #f1f3f5;
}

.time-cell.non-workday.missing-past {
  background: #d92d20;
}

.time-tracking-table th.today {
  background: #ffe4e7;
  color: var(--ath-red);
}

.time-cell {
  font-weight: 900;
}

.time-status {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  color: #122033;
  font-size: 11px;
  font-weight: 950;
}

.time-cell.booked,
.time-status.booked,
.time-cell.central,
.time-status.central,
.time-cell.holiday,
.time-status.holiday {
  background: #22c55e;
}

.time-cell.sick,
.time-status.sick {
  background: #f59e0b;
}

.time-cell.vacation,
.time-status.vacation {
  background: #284b7c;
  color: #fff;
}

.time-cell.off-duty,
.time-status.off-duty {
  background: #fde047;
}

.time-cell.missing-past,
.time-status.missing-past {
  background: #e30613;
  color: #fff;
}

.time-cell.missing-future,
.time-status.missing-future {
  background: #fff;
}

.time-tracking-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 760px;
}

.time-tracking-controls label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.time-tracking-date-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.time-tracking-date-control button {
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
}

.time-tracking-date-control input {
  width: 150px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  font: inherit;
  font-weight: 800;
}

.time-tracking-mode-control {
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.time-tracking-mode-control label {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  cursor: pointer;
}

.time-tracking-mode-control label:has(input:checked) {
  background: #fff;
  color: var(--ath-red);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}

.time-tracking-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.time-tracking-legend small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.vacation-journal-section {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.vacation-balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}

.vacation-balance-card {
  position: relative;
  display: grid;
  gap: 5px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .05);
}

.vacation-balance-card.active {
  border-color: var(--ath-red);
  box-shadow: 0 0 0 1px rgba(227, 6, 19, .16);
}

.vacation-balance-card strong {
  color: var(--text);
  font-size: 14px;
}

.vacation-balance-card span,
.vacation-balance-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vacation-balance-card i {
  display: block;
  height: 5px;
  margin-top: 5px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #284b7c var(--vacation-progress),
    #e6e9ef var(--vacation-progress)
  );
}

.vacation-journal-head {
  align-items: center;
}

.vacation-journal-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.vacation-journal-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.vacation-journal-controls input,
.vacation-journal-controls select {
  height: 40px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.vacation-year-calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
}

.vacation-month {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.vacation-month h3 {
  margin: 0;
  padding: 8px 10px;
  background: var(--ath-red);
  color: #fff;
  font-size: 13px;
}

.vacation-month-weekdays,
.vacation-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.vacation-month-weekdays span {
  padding: 6px 4px;
  background: #d8def2;
  color: #1f2a44;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}

.vacation-day {
  display: grid;
  align-content: start;
  min-height: 42px;
  padding: 4px;
  border-right: 1px solid #eef1f5;
  border-bottom: 1px solid #eef1f5;
  background: #fff;
  color: var(--muted);
}

.vacation-day.empty {
  background: #f1f3f5;
}

.vacation-day.weekend {
  background: #eef1f5;
  color: #98a2b3;
}

.vacation-day small {
  font-size: 10px;
  font-weight: 800;
}

.vacation-day strong {
  display: grid;
  place-items: center;
  min-height: 20px;
  margin-top: 3px;
  border-radius: 4px;
  background: #284b7c;
  color: #fff;
  font-size: 11px;
}

.vacation-day.planned strong {
  background: #376aa7;
}

.vacation-day.not-counted strong {
  background: #8293ad;
}

.vacation-day strong.time_off {
  background: #f4d03f;
  color: #1f2a44;
}

.vacation-day strong.holiday {
  background: #22a06b;
}

.hour-account-head {
  align-items: center;
}

.hour-account-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hour-account-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hour-account-controls input,
.hour-account-controls select {
  height: 40px;
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.hour-balance-section,
.hour-period-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.hour-period-section {
  margin-top: 18px;
}

.hour-period-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hour-balance-section h3,
.hour-period-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
}

.hour-period-section .hour-account-controls {
  margin-left: auto;
}

.hour-balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.hour-balance-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .05);
}

.hour-balance-card.active {
  border-color: var(--ath-red);
  box-shadow: 0 0 0 1px rgba(227, 6, 19, .16);
}

.hour-balance-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hour-balance-card strong {
  font-size: 22px;
}

.hour-balance-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.hour-balance-card.positive strong,
.hour-period-card.positive strong {
  color: #16a34a;
}

.hour-balance-card.negative strong,
.hour-period-card.negative strong {
  color: var(--ath-red);
}

.hour-period-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.hour-period-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-left: 4px solid #98a2b3;
  border-radius: 12px;
  background: #fff;
}

.hour-period-card.positive {
  border-left-color: #16a34a;
}

.hour-period-card.negative {
  border-left-color: var(--ath-red);
}

.hour-period-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hour-period-card > strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.hour-period-card dl {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.hour-period-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.hour-period-card dt,
.hour-period-card dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hour-period-card dd {
  color: var(--text);
  text-align: right;
}

.hour-debug-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed rgba(227, 6, 19, .35);
  border-radius: 16px;
  background: #fff7f7;
}

.hour-debug-head h3 {
  margin: 0;
  color: var(--ath-red);
  font-size: 14px;
}

.hour-debug-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hour-debug-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.hour-debug-table {
  width: 1380px;
  min-width: 1380px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.hour-debug-col-date {
  width: 110px;
}

.hour-debug-col-stamps {
  width: 360px;
}

.hour-debug-col-subject {
  width: 360px;
}

.hour-debug-col-calculation {
  width: 310px;
}

.hour-debug-col-hours {
  width: 80px;
}

.hour-debug-table th,
.hour-debug-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.hour-debug-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.hour-debug-table th:nth-child(1),
.hour-debug-table td:nth-child(1) {
  width: 110px;
}

.hour-debug-table th:nth-child(2),
.hour-debug-table td:nth-child(2) {
  width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hour-debug-table th:nth-child(3),
.hour-debug-table td:nth-child(3) {
  width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hour-debug-table th:nth-child(4),
.hour-debug-table td:nth-child(4) {
  width: 310px;
}

.hour-debug-table th:nth-child(5),
.hour-debug-table th:nth-child(6),
.hour-debug-table th:nth-child(7),
.hour-debug-table td:nth-child(5),
.hour-debug-table td:nth-child(6),
.hour-debug-table td:nth-child(7) {
  width: 80px;
}

.hour-debug-table td strong,
.hour-debug-table td span,
.hour-debug-table td small {
  display: block;
}

.hour-debug-table td small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.hour-debug-table td .hour-debug-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.hour-debug-table td .hour-debug-stamps span {
  display: inline-flex;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1f3f5;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hour-debug-table .positive {
  color: #16a34a;
  font-weight: 950;
}

.hour-debug-table .negative {
  color: var(--ath-red);
  font-weight: 950;
}

@media (max-width: 1300px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .employee-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .time-tracking-layout {
    grid-template-columns: 1fr;
  }

  .time-tracking-card-list .analytics-card-grid,
  .hour-period-grid {
    grid-template-columns: 1fr;
  }

  .vacation-year-calendar {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .time-tracking-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 850px) {
  .kpi-grid,
  .employee-grid,
  .vacation-year-calendar {
    grid-template-columns: 1fr;
  }

  .employee-util-body {
    grid-template-columns: 1fr;
  }

  .util-donut {
    margin: 0 auto;
  }

  .employee-util-facts {
    border-left: 0;
    padding-left: 0;
  }
}

/* BI Referenzlook: KPI Icons + Tabellenfarben */

.overview-kpi {
  grid-template-columns: 50px 1fr;
  min-height: 82px;
  border-radius: 6px;
}

.overview-kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  background: #f1f3f5;
  color: #596579;
  border: 1px solid #e1e5eb;
  font-size: 17px;
  font-weight: 900;
}

.overview-kpi-icon img {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.overview-kpi strong {
  font-size: 21px;
}

.mini-progress {
  height: 4px;
  background: #e6e8eb;
  border-radius: 999px;
  margin-top: 8px;
}

.mini-progress i {
  background: #2faa3f;
}

.mini-spark {
  height: 22px;
  margin-top: 6px;
  background:
    linear-gradient(135deg, transparent 44%, #2faa3f 45%, #2faa3f 55%, transparent 56%),
    linear-gradient(25deg, transparent 40%, #2faa3f 41%, #2faa3f 52%, transparent 53%);
  opacity: .9;
}

.profitability-kpi {
  border-left: 3px solid currentColor;
  text-decoration: none;
  cursor: pointer;
}

.profitability-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 24, 40, .1);
}

.profitability-kpi.positive {
  color: var(--green);
}

.profitability-kpi.neutral {
  color: var(--orange);
}

.profitability-kpi.negative {
  color: var(--danger);
}

.profitability-kpi .overview-kpi-icon {
  color: currentColor;
}

.profitability-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profitability-value-row strong {
  flex: 0 0 auto;
  color: currentColor;
}

.profitability-spark {
  width: 76px;
  height: 30px;
  overflow: visible;
}

.profitability-baseline {
  fill: none;
  stroke: #d7dce3;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.profitability-curve {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Auswertungen */

.analytics-view {
  overflow: hidden;
}

.analytics-track {
  display: flex;
  width: 200%;
  align-items: flex-start;
  transition: transform .42s cubic-bezier(.22, .8, .25, 1);
}

.analytics-view.show-detail .analytics-track {
  transform: translateX(-50%);
}

.analytics-list,
.analytics-detail {
  flex: 0 0 calc(50% - 56px);
  margin-left: 28px;
  margin-right: 28px;
}

.analytics-detail {
  min-height: 560px;
}

.analytics-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 18px;
}

.analytics-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 150px;
  padding: 24px;
  border-radius: 16px;
  text-align: left;
  background: #fff;
  box-shadow: var(--shadow);
}

.analytics-card:hover {
  border-color: rgba(227, 6, 19, .35);
}

.analytics-card-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--ath-red-soft);
  color: var(--ath-red);
  font-size: 26px;
  font-weight: 950;
}

.analytics-card-icon img {
  width: 55px;
  height: 55px;
  display: block;
  object-fit: contain;
}

.analytics-card-copy {
  display: grid;
  gap: 8px;
}

.analytics-card-copy strong {
  font-size: 21px;
}

.analytics-card-copy small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.analytics-card-arrow {
  color: var(--ath-red);
  font-size: 28px;
}

.reports-list {
  padding: 0 28px 28px;
}

.reports-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 560px));
  gap: 18px;
  align-items: stretch;
}

.reports-list .analytics-card {
  width: 100%;
  min-height: 150px;
  border: 1px solid var(--line);
}

.report-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.report-modal-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.report-modal-head h3 {
  margin: 4px 0 0;
}

.report-export-form {
  display: grid;
  gap: 14px;
}

.report-export-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.report-export-form select {
  width: 100%;
}

.report-export-hint {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.analytics-detail-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.analytics-detail-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-detail-head h2 {
  margin: 3px 0 0;
}

.profitability-annual-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.profitability-annual-summary article {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.profitability-annual-summary span,
.profitability-month-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profitability-annual-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.profitability-annual-summary small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.profitability-annual-summary .positive strong,
.profitability-month-card.positive strong {
  color: var(--green);
}

.profitability-annual-summary .neutral strong,
.profitability-month-card.neutral strong {
  color: var(--orange);
}

.profitability-annual-summary .negative strong,
.profitability-month-card.negative strong {
  color: var(--danger);
}

.profitability-year-chart {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow-x: auto;
}

.profitability-line-chart {
  display: block;
  min-width: 760px;
  width: 100%;
  height: 270px;
}

.profitability-zero-line {
  stroke: #cfd5dd;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.profitability-axis-label,
.profitability-month-label,
.profitability-point-value {
  font-family: Inter, Arial, sans-serif;
  font-weight: 800;
}

.profitability-axis-label {
  fill: var(--muted);
  font-size: 10px;
}

.profitability-line-path {
  fill: none;
  stroke: #596579;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profitability-point-hit {
  fill: transparent;
  cursor: pointer;
}

.profitability-point {
  fill: #fff;
  stroke: currentColor;
  stroke-width: 4;
  transition: r .16s ease, fill .16s ease;
}

.profitability-point-link:hover .profitability-point {
  r: 9px;
  fill: currentColor;
}

.profitability-point-link.positive {
  color: var(--green);
}

.profitability-point-link.neutral {
  color: var(--orange);
}

.profitability-point-link.negative {
  color: var(--danger);
}

.profitability-point-value {
  fill: currentColor;
  font-size: 10px;
  text-anchor: middle;
  pointer-events: none;
}

.profitability-month-label {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: middle;
  pointer-events: none;
}

.profitability-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.profitability-month-card {
  display: grid;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 4px solid currentColor;
  border-radius: 10px;
  background: var(--surface-soft);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}

.profitability-month-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.profitability-month-card.positive {
  color: var(--green);
}

.profitability-month-card.neutral {
  color: var(--orange);
}

.profitability-month-card.negative {
  color: var(--danger);
}

.profitability-month-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profitability-month-card strong {
  font-size: 17px;
}

.profitability-month-card small {
  color: var(--muted);
  font-size: 11px;
}

.profitability-employee-count {
  position: relative;
  width: fit-content;
  cursor: help;
  outline: none;
}

.profitability-employee-count::after {
  position: absolute;
  z-index: 20;
  left: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(320px, 70vw);
  padding: 8px 10px;
  border-radius: 7px;
  background: #172033;
  color: #fff;
  box-shadow: var(--shadow-soft);
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
  white-space: normal;
}

.profitability-employee-count:hover::after,
.profitability-employee-count:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.profitability-month-facts {
  display: grid;
  gap: 5px;
  margin: 4px 0;
}

.profitability-month-facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.profitability-month-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.profitability-month-facts dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.analytics-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.employee-profitability-intro {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.employee-profitability-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.employee-profitability-table-wrap {
  max-height: calc(100vh - 260px);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.employee-profitability-table {
  min-width: 1480px;
}

.employee-profitability-table th,
.employee-profitability-table td {
  padding: 11px 10px;
  border-right: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.employee-profitability-table thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #f4f6f8;
  font-size: 11px;
}

.employee-profitability-table tbody th {
  position: sticky;
  z-index: 2;
  left: 0;
  min-width: 190px;
  background: #fff;
  text-align: left;
}

.employee-profitability-table thead th:first-child {
  left: 0;
  z-index: 4;
  min-width: 190px;
}

.employee-profitability-table tbody th a {
  color: var(--blue);
  font-weight: 900;
}

.employee-profitability-table td {
  font-size: 11px;
  font-weight: 800;
}

.long-distance-orders-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.home-trip-debug-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.home-trip-debug-panel > h3,
.home-trip-debug-panel > p {
  display: none;
}

.home-trip-debug-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.home-trip-debug-toggle span {
  display: grid;
  gap: 3px;
}

.home-trip-debug-toggle strong {
  font-size: 15px;
  font-weight: 950;
}

.home-trip-debug-toggle small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-trip-debug-toggle i {
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  font-style: normal;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

.home-trip-debug-content {
  margin-top: 14px;
}

.home-trip-debug-panel.collapsed .home-trip-debug-content {
  display: none;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  text-decoration: underline;
}

.home-trip-debug-table {
  min-width: 1180px;
}

.home-trip-debug-table td {
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.home-trip-debug-table td:nth-child(1),
.home-trip-debug-table td:nth-child(2) {
  width: 110px;
  white-space: nowrap;
}

.home-trip-debug-table td:nth-child(4) {
  max-width: 560px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.45;
}

.home-trip-debug-row td:nth-child(2) span {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf0f3;
  color: #475467;
  font-weight: 950;
}

.home-trip-debug-row.ok td:nth-child(2) span,
.home-trip-debug-row.cached td:nth-child(2) span {
  background: #e8f8ee;
  color: #15803d;
}

.home-trip-debug-row.error td:nth-child(2) span,
.home-trip-debug-row.empty td:nth-child(2) span,
.home-trip-debug-row.skipped td:nth-child(2) span {
  background: #fff0f0;
  color: var(--danger);
}

.home-trip-debug-row.cached-empty td:nth-child(2) span,
.home-trip-debug-row.rate-limited td:nth-child(2) span {
  background: #fff8e6;
  color: #8a5700;
}

.home-trip-debug-row.request td:nth-child(2) span {
  background: #edf6ff;
  color: var(--blue);
}

.long-distance-bar-chart {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.long-distance-bar-chart h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

.long-distance-bar-chart p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.long-distance-bars {
  display: grid;
  gap: 10px;
}

.long-distance-bar-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr 40px;
  align-items: center;
  gap: 12px;
}

button.long-distance-bar-row {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

button.long-distance-bar-row:hover .long-distance-bar-track,
button.long-distance-bar-row.active .long-distance-bar-track {
  box-shadow: 0 0 0 2px rgba(227, 6, 19, .2);
}

button.long-distance-bar-row.active span {
  color: var(--ath-red);
}

.long-distance-bar-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.long-distance-bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.long-distance-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ath-red), #f59e0b);
}

.long-distance-bar-row strong {
  font-size: 13px;
  text-align: right;
}

.employee-profitability-table td.positive {
  background: rgba(34, 160, 107, .10);
  color: var(--green);
}

.employee-profitability-table td.neutral {
  background: rgba(217, 139, 0, .12);
  color: var(--orange);
}

.employee-profitability-table td.negative {
  background: rgba(227, 6, 19, .08);
  color: var(--danger);
}

.employee-profitability-table td.inactive {
  color: var(--muted);
  background: #f8fafc;
}

.employee-profitability-table td.annual {
  border-left: 2px solid #b8c0cc;
  font-size: 12px;
}

.employee-profitability-empty {
  padding: 28px !important;
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 1300px) {
  .analytics-card-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .profitability-month-grid {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }
}

@media (max-width: 850px) {
  .analytics-list,
  .analytics-detail {
    flex-basis: calc(50% - 32px);
    margin-left: 16px;
    margin-right: 16px;
  }

  .analytics-card-grid,
  .profitability-annual-summary,
  .profitability-month-grid {
    grid-template-columns: 1fr;
  }

  .analytics-card {
    grid-template-columns: 52px 1fr auto;
    padding: 18px;
  }

  .analytics-card-icon {
    width: 50px;
    height: 50px;
  }

  .analytics-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.order-type,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}

.order-type.montage {
  background: #e8f3ff;
  color: #1769b2;
  border-color: #b8dcff;
}

.order-type.reparatur {
  background: #fff2d9;
  color: #9c6400;
  border-color: #ffd891;
}

.order-type.einweisung,
.order-type.wartung {
  background: #e8f8ee;
  color: #13764d;
  border-color: #bde8cb;
}

.order-type.demontage {
  background: #f3e8ff;
  color: #6d28d9;
  border-color: #dbc4ff;
}

.order-type.default {
  background: #eef2f7;
  color: #475467;
  border-color: #d7dde6;
}

.profitability-month-facts .fair-revenue {
  color: #6941c6;
}

.order-type.messe {
  background: #f4f0ff;
  color: #6941c6;
  border-color: #d9ccff;
}

.status-badge.done {
  background: #e8f8ee;
  color: #15803d;
  border-color: #bde8cb;
}

.invoice-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.invoice-badge.invoiced {
  color: #15803d;
  background: #e8f8ee;
  border-color: #bde8cb;
}

.invoice-badge.open {
  color: #9c6400;
  background: #fff2d9;
  border-color: #ffd891;
}

.status-badge.planned {
  background: #eef5ff;
  color: #1d4ed8;
  border-color: #c8ddff;
}

.status-badge.warning {
  background: #fff7e6;
  color: #b45309;
  border-color: #ffdca8;
}

.status-badge.neutral {
  background: #f2f4f7;
  color: #475467;
  border-color: #d7dde6;
}
/* Einklappbare Navigation und robuste Inhaltsbreiten */
body {
  --sidebar-width: 220px;
  overflow-x: hidden;
}

body.sidebar-collapsed {
  --sidebar-width: 76px;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: 0;
  overflow-x: hidden;
  transition: width 180ms ease;
}

.sidebar nav a {
  min-width: 0;
}

.nav-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.nav-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-label {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 120ms ease;
}

body.sidebar-collapsed .sidebar .brand {
  justify-content: center;
  padding-inline: 8px;
}

body.sidebar-collapsed .sidebar .brand-logo {
  width: 52px;
}

body.sidebar-collapsed .sidebar .brand strong,
body.sidebar-collapsed .sidebar .nav-label {
  display: none;
}

body.sidebar-collapsed .sidebar nav a {
  justify-content: center;
  padding-inline: 0;
}

.main {
  width: auto;
  min-width: 0;
  max-width: none;
  margin-left: var(--sidebar-width);
  overflow-x: hidden;
  transition: margin-left 180ms ease;
}

.menu-icon {
  display: grid;
  width: 20px;
  gap: 4px;
}

.menu-icon i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, width 180ms ease;
}

body.sidebar-collapsed .menu-icon i:nth-child(1) {
  width: 12px;
  transform: translate(7px, 3px) rotate(35deg);
}

body.sidebar-collapsed .menu-icon i:nth-child(3) {
  width: 12px;
  transform: translate(7px, -3px) rotate(-35deg);
}

.main > section,
.panel,
.orders-panel,
.service-order-view,
.service-order-list,
.service-order-detail {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.service-order-view {
  width: 100%;
}

.service-order-track {
  min-width: 0;
}

.service-order-track > .panel {
  min-width: 0;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.table-wrap table {
  min-width: max-content;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    width: var(--sidebar-width);
  }

  .main {
    margin-left: var(--sidebar-width);
  }
}
