/* PicoFeedback – Modernes, konsistentes UI-Design mit Dark Mode
   Farbschema: Indigo/Slate, leichte Karten, klare Hierarchie
   Dark Mode: data-theme="dark" oder systemweite Vorgabe via JS
   Kein Tailwind/Bootstrap – reines, selbstgeschriebenes CSS */

:root {
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-secondary: #64748b;
  --color-secondary-hover: #475569;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-text: #065f46;
  --color-error: #ef4444;
  --color-error-bg: #fef2f2;
  --color-error-text: #991b1b;
  --color-info: #3b82f6;
  --color-info-bg: #eff6ff;
  --color-info-text: #1e40af;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-input-bg: #ffffff;
  --color-table-hover: #f8fafc;
  --color-product-placeholder: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1100px;
  --max-width-narrow: 640px;
}

[data-theme="dark"] {
  --color-primary: #6366f1;
  --color-primary-hover: #818cf8;
  --color-primary-light: rgba(99, 102, 241, 0.15);
  --color-secondary: #94a3b8;
  --color-secondary-hover: #cbd5e1;
  --color-danger: #f87171;
  --color-danger-hover: #fca5a5;
  --color-success: #34d399;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-success-text: #6ee7b7;
  --color-error: #f87171;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-error-text: #fca5a5;
  --color-info: #60a5fa;
  --color-info-bg: rgba(59, 130, 246, 0.12);
  --color-info-text: #93c5fd;
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-muted: #94a3b8;
  --color-border: #334155;
  --color-border-light: #27344c;
  --color-input-bg: #0f172a;
  --color-table-hover: #1e293b;
  --color-product-placeholder: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout-Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

.container-narrow {
  max-width: var(--max-width-narrow);
}

/* Header & Navigation */
.app-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.app-header .header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 2px 0 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav a:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.nav a.active {
  background-color: var(--color-primary);
  color: #fff;
}

/* Theme Toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.theme-toggle:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Seiten-Titel-Bereich */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--color-text);
}

.page-header p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Karten */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--color-border);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--color-text);
}

.card-subtitle {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-top: -12px;
  margin-bottom: 16px;
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.btn,
button[type="submit"],
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  line-height: 1.4;
}

.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active,
button[type="submit"]:active,
input[type="submit"]:active {
  transform: translateY(0);
}

.btn-primary,
button[type="submit"]:not(.btn-secondary):not(.btn-danger),
input[type="submit"]:not(.btn-secondary):not(.btn-danger) {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover,
button[type="submit"]:not(.btn-secondary):not(.btn-danger):hover,
input[type="submit"]:not(.btn-secondary):not(.btn-danger):hover {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--color-input-bg);
  color: var(--color-secondary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg);
  color: var(--color-secondary-hover);
}

.btn-danger {
  background-color: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  background-color: var(--color-danger-hover);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
  min-height: 36px;
}

/* Formulare */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="file"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background-color: var(--color-input-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}

.form-row .form-group {
  margin-bottom: 0;
}

fieldset.checkbox-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 20px 0;
  background-color: var(--color-bg);
}

fieldset.checkbox-group legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 6px;
  color: var(--color-text);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-weight: 400;
  cursor: pointer;
  color: var(--color-text);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.checkbox-group-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  margin: 12px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.checkbox-group-subtitle:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.email-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

.email-preview-header {
  padding: 16px;
  background: var(--color-border-light);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.email-preview-header p {
  margin: 4px 0;
  color: var(--color-text);
}

.email-preview-body {
  padding: 24px;
}

.email-preview-qr {
  padding: 16px 24px 24px;
  border-top: 1px dashed var(--color-border);
}

.email-preview-qr img {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.email-preview-qr p {
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.alert::before {
  content: "";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.alert-error {
  background-color: var(--color-error-bg);
  color: var(--color-error-text);
  border-color: rgba(239, 68, 68, 0.3);
}

.alert-error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23991b1b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}

.alert-success {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: rgba(16, 185, 129, 0.3);
}

.alert-success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23065f46' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}

.alert-info {
  background-color: var(--color-info-bg);
  color: var(--color-info-text);
  border-color: rgba(59, 130, 246, 0.3);
}

.alert-info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e40af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
}

/* Tabellen */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 560px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

th {
  background-color: var(--color-bg);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: var(--color-table-hover);
}

/* Stern-Bewertung */
.rating-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #f59e0b;
  font-weight: 600;
  white-space: nowrap;
}

.rating-display .stars {
  letter-spacing: 1px;
}

.rating-display .value {
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.85rem;
  margin-left: 4px;
}

/* Statistik-Kacheln */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-icon.testers { background-color: #ede9fe; }
.stat-icon.products { background-color: #dbeafe; }
.stat-icon.categories { background-color: #d1fae5; }

[data-theme="dark"] .stat-icon.testers { background-color: rgba(99, 102, 241, 0.2); }
[data-theme="dark"] .stat-icon.products { background-color: rgba(59, 130, 246, 0.2); }
[data-theme="dark"] .stat-icon.categories { background-color: rgba(16, 185, 129, 0.2); }

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

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

/* Produktkarten */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.product-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid var(--color-border);
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.product-card img,
.product-no-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: var(--color-product-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.product-card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-body h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.product-card-link {
  color: var(--color-text);
  text-decoration: none;
}

.product-card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card-link:hover {
  color: var(--color-primary);
}

.product-categories {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 0 0 14px;
  flex: 1;
  position: relative;
  z-index: 2;
}

.product-card-actions {
  margin-top: auto;
  position: relative;
  z-index: 2;
}

/* Produkt-Detailbild */
.product-image-large,
.current-image {
  margin: 0 0 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-product-placeholder);
  border: 1px solid var(--color-border);
  text-align: center;
}

.product-image-large img,
.current-image img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.current-image p {
  margin: 0;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

/* Detail-Grid für Tester/Produkt */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.detail-block {
  background-color: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--color-border);
}

.detail-block h2 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  font-weight: 700;
}

.detail-block p {
  margin: 6px 0;
  color: var(--color-text);
}

/* QR-Code & Link */
.qr-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin: 20px 0 28px;
  padding: 20px;
  background-color: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.qr-section .form-group {
  flex: 1 1 300px;
  margin-bottom: 0;
}

.qr-section input[readonly] {
  background-color: var(--color-input-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  cursor: text;
}

.qr-code svg {
  display: block;
  max-width: 180px;
  height: auto;
  border-radius: var(--radius-sm);
  background-color: #fff;
  padding: 8px;
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .qr-code svg {
  background-color: #fff;
}

/* Kategorien-Liste */
.category-list {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 20px;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-light);
  background-color: var(--color-surface);
}

.category-item:last-child {
  border-bottom: none;
}

.category-item form {
  margin: 0;
}

.category-item button {
  margin-top: 0;
}

/* Lösch-Formular */
.delete-form {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

/* Leer-Zustand */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-muted);
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

/* Feedback-Formular-spezifisch */
.rating-helper {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 4px;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 30px 24px;
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .card {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  .app-header {
    padding: 12px 16px;
  }

  .app-header .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-subtitle {
    display: none;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .nav {
    width: auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    padding: 8px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .theme-toggle {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .theme-toggle .toggle-text {
    display: none;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

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

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

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

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

  th,
  td {
    padding: 10px 12px;
  }

  .qr-section {
    flex-direction: column;
    align-items: stretch;
  }

  .qr-section .form-group {
    width: 100%;
  }

  .qr-code svg {
    max-width: 100%;
    width: 100%;
  }

  .actions {
    gap: 8px;
  }

  .btn,
  button[type="submit"],
  input[type="submit"] {
    width: 100%;
    min-height: 48px;
  }

  .actions .btn {
    flex: 1 1 auto;
  }

  .btn-small {
    width: auto;
    min-height: 36px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 12px;
  }

  .card {
    padding: 16px;
  }

  .page-header h1 {
    font-size: 1.35rem;
  }
}

/* Utility */
.text-muted {
  color: var(--color-muted);
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Anmelde-Formular / Datenschutz */
.hint {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 6px 0 0;
}

.consent-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 20px 0;
  background-color: var(--color-bg);
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.consent-box h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--color-text);
}

.consent-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
}

.consent-text p {
  margin: 0 0 12px;
}

.consent-text p:last-child {
  margin-bottom: 0;
}

/* Status-Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
}

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

.badge-active {
  background-color: #d1fae5;
  color: #065f46;
}

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

[data-theme="dark"] .badge-pending {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

[data-theme="dark"] .badge-active {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

[data-theme="dark"] .badge-rejected {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Filter und Inline-Formulare */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.inline-form button {
  min-height: 36px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .app-header,
  .app-footer,
  .actions,
  .print-actions,
  .print-hint,
  .theme-toggle,
  .btn {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
    break-inside: avoid;
  }
}
