:root {
  color-scheme: light;
  --theme-background-image: url("background.webp");
  --theme-background:
    radial-gradient(ellipse at center, rgba(31, 114, 104, 0.34) 0%, rgba(2, 22, 24, 0.68) 58%, rgba(0, 11, 13, 0.9) 100%),
    linear-gradient(90deg, rgba(2, 24, 27, 0.92) 0%, rgba(8, 67, 64, 0.52) 48%, rgba(2, 18, 22, 0.94) 100%),
    var(--theme-background-image) center center / cover no-repeat,
    #04191c;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-border: rgba(255, 255, 255, 0.8);
  --control-background: rgba(255, 255, 255, 0.96);
  --nav-link-background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 250, 0.96));
  --active-background: linear-gradient(135deg, #0f6d73 0%, #184e58 100%);
  --panel: var(--surface);
  --theme-ink: #183039;
  --theme-muted: #607784;
  --theme-line: #d7e3e7;
  --theme-accent: #0f6d73;
  --theme-accent-deep: #0d3440;
  --theme-accent-contrast: #f4fbfc;
  --theme-accent-soft: #e1eef3;
  --ink: #183039;
  --muted: #607784;
  --line: #d7e3e7;
  --accent: #0f6d73;
  --accent-deep: #0d3440;
  --accent-contrast: #f4fbfc;
  --accent-soft: #e1eef3;
  --field-background: #ffffff;
  --shadow: 0 24px 60px rgba(24, 48, 57, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --hero-background:
    radial-gradient(circle at 85% 25%, rgba(255, 255, 255, 0.14), transparent 18%),
    linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 62%, #48656d 100%);
  --hero-ink: var(--accent-contrast);
  --hero-copy: rgba(244, 251, 252, 0.9);
  --focus-outline: 2px solid rgba(15, 109, 115, 0.24);
  --danger: #a63a35;
  --danger-soft: #f7d8d5;
  --warning: #9a681a;
  --warning-soft: #f5e4bf;
  --notice: #2e6680;
  --notice-soft: #dbeef6;
  --success: #2d7157;
  --success-soft: #dff0e6;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background-color: #04191c;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  padding: clamp(8px, 1.4vw, 16px);
  font-family: "Aptos", "Segoe UI", sans-serif;
  color: var(--ink);
  background: transparent !important;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background: var(--theme-background);
  transform: translateZ(0);
}

body::after {
  z-index: -1;
  background-image:
    radial-gradient(ellipse at center, transparent 36%, rgba(0, 13, 15, 0.28) 76%, rgba(0, 5, 7, 0.54) 100%),
    repeating-linear-gradient(0deg, rgba(210, 255, 226, 0.13) 0 1px, rgba(0, 18, 17, 0.08) 1px 3px, transparent 3px 6px),
    repeating-linear-gradient(90deg, rgba(165, 255, 221, 0.045) 0 1px, transparent 1px 6px),
    linear-gradient(90deg, transparent 0%, rgba(166, 255, 211, 0.02) 34%, rgba(202, 255, 229, 0.2) 49%, rgba(157, 255, 209, 0.05) 56%, transparent 72%),
    repeating-linear-gradient(90deg, rgba(165, 255, 221, 0.07) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(165, 255, 221, 0.055) 0 1px, transparent 1px 56px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 960 230'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 122H130l18-18 18 18h76l26-56 35 122 30-66h124l18-24 20 24h150l28-44 30 88 28-44h229' stroke='%23b9ffd7' stroke-width='3' opacity='.48'/%3E%3Cpath d='M0 122H960' stroke='%238bf3c0' stroke-width='1' opacity='.16'/%3E%3Cpath d='M130 122l18-18 18 18M268 66l35 122 30-66M673 78l30 88 28-44' stroke='%23e7fff0' stroke-width='5' opacity='.12'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat, repeat, no-repeat, repeat, repeat, repeat, repeat-x;
  background-size: 100% 100%, 100% 6px, 6px 100%, 46% 100%, 360px 360px, 280px 280px, 160px 160px, 960px 230px;
  background-position: 0 0, 0 0, 0 0, -68vw 0, 0 0, 0 0, 0 0, 0 44%;
  opacity: 0.72;
  transform: translateZ(0);
  animation:
    calcusoins-crt-roll 18s linear infinite,
    calcusoins-crt-flicker 6.8s ease-in-out infinite;
}

@keyframes calcusoins-crt-roll {
  0% {
    background-position: 0 0, 0 0, 0 0, -68vw 0, 0 0, 0 0, 0 0, 0 44%;
  }

  100% {
    background-position: 0 0, 0 32px, 6px 0, 125vw 0, 42px 0, -22px 16px, 80px 36px, -960px 44%;
  }
}

@keyframes calcusoins-crt-flicker {
  0%,
  100% {
    opacity: 0.6;
    filter: saturate(1) brightness(0.98) contrast(1.02);
  }

  18% {
    opacity: 0.67;
  }

  48% {
    opacity: 0.7;
    filter: saturate(1.08) brightness(1.04) contrast(1.03);
  }

  52% {
    opacity: 0.64;
  }

  76% {
    opacity: 0.68;
  }
}

input,
select,
textarea,
button {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.site-nav,
.app-header,
.hero,
.panel,
.flash {
  min-width: 0;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.site-nav,
.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px;
  overflow: visible;
  z-index: 40;
  border-color: rgba(255, 255, 255, 0.88);
  background: rgba(248, 252, 252, 0.96);
}

.site-brand,
.brand {
  display: inline-flex;
  align-items: flex-start;
  flex: 0 1 auto;
  max-width: calc(100% - 168px);
  margin-left: 20px;
  min-width: 0;
  text-decoration: none;
}

.site-brand:focus-visible,
.brand:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 4px;
  border-radius: 20px;
}

.site-logo {
  display: block;
  max-height: 72px;
  width: auto;
  max-width: 100%;
  height: auto;
}

.nav-menu {
  position: relative;
  margin-left: auto;
  flex: 0 0 auto;
}

.nav-menu[open] {
  z-index: 20;
}

.nav-menu summary {
  list-style: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 251, 252, 0.16);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 100%);
  color: var(--accent-contrast);
  box-shadow: 0 14px 30px rgba(4, 34, 39, 0.18);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.nav-trigger:hover,
.nav-menu[open] .nav-trigger {
  transform: translateY(-1px);
  border-color: rgba(244, 251, 252, 0.32);
  background: linear-gradient(135deg, #082b35 0%, #0d6369 100%);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(4, 34, 39, 0.24);
}

.nav-trigger-icon {
  color: currentColor;
  font-size: 0.72rem;
  opacity: 0.78;
  transition: transform 160ms ease;
}

.nav-menu[open] .nav-trigger-icon {
  transform: rotate(180deg);
}

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: min(340px, calc(100vw - 48px));
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  background: var(--nav-panel-background);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.nav-link {
  display: grid;
  gap: 4px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--nav-link-background);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  border-color: transparent;
  background: var(--active-background);
  color: var(--accent-contrast);
}

.nav-link-label {
  display: block;
}

.nav-link-copy {
  display: block;
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
}

.nav-access-note {
  display: block;
  margin-top: 2px;
  color: #9b3434;
  font-weight: 900;
}

.nav-link:hover .nav-link-copy {
  color: var(--muted);
}

.nav-link[aria-current="page"] .nav-link-copy {
  color: color-mix(in srgb, var(--accent-contrast) 84%, transparent);
}

.nav-link[aria-current="page"] .nav-access-note {
  color: #ffe2df;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.main-nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-background);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.main-nav a:hover,
.button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  box-shadow: 0 12px 24px rgba(24, 48, 57, 0.08);
}

.button.primary {
  border-color: transparent;
  background: var(--active-background);
  color: var(--accent-contrast);
}

.button.subtle {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
}

.button.danger {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  color: var(--danger);
}

.button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #173d49 0%, #2d7157 100%);
  color: var(--accent-contrast);
}

.session-user {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.session-logout {
  color: var(--accent);
}

.session-logout:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.session-user + .nav-menu {
  margin-left: 0;
}

.app-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.hero {
  padding: 12px 18px;
  background: var(--hero-background);
  color: var(--hero-ink);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
}

h1,
.page-title {
  margin: 0;
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.hero p {
  margin: 6px 0 0;
  max-width: 780px;
  color: var(--hero-copy);
  font-size: 0.82rem;
  line-height: 1.35;
}

.inventory-hero .hero-summary {
  max-width: none;
  white-space: nowrap;
}

.hero .last-updated {
  color: color-mix(in srgb, var(--hero-copy) 92%, transparent);
  font-weight: 800;
}

.public-hero .site-name {
  margin: 0;
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.public-hero p {
  max-width: none;
  font-size: 1rem;
  line-height: 1.6;
}

.public-panel {
  padding: clamp(18px, 3vw, 28px);
}

.public-copy {
  display: grid;
  gap: 10px;
  max-width: 860px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.public-copy p {
  margin: 0;
}

.login-about .public-copy {
  max-width: none;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(244, 251, 252, 0.32);
  border-radius: 999px;
  background: rgba(244, 251, 252, 0.13);
  color: var(--theme-accent-contrast);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.inventory-help-panel {
  margin: 10px 0 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: none;
}

.inventory-help-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 14px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.inventory-help-panel > summary::-webkit-details-marker,
.inventory-help-question > summary::-webkit-details-marker {
  display: none;
}

.inventory-help-panel > summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
}

.inventory-help-panel[open] > summary::after {
  content: "-";
}

.inventory-help-panel > summary span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.inventory-help-panel > summary small {
  flex: 1;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.inventory-help-intro {
  margin: 0;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.4;
}

.inventory-help-faq {
  display: grid;
  gap: 7px;
  padding: 0 14px 14px;
}

.inventory-help-question {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  overflow: clip;
}

.inventory-help-question > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}

.inventory-help-question > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.inventory-help-question[open] > summary {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 42%, transparent);
}

.inventory-help-question[open] > summary::after {
  content: "-";
}

.inventory-help-question p {
  margin: 0;
}

.inventory-help-question p {
  padding: 9px 10px 0;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 750;
  line-height: 1.45;
}

.inventory-help-question p:last-child {
  padding-bottom: 10px;
}

.inventory-help-question p + p {
  padding-top: 6px;
}

.inventory-help-question strong {
  color: var(--ink);
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.panel {
  padding: clamp(12px, 1.8vw, 18px);
}

.panel + .panel {
  margin-top: 0;
}

.panel-head,
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.page-head.compact {
  align-items: center;
}

.inventory-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-copy,
.page-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.metric {
  appearance: none;
  display: grid;
  justify-items: start;
  align-content: start;
  width: 100%;
  min-height: 52px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--nav-link-background);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.metric:hover,
.metric:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: 0 10px 22px rgba(24, 48, 57, 0.16);
  transform: translateY(-1px);
}

.metric:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}

.metric.is-danger {
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger-soft) 78%, white), var(--surface-strong));
}

.metric.is-warning {
  border-color: color-mix(in srgb, var(--warning) 24%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--warning-soft) 78%, white), var(--surface-strong));
}

.metric.is-notice {
  border-color: color-mix(in srgb, var(--notice) 24%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--notice-soft) 78%, white), var(--surface-strong));
}

.metric.is-success {
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--success-soft) 78%, white), var(--surface-strong));
}

.metric.is-low-stock {
  border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--warning-soft) 58%, white), var(--surface-strong));
}

.metric-label {
  display: block;
  justify-self: start;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  justify-self: start;
  margin-top: 4px;
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 0.95;
  color: var(--ink);
}

.metric-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--nav-link-background);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 0.95;
}

.inventory-form-grid,
.form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 0.7fr) minmax(82px, 0.42fr) minmax(150px, 0.72fr) minmax(150px, 0.72fr);
  gap: 8px;
  align-items: end;
}

.admin-page-head {
  padding: 14px 18px;
}

.admin-page-head .page-title {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.admin-page-head .page-copy {
  font-size: 0.82rem;
}

.admin-create-panel {
  padding-top: 14px;
}

.admin-create-panel h2,
.admin-users-panel h2,
.admin-sessions-panel h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(1.08rem, 1.55vw, 1.3rem);
  line-height: 1.12;
}

.admin-users-panel .panel-head,
.admin-sessions-panel .panel-head,
.admin-gtins-panel .panel-head {
  margin-bottom: 10px;
}

.admin-suggestion-create-grid,
.admin-suggestion-edit-grid {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(110px, 150px) minmax(220px, 1fr) minmax(190px, 230px) auto auto;
  gap: 8px;
  align-items: end;
}

.admin-suggestion-create-grid .control,
.admin-suggestion-edit-grid .control,
.admin-suggestion-search .control,
.admin-gtin-search .control {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.admin-suggestion-alias-field textarea.control {
  height: auto;
  min-height: 48px;
  resize: vertical;
}

.admin-suggestion-profile-form,
.admin-suggestion-priority-grid {
  display: grid;
  gap: 8px;
  align-items: end;
}

.admin-suggestion-profile-form {
  grid-template-columns: minmax(180px, 260px) auto;
  justify-content: start;
}

.admin-suggestion-priority-grid {
  grid-template-columns: repeat(3, minmax(50px, 1fr));
}

.admin-suggestion-priority-grid label {
  font-size: 0.62rem;
}

.admin-suggestion-search,
.admin-gtin-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-suggestion-search .control,
.admin-gtin-search .control {
  width: min(320px, 38vw);
}

.admin-suggestion-seed-form {
  margin: 0 0 10px;
}

.admin-suggestion-card {
  position: relative;
}

.admin-suggestion-form {
  margin-top: 2px;
}

.admin-suggestion-delete-form,
.gtin-delete-form {
  justify-content: flex-end;
}

.admin-create-grid {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(190px, 260px) minmax(118px, 150px) minmax(150px, 190px);
  gap: 8px;
  align-items: end;
  justify-content: start;
}

.session-timeout-grid {
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(150px, 190px) auto;
  gap: 8px;
  align-items: end;
  justify-content: start;
}

.admin-create-grid .control,
.session-timeout-grid .control,
.user-account-grid .control,
.user-password-grid .control {
  height: 32px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.admin-create-panel .actions-row {
  margin-top: 8px;
}

.admin-create-panel .button,
.user-account-grid .button,
.user-password-grid .button {
  min-height: 32px;
  padding: 7px 12px;
}

.users-list {
  display: grid;
  gap: 10px;
}

.user-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
}

.user-card-summary {
  display: grid;
  grid-template-columns: minmax(190px, 0.62fr) minmax(0, 1.6fr);
  gap: 10px;
  align-items: stretch;
}

.user-identity {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 10px 0;
}

.user-identity strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.user-identity span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.user-meta-grid {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(120px, 0.8fr) minmax(180px, 1.15fr);
  gap: 8px;
}

.user-meta {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.user-meta > span,
.user-form-title {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
}

.user-meta strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.status-note {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning-soft) 78%, white);
  color: var(--warning);
  font-size: 0.68rem;
  font-weight: 800;
}

.user-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.62fr);
  gap: 10px;
  align-items: start;
}

.user-account-form,
.user-password-form,
.user-delete-form {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.user-account-grid,
.user-password-grid {
  display: grid;
  gap: 8px;
  align-items: end;
}

.user-account-grid {
  grid-template-columns: minmax(170px, 0.9fr) minmax(190px, 1fr) minmax(126px, 150px);
}

.user-password-grid {
  grid-template-columns: minmax(170px, 1fr) auto;
}

.user-delete-form {
  grid-column: 1 / -1;
  justify-content: end;
  background: color-mix(in srgb, var(--danger-soft) 32%, rgba(255, 255, 255, 0.72));
}

.gtin-list {
  gap: 10px;
}

.gtin-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.gtin-association-form {
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.gtin-association-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.55fr) minmax(190px, 0.75fr) auto;
  gap: 8px;
  align-items: end;
}

.gtin-safe-note {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--success) 22%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--success-soft) 78%, #ffffff);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-backup-panel h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(1.08rem, 1.55vw, 1.3rem);
  line-height: 1.12;
}

.backup-form {
  display: grid;
  gap: 12px;
}

.backup-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.backup-scope-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.backup-scope-card input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.backup-scope-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.backup-scope-card strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
}

.backup-scope-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.backup-file-row {
  max-width: 520px;
}

.backup-file-row .field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.backup-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
}

.backup-danger-option {
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 46%, white);
}

.backup-warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning-soft) 72%, white);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.backup-actions {
  display: flex;
  justify-content: flex-end;
}

.sessions-list {
  display: grid;
  gap: 10px;
}

.scanner-diagnostic-panel,
.scanner-diagnostic-log-panel {
  display: grid;
  gap: 14px;
}

.scanner-diagnostic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.72fr);
  gap: 12px;
  align-items: stretch;
}

.scanner-diagnostic-capture {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 164px;
  padding: 18px;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 70%, #ffffff), rgba(255, 255, 255, 0.88));
  cursor: default;
}

.scanner-diagnostic-capture:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}

.scanner-diagnostic-eyebrow,
.scanner-diagnostic-record-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.scanner-diagnostic-capture strong {
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.08;
}

.scanner-diagnostic-capture p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.45;
}

.scanner-diagnostic-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.scanner-diagnostic-status > div,
.scanner-diagnostic-saved-item {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.scanner-diagnostic-status span,
.scanner-diagnostic-saved-item span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scanner-diagnostic-status strong,
.scanner-diagnostic-saved-item strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.scanner-diagnostic-live {
  display: grid;
  gap: 10px;
}

.scanner-diagnostic-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.scanner-diagnostic-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.scanner-diagnostic-table th,
.scanner-diagnostic-table td {
  padding: 8px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  text-align: left;
  vertical-align: top;
}

.scanner-diagnostic-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scanner-diagnostic-table td {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.scanner-diagnostic-table tr:last-child td {
  border-bottom: 0;
}

.scanner-diagnostic-saved {
  display: grid;
  gap: 8px;
}

.scanner-diagnostic-saved:empty {
  display: none;
}

.scanner-diagnostic-saved-item {
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
  background: color-mix(in srgb, var(--success-soft) 58%, #ffffff);
}

.scanner-diagnostic-records {
  display: grid;
  gap: 10px;
}

.scanner-diagnostic-record {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
}

.scanner-diagnostic-record-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.scanner-diagnostic-record-main > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.scanner-diagnostic-record-main strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.scanner-diagnostic-record-main small,
.scanner-diagnostic-record-meta span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.scanner-diagnostic-record-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 170px;
}

.scanner-diagnostic-record-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scanner-diagnostic-record-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.2;
}

.scanner-diagnostic-details {
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  padding-top: 8px;
}

.scanner-diagnostic-details summary {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
}

.scanner-diagnostic-details pre {
  max-height: 340px;
  margin: 10px 0 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.session-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
}

.session-card-main {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.32fr);
  gap: 10px;
  align-items: stretch;
}

.session-user-block,
.session-status-block,
.session-agent {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.session-user-block strong,
.session-status-block strong,
.session-agent strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.session-user-block span,
.session-status-block span:not(.status),
.session-agent span,
.session-agent small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.session-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: var(--field-background);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.check-control input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.user-account-grid .button,
.user-password-grid .button {
  align-self: end;
  justify-self: start;
}

.field {
  display: grid;
  gap: 4px;
}

.field label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

.muted {
  color: var(--muted);
  font-weight: 700;
  opacity: 0.72;
}

.control,
.select-control,
.textarea-control {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-background);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.control[type="date"],
.control[data-inventory-date-input] {
  min-width: 0;
  padding-right: 34px;
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23607784' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px 18px;
}

.control[data-inventory-date-input] {
  appearance: none;
}

.control[type="date"]::-webkit-calendar-picker-indicator {
  width: 28px;
  height: 100%;
  margin-right: -24px;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

.inventory-form-grid .control {
  height: 32px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
}

.inventory-form-grid .control[type="date"],
.inventory-form-grid .control[data-inventory-date-input] {
  padding-right: 34px;
}

textarea.control,
.textarea-control {
  min-height: 58px;
  resize: vertical;
  line-height: 1.45;
}

.control:focus,
.select-control:focus,
.textarea-control:focus {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.button:focus-visible,
.control:focus-visible,
.select-control:focus-visible,
.textarea-control:focus-visible,
.sort-header:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.scan-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.manual-add-option {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.manual-add-button {
  min-height: 44px;
  padding-inline: 18px;
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, white);
  color: var(--accent);
}

.scan-action-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(58px, auto);
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 70%, white), var(--surface-strong));
}

.scan-action-panel.is-listening {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.scan-action-panel.is-passive-priority {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}

.scan-action-remove {
  border-color: color-mix(in srgb, var(--danger) 20%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger-soft) 48%, white), var(--surface-strong));
}

.scan-action-remove.is-listening {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent);
}

.scan-action-remove.is-passive-priority {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 14%, transparent);
}

@keyframes scan-waiting-pulse {
  0% {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 34%, transparent), 0 16px 32px rgba(4, 25, 28, 0.18);
  }

  70% {
    transform: translateY(-1px) scale(1.012);
    box-shadow: 0 0 0 12px color-mix(in srgb, currentColor 0%, transparent), 0 18px 36px rgba(4, 25, 28, 0.2);
  }

  100% {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent), 0 16px 32px rgba(4, 25, 28, 0.18);
  }
}

.scan-action-copy {
  display: grid;
  gap: 5px;
}

.scan-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scan-action-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.scan-action-title {
  color: var(--ink) !important;
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 1.18rem !important;
  font-weight: 800 !important;
  letter-spacing: 0;
  line-height: 1.1 !important;
}

.scan-priority-button {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, white);
  color: color-mix(in srgb, var(--muted) 76%, var(--ink));
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.scan-priority-button:hover {
  transform: translateY(-1px);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
}

.scan-priority-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 92%, #071f25);
  color: #ffffff;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 18%, transparent);
}

.scan-action-remove .scan-priority-button {
  border-color: color-mix(in srgb, var(--danger) 20%, var(--line));
}

.scan-action-remove .scan-priority-button:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 36%, var(--line));
}

.scan-action-remove .scan-priority-button.is-active {
  border-color: color-mix(in srgb, var(--danger) 70%, var(--line));
  background: color-mix(in srgb, var(--danger) 90%, #6d1414);
  color: #ffffff;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--danger) 18%, transparent);
}

.scan-priority-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.scan-priority-lock {
  display: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-priority-button.is-active .scan-priority-lock-closed,
.scan-priority-button:not(.is-active) .scan-priority-lock-open {
  display: block;
}

.scan-action-button {
  width: 100%;
  min-height: 70px;
  gap: 10px;
  border-radius: 14px;
  font-size: 0.94rem;
}

.scan-action-add .scan-action-button:not(.is-active) {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, white);
  color: var(--accent);
}

.scan-action-button.is-active {
  border-color: #071f25;
  background: linear-gradient(135deg, #071f25 0%, #006c7a 46%, #2fb67d 100%);
  color: #ffffff;
  animation: scan-waiting-pulse 1.2s ease-out infinite;
}

.scan-action-remove .scan-action-button.is-active {
  border-color: #6d1414;
  background: linear-gradient(135deg, #6d1414 0%, #c1292e 48%, #ff7a59 100%);
}

.scan-action-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.scan-capture {
  position: fixed;
  top: -1000px;
  left: -1000px;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  opacity: 0.01;
  resize: none;
}

@media (prefers-reduced-motion: reduce) {
  .scan-action-button.is-active {
    animation: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent), 0 16px 32px rgba(4, 25, 28, 0.18);
  }
}

.scan-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 78%, white), var(--surface-strong));
}

.scan-box.is-listening {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.scan-actions {
  margin-top: 0;
}

.scan-result {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 9px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.scan-result strong {
  color: var(--ink);
}

.scan-result small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
}

.scan-result.is-confirmed {
  min-height: 86px;
  padding: 12px 14px;
  border-style: solid;
}

.scan-result.is-confirmed strong {
  font-size: 0.9rem;
}

.scan-result.is-known {
  border-color: color-mix(in srgb, var(--success) 30%, var(--line));
  background: color-mix(in srgb, var(--success-soft) 74%, white);
}

.scan-result.is-unknown {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 74%, white);
}

.scan-result.is-error {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 74%, white);
}

.gtin-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 74%, white);
}

.gtin-suggestion[hidden] {
  display: none;
}

.gtin-suggestion.needs-action {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 78%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 12%, transparent);
}

.gtin-suggestion.is-accepted {
  border-color: color-mix(in srgb, var(--success) 34%, var(--line));
  background: color-mix(in srgb, var(--success-soft) 76%, white);
}

.gtin-suggestion-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.gtin-suggestion-copy strong {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.gtin-suggestion-copy span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.gtin-suggestion-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.medication-autocomplete-panel {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 96%, white);
  box-shadow: 0 18px 40px rgba(15, 45, 50, 0.18);
}

.medication-autocomplete-panel[hidden] {
  display: none;
}

.medication-autocomplete-option {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.medication-autocomplete-option:hover,
.medication-autocomplete-option.is-active {
  background: color-mix(in srgb, var(--accent-soft) 76%, white);
}

.medication-autocomplete-option span {
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.2;
}

.medication-autocomplete-option small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
}

.mini-button.muted-button {
  color: var(--muted);
}

.scan-box > .field,
.scan-box > .actions-row,
.scan-box > .scan-result {
  grid-column: 1;
}

.inventory-scan-dialog {
  width: min(760px, calc(100% - 32px));
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 16px;
  background: rgba(248, 252, 252, 0.99);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(4, 25, 28, 0.34);
}

.inventory-scan-dialog::backdrop {
  background: rgba(4, 25, 28, 0.58);
  backdrop-filter: blur(4px);
}

.inventory-scan-dialog-remove {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger-soft) 46%, white), rgba(248, 252, 252, 0.99));
}

.inventory-scan-dialog-remove .scan-dialog-eyebrow,
.inventory-scan-dialog-remove .scan-dialog-title {
  color: var(--danger);
}

.inventory-scan-dialog-remove .scan-dialog-summary > div,
.inventory-scan-dialog-remove .scan-dialog-hint {
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
}

.inventory-scan-dialog-remove .scan-dialog-summary > div {
  background: color-mix(in srgb, var(--danger-soft) 62%, white);
}

.inventory-scan-dialog-remove .scan-dialog-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.inventory-scan-dialog-remove #remove-quantity:focus {
  border-color: color-mix(in srgb, var(--danger) 52%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 15%, transparent);
}

.scan-dialog-form {
  margin: 0;
}

.scan-dialog-content {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 22px;
}

.scan-dialog-head {
  display: grid;
  gap: 6px;
}

.scan-dialog-eyebrow,
.scan-dialog-title,
.scan-dialog-message,
.scan-dialog-context,
.scan-dialog-hint {
  margin: 0;
}

.scan-dialog-eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.scan-dialog-title {
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
}

.scan-dialog-message {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.scan-dialog-eyebrow.is-danger-warning {
  color: var(--danger);
}

.scan-dialog-message.is-danger-warning {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--danger-soft) 72%, #ffffff), rgba(255, 255, 255, 0.95));
  color: var(--danger);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-weight: 900;
}

.scan-dialog-message.is-danger-warning::before {
  content: "Avertissement";
  display: block;
  margin-bottom: 3px;
  color: color-mix(in srgb, var(--danger) 88%, var(--ink));
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.scan-dialog-context,
.scan-dialog-summary > div {
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 55%, white);
}

.scan-dialog-context {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.scan-dialog-context[hidden] {
  display: none;
}

.scan-dialog-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scan-dialog-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scan-dialog-summary span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.scan-dialog-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.scan-dialog-fields {
  margin-top: 0;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.scan-dialog-quantity-field {
  max-width: 240px;
}

#remove-quantity {
  min-height: 48px;
  font-size: 1.28rem;
  font-weight: 900;
  text-align: center;
}

.scan-dialog-hint {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.scan-quantity-guard-toast {
  position: absolute;
  z-index: 5;
  right: 22px;
  bottom: 84px;
  width: min(420px, calc(100% - 44px));
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger-soft) 78%, #ffffff);
  color: var(--danger);
  box-shadow: 0 14px 30px rgba(93, 37, 37, 0.16);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.35;
  pointer-events: none;
}

.scan-quantity-guard-toast[hidden] {
  display: none;
}

.scan-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.scan-dialog-secondary-action {
  margin-right: auto;
}

.lot-history-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(780px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 96%, #ffffff);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(13, 35, 42, 0.32);
}

.lot-history-dialog::backdrop {
  background: rgba(8, 22, 25, 0.48);
  backdrop-filter: blur(5px);
}

.lot-history-dialog-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(780px, calc(100vh - 28px));
}

.lot-history-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 22px 22px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 62%, #ffffff), #ffffff);
}

.lot-history-eyebrow,
.lot-history-title,
.lot-history-subtitle,
.lot-history-entry p,
.lot-history-entry small,
.lot-history-empty {
  margin: 0;
}

.lot-history-eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.lot-history-title {
  margin-top: 6px;
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 1.36rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
}

.lot-history-subtitle {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.lot-history-close {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 90%, #ffffff);
  color: var(--muted);
  cursor: pointer;
}

.lot-history-close:hover,
.lot-history-close:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent);
}

.lot-history-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.lot-history-list {
  display: grid;
  gap: 0;
  max-height: min(560px, calc(100vh - 180px));
  padding: 10px 22px 22px;
  overflow-y: auto;
}

.lot-history-entry {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
}

.lot-history-entry + .lot-history-entry {
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.lot-history-dot {
  position: relative;
  align-self: start;
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border: 2px solid color-mix(in srgb, var(--accent) 72%, var(--line));
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-soft) 70%, transparent);
}

.lot-history-entry.is-add .lot-history-dot {
  border-color: color-mix(in srgb, var(--success) 72%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success-soft) 72%, transparent);
}

.lot-history-entry.is-remove .lot-history-dot {
  border-color: color-mix(in srgb, var(--danger) 72%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger-soft) 72%, transparent);
}

.lot-history-entry.is-warning .lot-history-dot {
  border-color: color-mix(in srgb, var(--warning) 82%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning-soft) 72%, transparent);
}

.lot-history-entry-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.lot-history-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.lot-history-entry-head strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.25;
}

.lot-history-entry-head time,
.lot-history-entry small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.3;
}

.lot-history-entry p {
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.lot-history-empty {
  padding: 24px 4px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;
}

.metric-detail-list {
  gap: 0;
}

.metric-detail-entry {
  display: grid;
  gap: 5px;
  padding: 13px 0;
}

.metric-detail-entry + .metric-detail-entry {
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.metric-detail-entry strong,
.metric-detail-entry p {
  margin: 0;
}

.metric-detail-entry strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.25;
}

.metric-detail-entry p {
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.metric-detail-entry.is-danger strong {
  color: color-mix(in srgb, var(--danger) 72%, var(--ink));
}

.metric-detail-entry.is-warning strong {
  color: color-mix(in srgb, var(--warning) 72%, var(--ink));
}

.metric-detail-entry.is-low-stock strong {
  color: color-mix(in srgb, var(--warning) 76%, var(--ink));
}

.log-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.preview-title {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
}

.preview-copy,
.date-meta,
.med-meta,
.empty-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.toolbar,
.filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto;
  gap: 8px;
  align-items: center;
  width: min(700px, 100%);
  margin-bottom: 0;
}

.inventory-filter-row {
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 260px);
  width: 100%;
  margin-bottom: 10px;
}

.inventory-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.inventory-print-link {
  min-width: 112px;
}

.inventory-column-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.column-layout-status {
  min-width: 86px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: right;
}

.column-layout-status[data-status-kind="success"] {
  color: var(--success);
}

.column-layout-status[data-status-kind="error"] {
  color: var(--danger);
}

.column-layout-status[data-status-kind="pending"] {
  color: var(--warning);
}

.filter-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.filter-submit:focus-visible {
  position: static;
  width: auto;
  height: auto;
  padding: 8px 12px;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.pagination-link,
.pagination-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-background);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
}

.pagination-status,
.pagination-link.is-disabled {
  color: var(--muted);
}

.pagination-link.is-disabled {
  opacity: 0.58;
}

.pagination-link:not(.is-disabled):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  box-shadow: 0 12px 24px rgba(24, 48, 57, 0.08);
}

.data-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 252, 252, 0.98);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-header:hover {
  color: var(--accent);
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.sort-indicator-icon {
  display: inline-block;
  width: 8px;
  height: 7px;
  background: currentColor;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.sort-indicator-icon.is-empty {
  background: transparent;
  clip-path: none;
}

.sort-indicator-icon.is-asc {
  transform: none;
}

.sort-indicator-icon.is-desc {
  transform: rotate(180deg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.med-name {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
}

.med-reference-hover {
  position: relative;
  width: fit-content;
  max-width: 100%;
  border-radius: 8px;
}

.med-reference-tooltip {
  display: none;
}

.med-reference-hover:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}

.lot-locked-detail {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.lot-locked-detail span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lot-locked-detail strong {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.expiry-locked-detail {
  border-color: color-mix(in srgb, var(--warning) 24%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 68%, #ffffff);
}

.quantity-cell {
  min-width: 90px;
}

td.total-quantity-cell {
  color: var(--ink);
  font-weight: 600;
}

.updated-cell {
  width: 220px;
  min-width: 220px;
}

.updated-cell span {
  display: block;
  max-width: 24ch;
  overflow-wrap: anywhere;
}

.updated-hover {
  position: relative;
  display: inline-grid;
  gap: 2px;
  min-width: 0;
}

.updated-tooltip {
  display: none;
}

.lot-history-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, white);
  color: color-mix(in srgb, var(--accent) 74%, var(--ink));
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease, transform 150ms ease;
}

.lot-history-button:hover,
.lot-history-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 72%, #ffffff);
  color: var(--accent);
  transform: translateY(-1px);
}

.lot-history-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lot-history-source {
  display: none;
}

.history-cell {
  width: 84px;
  min-width: 84px;
  text-align: left;
}

.floating-tooltip strong,
.floating-tooltip span,
.floating-tooltip small {
  max-width: none;
}

.floating-tooltip strong {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.floating-tooltip span {
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.35;
}

.floating-tooltip small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
}

.floating-tooltip {
  position: fixed;
  z-index: 10000;
  display: grid;
  gap: 5px;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 8px;
  background: rgba(248, 252, 252, 0.99);
  color: var(--ink);
  box-shadow: 0 22px 54px rgba(24, 48, 57, 0.22);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  pointer-events: none;
  white-space: normal;
}

.floating-tooltip[hidden] {
  display: none;
}

.floating-tooltip.is-updated {
  width: min(360px, calc(100vw - 24px));
}

.floating-tooltip.is-reference {
  width: max-content;
  max-width: min(330px, calc(100vw - 24px));
}

.expiry-note {
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
}

.expiry-note.expired {
  color: var(--danger);
}

.expiry-note.soon {
  color: var(--warning);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 800;
}

.status.off,
.status.expired {
  border-color: color-mix(in srgb, var(--danger) 26%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.status.soon {
  border-color: color-mix(in srgb, var(--warning) 26%, var(--line));
  background: var(--warning-soft);
  color: var(--warning);
}

.inline-form,
.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.inline-form .control {
  width: auto;
  min-width: 140px;
}

.actions-cell {
  width: 184px;
  min-width: 184px;
}

.action-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.inventory-table {
  table-layout: fixed;
  min-width: 1120px;
}

.inventory-table col.inventory-col-medication {
  width: 19%;
}

.inventory-table col.inventory-col-lot-quantity,
.inventory-table col.inventory-col-total-quantity {
  width: 15%;
}

.inventory-table col.inventory-col-expiry {
  width: 16%;
}

.inventory-table col.inventory-col-updated {
  width: 18%;
}

.inventory-table col.inventory-col-history {
  width: 7%;
}

.inventory-table col.inventory-col-actions {
  width: 13%;
}

.inventory-table th,
.inventory-table td {
  padding: 10px 14px;
}

.inventory-table td {
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  font-size: 0.86rem;
  font-weight: 560;
  line-height: 1.34;
}

.inventory-table th {
  position: sticky;
}

.inventory-table th[data-inventory-column-header] {
  position: sticky;
  padding-right: 18px;
}

.inventory-table.is-column-editing th[data-inventory-column-header] {
  background:
    linear-gradient(180deg, rgba(248, 252, 252, 0.99), color-mix(in srgb, var(--accent-soft) 42%, white));
}

.inventory-table.is-column-resizing,
.inventory-table.is-column-resizing * {
  cursor: col-resize;
  user-select: none;
}

.column-resize-handle {
  position: absolute;
  top: 8px;
  right: 0;
  bottom: 8px;
  z-index: 3;
  display: none;
  width: 12px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
}

.inventory-table.is-column-editing .column-resize-handle {
  display: block;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 5px;
  width: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 34%, var(--line));
}

.column-resize-handle:hover::after,
.column-resize-handle:focus-visible::after,
.inventory-table.is-column-resizing .column-resize-handle::after {
  background: var(--accent);
}

.column-resize-handle:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

.inventory-table .medication-cell {
  padding-left: 14px;
}

.inventory-table .quantity-cell,
.inventory-table .total-quantity-cell {
  min-width: 0;
  text-align: left;
}

.inventory-table .quantity-cell .inventory-display-value {
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
  font-size: 0.86rem;
  font-weight: 560;
  line-height: 1.3;
}

.inventory-table th.quantity-cell .sort-header {
  justify-content: flex-start;
}

.inventory-table td.total-quantity-cell {
  color: color-mix(in srgb, var(--ink) 84%, var(--muted));
  font-size: 0.86rem;
  font-weight: 560;
  white-space: nowrap;
}

.inventory-table td.total-quantity-cell.is-total-different {
  color: var(--accent-deep);
  font-weight: 700;
}

.inventory-table .expiry-cell {
  text-align: left;
}

.inventory-table th.expiry-cell .sort-header {
  justify-content: flex-start;
}

.inventory-table .expiry-cell .inventory-display-value {
  display: inline-grid;
  justify-items: start;
}

.inventory-table .expiry-cell .med-name {
  font-size: 0.88rem;
  font-weight: 800;
}

.inventory-table .updated-cell {
  width: auto;
  min-width: 0;
  color: var(--muted);
}

.inventory-table .updated-cell span {
  max-width: 22ch;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
  line-height: 1.3;
}

.inventory-table .updated-cell .date-meta {
  margin-top: 0;
  color: color-mix(in srgb, var(--muted) 90%, var(--ink));
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.inventory-table .history-cell {
  width: auto;
  min-width: 0;
  padding-right: 10px;
  padding-left: 10px;
  text-align: left;
}

.inventory-table th.history-cell {
  text-align: left;
}

.inventory-table .history-cell .lot-history-button {
  margin-right: auto;
  margin-left: 0;
}

.inventory-table .actions-cell {
  width: auto;
  min-width: 0;
  text-align: left;
}

.inventory-table .actions-cell .action-strip {
  justify-content: flex-start;
}

.inventory-table .mini-button {
  padding-right: 10px;
  padding-left: 10px;
}

.inventory-table .quantity-input {
  text-align: left;
}

.quantity-input {
  width: 100%;
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-background);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.inventory-edit-value,
.inventory-edit-actions {
  display: none;
}

.data-table tr.is-editing td {
  border-bottom-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 62%, #ffffff), color-mix(in srgb, var(--surface-strong) 78%, var(--accent-soft)));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--accent) 20%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--accent) 18%, transparent);
}

.data-table tr.is-editing .inventory-display-value,
.data-table tr.is-editing .inventory-display-actions {
  display: none;
}

.data-table tr.is-editing .inventory-edit-value {
  display: grid;
  gap: 5px;
}

.data-table tr.is-editing .inventory-edit-actions {
  display: flex;
}

.inventory-edit-value label,
.inventory-edit-value .inventory-edit-label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.inventory-edit-value .control,
.inventory-edit-value .quantity-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  text-align: left;
}

.inventory-edit-value .control[type="date"],
.inventory-edit-value .control[data-inventory-date-input] {
  padding-right: 34px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-background);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.mini-button.danger {
  color: var(--danger);
}

.mini-button.primary {
  border-color: transparent;
  background: var(--active-background);
  color: var(--accent-contrast);
}

.mini-button.is-active {
  border-color: transparent;
  background: var(--active-background);
  color: var(--accent-contrast);
}

.log-list li,
.log-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}

.log-list li:last-child {
  border-bottom: 0;
}

.log-entry-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.log-detail {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
}

.log-detail-separator {
  margin: 0 4px;
  color: var(--muted);
}

.log-product-hover {
  position: relative;
  display: inline-flex;
  color: var(--ink);
  font-weight: 900;
  outline: 0;
}

.log-reference-tooltip {
  display: none;
}

.log-delete-form {
  justify-self: end;
}

.log-list small,
.data-table span {
  color: var(--muted);
}

.floating-tooltip.is-reference {
  color: var(--ink);
}

.data-table .sort-indicator {
  color: var(--accent);
}

.floating-tooltip.is-updated span {
  color: var(--ink);
}

.history-panel {
  padding: 0;
}

.history-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.history-summary::-webkit-details-marker {
  display: none;
}

.history-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-background);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.history-toggle::before {
  font-size: 0.72rem;
}

.history-panel[open] .history-toggle::before {
  content: "Masquer";
}

.history-panel[open] .history-toggle {
  font-size: 0;
}

.history-panel:not([open]) .history-toggle::before {
  content: "Afficher";
}

.history-panel:not([open]) .history-toggle {
  font-size: 0;
}

.history-content {
  padding: 0 18px 14px;
}

.toast-region {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(14px, 2vw, 28px);
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 10px;
  overflow: hidden;
  padding: 12px 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 252, 252, 0.98);
  color: var(--ink);
  pointer-events: auto;
  box-shadow: 0 18px 46px rgba(13, 43, 50, 0.22);
  animation: toast-in 180ms ease-out;
}

.toast.success {
  border-color: color-mix(in srgb, var(--success) 34%, var(--line));
}

.toast.error {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
}

.toast.is-hiding {
  animation: toast-out 180ms ease-in forwards;
}

.toast-body {
  display: grid;
  gap: 3px;
}

.toast-body strong {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.toast-body span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.toast-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-background);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.toast-close:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
}

.toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: color-mix(in srgb, var(--accent) 46%, transparent);
  transform-origin: left center;
  animation: toast-progress 5s linear forwards;
}

.toast.success .toast-progress {
  background: color-mix(in srgb, var(--success) 46%, transparent);
}

.toast.error .toast-progress {
  background: color-mix(in srgb, var(--danger) 46%, transparent);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-progress {
  to {
    transform: scaleX(0);
  }
}

.flash-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line));
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(24, 48, 57, 0.3);
}

.flash-dialog::backdrop {
  background: rgba(4, 25, 28, 0.58);
  backdrop-filter: blur(3px);
}

.flash-dialog-content {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.flash-dialog-title {
  margin: 0;
  color: var(--danger);
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.flash-dialog-message {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
}

.flash-dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.confirm-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 16px;
  background: rgba(248, 252, 252, 0.98);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(4, 25, 28, 0.34);
}

.confirm-dialog::backdrop {
  background: rgba(4, 25, 28, 0.6);
  backdrop-filter: blur(4px);
}

.confirm-dialog-content {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
}

.confirm-dialog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger-soft) 74%, white);
  color: var(--danger);
  font-size: 1.05rem;
  font-weight: 900;
}

.confirm-dialog-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.confirm-dialog-eyebrow,
.confirm-dialog-title,
.confirm-dialog-message,
.confirm-dialog-context {
  margin: 0;
}

.confirm-dialog-eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.confirm-dialog-title {
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.1;
}

.confirm-dialog-message {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.confirm-dialog-context {
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 55%, white);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.confirm-dialog-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.login-card {
  width: min(420px, calc(100% - 28px));
  margin: 12vh auto;
}

@media (max-width: 980px) {
  .app-header,
  .scan-box,
  .toolbar,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .scan-choice-grid {
    grid-template-columns: 1fr;
  }

  .manual-add-option {
    justify-content: stretch;
  }

  .manual-add-button {
    width: 100%;
  }

  .scan-dialog-summary,
  .inventory-scan-dialog-remove .scan-dialog-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-create-grid,
  .session-timeout-grid,
  .scanner-diagnostic-grid,
  .scanner-diagnostic-record-main,
  .user-card-summary,
  .user-meta-grid,
  .user-card-actions,
  .user-account-grid,
  .user-password-grid,
  .gtin-association-grid,
  .admin-suggestion-create-grid,
  .admin-suggestion-edit-grid,
  .admin-suggestion-profile-form,
  .backup-scope-grid,
  .backup-option-grid {
    grid-template-columns: 1fr;
  }

  .scanner-diagnostic-record-meta {
    justify-items: start;
    min-width: 0;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .scan-box > .field,
  .scan-box > .actions-row,
  .scan-box > .scan-result {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  body {
    padding: 8px;
  }

  .hero-grid,
  .panel-head,
  .page-head,
  .admin-create-grid,
  .admin-suggestion-search,
  .admin-gtin-search,
  .scanner-diagnostic-status,
  .inventory-form-grid,
  .form-grid,
  .hero-metrics,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .page-head,
  .hero-grid {
    display: grid;
  }

  .admin-suggestion-search .control,
  .admin-gtin-search .control {
    width: 100%;
  }

  .mode-chip {
    justify-self: start;
    white-space: normal;
  }

  .inventory-help-panel > summary {
    align-items: flex-start;
  }

  .inventory-help-panel > summary small {
    display: none;
  }

  .gtin-suggestion {
    display: grid;
  }

  .gtin-suggestion-actions {
    justify-content: stretch;
  }

  .scan-dialog-summary,
  .inventory-scan-dialog-remove .scan-dialog-summary {
    grid-template-columns: 1fr;
  }

  .scan-dialog-actions {
    display: grid;
  }

  .scan-dialog-secondary-action {
    margin-right: 0;
  }

  .inventory-hero .hero-summary {
    white-space: normal;
  }

  .inventory-list-head {
    display: grid;
  }

  .inventory-column-controls {
    justify-content: flex-start;
    min-width: 0;
  }

  .inventory-list-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .column-layout-status {
    text-align: left;
  }

  .log-list li,
  .log-entry {
    grid-template-columns: 1fr;
  }

  .log-delete-form {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .site-logo {
    max-height: 48px;
  }

  h1,
  .page-title {
    font-size: 1.55rem;
    line-height: 1.08;
  }

  .actions-row,
  .row-actions {
    display: grid;
  }

  .button,
  .mini-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
    opacity: 0.5;
  }

  .main-nav a,
  .button,
  .control,
  .select-control,
  .textarea-control {
    transition: none;
  }

  .toast,
  .toast.is-hiding,
  .toast-progress {
    animation: none;
  }
}

@media print {
  body {
    padding: 0;
    background: #ffffff;
  }

  body::before,
  body::after,
  .app-header,
  .hero,
  .form-panel,
  .actions-row,
  .row-actions,
  .toolbar {
    display: none !important;
  }

  .panel {
    box-shadow: none;
    border-color: #d7e3e7;
    background: #ffffff;
  }
}
