/* ============================================================
   Controle de Coletores — design system (seção 4 do prompt)
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&family=Space+Grotesk:wght@700&display=swap");

:root {
  --bg: #0e1110;
  --bg-side: #121614;
  --surface: #151917;
  --input: #101312;
  --line: #2a312d;
  --line-2: #222825;
  --text: #eef2ef;
  --text-2: #a7b0ab;
  --muted: #8a948f;
  --faint: #6b746f;
  --green: #8dff6a;
  --on-green: #06130a;
  --cyan: #5cc8ff;
  --orange: #ffb27a;
  --red: #ff8a7a;

  --side-w: 220px;
  --content-max: 1400px;
  --balcao-max: 1100px;
  --radius-card: 14px;
  --radius-btn: 12px;
  --radius-input: 12px;
  --gap-block: 20px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ---------- Layout autenticado ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-wrap: wrap;
}

.sidebar {
  width: var(--side-w);
  flex-shrink: 0;
  background: var(--bg-side);
  border-right: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 16px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--green);
  color: #0e1110;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.brand-text span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-group {
  margin-top: 6px;
}

.nav-group-label {
  padding: 14px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--faint);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  background: rgba(141, 255, 106, 0.1);
  color: var(--green);
}

.nav-link .ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(141, 255, 106, 0.12);
  color: var(--green);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.btn-sair {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-sair:hover {
  color: var(--text);
  border-color: var(--muted);
}

.content {
  flex: 1;
  min-width: 0;
  padding: 24px 32px;
  background:
    radial-gradient(circle at 100% 0%, rgba(141, 255, 106, 0.07), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(92, 200, 255, 0.05), transparent 40%),
    var(--bg);
}

.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--gap-block);
}

.content-inner--balcao {
  max-width: var(--balcao-max);
}

/* ---------- Topo de página ---------- */

.page-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
}

.breadcrumb {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.turno-live {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--text-2);
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-tag {
  display: block;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--green);
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
}

.page-title em {
  font-style: normal;
  color: var(--green);
  text-shadow: 0 0 18px rgba(141, 255, 106, 0.28);
}

h2,
.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
}

.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Componentes ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 18px 20px;
}

.card-soft-green {
  background: linear-gradient(135deg, rgba(141, 255, 106, 0.08), transparent 60%),
    var(--surface);
  border-color: rgba(141, 255, 106, 0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--green);
  color: var(--on-green);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  height: 52px;
  padding: 0 22px;
  border-radius: var(--radius-btn);
  box-shadow: 0 6px 22px rgba(141, 255, 106, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-btn);
}

.btn-secondary:hover {
  border-color: var(--muted);
}

.field {
  margin-bottom: 14px;
}

.input,
.textarea,
.select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.textarea {
  height: auto;
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(141, 255, 106, 0.12);
}

/* Chrome/Edge: autocomplete deixa o fundo branco — força o tema escuro */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active,
.textarea:-webkit-autofill,
.textarea:-webkit-autofill:hover,
.textarea:-webkit-autofill:focus,
.select:-webkit-autofill,
.select:-webkit-autofill:hover,
.select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  border-color: var(--line);
  box-shadow: 0 0 0 1000px var(--input) inset !important;
  transition: background-color 99999s ease-out;
}

.input:-webkit-autofill:focus,
.textarea:-webkit-autofill:focus,
.select:-webkit-autofill:focus {
  border-color: var(--green) !important;
  box-shadow:
    0 0 0 1000px var(--input) inset,
    0 0 0 3px rgba(141, 255, 106, 0.12) !important;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

/* Campos do balcão (Retirada / Devolução) */
.input-lg,
.input-scan {
  height: 52px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  padding: 0 14px;
}

.input-scan::placeholder {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--faint);
  opacity: 1;
}

.input-with-ico {
  position: relative;
}

.input-with-ico .ico-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: grid;
  place-items: center;
  line-height: 0;
}

.input-with-ico .input {
  padding-left: 42px;
}

.input-with-ico .ico-right {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

/* Campo + Buscar como peça única */
.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(141, 255, 106, 0.12);
}

.input-group > .input,
.input-group > .input-with-ico {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  border: none;
  border-radius: 12px 0 0 12px;
  box-shadow: none;
  background: transparent;
}

.input-group > .input:focus,
.input-group .input:focus {
  border: none;
  box-shadow: none;
}

.input-group > .input-with-ico .input {
  height: 52px;
  border: none;
  border-radius: 12px 0 0 12px;
  box-shadow: none;
  background: transparent;
}

.input-group-btn {
  flex-shrink: 0;
  height: 52px;
  margin: 0;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-left: 1px solid var(--line);
  border-radius: 0 12px 12px 0;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.input-group-btn .ico {
  color: inherit;
  stroke: currentColor;
}

.input-group-btn:hover {
  color: var(--green);
  background: rgba(141, 255, 106, 0.08);
}

.input-group:focus-within .input-group-btn {
  border-left-color: rgba(141, 255, 106, 0.35);
}

.btn.btn-warn,
#btn-confirmar.btn-warn {
  background: #ffb27a;
  color: #1f0d02;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  height: 52px;
  padding: 0 22px;
  border-radius: var(--radius-btn);
  box-shadow: 0 6px 22px rgba(255, 178, 122, 0.28);
  border: none;
}

.btn.btn-warn:hover,
#btn-confirmar.btn-warn:hover {
  filter: brightness(1.06);
  background: #ffb27a;
  color: #1f0d02;
}

.btn.btn-warn:disabled,
#btn-confirmar.btn-warn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
  background: #ffb27a;
  color: #1f0d02;
}

.btn.btn-warn .ico,
#btn-confirmar.btn-warn .ico {
  color: #1f0d02;
  stroke: #1f0d02;
}

.field-suggest {
  position: relative;
}

.suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 2px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.suggest-list[hidden],
.suggest-list:empty {
  display: none !important;
  padding: 0;
  border: none;
  box-shadow: none;
  min-height: 0;
}

.suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.suggest-item strong {
  font-size: 15px;
  font-weight: 600;
}

.suggest-item .suggest-sub {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.suggest-item:hover,
.suggest-item.is-active {
  background: rgba(141, 255, 106, 0.1);
}

.contador-check {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: none;
}

.contador-ok {
  color: var(--green);
}

.contador-warn {
  color: var(--orange);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--on-green);
}

.chip.active.chip-warn {
  background: var(--orange);
  border-color: var(--orange);
  color: #1a1008;
}

.chip .count {
  font-family: var(--font-mono);
  font-size: 13px;
  opacity: 0.85;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.badge-ok {
  color: var(--green);
}
.badge-uso {
  color: var(--cyan);
}
.badge-warn {
  color: var(--orange);
}
.badge-danger {
  color: var(--red);
}
.badge-muted {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

table.data th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
}

table.data td {
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}

table.data td.mono,
table.data .mono {
  font-size: 14px;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.codigo-id {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

/* ---------- Atalhos do painel ---------- */

.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0;
}

.shortcut-card {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 76px;
  padding: 14px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.15s, transform 0.12s;
}

.shortcut-card:hover {
  transform: translateY(-1px);
}

.shortcut-card.saida {
  background: linear-gradient(135deg, rgba(141, 255, 106, 0.1), transparent 55%),
    var(--surface);
  border-color: rgba(141, 255, 106, 0.4);
}

.shortcut-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(141, 255, 106, 0.12);
  color: var(--green);
}

.shortcut-card:not(.saida) .shortcut-ico {
  background: rgba(92, 200, 255, 0.1);
  color: var(--cyan);
}

.shortcut-meta .key {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.shortcut-meta strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  line-height: 1.15;
}

.shortcut-meta p {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}

/* ---------- Contadores (compactos, em linha) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
}

.stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 84px;
  min-height: 84px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.stat-card.green::after {
  background: linear-gradient(160deg, rgba(141, 255, 106, 0.12), transparent 55%);
}
.stat-card.cyan::after {
  background: linear-gradient(160deg, rgba(92, 200, 255, 0.12), transparent 55%);
}
.stat-card.orange::after {
  background: linear-gradient(160deg, rgba(255, 178, 122, 0.12), transparent 55%);
}
.stat-card.red::after {
  background: linear-gradient(160deg, rgba(255, 138, 122, 0.12), transparent 55%);
}

.stat-ico {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.stat-card.green .stat-ico {
  background: rgba(141, 255, 106, 0.14);
  color: var(--green);
}
.stat-card.cyan .stat-ico {
  background: rgba(92, 200, 255, 0.14);
  color: var(--cyan);
}
.stat-card.orange .stat-ico {
  background: rgba(255, 178, 122, 0.14);
  color: var(--orange);
}
.stat-card.red .stat-ico {
  background: rgba(255, 138, 122, 0.14);
  color: var(--red);
}

.stat-value {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.4px;
}

.stat-card.green .stat-value {
  color: var(--green);
}
.stat-card.cyan .stat-value {
  color: var(--cyan);
}
.stat-card.orange .stat-value {
  color: var(--orange);
}
.stat-card.red .stat-value {
  color: var(--red);
}

.stat-text {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.stat-legend {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.stat-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}

a.stat-card:hover {
  transform: translateY(-1px);
}

a.stat-card.green:hover {
  border-color: rgba(141, 255, 106, 0.45);
}
a.stat-card.cyan:hover {
  border-color: rgba(92, 200, 255, 0.45);
}
a.stat-card.orange:hover {
  border-color: rgba(255, 178, 122, 0.5);
}
a.stat-card.red:hover {
  border-color: rgba(255, 138, 122, 0.5);
}

.atualizado-em {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.tempo-alerta {
  color: var(--red) !important;
  font-weight: 700;
}

table.data tr.row-click {
  cursor: pointer;
}

table.data tr.row-click:hover td {
  background: rgba(92, 200, 255, 0.06);
}

.empty-table {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 28px 12px !important;
  margin: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.section-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Tabela cola no título da seção */
.section-head + .table-wrap {
  margin-top: -12px;
}

.placeholder-msg {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

/* ---------- Login ---------- */

html:has(.login-page),
body:has(.login-page) {
  height: 100%;
  overflow: hidden;
}

.login-page {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  caret-color: var(--green);
}

/* No note: stage = tela inteira (visual idêntico ao anterior). */
.login-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  align-items: center;
  justify-items: start;
  padding: clamp(16px, 2.5vh, 32px) clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 8vw, 80px);
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 42%;
  display: block;
  filter: saturate(1) contrast(1.05) brightness(1.04);
}

.login-bg .login-bg-cut {
  display: none;
}

.login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(14, 17, 16, 0.96) 0%, rgba(14, 17, 16, 0.9) 34%, rgba(14, 17, 16, 0.35) 58%, rgba(14, 17, 16, 0.12) 100%),
    linear-gradient(180deg, rgba(14, 17, 16, 0.22) 0%, transparent 28%, rgba(14, 17, 16, 0.34) 100%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(ellipse at 18% 30%, rgba(141, 255, 106, 0.07), transparent 42%);
  background-size: auto, auto, 56px 56px, 56px 56px, auto;
}

.login-page ::selection {
  background: rgba(141, 255, 106, 0.28);
  color: var(--text);
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 20px);
}

.login-hero {
  min-width: 0;
  flex-shrink: 0;
}

.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(10px, 1.6vh, 16px);
}

.login-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0 0 clamp(10px, 1.6vh, 16px);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.login-title em {
  font-style: normal;
  color: var(--green);
}

.login-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(14, 17, 16, 0.78);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.login-status-item {
  margin: 0;
  padding: clamp(8px, 1.2vh, 12px) 12px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.login-status-item:last-child {
  border-right: none;
}

.login-status-item dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-status-item dd {
  margin: 0;
  font-size: clamp(18px, 2.2vh, 22px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.login-status-item.is-ok dd {
  color: var(--green);
}

.login-status-item.is-uso dd {
  color: var(--cyan);
}

.login-status-item.is-manut dd {
  color: var(--orange);
}

.login-card {
  background: rgba(21, 25, 23, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(18px, 2.4vh, 26px) clamp(18px, 2vw, 24px) clamp(14px, 2vh, 20px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  flex-shrink: 1;
  min-height: 0;
  animation: login-card-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-card {
    animation: none;
  }
}

.login-card-head {
  margin-bottom: clamp(12px, 1.8vh, 18px);
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vh, 26px);
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}

.login-card .sub {
  color: var(--text-2);
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.login-form .field {
  margin-bottom: clamp(8px, 1.2vh, 12px);
}

.login-card .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 clamp(12px, 1.8vh, 16px);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.login-card .check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  flex-shrink: 0;
}

.login-card .btn-primary {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
}

.login-foot {
  margin-top: clamp(12px, 1.8vh, 16px);
  padding-top: clamp(10px, 1.4vh, 14px);
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

@media (max-height: 820px) {
  .login-hero-brand {
    margin-bottom: 8px;
  }
  .login-title {
    font-size: 28px;
    margin-bottom: 10px;
  }
  .login-status-item dt {
    font-size: 10px;
  }
  .login-card .sub {
    display: none;
  }
}

.login-page-ver {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 16px;
  font-size: 11px;
  color: var(--faint);
  opacity: 0.7;
  pointer-events: none;
}

/*
  Só ultrawide 21:9 (34"). Note 16:9 não muda.
  Tela cheia: form à esquerda + coletor grande preenchendo a direita.
*/
@media (min-aspect-ratio: 21 / 9) {
  .login-page {
    place-items: stretch;
    padding: 0;
    background: var(--bg);
  }

  .login-stage {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 560px minmax(0, 1fr);
    align-items: stretch;
    justify-items: stretch;
    gap: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: var(--bg);
    padding: 0;
  }

  .login-wrap {
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: clamp(36px, 5vh, 56px) 28px clamp(36px, 5vh, 56px) clamp(44px, 3.2vw, 64px);
    justify-content: center;
    gap: clamp(16px, 2.2vh, 24px);
    background: linear-gradient(90deg, var(--bg) 68%, rgba(14, 17, 16, 0) 100%);
  }

  .login-title {
    font-size: clamp(34px, 3.2vw, 44px);
  }

  .login-status-item {
    padding: 14px 16px;
  }

  .login-status-item dt {
    font-size: 12px;
  }

  .login-status-item dd {
    font-size: 26px;
  }

  .login-card {
    padding: 28px 26px 22px;
  }

  .login-card h2 {
    font-size: 28px;
  }

  .login-card .btn-primary {
    min-height: 48px;
    font-size: 15px;
  }

  .login-bg {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 1;
    z-index: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
  }

  .login-bg .login-bg-full {
    display: none;
  }

  .login-bg .login-bg-cut {
    display: block;
    position: relative;
    inset: auto;
    width: auto;
    height: 100%;
    max-height: 100%;
    max-width: min(1240px, 100%);
    object-fit: contain;
    object-view-box: none;
    object-position: center;
    transform: none;
    padding: 0;
    box-sizing: border-box;
    filter: saturate(1.08) contrast(1.08) brightness(1.08) drop-shadow(0 28px 48px rgba(0, 0, 0, 0.55));
  }

  .login-bg::after {
    display: none;
  }
}

@media (max-width: 1100px) {
  .login-stage {
    padding: 16px 16px 20px;
    align-items: center;
    justify-items: stretch;
  }
  .login-wrap {
    max-width: 400px;
    margin: 0 auto;
    gap: 14px;
  }
  .login-bg img {
    object-position: 82% 32%;
    opacity: 0.35;
  }
  .login-bg::after {
    background:
      linear-gradient(180deg, rgba(14, 17, 16, 0.9) 0%, rgba(14, 17, 16, 0.84) 45%, rgba(14, 17, 16, 0.94) 100%),
      linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: auto, 56px 56px, 56px 56px;
  }
  .login-page-ver {
    right: 12px;
    bottom: 10px;
  }
  .login-hero {
    order: -1;
  }
  .login-title,
  .login-status {
    display: none;
  }
  .login-hero-brand {
    margin-bottom: 0;
    justify-content: center;
  }
  .login-card {
    padding: 20px 18px 16px;
  }
  .login-card h2 {
    font-size: 22px;
  }
}

/* ---------- Alertas, admin, formulários ---------- */

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 4px;
}

.alert-warn {
  background: rgba(255, 178, 122, 0.1);
  border-color: rgba(255, 178, 122, 0.35);
  color: var(--orange);
}

.alert-ok {
  background: rgba(141, 255, 106, 0.08);
  border-color: rgba(141, 255, 106, 0.3);
  color: var(--text);
}

.alert-info {
  background: rgba(92, 200, 255, 0.08);
  border-color: rgba(92, 200, 255, 0.25);
  color: var(--text-2);
}

.alert-info strong {
  color: var(--cyan);
}

.senha-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.senha-provisoria {
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 2px;
  padding: 8px 12px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.2fr;
  gap: 14px;
  align-items: end;
}

.form-actions {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.perfil-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.perfil-opt {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.perfil-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.perfil-opt.active {
  background: rgba(141, 255, 106, 0.12);
  border-color: rgba(141, 255, 106, 0.45);
  color: var(--green);
}

.badge-perfil {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
  border-radius: 7px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-sm {
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.row-inactive td {
  opacity: 0.55;
}

.form-grid-colab {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.form-grid-colab .form-actions {
  grid-column: 1 / -1;
}

.input-error {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 3px rgba(255, 178, 122, 0.15);
}

.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.import-bar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.file-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 100%);
  color: var(--muted);
}

.search-box .input {
  height: 40px;
  flex: 1;
}

.erro-lista {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
}

.muted-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

a.chip {
  text-decoration: none;
}

/* ---------- Retirada ---------- */

.retirada-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  width: 100%;
}

.retirada-main,
.retirada-resumo {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.retirada-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.retirada-form-body {
  flex: 1;
}

.retirada-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.retirada-actions .btn-primary {
  flex: 1;
  height: 52px;
  min-width: 0;
}

.retirada-actions .btn-secondary {
  flex: 0 0 140px;
  width: 140px;
  height: 52px;
  font-size: 15px;
}

.field-ok {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
}

.resumo-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.resumo-dl > div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}

.resumo-dl dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}

.resumo-dl dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.resumo-vazio {
  color: var(--faint);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
}

.resumo-nome {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.resumo-sub {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.resumo-aviso {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.resumo-aviso .ico {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--muted);
}

.retirada-resumo .section-head {
  margin-bottom: 16px;
}

.toast-sucesso {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(141, 255, 106, 0.12);
  border: 1px solid rgba(141, 255, 106, 0.35);
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 20px;
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.modal-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.modal-texto {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-2);
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions .btn {
  flex: 1;
  min-width: 120px;
}

@media (max-width: 900px) {
  .retirada-layout {
    grid-template-columns: 1fr;
  }
  .retirada-actions .btn-secondary {
    flex: 0 0 auto;
    width: auto;
    min-width: 120px;
  }
}

/* ---------- Devolução / Resultado ---------- */

.devolucao-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.field-id-dev {
  width: min(420px, 100%);
  position: relative;
  z-index: 30;
}

.field-id-dev .suggest-list {
  z-index: 50;
}

.field-id-dev .label {
  margin-bottom: 4px;
}

.field-id-dev .input-scan {
  color: var(--green);
  font-weight: 700;
}

.faixa-uso {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.faixa-uso .label {
  margin-bottom: 2px;
  font-size: 11px;
}

.faixa-uso strong {
  display: block;
  font-size: 14px;
}

#painel-checklist.card {
  padding: 14px 16px;
  overflow: hidden;
}

#painel-checklist .section-head {
  margin-bottom: 6px;
}

#painel-checklist .atalhos-check {
  margin: 0 0 8px;
  font-size: 12px;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.checklist .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  height: 56px;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input);
  outline: none;
}

.checklist .check-row.is-active {
  border-color: var(--green);
  box-shadow: none;
}

.checklist .check-row.is-problema {
  border-color: rgba(255, 178, 122, 0.5);
}

.checklist .check-row.is-problema .check-ico {
  color: var(--orange);
  background: rgba(255, 178, 122, 0.14);
}

.checklist .check-row.is-ok .check-ico {
  color: var(--green);
  background: rgba(141, 255, 106, 0.14);
}

.check-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
}

.check-text {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.check-text .check-line {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.check-text .check-line strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.check-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-check {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-check.ok:hover,
.checklist .check-row.is-ok .btn-check.ok {
  background: rgba(141, 255, 106, 0.14);
  border-color: rgba(141, 255, 106, 0.45);
  color: var(--green);
}

.btn-check.problema:hover,
.checklist .check-row.is-problema .btn-check.problema {
  background: rgba(255, 178, 122, 0.14);
  border-color: rgba(255, 178, 122, 0.45);
  color: var(--orange);
}

#painel-checklist .acoes-dev {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--input);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}

.resultado-wrap {
  display: grid;
  place-items: center;
  padding: 12px 0 28px;
}

.resultado-card {
  width: min(560px, 100%);
  text-align: center;
  padding: 28px 24px;
}

.resultado-ok {
  border-color: rgba(141, 255, 106, 0.35);
  background: linear-gradient(160deg, rgba(141, 255, 106, 0.1), transparent 50%),
    var(--surface);
}

.resultado-warn {
  border-color: rgba(255, 178, 122, 0.4);
  background: linear-gradient(160deg, rgba(255, 178, 122, 0.1), transparent 50%),
    var(--surface);
}

.resultado-ico {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
}

.resultado-ok .resultado-ico {
  color: var(--green);
  background: rgba(141, 255, 106, 0.14);
}

.resultado-warn .resultado-ico {
  color: var(--orange);
  background: rgba(255, 178, 122, 0.14);
}

.resultado-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -1px;
  margin: 0 0 8px;
}

.resultado-lead {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
  margin: 0 0 22px;
}

.resultado-meta {
  text-align: left;
  margin-bottom: 22px;
}

.resultado-meta dd .badge {
  margin-right: 6px;
}

.resultado-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .faixa-uso {
    grid-template-columns: 1fr 1fr;
  }
  .checklist .check-row {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
  }
  .check-btns {
    width: 100%;
  }
  .btn-check {
    flex: 1;
  }
}

/* ---------- Responsivo ---------- */

@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--line-2);
  }
  .content {
    padding: 20px 16px;
  }
  .shortcut-grid {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 30px;
  }
  .form-grid-3,
  .form-grid-colab {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-title {
    letter-spacing: -1.5px;
  }
}

/* —— Histórico —— */
.historico-filtros {
  margin-bottom: 14px;
}

.historico-filtros .filtros-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-end;
}

.historico-filtros .field-grow {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
}

.historico-filtros .filtros-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chips a.chip {
  text-decoration: none;
  color: inherit;
}

.chips {
  margin-bottom: 16px;
}

.historico-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 20px;
  align-items: start;
}

.historico-lista {
  min-width: 0;
}

table.data tr.row-click.is-selected td {
  background: rgba(92, 200, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.paginacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.paginacao-info {
  font-size: 13px;
  color: var(--muted);
}

.historico-detalhe {
  position: sticky;
  top: 16px;
  padding: 18px;
  min-height: 220px;
}

.historico-detalhe .empty-detalhe {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.detalhe-coletor {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.detalhe-meta {
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detalhe-meta dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.detalhe-meta dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.detalhe-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tl-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  align-items: start;
}

.tl-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.tl-dot.tl-saida {
  background: var(--green);
}

.tl-dot.tl-entrada {
  background: var(--cyan);
}

.tl-dot.tl-pendente {
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.25);
}

.tl-item strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.muted-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.detalhe-uso {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.detalhe-uso .label {
  margin: 0;
}

.check-list-mini {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-list-mini li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.check-list-mini li span {
  font-weight: 500;
  color: var(--text);
}

.check-list-mini li.is-ok {
  color: var(--green);
}

.check-list-mini li.is-problema {
  color: var(--orange);
}

@media (max-width: 960px) {
  .historico-layout {
    grid-template-columns: 1fr;
  }

  .historico-detalhe {
    position: static;
  }
}

/* ---------- Etiquetas ---------- */

.etiquetas-passos {
  margin: 0 0 18px;
  padding-left: 1.35em;
  color: var(--text-2);
  line-height: 1.65;
  font-size: 15px;
}

.etiquetas-passos li {
  margin-bottom: 6px;
}

.etiquetas-passos strong {
  color: var(--text);
  font-weight: 600;
}

.etiquetas-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.etiquetas-previa {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0c0b;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.etiquetas-previa img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
