:root {
  --bg: #f6f8f8;
  --surface: #ffffff;
  --surface-2: #eef7f7;
  --text: #111111;
  --muted: #687474;
  --line: #d6e3e3;
  --red: #e30613;
  --red-dark: #b00012;
  --turquoise: #009ca6;
  --turquoise-dark: #00727a;
  --violet: #2f1c86;
  --green: #13795b;
  --yellow: #a86d00;
  --blue: #2463a6;
  --shadow: 0 18px 45px rgba(20, 28, 24, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: var(--radius);
  background: var(--red);
  color: white;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0.65rem 0.95rem;
}

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

button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

button.secondary:hover {
  background: #e2ebe7;
}

button.danger {
  background: #5e1621;
}

button.success {
  background: var(--green);
}

button.link-button {
  background: transparent;
  color: var(--red);
  border: 0;
  padding: 0.2rem 0.35rem;
  min-height: auto;
}

.button-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
}

.button-anchor:hover {
  background: #e2ebe7;
}

.context-card {
  display: grid;
  gap: 0.2rem;
  border-radius: var(--radius);
  background: var(--turquoise);
  color: #fff;
  padding: 1rem;
}

.context-card span {
  color: rgba(255, 255, 255, 0.86);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 0.62rem 0.72rem;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #34403b;
  font-weight: 650;
}

.app-shell {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.app-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.4rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.app-footer-branding {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  opacity: 0.92;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 20px 0 18px;
  border-bottom: 5px solid var(--red);
  margin-bottom: 18px;
}


.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 280px;
}

.brand-logo {
  width: clamp(92px, 13vw, 190px);
  max-height: 72px;
  object-fit: contain;
  flex: 0 0 auto;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--turquoise-dark);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.role-strip {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

body[data-app-area="admin"] {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-2: #f0f2f4;
  --text: #171b20;
  --muted: #65707a;
  --line: #dfe4e8;
  --red: #ff9a3d;
  --red-dark: #e57f20;
  --turquoise: #20262d;
  --turquoise-dark: #11161b;
  --blue: #516170;
  --shadow: 0 18px 42px rgba(17, 22, 27, 0.08);
  background:
    linear-gradient(180deg, #ffffff 0, #f6f7f8 280px, #f5f6f7 100%);
}

body[data-app-area="admin"] .topbar {
  align-items: center;
  padding: 18px 0 16px;
  border-bottom: 4px solid var(--red);
}

body[data-app-area="admin"] .brand-lockup {
  gap: 1.2rem;
  min-width: min(100%, 520px);
}

body[data-app-area="admin"] .brand-logo {
  width: clamp(230px, 34vw, 420px);
  max-height: 78px;
}

body[data-app-area="admin"] .topbar h1 {
  font-size: clamp(1.3rem, 2vw, 2rem);
  color: var(--text);
}

body[data-app-area="admin"] .eyebrow {
  color: var(--red-dark);
  letter-spacing: 0.04em;
}

body[data-app-area="admin"] .role-button.active,
body[data-app-area="admin"] button:not(.secondary):not(.danger):not(.success):not(.link-button) {
  background: var(--red);
  color: #161a1f;
}

body[data-app-area="admin"] button:not(.secondary):not(.danger):not(.success):not(.link-button):hover {
  background: var(--red-dark);
}

body[data-app-area="admin"] .login-panel,
body[data-app-area="admin"] .workspace,
body[data-app-area="admin"] .panel {
  box-shadow: var(--shadow);
}

body[data-app-area="admin"] .badge,
body[data-app-area="admin"] .status.accepted {
  background: #fff1e5;
  color: #9b4d11;
}

body[data-app-area="admin"] .context-card {
  background: #20262d;
}

.role-button.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.login-panel,
.workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-panel {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 460px);
  gap: 1.5rem;
  align-items: end;
  padding: 26px;
}

.login-panel h2 {
  margin: 0.45rem 0 0;
  font-size: 1.45rem;
}

.login-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.75rem;
}

.hint {
  margin: 0;
  color: var(--muted);
  grid-column: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e8f8f8;
  color: var(--turquoise-dark);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
}

.hidden {
  display: none !important;
}

.workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 145px);
  overflow: hidden;
}

.workspace.beamer-mode {
  grid-template-columns: 1fr;
  background: #111111;
  border-color: #111111;
}

.workspace.beamer-mode .sidebar {
  display: none;
}

.workspace.beamer-mode .content-area {
  padding: 0;
}

.sidebar {
  background: #111111;
  color: white;
  padding: 18px;
}

.user-box {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.user-box .badge {
  width: max-content;
}

.user-box button {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.tabs {
  display: grid;
  gap: 0.5rem;
  padding-top: 18px;
}

.tab-button {
  background: transparent;
  color: #dce7e3;
  border: 1px solid transparent;
  text-align: left;
  justify-content: start;
}

.tab-button:hover,
.tab-button.active {
  background: var(--turquoise-dark);
  border-color: rgba(255, 255, 255, 0.16);
}

.content-area {
  padding: 22px;
  min-width: 0;
  overflow: auto;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 18px;
}

.view-header h2,
.panel h3 {
  margin: 0;
}

.view-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 18px;
}

.metric {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
}

.metric span {
  color: var(--muted);
  font-size: 0.86rem;
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 0.15rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
  gap: 1rem;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 0.75rem;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.6rem;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

th,
td {
  padding: 0.72rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: #2e3b36;
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-weight: 800;
  font-size: 0.78rem;
  white-space: nowrap;
}

.status.pending {
  background: #fff4d9;
  color: var(--yellow);
}

.status.accepted {
  background: #e0f4ed;
  color: var(--green);
}

.status.rejected {
  background: #fde5e9;
  color: var(--red-dark);
}

.status.open {
  background: #e9f1fb;
  color: var(--blue);
}

.preview-image {
  width: 116px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.submission-preview {
  width: 132px;
}

.submission-preview-open {
  width: 132px;
  min-height: 168px;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: center;
}

.submission-preview-open iframe,
.submission-preview-open img {
  width: 100%;
  height: 132px;
  border: 0;
  object-fit: cover;
  background: var(--surface-2);
  pointer-events: none;
}

.submission-preview-open span {
  display: block;
  padding: 0.45rem 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--line);
}

.submission-list {
  display: grid;
  gap: 0.9rem;
}

.submission-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 1rem;
  align-items: start;
}

.submission-item h3 {
  margin: 0;
}

.submission-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.75rem;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
}

.filters label {
  min-width: 190px;
}

.rank-table td:first-child,
.rank-table th:first-child {
  width: 72px;
  text-align: center;
}

.rank-one {
  font-size: 1.2rem;
  font-weight: 900;
}

.progress-track,
.load-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9e5;
}

.progress-track span,
.load-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--turquoise), var(--red));
}

.load-list {
  display: grid;
  gap: 0.6rem;
}

.load-item {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.8fr) auto;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.load-item div:first-child {
  display: grid;
  gap: 0.1rem;
}

.load-item span {
  color: var(--muted);
}

.load-list.large {
  gap: 0.85rem;
}

.load-list.large .load-item {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.8fr) auto;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.mobile-stack {
  display: grid;
  gap: 0.85rem;
}

.mobile-card,
.schedule-card,
.message-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
}

.station-focus h2 {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.75rem;
}

.station-focus {
  border-top: 6px solid var(--turquoise);
}

.touch-button {
  min-height: 56px;
  width: 100%;
  font-size: 1.05rem;
}

.active-visit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.active-visit:last-child {
  border-bottom: 0;
}

.active-visit div {
  display: grid;
  gap: 0.1rem;
}

.active-visit span,
.schedule-card span,
.progress-card span {
  color: var(--muted);
}

.schedule-card {
  display: grid;
  gap: 0.25rem;
}

.schedule-card.active {
  border-color: var(--green);
  background: #f0fbf6;
}

.message-list {
  display: grid;
  gap: 0.8rem;
}

.message-card p {
  margin: 0.55rem 0 0;
}

.message-reply-context {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-left: 4px solid var(--turquoise);
  background: var(--surface-2);
  color: var(--muted);
}

.message-reply-context strong {
  color: var(--text);
  font-size: 0.9rem;
}

.message-reply-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.progress-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.progress-card div {
  display: grid;
  gap: 0.15rem;
}

.progress-card b {
  font-size: 1.5rem;
}

.qr-code {
  display: block;
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 0.35rem;
}

.beamer-board {
  min-height: calc(100vh - 38px);
  background: #111111;
  color: #f4fbf8;
  padding: 28px;
}

.beamer-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 22px;
}

.beamer-header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.6rem);
}

.beamer-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 1rem;
}

.beamer-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(0, 156, 166, 0.18);
  padding: 18px;
}

.beamer-panel.wide {
  grid-row: span 2;
}

.beamer-panel h3 {
  margin: 0 0 1rem;
  font-size: 1.45rem;
}

.beamer-panel .message-card,
.beamer-panel .empty-state {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4fbf8;
}

.beamer-panel .empty-state strong,
.beamer-panel .message-card p {
  color: #f4fbf8;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-row .progress-track {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.16);
}

.podium {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.podium strong {
  color: #9ff2f2;
}

.notice {
  border-left: 4px solid var(--red);
  background: #fff8f9;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
}

.notice p {
  margin: 0;
}

.empty-state {
  display: grid;
  gap: 0.25rem;
  padding: 28px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.mail-text {
  white-space: pre-wrap;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  color: #25302c;
}

.sr-station {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.sr-title {
  border-left: 5px solid var(--red);
  padding-left: 1rem;
}

.sr-title h2 {
  margin: 0.2rem 0 0;
}

@media (max-width: 980px) {
  .topbar,
  .login-panel,
  .workspace,
  .grid-2,
  .sr-station {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo {
    width: 112px;
    max-height: 58px;
  }

  .role-strip {
    justify-content: flex-start;
  }

  .hint {
    grid-column: auto;
  }

  .login-form,
  .inline-grid,
  .metrics,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    gap: 1rem;
  }

  .tabs {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding-top: 0;
  }

  .load-item,
  .load-list.large .load-item {
    grid-template-columns: 1fr auto;
  }

  .load-meter {
    grid-column: 1 / -1;
  }

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

  .beamer-panel.wide {
    grid-row: auto;
  }
}

@media (max-width: 620px) {
  .app-shell,
  .content-area {
    padding: 10px;
  }

  .login-panel {
    padding: 16px;
  }

  .topbar {
    padding-top: 8px;
  }

  .topbar h1 {
    font-size: 1.65rem;
  }

  .role-strip {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-button {
    min-height: 46px;
    padding-inline: 0.45rem;
  }

  .login-form {
    gap: 0.85rem;
  }

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

  .workspace {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    min-height: calc(100vh - 112px);
  }

  .sidebar {
    padding: 12px;
  }

  .user-box {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding-bottom: 12px;
  }

  .user-box .badge {
    grid-column: 1 / -1;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .tab-button {
    min-width: max-content;
    min-height: 44px;
  }

  .submission-item {
    grid-template-columns: 1fr;
  }

  .preview-image {
    width: 100%;
  }

  .submission-preview,
  .submission-preview-open {
    width: 100%;
  }

  .submission-preview-open iframe,
  .submission-preview-open img {
    height: 210px;
  }

  .view-header,
  .panel-header {
    display: grid;
  }

  .view-header h2 {
    font-size: 1.45rem;
  }

  .panel,
  .mobile-card,
  .schedule-card,
  .message-card {
    padding: 14px;
  }

  .sr-title h2,
  .station-focus h2 {
    font-size: 1.45rem;
  }

  .active-visit {
    grid-template-columns: 1fr;
  }

  .active-visit button {
    width: 100%;
  }

  .beamer-board {
    padding: 14px;
  }

  .beamer-header {
    display: grid;
  }

  .beamer-header h2 {
    font-size: 2rem;
  }

  .beamer-panel h3 {
    font-size: 1.15rem;
  }
}

/* Kompakter Arbeitsmodus für Rechnerarbeitsplätze */
.app-shell {
  width: min(1680px, 100%);
  padding: 10px;
}

.topbar {
  padding: 10px 0 10px;
  margin-bottom: 10px;
  align-items: center;
}

.topbar h1 {
  font-size: clamp(1.5rem, 2.2vw, 2.35rem);
}

.role-strip {
  gap: 0.3rem;
}

button,
.button-anchor,
input,
select,
textarea {
  min-height: 36px;
}

button,
.button-anchor {
  padding: 0.48rem 0.68rem;
}

input,
select,
textarea {
  padding: 0.48rem 0.58rem;
}

.workspace {
  grid-template-columns: 228px 1fr;
  min-height: calc(100vh - 102px);
}

.sidebar {
  padding: 12px;
}

.tabs {
  gap: 0.35rem;
}

.tab-button {
  min-height: 36px;
  padding: 0.48rem 0.62rem;
}

.content-area {
  padding: 14px;
}

.view-header {
  margin-bottom: 12px;
}

.metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.55rem;
  margin-bottom: 12px;
}

.metrics-compact .metric {
  padding: 10px;
}

.metric {
  padding: 11px;
}

.metric strong {
  font-size: 1.35rem;
}

.grid-2.dashboard-grid {
  grid-template-columns: minmax(520px, 1.35fr) minmax(280px, 0.65fr);
}

.panel-wide {
  grid-column: span 1;
}

.panel {
  padding: 12px;
}

.panel-header {
  margin-bottom: 0.7rem;
}

.table-wrap {
  max-height: calc(100vh - 250px);
}

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

.compact-table th,
.compact-table td {
  padding: 0.46rem;
}

.compact-table input,
.compact-table select {
  min-height: 32px;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.25rem;
}

.compact-table select[multiple] {
  min-width: 220px;
  min-height: 108px;
}

.compact-table select[multiple] option,
.table-wrap select[multiple] option {
  padding: 0.28rem 0.35rem;
}

.table-wrap select[multiple] {
  min-width: 220px;
  min-height: 108px;
}

.actions-vertical {
  align-items: stretch;
  flex-direction: column;
}

.muted-small {
  color: var(--muted);
  font-size: 0.78rem;
}

.compact-card {
  padding: 10px;
  display: grid;
  gap: 0.15rem;
}

.choice-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.choice-card {
  width: 100%;
  display: grid;
  gap: 0.1rem;
  text-align: left;
  justify-content: stretch;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
}

.choice-card:hover,
.choice-card.active {
  background: #dff4f4;
  border-color: var(--turquoise);
  color: var(--text);
}

.choice-card small,
.choice-card em {
  color: var(--muted);
  font-style: normal;
}

.choice-card.disabled {
  opacity: 0.55;
}

.radio-list .choice-card {
  grid-template-columns: auto 1fr;
  align-items: start;
  cursor: pointer;
}

.radio-list input {
  width: auto;
  min-height: auto;
  margin-top: 0.2rem;
}

.radio-list .choice-card span {
  display: grid;
  gap: 0.1rem;
}

.image-thumb {
  padding: 0;
  min-height: auto;
  background: transparent;
  border: 0;
}

.image-thumb:hover {
  background: transparent;
}

.parcours-config {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
}

.parcours-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.parcours-box legend {
  font-weight: 800;
  padding: 0 0.25rem;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .grid-2,
  .grid-2.dashboard-grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Struktur-/Rollenupdate */
.inline-grid.three-cols,
.three-cols {
  grid-template-columns: repeat(3, minmax(90px, 1fr));
}

.panel-wide {
  grid-column: 1 / -1;
}

.nested-grid {
  margin-top: .75rem;
}

.manual-recipient-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .75rem;
  background: var(--surface-2);
}

.manual-recipient-box summary {
  cursor: pointer;
  font-weight: 800;
}

.file-thumb {
  display: grid;
  place-items: center;
  gap: .25rem;
  width: 116px;
  min-height: 116px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: .75rem;
  text-align: center;
}

.file-thumb strong {
  font-size: 1.4rem;
}

.file-thumb span {
  font-size: .78rem;
  color: var(--muted);
}

.live-message-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  background: #fff4d9;
  border: 1px solid #f2d588;
  color: #3a2a00;
}

.live-message-banner span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-message {
  border-left: 5px solid var(--red);
}

.message-card .actions {
  margin-top: .65rem;
}

@media (max-width: 820px) {
  .inline-grid.three-cols,
  .three-cols,
  .live-message-banner {
    grid-template-columns: 1fr;
  }
}

.schedule-panel {
  min-width: 0;
}

.schedule-board-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.schedule-board {
  min-width: 960px;
}

.schedule-timebar,
.schedule-row {
  display: grid;
  grid-template-columns: var(--schedule-label-width, 190px) minmax(720px, 1fr);
}

.schedule-timebar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  min-height: 38px;
}

.schedule-timebar-spacer {
  border-right: 1px solid var(--line);
}

.schedule-timebar-lane,
.schedule-lane {
  position: relative;
}

.schedule-timebar-lane span {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.schedule-parcours-heading {
  position: sticky;
  left: 0;
  z-index: 3;
  padding: .55rem .75rem;
  background: #111;
  color: #fff;
  font-weight: 900;
  border-top: 1px solid var(--line);
}

.schedule-row {
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

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

.schedule-row-label {
  display: grid;
  align-content: center;
  gap: .1rem;
  padding: .55rem .75rem;
  background: #fff;
  border-right: 1px solid var(--line);
  position: sticky;
  left: 0;
  z-index: 2;
}

.schedule-row-label span {
  color: var(--muted);
  font-size: .82rem;
}

.schedule-lane {
  min-height: 64px;
  background-image: repeating-linear-gradient(
    to right,
    rgba(214, 227, 227, .9) 0,
    rgba(214, 227, 227, .9) 1px,
    transparent 1px,
    transparent 8.333%
  );
}

.schedule-block {
  position: absolute;
  top: 7px;
  bottom: 7px;
  display: grid;
  align-content: center;
  gap: .05rem;
  overflow: hidden;
  padding: .35rem .45rem;
  border-radius: 7px;
  border: 1px solid rgba(0, 114, 122, .35);
  background: #e8f8f8;
  color: #063f42;
  box-shadow: 0 8px 18px rgba(20, 28, 24, .08);
}

.schedule-block strong,
.schedule-block span,
.schedule-block em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-block strong {
  font-size: .78rem;
}

.schedule-block span {
  font-size: .82rem;
  font-weight: 800;
}

.schedule-block em {
  font-size: .72rem;
  color: var(--muted);
  font-style: normal;
}

.schedule-block.active {
  border-color: var(--green);
  background: #e0f4ed;
  color: #063d2d;
}

.schedule-details {
  margin-top: .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: .75rem;
}

.schedule-details summary {
  cursor: pointer;
  font-weight: 900;
}

.schedule-details .table-wrap {
  margin-top: .75rem;
  background: #fff;
}

@media (max-width: 820px) {
  .schedule-board {
    min-width: 820px;
  }

  .schedule-timebar,
  .schedule-row {
    grid-template-columns: 155px minmax(620px, 1fr);
  }

  .schedule-board {
    --schedule-label-width: 155px;
  }
}

/* UX-Redesign 2026-06-20: kompakter Arbeitsmodus, listenzentrierte Fachseiten */
:root {
  --sidebar: #121816;
  --sidebar-soft: #1d2622;
  --focus-bg: #f9fbfb;
}

body {
  background: linear-gradient(180deg, #f7fafa 0%, #eef4f4 100%);
}

.app-shell {
  width: min(1760px, 100%);
  padding: 8px 14px 14px;
}

.topbar {
  padding: 8px 0 9px;
  margin-bottom: 8px;
  border-bottom-width: 4px;
}

.brand-lockup {
  gap: .8rem;
}

.brand-logo {
  width: clamp(74px, 8vw, 128px);
  max-height: 58px;
}

.topbar h1 {
  font-size: clamp(1.55rem, 2.1vw, 2.4rem);
}

.eyebrow {
  font-size: .78rem;
  margin-bottom: .05rem;
}

.role-strip {
  gap: .32rem;
}

.role-button {
  min-height: 34px;
  padding: .4rem .62rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

.workspace {
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: calc(100vh - 88px);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(20, 28, 24, .08);
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, #0d110f 100%);
  padding: 12px;
}

.user-box {
  gap: .55rem;
  padding-bottom: 12px;
}

.user-box button {
  min-height: 34px;
}

.tabs {
  gap: .9rem;
  padding-top: 12px;
}

.nav-section {
  display: grid;
  gap: .28rem;
}

.nav-section-title {
  color: rgba(255,255,255,.52);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .55rem .1rem;
}

.tab-button {
  min-height: 34px;
  padding: .45rem .62rem;
  border-radius: 9px;
  color: #f1f7f7;
  font-weight: 750;
}

.tab-button:hover {
  background: rgba(0,156,166,.2);
}

.tab-button.active {
  background: var(--turquoise-dark);
  box-shadow: inset 4px 0 0 #9ff2f2;
}

.content-area {
  padding: 16px;
  background: var(--focus-bg);
}

.view-header {
  align-items: center;
  margin-bottom: 12px;
  padding: 2px 2px 4px;
}

.view-header h2 {
  font-size: 1.55rem;
}

.view-header p,
.panel-header p {
  margin: .1rem 0 0;
  color: var(--muted);
}

.panel {
  border-color: #cfdede;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20, 28, 24, .045);
}

.quick-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: .65rem;
  margin-bottom: .8rem;
}

.quick-metrics .metric {
  background: #fff;
  padding: .75rem .85rem;
  border-radius: 12px;
}

.quick-metrics .metric strong {
  font-size: 1.35rem;
}

.management-layout {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 340px;
  gap: .85rem;
  align-items: start;
}

.priority-panel {
  min-width: 0;
}

.side-stack {
  display: grid;
  gap: .75rem;
  position: sticky;
  top: 12px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-panel .panel-header {
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.sticky-panel-header {
  position: sticky;
  top: 0;
  z-index: 5;
}

.action-card {
  padding: 0;
  overflow: hidden;
}

.action-card summary {
  cursor: pointer;
  list-style: none;
  padding: .78rem .9rem;
  font-weight: 900;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

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

.action-card summary::after {
  content: "öffnen";
  float: right;
  font-size: .74rem;
  color: var(--muted);
  font-weight: 800;
}

.action-card[open] summary::after {
  content: "schließen";
}

.action-card .compact-form {
  padding: .9rem;
}

.compact-form {
  gap: .62rem;
}

.compact-form .inline-grid {
  gap: .55rem;
}

.form-section-title {
  font-size: .74rem;
  font-weight: 900;
  color: var(--turquoise-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-top: 1px solid var(--line);
  padding-top: .55rem;
  margin-top: .15rem;
}

.form-section-title:first-child {
  border-top: 0;
  padding-top: 0;
}

button,
.button-anchor,
input,
select,
textarea {
  min-height: 34px;
}

button,
.button-anchor {
  padding: .48rem .7rem;
}

input,
select,
textarea {
  padding: .42rem .54rem;
}

textarea {
  min-height: 76px;
}

.table-wrap-large {
  max-height: calc(100vh - 230px);
  border: 0;
  border-radius: 0;
}

.admin-table {
  min-width: 1120px;
  font-size: .92rem;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #eef7f7;
}

.admin-table th,
.admin-table td,
.compact-table th,
.compact-table td {
  padding: .5rem .56rem;
}

.admin-table tbody tr:hover {
  background: #fbfdfd;
}

.admin-table input,
.admin-table select,
.compact-table input,
.compact-table select {
  min-height: 30px;
  padding: .34rem .42rem;
  margin: 0;
}

.cell-stack {
  display: grid;
  gap: .32rem;
}

.main-cell {
  min-width: 260px;
}

.origin-cell {
  min-width: 210px;
}

.code-cell {
  min-width: 145px;
}

.table-inline {
  grid-template-columns: .7fr 1fr;
  gap: .35rem;
}

.count-grid-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: .32rem;
  min-width: 210px;
}

.count-grid-mini label {
  font-size: .72rem;
  gap: .18rem;
  color: var(--muted);
}

.actions-vertical {
  gap: .32rem;
}

.actions-vertical button,
.actions-vertical .button-anchor {
  width: 100%;
  justify-content: center;
}

.station-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  max-width: 420px;
}

.station-tags span {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .18rem .48rem;
  background: var(--surface-2);
  font-size: .78rem;
  font-weight: 750;
}

.station-tags em {
  color: var(--muted);
  font-style: normal;
}

.schedule-workbench {
  display: grid;
  gap: .85rem;
}

.schedule-generator {
  padding: .9rem;
}

.schedule-generator-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: .7rem;
}

.schedule-generator-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) repeat(6, minmax(96px, .55fr)) minmax(160px, .8fr);
  gap: .55rem;
  align-items: end;
}

.overwrite-check {
  align-self: end;
  min-height: 34px;
  background: #fff8f9;
  border: 1px solid #f2cbd1;
  border-radius: var(--radius);
  padding: .38rem .55rem;
}

.schedule-main-panel {
  padding: 0;
  overflow: hidden;
}

.schedule-main-panel > .panel-header {
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.schedule-main-panel .schedule-board-wrap {
  border: 0;
  border-radius: 0;
  max-height: calc(100vh - 300px);
}

.schedule-board {
  min-width: 1220px;
}

.schedule-timebar,
.schedule-row {
  grid-template-columns: var(--schedule-label-width, 230px) minmax(940px, 1fr);
}

.schedule-row {
  min-height: 58px;
}

.schedule-row-label {
  padding: .45rem .7rem;
}

.schedule-lane {
  min-height: 58px;
}

.schedule-block {
  top: 6px;
  bottom: 6px;
  min-width: 42px;
  padding: .28rem .4rem;
}

.schedule-block strong {
  font-size: .72rem;
}

.schedule-block span {
  font-size: .78rem;
}

.schedule-details {
  margin: .75rem;
}

.manual-schedule-card {
  max-width: 760px;
}

@media (max-width: 1380px) {
  .management-layout {
    grid-template-columns: 1fr;
  }

  .side-stack {
    position: static;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .schedule-generator-grid {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    gap: .45rem;
  }

  .nav-section {
    display: contents;
  }

  .nav-section-title {
    display: none;
  }

  .quick-metrics,
  .side-stack,
  .schedule-generator-head,
  .schedule-generator-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }
}

/* Zeitplan: gezielte Gruppen-/Stationsansicht und kompaktere Detailtabellen */
.schedule-focus-panel {
  padding: 0;
  overflow: hidden;
}

.schedule-focus-panel > .panel-header {
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.schedule-focus-controls {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(260px, 1.2fr);
  gap: .55rem;
  align-items: end;
  min-width: min(560px, 100%);
}

.schedule-focus-controls .soft-hidden {
  display: none;
}

.schedule-focus-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: .65rem;
  padding: 14px;
}

.schedule-focus-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.schedule-focus-header div {
  display: grid;
  gap: .15rem;
}

.schedule-focus-header span:not(.status) {
  color: var(--muted);
  font-size: .9rem;
}

.schedule-focus-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .65rem;
  padding: 14px;
}

.schedule-focus-list.compact {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.schedule-focus-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: .7rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: .7rem;
}

.schedule-focus-card time {
  display: grid;
  gap: .1rem;
  color: var(--turquoise-dark);
  font-weight: 900;
}

.schedule-focus-card time span {
  color: var(--muted);
  font-weight: 700;
  font-size: .84rem;
}

.schedule-focus-card div {
  display: grid;
  gap: .14rem;
  min-width: 0;
}

.schedule-focus-card strong,
.schedule-focus-card span,
.schedule-focus-card em {
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-focus-card span,
.schedule-focus-card em {
  color: var(--muted);
  font-size: .86rem;
  font-style: normal;
}

.compact-table-wrap table,
.compact-table {
  min-width: 980px;
}

.compact-table th,
.compact-table td {
  padding: .52rem .6rem;
}

.schedule-main-panel .schedule-board-wrap {
  max-height: calc(100vh - 360px);
}

.schedule-board {
  min-width: 1380px;
}

.schedule-timebar,
.schedule-row {
  grid-template-columns: var(--schedule-label-width, 230px) minmax(1100px, 1fr);
}

.schedule-block {
  min-width: 58px;
  white-space: nowrap;
}

.schedule-block span {
  max-width: 100%;
}

#syncStatusBadge .status {
  width: max-content;
}

@media (max-width: 1100px) {
  .schedule-focus-controls,
  .schedule-focus-summary {
    grid-template-columns: 1fr;
  }

  .schedule-focus-card {
    grid-template-columns: 64px 1fr;
  }

  .schedule-focus-card button {
    grid-column: 1 / -1;
  }
}

/* Kompakte Stammdatenkarten statt breiter Tabellen */
.record-list {
  display: grid;
  gap: .55rem;
}

.record-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.record-card[open] {
  box-shadow: 0 12px 28px rgba(20, 28, 24, .07);
}

.record-summary {
  display: grid;
  grid-template-columns: 110px minmax(220px, 1.6fr) minmax(180px, 1.2fr) minmax(95px, .55fr) 72px 72px 72px;
  gap: .7rem;
  align-items: center;
  padding: .7rem .85rem;
  cursor: pointer;
  list-style: none;
}

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

.record-summary:hover {
  background: var(--surface-2);
}

.record-status,
.record-main,
.record-meta {
  display: grid;
  gap: .12rem;
  min-width: 0;
}

.record-main strong,
.record-origin,
.record-code,
.record-meta b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-main small,
.record-status small,
.record-meta small {
  color: var(--muted);
  font-size: .8rem;
}

.record-code code {
  font-size: .84rem;
  background: var(--surface-2);
  border-radius: 6px;
  padding: .2rem .35rem;
}

.record-meta {
  text-align: center;
}

.record-open-label {
  justify-self: end;
  color: var(--turquoise-dark);
  font-size: .84rem;
  font-weight: 800;
}

.record-card[open] .record-open-label::after {
  content: " offen";
}

.record-details {
  border-top: 1px solid var(--line);
  background: #fbfdfd;
  padding: .8rem;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: .7rem;
}

.detail-section {
  display: grid;
  gap: .55rem;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: .75rem;
}

.detail-section-wide {
  grid-column: span 2;
}

.detail-section h4 {
  margin: 0 0 .15rem;
  font-size: .92rem;
}

.count-grid-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: .45rem;
}

.message-sender {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin: .2rem 0 .35rem;
}

@media (max-width: 1320px) {
  .record-summary {
    grid-template-columns: 90px minmax(190px, 1.7fr) minmax(160px, 1fr) minmax(80px, .5fr) 64px 64px;
  }

  .record-meta:last-of-type,
  .record-open-label {
    display: none;
  }

  .record-detail-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 820px) {
  .record-summary {
    grid-template-columns: 1fr auto;
  }

  .record-status,
  .record-origin,
  .record-code,
  .record-meta {
    display: none;
  }

  .detail-section-wide {
    grid-column: span 1;
  }

  .record-detail-grid,
  .count-grid-mini {
    grid-template-columns: 1fr;
  }
}

/* Finales Responsive-/UX-Update: Smartphone, kompakte Stammdaten, Zeitplan sichtbar */
.group-record .record-summary {
  grid-template-columns: 86px minmax(210px, 1.8fr) minmax(160px, 1fr) minmax(94px, .55fr) 74px;
}

.group-record .record-meta {
  display: none;
}

.person-metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

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

.compact-wrap {
  max-width: 100%;
}

.schedule-main-panel {
  overflow: visible;
}

.schedule-main-panel .schedule-board-wrap,
.schedule-board-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.schedule-timebar {
  position: sticky;
  top: 0;
  z-index: 8;
}

.schedule-row-label {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.schedule-timebar-spacer {
  position: sticky;
  left: 0;
  z-index: 9;
  background: #e9f5f5;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 8px;
  }

  .topbar {
    align-items: start;
    gap: .65rem;
    padding: 8px 0 10px;
    margin-bottom: 10px;
  }

  .brand-logo {
    width: 58px;
    height: auto;
  }

  .topbar h1 {
    font-size: clamp(1.35rem, 8vw, 2.15rem);
  }

  .role-strip {
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding-bottom: .25rem;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .role-button {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .workspace {
    display: block;
    min-height: auto;
    overflow: visible;
  }

  .sidebar {
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 25;
    border-radius: 0 0 12px 12px;
  }

  .user-box {
    grid-template-columns: 1fr auto;
    gap: .45rem;
    padding-bottom: 8px;
  }

  .user-box strong,
  #syncStatusBadge {
    grid-column: 1 / -1;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    gap: .35rem;
    padding-top: 8px;
  }

  .nav-section {
    display: contents;
  }

  .nav-section-title {
    display: none;
  }

  .tab-button {
    white-space: nowrap;
    flex: 0 0 auto;
    min-height: 34px;
  }

  .content-area {
    padding: 10px 0 0;
    overflow: visible;
  }

  .view-header {
    display: grid;
    gap: .55rem;
    padding-inline: 2px;
  }

  .view-header .actions {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

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

  .grid-2,
  .grid-2.dashboard-grid,
  .grid-3,
  .management-layout,
  .schedule-workbench {
    display: grid;
    grid-template-columns: 1fr !important;
  }

  .side-stack {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 12px;
  }

  .table-panel,
  .schedule-main-panel {
    padding: 0;
  }

  .schedule-generator-head {
    grid-template-columns: 1fr;
  }

  .schedule-generator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .schedule-focus-controls {
    grid-template-columns: 1fr !important;
  }

  .schedule-main-panel .schedule-board-wrap {
    max-height: 70vh;
    min-height: 260px;
  }

  .schedule-board {
    min-width: 920px;
  }

  .schedule-timebar,
  .schedule-row {
    grid-template-columns: 150px minmax(740px, 1fr) !important;
  }

  .schedule-block {
    min-width: 48px;
    padding: .22rem .32rem;
  }

  .schedule-block strong,
  .schedule-block span {
    font-size: .68rem;
  }

  .schedule-row-label strong {
    font-size: .82rem;
  }

  .schedule-row-label span {
    font-size: .75rem;
  }

  .schedule-details .table-wrap {
    max-height: 58vh;
  }

  .record-summary,
  .group-record .record-summary {
    grid-template-columns: 1fr auto;
    padding: .7rem;
  }

  .record-main {
    grid-column: 1;
  }

  .record-status,
  .record-origin,
  .record-code,
  .record-meta {
    display: none !important;
  }

  .record-open-label {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .record-detail-grid,
  .count-grid-mini,
  .inline-grid,
  .inline-grid.three-cols {
    grid-template-columns: 1fr !important;
  }

  .mobile-stack {
    display: grid;
    gap: .7rem;
  }

  .schedule-card,
  .mobile-card {
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  .quick-metrics,
  .person-metrics {
    grid-template-columns: 1fr;
  }

  .schedule-generator-grid {
    grid-template-columns: 1fr !important;
  }

  .schedule-board {
    min-width: 820px;
  }

  .schedule-timebar,
  .schedule-row {
    grid-template-columns: 128px minmax(690px, 1fr) !important;
  }

  .schedule-main-panel .schedule-board-wrap {
    max-height: 68vh;
  }
}

/* UX-Korrektur: kompakte Listen ohne unpassende Tabellenköpfe */
.judge-record .record-summary {
  grid-template-columns: 96px minmax(220px, 1.6fr) minmax(95px, .55fr) 78px 72px;
}

.judge-detail-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.compact-actions-row {
  gap: .45rem;
}

.compact-actions-row > * {
  flex: 1 1 150px;
}

.person-detail-section .compact-counts {
  grid-template-columns: repeat(3, minmax(84px, 1fr));
}

.person-detail-section label,
.person-detail-section input {
  min-width: 0;
}

.person-detail-section input {
  width: 100%;
}

/* Rankings: Gesamtwertung + Kategorie-Rankings */
.ranking-layout {
  display: grid;
  gap: 1rem;
}

.ranking-table-wrap {
  max-height: none;
}

.compact-rank-table {
  min-width: 860px;
}

.compact-rank-table th,
.compact-rank-table td {
  padding: .48rem .55rem;
}

.compact-rank-table th {
  white-space: nowrap;
}

.compact-rank-table small {
  color: var(--muted);
}

.category-ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: .75rem;
}

.category-ranking-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: .75rem;
  min-width: 0;
}

.category-ranking-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .6rem;
  margin-bottom: .55rem;
}

.mini-rank-table {
  min-width: 0;
  width: 100%;
  font-size: .92rem;
}

.mini-rank-table th,
.mini-rank-table td {
  padding: .42rem .35rem;
}

.mini-rank-table th:first-child,
.mini-rank-table td:first-child {
  width: 38px;
  text-align: center;
}

.mini-rank-table th:last-child,
.mini-rank-table td:last-child {
  width: 68px;
  text-align: right;
}

.mini-rank-table small {
  color: var(--muted);
}

@media (max-width: 980px) {
  .judge-record .record-summary,
  .group-record .record-summary {
    grid-template-columns: 1fr auto;
  }

  .judge-record .record-status,
  .judge-record .record-code,
  .judge-record .record-meta,
  .group-record .record-origin,
  .group-record .record-code,
  .group-record .record-meta {
    display: none;
  }

  .judge-detail-grid,
  .record-detail-grid {
    grid-template-columns: 1fr !important;
  }

  .person-detail-section .compact-counts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .person-detail-section .compact-counts {
    grid-template-columns: 1fr;
  }

  .category-ranking-grid {
    grid-template-columns: 1fr;
  }
}

/* UX-Korrektur 2026-06-20: Zeitplangenerator bewusst nachrangig darstellen */
.schedule-generator-card {
  padding: 0;
  overflow: hidden;
  border-style: dashed;
  background: #fbfdfd;
}

.schedule-generator-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  cursor: pointer;
  padding: .75rem .9rem;
  font-weight: 850;
  list-style: none;
}

.schedule-generator-card > summary::-webkit-details-marker {
  display: none;
}

.schedule-generator-card > summary::after {
  content: "öffnen";
  color: var(--turquoise-dark);
  background: #e8f8f8;
  border-radius: 999px;
  padding: .16rem .52rem;
  font-size: .76rem;
  font-weight: 900;
}

.schedule-generator-card[open] > summary::after {
  content: "schließen";
}

.schedule-generator-card small {
  color: var(--muted);
  font-weight: 700;
}

.schedule-generator {
  padding: .85rem .9rem .95rem;
  border-top: 1px solid var(--line);
}

.compact-notice {
  margin-bottom: .75rem;
  padding: .65rem .75rem;
}

.schedule-generator-actions {
  justify-content: flex-end;
  margin-top: .7rem;
}

.schedule-generator-actions button {
  min-width: 220px;
}

/* Mobile UX: schwarzer Rollen-/Menübereich deutlich kompakter */
@media (max-width: 980px) {
  .sidebar {
    padding: 6px 8px;
    border-radius: 0 0 10px 10px;
  }

  .user-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    padding-bottom: 4px;
    border-bottom: 0;
  }

  .user-box strong {
    display: none;
  }

  .user-box .badge,
  #syncStatusBadge {
    grid-column: auto;
    width: auto;
    font-size: .68rem;
    line-height: 1.1;
    padding: .16rem .44rem;
  }

  .user-box button {
    margin-left: auto;
    min-height: 28px;
    padding: .25rem .55rem;
    font-size: .78rem;
    border-radius: 8px;
  }

  .tabs {
    padding-top: 5px;
    gap: .28rem;
  }

  .tab-button {
    min-height: 30px;
    padding: .32rem .5rem;
    font-size: .84rem;
    border-radius: 8px;
  }

  .content-area {
    padding-top: 8px;
  }

  .view-header h2 {
    font-size: 1.8rem;
  }

  .view-header p {
    font-size: 1rem;
    line-height: 1.35;
  }

  .schedule-generator-card > summary {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: .68rem .75rem;
  }

  .schedule-generator-card small {
    grid-column: 1 / -1;
    font-size: .78rem;
  }

  .schedule-generator {
    padding: .75rem;
  }

  .schedule-generator-actions button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .sidebar {
    margin-inline: -2px;
  }

  .tab-button {
    font-size: .8rem;
    padding-inline: .45rem;
  }
}

/* Nachrichten/Lesebestätigung und schlankere Schiedsrichterbedienung */
.compact-pick-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.compact-pick-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.compact-pick-row.as-button {
  cursor: pointer;
}

.compact-pick-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-pick-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-pick-row em.status {
  font-style: normal;
  justify-self: end;
}

.compact-pick-row.active {
  border-color: var(--green);
  background: #f0fbf6;
}

.compact-pick-row.done {
  opacity: 0.58;
  background: #f7fafa;
}

.compact-pick-row.done strong {
  text-decoration: line-through;
}

.compact-pick-row:disabled,
.compact-pick-row[disabled] {
  cursor: not-allowed;
}

.schedule-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.schedule-card-main {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.schedule-card p {
  grid-column: 1 / -1;
}

.schedule-card.done {
  opacity: 0.62;
  background: #f7fafa;
}

.schedule-card.done .schedule-card-main {
  text-decoration: line-through;
}

.schedule-card.status-rejected {
  opacity: 1;
  background: #fff7f8;
  border-color: #f2b8c0;
}

.schedule-card.status-rejected .schedule-card-main {
  text-decoration: none;
}

.schedule-block.done {
  opacity: 0.48;
  background: #eef3f3;
  border-color: #c7d8d8;
  box-shadow: none;
}

.schedule-block.done span {
  text-decoration: line-through;
}

.schedule-block.status-rejected {
  opacity: 0.9;
  background: #fde5e9;
  border-color: #d996a0;
}

.schedule-block.status-rejected span {
  text-decoration: none;
}

.schedule-block em {
  display: block;
}

@media (max-width: 620px) {
  .compact-pick-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .compact-pick-row span {
    display: none;
  }

  .schedule-card {
    grid-template-columns: 1fr;
  }

  .schedule-card > .status {
    width: max-content;
  }
}

/* Zeitplan: WL-Umschaltung Gruppen/Stationen und Druck aus Meldekopf */
.schedule-board-header {
  align-items: end;
}

/* JRK/DRK brand refinement */
.topbar {
  border-bottom-color: var(--red);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: min(100%, 420px);
}

.brand-logo {
  width: clamp(82px, 9vw, 138px);
  max-height: 68px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-lockup .eyebrow {
  color: var(--turquoise-dark);
  letter-spacing: 0;
}

.brand-lockup h1 {
  color: var(--text);
  line-height: 1.02;
  max-width: 820px;
}

@media (max-width: 620px) {
  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo {
    width: 74px;
    max-height: 58px;
  }
}

.schedule-board-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: .6rem;
  flex-wrap: wrap;
}

.schedule-board-controls label {
  min-width: 180px;
}

.schedule-board-wrap.view-stations .schedule-row-label strong {
  color: var(--turquoise-dark);
}

.schedule-compact-table small {
  color: var(--muted);
}

.schedule-slip table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-slip th,
.schedule-slip td {
  padding: .45rem .55rem;
  border-bottom: 1px solid #d6e3e3;
  text-align: left;
}

@media (max-width: 760px) {
  .schedule-board-header {
    display: grid;
    gap: .65rem;
  }

  .schedule-board-controls {
    justify-content: stretch;
  }

  .schedule-board-controls label,
  .schedule-board-controls select,
  .schedule-board-controls .status {
    width: 100%;
  }
}

/* Meldekopf: kompakte Check-in-Karten statt breiter Tabelle */
.mk-check-list {
  display: grid;
  gap: .65rem;
}

.mk-check-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.mk-check-card.checked-in {
  background: #fbfefc;
}

.mk-check-summary {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1.1fr) minmax(120px, .55fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .75rem;
}

.mk-status-block,
.mk-main-info,
.mk-code-info {
  display: grid;
  gap: .18rem;
}

.mk-status-block small,
.mk-code-info small,
.mk-main-info span {
  color: var(--muted);
  font-size: .82rem;
}

.mk-code-info code {
  font-weight: 800;
  background: var(--surface-2);
  padding: .22rem .45rem;
  border-radius: 999px;
  width: max-content;
}

.mk-primary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
}

.mk-primary-actions button {
  min-height: 36px;
  padding: .45rem .65rem;
}

.mk-details {
  border-top: 1px solid var(--line);
  background: #fbfdfd;
}

.mk-details summary {
  cursor: pointer;
  font-weight: 800;
  padding: .65rem .75rem;
  color: var(--turquoise-dark);
}

.mk-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: .75rem;
  padding: 0 .75rem .75rem;
}

.mk-detail-grid section {
  display: grid;
  gap: .45rem;
  align-content: start;
}

.mk-detail-grid h4 {
  margin: 0;
  font-size: .9rem;
  color: var(--muted);
}

.mk-detail-grid input,
.mk-detail-grid select {
  min-height: 36px;
  padding: .42rem .52rem;
}

@media (max-width: 1180px) {
  .mk-check-summary {
    grid-template-columns: 92px minmax(180px, 1fr) minmax(110px, .5fr);
  }

  .mk-primary-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .mk-detail-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  .mk-check-summary {
    grid-template-columns: 1fr;
    gap: .45rem;
  }

  .mk-primary-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mk-primary-actions button {
    width: 100%;
  }

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

/* UX-Korrektur: Rechenzentrum Nacherfassung einklappbar und Wertungslinks */
.manual-capture-card {
  margin-bottom: 1rem;
  padding: 0;
  overflow: hidden;
  border-style: dashed;
  background: #fbfdfd;
}

.manual-capture-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  cursor: pointer;
  padding: .85rem 1rem;
  list-style: none;
}

.manual-capture-card > summary::-webkit-details-marker {
  display: none;
}

.manual-capture-card > summary strong {
  display: block;
}

.manual-capture-card > summary small {
  display: block;
  color: var(--muted);
  margin-top: .15rem;
}

.manual-capture-form {
  padding: 0 1rem 1rem;
}

.point-link {
  min-height: auto;
  padding: .22rem .5rem;
  border-radius: 999px;
  background: #e8f8f8;
  color: var(--turquoise-dark);
  border: 1px solid #9ed7dc;
  font-weight: 900;
}

.point-link:hover {
  background: var(--turquoise);
  color: #fff;
}

.focused-submission {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, .12);
}

/* Filter, Suche und komprimierte Statuslisten */

.list-filter-details {
  margin: 0.65rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}

.list-filter-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 42px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-weight: 900;
  color: #24312c;
  list-style: none;
}

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

.list-filter-details > summary::after {
  content: "▾";
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform .15s ease;
}

.list-filter-details[open] > summary::after {
  transform: rotate(180deg);
}

.list-filter-details > summary .status {
  margin-left: auto;
}

.list-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(auto-fit, minmax(150px, 0.8fr)) auto;
  gap: 0.65rem;
  align-items: end;
  margin: 0;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.list-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.compact-filter-panel {
  padding: 0.25rem 0.5rem;
}

.back-button {
  white-space: nowrap;
}

.station-status-list {
  display: grid;
  gap: 0.75rem;
}

.station-status-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(200px, 0.9fr) minmax(220px, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.station-status-main,
.station-status-judge,
.station-status-progress {
  display: grid;
  gap: 0.2rem;
}

.station-status-main > div,
.station-status-judge {
  min-width: 0;
}

.station-status-main strong,
.station-status-judge strong {
  overflow-wrap: anywhere;
}

.station-status-main span:not(.status),
.station-status-judge span,
.station-status-progress span,
.station-status-card small {
  color: var(--muted);
}

.station-status-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .list-filter-details > summary {
    min-height: 38px;
    padding: .5rem .65rem;
  }
  .list-filter-bar {
    grid-template-columns: 1fr;
    padding: .65rem;
  }
  .station-status-card {
    grid-template-columns: 1fr;
  }
  .station-status-actions {
    justify-content: stretch;
  }
  .station-status-actions button {
    width: 100%;
  }
}

/* Ergänzungen: Meldekopf-SR-Karten und Stations-Gruppenaktionen */
.judge-check-summary {
  grid-template-columns: 110px minmax(200px, 1fr) minmax(130px, .55fr) auto;
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: .25rem .55rem;
  margin: .15rem .2rem .15rem 0;
  font-size: .86rem;
  font-weight: 700;
}

.station-group-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.station-group-row .pick-main {
  display: grid;
  gap: .12rem;
  min-width: 0;
}

.station-group-row .pick-actions {
  display: flex;
  gap: .35rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.station-group-row .pick-actions button {
  min-height: 34px;
  padding: .38rem .55rem;
}

.station-group-row.missing-checkin {
  opacity: .72;
  background: #fbfdfd;
}

@media (max-width: 760px) {
  .judge-check-summary,
  .station-group-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .station-group-row .pick-actions {
    justify-content: stretch;
  }
  .station-group-row .pick-actions button {
    flex: 1 1 140px;
  }
}


.submission-group-select {
  display: grid;
  gap: .55rem;
}

.selection-summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: .55rem .7rem;
}

.selection-summary span {
  color: var(--muted);
  font-size: .9rem;
}

@media (max-width: 760px) {
  .submission-group-select select {
    min-height: 48px;
  }
}

/* UX-Ergänzung: manuelle Aktualisierung, aussagekräftiger Nachrichtenbanner und Mittagspause im Zeitplan */
.refresh-button,
.sidebar-refresh-button {
  white-space: nowrap;
}

.user-box .sidebar-refresh-button {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  min-height: 36px;
  padding: .45rem .7rem;
}

.live-message-banner {
  grid-template-columns: minmax(160px, auto) minmax(0, 1fr) auto;
}

.live-message-heading {
  display: grid;
  gap: .12rem;
}

.live-message-heading small {
  color: #6d4a00;
  font-weight: 750;
  white-space: nowrap;
}

.live-message-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.schedule-lunch-marker {
  top: 0 !important;
  bottom: 0;
  transform: none !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(168, 109, 0, .35);
  border-right: 1px solid rgba(168, 109, 0, .35);
  background: rgba(255, 244, 217, .92);
  color: #6d4a00 !important;
  font-size: .74rem !important;
  font-weight: 900 !important;
  z-index: 2;
}

.schedule-lunch-band {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 244, 217, .75),
    rgba(255, 244, 217, .75) 9px,
    rgba(242, 213, 136, .5) 9px,
    rgba(242, 213, 136, .5) 18px
  );
  border-left: 1px solid rgba(168, 109, 0, .24);
  border-right: 1px solid rgba(168, 109, 0, .24);
}

.schedule-block {
  z-index: 1;
}

@media (max-width: 720px) {
  .live-message-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .live-message-actions {
    justify-content: stretch;
  }

  .live-message-actions button {
    flex: 1 1 160px;
  }
}

.schedule-card.lunch-card,
.schedule-focus-card.lunch-card {
  border-color: rgba(168, 109, 0, .35);
  background: #fff4d9;
  color: #6d4a00;
  box-shadow: none;
}

.schedule-card.lunch-card .schedule-card-main span {
  font-weight: 900;
  color: #6d4a00;
}

.print-lunch-row td {
  background: #fff4d9;
  color: #6d4a00;
  font-weight: 900;
  text-align: center;
}

/* Nachträgliche Schiedsrichter-Zuordnung und RZ-Korrekturen */
.nested-details {
  margin-top: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: .55rem .7rem;
}

.nested-details summary {
  cursor: pointer;
  font-weight: 800;
}

.assignment-list {
  display: grid;
  gap: .4rem;
  margin-top: .65rem;
  max-height: 280px;
  overflow: auto;
}

.assignment-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: .45rem .55rem;
}

.assignment-row span {
  display: grid;
  gap: .1rem;
}

.assignment-row small {
  color: var(--muted);
  font-weight: 600;
}

.correction-note {
  border-left: 4px solid var(--yellow);
  background: #fff8e8;
  padding: .65rem .75rem;
  border-radius: var(--radius);
  margin: .7rem 0 0;
}

/* JRK Styleguide 11/2021: Petrol primary, Quicksand typography, clear white space */
:root {
  --bg: #f7fbfb;
  --surface: #ffffff;
  --surface-2: #eef8f9;
  --text: #111111;
  --muted: #5d6868;
  --line: #cde8ea;
  --red: #eb0005;
  --red-dark: #c90004;
  --turquoise: #00a0aa;
  --turquoise-dark: #007982;
  --violet: #28197d;
  --green: #afd764;
  --yellow: #ffe646;
  --blue: #28197d;
  --shadow: 0 16px 38px rgba(0, 70, 76, 0.09);
}

body,
button,
input,
select,
textarea {
  font-family: Quicksand, "Calibri Light", Calibri, Arial, sans-serif;
}

body {
  background:
    linear-gradient(180deg, rgba(0, 160, 170, .07) 0%, rgba(255, 255, 255, 0) 230px),
    #fff;
}

button,
.button-anchor,
.touch-button {
  background: var(--turquoise);
  color: #fff;
}

button:hover,
.button-anchor:hover,
.touch-button:hover {
  background: var(--turquoise-dark);
}

button.secondary,
.button-anchor.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

button.secondary:hover,
.button-anchor.secondary:hover {
  background: var(--surface-2);
}

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

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

button.success {
  background: var(--green);
  color: var(--text);
}

.topbar {
  align-items: center;
  border-bottom: 6px solid var(--red);
  background: #fff;
  padding: 14px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.brand-lockup {
  align-items: center;
  gap: 1.1rem;
}

.brand-logo {
  width: clamp(96px, 10vw, 168px);
  min-width: 82px;
  max-height: 92px;
  object-fit: contain;
}

.brand-lockup .eyebrow,
.eyebrow {
  color: var(--turquoise-dark);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-lockup h1,
.topbar h1 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
}

.role-button.active,
.tab-button.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.badge {
  background: rgb(205, 235, 240);
  color: var(--turquoise-dark);
}

.context-card,
.station-focus,
.beamer-header {
  background: var(--turquoise);
  color: #fff;
}

.view-header {
  position: relative;
}

.view-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: -.45rem;
  width: 72px;
  height: 6px;
  background: var(--yellow);
  transform: rotate(-2deg);
  transform-origin: left center;
}

.panel,
.mobile-card,
.login-panel,
.workspace {
  border-color: var(--line);
}

.status.accepted {
  background: rgb(240, 245, 225);
  color: #3f5f00;
}

.status.pending,
.status.open {
  background: rgb(205, 235, 240);
  color: var(--turquoise-dark);
}

.status.rejected {
  background: rgb(250, 205, 205);
  color: var(--red-dark);
}

.notice,
.correction-note {
  border-left-color: var(--yellow);
  background: #fffbe0;
  color: var(--text);
}

@media (max-width: 620px) {
  .topbar {
    padding: 10px 12px;
  }

  .brand-logo {
    width: 82px;
    max-height: 82px;
  }
}

.readonly-note,
.rejection-note,
.correction-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 0.75rem;
  margin: 0.65rem 0;
}

.readonly-note p,
.rejection-note,
.correction-note {
  color: var(--text);
}

.readonly-note small {
  display: block;
  color: var(--muted);
  margin-top: 0.25rem;
}

.rejection-note {
  background: #fde5e9;
  border-color: rgba(176, 0, 18, 0.25);
}

.published-ranking-panel {
  margin-bottom: 1rem;
}

.published-ranking-actions {
  align-items: stretch;
}

.published-ranking-actions button {
  text-align: left;
}

.correction-comment-field.hidden {
  display: none;
}

.correction-comment-field {
  display: grid;
  gap: 0.35rem;
}

.published-ranking-list {
  display: grid;
  gap: 0.75rem;
  margin: 0.6rem 0 1rem;
}

.published-ranking-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.published-ranking-card .actions {
  margin-top: 0.35rem;
}

.published-ranking-card.muted-card {
  opacity: 0.75;
  background: var(--surface-2);
}

.compact-details {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.compact-details summary {
  cursor: pointer;
  font-weight: 800;
}

/* Punktelisten-Freigabe: auffälliger Hinweis für die Wettbewerbsleitung */
.ranking-review-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--red);
  border-left-width: 8px;
  border-radius: var(--radius);
  background: #fff2f3;
  color: var(--text);
}

.ranking-review-alert strong,
.ranking-review-alert span {
  display: block;
}

.ranking-review-alert span {
  margin-top: 0.2rem;
  color: var(--red-dark);
  font-weight: 700;
}

.group-ranking-slip {
  width: 200mm;
}

.group-ranking-summary {
  background: #eef7f7;
  border-left: 5px solid var(--turquoise);
  padding: 3mm 4mm;
  margin-bottom: 4mm;
}

@media (max-width: 760px) {
  .ranking-review-alert {
    display: grid;
    gap: 0.75rem;
  }

  .ranking-review-alert .actions {
    width: 100%;
  }

  .ranking-review-alert button {
    flex: 1 1 auto;
  }
}

/* QR-Codes direkt in Gruppen- und Schiedsrichterlisten */
.record-qr {
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-thumb {
  display: inline-grid;
  justify-items: center;
  gap: 0.12rem;
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-thumb img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.qr-thumb small {
  font-size: 0.68rem;
  line-height: 1;
  color: var(--muted);
  font-weight: 800;
}

.qr-detail-preview {
  display: flex;
  justify-content: center;
  padding: 0.35rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.qr-detail-preview .qr-thumb img {
  width: 86px;
  height: 86px;
}

.group-record .record-summary {
  grid-template-columns: 86px minmax(210px, 1.8fr) minmax(160px, 1fr) minmax(94px, .55fr) 66px 74px;
}

.judge-record .record-summary {
  grid-template-columns: 96px minmax(220px, 1.6fr) minmax(95px, .55fr) 66px 78px 72px;
}

@media (max-width: 980px) {
  .judge-record .record-summary,
  .group-record .record-summary {
    grid-template-columns: 1fr auto;
  }

  .judge-record .record-qr,
  .group-record .record-qr {
    display: none;
  }
}

/* CompetitionDesk Footer-Branding */
.product-footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.product-footer-brand img {
  display: block;
  width: min(100%, 620px);
  height: auto;
  object-fit: contain;
}

#dataTimestamp {
  display: inline-block;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 720px) {
  .product-footer-brand img {
  display: block;
  width: min(100%, 620px);
  height: auto;
  object-fit: contain;
}
}

@media (max-width: 720px) {
  body[data-app-area="admin"] .topbar {
    align-items: flex-start;
  }

  body[data-app-area="admin"] .brand-lockup {
    display: grid;
    gap: 0.75rem;
  }

  body[data-app-area="admin"] .brand-logo {
    width: min(100%, 340px);
    max-height: 70px;
  }
}



/* Fix QR-Vergrößerung */
.qr-thumb {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.qr-thumb img,
.qr-thumb small {
  pointer-events: none;
}

.qr-modal {
  z-index: 999999;
}

.qr-modal-card {
  z-index: 1000000;
}


/* QR-Vorschau als echtes Overlay */
body.qr-preview-open {
  overflow: hidden;
}

.qr-preview-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  background: rgba(0, 0, 0, 0.68) !important;
}

.qr-preview-card {
  position: relative !important;
  display: grid !important;
  justify-items: center !important;
  gap: 14px !important;
  width: min(92vw, 520px) !important;
  max-height: 92vh !important;
  overflow: auto !important;
  padding: 24px !important;
  border-radius: 18px !important;
  border: 1px solid var(--line, #d6e3e3) !important;
  background: #ffffff !important;
  color: var(--text, #111111) !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35) !important;
}

.qr-preview-card strong {
  font-size: 1.25rem !important;
}

.qr-preview-card img {
  display: block !important;
  width: min(76vw, 420px) !important;
  height: min(76vw, 420px) !important;
  object-fit: contain !important;
  image-rendering: pixelated;
}

.qr-preview-card small {
  max-width: 100% !important;
  color: var(--muted, #687474) !important;
  font-size: 0.82rem !important;
  line-height: 1.35 !important;
  word-break: break-all !important;
  text-align: center !important;
}

.qr-preview-close {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: var(--surface-2, #eef7f7) !important;
  color: var(--text, #111111) !important;
  border: 1px solid var(--line, #d6e3e3) !important;
  font-size: 1.4rem !important;
  line-height: 1 !important;
}

.qr-preview-close:hover {
  background: #e2ebe7 !important;
}

@media print {
  .qr-preview-overlay {
    display: none !important;
  }
}

/* CompetitionDesk neutral branding. JRK bleibt nur aktiv, wenn die App data-branding="jrk" setzt. */
body:not([data-branding="jrk"]) {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-2: #f0f2f4;
  --text: #171b20;
  --muted: #65707a;
  --line: #dfe4e8;
  --red: #ff9a3d;
  --red-dark: #e57f20;
  --turquoise: #20262d;
  --turquoise-dark: #11161b;
  --violet: #516170;
  --green: #5a7d4f;
  --yellow: #ffcf77;
  --blue: #516170;
  --shadow: 0 18px 42px rgba(17, 22, 27, 0.08);
  background: linear-gradient(180deg, #ffffff 0, #f6f7f8 280px, #f5f6f7 100%);
}

body:not([data-branding="jrk"]),
body:not([data-branding="jrk"]) button,
body:not([data-branding="jrk"]) input,
body:not([data-branding="jrk"]) select,
body:not([data-branding="jrk"]) textarea {
  font-family: Arial, "Segoe UI", sans-serif;
}

body:not([data-branding="jrk"]) button,
body:not([data-branding="jrk"]) .button-anchor,
body:not([data-branding="jrk"]) .touch-button {
  background: var(--red);
  color: #161a1f;
}

body:not([data-branding="jrk"]) button:hover,
body:not([data-branding="jrk"]) .button-anchor:hover,
body:not([data-branding="jrk"]) .touch-button:hover {
  background: var(--red-dark);
}

body:not([data-branding="jrk"]) button.secondary,
body:not([data-branding="jrk"]) .button-anchor.secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

body:not([data-branding="jrk"]) button.secondary:hover,
body:not([data-branding="jrk"]) .button-anchor.secondary:hover {
  background: #e4e8eb;
}

body:not([data-branding="jrk"]) button.danger {
  background: #5e1621;
  color: #fff;
}

body:not([data-branding="jrk"]) button.success {
  background: var(--green);
  color: #fff;
}

body:not([data-branding="jrk"]) .topbar {
  align-items: center;
  border-bottom: 4px solid var(--red);
  background: #fff;
  padding: 18px;
  border-radius: 0 0 var(--radius) var(--radius);
}

body:not([data-branding="jrk"]) .brand-lockup {
  gap: 1.2rem;
  min-width: min(100%, 520px);
}

body:not([data-branding="jrk"]) .brand-logo {
  width: clamp(230px, 34vw, 420px);
  min-width: 0;
  max-height: 78px;
  object-fit: contain;
}

body:not([data-branding="jrk"]) .brand-lockup .eyebrow,
body:not([data-branding="jrk"]) .eyebrow {
  color: var(--red-dark);
  font-weight: 800;
  letter-spacing: 0.04em;
}

body:not([data-branding="jrk"]) .brand-lockup h1,
body:not([data-branding="jrk"]) .topbar h1 {
  color: var(--text);
  font-size: clamp(1.3rem, 2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0;
}

body:not([data-branding="jrk"]) .role-button.active,
body:not([data-branding="jrk"]) .tab-button.active {
  background: var(--red);
  border-color: var(--red);
  color: #161a1f;
}

body:not([data-branding="jrk"]) .badge,
body:not([data-branding="jrk"]) .status.accepted {
  background: #fff1e5;
  color: #9b4d11;
}

body:not([data-branding="jrk"]) .status.pending,
body:not([data-branding="jrk"]) .status.open {
  background: #eef1f3;
  color: #37424c;
}

body:not([data-branding="jrk"]) .status.rejected {
  background: #fde5e9;
  color: #9b1c2a;
}

body:not([data-branding="jrk"]) .context-card,
body:not([data-branding="jrk"]) .station-focus,
body:not([data-branding="jrk"]) .beamer-header {
  background: var(--turquoise);
  color: #fff;
}

body:not([data-branding="jrk"]) .view-header::before {
  width: 70px;
  height: 4px;
  background: var(--red);
  transform: none;
}

body:not([data-branding="jrk"]) .panel,
body:not([data-branding="jrk"]) .mobile-card,
body:not([data-branding="jrk"]) .login-panel,
body:not([data-branding="jrk"]) .workspace {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

body:not([data-branding="jrk"]) .notice,
body:not([data-branding="jrk"]) .correction-note {
  border-left-color: var(--red);
  background: #fff7ef;
  color: var(--text);
}

body[data-branding="jrk"] .brand-logo {
  width: clamp(96px, 10vw, 168px);
  min-width: 82px;
  max-height: 92px;
}

@media (max-width: 720px) {
  body:not([data-branding="jrk"]) .topbar {
    align-items: flex-start;
  }

  body:not([data-branding="jrk"]) .brand-lockup {
    display: grid;
    gap: 0.75rem;
  }

  body:not([data-branding="jrk"]) .brand-logo {
    width: min(100%, 340px);
    max-height: 70px;
  }
}


/* Kompakter Mandantenblock in "Wettbewerb anlegen" */
.competition-create-layout {
  align-items: start;
}

.tenant-context-panel-compact {
  align-self: start;
  max-height: none;
}

.tenant-context-panel-compact .context-card {
  min-height: auto;
  padding: 1rem;
  border-radius: 14px;
}

.tenant-context-panel-compact .context-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.tenant-context-panel-compact .context-card span:empty {
  display: none;
}

.tenant-context-panel-compact .notice {
  display: none;
}

.tenant-context-panel-compact label {
  margin-top: 0.75rem;
}

.tenant-context-panel-compact select {
  min-height: 44px;
}

@media (min-width: 980px) {
  .competition-create-layout {
    grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
  }
}


/* Dynamische Parcours-Konfiguration */
.parcours-config:empty {
  display: none;
}
.parcours-box label input[data-parcours-name-input] {
  margin-top: 0.35rem;
}


/* Wettbewerb anlegen: Mandanten-Kontext als schlanke Infokarte */
.competition-create-page {
  display: grid !important;
  grid-template-columns: minmax(260px, 380px) minmax(520px, 1fr) !important;
  gap: 1rem !important;
  align-items: start !important;
}

.tenant-create-context {
  align-self: start !important;
  padding: 1rem !important;
  display: grid !important;
  gap: 0.9rem !important;
}

.tenant-create-context .tenant-create-row {
  display: grid !important;
  gap: 0.35rem !important;
}

.tenant-create-context .tenant-create-row strong {
  font-size: 1.05rem !important;
}

.tenant-create-context .tenant-create-row span:not(.badge) {
  color: var(--muted) !important;
  font-size: 0.92rem !important;
}

.tenant-create-context select {
  min-height: 42px !important;
}

.competition-create-form {
  min-width: 0 !important;
}

@media (max-width: 1100px) {
  .competition-create-page {
    grid-template-columns: 1fr !important;
  }
}


/* Zeitplan: optionale zentrale Pausen und feste Uhrzeiten */
.central-break-fields.hidden,
.hidden {
  display: none !important;
}
.fixed-events-field {
  grid-column: 1 / -1;
}
.print-special-row td {
  background: #fff4d9;
  color: #6d4a00;
  font-weight: 900;
  text-align: center;
  border: 1px solid #f0d894;
}


/* Stationsfortschritt */
.station-progress-text {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.station-progress-meter span {
  transition: width 0.2s ease;
}

.station-finished {
  opacity: 0.55;
  filter: grayscale(1);
  background: linear-gradient(180deg, rgba(245, 245, 245, 0.96), rgba(232, 236, 240, 0.96)) !important;
}

.station-finished strong,
.station-finished h2,
.station-finished h3 {
  text-decoration: line-through;
  text-decoration-thickness: 0.08em;
}

.station-finished .load-meter span,
.station-finished .progress-track span {
  width: 100% !important;
}

.station-finished .status.accepted {
  opacity: 1;
}


/* Auto-Code-Login: kein sichtbares Rollenmenü mehr */
.role-strip {
  display: none !important;
}


/* RZ-Nacherfassung: Bearbeitungsmodus vorhandener Wertungen */
.manual-edit-notice.hidden {
  display: none;
}
.manual-edit-notice .notice {
  margin-bottom: 0.75rem;
}
