/* =========================================================
   Juwelier Formulare – elegantes, minimalistisches Design
   ========================================================= */

:root {
  --ivory: #FBF9F5;
  --paper: #FFFFFF;
  --ink: #1A1815;
  --ink-soft: #55504A;
  --ink-faint: #8C857C;
  --line: #E6E0D6;
  --line-strong: #D3C9B8;
  --gold: #A8894F;
  --gold-soft: #C9AE79;
  --gold-tint: #F4EEE2;
  --danger: #9A3B32;
  --ok: #4B6B4F;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(26, 24, 21, .04), 0 8px 24px rgba(26, 24, 21, .05);
}

* { box-sizing: border-box; }

/* Das hidden-Attribut muss stärker sein als eigene display-Regeln */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: .01em; margin: 0 0 .4em; }
h1 { font-size: 2.1rem; line-height: 1.15; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; font-family: var(--sans); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration-color: var(--gold-soft); text-underline-offset: 3px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--gold-tint); padding: .15em .4em; border-radius: 2px; }
.muted { color: var(--ink-faint); }
.spacer { flex: 1; }

/* ---------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .62em 1.25em;
  font-family: var(--sans); font-size: .86rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { border-color: var(--gold); background: var(--gold-tint); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #F7F3EC; }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--gold-tint); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #E2CFCB; background: transparent; }
.btn-danger:hover { background: #FBF1EF; border-color: var(--danger); }
.btn-sm { padding: .45em .9em; font-size: .74rem; }
.btn-xl { padding: 1em 2.4em; font-size: 1rem; letter-spacing: .1em; }
.btn-block { width: 100%; }
.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--ink-soft); cursor: pointer; font-size: .95rem;
}
.icon-btn:hover:not(:disabled) { background: var(--gold-tint); border-color: var(--line); }
.icon-btn:disabled { opacity: .25; cursor: default; }
.icon-danger:hover { color: var(--danger); background: #FBF1EF; }

/* ---------------------------------------------------------- Inputs */
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=password], select, textarea {
  width: 100%;
  padding: .7em .85em;
  font-family: var(--sans); font-size: .95rem; font-weight: 300; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(168, 137, 79, .12);
}
textarea { resize: vertical; line-height: 1.55; }
label { display: block; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
label input, label select, label textarea { margin-top: .4em; text-transform: none; letter-spacing: normal; }
label small { display: block; margin-top: .35em; font-size: .78rem; text-transform: none; letter-spacing: normal; color: var(--ink-faint); }
.check { display: flex; align-items: center; gap: .6em; text-transform: none; letter-spacing: normal; font-size: .9rem; color: var(--ink); }
.check input { width: auto; margin: 0; }
.stack { display: grid; gap: 1.1rem; }
.stack > .btn { justify-self: start; }
.stack.tight { gap: .75rem; }

/* ---------------------------------------------------------- Login */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 2rem; }
.login-card {
  width: 100%; max-width: 380px; padding: 3rem 2.5rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center;
}
.login-card form { display: grid; gap: 1rem; text-align: left; margin-top: 1.8rem; }
.login-mark { font-size: 1.6rem; color: var(--gold); }
.login-card h1 { font-size: 1.9rem; margin: .3rem 0 0; }
.login-sub { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); }
.alert {
  padding: .7em 1em; background: #FBF1EF; border: 1px solid #E2CFCB;
  border-radius: var(--radius); color: var(--danger); font-size: .88rem;
}

/* ---------------------------------------------------------- Admin-Shell */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-mark { color: var(--gold); font-size: 1.1rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.brand-text em { font-style: normal; font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }
.topbar-nav { display: flex; gap: 1.5rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.topbar-nav a { text-decoration: none; color: var(--ink-soft); }
.topbar-nav a:hover { color: var(--gold); }

.shell { max-width: 1120px; margin: 0 auto; padding: 2.5rem 2rem 5rem; }

/* Benutzer-Chip in der Kopfzeile */
.user-chip { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold-tint); border: 1px solid var(--line-strong);
  color: var(--gold); font-size: .7rem; font-weight: 500; letter-spacing: .04em;
}
.avatar-lg { width: 62px; height: 62px; font-size: 1.1rem; margin: 0 auto .9rem; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; text-transform: none; letter-spacing: normal; }
.user-name { font-size: .84rem; color: var(--ink); }
.user-role { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }

.readonly-hint {
  padding: .7rem 1rem; margin-bottom: 1.75rem;
  background: var(--gold-tint); border-left: 2px solid var(--gold-soft);
  font-size: .84rem; color: var(--ink-soft);
}
.saved-banner {
  padding: .7em 1em; margin-bottom: 1.5rem;
  background: #F1F5F0; border: 1px solid #D6E0D4; border-radius: var(--radius);
  color: var(--ok); font-size: .88rem;
}

/* ---------------------------------------------------------- Portal */
.portal-head { margin-bottom: 2.25rem; }
.portal-head h1 { font-size: 2.4rem; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.app-tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  gap: .3rem 1.15rem; align-items: start;
  padding: 1.75rem; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.app-tile:hover { border-color: var(--gold-soft); transform: translateY(-2px); }
.app-icon {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--gold); font-size: 1.1rem;
}
.app-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.app-name { font-family: var(--serif); font-size: 1.45rem; line-height: 1.15; color: var(--ink); }
.app-tagline { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.app-desc { margin-top: .5rem; font-size: .87rem; line-height: 1.55; color: var(--ink-soft); }
.app-status {
  grid-column: 2; margin-top: 1rem;
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}
.is-live .app-status { color: var(--gold); }
.is-soon { background: #FCFBF8; }
.is-soon .app-icon { color: var(--ink-faint); border-style: dashed; }
.is-soon .app-name, .is-soon .app-tagline { color: var(--ink-faint); }
.preview-card .badge { margin-bottom: 1rem; display: inline-block; }

/* ---------------------------------------------------------- Profil & Benutzer */
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .profile-layout { grid-template-columns: 1fr; } }
.profile-card { text-align: center; }
.profile-card h2 { border: none; padding: 0; margin-bottom: .2rem; }
.profile-role { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.profile-meta { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); text-align: left; }
.profile-meta > div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; font-size: .85rem; }
.profile-meta dt { color: var(--ink-faint); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.profile-meta dd { margin: 0; }

.user-new { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; align-items: end; }
.user-new-submit { display: flex; align-items: end; }

.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.user-row { border: 1px solid var(--line); border-radius: var(--radius); background: #FDFCFA; min-width: 0; }
.user-row.is-inactive { opacity: .6; }
.user-head { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; flex-wrap: wrap; }
.user-ident { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.user-sub { font-size: .76rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; }
.user-last { font-size: .72rem; color: var(--ink-faint); margin-left: auto; }
.user-row details { border-top: 1px solid var(--line); }
.user-row summary { padding: .6rem 1rem; cursor: pointer; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.user-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; padding: .4rem 1rem 1.25rem; }
@media (max-width: 700px) { .user-edit { grid-template-columns: 1fr; } }
.user-edit-side { display: flex; flex-direction: column; gap: 1rem; }
.user-edit-side .danger-zone { margin-top: auto; padding-top: 1rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.head-actions { display: flex; gap: .6rem; align-items: center; }
.head-actions form { margin: 0; }
.crumb { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 .4rem; }
.crumb a { text-decoration: none; color: var(--ink-faint); }
.lede { color: var(--ink-soft); margin: .3rem 0 0; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.card h2 { padding-bottom: .7rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.empty { color: var(--ink-faint); font-style: italic; padding: 2rem 0; text-align: center; }
.empty.small { padding: 1rem 0; font-size: .9rem; text-align: left; }

.row-form { display: flex; gap: .75rem; flex-wrap: wrap; }
.row-form input[type=text] { flex: 2 1 260px; }
.row-form select { flex: 1 1 220px; width: auto; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.form-card { display: flex; flex-direction: column; margin: 0; }
.form-card h3 { font-family: var(--serif); font-size: 1.35rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: .5rem 0 .3rem; }
.badge { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; padding: .25em .6em; border-radius: 2px; }
.badge-on { background: var(--gold-tint); color: var(--gold); }
.badge-off { background: #F1EFEC; color: var(--ink-faint); }
.meta { display: flex; gap: 1.75rem; margin: 1rem 0; padding: .9rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.meta dt { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.meta dd { margin: .2rem 0 0; font-family: var(--serif); font-size: 1.2rem; }
.link-line { font-size: .82rem; color: var(--ink-faint); }
.card-actions { display: flex; gap: .5rem; margin-top: auto; flex-wrap: wrap; }

/* ---------------------------------------------------------- Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.switches { display: grid; gap: .6rem; }
.form-footer { display: flex; align-items: center; gap: 1rem; }
.save-hint { font-size: .82rem; }
.saved { color: var(--ok); }
.danger-zone { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

.field-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; min-width: 0; }
.field-item { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #FDFCFA; }
.field-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; min-width: 0; }
.field-head form { margin: 0; flex: none; }
.field-type {
  flex: none; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--line-strong); padding: .2em .5em; border-radius: 2px; white-space: nowrap;
}
.field-title {
  flex: 1 1 auto; min-width: 0;
  font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.field-item details { border-top: 1px solid var(--line); }
.field-item summary { padding: .6rem .8rem; cursor: pointer; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.field-item details form { padding: 0 .8rem 1rem; }

.add-field { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips form { margin: 0; }
.chip {
  font-family: var(--sans); font-size: .78rem; padding: .4em .8em;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 100px;
  color: var(--ink-soft); cursor: pointer; transition: all .18s ease;
}
.chip:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-tint); }

/* ---------------------------------------------------------- Auswertung */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.stat-value { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1.1; }
.stat-label { display: block; margin-top: .3rem; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }

.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.total { padding: 0 0 0 1rem; border-left: 2px solid var(--gold-soft); }
.total-label { display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.total-value { display: block; font-family: var(--serif); font-size: 1.75rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.total-sub { display: block; font-size: .78rem; color: var(--ink-faint); }

.breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: .75rem; align-items: center; margin-bottom: .5rem; font-size: .85rem; }
.bar { height: 6px; background: var(--gold-tint); border-radius: 100px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--gold-soft); }
.bar-count { font-variant-numeric: tabular-nums; color: var(--ink-faint); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line-strong);
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500;
}
.table td { padding: .75rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #FDFBF7; }
.nowrap { white-space: nowrap; }
.thumb { height: 34px; border: 1px solid var(--line); border-radius: 2px; background: #fff; }

.record-list { margin: 0; }
.record-row { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.record-row dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); padding-top: .2rem; }
.record-row dd { margin: 0; font-size: 1rem; }
.record-img { max-width: 320px; border: 1px solid var(--line); border-radius: 2px; background: #fff; }
.signature-img { max-width: 380px; border: none; border-bottom: 1px solid var(--ink); border-radius: 0; }
.tech { font-size: .74rem; margin-top: 1.2rem; }
@media (max-width: 700px) { .record-row { grid-template-columns: 1fr; gap: .3rem; } }

/* ---------------------------------------------------------- Kiosk / Kundenformular */
.kiosk { background: var(--ivory); }
.kiosk-frame { min-height: 100vh; display: flex; flex-direction: column; }
.kiosk-head {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  padding: 1.6rem; border-bottom: 1px solid var(--line); background: var(--paper);
}
.kiosk-brand { font-family: var(--serif); font-size: 1.35rem; letter-spacing: .18em; text-transform: uppercase; }
.kiosk-foot { padding: 1.5rem; text-align: center; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }

.sheet { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 3rem 1.75rem 2rem; }
.sheet-title { font-size: 2.6rem; text-align: center; }
.sheet-title::after {
  content: ""; display: block; width: 48px; height: 1px;
  background: var(--gold-soft); margin: 1.1rem auto 0;
}
.sheet-sub { text-align: center; color: var(--ink-soft); margin-top: 1rem; }

.disclaimer {
  max-height: 340px; overflow-y: auto;
  margin: 2rem 0; padding: 1.75rem;
  background: var(--paper); border: 1px solid var(--line); border-left: 2px solid var(--gold-soft);
  border-radius: var(--radius);
  font-size: .95rem; line-height: 1.75; color: var(--ink-soft);
  -webkit-overflow-scrolling: touch;
}
.disclaimer p:last-child { margin-bottom: 0; }

.kiosk-form { display: grid; gap: 1.9rem; margin-top: 2.5rem; }
.kiosk-form .field { display: grid; gap: .5rem; }
.kiosk-form label { text-transform: none; letter-spacing: normal; }
.kiosk-form .label {
  display: block; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}
.kiosk-form input[type=text], .kiosk-form input[type=email], .kiosk-form input[type=tel],
.kiosk-form input[type=number], .kiosk-form input[type=date], .kiosk-form select, .kiosk-form textarea {
  font-size: 1.05rem; padding: .85em .95em; background: var(--paper);
}
.field-heading { font-size: 1.6rem; margin: 1.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.field-info { color: var(--ink-soft); font-size: .95rem; }
.help { color: var(--ink-faint); font-size: .82rem; }
.error { color: var(--danger); font-size: .85rem; }
.has-error input, .has-error textarea, .has-error select,
.has-error .signature-wrap, .has-error .photo-stage { border-color: var(--danger); }

.consent {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.25rem; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 1rem; color: var(--ink); cursor: pointer;
}
.consent input { width: 26px; height: 26px; margin: 0; flex: none; accent-color: var(--gold); }
.choices { display: grid; gap: .5rem; margin-top: .5rem; }
.choice {
  display: flex; align-items: center; gap: .8rem;
  padding: .85rem 1rem; background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 1rem; color: var(--ink); cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--gold); background: var(--gold-tint); }
.choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--gold); }

/* Auswahl als Buttons – große Kacheln zum Antippen */
.option-buttons { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }
.option-button { position: relative; flex: 1 1 180px; text-transform: none; letter-spacing: normal; }
.option-button input {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
}
.option-button > span {
  display: flex; align-items: center; justify-content: center; min-height: 62px;
  padding: .9rem 1.2rem; text-align: center;
  font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer; user-select: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.option-button > span:active { transform: translateY(1px); }
.option-button input:checked > span,
.option-button input:checked + span {
  border-color: var(--ink); background: var(--ink); color: #F7F3EC;
}
.option-button input:checked + span::before {
  content: "✓"; margin-right: .55em; color: var(--gold-soft); font-size: .9em;
}
.option-button input:focus-visible + span {
  outline: none; box-shadow: 0 0 0 3px rgba(168, 137, 79, .25);
}
.has-error .option-button > span { border-color: var(--danger); }

/* Unterschrift */
.signature-wrap {
  position: relative; background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  height: 230px; touch-action: none; overflow: hidden;
}
.signature-pad { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.signature-baseline { position: absolute; left: 10%; right: 10%; bottom: 62px; height: 1px; background: var(--line-strong); }
.signature-hint {
  position: absolute; left: 0; right: 0; bottom: 34px; text-align: center;
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  pointer-events: none; transition: opacity .2s ease;
}
.signature-wrap.has-ink .signature-hint, .signature-wrap.has-ink .signature-baseline { opacity: 0; }
.signature-clear { position: absolute; right: .5rem; top: .5rem; }

/* Foto: Aufnahmefläche in Feldbreite, darunter die Bilderliste */
.photo-wrap { display: grid; gap: .75rem; }
.photo-stage {
  position: relative; display: grid; place-items: center;
  width: 100%; aspect-ratio: 4 / 3; max-height: 300px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden;
}
.photo-stage video { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
  padding: 0 1rem; text-align: center;
}
.photo-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.file-btn { display: inline-flex; text-transform: uppercase; }

.photo-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem;
}
.photo-item {
  position: relative; aspect-ratio: 1;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--paper); overflow: hidden;
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove {
  position: absolute; top: .3rem; right: .3rem;
  width: 28px; height: 28px; display: grid; place-items: center;
  background: rgba(26, 24, 21, .78); color: #F7F3EC;
  border: none; border-radius: 50%; cursor: pointer; font-size: .8rem; line-height: 1;
}
.photo-remove:hover { background: var(--danger); }
.photo-count { font-size: .74rem; margin: 0; }

/* Mehrere Bilder in der Auswertung */
.record-images { display: flex; flex-wrap: wrap; gap: .6rem; }

.submit-row { margin-top: 1.5rem; text-align: center; }
.legal a { color: var(--ink-faint); }
.submit-row .btn { width: 100%; max-width: 420px; }
.legal { margin-top: 1rem; font-size: .78rem; color: var(--ink-faint); }

.done { display: grid; place-content: center; text-align: center; gap: .5rem; min-height: 60vh; }
.done-mark { font-size: 2.5rem; color: var(--gold); }
.done-text { color: var(--ink-soft); max-width: 34ch; margin: 0 auto 1.5rem; }
.done .btn { justify-self: center; }

/* =========================================================
   App „Aufgaben"
   ========================================================= */

.head-icon { color: var(--gold); margin-right: .3rem; }
.mine-list, .checklist, .note-list { list-style: none; margin: 0; padding: 0; }
.mine-row { display: flex; align-items: center; gap: .9rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.mine-row:last-child { border-bottom: none; }
.mine-row a { text-decoration: none; }
.mine-list-name { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.mine-row .due { margin-left: auto; }

.list-new { display: grid; grid-template-columns: 2fr 1.3fr .6fr 2fr auto; gap: 1rem; align-items: end; }
@media (max-width: 900px) { .list-new { grid-template-columns: 1fr 1fr; } }

.list-card { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1.1rem; text-decoration: none; margin: 0; }
.list-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold); }
.list-body { display: flex; flex-direction: column; min-width: 0; }
.list-name { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); }
.list-kind { font-size: .66rem; letter-spacing: .13em; text-transform: uppercase; color: var(--gold); }
.list-desc { margin-top: .4rem; font-size: .86rem; color: var(--ink-soft); }
.list-counts { grid-column: 2; margin-top: .9rem; display: flex; gap: .8rem; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.count-late { color: var(--danger); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr; } }
.kanban-col { background: #FCFBF8; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.col-head { display: flex; align-items: baseline; gap: .6rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); margin-bottom: .9rem; }
.col-head h2 { margin: 0; font-family: var(--sans); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.col-count { margin-left: auto; font-size: .74rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.col-body { display: grid; gap: .6rem; min-height: 40px; border-radius: var(--radius); transition: background .15s ease; }
.col-body.is-dropping { background: var(--gold-tint); outline: 1px dashed var(--gold-soft); outline-offset: 3px; }
.col-empty { color: var(--ink-faint); font-size: .82rem; font-style: italic; padding: .4rem 0; margin: 0; }

.task-card {
  background: var(--paper); border: 1px solid var(--line-strong); border-left: 2px solid var(--line-strong);
  border-radius: var(--radius); padding: .8rem .9rem; cursor: grab; min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.task-card:hover { box-shadow: var(--shadow); }
.task-card.is-dragging { opacity: .4; }
.task-card.prio-hoch { border-left-color: var(--danger); }
.task-card.prio-niedrig { border-left-color: var(--line); }
.task-card.is-done { opacity: .62; }
.task-card.is-done .task-title { text-decoration: line-through; }
.task-top { display: flex; align-items: start; gap: .6rem; }
.task-top form { margin: 0; }
.task-check {
  flex: none; width: 20px; height: 20px; margin-top: .1rem;
  display: grid; place-items: center; font-size: .7rem; line-height: 1;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 3px;
  color: var(--gold); cursor: pointer;
}
.task-check:hover { border-color: var(--gold); }
.task-check.is-checked, .is-done .task-check { background: var(--gold-tint); border-color: var(--gold-soft); }
.task-title { font-size: .93rem; line-height: 1.35; color: var(--ink); text-decoration: none; }
.task-title:hover { color: var(--gold); }

.task-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.tag { font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; padding: .15em .5em; background: var(--gold-tint); color: var(--gold); border-radius: 100px; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: .6rem; font-size: .74rem; color: var(--ink-faint); }
.assignee { display: flex; align-items: center; gap: .35rem; }
.avatar-sm { width: 22px; height: 22px; font-size: .58rem; }
.due { font-size: .72rem; letter-spacing: .04em; color: var(--ink-soft); white-space: nowrap; }
.due.is-soon { color: var(--gold); }
.due.is-overdue { color: var(--danger); font-weight: 500; }
.task-badge { font-size: .72rem; }

.task-move { display: flex; gap: .35rem; margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.task-move form { margin: 0; }
.move-btn {
  font-family: var(--sans); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .25em .6em; background: transparent; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 100px; cursor: pointer;
}
.move-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-tint); }

.col-add { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line); display: grid; gap: .5rem; justify-items: stretch; }
.col-add > .btn { justify-self: end; }
.col-add input[type=text] { font-size: .88rem; }
.add-more summary { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); cursor: pointer; }
.add-fields { display: grid; gap: .6rem; margin-top: .6rem; }
.add-fields label { font-size: .68rem; }

/* Einfache Liste / Einkaufsliste */
.check-add { display: grid; grid-template-columns: 1fr auto auto auto; gap: .6rem; margin-bottom: 1.25rem; }
@media (max-width: 760px) { .check-add { grid-template-columns: 1fr; } }
.check-add select, .check-add input[type=date] { width: auto; }
.check-row { display: flex; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.check-row form { margin: 0; }
.check-title { flex: 1 1 auto; min-width: 0; font-size: .98rem; text-decoration: none; }
.check-row .due { margin-left: auto; }
.check-when { font-size: .74rem; color: var(--ink-faint); margin-left: auto; }
.is-done-list .check-title { text-decoration: line-through; color: var(--ink-faint); }
.done-block { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.done-block summary { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); cursor: pointer; }

/* Aufgaben-Detail */
.task-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .task-layout { grid-template-columns: 1fr; } }
.task-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.note { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.note-head { display: flex; align-items: center; gap: .6rem; }
.note-head form { margin-left: auto; }
.note-author { font-size: .86rem; }
.note-when { font-size: .74rem; color: var(--ink-faint); }
.note-body { margin: .5rem 0 0 calc(22px + .6rem); white-space: pre-wrap; font-size: .93rem; }
.note-form { margin-top: 1.25rem; display: grid; gap: .7rem; justify-items: start; }
.note-form textarea { width: 100%; }

.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.attachment { margin: 0; }
.attachment img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); }
.file-icon { display: grid; place-items: center; aspect-ratio: 1; font-size: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.attachment figcaption { display: flex; align-items: center; gap: .3rem; margin-top: .3rem; }
.file-name { flex: 1 1 auto; min-width: 0; font-size: .7rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-form input[type=file] { font-size: .82rem; }

/* =========================================================
   App „Arbeitsplan"
   ========================================================= */

.view-switch { display: flex; gap: .3rem; }
.view-switch a {
  padding: .5em 1em; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
.view-switch a:hover { border-color: var(--gold); color: var(--gold); }
.view-switch a.is-active { background: var(--ink); border-color: var(--ink); color: #F7F3EC; }

.week-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.week-steps, .week-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.week-tools form { margin: 0; display: flex; gap: .5rem; align-items: center; }
.apply-form select { width: auto; font-size: .85rem; padding: .45em .7em; }
.apply-form .check { font-size: .78rem; white-space: nowrap; }

/* Wochengitter */
.plan-grid { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.plan-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.plan-table th, .plan-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan-table thead th {
  padding: .7rem .5rem; text-align: center; background: #FCFBF8;
  border-bottom: 1px solid var(--line-strong);
}
.plan-table thead th.is-today { background: var(--gold-tint); }
.day-name { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--ink); font-weight: 500; }
.day-date { display: block; font-size: .66rem; letter-spacing: .1em; color: var(--ink-faint); }
.corner { width: 130px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.sum-col { width: 62px; text-align: center; font-variant-numeric: tabular-nums; font-size: .85rem; background: #FCFBF8; }

.staff-cell { padding: .6rem .8rem; text-align: left; background: #FCFBF8; white-space: nowrap; }
.staff-initials { display: block; font-family: var(--serif); font-size: 1.3rem; line-height: 1.1; }
.staff-name { display: block; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }

.plan-cell { padding: 0; vertical-align: top; position: relative; }
.plan-cell.is-today { background: #FEFCF7; }
.cell summary { list-style: none; cursor: pointer; }
.cell summary::-webkit-details-marker { display: none; }
.cell-face {
  display: grid; place-items: center; gap: .1rem;
  min-height: 74px; padding: .5rem; text-align: center;
  transition: background .15s ease;
}
.cell-face:hover { background: var(--gold-tint); }
.shift { font-family: var(--serif); font-size: 1.5rem; line-height: 1; color: #2A4A8A; white-space: nowrap; }
.shift-sep { color: var(--line-strong); margin: 0 .05em; }
.shift-break { font-size: .68rem; color: var(--ink-faint); }
/* Freier Tag: der rote Strich vom Whiteboard */
.free-mark { display: block; width: 46px; height: 24px; position: relative; }
.free-mark::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; background: #C0453A; transform: rotate(-24deg); border-radius: 2px;
}
.absence-mark {
  font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .25em .6em; border-radius: 100px; background: var(--gold-tint); color: var(--gold);
}
.kind-urlaub { background: #E8EFF6; color: #38618C; }
.kind-krank { background: #FBF1EF; color: var(--danger); }
.kind-schulung { background: #F0F1E8; color: #6B7040; }
.kind-frei, .kind-sonstiges { background: #F1EFEC; color: var(--ink-faint); }

.cell-edit { padding: .8rem; border-top: 1px solid var(--line); background: #FCFBF8; text-align: left; }
.cell-title { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 .5rem; }
.cell-hint { font-size: .74rem; color: var(--danger); margin: -.3rem 0 .5rem; }
.cell-form { display: grid; gap: .5rem; }
.time-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .4rem; }
.time-row label { font-size: .6rem; }
.time-row input, .time-row select { padding: .4em .5em; font-size: .82rem; margin-top: .2rem; }
.presets { display: flex; flex-wrap: wrap; gap: .25rem; }
.preset {
  font-family: var(--sans); font-size: .64rem; padding: .3em .55em;
  background: var(--paper); border: 1px solid var(--line); border-radius: 100px;
  color: var(--ink-faint); cursor: pointer; white-space: nowrap;
}
.preset:hover { border-color: var(--gold); color: var(--gold); }
.cell-edit input[type=text] { font-size: .82rem; padding: .4em .5em; }
.cell-actions { display: flex; gap: .4rem; }

.plan-table tfoot td, .plan-table tfoot th {
  background: #FCFBF8; text-align: center; padding: .5rem;
  font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--ink-soft);
  border-top: 1px solid var(--line-strong);
}
.plan-table tfoot .staff-cell { text-align: left; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.sum-col.total { font-weight: 500; color: var(--ink); }

.absence-strip .absence-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.absence-list li { display: flex; align-items: center; gap: .6rem; font-size: .86rem; }
.absence-list.spaced li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.inline-del { margin-left: auto; }

/* Monatsansicht */
.month-grid { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; margin-bottom: 1.5rem; }
.month-head, .month-row { display: grid; grid-template-columns: 58px repeat(6, minmax(110px, 1fr)); min-width: 760px; }
.month-head { background: #FCFBF8; border-bottom: 1px solid var(--line-strong); }
.month-head span { padding: .6rem; text-align: center; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.month-kw {
  display: grid; place-items: center; font-size: .66rem; letter-spacing: .08em;
  color: var(--gold); text-decoration: none; background: #FCFBF8; border-right: 1px solid var(--line);
}
.month-day { min-height: 92px; padding: .45rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .18rem; }
.month-day.is-outside { background: #FBFAF7; opacity: .5; }
.month-day.is-today { background: var(--gold-tint); }
.month-date { font-size: .72rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.month-shift { font-size: .7rem; color: var(--ink-soft); white-space: nowrap; }
.month-shift strong { color: #2A4A8A; }
.month-absence { font-size: .62rem; padding: .1em .45em; border-radius: 100px; align-self: start; }

/* Auswertung */
.range-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.range-form input { width: auto; }
.eval-rows { display: grid; gap: .9rem; }
.eval-row { display: grid; grid-template-columns: 170px minmax(80px, 2fr) 70px 1fr; gap: 1rem; align-items: center; font-size: .88rem; }
@media (max-width: 760px) { .eval-row { grid-template-columns: 1fr; gap: .2rem; } }
.eval-name strong { font-family: var(--serif); font-size: 1.15rem; margin-right: .4rem; }
.eval-hours { text-align: right; font-variant-numeric: tabular-nums; }
.eval-detail { font-size: .78rem; }

/* Vorlagen und Team */
.template-card h3 { font-family: var(--serif); font-size: 1.3rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.template-count { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.mini-plan { width: 100%; border-collapse: collapse; font-size: .8rem; }
.mini-plan td { padding: .25rem .4rem .25rem 0; border-bottom: 1px solid var(--line); }

.staff-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .staff-layout { grid-template-columns: 1fr; } }
.staff-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .5rem; }
.staff-row { border: 1px solid var(--line); border-radius: var(--radius); background: #FDFCFA; }
.staff-row.is-inactive { opacity: .55; }
.staff-head { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; }
.staff-head .staff-initials { font-size: 1.2rem; color: var(--gold); }
.staff-ident { display: flex; flex-direction: column; line-height: 1.3; }
.staff-ident .muted { font-size: .72rem; }
.staff-row details { border-top: 1px solid var(--line); }
.staff-row summary { padding: .5rem .9rem; cursor: pointer; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.staff-form { display: grid; grid-template-columns: 80px 1fr 100px auto auto; gap: .7rem; align-items: end; padding: .3rem .9rem 1rem; }
.staff-form label { font-size: .64rem; }
.new-staff { padding: 1rem 0 0; border-top: 1px solid var(--line); grid-template-columns: 80px 1fr 100px auto; }
@media (max-width: 700px) { .staff-form, .new-staff { grid-template-columns: 1fr 1fr; } }
.absence-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; align-items: end; margin-bottom: 1.5rem; }
.absence-form .wide { grid-column: 1 / -1; }
.absence-form label { font-size: .66rem; }

/* =========================================================
   Apps „22k Preisliste" und „Altgold/Metall"
   ========================================================= */

.rate-banner {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1rem; margin-bottom: 1.25rem;
  background: var(--paper); border: 1px solid var(--line); border-left: 2px solid var(--gold-soft);
  border-radius: var(--radius); font-size: .84rem; color: var(--ink-soft);
}
.rate-banner.is-missing { border-left-color: var(--danger); color: var(--danger); }
.rate-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.rate-headline { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin-bottom: 1.5rem; }
.rate-headline strong { color: var(--gold); font-weight: 500; }
.spinner { display: none; }
.htmx-request .spinner, .htmx-request.spinner { display: inline-block; }
.spinner::after {
  content: "…"; letter-spacing: .1em;
}

.rate-inline { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-left: auto; }
.rate-chip { font-size: .78rem; color: var(--ink-faint); white-space: nowrap; }
.rate-chip strong { color: var(--ink); font-weight: 500; }
.chip-manual {
  font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .1em .4em; border-radius: 100px; background: var(--gold-tint); color: var(--gold);
}

/* Produktkacheln (Preisliste und Ankauf) */
.price-card h2 { font-family: var(--serif); font-size: 1.35rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.25rem; }
.product {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  overflow: hidden; transition: border-color .18s ease, box-shadow .18s ease;
}
.product:hover { border-color: var(--gold-soft); box-shadow: var(--shadow); }
.product-image {
  display: grid; place-items: center; aspect-ratio: 4 / 3;
  background: #FCFBF8; border-bottom: 1px solid var(--line); overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { font-size: 1.5rem; color: var(--line-strong); }
.product-body { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem 1rem; }
.product-name { font-size: .95rem; line-height: 1.3; }
.product-specs { font-size: .72rem; color: var(--ink-faint); }
.product-note { font-size: .74rem; color: var(--ink-soft); font-style: italic; }
.product-price {
  margin-top: .5rem; font-family: var(--serif); font-size: 1.55rem; line-height: 1.1; color: var(--ink);
}
.product-price .unit { font-family: var(--sans); font-size: .72rem; color: var(--ink-faint); margin-left: .2em; }

.item-thumb {
  flex: none; width: 40px; height: 40px; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--radius); background: #FCFBF8;
}
.item-thumb.is-empty { display: grid; place-items: center; color: var(--line-strong); }
.item-price .unit { font-family: var(--sans); font-size: .68rem; color: var(--ink-faint); }
.check.inline { display: inline-flex; margin-left: .5rem; }

/* Metalle */
.metal-new { display: grid; grid-template-columns: 1fr 1.4fr 1fr auto; gap: 1rem; align-items: end; }
@media (max-width: 800px) { .metal-new { grid-template-columns: 1fr 1fr; } }
.metal-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; padding: .3rem .9rem 1.25rem; }
@media (max-width: 700px) { .metal-edit { grid-template-columns: 1fr; } }
.metal-side { display: flex; flex-direction: column; gap: 1rem; }
.metal-side .danger-zone { margin-top: auto; padding-top: 1rem; }

/* Formeleditor */
.formula-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; margin-top: 1.25rem; }
.formula-help h3 { font-size: .68rem; letter-spacing: .14em; margin-bottom: .8rem; }
.help-list { margin: 0; }
.help-list > div { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.help-list dt { font-size: .8rem; }
.help-list dd { margin: .1rem 0 0; font-size: .78rem; color: var(--ink-faint); }
.help-examples { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.help-examples li { display: flex; flex-direction: column; gap: .1rem; }
.help-examples span { font-size: .74rem; color: var(--ink-faint); }
.help-examples code, .help-list code { font-size: .78rem; }

.formula-field .formula-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem;
  background: #FCFBF8;
}
.item-formula {
  font-size: .72rem; color: var(--ink-soft); background: #FCFBF8;
  padding: .2em .5em; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch;
}
.formula-error { color: var(--danger); font-family: var(--sans); font-size: .78rem; }
.formula-error-detail {
  margin: 0; padding: .5rem .9rem .8rem; font-size: .8rem; color: var(--danger);
}
.item-row.has-error { border-color: #E2CFCB; }

.item-form {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem 1.25rem; align-items: start;
}
.item-form .col-2 { grid-column: span 2; }
.item-form .col-full { grid-column: 1 / -1; }
.item-form label { font-size: .64rem; min-width: 0; }
.item-form small { min-height: 1em; }
.item-form input[type=file] { font-size: .8rem; padding: .5em 0; }
.item-form .form-actions {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
@media (max-width: 900px) {
  .item-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-form .col-2 { grid-column: span 2; }
}
@media (max-width: 560px) {
  .item-form { grid-template-columns: 1fr; }
  .item-form .col-2 { grid-column: span 1; }
}
.item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.item-row { border: 1px solid var(--line); border-radius: var(--radius); background: #FDFCFA; min-width: 0; }
.item-row.is-inactive { opacity: .55; }
.item-head { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; padding: .75rem .9rem; }
.item-title { font-size: .96rem; }
.item-tag { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--line-strong); padding: .15em .5em; border-radius: 100px; }
.item-calc { font-size: .76rem; }
.item-price { margin-left: auto; font-family: var(--serif); font-size: 1.25rem; }
.item-row details { border-top: 1px solid var(--line); }
.item-row summary { padding: .55rem .9rem; cursor: pointer; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.item-row details form { padding: .3rem .9rem 1rem; }

/* Kurskarten */
.rate-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.rate-card {
  display: flex; flex-direction: column; gap: .1rem;
  padding: 1.25rem 1.4rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.rate-metal { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.rate-market { font-size: .76rem; color: var(--ink-faint); }
.rate-buy { font-family: var(--serif); font-size: 1.9rem; line-height: 1.2; margin-top: .3rem; }
.rate-buy-label { font-size: .7rem; color: var(--ink-faint); }

/* Ankaufsrechner */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.calc-grid input, .calc-grid select { font-size: 1.05rem; padding: .75em .85em; }
.calc-result {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: center;
  padding: 1.5rem; background: #FCFBF8; border: 1px solid var(--line); border-radius: var(--radius);
}
@media (max-width: 760px) { .calc-result { grid-template-columns: 1fr; } }
.calc-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1rem; }
.calc-step { display: flex; flex-direction: column; gap: .15rem; }
.step-label { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.step-value { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.calc-total { text-align: right; border-left: 1px solid var(--line); padding-left: 1.5rem; }
@media (max-width: 760px) { .calc-total { border-left: none; padding-left: 0; text-align: left; } }
.total-caption { display: block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.total-amount { display: block; font-family: var(--serif); font-size: 2.6rem; line-height: 1.15; color: var(--gold); }
.total-hint { display: block; font-size: .74rem; font-variant-numeric: tabular-nums; }
.calc-note { margin-top: 1.25rem; font-size: .8rem; }

.metal-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.metal-setting { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: #FDFCFA; }
.metal-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; padding-bottom: .7rem; border-bottom: 1px solid var(--line); margin-bottom: .9rem; }
.metal-name { font-family: var(--serif); font-size: 1.3rem; }
.metal-head .muted { font-size: .76rem; }
.metal-result { margin-left: auto; color: var(--gold); font-size: .95rem; }
.metal-form { display: grid; gap: .7rem; justify-items: start; }
.metal-form label { width: 100%; font-size: .66rem; }
.manual-rate { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.alloy-form { display: grid; grid-template-columns: 1fr 2fr 1fr auto; gap: .8rem; align-items: end; margin-bottom: 1.5rem; }
@media (max-width: 700px) { .alloy-form { grid-template-columns: 1fr 1fr; } }
.table .num { text-align: right; }
.table th.num { text-align: right; }

/* =========================================================
   Druckbeleg – ein Eintrag auf einer A4-Seite
   ========================================================= */

.print-sheet { display: none; }

@media print {
  @page { size: A4 portrait; margin: 12mm 13mm; }

  html, body {
    background: #fff; color: #000;
    font-size: 9pt; line-height: 1.35;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .topbar, .no-print, .kiosk-foot { display: none !important; }
  .shell { max-width: none; margin: 0; padding: 0; }

  .print-sheet { display: block; }

  /* Kopf */
  .ps-head {
    display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 6mm;
    padding-bottom: 2.5mm; border-bottom: .6pt solid #000;
  }
  .ps-brand { display: flex; align-items: baseline; gap: 2mm; font-family: var(--serif); font-size: 12pt; letter-spacing: .12em; text-transform: uppercase; }
  .ps-brand .brand-mark { color: var(--gold); font-size: 9pt; }
  .ps-doc h1 { font-family: var(--serif); font-size: 14pt; line-height: 1.1; margin: 0; }
  .ps-doc p { margin: .5mm 0 0; font-size: 7pt; color: #444; }
  .ps-meta { display: grid; grid-template-columns: auto auto; gap: 0 2mm; margin: 0; text-align: right; font-size: 7pt; }
  .ps-meta dt { color: #666; text-transform: uppercase; letter-spacing: .08em; }
  .ps-meta dd { margin: 0; font-variant-numeric: tabular-nums; }

  /* Bedingungen / Haftungsausschluss – zweispaltig, damit es kompakt bleibt */
  .ps-terms {
    columns: 2; column-gap: 6mm; column-rule: .4pt solid #DDD;
    margin: 2.5mm 0; padding-bottom: 2.5mm; border-bottom: .4pt solid #CCC;
    font-size: 6.4pt; line-height: 1.32; text-align: justify; color: #222;
    orphans: 2; widows: 2;
  }
  .ps-terms p { margin: 0 0 1.2mm; }
  .ps-terms p:last-child { margin-bottom: 0; }

  /* Ausgefüllte Angaben – zwei Spalten */
  .ps-data {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 6mm;
    margin: 3mm 0;
  }
  .ps-cell { break-inside: avoid; min-width: 0; }
  .ps-wide { grid-column: 1 / -1; }
  .ps-label {
    display: block; font-size: 6pt; letter-spacing: .1em; text-transform: uppercase; color: #777;
  }
  .ps-value {
    display: block; font-size: 9pt; padding-bottom: .6mm; border-bottom: .4pt dotted #999;
    overflow-wrap: anywhere;
  }

  /* Erklärungen, Fotos, Unterschrift */
  .ps-bottom {
    display: grid; grid-template-columns: 1fr auto; gap: 6mm; align-items: end;
    margin-top: 3mm; padding-top: 2.5mm; border-top: .4pt solid #CCC;
    break-inside: avoid;
  }
  .ps-consents { list-style: none; margin: 0 0 2mm; padding: 0; font-size: 7pt; line-height: 1.35; }
  .ps-consents li { display: flex; gap: 1.5mm; margin-bottom: 1mm; }
  .ps-check { flex: none; font-size: 8pt; line-height: 1; }
  .ps-photos { display: flex; gap: 3mm; }
  .ps-photos img { height: 20mm; border: .4pt solid #BBB; }
  .ps-photos figcaption { font-size: 5.5pt; color: #777; margin-top: .5mm; }

  .ps-signatures { display: flex; gap: 6mm; }
  .ps-sign { margin: 0; text-align: center; }
  .ps-sign img {
    display: block; height: 17mm; width: auto; max-width: 62mm;
    object-fit: contain; margin: 0 auto;
  }
  .ps-sign figcaption {
    margin-top: .8mm; padding-top: 1mm; border-top: .6pt solid #000;
    font-size: 6pt; letter-spacing: .06em; text-transform: uppercase; color: #444;
    min-width: 55mm;
  }

  .ps-foot {
    margin-top: 3mm; padding-top: 1.5mm; border-top: .4pt solid #DDD;
    font-size: 5.8pt; letter-spacing: .06em; color: #888; text-align: center;
  }
}

/* Zwischenüberschriften im Datenschutztext */
.privacy-heading {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin: 2rem 0 .6rem;
}
.privacy-heading-inline {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin: 1.4rem 0 .4rem;
}

/* Mitarbeiterauswahl im Formular und in der Auswertung */
.staff-buttons .option-button > span { flex-direction: column; gap: .35rem; line-height: 1.2; }
.staff-buttons .option-button input:checked + span::before { margin: 0 0 .1rem; }
.staff-badge {
  display: inline-block; padding: .2em .7em;
  font-family: var(--serif); font-size: .92rem; line-height: 1.35; letter-spacing: .06em;
  background: var(--gold-tint); color: var(--gold);
  border: 1px solid var(--line-strong); border-radius: 100px;
}
.option-button input:checked + span .staff-badge {
  background: transparent; color: var(--gold-soft); border-color: var(--gold-soft);
}
