:root {
  --pp-primary: #9dcc2e;
  --pp-primary-hover: #b5e63d;
  --pp-primary-text: #0a0a0a;
  --pp-accent: #00aeef;
  --pp-bg: #000000;
  --pp-bg-card: #141414;
  --pp-text: #f1f5f9;
  --pp-text-muted: #94a3b8;
  --pp-border: #2e2e2e;
  --pp-error-bg: #3f1d1d;
  --pp-error-text: #fecaca;
  --pp-focus: #9dcc2e;
  --pp-content-padding-x: clamp(1rem, 2vw, 2rem);
  --pp-content-padding-y: clamp(1rem, 2vw, 1.75rem);
  --pp-auth-card-max: 28rem;
  --pp-landing-max: 48rem;
  /* Inhaltsbreite: mobil/tablet volle Breite, ab Full HD schmaler, WQHD Maximum */
  --pp-layout-max: 100%;
}

/* Tablet / kleines Desktop */
@media (min-width: 1024px) {
  :root { --pp-layout-max: min(100%, 56rem); }   /* ~896px */
}

@media (min-width: 1280px) {
  :root { --pp-layout-max: min(100%, 68rem); }   /* ~1088px — Full-HD-nah */
}

@media (min-width: 1536px) {
  :root { --pp-layout-max: min(100%, 78rem); }   /* ~1248px */
}

@media (min-width: 1920px) {
  :root { --pp-layout-max: min(100%, 88rem); }   /* ~1408px — Full HD */
}

@media (min-width: 2560px) {
  :root { --pp-layout-max: min(100%, 100rem); }  /* ~1600px — WQHD Maximum */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", sans-serif;
  background: var(--pp-bg);
  color: var(--pp-text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--pp-primary); text-decoration: underline; }
a:hover { color: var(--pp-primary-hover); }

.pp-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.pp-skip-link:focus {
  position: fixed;
  left: 0.5rem;
  top: 0.5rem;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.5rem 1rem;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  z-index: 1000;
  background: var(--pp-primary);
  color: var(--pp-primary-text);
  border-radius: 6px;
  text-decoration: none;
}

.pp-main {
  width: 100%;
  max-width: var(--pp-layout-max);
  margin-left: auto;
  margin-right: auto;
  padding: var(--pp-content-padding-y) var(--pp-content-padding-x);
}

.pp-main-landing {
  max-width: var(--pp-landing-max);
  margin-left: auto;
  margin-right: auto;
  padding: 2rem var(--pp-content-padding-x) 1rem;
}

.pp-header {
  background: var(--pp-bg-card);
  border-bottom: 1px solid var(--pp-border);
  padding: 0.75rem 0;
}

.pp-header-inner {
  width: 100%;
  max-width: var(--pp-layout-max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--pp-content-padding-x);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pp-header-brand { display: inline-block; text-decoration: none; flex-shrink: 0; }
.pp-header-logo { display: block; height: 36px; width: auto; }

.pp-top-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem 1.25rem;
  min-width: 0;
}

.pp-top-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--pp-text);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
}

.pp-top-nav a:hover {
  color: var(--pp-primary);
  background: rgba(157, 204, 46, 0.1);
}

.pp-top-nav a:focus-visible {
  outline: 2px solid var(--pp-focus);
  outline-offset: 2px;
}

.pp-top-nav a.is-active {
  color: var(--pp-primary);
  background: rgba(157, 204, 46, 0.12);
}

.pp-app-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
}

.pp-app-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--pp-text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
}

.pp-app-nav a.is-active,
.pp-app-nav a:hover {
  color: var(--pp-primary);
  background: rgba(157, 204, 46, 0.12);
}

.pp-nav-soon {
  font-size: 0.85rem;
  color: var(--pp-text-muted);
  opacity: 0.55;
  padding: 0.35rem 0.5rem;
  cursor: not-allowed;
}

.pp-top-nav-user {
  font-size: 0.85rem;
  color: var(--pp-text-muted);
  margin-left: auto;
}

.pp-top-nav-logout {
  font-size: 0.9rem;
  color: var(--pp-text-muted) !important;
}

.pp-top-nav-logout:hover {
  color: var(--pp-primary) !important;
}

.pp-hero { text-align: center; margin-bottom: 2rem; }
.pp-hero-logo { max-width: min(100%, 320px); height: auto; margin: 0 auto 1rem; display: block; }
.pp-hero-title { margin: 0 0 0.5rem; font-size: 1.75rem; color: var(--pp-text); }
.pp-construction-banner {
  display: inline-block;
  margin: 0 auto 1.25rem;
  padding: 0.75rem 1.25rem;
  background: rgba(157, 204, 46, 0.12);
  border: 1px solid var(--pp-primary);
  border-radius: 8px;
  color: var(--pp-primary-hover);
  font-size: 1.05rem;
  font-weight: 600;
  max-width: 28em;
}

.pp-hero-tagline { color: var(--pp-text-muted); font-size: 1.05rem; margin: 0 0 0.75rem; max-width: 36em; margin-left: auto; margin-right: auto; }
.pp-hero-note { margin: 0; max-width: 32em; margin-left: auto; margin-right: auto; }
.pp-hero-cta { margin: 0; }

.pp-section { margin-bottom: 2rem; }
.pp-section h2 { font-size: 1.25rem; margin: 0 0 0.75rem; color: var(--pp-text); }
.pp-section-muted { opacity: 0.95; }
.pp-feature-list { margin: 0; padding-left: 1.25rem; }
.pp-feature-list li { margin-bottom: 0.5rem; }

.pp-card {
  background: var(--pp-bg-card);
  border: 1px solid var(--pp-border);
  border-radius: 10px;
  padding: 1.5rem;
  width: 100%;
  max-width: none;
}

.pp-card-wide { max-width: none; }

.pp-card-auth {
  max-width: var(--pp-auth-card-max);
  margin-left: auto;
  margin-right: auto;
}
.pp-error-code {
  margin: 0 0 0.35rem;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--pp-text-muted);
}
.pp-card h2 { margin: 0 0 1rem; font-size: 1.125rem; color: var(--pp-text); }
.pp-legal h1 { margin-top: 0; font-size: 1.5rem; }
.pp-legal h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.pp-muted { color: var(--pp-text-muted); font-size: 0.9rem; }

.pp-form { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 1rem; }
.pp-form label { font-size: 0.9rem; font-weight: 600; color: var(--pp-text); margin-top: 0.65rem; }
.pp-form input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--pp-border);
  border-radius: 6px;
  font-size: 1rem;
  background: #1a1a1a;
  color: var(--pp-text);
}

.pp-form input:focus-visible {
  outline: 2px solid var(--pp-focus);
  outline-offset: 2px;
  border-color: var(--pp-focus);
}

.pp-form textarea,
.pp-form select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--pp-border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #1a1a1a;
  color: var(--pp-text);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pp-form textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.pp-form textarea:focus-visible,
.pp-form select:focus-visible {
  outline: 2px solid var(--pp-focus);
  outline-offset: 2px;
  border-color: var(--pp-focus);
}

.pp-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--pp-primary);
  color: var(--pp-primary-text);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.pp-btn:hover {
  background: var(--pp-primary-hover);
  color: var(--pp-primary-text);
}

.pp-btn:focus-visible {
  outline: 2px solid var(--pp-text);
  outline-offset: 2px;
}

.pp-btn-danger {
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #991b1b;
}

.pp-btn-danger:hover {
  background: #991b1b;
}

.pp-btn-secondary {
  background: transparent;
  color: var(--pp-primary);
  border: 1px solid var(--pp-border);
}

.pp-alert { padding: 0.75rem 1rem; border-radius: 6px; margin: 0 0 1rem; font-size: 0.9rem; }
.pp-alert-error {
  background: var(--pp-error-bg);
  color: var(--pp-error-text);
  border: 1px solid #7f1d1d;
}

.pp-footer {
  border-top: 1px solid var(--pp-border);
  padding: 1.5rem var(--pp-content-padding-x);
  margin-top: 2rem;
  text-align: center;
}

.pp-footer-nav,
.pp-footer-copy {
  width: 100%;
  max-width: var(--pp-layout-max);
  margin-left: auto;
  margin-right: auto;
}

.pp-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 0.75rem;
}

.pp-footer-nav a { text-decoration: none; }
.pp-footer-nav a:focus-visible {
  outline: 2px solid var(--pp-focus);
  outline-offset: 2px;
}

.pp-footer-copy { margin: 0; font-size: 0.85rem; color: var(--pp-text-muted); }

.pp-global-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1rem 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pp-border);
}

.pp-global-nav a {
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  color: var(--pp-text-muted);
}

.pp-global-nav a.is-active,
.pp-global-nav a:hover {
  color: var(--pp-primary);
  background: rgba(157, 204, 46, 0.12);
}

.pp-tile-grid {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

@media (min-width: 560px) {
  .pp-tile-grid { grid-template-columns: 1fr 1fr; }
}

.pp-tile {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.pp-tile:hover {
  border-color: var(--pp-primary);
  color: inherit;
}

.pp-tile-disabled {
  opacity: 0.65;
  cursor: default;
}

.pp-tile-disabled:hover {
  border-color: var(--pp-border);
}

.pp-tile-title { display: block; font-weight: 700; color: var(--pp-text); margin-bottom: 0.35rem; }
.pp-tile-desc { display: block; font-size: 0.9rem; color: var(--pp-text-muted); }

.pp-table-wrap { overflow-x: auto; margin-top: 1rem; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pp-table th,
.pp-table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--pp-border); }
.pp-table th { color: var(--pp-text-muted); font-weight: 600; }

.pp-alert-success {
  background: rgba(157, 204, 46, 0.15);
  color: var(--pp-primary-hover);
  border: 1px solid var(--pp-primary);
}

.pp-form-grid {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
  min-width: 0;
}

@media (min-width: 600px) {
  .pp-form-grid { grid-template-columns: 1fr 1fr; }
  .pp-form-row-full { grid-column: 1 / -1; }
}

.pp-form-row { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.pp-form-row label { font-weight: 600; font-size: 0.9rem; }

.pp-form-row--error input,
.pp-form-row--error select,
.pp-form-row--error textarea {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px #ef4444;
}
.pp-form-row--error input:focus-visible,
.pp-form-row--error select:focus-visible,
.pp-form-row--error textarea:focus-visible {
  outline-color: #ef4444;
  border-color: #ef4444;
}
.pp-field-hint {
  font-size: 0.85rem;
  color: var(--pp-error-text);
}

/* Pflichtfeld-Stern — nicht mit Fehler-Rahmen verwechseln */
.pp-required {
  color: var(--pp-text-muted);
  font-weight: 700;
  margin-left: 0.15rem;
}

/* Kein Browser-Rot bei leeren Pflichtfeldern — Fehler nur serverseitig (.pp-form-row--error) */
.pp-form input:user-invalid,
.pp-form select:user-invalid,
.pp-form textarea:user-invalid {
  border-color: var(--pp-border);
  box-shadow: none;
}
.pp-form-section { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.pp-form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.pp-form-inline { margin-top: 1rem; }
.pp-form-inline .pp-btn { margin-top: 0; }

.pp-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 1rem 0;
}
.pp-dl dt { color: var(--pp-text-muted); font-weight: 600; }
.pp-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0.75rem 0 1rem;
}
.pp-table-actions { font-size: 0.9rem; vertical-align: top; }
.pp-code-truncate { font-size: 0.75rem; word-break: break-all; }

.pp-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  max-width: 22rem;
}

.pp-btn-small {
  margin-top: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.pp-table-actions .pp-form-inline {
  display: inline-flex;
  margin: 0;
}

.pp-btn-link {
  background: none;
  border: none;
  color: var(--pp-primary);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}
.pp-btn-link:hover { color: var(--pp-primary-hover); }

.pp-checkbox-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.pp-checkbox-row { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.pp-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.65rem 1rem;
  margin: 0.75rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
}
.pp-checkbox-grid.pp-form-row--error { border-color: var(--pp-error); }
.pp-checkbox { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; font-size: 0.92rem; line-height: 1.35; }
.pp-checkbox input { margin-top: 0.2rem; flex-shrink: 0; }

.pp-log-filter { margin: 1rem 0 1.5rem; }
.pp-table-log { font-size: 0.85rem; }
.pp-table-log th,
.pp-table-log td { white-space: nowrap; }
.pp-table-log td:nth-child(3) { white-space: normal; min-width: 8rem; }

select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--pp-border);
  border-radius: 6px;
  background: #1a1a1a;
  color: var(--pp-text);
  font-size: 1rem;
}

select:focus-visible {
  outline: 2px solid var(--pp-focus);
  outline-offset: 2px;
}

.pp-flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 0 0 1rem;
}

.pp-flash-ok {
  background: rgba(157, 204, 46, 0.15);
  color: var(--pp-primary-hover);
  border: 1px solid var(--pp-primary);
}

.pp-flash-error {
  background: var(--pp-error-bg);
  color: var(--pp-error-text);
  border: 1px solid #7f1d1d;
}

.pp-callout {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--pp-border);
  background: rgba(157, 204, 46, 0.08);
}

.pp-callout-action {
  border-color: var(--pp-primary);
}

.pp-callout-text {
  margin: 0 0 0.85rem;
  color: var(--pp-text);
  font-size: 0.95rem;
}

.pp-callout .pp-btn {
  margin-top: 0;
}

a.pp-btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  width: auto;
  max-width: 100%;
}

.pp-list-links {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.pp-list-links li { margin: 0.5rem 0; }

.pp-list-links a { font-weight: 600; }

.pp-rule-block {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
}

.pp-rule-content {
  max-height: 12rem;
  overflow-y: auto;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.pp-error-list {
  color: #b71c1c;
  margin: 1rem 0;
}

.pp-card-inset {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.pp-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.pp-stat {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  text-align: center;
}

.pp-stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
}

.pp-stat-label {
  font-size: 0.85rem;
  color: var(--pp-text-muted);
}

.pp-list-compact {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1.5rem;
}

.pp-list-compact li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--pp-border);
}

.pp-row-open {
  background: rgba(255, 193, 7, 0.08);
}

.pp-btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.pp-form-inline {
  display: inline;
}

.pp-info-box {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  background: rgba(157, 204, 46, 0.06);
}

.pp-info-box p { margin: 0.35rem 0; }
.pp-info-box p:first-child { margin-top: 0; }
.pp-info-box p:last-child { margin-bottom: 0; }

.pp-tag-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.pp-tag-card {
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  background: var(--pp-bg-card);
}

.pp-tag-card-highlight {
  border-color: var(--pp-primary);
  box-shadow: 0 0 0 1px var(--pp-primary);
}

.pp-tag-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.pp-tag-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pp-tag-status {
  margin-left: auto;
  font-size: 0.85rem;
  text-transform: capitalize;
}

.pp-tag-card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-start;
}

.pp-tag-qr-preview {
  flex: 0 0 auto;
  padding: 0.35rem;
  background: #fff;
  border-radius: 6px;
  line-height: 0;
}

.pp-tag-qr-preview img {
  display: block;
}

.pp-dl-compact { margin: 0; flex: 1 1 220px; }

.pp-tag-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--pp-border);
}

.pp-hero-flash { margin-bottom: 1rem; }

/* —— Responsive —— */
@media (max-width: 767px) {
  .pp-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .pp-top-nav {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .pp-top-nav-user {
    margin-left: 0;
  }

  .pp-app-nav {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .pp-form-actions .pp-btn {
    width: 100%;
    text-align: center;
  }

  .pp-stat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .pp-form-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .pp-skip-link,
  .pp-top-nav,
  .pp-app-nav,
  .pp-form-actions,
  .pp-log-filter,
  .pp-no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .pp-hero-logo { max-width: 200px; }
  .pp-card { border: none; box-shadow: none; }
  .pp-logbook-print .pp-table-log { font-size: 9pt; }
  .pp-logbook-print .pp-table-log th,
  .pp-logbook-print .pp-table-log td { border: 1px solid #ccc; }
}
