/* ============================================================
   BR Life · Etiquetas — Estilos (Invoice flow)
   ============================================================ */

/* --- Fontes locais (offline, sem Google Fonts) ---------------------------- */
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:400;
  font-display:swap; src:url("fonts/IBMPlexSans-400.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:500;
  font-display:swap; src:url("fonts/IBMPlexSans-500.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:600;
  font-display:swap; src:url("fonts/IBMPlexSans-600.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:700;
  font-display:swap; src:url("fonts/IBMPlexSans-700.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:400;
  font-display:swap; src:url("fonts/IBMPlexMono-400.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:500;
  font-display:swap; src:url("fonts/IBMPlexMono-500.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:600;
  font-display:swap; src:url("fonts/IBMPlexMono-600.woff2") format("woff2"); }

:root {
  --bg:        #fafaf9;
  --surface:   #ffffff;
  --surface-2: #f5f5f4;
  --surface-3: #ececeb;
  --border:    #e7e5e3;
  --border-2:  #d6d6d3;
  --text:      #0c0a09;
  --text-2:    #44403c;
  --text-3:    #78716c;
  --muted:     #a8a29e;

  --accent:        oklch(0.58 0.14 158);
  --accent-fg:     #ffffff;
  --accent-hover:  oklch(0.52 0.15 158);
  --accent-bg:     oklch(0.96 0.03 158);
  --accent-bg-2:   oklch(0.93 0.05 158);
  --accent-border: oklch(0.85 0.08 158);

  --warn:    oklch(0.72 0.16 65);
  --warn-bg: oklch(0.97 0.04 80);
  --warn-fg: oklch(0.42 0.13 60);

  --ok-bg:   oklch(0.97 0.04 158);
  --ok-fg:   oklch(0.38 0.11 158);

  --danger:    oklch(0.58 0.19 27);
  --danger-bg: oklch(0.97 0.03 25);
  --danger-fg: oklch(0.45 0.16 27);

  --cold-bg: oklch(0.96 0.03 240);
  --cold-fg: oklch(0.42 0.12 240);

  --shadow-sm: 0 1px 0 rgba(12, 10, 9, 0.04), 0 1px 2px rgba(12, 10, 9, 0.04);
  --shadow-md: 0 1px 0 rgba(12, 10, 9, 0.04), 0 4px 12px rgba(12, 10, 9, 0.06);
  --shadow-lg: 0 1px 0 rgba(12, 10, 9, 0.04), 0 12px 32px rgba(12, 10, 9, 0.10);
  --shadow-xl: 0 1px 0 rgba(12, 10, 9, 0.04), 0 20px 56px rgba(12, 10, 9, 0.18);

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", ui-sans-serif, sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 100px;
}

.mono, code, kbd { font-family: "IBM Plex Mono", ui-monospace, monospace; }
button { font: inherit; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: white; }

/* ============================================================
   TEMPLATES ZPL — tela de gestão
   ============================================================ */
.templates-page { display: flex; flex-direction: column; gap: 24px; }

.templates-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) { .templates-layout { grid-template-columns: 1fr; } }

.templates-sidebar { display: flex; flex-direction: column; gap: 12px; }
.templates-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow: auto; }
.tpl-item {
  text-align: left; background: #fff; border: 1px solid #e7e5e3;
  border-radius: 8px; padding: 10px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; font-family: inherit;
  transition: border-color 80ms, background 80ms;
}
.tpl-item:hover { border-color: #c9c4be; }
.tpl-item.is-active { border-color: #0a3d62; background: #eef5fb; }
.tpl-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.tpl-item-file { font-size: 11px; color: #777; }
.tpl-item-file code { background: transparent; padding: 0; }
.tpl-item-desc { font-size: 11px; color: #555; line-height: 1.3; }

.templates-editor {
  background: #fff; border: 1px solid #e7e5e3; border-radius: 10px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.editor-toolbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; padding-bottom: 14px; border-bottom: 1px solid #eee; margin-bottom: 14px;
  flex-wrap: wrap;
}
.editor-actions { display: flex; gap: 8px; }
.btn.danger { border-color: #d63031; color: #d63031; }
.btn.danger:hover { background: #fff5f5; }

.editor-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 1280px) { .editor-grid { grid-template-columns: 1fr; } }

.editor-zpl, .editor-preview { display: flex; flex-direction: column; gap: 8px; }

.zpl-textarea {
  width: 100%;
  min-height: 480px;
  padding: 10px 12px;
  border: 1px solid #d6d6d3;
  border-radius: 6px;
  background: #fafafa;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  font-family: "IBM Plex Mono", monospace;
  white-space: pre;
  overflow: auto;
}
.zpl-textarea:focus { outline: none; border-color: #0a3d62; background: #fff;
  box-shadow: 0 0 0 3px rgba(10,61,98,.10); }

.preview-stage {
  border: 1px dashed #d6d6d3;
  background: #fbfbfa;
  border-radius: 6px;
  padding: 14px;
  min-height: 480px;
  display: flex; align-items: center; justify-content: center;
}
.preview-stage img { max-width: 100%; max-height: 460px; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.preview-stage .erro-box { color: #b00020; background: #ffe8e8; padding: 12px; border-radius: 4px; font-size: 12px; max-width: 100%; }

.placeholders-panel {
  background: #fafafa; border: 1px solid #eee; border-radius: 8px;
  padding: 14px; margin-bottom: 16px;
}
.placeholders-groups { display: flex; flex-direction: column; gap: 10px; }
.ph-group { display: flex; gap: 12px; align-items: flex-start; }
.ph-group-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: #555; min-width: 130px; padding-top: 4px; font-weight: 600;
}
.ph-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ph-chip {
  background: #fff; border: 1px solid #d6d6d3; border-radius: 4px;
  padding: 2px 8px; cursor: pointer; font-family: monospace; font-size: 11px;
  color: #333;
}
.ph-chip:hover { background: #0a3d62; color: #fff; border-color: #0a3d62; }
.ph-chip code { background: transparent; padding: 0; color: inherit; }

.preview-data-panel {
  background: #fafafa; border: 1px solid #eee; border-radius: 8px;
  padding: 12px 16px;
}
.preview-data-panel summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #0a3d62; }
.preview-data-panel .form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px; margin-top: 12px;
}

.help-card {
  background: #eef5fb; border-left: 3px solid #0a3d62; padding: 16px 20px;
  border-radius: 4px; font-size: 13px;
}
.help-card h3 { font-size: 13px; text-transform: uppercase; color: #0a3d62; margin: 0 0 8px; }
.help-card ol { margin: 4px 0; padding-left: 22px; }
.help-card li { margin: 4px 0; }
.help-card code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 3px; }


/* ============================================================
   EDITOR VISUAL DE ETIQUETAS (spec por blocos)
   ============================================================ */
.editor2 { display: flex; flex-direction: column; gap: 18px; }
/* ≥ 1200 px: 3 colunas; abaixo disso ver "EDITOR DE ETIQUETAS — responsivo" */
.editor2-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr) 420px; gap: 18px; align-items: start; }

/* top = altura da topbar (56 px, também sticky) + folga */
.ed-lista { display: flex; flex-direction: column; gap: 6px;
  max-height: calc(100vh - 90px); overflow-y: auto; padding-right: 4px;
  position: sticky; top: 72px; }
.ed-busca { position: sticky; top: 0; z-index: 1; margin-bottom: 2px;
  padding: 8px 10px; border: 1px solid #d6d6d3; border-radius: 8px; font: inherit;
  font-size: 13px; background: #fff; }
.ed-busca:focus { outline: none; border-color: #0a3d62; }
.ed-nome { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 5px;
  font: inherit; font-size: 14px; font-weight: 600; }
.ed-nome:focus { outline: none; border-color: #0a3d62; }
.ed-item { text-align: left; background: #fff; border: 1px solid #e7e5e3; border-radius: 8px;
  padding: 10px 12px; cursor: pointer; font: inherit; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ed-item:hover { border-color: #c9c4be; }
.ed-item.is-active { border-color: #0a3d62; background: #eef5fb; font-weight: 600; }

.ed-form { display: flex; flex-direction: column; gap: 14px; }
.ed-bloco-config { background: #fff; border: 1px solid #e7e5e3; border-radius: 10px; padding: 14px 16px; }
.ed-size { display: flex; gap: 14px; }
.ed-size label, .ed-fixo { display: flex; flex-direction: column; font-size: 12px; color: #555; gap: 3px; }
.ed-size input { width: 90px; padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; font: inherit; }
.ed-fixo { margin-top: 8px; }
.ed-fixo input { padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; font: inherit; font-size: 12px; }

.ed-blocos { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ed-blk { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 6px 10px; border: 1px solid #eee; border-radius: 6px; background: #fafafa; }
.ed-blk.off { opacity: 0.5; }
.ed-blk-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ed-blk-ctrls { display: flex; align-items: center; gap: 12px; }
.ed-fonte, .ed-ordem { display: flex; align-items: center; gap: 4px; }
.ed-fonte b { font-size: 11px; min-width: 34px; text-align: center; font-family: "IBM Plex Mono", monospace; }
.ed-fonte button, .ed-ordem button {
  width: 24px; height: 24px; border: 1px solid #ccc; background: #fff; border-radius: 4px;
  cursor: pointer; font-size: 14px; line-height: 1; }
.ed-fonte button:hover, .ed-ordem button:hover { background: #0a3d62; color: #fff; border-color: #0a3d62; }
.ed-ordem button:disabled { opacity: 0.3; cursor: default; }
.ed-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }

.ed-acoes { display: flex; align-items: center; gap: 12px; }

.ed-preview { background: #fff; border: 1px solid #e7e5e3; border-radius: 10px; padding: 14px;
  position: sticky; top: 72px; }
.ed-preview-box { border: 1px dashed #d6d6d3; background: #fbfbfa; border-radius: 6px; padding: 10px;
  min-height: 200px; display: flex; align-items: center; justify-content: center; position: relative; }
.ed-preview-box img { max-width: 100%; box-shadow: 0 1px 6px rgba(0,0,0,.12); }


/* ============================================================
   CONFIG — impressora
   ============================================================ */
.config-page { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.config-card {
  background: #fff; border: 1px solid #e7e5e3; border-radius: 10px;
  padding: 20px; box-shadow: var(--shadow-sm);
}
.radio-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.radio-card {
  flex: 1 1 300px; display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid #d6d6d3; border-radius: 8px; padding: 12px 14px; cursor: pointer;
}
.radio-card.is-on { border-color: #0a3d62; background: #eef5fb; }
.radio-card input { margin-top: 3px; }
.radio-card strong { display: block; font-size: 13px; }
.radio-card span { display: block; font-size: 12px; color: #555; margin-top: 2px; }
.radio-card em { color: #0a7d3c; font-style: normal; }
.config-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }


/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
}

.brand-wrap {
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
  background: transparent; border: 0; cursor: pointer;
  padding: 4px 6px 4px 0;
  border-radius: 6px;
}
.brand-wrap:hover { background: var(--surface-2); }
.brand-mark svg { display: block; }
.brand-text {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 14px; color: var(--text);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.brand-text strong { font-weight: 600; }
.brand-text .dot { color: var(--muted); }
.brand-text span:last-child { color: var(--text-3); }

.topnav { display: flex; gap: 2px; }
.topnav-item {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.topnav-item:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.topnav-item.is-active { background: var(--text); color: white; }
.topnav-item:disabled { color: var(--muted); cursor: not-allowed; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

/* Seletor de idioma da INTERFACE (PT-BR / EN-US) */
.lang-switch {
  display: inline-flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px;
  gap: 2px;
}
.lang-btn {
  border: none; background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 11px; font-weight: 600; letter-spacing: -0.01em;
  padding: 3px 9px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 100ms;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-on {
  background: var(--text);
  color: #fff;
}

.printer-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 10px 4px 8px;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.printer-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}

.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--border); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: grid; place-items: center;
  letter-spacing: 0.02em;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.user-name { font-size: 12.5px; font-weight: 500; }
.user-role { font-size: 10.5px; color: var(--text-3); }

/* ============================================================
   APP / type
   ============================================================ */
.app-main { max-width: 1400px; margin: 0 auto; padding: 24px; }

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
h4 { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }

kbd {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 5px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-bottom-width: 1.5px;
  border-radius: 3px;
  color: var(--text-2);
}
.muted { color: var(--muted); }
.small { font-size: 11.5px; }

/* ============================================================
   PAGE HEAD (invoices list)
   ============================================================ */
.invoices { display: flex; flex-direction: column; gap: 24px; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 16px; gap: 24px;
}
.page-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-3); max-width: 60ch; }

.head-stats { display: flex; gap: 28px; }
.hstat { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.hstat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); white-space: nowrap; }
.hstat-value { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; font-family: "IBM Plex Mono", monospace; }
.hstat-value.sm { font-size: 16px; font-weight: 500; }
.hstat-of { color: var(--muted); font-size: 14px; font-weight: 400; }

/* ============================================================
   SEARCH HERO
   ============================================================ */
.search-hero { display: flex; flex-direction: column; gap: 10px; }
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color 120ms, box-shadow 120ms;
}
.search-input-wrap:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--text) 8%, transparent);
}
.search-input-wrap > svg { color: var(--text-3); flex-shrink: 0; }
.search-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.012em;
  padding: 0;
}
.search-input::placeholder { color: var(--muted); font-weight: 400; }
.kbd-hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.filter-bar {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-3);
  flex-wrap: wrap;
}
.filter-spacer { flex: 1; }

.select-pill {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  padding: 4px 28px 4px 12px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.select-pill:hover { border-color: var(--text); }

.link-btn {
  border: 0; background: transparent;
  color: var(--text-2); font-size: 12px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 4px;
  white-space: nowrap;
}
.link-btn:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.section-head.between { flex-direction: row; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.section-sub { font-size: 12px; color: var(--text-3); }

/* ============================================================
   CODE CHIPS
   ============================================================ */
.code-chip, .code-cell {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  background: var(--surface-2);
  color: var(--text);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: inline-block;
}
.code-chip.lg { font-size: 13px; padding: 3px 9px; }

/* ============================================================
   CHIPS
   ============================================================ */
.chip-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 100ms;
}
.chip:hover { border-color: var(--text); color: var(--text); }
.chip.is-on { background: var(--text); color: white; border-color: var(--text); }

/* ============================================================
   TABLE (invoices list)
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-wrap:focus { outline: none; }

.prod-table { width: 100%; border-collapse: collapse; }
.prod-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.prod-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.prod-table tbody tr { cursor: pointer; transition: background 80ms; }
.prod-table tbody tr:last-child td { border-bottom: 0; }
.prod-table tbody tr:hover, .prod-table tbody tr.is-focused { background: var(--surface-2); }
.prod-table tbody tr.is-focused { box-shadow: inset 2px 0 0 var(--accent); }

.prod-nome { font-weight: 500; letter-spacing: -0.005em; }
.prod-desc { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.status-stack { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.td-empty { padding: 36px; text-align: center; color: var(--text-3); }

.row-action {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-2);
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
}
.row-action:hover { background: var(--text); color: white; border-color: var(--text); }

.tbl-foot {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
}
.tbl-foot kbd { font-size: 10px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.badge.ok    { background: var(--ok-bg);   color: var(--ok-fg); }
.badge.ready { background: var(--ok-bg);   color: var(--ok-fg); }
.badge.warn  { background: var(--warn-bg); color: var(--warn-fg); }
.badge.err   { background: var(--danger-bg); color: var(--danger-fg); font-weight: 600; }
.badge.cold  { background: var(--cold-bg); color: var(--cold-fg); }
.badge.muted-badge { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }

/* ============================================================
   INVOICE DETAIL — header
   ============================================================ */
.invoice-detail { display: flex; flex-direction: column; gap: 16px; }

.crumb-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.crumb-back {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 0;
  padding: 4px 8px; margin-left: -8px;
  border-radius: 4px;
  color: var(--text-2); cursor: pointer; font-size: 13px;
}
.crumb-back:hover { background: var(--surface-2); color: var(--text); }
.crumb-sep { color: var(--muted); }
.crumb-now { color: var(--text); font-family: "IBM Plex Mono", monospace; font-size: 12px; }

.inv-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 32px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.inv-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.inv-title { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.inv-sub { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.inv-meta {
  margin-top: 14px;
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-3);
}
.inv-meta strong { color: var(--text); font-weight: 500; }
.inv-meta span { display: inline-flex; align-items: center; gap: 5px; }

.inv-stats {
  display: flex; gap: 24px; flex-shrink: 0;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}
.istat { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.istat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); white-space: nowrap; }
.istat-value { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }

/* ============================================================
   LINES TOOLBAR
   ============================================================ */
.lines-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 68px;
  z-index: 10;
}
.tb-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tb-right { display: flex; gap: 8px; }
.tb-sep { width: 1px; height: 20px; background: var(--border); }

.check-all {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}
.check-all input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--text); }

/* ============================================================
   LINE CARD
   ============================================================ */
.lines-list { display: flex; flex-direction: column; gap: 8px; }
.empty-card {
  padding: 40px;
  text-align: center;
  color: var(--text-3);
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
}

.line-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 120ms, box-shadow 120ms;
}
.line-card.is-selected {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}
.line-card.is-done {
  background: var(--surface-2);
  opacity: 0.85;
}

.line-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.line-card.is-selected .line-head { background: oklch(0.985 0.005 158); }

.line-check { display: flex; align-items: center; cursor: pointer; }
.line-check input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--text); }

.line-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.line-id .code-chip { width: fit-content; }
.line-name { font-size: 14px; font-weight: 500; letter-spacing: -0.005em; }

.line-quick {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  padding-right: 14px;
  border-right: 1px solid var(--border);
}
.quick-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.quick-value { font-size: 18px; font-weight: 500; line-height: 1.1; }

.line-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Line body */
.line-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 16px;
}
.line-group { display: flex; flex-direction: column; gap: 10px; }
.group-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.group-sub {
  font-size: 9.5px;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-bg);
  color: var(--ok-fg);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 500;
}
.line-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.line-fields.imp {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Inline info display (for read-only summary) */
.inline-info {
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  display: flex; align-items: baseline; gap: 6px;
}
.inline-info .muted { font-size: 11px; color: var(--text-3); }

/* Disclose (cadastro) */
.disclose {
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  width: 100%;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
}
.disclose:hover { background: var(--surface-2); }
.disclose svg { transition: transform 160ms; color: var(--text-3); }
.disclose.is-open svg { transform: rotate(180deg); }
.disclose-warn {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--warn-fg);
  background: var(--warn-bg);
  padding: 1px 7px; border-radius: 100px;
  font-weight: 500;
}
.disclose-ok {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--ok-fg);
  display: inline-flex; align-items: center; gap: 3px;
}

.cadastro-panel {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.cadastro-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}

/* Kit — painel de componentes */
.badge.kit { background: oklch(0.93 0.05 265); color: oklch(0.42 0.13 265); }
.kit-panel {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.kit-comps { display: flex; flex-direction: column; gap: 5px; overflow-x: auto; }
.kit-comp {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) 1fr 1fr 1fr 1fr 70px;
  gap: 6px; align-items: center;
}
.kit-comp-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-3); font-weight: 600;
}
.kit-comp input {
  padding: 5px 8px; border: 1px solid var(--border-2); border-radius: 5px;
  font: inherit; font-size: 12px; width: 100%; background: var(--surface);
}
.kit-comp input:focus { outline: none; border-color: var(--accent); }
.kit-comp input.is-invalid { border-color: var(--danger); background: var(--danger-bg); color: var(--danger-fg); }
/* célula do código: input + metadados (cadastro/temperatura/aviso) empilhados */
.kit-comp-code { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kit-comp-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kit-comp-meta .disclose-ok,
.kit-comp-meta .disclose-warn { margin-left: 0; }
.kit-comp-meta .badge { font-size: 9.5px; padding: 0 5px; line-height: 1.5; }
.kit-acoes { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; align-items: center; }

/* Preview inline */
.line-preview {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 16px;
}
.line-preview-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.line-preview-head span { display: inline-flex; align-items: center; gap: 5px; }
.line-preview-stage {
  background: repeating-linear-gradient(45deg, #f8f7f5 0 8px, #f4f3f1 8px 16px);
  padding: 16px;
  border-radius: var(--radius);
  display: grid; place-items: center;
}

/* Line footer */
.line-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ============================================================
   FIELDS
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
}
.field-hint { font-size: 10px; color: var(--text-3); font-weight: 400; font-family: "IBM Plex Mono", monospace; }

.field input, .field textarea, .field select, .select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 13px;
  outline: 0;
  transition: border-color 120ms, box-shadow 120ms;
}
.field textarea { resize: vertical; font-family: inherit; min-height: 56px; line-height: 1.4; }
.field input:focus, .field textarea:focus, .field select:focus, .select:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--text) 8%, transparent);
}
.field.is-readonly input { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }

/* Validação pré-impressão: erro (bloqueia) em vermelho, alerta em âmbar */
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--danger); background: var(--danger-bg); }
.field.is-invalid input:focus { box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 20%, transparent); }
.field.is-warn input, .field.is-warn textarea { border-color: var(--warn); }
.field-msg { font-size: 11px; line-height: 1.3; }
.field-msg.is-error { color: var(--danger-fg); font-weight: 500; }
.field-msg.is-warn  { color: var(--warn-fg); }

.select {
  appearance: none;
  padding-right: 30px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding-top: 4px; font-size: 13px; }
/* 1px e ancorado no .switch: sem isso o input herdava width:100% e esticava a página (rolagem horizontal) */
.switch input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--text); outline-offset: 2px; }
.switch-track {
  width: 30px; height: 18px;
  background: var(--surface-3);
  border-radius: 100px;
  position: relative;
  transition: background 120ms;
  flex-shrink: 0;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 140ms;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(12px); }

/* Cópias control */
.copias-control { display: inline-flex; align-items: stretch; border: 1px solid var(--border-2); border-radius: var(--radius); overflow: hidden; width: 100%; }
.copias-control.sm { width: 100%; }
.stepper {
  background: var(--surface);
  border: 0;
  padding: 0 10px;
  color: var(--text-2);
  cursor: pointer;
  min-width: 32px;
  display: grid; place-items: center;
}
.stepper:hover { background: var(--surface-2); color: var(--text); }
.copias-input {
  flex: 1; border: 0;
  border-left: 1px solid var(--border-2);
  border-right: 1px solid var(--border-2);
  text-align: center;
  font-size: 14px;
  padding: 7px 4px;
  outline: 0;
  min-width: 0;
  -moz-appearance: textfield;
}
.copias-input::-webkit-outer-spin-button,
.copias-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background 100ms, border-color 100ms;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn.primary {
  background: var(--text);
  color: white;
  border-color: var(--text);
}
.btn.primary:hover:not(:disabled) { background: #000; }
.btn.lg { padding: 9px 18px; font-size: 13.5px; }

/* ============================================================
   BULK BAR
   ============================================================ */
.bulk-bar {
  position: fixed;
  bottom: 16px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  z-index: 40;
  pointer-events: none;
  transform: translateY(120px);
  opacity: 0;
  transition: transform 240ms cubic-bezier(.2,.8,.3,1), opacity 200ms;
}
.bulk-bar.is-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
.bulk-bar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 28px;
  background: var(--text);
  color: white;
  padding: 10px 12px 10px 20px;
  border-radius: 14px;
  box-shadow: var(--shadow-xl);
  max-width: 96vw;
}
.bulk-info { display: flex; flex-direction: column; gap: 2px; }
.bulk-count {
  font-size: 13px;
  color: rgba(255,255,255,0.95);
  display: inline-flex; align-items: center; gap: 6px;
}
.bulk-count strong { font-weight: 600; color: white; }
.bulk-count .dot { color: rgba(255,255,255,0.4); }
.bulk-warn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  color: oklch(0.85 0.12 80);
}

.bulk-actions { display: flex; gap: 8px; align-items: center; }
.bulk-bar .btn.ghost {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.15);
}
.bulk-bar .btn.ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.14);
  color: white;
  border-color: rgba(255,255,255,0.25);
}
.bulk-bar .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.bulk-bar .btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(12, 10, 9, 0.4);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  z-index: 60;
  animation: backdrop-in 180ms ease-out;
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 560px; max-width: 92vw;
  display: flex; flex-direction: column;
  animation: modal-in 220ms cubic-bezier(.2,.8,.3,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  font-size: 16px; font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
}
.modal-sub { font-size: 12px; color: var(--text-3); display: block; margin-top: 4px; max-width: 44ch; }
.modal-close {
  background: transparent; border: 0;
  padding: 4px; cursor: pointer;
  color: var(--text-3);
  border-radius: 4px;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 16px 20px; }

/* Modal de pendências pré-impressão */
.modal-pend { width: 640px; }
.pend-body { max-height: 56vh; overflow: auto; }
.pend-list, .pend-msgs { list-style: none; margin: 0; padding: 0; }
.pend-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.pend-item:first-child { padding-top: 0; }
.pend-item:last-child { border-bottom: 0; padding-bottom: 0; }
.pend-item-head { display: flex; align-items: center; gap: 8px; }
.pend-item-head .link-btn { margin-left: auto; }
.pend-msgs { margin-top: 6px; display: grid; gap: 3px; font-size: 12.5px; line-height: 1.35; }
.pend-msgs li { padding-left: 12px; position: relative; }
.pend-msgs li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pend-msgs .is-error { color: var(--danger-fg); font-weight: 500; }
.pend-msgs .is-warn  { color: var(--warn-fg); }
.btn.btn-risk { background: var(--warn-bg); border-color: var(--warn); color: var(--warn-fg); font-weight: 600; }
.btn.btn-risk:hover:not(:disabled) { border-color: var(--warn-fg); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 70;
  animation: toast-in 200ms ease-out;
  white-space: nowrap;
}
.toast-ok > svg { color: var(--accent); }
@keyframes toast-in {
  from { transform: translate(-50%, 10px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

/* ============================================================
   LABEL PREVIEW
   ============================================================ */
.label-frame {
  width: 100%;
  max-width: 460px;
  background: white;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 2px 4px rgba(0,0,0,0.06),
    0 12px 32px rgba(0,0,0,0.08);
}
.label-svg { display: block; width: 100%; height: auto; }

/* ============================================================
   LISTA — densidade, período, foco, saúde dos dados, impressora
   ============================================================ */
/* linhas de ~52 px: cliente em 2 linhas no máximo, resto truncado com reticências */
.inv-table { table-layout: fixed; }
.inv-table tbody td { padding-top: 8px; padding-bottom: 8px; }
.inv-table tbody tr { scroll-margin-top: 64px; scroll-margin-bottom: 12px; }
.inv-table tbody tr.is-focused td { background: var(--accent-bg); }
.inv-table tbody tr.is-focused td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.cell-trunc { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.doc-link { text-decoration: none; }
.doc-link:hover { border-color: var(--text-3); }
.pay-seal {
  margin-top: 3px; font-size: 10.5px; color: var(--warn-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.row-action { text-decoration: none; }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.td-empty p { margin: 0 0 10px; }

.lista-periodo {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--border);
}
.lista-periodo-rot { font-size: 11px; color: var(--text-3); margin-right: 2px; }
.lista-mais {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 12px; font-size: 12px; color: var(--text-3);
}
.link-btn:disabled { opacity: 0.75; cursor: progress; }
.lista-girando { animation: lista-giro 0.9s linear infinite; }
@keyframes lista-giro { to { transform: rotate(360deg); } }

/* idade da extração e avisos (dados velhos, fonte com erro, recarga falhou) */
.hstat-age { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.hstat-age.is-stale { color: var(--warn-fg); font-weight: 600; }
.lista-aviso {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--warn-bg); color: var(--warn-fg); font-size: 12.5px;
  border: 1px solid color-mix(in oklab, var(--warn) 35%, transparent);
}
.lista-aviso.is-erro {
  background: var(--danger-bg); color: var(--danger-fg);
  border-color: color-mix(in oklab, var(--danger) 35%, transparent);
}
.lista-aviso svg { flex-shrink: 0; }
.lista-erro { color: var(--text-2); }
.lista-erro > svg { color: var(--danger); }
.lista-erro p { margin: 0; max-width: 70ch; overflow-wrap: anywhere; }
.lista-erro-tit { font-size: 16px; font-weight: 600; color: var(--text); }

/* pílula da impressora: estado real da fila (verde pronta, âmbar offline/pausada) */
button.printer-pill { cursor: pointer; }
button.printer-pill:hover { border-color: var(--text-3); }
.printer-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.printer-pill.is-offline .printer-dot,
.printer-pill.is-pausada .printer-dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--warn) 25%, transparent);
}
.printer-pill.is-erro .printer-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 25%, transparent);
}
.printer-pill.is-desconhecido .printer-dot { background: var(--muted); box-shadow: none; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--text-3);
}

/* ============================================================
   EDITOR DE ETIQUETAS — barra de ações, avisos, busca por código,
   preview estável/ampliado e layout responsivo
   ============================================================ */
.ed-seletor { display: none; flex-direction: column; gap: 8px; }
.ed-seletor .select { width: 100%; }
.ed-item-nome { min-width: 0; overflow-wrap: anywhere; }
.ed-item-uso { flex: none; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 500;
  color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 100px; padding: 0 7px; }
.ed-sujo-dot, .ed-sujo { color: var(--warn-fg); }
.ed-sujo { font-size: 12px; font-weight: 500; }
.ed-vazio { padding: 8px 4px; }
.ed-produto { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--accent-border); background: var(--accent-bg);
  border-radius: 8px; font-size: 12.5px; }

/* Salvar sempre visível: gruda logo abaixo da topbar (56 px) */
.ed-barra { position: sticky; top: 56px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 12px; padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.ed-barra-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ed-barra-nome { font-size: 14px; overflow-wrap: anywhere; }
.ed-barra-acoes { display: flex; gap: 8px; margin-left: auto; }
.ed-barra > .field-msg { flex-basis: 100%; }

.ed-aviso { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; margin: 8px 0 0;
  padding: 7px 10px; border-radius: 6px; font-size: 12px; line-height: 1.35; }
.ed-aviso.is-warn  { background: var(--warn-bg); color: var(--warn-fg); }
.ed-aviso.is-error { background: var(--danger-bg); color: var(--danger-fg); font-weight: 500; }
.ed-aviso .link-btn { padding: 0; color: inherit; text-decoration: underline; }
.ed-blk-aviso { display: flex; align-items: center; gap: 5px; padding: 0 10px 4px;
  font-size: 11.5px; color: var(--warn-fg); }
.ed-blk-aviso.is-error { color: var(--danger-fg); font-weight: 500; }
.ed-size label.is-invalid input, .ed-fixo.is-invalid input { border-color: var(--danger); background: var(--danger-bg); }
.ed-bio { border-color: var(--warn); }
.ed-bio-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.ed-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap; margin-bottom: 8px; }
.ed-exemplo { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.ed-exemplo .select { padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.ed-preview-box.has-img { cursor: zoom-in; }
.ed-preview-box:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
/* a imagem anterior fica na tela; só este selo indica a atualização */
.ed-prev-atualizando { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 100px;
  background: var(--text); color: #fff; font-size: 11px; opacity: .85; }

.ed-zoom { width: auto; max-width: 96vw; }
.ed-zoom-body { max-height: 72vh; overflow: auto; display: flex; justify-content: center; }
.ed-zoom-body img { display: block; max-width: none; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.ed-confirm-reg { margin-top: 10px; font-size: 13px; }
.ed-confirm-reg ul { margin: 6px 0 0; padding-left: 20px; }
.ed-diff { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12.5px; }
.ed-diff th, .ed-diff td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border);
  vertical-align: top; overflow-wrap: anywhere; }
.ed-diff th { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; }
.ed-diff del { color: var(--danger-fg); }

/* 900–1199 px: formulário | preview fixo; a lista vira o seletor com busca no topo */
@media (max-width: 1199px) {
  .editor2-grid { grid-template-columns: minmax(0, 1fr) 380px; }
  .ed-lista { display: none; }
  .ed-seletor { display: flex; }
}
/* < 900 px: 1 coluna, preview ANTES do formulário */
@media (max-width: 899px) {
  .editor2-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-preview { position: static; order: -1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .inv-header { flex-direction: column; }
  .inv-stats { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; width: 100%; justify-content: space-between; }
  .line-body { grid-template-columns: 1fr; }
  .line-head { grid-template-columns: auto 1fr auto; }
  .line-quick { display: none; }
}
