/* Gerado a partir do style.css do Compras original: preso em .modulo-compras, com as cores do Contando Comigo. */
.content:has(.modulo-compras.largo) { max-width: none; }
.modulo-compras { font-size: 14px; }
:root { --blue: #0EA5E9; --blue-soft: #E8F7FD; }
.modulo-compras .num { font-variant-numeric: tabular-nums; text-align: right; }
.modulo-compras.largo { max-width: none; margin: 0; }
.modulo-compras .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.modulo-compras .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.modulo-compras .kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.modulo-compras .kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.modulo-compras .kpi-value { font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 600; }
.modulo-compras table.ledger { width: 100%; border-collapse: collapse; }
.modulo-compras table.ledger th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.modulo-compras table.ledger th.num, .modulo-compras table.ledger td.num { text-align: right; }
.modulo-compras table.ledger td { padding: 10px; border-bottom: 1px solid var(--surface2); font-size: 14px; }
.modulo-compras table.ledger tbody tr:hover { background: var(--surface2); cursor: pointer; }
.modulo-compras .badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.modulo-compras .badge-green { background: var(--green-soft); color: var(--green); }
.modulo-compras .badge-red { background: var(--red-soft); color: var(--red); }
.modulo-compras .badge-amber { background: var(--amber-soft); color: var(--amber); }
.modulo-compras .badge-blue { background: var(--blue-soft); color: var(--blue); }
.modulo-compras .badge-muted { background: var(--surface2); color: var(--muted); }
.modulo-compras .btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text); }
.modulo-compras .btn:hover { background: var(--surface2); }
.modulo-compras .btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.modulo-compras .btn-primary:hover { background: #ea6a0e; }
.modulo-compras .btn-sm { padding: 4px 10px; font-size: 12px; }
.modulo-compras .btn-danger { color: var(--red); }
.modulo-compras .btn-blue { background: var(--blue); border-color: var(--blue); color: white; }
.modulo-compras .btn-blue:hover { background: #0c8fc7; }
.modulo-compras .btn-danger-soft { background: var(--red-soft); border-color: var(--red-soft); color: var(--red); }
.modulo-compras .btn-danger-soft:hover { background: #fbd8d8; }
.modulo-compras label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--muted); }
.modulo-compras input[type="checkbox"] { width: auto; padding: 0; margin: 0; flex-shrink: 0; }
.modulo-compras input, .modulo-compras select, .modulo-compras textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.modulo-compras .field { margin-bottom: 14px; }
.modulo-compras .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.modulo-compras .pill-toggle { display: inline-flex; background: var(--surface2); border-radius: 20px; padding: 3px; gap: 2px; }
.modulo-compras .pill-toggle button { border: none; background: transparent; padding: 6px 14px; border-radius: 18px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--muted); }
.modulo-compras .pill-toggle button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.cmp-backdrop.modulo-compras { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modulo-compras .cmp-sheet { background: var(--surface); width: 100%; max-width: 640px; border-radius: 16px 16px 0 0; padding: 20px; max-height: 88vh; overflow-y: auto; animation: slideUp 0.2s ease; }
.cmp-backdrop.modulo-compras.centered { align-items: center; padding: 16px; }
.cmp-backdrop.modulo-compras.centered .cmp-sheet { max-height: calc(100vh - 32px); }
.cmp-backdrop.modulo-compras.centered .cmp-sheet { border-radius: 16px; }
.cmp-backdrop.modulo-compras.centered.com-lista .cmp-sheet { min-height: 420px; }
.modulo-compras .switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.modulo-compras .switch input { opacity: 0; width: 0; height: 0; }
.modulo-compras .switch-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 22px; transition: 0.2s; }
.modulo-compras .switch-slider:before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.modulo-compras .switch input:checked + .switch-slider { background: var(--accent); }
.modulo-compras .switch input:checked + .switch-slider:before { transform: translateX(18px); }
.modulo-compras .autocomplete { position: relative; }
.modulo-compras .autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; max-height: 220px; overflow-y: auto; z-index: 10; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.modulo-compras .grupo-cabecalho td { background: var(--surface2); font-weight: 600; font-size: 13px; letter-spacing: .02em; padding-top: 10px; padding-bottom: 10px; }
.modulo-compras .autocomplete-item { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.modulo-compras .autocomplete-item:hover { background: var(--surface2); }
.modulo-compras .autocomplete-item.new { color: var(--accent); font-weight: 500; }
.modulo-compras h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.modulo-compras h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.modulo-compras .page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.modulo-compras .muted { color: var(--muted); font-size: 13px; }
.modulo-compras .text-right { text-align: right; }
.modulo-compras .collapsible-toggle { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 500; }
.modulo-compras .hidden { display: none !important; }
.modulo-compras .bar-track { background: var(--surface2); border-radius: 6px; height: 8px; overflow: hidden; }
.modulo-compras .bar-fill { background: var(--accent); height: 100%; }
.modulo-compras .btn-voltar { margin: 8px 0 12px 36px; }
.modulo-compras table.dash-tab { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.modulo-compras table.dash-tab th, .modulo-compras table.dash-tab td { text-align: center; white-space: nowrap; min-width: 76px; }
.modulo-compras table.dash-tab th { font-size: 11px; font-weight: 500; letter-spacing: 0.04em; }
.modulo-compras table.dash-tab th.num, .modulo-compras table.dash-tab td.num { text-align: center; }
.modulo-compras table.dash-tab thead tr:first-child th:first-child, .modulo-compras table.dash-tab tbody td:first-child { text-align: left; min-width: 170px; }
.modulo-compras table.dash-tab td { font-size: 13px; border-bottom: 1px solid var(--border); padding: 9px 10px; }
.modulo-compras table.dash-tab tr[data-grupo] td, .modulo-compras table.dash-tab tr.grupo-cabecalho td { text-align: left; }
.modulo-compras .pill-lucro { display: inline-block; min-width: 52px; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.modulo-compras table.dash-tab tfoot td:first-child { text-align: left; }
.modulo-compras table.dash-tab tfoot td { border-bottom: 0; }
.modulo-compras .dash-scroll { max-height: max(360px, calc(100vh - 150px)); overflow: auto; }
.modulo-compras table.dash-tab thead th { position: sticky; background: var(--surface); z-index: 3; }
.modulo-compras table.dash-tab thead tr:first-child th { top: 0; }
.modulo-compras table.dash-tab thead tr:nth-child(2) th { top: var(--dash-h1, 34px); }
.modulo-compras table.dash-tab thead tr:first-child th:first-child { z-index: 5 !important; top: 0; }
.modulo-compras td.cel-edit { cursor: text; }
.modulo-compras td.cel-edit:hover { outline: 1px dashed var(--border-strong); outline-offset: -3px; background: var(--surface2); }
.modulo-compras td.cel-edit input { width: 82px; text-align: center; }
.modulo-compras table.dash-tab tr.grupo-cabecalho td.cel-lote { text-align: center; font-weight: 400; font-size: 11px; color: var(--accent); cursor: pointer; white-space: nowrap; }
.modulo-compras table.dash-tab tr.grupo-cabecalho td.cel-lote:hover { text-decoration: underline; }
.modulo-compras table.dash-tab tr.grupo-cabecalho td.cel-lote input { width: 74px; font-size: 12px; text-align: center; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
