:root {
  --bg: #f4f1ea;
  --fg: #2a2722;
  --card: #fffefb;
  --muted: #6f6a62;
  --line: #e2ddd3;
  --yellow: #efc12a;
  --yellow-ink: #2a2308;
  --charcoal: #2c2924;
  --charcoal-ink: #f6f1e4;
  --danger: #b42318;
  --ok: #1f6b3a;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(42, 39, 34, 0.08);
  --max: 100%;
  --gutter: 1rem;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.45;
  overflow-x: hidden;
}

a { color: inherit; }

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

.hazard-stripe {
  height: 6px;
  background-image: repeating-linear-gradient(
    45deg,
    var(--yellow) 0 14px,
    var(--charcoal) 14px 28px
  );
}

.site-header {
  background: var(--charcoal);
  color: var(--charcoal-ink);
}

.header-inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: calc(1rem + env(safe-area-inset-top)) var(--gutter) 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--yellow-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title {
  display: block;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-sub {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
}

.header-cta { white-space: nowrap; }

.flash-wrap {
  max-width: var(--max);
  width: 100%;
  margin: 0.75rem auto 0;
  padding: 0 var(--gutter);
}

.flash {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  background: var(--card);
}

.flash-success {
  border-color: #b7e0c3;
  background: #eef8f1;
  color: var(--ok);
}

.flash-error {
  border-color: #f2c4c0;
  background: #fdeeee;
  color: var(--danger);
}

.page {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
}

.page-narrow {
  max-width: var(--max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.page-head-actions .is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.admin-out { display: inline; margin: 0; }
.admin-out .icon-btn { font: inherit; }

.admin-panel {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter) 1rem;
  color: var(--charcoal-ink);
}

.admin-panel[hidden] { display: none !important; }

.admin-bar {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0.85rem var(--gutter) 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fffdf4;
  border-bottom: 2px solid var(--yellow);
  color: var(--yellow-ink);
}

.admin-bar p { margin: 0; }

.admin-panel form {
  display: grid;
  gap: 0.45rem;
  max-width: 22rem;
  background: #3a362f;
  border-radius: 8px;
  padding: 0.85rem 1rem 1rem;
}

.admin-panel p { margin: 0; }
.admin-panel .hint { opacity: 0.8; }
.admin-panel input[type="password"] {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.18);
  background: #2c2924;
  color: var(--charcoal-ink);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

h1 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.lede {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.back:hover { color: var(--fg); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--yellow);
  color: var(--yellow-ink);
}

.btn-primary:hover { filter: brightness(0.97); }

.btn-secondary {
  background: var(--card);
  border-color: var(--line);
  color: var(--fg);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover { filter: brightness(0.95); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  min-height: 2.75rem;
}

.btn-ghost:hover { color: var(--fg); }

.stats {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .stats { grid-template-columns: repeat(6, 1fr); }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  text-decoration: none;
}

.stat-card.is-active {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(239, 193, 42, 0.25);
}

.stat-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.stat-value {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.filters {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .filters { flex-direction: row; flex-wrap: wrap; align-items: center; }
}

.search-field { position: relative; flex: 1; }

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-field input {
  width: 100%;
  padding-left: 2.4rem;
}

.status-field select { min-width: 11rem; max-width: 18rem; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--fg);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(239, 193, 42, 0.55);
  border-color: var(--yellow);
}

.list { margin-top: 1rem; display: grid; gap: 0.75rem; }

.list-compact { gap: 0.45rem; }

.list-compact .request-card {
  padding: 0.85rem 1rem;
  gap: 0.55rem;
  min-height: 6.25rem;
}

.list-compact .request-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  margin-top: 1rem;
  padding: 0.65rem 0 0.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.list-meta p { margin: 0; }

.list-toolbar .filters { margin-top: 0; }

.more-facets {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0.35rem 0.85rem 0.55rem;
}

.more-facets summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.45rem 0;
}

.more-facets .stats { margin-top: 0.35rem; }

@media (min-width: 900px) {
  .more-facets .stats-priority,
  .more-facets .stats-destination { grid-template-columns: repeat(3, 1fr); }
}

.request-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
}

.request-card:hover { border-color: var(--yellow); }

.card-watermark {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.25rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(196, 150, 12, 0.38);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
  transform: rotate(-18deg);
  animation: watermark-pulse 2.2s ease-in-out infinite;
}

.card-watermark.is-urgente {
  color: rgba(185, 22, 22, 0.48);
  letter-spacing: 0.14em;
  animation: watermark-pulse 1.5s ease-in-out infinite;
}

.request-card .request-main,
.request-card .card-flags,
.detail-head > div,
.detail-head .card-flags {
  position: relative;
  z-index: 1;
}

.request-card.is-pending:not(.is-urgent) {
  border-color: #efc12a;
  background: #fffdf3;
  animation: pending-glow 2.4s ease-in-out infinite;
}

.request-card.is-urgent,
.detail-head.is-urgent {
  border-color: #c62828;
  background: #fff4f2;
  animation: urgente-glow 1.55s ease-in-out infinite;
}

.request-card.is-pending.is-overdue:not(.is-urgent) {
  background: #fff8f7;
  border-color: #e3a39d;
}

.request-gap {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a4b00;
}

.badge-pendente {
  background: #fff4c8;
  border-color: #efc12a;
  animation: pending-badge 1.8s ease-in-out infinite;
}

@keyframes pending-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 193, 42, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(239, 193, 42, 0); }
}

@keyframes pending-badge {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 193, 42, 0.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(239, 193, 42, 0); }
}

@keyframes urgente-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.58); }
  50% { box-shadow: 0 0 0 8px rgba(198, 40, 40, 0); }
}

@keyframes watermark-pulse {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.88; }
}

@keyframes urgente-badge {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.55); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .request-card.is-pending,
  .request-card.is-urgent,
  .detail-head.is-pending,
  .detail-head.is-urgent,
  .badge-pendente,
  .badge-urgente,
  .card-watermark,
  .card-watermark.is-urgente { animation: none; }
}

.detail-head.is-pending:not(.is-urgent) {
  position: relative;
  overflow: hidden;
  border: 1px solid #efc12a;
  border-radius: var(--radius);
  background: #fffdf3;
  padding: 0.85rem 1rem;
  animation: pending-glow 2.4s ease-in-out infinite;
}

.detail-head.is-urgent {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.request-title {
  margin: 0;
  font-weight: 700;
}

.request-meta, .request-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.request-sub { font-size: 0.8rem; }

.badge {
  align-self: flex-start;
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-analise { background: #eeeae2; }
.badge-cadastrado { background: var(--ok); color: #f4fbf6; border-color: #17552e; }
.badge-recusado { background: #fdeeee; color: var(--danger); border-color: #f2c4c0; }
.badge-urgente {
  background: #c62828;
  color: #fff;
  border-color: #8e1b1b;
  animation: urgente-badge 1.55s ease-in-out infinite;
}
.badge-alta { background: #fff1d6; color: #8a4b00; border-color: #efc12a; }
.badge-media { background: #eef3f8; color: #33506b; border-color: #c5d4e2; }

.card-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-self: flex-start;
  justify-content: flex-end;
}

.request-card.is-overdue { border-color: #e3a39d; background: #fff8f7; }
.due-late {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--danger);
  font-weight: 700;
  font-size: 0.8rem;
}

.stats-priority { margin-top: 0.75rem; }
.stats-destination { margin-top: 0.75rem; }

.badge-destino-maquina { background: #fff4c8; color: var(--yellow-ink); border-color: #efc12a; }
.badge-destino-estoque { background: #e8f4ec; color: var(--ok); border-color: #9cc9ab; }
.badge-destino-obra { background: #eef3f8; color: #33506b; border-color: #c5d4e2; }

.destination-box {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf6;
}

.destination-box legend {
  font-weight: 700;
  padding: 0 0.35rem;
}

.destination-options {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}

.destination-card {
  flex: 1 1 auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  min-height: 2.85rem;
  min-width: min-content;
  border-right: 1px solid var(--line);
  background: var(--card);
}

.destination-card:last-child { border-right: 0; }

.destination-card input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--yellow);
}

.destination-card input:focus {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.destination-card span {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}

.destination-card.is-on,
.destination-card:has(input:checked) {
  background: #fffdf4;
  box-shadow: inset 0 -3px 0 var(--yellow);
}

.destination-panel {
  display: none;
  margin-top: 1rem;
}

.destination-box:has(input[value="aplicacao_direta"]:checked) [data-dest-panel="aplicacao_direta"],
.destination-box:has(input[value="estoque"]:checked) [data-dest-panel="estoque"],
.destination-box:has(input[value="envio_obra"]:checked) [data-dest-panel="envio_obra"] {
  display: block;
}

.destination-panel select {
  width: 100%;
  margin-top: 0.35rem;
}

#equipment-filter {
  width: 100%;
  margin: 0.35rem 0 0.5rem;
}

.equipment-picked {
  display: grid;
  gap: 0.15rem;
  margin: 0.5rem 0 0.65rem;
  padding: 0.7rem 0.85rem;
  background: #fffdf4;
  border: 1px solid var(--yellow);
  border-left: 4px solid var(--yellow);
  border-radius: 8px;
  color: var(--yellow-ink);
}

.equipment-picked[hidden] { display: none; }

.equipment-picked .kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.equipment-picked p:last-child {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.equipment-list {
  max-height: 16.5rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}

.equipment-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.equipment-option:last-child { border-bottom: 0; }

.equipment-option input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--yellow);
}

.equipment-option .eq-code {
  flex: 0 0 4.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.equipment-option .eq-name {
  flex: 1 1 auto;
  min-width: 0;
}

.equipment-option.is-on,
.equipment-option:has(input:checked) {
  background: #fffdf4;
  box-shadow: inset 4px 0 0 var(--yellow);
}

.equipment-option.is-on .eq-name,
.equipment-option:has(input:checked) .eq-name {
  font-weight: 700;
}

.equipment-option[hidden] { display: none; }

@media (max-width: 699px) {
  .destination-card {
    flex: 1 1 100%;
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .destination-card:last-child { border-bottom: 0; }
}

.empty {
  border: 1px dashed var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.empty .btn { margin-top: 0.75rem; }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  align-items: center;
  margin-top: 1.25rem;
  color: var(--muted);
}

.list-toolbar .pager { margin-top: 0; }

.pager a, .pager-current {
  display: inline-flex;
  min-width: 2rem;
  justify-content: center;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 650;
}

.pager a { border: 1px solid var(--line); background: var(--card); }

.pager-current {
  background: var(--charcoal);
  color: var(--charcoal-ink);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.form { margin-top: 1.25rem; }

.req-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.req-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.req-row input { width: auto; accent-color: var(--yellow); }

.form .flash {
  margin-bottom: 1rem;
}

.form .flash p {
  margin: 0.35rem 0 0;
}

.form .flash p:first-child {
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

@media (min-width: 700px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
}

@media (min-width: 1200px) {
  .form-grid { grid-template-columns: 1fr 1fr 1fr; }
  .span-2 { grid-column: span 2; }
}

.field label {
  display: block;
  font-weight: 650;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

.error { color: var(--danger); font-size: 0.8rem; margin: 0.3rem 0 0; }
.hint { color: var(--muted); font-size: 0.8rem; margin: 0.35rem 0 0; }

.preview-wrap { margin-top: 0.75rem; }
.preview-wrap img {
  max-height: 12rem;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #faf8f3;
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.sap-chip {
  display: inline-block;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 700px) {
  .detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1100px) {
  .detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.detail-grid p { margin: 0; }

.catalog-link { margin: 1.1rem 0 0; }
.catalog-link a { font-weight: 650; }

.ref-image {
  margin-top: 1rem;
  width: 100%;
  max-height: 18rem;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f3;
}

.form-sap { margin-top: 1rem; background: #faf7f0; }

.form-danger { margin-top: 1rem; background: #fdf6f5; }

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 650;
  cursor: pointer;
}

.check-label input {
  margin-top: 0.25rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--danger);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.4rem;
}

.btn-locked {
  border: 1px dashed #c9b8b6;
  background: #f6f1ef;
  color: #8a6f6c;
  cursor: not-allowed;
  opacity: 0.85;
}

.lock-banner {
  background: #fff4c8;
  border: 1px solid var(--yellow);
  color: var(--yellow-ink);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
}

.lock-banner em { font-style: normal; font-weight: 800; }

.history-card { margin-top: 1rem; }

.history-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  border-left: 3px solid var(--yellow);
}

.history-item {
  padding: 0 0 0.15rem 1rem;
  position: relative;
}

.history-item::before {
  content: "";
  position: absolute;
  left: -0.45rem;
  top: 0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid #2c2924;
}

.history-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
}

.history-summary {
  margin: 0.2rem 0 0;
  font-weight: 650;
}

.history-changes {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.history-item.history-bloqueio::before { background: #c45c4a; }
.history-item.history-correcao::before { background: #3d7ea6; }
.history-item.history-status::before { background: #3d8a5a; }
.history-item.history-nota::before { background: #8a6d1d; }

.site-footer {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter) 2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-version {
  margin: 0.45rem 0 0;
  font-weight: 700;
  color: var(--fg);
}

.footer-update {
  margin: 0.25rem 0 0;
  max-width: 52rem;
}

@media (max-width: 640px) {
  .page { padding-top: 1.4rem; }
  .form .btn,
  .empty .btn { width: 100%; }
  .brand-sub { display: none; }
  .header-cta { display: none; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { width: 100%; }
  .header-inner { padding: calc(0.85rem + env(safe-area-inset-top)) 1rem 0.85rem; gap: 0.6rem; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .icon-btn { font-size: 0.78rem; padding: 0.45rem 0.6rem; min-height: 2.5rem; }
  .brand-title { font-size: 0.95rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 1.45rem; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand span { min-width: 0; }
.brand-title { white-space: nowrap; }

.icon-btn {
  position: relative;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: var(--charcoal-ink);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.notify-dot {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-size: 0.7rem;
  display: grid;
  place-items: center;
}

.notify-dot[hidden] {
  display: none !important;
}

.pwa-setup {
  max-width: var(--max);
  width: 100%;
  margin: 0.75rem auto 0;
  padding: 0.95rem var(--gutter);
  background: #fff8dc;
  border: 1px solid #e6d27a;
  border-radius: var(--radius);
}

.pwa-setup[hidden] {
  display: none !important;
}

.pwa-setup p {
  margin: 0;
}

.pwa-setup .hint {
  margin-top: 0.45rem;
}

.pwa-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.pwa-setup-actions .btn {
  min-height: 2.6rem;
}

@media (max-width: 640px) {
  .pwa-setup-actions .btn {
    width: 100%;
  }
}

.notify-panel {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter) 1rem;
}

.notify-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  color: var(--charcoal-ink);
}

.notify-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.notify-list a {
  display: block;
  background: #3a362f;
  color: var(--charcoal-ink);
  text-decoration: none;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
}

.notify-list a span {
  display: block;
  font-size: 0.82rem;
  opacity: 0.8;
  margin-top: 0.15rem;
}

.toast-stack {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  gap: 0.5rem;
  z-index: 40;
  max-width: min(22rem, calc(100vw - 2rem));
}

.toast {
  display: grid;
  gap: 0.2rem;
  background: var(--charcoal);
  color: var(--charcoal-ink);
  text-decoration: none;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border-left: 4px solid var(--yellow);
  box-shadow: var(--shadow);
}

.live-banner {
  display: block;
  margin-bottom: 1rem;
  background: #fff4c8;
  border: 1px solid var(--yellow);
  color: var(--yellow-ink);
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.consult-banner {
  display: grid;
  gap: 0.2rem;
  margin-top: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  text-decoration: none;
}

.consult-banner strong { font-size: 1rem; }
.consult-banner span { color: var(--muted); font-size: 0.9rem; }
.consult-banner:hover { border-color: var(--yellow); }

.section-title {
  margin: 1.5rem 0 0.6rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 36rem;
}

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

.catalog-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #faf8f3;
}

.catalog-table tbody tr:last-child td { border-bottom: 0; }
.catalog-table tbody tr:hover { background: #fffdf6; }

.item-code {
  font-weight: 700;
  font-size: 0.88rem;
}

.table-count { margin: 0.7rem 0 0; }

.catalog-hits {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.4rem;
}

.catalog-hits[hidden] {
  display: none !important;
}

.catalog-hits .hit {
  display: block;
  border: 1px solid var(--line);
  background: #faf8f3;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  text-decoration: none;
}

.catalog-hits .hit span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

body.wizard-open {
  overflow: hidden;
}

body.wizard-open #pwa-setup {
  display: none !important;
}

.wizard[hidden] { display: none !important; }

.wizard {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
}

.wizard-scrim {
  position: absolute;
  inset: 0;
  background: rgba(44, 41, 36, 0.55);
}

.wizard-sheet {
  position: relative;
  width: min(42rem, 100%);
  max-height: min(100dvh, 100%);
  overflow: auto;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 1.15rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  outline: none;
}

.wizard-extra {
  margin-top: 0.75rem;
}

.tutorial-index {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}

.tutorial-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 0.9rem;
}

.tutorial-card h2 {
  margin: 0.2rem 0 0.45rem;
}

.wizard-progress {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.wizard-dot {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
}

.wizard-dot.is-on,
.wizard-dot.is-done {
  background: var(--yellow);
}

.wizard-kicker,
.wizard-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.wizard-sheet h2 {
  margin: 0.25rem 0 0.45rem;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.wizard-sheet .lede {
  margin: 0 0 0.85rem;
}

.wizard-points {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.4rem;
}

.wizard-nav,
.wizard-finish,
.wizard-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.wizard-nav .btn,
.wizard-finish .btn,
.wizard-actions-inline .btn {
  flex: 1 1 8rem;
  min-height: 2.85rem;
}

.wizard-nav .btn-ghost[hidden],
.wizard-finish[hidden],
.wizard-nav[hidden] {
  display: none !important;
}

.wizard-step[hidden] { display: none !important; }

@media (min-width: 720px) {
  .wizard {
    place-items: center;
  }
  .wizard-sheet {
    border-radius: 16px;
    padding: 1.5rem 1.5rem 1.35rem;
  }
  .wizard-sheet h2 { font-size: 1.7rem; }
}

@media (max-width: 719px) {
  .wizard-nav .btn,
  .wizard-finish .btn,
  .wizard-actions-inline .btn {
    flex: 1 1 100%;
  }
}

@media (min-width: 700px) {
  :root { --gutter: 1.5rem; }
}

@media (min-width: 1100px) {
  :root { --gutter: 2.25rem; }
  .header-inner { flex-wrap: nowrap; }
  .header-actions { flex-wrap: nowrap; }
  .page,
  .page-narrow { padding-top: 2.25rem; }
  .list-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
  }
  .list-toolbar .filters {
    flex: 1 1 auto;
    min-width: 0;
  }
  .list-toolbar .list-meta { margin-top: 0; flex-shrink: 0; }
  .consulta .filters,
  .page .filters {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (min-width: 1400px) {
  :root { --gutter: 2.75rem; }
}

.status-field input[type="date"] {
  min-width: 11rem;
  max-width: 18rem;
}

@media print {
  .site-header,
  .site-footer,
  .wizard,
  .pwa-setup,
  .flash-wrap,
  .admin-bar,
  .admin-panel,
  .notify-panel,
  .toast-stack,
  .no-print,
  .lock-banner {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .page,
  .page-narrow {
    max-width: 100%;
    padding: 0;
  }
  .card,
  .detail-head {
    box-shadow: none;
    border-color: #ccc;
    break-inside: avoid;
  }
  .card-watermark { display: none; }
  a { text-decoration: none; color: inherit; }
}


