:root {
  --bg: #0A0A0D;
  --fbg: #1f1f1f;
  --fg: #f5f5f5;
  --thw_blau: #003399;
  --thw_hellblau: #436EB2;
  --danger: #e53935;
  --button-bg: #1f1f1f;
  --button-hover: #333;
  --thw_gelb: #FFD400;
  /* Unified UI palette */
  --primary: var(--thw_blau);
  --primary-hover: var(--thw_hellblau);
  --primary-rgb: 0, 51, 153; /* #003399 */
  --accent: var(--thw_gelb);
  --text: #1f2937;
  --text-strong: #0f172a;
  --text-muted: #475569;
  --border: #d0d5dd;
  --chip-bg: #e2e8f0;
  --chip-bg-hover: #d1d9e6;
  --chip-muted-bg: #f1f5f9;
  --card-shadow: rgba(15, 23, 42, 0.08);
  --card-shadow-hover: rgba(15, 23, 42, 0.12);
  --card-border: rgba(15, 23, 42, 0.05);
  --primary-weak-rgba: rgba(var(--primary-rgb), 0.12);
  --primary-outline-rgba: rgba(var(--primary-rgb), 0.35);
  --primary-focus-rgba: rgba(var(--primary-rgb), 0.2);
  --warning: #f97316;
  --success: #16a34a;
  --danger-strong: #dc2626;
  --neutral: #64748b;
}

html.native-scanner-active,
body.native-scanner-active {
  background: transparent !important;
}

html {
  font-size: clamp(14px, 2.5vw, 18px);
}

html.native-scanner-active,
body.native-scanner-active {
  background: transparent !important;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  /* background: var(--bg);
  color: var(--fg); */
  font-family: system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
.button-link {
  box-sizing: border-box;
}

.body-notcenter {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--fg);
  height: 100%;
}

h1,
h2 {
  font-size: 1.8rem;
  text-align: center;
  margin: 0 0 1rem 0;
}

video {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  background: #000;
  margin: 1rem 0;
  display: block;
}

.button-link {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  background: var(--thw_blau);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 0.5rem;
  text-align: center;
}

.button-link:hover {
  background: var(--thw_hellblau);
}

body.flash {
  animation: flash-bg 0.6s ease-out;
}

@keyframes flash-bg {
  0% {
    background-color: var(--thw_hellblau);
  }

  100% {
    background-color: var(--bg);
  }
}

#scan-success {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--thw_hellblau);
  color: white;
  padding: 1rem 2rem;
  font-size: 1.6rem;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  animation: fade-in-out 2s ease-out;
}

@keyframes fade-in-out {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }

  10% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  90% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
}

/* LOGIN */

.login-page {
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* padding: 5%;
  max-width: 90%; */
  /* margin: 0 auto; */
}

/* .login-wrapper {
  width: 100%;
  max-width: 400px;
  background: var(--fbg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.login-form {
  width: 100%;
}

.login-form input[type="text"],
.login-form input[type="password"],
.login-form select,
.login-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  border: 1px solid #444;
  border-radius: 8px;
  background: #222;
  color: #fff;
  box-sizing: border-box;
}

.login-form label {
  font-size: 1rem;
  font-weight: bold;
  display: block;
  margin-bottom: 0.3rem;
}

.login-form button {
  width: 100%;
  padding: 1rem;
  font-size: 1.2rem;
  background: var(--thw_blau);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.login-form button:hover {
  background: var(--thw_hellblau);
} */


.error-message {
  text-align: center;
  font-weight: bold;
  margin-bottom: 1rem;
}

/* NAVIGATION */

.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  background: var(--fbg);
  border-bottom: 1px solid #333;
  border-radius: 0 0 12px 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.top-nav>* {
  flex: 1 1 auto;
  text-align: center;
  min-width: 100px;
  max-width: 200px;
}

.logout-form {
  display: flex;
  justify-content: center;
  margin: 0;
}

/* .logout-button:hover {
  background: #d10000;
} */

/* .logout-button {
  background: #b30000;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
} */

/* .logout-button,
.modus-select {
  width: 100%;
  max-width: 160px;
  font-size: 1rem;
  padding: 0.5rem;
} */
/* 
.modus-select {
  background: var(--fbg);
  color: var(--fg);
  font-size: 1rem;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 0.5rem;
  margin: 0 1rem;
  cursor: pointer;
  text-align: center;
  text-align-last: center;
} */

#scan-area {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;   /* Breite des Scanbereichs */
    height: 100px;  /* Hoehe des Scanbereichs */
  margin-left: -100px;
  margin-top: -50px;
  border: 2px solid red;
  box-sizing: border-box;
  pointer-events: none; /* Klicks weiterreichen */
    z-index: 3;
}

.user-info {
  font-size: 1rem;
  color: var(--fg);
  background: var(--fbg);
  border: 1px solid #555;
  border-radius: 8px;
  padding: 0.312rem 1rem;
  margin: 0 1rem;
  /* height: 2.6rem; */
  /* display: flex; */
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* TABLE */

.table-responsive {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch; /* smoother scroll on iOS */
  touch-action: pan-x pan-y; /* allow both directions */
}

.inventar-tabelle {
  min-width: 600px;
  width: max-content;
  margin: 0; /* zentriert auf größerem Bildschirm */
  border-collapse: collapse;
}

.inventar-tabelle th,
.inventar-tabelle td {
  padding: 0.6rem 1rem;
  border: 1px solid #333;
  text-align: left;
  white-space: nowrap;
}

.button-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.button-link-danger {
  width: 100%;
  padding: 0.8rem 1.2rem;
  font-size: 1.2rem;
  background: #b30000;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.button-link-danger:hover {
  background: #d10000;
}

.filter-form {
  margin: 1rem 0;
  text-align: center;
}

.filter-select {
  padding: 0.6rem 1rem;
  font-size: 1.1rem;
  border-radius: 8px;
  border: 1px solid #444;
  background: var(--fbg);
  color: var(--fg);
  cursor: pointer;
  max-width: 100%;
}

form {
  /* display: flex; */
  justify-content: center;
}

.form-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  gap: 1rem;
  margin: 0 auto;
}

.form-wrapper label {
  font-weight: bold;
}

.form-wrapper input,
.form-wrapper textarea,
.form-wrapper select {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  color: #000;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

/* Zweispaltiges Layout für Edit-Formulare */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-wrapper {
    max-width: 720px;
  }
}

.form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-row.full {
  grid-column: 1 / -1;
}

/* Allgemeine Formular-Layouts */
.scanner-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1rem;
  flex-wrap: wrap;
}

.scanner-form input[type="text"],
.scanner-form input[type="search"] {
  flex: 1 1 320px;
  min-width: 0;
}

.scanner-form button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .scanner-form input[type="text"],
  .scanner-form input[type="search"] {
    flex-basis: 100%;
  }
  .scanner-form button {
    width: 100%;
  }
}


/* Neue Scannerpage */
.scanner-page {
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 3%;
  max-width: 90%;
  margin: 0 auto;
  /* iOS safe-area: push content below Dynamic Island / notch */
  padding-top: calc(3% + constant(safe-area-inset-top)); /* old iOS */
  padding-top: calc(3% + env(safe-area-inset-top));       /* new iOS */
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1rem;
  flex-wrap: wrap;
  gap: 1rem;
  /* extra breathing room under Dynamic Island */
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top);
}

.scanner-main {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Detail page – card header + sections + actions */
.detail-header-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.1rem 1rem;
  box-shadow: 0 10px 20px var(--card-shadow);
  margin-bottom: 0.9rem;
}

.detail-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.detail-title {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.2;
  color: var(--primary);
  font-weight: 800;
}

.status-pill {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: .02em;
}
.status-warning { background: #ffedd5; color: #b45309; border: 1px solid #fdba74; }

.retired-note { color: #dc2626; margin-top: .4rem; font-weight: 600; }

.detail-meta { margin-top: 0.35rem; color: var(--text); }
.detail-meta .meta-row { font-size: 1.05rem; }

.detail-sections {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin: 0.6rem 0 1rem 0;
}

.section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: .9rem;
  padding: .85rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 6px 14px var(--card-shadow);
}
.section-link .chevron { font-size: 1.4rem; color: var(--neutral); }
.section-link:hover { background: #f8fafc; }

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin: .6rem 0 1rem 0;
}

.action-tile,
.action-tile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  border: none;
  cursor: pointer;
}
.action-tile:hover,
.action-tile-btn:hover { background: var(--primary-hover); }

.action-tile.as-button { padding: 0; }
.action-tile.as-button .action-tile-btn { width: 100%; height: 100%; }

@media (max-width: 520px) {
  .detail-actions { grid-template-columns: 1fr; }
}

.back-link {
  display: grid;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: .9rem;
  padding: .8rem 1rem;
  box-shadow: 0 6px 14px var(--card-shadow);
  justify-content: space-around;
}

/* Inventarliste: etwas breiter für Suche/Tabelle */
.inventar-list-main {
  max-width: 720px;
}

.user-info-box {
  display: flex;
  align-items: center;
  font-weight: bold;
  color: #003399;
}

.logout-button {
  background: #FFD400;
  color: #000;
  font-weight: 600;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.logout-button:hover {
  background: #ffcf00;
}

/* Aktionen auf Detailseite: zentriert & gleichmäßig */
.actions-grid {
  display: flex;
  /* grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); */
  gap: 0.75rem;
  /* margin-top: 1.5rem; */
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  flex-wrap: wrap;
}

/* Compact buttons in action areas */
.actions-grid .button-link,
.form-actions .button-link,
.form-actions button.button-link {
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
  border-radius: 7px;
}

/* Make action buttons take full column width */
.actions-grid .button-link,
.form-actions .button-link,
.form-actions button.button-link {
  display: block;
  width: 100%;
}

/* Formular-Top-Aktionen im Edit */
.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 520px) {
  .form-actions {
    grid-template-columns: 1fr;
  }
}

.scanner-main h1 {
  font-size: 1.8rem;
  font-weight: bold;
  color: #003399;
  text-align: center;
  margin-bottom: 1rem;
}

/* Compact form styling aligned with new cards */
.form-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 10px 20px var(--card-shadow);
}

.form-card + .form-card { margin-top: .75rem; }

.form-grid.is-compact { gap: .6rem; }
.form-grid.is-compact .form-row { margin: 0; }

.form-row label { color: var(--text-muted); font-weight: 700; font-size: .95rem; }

.form-row.full textarea { min-height: 96px; }

.form-toggle-group { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 520px){ .form-toggle-group { grid-template-columns: 1fr; } }

.toggle-row { display: flex; align-items: center; gap: .5rem; padding: .35rem .2rem; }
.toggle-row label { margin: 0; font-weight: 700; }
.toggle-row input[type="checkbox"] { width: 1.1rem; height: 1.1rem; }

.primary-button {
  display: block;
  width: 100%;
  background: #003399;
  color: #fff;
  padding: 0.5rem 0rem;
  text-align: center;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  text-decoration: none;
}

.modus-label {
  font-weight: bold;
  font-size: 1rem;
  margin-top: 1rem;
  color:#000
}

.modus-select {
  z-index: 10;
  position: relative;
  background-color: white;
  border: 1px solid #ccc;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  max-width: 250px;
  margin: 1rem auto;
  display: block;
}


.barcode-instruction {
  text-align: center;
  color: #000;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 1rem auto;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.scanner-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  z-index: 1;
}

/* Quagga Container Fix: sauberes Seitenverhältnis, kein schwarzer Overflow */
#scanner-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* Fallback für Browser ohne aspect-ratio: 16:9 per Padding */
@supports not (aspect-ratio: 1 / 1) {
  #scanner-container {
    height: 0;
    padding-bottom: 56.25%;
  }
}

#scanner-container video,
#scanner-container canvas {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Entfernt unerwünschte Außenabstände des von Quagga erzeugten <video> */
#scanner-container video { margin: 0 !important; border-radius: inherit; }

/* Desktop: gleiche Optik wie Mobile, keine übermäßige Höhe */
@media (min-width: 900px) {
  #scanner-container { max-height: 60vh; }
}

.torch-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.torch-button {
  background: #FFD400;
  border: none;
  color: #000;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.zoom-slider {
  width: 100%;
  margin: 1rem 0;
}

.camera-select {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #ccc;
  margin-bottom: 1rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
}
.modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.modal .modal-content {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  background: #fff;
  color: #000;
  padding: 1rem;
  border-radius: 10px;
  width: min(560px, calc(100% - 2rem));
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.modal .modal-content h2 {
  margin: 0 0 .5rem 0;
  color: var(--thw_blau);
}

.modal .modal-content #modal-code {
  color: var(--thw_hellblau);
}

.modal .modal-actions .primary-button {
  background: var(--thw_gelb);
  color: #000;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  border-radius: 8px;
}

.modal .modal-actions .primary-button:hover {
  background: #f2c300;
}

.manual-form {
  /* display: flex; */
  gap: 0.5rem;
  /* margin-top: 1rem; */
}

.manual-form input {
  flex: 1;
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

.manual-submit {
  background: #FFD400;
  border: none;
  padding: 0.5rem 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  color: #000;
  font-size: 0.95rem;
}

/* Neues Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  /* background: var(--bg); */
  /* padding: 2rem; */
}
.login-wrapper {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  border: 2px solid var(--thw_blau);
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
}

.login-form {
  width: 100%;
}

.form-group {
  margin-bottom: 1rem;
  width: 100%;
}

.login-form label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  /* color: var(--fg); */
}

.login-form input[type="text"],
.login-form input[type="password"] {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  color: #000;
  box-sizing: border-box;
}

.login-form button {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  background: var(--thw_gelb);
  color: black;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}



.login-form button:hover {
  background: #f2c300;
}

.error-message {
  background: var(--danger);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}


/* MOBILE OPTIMIERUNG */

@media (width >= 600px) {
  .scanner-page {
    max-width: 600px;
  }
}

/* Mobile-Stack-Ansicht entfernt: klassische Tabelle mit horizontalem Scrollen bleibt erhalten */

/* Inventar cards redesign */
.inventar-search {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.inventar-search input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip-muted-bg);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inventar-search input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-focus-rgba);
  background: #fff;
}

.inventar-filter-row {
  margin-bottom: 1rem;
}

.inventar-export {
  display: flex;
}

.inventar-filter-chips {
  display: flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
  padding: 0;
  margin: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  justify-content: flex-start;
}

.filter-chip {
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.filter-chip:hover { background: var(--chip-bg-hover); }

.filter-chip.is-active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px var(--primary-outline-rgba); }

.inventar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.inventar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 0.9rem;
  border: none;
  background: var(--chip-muted-bg);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.inventar-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.inventar-button:focus-visible {
  outline: 3px solid var(--primary-outline-rgba);
  outline-offset: 2px;
}

.inventar-button.is-primary {
  background: var(--primary);
  color: #fff;
}

.inventar-button.is-primary:hover {
  background: var(--primary-hover);
}

.inventar-button.is-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }

.inventar-button.is-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }

.inventar-button.is-outline:hover { background: rgba(var(--primary-rgb), 0.08); }

.inventar-card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inventar-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 12px 24px var(--card-shadow);
  border: 1px solid var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform, opacity, filter;
}

/* Scroll-reveal states */
.reveal-card {
  opacity: 0;
  transform: translate(0, 16px) scale(.98);
  filter: blur(2px);
  transition: transform 140ms cubic-bezier(.22,.61,.36,1), opacity 140ms ease, filter 140ms ease;
}
.reveal-card.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Animated-list like appearance */
@media (prefers-reduced-motion: reduce) {
  .inventar-card { transition: none !important; }
}

.inventar-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px var(--card-shadow-hover);
}

.inventar-card.is-retired {
  opacity: 0.6;
}

.inventar-card.is-empty {
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
}

.inventar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inventar-card-id {
  font-weight: 700;
  color: var(--text-strong);
  font-size: 1.1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.badge-warning { background: var(--warning); color: #fff; }

.badge-success { background: var(--success); color: #fff; }

.badge-danger { background: var(--danger-strong); color: #fff; }

.badge-neutral { background: var(--neutral); color: #fff; }

.inventar-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.meta-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.97rem;
}

.meta-label { font-weight: 600; color: var(--text-muted); }

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: var(--primary-weak-rgba);
  color: var(--primary-hover);
  font-weight: 600;
  border-radius: 999px;
  font-size: 0.85rem;
}

.inventar-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-around;
}

@media (min-width: 900px) {
  .inventar-list-main {
    max-width: 960px;
  }

  .inventar-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.2rem;
  }
}
