/* Kap-Arkona-Design (Tokens aus fotogalerie-pwa: dunkles Marineblau, Nordlicht-Akzente) */
:root {
  --bg: #0b1120;
  --panel: #131c31;
  --panel-2: #1a2540;
  --line: #2a3756;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --sky: #38bdf8;
  --teal: #2dd4bf;
  --rose: #f43f5e;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: system-ui, 'Segoe UI', Roboto, sans-serif; position: relative;
}
body::before {
  content: ''; position: fixed; inset: -25%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 20% 18%, rgba(56,189,248,.28), transparent 65%),
    radial-gradient(ellipse 50% 35% at 82% 12%, rgba(45,212,191,.2), transparent 65%),
    radial-gradient(ellipse 55% 40% at 55% 88%, rgba(244,63,94,.15), transparent 65%);
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(-2%,-1.5%,0) scale(1); } to { transform: translate3d(3%,2%,0) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
#app, #login { position: relative; z-index: 1; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: #fda4af; min-height: 1.2em; margin: .25rem 0; }
.notice { min-height: 1.4em; margin: .25rem 1rem; color: var(--teal); }
.notice.err { color: #fda4af; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.login { max-width: 380px; margin: 12vh auto 0; }
.login h1 { margin: 0 0 .25rem; font-size: 1.4rem; }

label { display: block; margin: .6rem 0; font-size: .9rem; color: var(--muted); }
input { display: block; width: 100%; margin-top: .25rem; padding: .55rem .7rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font: inherit; }
input:focus-visible, .btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }

.btn, .tab { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .9rem; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover, .tab:hover { border-color: var(--sky); }
.btn.primary, .tab.active { background: var(--sky); color: #04121f; border-color: var(--sky); font-weight: 600; }
.btn.danger { border-color: var(--rose); color: #fda4af; }

.topbar { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center;
  padding: .8rem 1rem; background: rgba(19,28,49,.85); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.topbar nav { display: flex; flex-wrap: wrap; gap: .5rem; }
#who { margin-left: .75rem; font-size: .85rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 1rem .25rem; }
.toolbar input { max-width: 320px; margin: 0; }

.table-wrap { overflow-x: auto; margin: .5rem 1rem 2rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(56,189,248,.05); }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; background: var(--bg); }
.noimg { width: 52px; height: 52px; border-radius: 8px; border: 1px dashed var(--line); display: block; }

td.stock input { width: 88px; margin: 0; text-align: right; padding: .4rem .5rem; }
td.stock input:disabled { opacity: .45; cursor: not-allowed; background: transparent; border-color: transparent; color: var(--text); }
td.stock input.saved { border-color: var(--teal); }
td.stock input.fail { border-color: var(--rose); }
.neg { color: #fda4af; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; max-width: min(92vw, 460px); }
dialog::backdrop { background: rgba(2,6,16,.75); }
#lightbox { max-width: min(94vw, 900px); text-align: center; }
#lightbox img { max-width: 100%; max-height: 72vh; border-radius: 8px; }
.dlg-actions { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; }
dialog h3 { margin: 0 0 .5rem; }

.print-only { display: none; }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; color: #000; }
  body::before, .no-print, .admin-only, .thumb-col { display: none !important; }
  .print-only { display: block; font-size: 14pt; margin: 0 0 6pt; }
  .table-wrap { margin: 0; border: 0; background: #fff; overflow: visible; }
  table { font-size: 9pt; }
  th, td { color: #000; background: #fff; border-bottom: 1px solid #999; padding: 3pt 5pt; position: static; }
  td.stock input { border: 0; background: transparent; color: #000; width: auto; text-align: right; opacity: 1; }
  .thumb, .noimg { width: 28px; height: 28px; border-color: #999; }
  tr { break-inside: avoid; }
  #tab-audit { display: none !important; }
}
@media (max-width: 640px) { #who { display: block; margin: 0; } }

th small { font-weight: 400; opacity: .75; }
