/* Padrão visual das páginas financeiras, comerciais, de estoque e de rotina. */
#gainsCalcView .gains-curve-a { --curve-ink:#146c43; --curve-bg:#eaf8ef; --curve-head:#d5efdf; }
#gainsCalcView .gains-curve-b { --curve-ink:#8a5b10; --curve-bg:#fff6e5; --curve-head:#f8e8c5; }
#gainsCalcView .gains-curve-c { --curve-ink:#a53041; --curve-bg:#fdeef0; --curve-head:#f7dce1; }
#gainsCalcView .gains-curve-row > td { background:var(--curve-bg) !important; }
#gainsCalcView .gains-curve-heading > th { background:var(--curve-head) !important; color:var(--curve-ink); padding:12px 16px; font-size:.8rem; }
#gainsCalcView .gains-curve-heading span { margin-left:14px; font-weight:400; font-size:.73rem; }
#gainsCalcView .gains-curve-badge { display:inline-flex; align-items:center; justify-content:center; width:29px; height:29px; border:1px solid currentColor; border-radius:8px; color:var(--curve-ink); background:var(--curve-head); font-weight:750; font-size:.8rem; }
#gainsCalcView .gains-curve-cell { width:65px; text-align:center; }
#gainsCalcView .gains-curve-legend { padding:18px 20px; border-bottom:1px solid var(--ws-border); }
#gainsCalcView .gains-curve-legend > strong { color:var(--ws-heading); font-size:.88rem; }
#gainsCalcView .gains-curve-legend p { color:var(--ws-muted); font-size:.76rem; margin:6px 0 12px; max-width:900px; }
#gainsCalcView .gains-curve-legend > div { display:flex; flex-wrap:wrap; gap:10px; }
#gainsCalcView .gains-curve-key { display:inline-flex; align-items:center; gap:9px; color:var(--curve-ink); background:var(--curve-bg); border-radius:9px; padding:7px 12px; font-size:.76rem; }
[data-bs-theme="dark"] #gainsCalcView .gains-curve-a { --curve-ink:#83d9b6; --curve-bg:#17372b; --curve-head:#204a38; }
[data-bs-theme="dark"] #gainsCalcView .gains-curve-b { --curve-ink:#edca85; --curve-bg:#392f1c; --curve-head:#514226; }
[data-bs-theme="dark"] #gainsCalcView .gains-curve-c { --curve-ink:#ffa8b5; --curve-bg:#3c232d; --curve-head:#54303e; }
.content, .content-inner { min-width:0; max-width:100%; }
.view-section { min-width:0; max-width:100%; }
.workspace {
  --ws-border:#dce4ef;
  --ws-panel:#fff;
  --ws-muted:#62738a;
  --ws-heading:#243951;
  --ws-soft:#f2f5fa;
}
.workspace-intro { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:24px 28px; border-radius:16px; background:linear-gradient(120deg,#142d50,#245583); color:#fff; }
.workspace-intro-copy { min-width:0; }
.workspace-eyebrow { font-size:.65rem; font-weight:700; letter-spacing:.14em; color:#b3d9ff; margin-bottom:7px; }
.workspace-intro h4 { display:flex; align-items:center; gap:10px; margin:0 0 7px; font-weight:750; font-size:1.4rem; }
.workspace-intro h4 i { font-size:1.25rem; }
.workspace-intro p { color:#d9e7f5; font-size:.88rem; margin:0; max-width:760px; }
.workspace-seal { display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border:1px solid #ffffff45; border-radius:24px; font-size:.78rem; white-space:nowrap; }
.workspace-tabs { display:flex; flex-wrap:wrap; gap:8px; }
.workspace-tab { display:inline-flex; align-items:center; gap:7px; border:1px solid #dce4ef; border-radius:9px; padding:10px 15px; background:#fff; color:#526477; font-size:.8rem; font-weight:600; }
.workspace-tab:hover { border-color:#8cb3e7; background:#f4f8ff; }
.workspace-tab.active { color:#235fa8; border-color:#8cb3e7; background:#eaf3ff; }
.workspace-tab:focus-visible { outline:3px solid #8cb3e7; outline-offset:2px; }
.workspace .card { border-radius:13px; min-width:0; box-shadow:0 3px 14px #22395708 !important; }
.workspace .card-body { min-width:0; }
.workspace .card-header { padding:18px 20px; border-radius:13px 13px 0 0; }
.workspace .card-header h5 { font-size:1rem; color:var(--ws-heading); }
.workspace .card-header h6 { color:var(--ws-heading); }
.workspace .card-header:not(.bg-primary):not(.bg-success):not(.bg-warning):not(.bg-info) { background:var(--ws-panel); }
.workspace .form-label { font-size:.78rem; font-weight:600; color:var(--ws-heading); }
.workspace .form-control, .workspace .form-select { border-color:var(--ws-border); border-radius:8px; min-height:37px; font-size:.82rem; }
.workspace .btn { border-radius:8px; }
.workspace .btn-sm { padding:8px 12px; font-size:.78rem; }
.workspace-filter-title { display:flex; align-items:center; gap:8px; color:var(--ws-heading); font-size:.9rem; font-weight:700; margin-bottom:18px; }
.workspace-filter-title i { color:#588fd6; }
.workspace-actions { border-top:1px solid var(--ws-border); padding-top:16px; margin-top:20px; }
.workspace .table { font-size:.82rem; color:var(--ws-heading); margin-bottom:0; }
.workspace .table th { background:var(--ws-soft); font-size:.72rem; font-weight:700; vertical-align:middle; }
.workspace .table td, .workspace .table th { padding:13px 15px; vertical-align:middle; }
.workspace .table tfoot { font-weight:700; }
.workspace .table-responsive { border-radius:0 0 13px 13px; }
.workspace .table-responsive .btn-sm { padding:5px 8px; }
.workspace .table td .btn-group { white-space:nowrap; }
.workspace .table th[data-field]:hover { background:#e5eefb; }
.workspace .table td strong { font-weight:650; }
.workspace .alert { border-radius:11px; font-size:.83rem; }
.workspace .badge { font-weight:600; }
.workspace .ml-comparison-value { font-size:1.7rem; color:var(--ws-ink,#235fa8); font-weight:750; overflow-wrap:anywhere; }
.workspace-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.workspace-metrics-status { grid-column:1/-1; display:flex; align-items:center; gap:9px; padding:18px; border:1px solid var(--ws-border); background:var(--ws-panel); color:var(--ws-muted); border-radius:12px; font-size:.83rem; }
.workspace .ws-tone-blue, .ws-tone-blue { --ws-ink:#235fa8; --ws-tint:#eef5ff; --ws-edge:#cfdef3; }
.workspace .ws-tone-green, .ws-tone-green { --ws-ink:#087a55; --ws-tint:#edfaf3; --ws-edge:#c5e8d8; }
.workspace .ws-tone-purple, .ws-tone-purple { --ws-ink:#7244ac; --ws-tint:#f6f0ff; --ws-edge:#e0d2f2; }
.workspace .ws-tone-amber, .ws-tone-amber { --ws-ink:#8a5b10; --ws-tint:#fff8e9; --ws-edge:#f0ddb6; }
.workspace .ws-tone-red, .ws-tone-red { --ws-ink:#ba3044; --ws-tint:#fff1f2; --ws-edge:#f3ccd2; }
.workspace .workspace-stat, .workspace-stat { min-width:0; border:1px solid var(--ws-edge,#cfdef3) !important; border-top:4px solid var(--ws-ink,#235fa8) !important; background:var(--ws-tint,#eef5ff) !important; color:var(--ws-ink,#235fa8); border-radius:13px; padding:18px; }
.workspace-stat-label { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:.8rem; font-weight:600; }
.workspace-stat-label > i { font-size:1.25rem; flex-shrink:0; }
.workspace-stat > strong { display:block; margin:12px 0 7px; font-size:1.8rem; line-height:1.2; font-weight:750; overflow-wrap:anywhere; }
.workspace-stat > small { color:var(--ws-muted,#62738a); font-size:.73rem; }
.workspace .card.workspace-stat { padding:0; height:100%; }
.workspace .card.workspace-stat > .card-body { background:transparent; padding:18px !important; text-align:left !important; }
.workspace .card.workspace-stat.p-3 { padding:18px !important; }
.workspace .workspace-stat .h5, .workspace .workspace-stat h5, .workspace .workspace-stat h4, .workspace .workspace-stat .gains-metric-value { color:var(--ws-ink) !important; font-size:1.65rem; font-weight:750; margin-top:8px; overflow-wrap:anywhere; }
.workspace .workspace-stat .text-muted { color:var(--ws-muted) !important; }
.workspace .workspace-stat .card-body > p:first-child { font-weight:600; font-size:.78rem; }
.workspace-stock-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.workspace-stock-metrics > [class*="col-"] { width:auto; padding:0; min-width:0; }
/* Mesmos cartões também para resumos criados após a consulta. */
#mlToDateSummary > div:nth-child(4n+1), #financeComparativeContainer > .row[aria-live] > div:nth-child(4n+1), #financeRecordsResults > .row:first-child > div:nth-child(4n+1) { --ws-ink:#235fa8; --ws-tint:#eef5ff; --ws-edge:#cfdef3; }
#mlToDateSummary > div:nth-child(4n+2), #financeComparativeContainer > .row[aria-live] > div:nth-child(4n+2), #financeRecordsResults > .row:first-child > div:nth-child(4n+2) { --ws-ink:#087a55; --ws-tint:#edfaf3; --ws-edge:#c5e8d8; }
#mlToDateSummary > div:nth-child(4n+3), #financeComparativeContainer > .row[aria-live] > div:nth-child(4n+3), #financeRecordsResults > .row:first-child > div:nth-child(4n+3) { --ws-ink:#7244ac; --ws-tint:#f6f0ff; --ws-edge:#e0d2f2; }
#mlToDateSummary > div:nth-child(4n+4), #financeComparativeContainer > .row[aria-live] > div:nth-child(4n+4), #financeRecordsResults > .row:first-child > div:nth-child(4n+4) { --ws-ink:#8a5b10; --ws-tint:#fff8e9; --ws-edge:#f0ddb6; }
#mlToDateSummary .card, #financeComparativeContainer > .row[aria-live] .card, #financeRecordsResults > .row:first-child .card { background:var(--ws-tint) !important; border:1px solid var(--ws-edge) !important; border-top:4px solid var(--ws-ink) !important; }
.workspace .workspace-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px; gap:10px; border:1px dashed var(--ws-border); border-radius:12px; background:var(--ws-panel); color:var(--ws-muted); }
.workspace-empty > i { font-size:1.8rem; color:#8ea7c5; }
/* Colunas e cartões do planner mantêm as cores de status e prioridade. */
#plannerKanban > div > .card { border:1px solid var(--ws-border) !important; background:var(--ws-soft); }
#plannerKanban > div:nth-child(1) > .card > .card-header { border-top:4px solid #c18b25; }
#plannerKanban > div:nth-child(2) > .card > .card-header { border-top:4px solid #3979c6; }
#plannerKanban > div:nth-child(3) > .card > .card-header { border-top:4px solid #22946e; }
#plannerKanban > div > .card > .card-body { min-height:180px; }
#plannerKanban .card .card .card-body { padding:15px !important; }
#plannerKanban .card-title { line-height:1.4; overflow-wrap:anywhere; }
#plannerKanban .btn-group { margin-left:8px; }
#checklistContent > .card > .card-header { background:var(--ws-soft) !important; color:var(--ws-heading) !important; }
#checklistContent .row { row-gap:18px; }
#checklistContent .list-group-item { padding:14px; font-size:.83rem; overflow-wrap:anywhere; }
#checklistContent .list-group-item.bg-secondary { background:#eaf1fa !important; color:#235fa8 !important; font-size:.75rem; }
#checklistContent .list-group-item:not(.bg-secondary) { background:var(--ws-panel) !important; border-color:var(--ws-border) !important; }
#checklistContent #activitiesLibrary { background:var(--ws-soft) !important; border-radius:0 0 12px 12px; }
#checklistContent #userChecklistDropZone { border:2px dashed #acc6e7 !important; border-radius:0 0 12px 12px; background:var(--ws-panel) !important; }
#checklistContent .checklist-item-checkbox { width:17px; height:17px; accent-color:#087a55; flex-shrink:0; }
/* Mantém as cores solicitadas dos grupos e a seleção de linhas da saúde. */
#stockHealthView .table th { font-size:.7rem; }
#stockHealthView .table td, #stockHealthView .table th { padding:11px 12px; }
#stockHealthView .stock-health-table-wrap { border-radius:12px; }
/* Janelas de cadastro seguem a mesma linguagem das páginas. */
.modal .modal-content { border-radius:15px; }
.modal .modal-header { padding:19px 22px; }
.modal .modal-title { font-weight:700; }
.modal .modal-footer { border-color:#dce4ef; gap:7px; }
/* Contraste consistente no tema escuro, inclusive nas páginas já redesenhadas. */
[data-bs-theme="dark"] .workspace { --ws-border:#33465e; --ws-panel:#172638; --ws-muted:#b0bfd2; --ws-heading:#e0e9f5; --ws-soft:#1e3046; }
[data-bs-theme="dark"] #pageTitle, [data-bs-theme="dark"] .sidebar-title h5 { color:#e0e9f5; }
[data-bs-theme="dark"] .workspace-intro { background:linear-gradient(120deg,#142d50,#245583) !important; }
[data-bs-theme="dark"] .workspace-tab, [data-bs-theme="dark"] .system-workspace .system-tab, [data-bs-theme="dark"] .ads-workspace .ads-tab { background:#172638; border-color:#33465e; color:#bdcce0; }
[data-bs-theme="dark"] .workspace-tab.active, [data-bs-theme="dark"] .system-workspace .system-tab.active, [data-bs-theme="dark"] .ads-workspace .ads-tab.active { background:#203e60; border-color:#4a79b2; color:#b3d9ff; }
[data-bs-theme="dark"] .workspace-tab:hover { background:#203e60; }
[data-bs-theme="dark"] .workspace .ws-tone-blue { --ws-ink:#9cc7ff; --ws-tint:#192f4a; --ws-edge:#345781; }
[data-bs-theme="dark"] .workspace .ws-tone-green { --ws-ink:#83d9b6; --ws-tint:#153a31; --ws-edge:#316851; }
[data-bs-theme="dark"] .workspace .ws-tone-purple { --ws-ink:#cfb0fa; --ws-tint:#302443; --ws-edge:#61447f; }
[data-bs-theme="dark"] .workspace .ws-tone-amber { --ws-ink:#edca85; --ws-tint:#3c321e; --ws-edge:#76613a; }
[data-bs-theme="dark"] .workspace .ws-tone-red { --ws-ink:#ffa8b5; --ws-tint:#3b222e; --ws-edge:#78404f; }
[data-bs-theme="dark"] .workspace .ml-comparison-value { color:#b3d9ff; }
[data-bs-theme="dark"] #mlToDateSummary .card, [data-bs-theme="dark"] #financeComparativeContainer > .row[aria-live] .card, [data-bs-theme="dark"] #financeRecordsResults > .row:first-child .card { background:#1e3046 !important; border-color:#426086 !important; }
[data-bs-theme="dark"] #checklistContent .list-group-item.bg-secondary { background:#203e60 !important; color:#b3d9ff !important; }
@media(max-width:1199px) {
  .workspace-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workspace-stock-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(min-width:768px) and (max-width:1399px) {
  #gainsCalcView .workspace-filter-title + .row > .col-md-2 { width:33.333333%; }
}
@media(max-width:767px) {
  .workspace-intro { padding:20px; align-items:flex-start; flex-direction:column; gap:14px; }
  .workspace-intro h4 { font-size:1.2rem; }
  .workspace-seal { padding:6px 10px; font-size:.7rem; }
  .workspace-tab { padding:9px 11px; font-size:.75rem; }
  .workspace-metrics, .workspace-stock-metrics { gap:10px; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workspace-stat { padding:14px; }
  .workspace-stat > strong { font-size:1.35rem; }
  .workspace-stat-label { font-size:.73rem; }
  .workspace-stat-label > i { font-size:1rem; }
  .workspace .card.workspace-stat > .card-body { padding:14px !important; }
  .workspace .workspace-stat h5, .workspace .workspace-stat h4, .workspace .workspace-stat .h5 { font-size:1.3rem; }
  .workspace .card-header { padding:16px; flex-wrap:wrap; gap:12px; }
  .workspace .card-header > .d-flex { flex-wrap:wrap; }
  .workspace .table-responsive .table { min-width:620px; }
  #stockSummaryRow > div:last-child { grid-column:1/-1; }
}
@media(prefers-reduced-motion:reduce) {
  .workspace *, .workspace *::before, .workspace *::after { scroll-behavior:auto !important; transition:none !important; }
}
