/* Diamond Almox Oficial Bundle CSS - 20260514_171115 */


/* ===== INÍCIO: diamond-system-compact.css ===== */
:root{
  --d-font: Inter, Arial, Helvetica, sans-serif;
  --d-bg:#f5f3ef;
  --d-card:#fff;
  --d-text:#0f172a;
  --d-muted:#64748b;
  --d-border:#e5ddcf;
  --d-gold:#d4af37;
  --d-green:#16a34a;
  --d-blue:#2563eb;
  --d-red:#dc2626;
  --d-radius:14px;
  --d-shadow:0 12px 30px rgba(15,23,42,.07);
}

html,body{
  font-family:var(--d-font)!important;
  background:var(--d-bg);
  color:var(--d-text);
  overflow-x:hidden!important;
}

*{
  box-sizing:border-box;
}

main,
.content,
.app-main,
.page,
section{
  max-width:100%;
}

button,
input,
select,
textarea{
  font-family:var(--d-font)!important;
}

input,
select,
textarea{
  border:1px solid var(--d-border)!important;
  border-radius:10px!important;
  min-height:36px!important;
  font-size:13px!important;
  outline:none!important;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--d-gold)!important;
  box-shadow:0 0 0 3px rgba(212,175,55,.13)!important;
}

button,
.btn{
  border-radius:10px!important;
  min-height:34px!important;
  padding:0 12px!important;
  font-size:13px!important;
  font-weight:800!important;
  box-shadow:0 8px 18px rgba(15,23,42,.07)!important;
  white-space:nowrap!important;
}

.card,
.panel,
.modal,
dialog,
[class*="card"],
[class*="panel"]{
  border-radius:16px!important;
  border:1px solid var(--d-border)!important;
  box-shadow:var(--d-shadow)!important;
}

.toolbar{
  gap:7px!important;
  flex-wrap:wrap!important;
}

table{
  width:100%!important;
  max-width:100%!important;
  border-collapse:collapse!important;
  table-layout:fixed!important;
  font-size:13px!important;
}

th{
  font-size:11px!important;
  letter-spacing:.04em!important;
  text-transform:uppercase!important;
  color:#64748b!important;
  background:#fafafa!important;
}

td,th{
  padding:8px 9px!important;
  border-bottom:1px solid #e8e0d4!important;
  vertical-align:middle!important;
}

td{
  overflow:hidden;
  text-overflow:ellipsis;
}

td button,
td .btn,
td a.btn{
  width:29px!important;
  min-width:29px!important;
  height:29px!important;
  min-height:29px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:9px!important;
  font-size:0!important;
}

td button svg,
td .btn svg,
td a.btn svg{
  width:14px!important;
  height:14px!important;
}

h1{
  font-size:25px!important;
  line-height:1.15!important;
  margin-bottom:4px!important;
}

h2{
  font-size:18px!important;
}

.sub,
small,
.text-muted{
  color:var(--d-muted)!important;
}

.diamond-scroll-y{
  overflow-y:auto!important;
  overflow-x:hidden!important;
}

.diamond-table-wrap{
  overflow-x:hidden!important;
  max-width:100%!important;
}

/* Evita colunas estourando tela */
@media (max-width:1400px){
  table th,
  table td{
    font-size:12px!important;
    padding:7px 7px!important;
  }

  button,
  .btn{
    font-size:12px!important;
  }
}

/* Sidebar sempre com rolagem vertical, sem empurrar layout */
aside,
.sidebar,
[class*="sidebar"]{
  overflow-y:auto!important;
  overflow-x:hidden!important;
}

/* Tooltip único */
[data-tip]{
  position:relative;
}

[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  left:50%;
  bottom:calc(100% + 8px);
  transform:translateX(-50%);
  background:#0f172a;
  color:#fff;
  padding:6px 8px;
  border-radius:8px;
  font-size:11px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  z-index:999999;
  transition:opacity .12s ease;
}

[data-tip]:hover::after{
  opacity:1;
}

/* Relatórios padrão Diamond */
.diamond-report-btn,
button[title*="PDF"],
button[data-kind="pdf"]{
  background:#111827!important;
  color:#fff!important;
}

/* ===== FIM: diamond-system-compact.css ===== */

/* ===== INÍCIO: diamond-no-ghost.css ===== */
/* Remove piscada de telas antigas embutidas antes dos módulos oficiais renderizarem */
#diamondEntradaLoader{
  min-height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px dashed #e5ddcf;
  background:#fff;
  border-radius:16px;
}

/* Impede componentes antigos de entrada manual aparecerem por milissegundos */
#page-entrada form:not([data-diamond-oficial]),
#page-entrada .legacy-entry,
#page-entrada [onclick="salvarEntrada()"]{
  display:none!important;
}

/* Base compacta para evitar estouro horizontal */
html,body{
  overflow-x:hidden!important;
}

table{
  max-width:100%!important;
}

.diamond-table-wrap{
  overflow-x:hidden!important;
}

/* ===== FIM: diamond-no-ghost.css ===== */

/* ===== INÍCIO: diamond-almoxarifado-compacto.css ===== */
/* Diamond Almoxarifado — listagem compacta */
#page-estoque .ap-toolbar {
  gap: 8px !important;
  margin-bottom: 14px !important;
}

#page-estoque .ap-toolbar .btn,
#page-estoque .ap-toolbar button {
  min-height: 38px !important;
  padding: 9px 14px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.06) !important;
}

#page-estoque h1 {
  margin-bottom: 4px !important;
}

#page-estoque .sub {
  font-size: 13px !important;
  margin-bottom: 14px !important;
}

#page-estoque .card.panel {
  padding: 18px !important;
  border-radius: 18px !important;
  overflow: visible !important;
}

#page-estoque .ap-filters {
  grid-template-columns: minmax(260px, 1.8fr) minmax(160px, .8fr) minmax(180px, .9fr) minmax(150px, .7fr) !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

#page-estoque .ap-filters input,
#page-estoque .ap-filters select {
  height: 40px !important;
  padding: 8px 12px !important;
  border-radius: 11px !important;
  font-size: 13px !important;
}

#page-estoque .table-wrap {
  overflow-x: hidden !important;
  overflow-y: visible !important;
  max-height: none !important;
  width: 100% !important;
}

#page-estoque table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-size: 12.5px !important;
}

#page-estoque thead th {
  padding: 10px 10px !important;
  font-size: 10.5px !important;
  letter-spacing: .7px !important;
  color: #6b7280 !important;
  white-space: nowrap !important;
  background: #faf9f7 !important;
}

#page-estoque tbody td {
  padding: 12px 10px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #e8e1d7 !important;
  white-space: normal !important;
  word-break: normal !important;
}

#page-estoque tbody tr {
  min-height: auto !important;
}

#page-estoque tbody tr:hover {
  background: rgba(201,168,76,.045) !important;
}

#page-estoque th:nth-child(1),
#page-estoque td:nth-child(1) {
  width: 34% !important;
}

#page-estoque th:nth-child(2),
#page-estoque td:nth-child(2) {
  width: 13% !important;
}

#page-estoque th:nth-child(3),
#page-estoque td:nth-child(3) {
  width: 11% !important;
}

#page-estoque th:nth-child(4),
#page-estoque td:nth-child(4) {
  width: 9% !important;
}

#page-estoque th:nth-child(5),
#page-estoque td:nth-child(5) {
  width: 7% !important;
}

#page-estoque th:nth-child(6),
#page-estoque td:nth-child(6) {
  width: 10% !important;
}

#page-estoque th:nth-child(7),
#page-estoque td:nth-child(7) {
  width: 16% !important;
}

#page-estoque .almox-item-cell {
  line-height: 1.25 !important;
}

#page-estoque .almox-item-title {
  display: block !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  color: #0f172a !important;
  margin-bottom: 3px !important;
  text-transform: none !important;
}

#page-estoque .almox-destino-line {
  display: block !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

#page-estoque .ap-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
}

#page-estoque .btn-xs {
  min-height: 29px !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 850 !important;
  box-shadow: none !important;
}

#page-estoque .btn-xs.blue {
  background: #2563eb !important;
}

#page-estoque .btn-xs.gold {
  background: #c9a84c !important;
}

#page-estoque .btn-xs.green {
  background: #16a34a !important;
}

#page-estoque .btn-xs.red {
  background: #dc2626 !important;
}

/* fallback: se algum JS antigo ainda renderizar a coluna Local, esconde sem quebrar */
#page-estoque table[data-legacy-local="1"] th:nth-child(6),
#page-estoque table[data-legacy-local="1"] td:nth-child(6) {
  display: none !important;
}

@media (max-width: 1100px) {
  #page-estoque .ap-filters {
    grid-template-columns: 1fr 1fr !important;
  }

  #page-estoque .ap-actions {
    flex-wrap: wrap !important;
  }
}

@media (max-width: 760px) {
  #page-estoque .ap-filters {
    grid-template-columns: 1fr !important;
  }

  #page-estoque table,
  #page-estoque thead,
  #page-estoque tbody,
  #page-estoque th,
  #page-estoque td,
  #page-estoque tr {
    display: block !important;
    width: 100% !important;
  }

  #page-estoque thead {
    display: none !important;
  }

  #page-estoque tbody tr {
    border: 1px solid #e8e1d7 !important;
    border-radius: 14px !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
    background: #fff !important;
  }

  #page-estoque tbody td {
    border: 0 !important;
    padding: 6px 0 !important;
  }

  #page-estoque .ap-actions {
    justify-content: flex-start !important;
  }
}

/* ===== FIM: diamond-almoxarifado-compacto.css ===== */

/* ===== INÍCIO: diamond-entrada-final-estavel.css ===== */
#page-entrada .ef-card{
  background:#fff;
  border:1px solid #e7dfd4;
  border-radius:18px;
  padding:14px 16px;
  box-shadow:0 14px 34px rgba(15,23,42,.06);
}

#page-entrada .ef-tabs{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

#page-entrada .ef-tab{
  border:1px solid #e7dfd4;
  background:#fff;
  border-radius:999px;
  padding:8px 14px;
  font-weight:900;
  font-size:13px;
  cursor:pointer;
}

#page-entrada .ef-tab.active{
  background:#c9a84c;
  border-color:#c9a84c;
  color:#fff;
}

#page-entrada .ef-grid{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1.1fr;
  gap:8px 10px;
  margin-bottom:10px;
}

#page-entrada label{
  display:block;
  font-size:10.5px;
  font-weight:900;
  margin-bottom:3px;
}

#page-entrada input,
#page-entrada select{
  width:100%;
  height:37px;
  border:1.5px solid #e3dacc;
  border-radius:10px;
  padding:7px 10px;
  background:#faf9f7;
  font-size:13px;
}

#page-entrada .ef-fast{
  border:1px solid #e7dfd4;
  background:#fffdf8;
  border-radius:16px;
  padding:10px;
  margin:10px 0 12px;
}

#page-entrada .ef-fast-title{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

#page-entrada .ef-fast-title b{
  font-size:14px;
}

#page-entrada .ef-fast-title span{
  font-size:12px;
  color:#64748b;
}

#page-entrada .ef-fast-line{
  display:grid;
  grid-template-columns:minmax(360px,1fr) 110px 130px 120px;
  gap:8px;
  align-items:end;
}

#page-entrada .ef-searchbox{
  position:relative;
}

#page-entrada .ef-results{
  display:none;
  position:absolute;
  top:42px;
  left:0;
  right:0;
  z-index:9000;
  background:#fff;
  border:1px solid #d8cfc3;
  border-radius:12px;
  box-shadow:0 18px 44px rgba(15,23,42,.18);
  overflow:hidden;
  max-height:360px;
  overflow-y:auto;
}

#page-entrada .ef-results.open{
  display:block;
}

#page-entrada .ef-result,
#page-entrada .ef-create{
  width:100%;
  border:0;
  background:#fff;
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  text-align:left;
  cursor:pointer;
  border-bottom:1px solid #eee4d9;
}

#page-entrada .ef-result.active,
#page-entrada .ef-result:hover{
  background:#0b7bd3;
  color:#fff;
}

#page-entrada .ef-result small{
  display:block;
  color:#64748b;
  font-size:11px;
  margin-top:2px;
}

#page-entrada .ef-result.active small,
#page-entrada .ef-result:hover small{
  color:#e0f2fe;
}

#page-entrada .ef-create{
  background:#f8fafc;
  justify-content:center;
  font-weight:900;
}

#page-entrada .ef-create:hover{
  background:#c9a84c;
  color:#fff;
}

#page-entrada .ef-confirm{
  height:37px;
  border:0;
  border-radius:10px;
  background:#16a34a;
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

#page-entrada .ef-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin:10px 0 8px;
}

#page-entrada .ef-toolbar h3{
  margin:0;
  font-size:18px;
}

#page-entrada .ef-mini-actions{
  display:flex;
  gap:6px;
}

#page-entrada .ef-mini-actions button{
  height:32px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #e7dfd4;
  background:#fff;
  font-weight:900;
  cursor:pointer;
  font-size:12px;
}

#page-entrada .ef-rows{
  display:grid;
  gap:7px;
}

#page-entrada .ef-row{
  display:grid;
  grid-template-columns:130px minmax(260px,1fr) 110px 120px 36px;
  gap:8px;
  align-items:end;
  border:1px solid #ede4d8;
  border-radius:14px;
  padding:9px 10px;
  background:#fff;
}

#page-entrada .ef-row.novo{
  grid-template-columns:130px minmax(260px,1fr) 90px 130px 90px 110px 36px;
}

#page-entrada .ef-row .ef-name{
  font-weight:900;
  font-size:13px;
  color:#0f172a;
  line-height:1.2;
}

#page-entrada .ef-row .ef-meta{
  font-size:11px;
  color:#64748b;
  margin-top:3px;
}

#page-entrada .ef-remove{
  width:36px;
  height:36px;
  border:0;
  border-radius:10px;
  background:#fee2e2;
  color:#991b1b;
  font-weight:900;
  cursor:pointer;
}

#page-entrada .ef-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:10px 0;
}

#page-entrada .ef-kpi{
  border:1px solid #e7dfd4;
  border-radius:13px;
  padding:9px 11px;
  background:#fff;
}

#page-entrada .ef-kpi small{
  display:block;
  font-size:10.5px;
  font-weight:900;
  color:#64748b;
}

#page-entrada .ef-kpi b{
  font-size:20px;
}

#page-entrada .ef-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:8px;
}

#page-entrada .ef-actions button{
  min-height:38px;
  border-radius:11px;
  padding:9px 14px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

#page-entrada .ef-cancel{
  background:#fff;
  border:1px solid #e7dfd4;
}

#page-entrada .ef-save{
  background:#16a34a;
  border:0;
  color:#fff;
}

@media(max-width:1050px){
  #page-entrada .ef-grid,
  #page-entrada .ef-summary{
    grid-template-columns:1fr 1fr;
  }

  #page-entrada .ef-fast-line{
    grid-template-columns:1fr 1fr;
  }

  #page-entrada .ef-row,
  #page-entrada .ef-row.novo{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:700px){
  #page-entrada .ef-grid,
  #page-entrada .ef-fast-line,
  #page-entrada .ef-summary,
  #page-entrada .ef-row,
  #page-entrada .ef-row.novo{
    grid-template-columns:1fr;
  }
}

/* ===== FIM: diamond-entrada-final-estavel.css ===== */

/* ===== INÍCIO: diamond-compras-entradas-pro.css ===== */
.ce-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  z-index:99950;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.ce-modal{
  width:min(1180px,calc(100vw - 34px));
  max-height:92vh;
  background:#fff;
  border-radius:18px;
  box-shadow:0 28px 80px rgba(0,0,0,.28);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.ce-head{
  padding:15px 18px;
  border-bottom:1px solid #e7dfd4;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}

.ce-head h2{
  margin:0;
  font-size:19px;
}

.ce-head p{
  margin:3px 0 0;
  color:#64748b;
  font-size:12px;
}

.ce-close{
  width:36px;
  height:36px;
  border:0;
  background:#fff;
  font-size:24px;
  cursor:pointer;
}

.ce-body{
  padding:14px 16px;
  overflow:auto;
}

.ce-filters{
  display:grid;
  grid-template-columns:1.4fr .85fr 1fr .9fr .9fr auto;
  gap:8px;
  align-items:end;
  margin-bottom:12px;
}

.ce-field label{
  display:block;
  font-size:10.5px;
  font-weight:900;
  margin-bottom:3px;
  color:#0f172a;
}

.ce-field input,
.ce-field select{
  width:100%;
  height:36px;
  border:1.5px solid #e3dacc;
  border-radius:10px;
  padding:7px 10px;
  background:#faf9f7;
  font-size:13px;
}

.ce-btn{
  height:36px;
  border-radius:10px;
  border:1px solid #e7dfd4;
  background:#fff;
  padding:0 12px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}

.ce-btn.gold{
  background:#c9a84c;
  border-color:#c9a84c;
  color:#fff;
}

.ce-btn.green{
  background:#16a34a;
  border-color:#16a34a;
  color:#fff;
}

.ce-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}

.ce-kpi{
  border:1px solid #e7dfd4;
  border-radius:14px;
  padding:11px 13px;
  background:#fff;
}

.ce-kpi small{
  display:block;
  color:#94a3b8;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.ce-kpi b{
  display:block;
  font-size:22px;
  margin-top:4px;
}

.ce-table-wrap{
  border:1px solid #e7dfd4;
  border-radius:14px;
  overflow:auto;
  max-height:52vh;
}

.ce-table{
  width:100%;
  border-collapse:collapse;
  font-size:12.5px;
  min-width:1020px;
}

.ce-table th{
  position:sticky;
  top:0;
  z-index:2;
  background:#faf9f7;
  text-align:left;
  color:#475569;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:10px 11px;
  border-bottom:1px solid #e7dfd4;
}

.ce-table td{
  padding:10px 11px;
  border-bottom:1px solid #eee4d9;
  vertical-align:top;
}

.ce-doc{
  max-width:260px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ce-dest{
  max-width:260px;
  color:#475569;
  font-size:11.5px;
}

.ce-badge{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  font-weight:900;
  font-size:11px;
}

.ce-actions{
  display:flex;
  gap:6px;
}

.ce-actions button{
  height:30px;
  border:0;
  border-radius:9px;
  padding:0 9px;
  font-weight:900;
  cursor:pointer;
  font-size:11.5px;
}

.ce-detail{
  background:#2563eb;
  color:#fff;
}

.ce-print{
  background:#c9a84c;
  color:#fff;
}

.ce-foot{
  padding:12px 16px;
  border-top:1px solid #e7dfd4;
  display:flex;
  justify-content:flex-end;
  gap:8px;
}

.ce-detail-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}

.ce-info{
  border:1px solid #e7dfd4;
  border-radius:12px;
  padding:9px 11px;
  background:#fff;
}

.ce-info small{
  display:block;
  color:#94a3b8;
  font-size:9.5px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.ce-info b{
  display:block;
  margin-top:3px;
  font-size:13px;
  word-break:break-word;
}

.ce-items-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.ce-items-table th,
.ce-items-table td{
  border-bottom:1px solid #e7dfd4;
  padding:8px;
  text-align:left;
}

.ce-items-table th{
  background:#faf9f7;
  font-size:10px;
  color:#475569;
  text-transform:uppercase;
}

.ce-num{
  text-align:right!important;
}

@media(max-width:950px){
  .ce-filters,
  .ce-kpis,
  .ce-detail-grid{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:640px){
  .ce-filters,
  .ce-kpis,
  .ce-detail-grid{
    grid-template-columns:1fr;
  }
}

/* ===== FIM: diamond-compras-entradas-pro.css ===== */

/* ===== INÍCIO: diamond-compras-entradas-wide.css ===== */
/* Compras / Entradas — modal largo e legível */
.ce-overlay{
  align-items:flex-start !important;
  justify-content:center !important;
  padding:22px 18px !important;
  z-index:99980 !important;
}

.ce-modal{
  width:min(1320px, calc(100vw - 30px)) !important;
  max-width:calc(100vw - 30px) !important;
  max-height:94vh !important;
  border-radius:18px !important;
}

.ce-head{
  padding:15px 18px !important;
}

.ce-body{
  padding:14px 16px !important;
}

.ce-filters{
  grid-template-columns:minmax(240px,1.35fr) 120px minmax(180px,.9fr) 150px 150px 92px !important;
  gap:10px !important;
}

.ce-kpis{
  grid-template-columns:repeat(4, minmax(0,1fr)) !important;
  gap:10px !important;
}

.ce-table-wrap{
  max-height:56vh !important;
  overflow:auto !important;
}

.ce-table{
  min-width:1180px !important;
  font-size:12.2px !important;
}

.ce-table th,
.ce-table td{
  padding:9px 10px !important;
}

.ce-doc{
  max-width:310px !important;
}

.ce-dest{
  max-width:330px !important;
  line-height:1.35 !important;
}

.ce-actions button{
  height:29px !important;
  padding:0 10px !important;
}

.ce-foot{
  padding:12px 16px !important;
}

.ce-btn{
  height:38px !important;
  padding:0 14px !important;
}

/* Detalhe da compra também mais largo */
#ceDetailOverlay .ce-modal{
  width:min(1220px, calc(100vw - 30px)) !important;
}

#ceDetailOverlay .ce-table-wrap{
  max-height:50vh !important;
}

.ce-detail-grid{
  grid-template-columns:repeat(4, minmax(0,1fr)) !important;
}

.ce-info b{
  font-size:12.8px !important;
}

@media(max-width:1050px){
  .ce-filters{
    grid-template-columns:1fr 1fr 1fr !important;
  }

  .ce-kpis,
  .ce-detail-grid{
    grid-template-columns:1fr 1fr !important;
  }
}

@media(max-width:700px){
  .ce-filters,
  .ce-kpis,
  .ce-detail-grid{
    grid-template-columns:1fr !important;
  }
}

/* ===== FIM: diamond-compras-entradas-wide.css ===== */

/* ===== INÍCIO: diamond-compras-entradas-refino.css ===== */
/* Compras / Entradas — refino visual */
.ce-overlay{
  padding:14px !important;
  align-items:flex-start !important;
  z-index:99990 !important;
}

.ce-modal{
  width:calc(100vw - 28px) !important;
  max-width:1420px !important;
  max-height:95vh !important;
  border-radius:18px !important;
}

.ce-head{
  padding:13px 16px !important;
}

.ce-head h2{
  font-size:18px !important;
}

.ce-head p{
  font-size:12px !important;
}

.ce-body{
  padding:12px 16px !important;
}

/* Filtros em duas camadas: presets + filtros principais */
.ce-periods{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin:0 0 10px;
  align-items:center;
}

.ce-periods small{
  font-size:10px;
  font-weight:900;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-right:4px;
}

.ce-periods button{
  height:30px;
  border-radius:999px;
  border:1px solid #e3dacc;
  background:#fff;
  padding:0 11px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}

.ce-periods button.active,
.ce-periods button:hover{
  background:#c9a84c;
  border-color:#c9a84c;
  color:#fff;
}

.ce-filters{
  display:grid !important;
  grid-template-columns:minmax(260px,1.4fr) 130px minmax(210px,1fr) 145px 145px 95px !important;
  gap:8px 10px !important;
  align-items:end !important;
  margin-bottom:11px !important;
}

.ce-field{
  min-width:0 !important;
}

.ce-field label{
  display:block !important;
  white-space:nowrap !important;
  overflow:visible !important;
  font-size:10px !important;
  font-weight:900 !important;
  line-height:1.1 !important;
  margin-bottom:4px !important;
}

.ce-field input,
.ce-field select{
  width:100% !important;
  min-width:0 !important;
  height:35px !important;
  border-radius:10px !important;
  font-size:12.5px !important;
  padding:6px 9px !important;
  box-sizing:border-box !important;
}

.ce-filters .ce-btn,
#ceFiltrar{
  width:95px !important;
  min-width:95px !important;
  height:35px !important;
  padding:0 !important;
  font-size:12.5px !important;
}

.ce-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:8px !important;
  margin-bottom:10px !important;
}

.ce-kpi{
  padding:9px 11px !important;
  border-radius:12px !important;
}

.ce-kpi small{
  font-size:9.5px !important;
}

.ce-kpi b{
  font-size:20px !important;
}

.ce-table-wrap{
  max-height:57vh !important;
  border-radius:13px !important;
}

.ce-table{
  width:100% !important;
  min-width:1120px !important;
  font-size:11.6px !important;
}

.ce-table th{
  padding:8px 9px !important;
  font-size:9.5px !important;
  white-space:nowrap !important;
}

.ce-table td{
  padding:8px 9px !important;
  line-height:1.25 !important;
}

.ce-table td:nth-child(1){
  width:128px !important;
  white-space:nowrap !important;
}

.ce-table td:nth-child(2){
  width:68px !important;
}

.ce-table td:nth-child(3){
  width:220px !important;
}

.ce-table td:nth-child(4){
  width:310px !important;
}

.ce-table td:nth-child(5){
  min-width:330px !important;
}

.ce-doc{
  max-width:300px !important;
}

.ce-dest{
  max-width:360px !important;
  font-size:11px !important;
}

.ce-badge{
  height:20px !important;
  padding:0 7px !important;
  font-size:10.5px !important;
}

.ce-actions button{
  height:28px !important;
  padding:0 9px !important;
  font-size:11px !important;
}

.ce-foot{
  padding:10px 16px !important;
}

.ce-btn{
  height:36px !important;
  font-size:12.5px !important;
  border-radius:10px !important;
}

/* Detalhe */
#ceDetailOverlay .ce-modal{
  width:calc(100vw - 34px) !important;
  max-width:1320px !important;
}

.ce-detail-grid{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:8px !important;
}

.ce-info{
  padding:8px 10px !important;
}

.ce-info small{
  font-size:9px !important;
}

.ce-info b{
  font-size:12.5px !important;
}

.ce-items-table{
  font-size:11.5px !important;
}

.ce-items-table th,
.ce-items-table td{
  padding:7px 8px !important;
}

/* Responsivo */
@media(max-width:1150px){
  .ce-filters{
    grid-template-columns:1fr 130px 1fr !important;
  }

  .ce-filters .ce-btn,
  #ceFiltrar{
    width:100% !important;
  }
}

@media(max-width:780px){
  .ce-filters,
  .ce-kpis,
  .ce-detail-grid{
    grid-template-columns:1fr !important;
  }

  .ce-modal{
    width:calc(100vw - 16px) !important;
  }
}

/* ===== FIM: diamond-compras-entradas-refino.css ===== */

/* ===== INÍCIO: diamond-almox-produto-custo-final.css ===== */
body.almox-produto-custo-final #almoxIconToolbar,
body.almox-produto-custo-final #almoxFinalToolbar,
body.almox-produto-custo-final #almoxHardActions,
body.almox-produto-custo-final #almoxFinalPdfBtn,
body.almox-produto-custo-final #almoxPdfIconFinal,
body.almox-produto-custo-final #almoxPdfHardBtn,
body.almox-produto-custo-final #almoxRelatorioFiltroBtn,
body.almox-produto-custo-final #almoxSingleToolbar{
  display:none !important;
}

/* Só esconde botões originais dentro do conteúdo, nunca sidebar */
body.almox-produto-custo-final main .almox-top-source-hidden,
body.almox-produto-custo-final section .almox-top-source-hidden,
body.almox-produto-custo-final .content .almox-top-source-hidden{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

body.almox-produto-custo-final .almox-prod-toolbar{
  display:flex !important;
  justify-content:flex-end !important;
  align-items:center !important;
  gap:7px !important;
  flex-wrap:wrap !important;
  margin:8px 0 12px !important;
}

body.almox-produto-custo-final .almox-prod-btn{
  width:34px !important;
  min-width:34px !important;
  height:34px !important;
  min-height:34px !important;
  border-radius:11px !important;
  border:1px solid #ded6c8 !important;
  background:#fff !important;
  color:#0f172a !important;
  padding:0 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow:0 7px 16px rgba(15,23,42,.07) !important;
  cursor:pointer !important;
  position:relative !important;
}

body.almox-produto-custo-final .almox-prod-btn svg{
  width:17px !important;
  height:17px !important;
  stroke:currentColor !important;
  stroke-width:2.25 !important;
  fill:none !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
}

body.almox-produto-custo-final .almox-prod-btn[data-kind="produto"]{
  background:#16a34a !important;
  border-color:#16a34a !important;
  color:#fff !important;
}

body.almox-produto-custo-final .almox-prod-btn[data-kind="xml"]{
  background:#d4af37 !important;
  border-color:#d4af37 !important;
  color:#fff !important;
}

body.almox-produto-custo-final .almox-prod-btn[data-kind="pdf"]{
  background:#111827 !important;
  border-color:#111827 !important;
  color:#fff !important;
}

body.almox-produto-custo-final [data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  left:50%;
  bottom:calc(100% + 8px);
  transform:translateX(-50%);
  background:#0f172a;
  color:#fff;
  padding:6px 8px;
  border-radius:8px;
  font-size:11px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  z-index:999999;
  transition:opacity .12s ease;
}

body.almox-produto-custo-final [data-tip]::before{
  content:"";
  position:absolute;
  left:50%;
  bottom:calc(100% + 3px);
  transform:translateX(-50%);
  border:5px solid transparent;
  border-top-color:#0f172a;
  opacity:0;
  pointer-events:none;
  z-index:999999;
  transition:opacity .12s ease;
}

body.almox-produto-custo-final [data-tip]:hover::after,
body.almox-produto-custo-final [data-tip]:hover::before{
  opacity:1;
}

/* Tabela corrigida: custo separado das ações */
body.almox-produto-custo-final table{
  width:100% !important;
  table-layout:fixed !important;
  border-collapse:collapse !important;
}

body.almox-produto-custo-final table th,
body.almox-produto-custo-final table td{
  padding:8px 8px !important;
  vertical-align:middle !important;
  line-height:1.22 !important;
}

body.almox-produto-custo-final table th:nth-child(1),
body.almox-produto-custo-final table td:nth-child(1){
  width:30% !important;
}

body.almox-produto-custo-final table th:nth-child(2),
body.almox-produto-custo-final table td:nth-child(2){
  width:11% !important;
}

body.almox-produto-custo-final table th:nth-child(3),
body.almox-produto-custo-final table td:nth-child(3){
  width:8% !important;
}

body.almox-produto-custo-final table th:nth-child(4),
body.almox-produto-custo-final table td:nth-child(4){
  width:8% !important;
  white-space:nowrap !important;
}

body.almox-produto-custo-final table th:nth-child(5),
body.almox-produto-custo-final table td:nth-child(5){
  width:5% !important;
}

body.almox-produto-custo-final table th:nth-child(6),
body.almox-produto-custo-final table td:nth-child(6){
  width:15% !important;
  min-width:130px !important;
  text-align:right !important;
  white-space:nowrap !important;
  overflow:visible !important;
  padding-right:14px !important;
}

body.almox-produto-custo-final table th:nth-child(7),
body.almox-produto-custo-final table td:nth-child(7){
  width:23% !important;
  min-width:150px !important;
  text-align:right !important;
  white-space:nowrap !important;
}

body.almox-produto-custo-final table td:nth-child(7){
  display:table-cell !important;
}

body.almox-produto-custo-final table td:nth-child(7) button,
body.almox-produto-custo-final table td:nth-child(7) a{
  width:28px !important;
  min-width:28px !important;
  max-width:28px !important;
  height:28px !important;
  min-height:28px !important;
  max-height:28px !important;
  padding:0 !important;
  margin-left:5px !important;
  border-radius:9px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:0 !important;
  line-height:1 !important;
  position:relative !important;
  overflow:visible !important;
}

body.almox-produto-custo-final table td:nth-child(7) button svg,
body.almox-produto-custo-final table td:nth-child(7) a svg{
  width:14px !important;
  height:14px !important;
  stroke:currentColor !important;
  stroke-width:2.2 !important;
  fill:none !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
}

body.almox-produto-custo-final table td:nth-child(1) b,
body.almox-produto-custo-final table td:nth-child(1) strong{
  display:block !important;
  max-width:100% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

body.almox-produto-custo-final table td:nth-child(1) small,
body.almox-produto-custo-final table td:nth-child(1) div{
  display:block !important;
  max-width:100% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

/* Modal cadastro produto */
#almoxProdutoOverlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  z-index:999999;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:24px;
}

#almoxProdutoModal{
  width:min(920px, calc(100vw - 28px));
  max-height:92vh;
  overflow:auto;
  background:#fff;
  border-radius:18px;
  box-shadow:0 28px 70px rgba(15,23,42,.25);
  border:1px solid #e5ddcf;
}

.almox-prod-head{
  padding:15px 18px;
  border-bottom:1px solid #e5ddcf;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.almox-prod-head h2{
  margin:0;
  font-size:18px;
}

.almox-prod-close{
  border:0;
  background:#fff;
  font-size:22px;
  cursor:pointer;
}

.almox-prod-body{
  padding:16px 18px 18px;
}

.almox-prod-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:11px;
}

.almox-prod-grid .full{
  grid-column:1 / -1;
}

.almox-prod-grid label{
  display:block;
  font-size:11px;
  font-weight:900;
  margin-bottom:5px;
}

.almox-prod-grid input{
  width:100%;
  height:38px;
  border:1px solid #ded6c8;
  border-radius:10px;
  padding:0 10px;
  font-size:13px;
}

.almox-prod-foot{
  padding:12px 18px 16px;
  border-top:1px solid #e5ddcf;
  display:flex;
  justify-content:flex-end;
  gap:9px;
}

.almox-prod-foot button{
  height:38px;
  border-radius:10px;
  padding:0 14px;
  font-weight:900;
  cursor:pointer;
  border:1px solid #ded6c8;
  background:#fff;
}

.almox-prod-save{
  background:#16a34a !important;
  border-color:#16a34a !important;
  color:#fff !important;
}

/* ===== FIM: diamond-almox-produto-custo-final.css ===== */


/* ===== PATCH FASE5B TOOLTIP FIXO INICIO ===== */

/* Desliga tooltip antigo por pseudo-elemento, que ficava atrás/cortado */
[data-tip]::before,
[data-tip]::after{
  display:none !important;
  content:none !important;
}

/* Tooltip global fixo: não corta dentro de cards, tables, toolbar ou header */
#diamondSmartTip{
  position:fixed !important;
  z-index:2147483647 !important;
  left:0;
  top:0;
  transform:translate(-50%, -8px);
  background:#0f172a;
  color:#fff;
  border:1px solid rgba(255,255,255,.08);
  border-radius:9px;
  padding:7px 9px;
  font-size:11px;
  font-weight:900;
  line-height:1.1;
  white-space:nowrap;
  max-width:280px;
  overflow:hidden;
  text-overflow:ellipsis;
  box-shadow:0 14px 32px rgba(15,23,42,.24);
  opacity:0;
  pointer-events:none;
  transition:opacity .08s ease, transform .08s ease;
}

#diamondSmartTip.show{
  opacity:1;
  transform:translate(-50%, -12px);
}

#diamondSmartTip.below{
  transform:translate(-50%, 12px);
}

/* Ícones de ação mais limpos e sem sobrepor custo */
td:last-child{
  overflow:visible !important;
  white-space:nowrap !important;
}

td:last-child button,
td:last-child a,
.almox-icon-btn,
button[data-tip],
a[data-tip]{
  overflow:visible !important;
}

td:last-child button,
td:last-child a{
  margin-left:4px !important;
}

/* Barra superior do almox: menos poluição */
.diamond-almox-toolbar,
.almox-toolbar,
.almox-actions,
.almox-top-actions{
  gap:7px !important;
  align-items:center !important;
  justify-content:flex-end !important;
}

.diamond-almox-toolbar button,
.almox-toolbar button,
.almox-actions button,
.almox-top-actions button{
  width:34px !important;
  min-width:34px !important;
  height:34px !important;
  min-height:34px !important;
  padding:0 !important;
  border-radius:11px !important;
}

/* Botão textual principal continua textual */
button:not(td button):not(.diamond-icon-only){
  max-width:100%;
}

/* ===== PATCH FASE5B TOOLTIP FIXO FIM ===== */
