/* ═══════════════════════════════════════════════
   FHT v2.0.0 – Component Styles
   ═══════════════════════════════════════════════ */

/* ─── App Shell ─── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--space-md) + env(safe-area-inset-top, 0px)) var(--space-lg) var(--space-md);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: var(--space-md);
}

.app-header__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.app-content {
  flex: 1;
  padding: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Offline Badge ─── */
.offline-badge {
  display: none;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-warning);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  animation: pulse 2s infinite;
}

.offline-badge.visible { display: flex; }

.offline-badge__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-inverse);
}

/* ─── Testumgebung (396 S11, A-011): rote Leiste, fest oben, auf jeder Seite ───
   fixed + Platz im body (statt sticky im Fluss): der klebende Kopf (.app-header, top: 0) würde sonst beim Scrollen unter die Leiste
   rutschen. Fehlt `ist-test` am body (= Prod), ändert sich nichts. */
:root { --test-leiste-hoehe: 28px; }
.test-leiste {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--test-leiste-hoehe);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #C62828;
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: 800;
  letter-spacing: 0.05em;
  pointer-events: none;
}
body.ist-test { padding-top: var(--test-leiste-hoehe); }
body.ist-test .app-header { top: var(--test-leiste-hoehe); }

/* ─── Gerätefunktion im Kopf (Brief 396 A-008): groß genug fürs Personal, farblich je Funktion ─── */
.geraet-badge {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: #616161;
  white-space: nowrap;
}
.geraet-badge[data-funktion="einlass"] { background: #2E7D32; }
.geraet-badge[data-funktion="auslass"] { background: #1565C0; }
.geraet-badge[data-funktion="beides"] { background: #6A1B9A; }
.geraet-badge[data-funktion="ansicht"] { background: #616161; }

/* ─── Dauerhafte Hinweise unter dem Kopf: bleiben, bis die Ursache behoben ist (utils/hinweise.js) ─── */
.dauerhinweise:empty { display: none; }
.dauerhinweis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: #000;
  background: var(--color-warning);
  border-bottom: 1px solid var(--border-color);
}
.dauerhinweis--danger { background: #c62828; color: #fff; }
/* „info“: ein Hinweis, der nur Admins etwas sagt (Doppel-Schutz fehlt): klein und leise, damit das Personal daran nicht hängen bleibt. */
.dauerhinweis--info { font-size: var(--font-size-sm); font-weight: 500; padding: 4px var(--space-lg); }

/* ─── Erklärung am gesperrten Knopf (utils/geraet.js sperrText) ─── */
.geraet-sperre {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-left: 4px solid var(--color-warning);
  background: var(--bg-surface-hover);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
}
button[data-gesperrt], button[data-gesperrt]:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── Sync Badge ─── */
.sync-badge {
  display: none;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.sync-badge.visible { display: flex; }

/* ─── Conflict Dialog ─── */
.conflict-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.conflict-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.conflict-dialog h3 {
  color: var(--color-warning);
  margin: 0;
  font-size: var(--font-size-lg);
}

.conflict-choice {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.conflict-choice:active {
  transform: scale(0.97);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--touch-target);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--color-primary);
  color: var(--text-inverse);
}
.btn--primary:hover { background: var(--color-primary-hover); }

.btn--accent {
  background: var(--color-accent);
  color: var(--text-inverse);
}
.btn--accent:hover { background: var(--color-accent-hover); }

.btn--success {
  background: var(--color-success);
  color: var(--text-inverse);
}

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

.btn--outline {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}
.btn--outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover { color: var(--text-primary); background: var(--bg-surface); }

.btn--lg {
  min-height: 56px;
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

.btn--block { width: 100%; }

.btn--icon {
  width: var(--touch-target);
  height: var(--touch-target);
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.card--interactive {
  cursor: pointer;
}
.card--interactive:hover {
  background: var(--bg-surface-hover);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}
.card--interactive:active {
  background: var(--bg-surface-active);
  transform: scale(0.98);
}

/* ─── Dashboard Tiles ─── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  min-height: 180px;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.tile:hover {
  border-color: var(--color-primary);
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tile:active {
  transform: scale(0.97);
}

.tile__icon {
  font-size: 48px;
  line-height: 1;
}

.tile__label {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.tile__sublabel {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.tile--primary { border-color: var(--color-primary); }
.tile--primary .tile__label { color: var(--color-primary); }

.tile--accent { border-color: var(--color-accent); }
.tile--accent .tile__label { color: var(--color-accent); }

/* ─── Forms ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  min-height: var(--touch-target);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-size-body);
  transition: border-color var(--transition);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  outline: none;
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; }

/* Datum-Wrapper: Textfeld + Kalender-Icon für iOS-Picker */
.date-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.date-wrapper .form-input {
  padding-right: 44px;
}
.date-wrapper__picker {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
  -webkit-appearance: none;
}
.date-wrapper__icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 18px;
  color: var(--text-secondary);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239E9E9E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: var(--touch-target);
  cursor: pointer;
  font-size: var(--font-size-body);
  user-select: none;
}

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

/* ─── Stepper ─── */
.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.stepper__btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--font-size-xl);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.stepper__btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.stepper__btn:disabled { opacity: 0.3; cursor: not-allowed; }

.stepper__value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  min-width: 48px;
  text-align: center;
}

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 2px solid var(--border-color);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: var(--space-sm) var(--space-lg);
  min-height: var(--touch-target);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--font-size-body);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  margin-bottom: -2px;
}

.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-body);
}

.table th {
  text-align: left;
  padding: var(--space-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border-color);
}

.table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table tr:hover td {
  background: var(--bg-surface-hover);
}

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

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-lg);
  animation: fadeIn 150ms ease-out;
}

.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 600px;
  width: 100%;
  max-height: 80dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal__title {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

/* ─── Search ─── */
.search-wrapper {
  position: relative;
}

.search-input {
  min-height: 56px;
  padding: var(--space-md) var(--space-md) var(--space-md) 48px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-size-lg);
  width: 100%;
  transition: border-color var(--transition);
}

.search-input:focus {
  border-color: var(--border-focus);
  outline: none;
}

/* Placeholder für contenteditable (Safari-kompatibler Ersatz für <input>) */
.search-input.is-empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

/* Cursor-Styling für contenteditable */
.search-input[contenteditable] {
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 20px;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-lg);
}

.search-result-item {
  padding: var(--space-md);
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-surface-hover); }

.search-result-item__name {
  font-weight: 600;
  font-size: var(--font-size-body);
}

.search-result-item__detail {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ─── Signature Pad ─── */
.signature-container {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  position: relative;
  touch-action: none;
}

.signature-container canvas {
  width: 100%;
  height: 150px;
  display: block;
  border-radius: var(--radius-md);
}

.signature-clear {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
}

.signature-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  pointer-events: none;
}

/* ─── Angler Card (Teich-Übersicht) ─── */
.angler-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.angler-card:hover {
  border-color: var(--color-primary);
  background: var(--bg-surface-hover);
}

.angler-card__info { flex: 1; }

.angler-card__name {
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.angler-card__detail {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

.angler-card__meta {
  text-align: right;
}

.angler-card__time {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-primary);
}

.angler-card__guests {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.angler-card--warning {
  border-left: 4px solid var(--color-warning);
}

/* ─── Teich Counter ─── */
.counter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 var(--space-md);
  background: var(--color-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.counter-badge--today {
  background: var(--color-accent);
  color: #000;
}

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.filter-chip {
  padding: var(--space-sm) var(--space-md);
  min-height: var(--touch-target);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
}

/* ─── Hinweis „Neue Version verfügbar“ (396 A-003): klebt oben über dem Kopf, schiebt den Inhalt nicht weg ─── */
.update-bar {
  position: sticky;
  top: 0;
  z-index: 1500;
  display: block;
  width: 100%;
  padding: calc(var(--space-sm) + env(safe-area-inset-top, 0px)) var(--space-lg) var(--space-sm);
  border: 0;
  background: var(--color-warning);
  color: #000;
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-body);
  box-shadow: var(--shadow-lg);
  animation: toastIn 300ms ease-out, toastOut 300ms ease-in 2700ms forwards;
  pointer-events: auto;
}

.toast--success { background: var(--color-success); color: #fff; }
.toast--error { background: var(--color-danger); color: #fff; }
.toast--info { background: var(--color-primary); color: var(--text-inverse); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ─── Page Header ─── */
.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.page-header__back {
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xl);
  cursor: pointer;
  transition: all var(--transition);
}
.page-header__back:hover { background: var(--bg-surface-hover); }
.page-header__back:active { transform: scale(0.9); opacity: 0.5; }

/* Tabellenzeilen: sofortiges Touch-Feedback */
.table tbody tr { transition: none; }
.table tbody tr:active { background: var(--bg-surface-hover) !important; opacity: 0.7; }

/* Angler-Cards: sofortiges Touch-Feedback */
.angler-card:active { transform: scale(0.98); opacity: 0.7; }

.page-header__title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
}

/* ─── Empty State ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 64px;
  opacity: 0.5;
}

.empty-state__text {
  font-size: var(--font-size-lg);
}

/* ─── Loading Spinner ─── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Checkout Actions ─── */
.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.checkout-actions__btn {
  width: 100%;
}

/* iPad+: Verlassen-Button volle Breite, größer */
@media (min-width: 768px) {
  .checkout-actions {
    flex-direction: row;
    gap: var(--space-lg);
  }
  .checkout-actions__btn {
    flex: 1;
    min-height: 64px;
    font-size: var(--font-size-xl);
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .app-content {
    padding: var(--space-md);
  }

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

  .tile {
    min-height: 140px;
    padding: var(--space-lg);
  }

  .tile__icon { font-size: 36px; }
  .tile__label { font-size: var(--font-size-lg); }

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

@media (min-width: 1024px) {
  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── iPhone / Small Mobile ─── */
@media (max-width: 430px) {
  .app-header {
    padding: var(--space-sm) var(--space-md);
  }

  .app-header__title span {
    display: none;
  }

  .app-content {
    padding: var(--space-sm) var(--space-md) var(--space-lg);
  }

  .page-header {
    margin-bottom: var(--space-md);
    gap: var(--space-sm);
  }

  .page-header__title {
    font-size: var(--font-size-xl);
  }

  .tile-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .tile {
    min-height: 110px;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }

  .tile__icon { font-size: 28px; }
  .tile__label { font-size: var(--font-size-body); }
  .tile__sublabel { font-size: 13px; }

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

  .angler-card {
    padding: var(--space-md);
    gap: var(--space-sm);
  }

  .angler-card__name {
    font-size: var(--font-size-body);
  }

  .counter-badge {
    min-width: 40px;
    height: 40px;
    font-size: var(--font-size-lg);
  }

  .btn--lg {
    min-height: 48px;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-body);
  }

  /* iOS: Inputs min 16px um Auto-Zoom zu verhindern */
  .form-input,
  .form-select,
  .form-textarea,
  .search-input {
    font-size: 16px;
  }

  /* Checkout: Buttons immer untereinander auf kleinen Geräten */
  .checkout-actions {
    flex-direction: column;
  }
  .checkout-actions__btn {
    min-height: 48px;
    font-size: var(--font-size-body);
  }
}

/* ─── Desktop: Native Date-Inputs vergrößern (Mac Safari rendert sie winzig) ─── */
@media (min-width: 769px) {
  input[type="date"].form-input,
  input[type="date"].input-date {
    font-size: var(--font-size-lg);
    min-height: 48px;
    padding: var(--space-sm) var(--space-md);
    min-width: 180px;
    cursor: pointer;
  }

  /* Inline-Datepicker in Filter-Bars: nicht volle Breite */
  .filter-bar input[type="date"].form-input {
    width: auto;
    min-width: 170px;
    max-width: 200px;
  }

  /* WebKit: Kalender-Icon größer + klickbar */
  input[type="date"]::-webkit-calendar-picker-indicator {
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    opacity: 0.7;
  }
  input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
  }
}

/* ─── iOS PWA Standalone Mode ─── */
@media (display-mode: standalone) {
  .toast-container {
    bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }
}

/* ─── Toggle Switch (iPad-freundlich) ─── */

.toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--border-color);
  border-radius: 32px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.toggle__slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle__slider {
  background: var(--color-success);
}

.toggle input:checked + .toggle__slider::before {
  transform: translateX(24px);
}

/* Stand-Anzeige der Teichübersicht (Brief 396 §C.7). Gelb, wenn der letzte erfolgreiche
   Server-Abgleich > 3 min her ist (data-stale="true", gesetzt in PondOverview.js).
   --color-warning ist in theme.css je Theme (hell/dunkel) definiert. Die Grundfarbe steht
   hier und nicht mehr inline am Element, sonst gewänne das Inline-Style gegen die Regel. */
[data-last-update] {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

[data-last-update][data-stale="true"] {
  color: var(--color-warning);
  font-weight: 700;
}

[data-last-update][data-stale="true"]::before {
  content: "⚠ ";
}
