/* Layout für das Betreiber-Portal — Header, Zurück-Leiste, Content, fixe
   Speichern-Leiste. Siehe foodtruck-portal-spec.md §9. */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
  height: 64px; flex: none; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--white); border-bottom: 1px solid var(--line-subtle);
}
.app-header-title { font: var(--weight-medium) var(--fs-h4) / 1 var(--font-core); letter-spacing: var(--ls-h4); }
.app-header-logo { height: 20px; width: auto; display: block; }

.radius-map { margin-top: 16px; width: 100%; height: 220px; background: var(--cloud); border: 1px solid var(--line); }

.subnav {
  position: sticky; top: 0; z-index: 20; height: 52px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.subnav-back {
  justify-self: start; display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px;
  border: none; background: none; cursor: pointer; text-decoration: none;
  font: var(--weight-medium) var(--fs-body) / 1 var(--font-core); color: var(--blue-bright);
}
.subnav-back:hover { color: var(--blue-dark); }
.subnav-title { font: var(--weight-medium) var(--fs-body) / 1 var(--font-core); white-space: nowrap; text-align: center; }

.view { flex: 1; width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 40px 16px 96px; box-sizing: border-box; }
.view.has-savebar { padding-bottom: 140px; }
.view-narrow-top { padding-top: 24px; }

.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.profile-head h1 { margin-top: 14px; font: var(--weight-medium) var(--fs-h2) / var(--lh-h2) var(--font-core); letter-spacing: var(--ls-h2); }
.profile-head .row-eyebrow { color: var(--text-muted); }
.profile-logo { width: 104px; height: 104px; }

.view-actions-center { margin-top: 40px; display: flex; justify-content: center; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--white);
  border-top: 1px solid var(--line-subtle); padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
}
.savebar-inner { max-width: 520px; margin: 0 auto; display: flex; }
/* Feste Leiste klar vom Inhalt abgesetzt: Schlagschatten + Milchglas, der Inhalt scheint beim Scrollen leicht durch. */
.savebar {
  background: rgba(255, 255, 255, .92); border-top-color: var(--line); box-shadow: 0 -8px 24px rgba(23, 23, 23, .10);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .savebar { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); }
}

.section { background: var(--white); border: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.section + .ts-label { margin-top: var(--space-8); }
.section-gap-lg { gap: 28px; }

/* ---- Login-Code-Screen ---- */
.code-screen { max-width: 560px; margin: 0 auto; padding: clamp(40px, 10vw, 96px) 20px; }
.code-screen form { display: flex; flex-direction: column; align-items: center; text-align: center; }
.code-icon {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: var(--blue-baby); color: var(--blue-dark);
}
.code-screen h1 { margin: 24px 0 0; font: var(--weight-medium) clamp(28px, 7vw, 40px) / var(--lh-h1) var(--font-core); letter-spacing: var(--ls-h1); }
.code-screen p { margin: 16px 0 0; max-width: 420px; font: var(--weight-regular) var(--fs-body) / var(--lh-body) var(--font-core); letter-spacing: var(--ls-body); color: var(--text-secondary); }
.code-screen p strong { color: var(--ink); font-weight: var(--weight-medium); }
.code-digits { margin-top: 32px; width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code-digits input {
  box-sizing: border-box; width: 100%; height: 60px; text-align: center; background: var(--white);
  border: 1px solid var(--line); font: var(--weight-medium) var(--fs-h2) / 1 var(--font-core);
  font-variant-numeric: tabular-nums; transition: border-color var(--dur) var(--ease-standard);
}
.code-digits input:focus { border-color: var(--ink); box-shadow: var(--focus-ring); }
.code-screen .btn { margin-top: 32px; width: 100%; }
.code-dev-note { margin-top: 24px; padding: 14px 16px; background: var(--info-bg); color: var(--blue-dark); font: var(--weight-regular) var(--fs-body-sm) / 1.4 var(--font-core); text-align: left; }
.code-dev-note strong { font-variant-numeric: tabular-nums; letter-spacing: .1em; }

/* Code-Seite: Fortschritt, Hilfe bei ausbleibender Mail */
.code-steps { list-style: none; margin: 0 0 28px; padding: 0; display: flex; justify-content: center; gap: 6px 14px; flex-wrap: wrap; font: var(--weight-medium) var(--fs-caption) / 1 var(--font-core); color: var(--text-muted); }
.code-steps li { display: inline-flex; align-items: center; gap: 6px; }
.code-steps li span { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); font-size: 11px; }
.code-steps li.is-current { color: var(--ink); }
.code-steps li.is-current span { background: var(--ink); border-color: var(--ink); color: var(--white); }
.code-help { margin-top: 32px; padding: 20px; background: var(--cloud); text-align: left; }
.code-help-title { margin: 0; font: var(--weight-medium) var(--fs-body-sm) / 1.3 var(--font-core); color: var(--ink); }
.code-help ul { margin: 10px 0 0; padding-left: 18px; font: var(--weight-regular) var(--fs-body-sm) / 1.45 var(--font-core); color: var(--text-secondary); }
.code-help li + li { margin-top: 6px; }
.code-help li strong { color: var(--ink); font-weight: var(--weight-medium); }
.code-screen .code-resend { display: block; margin-top: 16px; text-align: left; }
.code-screen .code-resend .btn { margin-top: 0; width: 100%; }
.code-help-foot { margin: 14px 0 0; font: var(--weight-regular) var(--fs-body-sm) / 1.4 var(--font-core); color: var(--text-secondary); }
.code-screen .code-help p { max-width: none; }
.code-screen .code-help .code-help-title { margin-top: 0; }
.code-legal { margin: 20px 0 0; text-align: center; color: var(--text-muted); font-size: var(--fs-caption); }

.login-email-form { display: flex; flex-direction: column; gap: 16px; align-items: stretch; width: 100%; }

/* Admin: Foto-Galerie in der Profilansicht */
.admin-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.admin-photos a { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--cloud); }
.admin-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Profil-Fortschritt (Portal-Startseite): Logo + Fotos bis zum vollständigen Profil */
.profile-progress { padding: 18px 18px 16px; margin-bottom: 28px; background: var(--white); border: 1px solid var(--line); font: var(--weight-regular) var(--fs-body-sm) / 1.45 var(--font-core); color: var(--text-secondary); }
.profile-progress strong { color: var(--ink); font-weight: var(--weight-medium); font-size: var(--fs-body); }
.profile-progress-bar { display: flex; gap: 4px; margin-top: 12px; }
.profile-progress-bar span { flex: 1; height: 8px; background: var(--smoke); }
.profile-progress-bar span.is-done { background: var(--success); }
.profile-checklist { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.profile-checklist li { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: var(--weight-medium); }
.profile-checklist li svg { flex: none; padding: 3px; box-sizing: content-box; width: 18px; height: 18px; background: var(--blue-baby); color: var(--blue-dark); }
.profile-checklist li.is-done { color: var(--text-muted); font-weight: var(--weight-regular); }
.profile-checklist li.is-done svg { background: var(--success-bg); color: var(--success); }
.profile-progress p { margin: 12px 0 0; }

/* Admin: interne Notiz zu einem Foodtruck */
.admin-note-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.admin-note-form textarea { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--line); background: #FFFBEA; font: var(--weight-regular) var(--fs-body-sm) / 1.45 var(--font-core); }

/* Admin: Bilder eines Foodtrucks mit Ablehnen/Löschen */
.admin-media-list { display: flex; flex-direction: column; gap: 10px; }
.admin-media-item { display: flex; gap: 14px; padding: 12px; background: var(--white); border: 1px solid var(--line-subtle); }
.admin-media-thumb { flex: none; width: 96px; height: 96px; background: var(--cloud); overflow: hidden; }
.admin-media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-media-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; font: var(--weight-regular) var(--fs-body-sm) / 1.3 var(--font-core); }
.admin-media-actions summary { cursor: pointer; margin-top: 6px; color: var(--text-link); font-weight: var(--weight-medium); }
.admin-media-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 8px; }
.admin-upload-btn { padding: 10px 16px; min-height: 0; cursor: pointer; font-size: var(--fs-body-sm); }
.admin-upload-btn input[type="file"] { display: none; }
.admin-reject-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.admin-reject-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); font: inherit; }

/* Admin: Karte mit Foodtruck-Standorten und Radien */
.admin-map-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.admin-map-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-chip {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); background: var(--white);
  font: var(--weight-medium) var(--fs-body-sm) / 1 var(--font-core); color: var(--text-secondary);
}
.admin-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.admin-chip:focus-visible { box-shadow: var(--focus-ring); }
.admin-map-fields { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font: var(--weight-regular) var(--fs-body-sm) / 1.3 var(--font-core); color: var(--text-secondary); }
.admin-map-field input[type="number"] { width: 92px; margin-left: 6px; padding: 8px 10px; border: 1px solid var(--line); background: var(--white); font: inherit; color: var(--ink); }
.admin-map-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.admin-map-count { margin: 0; font: var(--weight-medium) var(--fs-body-sm) / 1.3 var(--font-core); color: var(--ink); }
#admin-map { width: 100%; height: 68vh; min-height: 380px; border: 1px solid var(--line); isolation: isolate; }
.admin-map-note { margin: 12px 0 0; max-width: 760px; font: var(--weight-regular) var(--fs-caption) / 1.45 var(--font-core); color: var(--text-muted); }

/* ---- Admin-Bereich (foodtruck-portal-spec.md §1) ---- */
.admin-nav {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; padding: 8px 16px;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.admin-nav-link {
  flex: none; padding: 8px 14px; text-decoration: none; white-space: nowrap;
  font: var(--weight-medium) var(--fs-body-sm) / 1 var(--font-core); color: var(--text-muted);
}
.admin-nav-link.is-active { color: var(--ink); background: var(--cloud); }
.admin-table { width: 100%; border-collapse: collapse; font: var(--weight-regular) var(--fs-body-sm) / 1.3 var(--font-core); }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-subtle); text-align: left; white-space: nowrap; }
.admin-table th { color: var(--text-muted); font-weight: var(--weight-medium); }
.admin-table-wrap { width: 100%; overflow-x: auto; background: var(--white); border: 1px solid var(--line); }
.admin-table tr.is-buyers-row td { white-space: normal; background: var(--n-025); }
.admin-expand-btn { all: unset; cursor: pointer; display: inline-flex; color: var(--graphite); }
.admin-expand-btn[aria-expanded="true"] { transform: rotate(90deg); }

.admin-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 24px; }
.admin-filter .field { width: auto; min-width: 160px; }

.admin-stats { display: flex; flex-wrap: wrap; gap: 16px; }
.admin-stat { flex: 1 1 200px; background: var(--white); border: 1px solid var(--line); padding: 20px; }
.admin-stat-label { display: block; font: var(--weight-regular) var(--fs-caption) / 1.2 var(--font-core); color: var(--text-muted); }
.admin-stat-value { display: block; margin-top: 8px; font: var(--weight-medium) var(--fs-h2) / 1 var(--font-core); font-variant-numeric: tabular-nums; }

/* Inline-SMS-Bestätigung bei geänderter Handynummer (Infos bearbeiten) */
.phone-verify-box { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.phone-verify-code { display: flex; gap: 8px; width: 100%; max-width: 360px; }
.phone-verify-code .sms-code-input { flex: 1; min-width: 0; }
.field input.sms-code-input { box-sizing: border-box; width: 100%; height: 60px; padding: 0 0 0 .5em; background: var(--white); border: 1px solid var(--line); text-align: center; letter-spacing: .5em; font: var(--weight-medium) var(--fs-h2) / 1 var(--font-core); font-variant-numeric: tabular-nums; }
.field input.sms-code-input:focus { border-color: var(--ink); box-shadow: var(--focus-ring); }
.phone-verify-box[hidden], .phone-verify-code[hidden] { display: none; }

/* Aktionsleiste unter einem Galerie-Bild (Bilder bearbeiten) */
.image-slot-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.image-slot-actions .btn { padding: 10px 14px; min-height: 0; }
.image-slot-actions .btn-danger-text { margin-left: auto; }
.btn-danger-text, .btn-danger-text:hover { color: var(--danger); }

/* Logo-Ausschnitt wählen (Profil, siehe portal/includes/views/home.php) */
.crop-sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(23, 23, 23, .55); }
.crop-sheet[hidden] { display: none; }
.crop-sheet-inner { width: 100%; max-width: 360px; padding: 24px 20px; background: var(--white); text-align: center; }
.crop-sheet-inner h2 { margin: 0 0 8px; font: var(--weight-medium) var(--fs-h4) / 1.2 var(--font-core); }
.crop-sheet-inner p { margin: 0 0 16px; font: var(--weight-regular) var(--fs-body-sm) / 1.45 var(--font-core); color: var(--text-secondary); }
.crop-tile { width: 260px; max-width: 100%; aspect-ratio: 1 / 1; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); background: var(--cloud); touch-action: none; cursor: grab; }
.crop-tile img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.crop-actions { margin-top: 20px; display: flex; gap: 12px; }
.crop-actions .btn { flex: 1; padding-left: 12px; padding-right: 12px; }

/* Hinweis oben im Profil: Logo/Fotos fehlen noch (portal/includes/views/home.php) */
.profile-hint { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; padding: 16px; text-align: left; }
.profile-hint > svg { flex: none; margin-top: 2px; }
.profile-hint strong { font-weight: var(--weight-medium); }
.profile-hint p { margin: 4px 0 8px; font: var(--weight-regular) var(--fs-body-sm) / 1.45 var(--font-core); }
.profile-hint ul { margin: 0; padding-left: 18px; font: var(--weight-regular) var(--fs-body-sm) / 1.5 var(--font-core); }
.profile-hint a { color: inherit; text-decoration: underline; }
