:root {
  --red: #a20f1b;
  --red-dark: #790914;
  --graphite: #303234;
  --ink: #171a1d;
  --muted: #68707a;
  --line: #d9dee5;
  --surface: #ffffff;
  --page: #f4f6f8;
  --green: #13795b;
  --green-soft: #e8f5ef;
  --amber: #a56500;
  --amber-soft: #fff4df;
  --blue: #1d5f86;
  --shadow: 0 16px 36px rgba(20, 24, 28, 0.1);
  --row-alt: #fbfcfe;
  --row-soft-shadow: inset 4px 0 0 rgba(48, 50, 52, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --cell-soft-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --radius: 8px;
  color-scheme: light;
  font-family:
    Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  touch-action: pan-y;
  background: var(--page);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 88px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(20, 24, 28, 0.06);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  width: clamp(150px, 18vw, 230px);
  min-width: 150px;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 58px;
  object-fit: contain;
}

.title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  color: var(--graphite);
}

h1 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.15;
}

h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.top-actions,
.toolbar,
.segmented {
  display: flex;
  align-items: center;
}

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

.icon-button,
.primary-button,
.ghost-button,
.mode-button,
.file-button,
.segment,
.checklist-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 800;
  letter-spacing: 0;
}

.mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #edf1f5;
  border-radius: var(--radius);
}

.mode-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
}

.mode-button.active {
  color: #ffffff;
  background: var(--red);
}

.icon-button {
  padding: 0 14px;
  color: #ffffff;
  background: var(--graphite);
}

.icon-button:hover {
  background: #111315;
}

.app-update-button {
  color: var(--graphite);
  background: #fff5f6;
  border-color: rgba(166, 18, 28, 0.24);
}

.app-update-button:hover {
  color: #ffffff;
  background: var(--red);
}

.primary-button {
  padding: 0 14px;
  color: #ffffff;
  background: var(--red);
}

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

.ghost-button {
  padding: 0 14px;
  color: var(--red-dark);
  background: #ffffff;
  border-color: #efc7cc;
}

.ghost-button:hover {
  background: #fff5f6;
}

.icon-button svg,
.primary-button svg,
.ghost-button svg,
.mode-button svg,
.file-button svg,
.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 24px;
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 48px;
}

.app-view[hidden] {
  display: none !important;
}

.sidebar {
  position: sticky;
  top: 112px;
  align-self: start;
  display: grid;
  gap: 16px;
}

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

select,
input,
textarea {
  width: 100%;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #cfd6df;
  border-radius: var(--radius);
  outline: none;
}

select,
input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(162, 15, 27, 0.13);
}

.native-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.search-select {
  position: relative;
  min-width: 0;
}

.search-select-input {
  padding-right: 34px;
}

.search-select::after {
  position: absolute;
  top: 17px;
  right: 14px;
  width: 8px;
  height: 8px;
  pointer-events: none;
  content: "";
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.search-select-list {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 40;
  max-height: min(280px, 52vh);
  margin-top: 5px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cfd6df;
  border-radius: var(--radius);
  box-shadow: 0 18px 36px rgba(20, 24, 28, 0.16);
}

.search-select-option {
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  color: var(--ink);
  background: #ffffff;
  border: 0;
  border-radius: 0;
  text-align: left;
  line-height: 1.25;
}

.search-select-option:hover,
.search-select-option[aria-selected="true"] {
  color: var(--red-dark);
  background: #fff5f6;
}

.search-select-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.checklist-tabs {
  display: grid;
  gap: 8px;
}

.checklist-tab {
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  color: var(--graphite);
  background: #ffffff;
  border-color: var(--line);
  text-align: left;
}

.checklist-tab span:first-child {
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.checklist-tab:hover {
  border-color: #b9c2cc;
  box-shadow: 0 8px 20px rgba(20, 24, 28, 0.06);
}

.checklist-tab.active {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

.checklist-tab .count {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--graphite);
  background: #edf1f5;
  text-align: center;
  font-size: 0.78rem;
}

.checklist-tab.active .count {
  color: var(--red-dark);
  background: #ffffff;
}

.summary-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-panel > div {
  display: grid;
  align-content: center;
  min-height: 92px;
  padding: 14px;
  background: #ffffff;
}

.metric-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.summary-panel strong {
  color: var(--graphite);
  font-size: 1.55rem;
  line-height: 1;
}

.summary-panel small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.metric-ratio {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.form-band,
.toolbar,
.checklist-header,
.type-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-band {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

.form-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.form-actions .primary-button {
  flex: 0 0 auto;
  min-width: 150px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1.1fr) minmax(240px, 1.4fr) minmax(240px, 1.4fr) minmax(160px, 0.7fr);
  gap: 14px;
}

.form-grid label,
.notes-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-grid span,
.notes-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.field-help {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.toolbar {
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
}

.search-box {
  position: relative;
  flex: 1 1 260px;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  padding-left: 40px;
}

.segmented {
  flex: 0 1 auto;
  gap: 4px;
  padding: 4px;
  background: #edf1f5;
  border-radius: var(--radius);
}

.segment {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
}

.segment.active {
  color: #ffffff;
  background: var(--graphite);
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.progress-wrap {
  display: grid;
  gap: 8px;
  width: min(260px, 40%);
  min-width: 180px;
  color: var(--graphite);
  font-weight: 900;
  text-align: right;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  background: #e5e9ee;
  border-radius: 999px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--red);
  border-radius: inherit;
  transition: width 180ms ease;
}

.sections {
  display: grid;
  gap: 18px;
}

.type-section {
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 16px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.section-head small {
  color: var(--muted);
  font-weight: 800;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.items-table th {
  height: 42px;
  padding: 0 14px;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
  text-align: left;
  text-transform: uppercase;
}

.items-table th:nth-child(1) {
  width: 56%;
}

.items-table th:nth-child(2),
.items-table th:nth-child(3) {
  width: 13%;
  text-align: center;
}

.items-table th:nth-child(4) {
  width: 18%;
}

.item-row td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: middle;
}

.item-row:nth-child(even) {
  background: var(--row-alt);
}

.item-row:nth-child(even) td {
  box-shadow: var(--cell-soft-shadow);
}

.item-row:nth-child(even) td:first-child {
  box-shadow: var(--row-soft-shadow);
}

.item-row:last-child td {
  border-bottom: 0;
}

.item-description {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reference-cell {
  color: var(--graphite);
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
}

.quantity-input {
  text-align: center;
  font-weight: 900;
}

.field-attention {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 4px rgba(162, 15, 27, 0.2) !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-empty {
  color: var(--muted);
  background: #edf1f5;
}

.status-ok {
  color: var(--green);
  background: var(--green-soft);
}

.status-pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-extra {
  color: var(--blue);
  background: #e8f3f8;
}

.item-row.pending {
  background: #fffaf0;
}

.item-row.pending td {
  background: #fffaf0;
}

.item-row.pending:nth-child(even) td:first-child {
  box-shadow: inset 4px 0 0 rgba(165, 101, 0, 0.14), var(--cell-soft-shadow);
}

.item-row.ok {
  background: #fbfffd;
}

.item-row.ok td {
  background: #fbfffd;
}

.item-row.ok:nth-child(even) td:first-child {
  box-shadow: inset 4px 0 0 rgba(19, 121, 91, 0.12), var(--cell-soft-shadow);
}

.empty-state {
  margin: 0;
  padding: 28px;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed #c2cad3;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 800;
}

.dashboard .empty-state {
  padding: 18px;
}

.dashboard {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 0 auto;
  padding: 14px clamp(10px, 1.5vw, 24px) 36px;
}

.dashboard-header,
.dashboard-panel,
.dash-metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
}

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

.dashboard-nav {
  position: sticky;
  top: 88px;
  z-index: 8;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px;
  background: rgba(247, 249, 252, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.09);
  backdrop-filter: blur(10px);
}

.dashboard-nav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--graphite);
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-nav button:hover {
  color: var(--red);
  border-color: rgba(166, 18, 28, 0.35);
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.08);
}

.dashboard-nav svg {
  width: 16px;
  height: 16px;
}

.file-button {
  position: relative;
  min-height: 42px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--graphite);
  overflow: hidden;
}

.file-button:hover {
  background: #111315;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.dash-metric {
  min-height: 88px;
  padding: 12px;
}

.dash-metric span {
  display: block;
  min-height: 28px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.25;
}

.dash-metric strong {
  display: block;
  margin-top: 6px;
  color: var(--graphite);
  font-size: 1.75rem;
  line-height: 1;
}

.post-inspection-panel .panel-head {
  align-items: stretch;
}

.post-inspection-panel .panel-head > div {
  display: grid;
  gap: 4px;
}

.post-filter {
  display: grid;
  grid-template-columns: minmax(240px, 380px) auto;
  gap: 6px 8px;
  align-items: center;
  justify-content: end;
  min-width: min(520px, 100%);
}

.post-search-box {
  position: relative;
  display: block;
}

.post-search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
}

.post-search-box input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px 0 40px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #ccd5df;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
}

.post-search-box input:focus {
  outline: 2px solid rgba(166, 18, 28, 0.16);
  border-color: rgba(166, 18, 28, 0.42);
}

.post-filter-clear {
  min-height: 40px;
  padding: 0 12px;
  color: var(--red);
  background: #fff8f9;
  border: 1px solid rgba(166, 18, 28, 0.22);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
}

.post-filter-clear:hover {
  background: #fff1f3;
}

.post-filter small {
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.warehouse-field {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.warehouse-field input,
.warehouse-field select,
.warehouse-field .search-select-input {
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #d5dce4;
  border-radius: var(--radius);
  font: inherit;
  text-transform: none;
}

.post-checklists {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
  background: #f2f5f8;
  border-top: 1px solid #dbe2e9;
}

.post-status-box {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #ccd5df;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(20, 24, 28, 0.08);
}

.post-status-box.open-box {
  border-left: 5px solid var(--red);
}

.post-status-box.done-box {
  border-left: 5px solid var(--green);
}

.post-status-box.purchase-box {
  border-left: 5px solid var(--amber);
}

.post-status-box.delivery-box {
  border-left: 5px solid var(--blue);
}

.post-status-box > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 0 12px 0 14px;
  color: var(--graphite);
  background: #ffffff;
  cursor: pointer;
  list-style: none;
}

.post-status-box > summary:hover {
  filter: brightness(0.995);
}

.post-status-box.open-box > summary {
  background: #fff8f9;
}

.post-status-box.done-box > summary {
  background: #f5fbf8;
}

.post-status-box.purchase-box > summary {
  background: #fff9ed;
}

.post-status-box.delivery-box > summary {
  background: #f1f7fb;
}

.post-status-box > summary::-webkit-details-marker {
  display: none;
}

.post-status-box > summary span {
  min-width: 0;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.post-status-box > summary strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #dce3ea;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.post-status-box > summary::after {
  content: "Ver itens";
  min-width: 74px;
  padding: 7px 12px;
  color: var(--red);
  background: #ffffff;
  border: 1px solid rgba(166, 18, 28, 0.24);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 950;
  text-align: center;
}

.post-status-box[open] > summary {
  border-bottom: 1px solid #d9e0e8;
}

.post-status-box[open] > summary::after {
  content: "Ocultar";
  color: var(--graphite);
  background: #eef2f6;
  border-color: #d0d8e1;
}

.post-status-content {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: #f7f9fb;
}

.post-checklist {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dbe2e9;
  border-radius: var(--radius);
}

.post-checklist > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  background: #ffffff;
  cursor: pointer;
  list-style: none;
}

.post-checklist > summary:hover {
  background: #fafbfd;
}

.post-checklist > summary::-webkit-details-marker {
  display: none;
}

.post-checklist > summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--graphite);
  background: #f1f4f7;
  border: 1px solid #d6dde5;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.post-checklist[open] > summary::after {
  content: "-";
  color: var(--red);
  background: #fff5f6;
  border-color: rgba(166, 18, 28, 0.22);
}

.post-checklist > summary > span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.post-checklist > summary strong {
  color: var(--graphite);
  overflow-wrap: anywhere;
}

.post-checklist > summary small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.post-checklist-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.post-checklist-counts b,
.post-checklist-counts small {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  background: #f3f6f9;
  border-radius: 999px;
  white-space: nowrap;
}

.post-checklist-counts b {
  color: var(--red);
  background: #fff5f6;
}

.post-checklist[open] > summary {
  border-bottom: 1px solid #e1e6ec;
  background: #fbfcfd;
}

.post-issue-list {
  display: grid;
}

.post-issue {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(210px, 320px);
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: #ffffff;
  border-bottom: 1px solid #edf0f4;
  overflow: hidden;
}

.post-issue:nth-child(even) {
  background: var(--row-alt);
  box-shadow: var(--row-soft-shadow);
}

.post-issue:last-child {
  border-bottom: 0;
}

.post-issue > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.post-issue strong {
  color: var(--graphite);
}

.post-issue small {
  color: var(--muted);
  font-weight: 850;
}

.post-issue-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.issue-kind {
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  color: var(--amber);
  background: var(--amber-soft);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 950;
}

.issue-kind.extra {
  color: var(--blue);
  background: #eaf2ff;
}

.post-inspection-body {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.post-card {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 76px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e9ee;
  border-radius: var(--radius);
}

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

.post-card strong {
  color: var(--graphite);
  font-size: 1.35rem;
  line-height: 1.05;
}

.mini-progress {
  overflow: hidden;
  height: 8px;
  background: #e9eef3;
  border-radius: 999px;
}

.mini-progress div {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: inherit;
  transition: width 180ms ease;
}

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

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

.dashboard-panel {
  overflow: hidden;
  border-top-width: 3px;
  border-top-color: #b9c3ce;
}

#postInspectionSection {
  border-top-color: var(--red);
}

#launchPendingSection {
  border-top-color: var(--blue);
}

#purchaseSection {
  border-top-color: var(--amber);
}

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

.panel-head small {
  color: var(--muted);
  font-weight: 900;
}

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

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.bar-list,
.expected-list,
.treatment-list {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.bar-item {
  display: grid;
  gap: 6px;
}

.bar-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--graphite);
  font-weight: 900;
}

.bar-row span:first-child {
  overflow-wrap: anywhere;
}

.bar-track {
  overflow: hidden;
  height: 9px;
  background: #edf1f5;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: var(--red);
  border-radius: inherit;
}

.bar-fill.extra {
  background: var(--blue);
}

.expected-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e5e9ee;
  border-radius: var(--radius);
}

.expected-card strong {
  color: var(--graphite);
  overflow-wrap: anywhere;
}

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

.expected-progress {
  grid-column: 1 / -1;
  height: 7px;
}

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

.treatment-card {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e5e9ee;
  border-radius: var(--radius);
}

.treatment-card strong {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
}

.treatment-card span {
  color: var(--graphite);
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
}

.treatment-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.table-wrap {
  overflow-x: auto;
}

.launch-stack {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.launch-block {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(28, 38, 49, 0.06);
}

.completed-launch-block {
  border-left-color: var(--green);
}

.launch-block > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.launch-block > summary::-webkit-details-marker {
  display: none;
}

.launch-block > summary::after {
  content: "Abrir";
  justify-self: end;
  min-width: 72px;
  padding: 7px 12px;
  color: var(--red);
  background: #fff5f6;
  border: 1px solid rgba(166, 18, 28, 0.2);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 950;
  text-align: center;
}

.launch-block[open] > summary {
  border-bottom: 1px solid #d8e0e8;
}

.launch-block[open] > summary::after {
  content: "Fechar";
  color: var(--graphite);
  background: #eef3f7;
  border-color: #d5dde6;
}

.launch-block-title {
  display: grid;
  gap: 3px;
}

.launch-block-title small {
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.completed-launch-block .launch-block-title small {
  color: var(--green);
}

.launch-block-title strong {
  color: var(--graphite);
  font-size: 1.02rem;
  line-height: 1.15;
}

.launch-block > summary > b {
  justify-self: end;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 950;
  white-space: nowrap;
}

.launch-block > .launch-groups {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.launch-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
}

.launch-section-title h4 {
  margin: 0;
  color: var(--graphite);
  font-size: 0.92rem;
}

.launch-section-title small {
  color: var(--muted);
  font-weight: 900;
}

.launch-group {
  overflow: hidden;
  background: #fbfcfe;
  border: 1px solid #e1e6ec;
  border-radius: var(--radius);
}

.launch-group > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 9px 12px;
  color: var(--graphite);
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.launch-group > summary::-webkit-details-marker {
  display: none;
}

.launch-group > summary::after {
  content: "Abrir";
  min-width: 58px;
  padding: 6px 10px;
  color: var(--red);
  background: #fff5f6;
  border: 1px solid rgba(166, 18, 28, 0.2);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 950;
  text-align: center;
}

.launch-group[open] > summary {
  border-bottom: 1px solid #e1e6ec;
  background: #ffffff;
}

.launch-group[open] > summary::after {
  content: "Fechar";
  color: var(--graphite);
  background: #f1f4f7;
  border-color: #d7dde5;
}

.launch-group-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.launch-group-title b {
  overflow-wrap: anywhere;
  color: var(--graphite);
  font-size: 0.94rem;
  line-height: 1.16;
}

.launch-group-title small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
}

.launch-group > summary strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  white-space: nowrap;
}

.dashboard-table.launch-table {
  min-width: 820px;
}

.dashboard-table.completed-table {
  min-width: 1080px;
}

.ok-row {
  background: #fbfffd;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pdf-row-button,
.delete-row-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  color: #ffffff;
  background: var(--graphite);
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  font-size: 0.76rem;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}

.pdf-row-button:hover {
  background: #111315;
}

.delete-row-button {
  color: var(--red);
  background: #fff5f6;
  border-color: rgba(166, 18, 28, 0.24);
}

.delete-row-button:hover {
  background: #ffecee;
}

.pdf-row-button svg,
.delete-row-button svg {
  width: 15px;
  height: 15px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.dashboard-table.detail-table,
.dashboard-table.grouped-table {
  min-width: 1760px;
}

#purchaseSection .table-wrap {
  position: relative;
}

#purchaseSection .dashboard-table th:last-child,
#purchaseSection .dashboard-table tbody tr:not(.purchase-group-row) td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 174px;
  background: #ffffff;
  box-shadow: -14px 0 18px rgba(23, 31, 42, 0.08);
}

#purchaseSection .dashboard-table th:last-child {
  z-index: 3;
  background: #f8fafc;
}

.dashboard-table th,
.dashboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: top;
  text-align: left;
}

.dashboard-table th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.dashboard-table tbody tr:not(.purchase-group-row):nth-child(even) td {
  background: var(--row-alt);
  box-shadow: var(--cell-soft-shadow);
}

#purchaseSection .dashboard-table tbody tr:not(.purchase-group-row):nth-child(even) td:last-child {
  background: var(--row-alt);
  box-shadow: -14px 0 18px rgba(23, 31, 42, 0.08), var(--cell-soft-shadow);
}

.dashboard-table tbody tr:not(.purchase-group-row):nth-child(even) td:first-child {
  box-shadow: var(--row-soft-shadow);
}

.dashboard-table tbody tr:not(.purchase-group-row):not(.regularized-row):hover td,
.item-row:not(.pending):not(.ok):hover td,
.post-issue:not(.regularized-row):hover {
  background: #f7f9fc;
}

#purchaseSection .dashboard-table tbody tr:not(.purchase-group-row):hover td:last-child {
  background: #f7f9fc;
}

.purchase-group-row td {
  padding: 8px 12px;
  color: var(--graphite);
  background: #eef3f7;
  border-top: 2px solid #c8d2dc;
  border-bottom-color: #d7e0e8;
}

.purchase-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.purchase-group-label strong {
  color: var(--graphite);
  font-size: 0.86rem;
  font-weight: 950;
}

.purchase-group-label small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-table td {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
}

.dashboard-table td.numeric {
  color: var(--graphite);
  font-weight: 950;
  white-space: nowrap;
}

.regularized-row {
  background: #f8fbf9;
}

.dashboard-table tbody tr.regularized-row td {
  background: #f8fbf9;
}

.dashboard-table tbody tr.regularized-row:nth-child(even) td:first-child {
  box-shadow: inset 4px 0 0 rgba(19, 121, 91, 0.12), var(--cell-soft-shadow);
}

.post-issue.regularized-row {
  background: #f8fbf9;
}

.post-issue.regularized-row:nth-child(even) {
  background: #f8fbf9;
  box-shadow: inset 4px 0 0 rgba(19, 121, 91, 0.12), var(--cell-soft-shadow);
}

.regularization-cell {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.regularization-cell small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}

.regularization-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.regularization-pill.open {
  color: var(--amber);
  background: var(--amber-soft);
}

.regularization-pill.done {
  color: var(--green);
  background: var(--green-soft);
}

.regularization-pill.purchase {
  color: var(--blue);
  background: #eaf2ff;
}

.regularization-pill.available {
  color: var(--amber);
  background: var(--amber-soft);
}

.regularization-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 0 10px;
  color: #ffffff;
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  font-size: 0.76rem;
  font-weight: 950;
  cursor: pointer;
}

.regularization-button svg {
  width: 15px;
  height: 15px;
}

.regularization-button.secondary {
  color: var(--graphite);
  background: #ffffff;
  border-color: #d5dce4;
}

.regularization-button:hover {
  filter: brightness(0.96);
}

.purchase-receipt-cell {
  display: grid;
  gap: 5px;
  min-width: 170px;
}

.purchase-receipt-cell small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.purchase-receipt-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.purchase-receipt-status.waiting {
  color: var(--amber);
  background: var(--amber-soft);
}

.purchase-receipt-status.done {
  color: var(--green);
  background: var(--green-soft);
}

.purchase-receipt-status.partial {
  color: var(--blue);
  background: #eaf2ff;
}

.purchase-receipt-button {
  min-width: 142px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.44);
}

.regularization-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d8dee7;
  border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.32);
}

.regularization-modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 16px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  color: var(--graphite);
  font-size: 1.25rem;
}

.modal-close {
  width: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--graphite);
  background: #f4f6f8;
  border: 1px solid #dce2e8;
  border-radius: 999px;
}

.modal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 0;
}

.modal-summary div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e5e9ee;
  border-radius: var(--radius);
}

.modal-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-summary strong {
  color: var(--graphite);
  overflow-wrap: anywhere;
}

.warehouse-quantity-panel {
  display: grid;
  gap: 12px;
  margin: 16px 18px 0;
  padding: 12px;
  background: #fbfcfd;
  border: 1px solid #d6dee7;
  border-radius: var(--radius);
}

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

.warehouse-quantity-grid div,
.warehouse-quantity-input,
.warehouse-purchase-result {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  background: #f5f7fa;
  border: 1px solid #e2e8ef;
  border-radius: var(--radius);
}

.warehouse-quantity-grid span,
.warehouse-quantity-input span,
.warehouse-purchase-result span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.warehouse-quantity-grid strong,
.warehouse-purchase-result strong {
  color: var(--graphite);
  font-size: 1.2rem;
}

.warehouse-quantity-input input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--graphite);
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
}

.warehouse-purchase-result {
  background: #fff7ed;
  border-color: #fed7aa;
}

.warehouse-purchase-result strong {
  color: #9a3412;
}

.warehouse-purchase-result small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.warehouse-action-field {
  display: grid;
  gap: 8px;
  margin: 16px 18px 0;
  padding: 12px;
  border: 1px solid #dce3ea;
  border-radius: var(--radius);
}

.warehouse-action-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.warehouse-action-field label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e5e9ee;
  border-radius: var(--radius);
  cursor: pointer;
}

.warehouse-action-field label:hover {
  border-color: #cbd5df;
}

.warehouse-action-field input {
  margin-top: 4px;
  accent-color: var(--red);
}

.warehouse-action-field span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.warehouse-action-field strong {
  color: var(--graphite);
}

.warehouse-action-field small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.regularization-modal .warehouse-field {
  margin: 16px 18px 0;
}

.regularization-modal .search-select-list {
  position: static;
  z-index: 90;
  max-height: 180px;
  box-shadow: none;
}

.purchase-receipt-panel {
  display: grid;
  gap: 12px;
  margin: 16px 18px 0;
  padding: 12px;
  background: #fbfcfd;
  border: 1px solid #d6dee7;
  border-radius: var(--radius);
}

.receipt-info-box {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #f8fbf9;
  border: 1px solid #cfe9df;
  border-radius: var(--radius);
}

.receipt-info-box strong {
  color: var(--green);
  font-size: 0.9rem;
}

.receipt-info-box small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

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

.purchase-receipt-allocation {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #dde5ed;
  border-radius: var(--radius);
}

.receipt-allocation-head {
  display: grid;
  gap: 4px;
}

.receipt-allocation-head strong {
  color: var(--graphite);
}

.receipt-allocation-head small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.receipt-allocation-list {
  display: grid;
  overflow: hidden;
  border: 1px solid #e2e8ef;
  border-radius: var(--radius);
}

.receipt-allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto) 110px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #ffffff;
  border-bottom: 1px solid #edf1f5;
}

.receipt-allocation-row:nth-child(even) {
  background: var(--row-alt);
  box-shadow: var(--row-soft-shadow);
}

.receipt-allocation-row:last-child {
  border-bottom: 0;
}

.receipt-allocation-row > span:first-child,
.receipt-allocation-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.receipt-allocation-row strong {
  color: var(--graphite);
  overflow-wrap: anywhere;
}

.receipt-allocation-row small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.receipt-allocation-meta {
  justify-items: end;
}

.receipt-allocation-row input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--graphite);
  background: #ffffff;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  font: inherit;
  font-weight: 950;
  text-align: right;
}

.receipt-allocation-total {
  min-height: 34px;
  padding: 9px 10px;
  color: var(--muted);
  background: #f6f8fb;
  border: 1px solid #e1e7ee;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 900;
}

.receipt-allocation-total.ok {
  color: var(--green);
  background: var(--green-soft);
  border-color: #cfe9df;
}

.receipt-allocation-total.warn {
  color: var(--red);
  background: #fff5f6;
  border-color: rgba(166, 18, 28, 0.22);
}

.purchase-receipt-modal .warehouse-field,
.delivery-modal .warehouse-field {
  margin: 0;
}

.purchase-receipt-modal .search-select-list,
.delivery-modal .search-select-list {
  position: static;
  max-height: 180px;
  box-shadow: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.sync-pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.sync-progress {
  color: var(--blue);
  background: #e8f3f8;
}

.sync-sent {
  color: var(--green);
  background: var(--green-soft);
}

.muted-row td,
.empty-row td {
  color: var(--muted);
  font-weight: 800;
}

.desktop-preferred {
  display: inline;
}

.print-report {
  display: none;
}

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

  .sidebar {
    position: static;
  }

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

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

  .dashboard-header,
  .post-inspection-panel .panel-head {
    display: grid;
  }

  .post-filter {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    min-width: 0;
  }

  .dashboard-nav {
    position: static;
  }

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

  .post-inspection-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-checklist > summary,
  .post-status-box > summary,
  .post-issue,
  .receipt-allocation-row,
  .receipt-form-grid,
  .expected-card,
  .warehouse-quantity-grid,
  .modal-summary {
    grid-template-columns: 1fr;
  }

  .post-checklist > summary::after,
  .post-status-box > summary::after {
    justify-self: start;
  }

  .post-checklist-counts,
  .receipt-allocation-meta,
  .post-issue-side {
    justify-content: flex-start;
    justify-items: start;
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand {
    width: min(220px, 72vw);
  }

  .top-actions {
    justify-content: stretch;
  }

  .mode-switch,
  .top-actions .icon-button,
  .top-actions .mode-button {
    flex: 1 1 0;
  }

  .mode-switch {
    order: -1;
    width: 100%;
  }

  .mode-switch,
  #exportButton {
    display: none;
  }

  .mode-button {
    min-width: 0;
  }

  .workspace {
    padding-top: 16px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .post-inspection-body {
    grid-template-columns: 1fr;
  }

  .warehouse-field {
    min-width: 0;
  }

  .modal-actions {
    display: grid;
  }

  .content,
  .sections,
  .type-section {
    max-width: 100%;
    overflow-x: hidden;
  }

  .sections {
    overscroll-behavior: contain;
  }

  .checklist-tabs,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .form-actions,
  .segmented,
  .ghost-button,
  .primary-button {
    width: 100%;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .checklist-header {
    display: grid;
  }

  .progress-wrap {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .items-table,
  .items-table tbody,
  .items-table tr,
  .items-table td {
    display: block;
    width: 100%;
  }

  .items-table thead {
    display: none;
  }

  .item-row {
    display: grid;
    gap: 10px;
    scroll-margin-block: 14px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .item-row:last-child {
    border-bottom: 0;
  }

  .item-row td {
    padding: 0;
    border-bottom: 0;
  }

  .reference-cell {
    text-align: left;
  }

  .reference-cell::before,
  .quantity-cell::before,
  .status-cell::before {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .reference-cell::before {
    content: "Referência";
  }

  .quantity-cell::before {
    content: "Quantidade existente";
  }

  .status-cell::before {
    content: "Status";
  }

  .status-pill {
    width: 100%;
  }

  .quantity-input {
    min-height: 46px;
    font-size: 16px;
  }

  .dashboard {
    padding-top: 16px;
  }

  .dashboard-header {
    display: grid;
  }

  .dashboard-actions,
  .dashboard-actions .icon-button,
  .dashboard-actions .ghost-button,
  .file-button {
    width: 100%;
  }

  .dashboard-metrics,
  .dashboard-grid,
  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .dash-metric {
    min-height: 88px;
  }

  .dashboard-table {
    min-width: 560px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 7mm;
  }

  html,
  body {
    width: 100%;
    margin: 0;
    background: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-shell {
    display: none !important;
  }

  .print-report {
    display: block;
    color: #171a1d;
    background: #ffffff;
    font-size: 11px;
  }

  .print-page {
    display: flex;
    flex-direction: column;
    min-height: calc(297mm - 14mm);
    padding: 0;
  }

  .print-page + .print-page {
    break-before: page;
    page-break-before: always;
  }

  .print-header {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr) 38mm;
    gap: 12px;
    align-items: center;
    margin-bottom: 4mm;
    padding-bottom: 5mm;
    border-bottom: 2px solid var(--red);
  }

  .print-brand {
    display: flex;
    align-items: center;
  }

  .print-header img {
    width: 142px;
    height: auto;
  }

  .print-header p {
    margin: 0 0 3px;
    color: var(--red);
    font-size: 9.5px;
    line-height: 1.1;
    font-weight: 900;
    text-transform: uppercase;
  }

  .print-header h1 {
    margin: 0;
    color: var(--graphite);
    font-size: 20px;
    line-height: 1.16;
  }

  .print-title small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
  }

  .print-stamp {
    align-self: stretch;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 5px 7px;
    border: 1px solid #cfd6df;
    border-radius: 4px;
    background: #f8fafc;
  }

  .print-stamp span {
    color: var(--muted);
    font-size: 8.5px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .print-stamp strong {
    overflow-wrap: anywhere;
    color: var(--graphite);
    font-size: 10.5px;
    line-height: 1.2;
  }

  .print-continuation-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5mm;
    padding-bottom: 3mm;
    border-bottom: 2px solid var(--red);
  }

  .print-continuation-header strong {
    color: var(--graphite);
    font-size: 15px;
    line-height: 1.2;
  }

  .print-continuation-header span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-align: right;
    text-transform: uppercase;
  }

  .print-meta,
  .print-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-top: 0;
  }

  .print-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 7px;
  }

  .print-meta div,
  .print-summary div,
  .print-notes {
    min-height: 13mm;
    padding: 6px 7px;
    border: 1px solid #cfd6df;
    border-radius: 4px;
    break-inside: avoid;
  }

  .print-meta span,
  .print-summary span,
  .print-notes span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 8.8px;
    line-height: 1.15;
    font-weight: 900;
    text-transform: uppercase;
  }

  .print-meta strong,
  .print-summary strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--graphite);
    font-size: 12.5px;
    line-height: 1.25;
  }

  .print-notes {
    margin-top: 7px;
  }

  .print-notes p {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
  }

  .print-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    border: 1px solid #cfd6df;
    font-size: 10.2px;
    line-height: 1.24;
  }

  .print-col-type {
    width: 13%;
  }

  .print-col-item {
    width: 56%;
  }

  .print-col-number {
    width: 7%;
  }

  .print-col-status {
    width: 17%;
  }

  .print-table thead {
    display: table-header-group;
  }

  .print-table th,
  .print-table td {
    padding: 4.5px 5px;
    border: 1px solid #cfd6df;
    vertical-align: top;
    text-align: left;
    break-inside: avoid;
  }

  .print-table th {
    color: #ffffff;
    background: var(--graphite);
    font-size: 9px;
    line-height: 1.2;
    font-weight: 900;
    text-transform: uppercase;
  }

  .print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-table .numeric {
    text-align: center;
    white-space: nowrap;
  }

  .print-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16mm;
    margin-top: auto;
    padding-top: 19mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .signature-box {
    min-height: 29mm;
    padding-top: 15mm;
    border-top: 1px solid #171a1d;
    text-align: center;
  }

  .signature-box span {
    display: block;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.2;
    font-weight: 900;
    text-transform: uppercase;
  }

  .signature-box strong {
    display: block;
    margin-top: 3px;
    color: var(--graphite);
    font-size: 11.5px;
    line-height: 1.25;
  }

  .print-pending td {
    background: #fff8e8;
  }

  .print-extra td {
    background: #eaf4f9;
  }

  .print-ok td {
    background: #f7fcfa;
  }
}
