/* Shared presentation finish. Keep business-specific colors and layout semantics. */
:root {
  --ui-canvas: #f6f7f9;
  --ui-border: #e4e7ec;
  --ui-soft: #f8f9fb;
  --ui-muted: #626b78;
  --ui-shadow: 0 2px 8px rgb(16 24 40 / 4%);
}
/* 1688-inspired orange: vivid actions, darker text, restrained peach surfaces. */
:root, body.backend {
  --accent: #ff6000;
  --accent-hover: #e65100;
  --accent-strong: #eb5500;
  --accent-soft: #fff1e8;
  --accent-line: #ffd9c2;
  --accent-wash: #fff8f3;
  --native-accent: #ff6000;
  --bg: #f6f7f9;
}
::selection { background: #ffdfc7; color: #49250e; }
.text-link, .native-main a:not(.btn), body.backend .ops-table a, body.backend #admin-engine td a { color: #b84400; }
.portal-search { border: 2px solid var(--accent); background: #fff; }
.portal-search:focus-within { box-shadow: 0 0 0 4px rgb(255 96 0 / 12%); }
.portal-search button { background: linear-gradient(100deg, #ff8a20, #ff6000); }
.portal-search button:hover { background: var(--accent-hover); }
.btn.primary, body.backend .btn.primary, body.backend #admin-engine .ae-primary { box-shadow: none; }
.procurement-banner { background: linear-gradient(110deg, #fff2e8, #fffaf6); border-color: var(--accent-line); }
.portal-account, body.backend .member-card { background: linear-gradient(150deg, #fff1e8, #fffaf7); }
.account-shortcuts svg { color: var(--accent); }
.quick-card .ic { color: var(--accent); background: var(--accent-soft); }
.chart .bar { background: #ffd8bb; }
.chart .bar:nth-last-child(2) { background: var(--accent); }
.metric strong { font-family: var(--sans, sans-serif); font-weight: 600; }
body.backend .backend-top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--ui-border); box-shadow: none; }
body.backend .backend-brand, body.backend .backend-mark { color: var(--accent); }
body.backend .backend-mark { border-color: var(--accent); }
body.backend .backend-top nav a:hover { color: #b84400; border-bottom-color: var(--accent); }
body.backend .backend-top form { border: 1px solid var(--accent-line); box-shadow: none; }
body.backend .backend-top form button { color: #b84400; }
body.backend .backend-account .avatar, body.backend .member-heading .avatar { background: var(--accent-soft); color: #b84400; border-color: var(--accent-line); }
body.backend .backend-home.active, .live-backoffice .backend-home[aria-current=page] { background: var(--accent-soft); color: #b84400; }
body.backend .quota-track i { background: var(--accent); }
.live-backoffice :is(.be-menu-search button, .be-password-toggle) { color: #b84400; }
.live-backoffice :is(a, button, summary):focus-visible { outline-color: var(--accent); }
body.backend :is(.ops-table, #admin-engine table) tbody tr:has(input[type=checkbox]:checked) { background: var(--accent-soft); }
body { background-color: var(--ui-canvas); line-height: 1.6; }
.portal-brand strong, .procurement-banner h1, .page-heading h1, .auth h1, .dialog-header h2 { font-family: var(--sans, 'Microsoft YaHei', sans-serif); }
.procurement-banner h1 { font-weight: 600; letter-spacing: -.6px; }
button, input, select, textarea { font-family: inherit; }
:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent, #a55339);
  outline-offset: 3px;
}
:where(input[type=checkbox], input[type=radio]) { accent-color: var(--accent, #a55339); }
:where(button, input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: .55;
}
:where(.btn, .pagination a, .pagination button)[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
:where(.btn, button):disabled:hover { transform: none; box-shadow: none; }
:where(.field, .native-form, .auth, #admin-engine) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select, textarea) {
  box-sizing: border-box;
  max-width: 100%;
  border-color: #d8dde5;
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
:where(.field, .native-form, .auth, #admin-engine) :is(input, select, textarea):focus-visible {
  border-color: var(--accent, #a55339);
  box-shadow: 0 0 0 3px var(--accent-soft, #f9eee8);
}
input::placeholder, textarea::placeholder { color: #747d89; opacity: 1; }
:where(.field, .auth, #admin-engine) [aria-invalid=true] { border-color: #b42318; }
.field label { line-height: 1.6; }
.field textarea { min-height: 112px; resize: vertical; }

/* Quiet surfaces and a consistent reading hierarchy. */
:is(.panel, .list-panel, .native-panel, .supplier-card, .doc-card, .request-card, .design-card, .tool-group) {
  border-color: var(--ui-border);
  border-radius: 12px;
  box-shadow: var(--ui-shadow);
}
:is(.page-heading, .section-heading, .section-title) { gap: 16px; }
.page-heading h1 { line-height: 1.35; letter-spacing: -.5px; }
.page-heading p { line-height: 1.75; }
:is(.page-heading, .section-heading, .section-title) :is(h1, h2) { overflow-wrap: anywhere; }
:is(.supplier-card, .doc-card, .request-card, .editorial-card):hover {
  box-shadow: 0 4px 16px rgb(16 24 40 / 6%);
}
:is(.subtle, .native-main .muted, .search-hints) { color: var(--ui-muted); }
:is(.metric strong, .ops-metrics strong, .stock-num, .native-main td) { font-variant-numeric: tabular-nums; }
:is(.actions, .results-footer, .native-footer nav) { flex-wrap: wrap; gap: 10px; }
:is(.global-search, .content-grid > *, .native-grid > *, .form-grid > *, .backend-content, .workspace-layout > *) { min-width: 0; }
.search-hints { flex-wrap: wrap; row-gap: 4px; }
.portal-search input { min-width: 0; }
.portal-search button { flex-shrink: 0; }
:is(.tabs, .member-nav, .channel-bar nav) { scrollbar-width: thin; scroll-padding-inline: 16px; }
:is(.tabs, .member-nav) { overflow-x: auto; }
:is(.tabs, .member-nav) > * { flex-shrink: 0; }
.native-main > .panel, .native-panel { border-color: var(--ui-border); }
.native-main .search-panel { background: #fff; border-color: var(--ui-border); border-radius: 12px; }
.native-main th { background: var(--ui-soft); color: #4f5968; }
.native-main :is(th, td) { border-bottom-color: #edf0f3; }
.native-main tbody tr:hover { background: var(--ui-soft); }
:is(.table-scroll, .ops-table-wrap, .ae-scroll) {
  max-width: 100%;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.pagination { align-items: center; gap: 6px; }
.pagination :is(a, button) { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; box-sizing: border-box; }
.pagination a { color: var(--ink-2, #454c56); border-radius: 8px; }
.pagination a:hover { border-color: var(--accent, #a55339); background: var(--accent-soft, #f9eee8); }
.native-footer { background: #fff; border-color: var(--ui-border); color: var(--ui-muted); }

/* Backoffice: keep dense lists legible without enlarging every cell. */
body.backend :is(.ops-panel, .panel, .list-panel, .workspace-rail, #admin-engine .ae-panel) {
  border-color: var(--ui-border);
  box-shadow: var(--ui-shadow);
}
body.backend .page-heading { box-shadow: none; }
body.backend :is(.ops-toolbar, #admin-engine .ae-toolbar) { flex-wrap: wrap; row-gap: 10px; }
body.backend :is(.ops-table, #admin-engine table) { line-height: 1.65; }
body.backend :is(.ops-table, #admin-engine table) tbody tr:focus-within { background: var(--accent-wash); }
body.backend .backend-sidebar { scrollbar-width: thin; }
body.backend :is(.ops-empty, .crm-empty) { padding: 28px 16px; line-height: 1.8; }
body.backend #admin-engine .ae-dialog-close { min-width: 36px; min-height: 36px; border-radius: 8px; }
body.backend #admin-engine .ae-dialog-close:hover { background: var(--ui-soft); }
.dialog { max-height: min(88dvh, 900px); overscroll-behavior: contain; }
.dialog-header { gap: 16px; }
.dialog-header h2 { font-size: 20px; line-height: 1.5; }
.dialog-backdrop { padding: 16px; }
.toast { overflow-wrap: anywhere; line-height: 1.6; }

/* Detail rhythm: consistent labels, readable metadata and stable interaction states. */
.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin: 0; }
.page-heading p { margin: 8px 0 0; }
.section-title h2, .section-heading h2 { line-height: 1.5; }
.panel > .section-title { padding-bottom: 14px; border-bottom: 1px solid var(--ui-border); }
.panel > .section-title:last-child { padding-bottom: 0; border-bottom: 0; }
.eyebrow { font-size: 12px; letter-spacing: 1px; color: #b84400; }
.field > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: #414955; }
.field :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select) { min-height: 38px; }
.field :is(small, .hint) { font-size: 12px; line-height: 1.7; }
.error-text { font-size: 12px; line-height: 1.7; color: #b42318; }
body.backend :is(input:not([type=checkbox]):not([type=radio]), select, textarea):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(255 96 0 / 12%);
}
body.backend :is(input, select, textarea)[aria-invalid=true] { border-color: #b42318; }
.field input[type=file] { font-size: 13px; line-height: 1.6; }
.field input[type=file]::file-selector-button {
  margin-right: 12px; padding: 7px 12px; border: 1px solid var(--ui-border);
  border-radius: 6px; background: var(--ui-soft); color: #414955; font: inherit; cursor: pointer;
}
.btn, body.backend .btn { line-height: 1.4; }
.btn svg, .iconbtn svg { flex-shrink: 0; }
.iconbtn { min-width: 36px; min-height: 36px; border-radius: 8px; }
.iconbtn:hover { background: var(--ui-soft); color: var(--ink); }
.btn:disabled, body.backend .btn:disabled, body.backend #admin-engine button:disabled { transform: none; box-shadow: none; }
.btn.primary:disabled:hover, body.backend .btn.primary:disabled:hover, body.backend #admin-engine .ae-primary:disabled:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.quick-card { transition: border-color .15s, background-color .15s, box-shadow .15s; }
.quick-card:hover { transform: none; border-color: var(--accent-line); background: var(--accent-wash); box-shadow: var(--ui-shadow); }
body.backend .quick-card .ic { background: var(--accent-soft); color: var(--accent); }
.filter { transition: color .15s, background-color .15s; }
.filter:hover { background: var(--ui-soft); color: #414955; }
.filter.active, .filter[aria-pressed=true] { color: #b84400; background: var(--accent-soft); }
.stock-row { transition: background-color .15s; }
.stock-row:focus-within, .stock-row:has(input[type=checkbox]:checked) { background: var(--accent-wash); }
.stock-row .supplier-name { line-height: 1.6; overflow-wrap: anywhere; }
.stock-row .model { overflow-wrap: anywhere; }
.stock-row .supplier-tags { flex-wrap: wrap; row-gap: 4px; }
.results-footer { padding-top: 18px; padding-bottom: 18px; line-height: 1.7; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
.pagination button:disabled:hover { background: #fff; border-color: var(--ui-border); color: var(--ui-muted); }
.pagination [aria-current=page] { background: var(--accent-soft); color: #b84400; border-color: var(--accent-line); font-weight: 600; }
body.backend .backend-group summary { color: #414955; }
body.backend .backend-group a { line-height: 1.6; padding-top: 9px; padding-bottom: 9px; }
body.backend .backend-group a.active { color: #b84400; }
body.backend :is(.ops-tabs button.active, .ops-tabs a.active, .crm-filter button.active) { color: #b84400; }
body.backend :is(.ops-table, #admin-engine table) td { line-height: 1.65; }
.dialog { box-sizing: border-box; scrollbar-width: thin; }
.dialog-header { padding-bottom: 16px; border-bottom: 1px solid var(--ui-border); }
.dialog-header .iconbtn { flex-shrink: 0; }
.dialog :is(input, select, textarea) { max-width: 100%; box-sizing: border-box; }
.dialog .actions { justify-content: flex-end; margin-top: 20px; }
.article { line-height: 1.9; }
.article h1 { font-family: var(--sans, sans-serif); font-size: clamp(24px, 3vw, 32px); font-weight: 600; line-height: 1.5; }
.article p { font-size: 14px; line-height: 1.95; }
.article blockquote { background: var(--accent-wash); border-left-color: var(--accent); color: #525c69; font-family: inherit; }

@media (max-width: 760px) {
  .field :is(input:not([type=checkbox]):not([type=radio]), select, textarea), .auth input, .dialog :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { font-size: 16px; }
  .dialog .actions .btn { min-height: 40px; }
  .dialog-header { padding-bottom: 12px; }
  .page-heading { flex-wrap: wrap; }
  .page-heading h1 { font-size: 24px; }
  .page-heading > .actions { flex-direction: row; flex-wrap: wrap; }
  .page-heading > .actions .btn { font-size: 13px; padding: 8px 12px; }
  :is(.panel, .native-panel, .native-main > .panel) { padding: 18px; }
  :is(.search-hints, .portal-brand small, .portal-company, .portal-company small, .portal-stock-brand, .portal-stock-brand small, .portal-vendor p, .portal-vendor > span:last-child, .stock-row small, .stock-row .remark, .global-footer) { font-size: 12px; }
  :is(.btn.small, .doc-card .btn, .account-buttons .btn, .stock-row .btn) { min-height: 36px; font-size: 12px; }
  :is(.filter, .tabs > button, .tabs > a) { min-height: 36px; display: inline-flex; align-items: center; }
  .search-types { gap: 6px; flex-wrap: wrap; }
  .search-types a { font-size: 13px; }
  .portal-brand small { letter-spacing: 0; }
  .selection-bar { flex-wrap: wrap; justify-content: center; box-sizing: border-box; bottom: max(12px, env(safe-area-inset-bottom)); }
  .dialog { padding: 20px; max-height: 88dvh; }
  .dialog-header h2 { font-size: 18px; }
  .native-main .search-input { gap: 8px; }
  .native-main .search-input input { min-width: 140px; }
}
@media (max-width: 480px) {
  .portal-brand { flex-wrap: wrap; }
  .portal-brand small { display: block; margin-left: 0; }
  .portal-vendors { grid-template-columns: minmax(0, 1fr); }
  .portal-vendor { border-right: 0; border-bottom: 1px solid var(--ui-border); }
  .portal-vendor:last-child { border-bottom: 0; }
  .portal-vendor strong { font-size: 13px; }
  .results-footer { align-items: flex-start; }
  .dialog-backdrop { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body { background: #fff; }
  :is(.panel, .native-panel, .list-panel) { box-shadow: none; }
  :is(.toast, .selection-bar, .dialog-backdrop) { display: none !important; }
}
