/*
 * Foodchucks Partner-Portal — Design-Tokens & Basis-Komponenten (M9).
 *
 * Farbpalette bewusst von der Foodchucks-Consumer-App abgeleitet, aber mit
 * umgedrehter Gewichtung: Waldgrün ist hier die Führungsfarbe (Business-
 * Kontext), Orange bleibt Akzent für CTAs/aktive Zustände — in der
 * Consumer-App ist es umgekehrt. Details siehe docs/deployment.md-Nachbar
 * README "Meilensteinplan" M9.
 *
 * Headline-Font (Manrope) ist selbst gehostet (../assets/fonts), nicht über
 * Google Fonts CDN geladen — bewusste Entscheidung, siehe M9-Plan.
 */

@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/Manrope-Variable.woff2") format("woff2-variations"),
       url("../assets/fonts/Manrope-Variable.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Marken-Palette */
  --color-primary: #1b4332;
  --color-primary-dark: #143325;
  --color-primary-tint: rgba(27, 67, 50, 0.08);
  --color-accent: #e85d04;
  --color-accent-hover: #f48c06;
  --color-accent-tint: rgba(232, 93, 4, 0.12);

  /* Status-Farben */
  --color-success: #00694a;
  --color-success-tint: rgba(0, 168, 120, 0.14);
  --color-warning: #9c6a12;
  --color-warning-tint: rgba(221, 162, 58, 0.2);
  --color-danger: #a3352b;
  --color-danger-tint: rgba(163, 53, 43, 0.12);

  /* Neutrale Töne */
  --color-bg: #fffdfa;
  --color-surface: #ffffff;
  --color-surface-muted: #f4f2ee;
  --color-highlight: #fff8f0;
  --color-border: #e5e5e5;
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-text-on-primary: #ffffff;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1);
  --content-width: 720px;
  --content-width-narrow: 560px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-headline: "Manrope", var(--font-body);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

h1,
h2,
h3 {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 {
  font-size: 1.85rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Seiten-Gerüst */

.site-header {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-header .account-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
}

.site-header .account-nav a,
.site-header .account-nav .link-button {
  color: var(--color-text-on-primary);
}

.site-header .account-nav a:hover,
.site-header .account-nav .link-button:hover {
  opacity: 0.9;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.site-header a.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-on-primary);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.05rem;
}

.site-header a.brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.site-header img.brand-icon {
  display: block;
  border-radius: 8px;
}

.page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

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

.site-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.site-footer a {
  color: var(--color-text-muted);
}

.site-footer a:hover {
  color: var(--color-accent);
}

/* Karten */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 20px;
}

.card + .card {
  margin-top: 20px;
}

/* Reusable notice/callout — neutral by default, --success/--warning modifiers reuse existing status tokens. */
.info-box {
  background: var(--color-highlight);
  border-left: 3px solid var(--color-accent);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1em;
}

.info-box--success {
  background: var(--color-success-tint);
  border-left-color: var(--color-success);
}

.info-box--warning {
  background: var(--color-warning-tint);
  border-left-color: var(--color-warning);
}

/* session-watchdog.js: fix positioniert statt inline, da die Sitzung
   unabhängig vom Scroll-Zustand der Seite ablaufen kann. */
.session-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-warning-tint);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  max-width: calc(100vw - 40px);
}

/* form-autosave.js: Wiederherstellen/Verwerfen-Aktionen im Entwurfs-Hinweis. */
.autosave-banner .link-button {
  font-weight: 600;
}

/* Buttons */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 22px;
  cursor: pointer;
  background: var(--color-accent);
  color: #fff;
}

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

.btn:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

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

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

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

.btn-outline:hover {
  background: var(--color-primary-tint);
  text-decoration: none;
}

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

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

/* Fuer Tabellenzeilen-Aktionen mit Folgen (Nutzer sperren, Ausnahme
 * loeschen) -- deutlicher als .btn-outline, aber weniger laut als das
 * volltonige .btn-danger, das fuer einzelne Zeilen-Buttons zu viel
 * Gewicht haette. Eingefuehrt beim UX-Review 2026-10-02: vorher waren
 * diese Aktionen nackte .link-button-Text-Links, visuell nicht von
 * harmlosen Links wie "Abmelden" unterscheidbar. */
.btn-outline-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.btn-outline-danger:hover {
  background: var(--color-danger-tint);
  text-decoration: none;
}

/* Kompakte Variante fuer Tabellenzeilen-Aktionen, kombiniert mit .btn/
 * .btn-outline/.btn-outline-danger (z. B. class="btn btn-outline btn-sm"). */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Formulare */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

.field textarea {
  resize: vertical;
  min-height: 4.5em;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.field-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.field-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.field-checkbox input {
  margin-top: 4px;
}

.form-error {
  color: var(--color-danger);
  font-size: 0.9rem;
  margin-top: 4px;
}

.subsection-heading {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

/* Ausklappbare Standort-Abschnitte (Reservierungen/Kampagne) — natives
 * <details>/<summary>, kein JS noetig. Eingefuehrt beim UX-Review
 * 2026-10-02: vorher trug jede Standort-Karte alles (Ort-Verknuepfung +
 * komplettes Buchungsmanagement + Kampagne) ungegliedert hintereinander. */

.disclosure {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: 16px;
  overflow: hidden;
}

.disclosure > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  min-height: 44px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  background: var(--color-surface-muted);
}

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

.disclosure > summary::before {
  content: "▸";
  display: inline-block;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.disclosure[open] > summary::before {
  transform: rotate(90deg);
}

.disclosure[open] > summary {
  border-bottom: 1px solid var(--color-border);
}

.disclosure-body {
  padding: 18px;
}

/* Standort-Schnellnavigation -- nur gerendert wenn mehr als ein
 * Standort existiert (siehe dashboard.html), deshalb bewusst leichtgewichtig:
 * reine Anker-Links, kein Sticky-Verhalten, kein JS. */

.location-quicknav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.location-quicknav a {
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.9rem;
}

.location-quicknav a:hover {
  background: var(--color-primary-tint);
  text-decoration: none;
}

/* Paket-Vergleich -- nebeneinander statt einer Button-Liste, siehe
 * UX-Review 2026-10-02. */

.package-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.package-card {
  flex: 1 1 220px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Datenbasiert, nicht generisch -- siehe dashboard.html: nur gesetzt wenn
 * der Partner tatsächlich schon mehrere Standorte hat. Kein erfundenes
 * "Beliebtestes Paket"-Label ohne Grundlage. */
.package-card--recommended {
  border-color: var(--color-accent);
  border-width: 2px;
  padding: 19px;
}

.package-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.package-card h4 {
  margin: 0;
}

.package-price {
  font-family: var(--font-headline);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0 10px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  font-size: 0.9rem;
}

.feature-list li {
  padding-left: 1.4em;
  text-indent: -1.4em;
  margin-bottom: 6px;
}

.feature-list li::before {
  content: "✓ ";
  color: var(--color-success);
  font-weight: 700;
}

.package-highlight {
  background: var(--color-accent-tint);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* Ehrlich markieren, was bei diesem Paket NICHT dabei ist (z. B. Bronze
 * ohne Kachel-CTA) -- gedaempft statt rot/alarmierend, es ist eine
 * Paket-Grenze, kein Fehler. Siehe PackageOption.hasCta/ctaInfo. */
.feature-missing {
  color: var(--color-text-muted);
}

.package-card form {
  margin-top: auto;
}

.package-card .btn {
  width: 100%;
  text-align: center;
}

/* Status-Pills */

.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 4px 10px;
  border-radius: 999px;
}

.pill-success {
  background: var(--color-success-tint);
  color: var(--color-success);
}

.pill-warning {
  background: var(--color-warning-tint);
  color: var(--color-warning);
}

.pill-danger {
  background: var(--color-danger-tint);
  color: var(--color-danger);
}

.pill-neutral {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

/* Icon-Badges */

.icon-badge {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-badge svg {
  width: 18px;
  height: 18px;
}

.icon-badge-orange {
  background: var(--color-accent-tint);
  color: #a03e00;
}

.icon-badge-jade {
  background: var(--color-success-tint);
  color: var(--color-success);
}

.icon-badge-gold {
  background: var(--color-warning-tint);
  color: var(--color-warning);
}

/* Tabellen (Admin) */

/* Gefunden 2026-10-05: die Wochentemplate-Tabelle (7 Spalten, 4 davon
   feste Zeit-/Zahlen-Inputs) ist breiter als ihre Karte (--content-width:
   720px) -- ohne diesen Wrapper durchbricht sie den Kartenrand sichtbar
   statt sauber zu scrollen. table.data-table selbst kann width:100% nicht
   erzwingen, wenn der Inhalt (feste Input-Breiten) das verhindert. */
.table-scroll {
  overflow-x: auto;
}

/* table.data-table unten erzwingt width:100% -- innerhalb von .table-scroll
   genau das Gegenteil von dem, was hier gebraucht wird: eine Tabelle, die
   fest auf 100% ihres Wrappers gepinnt ist, kann diesen per Definition nie
   überragen, also scrollt der Wrapper nie -- stattdessen quetschen sich die
   Zellen intern zusammen (Gefunden 2026-10-10 beim Responsive-Check: bei
   390px maß der Wrapper fälschlich "kein Overflow", während Zeiteingaben
   sichtbar unleserlich abgeschnitten waren). min-width statt width lässt
   die Tabelle wie gewünscht weiterhin die volle Breite ausfüllen, wenn der
   Inhalt hineinpasst, aber bei Bedarf darüber hinauswachsen und den Wrapper
   dann tatsächlich scrollen lassen. */
.table-scroll table.data-table {
  width: auto;
  min-width: 100%;
}

/* Gefunden 2026-10-10 beim Responsive-Check: input[type="time"] hat anders
   als input[type="number"] (fixe style="width: 80px") keine deklarierte
   Breite -- unter Tabellen-Auto-Layout-Druck bei sehr schmalen Viewports
   quetscht der Browser es dann unter die eigentliche Tabellen-Mindestbreite
   zusammen (unleserlich, "--:" statt "--:-- --") statt die Tabelle ihre
   natürliche Breite behalten und sauber im .table-scroll scrollen zu
   lassen -- obwohl .table-scroll selbst korrekt scrollt (scrollWidth ==
   clientWidth maß vorher fälschlich "kein Overflow", weil der Inhalt
   tatsächlich mitgeschrumpft war, nicht übergelaufen). Mindestbreite
   erzwingt dasselbe "lieber scrollen als zusammenquetschen"-Verhalten wie
   bei den Zahlen-Inputs. */
table.data-table input[type="time"] {
  min-width: 110px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

table.data-table th,
table.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

table.data-table th {
  background: var(--color-surface-muted);
  font-weight: 700;
  font-size: 0.85rem;
}

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

/* Wohlfühl-Moment: Maskottchen */

.mascot-moment {
  text-align: center;
  margin: 8px 0 28px;
}

.mascot-moment img {
  max-width: 180px;
  height: auto;
}

.mascot-moment p {
  margin-top: 10px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Rechtliche Seiten: ruhige Prosa-Optik */

.legal-page {
  max-width: var(--content-width-narrow);
}

.legal-page h2 {
  margin-top: 32px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}

/* Standort-Karte (Leaflet) */

.location-picker-map {
  height: 320px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid var(--color-border);
}

.location-picker-map.field-error-outline {
  border-color: var(--color-danger);
}

/* Mobile */

@media (max-width: 480px) {
  .page {
    padding: 28px 16px 60px;
  }

  .card {
    padding: 18px;
  }
}
