:root {
  --bg: #f4f6f4;
  --panel: #ffffff;
  --panel-strong: #f9faf7;
  --ink: #151a17;
  --muted: #66716b;
  --line: #d9e0db;
  --line-strong: #b9c4bd;
  --green: #2f6f63;
  --green-dark: #1f5148;
  --amber: #b97822;
  --amber-soft: #fff4df;
  --red: #ad3f32;
  --red-soft: #fff0ee;
  --blue: #356c9c;
  --blue-soft: #edf5fb;
  --shadow: 0 16px 45px rgba(23, 31, 27, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body:not(.is-authenticated):not(.is-public-box) .app-shell {
  display: none;
}

body.is-authenticated .auth-screen,
body.is-public-box .auth-screen {
  display: none;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(21, 26, 23, 0.94), rgba(47, 111, 99, 0.86)),
    var(--ink);
}

.auth-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 2rem;
}

.auth-card .brand-mark {
  background: #e8f2ef;
  color: var(--green-dark);
  border-color: var(--line);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: #17211d;
  color: #f3f7f2;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark,
.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: #f0b44c;
  color: #151a17;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #b9c6be;
  font-size: 0.84rem;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 7px;
  color: #dbe5df;
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-status {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce7df;
}

.sidebar-status strong {
  color: #ffffff;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.context-line {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.admin-login {
  display: flex;
  gap: 8px;
}

.admin-password input,
.search-field input,
label input,
label select,
label textarea,
.select-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

label textarea {
  min-height: auto;
  padding-top: 11px;
  resize: vertical;
}

.admin-password input:focus,
.search-field input:focus,
label input:focus,
label select:focus,
label textarea:focus,
.select-field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 111, 99, 0.14);
}

.primary-button,
.secondary-button,
.icon-button,
.text-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  background: var(--green);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button,
.icon-button,
.text-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.secondary-button:hover,
.icon-button:hover,
.text-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-strong);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.danger-button {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f1c2bd;
}

.danger-button:hover {
  background: #ffe2de;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view.active > .panel,
.view.active .form-section,
.view.active .ldl-form-section,
.view.active .box-sheet-section,
.view.active .safety-work-grid > .panel {
  content-visibility: auto;
  contain-intrinsic-size: auto 460px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  min-width: min(420px, 80vw);
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 12px;
  color: var(--muted);
}

.search-field input {
  padding-left: 38px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.metric.warn {
  border-color: #efcf96;
  background: var(--amber-soft);
}

.metric.hot {
  border-color: #e7aaa2;
  background: var(--red-soft);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.split-layout > * {
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  margin-bottom: 0;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior: contain;
}

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

.data-table th,
.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--panel-strong);
  color: #3c4741;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: #f8fbf9;
}

.data-table tbody tr.selected {
  background: var(--blue-soft);
}

.count-pill,
.status-pill,
.lock-chip,
.small-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #3c4741;
  font-weight: 800;
  font-size: 0.78rem;
  white-space: nowrap;
}

.status-pill.status-active {
  border-color: #acd5ca;
  background: #eaf7f3;
  color: var(--green-dark);
}

.status-pill.status-planned {
  border-color: #bdd5e9;
  background: var(--blue-soft);
  color: #28577e;
}

.status-pill.status-hold {
  border-color: #efcf96;
  background: var(--amber-soft);
  color: #7b4b0c;
}

.status-pill.status-ready-for-release {
  border-color: #c8d8b6;
  background: #f0f7e8;
  color: #496720;
}

.status-pill.status-released {
  border-color: #d2d7d3;
  background: #eef1ee;
  color: #606b65;
}

.status-pill.status-issued,
.status-pill.status-in-service {
  border-color: #acd5ca;
  background: #eaf7f3;
  color: var(--green-dark);
}

.status-pill.status-returned,
.status-pill.status-spare {
  border-color: #d2d7d3;
  background: #eef1ee;
  color: #606b65;
}

.status-pill.status-lost,
.status-pill.status-damaged {
  border-color: #e7aaa2;
  background: var(--red-soft);
  color: var(--red);
}

.status-pill.status-removed {
  border-color: #efcf96;
  background: var(--amber-soft);
  color: #7b4b0c;
}

.lock-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lock-chip {
  background: #f7f9f6;
}

.action-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.text-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.detail-panel {
  position: sticky;
  top: 18px;
  min-height: 420px;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 360px;
  padding: 28px;
  color: var(--muted);
}

.empty-state h3 {
  margin: 12px 0 6px;
  color: var(--ink);
}

.detail-content {
  padding: 16px;
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.detail-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
}

.detail-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-item strong {
  overflow-wrap: anywhere;
}

.check-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f8faf8;
  border: 1px solid var(--line);
}

.check-item.done {
  border-color: #acd5ca;
  background: #eef8f4;
}

.evidence-section {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.evidence-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.evidence-header h3 {
  margin-bottom: 0;
}

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

.evidence-card,
.evidence-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.evidence-card {
  overflow: hidden;
}

.evidence-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.evidence-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e7ece8;
}

.evidence-card div {
  display: grid;
  gap: 3px;
  padding: 9px;
}

.evidence-card strong,
.evidence-card span {
  overflow-wrap: anywhere;
}

.evidence-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.evidence-card .danger-button {
  width: calc(100% - 18px);
  margin: 0 9px 9px;
}

.evidence-empty {
  grid-column: 1 / -1;
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.evidence-upload-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.evidence-upload-form label {
  display: grid;
  gap: 6px;
  color: #3f4a43;
  font-size: 0.86rem;
  font-weight: 800;
}

.loto-form {
  display: grid;
  gap: 14px;
}

.asset-form {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.signature-field {
  display: grid;
  gap: 10px;
}

.signature-label {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.signature-label strong,
.signature-label span {
  display: block;
}

.signature-label span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

#controlSignaturePad {
  width: 100%;
  max-width: 760px;
  height: auto;
  aspect-ratio: 38 / 11;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(23, 31, 27, 0.02);
  touch-action: none;
  cursor: crosshair;
}

.signature-thumb {
  display: block;
  width: 140px;
  max-width: 100%;
  height: 44px;
  margin: 4px 0;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.compact-metrics .metric {
  min-height: 96px;
}

.form-section {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.form-section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.form-section-title > span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #17211d;
  color: #ffffff;
  font-weight: 800;
}

.form-section-title p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.9rem;
}

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

.form-grid label,
.stack-form label {
  display: grid;
  gap: 6px;
  color: #3f4a43;
  font-size: 0.86rem;
  font-weight: 800;
}

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

.check-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.check-grid label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 56px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
  font-weight: 800;
  font-size: 0.84rem;
}

.check-grid input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--green);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(280px, 1fr);
  gap: 16px;
}

.user-panel {
  grid-column: 1 / -1;
}

.user-table {
  min-width: 700px;
}

.stack-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.rule-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.rule-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
}

.rule-list span {
  color: var(--muted);
}

.admin-only {
  display: none !important;
}

body.is-admin .admin-only {
  display: inline-flex !important;
}

body.is-admin th.admin-only,
body.is-admin td.admin-only {
  display: table-cell !important;
}

body.is-admin .admin-login {
  display: none !important;
}

#cancelEditBtn {
  display: none;
}

body.editing #cancelEditBtn {
  display: inline-flex;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  background: #17211d;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-status {
    display: none;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .form-section {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .admin-login,
  .filter-bar {
    width: 100%;
  }

  .admin-login {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .icon-button,
  .search-field,
  .select-field {
    width: 100%;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .metric-grid,
  .form-grid,
  .check-grid,
  .detail-grid,
  .evidence-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .signature-label {
    align-items: stretch;
    flex-direction: column;
  }
}

.box-control-sheet {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.box-sheet-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  gap: 28px;
  padding: 24px;
  border-bottom: 4px solid var(--green);
}

.box-sheet-header h2 {
  margin: 3px 0 8px;
  font-size: 3rem;
}

.box-sheet-header p {
  margin: 0;
  color: var(--muted);
}

.box-qr {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: #000000;
}

.box-qr svg {
  display: block;
  width: min(150px, 100%);
  height: auto;
  fill: #000000;
  stroke: none;
}

.box-qr strong {
  font-size: 1.05rem;
}

.box-sheet-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.box-sheet-facts > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.box-sheet-facts > div:last-child {
  border-right: 0;
}

.box-sheet-facts span,
.box-sheet-facts strong {
  display: block;
  overflow-wrap: anywhere;
}

.box-sheet-facts span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.box-sheet-section {
  border-bottom: 1px solid var(--line);
}

.box-sheet-section .data-table tbody tr {
  cursor: default;
}

.box-sheet-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.box-sheet-evidence-card {
  min-width: 0;
  break-inside: avoid;
}

.box-sheet-evidence-card .box-evidence-record {
  width: fit-content;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.box-sheet-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.box-sheet-empty {
  min-height: 420px;
}

.qr-unavailable {
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 1;
  border: 2px dashed var(--line-strong);
  color: var(--red);
  text-align: center;
}

body.is-public-box {
  background: #f4f7fb;
}

body.is-public-box .sidebar,
body.is-public-box .topbar,
body.is-public-box .box-sheet-toolbar .action-row {
  display: none !important;
}

body.is-public-box .app-shell {
  display: block;
}

body.is-public-box .workspace {
  min-height: 100vh;
  padding: clamp(14px, 3vw, 32px);
}

body.is-public-box .view {
  display: none !important;
}

body.is-public-box #view-box-sheet {
  display: block !important;
}

body.is-public-box .box-sheet-toolbar {
  margin: 0 auto 14px;
  max-width: 1180px;
}

body.is-public-box .box-control-sheet {
  max-width: 1180px;
  margin: 0 auto;
}

body.is-public-box .box-sheet-footer span:first-child::before {
  content: "Read-only public QR sheet | ";
  font-weight: 900;
}

@media (max-width: 1180px) {
  .box-sheet-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .box-sheet-facts > div:nth-child(3) {
    border-right: 0;
  }
}

@media (max-width: 760px) {
  .box-sheet-toolbar .action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .box-sheet-header {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .box-sheet-header h2 {
    font-size: 2rem;
  }

  .box-qr {
    justify-self: center;
    width: min(280px, 100%);
  }

  .box-sheet-facts {
    grid-template-columns: 1fr 1fr;
  }

  .box-sheet-evidence-grid {
    grid-template-columns: 1fr;
  }

  .box-sheet-facts > div:nth-child(2n) {
    border-right: 0;
  }

  .box-sheet-footer {
    flex-direction: column;
  }
}

@media print {
  @page {
    margin: 0.35in;
  }

  body {
    background: #ffffff;
  }

  .view.active > .panel,
  .view.active .form-section,
  .view.active .ldl-form-section,
  .view.active .box-sheet-section,
  .view.active .safety-work-grid > .panel {
    content-visibility: visible;
    contain-intrinsic-size: none;
  }

  .sidebar,
  .topbar,
  .box-sheet-toolbar,
  .toast {
    display: none !important;
  }

  .app-shell,
  .workspace,
  #view-box-sheet {
    display: block !important;
    padding: 0;
  }

  .view:not(#view-box-sheet) {
    display: none !important;
  }

  .box-control-sheet {
    border-color: #707070;
    box-shadow: none;
  }

  .box-sheet-header,
  .box-sheet-section,
  .box-sheet-facts {
    break-inside: avoid;
  }

  .box-sheet-evidence-section {
    break-inside: auto;
  }

  .box-sheet-evidence-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
  }

  .box-sheet-section .table-wrap {
    overflow: visible;
  }

  .box-sheet-section .data-table {
    min-width: 0;
  }

  .box-sheet-section .data-table th,
  .box-sheet-section .data-table td {
    padding: 7px;
    font-size: 8pt;
  }

  body.print-qr-label .box-control-sheet {
    border: 0;
  }

  body.print-qr-label .box-sheet-header {
    display: grid;
    grid-template-columns: 1fr;
    width: 2in;
    min-height: 0;
    margin: 0 auto;
    padding: 0.15in;
    border: 1px solid #000000;
    text-align: center;
  }

  body.print-qr-label .box-sheet-header > div:not(.box-qr) {
    display: none !important;
  }

  body.print-qr-label .box-sheet-header .box-qr {
    grid-row: 1;
    justify-self: center;
    width: 1.6in;
    padding: 0;
    border: 0;
  }

  body.print-qr-label .box-sheet-header .box-qr svg {
    width: 1.35in;
  }

  body.print-qr-label .box-sheet-header .box-qr strong {
    font-size: 12pt;
  }

  body.print-qr-label .box-sheet-facts,
  body.print-qr-label .box-sheet-section,
  body.print-qr-label .box-sheet-footer {
    display: none !important;
  }
}
