:root {
  --bg: #3f444a;
  --surface: #fffdf8;
  --surface-soft: #f7f6f1;
  --text: #19252b;
  --muted: #637179;
  --border: rgba(25, 37, 43, 0.14);
  --accent: #12615b;
  --accent-2: #9a5d22;
  --danger: #b33f37;
  --ok: #16724d;
  --shadow: 0 18px 44px rgba(25, 37, 43, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI Variable Text", Aptos, Arial, sans-serif;
  font-size: 0.9rem;
  background:
    linear-gradient(135deg, rgba(18, 97, 91, 0.22), transparent 34%),
    linear-gradient(225deg, rgba(154, 93, 34, 0.16), transparent 30%),
    var(--bg);
}

body.role-worker {
  --accent: #1f4fd6;
  --accent-2: #6d28d9;
  --surface: #f4f7ff;
  --surface-soft: #eaf0ff;
  --border: rgba(31, 79, 214, 0.24);
  background:
    linear-gradient(135deg, rgba(31, 79, 214, 0.22), transparent 34%),
    linear-gradient(225deg, rgba(109, 40, 217, 0.14), transparent 30%),
    var(--bg);
}

body.role-main {
  --accent: #12615b;
}

body.role-worker::before {
  position: fixed;
  top: 0.45rem;
  left: 0.75rem;
  z-index: 70;
  min-width: 11rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0 0 8px 8px;
  color: white;
  font-size: 0.82rem;
  font-weight: 950;
  text-align: center;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 28px rgba(25, 37, 43, 0.22);
  pointer-events: none;
}

body.role-worker::before {
  content: "PRACOVNA APLIKACIA";
  background: #1f4fd6;
}

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

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: clamp(9rem, 20vw, 15rem);
  max-height: 4.6rem;
  object-fit: contain;
}

.login-logo {
  width: min(16rem, 100%);
  justify-self: center;
}

.topbar-logo {
  width: clamp(8rem, 13vw, 12rem);
}

.portal-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.15rem;
}

.portal-main-logo {
  width: clamp(22rem, 48vw, 40rem);
  max-height: 10.5rem;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.22));
}

button.ghost,
.button.ghost {
  color: var(--accent);
  background: rgba(18, 97, 91, 0.08);
  border-color: rgba(18, 97, 91, 0.18);
}

button.danger-button {
  color: var(--danger);
  background: rgba(179, 63, 55, 0.08);
  border-color: rgba(179, 63, 55, 0.22);
}

.camera-scan-button {
  white-space: nowrap;
}

.disabled {
  pointer-events: none;
  opacity: 0.45;
}

input,
textarea {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
}

#scan-input,
#manual-search {
  border: 2px solid rgba(18, 97, 91, 0.36);
  box-shadow: inset 0 0 0 1px rgba(18, 97, 91, 0.08), 0 2px 8px rgba(25, 37, 43, 0.05);
  font-weight: 750;
}

#scan-input:focus,
#manual-search:focus {
  outline: 3px solid rgba(18, 97, 91, 0.16);
  border-color: rgba(18, 97, 91, 0.74);
}

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 750;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1;
}

h2 {
  font-size: 1.05rem;
}

.topbar {
  width: min(1440px, calc(100% - 1rem));
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
  position: fixed;
  top: 0.35rem;
  left: 50%;
  z-index: 40;
  transform: translate(-50%, calc(-100% + 0.7rem));
  transition: transform 180ms ease, box-shadow 180ms ease;
}

body.role-worker .topbar {
  border-color: rgba(31, 79, 214, 0.58);
  box-shadow: 0 18px 44px rgba(31, 79, 214, 0.22);
}

body.role-main .topbar {
  border-color: rgba(18, 97, 91, 0.36);
}

.topbar:hover,
.topbar:focus-within {
  transform: translate(-50%, 0);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.52rem;
  width: 9rem;
  height: 0.55rem;
  transform: translateX(-50%);
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, rgba(18, 97, 91, 0.24), rgba(18, 97, 91, 0.34));
  border: 1px solid rgba(18, 97, 91, 0.30);
  border-top: 0;
  box-shadow: 0 8px 18px rgba(25, 37, 43, 0.16);
}

.eyebrow {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.subline,
.muted,
small {
  color: var(--muted);
}

.sync-summary {
  margin: 0 0 0.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  font-weight: 800;
}

.sync-summary.ok {
  color: var(--ok);
  border-color: rgba(22, 114, 77, 0.28);
  background: rgba(22, 114, 77, 0.08);
}

.sync-summary.warn {
  color: #8b5a10;
  border-color: rgba(183, 121, 31, 0.32);
  background: rgba(183, 121, 31, 0.09);
}

.sync-summary.bad {
  color: var(--danger);
  border-color: rgba(179, 63, 55, 0.32);
  background: rgba(179, 63, 55, 0.09);
}

.hidden {
  display: none !important;
}

.auth-loading .topbar,
.auth-loading .shell {
  display: none;
}

.auth-screen {
  width: min(1100px, calc(100% - 1rem));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: 1.2rem 0;
}

.portal-screen {
  width: min(1100px, calc(100% - 1rem));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: clamp(1.3rem, 5vh, 3.2rem) 0 1.2rem;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow);
}

.portal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow);
}

.portal-actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-actions label {
  min-width: 14rem;
}

.portal-bg-picker {
  min-width: 7.5rem !important;
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.portal-bg-picker input {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.2rem;
  cursor: pointer;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.portal-grid-featured {
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

.portal-card {
  min-height: 9rem;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  text-align: left;
}

.portal-card[draggable="true"] {
  cursor: grab;
}

.portal-card.dragging {
  opacity: 0.52;
  cursor: grabbing;
  transform: scale(0.99);
}

.portal-card-featured {
  min-height: 10.5rem;
  grid-template-columns: minmax(8.5rem, 42%) minmax(0, 1fr);
  grid-template-areas:
    "media title"
    "media text";
  align-content: center;
  align-items: center;
  column-gap: 1rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  overflow: hidden;
}

.portal-card-featured img {
  grid-area: media;
  width: 100%;
  height: 8.8rem;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  background: white;
}

.portal-card-icon {
  grid-area: media;
  width: 100%;
  height: 8.8rem;
  border-radius: 6px;
  border: 5px solid #060707;
  background:
    linear-gradient(90deg, transparent 20%, #060707 20% 31%, transparent 31%),
    linear-gradient(90deg, transparent 46%, #060707 46% 57%, transparent 57%),
    linear-gradient(90deg, transparent 72%, #060707 72% 83%, transparent 83%),
    radial-gradient(circle at 25% 30%, #060707 0 0.7rem, transparent 0.75rem),
    radial-gradient(circle at 51% 63%, #060707 0 0.7rem, transparent 0.75rem),
    radial-gradient(circle at 77% 42%, #060707 0 0.7rem, transparent 0.75rem),
    white;
  box-shadow: inset 0 0 22px rgba(25, 37, 43, 0.08);
}

.portal-card-docs-icon {
  position: relative;
  border: 0;
  background:
    linear-gradient(#070808 0 0) 62% 24% / 34% 0.42rem no-repeat,
    linear-gradient(#070808 0 0) 62% 39% / 34% 0.42rem no-repeat,
    linear-gradient(#070808 0 0) 62% 54% / 34% 0.42rem no-repeat,
    linear-gradient(90deg, transparent 18%, #070808 18% 26%, transparent 26% 43%, #070808 43% 51%, transparent 51% 68%, #070808 68% 76%, transparent 76%) 15% 42% / 4.8rem 4.3rem no-repeat,
    white;
  box-shadow: none;
}

.portal-card-docs-icon::before,
.portal-card-docs-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.portal-card-docs-icon::before {
  left: 0.95rem;
  top: 1.1rem;
  width: 3.3rem;
  height: 5.6rem;
  border: 0.32rem solid #070808;
  border-radius: 0.18rem;
  background: white;
}

.portal-card-docs-icon::after {
  right: 0.95rem;
  top: 1.05rem;
  width: 3.85rem;
  height: 5.7rem;
  border: 0.32rem solid #070808;
  border-radius: 0.2rem;
  background:
    radial-gradient(circle at 50% 24%, #070808 0 0.7rem, transparent 0.75rem),
    linear-gradient(#070808 0 0) 50% 48% / 58% 0.34rem no-repeat,
    linear-gradient(#070808 0 0) 50% 62% / 58% 0.34rem no-repeat,
    linear-gradient(#070808 0 0) 50% 76% / 58% 0.34rem no-repeat,
    white;
}

.pdf-csv-icon {
  position: relative;
  border: 0;
  background: white;
  box-shadow: none;
}

.pdf-csv-icon::before,
.pdf-csv-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.pdf-csv-icon::before {
  left: 0.72rem;
  top: 1.05rem;
  width: 3.25rem;
  height: 5.7rem;
  border: 0.32rem solid #070808;
  border-radius: 0.18rem;
  background:
    linear-gradient(135deg, transparent 0 48%, #070808 49% 62%, white 63%) right top / 1.15rem 1.15rem no-repeat,
    linear-gradient(#070808 0 0) 50% 58% / 72% 0.34rem no-repeat,
    linear-gradient(#070808 0 0) 50% 72% / 72% 0.34rem no-repeat,
    white;
}

.pdf-csv-icon::after {
  right: 0.72rem;
  top: 1.05rem;
  width: 3.25rem;
  height: 5.7rem;
  border: 0.32rem solid #070808;
  border-radius: 0.18rem;
  background:
    linear-gradient(135deg, transparent 0 48%, #070808 49% 62%, white 63%) right top / 1.15rem 1.15rem no-repeat,
    linear-gradient(#070808 0 0) 50% 47% / 72% 0.22rem no-repeat,
    linear-gradient(#070808 0 0) 50% 61% / 72% 0.22rem no-repeat,
    linear-gradient(#070808 0 0) 50% 75% / 72% 0.22rem no-repeat,
    linear-gradient(90deg, transparent 31%, #070808 32% 38%, transparent 39% 63%, #070808 64% 70%, transparent 71%) center 60% / 72% 3rem no-repeat,
    white;
}

.pdf-csv-icon b,
.pdf-csv-icon em {
  position: absolute;
  z-index: 1;
  color: #070808;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.pdf-csv-icon b {
  left: 1.34rem;
  top: 2.1rem;
}

.pdf-csv-icon em {
  right: 1.18rem;
  top: 2.1rem;
}

.pdf-csv-icon i {
  position: absolute;
  left: 42%;
  top: 48%;
  width: 16%;
  height: 0.36rem;
  background: #070808;
  transform: translateY(-50%);
}

.pdf-csv-icon i::after {
  content: "";
  position: absolute;
  right: -0.1rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  border-top: 0.36rem solid #070808;
  border-right: 0.36rem solid #070808;
  transform: translateY(-50%) rotate(45deg);
}

.portal-card:hover {
  border-color: rgba(18, 97, 91, 0.38);
  background: rgba(18, 97, 91, 0.06);
}

.portal-card span:not(.portal-card-icon) {
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 900;
}

.portal-card-featured span:not(.portal-card-icon) {
  grid-area: title;
  align-self: end;
  font-size: 1.35rem;
  line-height: 1.1;
}

.portal-card strong {
  font-size: 0.92rem;
}

.portal-card-featured strong {
  grid-area: text;
  align-self: start;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.45;
}

.disabled-card {
  opacity: 0.62;
}

.inventory-menu {
  display: grid;
  gap: 0.75rem;
}

.inventory-menu-actions {
  justify-content: flex-start;
}

.inventory-menu-actions label {
  width: min(100%, 24rem);
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(340px, 1.2fr);
  gap: 0.75rem;
  align-items: start;
}

.admin-header-panel {
  grid-column: 1 / -1;
}

.admin-menu-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
}

.admin-content-section {
  grid-column: 1 / -1;
}

.admin-menu-card {
  min-height: 10.5rem;
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon text";
  align-content: center;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-menu-card:hover {
  border-color: rgba(18, 97, 91, 0.38);
  background: rgba(18, 97, 91, 0.06);
}

.admin-menu-card > span:not(.admin-menu-icon) {
  grid-area: title;
  align-self: end;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.1;
}

.admin-menu-card strong {
  grid-area: text;
  align-self: start;
  font-size: 0.98rem;
  line-height: 1.4;
}

.admin-menu-icon {
  grid-area: icon;
  position: relative;
  width: 100%;
  height: 8.8rem;
  border-radius: 6px;
  background: white;
  overflow: hidden;
}

.admin-menu-image {
  grid-area: icon;
  width: 100%;
  height: 8.8rem;
  display: block;
  object-fit: cover;
  border-radius: 6px;
}

.admin-menu-icon::before,
.admin-menu-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.admin-menu-icon-monitor::before {
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1.25rem;
  height: 4.4rem;
  border: 0.38rem solid #070808;
  border-radius: 0.25rem;
  background:
    linear-gradient(#070808 0 0) 18% 72% / 0.65rem 1.3rem no-repeat,
    linear-gradient(#070808 0 0) 39% 58% / 0.65rem 2rem no-repeat,
    linear-gradient(#070808 0 0) 60% 42% / 0.65rem 2.9rem no-repeat,
    linear-gradient(#070808 0 0) 81% 27% / 0.65rem 3.7rem no-repeat;
}

.admin-menu-icon-monitor::after {
  left: 2.2rem;
  right: 2.2rem;
  bottom: 0.55rem;
  height: 0.42rem;
  background: #070808;
  box-shadow: 0 -5.2rem 0 -0.04rem #070808;
}

.admin-menu-icon-theme::before {
  inset: 1.1rem;
  border: 0.38rem solid #070808;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 31%, #070808 0 0.44rem, transparent 0.5rem),
    radial-gradient(circle at 62% 31%, #070808 0 0.44rem, transparent 0.5rem),
    radial-gradient(circle at 30% 56%, #070808 0 0.44rem, transparent 0.5rem),
    radial-gradient(circle at 57% 70%, white 0 0.86rem, transparent 0.92rem),
    white;
}

.admin-menu-icon-theme::after {
  right: 1rem;
  bottom: 0.75rem;
  width: 2.1rem;
  height: 4.7rem;
  border-radius: 1.1rem 1.1rem 0.35rem 0.35rem;
  background: #070808;
  transform: rotate(38deg);
}

.admin-menu-icon-protocols::before {
  left: 1.6rem;
  top: 0.9rem;
  width: 5.4rem;
  height: 6.8rem;
  border: 0.38rem solid #070808;
  border-radius: 0.25rem;
  background:
    linear-gradient(#070808 0 0) 68% 28% / 2.2rem 0.35rem no-repeat,
    linear-gradient(#070808 0 0) 68% 46% / 2.2rem 0.35rem no-repeat,
    linear-gradient(#070808 0 0) 68% 64% / 2.2rem 0.35rem no-repeat,
    white;
}

.admin-menu-icon-protocols::after {
  left: 2.25rem;
  top: 2.15rem;
  width: 1.3rem;
  height: 2.9rem;
  border-right: 0.42rem solid #070808;
  border-bottom: 0.42rem solid #070808;
  transform: rotate(42deg);
  box-shadow: 1.55rem -1.55rem 0 -0.34rem white, 1.55rem -1.55rem 0 0 #070808;
}

.admin-menu-icon-branches::before {
  left: 1.15rem;
  top: 1.25rem;
  width: 2rem;
  height: 2rem;
  border: 0.35rem solid #070808;
  background: white;
  box-shadow:
    4rem 0 0 -0.35rem white,
    4rem 0 0 0 #070808,
    2rem 3.7rem 0 -0.35rem white,
    2rem 3.7rem 0 0 #070808;
}

.admin-menu-icon-branches::after {
  left: 2.9rem;
  top: 2.15rem;
  width: 3.5rem;
  height: 3.5rem;
  border-left: 0.38rem solid #070808;
  border-bottom: 0.38rem solid #070808;
  transform: rotate(-45deg);
}

.admin-menu-icon-users::before {
  left: 1rem;
  bottom: 1.2rem;
  width: 3rem;
  height: 3.5rem;
  border-radius: 1.5rem 1.5rem 0.4rem 0.4rem;
  background: #070808;
  box-shadow: 3.65rem 0.15rem 0 -0.15rem #070808;
}

.admin-menu-icon-users::after {
  left: 1.58rem;
  top: 1.15rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: #070808;
  box-shadow: 3.65rem 0.35rem 0 -0.1rem #070808;
}

.admin-theme-panel {
  grid-column: 1 / -1;
}

.admin-monitor-panel {
  grid-column: 1 / -1;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.monitor-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.monitor-card span {
  color: var(--muted);
  font-weight: 800;
}

.monitor-card strong {
  font-size: 1.05rem;
}

.monitor-card small {
  color: var(--muted);
  font-weight: 700;
}

.monitor-card.ok {
  border-color: rgba(22, 114, 77, 0.35);
  background: rgba(22, 114, 77, 0.08);
}

.monitor-card.warn {
  border-color: rgba(154, 93, 34, 0.4);
  background: rgba(154, 93, 34, 0.09);
}

.monitor-card.bad {
  border-color: rgba(179, 63, 55, 0.4);
  background: rgba(179, 63, 55, 0.09);
}

.monitor-card.ok strong {
  color: var(--ok);
}

.monitor-card.warn strong {
  color: var(--accent-2);
}

.monitor-card.bad strong {
  color: var(--danger);
}

.monitor-log {
  max-height: 18rem;
  margin-top: 0.8rem;
  padding: 0.85rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111517;
  color: #ecf4f1;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.harness-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.harness-wide {
  grid-column: 1 / -1;
}

.tomafer-panel {
  display: grid;
  gap: 0.75rem;
}

.tomafer-import-panel {
  width: min(920px, 100%);
}

.supplier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.supplier-grid legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-weight: 900;
}

.supplier-card {
  min-height: 8rem;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.5rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.supplier-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.supplier-card img {
  max-width: 8.5rem;
  max-height: 3.3rem;
  object-fit: contain;
}

.supplier-card span {
  font-weight: 900;
}

.supplier-card.selected {
  border-color: rgba(18, 97, 91, 0.5);
  background: rgba(18, 97, 91, 0.07);
  box-shadow: inset 0 0 0 1px rgba(18, 97, 91, 0.2);
}

.harness-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(340px, 1.15fr);
  gap: 0.8rem;
  align-items: start;
}

.harness-detail {
  display: grid;
  gap: 0.8rem;
}

.harness-protocol {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.protocol-copy {
  display: grid;
  gap: 0.75rem;
}

.print-only {
  display: none;
}

.protocol-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.45rem 0.8rem;
  align-items: start;
}

.protocol-grid span {
  color: var(--muted);
  font-weight: 800;
}

.protocol-link {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 1.8rem;
}

.signature-grid div {
  min-height: 4.2rem;
  display: flex;
  align-items: end;
  border-bottom: 1px solid var(--text);
}

.signature-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  transform: translateY(1.4rem);
}

.protocol-prefill-card {
  background: var(--surface-soft);
}

.revision-checks {
  margin: 0;
}

.revision-history {
  display: grid;
  gap: 0.55rem;
}

.revision-history h3 {
  margin: 0;
}

#harness-revision-print-area {
  display: none;
}

.revision-print-copy {
  display: grid;
  gap: 0.9rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.revision-print-table {
  width: 100%;
  border-collapse: collapse;
}

.revision-print-table th,
.revision-print-table td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.revision-print-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 900;
}

.saved-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.saved-checks span {
  padding: 0.24rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.saved-checks span.done {
  color: var(--ok);
  border-color: rgba(22, 114, 77, 0.28);
  background: rgba(22, 114, 77, 0.08);
}

.qr-code {
  width: 8rem;
  height: 8rem;
  object-fit: contain;
}

.harness-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.55rem;
}

.harness-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.theme-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem;
}

.theme-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.theme-form input[type="color"] {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.2rem;
  cursor: pointer;
}

.theme-actions {
  grid-column: 1 / -1;
}

.live-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: 0.75rem;
  align-items: start;
}

.live-panel > .panel:first-child,
.live-panel > .panel:last-child {
  grid-column: 1 / -1;
}

.live-events {
  display: grid;
  gap: 0.75rem;
}

.live-filters {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, auto) minmax(8rem, auto) minmax(11rem, auto);
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.live-filters label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.live-item-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.live-item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.85rem;
}

.live-item-head > div:first-child {
  display: grid;
  gap: 0.15rem;
}

.live-item-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.live-item-totals span {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.sync-connect {
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr) minmax(12rem, 1fr) auto auto;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.45rem;
  max-width: 52rem;
}

.sync-connect input,
.sync-connect select {
  min-height: 2rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
}

.worker-db-info {
  padding: 0.85rem;
  border: 1px solid rgba(15, 111, 143, 0.24);
  border-radius: 8px;
  background: rgba(15, 111, 143, 0.08);
  margin-bottom: 0.8rem;
}

.worker-client-card {
  border-left: 5px solid var(--ok);
}

.worker-client-card.warn {
  border-left-color: #b7791f;
}

.worker-client-card.bad {
  border-left-color: var(--danger);
}

.catalog-sync-dialog {
  width: min(28rem, calc(100vw - 2rem));
  border: 0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 22px 60px rgba(25, 37, 43, 0.24);
}

.catalog-sync-dialog::backdrop {
  background: rgba(25, 37, 43, 0.28);
}

.catalog-sync-body {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--surface);
}

.small-button {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
}

.finish-button {
  background: #2f855a;
  border-color: #2f855a;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tab {
  color: var(--text);
  background: transparent;
  border-color: transparent;
}

a.tab {
  text-decoration: none;
}

.tab.active {
  color: white;
  background: var(--accent);
}

.shell {
  width: min(1440px, calc(100% - 1rem));
  margin: 0.55rem auto 2rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view.live-panel.active {
  display: grid;
}

.layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(440px, 1.05fr);
  gap: 0.75rem;
  align-items: start;
}

.layout.two {
  grid-template-columns: minmax(320px, 0.75fr) minmax(480px, 1.25fr);
}

.session-left-column {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.price-check-layout {
  grid-template-columns: minmax(340px, 0.72fr) minmax(560px, 1.28fr);
}

.statistics-layout {
  display: grid;
  grid-template-columns: minmax(320px, var(--stat-left-col, 1fr)) 8px minmax(420px, var(--stat-right-col, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.counting-layout {
  display: grid;
  grid-template-columns: minmax(330px, var(--work-col, 1fr)) 8px minmax(390px, var(--count-col, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.inventory-strip {
  grid-column: 1 / -1;
  padding: 0.75rem 0.85rem;
  position: sticky;
  top: 0.85rem;
  z-index: 30;
}

.inventory-strip .section-head {
  margin-bottom: 0.55rem;
}

.strip-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(150px, 0.55fr) minmax(420px, 1.35fr);
  gap: 0.65rem;
  align-items: end;
}

.panel {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 10px 24px rgba(25, 37, 43, 0.07);
}

.work-panel {
  min-height: 420px;
}

.counted-panel {
  min-height: 420px;
}

.resizable-panel {
  resize: vertical;
  overflow: auto;
  min-height: 280px;
  max-height: calc(100vh - 8rem);
}

.column-resizer {
  width: 8px;
  min-height: 420px;
  align-self: stretch;
  border-radius: 999px;
  background: rgba(18, 97, 91, 0.12);
  border: 1px solid rgba(18, 97, 91, 0.12);
  cursor: col-resize;
  transition: background 160ms ease, border-color 160ms ease;
}

.column-resizer:hover,
.column-resizer.dragging {
  background: rgba(18, 97, 91, 0.28);
  border-color: rgba(18, 97, 91, 0.34);
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.list-filter {
  display: grid;
  gap: 0.35rem;
  margin: -0.2rem 0 0.75rem;
}

.list-filter select {
  max-width: 18rem;
}

.field-grid,
.scan-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.scan-box {
  grid-template-columns: minmax(12rem, 1fr) 7rem auto auto;
  align-items: end;
  margin-top: 0.45rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.wide-input {
  margin-bottom: 0.65rem;
}

.top-gap {
  margin-top: 1rem;
}

.inline-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.price-column-grid,
.price-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.price-filter-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.6fr) minmax(140px, 0.4fr);
  margin-bottom: 0.75rem;
}

.price-results {
  max-height: calc(100vh - 13rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.price-table th,
.price-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.price-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
}

.price-table td:nth-child(3),
.price-table td:nth-child(4),
.price-table td:nth-child(5),
.price-table td:nth-child(6),
.price-table td:nth-child(7) {
  text-align: right;
}

.price-status-different {
  background: rgba(154, 93, 34, 0.08);
}

.price-status-missing_code,
.price-status-invalid_price {
  background: rgba(179, 63, 55, 0.08);
}

.message {
  margin-top: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  font-weight: 750;
}

.scan-message-inline {
  margin-top: 0;
}

.scan-stock-info {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-weight: 750;
}

.scan-stock-info.success {
  color: var(--ok);
  border-color: rgba(22, 114, 77, 0.25);
  background: rgba(22, 114, 77, 0.08);
}

.scan-stock-info.warning {
  color: #8b5a10;
  border-color: rgba(217, 163, 33, 0.28);
  background: rgba(217, 163, 33, 0.1);
}

.scan-stock-info.error {
  color: var(--danger);
  border-color: rgba(179, 63, 55, 0.25);
  background: rgba(179, 63, 55, 0.08);
}

.message.success {
  color: var(--ok);
  border-color: rgba(22, 114, 77, 0.25);
  background: rgba(22, 114, 77, 0.08);
}

.result-summary {
  display: grid;
  gap: 0.3rem;
}

.export-box {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(18, 97, 91, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--text);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.message.error,
.error-text {
  color: var(--danger);
}

.control-box {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}

.compact-control {
  grid-template-columns: auto minmax(180px, 0.7fr) minmax(260px, 1fr);
  align-items: center;
  margin-top: 0;
  padding: 0.55rem;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.check-line input {
  width: auto;
  min-height: auto;
}

.check-group {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.check-group legend {
  padding: 0 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.stock-result {
  display: grid;
  gap: 0.18rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-weight: 750;
}

.manual-box {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.manual-box .section-head {
  margin-bottom: 0;
}

.stock-result.success {
  color: var(--ok);
  border-color: rgba(22, 114, 77, 0.25);
  background: rgba(22, 114, 77, 0.08);
}

.stock-result.warning {
  color: var(--accent-2);
  border-color: rgba(154, 93, 34, 0.25);
  background: rgba(154, 93, 34, 0.08);
}

.stock-result.error {
  color: var(--danger);
  border-color: rgba(179, 63, 55, 0.25);
  background: rgba(179, 63, 55, 0.08);
}

.results,
.card-stack,
.count-list {
  display: grid;
  gap: 0.55rem;
}

.operator-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.operator-summary article,
.compact-empty {
  display: grid;
  gap: 0.12rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.operator-summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.stock-snapshot-card.archived {
  opacity: 0.62;
  background: rgba(25, 37, 43, 0.04);
}

.branch-card.archived {
  opacity: 0.62;
  background: rgba(25, 37, 43, 0.04);
}

.result-card,
.session-card,
.count-row,
.mini-card,
.empty {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.session-card.selected {
  border-color: rgba(18, 97, 91, 0.45);
  background: rgba(18, 97, 91, 0.07);
}

.session-card-compact {
  display: grid;
  padding: 0.65rem 0.75rem;
}

.session-card-compact > div:first-child {
  gap: 0.12rem;
}

.session-actions {
  display: flex !important;
  flex-direction: row;
  flex-wrap: wrap;
  margin-top: 0.45rem;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
}

.session-actions button {
  width: auto;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
}

.session-actions .select-line {
  min-width: auto;
  width: auto;
}

.select-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 9rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.select-line input {
  width: auto;
  min-height: auto;
}

.result-card div,
.session-card div,
.count-row div,
.mini-card {
  display: grid;
  gap: 0.2rem;
}

.manual-actions {
  grid-template-columns: 6.5rem auto;
  align-items: end;
}

.qty-pill {
  min-width: 7rem;
  justify-items: end;
  align-self: center;
  color: var(--accent);
  font-weight: 900;
}

.diff {
  min-width: 4.5rem;
  align-self: center;
  text-align: right;
  font-weight: 900;
  color: var(--accent-2);
}

.count-row-grouped {
  align-items: flex-start;
}

.count-row-grouped small {
  line-height: 1.5;
}

.count-diff-stack {
  justify-items: end;
  min-width: 8.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: right;
}

.count-diff-stack .qty-pill,
.count-diff-stack .diff {
  min-width: 0;
}

.diff.ok {
  color: var(--ok);
}

.diff.bad {
  color: var(--danger);
}

.diff.warn {
  color: var(--accent-2);
}

.form-stack,
.upload-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.workflow-box {
  margin-bottom: 0.85rem;
  padding: 0.8rem;
  border: 1px solid rgba(18, 97, 91, 0.18);
  border-radius: 8px;
  background: var(--surface-soft);
}

.workflow-box > .form-stack,
.workflow-box.form-stack {
  margin-bottom: 0;
}

.upload-form {
  padding: 0.8rem;
  border: 1px solid rgba(18, 97, 91, 0.18);
  border-radius: 8px;
  background: var(--surface-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.summary-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.summary-button {
  width: 100%;
  min-height: auto;
  justify-content: stretch;
  text-align: left;
  color: var(--text);
  border-color: var(--border);
  background: white;
  text-decoration: none;
  cursor: pointer;
}

.summary-button:hover {
  border-color: rgba(18, 97, 91, 0.38);
  background: rgba(18, 97, 91, 0.06);
}

.summary-card strong {
  font-size: 1.45rem;
  color: var(--accent);
}

.summary-card small {
  color: var(--muted);
  font-weight: 750;
}

.statistic-row {
  align-items: center;
}

.statistic-report {
  display: grid;
  gap: 0.75rem;
}

.statistics-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.warehouse-stat-box {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid rgba(18, 97, 91, 0.20);
  border-radius: 8px;
  background: var(--surface-soft);
}

.warehouse-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.warehouse-stat-grid.single-warehouse {
  grid-template-columns: 1fr;
}

.warehouse-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.warehouse-stat-head h3 {
  margin: 0;
  font-size: 1rem;
}

.warehouse-stat-head span {
  font-weight: 900;
  color: var(--accent);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
}

.stat-grid span {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.stat-grid strong {
  color: var(--text);
}

.stat-grid small {
  color: var(--muted);
  font-weight: 800;
}

.database-dialog {
  width: min(1240px, calc(100% - 1rem));
  max-height: min(760px, calc(100vh - 1rem));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.database-dialog::backdrop {
  background: rgba(25, 37, 43, 0.42);
}

.dialog-head,
.dialog-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dialog-foot {
  margin: 0.75rem 0 0;
}

.database-results {
  margin-top: 0.65rem;
  max-height: 540px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.database-row {
  display: grid;
  gap: 0.18rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.database-table {
  min-width: 980px;
}

.database-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.database-table td:nth-child(2) {
  white-space: normal;
  min-width: 18rem;
}

.main-lookup-dialog {
  width: min(1180px, calc(100% - 1rem));
}

.main-lookup-results {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.65rem;
  max-height: 560px;
  overflow: auto;
}

.main-lookup-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.main-lookup-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.main-lookup-card-head > div:first-child,
.main-lookup-total {
  display: grid;
  gap: 0.18rem;
}

.main-lookup-total {
  min-width: 8rem;
  justify-items: end;
  color: var(--accent);
}

.main-lookup-total span,
.scan-history summary {
  color: var(--muted);
  font-weight: 800;
}

.lookup-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.lookup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.lookup-table th,
.lookup-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.lookup-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

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

.lookup-table .number-cell {
  text-align: right;
  font-weight: 900;
}

.scan-history {
  display: grid;
  gap: 0.55rem;
}

.scan-history summary {
  cursor: pointer;
}

.not-found-dialog {
  width: min(560px, calc(100% - 1rem));
  border: 2px solid rgba(179, 63, 55, 0.45);
  border-radius: 14px;
  padding: 0;
  background: white;
  box-shadow: 0 28px 90px rgba(179, 63, 55, 0.26);
}

.not-found-dialog::backdrop {
  background: rgba(25, 37, 43, 0.55);
}

.not-found-body {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding: 2rem 1.25rem;
  text-align: center;
}

.not-found-body strong {
  color: var(--danger);
  font-size: 2rem;
  line-height: 1;
}

.not-found-body p {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 750;
}

.assign-ean-dialog {
  width: min(520px, calc(100% - 1rem));
  border: 1px solid rgba(18, 97, 91, 0.3);
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(18, 97, 91, 0.22);
}

.assign-ean-dialog::backdrop {
  background: rgba(25, 37, 43, 0.5);
}

.camera-scan-dialog {
  width: min(720px, calc(100% - 1rem));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.camera-scan-dialog::backdrop {
  background: rgba(25, 37, 43, 0.62);
}

.camera-scan-body {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.camera-scan-body video {
  width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  background: #0f1416;
}

.assign-ean-body {
  display: grid;
  gap: 0.85rem;
  padding: 1.25rem;
}

.assign-ean-body h2 {
  margin: 0;
}

.assign-ean-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(18, 97, 91, 0.22);
  background: rgba(18, 97, 91, 0.08);
}

.assign-ean-card.soft {
  background: var(--surface-soft);
  border-color: var(--border);
}

.assign-ean-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.assign-ean-card strong {
  color: var(--text);
  font-size: 1rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  h1 {
    font-size: 1.6rem;
  }

  .topbar {
    transform: none;
    left: 0.5rem;
    width: calc(100% - 1rem);
    top: 0.35rem;
  }

  .topbar:hover,
  .topbar:focus-within {
    transform: none;
  }

  .topbar::after {
    display: none;
  }

  .inventory-strip {
    top: 4.8rem;
  }

  .topbar,
  .layout,
  .layout.two,
  .statistics-layout,
  .statistics-report-grid,
  .warehouse-stat-grid,
  .counting-layout,
  .scan-box,
  .live-filters,
  .field-grid,
  .price-column-grid,
  .price-filter-grid,
  .strip-grid,
  .compact-control {
    grid-template-columns: 1fr;
  }

  .portal-grid-featured {
    grid-template-columns: 1fr;
  }

  .admin-menu-grid {
    grid-template-columns: 1fr;
  }

  .portal-card-featured {
    grid-template-columns: minmax(6rem, 34%) minmax(0, 1fr);
    min-height: 8.5rem;
  }

  .admin-menu-card {
    grid-template-columns: minmax(6rem, 34%) minmax(0, 1fr);
    min-height: 8.5rem;
  }

  .portal-card-featured img,
  .portal-card-icon,
  .admin-menu-icon {
    height: 7rem;
  }

  .topbar,
  .portal-head,
  .section-head,
  .result-card,
  .session-card,
  .main-lookup-card-head,
  .count-row {
    flex-direction: column;
  }

  .main-lookup-total {
    justify-items: start;
  }

  .manual-actions {
    grid-template-columns: 1fr auto;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .portal-actions,
  .portal-actions label {
    width: 100%;
  }

  .admin-panel {
    grid-template-columns: 1fr;
  }

  .live-panel {
    grid-template-columns: 1fr;
  }

  .harness-panel,
  .harness-layout {
    grid-template-columns: 1fr;
  }

  .column-resizer {
    display: none;
  }

  .resizable-panel {
    max-height: none;
  }
}

@media print {
  body {
    background: white;
  }

  body * {
    visibility: hidden;
  }

  #harness-print-area,
  #harness-print-area * {
    visibility: visible;
  }

  body.print-revision-mode #harness-print-area {
    display: none;
  }

  body.print-revision-mode #harness-revision-print-area,
  body.print-revision-mode #harness-revision-print-area * {
    visibility: visible;
  }

  #harness-print-area {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    border: 0;
    box-shadow: none;
  }

  body.print-revision-mode #harness-revision-print-area {
    position: absolute;
    inset: 0 auto auto 0;
    display: block;
    width: 100%;
  }

  .revision-print-copy {
    display: none;
  }

  .revision-print-copy.selected-print {
    display: grid;
    min-height: 96vh;
    border: 0;
    box-shadow: none;
  }

  #harness-print-area .print-only {
    display: grid;
  }

  .protocol-copy {
    min-height: 95vh;
    padding: 1.2rem;
    page-break-after: always;
  }

  .protocol-copy:last-child {
    page-break-after: auto;
  }
}
