/* ======== Globale Basis & Farbpalette ======== */

:root {
  /* Farbpalette an das Logo angepasst */
  --color-bg: #e2f4f7;
  --color-bg-light: #f0fbff;
  --color-primary: #1f6f9c;        /* tiefes Blaugrün aus dem Logo */
  --color-primary-soft: #3da5c8;   /* helleres Blau */
  --color-accent: #155f7a;         /* dunkler Akzentton */
  --color-text: #0f2f3f;
  --radius-lg: 1.5rem;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.18);
}

/* Box-Sizing Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Grundlayout für alle Seiten */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  margin: 0;
  padding: 0;
  background: #f3f4f6;
  color: #111827;
}

/* Einheitliches Link-Design passend zur Farbpalette */

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

a:visited {
  color: var(--color-accent);
}

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

a:focus-visible {
  outline: 2px solid var(--color-primary-soft);
  outline-offset: 2px;
}

/* Buttons sind Links, sollen aber wie Buttons aussehen */
a.btn {
  text-decoration: none;
}

/* Primäre Buttons: Text immer weiß, auch nach Besuch */
a.btn-primary,
a.btn-primary:visited {
  color: #ffffff;
}

/* Sekundäre Buttons: definierte Akzentfarbe, nicht Link-Blau */
a.btn-secondary,
a.btn-secondary:visited {
  color: var(--color-accent);
}


/* Landingpage / Startseite */
body.page-index {
  background: radial-gradient(circle at top, var(--color-bg-light), var(--color-bg));
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* ======== Startseiten-Layout (Index) ======== */

.shell {
  width: 100%;
  max-width: 960px;
}

.card {
  background: #f5fbff; /* leicht kühles Hellblau passend zum Logo */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2.5rem 2.25rem 2.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
  gap: 2.5rem;
  border: 3px solid rgba(90, 50, 16, 0.08);
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

header img {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

header p.subtitle {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-accent);
}

nav {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, filter 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-soft));
  color: #ffffff; /* <— hier ändern */
  box-shadow: 0 10px 24px rgba(140, 74, 21, 0.45);
}

.btn-secondary {
  background: #e7f4ff;
  color: var(--color-accent);
  border: 1px solid rgba(21, 95, 122, 0.18);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(181, 28, 28, 0.45);
}

.btn:focus-visible {
  outline: 3px solid var(--color-primary-soft);
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: center;
}

main h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--color-accent);
}

main p {
  margin: 0 0 0.9rem;
  line-height: 1.7;
  font-size: 0.98rem;
  color: rgba(58, 36, 16, 0.92);
}

main p:last-child {
  margin-bottom: 0;
}

footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: rgba(58, 36, 16, 0.75);
}

body.page-admin footer,
body.page-seller footer {
  margin-top: 0;
}

/* Mobile Layout für Startseite */
@media (max-width: 768px) {
  body.page-index {
    padding: 1rem;
  }

  .card {
    grid-template-columns: minmax(0, 1fr);
    padding: 1.8rem 1.4rem 1.6rem;
    gap: 1.8rem;
  }

  header h1 {
    font-size: 1.7rem;
  }

  main h2 {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  header img {
    max-width: 190px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
  }
}

/* ======== Formular-Seite: Etiketteneingabe (aus eingabe.css) ======== */

.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

body > .wrapper {
  padding-bottom: 0;
}

h1 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.6rem;
}

/* Karte für Formularbereich */
.form-section {
  background: #ffffff;
  padding: 18px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  margin-bottom: 20px;
}

.footer-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.35rem 20px;
  box-sizing: border-box;
}

.note {
  background: #fff8e6;
  border: 1px solid #e5d4a4;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* Hervorgehobener Block für Event-Auswahl */
.event-select-box {
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #f7fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: none;
}

.admin-event-context {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: min(100%, 760px);
  margin: 12px auto 4px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
}

.admin-event-context-row {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.admin-event-context-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

.admin-event-context label {
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.admin-event-context select {
  min-width: 0;
  width: min(100%, 420px);
  padding: 4px 28px 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  background-color: #fff;
  color: #1f2937;
  font-size: 1rem;
}

.admin-account-menu {
  position: relative;
  flex: 0 0 auto;
  transform: translateY(4px);
}

.admin-account-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
}

.admin-account-toggle:hover,
.admin-account-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.admin-account-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-account-links {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: #237fa5;
  box-shadow: 0 8px 18px rgba(15, 47, 63, 0.25);
}

.admin-account-links[hidden] {
  display: none;
}

.admin-account-links a {
  white-space: nowrap;
}

.admin-settings-menu .admin-account-links {
  left: 0;
  right: auto;
}

@media (max-width: 600px) {
  .admin-event-context {
    align-items: stretch;
    flex-direction: column;
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    margin: 8px auto 3px;
  }

  .admin-event-context-row {
    width: 100%;
  }

  .admin-event-context-group {
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
  }

  .admin-event-context-group .admin-event-context {
    min-width: 0;
    flex: 1 1 auto;
  }

  .admin-account-menu {
    flex: 0 0 34px;
    transform: none;
  }

  .admin-event-context select {
    width: 100%;
  }
}

.event-select-box label {
  display: block;
  margin-bottom: 6px;
}

.event-select-box select {
  display: block;
  width: 100%;
}

.sale-added-book-action-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  white-space: nowrap;
}

.sale-added-book-actions,
.sale-added-book-delete-form {
  flex: 0 0 auto;
}

.sale-added-book-actions > summary {
  cursor: pointer;
  list-style: none;
}

.sale-added-book-actions > summary::-webkit-details-marker {
  display: none;
}

.sale-added-book-edit-form {
  display: grid;
  gap: 6px;
  min-width: 250px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f7fafc;
}

.sale-added-book-edit-form label {
  display: grid;
  gap: 3px;
  font-size: 0.85rem;
}

.sale-added-book-edit-form input,
.sale-added-book-edit-form select {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .sale-added-book-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    white-space: normal;
  }

  .sale-added-book-actions,
  .sale-added-book-delete-form,
  .sale-added-book-actions > summary,
  .sale-added-book-delete-form .btn {
    width: 100%;
    box-sizing: border-box;
  }

  .sale-added-book-edit-form {
    min-width: 0;
    width: calc(100vw - 80px);
    max-width: 280px;
  }
}

/* Hinweisboxen */
.hint {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 5px;
}

.hint-strong {
  font-size: 0.9rem;
  color: #b91c1c;
  margin: 8px 0 10px 0;
}

.hint-strong--centered {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
}

.row-inline > .checkbox-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  background: #ffffff;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 6px;
  align-items: center;
}

.checkbox-card input[type="checkbox"] {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}

.checkbox-card label {
  grid-column: 2;
  grid-row: 1;
  display: block;
  font-weight: 600;
  margin: 0;
}

.checkbox-card .hint-inline {
  grid-column: 2;
  grid-row: 2;
  display: block;
  font-size: 0.85rem;
  color: #4b5563;
}

.book-table {
  table-layout: auto;
}

.book-table thead th {
  vertical-align: bottom;
  padding-bottom: 8px;
}

.book-table thead th.col-price {
  text-align: left;
}

.book-table tbody td {
  vertical-align: top;
}

.book-table .col-price {
  width: auto;
  white-space: nowrap;
  text-align: left;
  padding-left: 0.5rem;
}

.book-table .col-action {
  width: auto;
  min-width: auto;
  max-width: none;
  text-align: center;
  white-space: nowrap;
}

.book-table .col-price input {
  width: auto;
  min-width: 4ch;
  max-width: 10ch;
  box-sizing: border-box;
  text-align: left;
}

.book-table .col-title > div {
  gap: 0.5rem;
  align-items: center;
}

.book-row-meta {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.book-row-index {
  min-width: 36px;
  display: inline-block;
}

.book-row-number {
  min-width: 30px;
  display: inline-block;
  text-align: right;
  color: #6b7280;
}

.book-price-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.row-state-bought {
  background: #e8f5e9;
}

.row-archived {
  opacity: 0.7;
  background: #f7f7f7;
}

.row-state--entered {
  background-color: #e8f4ff;
}

.row-state--delivered,
.row-state--deducted,
.row-state--payed-out {
  background-color: #e8f5e9;
}

.row-state--printed {
  background-color: #fef3c7;
}

.book-state-label {
  font-size: 0.85rem;
  color: #555;
}

.book-state-label--block {
  display: block;
}

/* Kopfzeile: Event / Seller / Checkbox */

.row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.row-inline > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #374151;
}

/* Textfelder allgemein */
input[type="text"] {
  font-size: 0.95rem;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  margin-bottom: 8px;
  margin-top: 8px;
}

/* Fokuszustand */
input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  background-color: #ffffff;
  margin-bottom: 8px;
  margin-top: 8px;
}

.brand-combined {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.brand-combined .brand-copy {
  text-align: center;
}

.login-brand {
  text-align: center;
  margin-bottom: 1rem;
}

.login-brand img {
  max-height: 72px;
  display: block;
  margin: 0 auto;
}

.payout-warning {
  color: #b91c1c;
}

.delivery-print-warning {
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 10px 12px;
  color: #92400e;
  background: #fff7ed;
  font-weight: 600;
}

.payout-table {
  width: 100%;
  border-collapse: collapse;
}

.payout-table th,
.payout-table td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.payout-table td.price,
.payout-table th.price {
  text-align: right;
  white-space: nowrap;
}

.payout-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 2000;
}

.payout-modal-backdrop.is-open {
  display: flex;
}

.payout-modal {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  max-width: 980px;
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.payout-modal header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.payout-modal header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.payout-modal .modal-body {
  padding: 14px 16px;
  overflow: auto;
}

.payout-modal .modal-actions {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.payout-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 6px;
}

.payout-summary .summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f9fafb;
}

.payout-summary .summary-card strong {
  display: block;
  margin-bottom: 2px;
}

.payout-summary .summary-card--payout {
  background: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
}

.payout-summary .summary-card--payout span {
  font-weight: 600;
  font-size: 1.35rem;
  display: block;
  margin-top: 4px;
}

.cashbook-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.cashbook-page,
.cashbook-page * {
  box-sizing: border-box;
}

.cashbook-heading > div,
.cashbook-filter-grid,
.cashbook-search-group,
.cashbook-total-row,
.cashbook-summary,
.cashbook-independent-summary {
  min-width: 0;
}

.cashbook-heading p {
  margin: 4px 0 0;
  color: #4b5563;
}

.cashbook-total-balance {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 14px 18px;
  border: 1px solid #b7dcef;
  border-radius: 8px;
  background: #eef8fd;
  color: #0f2f3f;
}

.cashbook-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.cashbook-total-row span {
  color: #4b6475;
}

.cashbook-total-row b {
  white-space: nowrap;
}

.cashbook-total-row--final {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 47, 63, 0.14);
}

.cashbook-total-row--final strong,
.cashbook-total-row--final b {
  font-size: 1.25rem;
}

.cashbook-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cashbook-filter {
  padding: 16px 18px;
}

.cashbook-filter label {
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.cashbook-filter-grid input,
.cashbook-filter-grid select {
  min-height: 42px;
  min-width: 0;
  margin-bottom: 0;
}

.cashbook-filter-grid > select:first-child {
  flex: 2 1 320px;
}

.cashbook-filter-grid > input[type="date"] {
  flex: 1 1 170px;
  max-width: 220px;
}

.cashbook-filter-grid > select:not(:first-child) {
  flex: 1 1 170px;
  max-width: 230px;
}

.cashbook-search-group {
  display: flex;
  flex: 1 1 360px;
  gap: 10px;
  align-items: center;
  min-width: 280px;
}

.cashbook-search-group input[type="search"] {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 42px;
  margin-bottom: 0;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.65rem;
  font-size: 0.95rem;
  color: #111827;
  background: #ffffff;
}

.cashbook-search-group .btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 18px;
}

.cashbook-group-toggles {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
}

.cashbook-group-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cashbook-group-toggles input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.cashbook-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.cashbook-summary .summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f9fafb;
}

.cashbook-summary .summary-card strong,
.cashbook-summary .summary-card span {
  display: block;
}

.cashbook-summary .summary-card span {
  margin-top: 4px;
  font-size: 1.25rem;
  font-weight: 700;
}

.cashbook-independent-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
}

.cashbook-independent-summary span {
  font-weight: 700;
  white-space: nowrap;
}

.cashbook-subheading {
  margin: 18px 0 8px;
}

.cashbook-actions {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0;
}

.cashbook-entry-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.cashbook-entry-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.cashbook-group-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  box-sizing: border-box;
  overflow: auto;
  border: 0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(15, 47, 63, 0.28);
}

.cashbook-group-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.cashbook-group-dialog .dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cashbook-group-total {
  text-align: right;
  margin-bottom: 0;
}

.cashbook-entry-form {
  padding: 18px;
  background: #f9fafb;
}

.cashbook-entry-form .dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cashbook-entry-form .dialog-header h3 {
  margin: 0;
}

.dialog-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #e5e7eb;
  color: #1f2937;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.cashbook-entry-form input,
.cashbook-entry-form select,
.cashbook-entry-form textarea {
  width: 100%;
  margin-bottom: 8px;
}

.cashbook-entry-form .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.cashbook-table-wrap {
  overflow-x: auto;
}

.cashbook-table .price {
  text-align: right;
  white-space: nowrap;
}

.log-filter-form {
  margin-bottom: 12px;
}

.wrapper:has(.log-page) {
  max-width: none;
  width: max-content;
  min-width: min(100%, 1100px);
  margin-left: auto;
  margin-right: auto;
}

.log-page {
  width: max-content;
  min-width: min(100%, 1100px);
  max-width: calc(100vw - 40px);
  overflow-x: auto;
}

.log-page .table-wrapper {
  overflow-x: visible;
}

.log-page table {
  width: max-content;
  min-width: 100%;
}

.log-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.log-filter-field {
  display: flex;
  flex: 1 1 170px;
  min-width: 150px;
  flex-direction: column;
  gap: 4px;
}

.log-filter-field--table {
  flex-basis: 220px;
}

.log-filter-field--search {
  flex-basis: 220px;
}

.log-filter-field label {
  margin: 0;
  font-weight: 600;
}

.log-filter-field input,
.log-filter-field select {
  width: 100%;
  margin-bottom: 0;
}

.log-filter-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

@media (max-width: 700px) {
  .log-filter-field,
  .log-filter-field--table,
  .log-filter-field--search,
  .log-filter-actions {
    flex: 1 1 100%;
  }

  .log-filter-actions .btn {
    flex: 1 1 0;
    text-align: center;
  }
}

.log-list-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 8px 0 12px;
  color: #4b5563;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.pagination .btn {
  min-width: 42px;
  text-align: center;
}

.pagination-disabled {
  opacity: 0.45;
  cursor: default;
}

.pagination-gap {
  color: #6b7280;
  padding: 0 2px;
}

.cashbook-row--generated {
  background: #f8fafc;
}

.cashbook-row--cancelled {
  color: #6b7280;
}

.cashbook-row--cancelled td {
  text-decoration: line-through;
}

.payout-books-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.payout-books-table th,
.payout-books-table td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.payout-books-table th.price,
.payout-books-table td.price {
  text-align: right;
  white-space: nowrap;
}

.payout-hint {
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
}

#payout-feedback {
  margin-top: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #991b1b;
  display: none;
}

#confirm-payout-amount {
  color: #0f172a;
}

#payout-confirm-modal .modal-body {
  font-size: 1.1rem;
}

.section-divider {
  margin: 16px 0;
  border: none;
  border-top: 1px solid #d9e2ec;
}

.hint-inline {
  margin-top: -8px;
}

.hint-inline--archived {
  margin-left: 8px;
}

.sale-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sale-summary-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  margin: 0.5rem 0 1rem;
}

.inline-form {
  display: inline;
}

.inline-form-inlineblock {
  display: inline-block;
  margin-right: 8px;
}

.btn-danger-light {
  background: #fee2e2;
  color: #b91c1c;
}

.qr-overlay,
.manual-book-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.qr-overlay.is-open,
.manual-book-overlay.is-open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.modal-card--scanner {
  max-width: 480px;
  width: 90%;
  position: relative;
  text-align: left;
}

.modal-card--scanner p {
  font-size: 0.9rem;
}

.modal-card--unsaved {
  max-width: 520px;
}

.modal-card--unsaved .modal-actions {
  flex-wrap: wrap;
}

.unsaved-warning-error {
  margin: 0 0 12px;
}

.scanner-status-wrapper {
  margin-top: 8px;
  text-align: right;
}

.scanner-status {
  font-size: 0.9rem;
  color: #555;
}

.scanner-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 10px 0 12px;
}

.scanner-fallback-actions[hidden],
.scanner-ocr-result[hidden] {
  display: none;
}

.scanner-ocr-result {
  margin-top: 10px;
}

.scanner-ocr-result .row-inline {
  align-items: stretch;
}

.scanner-ocr-result select {
  min-width: 0;
}

.scanner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-soft));
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

#print-warning-overlay .hint {
  margin-bottom: 1rem;
}

.modal-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--color-text);
}

.modal-card h3.modal-title--accent {
  color: var(--color-primary);
}

.sale-qr-amount {
  font-size: 1.9rem;
  font-weight: 600;
  margin: 12px 0;
}

.sale-qr-amount strong {
  font-size: inherit;
  font-weight: 700;
  color: #0f172a;
}

.modal-card p {
  margin-top: 0;
  margin-bottom: 12px;
}

.modal-card label {
  font-weight: 600;
  display: block;
  text-align: left;
}

.modal-field {
  margin: 0 0 1rem;
  text-align: left;
}

.modal-field label {
  margin-bottom: 0.35rem;
}

.modal-card select {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.55rem 2rem 0.55rem 0.65rem;
  font-size: 0.95rem;
  line-height: 1.2;
  color: #111827;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23155f7a' d='M1.41 0 6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  cursor: pointer;
}

.modal-card select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.45);
}

.modal-card input.full-width {
  width: 100%;
  margin-bottom: 8px;
}

.qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.qr-reader {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.scanner-reader-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.scanner-reader-wrap .qr-reader {
  max-width: none;
}

.scanner-ocr-frame {
  display: none;
}

.scanner-focus-indicator {
  position: fixed;
  z-index: 10000;
  width: 58px;
  height: 58px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(31, 111, 156, 0.95), 0 4px 14px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.75);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.scanner-focus-indicator.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.section-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  margin-top: 16px;
}

.summary-card-alt {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #f9fafb;
}

.info-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

.table-compact th,
.table-compact td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.alert-error {
  color: #b91c1c;
  margin-top: 0;
}

.info-card {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-weight: 600;
}

.info-card span {
  color: #555;
  font-weight: 400;
}

.form-compact {
  margin-bottom: 12px;
}

.form-compact--top {
  margin-top: 8px;
}
.table-compact th {
  font-weight: 600;
}

.hint--compact {
  margin-top: 0;
}

.mb-3 {
  margin-bottom: 12px;
}

.col-booknr {
  width: 120px;
}

.col-status {
  width: 140px;
}

.col-price {
  width: 110px;
}

.manual-book-form {
  display: none;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f7fafc;
  border: 1px solid #d9e2ec;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.manual-book-form.is-active {
  display: block;
}

.manual-book-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.manual-book-grid > div {
  min-width: 140px;
  flex: 1;
}

.manual-book-grid__field {
  min-width: 140px;
}

.manual-book-grid__field--wide {
  flex: 1 1 200px;
}

.mt-2 {
  margin-top: 8px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.font-bold {
  font-weight: 700;
}

.table-responsive {
  overflow-x: auto;
}

.sale-row--open {
  background: #fee2e2;
}

.sale-row--open td {
  border-color: #fca5a5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions--center {
  justify-content: center;
}

.ml-2 {
  margin-left: 8px;
}

.payout-preview-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.payout-preview-meta div {
  line-height: 1.4;
}

.payout-preview-books {
  overflow-x: auto;
}

/* Desktop-Breite für Event / Seller */
#event-prefix-input {
  width: 100px;
  margin-left: 0;
}

#seller-input {
  width: 80px;
  margin-left: 0;
}

/* Checkbox rechts daneben */
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.checkbox-inline label {
  display: inline-block;
}

/* Tabelle Titel / Preis */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding: 4px 6px;
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody td {
  padding: 3px 4px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.col-index {
  width: 40px;
  text-align: right;
  color: #6b7280;
}

.col-title input {
  width: 100%;
}

.col-price {
  width: 90px;
}

.col-price input {
  width: 100%;
  text-align: right;
}

/* Spezifisch für Bücher-Eingabe: Margins entfernen, damit Button bündig zentriert */
.book-title-input,
.book-price-input {
  margin-top: 0;
  margin-bottom: 0;
  height: 2.6rem;
  padding: 8px 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Buttons */

.btn-row {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-row--spaced {
  margin-top: 1rem;
}

button {
  font-size: 0.95rem;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-soft));
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
}

button:hover {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-soft));
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.2);
}

/* Scanner-Kamera-Button bündig zu Eingabefeldern */
.scan-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.6rem;
  padding: 0 12px;
  line-height: 1.1;
  align-self: center;
  margin: 0;
  font-size: 1rem;
  border-radius: 50%;
  transform: translateY(2px);
}

/* Responsive: Tablets */

@media (max-width: 900px) {
  .wrapper {
    padding: 16px 12px;
  }

  .form-section {
    padding: 16px 14px;
  }

  h1 {
    font-size: 1.4rem;
  }
}

/* Responsive: Smartphones */

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .wrapper {
    padding: 12px 10px;
  }

  .form-section {
    padding: 14px 12px;
    border-radius: 8px;
  }

  h1 {
    font-size: 1.3rem;
  }

  /* Eingabebereich untereinander statt nebeneinander */
  .row-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .row-inline > div {
    width: 100%;
  }

  /* Event / Seller volle Breite, größere Felder */
  #event-prefix-input,
  #seller-input {
    width: 100%;
  }

  input[type="text"] {
    padding: 10px 12px;
    font-size: 1rem;
  }

  .checkbox-inline {
    margin-top: 4px;
  }

  /* Buttons untereinander, gut klickbar */
  .btn-row {
    flex-direction: column;
  }

  .btn-row button {
    width: 100%;
    padding: 10px 16px;
    font-size: 1rem;
  }

  /* Tabelle etwas größer & leichter antippbar */
  table {
    font-size: 0.9rem;
  }

  thead th {
    padding: 6px 6px;
  }

  tbody td {
    padding: 6px 4px;
  }

  /* Den kleinen Scrollcontainer für die 50 Zeilen aufheben,
     damit man auf dem Handy einfach normal nach unten scrollt */
  .wrapper div[style*="max-height: 400px"] {
    max-height: none !important;
  }
}

/* ======== Formular-Controls (Admin & Seller) ======== */
section.form-section input[type="text"],
section.form-section input[type="number"],
section.form-section input[type="email"],
section.form-section input[type="date"],
section.form-section input[type="password"],
section.form-section select,
section.form-section textarea {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  line-height: 1.2;
  background-color: #ffffff;
  color: #111827;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

section.form-section input[type="text"]:focus,
section.form-section input[type="number"]:focus,
section.form-section input[type="email"]:focus,
section.form-section input[type="date"]:focus,
section.form-section input[type="password"]:focus,
section.form-section select:focus,
section.form-section textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.45);
  background-color: #ffffff;
}

.faq-editor {
  min-height: 180px;
  box-sizing: border-box;
  padding: 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.faq-editor:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.45);
}

.faq-editor img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
}

.faq-image-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.faq-image-tools label {
  margin: 0;
}

.faq-image-tools select {
  min-width: 150px;
}

.faq-image-selected {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.faq-create-dialog {
  width: min(720px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  box-sizing: border-box;
  overflow: auto;
  border: 0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(15, 47, 63, 0.28);
}

.faq-create-dialog h3 {
  margin-top: 0;
}

.faq-create-dialog label {
  display: block;
  margin: 10px 0 5px;
  font-weight: 600;
}

.faq-create-dialog input[type="text"],
.faq-create-dialog input[type="number"],
.faq-create-dialog input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.faq-create-dialog input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
}

.faq-create-dialog .row-inline label {
  margin-top: 0;
}

.faq-create-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.faq-preview-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  box-sizing: border-box;
  overflow: auto;
  border: 0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(15, 47, 63, 0.28);
}

.faq-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.62);
}

.faq-preview-content {
  margin: 16px 0;
  padding: 20px;
  border: 1px solid #cfe3ee;
  border-radius: 8px;
  background: #ffffff;
  color: #0f2f3f;
}

.faq-preview-content h2 {
  margin-top: 0;
}

.faq-preview-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0;
}

section.form-section input[type="text"]:-webkit-autofill,
section.form-section input[type="number"]:-webkit-autofill,
section.form-section input[type="email"]:-webkit-autofill,
section.form-section input[type="date"]:-webkit-autofill,
section.form-section input[type="password"]:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #111827;
}

/* Custom Dropdown-Pfeil für Select */
section.form-section select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23155f7a' d='M1.41 0 6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
  cursor: pointer;
}

/* ======== Admin-Layout (Header + Navigation) ======== */

body.page-admin {
  background: #f3f4f6;
  margin: 0;
}

header.site-header {
  background: var(--color-bg);
  border-bottom: 3px solid rgba(90, 50, 16, 0.12);
}

header.site-header .wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  flex-wrap: wrap;
}

header.site-header .brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 0.35rem 0.55rem;
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(90, 50, 16, 0.12);
}

header.site-header .brand-link img {
  display: block;
  height: 56px;
  width: auto;
}

header.site-header .brand-copy h1 {
  margin: 0;
  padding: 0;
  font-size: 1.35rem;
  color: var(--color-primary);
}

header.site-header .brand-copy p {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  color: rgba(58, 36, 16, 0.8);
}

nav.site-nav {
  position: relative;
  z-index: 100;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-soft));
  box-shadow: 0 8px 18px rgba(140, 74, 21, 0.35);
}

nav.site-nav .wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  justify-content: center;
}

nav.site-nav .nav-break {
  flex-basis: 100%;
  height: 0;
}

/* ======== Verkäufer-Bereich spezifisch ======== */
body.page-seller {
  background: #f3f4f6;
  margin: 0;
}

body.page-seller header.site-header {
  background: var(--color-bg);
  border-bottom: 3px solid rgba(90, 50, 16, 0.12);
}

body.page-seller header.site-header .wrapper {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

body.page-seller header.site-header h1 {
  margin: 0;
  padding: 0;
  font-size: 1.3rem;
  color: var(--color-primary);
}

body.page-seller header.site-header p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(58, 36, 16, 0.8);
}

body.page-seller main.seller-main {
  padding: 1rem 0 0;
}

main.admin-main .wrapper,
body.page-seller main.seller-main .wrapper {
  padding-bottom: 0;
}

/* etwas kompaktere Inputs im Verkäuferbereich */
body.page-seller section.form-section input[type="text"],
body.page-seller section.form-section input[type="number"],
body.page-seller section.form-section input[type="email"],
body.page-seller section.form-section input[type="date"],
body.page-seller section.form-section input[type="password"],
body.page-seller section.form-section select,
body.page-seller section.form-section textarea {
  margin-bottom: 0;
}

nav.site-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

nav.site-nav a:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ======== Admin statistics widgets ======== */
.stat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-end;
  margin-bottom: 0.6rem;
}

.stat-filter label {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.7);
  min-width: 130px;
}

.stat-filter-controls {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.stat-context {
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.65);
}

.stat-quicklist {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-quicklist li {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.stat-quicklist__label {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.65);
}

.stat-quicklist__value {
  font-size: 1.5rem;
  color: var(--color-accent);
}

.admin-stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #ffffff;
  border-radius: 1.1rem;
  padding: 1.1rem 1.4rem;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.stat-card--accent {
  border-color: var(--color-primary);
  box-shadow: 0 18px 30px rgba(31, 111, 156, 0.25);
}

.stat-label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.6);
}

.stat-value {
  margin: 0.2rem 0;
  font-size: 2rem;
  color: var(--color-text);
}

.stat-meta {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.6);
}

.admin-insights {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.1rem 1.4rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
  margin-bottom: 1.5rem;
}

.admin-insights h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  white-space: normal;
  word-break: break-word;
}

.admin-insights ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-insights li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #edf2f7;
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.75);
}

.admin-insights li:last-child {
  border-bottom: none;
}

.admin-state-section {
  margin-bottom: 2rem;
}

.admin-state-section h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  color: var(--color-accent);
}

@media (max-width: 640px) {
  .admin-state-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .admin-stats-grid,
  .stat-quicklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
}

.state-chip {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.state-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(15, 23, 42, 0.6);
}

.state-value {
  margin: 0.2rem 0 0;
  font-size: 1.7rem;
  color: var(--color-text);
}

.admin-event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.event-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.event-card__header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.event-card__header strong {
  font-size: 1.1rem;
}

.event-card__meta {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.6);
}

.event-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.event-card__stat {
  background: #f9fafb;
  border-radius: 0.8rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.event-card__stat-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.5);
}

.event-card__stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.event-card__note {
  display: block;
  font-size: 0.7rem;
  color: rgba(15, 23, 42, 0.6);
  margin-top: 0.15rem;
}

.admin-event-empty {
  padding: 1rem;
  text-align: center;
  color: rgba(15, 23, 42, 0.65);
}

.event-id {
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.6);
}

main.admin-main {
  padding: 1rem 0 0;
}

/* Tabellen im Admin dürfen Karten-Optik haben */
.admin-main table {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.admin-main table thead th {
  background: #f9fafb;
}

.admin-main h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--color-accent);
}

.admin-main .btn-link {
  text-decoration: none;
}

@media (max-width: 640px) {
  header.site-header .brand-link {
    padding: 0.25rem 0.4rem;
  }

  header.site-header .brand-link img {
    height: 46px;
  }

  header.site-header .brand-copy h1 {
    font-size: 1.2rem;
  }

  header.site-header .brand-copy p {
    font-size: 0.85rem;
  }
}

/* ======== Admin-Helferklassen (Spacing & Cards) ======== */

.admin-form-spaced {
  margin-top: 8px;
  margin-bottom: 16px;
}

.admin-form-bottom {
  margin-bottom: 12px;
}

.admin-section {
  margin-bottom: 16px;
}

.section-title {
  margin-top: 0;
  margin-bottom: 8px;
}

.admin-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 16px;
}

.admin-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.admin-card-muted {
  background: #f9fafb;
}

.admin-table-scroll {
  overflow-x: auto;
}

.table-spacious th {
  padding: 8px;
  text-align: left;
}

.table-spacious td {
  padding: 8px;
}

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

.text-center {
  text-align: center;
}

/* ======== Admin Auth (Login / Reset) ======== */

body.page-admin-login,
body.page-seller-login {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, var(--color-bg-light), var(--color-bg));
}

.login-card {
  max-width: 380px;
  width: 100%;
  border-radius: var(--radius-lg);
  background: #f5fbff;
  box-shadow: var(--shadow-soft);
  padding: 1.8rem 1.6rem 1.4rem;
}

.login-card h1 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
  text-align: center;
  color: var(--color-primary);
}

.login-card p.subtitle {
  margin: 0 0 1.4rem;
  font-size: 0.85rem;
  text-align: center;
  color: rgba(58, 36, 16, 0.8);
}

.login-card label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
  display: block;
  margin-bottom: 0.2rem;
}

.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  line-height: 1.2;
  background-color: #ffffff;
  color: #111827;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus,
.login-card input[type="email"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.45);
  background-color: #ffffff;
}

.login-card input[type="text"]:-webkit-autofill,
.login-card input[type="password"]:-webkit-autofill,
.login-card input[type="email"]:-webkit-autofill,
.login-card input[type="text"]:-webkit-autofill:hover,
.login-card input[type="password"]:-webkit-autofill:hover,
.login-card input[type="email"]:-webkit-autofill:hover,
.login-card input[type="text"]:-webkit-autofill:focus,
.login-card input[type="password"]:-webkit-autofill:focus,
.login-card input[type="email"]:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #111827;
}

.login-card .error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.login-card .info {
  color: #15803d;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.login-card .btn-row {
  margin-top: 0.2rem;
  display: flex;
  justify-content: center;
}

.login-card .bottom-link {
  margin-top: 1.5rem;
  text-align: center;
}

.login-card .bottom-link.compact {
  margin-top: 1rem;
}

.login-card .bottom-link a {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(58, 36, 16, 0.9);
  text-decoration: none;
}

.login-card .bottom-link a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.login-card summary {
  cursor: pointer;
}

.login-card .details-content {
  margin-top: 0.6rem;
}

.auth-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hint-success {
  color: #15803d;
  margin-bottom: 0.8rem;
}

.autosave-status {
  min-height: 1.2rem;
  margin: -0.25rem 0 0.75rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.autosave-status.is-saving {
  color: #92400e;
}

.autosave-status.is-saved {
  color: #15803d;
}

.autosave-status.is-error {
  color: #b91c1c;
}

.text-muted {
  color: #374151;
}

.mt-0 {
  margin-top: 0;
}

@media (max-width: 900px) {
  .cashbook-heading {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
  }

  .cashbook-heading .btn-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .cashbook-heading .btn-row .btn {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }

  .cashbook-filter-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .cashbook-total-balance {
    gap: 8px;
    padding: 12px;
  }

  .cashbook-total-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .cashbook-total-row span {
    font-size: 0.9rem;
    line-height: 1.25;
  }

  .cashbook-total-row--final {
    padding-top: 8px;
  }

  .cashbook-total-row--final strong,
  .cashbook-total-row--final b {
    font-size: 1.15rem;
  }

  .cashbook-filter {
    padding: 12px;
  }

  .cashbook-filter label {
    margin-bottom: 8px;
  }

  .cashbook-filter-grid {
    gap: 8px;
  }

  .cashbook-filter-grid input,
  .cashbook-filter-grid select,
  .cashbook-search-group input[type="search"],
  .cashbook-search-group .btn {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
  }

  .cashbook-filter-grid > select:first-child,
  .cashbook-filter-grid > input[type="date"],
  .cashbook-filter-grid > select:not(:first-child),
  .cashbook-search-group {
    flex-basis: auto;
    max-width: none;
    width: 100%;
  }

  .cashbook-search-group {
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .cashbook-actions {
    justify-content: stretch;
  }

  .cashbook-actions .btn {
    width: 100%;
  }

  .cashbook-entry-form .dialog-actions {
    flex-direction: column-reverse;
  }
}

@media (max-width: 560px) {
  body.page-admin {
    overflow-x: hidden;
  }

  body.page-admin main.admin-main .wrapper {
    max-width: 100%;
    overflow-x: hidden;
  }

  .cashbook-page {
    padding: 12px;
    overflow-x: hidden;
  }

  .cashbook-heading h2 {
    margin-bottom: 8px;
  }

  .cashbook-heading p {
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .cashbook-heading .btn-row .btn {
    padding: 10px 8px;
    font-size: 0.95rem;
  }

  .cashbook-total-row span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .cashbook-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .cashbook-summary .summary-card {
    padding: 9px 10px;
  }

  .cashbook-summary .summary-card strong {
    font-size: 0.86rem;
  }

  .cashbook-summary .summary-card span {
    font-size: 1.05rem;
  }

  .cashbook-independent-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .cashbook-table-wrap {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    overflow-x: auto;
  }
}
