:root {
  --red: oklch(55% .21 25);
  --red-dark: oklch(46% .18 25);
  --red-soft: oklch(96% .025 25);
  --ink: oklch(25% .018 255);
  --muted: oklch(51% .018 255);
  --line: oklch(89% .012 255);
  --surface: oklch(99.5% .003 255);
  --canvas: oklch(97% .006 255);
  --success: oklch(57% .16 150);
  --warning: oklch(70% .15 70);
  --danger: oklch(58% .2 28);
  --radius: 12px;
  --shadow: 0 12px 36px oklch(25% .02 255 / 8%);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid oklch(65% .16 25 / 32%); outline-offset: 2px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; background: white; }
.brand span { display: grid; line-height: 1.25; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 8px; padding: 0 18px; font-weight: 650; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--red); color: white; box-shadow: 0 6px 16px oklch(55% .21 25 / 18%); }
.button.primary:hover { background: var(--red-dark); }
.button.secondary { background: white; border-color: var(--line); }
.button.secondary:hover, .button.ghost:hover { border-color: oklch(72% .03 255); background: oklch(98% .005 255); }
.button.ghost { background: transparent; border-color: var(--line); }
.button.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.text-button { border: 0; background: none; color: var(--red); min-height: 44px; padding: 0 4px; font-weight: 650; }
.icon-button { border: 0; background: oklch(96% .006 255); border-radius: 8px; width: 42px; height: 42px; font-size: 24px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; color: white; background: var(--ink); padding: 12px 18px; border-radius: 9px; box-shadow: var(--shadow); transition: .22s ease; max-width: min(480px, calc(100vw - 32px)); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--danger); }
.badge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 99px; padding: 0 9px; font-size: 12px; font-weight: 650; background: oklch(94% .01 255); }
.badge.success { color: oklch(43% .13 150); background: oklch(94% .045 150); }
.badge.warning { color: oklch(46% .12 70); background: oklch(95% .06 80); }
.badge.danger { color: var(--red-dark); background: var(--red-soft); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.skeleton { border-radius: 8px; background: linear-gradient(100deg, oklch(94% .006 255) 20%, white 40%, oklch(94% .006 255) 60%); background-size: 240% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -240% 0; } }

/* Employee surface */
.employee-body { min-height: 100vh; background: var(--canvas); }
.employee-header { position: sticky; top: 0; z-index: 20; height: 68px; background: oklch(99.5% .003 255 / 95%); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.employee-header-inner { height: 100%; max-width: 1120px; margin: auto; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; }
.account-chip { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 7px 11px; display: grid; text-align: right; }
.account-chip span { font-size: 13px; font-weight: 700; }
.account-chip small { color: var(--muted); font-size: 11px; }
.employee-main { max-width: 1120px; margin: auto; padding: 40px 22px 64px; }
.search-section { max-width: 760px; margin-bottom: 32px; }
.search-section h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 18px; letter-spacing: -.04em; }
.search-box { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px; background: white; border: 1px solid oklch(84% .018 255); padding: 7px 7px 7px 16px; border-radius: 12px; box-shadow: 0 6px 26px oklch(25% .02 255 / 6%); }
.search-box:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.search-box svg { width: 22px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-box input { min-width: 0; height: 42px; border: 0; outline: 0; font-size: 15px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.quick-category-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.category-tile { min-height: 86px; border: 1px solid var(--line); background: white; border-radius: 10px; padding: 14px; text-align: left; display: grid; align-content: space-between; transition: .16s ease; }
.category-tile:hover { border-color: oklch(72% .08 25); transform: translateY(-2px); box-shadow: 0 8px 18px oklch(25% .02 255 / 6%); }
.category-tile strong { font-size: 14px; }
.category-tile small { color: var(--muted); }
.active-filter { margin-top: 22px; padding: 12px 14px; border-left: 3px solid var(--red); border-radius: 8px; background: var(--red-soft); display: flex; align-items: center; gap: 12px; }
.active-filter span { display: grid; }
.active-filter small { font-size: 11px; color: var(--muted); }
.active-filter button { border: 0; background: none; color: var(--red-dark); margin-left: auto; min-height: 36px; }
.active-filter button + button { margin-left: 0; font-size: 20px; }
.results-section { margin-top: 34px; }
.result-heading { align-items: center; }
.status-filters { display: flex; gap: 6px; overflow-x: auto; }
.status-filters button, .segmented button { white-space: nowrap; border: 1px solid var(--line); background: white; border-radius: 7px; min-height: 36px; padding: 0 12px; font-size: 13px; }
.status-filters button.active, .segmented button.active { background: var(--ink); border-color: var(--ink); color: white; }
.supplier-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.supplier-card { border: 1px solid var(--line); background: white; border-radius: 11px; padding: 18px; text-align: left; transition: .16s ease; }
.supplier-card:hover { border-color: oklch(73% .035 255); box-shadow: 0 8px 22px oklch(25% .02 255 / 6%); }
.supplier-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.supplier-card h3 { font-size: 16px; margin: 0 0 4px; }
.supplier-card .code { color: var(--muted); font-size: 12px; }
.supplier-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 13px 0; }
.supplier-card .meta { border-top: 1px solid var(--line); padding-top: 12px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.supplier-card .meta strong { color: var(--ink); }
.load-more { width: 100%; margin-top: 14px; }
.modal { width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 40px); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 30px 90px oklch(20% .02 255 / 28%); overflow: auto; }
.modal::backdrop { background: oklch(20% .02 255 / 42%); backdrop-filter: blur(2px); }
.modal-header { position: sticky; top: 0; z-index: 2; background: white; padding: 22px 24px 16px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line); }
.modal-header span { color: var(--red); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.modal-header h2 { margin: 4px 0 0; font-size: 22px; }
.modal-search { display: block; padding: 18px 24px 10px; }
.modal-search span, .modal label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.modal-search input, .modal input, .modal select, .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; min-height: 42px; padding: 9px 11px; background: white; }
.category-list { padding: 8px 24px 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.category-row { border: 1px solid var(--line); background: white; min-height: 50px; border-radius: 8px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; text-align: left; }
.category-row small { color: var(--muted); }
.detail-body { padding: 22px 24px 28px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; }
.detail-item { display: grid; gap: 5px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item span { color: var(--muted); font-size: 12px; }
.detail-item strong { font-size: 14px; font-weight: 650; }
.contact-card { grid-column: 1 / -1; background: var(--canvas); border-radius: 9px; padding: 15px; display: grid; gap: 8px; }

/* Admin surface */
.admin-body { min-height: 100vh; padding-left: 236px; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: oklch(21% .015 255); color: white; padding: 22px 14px; display: flex; flex-direction: column; z-index: 30; }
.admin-brand { padding: 0 9px 22px; }
.admin-brand small { color: oklch(76% .01 255); }
.admin-nav { display: grid; gap: 5px; }
.nav-item { min-height: 46px; border: 0; border-radius: 8px; background: transparent; color: oklch(82% .01 255); padding: 0 11px; display: flex; align-items: center; gap: 10px; text-align: left; }
.nav-item span { width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; background: oklch(30% .014 255); font-size: 12px; }
.nav-item:hover { color: white; background: oklch(27% .014 255); }
.nav-item.active { color: white; background: var(--red); }
.nav-item.active span { background: oklch(100% 0 0 / 17%); }
.sidebar-foot { margin-top: auto; border-top: 1px solid oklch(35% .01 255); padding: 18px 9px 0; display: grid; }
.sidebar-foot small { margin-top: 4px; color: oklch(72% .01 255); font-size: 11px; }
.sidebar-foot a { margin-top: 12px; color: oklch(82% .08 25); font-size: 13px; }
.admin-main { padding: 0 30px 48px; }
.admin-topbar { height: 94px; display: flex; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.admin-topbar p { color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.admin-topbar h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
.health { margin-left: auto; border: 1px solid var(--line); background: white; border-radius: 99px; padding: 8px 12px; color: var(--muted); font-size: 12px; }
.health i { width: 7px; height: 7px; display: inline-block; margin-right: 6px; border-radius: 50%; background: var(--warning); }
.health.ok i { background: var(--success); }
.mobile-menu { display: none; }
.admin-view { display: none; }
.admin-view.active { display: block; animation: reveal .18s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.metric-grid article { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 17px 19px; display: grid; }
.metric-grid span { color: var(--muted); font-size: 12px; }
.metric-grid strong { font-size: 25px; margin: 8px 0 4px; }
.metric-grid small { color: var(--muted); }
.panel { background: white; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 4px 18px oklch(25% .02 255 / 3%); }
.narrow-panel { max-width: 980px; }
.toolbar { display: flex; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.toolbar-search { display: flex; gap: 8px; flex: 1; max-width: 560px; }
.toolbar input, .toolbar select { min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 0 11px; min-width: 150px; }
.toolbar-search input { width: 100%; }
.push-right { margin-left: auto; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { height: 46px; padding: 0 14px; text-align: left; color: var(--muted); background: oklch(98% .004 255); white-space: nowrap; font-size: 12px; }
td { min-height: 54px; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
td strong { font-size: 13px; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.table-action { border: 0; background: none; color: var(--red); font-weight: 650; padding: 7px 5px; }
.table-action.danger { color: var(--danger); }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.panel-title { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.panel-title p { margin: 0 0 4px; color: var(--red); font-size: 11px; font-weight: 750; letter-spacing: .06em; }
.panel-title h2 { margin: 0; font-size: 20px; }
.panel-title small { display: block; color: var(--muted); margin-top: 6px; }
.toggle { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: oklch(82% .01 255); position: relative; transition: .16s; vertical-align: middle; cursor: pointer; }
.toggle::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px oklch(20% .02 255 / 20%); transition: .16s; }
.toggle:checked { background: var(--red); }
.toggle:checked::after { transform: translateX(16px); }
.segmented { display: flex; gap: 6px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.upload-drop { margin: 26px; min-height: 184px; border: 1px dashed oklch(72% .035 255); border-radius: 10px; background: var(--canvas); display: grid; place-content: center; text-align: center; cursor: pointer; }
.upload-drop:hover, .upload-drop.dragging { border-color: var(--red); background: var(--red-soft); }
.upload-drop input { position: absolute; opacity: 0; pointer-events: none; }
.upload-drop span { font-size: 16px; font-weight: 700; }
.upload-drop small { margin-top: 7px; color: var(--muted); }
.import-actions, .confirm-bar { padding: 0 26px 26px; display: flex; justify-content: flex-end; gap: 10px; }
.import-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 26px 20px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.import-summary div { padding: 12px 14px; border-right: 1px solid var(--line); display: grid; }
.import-summary div:last-child { border: 0; }
.import-summary small { color: var(--muted); }
.import-summary strong { font-size: 20px; margin-top: 3px; }
.confirm-bar { align-items: center; padding-top: 18px; }
.confirm-bar span { color: var(--muted); margin-right: auto; }
.form-modal { width: min(860px, calc(100vw - 28px)); }
.form-grid { padding: 22px 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid label { min-width: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.form-grid fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 13px; }
.form-grid legend { color: var(--muted); font-size: 12px; font-weight: 650; padding: 0 4px; }
.check-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 130px; overflow-y: auto; }
.check-grid label { min-height: 34px; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.check-grid input { width: 16px; min-height: 16px; }
.contact-block { background: var(--canvas); border-radius: 9px; padding: 14px; }
.contact-block > div:first-child { display: flex; justify-content: space-between; }
.contact-block small { color: var(--muted); }
.contact-block .form-grid { padding: 14px 0 0; }
.modal-actions { position: sticky; bottom: 0; background: white; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; padding: 15px 24px; }
.mini-modal { width: min(440px, calc(100vw - 28px)); }
.mini-modal form > label { display: block; padding: 14px 22px 0; }
.simple-check-field { margin: 18px 22px 4px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.simple-check-field legend { color: var(--muted); font-size: 12px; font-weight: 650; }
.simple-check-field .check-grid { max-height: 300px; }
.switch-row { display: flex !important; justify-content: space-between; align-items: center; }
.switch-row input { width: auto; min-height: auto; }
.permission-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 20px; }
.permission-users-panel { margin-top: 16px; }
.permission-card { border: 1px solid var(--line); border-radius: 9px; padding: 17px; }
.permission-card h3 { margin: 0; }
.permission-card > p { color: var(--muted); margin: 6px 0 16px; font-size: 12px; }
.permission-option { min-height: 42px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); font-size: 13px; }
.members { margin-top: 13px; color: var(--muted); font-size: 12px; }
.log-modal { width: min(920px, calc(100vw - 28px)); }
.diff-grid { padding: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.diff-grid section { min-width: 0; }
.diff-grid h3 { font-size: 13px; margin: 0 0 8px; }
.diff-grid pre { margin: 0; min-height: 240px; max-height: 460px; overflow: auto; background: oklch(20% .014 255); color: oklch(90% .01 255); border-radius: 8px; padding: 14px; font: 12px/1.6 Consolas, monospace; white-space: pre-wrap; }

@media (max-width: 960px) {
  .quick-category-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-body { padding-left: 0; }
  .admin-sidebar { transform: translateX(-100%); transition: .2s ease; box-shadow: var(--shadow); }
  .admin-body.menu-open .admin-sidebar { transform: translateX(0); }
  .admin-main { padding: 0 18px 40px; }
  .mobile-menu { display: inline-grid; place-items: center; margin-right: 14px; width: 42px; height: 42px; border: 1px solid var(--line); background: white; border-radius: 8px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar-search { max-width: none; flex-basis: 100%; }
  .push-right { margin-left: 0; }
}
@media (max-width: 680px) {
  .employee-header { height: 62px; }
  .employee-header-inner, .employee-main { padding-left: 15px; padding-right: 15px; }
  .employee-main { padding-top: 26px; }
  .brand img { width: 36px; height: 36px; }
  .account-chip small { display: none; }
  .search-box { grid-template-columns: 22px 1fr; }
  .search-box .button { grid-column: 1 / -1; width: 100%; }
  .quick-category-grid { grid-template-columns: repeat(2, 1fr); }
  .supplier-results { grid-template-columns: 1fr; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .status-filters { width: 100%; }
  .category-list, .detail-grid, .metric-grid, .permission-grid, .diff-grid { grid-template-columns: 1fr; }
  .modal { width: 100vw; max-width: none; max-height: 94vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: 1; }
  .check-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 0 12px 32px; }
  .admin-topbar { height: 78px; margin-bottom: 16px; }
  .admin-topbar p, .health { display: none; }
  .toolbar select { flex: 1; min-width: 120px; }
  .push-right { width: 100%; }
  .import-summary { grid-template-columns: repeat(2, 1fr); }
}
