:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #e8edf2;
  background: #0c1015;
  font-synthesis: none;
  --muted: #9aa8b8;
  --line: #293440;
  --panel: #141b23;
  --accent: #b8edce;
  --danger: #ffb4b0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
button,
summary,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 16px;
  background: #202b37;
  color: #e8edf2;
  font-size: 0.9rem;
  font-weight: 600;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button:hover:not(:disabled) {
  filter: brightness(1.13);
}
:focus-visible {
  outline: 3px solid #b8edce;
  outline-offset: 3px;
}
button.primary {
  background: var(--accent);
  color: #11271c;
  border-color: var(--accent);
}
button.secondary {
  background: #222f3b;
}
button.quiet {
  background: transparent;
  border-color: transparent;
  color: #b5c1cd;
}
button.danger {
  color: var(--danger);
  border-color: #714341;
  background: #2c1f23;
}
button.small {
  padding: 7px 10px;
  font-size: 0.8rem;
}
.wide {
  width: 100%;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar {
  height: 88px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 0 42px;
  background: #10161d;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-size: 17px;
  letter-spacing: 2px;
  font-weight: 700;
  line-height: 1.2;
}
.brand svg {
  width: 29px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.brand-sub {
  display: block;
  font-size: 9px;
  letter-spacing: 4px;
  font-weight: 500;
  margin-top: 5px;
  color: #a9b6c5;
}
.environment {
  font-size: 0.72rem;
  border: 1px solid #465044;
  padding: 6px 10px;
  border-radius: 4px;
  color: #c1c8aa;
  letter-spacing: 0.3px;
}
.topbar #signed-controls {
  margin-left: auto;
}
.auth-layout {
  max-width: 1220px;
  margin: auto;
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 100px;
  align-items: center;
  padding: 70px 44px;
}
.eyebrow,
.nav-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
}
h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 550;
  line-height: 1.12;
  letter-spacing: -2px;
  margin: 24px 0;
}
h2 {
  font-size: 1.55rem;
  font-weight: 550;
  letter-spacing: -0.5px;
  margin: 15px 0;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 14px;
}
p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.92rem;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}
.auth-card {
  padding: 38px;
  max-width: 460px;
  width: 100%;
}
.auth-card > p {
  margin-bottom: 28px;
}
.auth-card summary {
  font-size: 0.85rem;
  cursor: pointer;
  color: #c7d2dd;
}
.security-note {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 42px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.muted {
  color: var(--muted);
  font-size: 0.8rem;
}
.footnote {
  margin-bottom: 0 !important;
  margin-top: 28px !important;
}
.message {
  margin: 16px 42px 0;
  padding: 13px 18px;
  border-radius: 7px;
  border: 1px solid #42604e;
  background: #15291e;
  color: #c7ebd3;
  font-size: 0.9rem;
}
.message.error {
  background: #2b1c21;
  border-color: #87504e;
  color: #ffd0cc;
}
label {
  display: block;
  font-size: 0.8rem;
  color: #bbc7d3;
  margin: 18px 0 8px;
}
input,
select {
  display: block;
  width: 100%;
  border: 1px solid #3c4c5e;
  color: #e8edf2;
  background: #10161e;
  border-radius: 6px;
  padding: 11px 12px;
  min-width: 0;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  display: inline;
  accent-color: var(--accent);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 15px 0;
}
legend {
  font-size: 0.8rem;
  color: #bbc7d3;
}
.check {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 10px 0;
  font-size: 0.82rem;
}
.workspace {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 88px);
}
nav {
  padding: 35px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #10161d;
}
nav button {
  text-align: left;
  background: transparent;
  border: 0;
  font-weight: 500;
  color: #aab8c7;
  padding: 12px 15px;
}
nav button[aria-current="page"] {
  background: #26362f;
  color: #d9f0e2;
}
nav .nav-label {
  padding: 0 15px;
  margin-bottom: 12px;
  margin-top: 12px;
}
.nav-footer {
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: auto;
  line-height: 1.6;
  padding: 35px 15px 0;
}
.nav-footer .dot {
  margin-right: 5px;
}
#content {
  padding: 42px;
  max-width: 1440px;
  width: 100%;
  min-width: 0;
}
#content h1 {
  font-size: 2rem;
  letter-spacing: -1px;
  margin: 12px 0;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.page-head p {
  margin: 5px 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.badge {
  display: inline-block;
  border: 1px solid #405547;
  background: #1b3025;
  color: #bddfc9;
  font-size: 0.65rem;
  padding: 5px 8px;
  border-radius: 4px;
  margin: 3px 5px 3px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge.neutral {
  border-color: #3b495a;
  background: #212c38;
  color: #c0ccda;
}
.badge.danger {
  border-color: #714341;
  background: #2c1f23;
  color: #ffc6c1;
}
.name {
  font-size: 1.6rem;
  color: #edf2f6;
  margin: 14px 0 6px;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.kv strong {
  color: #d9e4ed;
  font-weight: 500;
  text-align: right;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}
th {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--muted);
  font-weight: 600;
}
th,
td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td:first-child {
  padding-left: 0;
}
td strong {
  display: block;
  font-weight: 500;
  color: #e6edf5;
}
td small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr);
  gap: 22px;
  align-items: start;
}
.search {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}
.search input {
  flex: 1;
}
.id-card {
  max-width: 460px;
  background: linear-gradient(125deg, #1f2f2c, #151f28);
  border: 1px solid #4a6156;
}
.id-card .id-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.id-card canvas {
  display: block;
  margin: 24px auto 12px;
  border-radius: 8px;
  max-width: 100%;
  height: auto !important;
}
.qr-count {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #c7decf;
}
.notice {
  font-size: 0.8rem;
  border-left: 2px solid #b2bd86;
  padding: 10px 15px;
  background: #20271f;
  color: #cbd2b6;
  line-height: 1.6;
}
.invite-output {
  overflow-wrap: anywhere;
  border: 1px solid #506348;
  padding: 16px;
  border-radius: 6px;
  background: #1e2c20;
}
.invite-output input {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
}
.empty {
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.camera {
  width: 100%;
  max-height: 350px;
  background: #090d11;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
}
.list-row {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.list-row p {
  margin: 5px 0;
  font-size: 0.8rem;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  .account-grid,
  .grid {
    grid-template-columns: 1fr;
  }
  .auth-layout {
    gap: 40px;
  }
  .workspace {
    grid-template-columns: 190px 1fr;
  }
  #content {
    padding: 28px;
  }
  .topbar {
    padding: 0 26px;
  }
  .auth-card {
    padding: 28px;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: auto;
    min-height: 78px;
    padding: 16px 20px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .environment {
    font-size: 0.6rem;
    margin-left: auto;
  }
  .topbar #signed-controls {
    width: 100%;
    text-align: right;
  }
  .auth-layout {
    display: block;
    padding: 40px 20px;
  }
  .intro {
    margin-bottom: 36px;
  }
  .intro h1 {
    font-size: 2.5rem;
  }
  .intro > p {
    display: none;
  }
  .security-note {
    margin-top: 20px;
  }
  .auth-card {
    max-width: none;
  }
  .workspace {
    display: block;
  }
  nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    white-space: nowrap;
  }
  nav .nav-label,
  .nav-footer {
    display: none;
  }
  nav button {
    font-size: 0.8rem;
    padding: 10px 12px;
  }
  #content {
    padding: 24px 18px;
  }
  .page-head {
    align-items: start;
    margin-bottom: 22px;
  }
  .panel {
    padding: 22px;
  }
  .message {
    margin: 12px 18px;
  }
  .page-head h1 {
    font-size: 1.6rem !important;
  }
  .grid {
    gap: 16px;
  }
}

.operational {
  margin-top: 22px;
}

.workflow-record {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.record-title {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.criterion-editor {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  margin: 18px 0;
}
.criterion-editor legend {
  padding: 0 7px;
  line-height: 1.6;
  max-width: 100%;
}
textarea {
  display: block;
  width: 100%;
  min-height: 85px;
  padding: 11px 12px;
  background: #10161e;
  border: 1px solid #3c4c5e;
  border-radius: 6px;
  color: #e8edf2;
  font: inherit;
  resize: vertical;
}
.workflow-record details {
  margin-top: 15px;
}
.workflow-record summary {
  font-size: 0.8rem;
  cursor: pointer;
  color: #b9c8d8;
}
.workflow-record strong,
.record-title {
  overflow-wrap: anywhere;
}

.record-title .badge {
  flex-shrink: 0;
  white-space: nowrap;
}
.record-title strong {
  min-width: 0;
}
.workflow-record > .badge {
  margin-left: 8px;
}

.inventory-body {
  margin-top: 24px;
}
.inventory-form {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.inventory-form summary {
  cursor: pointer;
  color: #c8d6e4;
  font-size: 0.85rem;
}
.inventory-form form {
  padding: 4px 0 15px;
}
.inventory-form button[type="submit"] {
  margin-top: 12px;
}

.report-history-row {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  overflow-wrap: anywhere;
}
.report-history-row p {
  margin: 6px 0;
  font-size: 0.8rem;
}

.personnel-photo {
  width: 180px;
  height: 180px;
  max-width: 100%;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.photo-preview {
  margin: 16px 0;
}

/* Installed mobile app safe areas and public device help. */
body {
  padding-bottom: env(safe-area-inset-bottom);
}
.topbar {
  padding-top: max(1rem, env(safe-area-inset-top));
}
dialog {
  color: var(--text, #edf1f4);
  background: #151f28;
  border: 1px solid #354452;
  border-radius: 1rem;
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
}
dialog::backdrop {
  background: rgb(0 0 0 / 75%);
}
#connection-message {
  margin: 1rem;
}
@media (display-mode: standalone) {
  .topbar {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

.readiness-counts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1rem;
}
.readiness-counts dd {
  margin: 0;
  font-weight: 700;
}
.workflow-record h4,
.workflow-record p {
  overflow-wrap: anywhere;
}

.catalogue-select {
  min-inline-size: 0;
}

.stock-slot,
.batch-record {
  flex-wrap: wrap;
  gap: 12px;
  overflow-wrap: anywhere;
}
.stock-slot > p,
.batch-record > p {
  flex-basis: 100%;
  min-width: 0;
}
.shooting-chart {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
  color: var(--accent, #c7f3d5);
  border-bottom: 1px solid currentColor;
}

.audit-detail {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
  font-size: 0.85rem;
}

.evidence-receipt {
  overflow-wrap: anywhere;
}
.audit-evidence input[type="file"] {
  max-inline-size: 100%;
}
