/* PASELIX Handwerk – ruhige Linie wie Paselix: eine Aktionsfarbe (Blau), Rest neutral */

@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/poppins-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 800; font-style: normal; font-display: swap; src: url('/fonts/poppins-latin-800-normal.woff2') format('woff2'); }

:root {
  --bg: #F5F6FB;
  --card: #ffffff;
  --navy: #1B2250;
  --blue: #4F6BFF;
  --action: #4F46E5;
  --action-dark: #3730A3;
  --action-soft: #EEF1FF;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #475569;
  --line: #e2e8f0;
  --line-2: #f1f5f9;
  --ok-bg: #DCFCE7; --ok: #166534;
  --warn-bg: #FEF3C7; --warn: #92400E;
  --danger: #b91c1c; --danger-bg: #FEF2F2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Poppins', system-ui, -apple-system, Segoe UI, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--action); }
a:hover { color: var(--action-dark); }
button { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(79,107,255,.45); outline-offset: 2px; }

.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; padding-top: env(safe-area-inset-top); padding-bottom: 120px; }
.shell.no-tabs { padding-bottom: 40px; }
.pad { padding: 0 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }

/* Logo */
.logo-word { font-size: 22px; font-weight: 800; letter-spacing: .5px; line-height: 1.1; }
.logo-word .pa { color: var(--navy); }
.logo-word .selix { color: var(--blue); }
.logo-sub { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.topbar { padding: 20px 20px 0; display: flex; align-items: center; justify-content: space-between; }

/* Überschriften */
.h1 { margin: 0; font-size: 20px; font-weight: 800; color: var(--navy); }
.title-row { padding: 24px 20px 6px; display: flex; align-items: center; gap: 10px; }
.sub { margin: 0 20px 16px; font-size: 13px; color: var(--muted); }
.ico-sq { width: 30px; height: 30px; border-radius: 9px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.hdr { padding: 14px 12px 4px; display: flex; align-items: center; gap: 4px; }
.back { width: 44px; height: 44px; border: none; background: none; color: var(--navy); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 12px; flex: none; }
.back:hover { background: #e9ecf5; }
.lbl { display: block; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.lbl small { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* Karten */
.card { background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.06); padding: 16px; }
.card.tap { cursor: pointer; border: none; text-align: left; width: 100%; font: inherit; color: inherit; display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.card.tap:hover { background: #fafbff; }
.list-ico { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--action-soft); color: var(--action); display: flex; align-items: center; justify-content: center; }
.item-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chev { color: #94a3b8; flex: none; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.stat { border: none; text-align: left; font: inherit; cursor: pointer; }
.stat b { display: block; font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.stat span { font-size: 12px; font-weight: 600; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* Formulare */
.in { width: 100%; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: 15px; color: var(--ink); outline: none; }
.in:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,107,255,.18); }
textarea.in { resize: vertical; min-height: 84px; }
.field + .field { margin-top: 16px; }
.err { margin: 6px 0 0; font-size: 13px; color: var(--danger); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Buttons */
.btn { width: 100%; min-height: 52px; border: none; border-radius: 16px; background: var(--action); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; text-decoration: none; }
.btn:hover { background: #4338CA; color: #fff; }
.btn[disabled] { background: #a5b4fc; cursor: not-allowed; }
.btn.sec { background: #fff; color: var(--action); box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.btn.sec:hover { background: #fafbff; color: var(--action-dark); }
.btn.soft { background: var(--action-soft); color: var(--action-dark); box-shadow: none; }
.btn.grey { background: #f1f5f9; color: var(--ink-2); box-shadow: none; min-height: 46px; font-size: 14px; }
.btn.small { min-height: 44px; font-size: 14px; border-radius: 14px; }
.btn.danger-link { background: none; color: var(--danger); box-shadow: none; min-height: 44px; font-size: 14px; font-weight: 600; }
.link-btn { background: none; border: none; color: var(--action); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.chip.on { background: var(--action); color: #fff; box-shadow: none; }
.check { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: none; background: none; font: inherit; font-size: 14px; color: var(--ink); padding: 9px 0; cursor: pointer; line-height: 1.45; width: 100%; }
.check .box { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid #94a3b8; background: #fff; display: flex; align-items: center; justify-content: center; color: #fff; }
.check[aria-checked="true"] .box { background: var(--action); border-color: var(--action); }
.tgl-row { display: flex; align-items: center; gap: 12px; }
.tgl { width: 50px; height: 30px; flex: none; border: none; border-radius: 999px; padding: 3px; cursor: pointer; background: #cbd5e1; display: flex; align-items: center; }
.tgl .knob { width: 24px; height: 24px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.tgl[aria-checked="true"] { background: var(--action); }
.tgl[aria-checked="true"] .knob { transform: translateX(20px); }
.swatch { width: 44px; height: 44px; border-radius: 12px; cursor: pointer; border: 3px solid transparent; }
.swatch.on { border-color: var(--blue); }
.del { width: 36px; height: 36px; border: none; background: none; color: #94a3b8; cursor: pointer; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.del:hover { color: #dc2626; background: #fef2f2; }

/* Pillen */
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #F1F5F9; color: var(--ink-2); }
.pill.neu { background: var(--action-soft); color: var(--action-dark); }
.pill.bearbeitung { background: var(--warn-bg); color: var(--warn); }
.pill.erledigt { background: var(--ok-bg); color: var(--ok); }
.dot { width: 9px; height: 9px; border-radius: 999px; background: var(--action); }

/* Fotos */
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photo { width: 76px; height: 76px; border-radius: 12px; background: #e2e8f0; color: #64748b; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo a { display: block; width: 100%; height: 100%; }
.photo .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 999px; border: 2px solid #fff; background: rgba(15,23,42,.7); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.photo-add { width: 76px; height: 76px; border-radius: 12px; border: 1.5px dashed #a5b4fc; background: var(--action-soft); color: var(--action-dark); font-size: 11px; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }

/* QR */
.qr-box { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: inline-flex; }
.qr-box svg { display: block; width: 190px; height: 190px; }
.center { display: flex; flex-direction: column; align-items: center; text-align: center; }

/* Hinweise */
.note-ok { padding: 12px; border-radius: 12px; background: #F0FDF4; display: flex; gap: 10px; align-items: center; color: var(--ok); font-size: 13px; }
.note-danger { padding: 14px; border-radius: 16px; background: var(--danger-bg); display: flex; gap: 10px; color: #7f1d1d; font-size: 13px; line-height: 1.5; }
.note-danger svg { color: var(--danger); flex: none; margin-top: 1px; }
.bubble { padding: 12px 14px; background: var(--bg); border-radius: 4px 14px 14px 14px; font-size: 14px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty .btn { margin-top: 12px; }

/* FAB & Tabs */
.fab { position: fixed; right: max(20px, calc(50% - 260px)); bottom: 92px; width: 58px; height: 58px; border-radius: 999px; border: none; background: var(--action); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 16px rgba(79,70,229,.35); z-index: 20; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; box-shadow: 0 -1px 0 #eef0f5; z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.tabs-inner { max-width: 560px; margin: 0 auto; display: flex; height: 66px; }
.tab { flex: 1; border: none; background: none; font-size: 11px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); }
.tab.on { color: var(--action); }
.tab .ic { position: relative; display: flex; }
.badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); max-width: min(520px, calc(100% - 40px)); padding: 12px 16px; border-radius: 14px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 500; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Laden */
.loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 999px; border: 3px solid #c7d2fe; border-top-color: var(--action); animation: spin .8s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth */
.auth { max-width: 420px; margin: 0 auto; padding: 48px 20px 40px; }
.auth .logo { margin-bottom: 28px; }

details.card { padding: 0 16px; }
details.card summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
details.card summary::-webkit-details-marker { display: none; }
details.card[open] summary .arr { transform: rotate(90deg); }
details.card .arr { transition: transform .15s; }
details.card .body { padding-bottom: 14px; }

/* Druck: Etikett */
#print-area { display: none; }
@media print {
  @page { margin: 10mm; }
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .label { width: 70mm; border: 0.3mm dashed #94a3b8; border-radius: 3mm; padding: 4mm; display: inline-flex; flex-direction: column; align-items: center; text-align: center; margin: 0 4mm 4mm 0; break-inside: avoid; font-family: 'Poppins', sans-serif; color: #0f172a; }
  .label svg { width: 40mm; height: 40mm; }
  .label .t { font-size: 9pt; font-weight: 700; margin-top: 2mm; text-transform: uppercase; letter-spacing: .5pt; }
  .label .b { font-size: 8pt; margin-top: 1mm; }
  .label .s { font-size: 7pt; color: #475569; margin-top: .5mm; }
}
.in::placeholder { letter-spacing: 0; font-size: 15px; color: #94a3b8; }
