﻿/* Quick-Filter Buttons für Rechnungen */
.invoice-quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 12px;
}

.quick-filter-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fafafa;
  color: #333;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}

.quick-filter-btn:hover {
  background: #f0f0f0;
  border-color: var(--accent);
  color: var(--accent);
}

.quick-filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* --- Verbesserungen Dashboard-Detailfenster: Animation, Overlay, Close-Button, Responsive --- */
.dashboard-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 21, 24, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in-overlay 320ms cubic-bezier(.4,0,.2,1);
}
@keyframes fade-in-overlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dashboard-detail-overlay .dashboard-worker-detail {
  position: relative !important;
  animation: detail-pop-in 340ms cubic-bezier(.4,0,.2,1);
  box-shadow: 0 12px 48px 0 rgba(15,76,92,0.18), 0 2px 12px 0 rgba(227,100,20,0.13) !important;
  border-radius: 28px !important;
  padding: 38px 38px 28px 38px !important;
  margin: 0 auto !important;
  max-width: 480px !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  background: linear-gradient(145deg, #fffef9 90%, #ece3d1 100%) !important;
}
@keyframes detail-pop-in {
  from { opacity: 0; transform: translateY(32px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dashboard-detail-overlay .dashboard-worker-detail .close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #ece3d1;
  color: #a855f7;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px 0 rgba(15,76,92,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
}
.dashboard-detail-overlay .dashboard-worker-detail .close-btn:hover {
  background: #a855f7;
  color: #fff;
}
@media (max-width: 900px) {
  .dashboard-detail-overlay .dashboard-worker-detail {
    max-width: 98vw !important;
    min-width: 0 !important;
    padding: 18px 6vw 18px 6vw !important;
  }
  .dashboard-detail-overlay {
    align-items: flex-end;
    padding-bottom: 12px;
  }
}
/* --- Ende Verbesserungen --- */
.dashboard-detail-overlay .dashboard-worker-detail {
  box-sizing: border-box !important;
  position: relative;
}
.dashboard-worker-detail .worker-detail-card {
  box-shadow: none;
  background: none;
  padding: 0;
}
.dashboard-worker-detail img {
  width: 90px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #eee;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px 0 rgba(227,100,20,0.10);
}
.dashboard-worker-detail h2 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  color: #06b6d4;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-weight: 700;
}
.dashboard-worker-detail p {
  margin: 0 0 4px 0;
  font-size: 0.98rem;
  color: #36565d;
}
.dashboard-worker-detail .button-row {
  margin-top: 10px;
  gap: 10px;
  display: flex;
  flex-wrap: wrap;
}
.dashboard-worker-detail .button-row .primary-button {
  background: var(--button-bg, var(--surface-strong));
  color: var(--button-text, var(--text));
  border: 1px solid var(--button-border, var(--line));
  border-radius: 12px;
  font-weight: 700;
  padding: 12px 22px;
  margin-right: 10px;
  box-shadow: 0 2px 8px 0 rgba(15,76,92,0.10);
  transition: background 0.2s, box-shadow 0.2s;
}
.dashboard-worker-detail .button-row .primary-button:hover {
  background: var(--button-bg, var(--surface-strong));
  box-shadow: 0 4px 16px 0 rgba(227,100,20,0.18);
}
.dashboard-worker-detail .button-row .ghost-button {
  background: var(--button-bg, var(--surface-strong));
  color: var(--button-text, var(--text));
  border: 1px solid var(--button-border, var(--line));
  border-radius: 12px;
  font-weight: 700;
  padding: 12px 22px;
  margin-right: 10px;
  box-shadow: none;
}
.dashboard-worker-detail .button-row .ghost-button:hover {
  background: var(--button-bg, var(--surface-strong));
  color: var(--button-text, var(--text));
  border-color: var(--button-border, var(--line));
}
.dashboard-worker-detail p strong {
  color: #163842;
}
:root {
  --bg: #050816;
  --surface: rgba(11, 16, 32, 0.84);
  --surface-strong: #111a2f;
  --surface-alt: #0b1224;
  --text: #eef6ff;
  --muted: #8ea4c0;
  --line: rgba(120, 156, 255, 0.16);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.18);
  --accent-dark: #2563eb;
  --ink-deep: #050816;
  --teal-soft: #7dd3fc;
  --success: #22c55e;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  position: relative;
  min-height: 100vh;
  color: var(--text);
  font-family: "Barlow", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(56, 189, 248, 0.18), transparent 30%),
    radial-gradient(circle at 100% 12%, rgba(99, 102, 241, 0.18), transparent 30%),
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(155deg, #050816 0%, #081124 52%, #050816 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(1px);
}

body::before {
  inset: auto auto 14% -6%;
  width: 340px;
  height: 340px;
  border-radius: 44% 56% 62% 38% / 49% 34% 66% 51%;
  background: radial-gradient(circle at 28% 30%, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0));
  animation: blob-drift 14s ease-in-out infinite;
}

body::after {
  inset: -8% -2% auto auto;
  width: 420px;
  height: 260px;
  border-radius: 60% 40% 58% 42% / 40% 58% 42% 60%;
  background:
    repeating-linear-gradient(
      112deg,
      rgba(120, 156, 255, 0.08) 0,
      rgba(120, 156, 255, 0.08) 8px,
      rgba(120, 156, 255, 0) 8px,
      rgba(120, 156, 255, 0) 16px
    ),
    radial-gradient(circle at 40% 30%, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0));
  animation: blob-drift 18s ease-in-out infinite reverse;
}

body.auth-locked {
  overflow: hidden;
}

/* Lokaler Entwicklungsmodus – nur localhost */
html.baupass-local-dev body::after {
  content: "Lokal · " attr(data-local-url);
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 99999;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0f3d2e;
  background: rgba(167, 243, 208, 0.95);
  border: 1px solid rgba(16, 120, 87, 0.35);
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

html.baupass-local-dev {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.baupass-local-dev #superadminSidebarCompanyPicker,
html.baupass-local-dev #superadminSidebarPreviewStatus {
  display: none !important;
}

html.baupass-local-dev .enterprise-embed-shell {
  border-color: transparent !important;
  box-shadow: none !important;
}

html.baupass-local-dev .enterprise-embed-toolbar {
  box-shadow: none !important;
}

html.baupass-local-dev .sidebar {
  background: linear-gradient(178deg, rgba(13, 19, 26, 0.98), rgba(21, 26, 32, 0.95)) !important;
}

html.baupass-local-dev .sidebar::after,
html.baupass-local-dev .sidebar::before {
  display: none !important;
}

html.baupass-local-dev .auth-overlay {
  background: rgba(18, 20, 23, 0.92) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html.baupass-local-dev .auth-panel {
  background: rgba(255, 251, 245, 0.98) !important;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(127, 48, 24, 0.42);
  border: 2px solid rgba(255, 255, 255, 0.45);
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.36);
}

body.auth-locked .shell.locked {
  display: none;
}

button,
input,
select {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky !important;
  left: 0;
  top: 0;
  height: 100vh !important;
  max-height: 100dvh !important;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding: 20px 18px;
  min-height: 0;
  overflow: hidden;
  color: #fff7ef;
  background:
    linear-gradient(178deg, rgba(13, 19, 26, 0.98), rgba(21, 26, 32, 0.95)),
    conic-gradient(from 150deg at 0% 0%, rgba(202, 90, 45, 0.28), rgba(42, 113, 119, 0.18), rgba(202, 90, 45, 0.24));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 0;
}

.sidebar > div:first-child {
  flex-shrink: 0;
  min-width: 0;
}

.sidebar-card {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .sidebar {
    position: static !important;
    height: auto !important;
  }
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 12px);
  opacity: 0.35;
}

.sidebar h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
  font-size: 1.28rem;
  line-height: 1.15;
}

.topbar h2,
.hero-panel h3,
.panel h3,
.badge-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

.sidebar-copy,
.sidebar-card span,
.hero-panel p,
.panel p,
.list-item span,
.card-item span,
.empty-state {
  color: var(--muted);
}

.sidebar-copy {
  margin-top: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(255, 247, 239, 0.78);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav {
  display: grid;
  gap: 8px;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(15, 23, 32, 0.5);
}

.nav::-webkit-scrollbar {
  width: 6px;
}

.nav::-webkit-scrollbar-track {
  background: rgba(15, 23, 32, 0.55);
  border-radius: 999px;
}

.nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.nav-enterprise-mount {
  margin: 0.35rem 0 0.5rem;
  padding: 0.5rem 0 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-section-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0 0 0.35rem 0.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nav-plan-pill {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.14);
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.28);
  opacity: 1;
  font-weight: 700;
}

.nav-link-deployment-plan {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(15, 76, 92, 0.2);
  font-weight: 700;
}

.deployment-steps {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem 1rem 2rem;
  border-radius: 12px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  background: rgba(15, 76, 92, 0.1);
  list-style: decimal;
}

.deployment-steps li {
  margin-bottom: 0.65rem;
  padding-left: 0.25rem;
}

.deployment-steps li strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text, #1a2e3a);
}

.deployment-steps li span {
  font-size: 0.9rem;
  color: var(--muted, #5a6a78);
}

.nav-link-enterprise-quick {
  display: none !important;
}

.nav-link-enterprise-quick.legacy-visible {
  border: 1px dashed rgba(94, 234, 212, 0.45) !important;
  color: #7dd3fc !important;
  margin-top: 0.25rem;
}

.nav-link-enterprise {
  display: block;
  width: 100%;
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
  border-inline-start: 2px solid rgba(94, 234, 212, 0.45);
  padding-inline-start: 0.65rem;
}

.view-embed.active {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.content.has-embed-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.content.has-embed-view::before {
  display: none;
}

.content.has-embed-view .view-embed.active {
  flex: 1;
  height: auto;
  min-height: 0;
}

.enterprise-embed-toolbar .ghost-button,
.enterprise-embed-toolbar .primary-button {
  overflow: visible;
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
  color: #121518 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(20, 27, 34, 0.14) !important;
}

.enterprise-embed-toolbar .ghost-button::after,
.enterprise-embed-toolbar .primary-button::after {
  display: none;
}

.enterprise-embed-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  background: var(--surface-2, #0d131a);
}

.enterprise-embed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.enterprise-embed-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.enterprise-embed-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: none;
  background: var(--surface-2, #0d131a);
}

body.embed-mode .ops-header .ops-nav,
body.embed-mode #hubHeader {
  display: none !important;
}

body.embed-mode.admin-v2-embed #loginView .small {
  display: none !important;
}

body.embed-mode.admin-v2-embed {
  background: transparent;
}

body.embed-mode.admin-v2-embed #app {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-stack {
  display: grid;
  gap: 1rem;
}

.dashboard-stack .session-card {
  margin-bottom: 0;
}

.enterprise-hub-banner {
  border: 1px solid rgba(120, 156, 255, 0.2);
  background: linear-gradient(135deg, rgba(10, 16, 30, 0.98), rgba(16, 24, 44, 0.98));
  color: #ffffff;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.32);
}

.enterprise-hub-banner-eyebrow {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.enterprise-hub-plan-hint {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ffffff;
}

.enterprise-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0 1.25rem 1.25rem;
}

.nav-link {
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: left;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(99, 102, 241, 0.24));
  transform: translateX(4px);
}

.sidebar-card {
  display: grid;
  gap: 6px;
  flex-shrink: 0;
  margin-top: auto;
  padding: 14px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 0;
}

.sidebar-card strong {
  color: #fff7ef;
  font-size: 0.9rem;
  line-height: 1.3;
}

.sidebar-card span {
  color: rgba(255, 247, 239, 0.78) !important;
  font-size: 0.8rem;
  line-height: 1.45;
}

.sidebar-card-label {
  margin: 0;
  color: rgba(255, 247, 239, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
}

.superadmin-sidebar-preview-status {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.superadmin-sidebar-preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4be3d1;
  box-shadow: 0 0 0 0 rgba(75, 227, 209, 0.4);
  animation: sidebar-preview-pulse 1100ms ease-in-out infinite;
}

.superadmin-sidebar-preview-main {
  display: grid;
  gap: 2px;
}

.superadmin-sidebar-preview-main strong {
  color: #f4fbff;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.superadmin-sidebar-preview-main span {
  color: rgba(244, 251, 255, 0.82);
  font-size: 0.79rem;
  font-weight: 700;
}

.superadmin-sidebar-preview-close {
  min-height: 26px;
  padding: 4px 9px;
  font-size: 0.7rem;
  color: #f4fbff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(10, 14, 20, 0.2);
}

.superadmin-sidebar-preview-status.sidebar-simulation-construction .superadmin-sidebar-preview-dot {
  background: #4be3d1;
  box-shadow: 0 0 0 0 rgba(75, 227, 209, 0.36);
}

.superadmin-sidebar-preview-status.sidebar-simulation-industry .superadmin-sidebar-preview-dot {
  background: #61b6ff;
  box-shadow: 0 0 0 0 rgba(97, 182, 255, 0.4);
}

.superadmin-sidebar-preview-status.sidebar-simulation-premium .superadmin-sidebar-preview-dot {
  background: #f3b34c;
  box-shadow: 0 0 0 0 rgba(243, 179, 76, 0.38);
}

@keyframes sidebar-preview-pulse {
  0% {
    transform: scale(1);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.content {
  padding: 14px 18px 16px;
  padding-top: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 0.94rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0));
}

.app-boot-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12141780;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.25s;
}
.app-boot-loader.hidden {
  display: none;
}
.app-boot-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--brand-primary, #06b6d4);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  align-items: center;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(18, 20, 23, 0.8), rgba(18, 20, 23, 0.84)),
    radial-gradient(circle at top left, rgba(217, 93, 57, 0.22), transparent 30%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.auth-overlay.active {
  display: grid;
}

.auth-panel {
  width: min(100%, 380px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  padding: 14px 16px 12px;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  margin: 0;
  border-radius: 18px;
  font-size: 0.9rem;
  background:
    radial-gradient(circle at top right, rgba(217, 93, 57, 0.16), transparent 38%),
    rgba(255, 251, 245, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  animation: auth-enter 420ms ease;
}

.auth-intro-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.auth-lang-field-top {
  margin-left: auto;
}

.auth-brand-block {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  margin: 4px 0 14px;
  padding: 18px 16px 14px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.92));
  border: 1px solid rgba(6, 182, 212, 0.22);
  box-shadow:
    0 16px 40px rgba(6, 182, 212, 0.12),
    0 0 0 1px rgba(168, 85, 247, 0.06) inset;
  overflow: hidden;
}

.auth-brand-glow {
  position: absolute;
  inset: -30% -10%;
  background:
    radial-gradient(circle at 22% 40%, rgba(6, 182, 212, 0.22), transparent 52%),
    radial-gradient(circle at 78% 60%, rgba(168, 85, 247, 0.18), transparent 48%);
  pointer-events: none;
}

.auth-brand-product {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #64748b;
}

.website-logo-auth {
  position: relative;
  z-index: 1;
  margin: 0;
  width: min(100%, 320px);
  max-width: 320px;
  max-height: 72px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(6, 182, 212, 0.18));
}

.auth-lang-field-compact {
  position: static;
  margin: 0;
  width: min(132px, 38vw);
  gap: 0;
  flex-shrink: 0;
}

.auth-lang-field-compact > span {
  display: none;
}

.auth-intro {
  flex-shrink: 0;
}

.auth-panel h2 {
  margin: 4px 0 0;
  font-size: 1.12rem;
  line-height: 1.2;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
}

.auth-panel h3 {
  font-size: 1rem;
}

.auth-panel h2,
.auth-panel h3,
.auth-panel strong,
.auth-panel label,
.auth-panel p,
.auth-panel span,
.auth-panel .eyebrow {
  color: #111827;
}

.auth-panel .eyebrow {
  display: none;
}

/* Langer Text + Drehkreuz-Karte sparen Platz – Login ohne Scrollen */
.auth-copy,
.auth-system-card.full-width {
  display: none;
}

.auth-panel .auth-copy,
.auth-panel .helper-text,
.auth-panel .auth-system-card span {
  color: #1f2937;
}

.auth-panel input,
.auth-panel select,
.auth-panel textarea {
  color: #0f172a;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.18);
}

.auth-panel input::placeholder,
.auth-panel textarea::placeholder {
  color: #6b7280;
  opacity: 1;
}

.auth-panel input:focus,
.auth-panel select:focus,
.auth-panel textarea:focus {
  outline: 2px solid rgba(15, 76, 92, 0.32);
  outline-offset: 1px;
}

.auth-panel input.login-focus-pulse,
.auth-panel input.login-focus-pulse:focus {
  border-color: rgba(15, 76, 92, 0.62);
  box-shadow: 0 0 0 4px rgba(15, 76, 92, 0.18), 0 0 0 1px rgba(15, 76, 92, 0.45);
  animation: login-focus-pulse 700ms ease-out;
}

@keyframes login-focus-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes login-focus-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

.support-assist-spectator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120000;
  display: grid;
  place-items: start center;
  padding: 10px 12px 0;
  pointer-events: none;
  background: transparent;
}

.support-assist-spectator.hidden {
  display: none;
}

.support-assist-spectator-card {
  max-width: min(720px, 96vw);
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(15, 76, 92, 0.18);
  box-shadow: 0 10px 28px rgba(8, 24, 32, 0.14);
}

.support-assist-spectator.support-assist-spectator-login-ready .support-assist-spectator-card,
body.support-assist-spectator-login-ready .support-assist-spectator-card {
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: 0 10px 28px rgba(22, 163, 74, 0.12);
}

.support-assist-spectator-compact {
  padding: 8px 12px;
}

.support-assist-live-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.support-assist-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18);
  animation: supportAssistPulse 1.4s ease-in-out infinite;
}

@keyframes supportAssistPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.92); }
}

.support-assist-view-chip {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(15, 76, 92, 0.1);
  color: #06b6d4;
  font-size: 0.78rem;
  font-weight: 600;
}

.support-assist-view-chip.hidden {
  display: none;
}

.support-assist-spectator-compact .support-assist-status {
  margin-top: 6px;
  font-size: 0.82rem;
}

.support-assist-mirror-field {
  background: rgba(15, 76, 92, 0.06) !important;
  color: inherit !important;
}

body.support-assist-mirror-auth #authOverlay {
  display: grid !important;
  z-index: 99990 !important;
  pointer-events: none !important;
}

body.support-assist-mirror-auth.support-assist-spectator-login-ready #authOverlay,
body.support-assist-mirror-auth.support-assist-spectator-login-ready #authOverlay .auth-form,
body.support-assist-mirror-auth.support-assist-spectator-login-ready #authOverlay input,
body.support-assist-mirror-auth.support-assist-spectator-login-ready #authOverlay select,
body.support-assist-mirror-auth.support-assist-spectator-login-ready #authOverlay button {
  pointer-events: auto !important;
  user-select: auto !important;
  cursor: auto !important;
}

body.support-assist-mirror-app #authOverlay {
  display: none !important;
}

body.support-assist-mirror-app #mainShell {
  display: grid !important;
  visibility: visible !important;
}

body.support-assist-mirror-app.auth-locked #mainShell {
  pointer-events: none;
}

.support-assist-kicker {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 76, 92, 0.72);
}

.support-assist-spectator-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.support-assist-status {
  margin: 0;
  color: rgba(18, 32, 40, 0.82);
  line-height: 1.45;
}

.support-assist-remote-cursor {
  position: fixed;
  z-index: 120001;
  width: 18px;
  height: 18px;
  margin-left: -2px;
  margin-top: -2px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #06b6d4;
  box-shadow: 0 0 0 1px rgba(15, 76, 92, 0.45), 0 8px 24px rgba(8, 24, 32, 0.28);
  pointer-events: none;
  transition: left 90ms linear, top 90ms linear;
}

.support-assist-remote-cursor.hidden {
  display: none;
}

.support-assist-remote-cursor-label {
  position: absolute;
  top: 18px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #06b6d4;
  color: #fff;
  font-size: 0.72rem;
  white-space: nowrap;
}

body.support-assist-spectator-active .app-shell,
body.support-assist-spectator-active .auth-overlay,
body.support-assist-spectator-active .topbar,
body.support-assist-spectator-active main {
  pointer-events: none !important;
  user-select: none !important;
}

body.support-assist-spectator-active.support-assist-spectator-login-ready .auth-overlay,
body.support-assist-spectator-active.support-assist-spectator-login-ready .auth-panel,
body.support-assist-spectator-active.support-assist-spectator-login-ready .auth-form,
body.support-assist-spectator-active.support-assist-spectator-login-ready #loginForm,
body.support-assist-spectator-active.support-assist-spectator-login-ready #loginForm input,
body.support-assist-spectator-active.support-assist-spectator-login-ready #loginForm select,
body.support-assist-spectator-active.support-assist-spectator-login-ready #loginForm button,
body.support-assist-spectator-active.support-assist-spectator-login-ready #loginSupportNotice {
  pointer-events: auto !important;
  user-select: auto !important;
  cursor: auto !important;
}

body.support-assist-spectator-active input,
body.support-assist-spectator-active select,
body.support-assist-spectator-active textarea,
body.support-assist-spectator-active button,
body.support-assist-spectator-active a {
  cursor: not-allowed !important;
}

.auth-lang-field {
  display: grid;
  gap: 6px;
  width: 100%;
}

.auth-lang-field > span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #47505c;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-lang-field > span::before {
  content: "🌐";
  font-size: 0.78rem;
  line-height: 1;
}

.auth-lang-select-shell {
  position: relative;
  width: 100%;
}

.auth-lang-trigger {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 32px 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(20, 27, 34, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 250, 0.92)),
    radial-gradient(circle at top left, rgba(217, 93, 57, 0.1), transparent 42%);
  color: #1b2430;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 24px rgba(20, 27, 34, 0.08);
  cursor: pointer;
}

.auth-lang-trigger::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: #5a6572;
  pointer-events: none;
}

.auth-lang-trigger:focus-visible {
  outline: 2px solid rgba(15, 76, 92, 0.34);
  outline-offset: 1px;
}

.auth-lang-trigger-flag {
  flex: 0 0 auto;
}

.auth-lang-trigger-code {
  line-height: 1;
}

.auth-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  display: none;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(20, 27, 34, 0.08);
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 18px 34px rgba(20, 27, 34, 0.16);
  z-index: 20;
}

.auth-lang-select-shell.is-open .auth-lang-menu {
  display: grid;
}

.auth-lang-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1b2430;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
}

.auth-lang-option:hover,
.auth-lang-option[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(15, 76, 92, 0.1), rgba(217, 93, 57, 0.12));
}

.auth-lang-option:focus-visible {
  outline: 2px solid rgba(15, 76, 92, 0.28);
  outline-offset: 1px;
}

.auth-lang-option-flag {
  flex: 0 0 auto;
}

.auth-lang-option-code {
  line-height: 1;
}

.auth-lang-flag {
  display: inline-block;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(20, 27, 34, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.auth-lang-flag[data-flag="de"] {
  background: linear-gradient(180deg, #111111 0 33.33%, #cf2027 33.33% 66.66%, #f3c216 66.66% 100%);
}

.auth-lang-flag[data-flag="fr"] {
  background: linear-gradient(90deg, #1f4fb2 0 33.33%, #f8f8f8 33.33% 66.66%, #d53032 66.66% 100%);
}

.auth-lang-flag[data-flag="it"] {
  background: linear-gradient(90deg, #229b5b 0 33.33%, #f8f8f8 33.33% 66.66%, #d53032 66.66% 100%);
}

.auth-lang-flag[data-flag="es"] {
  background: linear-gradient(180deg, #c41f2b 0 24%, #f1c230 24% 76%, #c41f2b 76% 100%);
}

.auth-lang-flag[data-flag="pl"] {
  background: linear-gradient(180deg, #fcfcfc 0 50%, #d83a4d 50% 100%);
}

.auth-lang-flag[data-flag="ar"] {
  background:
    linear-gradient(180deg, transparent 0 44%, rgba(255,255,255,0.9) 44% 56%, transparent 56% 100%),
    #0b8a43;
}

.auth-lang-flag[data-flag="tr"] {
  background:
    radial-gradient(circle at 42% 50%, #ffffff 0 18%, transparent 19%),
    radial-gradient(circle at 47% 50%, #d52331 0 14%, transparent 15%),
    radial-gradient(circle at 61% 50%, #ffffff 0 6%, transparent 7%),
    #d52331;
}

.auth-lang-flag[data-flag="en"] {
  background:
    linear-gradient(90deg, transparent 0 37%, #ffffff 37% 63%, transparent 63% 100%),
    linear-gradient(180deg, transparent 0 37%, #ffffff 37% 63%, transparent 63% 100%),
    linear-gradient(90deg, transparent 0 43%, #c8102e 43% 57%, transparent 57% 100%),
    linear-gradient(180deg, transparent 0 43%, #c8102e 43% 57%, transparent 57% 100%),
    #012169;
}

.auth-lang-select-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.auth-system-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.auth-system-card {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(23, 23, 23, 0.08);
}

.auth-system-card span {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4f554f;
}

.auth-system-card strong {
  font-size: 0.84rem;
  color: #1f2321;
  word-break: break-word;
}

.auth-system-card.full-width {
  grid-column: 1 / -1;
}

.auth-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.website-logo {
  display: block;
  max-width: 220px;
  max-height: 88px;
  object-fit: contain;
}

.website-logo-sidebar {
  margin-bottom: 14px;
  width: min(100%, 220px);
  max-width: 220px;
  max-height: 64px;
  padding: 10px 12px;
  object-fit: contain;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(5, 8, 22, 0.88));
  border: 1px solid rgba(103, 232, 249, 0.22);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(168, 85, 247, 0.12);
}

.website-logo-feedback {
  margin: 0 auto 8px;
  max-width: 180px;
  max-height: 72px;
}

.access-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 38px);
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background 200ms ease;
}

.access-feedback-overlay.feedback-in {
  background:
    radial-gradient(circle at 24% 16%, rgba(150, 255, 208, 0.3), rgba(150, 255, 208, 0) 40%),
    radial-gradient(circle at 80% 84%, rgba(70, 201, 157, 0.28), rgba(70, 201, 157, 0) 42%),
    rgba(15, 55, 43, 0.74);
}

.access-feedback-overlay.feedback-out {
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 219, 128, 0.28), rgba(255, 219, 128, 0) 38%),
    radial-gradient(circle at 82% 80%, rgba(253, 174, 103, 0.26), rgba(253, 174, 103, 0) 40%),
    rgba(61, 37, 16, 0.74);
}

.access-feedback-overlay.feedback-error {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 160, 160, 0.3), rgba(255, 160, 160, 0) 42%),
    radial-gradient(circle at 82% 82%, rgba(255, 82, 82, 0.28), rgba(255, 82, 82, 0) 44%),
    rgba(72, 18, 18, 0.78);
}

.access-feedback-card {
  width: min(100%, 920px);
  text-align: center;
  border-radius: 30px;
  padding: clamp(24px, 5vw, 46px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 34px 88px rgba(0, 0, 0, 0.36);
  animation: access-feedback-pop 220ms ease-out;
}

.access-feedback-photo {
  width: clamp(124px, 19vw, 186px);
  height: clamp(154px, 24vw, 236px);
  object-fit: cover;
  border-radius: 22px;
  border: 3px solid rgba(23, 23, 23, 0.08);
  display: block;
  margin: 0 auto 16px;
  background: rgba(23, 23, 23, 0.06);
}

.access-feedback-card h3 {
  margin: 0;
  letter-spacing: 0.04em;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
}

.access-feedback-card p {
  margin: 12px 0 0;
  color: #1f252c;
  font-weight: 600;
  font-size: clamp(0.98rem, 2.2vw, 1.2rem);
  line-height: 1.4;
}

.access-feedback-overlay.feedback-error .access-feedback-card {
  border-color: rgba(197, 61, 47, 0.36);
}

@keyframes access-feedback-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 700px) {
  .access-feedback-card {
    border-radius: 22px;
    width: 100%;
  }
}

.worker-app-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 19, 26, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.worker-app-qr-card {
  width: min(100%, 460px);
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 251, 245, 0.98);
  border: 1px solid rgba(18, 21, 24, 0.08);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
  color: #1a2332;
}

.worker-app-qr-card h3,
.worker-app-qr-card p,
.worker-app-qr-card label,
.worker-app-qr-card strong {
  color: #1a2332;
}

.worker-app-qr-card .helper-text {
  color: #4b5563;
}

.worker-app-qr-card input,
.worker-app-qr-card select,
.worker-app-qr-card textarea {
  background: #ffffff;
  color: #121518;
  border: 1px solid rgba(18, 21, 24, 0.18);
}

body.theme-black .worker-app-qr-card {
  background: rgba(22, 27, 36, 0.98);
  color: #f0f4f8;
  border-color: rgba(255, 255, 255, 0.14);
}

body.theme-black .worker-app-qr-card h3,
body.theme-black .worker-app-qr-card p,
body.theme-black .worker-app-qr-card label,
body.theme-black .worker-app-qr-card strong {
  color: #f0f4f8;
}

body.theme-black .worker-app-qr-card .app-confirm-message {
  color: #f0f4f8 !important;
}

body.theme-black .worker-app-qr-card .helper-text {
  color: #94a3b8;
}

body.theme-black .worker-app-qr-card input,
body.theme-black .worker-app-qr-card select,
body.theme-black .worker-app-qr-card textarea {
  background: #0f1419;
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.2);
}

.worker-app-qr-card h3,
.worker-app-qr-card p {
  margin: 0;
}

.turnstile-secret-card {
  width: min(100%, 540px);
}

.worker-export-dialog {
  width: min(100%, 420px);
  gap: 16px;
}

.worker-export-title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.2;
  color: #18212b;
}

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

.worker-export-check,
.worker-export-field {
  display: grid;
  gap: 8px;
  color: #1b2430;
}

.worker-export-check {
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(18, 21, 24, 0.05);
  border: 1px solid rgba(18, 21, 24, 0.08);
  cursor: pointer;
}

.worker-export-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.worker-export-check span,
.worker-export-field span {
  font-weight: 700;
  color: #18212b;
}

.worker-export-field select,
.worker-export-field input {
  width: 100%;
  background: #ffffff;
  color: #1b2430;
}

.worker-export-field-hidden {
  display: none;
}

.worker-export-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.turnstile-secret-copy {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(18, 21, 24, 0.06);
  border: 1px solid rgba(18, 21, 24, 0.08);
}

.turnstile-secret-copy span {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: break-word;
}

.worker-app-qr-card img {
  width: min(100%, 320px);
  margin: 8px auto;
  border-radius: 14px;
  border: 1px solid rgba(18, 21, 24, 0.1);
  background: #fff;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
  margin-top: 2px;
  flex-shrink: 0;
}

.auth-form label:has(#loginUsername),
.auth-form label:has(#loginPassword),
.auth-form label:has(#loginSupportNotice),
.auth-form > .primary-button,
.auth-form > .ghost-button,
.auth-form #loginSupportNotice {
  grid-column: 1 / -1;
}

.auth-form label:has(#loginOtpCode) {
  grid-column: 1;
}

.auth-form label:has(#loginScope) {
  grid-column: 2;
}

.auth-form label {
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-form input,
.auth-form select {
  padding: 8px 10px;
  font-size: 0.86rem;
  border-radius: 9px;
  background: #ffffff;
  color: #1b2430;
  border-color: rgba(20, 27, 34, 0.14);
}

.auth-form .primary-button,
.auth-form .ghost-button {
  padding: 9px 12px;
  font-size: 0.86rem;
  border-radius: 9px;
  min-height: 36px;
  margin-top: 0;
  margin-bottom: 0;
}

.auth-form #loginSupportNotice {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255, 241, 228, 0.94));
  border: 1px solid rgba(217, 93, 57, 0.24);
  color: #1f2937;
}

.auth-form #loginSupportNotice,
.auth-form #loginSupportNotice p,
.auth-form #loginSupportNotice span,
.auth-form #loginSupportNotice strong {
  color: #1f2937;
}

.auth-panel input.invoice-field-invalid,
.auth-panel select.invoice-field-invalid,
.auth-panel textarea.invoice-field-invalid {
  border-color: rgba(197, 61, 47, 0.9) !important;
  box-shadow: 0 0 0 3px rgba(197, 61, 47, 0.14);
}

input.invoice-field-invalid,
select.invoice-field-invalid,
textarea.invoice-field-invalid {
  border-color: #c53d2f !important;
  box-shadow: 0 0 0 3px rgba(197, 61, 47, 0.18);
}

input.invoice-field-valid,
select.invoice-field-valid,
textarea.invoice-field-valid {
  border-color: #148a4b !important;
  box-shadow: 0 0 0 3px rgba(20, 138, 75, 0.2);
}

.invoice-field-error-hint {
  margin-top: 2px;
}

/* Login-Buttons: einheitlich (kein Orange-Blau-Split aus theme-black) */
.auth-panel .primary-button {
  background: linear-gradient(135deg, #a855f7 0%, #d35410 100%) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 8px 20px rgba(217, 93, 57, 0.28) !important;
}

.auth-panel .primary-button::after {
  display: none;
}

.auth-panel .ghost-button {
  background: #fff !important;
  color: #1b2430 !important;
  border: 1px solid rgba(20, 27, 34, 0.14) !important;
  box-shadow: none !important;
}

.auth-panel .ghost-button::after {
  display: none;
}

.auth-legal-footer .ghost-button {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #374151 !important;
  border: 1px solid rgba(20, 27, 34, 0.12) !important;
}

.auth-hints .meta-box.install-box {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(20, 27, 34, 0.1);
  color: #1b2430;
}

.auth-hints .install-box .ghost-button {
  background: #f3f4f6 !important;
  color: #1b2430 !important;
  border: 1px solid rgba(20, 27, 34, 0.12) !important;
}

.auth-form .primary-button {
  margin-top: 0;
  margin-bottom: 0;
}

.auth-hints {
  display: block;
  flex-shrink: 0;
  margin-top: 2px;
}

.auth-hints .meta-box.install-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 7px 10px;
  font-size: 0.76rem;
}

.auth-hints .install-box .helper-text {
  display: none;
}

.auth-hints .install-box > p {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
}

.auth-hints .install-box .ghost-button {
  padding: 5px 10px;
  font-size: 0.74rem;
  min-height: 28px;
  width: auto;
}

.auth-legal-footer {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding-top: 0;
  flex-shrink: 0;
  font-size: 0.74rem;
  color: var(--muted, #6b7280);
}

.auth-legal-footer .ghost-button.small-button {
  font-size: 0.82rem;
  padding: 2px 8px;
}

.legal-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legal-modal.hidden {
  display: none;
}

.legal-modal-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.18);
  padding: 28px 32px 24px 32px;
  max-width: 660px;
  width: 95vw;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}

.legal-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
}

.legal-modal-body {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.65;
  margin-top: 12px;
  color: var(--text, #1f2937);
}

.install-box {
  display: grid;
  gap: 12px;
}

@media (max-height: 640px) {
  .auth-system-grid {
    display: none;
  }

  .auth-hints {
    display: none;
  }
}

@media (max-width: 420px) {
  .auth-form {
    grid-template-columns: 1fr;
  }

  .auth-form label:has(#loginOtpCode),
  .auth-form label:has(#loginScope) {
    grid-column: 1 / -1;
  }
}

.topbar {
  position: sticky;
  top: 0;
  left: auto;
  right: auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 30px rgba(35, 24, 14, 0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.topbar-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 280px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 620px;
}

.support-readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(178, 84, 0, 0.32);
  border-left: 4px solid #c15b00;
  background: linear-gradient(140deg, rgba(255, 241, 222, 0.95), rgba(255, 228, 194, 0.92));
  color: #7a3600;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(107, 52, 0, 0.16);
}

.support-readonly-badge::before {
  content: "\1F512";
  font-size: 0.86rem;
  line-height: 1;
}

.theme-black .support-readonly-badge {
  border-color: rgba(255, 176, 102, 0.46);
  border-left-color: #ffb066;
  background: linear-gradient(140deg, rgba(91, 52, 14, 0.88), rgba(72, 39, 10, 0.9));
  color: #ffd6ae;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.support-readonly-badge-flash {
  animation: support-readonly-pulse 1.2s ease-out 1;
}

@keyframes support-readonly-pulse {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 0 rgba(193, 91, 0, 0.38);
  }
  55% {
    transform: scale(1.02);
    box-shadow: 0 0 0 8px rgba(193, 91, 0, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 6px 16px rgba(107, 52, 0, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-readonly-badge-flash {
    animation: none;
  }
}

.superadmin-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(22, 94, 216, 0.32);
  background: linear-gradient(140deg, rgba(232, 242, 255, 0.95), rgba(220, 248, 242, 0.88));
  box-shadow: 0 6px 16px rgba(14, 42, 82, 0.14);
}

.superadmin-preview-pill-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #123c72;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.superadmin-preview-pill-close {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 0.74rem;
}

.ui-lang-select {
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(18, 21, 24, 0.18);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: #121518;
}
body.theme-black .ui-lang-select {
  border-color: rgba(255, 255, 255, 0.22);
  color: #f5f5f5;
  background: rgba(17, 17, 17, 0.85);
}

.session-card {
  display: grid;
  gap: 2px;
  min-width: 210px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(23, 23, 23, 0.08);
}

.session-card strong,
.session-card span {
  display: block;
}

.system-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(197, 61, 47, 0.24);
  background: rgba(255, 247, 245, 0.88);
}

.superadmin-simulation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(12, 17, 23, 0.16);
  background: linear-gradient(135deg, rgba(235, 245, 255, 0.96), rgba(229, 255, 247, 0.9));
  box-shadow: 0 10px 24px rgba(12, 17, 23, 0.14);
}

.superadmin-simulation-main {
  display: grid;
  gap: 3px;
}

.superadmin-simulation-main strong {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0f3559;
}

.superadmin-simulation-main span {
  font-size: 0.84rem;
  color: #244861;
  font-weight: 700;
}

.superadmin-simulation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.superadmin-simulation-close {
  min-height: 30px;
  font-size: 0.76rem;
}

.superadmin-simulation-bar.simulation-construction {
  border-color: rgba(22, 120, 87, 0.38);
  background: linear-gradient(135deg, rgba(225, 255, 244, 0.96), rgba(255, 243, 225, 0.9));
}

.superadmin-simulation-bar.simulation-industry {
  border-color: rgba(22, 94, 216, 0.36);
  background: linear-gradient(135deg, rgba(230, 240, 255, 0.96), rgba(234, 241, 250, 0.9));
}

.superadmin-simulation-bar.simulation-premium {
  border-color: rgba(203, 139, 27, 0.4);
  background: linear-gradient(135deg, rgba(255, 247, 222, 0.96), rgba(235, 255, 247, 0.9));
}

.system-alert-banner p {
  margin: 4px 0 0;
}

.system-alert-banner-warn {
  border-color: rgba(221, 140, 36, 0.34);
  background: rgba(255, 248, 235, 0.9);
}

.system-alert-banner-alert {
  border-color: rgba(197, 61, 47, 0.4);
  background: rgba(255, 240, 236, 0.92);
  box-shadow: 0 0 0 1px rgba(197, 61, 47, 0.14) inset;
}

@media (max-width: 860px) {
  .system-alert-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .superadmin-simulation-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .superadmin-simulation-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .superadmin-preview-pill {
    width: 100%;
    justify-content: space-between;
  }

  .superadmin-preview-pill-label {
    white-space: normal;
  }
}

.view {
  display: none;
  animation: fade-up 260ms ease;
}

.view.active:not(.view-embed) {
  display: block;
}

.view.active > * {
  animation: fade-up 320ms ease both;
}

.view.active > *:nth-child(2) {
  animation-delay: 70ms;
}

.view.active > *:nth-child(3) {
  animation-delay: 130ms;
}

.hero-panel,
.panel,
.stat-card {
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  margin-bottom: 14px;
  border-radius: var(--radius-xl);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(202, 90, 45, 0.13), transparent 42%),
    radial-gradient(circle at 84% 12%, rgba(42, 113, 119, 0.16), rgba(42, 113, 119, 0));
}

.hero-panel p {
  max-width: 720px;
  margin: 8px 0 0;
  line-height: 1.45;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hero-badges span,
.badge-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 600;
  background: rgba(202, 90, 45, 0.14);
  color: var(--accent-dark);
}

.hero-panel .hero-badges span {
  font-size: 0.9rem;
  box-shadow: 0 2px 8px 0 rgba(227,100,20,0.10);
}

.stats-grid,
.panel-grid {
  display: grid;
  gap: 14px;
}

/* Panels untereinander (volle Breite) – vermeidet halbe leere Seite + Höhen-Lücken */
.panel-grid.two-columns {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  height: auto;
  gap: 20px;
  padding: 0;
  align-items: stretch;
}

.panel-grid.two-columns > .panel,
.panel-grid.two-columns > article.panel {
  width: 100%;
  min-width: 0;
}

/* Optional: zwei gleichwertige Karten nur auf sehr breiten Bildschirmen */
@media (min-width: 1500px) {
  .panel-grid.two-columns.layout-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 14px;
}

.dashboard-panel-loading {
  min-height: 3.5rem;
  display: flex;
  align-items: center;
}

.panel .stats-grid {
  margin-bottom: 0;
}

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

.stat-card,
.panel {
  border-radius: var(--radius-lg);
}

.stat-card {
  padding: 16px 18px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  position: relative;
}

.stat-card-critical {
  border-color: #e55a2b;
  background: #fff5f2;
}

.stat-card-critical strong {
  color: #c0392b;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, rgba(202, 90, 45, 0.92), rgba(42, 113, 119, 0.82));
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 44px rgba(35, 24, 14, 0.2);
}

.stat-label,
.stat-detail {
  margin: 0;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat-card .stat-label {
  color: #a855f7;
  font-weight: 700;
}

.stat-value {
  display: block;
  margin: 12px 0 6px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-family: "Space Grotesk", sans-serif;
}

.stat-card .stat-value {
  color: #06b6d4;
  font-weight: 700;
}

.panel {
  padding: 22px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 42px rgba(35, 24, 14, 0.18);
}

.invoice-preview-frame {
  width: 100%;
  min-height: 560px;
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: 14px;
  background: #ffffff;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(18, 21, 24, 0.08);
}

.panel-heading .eyebrow {
  color: #a855f7;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
}

.panel-heading h3 {
  margin: 0;
  color: #06b6d4;
  font-size: 1.65rem;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-weight: 700;
}

.accent-panel {
  background: linear-gradient(145deg, rgba(255, 235, 220, 0.9), rgba(255, 250, 244, 0.86));
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-grid {
  grid-template-columns: 1fr 1fr;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-geo-btn {
  position: absolute;
  top: 50%;
  right: 0.28rem;
  transform: translateY(-50%);
  z-index: 2;
  width: 1.72rem;
  height: 1.72rem;
  padding: 0;
  min-height: 1.72rem;
  min-width: 1.72rem;
  font-size: 0.68rem;
  border-radius: 999px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.18);
  color: rgba(125, 211, 252, 0.92);
  box-shadow: none;
  overflow: hidden;
}

.site-geo-icon {
  width: 0.82rem;
  height: 0.82rem;
  fill: currentColor;
  display: block;
}

.site-geo-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #ffffff;
}

.site-geo-btn:focus-visible {
  outline: 1px solid rgba(56, 189, 248, 0.5);
  outline-offset: 1px;
}

.site-geo-btn::after {
  content: none;
}

.site-input-shell {
  position: relative;
  width: 100%;
}

.site-input-shell input {
  width: 100%;
  padding-inline-end: 2.45rem;
  box-sizing: border-box;
}

input,
select {
  width: 100%;
  padding: 14px 15px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus {
  border-color: rgba(217, 93, 57, 0.66);
  box-shadow: 0 0 0 4px rgba(217, 93, 57, 0.12);
}

.primary-button,
.ghost-button {
  position: relative;
  overflow: hidden;
  border: 0;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.small-button {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
}

.btn-danger {
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
  background: rgba(254, 226, 226, 0.7) !important;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(254, 202, 202, 0.9) !important;
}

.btn-warning {
  color: #92400e !important;
  border-color: #fcd34d !important;
  background: rgba(254, 243, 199, 0.7) !important;
}
.btn-warning:hover:not(:disabled) {
  background: rgba(253, 230, 138, 0.9) !important;
}

.btn-success {
  color: #065f46 !important;
  border-color: #6ee7b7 !important;
  background: rgba(209, 250, 229, 0.7) !important;
}
.btn-success:hover:not(:disabled) {
  background: rgba(167, 243, 208, 0.9) !important;
}

.primary-button {
  color: var(--button-text, var(--text));
  background: var(--button-bg, var(--surface-strong));
  border: 1px solid var(--button-border, var(--line));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.ghost-button {
  color: var(--button-text, var(--text));
  background: var(--button-bg, var(--surface-strong));
  border: 1px solid var(--button-border, var(--line));
}

.topbar .ghost-button::after,
.topbar .primary-button::after,
.enterprise-embed-toolbar .ghost-button::after,
.enterprise-embed-toolbar .primary-button::after {
  display: none;
}

.primary-button::after,
.ghost-button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transition: transform 260ms ease;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover::after,
.ghost-button:hover::after {
  transform: translateX(120%);
}

.full-width {
  grid-column: 1 / -1;
}

.camera-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px dashed rgba(23, 23, 23, 0.12);
}

.compliance-signature-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 122, 0, 0.06);
  border: 1px solid rgba(255, 122, 0, 0.22);
}

.compliance-signature-block h4 {
  margin: 0;
  font-size: 1.05rem;
}

.signotec-bridge-setup {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.signotec-bridge-setup.hidden {
  display: none;
}

.signotec-bridge-setup h5 {
  margin: 4px 0 8px;
  font-size: 0.98rem;
}

.signotec-bridge-steps {
  margin: 0 0 10px;
  padding-left: 1.1rem;
  display: grid;
  gap: 6px;
}

.signotec-bridge-step {
  font-size: 0.88rem;
  color: rgba(23, 23, 23, 0.55);
}

.signotec-bridge-step[data-state="ok"] {
  color: #15803d;
  font-weight: 600;
}

.signotec-bridge-step[data-state="ok"]::marker {
  content: "✓ ";
}

.signotec-bridge-step[data-state="pending"] {
  color: #c2410c;
  font-weight: 600;
}

.signotec-bridge-status {
  min-height: 1.2em;
  color: #b45309;
}

.signotec-bridge-firefox {
  color: #1d4ed8;
  font-weight: 600;
}

.signotec-bridge-actions {
  flex-wrap: wrap;
}

.worker-form-step-indicator {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.worker-form-step {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
  color: rgba(23, 23, 23, 0.55);
}

.worker-form-step.active {
  background: rgba(255, 122, 0, 0.14);
  color: #c2410c;
  border: 1px solid rgba(255, 122, 0, 0.35);
}

.worker-form-phase.full-width {
  grid-column: 1 / -1;
  display: contents;
}

.input-with-embedded-action {
  position: relative;
  display: block;
  width: 100%;
}

.input-with-embedded-action > input {
  width: 100%;
  padding-right: 34px;
}

.input-embedded-action-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent, #2563eb) 12%, transparent);
  color: var(--accent, #2563eb);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.input-embedded-action-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent, #2563eb) 20%, transparent);
}

.input-embedded-action-btn:active:not(:disabled) {
  transform: translateY(-50%) scale(0.94);
}

.input-embedded-action-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.input-embedded-action-icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
  pointer-events: none;
}

.input-embedded-action-btn.is-loading .input-embedded-action-icon {
  animation: site-geo-spin 0.85s linear infinite;
}

@keyframes site-geo-spin {
  to {
    transform: rotate(360deg);
  }
}

.visitor-duration-row {
  display: grid;
  gap: 8px;
}

.visitor-duration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.worker-only-fields.full-width {
  grid-column: 1 / -1;
  display: contents;
}

.signature-pad-wrap {
  border-radius: 12px;
  border: 1px solid rgba(23, 23, 23, 0.15);
  background: #fff;
  overflow: hidden;
  touch-action: none;
}

#complianceSignatureCanvas {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  cursor: crosshair;
}

.signature-canvas-hint {
  margin: 0;
  padding: 6px 10px 8px;
  font-size: 0.82rem;
  color: rgba(23, 23, 23, 0.55);
  text-align: center;
}

.worker-detail-signature {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(23, 23, 23, 0.08);
}

.worker-detail-signature img {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.camera-preview-wrap {
  position: relative;
  min-height: 260px;
  height: clamp(260px, 48vw, 420px);
  overflow: hidden;
  border-radius: 18px;
  background: #111417;
}

#cameraPreview,
.captured-photo {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(135deg, rgba(18, 20, 23, 0.88), rgba(18, 20, 23, 0.42));
}

.camera-guide {
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.22);
}

.camera-guide::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  width: min(70%, 230px);
  aspect-ratio: 3 / 4;
  transform: translateX(-50%);
  border-radius: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
}

.camera-actions {
  display: flex;
  gap: 12px;
}

.camera-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.camera-option input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.turnstile-quick-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.quick-panel-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(23, 23, 23, 0.06);
}

.turnstile-tap-live {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(23, 23, 23, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

.turnstile-tap-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8a919b;
  box-shadow: 0 0 0 0 rgba(138, 145, 155, 0.45);
}

.turnstile-tap-live.is-idle {
  border-color: rgba(23, 23, 23, 0.14);
}

.turnstile-tap-live.is-idle .turnstile-tap-dot {
  background: #8a919b;
}

.turnstile-tap-live.is-pending {
  border-color: rgba(200, 129, 7, 0.35);
  background: rgba(255, 244, 214, 0.8);
}

.turnstile-tap-live.is-pending .turnstile-tap-dot {
  background: #d08a0f;
  animation: turnstile-tap-pulse 900ms ease-in-out infinite;
}

.turnstile-tap-live.is-success {
  border-color: rgba(22, 120, 87, 0.36);
  background: rgba(218, 248, 236, 0.86);
}

.turnstile-tap-live.is-success .turnstile-tap-dot {
  background: #167857;
  animation: turnstile-tap-pulse 780ms ease-out 1;
}

.turnstile-tap-live.is-error {
  border-color: rgba(197, 61, 47, 0.38);
  background: rgba(252, 228, 225, 0.9);
}

.turnstile-tap-live.is-error .turnstile-tap-dot {
  background: #c53d2f;
  animation: turnstile-tap-pulse 700ms ease-out 1;
}

@keyframes turnstile-tap-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 120, 87, 0.42);
    transform: scale(1);
  }
  65% {
    box-shadow: 0 0 0 10px rgba(22, 120, 87, 0);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 120, 87, 0);
    transform: scale(1);
  }
}

.turnstile-card-input {
  width: 100%;
  border: 2px solid rgba(22, 120, 87, 0.26);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.92);
}

.turnstile-card-input:focus {
  outline: none;
  border-color: rgba(22, 120, 87, 0.7);
  box-shadow: 0 0 0 4px rgba(22, 120, 87, 0.16);
}

/* --- Future-forward visual layer for company-facing UI --- */
:root {
  --future-cyan: #4be3d1;
  --future-orange: #ff8e3c;
  --future-ink: #0c1117;
  --future-glow: 0 0 0 1px rgba(75, 227, 209, 0.18), 0 22px 48px rgba(12, 17, 23, 0.24);
}

body.tenant-white-label .sidebar-card-label,
body.tenant-white-label [data-ui-i18n="sidebarEyebrow"] {
  /* Firmenname statt Plattform-Label — wird per JS gesetzt */
}

body.tenant-white-label .website-logo-sidebar:not(.hidden) {
  display: block !important;
}
  --future-cyan: #4be3d1;
  --future-orange: #ff8e3c;
}

body[data-branding-preset="industry"] {
  --future-cyan: #61b6ff;
  --future-orange: #7e94aa;
}

body[data-branding-preset="premium"] {
  --future-cyan: #2cd5bc;
  --future-orange: #f3b34c;
}

.content {
  position: relative;
}

.content::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, var(--future-cyan), var(--future-orange) 40%, var(--future-cyan)),
    repeating-linear-gradient(0deg, rgba(12, 17, 23, 0.03) 0, rgba(12, 17, 23, 0.03) 1px, transparent 1px, transparent 24px);
  border-radius: 24px;
  opacity: 0.12;
}

.panel,
.hero-panel,
.stat-card,
.quick-panel-card,
.porter-live-card,
.worker-app-qr-card,
.access-feedback-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.topbar {
  overflow: visible;
  isolation: isolate;
}

.topbar::after,
.panel::after,
.hero-panel::after,
.stat-card::after,
.quick-panel-card::after,
.porter-live-card::after,
.worker-app-qr-card::after,
.access-feedback-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.03) 45%, rgba(75, 227, 209, 0.06));
  z-index: 0;
}

.topbar::after {
  display: none;
}

.topbar-actions {
  position: relative;
  z-index: 2;
}

.topbar-actions .ghost-button,
.topbar-actions .primary-button,
.topbar-actions .topbar-more-menu > summary {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #121518 !important;
  border: 1px solid rgba(20, 27, 34, 0.14) !important;
  box-shadow: 0 4px 14px rgba(35, 24, 14, 0.08) !important;
  overflow: hidden;
}

.topbar-actions .ghost-button:hover,
.topbar-actions .primary-button:hover,
.topbar-actions .topbar-more-menu > summary:hover {
  color: #0a0d10 !important;
  background: #ffffff !important;
}

.panel,
.hero-panel,
.stat-card,
.quick-panel-card,
.porter-live-card {
  border: 1px solid rgba(12, 17, 23, 0.08);
  box-shadow: var(--future-glow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.panel:hover,
.stat-card:hover,
.quick-panel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(75, 227, 209, 0.28), 0 30px 68px rgba(12, 17, 23, 0.28);
}

.eyebrow {
  text-shadow: 0 0 18px rgba(75, 227, 209, 0.22);
}

.nav-link.active,
.nav-link:hover {
  box-shadow: 0 10px 24px rgba(12, 17, 23, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.primary-button {
  background: var(--button-bg, var(--surface-strong));
  border: 1px solid var(--button-border, var(--line));
}

.ghost-button {
  border-color: var(--button-border, var(--line));
  background: var(--button-bg, var(--surface-strong));
}

.status-pill {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 6px 16px rgba(12, 17, 23, 0.18);
}

.turnstile-card-input,
#turnstileQuickSearch,
#accessGate,
#accessNote,
#workerSearchInput {
  border: 1px solid rgba(12, 17, 23, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 255, 0.9));
}

.turnstile-card-input:focus,
#turnstileQuickSearch:focus,
#accessGate:focus,
#accessNote:focus,
#workerSearchInput:focus {
  box-shadow: 0 0 0 4px rgba(75, 227, 209, 0.18);
}

[data-company-branding-select] {
  min-width: 150px;
  border-radius: 10px;
  border: 1px solid rgba(12, 17, 23, 0.14);
  background: rgba(255, 255, 255, 0.85);
  padding: 7px 10px;
}

.company-branding-preview {
  width: 36px;
  height: 18px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(12, 17, 23, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.company-branding-preview.preview-construction {
  background: linear-gradient(120deg, #1a2d3d, #0f1923 40%, #1a2d3d);
}

.company-branding-preview.preview-industry {
  background: linear-gradient(120deg, #e65c00, #ff9a3c 40%, #e65c00);
}

.company-branding-preview.preview-premium {
  background: linear-gradient(120deg, #1565c0, #42a5f5 40%, #1565c0);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-panel,
  .panel,
  .stat-card,
  .quick-panel-card {
    animation: future-fade-in 420ms ease-out;
  }
}

@keyframes future-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.porter-live-card {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(23, 23, 23, 0.08);
}

.porter-live-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.porter-head {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
}

.porter-photo {
  width: 92px;
  height: 112px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(23, 23, 23, 0.1);
}

.porter-head strong {
  display: block;
  margin-bottom: 4px;
}

.porter-head span {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.porter-event {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(22, 120, 87, 0.12);
  color: #145d45;
  font-weight: 600;
}

.porter-event.muted {
  background: rgba(23, 23, 23, 0.06);
  color: var(--muted);
  font-weight: 500;
}

.porter-feed {
  display: grid;
  gap: 10px;
}

.porter-feed-list {
  display: grid;
  gap: 8px;
}

.porter-feed-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.porter-feed-check-in {
  background: rgba(22, 120, 87, 0.1);
}

.porter-feed-check-out {
  background: rgba(217, 93, 57, 0.1);
}

.porter-feed-photo {
  width: 56px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(23, 23, 23, 0.1);
}

.porter-feed-copy {
  display: grid;
  gap: 2px;
}

.porter-feed-copy strong {
  display: block;
}

.porter-feed-copy span {
  color: var(--muted);
  line-height: 1.3;
}

.porter-feed-empty {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(23, 23, 23, 0.06);
  color: var(--muted);
}

.porter-company-summary {
  margin-top: 6px;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.78);
}

.porter-company-summary > strong {
  color: #0f172a;
  font-size: 0.9rem;
}

.porter-company-list {
  display: grid;
  gap: 6px;
}

.porter-company-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(15, 76, 92, 0.08);
  color: #0b2430;
  font-size: 0.9rem;
}

.porter-company-count {
  min-width: 26px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 76, 92, 0.14);
  font-weight: 700;
}

.porter-company-summary.empty {
  background: rgba(23, 23, 23, 0.05);
}

/* Duplikat-Buchung Fehler-Banner im Zutrittsformular */
.access-duplicate-error {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.10);
  border: 1.5px solid rgba(220, 38, 38, 0.38);
  color: #991b1b;
  font-weight: 600;
  font-size: 0.92rem;
  animation: duplicateErrorShake 0.34s ease;
}
.access-duplicate-error::before {
  content: "⛔";
  font-size: 1.1rem;
  flex-shrink: 0;
}
@keyframes duplicateErrorShake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}
.access-duplicate-error.hidden { display: none !important; }

/* Porter: Firmen-Gesamtzahl-Leiste */
.porter-company-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 76, 92, 0.14);
  font-weight: 700;
  font-size: 0.95rem;
  color: #0b2430;
}
.porter-company-total .porter-company-count {
  background: rgba(15, 76, 92, 0.22);
}
.access-entry-layout {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}

.access-entry-photo {
  width: 56px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(23, 23, 23, 0.1);
  background: rgba(23, 23, 23, 0.08);
}

.access-entry-copy {
  display: grid;
  gap: 4px;
}

.access-entry-copy header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.access-entry-copy header div {
  display: grid;
  gap: 2px;
}

.access-entry-copy span {
  color: var(--muted);
  line-height: 1.3;
}

#recentAccessList.list {
  width: 100% !important;
  max-width: unset !important;
  min-width: unset !important;
  height: 100% !important;
  min-height: 320px;
  max-height: 480px;
  box-sizing: border-box !important;
  overflow-y: auto;
  background: #f6efe2;
  border-radius: 18px;
  padding: 18px 0 18px 0;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px 0 rgba(202,90,45,0.04);
}

.access-entry-time-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}

.access-entry-clock {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-primary, #142a44);
}

.access-entry-day {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #607995);
}

.access-entry-direction {
  font-weight: 700;
}

.recent-access-item.access-entry-arrival {
  border-left: 4px solid #16a34a;
}

.recent-access-item.access-entry-departure {
  border-left: 4px solid #64748b;
}

.recent-access-item.access-entry-arrival .access-entry-direction {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.recent-access-item.access-entry-departure .access-entry-direction {
  background: rgba(100, 116, 139, 0.12);
  color: #334155;
}

.access-entry-note {
  color: var(--text-muted, #607995);
  font-size: 0.88rem;
}

#recentAccessList .recent-access-item {
  padding: 14px 16px;
}

#recentAccessList .access-entry-featured {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(246, 239, 226, 0.96));
  border: 1px solid rgba(227, 100, 20, 0.18);
  box-shadow: 0 10px 22px rgba(15, 76, 92, 0.08);
}

#recentAccessList .access-entry-layout {
  grid-template-columns: 84px 1fr;
  gap: 16px;
  align-items: center;
}

#recentAccessList .access-entry-featured .access-entry-layout {
  grid-template-columns: 116px 1fr;
  gap: 18px;
}

#recentAccessList .access-entry-photo {
  width: 84px;
  height: 104px;
  border-radius: 14px;
}

#recentAccessList .access-entry-featured .access-entry-photo {
  width: 116px;
  height: 144px;
  border-radius: 18px;
}

#recentAccessList .access-entry-copy {
  gap: 6px;
}

#recentAccessList .access-entry-featured .access-entry-copy {
  gap: 8px;
}

#recentAccessList .access-entry-copy strong {
  font-size: 1.05rem;
}

#recentAccessList .access-entry-featured .access-entry-copy strong {
  font-size: 1.22rem;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.sector-field-emphasis {
  grid-column: 1 / -1;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: linear-gradient(165deg, rgba(20, 36, 58, 0.55), rgba(10, 16, 28, 0.75));
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.06);
}

.sector-field-emphasis > span:first-child {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sector-hint {
  margin-top: 0.45rem;
  font-size: 0.78rem;
}

.sector-preview {
  margin-top: 0.65rem;
}

.sector-preview strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fb4cf;
  margin-bottom: 0.4rem;
}

.sector-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sector-preview-chip {
  display: inline-flex;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(14, 24, 40, 0.9);
  color: #d7ebff;
  font-size: 0.74rem;
  font-weight: 600;
}

.field-hint {
  display: block;
  font-size: .76rem;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

.helper-text-warning {
  color: #b42318;
  font-weight: 700;
}

.helper-text-ok {
  color: #087443;
  font-weight: 700;
}

.helper-text-info {
  color: #165ed8;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.captured-photo {
  display: none;
  min-height: 240px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.captured-photo.has-image {
  display: block;
  cursor: grab;
  touch-action: none;
}

.captured-photo.dragging {
  cursor: grabbing;
}

.photo-adjust-controls {
  display: grid;
  gap: 10px;
}

.photo-adjust-panel {
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.04);
}

.photo-zoom-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.92rem;
  align-items: center;
}

.photo-zoom-row > span:first-child {
  grid-column: 1 / -1;
}

.photo-zoom-row input[type="range"] {
  grid-column: 1;
  width: 100%;
  accent-color: var(--accent, #06b6d4);
}

.photo-zoom-value {
  grid-column: 2;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 3.2rem;
  text-align: right;
}

.photo-validate-row {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-bottom: 8px;
}

.photo-validate-btn {
  font-size: 0.85rem;
}

.photo-validation-result {
  font-size: 0.82rem;
  text-align: center;
}

.photo-dpad-wrap {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.photo-dpad {
  display: grid;
  grid-template-columns: 44px 44px 44px;
  grid-template-rows: 44px 44px 44px;
  gap: 6px;
  justify-content: center;
}

.photo-dpad-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
}

.photo-dpad-up { grid-column: 2; grid-row: 1; }
.photo-dpad-left { grid-column: 1; grid-row: 2; }
.photo-dpad-center { grid-column: 2; grid-row: 2; font-size: 1.25rem; }
.photo-dpad-right { grid-column: 3; grid-row: 2; }
.photo-dpad-down { grid-column: 2; grid-row: 3; }

.photo-adjust-status {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.invoice-logo-preview {
  grid-column: 1 / -1;
  max-width: 280px;
  max-height: 96px;
  object-fit: contain;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.94));
  border: 1px solid rgba(6, 182, 212, 0.24);
  box-shadow: 0 10px 28px rgba(6, 182, 212, 0.12);
}

.invoice-toolbar {
  margin-bottom: 16px;
  gap: 10px;
  align-items: center;
}

.invoice-toolbar .ghost-button,
.invoice-quick-filters .ghost-button,
.invoice-toolbar-refresh {
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 92, 0.26);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(238, 247, 249, 0.94));
  color: #06b6d4;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(15, 76, 92, 0.1);
}

.invoice-toolbar .ghost-button:hover,
.invoice-quick-filters .ghost-button:hover,
.invoice-toolbar-refresh:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 76, 92, 0.45);
  box-shadow: 0 9px 18px rgba(15, 76, 92, 0.16);
}

.doc-inbox-toolbar {
  gap: 6px;
}

.doc-inbox-btn {
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 92, 0.26);
  background: linear-gradient(135deg, #ffffff, #eef6f8);
  color: #06b6d4;
  font-weight: 700;
}

.doc-inbox-btn:hover {
  border-color: rgba(15, 76, 92, 0.45);
  background: linear-gradient(135deg, #ffffff, #e4f1f5);
}

.doc-inbox-item {
  border-radius: 14px;
  border: 1px solid rgba(15, 76, 92, 0.14);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 250, 0.95));
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.doc-inbox-item:hover {
  box-shadow: 0 4px 18px rgba(15, 76, 92, 0.13);
  border-color: rgba(15, 76, 92, 0.28);
}

.doc-inbox-unread {
  border-left: 4px solid var(--accent, #e47c3a) !important;
  background: linear-gradient(145deg, rgba(228, 124, 58, 0.06), rgba(255, 250, 245, 0.98)) !important;
}

body.theme-black .doc-inbox-item {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(255,255,255,0.1);
}

body.theme-black .doc-inbox-unread {
  background: rgba(228, 124, 58, 0.10) !important;
  border-left-color: #e47c3a !important;
}

.doc-inbox-unread-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent, #e47c3a);
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: middle;
}

.doc-inbox-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.doc-inbox-attachment-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.doc-inbox-attachment-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 9px;
  background: rgba(15, 76, 92, 0.05);
}

.doc-inbox-row-actions {
  margin-top: 8px;
}

.invoice-filter-input {
  flex: 1;
  min-width: 240px;
}

.invoice-filter-select {
  min-width: 140px;
}

.invoice-filter-select-wide {
  min-width: 220px;
}

.invoice-kpi-grid {
  margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.invoice-ops-trend-list {
  margin-bottom: 12px;
}

.invoice-ops-trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.invoice-ops-trend-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.invoice-ops-trend-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.invoice-ops-bar-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 76, 92, 0.08);
}

.invoice-ops-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #06b6d4, #a855f7);
}

.invoice-ops-error-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.invoice-ops-error-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(255, 247, 239, 0.9);
  color: #5f4638;
  font-size: 0.8rem;
  font-weight: 700;
}

.gate-deny-chip {
  border-width: 1px;
}

.gate-deny-critical {
  color: #7c2218;
  border-color: rgba(164, 48, 32, 0.3);
  background: rgba(255, 235, 230, 0.95);
}

.gate-deny-warn {
  color: #6d3b09;
  border-color: rgba(181, 106, 29, 0.32);
  background: rgba(255, 243, 224, 0.95);
}

.gate-deny-tech {
  color: #144e6c;
  border-color: rgba(26, 118, 156, 0.3);
  background: rgba(228, 245, 253, 0.96);
}

.gate-deny-neutral {
  color: #4f4f4f;
  border-color: rgba(87, 87, 87, 0.2);
  background: rgba(242, 242, 242, 0.95);
}

.gate-deny-legend-row {
  margin-top: 2px;
  margin-bottom: 4px;
}

.invoice-management-item {
  position: relative;
  padding: 14px 14px 14px 42px;
  border-radius: 16px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(246, 239, 226, 0.72));
  box-shadow: 0 8px 18px rgba(15, 76, 92, 0.07);
}
.invoice-bulk-checkbox-label {
  position: absolute;
  top: 14px;
  left: 12px;
  line-height: 1;
}
.invoice-bulk-cb {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent, #a855f7);
}

.invoice-status-draft {
  border-left: 5px solid rgba(54, 86, 93, 0.6);
}

.invoice-status-sent {
  border-left: 5px solid rgba(22, 94, 216, 0.7);
}

.invoice-status-overdue {
  border-left: 5px solid rgba(197, 61, 47, 0.8);
  background: linear-gradient(145deg, rgba(255, 247, 245, 0.95), rgba(255, 234, 230, 0.8));
}

.invoice-status-bezahlt {
  border-left: 5px solid rgba(22, 120, 87, 0.78);
  background: linear-gradient(145deg, rgba(245, 255, 250, 0.95), rgba(233, 250, 242, 0.8));
}

.invoice-status-send_failed {
  border-left: 5px solid rgba(127, 48, 24, 0.86);
  background: linear-gradient(145deg, rgba(255, 250, 244, 0.95), rgba(255, 238, 222, 0.82));
}

@keyframes invoice-paid-pulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 8px 18px rgba(15, 76, 92, 0.07);
  }
  35% {
    transform: translateY(-2px) scale(1.008);
    box-shadow: 0 14px 26px rgba(22, 120, 87, 0.2);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 8px 18px rgba(15, 76, 92, 0.07);
  }
}

.invoice-status-just-paid {
  animation: invoice-paid-pulse 900ms ease-in-out 2;
}

@media (prefers-reduced-motion: reduce) {
  .invoice-status-just-paid {
    animation: none;
  }
}

.invoice-management-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.invoice-management-main {
  flex: 1;
  min-width: 0;
}

.invoice-new-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(22, 94, 216, 0.14);
  border: 1px solid rgba(22, 94, 216, 0.26);
  color: #124aaf;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.invoice-dunning-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.dunning-stage-1 {
  background: rgba(230, 126, 34, 0.14);
  border: 1px solid rgba(230, 126, 34, 0.35);
  color: #a04000;
}
.dunning-stage-2 {
  background: rgba(192, 57, 43, 0.14);
  border: 1px solid rgba(192, 57, 43, 0.35);
  color: #922b21;
}
.dunning-stage-3 {
  background: rgba(136, 8, 8, 0.18);
  border: 1px solid rgba(136, 8, 8, 0.4);
  color: #7b0000;
}

.invoice-management-side {
  text-align: right;
  min-width: 140px;
}

.invoice-management-actions {
  margin-top: 10px;
  align-items: center;
}

.invoice-management-error {
  flex: 1;
  margin: 0;
}

.invoice-retry-meta {
  margin-top: 6px;
  padding-left: 2px;
  font-size: 0.82rem;
  color: #5f4638;
}

.invoice-attempt-timeline {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.invoice-attempt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.invoice-attempt-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(250, 249, 246, 0.8);
}

.invoice-attempt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.invoice-attempt-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.invoice-attempt-status-sent {
  color: #0c6b4b;
  background: rgba(22, 120, 87, 0.15);
  border-color: rgba(22, 120, 87, 0.28);
}

.invoice-attempt-status-failed {
  color: #9f261a;
  background: rgba(197, 61, 47, 0.15);
  border-color: rgba(197, 61, 47, 0.28);
}

.invoice-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
}

.invoice-status-icon {
  display: inline-grid;
  place-items: center;
  width: 14px;
  min-width: 14px;
  height: 14px;
  font-size: 0.76rem;
}

.invoice-status-badge-draft {
  color: #2f4950;
  background: rgba(54, 86, 93, 0.14);
  border-color: rgba(54, 86, 93, 0.24);
}

.invoice-status-badge-sent {
  color: #124aaf;
  background: rgba(22, 94, 216, 0.14);
  border-color: rgba(22, 94, 216, 0.24);
}

.invoice-status-badge-overdue {
  color: #9f261a;
  background: rgba(197, 61, 47, 0.15);
  border-color: rgba(197, 61, 47, 0.28);
}

.invoice-status-badge-bezahlt {
  color: #0c6b4b;
  background: rgba(22, 120, 87, 0.15);
  border-color: rgba(22, 120, 87, 0.28);
}

.invoice-status-badge-send_failed {
  color: #6c2f17;
  background: rgba(127, 48, 24, 0.16);
  border-color: rgba(127, 48, 24, 0.3);
}

.invoice-kpi-card {
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: 14px;
}

.invoice-kpi-card strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1.1;
  margin: 4px 0;
}

.gate-ops-controls {
  gap: 8px;
}

.gate-ops-window-select {
  max-width: 140px;
}

.invoice-kpi-open {
  background: linear-gradient(145deg, rgba(252, 250, 246, 0.95), rgba(245, 238, 226, 0.75));
}

.invoice-kpi-overdue {
  background: linear-gradient(145deg, rgba(255, 247, 245, 0.95), rgba(255, 233, 228, 0.82));
}

.invoice-kpi-paid {
  background: linear-gradient(145deg, rgba(245, 255, 250, 0.95), rgba(229, 248, 239, 0.82));
}

.invoice-kpi-failed {
  background: linear-gradient(145deg, rgba(255, 250, 244, 0.95), rgba(255, 238, 222, 0.82));
}

.billing-subscription-portal {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(127, 48, 24, 0.12);
}

.billing-current-plan-card {
  margin: 0.75rem 0 1rem;
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.billing-plan-card-current {
  outline: 2px solid rgba(15, 76, 92, 0.35);
}

.billing-revenue-metrics {
  margin-top: 1rem;
}

.billing-trial-offer {
  color: #0f766e;
  font-weight: 600;
}

.billing-trial-active {
  color: #b45309;
  font-weight: 600;
}

.retry-queue-item {
  border: 1px solid rgba(127, 48, 24, 0.2);
  background: linear-gradient(145deg, rgba(255, 251, 247, 0.95), rgba(255, 240, 228, 0.86));
}

.invoice-dead-letter-item {
  border: 1px solid rgba(159, 38, 26, 0.24);
  background: linear-gradient(145deg, rgba(255, 246, 242, 0.96), rgba(255, 232, 224, 0.88));
}

.invoice-approval-item {
  border: 1px solid rgba(22, 94, 216, 0.22);
  background: linear-gradient(145deg, rgba(245, 249, 255, 0.96), rgba(230, 240, 255, 0.88));
}

.invoice-approval-item-warn {
  border-color: rgba(221, 140, 36, 0.38);
  background: linear-gradient(145deg, rgba(255, 250, 238, 0.98), rgba(255, 240, 214, 0.9));
}

.invoice-approval-item-alert {
  border-color: rgba(197, 61, 47, 0.48);
  background: linear-gradient(145deg, rgba(255, 244, 242, 0.98), rgba(255, 224, 218, 0.9));
  box-shadow: 0 0 0 1px rgba(197, 61, 47, 0.18) inset;
}

.retry-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.invoice-retry-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.invoice-retry-select input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.invoice-top-issues-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(23, 23, 23, 0.1);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
}

.invoice-top-issues-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.invoice-priority-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
}

.invoice-priority-kritisch {
  color: #8f1f1f;
  background: rgba(197, 61, 47, 0.16);
  border-color: rgba(197, 61, 47, 0.3);
}

.invoice-priority-hoch {
  color: #7a4a0d;
  background: rgba(221, 140, 36, 0.16);
  border-color: rgba(221, 140, 36, 0.3);
}

.invoice-priority-niedrig {
  color: #2b5864;
  background: rgba(22, 94, 216, 0.1);
  border-color: rgba(22, 94, 216, 0.2);
}

#invoiceRetryCriticalSendBtn.invoice-critical-btn-warn {
  color: #7a4a0d;
  background: rgba(221, 140, 36, 0.16);
  border-color: rgba(221, 140, 36, 0.3);
}

#invoiceRetryCriticalSendBtn.invoice-critical-btn-alert {
  color: #8f1f1f;
  background: rgba(197, 61, 47, 0.18);
  border-color: rgba(197, 61, 47, 0.34);
  box-shadow: 0 0 0 1px rgba(197, 61, 47, 0.18) inset;
  animation: invoice-critical-btn-pulse 1.2s ease-in-out infinite;
}

@keyframes invoice-critical-btn-pulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 1px rgba(197, 61, 47, 0.18) inset;
  }
  50% {
    transform: translateY(-1px) scale(1.012);
    box-shadow: 0 0 0 1px rgba(197, 61, 47, 0.22) inset, 0 8px 18px rgba(197, 61, 47, 0.24);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 1px rgba(197, 61, 47, 0.18) inset;
  }
}

@media (prefers-reduced-motion: reduce) {
  #invoiceRetryCriticalSendBtn.invoice-critical-btn-alert {
    animation: none;
  }
}

@media (max-width: 860px) {
  .invoice-management-head {
    flex-direction: column;
  }

  .invoice-management-side {
    text-align: left;
    min-width: 0;
  }

  .invoice-filter-input,
  .invoice-filter-select,
  .invoice-filter-select-wide {
    width: 100%;
    min-width: 0;
  }
}

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

.summary-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.day-close-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(23, 23, 23, 0.1);
  font-weight: 600;
  line-height: 1.45;
}

#dayCloseAcknowledgeForm {
  margin-bottom: 12px;
}

.day-close-banner.is-warning {
  background: rgba(239, 180, 61, 0.2);
  border-color: rgba(239, 180, 61, 0.45);
  color: #6b4f08;
}

.day-close-banner.is-ok {
  background: rgba(22, 120, 87, 0.14);
  border-color: rgba(22, 120, 87, 0.28);
  color: var(--success);
}

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

.summary-block {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(23, 23, 23, 0.06);
}

.panel-heading.slim {
  margin-bottom: 10px;
}

.summary-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(23, 23, 23, 0.06);
}

.summary-card strong {
  font-size: 1rem;
}

.summary-card span {
  color: var(--muted);
}

.summary-visitor-block {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(23, 23, 23, 0.08);
}

.summary-visitor-title {
  color: #222;
  font-weight: 700;
}

.summary-visitor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-visitor-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 76, 92, 0.1);
  color: #164653;
  font-size: 0.84rem;
  font-weight: 600;
}

.hourly-grid {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.hour-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 23, 23, 0.06);
}

.warning-item {
  border-left: 4px solid var(--warning);
}

.warning-item.severity-green {
  border-left-color: var(--success);
}

.warning-item.severity-yellow {
  border-left-color: var(--warning);
}

.warning-item.severity-red {
  border-left-color: var(--danger);
  background: rgba(197, 61, 47, 0.08);
}

.card-item,
.list-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 252, 247, 0.6));
  border: 1px solid rgba(23, 23, 23, 0.06);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
  cursor: pointer;
  position: relative;
}
.card-item:active {
  background: linear-gradient(145deg, rgba(202, 90, 45, 0.08), rgba(255, 252, 247, 0.6));
}

.card-item:hover,
.list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(202, 90, 45, 0.24);
  box-shadow: 0 16px 26px rgba(35, 24, 14, 0.1);
}

.card-item header,
.list-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-item strong,
.list-item strong {
  font-size: 1.02rem;
}

.card-item code.company-id-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
  word-break: break-all;
}

.card-item button {
  justify-self: flex-start;
  margin-top: 6px;
}

.badge-shell {
  min-height: 420px;
  display: grid;
  place-items: center;
  /* Freeze preview palette so system theme does not alter badge appearance. */
  --badge-preview-accent: #d95d39;
  --badge-preview-accent-dark: #b94a2a;
  --badge-preview-text: #161312;
  --badge-preview-muted: #665f5a;
}

.badge-card-stage {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.badge-card-note {
  width: min(100%, 430px);
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 248, 241, .94), rgba(247, 238, 228, .92));
  border: 1px solid rgba(176, 125, 0, .16);
  box-shadow: 0 14px 30px rgba(77, 45, 18, .08);
}

.badge-card-note .helper-text {
  margin: 0;
}

.badge-card-note .helper-text + .helper-text {
  margin-top: 8px;
}

.badge-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(176, 125, 0, .08);
}

.badge-info-row:last-child {
  border-bottom: none;
}

.badge-info-icon {
  font-size: .9rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.badge-info-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  flex-shrink: 0;
}

.badge-info-value {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-left: auto;
  text-align: right;
}

.badge-info-link {
  text-decoration: none;
  color: #1147a6;
}

.badge-info-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ═══════════════════════════════════════════
   BADGE PREVIEW CARD - 1:1 wie Mitarbeiter-App
   ═══════════════════════════════════════════ */
.badge-shell .wallet-card {
  --accent: var(--badge-preview-accent);
  --accent-dark: var(--badge-preview-accent-dark);
  position: relative;
  container-type: inline-size;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  aspect-ratio: 85.6 / 56;
  min-height: 228px;
  border-radius: 22px;
  padding: 3.8% 4.5% 3.2%;
  background: linear-gradient(135deg, #0f1923 0%, #1a2d3d 45%, #0d1520 100%);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, .55),
    0 4px 20px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(255, 255, 255, .07),
    inset 0 1px 0 rgba(255, 255, 255, .1);
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(2px, 1.2%, 6px);
  -webkit-user-select: none;
  user-select: none;
}

.badge-shell .wallet-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #f0844a 50%, var(--accent) 100%);
  height: 3px;
  bottom: auto;
}

.badge-shell .wallet-card .wc-shimmer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 0%, transparent 30%, rgba(217, 93, 57, .10) 38%, rgba(255, 200, 100, .08) 46%, rgba(217, 93, 57, .06) 54%, transparent 62%, transparent 100%);
  background-size: 220% 220%;
  animation: badge-wallet-holo 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes badge-wallet-holo {
  0% { background-position: 200% 200%; }
  50% { background-position: 0% 0%; }
  100% { background-position: 200% 200%; }
}

.badge-shell .wallet-card .wc-grid {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.badge-shell .wallet-card .wc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
  margin-top: -2px;
}

.badge-shell .wallet-card .wc-brand {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: calc(100% - 34px);
}

.badge-shell .wallet-card .wc-brand-mark {
  width: clamp(28px, 7.5%, 36px);
  height: clamp(28px, 7.5%, 36px);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(217, 93, 57, .45);
  flex-shrink: 0;
  overflow: hidden;
}

.badge-shell .wallet-card .wc-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
}

.badge-shell .wallet-card .wc-brand-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(.58rem, 2.35cqw, .76rem);
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.12;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  max-width: 100%;
}

.badge-shell .wallet-card .wc-brand-sub {
  font-size: clamp(.37rem, 1.45cqw, .48rem);
  color: rgba(255, 255, 255, .52);
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.14;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  max-width: 100%;
}

.badge-shell .wallet-card .wc-nfc {
  opacity: .75;
  flex-shrink: 0;
}

.badge-shell .wallet-card .wc-middle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.badge-shell .wallet-card .wc-qr-holder {
  position: relative;
  width: 94px;
  height: 94px;
  flex-shrink: 0;
}

.badge-shell .wallet-card .wc-qr-frame {
  position: absolute;
  -webkit-backdrop-filter: blur(4px);
  inset: -7px;
  border-radius: 16px;
  background: linear-gradient(135deg, #b88628 0%, #efd26b 26%, #fff2a5 45%, #d09b2f 62%, #8d6420 100%);
  border: 1px solid rgba(255, 220, 140, .42);
  box-shadow: 0 12px 24px rgba(212, 168, 67, .4), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(96, 61, 12, .48);
}

.badge-shell .wallet-card .wc-qr-frame::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 10px;
  border: 1px solid rgba(129, 86, 10, .38);
  background-image: linear-gradient(rgba(129, 86, 10, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(129, 86, 10, .14) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
}

/* ── INDUSTRY: warmes Dunkel-Orange ─────────────────────────────── */
body[data-branding-preset="industry"] .badge-shell .wallet-card {
  background: linear-gradient(135deg, #241406 0%, #5a3313 44%, #2a1708 100%);
  box-shadow:
    0 28px 60px rgba(110, 58, 20, .42),
    0 4px 20px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(210, 140, 70, .2),
    inset 0 1px 0 rgba(255, 215, 150, .1);
}

body[data-branding-preset="industry"] .badge-shell .wallet-card::before {
  background: linear-gradient(90deg, #c06e22 0%, #e2ad62 50%, #c06e22 100%);
  height: 2px;
}

body[data-branding-preset="industry"] .badge-shell .wallet-card .wc-shimmer {
  background: linear-gradient(115deg, transparent 0%, transparent 30%, rgba(214, 151, 79, .12) 38%, rgba(245, 211, 150, .08) 46%, rgba(188, 116, 45, .07) 54%, transparent 62%, transparent 100%);
}

body[data-branding-preset="industry"] .badge-shell .wallet-card .wc-brand-mark {
  background: linear-gradient(135deg, #bc6f2d, #d6964e);
  box-shadow: 0 3px 10px rgba(146, 90, 40, .45);
}

body[data-branding-preset="industry"] .badge-shell .wallet-card .wc-qr-frame {
  background: linear-gradient(135deg, #6f411b 0%, #b37333 24%, #e5bb79 46%, #c8833a 66%, #75451f 100%);
  border-color: rgba(232, 182, 112, .42);
  box-shadow: 0 12px 24px rgba(122, 76, 33, .35), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(65, 38, 15, .44);
}

/* ── PREMIUM: tiefes Marineblau / Saphir ────────────────────────── */
body[data-branding-preset="premium"] .badge-shell .wallet-card {
  background: linear-gradient(135deg, #010d1f 0%, #06245a 42%, #000e22 100%);
  box-shadow:
    0 28px 60px rgba(0, 40, 150, .5),
    0 4px 20px rgba(0, 0, 0, .4),
    0 0 0 1px rgba(80, 160, 255, .18),
    inset 0 1px 0 rgba(120, 190, 255, .12);
}

body[data-branding-preset="premium"] .badge-shell .wallet-card::before {
  background: linear-gradient(90deg, #1565c0 0%, #42a5f5 48%, #1565c0 100%);
}

body[data-branding-preset="premium"] .badge-shell .wallet-card .wc-shimmer {
  background: linear-gradient(115deg, transparent 0%, transparent 30%, rgba(66, 165, 245, .12) 38%, rgba(100, 200, 255, .09) 46%, rgba(21, 101, 192, .08) 54%, transparent 62%, transparent 100%);
}

body[data-branding-preset="premium"] .badge-shell .wallet-card .wc-brand-mark {
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  box-shadow: 0 3px 10px rgba(21, 101, 192, .55);
}

body[data-branding-preset="premium"] .badge-shell .wallet-card .wc-qr-frame {
  background: linear-gradient(135deg, #082060 0%, #1565c0 24%, #42a5f5 46%, #1976d2 66%, #061840 100%);
  border-color: rgba(66, 165, 245, .42);
  box-shadow: 0 12px 24px rgba(0, 60, 160, .38), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(0, 20, 80, .44);
}

/* ── Klassen-basierte Preset-Regeln (direkt auf der Karte) ──────────────── */
/* Diese greifen wenn preset-* class direkt auf .wallet-card gesetzt ist    */

.badge-shell .wallet-card.preset-construction {
  background: linear-gradient(135deg, #0f1923 0%, #1a2d3d 45%, #0d1520 100%);
}

.badge-shell .wallet-card.branding-custom::before {
  background: linear-gradient(
    90deg,
    var(--worker-card-accent, #d95d39) 0%,
    var(--worker-card-primary-light, #f08a50) 50%,
    var(--worker-card-accent, #d95d39) 100%
  );
}

.badge-shell .wallet-card.branding-custom .wc-brand-mark {
  background: linear-gradient(135deg, var(--worker-card-primary, #183243), var(--worker-card-accent, #f08a50));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--worker-card-accent, #f08a50) 45%, transparent);
}

.badge-shell .wallet-card.branding-custom .wc-brand-mark .wc-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 2px;
  border-radius: 8px;
  display: block;
  background: rgba(255, 255, 255, 0.98);
}

.badge-shell .wallet-card.branding-custom .wc-qr-frame {
  background: linear-gradient(
    135deg,
    var(--worker-card-primary-dark, #183243) 0%,
    var(--worker-card-accent, #f08a50) 42%,
    var(--worker-card-primary-light, #f0b27a) 100%
  );
  border-color: color-mix(in srgb, var(--worker-card-accent, #f08a50) 46%, transparent);
}

/* INDUSTRY – Dunkelorange */
.badge-shell .wallet-card.preset-industry {
  background: linear-gradient(135deg, #241406 0%, #5a3313 44%, #2a1708 100%);
  box-shadow:
    0 28px 60px rgba(110, 58, 20, .42),
    0 4px 20px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(210, 140, 70, .2),
    inset 0 1px 0 rgba(255, 215, 150, .1);
}

.badge-shell .wallet-card.preset-industry::before {
  background: linear-gradient(90deg, #c06e22 0%, #e2ad62 50%, #c06e22 100%);
  height: 2px;
}

.badge-shell .wallet-card.preset-industry .wc-shimmer {
  background: linear-gradient(115deg, transparent 0%, transparent 30%, rgba(214, 151, 79, .12) 38%, rgba(245, 211, 150, .08) 46%, rgba(188, 116, 45, .07) 54%, transparent 62%, transparent 100%);
}

.badge-shell .wallet-card.preset-industry .wc-brand-mark {
  background: linear-gradient(135deg, #bc6f2d, #d6964e);
  box-shadow: 0 3px 10px rgba(146, 90, 40, .45);
}

.badge-shell .wallet-card.preset-industry .wc-qr-frame {
  background: linear-gradient(135deg, #6f411b 0%, #b37333 24%, #e5bb79 46%, #c8833a 66%, #75451f 100%);
  border-color: rgba(232, 182, 112, .42);
  box-shadow: 0 12px 24px rgba(122, 76, 33, .35), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(65, 38, 15, .44);
}

.badge-shell .wallet-card.preset-industry .wc-name,
.badge-shell .wallet-card.preset-industry .wc-role-text,
.badge-shell .wallet-card.preset-industry .wc-company,
.badge-shell .wallet-card.preset-industry .wc-subcompany,
.badge-shell .wallet-card.preset-industry .wc-field-value,
.badge-shell .wallet-card.preset-industry .wc-status {
  color: #fff8ee;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}

.badge-shell .wallet-card.preset-industry .wc-field-label {
  color: rgba(255, 200, 100, .75);
}

/* PREMIUM – Marineblau / Saphir */
.badge-shell .wallet-card.preset-premium {
  background: linear-gradient(135deg, #010d1f 0%, #06245a 42%, #000e22 100%);
  box-shadow:
    0 28px 60px rgba(0, 40, 150, .5),
    0 4px 20px rgba(0, 0, 0, .4),
    0 0 0 1px rgba(80, 160, 255, .18),
    inset 0 1px 0 rgba(120, 190, 255, .12);
}

.badge-shell .wallet-card.preset-premium::before {
  background: linear-gradient(90deg, #1565c0 0%, #42a5f5 48%, #1565c0 100%);
}

.badge-shell .wallet-card.preset-premium .wc-shimmer {
  background: linear-gradient(115deg, transparent 0%, transparent 30%, rgba(66, 165, 245, .12) 38%, rgba(100, 200, 255, .09) 46%, rgba(21, 101, 192, .08) 54%, transparent 62%, transparent 100%);
}

.badge-shell .wallet-card.preset-premium .wc-brand-mark {
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  box-shadow: 0 3px 10px rgba(21, 101, 192, .55);
}

.badge-shell .wallet-card.preset-premium .wc-qr-frame {
  background: linear-gradient(135deg, #082060 0%, #1565c0 24%, #42a5f5 46%, #1976d2 66%, #061840 100%);
  border-color: rgba(66, 165, 245, .42);
  box-shadow: 0 12px 24px rgba(0, 60, 160, .38), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(0, 20, 80, .44);
}

.badge-shell .wallet-card.preset-premium .wc-name,
.badge-shell .wallet-card.preset-premium .wc-role-text,
.badge-shell .wallet-card.preset-premium .wc-company,
.badge-shell .wallet-card.preset-premium .wc-subcompany,
.badge-shell .wallet-card.preset-premium .wc-field-value,
.badge-shell .wallet-card.preset-premium .wc-status {
  color: #e8f4ff;
  text-shadow: 0 1px 4px rgba(0, 20, 80, .7);
}

.badge-shell .wallet-card.preset-premium .wc-field-label {
  color: rgba(120, 190, 255, .8);
}

.badge-shell .wallet-card .badge-wallet-qr {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  display: block;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

.badge-shell .wallet-card .wc-photo {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .22);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .34);
  flex-shrink: 0;
}

.badge-shell .wallet-card .wc-bottom {
  position: relative;
  z-index: 1;
  margin-top: 6px;
}

.badge-shell .wallet-card .wc-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.16;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.badge-shell .wallet-card .wc-role-text {
  margin: 0 0 2px;
  font-size: .5rem;
  color: rgba(255, 255, 255, .55);
  text-transform: uppercase;
  letter-spacing: .1em;
  line-height: 1.14;
}

.badge-shell .wallet-card .wc-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

.badge-shell .wallet-card .wc-fields {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: flex-end;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.badge-shell .wallet-card .wc-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.badge-shell .wallet-card .wc-field-label {
  font-size: .38rem;
  color: rgba(235, 243, 255, .84);
  text-transform: uppercase;
  letter-spacing: .11em;
  line-height: 1.12;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.badge-shell .wallet-card .wc-field-value {
  font-family: "Space Grotesk", monospace;
  font-size: .48rem;
  font-weight: 600;
  color: rgba(250, 252, 255, .99);
  letter-spacing: .04em;
  line-height: 1.18;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.badge-shell .wallet-card .wc-field.wc-field-badge .wc-field-value {
  font-size: .64rem;
  font-weight: 800;
  color: #ffe9a8;
  letter-spacing: .07em;
}

.badge-shell .wallet-card .wc-field.wc-field-badge {
  max-width: 12ch;
}

.badge-shell .wallet-card .wc-field.wc-field-valid {
  max-width: 9.5ch;
}

.badge-shell .wallet-card .wc-field.wc-field-valid .wc-field-value {
  letter-spacing: .02em;
}

.badge-shell .wallet-card .wc-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  max-width: 46%;
  min-width: 0;
}

.badge-shell .wallet-card .wc-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .41rem;
  font-weight: 700;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: .1em;
  line-height: 1;
}

.badge-shell .wallet-card .wc-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 7px rgba(74, 222, 128, .7);
  flex-shrink: 0;
}

.badge-shell .wallet-card .wc-status[data-status="gesperrt"],
.badge-shell .wallet-card .wc-status[data-status="inaktiv"] {
  color: #ffb3b3;
}

.badge-shell .wallet-card .wc-status[data-status="gesperrt"]::before,
.badge-shell .wallet-card .wc-status[data-status="inaktiv"]::before {
  background: #ff6b6b;
  box-shadow: 0 0 7px rgba(255, 107, 107, .7);
}

.badge-shell .wallet-card .wc-company {
  margin: 0;
  max-width: 24ch;
  font-size: .48rem;
  color: rgba(255, 255, 255, .93);
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.16;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-shell .wallet-card .wc-subcompany {
  margin: 0;
  max-width: 22ch;
  font-size: .42rem;
  color: rgba(255, 255, 255, .72);
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.14;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-shell .wallet-card .wc-subcompany.hidden {
  display: none;
}

/* Keep badge preview visually identical in light and dark system modes. */
.badge-shell .wallet-card {
  color-scheme: light;
  forced-color-adjust: none;
}

@media (prefers-color-scheme: dark) {
  /* Keep card rendering identical to light mode even if OS is dark. */
  .badge-shell .wallet-card {
    color-scheme: light;
    forced-color-adjust: none;
  }
}

body.theme-black .badge-shell .wallet-card.preset-construction,
[data-theme="dark"] .badge-shell .wallet-card.preset-construction {
  background: linear-gradient(135deg, #0f1923 0%, #1a2d3d 45%, #0d1520 100%) !important;
}

/* Keep preset visuals stable in dark admin theme (same look as light mode). */
body.theme-black .badge-shell .wallet-card.preset-industry,
[data-theme="dark"] .badge-shell .wallet-card.preset-industry {
  background: linear-gradient(135deg, #241406 0%, #5a3313 44%, #2a1708 100%) !important;
  box-shadow:
    0 28px 60px rgba(110, 58, 20, .42),
    0 4px 20px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(210, 140, 70, .2),
    inset 0 1px 0 rgba(255, 215, 150, .1) !important;
}

body.theme-black .badge-shell .wallet-card.preset-premium,
[data-theme="dark"] .badge-shell .wallet-card.preset-premium {
  background: linear-gradient(135deg, #010d1f 0%, #06245a 42%, #000e22 100%) !important;
  box-shadow:
    0 28px 60px rgba(0, 40, 150, .5),
    0 4px 20px rgba(0, 0, 0, .4),
    0 0 0 1px rgba(80, 160, 255, .18),
    inset 0 1px 0 rgba(120, 190, 255, .12) !important;
}

/* Lock ALL card text to hardcoded card colors regardless of admin or OS dark theme. */
body.theme-black .badge-shell .wallet-card .wc-name,
[data-theme="dark"] .badge-shell .wallet-card .wc-name {
  color: #fff !important;
  font-size: .69rem !important;
  line-height: 1.12 !important;
}
body.theme-black .badge-shell .wallet-card .wc-brand-name,
[data-theme="dark"] .badge-shell .wallet-card .wc-brand-name {
  color: #fff !important;
  font-size: .68rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-brand-sub,
[data-theme="dark"] .badge-shell .wallet-card .wc-brand-sub {
  color: rgba(255, 255, 255, .45) !important;
  font-size: .44rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-role-text,
[data-theme="dark"] .badge-shell .wallet-card .wc-role-text {
  color: rgba(255, 255, 255, .62) !important;
  font-size: .46rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-field-label,
[data-theme="dark"] .badge-shell .wallet-card .wc-field-label {
  color: rgba(220, 232, 255, .86) !important;
  font-size: .36rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-field-value,
[data-theme="dark"] .badge-shell .wallet-card .wc-field-value {
  color: rgba(250, 252, 255, .99) !important;
  font-size: .47rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-field.wc-field-badge .wc-field-value,
[data-theme="dark"] .badge-shell .wallet-card .wc-field.wc-field-badge .wc-field-value {
  color: #ffe9a8 !important;
  font-size: .6rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-company,
[data-theme="dark"] .badge-shell .wallet-card .wc-company {
  color: rgba(255, 255, 255, .93) !important;
  font-size: .45rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-subcompany,
[data-theme="dark"] .badge-shell .wallet-card .wc-subcompany {
  color: rgba(220, 236, 255, .84) !important;
  font-size: .39rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-status,
[data-theme="dark"] .badge-shell .wallet-card .wc-status {
  color: #4ade80 !important;
  font-size: .38rem !important;
}
body.theme-black .badge-shell .wallet-card .wc-status::before,
[data-theme="dark"] .badge-shell .wallet-card .wc-status::before {
  background: #4ade80 !important;
  box-shadow: 0 0 7px rgba(74, 222, 128, .7) !important;
}

body.theme-black .badge-shell .badge-card-note,
[data-theme="dark"] .badge-shell .badge-card-note {
  background: linear-gradient(180deg, rgba(255, 248, 241, .94), rgba(247, 238, 228, .92)) !important;
  border: 1px solid rgba(176, 125, 0, .16) !important;
}

body.theme-black .badge-shell .badge-info-label,
[data-theme="dark"] .badge-shell .badge-info-label {
  color: var(--badge-preview-muted) !important;
}

body.theme-black .badge-shell .badge-info-value,
[data-theme="dark"] .badge-shell .badge-info-value {
  color: var(--badge-preview-text) !important;
}

/* Badge action row (print / app-link buttons) */
.badge-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.badge-card {
  width: min(100%, 420px);
  padding: 22px;
  border-radius: 28px;
  color: #fff6ec;
  background:
    radial-gradient(circle at top left, rgba(239, 180, 61, 0.28), transparent 28%),
    linear-gradient(160deg, #13171c 0%, #2b2f35 48%, #8a381f 100%);
  box-shadow: 0 28px 60px rgba(18, 20, 23, 0.32);
}

.badge-card.badge-card-daypass {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 26%),
    linear-gradient(165deg, #06b6d4 0%, #167857 56%, #efb43d 100%);
}

.badge-top,
.badge-footer,
.badge-body {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.badge-top {
  align-items: flex-start;
  margin-bottom: 18px;
}

.badge-photo {
  width: 116px;
  height: 146px;
  object-fit: cover;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.badge-body {
  align-items: stretch;
}

.badge-copy {
  display: grid;
  gap: 10px;
  flex: 1;
}

.badge-copy p,
.badge-copy h3,
.badge-footer p {
  margin: 0;
}

.qr-block {
  min-width: 110px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  aspect-ratio: 1;
}

.qr-cell {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.qr-cell.filled {
  background: white;
}

.badge-meta {
  display: grid;
  gap: 14px;
}

.meta-box {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 250, 244, 0.68));
  border: 1px solid rgba(23, 23, 23, 0.06);
}

.meta-box p {
  margin: 0;
}
.meta-box code {
  display: inline-block;
  padding: 6px 10px;
  margin-top: 8px;
  border-radius: 12px;
  background: rgba(18, 20, 23, 0.08);
  font-family: "Space Grotesk", sans-serif;
}

.divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

/* ── Admin settings: visual group headers inside forms ── */
.form-section {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.form-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.form-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft, rgba(15,76,92,.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.form-section-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.form-section-label .eyebrow {
  margin: 0;
}
.form-section-label h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary, #1a202c);
  margin: 0;
  line-height: 1.3;
}

/* ── Worker list toolbar (search + bulk select) ── */
.worker-list-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0 8px;
  flex-wrap: wrap;
}
.worker-list-toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
}
.worker-insights-toolbar {
  margin-top: 8px;
  padding-top: 0;
}
.worker-insights-name-input {
  max-width: 320px;
}
.worker-insights-panel {
  display: none;
  margin: 8px 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(42, 113, 119, 0.18);
  background:
    radial-gradient(circle at top right, rgba(42, 113, 119, 0.08), transparent 42%),
    radial-gradient(circle at top left, rgba(202, 90, 45, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.92);
}
.worker-insights-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.worker-insights-title-wrap .eyebrow {
  margin-bottom: 4px;
}
.worker-insights-title-wrap h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-deep);
}
.worker-insights-month {
  color: var(--muted);
  font-weight: 500;
}
.worker-insights-kpis {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.worker-insights-kpi {
  min-width: 130px;
  border-radius: 10px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(255, 255, 255, 0.84);
  padding: 8px 10px;
  display: grid;
  gap: 2px;
}
.worker-insights-kpi span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}
.worker-insights-kpi strong {
  font-size: 0.95rem;
  color: #111827;
}
.worker-insights-kpi-late {
  border-color: rgba(224, 109, 64, 0.35);
  background: rgba(255, 245, 240, 0.9);
}
.worker-insights-kpi-early {
  border-color: rgba(202, 90, 45, 0.28);
  background: rgba(255, 248, 244, 0.92);
}
.worker-insights-window,
.worker-insights-note {
  margin: 6px 0 0;
}
.worker-insights-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.worker-insights-card {
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
}
.worker-insights-card h5 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #374151;
}
.worker-insights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.worker-insights-table th,
.worker-insights-table td {
  text-align: left;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(23, 23, 23, 0.08);
}
.worker-insights-table th:last-child,
.worker-insights-table td:last-child {
  text-align: right;
}
.worker-insights-table tbody tr:last-child td {
  border-bottom: none;
}
.worker-insights-empty {
  margin: 6px 0 0;
}

/* ── Collapsible Sections ────────────────────────────────────────── */
.collapsible-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.collapsible-section-header:hover {
  opacity: 0.8;
}

.collapsible-toggle-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.collapsible-toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.collapsible-section-content {
  max-height: 10000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
  margin-top: 8px;
}

.collapsible-section-content.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
}

body.theme-black .collapsible-toggle-icon {
  color: #e2e8f0;
}

@media (max-width: 600px) {
  .worker-insights-toolbar {
    gap: 8px;
  }
  .worker-insights-name-input,
  .worker-insights-toolbar .ghost-button {
    width: 100%;
    max-width: none;
  }
  .worker-insights-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .worker-insights-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .worker-insights-kpi {
    min-width: 0;
  }
  .worker-insights-grid {
    grid-template-columns: 1fr;
  }
  .worker-insights-table {
    font-size: 0.78rem;
  }
  .worker-insights-table th,
  .worker-insights-table td {
    padding: 5px 4px;
  }
}

@media (max-width: 400px) {
  .worker-insights-kpis {
    grid-template-columns: 1fr;
  }
}
.bulk-select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-secondary, #555);
  cursor: pointer;
  white-space: nowrap;
}
.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: #1a1a1a;
}
.bulk-action-bar.hidden { display: none; }
#bulkSelectionCount { font-weight: 600; margin-right: 4px; }

body.theme-black .bulk-action-bar {
  background: rgba(228, 124, 58, 0.15);
  border-color: rgba(228, 124, 58, 0.5);
  color: #f5f5f5;
}
body.theme-black .bulk-action-bar #bulkSelectionCount {
  color: #f5f5f5;
}
body.theme-black .bulk-action-bar .ghost-button {
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.3);
}
.danger-button {
  padding: 7px 16px;
  border-radius: 8px;
  background: #e53e3e;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}
.danger-button:hover { background: #c53030; }
.card-item input[type="checkbox"].bulk-checkbox {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent, #2d6a4f);
}

.empty-state {
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed rgba(23, 23, 23, 0.12);
  background: rgba(255, 255, 255, 0.44);
  line-height: 1.5;
}

.status-pill.status-aktiv,
.status-pill.status-check-in {
  background: rgba(22, 120, 87, 0.14);
  color: var(--success);
}

.status-pill.status-gesperrt,
.status-pill.status-check-out {
  background: rgba(197, 61, 47, 0.14);
  color: var(--danger);
}

.status-pill.status-abgelaufen,
.status-pill.status-test {
  background: rgba(239, 180, 61, 0.18);
  color: #8b6510;
}

.status-pill.status-pausiert {
  background: rgba(18, 20, 23, 0.1);
  color: #45484d;
}

.status-pill.status-late {
  background: rgba(197, 61, 47, 0.18);
  color: var(--danger);
  font-weight: 600;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Topbar polish: clearer hierarchy and cleaner action buttons */
.topbar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 244, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 36px rgba(35, 24, 14, 0.11);
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}

.topbar-actions {
  gap: 10px;
}

.topbar-actions .ghost-button,
.topbar-actions .primary-button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  flex: 0 1 auto;
}

#seedDataButton {
  color: #70410e;
  background: linear-gradient(135deg, rgba(250, 231, 205, 0.92), rgba(245, 219, 184, 0.9));
  border: 1px solid rgba(167, 103, 35, 0.35);
}

#exportButton {
  color: #fefaf6;
  background: linear-gradient(135deg, #06b6d4, #1e6c74);
  box-shadow: 0 10px 24px rgba(15, 76, 92, 0.28);
}

#logoutButton {
  color: #3a2a20;
  background: linear-gradient(135deg, rgba(255, 242, 236, 0.96), rgba(248, 228, 217, 0.94));
  border: 1px solid rgba(186, 112, 77, 0.32);
}

#seedDataButton:hover,
#exportButton:hover,
#logoutButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(35, 24, 14, 0.14);
}

#seedDataButton:disabled,
#exportButton:disabled,
#logoutButton:disabled,
.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 820px) {
  .topbar-actions .ghost-button,
  .topbar-actions .primary-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 1200px) {
  .two-columns,
  .form-grid,
  .two-col-mini {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .topbar {
    position: sticky;
    left: auto;
    right: auto;
    align-items: stretch;
    border-radius: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.92);
    margin-bottom: 18px;
  }

  .topbar-copy,
  .topbar-actions {
    flex-basis: 100%;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    justify-content: stretch;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .primary-button {
    width: 100%;
    justify-content: center;
  }

  .content {
    padding-top: 28px;
  }
}

@media (max-width: 820px) {
  .content {
    padding: 16px;
  }

  .sidebar {
    padding: 22px 18px;
  }

  .topbar,
  .hero-panel,
  .badge-top,
  .badge-body,
  .badge-footer,
  .camera-actions,
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    position: sticky;
    top: 0;
    padding: 12px 16px;
    margin-bottom: 16px;
  }

  .content {
    padding-top: 16px;
  }

  .topbar h2 {
    font-size: 1.28rem;
  }

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

  .hero-panel {
    padding: 20px;
    border-radius: 22px;
  }

  .panel,
  .stat-card {
    padding: 16px;
    border-radius: 16px;
  }

  .primary-button,
  .ghost-button {
    min-height: 46px;
  }

  .hero-badges {
    justify-content: flex-start;
  }

  .auth-system-grid {
    grid-template-columns: 1fr;
  }

  .invoice-preview-frame {
    min-height: 420px;
  }
}

@keyframes auth-enter {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes blob-drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(14px, -10px, 0) rotate(5deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

body.theme-white {
  --bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #121518;
  --muted: #475569;
  --line: rgba(18, 21, 24, 0.12);
  --button-bg: #ffffff;
  --button-text: #111111;
  --button-border: rgba(17, 17, 17, 0.24);
  background: var(--window-color, #ffffff);
}

body.theme-white::before,
body.theme-white::after {
  opacity: 0.12;
}

body.theme-black {
  --bg: #0f1116;
  --surface: rgba(22, 27, 36, 0.9);
  --surface-strong: #171d27;
  --text: #f4f7ff;
  --muted: #b7c1d6;
  --line: rgba(129, 173, 240, 0.2);
  --button-bg: linear-gradient(135deg, #f58a46 0%, #ea6f2f 46%, #5d87e8 54%, #4f76d1 100%);
  --button-text: #fdfdff;
  --button-border: rgba(129, 173, 240, 0.34);
  --accent: #f39256;
  --accent-soft: rgba(243, 146, 86, 0.17);
  --accent-dark: #cb6d36;
  --shadow: 0 26px 58px rgba(3, 6, 12, 0.58);
  background:
    radial-gradient(circle at 8% 0%, rgba(245, 138, 70, 0.2), transparent 36%),
    radial-gradient(circle at 100% 12%, rgba(93, 135, 232, 0.16), transparent 34%),
    linear-gradient(155deg, #0f1116 0%, #141a24 52%, #10151f 100%);
}

body.theme-black::before,
body.theme-black::after {
  opacity: 0.28;
}

body.theme-black .content {
  background: linear-gradient(180deg, rgba(16, 20, 28, 0.94), rgba(20, 25, 34, 0.9));
}

body.theme-black .content::before {
  opacity: 0;
}

body.theme-black .topbar {
  background: rgba(18, 24, 34, 0.92);
  border-color: rgba(129, 173, 240, 0.22);
  box-shadow: 0 14px 30px rgba(4, 7, 12, 0.5);
}

body.theme-black .hero-panel,
body.theme-black .panel,
body.theme-black .stat-card,
body.theme-black .quick-panel-card {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

body.theme-black .hero-panel,
body.theme-black .panel,
body.theme-black .stat-card,
body.theme-black .quick-panel-card,
body.theme-black .session-card,
body.theme-black .badge-meta,
body.theme-black .list-item,
body.theme-black .card-item,
body.theme-black .camera-block {
  background: #19202b;
  border-color: rgba(129, 173, 240, 0.16);
  color: #f4f7ff;
}

body.theme-black .hero-panel::before {
  background: none;
}

/* Remove the white glass sheen overlay in dark mode — prevents the muddy gray look */
body.theme-black .topbar::after,
body.theme-black .hero-panel::after,
body.theme-black .panel::after,
body.theme-black .stat-card::after,
body.theme-black .quick-panel-card::after,
body.theme-black .porter-live-card::after,
body.theme-black .worker-app-qr-card::after,
body.theme-black .access-feedback-card::after {
  background: none;
}

/* Fix hardcoded dark-teal text that becomes invisible on dark cards */
body.theme-black .stat-card .stat-value {
  color: #f0f4f8;
}

body.theme-black .panel-heading h3 {
  color: #f0f4f8;
}

body.theme-black .panel-heading {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.theme-black .stat-label,
body.theme-black .stat-detail,
body.theme-black .muted,
body.theme-black .helper-text,
body.theme-black .panel p,
body.theme-black .panel span,
body.theme-black .panel label {
  color: #c2ccd8;
}

body.theme-black .panel strong,
body.theme-black .panel h1,
body.theme-black .panel h2,
body.theme-black .panel h3,
body.theme-black .panel h4,
body.theme-black .panel h5,
body.theme-black .panel h6,
body.theme-black .stat-value {
  color: #f0f4f8;
}

body.theme-black .eyebrow,
body.theme-black .panel-heading .eyebrow,
body.theme-black .stat-card .stat-label {
  color: var(--accent);
  text-shadow: none;
}

body.theme-black .turnstile-tap-live,
body.theme-black .quick-panel-card,
body.theme-black .table-shell,
body.theme-black .badge-card,
body.theme-black .worker-card,
body.theme-black .access-log-item,
body.theme-black .access-entry,
body.theme-black .meta-box,
body.theme-black .note-box {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.1);
}
body.theme-black .worker-insights-panel {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at top right, rgba(42, 113, 119, 0.22), transparent 42%),
    radial-gradient(circle at top left, rgba(202, 90, 45, 0.2), transparent 40%),
    rgba(20, 20, 20, 0.88);
}
body.theme-black .worker-insights-title-wrap h4,
body.theme-black .worker-insights-kpi strong,
body.theme-black .worker-insights-card h5,
body.theme-black .worker-insights-table {
  color: #f3f4f6;
}
body.theme-black .worker-insights-kpi {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 10, 0.55);
}
body.theme-black .worker-insights-kpi span {
  color: #9ca3af;
}
body.theme-black .worker-insights-kpi-late,
body.theme-black .worker-insights-kpi-early {
  border-color: rgba(228, 124, 58, 0.36);
  background: rgba(76, 38, 23, 0.35);
}
body.theme-black .worker-insights-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 12, 0.45);
}
body.theme-black .worker-insights-table th,
body.theme-black .worker-insights-table td {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.theme-black .panel:hover,
body.theme-black .stat-card:hover,
body.theme-black .quick-panel-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
}

body.theme-black .stat-card-critical {
  background: rgba(197, 61, 47, 0.18);
  border-color: rgba(197, 61, 47, 0.5);
}

body.theme-black .stat-card-critical strong {
  color: #fca5a5;
}

body.theme-black .ghost-button {
  background: var(--button-bg, #000000);
  color: var(--button-text, #ffffff);
  border-color: var(--button-border, rgba(255, 255, 255, 0.32));
}

body.theme-black input,
body.theme-black select,
body.theme-black textarea {
  background: #111111;
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.2);
}

body.theme-black .auth-form input,
body.theme-black .auth-form select {
  background: #ffffff;
  color: #1b2430;
  border-color: rgba(20, 27, 34, 0.16);
}

body.theme-black .sidebar {
  background:
    linear-gradient(178deg, rgba(0, 0, 0, 0.98), rgba(10, 10, 10, 0.95)),
    conic-gradient(from 150deg at 0% 0%, rgba(202, 90, 45, 0.18), rgba(42, 113, 119, 0.14), rgba(202, 90, 45, 0.18));
}

/* ── Dark Mode: Hilfstexte & Statusfarben ───────────────────── */
body.theme-black .helper-text-info {
  color: #7eb8f7;
}
body.theme-black .helper-text-ok {
  color: #6ee7b7;
}
body.theme-black .helper-text-warning {
  color: #fca5a5;
}

/* Status-Pills im Dark Mode */
body.theme-black .status-pill.status-abgelaufen,
body.theme-black .status-pill.status-test {
  background: rgba(239, 180, 61, 0.22);
  color: #fcd34d;
}
body.theme-black .status-pill.status-pausiert {
  background: rgba(255, 255, 255, 0.1);
  color: #b0b3b8;
}

/* Worker-Detail-Overlay & Popup-Karte */
body.theme-black .worker-detail-overlay .worker-detail-card,
body.theme-black .worker-detail-card {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255,255,255,0.12);
}
body.theme-black .worker-detail-card h3,
body.theme-black .worker-detail-card h4,
body.theme-black .worker-detail-card p,
body.theme-black .worker-detail-card strong,
body.theme-black .worker-detail-card label {
  color: #f0f0f0;
}
body.theme-black .worker-detail-card .muted {
  color: #9ca3af;
}
body.theme-black .worker-detail-card hr {
  border-color: rgba(255,255,255,0.1);
}
body.theme-black .worker-detail-card select,
body.theme-black .worker-detail-card textarea {
  background: #111;
  color: #f5f5f5;
  border-color: rgba(255,255,255,0.2);
}
body.theme-black .worker-detail-card details summary {
  color: #7eb8f7;
}

/* Warn-/Info-Boxen mit hartkodiertem Gelb in app.js */
body.theme-black [style*="background:#fff8e1"],
body.theme-black [style*="background: #fff8e1"],
body.theme-black [style*="background:#f9f9f9"],
body.theme-black [style*="background: #f9f9f9"],
body.theme-black [style*="background:#fef3c7"],
body.theme-black [style*="background: #fef3c7"],
body.theme-black [style*="background:#f9fafb"],
body.theme-black [style*="background: #f9fafb"],
body.theme-black [style*="background:#f5f7fa"],
body.theme-black [style*="background: #f5f7fa"] {
  background: rgba(255,255,255,0.07) !important;
  color: #e5e7eb !important;
  border-color: rgba(255,255,255,0.18) !important;
}

/* Dokument-Upload-Formulare */
body.theme-black .worker-doc-upload-form select,
body.theme-black .worker-doc-upload-form textarea,
body.theme-black .worker-doc-upload-form input[type="date"],
body.theme-black .worker-doc-upload-form input[type="file"] {
  background: #111;
  color: #f5f5f5;
  border-color: rgba(255,255,255,0.2);
}
body.theme-black .worker-doc-upload-form button[type="submit"] {
  background: linear-gradient(135deg, #e47c3a, #bf5e27);
  color: #fff;
}

.worker-hce-section {
  margin-top: 10px;
}

.worker-hce-device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.worker-hce-device-row:last-child {
  border-bottom: none;
}

.worker-hce-device-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.worker-hce-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 600;
}

.worker-hce-status.is-active {
  background: #dcfce7;
  color: #166534;
}

.worker-hce-status.is-revoked {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Admin view (nav Admin) — aligned with platform shell ── */
.view-admin {
  display: grid;
  gap: 18px;
  padding-bottom: 28px;
}

.admin-view-hero {
  padding: 22px 24px 20px;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(99, 102, 241, 0.06) 48%, rgba(10, 16, 30, 0.4) 100%),
    var(--surface, rgba(11, 16, 32, 0.84));
  box-shadow: var(--shadow);
}

.admin-view-title {
  margin: 6px 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.02em;
}

.admin-view-lead {
  margin: 0;
  max-width: 62ch;
}

.view-admin .panel {
  border: 1px solid var(--line);
  background: var(--surface, rgba(11, 16, 32, 0.84));
  box-shadow: var(--shadow);
}

.view-admin .admin-account-panel {
  margin-bottom: 0;
}

.view-admin .admin-system-grid {
  align-items: start;
  gap: 18px;
}

.view-admin .admin-system-panel .form-section {
  grid-column: 1 / -1;
  margin-top: 4px;
}

/* ── Super-Admin zone (legacy admin panel) ── */
.superadmin-zone {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.superadmin-intro-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md, 14px);
  border: 1px solid rgba(56, 189, 248, 0.22);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.1), transparent 50%),
    rgba(8, 12, 24, 0.42);
}

.superadmin-intro-mark {
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.superadmin-intro-banner h3 {
  margin: 2px 0 6px;
}

.superadmin-block {
  padding: 16px 18px;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.22));
  border-radius: var(--radius-md, 14px);
  background: rgba(8, 12, 24, 0.28);
}

.superadmin-block-heading {
  margin-bottom: 12px;
}

.superadmin-status-card {
  margin-bottom: 12px;
}

.superadmin-actions {
  margin-top: 4px;
}

.superadmin-settings-form {
  margin-top: 4px;
}

.superadmin-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.superadmin-metric {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
}

.superadmin-metric-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #94a3b8);
  margin-bottom: 4px;
}

.superadmin-metric-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text, #e2e8f0);
}

.superadmin-readiness-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.invoice-superadmin-zone {
  margin-top: 8px;
}

.invoice-superadmin-zone .divider:first-child {
  margin-top: 0;
}
  margin: 0 0 8px;
  font-size: 0.82rem;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: 0.9;
}

body.theme-white .superadmin-intro-banner,
body.theme-white .superadmin-block {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

body.theme-white .superadmin-metric {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
}

body.theme-black .superadmin-intro-banner {
  border-color: rgba(129, 173, 240, 0.22);
  background:
    radial-gradient(circle at top right, rgba(129, 173, 240, 0.14), transparent 55%),
    rgba(12, 17, 26, 0.82);
}

body.theme-black .superadmin-block {
  background: rgba(12, 17, 26, 0.72);
  border-color: rgba(129, 173, 240, 0.16);
}

.view-admin .meta-box,
.view-admin .card-item,
.view-admin .card-list .list-item {
  border-color: var(--line);
  background: rgba(8, 12, 24, 0.35);
}

body.theme-white .view-admin .panel,
body.theme-white .admin-view-hero {
  background: var(--surface-strong, #ffffff);
}

body.theme-white .view-admin .admin-account-col,
body.theme-white .view-admin .meta-box,
body.theme-white .view-admin .card-item {
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
}

body.theme-black .view-admin .panel,
body.theme-black .admin-view-hero {
  background:
    linear-gradient(145deg, rgba(22, 27, 36, 0.96) 0%, rgba(16, 20, 28, 0.92) 100%);
  border-color: rgba(129, 173, 240, 0.18);
}

body.theme-black .view-admin .admin-account-col,
body.theme-black .view-admin .meta-box,
body.theme-black .view-admin .card-item {
  background: rgba(12, 17, 26, 0.72);
  border-color: rgba(129, 173, 240, 0.16);
}

body.theme-black .password-toggle-btn {
  color: var(--muted);
}

body.theme-black .password-toggle-btn:hover,
body.theme-black .password-toggle-btn:focus-visible {
  color: var(--text);
  background: rgba(129, 173, 240, 0.14);
}

.admin-account-panel {
  margin-bottom: 18px;
}

.admin-account-lead {
  margin: 0 0 14px;
}

.admin-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.admin-account-col {
  padding: 16px 18px;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.28));
  border-radius: var(--radius-md, 14px);
  background: rgba(8, 12, 24, 0.35);
}

.admin-account-subtitle {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.admin-account-security {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.compact-heading {
  margin-bottom: 8px;
}

.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-field-wrap input[type="password"],
.password-field-wrap input[type="text"] {
  width: 100%;
  padding-right: 2.8rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  color: #0f172a;
  background: rgba(148, 163, 184, 0.18);
  outline: none;
}

.password-toggle-btn.is-visible {
  color: #0f766e;
}

.password-eye-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.password-match-hint,
.account-form-feedback {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.88rem;
}

.password-match-hint.is-ok,
.account-form-feedback.is-success {
  color: #166534;
}

.password-match-hint.is-error,
.account-form-feedback.is-error {
  color: #b91c1c;
}

.account-form-feedback.is-info {
  color: #475569;
}

html.pwa-installed .enterprise-embed-toolbar a[target="_blank"]:not([data-pwa-external="1"]) {
  display: none;
}

/* Camera hub — bulk import & bridge wizard */
.camera-hub-panel {
  overflow: hidden;
}

.camera-setup-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}

.camera-setup-tab {
  border: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.35);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.camera-setup-tab.active {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent, #38bdf8);
}

.camera-setup-tab-live.active {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.camera-live-pane {
  padding-top: 4px;
}

.camera-live-pane .camera-live-section {
  margin-top: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.camera-events-heading {
  margin-top: 18px;
}

.camera-setup-pane:not(.camera-live-pane) {
  padding: 12px 14px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 14px);
  background: rgba(8, 12, 24, 0.28);
}

.camera-bulk-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong, rgba(17, 26, 47, 0.92));
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 10px 12px;
}

.camera-bulk-result {
  min-height: 1.2rem;
  margin-top: 8px;
}

.camera-live-grid {
  align-items: start;
}

.camera-live-section {
  margin: 14px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 14px);
  background: rgba(8, 12, 24, 0.28);
}

.camera-live-section-heading {
  margin-bottom: 12px;
}

.camera-live-section-heading .helper-text {
  margin: 4px 0 0;
}

.camera-live-grid-empty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.camera-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.camera-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  min-width: 0;
}

.camera-tile-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
}

.camera-tile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-tile-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
}

.camera-tile-footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 6px 8px;
  align-items: center;
  padding: 10px 10px 10px 12px;
  border-top: 1px solid var(--line);
}

.camera-tile-meta {
  min-width: 0;
}

.camera-tile-name {
  display: block;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.camera-tile-location {
  display: block;
  font-size: 0.74rem;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.camera-tile-badge {
  font-size: 0.68rem;
}

.camera-tile-delete {
  color: #dc2626 !important;
  padding: 4px 8px !important;
}

.camera-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
}

.camera-fullscreen-overlay.hidden {
  display: none;
}

.camera-fullscreen-dialog {
  width: min(96vw, 1200px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.camera-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
}

.camera-fullscreen-image {
  width: 100%;
  max-height: calc(92vh - 48px);
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}

.camera-live-view {
  min-height: 200px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.18);
  padding: 8px;
}

.camera-live-image {
  max-width: 100%;
  border-radius: 10px;
  display: block;
}

.camera-device-list .device-status-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.camera-device-list .device-meta {
  grid-column: 2 / -1;
  font-size: 0.78rem;
  opacity: 0.85;
}

.camera-row-selected {
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.camera-bridge-setup {
  display: grid;
  gap: 10px;
}

.camera-bridge-meta code {
  word-break: break-all;
}

.camera-bridge-json-preview {
  max-height: 180px;
  overflow: auto;
  font-size: 0.72rem;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 960px) {
  .admin-account-grid {
    grid-template-columns: 1fr;
  }
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(10px);
  z-index: 10050;
  min-width: 220px;
  max-width: min(90vw, 560px);
  padding: 10px 14px;
  border-radius: 12px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  background: #111827;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-toast.app-toast-success {
  background: #166534;
}

.app-toast.app-toast-info {
  background: #1f2937;
}

.app-toast.app-toast-error {
  background: #991b1b;
}

.app-confirm-card {
  max-width: 480px;
}

.app-confirm-message {
  margin: 0 0 14px;
  line-height: 1.45;
  color: #1f2937;
  font-weight: 500;
}

.worker-app-qr-card > * {
  position: relative;
  z-index: 1;
}

body.theme-black .worker-hce-device-row {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

body.theme-black .worker-hce-status.is-active {
  background: rgba(34, 197, 94, 0.2);
  color: #a7f3d0;
}

body.theme-black .worker-hce-status.is-revoked {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

body.theme-black .app-toast {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.44);
}

body.theme-black .app-toast.app-toast-info {
  background: #111827;
}

/* Confirm overlays: light card in light theme, dark card in dark theme */
body.theme-white .app-confirm-message {
  color: #1a2332 !important;
}

body.theme-black .app-confirm-card,
body.theme-black .worker-app-qr-card.app-confirm-card {
  color: #f0f4f8;
}

@media (prefers-reduced-motion: reduce) {
  .app-toast {
    transition: none;
  }
}

/* Details-Zusammenfassung (summary) global */
body.theme-black details summary {
  color: #7eb8f7;
}

/* Import-Vorschau-Tabelle */
body.theme-black [style*="background:#dcfce7"] {
  background: rgba(34,197,94,0.18) !important;
  color: #a7f3d0 !important;
}
body.theme-black [style*="background:#fee2e2"] {
  background: rgba(220,38,38,0.18) !important;
  color: #fca5a5 !important;
}
body.theme-black [style*="background:#fef9c3"],
body.theme-black [style*="background:#fef3c7"] {
  background: rgba(234,179,8,0.18) !important;
  color: #fde68a !important;
}

/* ── Window Controls Overlay: Titelleiste komplett verstecken ── */

@media (display-mode: window-controls-overlay) {
  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(titlebar-area-height, 0px);
    background: #0d131a;
    z-index: 99999;
    pointer-events: none;
    /* Nur die linke Seite abdecken - Window-Controls-Bereich freilassen */
    right: calc(100% - env(titlebar-area-x, 100%) - env(titlebar-area-width, 100%));
  }

  .shell {
    min-height: 100dvh;
  }

  /* Sidebar füllt die gesamte Fensterhöhe inkl. Titelleistenbereich */
  .sidebar {
    height: 100dvh !important;
    padding-top: calc(32px + env(titlebar-area-height, 0px));
  }

  /* Ziehbarer Streifen über der Sidebar */
  .sidebar::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: env(titlebar-area-width, 320px);
    height: env(titlebar-area-height, 32px);
    background: #0d131a;
    -webkit-app-region: drag;
    z-index: 9999;
  }

  /* Buttons/Links in der Sidebar sollen nicht ziehen */
  .sidebar * {
    -webkit-app-region: no-drag;
  }
}

/* ── Native Desktop Shell (Electron) ─────────────────────────────────────── */
.desktop-titlebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 0 14px;
  background: linear-gradient(180deg, #111820 0%, #0d131a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3e9dd;
  z-index: 12000;
  -webkit-app-region: drag;
}

.desktop-titlebar-brand {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
  font-weight: 600;
}

.desktop-titlebar-spacer {
  flex: 1;
}

.desktop-titlebar-actions {
  display: flex;
  align-items: stretch;
  gap: 0;
  -webkit-app-region: no-drag;
}

.desktop-titlebar-btn {
  width: 46px;
  height: 40px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #f0e8dd;
  font-size: 0.95rem;
  cursor: pointer;
}

.desktop-titlebar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.desktop-titlebar-btn-close:hover {
  background: #c53d2f;
  color: white;
}

body.desktop-app {
  padding-top: 40px;
}

body.desktop-app .shell {
  min-height: calc(100vh - 40px);
}

body.desktop-app .auth-overlay {
  top: 40px;
  height: calc(100vh - 40px);
  -webkit-app-region: no-drag;
}

body.desktop-app .auth-panel,
body.desktop-app .auth-form,
body.desktop-app .auth-form label,
body.desktop-app .auth-form input,
body.desktop-app .auth-form select,
body.desktop-app .auth-form textarea,
body.desktop-app .auth-form button,
body.desktop-app .auth-lang-select-shell,
body.desktop-app .auth-hints,
body.desktop-app .auth-legal-footer {
  -webkit-app-region: no-drag;
}

body.desktop-app .sidebar {
  top: 40px !important;
  height: calc(100vh - 40px) !important;
}

body.desktop-app .topbar {
  top: 40px !important;
}
/* ── Begrüssungs-Overlay (Vollbild) ─────────────────────────── */
.login-greeting-toast {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  background: rgba(10, 28, 36, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  text-align: center;
  padding: 40px;
  animation: greetFadeIn 0.4s ease;
  pointer-events: none;
}
.login-greeting-toast.hidden { display: none; }
.login-greeting-toast.fade-out { animation: greetFadeOut 0.55s ease forwards; }
.login-greeting-toast .greet-icon {
  font-size: 4rem;
  line-height: 1;
  animation: greetIconPop 0.5s cubic-bezier(.22,1.2,.55,1) both;
}
.login-greeting-toast .greet-salutation {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.login-greeting-toast .greet-sub {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  opacity: 0.82;
  font-weight: 400;
  margin: 0;
}
.login-greeting-toast .greet-bar {
  width: 180px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  overflow: hidden;
  margin-top: 8px;
}
.login-greeting-toast .greet-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: #4ecdc4;
  animation: greetBarDrain var(--greet-duration, 4s) linear forwards;
  transform-origin: left;
}
@keyframes greetFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes greetFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.04); }
}
@keyframes greetIconPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes greetBarDrain {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── Ger\u00E4te-Status (Hardware Watchdog) ──────────────────────────── */
.device-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.device-status-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(23, 23, 23, 0.08);
}
.device-status-item.online {
  border-color: rgba(22, 120, 87, 0.3);
  background: rgba(22, 120, 87, 0.05);
}
.device-status-item.offline {
  border-color: rgba(197, 61, 47, 0.25);
  background: rgba(197, 61, 47, 0.04);
}
.device-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.device-status-item.online .device-status-dot {
  background: #16a34a;
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.6);
  animation: devicePulse 2s infinite;
}
.device-status-item.offline .device-status-dot {
  background: #dc2626;
}
@keyframes devicePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(22, 163, 74, 0.6); }
  50%       { box-shadow: 0 0 14px rgba(22, 163, 74, 0.9); }
}
.device-status-info { flex: 1; }
.device-status-name { font-weight: 700; font-size: .95rem; }
.device-status-meta { font-size: .8rem; color: #6b7280; margin-top: 2px; }
.device-status-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.device-status-item.online .device-status-badge {
  background: rgba(22, 120, 87, 0.14);
  color: #166534;
}
.device-status-item.offline .device-status-badge {
  background: rgba(197, 61, 47, 0.14);
  color: #991b1b;
}
.device-apikey-result {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(22, 120, 87, 0.07);
  border: 1px solid rgba(22, 120, 87, 0.25);
  font-size: .85rem;
  line-height: 1.6;
}
.device-apikey-result.hidden { display: none; }
.device-apikey-result code {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: #0f1117;
  color: #86efac;
  border-radius: 8px;
  word-break: break-all;
  font-size: .8rem;
}

/* ── Ausweis drucken ──────────────────────────────────────────── */
@media print {
  body { background: #fff !important; color: #000 !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body > *:not(.print-badge-root) { display: none !important; }
  .print-badge-root {
    display: block !important;
    position: static !important;
    inset: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 85.6mm !important;
    background: #fff !important;
  }
  .print-badge-root .badge-shell {
    display: block !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    width: 85.6mm !important;
    transform: none !important;
    zoom: 1 !important;
  }
  .print-badge-root .badge-card-stage {
    display: block !important;
    width: 85.6mm !important;
    height: 54mm !important;
    justify-items: start !important;
  }
  .print-badge-root .wallet-card {
    width: 85.6mm !important;
    max-width: 85.6mm !important;
    height: 54mm !important;
    aspect-ratio: auto !important;
    padding: 4mm 4.8mm !important;
    border-radius: 4.2mm !important;
    background: linear-gradient(135deg, #0f1923 0%, #1a2d3d 45%, #0d1520 100%) !important;
    border: 0.2mm solid rgba(255, 255, 255, .08) !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    transform: none !important;
    display: grid !important;
    grid-template-rows: auto auto 1fr !important;
    gap: 1.15mm !important;
    overflow: hidden !important;
  }
  .print-badge-root .wallet-card.preset-industry {
    background: linear-gradient(135deg, #241406 0%, #5a3313 44%, #2a1708 100%) !important;
  }
  .print-badge-root .wallet-card.preset-premium {
    background: linear-gradient(135deg, #010d1f 0%, #06245a 42%, #000e22 100%) !important;
  }
  .print-badge-root .wallet-card::before {
    display: block !important;
    height: 0.8mm !important;
    opacity: .95 !important;
  }
  .print-badge-root .wallet-card.preset-industry::before {
    background: linear-gradient(90deg, #c06e22 0%, #e2ad62 50%, #c06e22 100%) !important;
  }
  .print-badge-root .wallet-card.preset-premium::before {
    background: linear-gradient(90deg, #1565c0 0%, #42a5f5 48%, #1565c0 100%) !important;
  }
  .print-badge-root .wallet-card .wc-shimmer { display: none !important; }
  .print-badge-root .wallet-card .wc-grid { display: none !important; }
  .print-badge-root .wallet-card .wc-brand-mark {
    width: 6.5mm !important; height: 6.5mm !important; border-radius: 1.5mm !important;
  }
  .print-badge-root .wallet-card .wc-brand-name { font-size: 6.5pt !important; letter-spacing: .08em !important; }
  .print-badge-root .wallet-card .wc-brand-sub  { font-size: 4pt !important; }
  .print-badge-root .wallet-card .wc-nfc        { width: 5.5mm !important; height: 5.5mm !important; }
  .print-badge-root .wallet-card .wc-qr-holder  { width: 22.8mm !important; height: 22.8mm !important; min-width: 22.8mm !important; flex-shrink: 0 !important; }
  .print-badge-root .wallet-card .wc-middle { display: flex !important; justify-content: space-between !important; align-items: center !important; gap: 2mm !important; }
  .print-badge-root .wallet-card .wc-top,
  .print-badge-root .wallet-card .wc-middle,
  .print-badge-root .wallet-card .wc-bottom { margin: 0 !important; }
  .print-badge-root .wallet-card .wc-qr-frame   { inset: -1.5mm !important; border-radius: 3mm !important; }
  .print-badge-root .wallet-card .wc-qr-frame::before { display: none !important; }
  .print-badge-root .wallet-card .badge-wallet-qr { border-radius: 1.5mm !important; padding: 0.5mm !important; }
  .print-badge-root .wallet-card .wc-photo      { display: block !important; width: 20.5mm !important; height: 20.5mm !important; border-radius: 2.5mm !important; min-width: 20.5mm !important; flex-shrink: 0 !important; }
  .print-badge-root .wallet-card .wc-name       { font-size: 8.4pt !important; line-height: 1.16 !important; margin: 0 0 1px !important; }
  .print-badge-root .wallet-card .wc-role-text  { font-size: 5.6pt !important; line-height: 1.1 !important; margin: 0 0 1.6mm !important; }
  .print-badge-root .wallet-card .wc-bottom     { margin-top: .7mm !important; }
  .print-badge-root .wallet-card .wc-footer     { display: flex !important; justify-content: space-between !important; align-items: flex-end !important; gap: 1mm !important; }
  .print-badge-root .wallet-card .wc-fields     { display: flex !important; flex-direction: row !important; gap: 2.5mm !important; align-items: flex-end !important; }
  .print-badge-root .wallet-card .wc-field      { display: flex !important; flex-direction: column !important; gap: .3mm !important; }
  .print-badge-root .wallet-card .wc-field-label{ font-size: 4.2pt !important; line-height: 1.08 !important; }
  .print-badge-root .wallet-card .wc-field-value{ font-size: 5.6pt !important; line-height: 1.1 !important; }
  .print-badge-root .wallet-card .wc-field.wc-field-badge .wc-field-value { font-size: 6.8pt !important; }
  .print-badge-root .wallet-card .wc-status     { font-size: 5.2pt !important; gap: 2px !important; padding: 1px 4px !important; border-radius: 2px !important; }
  .print-badge-root .wallet-card .wc-status::before { width: 3px !important; height: 3px !important; }
  .print-badge-root .wallet-card .wc-company    { font-size: 5.2pt !important; line-height: 1.1 !important; }
  .print-badge-root .wallet-card .wc-subcompany { font-size: 4.6pt !important; line-height: 1.08 !important; padding: 1px 3px !important; }
  .print-badge-root .wallet-card .wc-right      { max-width: 34mm !important; gap: 0.3mm !important; }
  .print-badge-root .wallet-card .wc-company,
  .print-badge-root .wallet-card .wc-field-value {
    max-width: 29mm !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .print-badge-root .wallet-card .wc-subcompany {
    max-width: 31mm !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .print-badge-root .wallet-card .wc-field-label,
  .print-badge-root .wallet-card .wc-field-value,
  .print-badge-root .wallet-card .wc-company,
  .print-badge-root .wallet-card .wc-subcompany,
  .print-badge-root .wallet-card .wc-status {
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
  }
  .print-badge-root .wallet-card .wc-field-label { color: rgba(231, 240, 255, .9) !important; }
  .print-badge-root .wallet-card .wc-field-value { color: rgba(250, 252, 255, .99) !important; }
  .print-badge-root .wallet-card .wc-field.wc-field-badge .wc-field-value { color: #ffe9b4 !important; }
  .print-badge-root .wallet-card .wc-name,
  .print-badge-root .wallet-card .wc-brand-name { color: #fff !important; }
  .print-badge-root .wallet-card .wc-brand-sub { color: rgba(255, 255, 255, .45) !important; }
  .print-badge-root .wallet-card .wc-role-text { color: rgba(255, 255, 255, .62) !important; }
  .print-badge-root .wallet-card .wc-company { color: rgba(250, 252, 255, .98) !important; }
  .print-badge-root .wallet-card .wc-subcompany { color: rgba(236, 244, 255, .88) !important; }
  .print-badge-root .wallet-card .wc-status { color: #4ade80 !important; }
  .print-badge-root .wallet-card .wc-status::before {
    background: #4ade80 !important;
    box-shadow: 0 0 5px rgba(74, 222, 128, .65) !important;
  }
  .print-badge-root .badge-card-note {
    display: none !important;
  }
  .print-badge-root button,
  .print-badge-root .print-badge-root-hide { display: none !important; }
  .print-badge-root .helper-text { font-size: 8pt; }
}

  /* Admin settings visual refresh */
  #settingsForm {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
  }

  #settingsForm label {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 76, 92, 0.08);
    border-radius: 14px;
    padding: 10px 12px;
  }

  #settingsForm .form-section {
    margin-top: 16px;
    padding: 12px 12px 0;
    border-top: 1px solid rgba(15, 76, 92, 0.14);
  }

  #settingsForm .form-section-icon {
    background: linear-gradient(135deg, rgba(15, 76, 92, 0.16), rgba(227, 100, 20, 0.16));
  }

  #settingsForm .primary-button.full-width {
    position: sticky;
    bottom: 8px;
    z-index: 2;
    box-shadow: 0 14px 28px rgba(227, 100, 20, 0.24);
  }

  /* Settings action buttons: stronger hierarchy and clearer affordance */
  #settingsForm .btn,
  #settingsForm .primary-button,
  #settingsForm .ghost-button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 180ms ease, filter 180ms ease, border-color 180ms ease, background 180ms ease;
  }

  #settingsForm .btn:hover,
  #settingsForm .primary-button:hover,
  #settingsForm .ghost-button:hover {
    transform: translateY(-1px);
  }

  #settingsForm .btn:active,
  #settingsForm .primary-button:active,
  #settingsForm .ghost-button:active {
    transform: translateY(0);
  }

  #settingsForm .btn:focus-visible,
  #settingsForm .primary-button:focus-visible,
  #settingsForm .ghost-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(15, 76, 92, 0.2), 0 8px 18px rgba(15, 76, 92, 0.18);
  }

  #settingsForm .btn.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #06b6d4, #1f6a7c);
    border-color: rgba(15, 76, 92, 0.4);
    box-shadow: 0 10px 20px rgba(15, 76, 92, 0.24);
  }

  #settingsForm .btn.btn-primary:hover {
    filter: saturate(1.08) brightness(1.03);
    box-shadow: 0 14px 24px rgba(15, 76, 92, 0.28);
  }

  #settingsForm .btn.btn-secondary {
    color: #0c3139;
    background: linear-gradient(135deg, #fff1dc, #f6d9b2);
    border-color: rgba(191, 89, 15, 0.52);
    box-shadow: 0 9px 18px rgba(191, 89, 15, 0.22);
  }

  #settingsForm .btn.btn-secondary:hover {
    background: linear-gradient(135deg, #ffe6c3, #f2c88d);
    box-shadow: 0 12px 24px rgba(191, 89, 15, 0.26);
  }

  #settingsForm .ghost-button {
    color: #16323b;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 246, 247, 0.92));
    border-color: rgba(15, 76, 92, 0.22);
    box-shadow: 0 6px 14px rgba(15, 76, 92, 0.1);
  }

  #settingsForm .ghost-button:hover {
    border-color: rgba(15, 76, 92, 0.34);
    box-shadow: 0 10px 18px rgba(15, 76, 92, 0.14);
  }

  #settingsForm .btn:disabled,
  #settingsForm .primary-button:disabled,
  #settingsForm .ghost-button:disabled {
    opacity: 0.62;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: grayscale(0.1);
  }

  #settingsForm #smtpTestResult,
  #settingsForm #otpTestResult,
  #settingsForm #brevoTestResult {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    background: rgba(15, 76, 92, 0.06);
    border: 1px solid rgba(15, 76, 92, 0.12);
  }

  @media (max-width: 860px) {
    #settingsForm {
      padding: 12px;
      border-radius: 16px;
    }

    #settingsForm label {
      padding: 9px 10px;
    }
  }

/* ── Worker Stats Panel ──────────────────────────────────────────────────── */
.worker-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}
.worker-stats-kpi {
  flex: 1 1 100px;
  background: rgba(246, 239, 226, 0.5);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 90px;
}
.worker-stats-kpi strong { font-size: 1.6rem; display: block; }
.worker-stats-kpi .meta-text { font-size: 0.78rem; color: #888; margin: 0; }
.worker-stats-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.worker-stats-bar-label {
  flex: 0 0 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #444;
}
.worker-stats-bar-track {
  flex: 1;
  height: 8px;
  background: #e9e9e9;
  border-radius: 4px;
  overflow: hidden;
}
.worker-stats-bar-fill {
  height: 100%;
  background: var(--accent, #a855f7);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.worker-stats-bar-fill.accent { background: #3b82f6; }
.worker-stats-bar-count {
  flex: 0 0 32px;
  text-align: right;
  font-weight: 600;
  color: #333;
  font-size: 0.82rem;
}
.worker-stats-hour-grid {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding-bottom: 20px;
  position: relative;
}
.worker-stats-hour-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.worker-stats-hour-bar {
  width: 100%;
  background: var(--accent, #a855f7);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: height 0.4s ease;
}
.worker-stats-hour-label {
  font-size: 0.6rem;
  color: #999;
  margin-top: 3px;
  position: absolute;
  bottom: 0;
}

/* ── Manual Entry Button & Modal ─────────────────────────────────────── */
.manual-entry-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, #e86c1a, #d45a0a);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(232, 108, 26, 0.35);
}

.manual-entry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 108, 26, 0.45);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(18, 20, 23, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(18, 20, 23, 0.22);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}

.modal-search-label input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border, #e0ddd8);
  border-radius: 10px;
  font-size: 0.97rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.modal-search-label input:focus {
  border-color: var(--teal, #4db6ac);
}

.manual-entry-context-hint {
  font-size: 0.84rem;
  color: #4b5563;
  background: rgba(77, 182, 172, 0.08);
  border: 1px solid rgba(77, 182, 172, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
}

.manual-entry-worktime-panel {
  border: 1px solid var(--border, #e0ddd8);
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manual-entry-worktime-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.manual-entry-worktime-status {
  font-size: 0.78rem;
  color: #6b7280;
}

.manual-entry-worktime-status.active {
  color: #16a34a;
  font-weight: 700;
}

.manual-entry-worktime-status.inactive {
  color: #d97706;
  font-weight: 600;
}

.manual-entry-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.manual-entry-late-pill {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
  font-weight: 700;
}

.manual-entry-row-late {
  border-left: 3px solid #ef4444;
  background: rgba(220, 38, 38, 0.03);
}

.manual-entry-worktime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.manual-entry-worktime-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: #4b5563;
}

.manual-entry-worktime-label input {
  border: 1px solid var(--border, #e0ddd8);
  border-radius: 8px;
  padding: 7px 8px;
}

.manual-entry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}

.manual-entry-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface, #f8f7f4);
  border: 1px solid var(--border, #e0ddd8);
}

.manual-entry-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.manual-entry-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.manual-entry-info strong {
  font-size: 0.93rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manual-entry-info span {
  font-size: 0.8rem;
  color: #6b7280;
}

.manual-entry-badge {
  font-size: 0.75rem !important;
  font-family: monospace;
  opacity: 0.7;
}

.manual-entry-status {
  font-size: 0.72rem !important;
  padding: 2px 7px;
  border-radius: 20px;
  align-self: flex-start;
}

.manual-entry-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.manual-entry-actions .primary-button,
.manual-entry-actions .ghost-button {
  padding: 7px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.manual-entry-empty {
  color: #9ca3af;
  font-size: 0.9rem;
  text-align: center;
  padding: 12px 0;
  margin: 0;
}

.manual-entry-feedback {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.manual-entry-feedback.success {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.manual-entry-feedback.error {
  background: rgba(197, 61, 47, 0.12);
  color: var(--danger, #c53d2f);
  border: 1px solid rgba(197, 61, 47, 0.25);
}

/* ── Verbesserte Stat-Karten (v2) ─────────────────────────────── */
.stat-card-v2 {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  overflow: visible;
  min-height: 7.25rem;
}

.stat-card-v2 .stat-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-v2 .stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  hyphens: auto;
}

.stat-card-v2 .stat-value-v2 {
  display: block;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 1;
  margin-top: 2px;
}

.stat-card-warn {
  border-left: 3px solid var(--stat-accent, #d97706) !important;
}

.compliance-kpi-card {
  border: 1px solid rgba(18, 21, 24, 0.12);
}

.compliance-kpi-card.is-critical {
  border-color: rgba(220, 38, 38, 0.6);
}

.compliance-kpi-card.is-warning {
  border-color: rgba(234, 155, 24, 0.6);
}

.compliance-kpi-card.is-ok {
  border-color: rgba(22, 163, 74, 0.6);
}

.compliance-kpi-card .compliance-kpi-label {
  margin: 0;
}

.compliance-kpi-card .compliance-kpi-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

body.theme-black .compliance-kpi-card {
  background: #12161d;
  border-color: rgba(255, 255, 255, 0.14);
}

body.theme-black .compliance-kpi-card.is-critical {
  border-color: rgba(220, 38, 38, 0.9);
}

body.theme-black .compliance-kpi-card.is-warning {
  border-color: rgba(234, 155, 24, 0.9);
}

body.theme-black .compliance-kpi-card.is-ok {
  border-color: rgba(22, 163, 74, 0.9);
}

body.theme-black .compliance-kpi-card .compliance-kpi-meta {
  color: #98a2b3;
}

.compliance-expiry-card {
  border: 1px solid rgba(17, 24, 39, 0.1);
}

.compliance-expiry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.compliance-expiry-list {
  display: grid;
  gap: 8px;
}

.compliance-expiry-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.74);
}

.compliance-expiry-item strong {
  display: block;
  font-size: 0.9rem;
}

.compliance-expiry-item span {
  display: block;
  font-size: 0.78rem;
  color: #5b6472;
}

.compliance-expiry-meta {
  text-align: right;
}

.dashboard-compliance-panel .dashboard-compliance-divider {
  border: 0;
  border-top: 1px solid rgba(18, 21, 24, 0.1);
  margin: 20px 0 4px;
}

.dashboard-compliance-panel .dashboard-compliance-subhead {
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: 0;
}

.dashboard-compliance-panel .dashboard-compliance-subhead h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink, #121518);
}

body.theme-black .compliance-expiry-card {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(14, 20, 29, 0.78);
}

body.theme-black .compliance-expiry-item {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(20, 28, 40, 0.78);
}

body.theme-black .compliance-expiry-item span {
  color: #b6c1cf;
}

body.theme-black .dashboard-compliance-panel .dashboard-compliance-divider {
  border-top-color: rgba(148, 163, 184, 0.22);
}

body.theme-black .dashboard-compliance-panel .dashboard-compliance-subhead h4 {
  color: #e8edf5;
}

/* ── Mobile Verbesserungen ────────────────────────────────────── */
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card-v2 {
    padding: 12px 14px;
  }

  .stat-card-v2 .stat-value-v2 {
    font-size: 1.7rem;
  }

  .stat-card-v2 .stat-icon {
    font-size: 1.2rem;
  }

  /* Card buttons wrapping nicely on mobile */
  .card-item [style*="flex-direction:column"] {
    gap: 6px !important;
  }

  .card-item [style*="flex-wrap:wrap"] {
    gap: 4px !important;
  }

  .small-button {
    padding: 5px 9px !important;
    font-size: 0.75rem !important;
  }

  /* Worker/Company list cards spacing */
  .card-item {
    padding: 14px 16px;
  }

  /* Form buttons full-width on tiny screens */
  .button-row {
    flex-direction: column;
  }

  .button-row .ghost-button,
  .button-row .primary-button {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card-v2 .stat-value-v2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 520px) {
  .manual-entry-row {
    flex-wrap: wrap;
  }
  .manual-entry-worktime-grid {
    grid-template-columns: 1fr;
  }
  .manual-entry-actions {
    width: 100%;
  }
  .manual-entry-actions .primary-button,
  .manual-entry-actions .ghost-button {
    flex: 1;
  }
}

/* Leave request forwarded badge */
.leave-forwarded-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #1a6fbf;
  background: #e8f0fe;
  border: 1px solid #b3d0f7;
  border-radius: 4px;
  padding: 1px 6px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Aktuelle Besucher Live-Karte */
.visitor-live-card {
  padding: 12px 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  margin-bottom: 8px;
}
.vlc-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.vlc-badge {
  display: inline-block;
  background: #e8f0fe;
  color: #1a6fbf;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}
.vlc-meta { font-size: 12px; color: var(--muted, #6b7280); }
.visitor-time {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 8px;
}
.visitor-time.ok { background: rgba(26,122,58,.1); color: #1a7a3a; }
.visitor-time.soon { background: rgba(234,139,22,.12); color: #b86b00; }
.visitor-time.expired { background: rgba(197,61,47,.12); color: #c53d2f; }

/* Abwesenheitskalender */
.absence-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 14px;
  font-size: 16px;
}
.absence-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-head {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #6b7280);
  padding: 4px 2px;
  text-transform: uppercase;
}
.cal-head.weekend { color: #c53d2f; }
.cal-cell {
  min-height: 52px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 4px;
  font-size: 11px;
  position: relative;
  overflow: hidden;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.weekend { background: rgba(239,68,68,.04); }
.cal-cell.today { border-color: #2563eb; background: rgba(37,99,235,.05); }
.cal-cell.has-entries { background: rgba(37,99,235,.04); }
.cal-day { font-size: 12px; font-weight: 700; color: #374151; display: block; }
.cal-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin: 1px;
}
.cal-names {
  font-size: 9px;
  color: #374151;
  line-height: 1.3;
  margin-top: 2px;
}
.cal-names span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.cal-legend span { display: flex; align-items: center; gap: 4px; }

/* ── Nav Badge (offene Urlaubsanträge) ────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e53935;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1;
}
.nav-badge.hidden { display: none; }

/* ── Admin Toast ──────────────────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #323232;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.admin-toast.admin-toast-show { opacity: 1; transform: translateY(0); }
.admin-toast.admin-toast-success { background: #388e3c; }
.admin-toast.admin-toast-info { background: #1565c0; }
.admin-toast.admin-toast-error { background: #c62828; }

/* ── Leave-View Filtrar-Bar ───────────────────────────────────────── */
.leave-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border, #e0e0e0);
  margin-bottom: 16px;
}
.btn-filter {
  padding: 6px 14px;
  border: 1px solid var(--border, #d0d0d0);
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-filter:hover { background: var(--accent-light, #e3f2fd); border-color: var(--accent, #1976d2); }
.btn-filter.active { background: var(--accent, #1976d2); color: #fff; border-color: var(--accent, #1976d2); }

/* ── Leave Cards Grid ─────────────────────────────────────────────── */
.leave-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.leave-card {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  padding: 14px 16px;
  transition: box-shadow .15s;
  background: var(--card-bg, #fff);
}
.leave-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.leave-card-clickable { cursor: pointer; }
.leave-card-clickable:focus-visible { outline: 2px solid var(--accent, #0a57c0); outline-offset: 2px; }
.leave-panel-hint { margin: 0 0 12px; font-size: 0.9rem; }
.leave-empty-state { padding: 18px 14px; border-radius: 12px; border: 1px dashed var(--border, #d0d7de); background: var(--surface-soft, #f8fafc); }
.leave-export-csv-btn { font-size: 0.82rem; opacity: 0.85; }
.leave-card-genehmigt { border-left: 4px solid #43a047; }
.leave-card-abgelehnt { border-left: 4px solid #e53935; }
.leave-card-ausstehend { border-left: 4px solid #fb8c00; }
.leave-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.leave-card-worker { font-weight: 600; font-size: 14px; }
.leave-card-status { font-size: 12px; font-weight: 700; white-space: nowrap; }
.leave-status-genehmigt { color: #43a047; }
.leave-status-abgelehnt { color: #e53935; }
.leave-status-ausstehend { color: #fb8c00; }
.leave-card-type { font-size: 13px; color: var(--text-secondary, #666); margin-bottom: 4px; }
.leave-card-dates { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.leave-card-days { background: var(--accent-light, #e3f2fd); color: var(--accent, #1565c0); border-radius: 12px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.leave-card-note { margin-top: 8px; font-size: 12px; opacity: .75; font-style: italic; }
.leave-card-review-note { margin-top: 6px; font-size: 12px; color: #555; background: #f5f5f5; border-radius: 4px; padding: 4px 8px; }
.leave-card-forwarded { margin-top: 6px; font-size: 11px; opacity: .7; }
.leave-card-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border, #e0e0e0); }
.leave-card-document {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border, #dbe3ef);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.leave-card-doc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border, #e8edf3);
  background: linear-gradient(135deg, rgba(15,76,117,.06), rgba(255,255,255,.96));
}
.leave-card-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}
.leave-card-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--accent, #0f4c75);
  font-size: 18px;
}
.leave-card-doc-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.leave-card-company {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leave-card-doc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.leave-card-body {
  padding: 14px 16px 4px;
}
.leave-card-signature {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 76, 117, 0.06);
  font-size: 12px;
  color: #334155;
  font-style: italic;
}
.btn-approve { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.btn-approve:hover { background: #43a047; color: #fff; }
.leave-forwarded-badge { font-size: 11px; opacity: .8; }

/* ── View fade-in transition ──────────────────────────────────────── */
.view { display: none; animation: fadeInView .18s ease; }
.view.active:not(.view-embed) { display: block; }
.view.view-embed.active { display: flex !important; flex-direction: column; }
@keyframes fadeInView { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Admin Modal (Leave Reject) ──────────────────────────────────── */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeInView .15s ease;
}
.admin-modal-overlay.hidden { display: none; }
.admin-modal-card {
  background: var(--surface, #fff);
  border-radius: 12px;
  padding: 28px 28px 20px;
  width: min(420px, 92vw);
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
}
.admin-modal-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.admin-modal-desc { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary, #666); }
.admin-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.admin-modal-card.company-branding-pdf-card {
  width: min(920px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.company-branding-pdf-frame {
  width: 100%;
  min-height: 58vh;
  flex: 1;
  border: 1px solid var(--border, #d0d0d0);
  border-radius: 8px;
  background: #fff;
}
.btn-danger-solid { background: #c62828 !important; color: #fff !important; border-color: #c62828 !important; }
.btn-danger-solid:hover { background: #b71c1c !important; }

/* ── one-column panel grid ───────────────────────────────────────── */
.panel-grid.one-column { grid-template-columns: 1fr; }

/* ── Dark consistency patch: access/zutritt + gray remnants ───────────── */
body.theme-black .turnstile-tap-live,
body.theme-black .access-log-item,
body.theme-black .access-entry,
body.theme-black .meta-box,
body.theme-black .note-box {
  background: #272220;
  border-color: rgba(255, 233, 219, 0.12);
}

body.theme-black .stat-label,
body.theme-black .stat-detail,
body.theme-black .muted,
body.theme-black .helper-text,
body.theme-black .panel p,
body.theme-black .panel span,
body.theme-black .panel label {
  color: #cdc2bb;
}

body.theme-black .worker-detail-overlay .worker-detail-card,
body.theme-black .worker-detail-card {
  background: #292321;
  color: #f7f0ea;
  border: 1px solid rgba(255, 233, 219, 0.14);
}

body.theme-black .worker-detail-card h3,
body.theme-black .worker-detail-card h4,
body.theme-black .worker-detail-card p,
body.theme-black .worker-detail-card strong,
body.theme-black .worker-detail-card label {
  color: #f7f0ea;
}

body.theme-black .worker-detail-card .muted {
  color: #c8bbb3;
}

body.theme-black .worker-detail-card select,
body.theme-black .worker-detail-card textarea {
  background: #211d1b;
  color: #f7f0ea;
  border-color: rgba(255, 233, 219, 0.14);
}

body.theme-black .worker-detail-card details summary {
  color: #d79a72;
}

body.theme-black .access-feedback-card {
  background: rgba(40, 34, 31, 0.96);
  border-color: rgba(255, 233, 219, 0.16);
  color: #f7f0ea;
}

body.theme-black .access-feedback-card p {
  color: #d8cbc3;
}

body.theme-black #recentAccessList.list {
  background: linear-gradient(165deg, #272220 0%, #312b28 100%);
  border: 1px solid rgba(255, 233, 219, 0.14);
  box-shadow: 0 6px 20px rgba(18, 12, 9, 0.22);
}

body.theme-black #recentAccessList .access-entry-featured {
  background: linear-gradient(150deg, rgba(60, 47, 40, 0.94), rgba(49, 39, 34, 0.9));
  border-color: rgba(201, 131, 87, 0.24);
  box-shadow: 0 8px 20px rgba(18, 12, 9, 0.24);
}

body.theme-black #recentAccessList .access-entry-copy span,
body.theme-black #recentAccessList .access-entry-copy strong {
  color: #f0e7e1;
}

body.theme-black .turnstile-tap-live.is-idle {
  background: rgba(56, 47, 42, 0.4);
  border-color: rgba(201, 131, 87, 0.18);
}

body.theme-black .turnstile-tap-live.is-idle .turnstile-tap-dot {
  background: #ae856b;
  box-shadow: 0 0 0 0 rgba(174, 133, 107, 0.22);
}

body.theme-black .turnstile-card-input,
body.theme-black #turnstileQuickSearch,
body.theme-black #accessGate,
body.theme-black #accessNote,
body.theme-black #workerSearchInput {
  background: linear-gradient(180deg, rgba(44, 37, 34, 0.96), rgba(37, 31, 29, 0.94));
  border-color: rgba(201, 131, 87, 0.18);
  color: #f7f0ea;
}

body.theme-black .dashboard-worker-detail {
  background: linear-gradient(155deg, #241f1d 0%, #2b2522 100%);
  border-color: rgba(255, 233, 219, 0.14);
  box-shadow: 0 12px 32px rgba(12, 10, 9, 0.34);
}

body.theme-black .dashboard-worker-detail .worker-detail-card {
  background: transparent;
}

body.theme-black .dashboard-worker-detail img {
  border-color: rgba(255, 233, 219, 0.16);
  box-shadow: 0 6px 18px rgba(12, 10, 9, 0.28);
}

body.theme-black .dashboard-worker-detail h2 {
  color: #f3e9e1;
}

body.theme-black .dashboard-worker-detail p {
  color: #ddd0c7;
}

body.theme-black .dashboard-worker-detail p strong {
  color: #f7f0ea;
}

body.theme-black .dashboard-worker-detail .close-btn {
  background: rgba(255, 233, 219, 0.08);
  color: #d79a72;
}

body.theme-black .dashboard-worker-detail .button-row .primary-button,
body.theme-black .dashboard-worker-detail .button-row .ghost-button {
  color: #fffaf5;
  background: linear-gradient(90deg, #d0834f 0%, #c67645 46%, #5d7faa 54%, #4f719b 100%);
  border: 1px solid rgba(255, 233, 219, 0.14);
  box-shadow: 0 10px 22px rgba(18, 12, 9, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.theme-black .dashboard-worker-detail .button-row .primary-button:hover,
body.theme-black .dashboard-worker-detail .button-row .ghost-button:hover {
  box-shadow: 0 12px 26px rgba(18, 12, 9, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  filter: brightness(1.05) saturate(1.04);
}

body.theme-black #recentAccessList.list {
  background: linear-gradient(165deg, #2d2724 0%, #38312d 100%);
}

body.theme-black #recentAccessList .recent-access-item {
  border-bottom: 1px solid rgba(255, 233, 219, 0.08);
}

body.theme-black #recentAccessList .access-entry-featured {
  background: linear-gradient(150deg, rgba(76, 66, 60, 0.96), rgba(58, 49, 45, 0.92));
  border-color: rgba(255, 233, 219, 0.18);
}

body.theme-black #recentAccessList .access-entry-photo,
body.theme-black .access-entry-photo {
  border-color: rgba(255, 233, 219, 0.18);
  background: rgba(255, 233, 219, 0.08);
}

body.theme-black #recentAccessList .access-entry-copy strong,
body.theme-black .access-entry-copy strong {
  color: #fff7f1;
}

body.theme-black #recentAccessList .access-entry-copy span,
body.theme-black .access-entry-copy span {
  color: #eadfd7;
}

body.theme-black #recentAccessList .access-entry-copy header > span,
body.theme-black .access-entry-copy header > span {
  color: #e0b79d;
}

body.theme-black .invoice-preview-frame {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  color: #161312;
  box-shadow: 0 10px 26px rgba(6, 10, 18, 0.26);
}

body.theme-black .invoice-toolbar .ghost-button,
body.theme-black .invoice-quick-filters .ghost-button,
body.theme-black .invoice-toolbar-refresh {
  background: linear-gradient(145deg, rgba(49, 40, 36, 0.96), rgba(40, 34, 31, 0.94));
  border-color: rgba(201, 131, 87, 0.22);
  color: #f3e8df;
  box-shadow: 0 6px 16px rgba(18, 12, 9, 0.2);
}

body.theme-black .invoice-toolbar .ghost-button:hover,
body.theme-black .invoice-quick-filters .ghost-button:hover,
body.theme-black .invoice-toolbar-refresh:hover {
  border-color: rgba(201, 131, 87, 0.34);
  box-shadow: 0 8px 20px rgba(18, 12, 9, 0.26);
}

body.theme-black .invoice-filter-input,
body.theme-black .invoice-filter-select,
body.theme-black .invoice-filter-select-wide,
body.theme-black .invoice-retry-select,
body.theme-black .invoice-top-issues-toggle {
  background: rgba(43, 37, 34, 0.94);
  border-color: rgba(255, 233, 219, 0.14);
  color: #f3e8df;
}

body.theme-black .invoice-management-item,
body.theme-black .invoice-attempt-timeline,
body.theme-black .invoice-attempt-item,
body.theme-black .invoice-kpi-card,
body.theme-black .retry-queue-item,
body.theme-black .invoice-dead-letter-item,
body.theme-black .invoice-approval-item,
body.theme-black .invoice-approval-item-warn,
body.theme-black .invoice-approval-item-alert {
  background: linear-gradient(155deg, rgba(48, 41, 37, 0.96), rgba(39, 34, 31, 0.92));
  border-color: rgba(255, 233, 219, 0.14);
  color: #f5ece5;
  box-shadow: 0 8px 20px rgba(18, 12, 9, 0.18);
}

body.theme-black .invoice-status-overdue {
  background: linear-gradient(145deg, rgba(88, 46, 41, 0.92), rgba(64, 37, 34, 0.88));
}

body.theme-black .invoice-status-bezahlt {
  background: linear-gradient(145deg, rgba(42, 74, 60, 0.92), rgba(34, 54, 46, 0.88));
}

body.theme-black .invoice-status-send_failed {
  background: linear-gradient(145deg, rgba(93, 57, 39, 0.92), rgba(68, 43, 31, 0.88));
}

body.theme-black .invoice-management-item,
body.theme-black .invoice-management-item strong,
body.theme-black .invoice-management-item span,
body.theme-black .invoice-management-item p,
body.theme-black .invoice-retry-meta,
body.theme-black .invoice-attempt-item,
body.theme-black .invoice-attempt-item strong,
body.theme-black .invoice-attempt-item span,
body.theme-black .invoice-kpi-card,
body.theme-black .invoice-kpi-card strong,
body.theme-black .invoice-dead-letter-item,
body.theme-black .invoice-approval-item,
body.theme-black .invoice-approval-item p {
  color: #f5ece5;
}

body.theme-black .invoice-retry-meta,
body.theme-black .invoice-management-side,
body.theme-black .invoice-attempt-row time,
body.theme-black .invoice-top-issues-toggle,
body.theme-black .invoice-retry-select {
  color: #dbcac0;
}

body.theme-black .invoice-kpi-open,
body.theme-black .invoice-kpi-overdue,
body.theme-black .invoice-kpi-paid,
body.theme-black .invoice-kpi-failed {
  background: linear-gradient(155deg, rgba(54, 46, 42, 0.96), rgba(42, 36, 33, 0.92));
}

body.theme-black .invoice-status-badge-draft {
  color: #d7dce4;
  background: rgba(116, 130, 145, 0.16);
  border-color: rgba(116, 130, 145, 0.26);
}

body.theme-black .invoice-status-badge-sent {
  color: #cfe0f5;
  background: rgba(93, 127, 170, 0.18);
  border-color: rgba(93, 127, 170, 0.3);
}

/* Ultra pass: stronger glow only on dark interactive buttons */
body.theme-black .primary-button,
body.theme-black .ghost-button,
body.theme-black .dashboard-worker-detail .button-row .primary-button,
body.theme-black .dashboard-worker-detail .button-row .ghost-button,
body.theme-black .invoice-toolbar .ghost-button,
body.theme-black .invoice-quick-filters .ghost-button,
body.theme-black .invoice-toolbar-refresh {
  box-shadow:
    0 10px 24px rgba(6, 10, 18, 0.44),
    0 0 0 1px rgba(129, 173, 240, 0.2),
    0 0 22px rgba(243, 146, 86, 0.18),
    0 0 16px rgba(93, 135, 232, 0.16);
}

body.theme-black .primary-button:hover,
body.theme-black .ghost-button:hover,
body.theme-black .dashboard-worker-detail .button-row .primary-button:hover,
body.theme-black .dashboard-worker-detail .button-row .ghost-button:hover,
body.theme-black .invoice-toolbar .ghost-button:hover,
body.theme-black .invoice-quick-filters .ghost-button:hover,
body.theme-black .invoice-toolbar-refresh:hover {
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.08);
  box-shadow:
    0 14px 30px rgba(6, 10, 18, 0.54),
    0 0 0 1px rgba(129, 173, 240, 0.34),
    0 0 30px rgba(243, 146, 86, 0.28),
    0 0 24px rgba(93, 135, 232, 0.24);
}

body.theme-black .primary-button,
body.theme-black .ghost-button,
body.theme-black .dashboard-worker-detail .button-row .primary-button,
body.theme-black .dashboard-worker-detail .button-row .ghost-button,
body.theme-black .invoice-toolbar .ghost-button,
body.theme-black .invoice-quick-filters .ghost-button,
body.theme-black .invoice-toolbar-refresh {
  position: relative;
  overflow: hidden;
}

body.theme-black .primary-button::before,
body.theme-black .ghost-button::before,
body.theme-black .dashboard-worker-detail .button-row .primary-button::before,
body.theme-black .dashboard-worker-detail .button-row .ghost-button::before,
body.theme-black .invoice-toolbar .ghost-button::before,
body.theme-black .invoice-quick-filters .ghost-button::before,
body.theme-black .invoice-toolbar-refresh::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.36) 50%, transparent 80%);
  transform: translateX(-140%);
  opacity: 0;
  pointer-events: none;
}

body.theme-black .primary-button:hover::before,
body.theme-black .ghost-button:hover::before,
body.theme-black .dashboard-worker-detail .button-row .primary-button:hover::before,
body.theme-black .dashboard-worker-detail .button-row .ghost-button:hover::before,
body.theme-black .invoice-toolbar .ghost-button:hover::before,
body.theme-black .invoice-quick-filters .ghost-button:hover::before,
body.theme-black .invoice-toolbar-refresh:hover::before {
  opacity: 0.82;
  animation: darkButtonSweep 760ms cubic-bezier(0.22, 0.78, 0.18, 1) 1;
}

body.theme-black .primary-button:focus-visible,
body.theme-black .ghost-button:focus-visible,
body.theme-black .dashboard-worker-detail .button-row .primary-button:focus-visible,
body.theme-black .dashboard-worker-detail .button-row .ghost-button:focus-visible,
body.theme-black .invoice-toolbar .ghost-button:focus-visible,
body.theme-black .invoice-quick-filters .ghost-button:focus-visible,
body.theme-black .invoice-toolbar-refresh:focus-visible {
  outline: none;
  animation: darkButtonPulse 520ms ease-out 1;
  box-shadow:
    0 0 0 2px rgba(129, 173, 240, 0.44),
    0 0 0 5px rgba(243, 146, 86, 0.28),
    0 0 34px rgba(93, 135, 232, 0.28);
}

body.theme-black .primary-button:active,
body.theme-black .ghost-button:active,
body.theme-black .dashboard-worker-detail .button-row .primary-button:active,
body.theme-black .dashboard-worker-detail .button-row .ghost-button:active,
body.theme-black .invoice-toolbar .ghost-button:active,
body.theme-black .invoice-quick-filters .ghost-button:active,
body.theme-black .invoice-toolbar-refresh:active {
  transform: translateY(0) scale(0.99);
  filter: saturate(1.14) brightness(1.05);
  animation: darkButtonPulse 420ms ease-out 1;
}

@keyframes darkButtonSweep {
  from { transform: translateX(-140%); }
  to { transform: translateX(140%); }
}

@keyframes darkButtonPulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(243, 146, 86, 0.38),
      0 0 0 0 rgba(93, 135, 232, 0.34);
  }
  100% {
    box-shadow:
      0 0 0 10px rgba(243, 146, 86, 0),
      0 0 0 14px rgba(93, 135, 232, 0);
  }
}

body.theme-black .invoice-status-badge-overdue,
body.theme-black .invoice-attempt-status-failed {
  color: #ffd5cf;
  background: rgba(160, 76, 67, 0.2);
  border-color: rgba(160, 76, 67, 0.34);
}

body.theme-black .invoice-status-badge-bezahlt,
body.theme-black .invoice-attempt-status-sent {
  color: #d0f0df;
  background: rgba(56, 111, 84, 0.2);
  border-color: rgba(56, 111, 84, 0.32);
}

body.theme-black .invoice-status-badge-send_failed {
  color: #ffd9c6;
  background: rgba(146, 94, 61, 0.22);
  border-color: rgba(146, 94, 61, 0.34);
}

/* Readability hotfix: low-contrast areas from runtime screenshots */
body.theme-black .dashboard-detail-overlay {
  background: rgba(6, 10, 18, 0.7) !important;
}

body.theme-black .dashboard-worker-detail {
  background: linear-gradient(155deg, #171d27 0%, #1d2431 100%) !important;
  border: 1px solid rgba(129, 173, 240, 0.24) !important;
  box-shadow: 0 18px 40px rgba(3, 6, 12, 0.56) !important;
  color: #f4f7ff !important;
}

body.theme-black .dashboard-worker-detail .worker-detail-card,
body.theme-black .dashboard-worker-detail .worker-detail-card * {
  color: #f0f4ff !important;
  opacity: 1 !important;
}

body.theme-black .dashboard-worker-detail h2 {
  font-size: 1.35rem !important;
  line-height: 1.2 !important;
}

body.theme-black .dashboard-worker-detail p,
body.theme-black .dashboard-worker-detail li,
body.theme-black .dashboard-worker-detail label {
  font-size: 1.01rem !important;
  line-height: 1.55 !important;
}

body.theme-black .dashboard-worker-detail .muted,
body.theme-black .dashboard-worker-detail .worker-detail-card .muted {
  color: #c2cde3 !important;
}

body.theme-black .dashboard-worker-detail .close-btn {
  background: rgba(129, 173, 240, 0.14) !important;
  color: #f3a06c !important;
  border: 1px solid rgba(129, 173, 240, 0.22) !important;
}

body.theme-black .access-feedback-card,
body.theme-black .porter-company-summary,
body.theme-black .porter-company-summary.empty,
body.theme-black .porter-company-total {
  background: linear-gradient(160deg, rgba(26, 33, 45, 0.96), rgba(22, 29, 40, 0.94)) !important;
  border-color: rgba(129, 173, 240, 0.2) !important;
  color: #eef3ff !important;
}

body.theme-black .access-feedback-card h3,
body.theme-black .access-feedback-card p,
body.theme-black .porter-company-total,
body.theme-black .porter-company-summary,
body.theme-black .porter-company-summary span {
  color: #eef3ff !important;
}

body.theme-black .access-feedback-card h3 {
  font-size: 1.05rem !important;
  line-height: 1.25 !important;
}

body.theme-black .access-feedback-card p,
body.theme-black .porter-company-total,
body.theme-black .porter-company-summary,
body.theme-black .porter-company-summary span {
  font-size: 0.98rem !important;
  line-height: 1.55 !important;
}

body.theme-black #recentAccessList.list {
  background: linear-gradient(165deg, #1a2130 0%, #20293a 100%) !important;
  border: 1px solid rgba(129, 173, 240, 0.2) !important;
}

body.theme-black #recentAccessList .recent-access-item {
  border-bottom: 1px solid rgba(129, 173, 240, 0.14) !important;
}

body.theme-black #recentAccessList .access-entry-featured {
  background: linear-gradient(150deg, rgba(32, 41, 57, 0.98), rgba(27, 35, 49, 0.96)) !important;
  border-color: rgba(129, 173, 240, 0.24) !important;
}

body.theme-black #recentAccessList .access-entry-copy strong,
body.theme-black .access-entry-copy strong {
  color: #f4f7ff !important;
  font-size: 1.05rem !important;
  line-height: 1.25 !important;
}

body.theme-black #recentAccessList .access-entry-copy span,
body.theme-black .access-entry-copy span {
  color: #d4def2 !important;
  font-size: 0.95rem !important;
  line-height: 1.42 !important;
}

body.theme-black #recentAccessList .access-entry-copy header > span,
body.theme-black .access-entry-copy header > span {
  color: #ffbf93 !important;
  font-size: 0.88rem !important;
}

body.theme-black .gate-deny-legend-row,
body.theme-black .invoice-ops-error-row {
  color: #e7efff !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
}

body.theme-black .gate-deny-chip {
  border-width: 1px;
  font-weight: 700;
  font-size: 0.9rem !important;
  line-height: 1.2 !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

body.theme-black .gate-deny-critical {
  color: #ffd2cb !important;
  border-color: rgba(230, 106, 92, 0.52) !important;
  background: rgba(133, 40, 34, 0.34) !important;
}

body.theme-black .gate-deny-warn {
  color: #ffe1b4 !important;
  border-color: rgba(226, 160, 72, 0.5) !important;
  background: rgba(112, 74, 23, 0.34) !important;
}

body.theme-black .gate-deny-tech {
  color: #d6eaff !important;
  border-color: rgba(96, 165, 250, 0.5) !important;
  background: rgba(28, 70, 120, 0.34) !important;
}

body.theme-black .gate-deny-neutral {
  color: #e5edf9 !important;
  border-color: rgba(159, 174, 195, 0.42) !important;
  background: rgba(68, 79, 96, 0.3) !important;
}

body.theme-black .invoice-ops-trend-item {
  background: linear-gradient(160deg, rgba(20, 27, 38, 0.98), rgba(15, 21, 31, 0.96)) !important;
  border-color: rgba(129, 173, 240, 0.2) !important;
  color: #eef3ff !important;
  box-shadow: 0 12px 28px rgba(3, 6, 12, 0.42) !important;
}

body.theme-black .invoice-ops-trend-head,
body.theme-black .invoice-ops-trend-item strong,
body.theme-black .invoice-ops-trend-item span,
body.theme-black .invoice-ops-trend-item p {
  color: #eef3ff !important;
}

body.theme-black .invoice-ops-trend-head {
  font-size: 1.02rem !important;
  line-height: 1.35 !important;
}

body.theme-black .hourly-grid {
  gap: 8px !important;
}

body.theme-black .hour-row {
  background: linear-gradient(160deg, rgba(22, 31, 44, 0.99), rgba(16, 24, 35, 0.97)) !important;
  border-color: rgba(129, 173, 240, 0.16) !important;
  color: #eef3ff !important;
}

body.theme-black .hour-row span,
body.theme-black .hour-row strong,
body.theme-black .hour-row div {
  color: #eef3ff !important;
  font-size: 1rem !important;
  line-height: 1.45 !important;
}

body.theme-black .hour-row .summary-visitor-pill {
  background: rgba(129, 173, 240, 0.16) !important;
  color: #f4f7ff !important;
}

body.theme-black .warning-item {
  background: linear-gradient(160deg, rgba(21, 29, 41, 0.98), rgba(15, 22, 32, 0.96)) !important;
  border-color: rgba(129, 173, 240, 0.16) !important;
  color: #eef3ff !important;
}

body.theme-black .warning-item.severity-green {
  border-left-color: rgba(110, 231, 183, 0.9) !important;
}

body.theme-black .warning-item.severity-yellow {
  border-left-color: rgba(252, 211, 77, 0.95) !important;
}

body.theme-black .warning-item.severity-red {
  border-left-color: rgba(248, 113, 113, 0.95) !important;
  background: linear-gradient(160deg, rgba(46, 24, 28, 0.98), rgba(28, 18, 22, 0.96)) !important;
}

body.theme-black .warning-item,
body.theme-black .warning-item strong,
body.theme-black .warning-item span,
body.theme-black .warning-item p {
  color: #eef3ff !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
}

body.theme-black .warning-item .summary-visitor-pill,
body.theme-black .warning-item .invoice-ops-error-chip {
  background: rgba(129, 173, 240, 0.14) !important;
  color: #f4f7ff !important;
  border-color: rgba(129, 173, 240, 0.24) !important;
}

body.theme-black .summary-block {
  background: linear-gradient(160deg, rgba(20, 27, 38, 0.98), rgba(14, 21, 31, 0.96)) !important;
  border-color: rgba(129, 173, 240, 0.18) !important;
  box-shadow: 0 12px 28px rgba(3, 6, 12, 0.42) !important;
}

body.theme-black .summary-block .eyebrow,
body.theme-black .summary-block h3 {
  color: #f1f5ff !important;
}

body.theme-black .summary-card {
  background: linear-gradient(160deg, rgba(24, 33, 47, 0.99), rgba(17, 25, 37, 0.97)) !important;
  border-color: rgba(129, 173, 240, 0.16) !important;
  color: #eef3ff !important;
}

body.theme-black .summary-card strong {
  color: #f4f7ff !important;
  font-size: 1.06rem !important;
  line-height: 1.25 !important;
}

body.theme-black .summary-card span {
  color: #d6e0f5 !important;
  font-size: 0.97rem !important;
  line-height: 1.5 !important;
}

body.theme-black .summary-visitor-block {
  border-top-color: rgba(129, 173, 240, 0.2) !important;
}

body.theme-black .summary-visitor-title {
  color: #f0f4ff !important;
}

body.theme-black .summary-visitor-pill {
  background: rgba(129, 173, 240, 0.14) !important;
  color: #f4f7ff !important;
  border: 1px solid rgba(129, 173, 240, 0.22) !important;
  font-size: 0.9rem !important;
}

body.theme-black .status-pill.status-check-in {
  background: rgba(129, 173, 240, 0.22) !important;
  color: #eef3ff !important;
  border-color: rgba(129, 173, 240, 0.34) !important;
}

body.theme-black .porter-live-card {
  background: linear-gradient(160deg, rgba(20, 27, 38, 0.98), rgba(14, 21, 31, 0.96)) !important;
  border-color: rgba(129, 173, 240, 0.2) !important;
  box-shadow: 0 12px 30px rgba(3, 6, 12, 0.44) !important;
  color: #eef3ff !important;
}

body.theme-black .porter-live-topline,
body.theme-black .porter-live-topline strong,
body.theme-black .porter-live-topline span,
body.theme-black .porter-head strong,
body.theme-black .porter-head span {
  color: #edf3ff !important;
}

body.theme-black .porter-event {
  background: rgba(41, 96, 75, 0.34) !important;
  border: 1px solid rgba(110, 231, 183, 0.28) !important;
  color: #dcfff0 !important;
}

body.theme-black .porter-event.muted {
  background: rgba(61, 82, 108, 0.34) !important;
  border: 1px solid rgba(129, 173, 240, 0.24) !important;
  color: #e3edff !important;
}

body.theme-black .invoice-ops-error-chip {
  background: linear-gradient(160deg, rgba(28, 36, 49, 0.96), rgba(20, 27, 38, 0.94)) !important;
  color: #eef3ff !important;
  border-color: rgba(129, 173, 240, 0.26) !important;
  font-size: 0.92rem !important;
}

/* Final dark system pass: contrast autopilot + typography hierarchy + primary-only glow */
body.theme-black {
  --ui-title-size: 1.16rem;
  --ui-value-size: 1.04rem;
  --ui-meta-size: 0.94rem;
  --ui-line-height: 1.52;
}

body.theme-black .panel h3,
body.theme-black .summary-card strong,
body.theme-black .porter-head strong,
body.theme-black .hour-row strong,
body.theme-black .warning-item strong,
body.theme-black .invoice-ops-trend-head {
  font-size: var(--ui-title-size) !important;
  line-height: 1.28 !important;
  color: #f4f7ff !important;
}

body.theme-black .panel p,
body.theme-black .panel span,
body.theme-black .summary-card span,
body.theme-black .porter-head span,
body.theme-black .hour-row span,
body.theme-black .warning-item span,
body.theme-black .invoice-ops-error-chip,
body.theme-black .gate-deny-chip {
  font-size: var(--ui-meta-size) !important;
  line-height: var(--ui-line-height) !important;
  color: #d9e3f8 !important;
}

body.theme-black .summary-card,
body.theme-black .hour-row,
body.theme-black .warning-item,
body.theme-black .porter-live-card,
body.theme-black .invoice-ops-trend-item,
body.theme-black .access-feedback-card,
body.theme-black .porter-company-summary,
body.theme-black .summary-block {
  color: #eef3ff !important;
  border-color: rgba(129, 173, 240, 0.2) !important;
}

body.theme-black .ghost-button,
body.theme-black .dashboard-worker-detail .button-row .ghost-button,
body.theme-black .invoice-toolbar .ghost-button,
body.theme-black .invoice-quick-filters .ghost-button,
body.theme-black .invoice-toolbar-refresh {
  box-shadow: 0 6px 14px rgba(6, 10, 18, 0.28), 0 0 0 1px rgba(129, 173, 240, 0.16) !important;
  filter: none !important;
}

body.theme-black .ghost-button:hover,
body.theme-black .dashboard-worker-detail .button-row .ghost-button:hover,
body.theme-black .invoice-toolbar .ghost-button:hover,
body.theme-black .invoice-quick-filters .ghost-button:hover,
body.theme-black .invoice-toolbar-refresh:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 9px 18px rgba(6, 10, 18, 0.34), 0 0 0 1px rgba(129, 173, 240, 0.22) !important;
  filter: none !important;
}

body.theme-black .ghost-button::before,
body.theme-black .dashboard-worker-detail .button-row .ghost-button::before,
body.theme-black .invoice-toolbar .ghost-button::before,
body.theme-black .invoice-quick-filters .ghost-button::before,
body.theme-black .invoice-toolbar-refresh::before {
  display: none !important;
}

body.theme-black .ghost-button:focus-visible,
body.theme-black .dashboard-worker-detail .button-row .ghost-button:focus-visible,
body.theme-black .invoice-toolbar .ghost-button:focus-visible,
body.theme-black .invoice-quick-filters .ghost-button:focus-visible,
body.theme-black .invoice-toolbar-refresh:focus-visible {
  animation: none !important;
  box-shadow: 0 0 0 2px rgba(129, 173, 240, 0.34), 0 8px 16px rgba(6, 10, 18, 0.3) !important;
}

body.theme-black .ghost-button:active,
body.theme-black .dashboard-worker-detail .button-row .ghost-button:active,
body.theme-black .invoice-toolbar .ghost-button:active,
body.theme-black .invoice-quick-filters .ghost-button:active,
body.theme-black .invoice-toolbar-refresh:active {
  animation: none !important;
  transform: translateY(0) scale(0.99) !important;
}

/* —— UX: quick dashboard access + mobile shell nav —— */
.dashboard-quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.quick-nav-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--line);
  background: var(--surface, #fff);
  color: var(--ink, #0f1720);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.quick-nav-tile:hover {
  border-color: var(--accent, #1b7a9e);
  box-shadow: 0 6px 20px rgba(15, 23, 32, 0.08);
  transform: translateY(-1px);
}

.quick-nav-tile-accent {
  background: linear-gradient(135deg, rgba(27, 122, 158, 0.12), rgba(15, 76, 92, 0.08));
  border-color: rgba(27, 122, 158, 0.35);
}

.sidebar-admin-v2-link {
  display: none !important;
}

.sidebar-admin-v2-link.legacy-visible {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: #7dd3fc;
  border: 1px dashed rgba(94, 234, 212, 0.45);
  text-align: center;
  background: rgba(15, 23, 32, 0.55);
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.sidebar-admin-v2-link:hover {
  background: rgba(94, 234, 212, 0.12);
  border-color: rgba(94, 234, 212, 0.55);
}

.nav-link-external {
  text-decoration: none;
  color: inherit;
  font-size: 0.88rem;
  opacity: 0.9;
}

.topbar-more-menu {
  position: relative;
}

.topbar-more-menu[open] {
  z-index: 210;
}

.topbar-more-menu summary {
  list-style: none;
  cursor: pointer;
}

.topbar-more-menu summary::-webkit-details-marker {
  display: none;
}

.topbar-more-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 200;
  min-width: 220px;
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface, #fff);
  box-shadow: 0 12px 32px rgba(15, 23, 32, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-shell-nav {
  display: none;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr !important;
    padding-bottom: 4.5rem;
  }

  .sidebar {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible;
  }

  .mobile-shell-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 800;
    background: var(--surface, #fff);
    border-top: 1px solid var(--line);
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0));
    justify-content: space-around;
    gap: 0.15rem;
    box-shadow: 0 -6px 24px rgba(15, 23, 32, 0.1);
  }

  .mobile-shell-nav-item {
    flex: 1;
    flex-direction: column;
    font-size: 0.68rem;
    padding: 0.45rem 0.25rem;
    min-height: 48px;
    border-radius: 8px;
    text-align: center;
    background: transparent;
    border: none;
  }

  .mobile-shell-nav-item.active {
    background: rgba(27, 122, 158, 0.12);
    color: var(--accent, #1b7a9e);
    font-weight: 700;
  }
}

/* —— Einsatzplan (SUPPIX + shared modal) —— */
.deployment-month-bar {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  background: rgba(15, 76, 92, 0.12);
}

.deployment-month-bar-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.deployment-month-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.deployment-status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.deployment-status-badge.draft {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.deployment-status-badge.awaiting {
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

.deployment-status-badge.sent {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.deployment-ready-pill {
  font-size: 0.78rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.deployment-ready-pill.ok {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.deployment-workers-section {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 2px solid rgba(94, 234, 212, 0.35);
}

.deployment-workers-section-head h4 {
  margin: 0 0 0.35rem;
  font-size: 1.12rem;
  color: var(--text, #1a2e3a);
}

.deployment-worker-list-wrap {
  margin-top: 0.75rem;
  min-height: 12rem;
}

.deployment-worker-table .primary-button.small-button {
  min-width: 7.5rem;
  font-weight: 700;
}

.deployment-day-clear {
  font-size: 0.78rem;
  padding: 0.2rem 0.45rem;
  white-space: nowrap;
}

.admin-modal-card.deployment-modal-card {
  width: min(920px, 96vw);
  max-width: 96vw;
  height: min(92vh, 880px);
  max-height: min(92vh, 880px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.deployment-modal-header {
  flex-shrink: 0;
  padding: 1.1rem 1.35rem 0.65rem;
  border-bottom: 1px solid var(--border, #2a3848);
}

.deployment-modal-header .admin-modal-title {
  margin: 0 0 0.25rem;
}

.deployment-modal-worker {
  margin: 0 0 0.65rem;
  font-weight: 600;
}

.deployment-quick-details {
  margin-top: 0.45rem;
  border: 1px solid var(--border, #2a3848);
  border-radius: 10px;
  background: rgba(15, 76, 92, 0.15);
}

.deployment-quick-details summary {
  cursor: pointer;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-hover, #5eead4);
  list-style: none;
}

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

.deployment-quick-details[open] summary {
  border-bottom: 1px solid var(--border, #2a3848);
}

.deployment-quick-details .deployment-bulk-bar {
  margin: 0;
  padding: 0.55rem 0.65rem 0.65rem;
}

.deployment-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1.25rem 0.75rem;
}

.deployment-scroll-hint {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: rgba(94, 234, 212, 0.12);
  color: var(--accent-hover, #5eead4);
  font-size: 0.78rem;
}

.deployment-modal-footer {
  flex-shrink: 0;
  margin: 0;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--border, #2a3848);
  background: var(--panel, #121a24);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.deployment-toolbar,
.deployment-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.deployment-bulk-bar input[type="text"],
.deployment-bulk-bar input[type="time"] {
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border, #2a3848);
  background: var(--panel-2, #182230);
  color: var(--text, #eef4f9);
}

.deployment-bulk-bar input[type="text"] {
  flex: 1 1 160px;
}

.deployment-days-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  padding: 0.35rem 0.15rem 0.5rem;
  border: 1px solid var(--border, #2a3848);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
  overflow: visible;
  min-height: auto;
  max-height: none;
  flex: none;
}

.deployment-days-header,
.deployment-day-row {
  display: grid;
  grid-template-columns: 4.25rem minmax(120px, 1.5fr) 5rem 5rem minmax(72px, 1fr) 2.75rem minmax(9rem, auto);
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
}

.deployment-days-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.35rem 0.1rem;
  background: var(--panel, #121a24);
  border-bottom: 1px solid var(--border, #2a3848);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted, #8fa0b0);
}

.deployment-day-row.weekend {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.deployment-day-row.is-free-day {
  background: rgba(16, 185, 129, 0.12);
  border-radius: 6px;
}

.deployment-day-row[style*="--dep-row-color"] {
  box-shadow: inset 3px 0 0 var(--dep-row-color, transparent);
}

.deployment-day-color {
  width: 2.25rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border, #2a3848);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.deployment-day-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.deployment-day-row input {
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border, #2a3848);
  background: #0d131a;
  color: var(--text, #eef4f9);
  font-size: 0.82rem;
}

.deployment-day-meta {
  color: var(--muted, #8fa0b0);
  font-size: 0.78rem;
  line-height: 1.2;
}

.deployment-weekday {
  display: block;
  font-size: 0.68rem;
  color: var(--accent-hover, #22a8d4);
}

.deployment-day-declined {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #92400e;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.deployment-decline-reason {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text, #1e293b);
}

.stat-card-clickable[data-view] {
  cursor: pointer;
}

.stat-card-clickable[data-view]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 76, 92, 0.12);
}

.deployment-day-row.worker-declined {
  box-shadow: inset 3px 0 0 #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.deployment-worker-decline-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400e;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.deployment-worker-table tr.has-worker-declines td:first-child {
  font-weight: 700;
}

.deployment-declines-banner {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
}

.deployment-declines-banner-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: #92400e;
}

.deployment-declines-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.deployment-decline-clickable {
  cursor: pointer;
  border-radius: 6px;
  padding: 0.15rem 0.35rem;
  margin-left: -0.35rem;
  transition: background 0.15s ease;
}

.deployment-decline-clickable:hover,
.deployment-decline-clickable:focus-visible {
  background: rgba(245, 158, 11, 0.22);
  outline: none;
}

.deployment-day-row.deployment-day-highlight {
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.75);
  animation: deployment-day-pulse 1.2s ease 2;
}

@keyframes deployment-day-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.35);
  }
  50% {
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.95);
  }
}

.deployment-modal-declined-meta {
  margin: 0.35rem 0 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.deployment-modal-declined-meta.hidden {
  display: none;
}

#cpDeploymentModal.admin-modal-overlay {
  z-index: 1200;
}

/* ── Photo editor (Canva-style drag) ─────────────────────────────── */
.photo-editor-stage {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin: 12px 0;
}

.photo-editor-frame {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--line, rgba(255, 255, 255, 0.2));
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  touch-action: none;
  outline: none;
}

.photo-editor-frame:focus-visible {
  border-color: var(--accent, #06b6d4);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.35), 0 8px 24px rgba(0, 0, 0, 0.18);
}

.photo-editor-frame .captured-photo,
#capturedPhoto.captured-photo {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border: none;
  border-radius: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
}

.photo-editor-frame .captured-photo.has-image,
#capturedPhoto.captured-photo.has-image {
  display: block;
}

.photo-editor-guide {
  position: absolute;
  inset: 12% 18% 28% 18%;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  border-radius: 50% / 42%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.08);
}

.photo-editor-frame.has-photo .photo-editor-guide {
  opacity: 1;
}

.photo-editor-hint {
  position: absolute;
  inset: auto 8px 8px 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.photo-editor-frame.has-photo:hover .photo-editor-hint,
.photo-editor-frame.has-photo:focus-within .photo-editor-hint,
.photo-editor-frame.has-photo:focus .photo-editor-hint {
  opacity: 0.92;
}

body.theme-black .photo-editor-frame {
  border-color: rgba(255, 255, 255, 0.22);
  background: #111827;
}

body.theme-black .photo-adjust-panel {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.12);
}

body.theme-white .photo-adjust-panel {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.1);
}

body.theme-black .photo-zoom-row,
body.theme-black .photo-adjust-status {
  color: #c2ccd8;
}

body.theme-white .session-card {
  background: rgba(255, 255, 255, 0.96);
  color: #121518;
  border-color: rgba(18, 21, 24, 0.1);
}

body.theme-white .session-card strong,
body.theme-white .session-card span {
  color: #121518;
}

body.theme-black .session-card strong,
body.theme-black .session-card span {
  color: #f0f4f8;
}

/* ── Modal & form contrast (theme-independent readability) ───────── */
body.theme-black .admin-modal-card {
  background: #1a2332;
  color: #f0f4f8;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.theme-black .admin-modal-title {
  color: #f8fafc;
}

body.theme-black .admin-modal-desc {
  color: #cbd5e1;
}

body.theme-white .admin-modal-card {
  background: #fff9f5;
  color: #1a2332;
}

.theme-toggle-btn {
  min-width: 9.5rem;
  font-weight: 700;
}

.photo-undo-btn {
  justify-self: center;
  min-height: 36px;
  font-size: 0.85rem;
}

body.theme-black select option {
  background: #111111;
  color: #f5f5f5;
}

body.theme-white select option {
  background: #ffffff;
  color: #121518;
}

body.theme-black .shell select:not([multiple]),
body.theme-black .topbar-actions select:not([multiple]),
body.theme-black .sidebar-company-picker-select {
  color: #f5f5f5;
  background: #111111;
}

body.theme-white .shell select:not([multiple]),
body.theme-white .topbar-actions select:not([multiple]) {
  color: #121518;
  background: #ffffff;
}
