:root {
  --ink: #242423;
  --paper: #f7f7f2;
  --blue: #3a86ff;
  --amber: #ffbe0b;
  --line: rgba(36, 36, 35, 0.18);
  --muted: rgba(36, 36, 35, 0.62);
  --green: #26a269;
  --red: #d64545;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  letter-spacing: 0;
  background:
    repeating-linear-gradient(90deg, rgba(36, 36, 35, 0.05) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #f7f7f2 0%, #eeeeea 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 12px;
  color: var(--paper);
  background: var(--ink);
}

.brand {
  display: grid;
  gap: 10px;
  color: var(--paper);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 13px;
  line-height: 1.05;
  font-weight: 800;
}

.brand img {
  width: 46px;
  height: 46px;
}

.nav-tabs {
  display: grid;
  gap: 10px;
}

.nav-tab,
.icon-button,
.stage-button {
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
}

.nav-tab {
  min-height: 48px;
  padding: 8px 4px;
  border-color: rgba(247, 247, 242, 0.18);
  color: rgba(247, 247, 242, 0.72);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.nav-tab.is-active {
  color: var(--ink);
  background: var(--amber);
  border-color: var(--amber);
}

.rail-foot {
  display: grid;
  gap: 12px;
  font-size: 11px;
  color: rgba(247, 247, 242, 0.64);
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 6px rgba(58, 134, 255, 0.18);
}

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

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

.eyebrow,
.mono {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.95;
  max-width: 780px;
}

h2 {
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1.04;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

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

.primary-action,
.icon-button {
  min-height: 42px;
  border-radius: 4px;
  font-weight: 800;
}

.primary-action {
  border: 0;
  padding: 0 16px;
  color: var(--ink);
  background: var(--amber);
}

.primary-action.wide {
  width: 100%;
}

.icon-button {
  width: 42px;
  color: var(--ink);
  background: var(--paper);
}

.scanner-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr)) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.scan-code {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--paper);
  background:
    repeating-linear-gradient(90deg, transparent 0 4px, rgba(247, 247, 242, 0.22) 4px 6px),
    var(--ink);
  font-family: "Courier New", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.scanner-strip strong {
  justify-self: end;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.alert-strip {
  min-height: 40px;
}

.toast {
  display: inline-flex;
  max-width: 100%;
  padding: 10px 12px;
  border-left: 5px solid var(--blue);
  background: #fff;
  box-shadow: 0 10px 30px rgba(36, 36, 35, 0.08);
}

.toast.warn {
  border-color: var(--amber);
}

.toast.error {
  border-color: var(--red);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.inbox-grid {
  display: grid;
  grid-template-columns: minmax(245px, 0.9fr) minmax(360px, 1.35fr) minmax(260px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.queue-pane,
.record-pane,
.action-pane,
.analysis-board,
.public-status {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(247, 247, 242, 0.78);
}

.queue-pane,
.action-pane,
.analysis-board,
.public-status {
  padding: 14px;
}

.record-pane {
  padding: 14px;
  background: #ffffff;
}

.pane-head,
.record-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.pane-head.compact {
  margin-bottom: 8px;
}

.count-badge {
  min-width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  background: var(--ink);
  font-weight: 800;
}

.filters {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.filters input,
.filters select,
.note-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.case-list {
  display: grid;
  gap: 8px;
}

.case-row {
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.68);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.case-row:hover,
.case-row.is-active {
  transform: translateX(2px);
  border-color: var(--blue);
  background: #fff;
}

.barcode {
  width: 16px;
  min-height: 54px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 7px, transparent 7px 10px);
}

.case-main,
.case-side {
  display: grid;
  gap: 4px;
}

.case-main strong,
.check-row strong,
.doc-row span,
.deadline strong {
  overflow-wrap: anywhere;
}

.case-main em,
.case-side i,
.check-row em,
.muted {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
}

.case-side {
  justify-items: end;
}

.case-side b {
  font-size: 20px;
}

.tone {
  padding: 3px 6px;
  background: rgba(36, 36, 35, 0.08);
}

.tone.risk {
  color: #8f1919;
}

.tone.clear {
  color: #11613d;
}

.score-ring {
  --score: 0;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--score) * 1%), rgba(36, 36, 35, 0.12) 0);
}

.score-ring span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-weight: 900;
}

.mobile-frame {
  border: 8px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.phone-top {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  color: var(--paper);
  background: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.checklist {
  display: grid;
  gap: 1px;
  padding: 10px;
}

.check-row {
  display: grid;
  grid-template-columns: 24px 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  background: #fff;
  border-left: 4px solid var(--amber);
}

.check-row.is-done {
  border-left-color: var(--green);
}

.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.scan-mark {
  height: 38px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 7px);
  opacity: 0.78;
}

.notes-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.note-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.note {
  padding: 9px 10px;
  background: var(--paper);
}

.note p {
  margin: 4px 0;
  line-height: 1.5;
}

.note time {
  color: var(--muted);
  font-size: 11px;
}

.note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.metric-stack,
.next-block,
.deadline-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.metric-row span {
  color: var(--muted);
  line-height: 1.35;
}

.metric-row strong {
  font-size: 22px;
  white-space: nowrap;
}

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

.stage-button {
  min-height: 38px;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}

.stage-button.is-active {
  color: var(--paper);
  background: var(--blue);
  border-color: var(--blue);
}

.deadline {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fff;
  border-left: 4px solid var(--blue);
}

.deadline span {
  color: var(--muted);
  font-size: 12px;
}

.analytics-layout,
.import-layout,
.public-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.workflow-bars,
.doc-table,
.import-feed,
.public-feed {
  display: grid;
  gap: 10px;
}

.bar-row,
.doc-row,
.import-feed div,
.public-feed div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #fff;
}

.bar-track {
  height: 16px;
  background: rgba(36, 36, 35, 0.1);
}

.bar-track i {
  display: block;
  height: 100%;
  background: var(--blue);
}

.doc-row {
  grid-template-columns: minmax(0, 1fr) 96px 72px;
}

.doc-row em {
  color: var(--muted);
  font-style: normal;
}

.copy {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.65;
}

.public-meter {
  height: 18px;
  margin-top: 22px;
  background: rgba(36, 36, 35, 0.12);
}

.public-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
  transition: width 240ms ease;
}

@media (max-width: 1080px) {
  .inbox-grid {
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  }

  .action-pane {
    grid-column: 1 / -1;
  }
}

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

  .rail {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
  }

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

  .nav-tab {
    min-height: 40px;
  }

  .workspace {
    padding: 14px;
  }

  .topbar,
  .scanner-strip,
  .analytics-layout,
  .import-layout,
  .public-layout,
  .inbox-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .scanner-strip strong {
    justify-self: stretch;
  }

  .record-head {
    display: grid;
  }

  .score-ring {
    width: 64px;
    height: 64px;
  }

  .bar-row,
  .doc-row,
  .import-feed div,
  .public-feed div {
    grid-template-columns: 1fr;
  }
}
