:root {
  --bg-base: #060608;
  --bg-surface: #11151c;
  --bg-surface-2: #181d27;
  --border: #252c3a;
  --border-soft: #151a24;
  --text: #f1f4f9;
  --text-muted: #8d97a8;
  --text-dim: #5d6779;
  --accent: #1f7bf0;
  --accent-soft: rgba(31, 123, 240, 0.16);
  --teal: #3fd9c7;
  --teal-soft: rgba(63, 217, 199, 0.12);
  --danger: #e8604c;
  --danger-soft: rgba(232, 96, 76, 0.14);
  --warn: #f2c14e;
  --warn-soft: rgba(242, 193, 78, 0.14);
  --radius: 10px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Fundo: linhas de camada, como uma impressão vista de lado */
.layers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(31, 123, 240, 0.04) 0px,
    rgba(31, 123, 240, 0.04) 1px,
    transparent 1px,
    transparent 7px
  );
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar, .main { min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--bg-base);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: block; margin: -6px -6px 22px; }
.brand-logo { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto; }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-index { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.nav-item:hover { background: var(--bg-surface-2); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-item.is-active .nav-index { color: var(--accent); }
.nav-item:focus-visible, .btn:focus-visible, .btn-icon:focus-visible, .foot-version:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--accent);
  color: #1a0f08;
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 700;
}
.nav-badge.warn { background: var(--warn); }

.sidebar-foot { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.foot-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.foot-value { font-family: var(--font-mono); font-size: 13px; color: var(--teal); margin-top: 4px; }
.foot-value.busy { color: var(--accent); }
.foot-version {
  margin-top: 14px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.foot-version:hover { color: var(--text); border-color: var(--text-dim); }

/* ---------- Main ---------- */
.main { padding: 40px 48px; max-width: 1180px; width: 100%; }
.view { display: none; }
.view.is-active { display: block; }

.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.view-head h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.subtitle { color: var(--text-muted); font-size: 13.5px; margin: 0; max-width: 520px; line-height: 1.5; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

h2.section-title {
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--teal);
  margin: 30px 0 12px;
  font-weight: 500;
}

/* ---------- Botões ---------- */
.btn {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:disabled { opacity: 0.55; cursor: wait; }
a.btn { text-decoration: none; display: inline-block; }
.aviso-config { background: var(--warn-soft); border: 1px solid rgba(242,193,78,0.35); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; font-size: 13.5px; color: var(--text); line-height: 1.55; }
.aviso-config strong { color: var(--warn); }
.aviso-config button { margin-left: 8px; }
.btn-primary { background: var(--accent); color: #1a0f08; }
.btn-primary:hover:not(:disabled) { background: #3b8ef5; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-sm { font-size: 12px; padding: 6px 11px; }
.btn-ok { background: var(--teal-soft); color: var(--teal); border-color: rgba(63,217,199,0.3); }
.btn-ok:hover { background: rgba(63,217,199,0.2); }
.btn-bad { background: var(--danger-soft); color: var(--danger); border-color: rgba(232,96,76,0.3); }
.btn-bad:hover { background: rgba(232,96,76,0.24); }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
}
.btn-icon:hover { color: var(--text); border-color: var(--text-dim); }
.btn-icon.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Tabelas ---------- */
.table-wrap { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); font-weight: 600; padding: 13px 16px; border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.tbl tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); font-size: 14px; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clicavel { cursor: pointer; transition: background 0.12s ease; }
.tbl tbody tr.clicavel:hover { background: var(--bg-surface-2); }
.tbl .num { text-align: right; }
.tbl th.num { text-align: right; }
.tbl tfoot td { padding: 13px 16px; font-size: 13px; font-weight: 600; border-top: 1px solid var(--border); background: var(--bg-surface-2); }

.nome { font-weight: 600; color: var(--text); }
.nome small { display: block; font-weight: 400; color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.mono { font-family: var(--font-mono); color: var(--text-muted); font-size: 13px; }
.preco { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: 14.5px; }
.lucro { font-family: var(--font-mono); color: var(--teal); font-size: 13.5px; }
.lucro.neg { color: var(--danger); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-icon { font-size: 28px; color: var(--text-dim); display: block; margin-bottom: 12px; }
.empty-state p { margin: 4px 0; font-size: 14px; }
.empty-sub { font-size: 12.5px; color: var(--text-dim); }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 10px; background: var(--bg-surface-2); color: var(--text-muted); }
.badge.ok { background: var(--teal-soft); color: var(--teal); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; background: var(--text-dim); vertical-align: middle; border: 1px solid rgba(255,255,255,0.28); flex: none; }

/* Seletor de cor das bobinas */
.paleta { display: flex; flex-wrap: wrap; gap: 9px; padding: 2px 0; }
.cor-opt {
  position: relative; width: 28px; height: 28px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--c); border: 2px solid rgba(255,255,255,0.22); transition: transform 0.1s ease;
  display: inline-block; overflow: hidden;
}
.cor-opt:hover { transform: scale(1.12); }
.cor-opt[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--bg-surface); }
.cor-opt:focus-visible, .cor-opt.custom:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.cor-opt.custom { background: var(--c, conic-gradient(#ff3b30, #ffcc00, #34c759, #00c7be, #0a84ff, #bf5af2, #ff3b30)); }
.cor-opt.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; border: 0; cursor: pointer; }

/* ---------- Painel ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px 20px; }
.kpi-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); }
.kpi-value { font-family: var(--font-mono); font-size: 24px; font-weight: 700; margin-top: 8px; }
.kpi-value.teal { color: var(--teal); }
.kpi-value.accent { color: var(--accent); }
.kpi-value.danger { color: var(--danger); }
.kpi-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.4; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.card { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin: 0 0 10px; font-weight: 500; }
.card .big { font-family: var(--font-mono); font-size: 20px; font-weight: 700; }
.card p { margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.card ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.card li { padding: 4px 0; color: var(--text-muted); display: flex; justify-content: space-between; gap: 10px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 150px; padding: 8px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar { width: 100%; max-width: 54px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; }
.bar.neg { background: var(--danger); }
.bar-val { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.bar-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }
.bar-col.atual .bar-label { color: var(--accent); font-weight: 700; }

/* ---------- Fila ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.col { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px; min-height: 140px; }
.col-title { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 2px 2px 12px; }
.job { background: var(--bg-surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.job.imprimindo { border-color: rgba(31,123,240,0.6); }
.job-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.job-nome { font-weight: 600; font-size: 14px; }
.job-qtd { font-family: var(--font-mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
.job-meta { font-size: 12px; color: var(--text-muted); margin: 8px 0 10px; line-height: 1.6; }
.job-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.col-empty { font-size: 12.5px; color: var(--text-dim); text-align: center; padding: 18px 6px; }

/* ---------- Filamentos ---------- */
.meter { height: 6px; background: var(--bg-base); border-radius: 4px; overflow: hidden; min-width: 90px; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.meter.low > span { background: var(--warn); }
.meter.empty > span { background: var(--danger); }

/* ---------- Parâmetros ---------- */
.config-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.config-card { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; margin: 0; min-width: 0; }
.config-card legend { font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal); padding: 0 0 4px; float: left; width: 100%; }
.config-card legend + * { clear: both; }
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.note { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin: 0 0 14px; max-width: 640px; }

label, .campo { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.campo small { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }
.campo.check { flex-direction: row; align-items: center; gap: 8px; }
.campo.check input { width: 16px; height: 16px; accent-color: var(--accent); }

input, select, textarea {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}
select { font-family: var(--font-body); }
textarea { font-family: var(--font-body); resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="month"], input[type="date"] { color-scheme: dark; }
.mes-input { width: auto; }

/* ---------- Modal ---------- */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(10, 8, 6, 0.74); z-index: 10; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.modal-backdrop.is-visible { display: flex; }
.modal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 520px; padding: 24px; max-height: 92vh; overflow-y: auto; }
.modal.estreito { max-width: 420px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.modal-head h2 { font-family: var(--font-display); font-size: 18px; margin: 0; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-form .campo.inteira { grid-column: 1 / -1; }
.form-preview { grid-column: 1 / -1; background: var(--bg-base); border: 1px dashed var(--border); border-radius: 8px; padding: 12px 14px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.form-preview:empty { display: none; }
.form-preview strong { color: var(--teal); font-family: var(--font-mono); }
.form-preview .aviso { color: var(--warn); }
.form-erro { grid-column: 1 / -1; color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.form-erro:empty { display: none; }
.modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.breakdown { display: flex; flex-direction: column; gap: 2px; }
.breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; gap: 12px; }
.breakdown-row .label { color: var(--text-muted); }
.breakdown-row .value { font-family: var(--font-mono); }
.breakdown-row.total { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); border-bottom: none; font-size: 15px; font-weight: 700; }
.breakdown-row.total .value { color: var(--accent); font-size: 16px; }
.breakdown-row.lucro .value { color: var(--teal); }
.breakdown-sub { font-family: var(--font-display); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--teal); margin: 18px 0 4px; }

/* ---------- Versões ---------- */
.versao { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; }
.versao.atual { border-color: rgba(31,123,240,0.55); }
.versao-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.versao-num { font-family: var(--font-mono); font-weight: 700; font-size: 18px; color: var(--accent); }
.versao-titulo { font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.versao-data { font-size: 12px; color: var(--text-dim); margin-left: auto; }
.versao ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-muted); line-height: 1.65; }
.versao li { margin-bottom: 4px; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 30; max-width: 380px; }
.toast { background: var(--bg-surface-2); border: 1px solid var(--border); border-left: 3px solid var(--teal); border-radius: 8px; padding: 12px 16px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); animation: entra 0.18s ease; }
.toast.erro { border-left-color: var(--danger); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

.carregando { color: var(--text-dim); padding: 40px 0; font-size: 14px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cards, .config-grid, .kanban, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: column; align-items: stretch; padding: 14px 16px; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .brand { margin-bottom: 8px; }
  .brand-logo { max-width: 120px; margin: 0; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .nav-item { white-space: nowrap; padding: 8px 10px; }
  .nav-index { display: none; }
  .sidebar-foot { display: none; }
  .main { padding: 24px 16px; }
  .kpis { grid-template-columns: 1fr; }
  .modal-form { grid-template-columns: 1fr; }
  .view-head { flex-direction: column; align-items: flex-start; }
}

/* Impressoras */
.imp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.imp-card.inativa { opacity: 0.6; }
.imp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.imp-nome { font-family: var(--font-display); font-size: 17px; margin: 0; }
.imp-modelo { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.imp-card .imp-agora { margin: 12px 0 4px; }
.imp-dados { border-top: 1px solid var(--border-soft); margin-top: 10px !important; padding-top: 6px !important; }
.imp-uso { font-size: 11.5px; color: var(--text-dim); margin: 6px 0 12px; }
.imp-card .row-actions { justify-content: flex-end; }
.barra { height: 5px; border-radius: 3px; background: var(--bg-surface-2); overflow: hidden; margin-top: 12px; }
.barra > span { display: block; height: 100%; background: var(--accent); }
.imp-grid + .note { margin-top: 16px; }

/* Estoque de filamento no painel */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.estoque-resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.estoque-num { display: block; font-family: var(--font-mono); font-size: 18px; font-weight: 700; }
.estoque-lbl { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.estoque-lista { list-style: none; margin: 10px 0 0; padding: 0; }
.estoque-lista li { display: grid; grid-template-columns: minmax(150px, 1.1fr) 2fr 70px; gap: 14px; align-items: center; padding: 8px 0; }
.estoque-nome { font-size: 13.5px; color: var(--text); display: block; }
.estoque-nome small { display: block; font-size: 11.5px; color: var(--text-dim); margin: 1px 0 0 18px; }
.estoque-g { text-align: right; font-size: 13px; color: var(--text-muted); }
.estoque-lista .barra { margin: 0; }
.barra > span.baixo { background: var(--warn); }
.aviso-baixo { color: var(--warn); font-weight: 600; }
@media (max-width: 780px) {
  .estoque-resumo { grid-template-columns: 1fr; }
  .estoque-lista li { grid-template-columns: 1fr 64px; }
  .estoque-lista .barra { grid-column: 1 / -1; order: 3; }
}

/* Barras de estoque com a cor da bobina: contorno claro para cores escuras não sumirem no fundo */
.estoque-lista .barra > span, .meter > span { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
.estoque-lista .barra { height: 8px; }

/* Lista de estoque no painel: 6 linhas visíveis, o resto rola */
.estoque-lista { --linha: 52px; max-height: calc(var(--linha) * 6); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.estoque-lista li { min-height: var(--linha); padding: 0; box-sizing: border-box; }
.estoque-lista::-webkit-scrollbar { width: 8px; }
.estoque-lista::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.estoque-lista::-webkit-scrollbar-track { background: transparent; }
.estoque-mais { font-size: 11.5px; color: var(--text-dim); margin: 8px 0 0; }

.sub-title { font-family: var(--font-display); font-size: 14px; margin: 22px 0 6px; color: var(--text); }
.vazio-linha { color: var(--text-dim); font-size: 13px; padding: 16px; }
label.btn { cursor: pointer; }

/* Cópia na nuvem */
.nuvem-box { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.nuvem-atual { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-dim); }
.nuvem-atual strong { font-size: 13px; color: var(--text); font-weight: 500; word-break: break-all; }
.nuvem-status { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.nuvem-status.bom { color: var(--teal); }
.nuvem-status.ruim { color: var(--warn); }
.nuvem-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.nuvem-sug .btn { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; }
.nuvem-sug .btn small { font-size: 10.5px; color: var(--text-dim); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nuvem-manual { display: flex; flex-wrap: wrap; gap: 8px; }
.nuvem-manual input { flex: 1 1 280px; min-width: 0; background: var(--bg-base); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 13px; }
.nuvem-manual input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.danger { color: var(--danger); }

/* Logotipo: bordas esmaecidas para se fundir ao fundo da barra lateral */
.brand-logo { -webkit-mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 82%, transparent 100%); mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 82%, transparent 100%); }

/* Login e usuário (modo servidor) */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 380px; background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 28px 28px 26px; }
.login-logo { display: block; width: 100%; max-width: 240px; height: auto; margin: -6px auto 14px; -webkit-mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 82%, transparent 100%); mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 82%, transparent 100%); }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .campo input { width: 100%; }
.login-erro { margin: 0; font-size: 13px; color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 9px 12px; }
.login-btn { width: 100%; justify-content: center; padding: 11px 14px; }
.user-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 18px 0 16px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-muted); }
.user-box .user-nome { flex: 1 0 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box strong { color: var(--text); font-weight: 600; }
@media (max-width: 780px) {
  .user-box { margin: 4px 0 8px; padding-top: 8px; border-top: none; }
  .user-box .user-nome { flex: 1 1 auto; }
}

/* clientes (v3.2.0) */
.tbl .nome a { color: var(--text); font-weight: 600; text-decoration: none; }
.tbl .nome a:hover, .tbl .nome a:focus-visible { color: var(--accent); text-decoration: underline; }
.cliente-det { display: block; }
.cliente-det p { margin: 0 0 10px; color: var(--text-muted); }
.cliente-det .table-wrap { margin-top: 14px; max-height: 260px; overflow: auto; }
.cliente-det .modal-actions { margin-top: 16px; }
