:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #1a202c;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e2e8f0;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: white;
  padding: 1.25rem 1.5rem;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem 1.5rem;
  flex-wrap: wrap;
}

.header-brand {
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  flex: 1 0 100%;
}

.main-nav a {
  color: white;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  opacity: 0.9;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.user-info {
  opacity: 0.85;
}

.nav-logout {
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.nav-logout-form {
  display: inline;
  margin: 0;
}

.main-nav button.nav-logout {
  color: white;
  background: transparent;
  font: inherit;
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  opacity: 0.9;
}

.main-nav button.nav-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.lang-switch a {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-width: 2rem;
  text-align: center;
}

.lang-switch-nav a.active {
  background: rgba(255, 255, 255, 0.22);
  opacity: 1;
}

.lang-switch-login {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.lang-switch-login a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
}

.lang-switch-login a:hover,
.lang-switch-login a.active {
  color: var(--primary);
  background: #eff6ff;
}

.info-banner {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}

.login-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.login-form {
  text-align: left;
  margin-top: 1.5rem;
}

.login-form .error {
  margin-bottom: 1rem;
}

.success {
  color: var(--ok);
  background: var(--ok-bg);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.login-card-wide {
  max-width: 460px;
}

.login-links {
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.login-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.login-links a:hover {
  text-decoration: underline;
}

.login-help-links {
  margin-top: 1rem;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.85rem;
  margin-top: 0.35rem;
}

.account-badge,
.header-meta .user-info {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.login-hint {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toolbar-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rolle-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.rolle-admin {
  background: #ede9fe;
  color: #6d28d9;
}

.rolle-benutzer {
  background: #dbeafe;
  color: #1d4ed8;
}

.rolle-readonly {
  background: #f1f5f9;
  color: #475569;
}

.badge-self {
  font-size: 0.75rem;
  background: #e2e8f0;
  color: #475569;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.25rem;
}

.badge-pending {
  font-size: 0.75rem;
  background: var(--warn-bg);
  color: var(--warn);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.25rem;
}

.copyright {
  font-size: 0.8rem;
  margin: 0.15rem 0 0.5rem;
  opacity: 0.85;
}

.copyright a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.copyright a:hover {
  opacity: 1;
}

header .copyright {
  color: rgba(255, 255, 255, 0.9);
}

.login-card .copyright {
  color: var(--text-muted);
}

.page-title {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  margin-top: 0.25rem;
  opacity: 0.9;
  font-size: 0.95rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  box-sizing: border-box;
}

a.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

a.btn-primary {
  color: white;
}

a.btn-secondary {
  color: var(--text);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-danger:hover {
  background: #fecaca;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn-danger:disabled:hover,
.btn-danger[disabled]:hover {
  background: var(--danger-bg);
}

.form-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.share-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.share-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.share-section .toolbar-info {
  margin-bottom: 1rem;
}

.share-url-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.share-url-row input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #f8fafc;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.share-empty {
  margin-top: 0.5rem;
}

.locations-table {
  margin-top: 1rem;
}

.locations-table .actions {
  white-space: nowrap;
}

.cell-email {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.share-section .error {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  text-align: left;
}

.log-details {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 28rem;
}

.log-undone-meta {
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

.log-row-undone {
  opacity: 0.72;
}

.log-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.log-badge-create {
  background: var(--ok-bg);
  color: var(--ok);
}

.log-badge-update,
.log-badge-menge {
  background: #dbeafe;
  color: #1d4ed8;
}

.log-badge-delete {
  background: var(--danger-bg);
  color: var(--danger);
}

.log-badge-undo {
  background: #f1f5f9;
  color: #475569;
}

.shop-row-deleted td {
  color: var(--text-muted);
}

.shop-row-deleted strong {
  color: inherit;
}

.shop-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.shop-name-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
}

.shop-name-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
}

#limit-info {
  margin-bottom: 0.75rem;
}

.form-section h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.gerichte-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.gerichte-header h2 {
  margin-bottom: 0;
}

.gerichte-liste {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gericht-card {
  background: var(--bg, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.gericht-card.is-urgent {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.gericht-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.gericht-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.gericht-card h4 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.75;
}

.gericht-card ul,
.gericht-card ol {
  margin: 0;
  padding-left: 1.2rem;
}

.gericht-card li {
  margin: 0.2rem 0;
}

.gericht-reason {
  margin: 0;
  font-size: 0.95rem;
}

.gericht-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.gerichte-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.gerichte-loading-wait {
  max-width: 28rem;
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
}

.gerichte-hourglass {
  width: 2.1rem;
  height: 3rem;
  position: relative;
  animation: gerichte-hourglass-spin 1.3s linear infinite;
}

.gerichte-hourglass::before,
.gerichte-hourglass::after {
  content: '';
  position: absolute;
  left: 0;
  width: 0;
  height: 0;
  border-left: 1.05rem solid transparent;
  border-right: 1.05rem solid transparent;
}

.gerichte-hourglass::before {
  top: 0;
  border-top: 1.45rem solid var(--primary);
}

.gerichte-hourglass::after {
  bottom: 0;
  border-bottom: 1.45rem solid var(--primary);
}

@keyframes gerichte-hourglass-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.form-row {
  margin-bottom: 1rem;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.chargen-liste {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chargen-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) minmax(9rem, 1.5fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.chargen-row input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

#btn-charge-add {
  margin-bottom: 0.35rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.name-suggest-wrap {
  position: relative;
}

.name-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 15rem;
  overflow-y: auto;
}

.name-suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.name-suggest-item:hover,
.name-suggest-item.active {
  background: #eff6ff;
}

.name-suggest-name {
  font-weight: 600;
}

.name-suggest-name strong {
  color: var(--primary);
  font-weight: 700;
}

.name-suggest-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-row input[type="checkbox"] {
  width: auto;
}

.weekly-cell {
  text-align: center;
}

.weekly-cell input {
  width: auto;
  accent-color: var(--primary);
}

.form-row-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.password-strength {
  margin-top: 0.45rem;
}

.password-strength-bar {
  display: flex;
  gap: 0.25rem;
  height: 6px;
}

.password-strength-bar span {
  flex: 1;
  border-radius: 999px;
  background: var(--border);
}

.password-strength-bar[data-level="1"] span:nth-child(1) {
  background: var(--danger);
}

.password-strength-bar[data-level="2"] span:nth-child(-n+2) {
  background: var(--warn);
}

.password-strength-bar[data-level="3"] span:nth-child(-n+3) {
  background: #65a30d;
}

.password-strength-bar[data-level="4"] span {
  background: var(--ok);
}

.password-strength-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.password-strength[data-level="1"] .password-strength-label {
  color: var(--danger);
}

.password-strength[data-level="2"] .password-strength-label {
  color: var(--warn);
}

.password-strength[data-level="3"] .password-strength-label {
  color: #4d7c0f;
}

.password-strength[data-level="4"] .password-strength-label {
  color: var(--ok);
}

.einkauf-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.einkauf-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.einkauf-row input[type="number"] {
  width: 8rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.einkauf-row input[type="number"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.liste-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.artikel-tabelle {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.artikel-tabelle th,
.artikel-tabelle td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.artikel-tabelle th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-weight: 600;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  user-select: none;
}

.sort-btn:hover {
  color: var(--primary);
}

.sort-btn.active {
  color: var(--primary);
}

.sort-btn::after {
  content: '↕';
  font-size: 0.75rem;
  opacity: 0.35;
}

.sort-btn.active.asc::after {
  content: '↑';
  opacity: 1;
}

.sort-btn.active.desc::after {
  content: '↓';
  opacity: 1;
}

.artikel-tabelle tbody tr:hover {
  background: #f8fafc;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.status-bald {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-abgelaufen {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-offen {
  background: #e2e8f0;
  color: var(--text-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.name-cell strong {
  display: block;
}

.name-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.menge-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.menge-btn {
  width: 1.9rem;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 700;
}

.menge-value {
  min-width: 4.25rem;
  text-align: center;
}

.loading,
.empty,
.error {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.error {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

.barcode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.barcode-row input {
  flex: 1 1 12rem;
  min-width: 0;
}

.barcode-row .btn {
  flex: 0 0 auto;
}

.field-hint.is-ok {
  color: var(--ok);
}

.field-hint.is-warn {
  color: var(--warn);
}

.scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.72);
}

.scanner-dialog {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.25rem;
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  overflow: auto;
  box-shadow: var(--shadow);
}

.scanner-dialog h2 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.scanner-hint,
.scanner-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.scanner-video-wrap {
  position: relative;
  width: 100%;
  height: min(55vh, 420px);
  min-height: 220px;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  cursor: pointer;
  touch-action: manipulation;
}

.scanner-video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.scanner-frame {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 36%;
  height: 22%;
  border: 2px solid #4ade80;
  border-radius: 8px;
  pointer-events: none;
}

.scanner-focus-mark {
  position: absolute;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
}

.scanner-focus-mark.is-flash {
  animation: scanner-focus-flash 0.65s ease-out;
}

@keyframes scanner-focus-flash {
  0% {
    opacity: 1;
    transform: scale(1.25);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

.scanner-manual-row,
.scanner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.scanner-manual-row input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

@media (max-width: 768px) {
  .stack-table {
    width: 100%;
    table-layout: fixed;
  }

  .stack-table thead {
    display: none;
  }

  .stack-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .stack-table tr {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.2rem 0;
  }

  .stack-table td {
    display: block;
    text-align: left;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .stack-table td:last-child {
    border-bottom: none;
  }

  .stack-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
  }

  .stack-table td > * {
    max-width: 100%;
  }

  .stack-table td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    white-space: normal;
  }

  .stack-table td.actions::before {
    flex: 1 0 100%;
  }

  .stack-table .rolle-badge {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .locations-table .actions {
    white-space: normal;
  }

  .stack-table tbody tr:hover {
    background: var(--bg);
  }

  .share-url-row {
    flex-direction: column;
  }

  .share-url-row .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  main {
    padding: 1rem 0.75rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row-inline {
    grid-template-columns: 1fr;
  }

  .chargen-row {
    grid-template-columns: 1fr auto;
  }

  .chargen-row .charge-ablauf {
    grid-column: 1 / -1;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .share-url-row {
    flex-direction: column;
  }

  .share-section,
  .liste-section,
  .form-section {
    padding: 1rem;
  }

  .share-url-row .btn,
  .form-actions .btn,
  .barcode-row .btn,
  .scanner-actions .btn {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }
}

.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.feedback-message {
  min-height: 10rem;
  resize: vertical;
}
