/* ==========================================================================
   PA-Zone · Design-System 2.0
   Dunkles, modernes Interface (Linear/Vercel-Anmutung) mit PA-Zone-Brand
   Violett/Magenta. Mobile first, ein System für Website + Mitarbeiterbereich.
   ========================================================================== */

:root {
  /* Flächen */
  --bg:            #0a0812;
  --bg-deep:       #07060d;
  --panel:         #110e1c;
  --surface:       #17131f;
  --surface-2:     #1f1a2b;
  --line:          rgba(255, 255, 255, .08);
  --line-soft:     rgba(255, 255, 255, .05);

  /* Text */
  --text:          #f6f5fa;
  --text-2:        #c9c4d6;
  --muted:         #9a93ac;
  --faint:         #6d6680;

  /* Brand */
  --brand:         #a855f7;
  --brand-strong:  #c084fc;
  --brand-deep:    #7c3aed;
  --magenta:       #e879f9;
  --grad:          linear-gradient(120deg, #7c3aed 0%, #a855f7 45%, #e879f9 100%);
  --grad-soft:     linear-gradient(140deg, rgba(124,58,237,.22), rgba(232,121,249,.10));

  /* Status */
  --ok:            #34d399;
  --warn:          #fbbf24;
  --danger:        #fb7185;
  --info:          #60a5fa;

  /* Form */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --pill: 999px;

  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .85);
  --glow:   0 0 0 1px rgba(168, 85, 247, .35), 0 12px 40px -12px rgba(168, 85, 247, .45);
  --container: 1180px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.011em;
  font-feature-settings: 'cv01', 'ss03';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {  /* dezenter Brand-Schein oben */
  content: '';
  position: fixed;
  inset: -20% 0 auto 0;
  height: 60vh;
  background: radial-gradient(60% 60% at 50% 0%, rgba(124, 58, 237, .28), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; }

a { color: var(--brand-strong); text-decoration: none; }
a:hover { color: var(--magenta); }

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; line-height: 1.1; letter-spacing: -.032em; }
h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: 1.25rem; letter-spacing: -.02em; }
p  { margin: 0 0 1rem; color: var(--text-2); }

.mono { font-family: var(--mono); font-size: .85rem; letter-spacing: 0; }

/* ---------------------------------------------------------------- Layout */

.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; position: relative; z-index: 1; }
.wrap-narrow { max-width: 760px; }
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section-sm { padding: clamp(32px, 5vw, 56px) 0; }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.75rem; } .mt-4 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.75rem; }
.hide { display: none !important; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand-strong);
  margin-bottom: .9rem;
}
.lead { font-size: 1.1rem; color: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------------------------------------------------------------- Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 8, 18, .78);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -.02em; }
.brand img { height: 30px; width: auto; max-width: 190px; object-fit: contain; }
.brand span { font-size: 1.05rem; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 9px 14px;
  border-radius: var(--pill);
  color: var(--text-2);
  font-size: .94rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.nav a.active { color: var(--text); background: rgba(168, 85, 247, .16); }

.burger {
  margin-left: auto;
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .burger { display: block; }
  .nav {
    position: absolute;
    top: 68px; left: 12px; right: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: rgba(17, 14, 28, .98);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

/* ---------------------------------------------------------------- Hero */

.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 5vw, 56px); }
.hero-logo { max-width: min(680px, 92%); margin: 0 auto 1.5rem; }
.hero h1 { margin-bottom: .6rem; }
.hero .lead { max-width: 62ch; margin-inline: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 2rem; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 1.5rem; }
.badge {
  font-size: .78rem;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  color: var(--text-2);
  background: rgba(255, 255, 255, .03);
}
.badge.brand { border-color: rgba(168, 85, 247, .4); color: var(--brand-strong); background: rgba(168, 85, 247, .1); }

/* ---------------------------------------------------------------- Karten */

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card-tight { padding: 16px; }
.card h3 { margin-bottom: .35rem; }
.card p:last-child { margin-bottom: 0; }
.card-hover { transition: transform .2s, border-color .2s, box-shadow .2s; }
.card-hover:hover { transform: translateY(-3px); border-color: rgba(168, 85, 247, .45); box-shadow: var(--glow); }

.card-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--grad-soft);
  border: 1px solid rgba(168, 85, 247, .3);
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.glass {
  background: rgba(17, 14, 28, .72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s, color .15s;
}
.btn:hover { background: rgba(255, 255, 255, .09); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -12px rgba(168, 85, 247, .8); }
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(251, 113, 133, .45); color: #ffd7dd; background: rgba(251, 113, 133, .12); }
.btn-danger:hover { background: rgba(251, 113, 133, .22); }
.btn-ok { border-color: rgba(52, 211, 153, .45); color: #d6fff0; background: rgba(52, 211, 153, .12); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }

/* ---------------------------------------------------------------- Formulare */

.field { margin-bottom: 16px; }
.label { display: block; font-size: .85rem; font-weight: 500; color: var(--text-2); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgba(168, 85, 247, .7);
  background: rgba(255, 255, 255, .05);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .18);
}
.textarea { min-height: 120px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.select option { background: var(--panel); color: var(--text); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--text-2); }
.check input { margin-top: 4px; accent-color: var(--brand); width: 17px; height: 17px; }
.hint { font-size: .8rem; color: var(--faint); margin-top: 6px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------------------------------------------------------------- Meldungen */

.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  font-size: .92rem;
  margin-bottom: 14px;
}
.alert-success { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); color: #cffbec; }
.alert-warning { border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1); color: #ffeec4; }
.alert-danger  { border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .1); color: #ffd9df; }
.alert-info    { border-color: rgba(96, 165, 250, .4); background: rgba(96, 165, 250, .1); color: #d8e8ff; }
.alert p:last-child { margin-bottom: 0; }

.toast-host { position: fixed; top: 16px; right: 16px; z-index: 9999; display: grid; gap: 10px; max-width: min(360px, 92vw); }
.toast {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(23, 19, 31, .97);
  box-shadow: var(--shadow);
  font-size: .9rem;
  animation: toast-in .22s ease-out;
}
.toast.ok { border-color: rgba(52, 211, 153, .45); }
.toast.err { border-color: rgba(251, 113, 133, .45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Tabellen */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
table.data th { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; background: rgba(255, 255, 255, .02); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: rgba(255, 255, 255, .02); }

.tag { display: inline-block; padding: 3px 10px; border-radius: var(--pill); font-size: .75rem; font-weight: 500; border: 1px solid var(--line); }
.tag.ok { border-color: rgba(52, 211, 153, .45); color: #a7f3d0; background: rgba(52, 211, 153, .1); }
.tag.busy { border-color: rgba(168, 85, 247, .5); color: #e9d5ff; background: rgba(168, 85, 247, .14); }
.tag.blocked { border-color: rgba(251, 113, 133, .5); color: #ffd9df; background: rgba(251, 113, 133, .12); }
.tag.held { border-color: rgba(251, 191, 36, .5); color: #ffeec4; background: rgba(251, 191, 36, .12); }
.tag.neutral { color: var(--muted); }

/* ---------------------------------------------------------------- Kalender */

.cal-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; text-transform: capitalize; }
.cal-nav { display: flex; gap: 8px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-weekdays div { text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.cal-day {
  position: relative;
  min-height: 84px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .02);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, background .15s, transform .12s;
  overflow: hidden;
}
.cal-day:hover { background: rgba(255, 255, 255, .06); border-color: rgba(168, 85, 247, .5); }
.cal-day.is-empty { background: transparent; border-color: transparent; cursor: default; pointer-events: none; }
.cal-day .d-num { font-weight: 600; font-size: .95rem; color: var(--text); }
.cal-day .d-info { display: block; margin-top: 6px; font-size: .72rem; color: var(--muted); line-height: 1.3; }
.cal-day.today { border-color: var(--brand-strong); box-shadow: inset 0 0 0 1px rgba(192, 132, 252, .5); }
.cal-day.selected { border-color: var(--magenta); background: rgba(232, 121, 249, .12); }
.cal-day.busy { background: rgba(168, 85, 247, .16); border-color: rgba(168, 85, 247, .45); }
.cal-day.blocked { background: rgba(251, 113, 133, .14); border-color: rgba(251, 113, 133, .45); }
.cal-day.held { background: rgba(251, 191, 36, .13); border-color: rgba(251, 191, 36, .42); }
.cal-day .d-pill { display: inline-block; margin-top: 6px; padding: 1px 8px; border-radius: var(--pill); font-size: .68rem; background: rgba(0, 0, 0, .35); color: var(--text); }

/* Alle Arten eines Tages als eigene Farbe (mehrere Termine = mehrere Streifen) */
.cal-day .d-farben { display: flex; gap: 3px; margin-top: 5px; }
.cal-day .d-farbe { display: block; width: 15px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .2); }
.cal-day .d-farbe:nth-child(n+5) { display: none; }
.d-farbe.f-termin { background: #fbbf24; }
.d-farbe.f-kunde { background: #a855f7; }
.d-farbe.f-verleih { background: #2dd4bf; }
.d-farbe.f-blocker { background: #fb7185; }
.cal-day.hat-verleih { border-color: rgba(45, 212, 191, .55); }
.cal-day.hat-verleih:hover { border-color: #2dd4bf; background: rgba(45, 212, 191, .1); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.free { background: rgba(255, 255, 255, .18); }
.dot.busy { background: #a855f7; }
.dot.blocked { background: #fb7185; }
.dot.held { background: #fbbf24; }
.dot.verleih { background: #2dd4bf; }

/* Tages-Panel */
.day-panel { margin-top: 22px; }
.entry { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.entry + .entry { margin-top: 12px; }
.entry-main { min-width: 200px; }
.entry-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 700px) {
  .cal-day { min-height: 62px; padding: 6px; }
  .cal-day .d-info, .cal-day .d-pill { display: none; }
  .cal-weekdays div { font-size: .62rem; letter-spacing: .04em; }
}

/* ---------------------------------------------------------------- Bereich */

.bereich-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.bereich-side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.bereich-side .brand { margin-bottom: 18px; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: .93rem;
  font-weight: 500;
}
.side-link:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.side-link.active { background: rgba(168, 85, 247, .16); color: var(--text); border: 1px solid rgba(168, 85, 247, .3); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 14px; font-size: .84rem; color: var(--muted); }
.bereich-main { padding: 26px clamp(16px, 3vw, 38px) 60px; }
.bereich-top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.bereich-top h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }

.stat { background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat .n { font-size: 1.7rem; font-weight: 600; letter-spacing: -.03em; }
.stat .l { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 54px; height: 30px; border-radius: var(--pill); background: rgba(255, 255, 255, .12); border: 1px solid var(--line); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch input:checked + .track { background: var(--grad); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(24px); }

@media (max-width: 900px) {
  .bereich-shell { grid-template-columns: minmax(0, 1fr); }
  .bereich-main { min-width: 0; }
  .bereich-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; align-items: center; }
  .bereich-side .brand { margin: 0 12px 0 0; }
  .side-link { white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; white-space: nowrap; }
  .bereich-main { padding: 20px 14px 48px; }
}

/* ---------------------------------------------------------------- Footer */

.site-footer { border-top: 1px solid var(--line-soft); padding: 40px 0 32px; margin-top: 40px; position: relative; z-index: 1; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: .9rem; }

/* ---------------------------------------------------------------- Login / Wartung */

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card .brand { justify-content: center; margin-bottom: 20px; }
.auth-card .brand img { height: 42px; max-width: 100%; }

/* -------------------------------------------------- Angebotsbilder und Aufbaupläne */

/* Kartenbild: gleiches Format für alle drei Angebote, damit nichts verzerrt. */
.paket-bild {
  width: 100%;
  height: auto;          /* überschreibt die Höhenangabe im Bild-Tag */
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  display: block;
}

/* Aufbaupläne: helle Strichzeichnung, deshalb invertiert und eingepasst. */
.aufbau-karte {
  margin: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.aufbau-karte img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: var(--r);
  filter: invert(1) hue-rotate(180deg) saturate(.6);
  opacity: .92;
}
.aufbau-karte figcaption { margin-top: auto; padding-top: .75rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}


/* ---------------------------------------------------------- Termine */

.form-grid .form-wide { grid-column: 1 / -1; }

fieldset[data-teilnehmer] {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 10px 12px 12px;
  margin: 0;
}
fieldset[data-teilnehmer] legend {
  padding: 0 6px;
  color: var(--muted, #9aa0a6);
  font-size: 13px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.chip:hover { border-color: rgba(255, 255, 255, .35); }
.chip input { margin: 0; }

.day-panel-inner { padding: 16px; }
.day-panel .entry .dot { margin-right: 4px; }

/* Termin-Kalender: Teilnehmer am Tag und einklappbares Eingabefeld */
.cal-day .d-wer { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.cal-day .d-p {
  font-size: 10px;
  line-height: 1.3;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  white-space: nowrap;
}
.cal-day .d-p.zugesagt { background: rgba(52, 199, 89, .22); }
.cal-day .d-p.offen    { background: rgba(255, 179, 0, .22); }
.cal-day .d-p.abgesagt { background: rgba(255, 69, 58, .22); }
.cal-day .d-p.mehr     { background: transparent; }

details.neu-klappe {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}
details.neu-klappe > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
details.neu-klappe > summary::-webkit-details-marker { display: none; }
details.neu-klappe > summary::before { content: '+ '; }
details.neu-klappe[open] > summary::before { content: '– '; }
.neu-klappe-inhalt { padding-top: 12px; }

/* ==========================================================================
   Handy & installierte Web-App
   Die Seitenleiste wird zum ausfahrbaren Menü, alles bekommt Fingergröße,
   und oben sitzt eine feste Leiste statt der seitlich scrollenden Reiter.
   ========================================================================== */

/* Die feste Leiste gibt es nur auf kleinen Geräten */
.m-bar { display: none; }
.menue-schleier { display: none; }
.menue-schliessen { display: none; }

/* Menü-Eintrag als Knopf (Benachrichtigungen) – Basisform für alle Größen */
.side-knopf {
  width: 100%;
  font: inherit;
  font-size: .93rem;
  font-weight: 500;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}
/* Eigene display-Regeln dürfen das hidden-Attribut nicht aushebeln */
.bereich-side [hidden] { display: none !important; }

@media (max-width: 980px) {
  /* -------- Kopfzeile -------- */
  .m-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 9300;
    margin: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
    min-height: calc(env(safe-area-inset-top, 0px) + 54px);
    background: rgba(10, 8, 18, .92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
  }
  .m-brand { display: flex; align-items: center; margin-right: auto; }
  .m-brand img { height: 26px; width: auto; max-width: 150px; object-fit: contain; }
  .m-burger {
    width: 44px;
    height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    cursor: pointer;
  }
  .m-burger:active { background: rgba(255, 255, 255, .1); }
  .m-burger svg { width: 22px; height: 22px; }

  /* -------- Seite = ganze Breite, Menü liegt darüber -------- */
  .bereich-shell { display: block; }
  .bereich-main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }

  .menue-schleier {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9400;
    background: rgba(4, 3, 8, .6);
  }
  .menue-schleier[hidden] { display: none; }

  .bereich-side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 310px);
    z-index: 9500;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 14px calc(env(safe-area-inset-bottom, 0px) + 20px);
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-102%);
    transition: transform .22s ease;
    will-change: transform;
  }
  .bereich-shell.menue-offen .bereich-side {
    transform: none;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .9);
  }
  .bereich-side .brand { margin: 0 0 14px; }
  .menue-schliessen {
    display: block;
    align-self: flex-end;
    width: 38px;
    height: 38px;
    margin-bottom: 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .04);
    color: var(--text-2);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  .side-link {
    white-space: normal;
    min-height: 46px;
    padding: 12px 12px;
    font-size: 1rem;
  }
  .side-knopf { font-size: 1rem; }
  .side-foot {
    margin: 18px 0 0;
    border-top: 1px solid var(--line-soft);
    padding-top: 14px;
    white-space: normal;
    font-size: .9rem;
  }

  /* -------- Fingergröße -------- */
  .btn { min-height: 46px; padding: 12px 18px; }
  .btn-sm { min-height: 40px; padding: 9px 14px; font-size: .9rem; }
  .input, .select, .textarea { min-height: 46px; font-size: 16px; }
  .textarea { min-height: 110px; }
  .check input { width: 22px; height: 22px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; }
  .switch input { display: none; }
  .chip { min-height: 40px; padding: 8px 13px; }
  .select { padding-right: 40px; }
  .side-link .small, .side-foot .small { font-size: .85rem; }

  /* Kleine Symbol-Knöpfe (×, löschen) antippbar machen */
  .chat-chip-weg, .chat-vorschau-weg, .artikel-chip-weg, .lager-foto-weg,
  .foto-weg, .weg-knopf, button[data-weg] {
    min-width: 30px;
    min-height: 30px;
  }
  .toast-host { top: calc(env(safe-area-inset-top, 0px) + 62px); right: 10px; left: 10px; max-width: none; }

  /* Kästchen-Zeilen als ganze Fläche antippbar */
  .check { min-height: 44px; align-items: center; padding: 4px 0; }
  .check input { margin-top: 0; flex: none; }

  /* -------- Tabellen und Karten -------- */
  .table-wrap { -webkit-overflow-scrolling: touch; border-radius: var(--r-sm); }
  table.data { min-width: 460px; }
  table.data th, table.data td { padding: 10px 12px; }
  .card, .glass { padding: 16px; }
  .bereich-top { margin-bottom: 16px; gap: 8px; }
  .bereich-top h1 { font-size: 1.45rem; }
  .grid { gap: 14px; }

  /* Der Kalender darf die Breite voll ausnutzen */
  .cal-day { padding: 5px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
}

/* Sehr kleine Geräte (iPhone SE) */
@media (max-width: 400px) {
  .bereich-main { padding-left: 11px; padding-right: 11px; }
  .m-brand img { height: 22px; }
  .cal-weekdays div { font-size: .6rem; letter-spacing: 0; }
  .cal-day .d-num { font-size: .85rem; }
}

/* Beim ausgefahrenen Menü darf die Seite dahinter nicht mitscrollen */
body.menue-offen { overflow: hidden; }
