:root {
  --brand: #f28c28;
  --brand-dark: #d86f12;
  --brand-soft: #fff1e3;
  --brand-rgb: 242, 140, 40;
  --logo-red: #d52f26;
  --ink: #22252a;
  --muted: #6f7782;
  --surface: #ffffff;
  --page: #f6f7f9;
  --border: #e7e9ed;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(26, 30, 36, .07);

  /* Menu lateral fixado diretamente no visual V2 */
  --sidebar-bg: #ffffff;
  --sidebar-brand-color: #1e232a;
  --sidebar-brand-muted: #7d848e;
  --sidebar-nav-color: #44505d;
  --sidebar-nav-hover-bg: #fff8f2;
  --sidebar-nav-hover-color: #c86a12;
  --sidebar-nav-active-bg: #fff5ea;
  --sidebar-nav-active-color: #c86a12;
  --sidebar-nav-active-shadow: inset 4px 0 0 var(--brand), 0 10px 18px rgba(var(--brand-rgb), .08);
  --sidebar-section-color: #9d6d3f;
  --sidebar-user-border: #ebeef3;
  --sidebar-user-muted: #6f7782;
  --sidebar-panel-border: 1px solid #eceef2;
  --sidebar-panel-shadow: 0 18px 40px rgba(29, 36, 45, .04);
  --sidebar-brand-logo-bg: #ffffff;
}
* { box-sizing: border-box; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--page); }
a { text-decoration: none; }
.btn { border-radius: 10px; font-weight: 600; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { color: var(--brand-dark); border-color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.text-brand { color: var(--brand-dark)!important; }
.bg-brand-soft { background: var(--brand-soft)!important; }
.form-control, .form-select { border-radius: 10px; border-color: #dfe2e7; min-height: 44px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .16); }
.form-label { font-weight: 600; font-size: .9rem; color: #3d424a; }
.required::after { content: " *"; color: #dc3545; }
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; }
.card-header { background: transparent; border-bottom-color: var(--border); padding: 1rem 1.2rem; }
.card-body { padding: 1.2rem; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; border-color: #eef0f2; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.badge { border-radius: 999px; font-weight: 600; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 268px; padding: 18px 14px; background: var(--sidebar-bg); color: var(--sidebar-brand-color); border-right: var(--sidebar-panel-border); box-shadow: var(--sidebar-panel-shadow); flex-direction: column; z-index: 1040; transition: background .22s ease, border-color .22s ease, box-shadow .22s ease; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; color: var(--sidebar-brand-color); }
.sidebar-brand img { width: 52px; height: 52px; object-fit: contain; background: var(--sidebar-brand-logo-bg); border-radius: 14px; padding: 5px; box-shadow: 0 6px 18px rgba(0,0,0,.05); }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 1.08rem; }
.sidebar-brand small { color: var(--sidebar-brand-muted); font-size: .75rem; }
.sidebar-nav { overflow-y: auto; padding-right: 3px; }
.sidebar-nav .nav-item { display: flex; align-items: center; gap: 12px; color: var(--sidebar-nav-color); padding: 11px 12px; margin: 3px 0; border-radius: 10px; font-weight: 600; font-size: .92rem; transition: all .18s ease; }
.sidebar-nav .nav-item i { width: 21px; text-align: center; font-size: 1.04rem; }
.sidebar-nav .nav-item:hover { color: var(--sidebar-nav-hover-color); background: var(--sidebar-nav-hover-bg); }
.sidebar-nav .nav-item.active { color: var(--sidebar-nav-active-color); background: var(--sidebar-nav-active-bg); box-shadow: var(--sidebar-nav-active-shadow); }
.nav-section { color: var(--sidebar-section-color); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; padding: 18px 12px 7px; }
.sidebar-user { margin-top: auto; border-top: 1px solid var(--sidebar-user-border); padding: 16px 8px 2px; display: flex; gap: 10px; align-items: center; }
.sidebar-user small { color: var(--sidebar-user-muted); font-size: .68rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand); color: #fff; font-weight: 800; flex: 0 0 auto; }
.avatar-sm { width: 32px; height: 32px; }
.app-main { min-width: 0; margin-left: 268px; width: calc(100% - 268px); display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 72px; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 1030; }
.user-menu { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; }
.content-wrapper { flex: 1; max-width: 1680px; }
.app-footer { padding: 18px 24px; border-top: 1px solid var(--border); background: #fff; display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.page-header h1 { font-family: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif; font-size: clamp(1.5rem, 3vw, 2.05rem); margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -.018em; }
.page-header p { color: var(--muted); margin: .35rem 0 0; }
.breadcrumb-small { color: var(--brand-dark); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 800; margin-bottom: 4px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-card { position: relative; overflow: hidden; height: 100%; }
.stat-card .card-body { display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.3rem; }
.stat-card h3 { font-size: 1.55rem; font-weight: 800; margin: 2px 0 0; }
.stat-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.stat-link { color: inherit; }
.stat-link:hover .stat-card { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card { transition: .2s ease; }
.quick-action { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; color: var(--ink); background: #fff; transition: .2s ease; }
.quick-action:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-2px); }
.quick-action i { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand-dark); }
.filter-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.entity-title { font-weight: 700; color: var(--ink); }
.entity-subtitle { color: var(--muted); font-size: .78rem; }
.empty-state { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty-state i { font-size: 2.5rem; color: #c6cbd2; }
.empty-state h3 { color: var(--ink); font-size: 1.1rem; margin: 14px 0 6px; }
.empty-state p { margin: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.detail-item { padding: 14px; background: #fafbfc; border: 1px solid var(--border); border-radius: 12px; }
.detail-item small { display: block; color: var(--muted); margin-bottom: 4px; }
.detail-item strong { overflow-wrap: anywhere; }
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: #e2e5e9; }
.timeline-item { position: relative; padding: 0 0 22px 18px; }
.timeline-dot { position: absolute; left: -25px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline-card { border: 1px solid var(--border); border-radius: 13px; padding: 14px; background: #fff; }
.timeline-card h3 { font-size: 1rem; margin: 0; }
.timeline-meta { color: var(--muted); font-size: .78rem; }
.flash-stack { position: relative; z-index: 2; }
.status-ATIVO, .status-CONFIRMADA, .status-NORMAL { background: #dcfce7; color: #15743c; }
.status-INATIVO, .status-ESTORNADA, .status-VENCIDO { background: #fee2e2; color: #a51e2b; }
.status-ESGOTADO { background: #eef0f3; color: #5d6570; }
.status-PROXIMO_VENCIMENTO, .status-BAIXO { background: #fff1ca; color: #8a5b00; }
.status-BLOQUEADO { background: #ede9fe; color: #5b3ea8; }
.movement-ENTRADA, .movement-AJUSTE_POSITIVO, .movement-DEVOLUCAO_CLIENTE { background: #dcfce7; color: #15743c; }
.movement-SAIDA, .movement-AJUSTE_NEGATIVO, .movement-DEVOLUCAO_FORNECEDOR, .movement-PERDA, .movement-AVARIA { background: #fee2e2; color: #a51e2b; }
.movement-ESTORNO { background: #e9e5ff; color: #5533a7; }
.mobile-sidebar { background: var(--sidebar-bg); color: var(--sidebar-brand-color); width: 300px!important; border-right: var(--sidebar-panel-border); }
.mobile-sidebar .btn-close { filter: none; }
.dropdown-item:active { background: var(--brand); }
.pagination .page-link { color: var(--brand-dark); border-color: var(--border); }
.pagination .active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .app-footer, .no-print, .page-actions, .filter-card { display: none!important; }
  .app-main { margin: 0; width: 100%; }
  .content-wrapper { padding: 0!important; }
  .card { border: 0; }
  .print-only { display: block; }
}

.demo-mode-banner {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0 0 1rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(242, 140, 40, .35);
  border-radius: .8rem;
  background: rgba(242, 140, 40, .10);
  color: #7a3f09;
}
.demo-mode-banner i { font-size: 1.35rem; }
.demo-mode-banner div { display: flex; flex-direction: column; line-height: 1.25; }
.demo-mode-banner span { font-size: .82rem; opacity: .85; }

.quantity-value,
.audit-datetime,
.classic-data-font {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: .02em;
}

.audit-datetime {
  display: inline-block;
  font-size: .98rem;
}

.chart-filter-form .form-select {
  min-width: 220px;
}




.dashboard-movements-table-wrap {
  padding: .2rem 1rem 1rem;
}

.dashboard-movements-table thead th {
  font-size: .76rem;
}

.dashboard-movements-table td,
.dashboard-movements-table th {
  vertical-align: middle;
}

.dashboard-movements-table .entity-title {
  font-size: 1rem;
}

.dashboard-movements-table .entity-subtitle {
  font-size: .82rem;
}

.dashboard-movements-table .quantity-value {
  font-size: 1.04rem;
}

.dashboard-movements-table .btn-light {
  border-color: #eceff3;
  background: #f8f9fb;
}

.dashboard-table-tools {
  min-height: 38px;
}

.dashboard-table-tools .pagination {
  margin: 0;
  gap: .25rem;
}

.dashboard-table-tools .page-link {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px !important;
  border: 1px solid #e8ebf0;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: none;
  font-weight: 700;
}

.dashboard-table-tools .page-item.active .page-link {
  background: var(--brand-soft);
  border-color: #f2d0ad;
  color: var(--brand-dark);
}

.dashboard-table-tools .page-item.disabled .page-link {
  opacity: .45;
  background: #fafbfc;
}

@media (max-width: 991.98px) {
  .dashboard-movements-table-wrap {
    padding: .2rem 0 .8rem;
  }
}

/* DataTables globais: mesmo padrão visual da dashboard */
.app-datatable {
  width: 100% !important;
  margin: 0 !important;
}

.app-datatable thead th {
  background: #fff;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  vertical-align: middle;
}

.app-datatable tbody td {
  vertical-align: middle;
}

.dt-container,
.dataTables_wrapper {
  width: 100%;
  color: var(--ink);
}

.datatable-toolbar,
.datatable-footer {
  background: #fff;
}

.datatable-toolbar {
  border-bottom: 1px solid #f0f1f3;
}

.datatable-footer {
  border-top: 1px solid #f0f1f3;
}

.datatable-length,
.datatable-search,
.datatable-info,
.datatable-pagination {
  min-width: 0;
}

.dt-length,
.dt-search,
.dataTables_length,
.dataTables_filter {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--muted);
  font-size: .82rem;
}

.dt-length label,
.dt-search label,
.dataTables_length label,
.dataTables_filter label {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.dt-length select,
.dataTables_length select {
  min-width: 76px;
  min-height: 38px;
  border: 1px solid #dfe2e7;
  border-radius: 10px;
  background-color: #fff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: none;
}

.dt-search input,
.dataTables_filter input {
  min-width: 240px;
  min-height: 40px;
  margin: 0 !important;
  padding: .5rem .8rem;
  border: 1px solid #dfe2e7 !important;
  border-radius: 10px !important;
  background: #fff;
  color: var(--ink);
  box-shadow: none !important;
}

.dt-search input:focus,
.dataTables_filter input:focus,
.dt-length select:focus,
.dataTables_length select:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .13) !important;
  outline: none;
}

.dt-info,
.dataTables_info {
  color: var(--muted) !important;
  font-size: .82rem;
  padding: 0 !important;
}

.dt-paging .pagination,
.dataTables_paginate .pagination,
.datatable-pagination .pagination,
.dashboard-table-tools .pagination {
  margin: 0;
  gap: .25rem;
  flex-wrap: wrap;
}

.dt-paging .page-link,
.dataTables_paginate .page-link,
.datatable-pagination .page-link,
.dashboard-table-tools .page-link {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px !important;
  border: 1px solid #e8ebf0;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: none;
  font-weight: 700;
}

.dt-paging .page-item.active .page-link,
.dataTables_paginate .page-item.active .page-link,
.datatable-pagination .page-item.active .page-link,
.dashboard-table-tools .page-item.active .page-link {
  background: var(--brand-soft);
  border-color: #f2d0ad;
  color: var(--brand-dark);
}

.dt-paging .page-item.disabled .page-link,
.dataTables_paginate .page-item.disabled .page-link,
.datatable-pagination .page-item.disabled .page-link,
.dashboard-table-tools .page-item.disabled .page-link {
  opacity: .45;
  background: #fafbfc;
}

.dt-column-order::before,
.dt-column-order::after {
  color: var(--brand-dark) !important;
  opacity: .45 !important;
}

.table-responsive > .dt-container,
.table-responsive > .dataTables_wrapper {
  min-width: 100%;
}

@media (max-width: 767.98px) {
  .datatable-toolbar,
  .datatable-footer {
    align-items: stretch !important;
  }

  .dt-length,
  .dt-search,
  .dataTables_length,
  .dataTables_filter {
    width: 100%;
    justify-content: space-between;
  }

  .dt-search input,
  .dataTables_filter input {
    min-width: 0;
    width: 100%;
  }

  .datatable-search {
    width: 100%;
  }

  .datatable-search .dt-search,
  .datatable-search .dataTables_filter {
    width: 100%;
  }

  .datatable-search input {
    flex: 1;
  }

  .datatable-pagination,
  .datatable-pagination .dt-paging,
  .datatable-pagination .dataTables_paginate {
    width: 100%;
  }

  .datatable-pagination .pagination {
    justify-content: center;
  }
}

/* Separação do estoque por classificação */
.stock-overview-grid > [class*='col'] { min-width: 0; }
.stock-overview-card {
  height: 100%;
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stock-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.stock-overview-card.active {
  border-color: currentColor;
  box-shadow: 0 10px 26px rgba(26, 30, 36, .08);
}
.stock-overview-icon {
  width: 45px;
  height: 45px;
  border-radius: 13px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: #f3f4f6;
  font-size: 1.18rem;
}
.stock-overview-content { min-width: 0; display: flex; flex-direction: column; }
.stock-overview-content small { color: var(--muted); font-size: .74rem; font-weight: 700; }
.stock-overview-content strong { margin-top: 1px; font-size: 1.02rem; line-height: 1.25; }
.stock-overview-content span { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.stock-tabs-wrap { overflow-x: auto; padding-bottom: 2px; }
.stock-tabs {
  display: inline-flex;
  min-width: max-content;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
}
.stock-tab {
  padding: 9px 13px;
  border-radius: 9px;
  color: #5e6670;
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
}
.stock-tab:hover { background: var(--brand-soft); color: var(--brand-dark); }
.stock-tab.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(var(--brand-rgb), .2); }
.stock-class-badge { border: 1px solid transparent; padding: .42em .72em; }
.stock-class-all { color: #4f5965; }
.stock-class-all .stock-overview-icon { color: #4f5965; background: #eef0f3; }
.stock-class-material { color: #8a5b00; background: #fff6d9; border-color: #f5dea0; }
.stock-class-material .stock-overview-icon { color: #8a5b00; background: #fff1bd; }
.stock-class-supply { color: #1f5f9b; background: #eaf4ff; border-color: #cfe6fb; }
.stock-class-supply .stock-overview-icon { color: #1f5f9b; background: #dcedff; }
.stock-class-production { color: #a75308; background: #fff0df; border-color: #f6d4ad; }
.stock-class-production .stock-overview-icon { color: #a75308; background: #ffe2c3; }
.stock-class-finished { color: #1f7846; background: #e8f8ef; border-color: #ccebd9; }
.stock-class-finished .stock-overview-icon { color: #1f7846; background: #d7f2e2; }
.stock-overview-card.stock-class-material,
.stock-overview-card.stock-class-supply,
.stock-overview-card.stock-class-production,
.stock-overview-card.stock-class-finished { background: #fff; }
.stock-overview-card.active.stock-class-material { background: #fffaf0; }
.stock-overview-card.active.stock-class-supply { background: #f5faff; }
.stock-overview-card.active.stock-class-production { background: #fff8f1; }
.stock-overview-card.active.stock-class-finished { background: #f4fcf7; }
@media (max-width: 575.98px) {
  .stock-overview-card { min-height: 104px; padding: 13px; gap: 10px; }
  .stock-overview-icon { width: 40px; height: 40px; }
  .stock-overview-content strong { font-size: .9rem; }
}

/* Valorização do estoque */
.valuation-rule-note { color: #5f6670; background: #fff; }
.valuation-summary-grid > [class*='col'] { min-width: 0; }
.valuation-summary-card {
  height: 100%; min-height: 116px; display: flex; align-items: center; gap: 14px;
  padding: 17px; border: 1px solid var(--border); border-radius: 15px; background: #fff;
  color: var(--ink); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.valuation-summary-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); border-color: #f1c89f; }
.valuation-summary-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.28rem; }
.valuation-summary-card > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.valuation-summary-card small { color: var(--muted); font-weight: 700; font-size: .74rem; }
.valuation-summary-card strong { margin-top: 2px; font-size: 1.22rem; line-height: 1.25; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
.valuation-summary-card em { margin-top: 4px; color: var(--muted); font-size: .72rem; font-style: normal; }
.valuation-warning .valuation-summary-icon { background: #fff3cd; color: #8a5b00; }
.valuation-total .valuation-summary-icon { background: #e9f7ee; color: #15743c; }
.valuation-table-card .card-header { min-height: 74px; }
.valuation-money, .valuation-total-value { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; white-space: nowrap; font-variant-numeric: tabular-nums; }
.valuation-money { font-weight: 650; }
.valuation-total-value { font-weight: 800; color: #1f5f3e; }
.curve-badge { min-width: 34px; padding: .45em .72em; border: 1px solid transparent; font-weight: 800; }
.curve-A { background: #fee7d5; color: #a74705; border-color: #f8c69f; }
.curve-B { background: #fff4c9; color: #7e5a00; border-color: #f1dda0; }
.curve-C { background: #e7f1fb; color: #255f91; border-color: #c9dff2; }
.curve-SEM_VALOR { background: #eef0f3; color: #656d77; border-color: #dfe3e8; }
.valuation-detail-stat .card-body { display: flex; flex-direction: column; justify-content: center; min-height: 128px; }
.valuation-detail-stat small { color: var(--muted); font-weight: 700; font-size: .75rem; }
.valuation-detail-stat strong { margin: 7px 0 4px; font-size: 1.35rem; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
.valuation-detail-stat span { color: var(--muted); font-size: .78rem; }
.valuation-detail-stat strong .badge { font-size: 1rem; }
@media (max-width: 991.98px) {
  .valuation-detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 575.98px) {
  .valuation-summary-card { min-height: 105px; padding: 14px; }
  .valuation-summary-icon { width: 42px; height: 42px; }
  .valuation-summary-card strong { font-size: 1.05rem; }
  .valuation-detail-grid { grid-template-columns: 1fr; }
}
@media print {
  .valuation-rule-note { border: 0 !important; padding-left: 0; }
  .valuation-summary-card { min-height: 82px; box-shadow: none; break-inside: avoid; }
  .valuation-table-card { break-inside: auto; }
  .valuation-table-card tr { break-inside: avoid; }
}
.valuation-report-footer { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 14px; padding: 16px 18px; background: #fbfcfd; border-top: 1px solid var(--border); }
.valuation-report-footer > div { min-width: 0; }
.valuation-report-footer small { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.valuation-report-footer strong { display: block; margin-top: 3px; font-size: .86rem; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
.valuation-report-emission { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--border); }
@media (max-width: 991.98px) { .valuation-report-footer { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 575.98px) { .valuation-report-footer { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Módulo de Produção */
.production-kpi-grid .stat-card { min-height: 108px; }
.production-summary-card,
.production-report-card { padding: 16px 18px; min-height: 92px; }
.production-summary-card small,
.production-report-card small,
.production-order-stat small { color: var(--muted); font-weight: 700; }
.production-summary-card strong,
.production-report-card strong { display: block; margin-top: 4px; font-size: 1.45rem; }
.production-order-stat { padding: 18px; min-height: 128px; }
.production-order-stat > strong { display: block; margin: 7px 0; font-size: 1.25rem; }
.production-order-stat > span { color: var(--muted); font-size: .78rem; }
.production-order-status,
.production-stage-status,
.priority-BAIXA,.priority-NORMAL,.priority-ALTA,.priority-URGENTE { padding: .42rem .68rem; }
.status-RASCUNHO { background: #eef0f3; color: #5d6570; }
.status-PROGRAMADA { background: #e7f0ff; color: #245aa5; }
.status-LIBERADA { background: #fff0db; color: #9d5509; }
.status-EM_PRODUCAO { background: #fff1e3; color: #b95d0a; }
.status-PAUSADA { background: #fff1ca; color: #855600; }
.status-CONCLUIDA { background: #dcfce7; color: #15743c; }
.status-CANCELADA { background: #fee2e2; color: #a51e2b; }
.stage-PENDENTE { background: #eef0f3; color: #5d6570; }
.stage-LIBERADA { background: #e7f0ff; color: #245aa5; }
.stage-EM_ANDAMENTO { background: #fff1e3; color: #b95d0a; }
.stage-CONCLUIDA { background: #dcfce7; color: #15743c; }
.stage-BLOQUEADA { background: #f3f0f7; color: #71657d; }
.stage-CANCELADA { background: #fee2e2; color: #a51e2b; }
.priority-BAIXA { background: #eef0f3; color: #5d6570; }
.priority-NORMAL { background: #e7f0ff; color: #245aa5; }
.priority-ALTA { background: #fff1ca; color: #855600; }
.priority-URGENTE { background: #fee2e2; color: #a51e2b; }
.production-mini-progress { width: 100%; min-width: 90px; height: 7px; overflow: hidden; border-radius: 999px; background: #edf0f3; }
.production-mini-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),#ffaf61); }
.production-progress-row { display: flex; align-items: center; gap: 8px; }
.production-progress-row small { min-width: 42px; color: var(--muted); }
.production-task-list { display: flex; flex-direction: column; }
.production-task-item { display: flex; align-items: center; gap: 11px; padding: 13px 16px; color: var(--ink); border-bottom: 1px solid var(--border); }
.production-task-item:last-child { border-bottom: 0; }
.production-task-item:hover { background: #fffaf5; color: var(--brand-dark); }
.production-task-item > div { flex: 1; min-width: 0; }
.production-task-item strong,.production-task-item small { display: block; }
.production-task-item small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.production-task-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand-dark); }
.production-simple-list { display: flex; flex-direction: column; }
.production-simple-list a { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--border); color: var(--ink); }
.production-simple-list a:last-child { border-bottom: 0; }
.production-simple-list a:hover strong { color: var(--brand-dark); }
.production-simple-list strong,.production-simple-list span { display: block; }
.production-simple-list span,.production-simple-list small { color: var(--muted); font-size: .78rem; }
.production-flow-preview { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 18px; border: 1px dashed #efc394; border-radius: 14px; background: #fffaf5; }
.production-flow-preview span { display: flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 10px; background: #fff; border: 1px solid #f2dfca; font-weight: 700; }
.production-flow-preview span i { color: var(--brand-dark); }
.production-flow-preview > i { color: #bc8c5f; }
.production-timeline { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; position: relative; }
.production-stage-card { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px; min-height: 104px; padding: 15px; border: 1px solid var(--border); border-radius: 15px; background: #fff; }
.production-stage-card.is-current { border-color: #efb678; box-shadow: 0 10px 26px rgba(var(--brand-rgb),.12); }
.production-stage-card.is-complete { background: #fbfffc; border-color: #bde8ca; }
.production-stage-number { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #eef0f3; color: #5d6570; font-weight: 800; }
.production-stage-card.is-complete .production-stage-number { background: #20a45b; color: #fff; }
.production-stage-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.1rem; }
.production-stage-content strong,.production-stage-content small { display: block; }
.production-stage-content .badge { margin: 4px 0; }
.production-stage-content small { color: var(--muted); font-size: .7rem; }
.production-stage-chip { background: var(--brand-soft); color: var(--brand-dark); }
.production-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.production-stage-header .card-body { display: flex; align-items: center; gap: 14px; }
.production-stage-header h2 { margin: 2px 0 6px; font-size: 1.5rem; }
.production-stage-header small,.production-stage-header strong { display: block; }
.production-stage-big-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.55rem; }
.production-calculation-box { padding: 16px; border-radius: 13px; background: #fff7ef; border: 1px solid #f1d2b2; }
.production-calculation-box small,.production-calculation-box strong,.production-calculation-box span { display: block; }
.production-calculation-box strong { margin: 5px 0; color: var(--brand-dark); font-size: 1.5rem; }
.production-calculation-box span { color: var(--muted); font-size: .75rem; }
.production-conclude-switch { padding: 14px 18px 14px 54px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.production-conclude-switch .form-check-input { margin-left: -38px; }
.production-conclude-switch small { display: block; color: var(--muted); }
.planned-consumption { color: var(--muted); font-weight: 700; white-space: nowrap; }
.lot-balance { white-space: nowrap; font-weight: 700; }

@media (max-width: 1199.98px) {
  .production-timeline { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .production-stage-card { grid-template-columns: auto auto 1fr; }
  .production-stage-actions { grid-column: 1/-1; }
  .production-stage-actions .btn { width: 100%; }
  .production-stage-header .card-body { align-items: flex-start; flex-wrap: wrap; }
  .production-stage-header .ms-auto { width: 100%; text-align: left !important; }
  .production-detail-grid { grid-template-columns: 1fr; }
  .production-flow-preview > i { transform: rotate(90deg); }
}


/* ============================================================
   Checklist de rastreabilidade — estilos aditivos
   ============================================================ */
.status-DISPONIVEL, .status-ATIVA, .status-PRONTO, .status-CONFIRMADO, .status-RECEBIDA, .status-FINALIZADO { background:#dcfce7; color:#15743c; }
.status-PARCIALMENTE_UTILIZADO, .status-PARCIAL, .status-AGUARDANDO_CHEGADA { background:#fff1e3; color:#b95d0a; }
.status-ESGOTADO, .status-INATIVA { background:#eef0f3; color:#5d6570; }
.status-BLOQUEADO_PAL { background:#ede9fe; color:#5b3ea8; }
.status-CORTE { background:#e7f0ff; color:#245aa5; }
.status-SALMOURA { background:#e0f2fe; color:#075985; }
.status-SALGA { background:#fff1ca; color:#855600; }
.status-MATERIA_PRIMA { background:#fef3c7; color:#92500e; }
.status-INSUMO { background:#ede9fe; color:#5b3ea8; }
.code-chip { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; font-weight:700; background:var(--brand-soft); color:var(--brand-dark); border-radius:8px; padding:2px 8px; font-size:.8rem; }
.qr-box { text-align:center; padding:16px; border:1px solid var(--border); border-radius:14px; background:#fff; }
.qr-box img { width:180px; height:180px; image-rendering:pixelated; }
.qr-box .qr-code { margin-top:10px; font-weight:700; letter-spacing:.02em; }
.qr-actions { display:flex; gap:8px; justify-content:center; margin-top:10px; }
@media print { .qr-box { border:0; } }
.compose-row { display:grid; grid-template-columns:1fr auto auto; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--border); border-radius:12px; margin-bottom:8px; background:#fafbfc; }
.compose-row .compose-type { font-size:.72rem; }
.kanban-board { display:flex; gap:14px; overflow-x:auto; padding-bottom:8px; }
.kanban-col { flex:0 0 288px; background:#f5f6f8; border:1px solid var(--border); border-radius:16px; display:flex; flex-direction:column; }
.kanban-col-head { padding:12px 14px; font-weight:700; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--border); }
.kanban-col-head .count { background:#fff; border:1px solid var(--border); border-radius:999px; font-size:.72rem; padding:1px 9px; color:var(--muted); }
.kanban-col-body { padding:12px; display:flex; flex-direction:column; gap:10px; min-height:80px; }
.kanban-card { background:#fff; border:1px solid var(--border); border-radius:13px; padding:12px; transition:.15s ease; border-left:4px solid var(--brand); }
.kanban-card:hover { box-shadow:var(--shadow); transform:translateY(-1px); }
.kanban-card h4 { font-size:.95rem; margin:0 0 4px; font-weight:700; }
.kanban-card .kmeta { color:var(--muted); font-size:.75rem; display:flex; flex-wrap:wrap; gap:4px 10px; margin-top:6px; }
.kanban-col[data-stage="CORTE"] .kanban-card { border-left-color:#2f6fd6; }
.kanban-col[data-stage="SALMOURA"] .kanban-card { border-left-color:#0891b2; }
.kanban-col[data-stage="SALGA"] .kanban-card { border-left-color:#d69a1e; }
.kanban-col[data-stage="PRONTO"] .kanban-card { border-left-color:#22a559; }
.kanban-col[data-stage="CANCELADO"] .kanban-card { border-left-color:#c0424f; opacity:.75; }
.flow-steps { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.flow-step { flex:1; min-width:120px; text-align:center; padding:10px; border:1px solid var(--border); border-radius:12px; background:#fff; font-size:.8rem; color:var(--muted); }
.flow-step.done { background:var(--brand-soft); color:var(--brand-dark); border-color:transparent; font-weight:700; }
.flow-step.current { border-color:var(--brand); color:var(--brand-dark); font-weight:700; }
.scan-field { display:flex; gap:8px; } .scan-field .btn { white-space:nowrap; }
