/* ============================================================
   SISTEMA UXI — CADASTRO E GESTAO DE PRODUTOS
   style.css  |  Design System IRA v1
   ============================================================ */

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: 0; background: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* ── VARIAVEIS — paleta IRA oficial ───────────────────────── */
:root {
  --ira-navy:        #1B2E45;
  --ira-steel:       #2A4A6B;
  --ira-blue-mid:    #3D6B99;
  --ira-blue-light:  #7AADD4;
  --ira-navy-deep:   #243D58;

  --bg-primary:      #F5F7FA;
  --bg-section:      #1B2E45;
  --bg-hero:         #B8CDD8;
  --bg-card:         #FFFFFF;
  --bg-header:       #FFFFFF;

  --gray-dark:       #2D3748;
  --gray-mid:        #718096;
  --gray-light:      #E2E8F0;
  --gray-soft:       #F1F4F8;
  --white:           #FFFFFF;

  --accent-dark:     #1A2535;
  --accent-success:  #2F855A;
  --accent-warning:  #C05621;
  --accent-danger:   #9B2C2C;

  --font-display: "Barlow Condensed", "Oswald", -apple-system, sans-serif;
  --font-body:    "IBM Plex Sans", "Source Sans 3", -apple-system, sans-serif;

  --header-height: 64px;
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(27, 46, 69, 0.06);
  --shadow-md: 0 2px 8px rgba(27, 46, 69, 0.08);
  --shadow-lg: 0 8px 24px rgba(27, 46, 69, 0.12);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── BODY + TIPOGRAFIA ───────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--gray-dark);
  background: var(--bg-primary);
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--ira-navy);
  text-transform: uppercase;
}

/* ── HEADER ──────────────────────────────────────────────── */
.app-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 2px solid var(--ira-navy);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--ira-navy);
  text-transform: uppercase;
}
.brand .logo span { color: var(--ira-blue-mid); }
.brand .tagline {
  font-size: 12px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.header-spacer { flex: 1; }
.header-stat {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--gray-mid);
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-stat strong {
  font-size: 18px;
  color: var(--ira-navy);
}
.modo-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius);
  margin-right: 16px;
  white-space: nowrap;
  cursor: default;
}
.modo-badge.modo-local { background: var(--gray-light); color: var(--gray-dark); }
.modo-badge.modo-nuvem { background: var(--accent-success); color: var(--white); }
.modo-badge.modo-teste { background: var(--accent-warning); color: var(--white); }

/* área de usuário logado no header */
.header-user { display: flex; align-items: center; gap: 10px; margin-right: 16px; }
.user-email { font-size: 13px; color: var(--gray-mid); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── TELA DE LOGIN ───────────────────────────────────────── */
.login-gate {
  position: fixed;
  inset: 0;
  background: var(--ira-navy);
  background-image:
    linear-gradient(135deg, var(--ira-navy-deep) 25%, transparent 25%),
    linear-gradient(225deg, var(--ira-navy-deep) 25%, transparent 25%),
    linear-gradient(315deg, var(--ira-navy-deep) 25%, transparent 25%),
    linear-gradient(45deg,  var(--ira-navy-deep) 25%, transparent 25%);
  background-size: 40px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  border-top: 4px solid var(--ira-navy);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
}
.login-card .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: 0.04em;
  color: var(--ira-navy);
  text-transform: uppercase;
  display: block;
  text-align: center;
}
.login-card .logo span { color: var(--ira-blue-mid); }
.login-card h2 { text-align: center; font-size: 22px; margin-top: 14px; }
.login-sub { text-align: center; color: var(--gray-mid); font-size: 13px; margin-bottom: 22px; }
.login-erro {
  background: #FDECEC;
  border: 1px solid #F5C2C2;
  color: var(--accent-danger);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}
.login-debug {
  margin-top: 14px;
  font-size: 11px;
  color: var(--gray-mid);
  text-align: center;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* ── NAVEGAÇÃO ENTRE TELAS ───────────────────────────────── */
.main-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--gray-light);
  flex-wrap: wrap;
}
.nav-btn {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-mid);
  padding: 10px 20px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}
.nav-btn:hover { color: var(--ira-navy); }
.nav-btn.active { color: var(--ira-navy); border-bottom-color: var(--ira-navy); }

/* ── BARRA DE FERRAMENTAS ────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}
.toolbar .search {
  flex: 1 1 280px;
  position: relative;
}
.toolbar .search input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.toolbar .search input:focus {
  outline: 0;
  border-color: var(--ira-blue-mid);
  box-shadow: 0 0 0 3px rgba(61, 107, 153, 0.15);
}
.toolbar .search::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
}
.toolbar select {
  padding: 10px 12px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-dark);
  min-width: 130px;
}
.toolbar select:focus { outline: 0; border-color: var(--ira-blue-mid); }

/* menu de exportação (escolher CSV/Excel após clicar) */
.export-wrap, .more-wrap { position: relative; }
.export-menu, .more-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  padding: 4px;
}
.export-menu button, .more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-dark);
  white-space: nowrap;
}
.export-menu button:hover, .more-menu button:hover { background: var(--gray-soft); color: var(--ira-navy); }

/* ── BOTOES ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ira-navy); color: var(--white); }
.btn-primary:hover { background: var(--ira-steel); }
.btn-ghost {
  background: var(--white);
  color: var(--ira-navy);
  border: 1px solid var(--gray-light);
}
.btn-ghost:hover { border-color: var(--ira-blue-mid); color: var(--ira-blue-mid); }
.btn-danger { background: var(--accent-danger); color: var(--white); }
.btn-danger:hover { opacity: 0.88; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── TABELA ──────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  overflow-x: auto;            /* rola na horizontal no celular, sem cortar conteudo */
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--ira-navy);
  color: var(--white);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
}
tbody td {
  padding: 11px 16px;
  border-top: 1px solid var(--gray-light);
  vertical-align: top;
}
/* cabeçalhos ordenáveis */
th.th-sort { cursor: pointer; user-select: none; }
th.th-sort::after { content: " ⇅"; opacity: 0.4; font-size: 11px; }
th.th-sort:hover::after { opacity: 0.75; }
th.th-sort.sort-asc::after { content: " ▲"; opacity: 1; }
th.th-sort.sort-desc::after { content: " ▼"; opacity: 1; }
th.th-sort:hover { background: var(--ira-steel); }
tbody tr:hover { background: var(--gray-soft); }
td.col-sku { font-weight: 600; color: var(--ira-navy); font-variant-numeric: tabular-nums; }
td.col-desc { color: var(--gray-dark); max-width: 420px; }
td.col-acoes { white-space: nowrap; text-align: right; }
.col-acoes .btn { margin-left: 6px; }

/* ── BADGES (grupo / marca) ──────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-grupo { background: var(--ira-navy); color: var(--white); }
.badge-grupo.is-camara { background: var(--ira-blue-mid); }
.badge-marca { background: var(--gray-light); color: var(--ira-navy); }
.badge-inativo { background: var(--gray-mid); color: var(--white); }

/* colunas comerciais */
td.col-custo, th.col-custo { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--gray-mid); }
td.col-preco, th.col-preco { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.col-estoque, th.col-estoque { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.col-estoque.estoque-baixo { color: var(--accent-danger); font-weight: 600; }
tr.is-inativo td { opacity: 0.55; }
tr.is-inativo:hover td { opacity: 0.8; }

/* ── ESTADO VAZIO ────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--gray-mid);
}
.empty h3 { color: var(--gray-mid); margin-bottom: 8px; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 46, 69, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--ira-navy);
}
.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h2 { font-size: 22px; }
.modal-close { font-size: 22px; color: var(--gray-mid); line-height: 1; }
.modal-close:hover { color: var(--accent-danger); }
.modal-body { padding: 22px 24px; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--gray-soft);
}

/* ── FORMULARIO ──────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ira-steel);
  margin-bottom: 6px;
  font-weight: 600;
}
.field label .req { color: var(--accent-danger); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0;
  border-color: var(--ira-blue-mid);
  box-shadow: 0 0 0 3px rgba(61, 107, 153, 0.15);
}
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: 12px; color: var(--gray-mid); margin-top: 4px; }
.hint-inline { font-size: 11px; color: var(--gray-mid); font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-section {
  font-size: 14px;
  margin: 22px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-light);
  color: var(--ira-steel);
}
.field input.invalid, .field select.invalid { border-color: var(--accent-danger); }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

/* ── IMPORTACAO DE PLANILHA ──────────────────────────────── */
#modalImport .modal { max-width: 620px; }
.import-info {
  background: var(--gray-soft);
  border-left: 3px solid var(--ira-blue-mid);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  color: var(--gray-dark);
}
.import-info strong { color: var(--ira-navy); }
.import-subtitle {
  font-size: 15px;
  margin: 20px 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-light);
}
.map-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.map-row .map-label {
  flex: 0 0 130px;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ira-steel);
  font-weight: 600;
}
.map-row .map-label .req { color: var(--accent-danger); }
.map-row select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  background: var(--white);
}
.map-row select:focus { outline: 0; border-color: var(--ira-blue-mid); }
.import-modes { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 9px 12px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}
.radio:hover { border-color: var(--ira-blue-light); }
.radio input { accent-color: var(--ira-navy); }
.radio .hint { color: var(--gray-mid); font-size: 13px; }
/* modelo / template */
.tpl-table-wrap { overflow-x: auto; border: 1px solid var(--gray-light); border-radius: var(--radius); margin-bottom: 14px; }
.tpl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tpl-table th {
  background: var(--ira-navy); color: var(--white);
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 12px; font-weight: 600; text-align: left; padding: 8px 12px; white-space: nowrap;
}
.tpl-table th .req { color: #FF9AA2; }
.tpl-table td { padding: 7px 12px; border-top: 1px solid var(--gray-light); color: var(--gray-dark); white-space: nowrap; }
.tpl-table tbody tr:nth-child(even) { background: var(--gray-soft); }
.tpl-rules { margin: 4px 0 18px; padding-left: 18px; list-style: disc; color: var(--gray-dark); font-size: 14px; }
.tpl-rules li { margin-bottom: 5px; }
.tpl-rules code {
  background: var(--gray-soft); border: 1px solid var(--gray-light);
  border-radius: 3px; padding: 1px 5px; font-size: 12px; color: var(--ira-steel);
}
.tpl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.import-preview {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ira-navy);
  font-weight: 500;
  min-height: 20px;
}
.import-preview.error { color: var(--accent-danger); }
.import-preview p { margin: 0 0 4px; }
.import-avisos {
  list-style: none;
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: var(--radius);
}
.import-avisos li { color: var(--accent-warning); font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.import-avisos li:last-child { margin-bottom: 0; }
.imp-amostra-tit { margin: 14px 0 4px; font-weight: 600; font-size: 13px; color: var(--ira-navy); }
.imp-amostra { width: 100%; border-collapse: collapse; font-size: 13px; }
.imp-amostra th, .imp-amostra td { text-align: left; padding: 4px 8px; border-bottom: 1px solid #E2E8F0; white-space: nowrap; }
.imp-amostra th { font-weight: 600; color: var(--ira-navy); }
.imp-amostra td.imp-flag { background: #FFF7ED; color: var(--accent-warning); font-weight: 600; }
.imp-amostra .imp-raw { color: #94A3B8; font-weight: 400; font-size: 12px; }
.venda-cancelada td { color: #94A3B8; }
.badge-cancelada { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--accent-danger); background: #FDECEC; border: 1px solid #F5C6C6; border-radius: 4px; padding: 1px 6px; vertical-align: middle; }
/* Vendas: o total é o número-chave da linha — ganha peso e a cor da marca (hierarquia escaneável) */
td.venda-total { font-weight: 600; color: var(--ira-navy); }
.venda-cancelada td.venda-total { color: #94A3B8; font-weight: 400; }
/* Vendas: coluna do vendedor trunca e-mails longos sem estourar a largura (título no hover mostra o todo) */
.col-vendedor { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Cancelar uma venda é destrutivo: o hover deixa isso claro, sem poluir a lista de vermelho */
.btn-cancelar:hover { border-color: var(--accent-danger); color: var(--accent-danger); }

/* ── AÇÕES EM LOTE (Produtos) ────────────────────────────── */
.col-check { width: 1%; white-space: nowrap; text-align: center; }
.col-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--ira-navy); vertical-align: middle; }
thead th.col-check input { accent-color: var(--ira-blue-light); }   /* visível sobre o cabeçalho navy */
thead th.col-check { text-align: center; }
tbody tr.linha-sel { background: #EAF1F8; }       /* azul muito claro: linha marcada */
tbody tr.linha-sel:hover { background: #E1EBF5; }
.bulk-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  background: var(--gray-soft); border: 1px solid var(--gray-light); border-radius: var(--radius);
  padding: 8px 14px; margin-bottom: 10px;
}
.bulk-count { font-family: var(--font-display); font-weight: 600; letter-spacing: .03em; color: var(--ira-navy); }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── MOVIMENTAÇÃO DE ESTOQUE ─────────────────────────────── */
.mov-produto {
  background: var(--gray-soft);
  border-left: 3px solid var(--ira-blue-mid);
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 14px;
}
.mov-produto .mov-saldo { display: block; margin-top: 4px; color: var(--gray-mid); font-size: 13px; }
.mov-tipos { display: flex; flex-wrap: wrap; gap: 10px; }
.mov-tipos .radio { flex: 1 1 30%; }

/* ── HISTÓRICO ───────────────────────────────────────────── */
.modal-lg { max-width: 860px; }
.hist-table-wrap { overflow-x: auto; border: 1px solid var(--gray-light); border-radius: var(--radius); margin-top: 8px; }
.hist-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hist-table th {
  background: var(--ira-navy); color: var(--white);
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 12px; font-weight: 600; text-align: left; padding: 9px 12px; white-space: nowrap;
}
.hist-table td { padding: 9px 12px; border-top: 1px solid var(--gray-light); vertical-align: top; }
.hist-table tbody tr:hover { background: var(--gray-soft); }
.hist-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hist-num.pos { color: var(--accent-success); font-weight: 600; }
.hist-num.neg { color: var(--accent-danger); font-weight: 600; }
.hist-sub { color: var(--gray-mid); font-size: 12px; }
.hist-vazio { text-align: center; color: var(--gray-mid); padding: 28px; }
.mov-badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--white);
}
.mov-badge.mov-entrada { background: var(--accent-success); }
.mov-badge.mov-saida   { background: var(--accent-danger); }
.mov-badge.mov-ajuste  { background: var(--ira-blue-mid); }

/* ── VENDA (itens + totais) ──────────────────────────────── */
.venda-itens-head, .venda-item {
  display: grid;
  grid-template-columns: 2.4fr 0.8fr 1fr 0.8fr 1fr 30px;
  gap: 8px;
  align-items: center;
}
.venda-itens-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--gray-mid); font-weight: 600; padding: 0 2px 6px;
}
.venda-item { margin-bottom: 6px; }
.venda-item input {
  width: 100%; padding: 7px 8px;
  border: 1px solid var(--gray-light); border-radius: var(--radius); background: var(--white);
}
.venda-item input:focus { outline: 0; border-color: var(--ira-blue-mid); }
.vi-total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ira-navy); }
.vi-remover { color: var(--accent-danger); font-size: 20px; line-height: 1; text-align: center; }
.venda-totais {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; margin-top: 18px; flex-wrap: wrap;
}
.venda-totais .field { flex: 1 1 200px; margin-bottom: 0; }
.venda-resumo { text-align: right; font-size: 15px; color: var(--gray-dark); }
.venda-total-final { font-size: 20px; color: var(--ira-navy); margin-top: 4px; }
.venda-aviso {
  font-size: 13px; color: var(--accent-warning);
  background: #FFF7ED; border: 1px solid #FED7AA; border-radius: var(--radius);
  padding: 8px 12px; margin-top: 14px;
}
.vv-itens { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.vv-itens th, .vv-itens td { padding: 7px 10px; border-bottom: 1px solid var(--gray-light); text-align: left; }
.vv-itens td.num, .vv-itens th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── FINANCEIRO (cards resumo) ───────────────────────────── */
.fin-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.fin-card {
  flex: 1 1 150px;
  background: var(--bg-card);
  border: 1px solid var(--gray-light);
  border-top: 3px solid var(--gray-mid);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.fin-card span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-mid); }
.fin-card strong { font-size: 19px; font-variant-numeric: tabular-nums; color: var(--ira-navy); }
.fin-receber  { border-top-color: var(--accent-success); }
.fin-recebido { border-top-color: var(--accent-success); }
.fin-pagar    { border-top-color: var(--accent-danger); }
.fin-pago     { border-top-color: var(--accent-danger); }
.fin-saldo    { border-top-color: var(--ira-navy); }
/* coluna valor financeiro */
td.fin-valor-pos { color: var(--accent-success); font-weight: 600; }
td.fin-valor-neg { color: var(--accent-danger); font-weight: 600; }
.fin-status-pago { color: var(--accent-success); font-weight: 600; font-size: 13px; }
.fin-status-pend { color: var(--accent-warning); font-size: 13px; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ira-navy);
  color: var(--white);
  padding: 12px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  z-index: 200;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--accent-success); }
.toast.error { background: var(--accent-danger); }

/* ── RODAPE INFO ─────────────────────────────────────────── */
.result-info {
  font-size: 13px;
  color: var(--gray-mid);
  margin: 14px 2px 0;
}

/* ── ACESSIBILIDADE ──────────────────────────────────────── */
/* foco visivel e consistente para navegacao por teclado */
:focus-visible {
  outline: 2px solid var(--ira-blue-mid);
  outline-offset: 2px;
}
.btn:focus-visible { outline-offset: 3px; }
/* esconde visualmente mas mantem para leitores de tela */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── RESPONSIVO ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .app-header { padding: 0 14px; }
  .brand .tagline { display: none; }
  .header-stat { display: none; }
  .toolbar .search { flex-basis: 100%; }
  .toolbar .btn { flex: 1 1 auto; justify-content: center; }

  /* PRODUTOS no celular: a tabela vira CARTÕES (nada é escondido; tudo fica legível,
     inclusive a descrição/medida do pneu). Cada linha é um cartão com SKU no topo e
     rótulos por campo; Preço e Estoque ganham destaque. */
  #view-produtos .table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  #view-produtos table, #view-produtos tbody, #view-produtos tr, #view-produtos td { display: block; width: auto; }
  #view-produtos thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  #view-produtos tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 10px 14px;
    margin-bottom: 10px;
  }
  #view-produtos tbody tr:hover { background: var(--bg-card); }
  #view-produtos tbody td {
    border: 0; padding: 4px 0; text-align: right;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
  }
  #view-produtos tbody td::before {
    content: attr(data-label);
    font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em;
    font-size: 12px; color: var(--ira-steel); text-align: left;
  }
  #view-produtos td.col-sku {
    display: block; text-align: left;
    font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ira-navy);
    border-bottom: 1px solid var(--gray-light); padding: 0 0 8px; margin-bottom: 4px;
  }
  #view-produtos td.col-sku::before { content: ""; }
  #view-produtos td.col-preco, #view-produtos td.col-estoque { font-weight: 600; }
  #view-produtos td.col-acoes { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  #view-produtos td.col-acoes::before { content: ""; }
  #view-produtos td.col-acoes .btn { flex: 1 1 auto; justify-content: center; margin: 0; }

  .field-row { flex-direction: column; gap: 0; }
  /* acoes empilhadas e ocupando a largura no celular (demais tabelas) */
  td.col-acoes { white-space: normal; }
  .col-acoes .btn { margin: 2px 0 2px 4px; }
  .map-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .map-row .map-label { flex-basis: auto; }
  .modal-foot { flex-wrap: wrap; }
}

/* ── ACESSIBILIDADE: respeita quem pede menos movimento ──── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
