.simple-profit { border-top:4px solid #287b87; }
.profit-intro { color:#596978; margin:8px 0 20px; }
.profit-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:16px; margin-bottom:20px; }
.profit-toolbar label { min-width:180px; }
.profit-toolbar input,.profit-toolbar select { width:100%; }
.profit-table { min-width:870px; }
#simple-profit .table-wrap { overflow:auto; max-width:100%; }
.simple-profit { min-width:0; }
.profit-table th { white-space:nowrap; }
.profit-table input,.profit-table select { min-width:85px; width:100%; }
.profit-table td:last-child { min-width:76px; }
.profit-table td:last-child button { white-space:nowrap; }
.profit-table textarea { min-width:190px; width:100%; min-height:58px; }
.profit-fees { display:grid; grid-template-columns:repeat(auto-fit,minmax(195px,1fr)); gap:14px; margin:14px 0 24px; }
.profit-fees label { display:flex; flex-direction:column; gap:6px; }
.profit-fees label[hidden] { display:none; }
.profit-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; }
.profit-summary article { background:#f3f7f9; border:1px solid #e0e9ed; padding:18px; border-radius:10px; }
.profit-summary small { display:block; color:#596978; margin-bottom:8px; }
.profit-summary strong { font-size:22px; color:#173f4b; }
.profit-summary article:last-child { background:#e7f3ed; }
.profit-summary .loss strong { color:#a83131; }
.profit-status { min-height:24px; color:#a83131; margin-top:12px; }
.profit-note { font-size:13px; color:#637482; margin:12px 0; }
#profit-legacy { margin:20px 0; }
#profit-legacy summary { cursor:pointer; font-weight:600; color:#526878; padding:14px; }
.profit-quote-summary { margin:12px 0; padding:14px 18px; background:#edf6f4; border-radius:8px; }
.profit-preview-banner { background:#fff3ce; padding:10px 18px; border-radius:8px; margin-bottom:14px; color:#785b10; }
@media print { .simple-profit,.profit-quote-summary,.profit-preview-banner,#profit-legacy > summary { display:none!important; } }
@media(max-width:700px) { body:has(#simple-profit) .module-nav { align-items:center; max-height:78px; } body:has(#simple-profit) .module-nav button { min-height:48px; flex-shrink:0; } }

/* Clear hierarchy for the new calculation and the retained packing section. */
#simple-profit { border:1px solid #dce7ee; border-top:4px solid #267d91; padding:30px; border-radius:20px; box-shadow:0 12px 34px #223b5010; }
#simple-profit h2 { font-size:24px; letter-spacing:.02em; color:#173c49; margin-bottom:12px; }
#simple-profit .profit-intro { margin:0 0 22px; font-size:14px; line-height:1.8; }
#simple-profit h3 { font-size:16px; color:#40566b; margin:26px 0 14px; }
.profit-toolbar { background:#f3f7fa; border:1px solid #e0e8ef; border-radius:14px; padding:18px 20px; gap:18px; }
.profit-toolbar label { font-size:13px; flex:0 1 220px; }
#simple-profit select { appearance:auto; border:1px solid #cfdae3; border-radius:9px; padding:11px 12px; font:inherit; background:#fff; color:#263f53; }
#simple-profit input,#simple-profit textarea { border-color:#d4dee7; background:#fff; border-radius:9px; font-size:14px; }
#simple-profit input:focus,#simple-profit textarea:focus,#simple-profit select:focus { outline:3px solid #318ba91b; border-color:#318ba9; }
#simple-profit button { font-size:14px; padding:11px 16px; border-radius:9px; }
#simple-profit #profit-save { background:#236b83; color:#fff; margin-left:auto; }
#simple-profit button:disabled { opacity:.4; cursor:not-allowed; }
#simple-profit .table-wrap { border:1px solid #dce5ec; border-radius:12px; }
.profit-table { font-size:14px; }
.profit-table th { padding:14px 12px; background:#edf3f7; color:#617587; font-size:12px; font-weight:650; }
.profit-table td { padding:16px 12px; border-bottom:1px solid #edf1f5; }
.profit-table tbody tr:last-child td { border-bottom:0; }
.profit-table th:nth-child(5),.profit-table td:nth-child(5) { background:#fff8ec; }
.profit-table th:nth-child(6),.profit-table td:nth-child(6) { background:#eef6ff; }
.profit-table td:nth-child(7) { color:#a46520; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.profit-table [data-profit-delete] { background:#fff0ee; color:#ae554b; font-size:12px!important; padding:8px 12px!important; }
.profit-fees { grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.profit-fees label { background:#faf7f1; border:1px solid #eee2d0; padding:15px; border-radius:12px; color:#8b6a35; font-size:13px; gap:10px; }
.profit-fees input { font-variant-numeric:tabular-nums; }
.profit-summary { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:26px; }
.profit-summary article { position:relative; padding:22px 24px; border-radius:14px; border:1px solid; box-shadow:0 4px 12px #23354806; }
.profit-summary small { font-size:12px; font-weight:650; letter-spacing:.03em; margin-bottom:12px; }
.profit-summary strong { font-size:29px; font-weight:750; line-height:1.2; font-variant-numeric:tabular-nums; }
.profit-summary [data-metric="sales"] { background:#edf5ff; border-color:#d3e5fa; }
.profit-summary [data-metric="sales"] small,.profit-summary [data-metric="sales"] strong { color:#2866a5; }
.profit-summary [data-metric="product"] { background:#fff7eb; border-color:#f0dfbf; }
.profit-summary [data-metric="product"] small,.profit-summary [data-metric="product"] strong { color:#a46b25; }
.profit-summary [data-metric="fees"] { background:#f4f0fb; border-color:#e2d8f0; }
.profit-summary [data-metric="fees"] small,.profit-summary [data-metric="fees"] strong { color:#79609d; }
.profit-summary [data-metric="total"] { background:#eef2f6; border-color:#dbe3eb; }
.profit-summary [data-metric="total"] small,.profit-summary [data-metric="total"] strong { color:#50647c; }
.profit-summary [data-metric="profit"] { background:#18775f; border-color:#18775f; }
.profit-summary [data-metric="profit"] small { color:#c3e6da; }
.profit-summary [data-metric="profit"] strong { color:#fff; font-size:34px; }
.profit-summary [data-metric="margin"] { background:#eaf7ef; border-color:#cde6d6; }
.profit-summary [data-metric="margin"] small,.profit-summary [data-metric="margin"] strong { color:#267551; }
.profit-summary [data-metric="profit"].loss { background:#b64e4e; border-color:#b64e4e; }
.profit-summary [data-metric="profit"].loss small { color:#ffe1e1; }
.profit-summary [data-metric="profit"].loss strong { color:#fff; }
.profit-note { line-height:1.8; color:#80909c; }
.profit-status:empty { display:none; }
#profit-legacy { border:1px solid #dae4ea; border-radius:16px; background:#f7fafb; padding:4px; }
#profit-legacy > summary { padding:17px 20px; font-size:14px; color:#596f81; }
#profit-legacy .card { margin:4px 0; border-radius:12px; box-shadow:none; padding:24px; }
#costing-view #profit-legacy .cost-table tr { background:#fff; border:1px solid #e0e7ee; padding:22px; gap:18px; border-radius:14px; box-shadow:none; }
#costing-view #profit-legacy .cost-table td::before { color:#7c8b99; font-size:12px; font-weight:600; }
#costing-view #profit-legacy .cost-table input { background:#fbfcfe; border-color:#d8e1e9; font-size:14px; border-radius:8px; }
#costing-view #profit-legacy .cost-table td:nth-child(3) input { border-color:#e6c994; background:#fffaf1; color:#946020; font-weight:650; }
#costing-view #profit-legacy .cost-table td:nth-child(11) input { border-color:#d7c8e8; background:#f8f4fc; color:#78569c; }
#costing-view #profit-legacy .cost-table td:nth-child(12) { background:#f4eefb; color:#79609d; }
#costing-view #profit-legacy .cost-table td:nth-child(14) { background:#eaf3fc; color:#356c9f; }
#costing-view #profit-legacy .cost-table td:nth-child(15) { background:#e6f3ed; color:#267557; }
#costing-view #profit-legacy .cost-table td:nth-child(16) { background:#1c7058; color:#fff; }
#costing-view #profit-legacy .cost-table td:nth-child(16)::before { color:#c5e6d7; }
#costing-view #profit-legacy .cost-packing-panel { background:#f6f8fa!important; border-color:#dee6ec!important; padding:20px!important; gap:16px; }
#profit-legacy .packing-title { font-size:16px; color:#556b7d; }
#profit-legacy .packing-results div { background:#eaf0f8; color:#506986; padding:16px; border-radius:10px; }
#profit-legacy .c-packing-preview { background:#fff; border-color:#dce5ed; padding:16px; line-height:1.7; font-size:12px; }
@media(max-width:1000px) { .profit-fees { grid-template-columns:repeat(2,minmax(0,1fr)); } .profit-summary strong { font-size:24px; } }
@media(max-width:700px) { #simple-profit { padding:20px 16px; } .profit-toolbar { padding:14px; gap:14px; } .profit-toolbar label { flex:1 1 100%; min-width:0; } #simple-profit #profit-save { margin-left:0; } .profit-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } .profit-summary article { padding:17px 14px; } .profit-summary strong,.profit-summary [data-metric="profit"] strong { font-size:23px; } .profit-fees { grid-template-columns:1fr; } }
