:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#acb5c1;
  --line:#e5eaf2;
  --head:#f1f5ff;
  --head2:#f8fafc;
  --accent:#2563eb;
  --accent2:#0ea5e9;
  --accentSoft:#e8efff;
  --shadow: 0 14px 34px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
body{
  margin:0;
  padding:18px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background-image: url('/img/background.jpg?v=2');
  background-size: cover;      /* Ajusta para cobrir toda a tela */
  background-repeat: no-repeat; /* Não repete a imagem */
  background-position: center;  /* Centraliza */
  background-attachment: fixed;;
}
.wrap{
  max-width:1750px;
  margin:0 auto;
  width:100%;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px 16px;
  box-shadow:var(--shadow);
}
.headerRow{
  display:flex;
  align-items:flex-start;
  gap:20px;
}
h1{ margin:0 0 4px; font-size:22px; color: #a44254; }
.sub{ margin:0; color:#707e91; font-size:13px; }
.actions{ display:flex; gap:10px; align-items:center; }
.btnSecondary{
  font-size: 12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--accent);
  cursor:pointer;
}

.btnSecondary:hover{ background:var(--head2); }
.meta{ display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
.chip{
  background:var(--head2);
  border:1px solid var(--line);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  color:var(--text);
}
.chip strong{ color:var(--accent); }

.tableWrap{
  background:var(--card);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:12.5px;
  table-layout:fixed;
}

/* Corpo da tabela pode quebrar palavras longas */
td{
  word-break:break-word;
  overflow-wrap:anywhere;
}

/* Cabeçalho não deve quebrar em cada letra */
th{
  word-break:normal;
  overflow-wrap:normal;
}

thead tr.head1 {
  background-image: linear-gradient(#5e76a9, #27417c);
  color:#fff;
}

thead tr.head1 th{
  position:sticky;
  top:0;
  z-index:20;
  background-image: linear-gradient(#5e76a9, #27417c);
  background-color:#27417c;
  color:#fff;
  padding:10px 12px;
  height:44px;
  cursor:pointer;
  user-select:none;
}
thead tr.head2 th{
  position:sticky;
  top:44px;
  z-index:19;
  background:#92a5d5;
  border-bottom:1px solid var(--line);
  padding:8px 10px;
}
th .sort{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:6px;
  font-weight:900;
  line-height:1.15;
  flex-wrap:nowrap;
}

th .sortLabel{
  min-width:0;
  white-space:normal;
}

.sortIcon{
  flex:0 0 auto;
  display:inline-block;
  white-space:nowrap;
  opacity:.65;
  color:var(--muted);
  transition:transform .18s ease, opacity .18s ease;
}
th[data-dir="asc"] .sortIcon{ transform:rotate(180deg); }
th[data-active="1"] .sortIcon{ opacity:1; color:#e9c20e; }

.center{ text-align:center; }

.col-cotacao{ width:88px; }
.col-icon{ width:72px; }

thead tr.head1 th.center{ text-align:center; }
thead tr.head1 th.center .sort{ justify-content:center; }

.filterInput{
  width:100%;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-size:12px;
  outline:none;
}



input.filterInput.center{ text-align:center; }
.filterInput:focus{
  border-color:rgba(14,165,233,.45);
  box-shadow:0 0 0 4px rgba(14,165,233,.10);
}
tbody td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
}
tbody tr {transition: background-color 0.3s ease;}
tbody tr:nth-child(odd){ background:#fbfdff; }
tbody tr:hover{ background:#f7f7bf; }
.right{text-align:right}
.noteBtn{
  width:30px;height:30px;
  border-radius:12px;
  border:1px solid rgba(37,99,235,.20);
  background:var(--accentSoft);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--accent);
}
.noteBtn svg{ width:16px;height:16px; }
.hiddenCol{ display:none !important; }
.empty{ padding:18px; color:var(--muted); font-size:13px; }

/* Loading overlay */
.loadingOverlay{
  position:fixed;
  inset:0;
  background:rgba(244,247,251,.70);
  backdrop-filter:blur(3px);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:80;
}
.loaderCard{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 24px 60px rgba(15,23,42,.10);
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:12px;
  min-width:220px;
}
.spinner{
  width:22px;height:22px;
  border-radius:50%;
  border:3px solid rgba(14,165,233,.25);
  border-top-color:rgba(14,165,233,1);
  animation:spin .8s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg);} }
.loaderText{ font-weight:900; color:var(--text); font-size:13px; }

/* Modais */
.modalOverlay{
  position:fixed; inset:0;
  background:rgba(15,23,42,.30);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:60;
}
.modal{
  width:min(900px,96vw);
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 24px 60px rgba(15,23,42,.18);
  overflow:hidden;
}
.modalHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  background:var(--head);
}
.modalTitle{ font-size:18px; color: #a44254; font-weight: 600;}
.modalClose{
  border:1px solid var(--line);
  background:#fff;
  color:var(--accent);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}
.modalClose:hover{ background:var(--head2); }
.modalBody{
  padding:14px;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:60vh;
  overflow:auto;
  color:var(--text);
}
.modalFooter{
  padding:12px 14px;
  border-top:1px solid var(--line);
  display:flex;
  gap:10px;
  justify-content:flex-end;
  background:#fff;
}
.smallBtn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  color:var(--accent);
}
.smallBtn:hover{ background:var(--head2); }
.colList{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}
.colItem{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--head2);
  font-size:12px;
}
