/*
 * PC 管理后台 UI refresh · 2026-08-23
 *
 * This is a CSS-only, immutable overlay for the production Element Plus build.
 * The token scale and component patterns are translated from the shadcn Studio
 * refine references selected for this wave: data-table-03, badge-05, dialog-06,
 * sheet-01 and input-09. No business selectors or data behaviour are changed.
 */
:root {
  --suya-surface: #ffffff;
  --suya-surface-muted: #f8fafc;
  --suya-surface-subtle: #f1f5f9;
  --suya-border-strong: #cbd5e1;
  --suya-focus: #0f766e;
  --suya-shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --suya-shadow-popover: 0 16px 40px rgba(15, 23, 42, .14), 0 2px 8px rgba(15, 23, 42, .08);
}

/* Page shell: calmer hierarchy and a stable reading canvas. */
.layout-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .94);
  border-bottom-color: var(--suya-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
  backdrop-filter: blur(10px);
}
.layout-main {
  padding: 28px 32px 112px;
  background:
    radial-gradient(circle at 100% 0, rgba(20, 184, 166, .05), transparent 28%),
    var(--suya-bg);
}
.bc-current { font-size: 17px; letter-spacing: -.01em; }
.header-right { gap: 10px; }
.user-info { padding: 6px 10px; border: 1px solid transparent; }
.user-info:hover { border-color: var(--suya-border); background: var(--suya-surface-muted); }

/* Sidebar: shadcn Sidebar-style groups with predictable active/hover states. */
.layout-aside {
  background: linear-gradient(180deg, #115e59 0%, #0f766e 50%, #134e4a 100%) !important;
  box-shadow: 8px 0 24px rgba(15, 23, 42, .08);
}
.logo-bar { height: 64px; padding: 0 20px; }
.logo-icon { width: 34px; height: 34px; border-radius: 9px; }
.logo-name { letter-spacing: .08em; }
.layout-menu { padding: 14px 10px; }
.layout-menu .el-menu-item-group__title {
  padding: 14px 12px 6px;
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.layout-menu .el-menu-item {
  height: 40px;
  line-height: 40px;
  margin: 2px 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, .78) !important;
  font-size: 13px;
}
.layout-menu .el-menu-item:hover { background: rgba(255, 255, 255, .12) !important; color: #fff !important; }
.layout-menu .el-menu-item.is-active {
  background: rgba(255, 255, 255, .18) !important;
  box-shadow: inset 3px 0 0 #5eead4;
  color: #fff !important;
}
.menu-search { padding: 12px 12px 6px; }
.menu-search-input {
  height: 34px;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, .22);
  background: rgba(15, 23, 42, .18);
  font-size: 13px;
}
.menu-search-input:focus { box-shadow: 0 0 0 3px rgba(94, 234, 212, .22); }

/* shadcn-style toolbar/filter primitives translated to existing Element Plus classes. */
.filter-bar,
.page-toolbar,
.toolbar,
.table-toolbar,
.search-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--suya-border);
  border-radius: 10px;
  background: var(--suya-surface);
  box-shadow: var(--suya-shadow-sm);
}
.filter-bar .filter-spacer { flex: 1 1 auto; }
.filter-bar .el-input,
.filter-bar .el-select,
.filter-bar .el-date-editor,
.page-toolbar .el-input,
.page-toolbar .el-select,
.toolbar .el-input,
.toolbar .el-select { min-width: 160px; }

/* Inputs: labels/helper text are easier to scan and focus rings are visible. */
.el-input__wrapper,
.el-textarea__inner,
.el-select .el-input__wrapper,
.el-date-editor.el-input__wrapper {
  min-height: 34px;
  border-radius: 8px !important;
  box-shadow: 0 0 0 1px var(--suya-border) inset !important;
  transition: box-shadow .15s ease, background .15s ease;
}
.el-input__wrapper:hover,
.el-textarea__inner:hover { box-shadow: 0 0 0 1px var(--suya-border-strong) inset !important; }
.el-input__wrapper.is-focus,
.el-textarea__inner:focus,
.el-select .el-input.is-focus .el-input__wrapper {
  box-shadow: 0 0 0 1px var(--suya-focus) inset, 0 0 0 3px rgba(15, 118, 110, .14) !important;
}
.el-form-item__label { color: var(--suya-text-secondary); font-size: 12px; font-weight: 600; }
.el-form-item__error { line-height: 1.35; }

/* Buttons: clear primary/secondary hierarchy and comfortable hit areas. */
.el-button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px !important;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.el-button--primary {
  border-color: var(--suya-primary-dark) !important;
  background: var(--suya-primary-dark) !important;
  box-shadow: 0 1px 2px rgba(15, 118, 110, .2);
}
.el-button--primary:hover { transform: translateY(-1px); box-shadow: var(--suya-shadow-brand); }
.el-button.el-button--primary.is-link,
.el-button.el-button--primary.is-link:hover,
.el-button.el-button--primary.is-link:focus-visible {
  color: #fff !important;
  background: var(--suya-primary-dark) !important;
  border-color: var(--suya-primary-dark) !important;
}
.el-button.el-button--primary.is-link span { color: inherit !important; }

/* Element Plus emits `is-text` for header actions such as “查看全部”.
 * Keep text buttons transparent instead of inheriting the solid primary fill. */
.el-button.el-button--primary.is-text,
.el-button.el-button--primary.is-text:focus-visible {
  color: var(--suya-primary-dark) !important;
  background: transparent !important;
  border-color: transparent !important;
  --el-button-text-color: var(--suya-primary-dark) !important;
  --el-button-hover-text-color: var(--suya-primary-dark) !important;
  --el-button-bg-color: transparent !important;
  --el-button-hover-bg-color: #f0fdfa !important;
  box-shadow: none !important;
  transform: none;
}
.el-button.el-button--primary.is-text:hover { background: #f0fdfa !important; }
.el-button.el-button--primary.is-text > span { color: inherit !important; }

/* Orders and fulfillment use Element Plus `is-plain` for state actions.
 * Keep the plain variant readable when the module stylesheet sets a solid
 * primary background and an inherited teal text color at the same time. */
.el-button.el-button--primary.is-plain,
.el-button.el-button--primary.is-plain:hover,
.el-button.el-button--primary.is-plain:focus-visible {
  color: var(--suya-primary-dark) !important;
  background: #f0fdfa !important;
  border-color: #99f6e4 !important;
  --el-button-text-color: var(--suya-primary-dark) !important;
  --el-button-hover-text-color: #0f766e !important;
  --el-button-bg-color: #f0fdfa !important;
  --el-button-hover-bg-color: #ccfbf1 !important;
  --el-button-border-color: #99f6e4 !important;
  --el-button-hover-border-color: #5eead4 !important;
  box-shadow: none !important;
  transform: none;
}
.el-button.el-button--primary.is-plain:hover { background: #ccfbf1 !important; }
.el-button.el-button--primary.is-plain > span { color: inherit !important; }
.el-button.el-button--primary.is-plain .el-icon { color: currentColor !important; }
.el-button--default { border-color: var(--suya-border-strong); color: var(--suya-text); background: var(--suya-surface); }
.el-button--default:hover { color: var(--suya-primary-dark); border-color: #99f6e4; background: #f0fdfa; }
.el-button.is-link { min-height: 30px; padding-inline: 6px; }

/* Product/order tables: keep action labels visible and visually secondary.
 * Element Plus link buttons derive text color from --el-button-text-color;
 * set both the variable and the rendered span so a later module stylesheet
 * cannot turn the solid action buttons into blank teal blocks. */
.el-table .el-button.el-button--primary.is-link,
.el-table .el-button.el-button--primary.is-link:hover,
.el-table .el-button.el-button--primary.is-link:focus-visible {
  min-width: 42px;
  min-height: 30px;
  margin-inline: 1px;
  padding-inline: 7px;
  border: 1px solid #99f6e4 !important;
  border-radius: 7px !important;
  color: var(--suya-primary-dark) !important;
  --el-button-text-color: var(--suya-primary-dark) !important;
  --el-button-hover-text-color: #0f766e !important;
  --el-button-bg-color: #f0fdfa !important;
  --el-button-hover-bg-color: #ccfbf1 !important;
  --el-button-border-color: #99f6e4 !important;
  --el-button-hover-border-color: #5eead4 !important;
  background: #f0fdfa !important;
  box-shadow: none !important;
  transform: none;
}
.el-table .el-button.el-button--primary.is-link:hover { background: #ccfbf1 !important; }
.el-table .el-button.el-button--primary.is-link > span { color: inherit !important; }
.el-table .el-button.el-button--primary.is-link .el-icon { color: currentColor !important; }
.el-table .el-table__cell:last-child .cell { white-space: nowrap; }

/* Cards/KPIs: one elevation scale across dashboard and modules. */
.el-card,
.stat-card,
.kpi-card,
.chart-card,
.summary-card,
.content-card {
  border: 1px solid var(--suya-border-light) !important;
  border-radius: 12px !important;
  background: var(--suya-surface) !important;
  box-shadow: var(--suya-shadow-card) !important;
}
.el-card:hover,
.stat-card:hover,
.kpi-card:hover { box-shadow: 0 8px 28px rgba(15, 23, 42, .1) !important; }
.stat-card { min-height: 96px; }
.stat-label { color: var(--suya-text-secondary); font-weight: 600; }
.stat-val,
.stat-value { color: var(--suya-text); letter-spacing: -.02em; }

/* Tables: preserve all business columns while improving scanability. */
.el-table {
  border-radius: 10px;
  overflow: hidden;
  --el-table-header-bg-color: #f8fafc;
  --el-table-row-hover-bg-color: #f0fdfa;
}
.el-table th.el-table__cell {
  height: 42px;
  color: var(--suya-text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  background: #f8fafc;
}
.el-table td.el-table__cell { height: 44px; color: var(--suya-text); }
.el-table .cell { line-height: 1.45; }
.el-table__inner-wrapper::before { background-color: var(--suya-border-light); }
.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell { background: #fbfdff; }
.el-table .el-table__row:focus-within td.el-table__cell { background: #f0fdfa; }

/* Badge-05 semantics: compact dot + text status without removing parallel states. */
.status-tag,
.el-tag { min-height: 24px; line-height: 20px; border-radius: 999px !important; font-weight: 600; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; padding-inline: 9px; }
.status-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}
.status-tag--draft { background: #f1f5f9; color: #475569; }
.status-tag--review { background: #fffbeb; color: #b45309; }
.status-tag--approved { background: #f0fdf4; color: #15803d; }
.status-tag--rejected { background: #fef2f2; color: #b91c1c; }
.status-tag--closed { background: #eff6ff; color: #1d4ed8; }

/* Dialog-06 / Sheet-01: persistent actions and consistent overlay geometry. */
.el-dialog {
  max-width: calc(100vw - 48px);
  border: 1px solid var(--suya-border) !important;
  box-shadow: var(--suya-shadow-popover) !important;
}
.el-dialog__header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--suya-border-light);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
.el-dialog__body { padding: 20px 22px; }
.el-dialog__footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 14px 22px;
  border-top: 1px solid var(--suya-border-light);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
.el-drawer { box-shadow: var(--suya-shadow-popover); }
.el-drawer.rtl {
  width: min(720px, 58vw) !important;
  max-width: calc(100vw - 32px) !important;
}
.el-drawer__header { margin-bottom: 0; padding: 18px 22px; border-bottom: 1px solid var(--suya-border-light); }
.el-drawer__body { padding: 20px 22px; }
.el-drawer .el-descriptions__table { table-layout: fixed; width: 100%; }
.el-drawer .el-descriptions__label {
  width: 136px !important;
  min-width: 136px !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}
.el-drawer .el-descriptions__content {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.el-drawer .el-descriptions__content a { word-break: break-all; }

/* Empty/error states: give "暂无" a useful visual anchor without changing text. */
.el-empty { padding: 36px 20px; }
.el-empty__description { color: var(--suya-text-secondary); font-size: 13px; }
.empty-state,
.contracts-empty-tip { border: 1px dashed var(--suya-border-strong); border-radius: 10px; background: var(--suya-surface-muted); }
.el-alert { border-radius: 10px; }

/* Keyboard/focus affordances and reduced motion. */
:where(button, [role="button"], a, input, textarea, select):focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* PC scope: preserve the agreed desktop-first model while avoiding clipped dialogs. */
@media (min-width: 1200px) {
  .layout-main { padding-left: 36px; padding-right: 36px; }
  .filter-bar, .page-toolbar, .toolbar, .table-toolbar, .search-bar { gap: 12px; }
}
