#access { margin-inline: auto; }

.access form, #set-email-password, #inventory {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.access > label { margin-top: 14px; }
#boxes { margin-top: 16px; }
#photo-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; margin-bottom: 12px; }
#photo-gallery figure { margin: 0; min-width: 0; }
#photo-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f9f4ee; border-radius: 8px; }
#photo-gallery button { width: 100%; margin-top: 5px; font-size: .85rem; }
#photo-feedback { margin: 6px 0 0; }
#photo-feedback:empty { display: none; }

.lager-page { background: #fcfaf6; color: #2a211b; }
.lager-page > header { background: #fff; border-color: #e8e1d9; }
.lager-page .storage { max-width: 1224px; padding-block: 26px 64px; }
.lager-page .top { justify-content: space-between; }
.lager-page .storage-logo img { width: 104px; }
.header-caption { color: #514b46; font-size: .9rem; }
.lager-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(22px, 4vw, 36px);
  border-radius: 24px;
  background: #f7ded3;
  color: #2a211b;
}
.lager-hero h1, #inventar h2, #inventar h3 {
  font-family: 'Avenir Next', system-ui, sans-serif;
  font-weight: 750;
  letter-spacing: -.045em;
}
.lager-hero h1 { margin: 0 0 8px; font-size: clamp(42px, 6vw, 60px); }
.lager-hero p { margin: 0; color: #6f3426; }
.lager-hero .eyebrow { margin-bottom: 8px; }
.hero-mark {
  position: absolute;
  right: 19%;
  top: 50%;
  z-index: -1;
  width: 156px;
  aspect-ratio: 1;
  border: 1px solid #c8544260;
  border-radius: 32px;
  transform: translateY(-50%) rotate(-24deg);
  box-shadow: 0 0 0 14px #c8544225, 0 0 0 28px #c8544212;
}
.hero-actions a { font-weight: 750; text-decoration: none; }
.lager-hero .hero-actions .button { border-radius: 10px; background: #bd3022; border-color: #bd3022; }
.hero-secondary { border: 1px solid #d7bfb3; border-radius: 10px; padding: 12px 16px; background: #fff; }
.lager-page .eyebrow { font-size: .76rem; letter-spacing: .12em; font-weight: 750; }
.lager-page #message:not(:empty) { padding: 12px 16px; margin-block: 14px; background: #fff0e8; border-radius: 10px; }
.lager-page .workspace-bar { justify-content: space-between; padding: 20px 0 14px; }
.lager-page .workspace-bar strong { display: block; overflow-wrap: anywhere; }
.lager-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.lager-nav a { border: 1px solid #ddd5cd; border-radius: 999px; padding: 7px 14px; color: #3d3532; background: #fff; text-decoration: none; }
.lager-nav a:hover { border-color: #a63c46; color: #9b2633; }
.lager-page .panel { padding: clamp(16px, 3vw, 28px); border-color: #e5ded7; border-radius: 20px; box-shadow: 0 4px 20px #33261b08; }
.lager-page .panel .eyebrow { margin: 0 0 5px; color: #9b2633; }
.lager-page .panel h2 { margin-bottom: 12px; }
#inventar { margin-top: 24px; }
#inventar h2 { margin: 0 0 6px; }
.lager-section-head { display: flex; justify-content: space-between; align-items: end; gap: 14px; }
.lager-section-head p { margin: 0; color: #655c56; }
.lager-section-head label { width: min(100%, 17rem); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.inventory-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.storage .inventory-filters button { border-color: #ddd2ca; border-radius: 999px; background: transparent; }
.storage .inventory-filters button[aria-pressed=true] { background: #292322; border-color: #292322; color: #fff; }
.lager-followup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lager-followup:has(> [hidden]) > :not([hidden]) { grid-column: 1 / -1; }
.lager-page .box-card { padding: 16px; border: 1px solid #e8e0d8; border-radius: 14px; background: #fff; }
.lager-page #boxes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lager-page #boxes .box-card { padding: 0; }
.inventory-card-body { padding: 15px; }
.inventory-card-body form { margin-top: 12px; }
.lager-page .unit-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; font-size: .8rem; color: #62574f; }
.lager-page .unit-code { margin: 0; font-weight: 700; }
.lager-page #boxes .inventory-card-body > button { padding: 7px 0; border: 0; color: #a42a1d; font-weight: 750; }
.lager-page .badge[data-state=stored] { background: #e5f1e8; color: #254f34; }
.lager-page .badge[data-state=ordered] { background: #fff0d8; color: #694400; }
.lager-page .badge[data-state=home] { background: #f6e5d3; color: #77471e; }
.lager-page #customer-orders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.lager-page #customer-orders details, .lager-page #billing-invoices details { background: #fff; border: 1px solid #e5ded7; border-radius: 10px; padding: 12px; margin-top: 8px; }
.lager-page #customer-order-form form { display: grid; gap: 12px; margin-block: 8px 24px; }
.lager-page fieldset { border: 1px solid #ddd5cd; border-radius: 10px; min-width: 0; padding: 12px; }
.lager-page :focus-visible { outline: 3px solid #91283b; outline-offset: 3px; }
@media (max-width: 900px) {
  .lager-page #boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lager-followup { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 640px) {
  .lager-hero, .lager-section-head { flex-direction: column; align-items: stretch; }
  .hero-mark { right: -45px; opacity: .5; }
  .lager-section-head label { width: 100%; }
  .lager-page #boxes { grid-template-columns: 1fr; }
  .hero-actions a { flex: 1 1 auto; justify-content: center; text-align: center; }
}

.lager-page .inventory-photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 1;
  min-height: 148px;
  margin: 8px;
  border: 1px dashed #ad9688;
  border-radius: 10px;
  background: #f9f4ee;
  text-align: center;
}
.lager-page .inventory-photo[data-preview=ready] {
  margin: 0;
  border: 0;
  border-radius: 13px 13px 0 0;
}
.inventory-photo-controls { display: grid; justify-items: center; padding: 8px; }
.inventory-photo-mark { display: none; color: #a42a1d; font-size: 28px; line-height: 1; }
[data-preview=empty] .inventory-photo-mark { display: block; margin-bottom: 7px; }
.lager-page .inventory-photo.is-dragging { outline: 2px solid #a42a1d; outline-offset: -3px; background: #fae5dc; }
.lager-page .box-card .inventory-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
[data-preview=ready] .inventory-photo-controls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 0;
}
.lager-page [data-preview=ready] .inventory-photo-label { display: none; }
.lager-page .inventory-photo-label { color: #4f403b; font-size: .9rem; }
.lager-page .inventory-photo button { border: 0; background: #fff; border-radius: 999px; color: #722d22; font-size: .85rem; font-weight: 700; min-height: 36px; }
.lager-page [data-preview=empty] button { background: transparent; text-decoration: underline; }
.lager-page .inventory-photo-status {
  position: absolute;
  top: 7px;
  left: 7px;
  max-width: calc(100% - 14px);
  padding: 2px 7px;
  border-radius: 6px;
  background: #fff;
  color: #663143;
  font-size: .8rem;
}
.lager-page .inventory-photo-status:empty { display: none; }

.invoice-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid #e5ded7; }
.invoice-row h3, .invoice-row p { margin: 0; overflow-wrap: anywhere; }
.invoice-row p { color: #62574f; font-size: .85rem; }
#invoice-viewer { width: min(980px, calc(100% - 24px)); }
#invoice-frame { display: block; width: 100%; height: 70vh; border: 1px solid #e5ded7; border-radius: 8px; }
@media (max-width: 640px) { .invoice-row { grid-template-columns: minmax(0, 1fr) auto; } .invoice-row .row-actions { grid-column: 1 / -1; } }

.lager-page .inventory-photo .inventory-preview-open {
  position: absolute;
  inset: 0;
  padding: 0;
  border-radius: inherit;
  cursor: zoom-in;
}
.lager-page .inventory-preview-open:focus-visible { outline-offset: -4px; }
#photo-gallery .inventory-preview-open { padding: 0; border: 0; cursor: zoom-in; }
#photo-viewer {
  width: min(1080px, calc(100% - 20px));
  max-height: calc(100dvh - 20px);
  padding: clamp(10px, 2vw, 20px);
  background: #251e1b;
  color: #fff;
}
#photo-viewer .dialog-head { align-items: center; flex-wrap: nowrap; margin-bottom: 10px; }
#photo-viewer h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(20px, 4vw, 32px); }
#photo-viewer button { color: #251e1b; min-width: 44px; min-height: 44px; }
#photo-viewer-stage {
  display: grid;
  place-items: center;
  height: min(72dvh, calc(100dvh - 156px));
  min-height: 80px;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
#photo-viewer-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.photo-viewer-navigation { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }
