/* ───────────────────────────────────────────────────────
   TRICOFIO — Sistema de Controle de Malharia
   Paleta Blue Grey (logo: #263238 / #607D8B)
   Fonte: Century Gothic (Windows) + fallbacks
   ─────────────────────────────────────────────────────── */

:root {
  /* Paleta principal — Blue Grey Material Design */
  --bg-900: #263238;
  --bg-800: #37474F;
  --bg-700: #455A64;
  --bg-600: #546E7A;
  --bg-500: #607D8B;
  --bg-400: #78909C;
  --bg-300: #90A4AE;
  --bg-200: #B0BEC5;
  --bg-100: #CFD8DC;
  --bg-50:  #ECEFF1;

  /* Acento / destaque */
  --accent-gold:   #FFC000;
  --accent-green:  #00B050;
  --accent-red:    #C00000;
  --accent-blue:   #006699;
  --accent-orange: #FF6600;

  /* Gráficos de produção — dois azuis frios e suaves */
  --prod-interna: #3a7585;   /* petróleo suave */
  --prod-externa: #8aa1b1;   /* azul-acinzentado */

  /* Semânticos */
  --primary:       var(--bg-900);
  --primary-light: var(--bg-700);
  --secondary:     var(--bg-500);
  --sidebar-bg:    var(--bg-900);
  --sidebar-hover: var(--bg-800);
  --topbar-bg:     var(--bg-800);
  --body-bg:       var(--bg-50);
  --card-bg:       #ffffff;
  --text-primary:  var(--bg-900);
  --text-muted:    var(--bg-500);
  --border:        var(--bg-200);

  /* Status OS */
  --status-aberta:       #FFC000;
  --status-em_andamento: #006699;
  --status-concluida:    #00B050;
  --status-cancelada:    #C00000;

  /* Tipografia */
  --font: 'Century Gothic', 'CenturyGothic', 'AppleGothic', 'Trebuchet MS', Arial, sans-serif;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(38,50,56,.12);
  --shadow-lg: 0 4px 20px rgba(38,50,56,.18);
  --transition: .18s ease;
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  height: 100%;
}
/* Fundo das telas em degradê (tons abaixo do menu lateral) — Malharia e Linha, como no Terceirizados.
   Usa a escala --bg-* de cada tema (azul-grey na Malharia, laranja na Linha). */
body[data-modulo="malharia"], body[data-modulo="linha"] {
  background: linear-gradient(160deg, var(--bg-100) 0%, var(--bg-200) 55%, var(--bg-300) 100%) fixed;
}
a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ─── Layout Principal ───────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ─── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, var(--bg-900) 0%, var(--bg-700) 100%);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width var(--transition);
  z-index: 100;
}
.sidebar.collapsed { width: 60px; min-width: 60px; }

.sidebar-logo {
  padding: 0;
  border-bottom: 1px solid var(--bg-800);
}
.logo-box {
  background: linear-gradient(135deg, var(--bg-900) 0%, var(--bg-600) 100%);
  height: 52px;            /* igual à topbar */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}
.logo-img {
  height: 48px;            /* logo maior */
  width: auto;
  display: block;
  filter: brightness(0) invert(1);   /* logo em branco */
}
.sidebar.collapsed .logo-box { padding: 0 8px; }
.sidebar.collapsed .logo-img { height: 28px; }

/* Seção com accordion */
.sidebar-section {
  padding: 10px 14px 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color var(--transition);
  border-top: 1px solid rgba(255,255,255,.04);
  margin-top: 2px;
}
.sidebar-section:hover { color: var(--accent-gold); }
.sidebar-section .acc-arrow {
  font-size: 8px;
  transition: transform var(--transition);
  opacity: .6;
}
.sidebar-section.collapsed-group .acc-arrow { transform: rotate(-90deg); }
.sidebar-group { overflow: hidden; transition: max-height .25s ease; }
.sidebar-group.hidden-group { max-height: 0 !important; }
.sidebar.collapsed .sidebar-section { justify-content: center; padding: 6px 0; }
.sidebar.collapsed .sidebar-section span,
.sidebar.collapsed .acc-arrow { display: none; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--bg-200);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-item:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-item.active {
  background: var(--bg-800);
  color: #fff;
  border-left-color: var(--accent-gold);
}
.sidebar-item svg { min-width: 20px; width: 20px; height: 20px; }
.sidebar-item span { font-size: 15px; }
/* Editor de Preços de Terceirização (linhas parte/serviço + preço) */
.pt-rows { margin: 6px 0; }
.pt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pt-row .pt-nome { flex: 2; }
.pt-row .pt-preco, .pt-prow .pt-preco { width: 90px; text-align: right; }
/* Partes (read-only, vindas do modelo): nome + qtd + preço (+ linha calculada no Passamento) */
.pt-prow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pt-prow .pt-pnome { flex: 2; font-size: 13px; }
.pt-prow .pt-qtd { display: inline-block; background: var(--bg-200); color: var(--bg-900); font-size: 11px; font-weight: bold; padding: 1px 7px; border-radius: 6px; }
.pt-prow .pt-linha { width: 100px; text-align: right; font-size: 12px; font-weight: bold; color: var(--bg-700); }
/* Seções de preço por processo (lista todos) — barra de terceiros (⭐ Padrão + chips + "+ terceiro") */
.pp-rows { margin: 6px 0; }
.pp-tercbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.pp-tchip { font-size: 12px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; }
.pp-tchip:hover { background: var(--bg-50); border-color: var(--bg-400); }
.pp-tchip.active { background: var(--bg-700); color: #fff; border-color: var(--bg-700); }
.pp-add-terc { font-size: 12px; padding: 4px 8px; border-radius: 8px; max-width: 150px; }
.pt-del { border: none; background: transparent; color: var(--accent-red); cursor: pointer; font-size: 16px; padding: 2px 8px; }
.pt-del:hover { opacity: .7; }
.pt-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 4px; }

/* Abas (pílulas) da ficha do modelo: Dados do Modelo | Preços Terceiros */
.ft-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.ft-tab-btn {
  padding: 9px 18px; background: var(--bg-50); border: 1px solid var(--border);
  border-radius: 22px; font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--bg-700); cursor: pointer; transition: all var(--transition);
}
.ft-tab-btn:hover { border-color: var(--bg-500); color: var(--bg-900); background: #fff; }
.ft-tab-btn.active { background: linear-gradient(90deg, var(--bg-900) 0%, var(--bg-700) 100%); border-color: var(--bg-900); color: #fff; }

/* Bloco Processos da ficha (checkboxes) */
.ft-proc-list { display: flex; flex-direction: column; gap: 5px; }
.ft-proc-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; }
.ft-proc-item:hover { background: var(--bg-50); }
.ft-proc-item input { margin: 0; width: 16px; height: 16px; }

.sidebar-emoji {
  min-width: 22px; width: 22px;
  font-size: 19px; line-height: 1;
  font-style: normal; text-align: center;
  display: inline-block;
}

/* Cores dos ícones — uma cor por grupo do menu */
#group-cadastros .sidebar-item svg { color: #4FC3F7; }  /* azul claro */
#group-producao  .sidebar-item svg { color: #81C784; }  /* verde */
#group-tec       .sidebar-item svg { color: #90A4AE; }  /* azul-acinzentado (Tecelagem/Shima) */
.sidebar-emoji svg { display: block; margin: 0 auto; }
#group-fios      .sidebar-item svg { color: #FFB74D; }  /* laranja */
#group-bd        .sidebar-item svg { color: #FFD54F; }  /* âmbar */
#group-admin     .sidebar-item svg { color: #E57373; }  /* vermelho */
.sidebar.collapsed .sidebar-item span { display: none; }

/* ─── Conteúdo ───────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Topbar ─────────────────────────────────────────── */
.topbar {
  background: linear-gradient(90deg, var(--bg-900) 0%, var(--bg-700) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 52px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.topbar-toggle {
  background: none; border: none; color: var(--bg-200);
  padding: 6px; border-radius: var(--radius);
  display: flex; align-items: center;
}
.topbar-toggle:hover { background: var(--bg-700); color: #fff; }
.topbar-title { font-size: 15px; font-weight: bold; flex: 1; }
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--bg-200);
}
.topbar-user strong { color: #fff; }
.btn-logout {
  background: var(--bg-700); border: none; color: var(--bg-200);
  padding: 5px 12px; border-radius: var(--radius); font-size: 12px;
  cursor: pointer; transition: background var(--transition);
}
.btn-logout:hover { background: var(--accent-red); color: #fff; }

/* ─── Área de conteúdo ───────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ─── Página Header ──────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 {
  font-size: 20px; font-weight: bold; color: var(--bg-900);
  display: flex; align-items: center; gap: 8px;
}
.page-header h1 svg { color: var(--bg-500); }

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  background: linear-gradient(90deg, var(--bg-900) 0%, var(--bg-700) 100%);
  color: #fff;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: bold;
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 18px; }

/* Dashboard stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
  border-left: 4px solid var(--bg-500);
}
.stat-card.gold  { border-left-color: var(--accent-gold); }
.stat-card.green { border-left-color: var(--accent-green); }
.stat-card.blue  { border-left-color: var(--accent-blue); }
.stat-card.red   { border-left-color: var(--accent-red); }
.stat-card.orange { border-left-color: var(--accent-orange); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; }
.stat-value { font-size: 28px; font-weight: bold; color: var(--bg-900); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); }

/* ─── Tabelas ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
thead th {
  background: var(--bg-900); color: #fff;
  padding: 10px 12px; text-align: left;
  font-size: 12px; font-weight: bold; letter-spacing: .5px;
  white-space: nowrap;
}
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
tbody tr { border-bottom: 1px solid var(--bg-100); transition: background var(--transition); }
tbody tr:nth-child(even) { background: var(--bg-50); }   /* zebra */
tbody tr:hover { background: var(--bg-100); }
tbody td { padding: 9px 12px; color: var(--text-primary); vertical-align: middle; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* TBs (Bases de Dados) — colunas largas do Excel, mesmo padrão do atalho */
.bd-raw-table th, .bd-raw-table td { white-space: nowrap; }

/* Banco de Dados — visual estilo planilha (linhas de grade + cabeçalho fixo + nº de linha) */
/* tabela preenche o card (sem padding) → cantos arredondados do card emolduram a planilha */
#bd-table-content { padding: 0; }
#bd-table-content .table-wrap { border-radius: var(--radius); }
#bd-table-content .empty-state, #bd-table-content .loading { padding: 24px; }
#bd-main-table { border-collapse: collapse; font-size: 12px; }
#bd-main-table th, #bd-main-table td { border: 1px solid var(--bg-200); padding: 4px 9px; }
#bd-main-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: linear-gradient(90deg, var(--bg-900) 0%, var(--bg-700) 100%);
  color: #fff; font-size: 11.5px; border-color: var(--bg-700);
}
#bd-main-table tbody tr:nth-child(even) { background: var(--bg-50); }
#bd-main-table tbody tr:hover { background: #e8f0f5; }
/* numeração de linha (CSS counter → não entra no filtro e renumera ao ocultar) */
#bd-main-table tbody { counter-reset: bdrow; }
#bd-main-table tbody tr { counter-increment: bdrow; }
#bd-main-table td.bd-rownum, #bd-main-table th.bd-rownum {
  position: sticky; left: 0; z-index: 2;
  background: var(--bg-100); color: var(--text-muted);
  text-align: center; font-size: 10px; font-weight: bold; width: 38px; min-width: 38px;
}
#bd-main-table thead th.bd-rownum { z-index: 4; background: var(--bg-800); color: #fff; }
#bd-main-table td.bd-rownum::before { content: counter(bdrow); }

/* ─── Botões ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary   { background: var(--bg-900); color: #fff; }
.btn-primary:hover   { background: var(--bg-800); }
.btn-secondary { background: var(--bg-500); color: #fff; }
.btn-secondary:hover { background: var(--bg-600); }
.btn-success   { background: var(--accent-green); color: #fff; }
.btn-success:hover   { background: #009140; }
.btn-warning   { background: var(--accent-gold); color: var(--bg-900); }
.btn-warning:hover   { background: #e6ac00; }
.btn-danger    { background: var(--accent-red); color: #fff; }
.btn-danger:hover    { background: #9c0000; }
.btn-outline   { background: transparent; color: var(--bg-700); border: 1.5px solid var(--bg-300); }
.btn-outline:hover   { background: var(--bg-50); border-color: var(--bg-500); }
.btn-icon {
  padding: 6px; background: transparent; border: none;
  color: var(--bg-500); border-radius: var(--radius);
  display: inline-flex; align-items: center;
}
.btn-icon:hover { background: var(--bg-50); color: var(--bg-900); }
.btn-icon.danger:hover { background: #ffe4e4; color: var(--accent-red); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ─── Formulários ─────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
label {
  display: block; font-size: 12px; font-weight: bold;
  color: var(--bg-700); margin-bottom: 4px; letter-spacing: .3px;
}
input, select, textarea {
  width: 100%; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 13.5px; color: var(--text-primary);
  background: #fff; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--bg-500);
  box-shadow: 0 0 0 3px rgba(96,125,139,.15);
}
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ─── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(38,50,56,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp .18s ease;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-lg { max-width: 980px; }
.modal-xl { max-width: 1200px; }
.modal-header {
  background: var(--bg-900); color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.modal-close {
  background: none; border: none; color: var(--bg-300);
  font-size: 20px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { background: var(--bg-800); color: #fff; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ─── Tabs ────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--bg-200); margin-bottom: 20px; }
.tab-btn {
  padding: 8px 18px; background: none; border: none;
  font-family: var(--font); font-size: 13px; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--bg-900); }
.tab-btn.active { color: var(--bg-900); font-weight: bold; border-bottom-color: var(--bg-900); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Cadastro Geral — guias em "pílulas" mais visíveis */
#cad-tabs { border-bottom: none; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
#cad-tabs .tab-btn {
  padding: 9px 16px; background: var(--bg-50); border: 1px solid var(--border);
  border-radius: 22px; font-size: 13px; font-weight: 600; color: var(--bg-700);
  margin-bottom: 0; transition: all var(--transition);
}
#cad-tabs .tab-btn:hover { border-color: var(--bg-500); color: var(--bg-900); background: #fff; }
#cad-tabs .tab-btn.active {
  background: linear-gradient(90deg, var(--bg-900) 0%, var(--bg-700) 100%);
  border-color: var(--bg-900); color: #fff;
}

/* ─── Badges de Status ────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: bold;
}
.badge-aberta       { background: #FFF3CD; color: #856404; }
.badge-em_andamento { background: #D1ECF1; color: #0c5460; }
.badge-concluida    { background: #D4EDDA; color: #155724; }
.badge-cancelada    { background: #F8D7DA; color: #721c24; }
.badge-atrasada     { background: #FFD8A8; color: #8a3b00; font-weight: bold; }

/* ─── Busca ───────────────────────────────────────────── */
.search-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-bar input { max-width: 300px; flex: 1; }
.search-bar select { max-width: 200px; }

/* ─── Galeria de Fotos ────────────────────────────────── */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.foto-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.foto-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.foto-card img {
  width: 100%; height: 170px;
  object-fit: cover; display: block;
}
.foto-card .foto-nome {
  padding: 8px 10px; font-size: 12px; color: var(--bg-800);
  border-top: 1px solid var(--border); background: #fff;
}
.foto-card .foto-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 4px; opacity: 0;
  transition: opacity var(--transition);
}
.foto-card:hover .foto-actions { opacity: 1; }
.foto-principal-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--accent-gold); color: var(--bg-900);
  font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 4px;
}

/* ─── Ficha Técnica ───────────────────────────────────── */
.ft-section {
  background: var(--bg-50); border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 16px; overflow: hidden;
}
.ft-section-header {
  background: var(--bg-800); color: #fff;
  padding: 8px 14px; font-size: 12px; font-weight: bold;
  letter-spacing: .5px; text-transform: uppercase;
}
.ft-section-body { padding: 14px; }
.ft-row {
  display: grid; gap: 8px;
  align-items: start;
}
.ft-row-fio { grid-template-columns: 30px 1fr 1fr 90px; }
.ft-row-parte { grid-template-columns: 30px 1fr 70px 1fr 1fr 80px; }
.ft-row-medida { grid-template-columns: 30px 1fr 90px 90px 90px; }
.ft-num {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-900); color: #fff; border-radius: 50%;
  width: 22px; height: 22px; font-size: 11px; font-weight: bold;
  flex-shrink: 0; margin-top: 8px;
}

/* ─── Composição ──────────────────────────────────────── */
.composicao-bar { display: flex; height: 28px; border-radius: var(--radius); overflow: hidden; margin-top: 10px; }
.composicao-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; color: #fff; }

/* ─── Upload Drag-Drop ────────────────────────────────── */
.upload-drop {
  border: 2.5px dashed var(--bg-300);
  border-radius: var(--radius);
  padding: 32px; text-align: center;
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition);
}
.upload-drop:hover, .upload-drop.drag-over {
  border-color: var(--bg-500); background: var(--bg-50); color: var(--bg-700);
}

/* ─── Toast ───────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  min-width: 260px; max-width: 380px;
  padding: 12px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .2s ease;
  font-size: 13.5px;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-success { background: var(--accent-green); color: #fff; }
.toast-error   { background: var(--accent-red); color: #fff; }
.toast-info    { background: var(--bg-800); color: #fff; }
.toast-warning { background: var(--accent-gold); color: var(--bg-900); }

/* ─── Login ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-900) 0%, var(--bg-600) 55%, var(--bg-500) 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 40px rgba(38,50,56,.35);
  width: 100%; max-width: 380px; padding: 40px 36px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 96px; margin: 0 auto 12px; }
.login-logo p  { font-size: 13px; color: var(--text-muted); }

/* ─── Impressão OS ────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .modal-overlay { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .print-area { display: block !important; }
}
.print-area {
  background: #fff; padding: 20px;
  font-size: 12px; color: #000;
}
.print-header {
  border-bottom: 2px solid var(--bg-900);
  padding-bottom: 10px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ─── Backdrop do menu mobile (fora do media query: padrão oculto) ─── */
#sidebar-backdrop { display: none; }

/* ─── Responsivo ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: -260px; top: 0; height: 100vh; width: 240px; min-width: 240px;
    z-index: 200; transition: left .22s ease;
  }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.55); }
  .sidebar.collapsed { width: 240px; min-width: 240px; }   /* no mobile não encolhe */
  #sidebar-backdrop.show {
    display: block; position: fixed; inset: 0; z-index: 150;
    background: rgba(0,0,0,.45);
  }
  .content { padding: 14px; }
  .form-row { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .ft-row-fio, .ft-row-parte, .ft-row-medida { grid-template-columns: 1fr 1fr; }
  /* Painel da Linha em 1 coluna no celular */
  .painel-grid { grid-template-columns: 1fr !important; }
}

/* ─── Utils ───────────────────────────────────────────── */
.hidden  { display: none !important; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-8  { gap: 8px; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: bold; }
.w-full { width: 100%; }
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--bg-500);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; gap: 10px; color: var(--text-muted); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }

/* ─── Role Badge ──────────────────────────────────────── */
.role-badge {
  font-size: 10px; font-weight: bold; letter-spacing: .8px;
  padding: 2px 8px; border-radius: 20px; text-transform: uppercase;
}
.role-badge.admin     { background: var(--accent-gold); color: var(--bg-900); }
.role-badge.operador  { background: var(--bg-600); color: #fff; }
.role-badge.visitante { background: var(--bg-400); color: #fff; }

/* ─── Ficha Técnica — Layout Excel ───────────────────── */
/* Grade principal da ficha */
.ft-excel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.ft-excel-grid-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 1200px) {
  .ft-excel-grid, .ft-excel-grid-bottom { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .ft-excel-grid, .ft-excel-grid-bottom { grid-template-columns: 1fr; }
}

/* Mini-tabela para fios dentro da ficha */
.ft-mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ft-mini-table th {
  background: var(--bg-800); color: #fff;
  padding: 5px 6px; font-size: 11px; font-weight: bold;
  text-align: center; white-space: nowrap;
}
.ft-mini-table td { padding: 2px 4px; border-bottom: 1px solid var(--bg-100); vertical-align: middle; }
.ft-mini-table tr:nth-child(even) td { background: var(--bg-50); }
.ft-mini-table input, .ft-mini-table select {
  width: 100%; padding: 3px 5px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; font-family: var(--font);
  background: #fff;
}
.ft-mini-table input:focus, .ft-mini-table select:focus {
  border-color: var(--bg-500); outline: none;
}
/* Fio/Cor preenchidos: esconde a seta do select p/ não atrapalhar a leitura */
.ft-mini-table select.fio-cheio,
.ft-mini-table select.cor-cheio {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 5px; background-image: none;
}
.ft-mini-table .row-num {
  background: var(--bg-900); color: #fff;
  width: 20px; text-align: center;
  font-size: 10px; font-weight: bold; border-radius: 50%;
  padding: 2px 0;
}

/* Cabeçalho de bloco Excel */
.ft-block { border: 1px solid var(--bg-200); border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(38,50,56,.10); }
.ft-block-header {
  background: var(--bg-800); color: #fff;
  padding: 6px 10px; font-size: 11px; font-weight: bold;
  letter-spacing: .5px; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.ft-block-body { padding: 8px; background: #fff; }

/* Bicos layout */
.bicos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bico-col th { background: var(--bg-700); }

/* Peso tirado */
.peso-tirado-row { display: flex; gap: 4px; }
.peso-tirado-row input { flex: 1; text-align: right; background: var(--bg-50) !important; }
.peso-tirado-calc {
  color: var(--accent-green); font-weight: bold; font-size: 11px; text-align: right;
}

/* Composição inline */
.comp-inline { padding: 8px; }
.comp-bar-row { display: flex; height: 22px; border-radius: 4px; overflow: hidden; margin: 6px 0; }
.comp-bar-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: bold; color: #fff; transition: width .3s;
}

/* Imagem inline */
.ft-img-box {
  width: 100%; min-height: 230px;
  background: var(--bg-50); border: 2px dashed var(--bg-300);
  border-radius: 6px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
}
.ft-img-box img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; }
.ft-img-box .ft-img-overlay {
  position: absolute; inset: 0; background: rgba(38,50,56,.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; color: #fff; font-size: 13px;
}
.ft-img-box:hover .ft-img-overlay { opacity: 1; }

/* Ficha — página inteira (não modal) */
.ft-page { padding: 0; }
.ft-page-header {
  background: var(--bg-900); color: #fff;
  padding: 12px 20px; display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
  border-radius: var(--radius);
}
.ft-page-header h2 { font-size: 15px; flex: 1; }
.ft-status { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--bg-100); flex-wrap: wrap; }
.ft-status-datas { opacity: .85; }
.ft-badge { padding: 3px 9px; border-radius: 10px; font-weight: bold; font-size: 10px; letter-spacing: .5px; white-space: nowrap; }
.ft-badge.novo { background: var(--accent-green); color: #fff; }
.ft-badge.edit { background: var(--accent-red); color: #fff; }
#ft-codigo-aviso.existe { background: var(--accent-red); color: #fff; padding: 3px 9px; border-radius: 4px; font-weight: bold; animation: pulse 1.2s infinite; }
#ft-codigo-aviso.livre { color: var(--accent-green); font-weight: bold; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ─── Tela inicial ───────────────────────────────────── */
.inicio-tela {
  position: relative;
  min-height: calc(100vh - 100px);
  background: linear-gradient(135deg, var(--bg-50) 0%, var(--bg-200) 55%, var(--bg-500) 100%);
  border-radius: var(--radius);
}
.inicio-atalhos { position: absolute; top: 26px; left: 26px; display: flex; gap: 18px; flex-wrap: wrap; }
.inicio-atalho {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  width: 175px; height: 150px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--bg-200); border-radius: 14px;
  cursor: pointer; box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.inicio-atalho:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ia-emoji { font-size: 54px; line-height: 1; }
.ia-label { font-size: 15px; font-weight: bold; color: var(--bg-900); text-align: center; padding: 0 10px; }
.inicio-canto { position: absolute; right: 24px; bottom: 18px; text-align: right; }
.inicio-logo { width: 460px; max-width: 60vw; opacity: .95; display: block; margin-left: auto; }
.inicio-relogio { margin-top: 8px; }
.inicio-hora { font-size: 50px; font-weight: bold; color: #fff; line-height: 1; text-shadow: 0 2px 6px rgba(38,50,56,.45); }
.inicio-data { font-size: 15px; color: #ECEFF1; margin-top: 5px; text-shadow: 0 1px 4px rgba(38,50,56,.4); }

/* ─── Lançamento de O.S. (cabeçalho denso, estilo Excel) ─── */
.os-cab {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end;
  background: var(--card-bg); padding: 8px 10px; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 8px;
}
.os-f { display: flex; flex-direction: column; min-width: 92px; }
.os-f.grow { flex: 1; min-width: 150px; }
.os-f.sm { min-width: 46px; width: 46px; }
.os-f label {
  font-size: 9px; color: var(--bg-600); font-weight: bold;
  text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px;
}
.os-f .v {
  font-size: 13px; font-weight: bold; padding: 6px 4px;
  background: var(--bg-50); border-radius: 4px; min-height: 30px;
  display: flex; align-items: center;
}
.os-f .v[style*="center"] { justify-content: center; }
.os-f .v[style*="right"] { justify-content: flex-end; }
.os-f input, .os-f select { padding: 6px; }
.os-f.sm input { text-align: center; padding: 6px 2px; }
.os-ref-erro { border: 1.5px solid var(--accent-red) !important; background: #fff3f3 !important; }
.os-consulta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; }
.os-clbl { font-size: 10px; color: var(--bg-600); text-transform: uppercase; letter-spacing: .3px; font-weight: bold; }
.os-cval { font-size: 13px; }
.ft-campos-topo {
  display: grid;
  grid-template-columns:
    88px                 /* Código */
    minmax(140px, 1.6fr) /* Nome do Modelo */
    74px                 /* Tempo/Pç */
    minmax(100px, 1fr)   /* Máquina */
    minmax(100px, 1fr)   /* Coleção */
    68px                 /* Peso */
    74px                 /* Preço */
    minmax(100px, 1fr)   /* Programador */
    minmax(95px, .9fr)   /* Tipo */
    90px;                /* NCM (só leitura) */
  gap: 8px; align-items: end; margin-bottom: 10px;
  background: var(--card-bg); padding: 10px 12px;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
@media (max-width: 1200px) {
  .ft-campos-topo { grid-template-columns: repeat(4, 1fr); }
}

/* BD Page */
.bd-table-filter {
  display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center;
}
.bd-inline-edit { display: flex; gap: 6px; align-items: center; }
.bd-inline-edit input { flex: 1; padding: 4px 8px; border: 1.5px solid var(--bg-400); border-radius: 4px; font-size: 12px; font-family: var(--font); }
.editable-cell { cursor: pointer; }
.editable-cell:hover { background: var(--bg-50); border-radius: 3px; }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: .35; }

/* ── Consulta de Produção ── */
.cp-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cp-toolbar .cp-tb-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-right: 2px; }
.cp-year-btn { padding: 6px 15px; border: 1px solid var(--border); background: #fff; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); transition: var(--transition); font-family: var(--font); }
.cp-year-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.cp-year-btn.active { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
.cp-legend { display: flex; gap: 18px; align-items: center; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.cp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cp-legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
/* Legenda dentro do cabeçalho navy do quadro → texto claro e quadradinhos com contorno */
.card-header .cp-legend { color: #fff; font-size: 12.5px; font-weight: 600; margin-top: 0; }
.card-header .cp-legend i { width: 14px; height: 14px; box-shadow: 0 0 0 1px rgba(255,255,255,.45); }
.cp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 900px) { .cp-grid2 { grid-template-columns: 1fr; } }
.cp-hbars { display: flex; flex-direction: column; gap: 8px; }
.cp-hbar-row { display: grid; grid-template-columns: 116px 1fr 60px; align-items: center; gap: 9px; font-size: 13px; }
.cp-hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); font-weight: 600; }
.cp-hbar-track { background: #eceff1; border-radius: 6px; height: 19px; overflow: hidden; }
.cp-hbar-fill { display: block; height: 100%; border-radius: 6px; transition: width .45s ease; min-width: 2px; }
.cp-hbar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.cp-chart-card svg text { font-family: var(--font); }
.stat-card .stat-pct { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Painel "sem scroll": preenche a altura da área de conteúdo (2×2) */
.cp-dash { height: 100%; display: flex; flex-direction: column; gap: 12px; }
.cp-dash-top { flex-shrink: 0; }
.cp-headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cp-headrow h1 { margin: 0; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.cp-headrow .cp-toolbar { margin-bottom: 0; }
.cp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cp-kpis .stat-card { padding: 9px 14px; gap: 3px; }
.cp-kpis .stat-value { font-size: 22px; }
.cp-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1.1fr; gap: 12px; }
.cp-panel { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cp-panel > .card-header { flex-shrink: 0; padding: 8px 14px; font-size: 13px; }
.cp-panel-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 14px; }
.cp-panel-body.is-chart { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 6px; }
.cp-chart-wrap { flex: 1; min-height: 0; }
.cp-chart-wrap svg { width: 100%; height: 100%; display: block; }
.cp-panel-body table th, .cp-panel-body table td { padding: 6px 10px; }
/* Painel de tabela: sem padding p/ o cabeçalho fixo (sticky) encostar no topo */
.cp-body-table { padding: 0; }
.cp-body-table table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-700); color: #fff;
  border-radius: 0;
}
.cp-body-table table tfoot td {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--bg-100); border-top: 2px solid var(--border);
}
@media (max-width: 980px) {
  .cp-dash { height: auto; }
  .cp-grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .cp-grid .cp-panel { min-height: 280px; }
  .cp-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ─── BD: barra de período (últimos N meses) + marcação de retorno ─── */
.bd-extra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; }
.bd-extra .btn-sm { padding: 3px 10px; font-size: 12px; }
/* ID de saída no BD Lançamentos: verde = já retornou (completo); amarelo = parcial */
td.bd-ret-ok   { background: #c8e6c9 !important; color: #1b5e20; font-weight: 700; }
td.bd-ret-parc { background: #ffe9a8 !important; color: #7a5b00; font-weight: 700; }
.bd-legenda { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.bd-legenda i { display: inline-block; width: 16px; height: 12px; border-radius: 3px; }
.bd-legenda i.bd-ret-ok { background: #c8e6c9; }
.bd-legenda i.bd-ret-parc { background: #ffe9a8; }

/* Painel-resumo da situação (BD Lançamentos) */
.bd-resumo { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.bd-rcard { display: flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--border); border-left-width: 4px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.bd-rcard .ic { font-size: 18px; line-height: 1; }
.bd-rcard .num { font-size: 21px; font-weight: 800; line-height: 1; }
.bd-rcard .lbl { font-size: 12px; color: var(--text-muted); }
.bd-rcard.tot  { border-left-color: var(--bg-500); }
.bd-rcard.ok   { border-left-color: #2e7d32; } .bd-rcard.ok .num   { color: #1b5e20; }
.bd-rcard.parc { border-left-color: #f9a825; } .bd-rcard.parc .num { color: #7a5b00; }
.bd-rcard.none { border-left-color: #c62828; } .bd-rcard.none .num { color: #b71c1c; }
/* cards clicáveis = filtro de situação */
.bd-rcard.clickable { cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s ease; user-select: none; }
.bd-rcard.clickable:hover { box-shadow: 0 3px 10px rgba(0,0,0,.16); transform: translateY(-1px); }
.bd-rcard.active { border-width: 2px; border-left-width: 5px; }
.bd-rcard.ok.active   { background: #e8f5e9; border-color: #2e7d32; }
.bd-rcard.parc.active { background: #fff8e1; border-color: #f9a825; }
.bd-rcard.none.active { background: #ffebee; border-color: #c62828; }
.bd-rcard.tot.active  { background: var(--bg-50); border-color: var(--bg-500); }
/* ID clicável + modal de conferência (quantidades da saída) */
td.bd-idcell { cursor: pointer; text-decoration: underline dotted; }
td.bd-idcell:hover { outline: 2px solid var(--bg-600); outline-offset: -2px; }
.bd-conf-table { width: 100%; border-collapse: collapse; }
.bd-conf-table th, .bd-conf-table td { padding: 6px 10px; text-align: center; border-bottom: 1px solid var(--border); }
.bd-conf-table th:first-child, .bd-conf-table td:first-child { text-align: left; font-weight: 600; }
.bd-conf-table thead th { background: var(--bg-100); font-size: 12px; }
.bd-conf-table tfoot td { font-weight: 800; border-top: 2px solid var(--border); }
.bd-conf-table td.bd-falta { color: #b71c1c; font-weight: 800; background: #ffebee; }
.bd-badge { font-size: 12px; padding: 2px 9px; border-radius: 10px; font-weight: 700; vertical-align: middle; margin-left: 6px; }
.bd-badge.ok { background: #c8e6c9; color: #1b5e20; }
.bd-badge.parc { background: #ffe9a8; color: #7a5b00; }
.bd-badge.none { background: #ffcdd2; color: #b71c1c; }

/* ─── Rota do Dia ─── */
.rt-sug { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rt-sugchip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 12px;
  border: 1px solid var(--border); border-left: 3px solid #8d6e63; border-radius: 9px; background: #fff; cursor: pointer;
  transition: box-shadow .12s ease, transform .08s ease; text-align: left; }
.rt-sugchip:hover { box-shadow: 0 2px 8px rgba(0,0,0,.16); transform: translateY(-1px); }
.rt-sugchip .t { font-weight: 700; font-size: 13px; }
.rt-sugchip .m { font-size: 11px; color: var(--text-muted); }
.rt-num { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-500); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.rt-tbl td { vertical-align: middle; }
.rt-tbl .rt-det { width: 100%; min-width: 150px; }
.rt-tbl .rt-acao { width: 100%; }
