:root {
  color-scheme: light;
  --ink: #20242a;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --brand: #175cd3;
  --brand-hover: #1849a9;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand); }
.site-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); font-weight: 700; text-decoration: none; }
nav { display: flex; align-items: center; gap: 20px; }
nav form { margin: 0; }
button { font: inherit; }
nav button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.page-shell { width: min(1120px, calc(100% - 32px)); margin: 48px auto; }
.site-footer { padding: 16px; color: var(--muted); font-size: 12px; text-align: center; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.panel, .auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 32px; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.05); }
.auth-card { width: min(440px, 100%); margin: 80px auto; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
h1 { margin: 4px 0 12px; font-size: clamp(28px, 4vw, 40px); line-height: 1.2; }
label { display: block; margin: 18px 0 6px; font-weight: 600; }
input { width: 100%; padding: 11px 12px; border: 1px solid #98a2b3; border-radius: 6px; font: inherit; }
input:focus { outline: 3px solid #d1e9ff; border-color: var(--brand); }
.primary-action { display: inline-block; margin-top: 22px; padding: 10px 18px; border: 0; border-radius: 6px; background: var(--brand); color: white; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary-action:hover { background: var(--brand-hover); }
.auth-card .primary-action { width: 100%; }
.error-message { color: var(--danger); background: #fef3f2; border: 1px solid #fecdca; padding: 10px 12px; }
.empty-state { margin-top: 24px; padding: 44px 20px; color: var(--muted); text-align: center; border: 1px dashed #98a2b3; border-radius: 8px; }
.report-list { display: grid; gap: 14px; margin-top: 24px; }
.report-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; }
.report-card span, .report-card p { color: var(--muted); font-size: 13px; }
.report-card h2 { margin: 3px 0; font-size: 20px; }
.report-card p { margin: 0; }
.report-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.report-actions .primary-action { margin-top: 0; }
.profit-report-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 28px; }
.profit-report-heading span, .profit-report-heading p { color: var(--muted); font-size: 13px; }
.profit-report-heading h2 { margin: 3px 0; font-size: 20px; }
.profit-report-heading p { margin: 0; }
.sort-action, .table-action { color: var(--brand); font-weight: 700; text-decoration: none; }
.sort-action:hover, .table-action:hover { text-decoration: underline; }
.profit-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.profit-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.profit-table th, .profit-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.profit-table thead th { color: var(--muted); background: #f9fafb; font-size: 13px; }
.profit-table tbody tr:last-child th, .profit-table tbody tr:last-child td { border-bottom: 0; }
.profit-table .number-cell { text-align: right; font-variant-numeric: tabular-nums; }
.profit-table .action-cell { text-align: center; white-space: nowrap; }
.metric-value { display: inline-block; min-width: 92px; padding: 3px 9px; border-radius: 6px; font-weight: 700; text-align: right; }
.metric-positive { color: #067647; background: #ecfdf3; }
.metric-negative { color: var(--danger); background: #fef3f2; }
.metric-neutral { color: var(--muted); background: #f2f4f7; }
.detail-actions { margin-top: 24px; }
.account-details { display: grid; gap: 0; margin: 24px 0 0; }
.account-details div { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.account-details dt { color: var(--muted); font-weight: 600; }
.account-details dd { margin: 0; overflow-wrap: anywhere; }
.portal-entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.portal-entry-card { display: grid; gap: 5px; min-height: 120px; padding: 20px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; }
.portal-entry-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(23, 92, 211, 0.10); }
.portal-entry-card strong { color: var(--brand); font-size: 18px; }
.portal-entry-card span { color: var(--muted); }
.task-panel { max-width: 880px; margin: 0 auto; }
.task-status { display: inline-block; margin: 4px 0 12px; padding: 4px 10px; color: #344054; background: #f2f4f7; border-radius: 999px; font-weight: 700; }
.task-status--awaiting_confirmation { color: #93370d; background: #fffaeb; }
.task-status--queued, .task-status--running { color: #175cd3; background: #eff8ff; }
.task-status--succeeded { color: #067647; background: #ecfdf3; }
.task-status--needs_review { color: #93370d; background: #fffaeb; }
.task-status--failed, .task-status--cancelled { color: var(--danger); background: #fef3f2; }
.task-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.task-actions form { margin: 0; }
.task-actions .primary-action { margin-top: 0; }
.secondary-action, .danger-action { display: inline-block; padding: 9px 16px; border-radius: 6px; background: var(--surface); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.secondary-action { color: var(--brand); border: 1px solid #84adff; }
.danger-action { color: var(--danger); border: 1px solid #fda29b; }
.task-notice { margin: 24px 0 0; padding: 14px 16px; color: #344054; background: #f9fafb; border-left: 4px solid var(--brand); }
.error-text { color: var(--danger); }
.account-details code { overflow-wrap: anywhere; }

.erp-layout { --erp-sidebar-width: 88px; padding: 56px 0 0 var(--erp-sidebar-width); background: #eff2f6; }
.erp-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--erp-sidebar-width); background: rgba(100, 105, 112, .14); color: #64707c; border-right: 1px solid rgba(100, 105, 112, .10); overflow-y: auto; }
.erp-sidebar svg { stroke: currentColor; }
.erp-logo { display: flex; flex: 0 0 56px; align-items: center; justify-content: center; color: #596675; text-decoration: none; border-bottom: 1px solid rgba(100, 105, 112, .12); }
.erp-logo-mark { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; }
.erp-logo svg { display: block; flex: none; width: 28px; height: 28px; }
.erp-module-nav { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 4px; }
.erp-module-link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 86px; padding: 10px 2px; border-radius: 7px; color: #64707c; text-align: center; text-decoration: none; font-size: 12px; line-height: 1.5; }
.erp-module-icon { display: flex; flex: 0 0 36px; align-items: center; justify-content: center; width: 36px; height: 36px; }
.erp-module-icon svg { display: block; flex: none; width: 24px; height: 24px; }
.erp-module-link:hover { color: #3f4b59; background: rgba(107, 117, 132, .08); }
.erp-module-link[aria-current="page"] { color: #3f4b59; background: rgba(107, 117, 132, .14); }
.erp-module-link[aria-current="page"]::before { position: absolute; inset: 20px auto 20px 0; width: 3px; border-radius: 0 3px 3px 0; background: #8593a3; content: ""; }
.erp-module-link:focus-visible, .erp-logo:focus-visible { outline: 2px solid #7089a6; outline-offset: -3px; }
.erp-layout .site-header { position: fixed; inset: 0 0 auto var(--erp-sidebar-width); z-index: 30; min-height: 56px; padding: 0 24px; gap: 24px; background: rgba(125, 153, 187, .18); border-bottom: 1px solid rgba(112, 137, 166, .12); color: #52677e; }
.erp-layout .brand { color: rgba(60, 83, 111, .92); font-size: 15px; white-space: nowrap; }
.erp-layout .site-header nav { gap: 18px; font-size: 13px; }
.erp-layout .site-header nav a, .erp-layout .site-header nav button { color: #5e7085; text-decoration: none; white-space: nowrap; }
.erp-layout .site-header nav a:hover, .erp-layout .site-header nav button:hover { color: #3e5876; }
.erp-layout .page-shell { width: 100%; max-width: none; margin: 0; padding: 20px; }
.home-workspace { min-width: 0; }
.home-report-panel { min-width: 0; padding: 22px; border: 1px solid #e7ebf1; box-shadow: 0 2px 6px rgba(16, 24, 40, .03); }
.home-report-panel h1 { margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: 22px; font-weight: 600; }
.home-report-panel .profit-report-heading { margin-top: 0; align-items: center; gap: 16px; }
.home-report-panel .profit-report-heading h2 { font-size: 15px; font-weight: 500; }
.home-report-panel .sort-action { font-size: 12px; white-space: nowrap; }
.home-report-panel .profit-table { min-width: 700px; font-size: 13px; }
.home-report-panel .profit-table th, .home-report-panel .profit-table td { padding: 12px 10px; }
.home-report-panel .profit-table thead th { font-size: 12px; white-space: nowrap; }
.home-report-panel .profit-table tbody th { white-space: nowrap; font-weight: 500; }
.home-report-panel .profit-table tbody tr:hover { background: #f5f9ff; }
.home-report-panel .metric-value { min-width: 80px; font-weight: 600; }
.home-report-panel .table-action { display: inline-block; padding: 5px 10px; border: 1px solid #c5dcfc; border-radius: 4px; background: #f2f7ff; font-size: 12px; font-weight: 500; }
.home-report-panel .table-action:hover { border-color: #76a9f4; background: #e8f1ff; text-decoration: none; }
.home-metric-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.home-report-panel--workspace { max-width: 1180px; margin: 0 auto; padding: 0; border: 0; background: transparent; box-shadow: none; }
.home-launcher { display: grid; gap: 18px; min-width: 0; }
.home-launcher-hero { position: relative; display: flex; min-height: 210px; align-items: center; justify-content: space-between; gap: 40px; overflow: hidden; padding: clamp(26px, 3.5vw, 42px); border: 1px solid #d9e2ee; border-radius: 14px; background: linear-gradient(125deg, #fff 0%, #f7faff 56%, #edf3fa 100%); box-shadow: 0 10px 28px rgba(45, 67, 94, .07); }
.home-launcher-hero::after { position: absolute; right: -76px; bottom: -110px; width: 280px; height: 280px; border: 1px solid rgba(72, 101, 137, .09); border-radius: 50%; content: ""; }
.home-launcher-copy { position: relative; z-index: 1; min-width: 0; }
.home-launcher-eyebrow { display: block; margin-bottom: 8px; color: #55759b; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.home-launcher-copy h1 { margin: 0; padding: 0; border: 0; color: #182638; font-size: clamp(28px, 3vw, 36px); font-weight: 700; letter-spacing: -.02em; }
.home-launcher-copy p { max-width: 650px; margin: 12px 0 0; color: #5e6c7d; font-size: 14px; }
.home-launcher-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.home-launcher-tags span { padding: 5px 10px; border: 1px solid #d8e4f1; border-radius: 999px; background: rgba(255, 255, 255, .78); color: #526b87; font-size: 12px; }
.home-launcher-visual { position: relative; z-index: 1; display: grid; flex: 0 0 142px; min-height: 142px; place-items: center; align-content: center; gap: 8px; border: 1px solid rgba(82, 111, 147, .15); border-radius: 26px; background: rgba(255, 255, 255, .72); color: #486988; box-shadow: 0 12px 28px rgba(53, 80, 112, .10); transform: rotate(2deg); }
.home-launcher-visual-icon { display: flex; align-items: center; justify-content: center; }
.home-launcher-visual > span:last-child { color: #6a8199; font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.home-launcher-features { padding: clamp(22px, 3vw, 30px); border: 1px solid #e1e6ed; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(16, 24, 40, .04); }
.home-launcher-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.home-launcher-section-heading span { display: block; color: #6e7d8e; font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.home-launcher-section-heading h2 { margin: 2px 0 0; color: #1f2c3d; font-size: 21px; line-height: 1.3; }
.home-launcher-section-heading small { color: #7b8795; font-size: 12px; }
.home-launcher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.home-launcher-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; min-width: 0; min-height: 138px; padding: 20px; border: 1px solid #e0e6ee; border-radius: 11px; background: linear-gradient(145deg, #fff, #fbfcfe); color: #293749; text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.home-launcher-card:only-child { grid-column: 1 / -1; }
.home-launcher-card:hover { border-color: #9fb6d1; box-shadow: 0 10px 24px rgba(46, 72, 103, .09); transform: translateY(-2px); }
.home-launcher-card:focus-visible { outline: 3px solid #c9ddf4; outline-offset: 2px; }
.home-launcher-card-icon { display: flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 12px; background: #edf3f9; color: #486b91; }
.home-launcher-card-copy { display: grid; min-width: 0; gap: 3px; }
.home-launcher-card-copy > span { color: #7a8b9f; font-size: 10px; font-weight: 700; letter-spacing: .09em; }
.home-launcher-card-copy strong { color: #25364a; font-size: 17px; }
.home-launcher-card-copy small { color: #68778a; font-size: 12px; line-height: 1.6; }
.home-launcher-card-arrow { display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; background: #f1f5f9; color: #597895; font-size: 18px; transition: background .18s ease, transform .18s ease; }
.home-launcher-card:hover .home-launcher-card-arrow { background: #e5eef8; transform: translateX(2px); }
.home-launcher-scope-note { display: flex; align-items: center; gap: 7px; margin: 18px 0 0; color: #748295; font-size: 12px; }
.home-empty-workspace { display: grid; min-height: 320px; place-items: center; align-content: center; gap: 8px; padding: 36px; border: 1px solid #e1e6ed; border-radius: 14px; background: #fff; text-align: center; box-shadow: 0 5px 18px rgba(16, 24, 40, .04); }
.home-empty-workspace-icon { display: flex; width: 62px; height: 62px; align-items: center; justify-content: center; margin-bottom: 4px; border-radius: 16px; background: #edf3f9; color: #5f7895; }
.home-empty-workspace h1 { margin: 0; padding: 0; border: 0; font-size: 24px; }
.home-empty-workspace p { margin: 0; color: var(--muted); font-size: 14px; }
.promotion-heading h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.promotion-status { display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: #f2f4f7; color: #475467; font-size: 12px; font-weight: 500; }
.promotion-notice { margin: 16px 0 0; padding: 12px 14px; border: 1px solid #fedf89; border-radius: 6px; background: #fffaeb; color: #93370d; font-size: 13px; }
.promotion-table-wrap { max-height: 72vh; overflow: auto; }
.home-report-panel .promotion-table { min-width: 990px; }
.promotion-table thead th { position: sticky; top: 0; z-index: 2; }
.promotion-table tr > :first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 100px; }
.promotion-table thead tr > :first-child { background: #f9fafb; z-index: 3; }
.promotion-table tbody tr:hover > :first-child { background: #f5f9ff; }

@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .page-shell { margin: 24px auto; }
  .panel, .auth-card { padding: 24px; }
  .report-card { align-items: flex-start; flex-direction: column; }
  .profit-report-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .account-details div { grid-template-columns: 1fr; gap: 2px; }
  .portal-entry-grid { grid-template-columns: 1fr; }
  .erp-layout { --erp-sidebar-width: 76px; padding-top: 96px; }
  .erp-layout .site-header { min-height: 96px; padding: 12px 16px; flex-wrap: wrap; gap: 6px; align-content: center; }
  .erp-layout .site-header nav { gap: 12px; flex-wrap: wrap; }
  .erp-layout .page-shell { padding: 12px; }
  .erp-module-link { font-size: 11px; }
  .home-report-panel { padding: 16px; }
  .home-report-panel--workspace { padding: 0; }
  .home-launcher-hero { min-height: 0; padding: 24px; }
  .home-launcher-visual { display: none; }
  .home-launcher-grid { grid-template-columns: 1fr; }
  .home-launcher-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .home-launcher-card { min-height: 126px; padding: 17px; }
  .home-launcher-card-arrow { width: 28px; height: 28px; }
}

@media (max-width: 480px) {
  .home-launcher-card { grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; gap: 12px; }
  .home-launcher-card-arrow { display: none; }
  .home-launcher-card-copy strong { font-size: 16px; }
  .home-launcher-scope-note { align-items: flex-start; }
}
