/* SYS-UI-001: PC presentation only. ERP keeps its own scoped layouts and controls. */
:root {
  --kingree-blue: #2881c7;
  --kingree-blue-dark: #1c67a1;
  --kingree-blue-soft: #e2f3ff;
  --kingree-hover: #edf6fc;
  --kingree-surface: #f5f7fa;
  --kingree-line: #d4dfe8;
  --kingree-text: #263746;
  --kingree-muted: #64788b;
  --bg: var(--kingree-surface);
  --panel: #fff;
  --line: var(--kingree-line);
  --text: var(--kingree-text);
  --muted: var(--kingree-muted);
  --primary: var(--kingree-blue);
  --primary-dark: var(--kingree-blue-dark);
}

body { font-size: 13px; }
/* Navigation hierarchy and available items stay exactly as before. */
.side-nav { padding: 16px 10px; }
.side-brand { color: #21435e; padding: 0 6px; }
.side-nav-main, .side-nav-bottom { gap: 5px; }
.side-nav .side-nav-item { border-radius: 2px; border-color: transparent; min-height: 37px; padding: 7px 10px; }
.side-nav .side-nav-item:hover { background: var(--kingree-hover); }
.side-nav .side-nav-item.active { background: var(--kingree-blue-soft); border-color: #b5d8f1; color: var(--primary-dark); }
.topbar { background: var(--primary); border-bottom-color: var(--primary-dark); }
.topbar :is(.profile-menu-btn, .topbar-action-btn) { background: transparent; border-color: #75acda; color: #fff; }
.topbar :is(.profile-menu-btn, .topbar-action-btn):hover { background: var(--primary-dark); border-color: #a5d3f2; color: #fff; }
.topbar .profile-menu button { color: var(--text); }
.topbar .current-user-name { color: #fff; }
.topbar .profile-menu button:hover, .employee-view-person:hover, .employee-view-person.selected { background: var(--kingree-blue-soft); }
.employee-view-popover { border-radius: 3px; }
.page { padding: 16px 20px 26px; }

/* Normal control sizes; no changes to checked/disabled/read-only or required behavior. */
input, select, textarea { border-color: #bdcdda; border-radius: 2px; padding: 5px 8px; min-height: 32px; }
button, .filebtn { border-color: #bdcdda; border-radius: 2px; padding: 5px 10px; min-height: 32px; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px;
}
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }
.smart-date-button:hover { background: var(--kingree-hover); }
.view-as-banner { background: #edf6fc; border-color: #b5d8f1; color: #315b7c; }
.view-as-banner button { border-color: #b5d8f1; color: var(--primary-dark); }

/* Keep dashboard grids, calendar geometry and project sections; unify their surfaces. */
:is(.sales-home-hero, .sales-home-card, .boss-home-topbar, .boss-domain, .tablewrap,
  .crm-wb-wrap, .crm-wb-summary, .custom-entry-card, .custom-section, .custom-production-panel,
  .custom-journey-status, .custom-form-summary, .custom-scheme-block, .custom-design-confirm-list,
  .custom-return-sku-focus-card, .custom-return-version-detail-panel) { border-radius: 3px; border-color: var(--line); }
:is(.sales-home-hero, .sales-home-card, .boss-home-topbar, .boss-domain) { padding: 12px 14px; }
:is(.sales-home-update, .boss-chart-card, .boss-customer-kpi-panel, .boss-customer-chart-panel,
  .boss-domain .boss-sparkline-empty, .crm-wb-summary, .custom-journey-status,
  .custom-form-summary, .custom-design-confirm-block-secondary, .custom-tin-recommendation,
  .custom-scent-link) { background: #f7fafc; border-color: var(--line); border-radius: 3px; color: var(--muted); }
.page :is(h1, h2, h3), .custom-project-title-line strong, .custom-design-confirm-row strong,
.custom-handoff-summary h3, .custom-handoff-block h4, .custom-form-summary strong,
.custom-scheme-block h5, .custom-return-sku-focus-head strong { color: var(--text); }
.page h1 { font-size: 21px; }
.page h2 { font-size: 18px; }
.boss-metric-card > strong, .boss-metric-line strong, .boss-domain-head p strong,
.sales-quarter-value { color: #21435e; }
.boss-section-title, .boss-chart-module-title, .boss-metric-title { color: var(--muted); }
.boss-chart-card { border-radius: 3px; }
.boss-chart-y-tick line { stroke: #e6edf3; }
.boss-chart-axis { stroke: #c7d7e4; }
.boss-chart-y-tick text, .boss-chart-x-label { fill: #73889a; }
.boss-sparkline path, .boss-chart-line { stroke: var(--primary); }
.boss-sparkline circle, .boss-chart-point { fill: var(--primary-dark); }
.boss-chart-bar { fill: #69a9db; }
.boss-chart-bar:hover { fill: var(--primary); }

/* Tabular queries, including frozen columns, share the ERP blue header. */
th { background: var(--primary); color: #fff; font-weight: 400; border-right: 1px solid #75acda; }
th, td { padding: 6px 8px; font-size: 13px; }
td { border-right: 1px solid #e5eaf0; }
table.crm-wb :is(th, td) { color: var(--text); font-size: 13px; height: 34px; border-color: #e5eaf0; }
table.crm-wb thead th, #aiSettingsBody .user-account-table thead th {
  height: 35px; background: var(--primary); color: #fff; border-color: #75acda; font-weight: 400;
}
table.crm-wb tbody tr:nth-child(even):not(.crm-wb-group):not(.crm-wb-subtotal) > td { background: #f8f9fb; }
table.crm-wb tbody tr:not(.crm-wb-group):not(.crm-wb-subtotal):hover > td { background: var(--kingree-hover); }
table.crm-wb .crm-wb-group > *, table.crm-wb .crm-wb-subtotal > * { background: #f1f6fa; }
table.crm-wb tfoot .crm-wb-total > * { background: #fffbe4; border-color: #d9dfcb; }
.crm-wb-summary strong, .crm-wb-summary .is-key strong, .crm-wb-group-name strong,
.crm-wb .crm-wb-result { color: #21435e; }
.crm-wb-toolbar label, .crm-wb .crm-wb-muted, .crm-wb-group-name { color: var(--muted); }
.crm-wb-link:not(.is-danger), .crm-wb-more > summary { color: var(--primary-dark); }
.crm-wb-link.is-task-primary, .crm-wb-link.is-task-primary:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.crm-wb-link.is-task-primary:hover { background: var(--primary-dark); }
.crm-wb-more-menu { border-color: var(--line); border-radius: 3px; }
.crm-wb-more-menu button:not(.is-danger) { color: var(--text); }
.crm-wb-more-menu button:hover { background: var(--kingree-hover); }
.crm-wb-edit input:focus { border-color: var(--primary); outline-color: var(--primary); }
.crm-wb input[type=checkbox] { accent-color: var(--primary); }

/* Existing custom stage tabs and neutral identity labels are not completion statuses. */
.custom-wb-groups { border-color: var(--line); border-radius: 2px; }
.crm-wb-toolbar .custom-wb-groups .custom-wb-group { color: var(--muted); border-color: var(--line); }
.crm-wb-toolbar .custom-wb-groups .custom-wb-group:hover { background: var(--kingree-hover); }
.crm-wb-toolbar .custom-wb-groups .custom-wb-group.is-active,
.custom-return-mode button.active { background: var(--kingree-blue-soft); color: var(--primary-dark); }
.custom-wb-name strong { color: var(--text); }
.custom-nature-tag, .custom-project-identity-first, .custom-project-identity-return,
.custom-handoff-chips span, .custom-scheme-flavors b, .custom-plan-badge.design {
  border-color: #bfd9ed; background: #edf6fc; color: #315b7c; border-radius: 3px;
}
.custom-entry-card:hover { border-color: var(--primary); background: var(--kingree-hover); }
.custom-entry-card strong, .custom-design-confirm-block h3, .custom-design-confirm-row input:checked + em { color: var(--primary-dark); }
.custom-journey-next strong, .custom-submitted-requirements > summary,
.custom-handoff-step-head strong { color: var(--text); }
.custom-journey-facts, .custom-journey-owner small, .custom-journey-next { color: var(--muted); }
.custom-journey-facts b { color: var(--text); }
.custom-handoff-step-no { background: #e7eef5; color: var(--muted); }
.custom-handoff-step.is-current .custom-handoff-step-no { background: var(--primary); color: #fff; }
.custom-factory-handoff .custom-handoff-step .custom-form-actions > button.primary { background: var(--primary); border-color: var(--primary); }
.custom-factory-handoff .custom-handoff-step .custom-form-actions > button.custom-secondary-action,
.custom-final-scent-add { border-color: #b5d0e4; color: var(--primary-dark); }
.custom-project-meta-line, .custom-wb-owner, .custom-wb-next, .custom-wb-waiting,
.custom-design-task-type, .custom-project-head p { color: var(--muted); }
.settings-tabs button.active, .library-quick-tabs button.active,
.library-tree-nav-row.active, .custom-product-picker button.active, .custom-chipline span,
.custom-display-choice button.active { background: var(--kingree-blue-soft); border-color: #b5d8f1; color: var(--primary-dark); }
.settings-tabs.compact button.active, .custom-confirm-choice button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.custom-production-panel .custom-production-action, .custom-production-panel .custom-plan-confirm,
.custom-production-panel .custom-assembly-actions .custom-handoff-print.primary,
.custom-production-panel [data-custom-action="confirm-actual-scents"].custom-quantity-first,
.custom-return-quantity-section [data-custom-action="confirm-actual-scents"].custom-quantity-first {
  background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 2px;
}
.custom-production-panel .custom-production-action:hover, .custom-production-panel .custom-plan-confirm:hover,
.custom-production-panel .custom-assembly-actions .custom-handoff-print.primary:hover,
.custom-production-panel [data-custom-action="confirm-actual-scents"].custom-quantity-first:hover,
.custom-return-quantity-section [data-custom-action="confirm-actual-scents"].custom-quantity-first:hover { background: var(--primary-dark); }
.custom-production-panel .custom-production-actions > .custom-production-more > summary,
.custom-production-panel .custom-assembly-actions .custom-handoff-print.is-secondary {
  border-color: var(--primary); color: var(--primary-dark); background: #fff; border-radius: 2px;
}
.custom-production-panel [data-custom-action="save-production-quantity"],
.custom-production-panel [data-custom-action="confirm-actual-scents"],
.custom-return-quantity-section [data-custom-action="confirm-actual-scents"] { border-color: #b5d8f1; background: var(--kingree-blue-soft); color: var(--primary-dark); }
.custom-production-panel [data-custom-action="save-production-quantity"]:hover { background: var(--kingree-hover); color: var(--primary-dark); }
.custom-design-file-row .custom-factory-file-chip input { accent-color: var(--primary); }

/* Dialog structure, fieldsets, action placement and scroll behavior remain owned by each feature. */
.modalbox { border: 1px solid var(--line); border-radius: 3px; }
.modalbox :is(h2, h3, h4) { color: var(--text); }
.modalhead { padding: 8px 10px; background: var(--primary); color: #fff; border-radius: 2px 2px 0 0; }
.modalhead h2, .modalhead h3, .modalhead p, .modalhead .muted { color: #fff; }
.modalhead .iconbtn { background: transparent; border-color: transparent; color: #fff; }
.modalhead .iconbtn:hover { background: var(--primary-dark); color: #fff; }
#channelForm .modalhead, #announcementForm .modalhead { background: var(--primary); padding: 12px 10px; }
.drawerhead { border-bottom: 2px solid var(--primary); }
#aiSettingsBody .settings-sidebar { border-color: var(--line); }
#aiSettingsBody .settings-sidebar button { border-radius: 2px; color: var(--text); }
#aiSettingsBody .settings-sidebar button.active { background: var(--kingree-blue-soft); border-color: #b5d8f1; color: var(--primary-dark); box-shadow: inset 3px 0 0 var(--primary); }
#aiSettingsBody .settings-sidebar button:hover { background: var(--kingree-hover); }
.leave-calendar-day.selected { background: var(--primary); }
.leave-calendar-day:hover:not(:disabled):not(.selected) { background: var(--kingree-hover); }

/* Data coverage maps use blue ranks; quantities, geographic sources and interactions are unchanged. */
.market-map-v2.home { background: #f8fafc; border-color: var(--line); border-radius: 3px; }
.market-map-v2.home :is(.map-v2-loading, .map-v2-fallback) { color: var(--muted); background: #f8fafc; }
.market-map-v2.home .map-v2-label, .market-map-v2.home .map-v2-label.province-label,
.market-map-v2.home .map-v2-label.province-label.has-customers { border-color: #cfdfeb; color: #466680; border-radius: 3px; }
.market-map-v2.home .province-label-count, .market-map-v2.home .map-v2-tooltip span b { color: var(--primary-dark); }
.market-map-v2.home .map-v2-tooltip { border-color: var(--line); border-radius: 3px; color: var(--text); }
.market-map-v2.home .map-v2-tooltip span, .market-map-v2.home .map-v2-tooltip small { color: var(--muted); }
.asset-growth-chart circle, .customer-growth-chart circle { fill: var(--primary); }
.asset-growth-chart circle.current { fill: var(--primary-dark); }
.customer-growth-line { stroke: var(--primary); }
.customer-growth-area { fill: #2881c71f; }
.customer-growth-empty { border-color: var(--line); background: #f7fafc; border-radius: 3px; }
.customer-growth-empty::before { background: #e1eff9; }

@media (max-width: 760px) {
  .page { padding: 12px 10px 20px; }
  input, select, textarea, button, .filebtn { min-height: 36px; }
}
