:root {
  --bg: #f4f2f9;
  --panel: #ffffff;
  --panel-soft: #f8f7fc;
  --text: #17212f;
  --muted: #64748b;
  --line: #ded8eb;
  --brand-light: #d1c6eb;
  --brand: #5b3fa3;
  --brand-deep: #2e3192;
  --blue: #5b3fa3;
  --blue-deep: #2e3192;
  --green: #15803d;
  --green-soft: #eaf7ef;
  --orange: #b75d0b;
  --orange-soft: #fff2df;
  --red: #c0332b;
  --red-soft: #fff0ee;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1040px;
  min-height: 100vh;
  color: var(--text);
  font-family:
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    "Segoe UI",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at 78% 8%, rgba(91, 63, 163, 0.12), transparent 30%),
    linear-gradient(180deg, #f7f5fb 0, #fbfbfd 360px, #f4f2f9 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(760px, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(91, 63, 163, 0.78), rgba(46, 49, 146, 0.96)),
    #2e3192;
  color: #f5f8fb;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: url("./assets/kunyuan-graphics-lite.png");
  background-size: 520px auto;
  background-position: 8% 0;
  background-repeat: no-repeat;
  pointer-events: none;
}

.sidebar > * {
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
}

.brand-logo,
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.brand-logo {
  object-fit: contain;
  background: #ffffff;
  padding: 5px;
}

.brand-mark {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--brand);
  font-weight: 800;
  letter-spacing: 0;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.detail-header h3,
.modal h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.25;
}

.brand p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: #dce5ee;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #9db4cc;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px 4px;
}

.scan-state {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.scan-state strong {
  display: block;
  font-size: 13px;
}

.scan-state small {
  display: block;
  margin-top: 3px;
  color: #aeb9c5;
  font-size: 12px;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #31c46a;
  box-shadow: 0 0 0 6px rgba(49, 196, 106, 0.16);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 2px 0 4px;
}

.topbar h2 {
  font-size: 25px;
  line-height: 1.2;
}

.topbar p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.primary-button,
.ghost-button {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid var(--line);
}

.icon-button {
  display: grid;
  width: 36px;
  place-items: center;
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
}

.icon-button:hover {
  border-color: #b7c3d0;
  background: #f6f8fa;
}

.primary-button {
  border-color: var(--brand);
  padding: 0 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  font-weight: 700;
}

.primary-button:hover {
  background: var(--brand-deep);
}

.ghost-button {
  padding: 0 16px;
  color: var(--text);
  background: #ffffff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 98px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.045);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -30px;
  width: 86px;
  height: 86px;
  background: linear-gradient(135deg, rgba(209, 198, 235, 0.6), rgba(46, 49, 146, 0.08));
  transform: skewX(-18deg);
}

.stat-label,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  position: relative;
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.smart-desk {
  display: grid;
  grid-template-columns: 160px minmax(360px, 1fr) minmax(360px, 1.15fr);
  gap: 12px;
  align-items: stretch;
}

.smart-score,
.smart-main,
.smart-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.045);
}

.smart-score {
  display: grid;
  align-content: center;
  min-height: 132px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(91, 63, 163, 0.92), rgba(46, 49, 146, 0.96)),
    var(--brand-deep);
  color: #ffffff;
}

.smart-score .eyebrow {
  color: rgba(255, 255, 255, 0.74);
}

.smart-score strong {
  display: block;
  margin-top: 8px;
  font-size: 42px;
  line-height: 1;
}

.smart-score small {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
}

.smart-main {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 132px;
  padding: 18px;
}

.smart-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.smart-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.smart-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.smart-item {
  display: grid;
  gap: 5px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: var(--panel-soft);
}

.smart-item strong,
.smart-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-item strong {
  font-size: 13px;
}

.smart-item small {
  color: var(--muted);
  font-size: 12px;
}

.smart-item.ok {
  border-color: rgba(21, 128, 61, 0.18);
  background: var(--green-soft);
}

.smart-item.warn {
  border-color: rgba(183, 93, 11, 0.2);
  background: var(--orange-soft);
}

.smart-item.bad {
  border-color: rgba(192, 51, 43, 0.2);
  background: var(--red-soft);
}

.stat-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 360px;
  gap: 16px;
  min-height: 0;
}

.device-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.045);
}

.device-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 380px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.segment {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
}

.segment.active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(31, 41, 51, 0.12);
}

.table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 285px);
}

.device-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.device-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 40px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.device-table td {
  height: 58px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

.device-table th:nth-child(1),
.device-table td:nth-child(1) {
  width: 28%;
}

.device-table th:nth-child(2),
.device-table td:nth-child(2) {
  width: 18%;
}

.device-table th:nth-child(3),
.device-table td:nth-child(3) {
  width: 18%;
}

.device-table th:nth-child(4),
.device-table td:nth-child(4),
.device-table th:nth-child(5),
.device-table td:nth-child(5) {
  width: 12%;
}

.device-row {
  cursor: pointer;
}

.device-row:hover {
  background: #f6f9fd;
}

.device-row.selected {
  background: #edf4ff;
}

.computer-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.computer-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: #e9eff6;
  color: #35506b;
  font-weight: 800;
}

.computer-cell strong,
.computer-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.computer-cell small {
  margin-top: 3px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 25px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ok {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.warn {
  color: var(--orange);
  background: var(--orange-soft);
}

.status-pill.bad {
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.neutral {
  color: #586575;
  background: #edf1f5;
}

.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 16px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-header h3 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
  word-break: break-all;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-meta div {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.detail-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-meta strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
}

.action-button:hover {
  border-color: #aebbd0;
  background: #f7faff;
}

.action-button.warning:hover {
  border-color: #efbd78;
  background: #fff9ef;
}

.button-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}

.action-button.warning .button-icon {
  background: var(--orange);
}

.action-button strong,
.action-button small {
  display: block;
}

.action-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.drive-list,
.capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drive-chip,
.capability-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  color: #435365;
  background: var(--panel-soft);
  font-size: 12px;
}

.drive-chip.available {
  color: var(--green);
  border-color: #b7e2c5;
  background: var(--green-soft);
}

.primary-link-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid var(--blue);
  padding: 0 16px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.content-grid {
  display: grid;
  gap: 16px;
}

.content-grid.two {
  grid-template-columns: minmax(520px, 620px) minmax(0, 1fr);
  align-items: start;
}

.content-grid.two.resizable-grid {
  grid-template-columns: minmax(420px, var(--side-width, 620px)) 10px minmax(0, 1fr);
}

.splitter {
  width: 10px;
  min-height: 100%;
  border-radius: 999px;
  cursor: col-resize;
  background: linear-gradient(90deg, transparent 0 3px, #c7d2df 3px 7px, transparent 7px 10px);
}

.splitter:hover {
  background: linear-gradient(90deg, transparent 0 3px, var(--blue) 3px 7px, transparent 7px 10px);
}

.module-card {
  min-width: 0;
  overflow-x: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.045);
}

.module-card.wide {
  grid-column: span 1;
}

.content-grid.two .module-card.wide {
  grid-column: span 1;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h3 {
  margin: 0;
  font-size: 17px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.simple-table th {
  height: 36px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  text-align: left;
}

.simple-table td {
  min-height: 44px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.mini-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--blue);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-list div,
.feature-grid div {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.task-list strong,
.task-list small,
.feature-grid strong,
.feature-grid small {
  display: block;
}

.task-list small,
.feature-grid small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feature-grid.single-col {
  grid-template-columns: 1fr;
}

.big-device {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.big-device h3,
.big-device p {
  margin: 0;
}

.big-device p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.detail-meta.single {
  grid-template-columns: 1fr;
  margin-top: 12px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}

.timeline-item strong,
.timeline-item small {
  display: block;
}

.timeline-item small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  background: #c5ced8;
  box-shadow: 0 0 0 5px rgba(197, 206, 216, 0.22);
}

.dot.ok {
  background: #31c46a;
  box-shadow: 0 0 0 5px rgba(49, 196, 106, 0.14);
}

.dot.warn {
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.16);
}

.form-grid.stacked {
  grid-template-columns: 1fr;
}

.full-width {
  width: 100%;
  margin-top: 14px;
}

.employee-body {
  min-width: 980px;
  background: #f1f5f8;
}

.employee-shell {
  min-height: 100vh;
}

.employee-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #14202d;
  color: #ffffff;
}

.compact-brand {
  padding: 0;
}

.employee-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c7d2df;
  font-size: 13px;
}

.employee-status span:not(.status-pill) {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  padding-left: 10px;
}

.employee-main {
  display: grid;
  gap: 14px;
  padding: 18px 22px 28px;
}

.employee-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 118px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.045);
}

.employee-hero h2,
.employee-hero p {
  margin: 0;
}

.employee-hero h2 {
  margin-top: 5px;
  font-size: 26px;
}

.employee-login-layout {
  display: grid;
  grid-template-columns: 460px minmax(420px, 1fr);
  gap: 14px;
  align-items: start;
}

.login-card {
  min-height: 292px;
}

.system-status-card {
  min-height: 292px;
}

.status-grid,
.employee-hero-status {
  display: grid;
  gap: 10px;
}

.status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-grid div,
.employee-hero-status div {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.status-grid span,
.status-grid strong,
.employee-hero-status span,
.employee-hero-status strong {
  display: block;
}

.status-grid span,
.employee-hero-status span {
  color: var(--muted);
  font-size: 12px;
}

.status-grid strong,
.employee-hero-status strong {
  margin-top: 8px;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 520px) auto;
}

.employee-hero-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.employee-hero p {
  margin-top: 8px;
  color: var(--muted);
}

.inline-search {
  max-width: none;
  margin-bottom: 12px;
}

.month-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.month-switch input {
  min-width: 132px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  outline: none;
}

.month-switch.compact {
  min-height: 44px;
  background: rgba(255, 255, 255, 0.85);
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  outline: none;
}

textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 63, 163, 0.14);
}

.notice-list,
.anomaly-list {
  display: grid;
  gap: 10px;
}

.notice-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.notice-item strong {
  color: var(--ink);
  font-size: 15px;
}

.notice-item small,
.notice-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.preview-box {
  margin-top: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px dashed #bdb4df;
  border-radius: 8px;
  color: var(--brand-deep);
  background: rgba(209, 198, 235, 0.22);
  font-size: 13px;
  line-height: 1.5;
}

.employee-payroll-card {
  grid-column: 1 / -1;
  min-height: 300px;
  padding: 22px;
}

.payroll-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.payroll-summary-strip div {
  min-height: 102px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.payroll-summary-strip span,
.payroll-summary-strip strong {
  display: block;
}

.payroll-summary-strip span {
  color: var(--muted);
  font-size: 12px;
}

.payroll-summary-strip strong {
  margin-top: 10px;
  font-size: 34px;
}

.compact-entry-card {
  align-self: start;
  min-height: 0;
  height: auto;
}

.profit-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 122px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.05);
}

.profit-hero strong {
  display: block;
  margin-top: 8px;
  font-size: 40px;
  line-height: 1;
}

.profit-hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

.payroll-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.platform-total-grid,
.platform-rule-grid,
.employee-commission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.platform-total-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.04);
}

.platform-total-card span,
.platform-total-card strong,
.platform-total-card small {
  display: block;
}

.platform-total-card span,
.platform-total-card small {
  color: var(--muted);
}

.platform-total-card strong {
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

.platform-total-card small {
  margin-top: 12px;
  font-size: 12px;
}

.add-platform-card {
  border-style: dashed;
}

.employee-commission-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.commission-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.commission-input-grid label,
.readonly-total {
  display: grid;
  gap: 6px;
}

.commission-input-grid span,
.readonly-total span {
  color: var(--muted);
  font-size: 12px;
}

.commission-input-grid input,
.editable-expense-table input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #ffffff;
}

.readonly-total {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel-soft);
}

.readonly-total strong {
  font-size: 20px;
}

.editable-expense-table td {
  padding: 6px 10px;
}

.expense-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.device-table.extended th:nth-child(1),
.device-table.extended td:nth-child(1) {
  width: 24%;
}

.device-table.extended th:nth-child(2),
.device-table.extended td:nth-child(2),
.device-table.extended th:nth-child(3),
.device-table.extended td:nth-child(3) {
  width: 16%;
}

.device-table.extended th:nth-child(4),
.device-table.extended td:nth-child(4),
.device-table.extended th:nth-child(5),
.device-table.extended td:nth-child(5),
.device-table.extended th:nth-child(6),
.device-table.extended td:nth-child(6),
.device-table.extended th:nth-child(7),
.device-table.extended td:nth-child(7) {
  width: 11%;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 33, 43, 0.38);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(720px, calc(100vw - 48px));
  border-radius: 10px;
  padding: 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal-card.compact {
  width: min(520px, calc(100vw - 48px));
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-card h3 {
  margin-top: 3px;
  font-size: 20px;
}

.modal-card p {
  margin: 18px 0 2px;
  color: #435365;
  line-height: 1.7;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.check-row {
  display: flex;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.check-row strong,
.check-row small {
  display: block;
}

.check-row small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.form-grid label {
  display: grid;
  gap: 6px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid label span {
  color: var(--muted);
  font-size: 12px;
}

.form-help {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-grid input,
.form-grid select {
  min-height: 37px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  outline: 0;
  background: #ffffff;
}

.table-input,
.simple-table select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #ffffff;
}

.empty-cell,
.empty-panel {
  color: var(--muted);
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 63, 163, 0.14);
}

.modal-card footer {
  margin-top: 18px;
  justify-content: flex-end;
}

.is-refreshing .pulse {
  animation: breathe 1s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(49, 196, 106, 0.16);
  }

  50% {
    transform: scale(0.82);
    box-shadow: 0 0 0 12px rgba(49, 196, 106, 0.05);
  }
}

@media (max-width: 1120px) {
  body {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .brand div:last-child,
  .nav-item span:last-child,
  .sidebar-footer {
    display: none;
  }

  .nav-item {
    justify-content: center;
  }

  .nav-icon {
    font-size: 18px;
  }

  .main,
  .employee-main {
    min-width: 0;
    padding: 18px;
  }

  .topbar,
  .employee-hero,
  .employee-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .smart-desk,
  .content-grid.two,
  .employee-login-layout,
  .employee-dashboard-hero {
    grid-template-columns: 1fr;
  }

  .smart-list {
    grid-template-columns: 1fr;
  }

  .content-grid.two.resizable-grid {
    grid-template-columns: 1fr;
  }

  .splitter {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel {
    order: -1;
  }

  .employee-body {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px 8px;
  }

  .brand-mark,
  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .stats-grid,
  .smart-desk,
  .smart-list,
  .feature-grid,
  .config-grid,
  .form-grid,
  .status-grid,
  .employee-hero-status,
  .payroll-summary-strip,
  .platform-total-grid,
  .platform-rule-grid,
  .employee-commission-grid,
  .commission-input-grid {
    grid-template-columns: 1fr;
  }

  .profit-hero,
  .expense-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-toolbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .search-box {
    max-width: none;
  }

  .segmented {
    overflow-x: auto;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .device-table,
  .simple-table {
    min-width: 760px;
  }
}

/* 2026-06 UI fix: 工作填报页去掉右侧大空白。
   原因：同一个 CSS grid 的第一行高度被左侧“新增记录”卡片撑高，
   导致右侧“导入旧 WPS 表格”下面空出一大块。
   改为左右两列各自纵向排列，右侧“工作记录”会紧贴导入框下方。 */
.worklog-layout {
  display: grid;
  grid-template-columns: minmax(460px, 620px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.worklog-column {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.worklog-table-card {
  margin-top: 0;
}

.worklog-table th:nth-child(1),
.worklog-table td:nth-child(1) {
  width: 14%;
}

.worklog-table th:nth-child(2),
.worklog-table td:nth-child(2),
.worklog-table th:nth-child(3),
.worklog-table td:nth-child(3) {
  width: 12%;
}

.worklog-table th:nth-child(4),
.worklog-table td:nth-child(4) {
  width: 28%;
}

.worklog-table th:nth-child(5),
.worklog-table td:nth-child(5),
.worklog-table th:nth-child(6),
.worklog-table td:nth-child(6),
.worklog-table th:nth-child(7),
.worklog-table td:nth-child(7) {
  width: 11%;
}

.break-cell {
  word-break: break-all;
}

@media (max-width: 1120px) {
  .worklog-layout {
    grid-template-columns: 1fr;
  }
}

/* 2026-06 UI fix: 员工端也改成左右独立纵向布局，避免短卡片下面出现大块空白。 */
.employee-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 560px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.employee-column {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.employee-table-card,
.employee-payroll-card {
  margin-top: 0;
}

.employee-worklog-table th:nth-child(1),
.employee-worklog-table td:nth-child(1) {
  width: 14%;
}

.employee-worklog-table th:nth-child(2),
.employee-worklog-table td:nth-child(2) {
  width: 14%;
}

.employee-worklog-table th:nth-child(3),
.employee-worklog-table td:nth-child(3) {
  width: 30%;
}

.employee-worklog-table th:nth-child(4),
.employee-worklog-table td:nth-child(4),
.employee-worklog-table th:nth-child(5),
.employee-worklog-table td:nth-child(5),
.employee-worklog-table th:nth-child(6),
.employee-worklog-table td:nth-child(6) {
  width: 14%;
}

@media (max-width: 1120px) {
  .employee-workspace {
    grid-template-columns: 1fr;
  }
}

/* 2026-06 UI fix: 固定左侧导航/左侧工作区，不随页面滚轮移动 */
html,
body {
  height: 100%;
}

body:not(.employee-body) {
  overflow: hidden;
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  align-self: start;
}

.main {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.employee-body {
  height: 100vh;
  overflow: hidden;
}

.employee-shell {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.employee-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}

.employee-main {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.employee-workspace .employee-column:first-child {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  align-self: start;
  padding-right: 2px;
}

@media (max-width: 1120px) {
  .employee-workspace .employee-column:first-child {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

/* 2026-06-09：平台规则卡片紧凑化，去掉无关大空白 */
.platform-rule-grid {
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  align-items: start;
}

.compact-platform-card {
  padding: 14px 16px;
}

.compact-platform-card .section-title {
  margin-bottom: 8px;
}

.form-grid.compact-form,
.platform-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 8px;
}

.form-grid.compact-form label {
  gap: 4px;
}

.form-grid.compact-form input,
.form-grid.compact-form select {
  min-height: 34px;
}

.form-grid.compact-form .wide,
.platform-form-grid .wide {
  grid-column: 1 / -1;
}

.compact-platform-card .form-help {
  margin-top: -2px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--panel-soft);
}

.compact-actions {
  margin-top: 10px;
  gap: 8px;
}

.compact-actions .ghost-button,
.compact-actions .primary-button {
  min-height: 32px;
  padding: 0 12px;
}

.compact-platform-card select:disabled {
  color: var(--muted);
  background: #f5f4f8;
  cursor: not-allowed;
}

@media (max-width: 1280px) {
  .platform-rule-grid {
    grid-template-columns: 1fr;
  }
}


/* 2026-06-09 compact UI: 管理端 + 员工端整体紧凑化 */
:root {
  --radius: 6px;
}

/* 全局密度 */
.main {
  gap: 9px;
  padding: 12px 14px 18px;
}

.topbar {
  min-height: 42px;
  padding: 0;
}

.topbar h2 {
  font-size: 22px;
}

.topbar p,
.employee-hero p,
.sidebar-footer small,
.form-help.compact-hide {
  display: none;
}

.top-actions {
  gap: 7px;
}

.primary-button,
.ghost-button,
.primary-link-button,
.icon-button,
.month-switch {
  min-height: 32px;
  border-radius: 6px;
}

.primary-button,
.ghost-button,
.primary-link-button {
  padding: 0 12px;
  font-size: 13px;
}

.month-switch {
  padding: 0 8px;
  gap: 6px;
}

.month-switch input {
  min-width: 116px;
}

/* 管理端左侧菜单变窄变紧凑 */
.app-shell {
  grid-template-columns: 198px minmax(0, 1fr);
}

.sidebar {
  padding: 12px 8px;
}

.sidebar::before {
  opacity: 0.12;
  background-size: 420px auto;
}

.brand {
  gap: 9px;
  padding: 2px 7px 12px;
}

.brand-logo,
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

.brand h1 {
  font-size: 15px;
}

.brand p {
  font-size: 11px;
}

.nav-list {
  gap: 3px;
}

.nav-item {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 9px;
  gap: 8px;
  font-size: 13px;
}

.nav-icon {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding: 8px 4px 2px;
}

.scan-state {
  padding: 8px;
  gap: 8px;
}

.scan-state strong {
  font-size: 12px;
}

/* 卡片、表格、表单压缩 */
.content-grid,
.employee-column,
.payroll-section,
.task-list,
.notice-list,
.anomaly-list,
.platform-total-grid,
.platform-rule-grid,
.employee-commission-grid {
  gap: 8px;
}

.module-card {
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(31, 41, 51, 0.035);
}

.section-title {
  margin-bottom: 7px;
  gap: 8px;
  align-items: center;
}

.section-title h3 {
  font-size: 15px;
}

.section-title span {
  font-size: 11px;
}

.form-grid {
  gap: 8px;
  margin-top: 8px;
}

.form-grid label {
  gap: 3px;
}

.form-grid label span,
.form-help,
.stat-label,
.eyebrow {
  font-size: 11px;
}

.form-grid input,
.form-grid select,
.table-input,
.simple-table select,
.commission-input-grid input,
.editable-expense-table input,
textarea {
  min-height: 30px;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 13px;
}

textarea {
  min-height: 78px;
  padding: 7px 8px;
}

.full-width {
  margin-top: 8px;
}

.inline-actions {
  gap: 6px;
  margin-top: 8px;
}

.preview-box {
  min-height: 32px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 12px;
}

.simple-table th {
  height: 30px;
  padding: 0 8px;
  font-size: 11px;
}

.simple-table td {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.mini-button {
  min-height: 24px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
}

.status-pill {
  min-width: 50px;
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

/* 首页和工资页少占空间 */
.stats-grid {
  gap: 8px;
}

.stat-card {
  min-height: 76px;
  padding: 11px;
}

.stat-card strong {
  margin-top: 5px;
  font-size: 24px;
}

.stat-card small {
  margin-top: 7px;
}

.smart-desk {
  grid-template-columns: 118px minmax(300px, 0.9fr) minmax(320px, 1.1fr);
  gap: 8px;
}

.smart-score,
.smart-main {
  min-height: 104px;
  padding: 12px;
}

.smart-score strong {
  font-size: 32px;
}

.smart-list {
  gap: 6px;
  padding: 7px;
}

.smart-item {
  min-height: 42px;
  padding: 7px 8px;
}

.profit-hero {
  min-height: 74px;
  padding: 12px 14px;
  gap: 10px;
}

.profit-hero strong {
  margin-top: 4px;
  font-size: 28px;
}

.profit-hero p {
  margin-top: 6px;
  font-size: 12px;
}

.payroll-section {
  padding: 9px;
  border-radius: 6px;
}

.platform-total-card {
  min-height: 76px;
  padding: 11px;
}

.platform-total-card strong {
  margin-top: 6px;
  font-size: 22px;
}

.platform-total-card small {
  margin-top: 7px;
}

.platform-rule-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
}

.compact-platform-card {
  padding: 10px;
}

.compact-platform-card .section-title {
  margin-bottom: 5px;
}

.form-grid.compact-form,
.platform-form-grid {
  gap: 7px 8px;
  margin-top: 5px;
}

.form-grid.compact-form input,
.form-grid.compact-form select {
  min-height: 29px;
}

.compact-platform-card .form-help {
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.35;
}

.compact-actions {
  margin-top: 7px;
  gap: 6px;
}

.compact-actions .ghost-button,
.compact-actions .primary-button {
  min-height: 28px;
  padding: 0 9px;
}

.employee-commission-card,
.readonly-total {
  padding: 8px;
}

.commission-input-grid {
  gap: 7px;
  margin-top: 7px;
}

/* 工作填报页面压缩 */
.worklog-layout {
  gap: 9px;
}

.import-card,
.worklog-table-card,
.employee-table-card,
.employee-payroll-card {
  min-height: 0;
}

/* 员工端顶部和内容压缩 */
.employee-topbar {
  min-height: 50px;
  padding: 0 16px;
}

.employee-status {
  gap: 6px;
  font-size: 12px;
}

.employee-status span:not(.status-pill) {
  min-height: 22px;
  padding-left: 7px;
}

.employee-main {
  gap: 9px;
  padding: 10px 14px 16px;
}

.employee-hero {
  min-height: 62px;
  padding: 10px 12px;
  gap: 10px;
  border-radius: 6px;
}

.employee-hero h2 {
  margin-top: 2px;
  font-size: 20px;
}

.employee-dashboard-hero {
  grid-template-columns: minmax(180px, 0.9fr) minmax(260px, 420px) auto;
}

.employee-hero-status {
  gap: 6px;
}

.employee-hero-status div,
.status-grid div {
  min-height: 48px;
  padding: 7px 8px;
  border-radius: 6px;
}

.employee-hero-status strong,
.status-grid strong {
  margin-top: 4px;
  font-size: 15px;
}

.month-switch.compact {
  min-height: 32px;
}

.employee-workspace {
  grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
  gap: 9px;
}

.employee-workspace .employee-column:first-child {
  top: 10px;
  max-height: calc(100vh - 20px);
}

.notice-item {
  gap: 3px;
  padding: 8px;
  border-radius: 6px;
}

.notice-item strong {
  font-size: 13px;
}

.notice-item small,
.notice-item p {
  line-height: 1.35;
  font-size: 12px;
}

.payroll-summary-strip {
  gap: 7px;
  margin-bottom: 8px;
}

.payroll-summary-strip div {
  min-height: 60px;
  padding: 9px;
  border-radius: 6px;
}

.payroll-summary-strip strong {
  margin-top: 5px;
  font-size: 22px;
}

.employee-payroll-card {
  padding: 10px;
}

/* 大屏一屏显示更多内容 */
@media (min-width: 1280px) {
  .platform-total-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .platform-rule-grid {
    grid-template-columns: 1fr;
  }
  .employee-dashboard-hero {
    grid-template-columns: 1fr;
  }
}

/* 业务记录增强：公告换行、删除按钮、紧凑状态 */
.preserve-lines {
  white-space: pre-wrap !important;
  word-break: break-word;
}
.danger-button {
  color: #c0332b;
  border-color: rgba(192, 51, 43, 0.28);
  background: #fff7f6;
}
.danger-button:hover {
  background: #fff0ee;
}
.simple-table td,
.simple-table th {
  vertical-align: middle;
}


/* 2026-06-09 按钮显示完整修复：所有表格允许横向滚动，操作列不再被挤成竖排 */
.module-card {
  overflow-x: auto;
}

.simple-table {
  table-layout: auto !important;
  min-width: 100%;
}

.simple-table th,
.simple-table td {
  vertical-align: middle;
}

.simple-table th:last-child,
.simple-table td:last-child,
.simple-table .action-cell {
  width: 1%;
  min-width: 76px;
  white-space: nowrap !important;
  word-break: keep-all;
  overflow-wrap: normal;
}

.action-cell,
.simple-table td:last-child {
  white-space: nowrap !important;
}

.action-cell .mini-button,
.simple-table td:last-child .mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-right: 4px;
}

.action-cell .mini-button:last-child,
.simple-table td:last-child .mini-button:last-child {
  margin-right: 0;
}

.action-cell-wide {
  min-width: 150px !important;
}

.worklog-table {
  min-width: 1120px;
}

.worklog-table th:nth-child(1),
.worklog-table td:nth-child(1) { width: 96px; }
.worklog-table th:nth-child(2),
.worklog-table td:nth-child(2) { width: 82px; }
.worklog-table th:nth-child(3),
.worklog-table td:nth-child(3) { width: 82px; }
.worklog-table th:nth-child(4),
.worklog-table td:nth-child(4) { width: 72px; }
.worklog-table th:nth-child(5),
.worklog-table td:nth-child(5) { width: 260px; }
.worklog-table th:nth-child(6),
.worklog-table td:nth-child(6) { width: 76px; }
.worklog-table th:nth-child(7),
.worklog-table td:nth-child(7) { width: 74px; }
.worklog-table th:nth-child(8),
.worklog-table td:nth-child(8) { width: 82px; }
.worklog-table th:nth-child(9),
.worklog-table td:nth-child(9) { width: 72px; min-width: 72px; }

.employee-worklog-table {
  min-width: 880px;
}

.employee-worklog-table th:nth-child(1),
.employee-worklog-table td:nth-child(1) { width: 96px; }
.employee-worklog-table th:nth-child(2),
.employee-worklog-table td:nth-child(2) { width: 86px; }
.employee-worklog-table th:nth-child(3),
.employee-worklog-table td:nth-child(3) { width: 72px; }
.employee-worklog-table th:nth-child(4),
.employee-worklog-table td:nth-child(4) { width: 260px; }
.employee-worklog-table th:nth-child(5),
.employee-worklog-table td:nth-child(5) { width: 78px; }
.employee-worklog-table th:nth-child(6),
.employee-worklog-table td:nth-child(6) { width: 74px; }
.employee-worklog-table th:nth-child(7),
.employee-worklog-table td:nth-child(7) { width: 126px; min-width: 126px; }

.employee-action-cell {
  min-width: 126px !important;
}

.break-cell {
  word-break: break-all;
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .worklog-table { min-width: 1180px; }
  .employee-worklog-table { min-width: 920px; }
}

/* 2026-06-09 员工端顶部四卡片一排 + 下拉状态紧凑优化 */
.employee-dashboard-hero {
  grid-template-columns: minmax(180px, 0.7fr) minmax(520px, 1.15fr) auto !important;
  align-items: center;
}
.employee-hero-status {
  grid-template-columns: repeat(4, minmax(112px, 1fr)) !important;
  gap: 8px !important;
}
.employee-hero-status div {
  min-height: 48px !important;
  padding: 7px 9px !important;
}
.table-select,
.final-status-select {
  min-height: 28px;
  height: 28px;
  max-width: 96px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}
.simple-table td select.final-status-select {
  width: 82px;
}
.compact-actions .danger-button,
.action-cell .danger-button {
  border-color: rgba(192, 51, 43, 0.26);
  color: var(--red);
  background: var(--red-soft);
}
#workChannelRow[hidden],
#employeeChannelRow[hidden] {
  display: none !important;
}
@media (max-width: 1280px) {
  .employee-dashboard-hero {
    grid-template-columns: 1fr !important;
  }
  .employee-hero-status {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}


/* 2026-06-09 final clean compact overrides */
body { min-width: 1180px; }
.app-shell { grid-template-columns: 180px minmax(960px, 1fr) !important; }
.sidebar { position: sticky !important; top: 0 !important; height: 100vh !important; padding: 10px 8px !important; }
.brand { padding: 2px 6px 12px !important; gap: 8px !important; }
.brand-logo, .brand-mark { width: 34px !important; height: 34px !important; border-radius: 6px !important; }
.brand h1 { font-size: 15px !important; }
.brand p { font-size: 11px !important; }
.nav-list { gap: 3px !important; }
.nav-item { min-height: 32px !important; border-radius: 6px !important; padding: 0 8px !important; font-size: 13px !important; }
.main { padding: 12px 14px 18px !important; gap: 9px !important; }
.topbar { min-height: 40px !important; }
.topbar h2 { font-size: 21px !important; }
.topbar p { margin-top: 2px !important; font-size: 12px !important; }
.module-card, .stat-card, .smart-score, .smart-main, .smart-list { border-radius: 6px !important; box-shadow: 0 4px 10px rgba(31,41,51,.045) !important; }
.module-card { padding: 10px !important; }
.stats-grid { gap: 8px !important; }
.stat-card { min-height: 74px !important; padding: 10px 12px !important; }
.stat-card strong { font-size: 24px !important; margin-top: 4px !important; }
.stat-card small { margin-top: 6px !important; }
.content-grid, .worklog-layout, .payroll-grid, .employee-dashboard-layout { gap: 8px !important; }
.form-grid { gap: 7px !important; }
.form-grid label span { margin-bottom: 3px !important; font-size: 12px !important; }
input, select, textarea { min-height: 32px !important; font-size: 13px !important; }
textarea { min-height: 74px !important; }
.primary-button, .ghost-button, .mini-button, .primary-link-button { min-height: 30px !important; border-radius: 5px !important; }
.mini-button { min-width: 46px !important; padding: 0 9px !important; white-space: nowrap !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }
.simple-table { min-width: 100%; table-layout: auto !important; }
.simple-table th, .simple-table td { height: 34px !important; padding: 6px 8px !important; font-size: 12px !important; vertical-align: middle !important; }
.simple-table th:last-child, .simple-table td:last-child, .action-cell { min-width: 94px !important; width: 94px !important; white-space: nowrap !important; text-align: center !important; }
.action-cell { display: table-cell !important; }
.action-cell .mini-button { margin: 0 2px 2px 0 !important; }
.break-cell { word-break: break-all !important; overflow-wrap: anywhere !important; min-width: 130px !important; }
.table-select, .final-status-select { min-height: 26px !important; height: 26px !important; min-width: 76px !important; max-width: 96px !important; padding: 0 5px !important; font-size: 12px !important; }
.preserve-lines, .notice-item p { white-space: pre-wrap !important; word-break: break-word !important; }
.employee-body { min-width: 1180px !important; }
.employee-shell { min-height: 100vh !important; }
.employee-topbar { position: sticky !important; top: 0 !important; z-index: 20 !important; min-height: 44px !important; padding: 6px 12px !important; }
.employee-main { padding: 8px 10px 14px !important; gap: 8px !important; }
.employee-hero { padding: 10px !important; min-height: 86px !important; }
.employee-dashboard-hero { grid-template-columns: minmax(170px, .7fr) minmax(520px, 1.15fr) auto !important; align-items: center !important; gap: 8px !important; }
.employee-hero h2 { font-size: 20px !important; }
.employee-hero p { margin-top: 3px !important; font-size: 12px !important; }
.employee-hero-status { grid-template-columns: repeat(4, minmax(112px, 1fr)) !important; gap: 7px !important; }
.employee-hero-status div { min-height: 46px !important; padding: 6px 8px !important; }
.employee-hero-status strong { font-size: 15px !important; margin-top: 3px !important; }
.employee-worklog-table { min-width: 980px !important; }
.worklog-table { min-width: 1180px !important; }
.table-scroll, .table-wrap { overflow-x: auto !important; }


/* 2026-06-09 最终修复：按钮完整显示、定稿状态下拉、公告/平台删除按钮清晰 */
.module-card,
.worklog-table-card {
  overflow-x: auto !important;
  overflow-y: visible;
}
.simple-table {
  table-layout: fixed !important;
  width: 100%;
  border-collapse: collapse;
}
.simple-table th,
.simple-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.simple-table th:last-child,
.simple-table td:last-child,
.simple-table .action-cell {
  min-width: 116px !important;
  width: 116px !important;
  max-width: none !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: left;
}
.action-cell,
.action-cell-wide,
.employee-action-cell {
  display: table-cell !important;
  min-width: 116px !important;
  width: 116px !important;
  white-space: nowrap !important;
}
.action-cell .mini-button,
.action-cell .ghost-button,
.action-cell .primary-button,
.action-cell-wide .mini-button,
.employee-action-cell .mini-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 26px;
  margin: 0 4px 0 0;
  padding: 0 8px;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  word-break: keep-all !important;
}
.danger-button,
.rule-delete-button {
  border-color: rgba(192, 51, 43, 0.32) !important;
  color: var(--red) !important;
  background: var(--red-soft) !important;
}
.worklog-table {
  min-width: 1260px !important;
}
.worklog-table th:nth-child(1),
.worklog-table td:nth-child(1) { width: 96px !important; }
.worklog-table th:nth-child(2),
.worklog-table td:nth-child(2) { width: 88px !important; }
.worklog-table th:nth-child(3),
.worklog-table td:nth-child(3) { width: 90px !important; }
.worklog-table th:nth-child(4),
.worklog-table td:nth-child(4) { width: 74px !important; }
.worklog-table th:nth-child(5),
.worklog-table td:nth-child(5) { width: 330px !important; }
.worklog-table th:nth-child(6),
.worklog-table td:nth-child(6) { width: 82px !important; }
.worklog-table th:nth-child(7),
.worklog-table td:nth-child(7) { width: 98px !important; }
.worklog-table th:nth-child(8),
.worklog-table td:nth-child(8) { width: 78px !important; }
.worklog-table th:nth-child(9),
.worklog-table td:nth-child(9) { width: 116px !important; min-width: 116px !important; }
.table-select,
.final-status-select,
.simple-table td select.final-status-select {
  display: inline-block !important;
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
  height: 27px !important;
  min-height: 27px !important;
  padding: 0 6px !important;
  white-space: nowrap !important;
}
.employee-worklog-table {
  min-width: 1060px !important;
}
.employee-worklog-table th:nth-child(1),
.employee-worklog-table td:nth-child(1) { width: 96px !important; }
.employee-worklog-table th:nth-child(2),
.employee-worklog-table td:nth-child(2) { width: 88px !important; }
.employee-worklog-table th:nth-child(3),
.employee-worklog-table td:nth-child(3) { width: 74px !important; }
.employee-worklog-table th:nth-child(4),
.employee-worklog-table td:nth-child(4) { width: 300px !important; }
.employee-worklog-table th:nth-child(5),
.employee-worklog-table td:nth-child(5) { width: 82px !important; }
.employee-worklog-table th:nth-child(6),
.employee-worklog-table td:nth-child(6) { width: 98px !important; }
.employee-worklog-table th:nth-child(7),
.employee-worklog-table td:nth-child(7) { width: 140px !important; min-width: 140px !important; }
.inline-actions.compact-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
}
.inline-actions.compact-actions .danger-button {
  min-width: 48px;
}
.preserve-lines {
  white-space: pre-wrap !important;
  line-height: 1.55;
}

/* === 2026-06 最终轻量订单记录系统：紧凑 UI + 筛选 + 批量状态 === */
.compact-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.compact-stats-grid .stat-card {
  min-height: 72px;
  padding: 10px 12px;
}
.compact-stats-grid .stat-card strong {
  font-size: 24px;
  margin-top: 5px;
}
.compact-stats-grid .stat-card small {
  margin-top: 6px;
}
.compact-form-card .form-grid.stacked,
.compact-panel .form-grid.stacked {
  gap: 8px;
}
.compact-form-card label span,
.compact-panel label span {
  margin-bottom: 4px;
}
.two-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.wide-column {
  min-width: 0;
}
.compact-panel {
  padding: 12px;
}
.compact-import-grid {
  grid-template-columns: 220px minmax(260px, 1fr);
  align-items: end;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 8px 0;
}
.filter-bar .search-box {
  max-width: 260px;
  min-height: 32px;
}
.filter-select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  max-width: 130px;
}
.batch-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 6px 0 8px;
  padding: 6px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.table-scroll table {
  min-width: 980px;
}
.worklog-table th:first-child,
.worklog-table td:first-child {
  width: 36px;
  min-width: 36px;
  text-align: center;
}
.table-select.approval-status-select,
.table-select.final-status-select {
  min-width: 84px;
}
.void-row {
  opacity: .72;
  background: repeating-linear-gradient(135deg, rgba(100,116,139,.05) 0, rgba(100,116,139,.05) 8px, transparent 8px, transparent 16px);
}
.void-row td {
  color: var(--muted);
}
.mini-kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mini-kanban button {
  display: grid;
  gap: 4px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: center;
}
.mini-kanban strong {
  font-size: 22px;
  line-height: 1;
  margin-top: 10px;
}
.mini-kanban span {
  color: var(--muted);
  font-size: 12px;
}
.employee-filter-bar {
  margin-top: 0;
}
.employee-hero-status {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.employee-worklog-table {
  min-width: 880px;
}
.employee-table-card .table-scroll,
.worklog-table-card .table-scroll {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.compact-tools > div {
  position: relative;
  padding-right: 72px;
}
.compact-tools button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
@media (max-width: 1280px) {
  .worklog-layout,
  .employee-workspace {
    grid-template-columns: 360px minmax(620px, 1fr);
  }
  .compact-stats-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

/* === 2026-06-09 网页功能收尾：表格显示、员工端审批只读、系统设置位置优化 === */
.table-scroll {
  overflow-x: auto !important;
  overflow-y: visible !important;
}
.worklog-table {
  min-width: 1500px !important;
  table-layout: fixed !important;
}
.worklog-table th:nth-child(1),
.worklog-table td:nth-child(1) { width: 46px !important; }
.worklog-table th:nth-child(2),
.worklog-table td:nth-child(2) { width: 96px !important; }
.worklog-table th:nth-child(3),
.worklog-table td:nth-child(3) { width: 90px !important; }
.worklog-table th:nth-child(4),
.worklog-table td:nth-child(4) { width: 90px !important; }
.worklog-table th:nth-child(5),
.worklog-table td:nth-child(5) { width: 76px !important; }
.worklog-table th:nth-child(6),
.worklog-table td:nth-child(6) { width: 390px !important; }
.worklog-table th:nth-child(7),
.worklog-table td:nth-child(7) { width: 78px !important; }
.worklog-table th:nth-child(8),
.worklog-table td:nth-child(8) { width: 104px !important; }
.worklog-table th:nth-child(9),
.worklog-table td:nth-child(9) { width: 104px !important; }
.worklog-table th:nth-child(10),
.worklog-table td:nth-child(10) { width: 92px !important; }
.worklog-table th:nth-child(11),
.worklog-table td:nth-child(11),
.worklog-table .action-cell { width: 126px !important; min-width: 126px !important; }
.employee-worklog-table {
  min-width: 1180px !important;
  table-layout: fixed !important;
}
.employee-worklog-table th:nth-child(1),
.employee-worklog-table td:nth-child(1) { width: 96px !important; }
.employee-worklog-table th:nth-child(2),
.employee-worklog-table td:nth-child(2) { width: 86px !important; }
.employee-worklog-table th:nth-child(3),
.employee-worklog-table td:nth-child(3) { width: 74px !important; }
.employee-worklog-table th:nth-child(4),
.employee-worklog-table td:nth-child(4) { width: 360px !important; }
.employee-worklog-table th:nth-child(5),
.employee-worklog-table td:nth-child(5) { width: 80px !important; }
.employee-worklog-table th:nth-child(6),
.employee-worklog-table td:nth-child(6) { width: 104px !important; }
.employee-worklog-table th:nth-child(7),
.employee-worklog-table td:nth-child(7) { width: 92px !important; }
.employee-worklog-table th:nth-child(8),
.employee-worklog-table td:nth-child(8),
.employee-worklog-table .action-cell { width: 126px !important; min-width: 126px !important; }
.break-cell,
.order-cell-wide {
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.45 !important;
  min-width: 0 !important;
}
.approval-readonly {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f6fb;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.employee-workspace .two-inline {
  grid-template-columns: minmax(0, 1fr) !important;
}
.settings-grid .module-card {
  min-width: 0;
}
.settings-log-table,
.settings-backup-table {
  min-width: 760px !important;
}
.settings-log-table th:nth-child(1),
.settings-log-table td:nth-child(1) { width: 154px !important; }
.settings-log-table th:nth-child(2),
.settings-log-table td:nth-child(2) { width: 88px !important; }
.settings-log-table th:nth-child(3),
.settings-log-table td:nth-child(3) { width: 130px !important; }
.settings-log-table th:nth-child(4),
.settings-log-table td:nth-child(4) { width: 360px !important; }
.action-cell .mini-button,
.employee-action-cell .mini-button {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  word-break: keep-all !important;
}

/* 2026-06 功能完善版补充样式 */
.dashboard-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.backup-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--panel-soft);
}
.backup-summary strong,
.backup-summary small {
  display: block;
}
.backup-summary small {
  margin-top: 4px;
  color: var(--muted);
}
.backup-summary.warn {
  border-color: rgba(183, 93, 11, 0.25);
  background: var(--orange-soft);
}
.backup-summary.ok {
  border-color: rgba(21, 128, 61, 0.18);
  background: var(--green-soft);
}
.import-preview-box {
  margin-top: 8px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 8px;
  color: var(--muted);
  max-height: 160px;
  overflow: auto;
}
.import-preview-box pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.6;
}
.employee-hero-status-wide {
  grid-template-columns: repeat(6, minmax(82px, 1fr));
}
@media (max-width: 1300px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .employee-hero-status-wide {
    grid-template-columns: repeat(3, minmax(82px, 1fr));
  }
}


/* 员工端顶部统计修复：只保留 4 个核心卡片，避免第二行被内容区遮挡 */
.employee-dashboard-hero {
  grid-template-columns: minmax(220px, 0.9fr) minmax(520px, 1.5fr) auto;
  align-items: center;
  min-height: auto;
  padding: 12px 14px;
  overflow: visible;
}

.employee-dashboard-hero .employee-hero-status,
.employee-hero-status.employee-hero-status-wide {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
  min-width: 520px;
}

.employee-dashboard-hero .employee-hero-status > div,
.employee-hero-status.employee-hero-status-wide > div {
  min-height: 48px;
  padding: 8px 10px;
}

.employee-dashboard-hero .employee-hero-status strong,
.employee-hero-status.employee-hero-status-wide strong {
  margin-top: 4px;
  font-size: 16px;
}

.employee-dashboard-hero .top-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.employee-main {
  overflow: visible;
}

@media (max-width: 1280px) {
  .employee-dashboard-hero {
    grid-template-columns: 1fr;
  }

  .employee-dashboard-hero .employee-hero-status,
  .employee-hero-status.employee-hero-status-wide {
    min-width: 0;
    width: 100%;
  }
}


/* === 2026-06-09 全表格滚动 + 手动调整列宽 === */
.module-card {
  min-width: 0;
}
.table-scroll,
.table-wrap,
.auto-table-scroll {
  width: 100% !important;
  max-width: 100% !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
.table-scroll {
  max-height: min(68vh, 720px);
}
.worklog-table-card .table-scroll,
.employee-table-card .table-scroll {
  max-height: calc(100vh - 286px);
}
.settings-grid .table-scroll,
.content-grid .module-card .table-scroll {
  max-height: min(58vh, 560px);
}
.resizable-table,
.table-scroll > table,
.table-wrap > table {
  width: max-content !important;
  min-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}
.resizable-table th,
.resizable-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resizable-table td.break-cell,
.resizable-table td.order-cell-wide,
.resizable-table td.notice-content,
.resizable-table .notice-content {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}
.resizable-th {
  position: relative !important;
  user-select: none;
}
.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 5;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 3px;
  width: 1px;
  background: rgba(91, 63, 163, 0.18);
}
.resizable-th:hover .col-resizer::after,
.resizing-column .col-resizer::after {
  background: rgba(91, 63, 163, 0.72);
}
.resizing-column {
  cursor: col-resize !important;
  user-select: none !important;
}
.action-cell,
.employee-action-cell,
.simple-table td:last-child,
.simple-table th:last-child {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.action-cell .mini-button,
.employee-action-cell .mini-button,
.simple-table td:last-child .mini-button {
  white-space: nowrap !important;
}
.simple-table select,
.simple-table input {
  max-width: 100%;
}


/* === 2026-06-09 员工端表格滚动与列宽二次修复 === */
.employee-workspace,
.employee-column,
.employee-table-card,
.employee-payroll-card {
  min-width: 0 !important;
}
.employee-table-card,
.employee-payroll-card {
  overflow: hidden !important;
}
.employee-table-card .table-scroll {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: calc(100vh - 330px) !important;
  overflow: auto !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.employee-payroll-scroll,
.employee-payroll-card .table-scroll {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 260px !important;
  overflow: auto !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.employee-worklog-table,
.employee-payroll-table {
  width: max-content !important;
  min-width: 100% !important;
  table-layout: fixed !important;
}
.employee-worklog-table {
  min-width: 1180px !important;
}
.employee-payroll-table {
  min-width: 760px !important;
}
.employee-worklog-table th,
.employee-worklog-table td,
.employee-payroll-table th,
.employee-payroll-table td {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.employee-worklog-table td.order-cell-wide,
.employee-worklog-table td.break-cell {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}
.employee-worklog-table .action-cell,
.employee-payroll-table .action-cell {
  min-width: 126px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}
.employee-main .col-resizer {
  display: block !important;
}
.employee-main .resizable-th {
  position: relative !important;
}

/* === 2026-06-09 员工端：工资明细固定可见 + 我的记录内部滚动 === */
.employee-main {
  min-height: 0 !important;
}
.employee-workspace {
  height: calc(100vh - 172px) !important;
  min-height: 520px !important;
  align-items: stretch !important;
  overflow: hidden !important;
}
.employee-workspace .employee-column {
  min-height: 0 !important;
}
.employee-workspace .employee-column:first-child {
  max-height: 100% !important;
  overflow: auto !important;
}
.employee-workspace .employee-column:last-child {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
.employee-table-card {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.employee-table-card .section-title,
.employee-table-card .employee-filter-bar {
  flex: 0 0 auto !important;
}
.employee-table-card .table-scroll {
  height: 100% !important;
  min-height: 220px !important;
  max-height: none !important;
  overflow: auto !important;
}
.employee-payroll-card {
  flex: 0 0 auto !important;
  min-height: 156px !important;
  max-height: 230px !important;
  overflow: hidden !important;
}
.employee-payroll-card .payroll-summary-strip {
  margin-bottom: 6px !important;
}
.employee-payroll-scroll,
.employee-payroll-card .table-scroll {
  height: 98px !important;
  max-height: 98px !important;
  overflow: auto !important;
}
@media (max-height: 760px) {
  .employee-workspace {
    height: calc(100vh - 154px) !important;
    min-height: 450px !important;
  }
  .employee-payroll-card {
    min-height: 138px !important;
    max-height: 190px !important;
  }
  .employee-payroll-scroll,
  .employee-payroll-card .table-scroll {
    height: 76px !important;
    max-height: 76px !important;
  }
  .employee-table-card .table-scroll {
    min-height: 180px !important;
  }
}

/* === 2026-06-09 全局修复：任何长表格都只能在卡片内部滚动，不能把后续模块挤出屏幕 === */
html, body {
  height: 100%;
}
.main,
.employee-main {
  min-height: 0 !important;
}
.scroll-table-card,
.module-card:has(.table-scroll) {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.scroll-table-card > .section-title,
.scroll-table-card > .search-box,
.scroll-table-card > .employee-filter-bar,
.scroll-table-card > .filter-toolbar,
.scroll-table-card > .bulk-actions,
.scroll-table-card > .payroll-summary-strip,
.scroll-table-card > .form-grid,
.scroll-table-card > .inline-actions,
.module-card:has(.table-scroll) > .section-title,
.module-card:has(.table-scroll) > .search-box,
.module-card:has(.table-scroll) > .employee-filter-bar,
.module-card:has(.table-scroll) > .filter-toolbar,
.module-card:has(.table-scroll) > .bulk-actions,
.module-card:has(.table-scroll) > .payroll-summary-strip {
  flex: 0 0 auto !important;
}
.scroll-table-card .table-scroll,
.module-card:has(.table-scroll) .table-scroll {
  flex: 1 1 auto !important;
  min-height: 120px !important;
  max-height: min(52vh, 520px) !important;
  overflow: auto !important;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.worklog-table-card .table-scroll {
  max-height: min(46vh, 500px) !important;
  min-height: 240px !important;
}
.settings-grid .scroll-table-card .table-scroll,
.settings-grid .module-card:has(.table-scroll) .table-scroll {
  max-height: min(42vh, 460px) !important;
}
.content-grid.two .scroll-table-card .table-scroll,
.content-grid.two .module-card:has(.table-scroll) .table-scroll {
  max-height: min(44vh, 480px) !important;
}

/* 员工端：右侧“我的记录”和“工资明细”固定分区，任何一块都不能挤掉另一块 */
.employee-workspace {
  display: grid !important;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) !important;
  gap: 8px !important;
  height: calc(100vh - 168px) !important;
  min-height: 520px !important;
  overflow: hidden !important;
  align-items: stretch !important;
}
.employee-workspace .employee-column {
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
.employee-workspace .employee-column:first-child {
  overflow: auto !important;
  padding-right: 2px !important;
}
.employee-workspace .employee-column:last-child {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) minmax(178px, 236px) !important;
  gap: 8px !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.employee-table-card,
.employee-payroll-card {
  min-height: 0 !important;
  overflow: hidden !important;
}
.employee-table-card {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}
.employee-payroll-card {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  min-height: 178px !important;
}
.employee-table-card .table-scroll,
.employee-payroll-card .table-scroll,
.employee-payroll-scroll {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: auto !important;
}
.employee-table-card .table-scroll {
  min-height: 180px !important;
}
.employee-payroll-card .table-scroll,
.employee-payroll-scroll {
  min-height: 74px !important;
}
@media (max-height: 780px) {
  .employee-workspace {
    height: calc(100vh - 148px) !important;
    min-height: 450px !important;
  }
  .employee-workspace .employee-column:last-child {
    grid-template-rows: minmax(0, 1fr) minmax(150px, 190px) !important;
  }
  .employee-payroll-card {
    min-height: 150px !important;
  }
}

/* 管理端工资汇总、系统设置、公告等长表格模块：锁定内部滚动，后续模块始终可见 */
.payroll-grid .scroll-table-card .table-scroll,
.payroll-grid .module-card:has(.table-scroll) .table-scroll {
  max-height: min(40vh, 440px) !important;
}
.simple-table thead th,
.device-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
  background: var(--panel-soft) !important;
}
.scroll-table-inner::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.scroll-table-inner::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(91, 63, 163, .28);
  border-radius: 999px;
  border: 2px solid #fff;
}
.scroll-table-inner::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
  background: rgba(91, 63, 163, .06);
  border-radius: 999px;
}

/* === 2026-06-09 UI final audit: remove forced blank space, make every long list scroll inside its own card === */
/* 1) Grid/cards should fit their content instead of stretching short cards to the height of tall neighbor cards. */
.content-grid,
.content-grid.two,
.worklog-layout,
.settings-grid,
.payroll-grid,
.employee-workspace,
.platform-rule-grid,
.employee-login-layout {
  align-items: start !important;
}
.module-card,
.compact-panel,
.compact-platform-card,
.employee-table-card,
.employee-payroll-card {
  align-self: start !important;
}

/* 2) Tables: scroll when needed, but do not reserve giant empty areas when content is short. */
.table-scroll,
.scroll-table-inner,
.auto-table-scroll,
.table-wrap {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: auto !important;
  border: 1px solid var(--line) !important;
  border-radius: 7px !important;
  background: #fff !important;
}
.module-card:has(.table-scroll),
.scroll-table-card {
  display: block !important;
  overflow: visible !important;
  min-height: 0 !important;
  max-height: none !important;
}
.module-card:has(.table-scroll) .table-scroll,
.scroll-table-card .table-scroll {
  height: auto !important;
  min-height: 0 !important;
  max-height: clamp(240px, 42vh, 520px) !important;
}

/* 3) Key long-table pages get sensible limits, so lower modules remain reachable without large blank zones. */
.worklog-table-card .table-scroll {
  max-height: clamp(300px, 48vh, 620px) !important;
}
.employee-table-card .table-scroll {
  max-height: clamp(280px, 46vh, 560px) !important;
}
.employee-payroll-card .table-scroll,
.employee-payroll-scroll {
  max-height: clamp(110px, 22vh, 240px) !important;
}
.settings-grid .table-scroll,
.payroll-grid .table-scroll,
.content-grid.two .table-scroll {
  max-height: clamp(220px, 38vh, 480px) !important;
}

/* 4) Employee page: let the page breathe; do not lock the right column into a huge fixed grid that creates white gaps. */
.employee-body,
.employee-shell,
.employee-main {
  min-height: 0 !important;
}
.employee-workspace {
  display: grid !important;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) !important;
  gap: 8px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  align-items: start !important;
}
.employee-workspace .employee-column {
  display: grid !important;
  gap: 8px !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  align-content: start !important;
}
.employee-workspace .employee-column:first-child {
  position: sticky !important;
  top: 10px !important;
  max-height: calc(100vh - 84px) !important;
  overflow: auto !important;
  padding-right: 2px !important;
}
.employee-workspace .employee-column:last-child {
  grid-template-rows: none !important;
  overflow: visible !important;
}
.employee-table-card,
.employee-payroll-card {
  display: block !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

/* 5) Admin main panels: reduce accidental empty canvas-like areas. */
.main {
  gap: 10px !important;
  padding-bottom: 18px !important;
}
.module-card {
  margin-bottom: 0 !important;
}
.settings-grid .module-card:empty,
.content-grid .module-card:empty {
  display: none !important;
}

/* 6) Resizable tables and buttons: keep operation columns readable and allow horizontal scroll. */
.simple-table,
.device-table {
  width: max-content !important;
  min-width: 100% !important;
  table-layout: fixed !important;
}
.simple-table th,
.simple-table td,
.device-table th,
.device-table td {
  vertical-align: middle !important;
}
.simple-table thead th,
.device-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background: var(--panel-soft) !important;
}
.action-cell,
.action-cell-wide,
.employee-action-cell,
.simple-table th:last-child,
.simple-table td:last-child {
  min-width: 112px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.mini-button,
.primary-button,
.ghost-button,
.danger-button {
  white-space: nowrap !important;
}
.break-cell,
.order-cell-wide,
.preserve-lines {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* 7) Compact but readable forms/cards. */
.form-grid.stacked {
  gap: 7px !important;
}
.section-title {
  margin-bottom: 6px !important;
}
.bulk-actions,
.filter-toolbar,
.employee-filter-bar {
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 6px !important;
}

/* 8) Mobile/smaller screens fallback. */
@media (max-width: 1120px) {
  .employee-workspace,
  .worklog-layout,
  .settings-grid,
  .content-grid.two {
    grid-template-columns: 1fr !important;
  }
  .employee-workspace .employee-column:first-child {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* === 安全与表格稳定最终补丁：统一滚动容器，避免重复规则互相覆盖 === */
.admin-login-wrap {
  display: grid;
  min-height: calc(100vh - 80px);
  place-items: center;
}
.admin-login-card,
.force-password-card {
  width: min(420px, 92vw);
}
.warn-text {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(192, 51, 43, 0.18);
}
.table-scroll {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(52vh, 520px) !important;
  overflow: auto !important;
  border-radius: 7px !important;
  overscroll-behavior: contain !important;
}
.module-card > .table-scroll:last-child {
  margin-bottom: 0 !important;
}
.simple-table,
.device-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  min-width: max(100%, 920px) !important;
  width: max-content !important;
  table-layout: fixed !important;
}
.employee-worklog-table {
  min-width: 980px !important;
}
.employee-payroll-table {
  min-width: 720px !important;
}
.worklog-table {
  min-width: 1280px !important;
}
.simple-table th,
.simple-table td,
.device-table th,
.device-table td {
  max-width: 260px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.simple-table thead th,
.device-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 8 !important;
  background: var(--panel-soft) !important;
  box-shadow: inset 0 -1px 0 var(--line) !important;
}
.action-cell,
.action-cell-wide,
.employee-action-cell,
.simple-table th:last-child,
.simple-table td:last-child {
  min-width: 150px !important;
  width: 150px !important;
  max-width: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.action-cell .mini-button,
.action-cell-wide .mini-button,
.employee-action-cell .mini-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 2px 3px 2px 0 !important;
}
.break-cell,
.order-cell-wide,
.preserve-lines {
  max-width: 320px !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}
.employee-workspace .employee-column:last-child {
  min-height: 0 !important;
  overflow: visible !important;
}
.employee-workspace .employee-column:last-child .module-card {
  min-height: 0 !important;
}
.employee-workspace .employee-column:last-child .table-scroll {
  max-height: 34vh !important;
}
.employee-payroll-scroll {
  max-height: 28vh !important;
}
.settings-grid .module-card .table-scroll {
  max-height: 42vh !important;
}


/* ===== Dashboard visual upgrade 2026-06 ===== */
.dashboard-v2 {
  display: grid;
  gap: 12px;
}
.dashboard-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(91, 63, 163, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 80% -20%, rgba(59, 130, 246, 0.18), transparent 35%),
    linear-gradient(135deg, rgba(238, 249, 255, 0.92), rgba(247, 242, 255, 0.96));
  box-shadow: 0 14px 35px rgba(31, 41, 55, 0.08);
}
.dashboard-hero-main h2 {
  margin: 6px 0 4px;
  font-size: 28px;
  letter-spacing: -0.5px;
}
.dashboard-hero-main p {
  margin: 0;
  color: var(--muted);
}
.dashboard-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}
.dash-metric-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
}
.dash-metric-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -34px;
  width: 100px;
  height: 100px;
  border-radius: 32px;
  opacity: .18;
  transform: rotate(18deg);
  background: currentColor;
}
.dash-metric-card.green { color: #059669; }
.dash-metric-card.blue { color: #2563eb; }
.dash-metric-card.cyan { color: #0891b2; }
.dash-metric-card.orange { color: #d97706; }
.dash-metric-card.purple { color: #7c3aed; }
.dash-metric-card.red { color: #dc2626; }
.dash-metric-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, currentColor 12%, #fff);
  font-weight: 900;
}
.dash-metric-body { min-width: 0; color: var(--text); }
.dash-metric-body span,
.dash-metric-body small { display: block; color: var(--muted); }
.dash-metric-body strong {
  display: block;
  margin: 3px 0 2px;
  font-size: 24px;
  line-height: 1;
  color: var(--text);
}
.dashboard-panel-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 1fr) minmax(260px, .8fr);
  gap: 10px;
}
.dashboard-card,
.dashboard-card-fill {
  border-radius: 13px !important;
  background: rgba(255,255,255,.92) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055) !important;
}
.dashboard-card {
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
}
.dash-donut-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 210px;
}
.dash-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06), 0 12px 28px rgba(15, 23, 42, .12);
}
.dash-donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: inherit;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}
.dash-donut b,
.dash-donut span {
  position: relative;
  z-index: 1;
  text-align: center;
}
.dash-donut b {
  align-self: end;
  font-size: 20px;
  line-height: 1;
}
.dash-donut span {
  align-self: start;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.dash-legend { display: grid; gap: 8px; min-width: 0; }
.dash-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(70px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
}
.dash-legend-row i { width: 10px; height: 10px; border-radius: 999px; }
.dash-legend-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-legend-row small { color: var(--muted); }
.dash-bars { display: grid; gap: 12px; padding: 10px 0 2px; }
.dash-bar-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
}
.dash-bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-row strong { text-align: right; font-size: 13px; }
.dash-bar-track { height: 10px; border-radius: 999px; background: #edf2f7; overflow: hidden; }
.dash-bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #14b8a6, #3b82f6); }
.dash-health-main {
  display: grid;
  place-items: center;
  min-height: 110px;
  margin: 10px 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #2563eb);
}
.dash-health-main strong { display: block; font-size: 42px; line-height: 1; }
.dash-health-main span { color: rgba(255,255,255,.82); }
.dash-health-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dash-health-list div { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.dash-health-list span { display: block; color: var(--muted); font-size: 12px; }
.dash-health-list strong { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(360px, 1.2fr) minmax(260px, .9fr);
  gap: 10px;
}
.dash-anomaly-list { display: grid; gap: 8px; max-height: 220px; overflow: auto; }
.compact-empty { min-height: 88px; display: grid; place-items: center; }
@media (max-width: 1380px) {
  .dashboard-metric-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .dashboard-panel-grid { grid-template-columns: 1fr; }
  .dashboard-bottom-grid { grid-template-columns: 1fr; }
}


/* =========================================================
   坤元创意 VI 风格升级版 2026-06-10
   目标：参考后台工作台 + 坤元创意紫蓝 VI，统一管理端/员工端视觉。
   ========================================================= */
:root {
  --ky-primary: #5b3fa3;
  --ky-primary-deep: #2e3192;
  --ky-primary-light: #d1c6eb;
  --ky-ink: #111827;
  --ky-muted: #667085;
  --ky-bg: #eef2f8;
  --ky-card: rgba(255, 255, 255, 0.86);
  --ky-card-solid: #ffffff;
  --ky-line: rgba(91, 63, 163, 0.14);
  --ky-shadow: 0 18px 50px rgba(46, 49, 146, 0.10);
  --ky-radius-lg: 22px;
  --ky-radius-md: 16px;
}
html { background: var(--ky-bg); }
body {
  background:
    radial-gradient(circle at 86% 6%, rgba(91,63,163,.16), transparent 28%),
    radial-gradient(circle at 28% 0%, rgba(46,49,146,.08), transparent 30%),
    linear-gradient(180deg, #f4f7fc 0%, #eef2f8 100%) !important;
  color: var(--ky-ink) !important;
}
.app-shell {
  grid-template-columns: 232px minmax(880px, 1fr) !important;
  min-height: 100vh;
}
.sidebar {
  background:
    linear-gradient(150deg, rgba(91,63,163,.95), rgba(46,49,146,.98) 58%, #2e3192),
    #2e3192 !important;
  padding: 22px 14px !important;
  box-shadow: 16px 0 40px rgba(46,49,146,.16);
}
.sidebar::before {
  opacity: .17 !important;
  background-size: 610px auto !important;
  background-position: -120px -80px !important;
  filter: saturate(1.1);
}
.brand {
  padding: 4px 8px 26px !important;
  gap: 12px !important;
}
.brand-logo {
  width: 46px !important;
  height: 46px !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}
.brand h1 { font-size: 19px !important; font-weight: 900 !important; letter-spacing: .04em; }
.brand p { color: rgba(255,255,255,.72) !important; letter-spacing: .08em; }
.nav-list { gap: 8px !important; }
.nav-item {
  min-height: 44px !important;
  border-radius: 12px !important;
  color: rgba(255,255,255,.76) !important;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}
.nav-item:hover { transform: translateX(2px); }
.nav-item.active,
.nav-item:hover {
  background: rgba(255,255,255,.16) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.nav-icon { color: rgba(255,255,255,.64) !important; }
.main {
  padding: 22px 24px 30px !important;
  gap: 16px !important;
}
.topbar,
.dashboard-hero-card,
.employee-hero,
.module-card,
.stat-card,
.dashboard-card,
.dashboard-card-fill,
.device-panel,
.detail-panel,
.login-card,
.system-status-card {
  border-radius: var(--ky-radius-md) !important;
  border-color: var(--ky-line) !important;
  box-shadow: var(--ky-shadow) !important;
}
.module-card,
.dashboard-card,
.dashboard-card-fill,
.stat-card,
.device-panel,
.detail-panel,
.login-card,
.system-status-card {
  background: var(--ky-card) !important;
  backdrop-filter: blur(14px);
}
.topbar {
  padding: 10px 16px !important;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(91,63,163,.10);
  backdrop-filter: blur(14px);
}
.topbar h2 { color: #101828; font-size: 26px !important; font-weight: 900 !important; }
.primary-button {
  border: 0 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, var(--ky-primary), var(--ky-primary-deep)) !important;
  box-shadow: 0 10px 24px rgba(91,63,163,.22);
}
.ghost-button,
.icon-button,
.filter-select,
input,
select,
textarea {
  border-radius: 11px !important;
}
.ghost-button {
  border-color: rgba(91,63,163,.18) !important;
  background: rgba(255,255,255,.82) !important;
}
.dashboard-v2 { gap: 16px !important; }
.dashboard-hero-card {
  position: relative;
  overflow: hidden;
  min-height: 176px;
  padding: 28px 30px !important;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(91,63,163,.95), rgba(46,49,146,.96)),
    #2e3192 !important;
}
.dashboard-hero-card::before {
  content: "";
  position: absolute;
  left: -120px;
  top: -180px;
  width: 720px;
  height: 720px;
  background: url('./assets/kunyuan-graphics-lite.png') no-repeat left top / contain;
  opacity: .18;
  pointer-events: none;
}
.dashboard-hero-card::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 26px;
  width: 240px;
  height: 150px;
  background: linear-gradient(135deg, rgba(255,255,255,.20), rgba(255,255,255,.04));
  clip-path: polygon(15% 0%, 100% 0%, 82% 100%, 0% 100%);
  opacity: .45;
  pointer-events: none;
}
.dashboard-hero-card > * { position: relative; z-index: 1; }
.dashboard-hero-main .eyebrow { color: rgba(255,255,255,.72) !important; letter-spacing: .18em; }
.dashboard-hero-main h2 {
  color: #fff !important;
  font-size: 34px !important;
  font-weight: 950 !important;
  letter-spacing: .03em !important;
}
.dashboard-hero-main p { color: rgba(255,255,255,.78) !important; }
.dashboard-hero-actions .ghost-button { background: rgba(255,255,255,.14) !important; color: #fff !important; border-color: rgba(255,255,255,.20) !important; }
.dashboard-hero-actions .month-switch { background: rgba(255,255,255,.14) !important; color: #fff; border-color: rgba(255,255,255,.18) !important; }
.dashboard-metric-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr)) !important;
  gap: 14px !important;
}
.dash-metric-card {
  min-height: 104px !important;
  padding: 18px !important;
  border-radius: 18px !important;
  background: #fff !important;
  border-color: rgba(91,63,163,.10) !important;
  box-shadow: 0 14px 36px rgba(46,49,146,.08) !important;
}
.dash-metric-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
}
.dash-metric-body strong { font-size: 26px !important; font-weight: 900 !important; }
.dashboard-panel-grid { grid-template-columns: minmax(380px, 1.1fr) minmax(360px, 1fr) minmax(300px, .86fr) !important; gap: 14px !important; }
.dashboard-bottom-grid { grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.2fr) minmax(320px, .9fr) !important; gap: 14px !important; }
.dashboard-card { min-height: 280px !important; padding: 18px !important; }
.section-title h3 { font-weight: 900 !important; color: #111827; }
.section-title span { color: #7b8091 !important; }
.dash-bar-track i { background: linear-gradient(90deg, #d1c6eb, #5b3fa3, #2e3192) !important; }
.dash-health-main { background: linear-gradient(135deg, #5b3fa3, #2e3192) !important; border-radius: 16px !important; }
.simple-table thead th,
.device-table thead th {
  background: linear-gradient(180deg, rgba(247,247,252,.98), rgba(240,237,249,.98)) !important;
  color: #344054 !important;
  font-weight: 800 !important;
}
.simple-table tbody tr:hover,
.device-table tbody tr:hover { background: rgba(209,198,235,.12) !important; }
.table-scroll,
.table-wrap,
.auto-table-scroll {
  border-radius: 14px !important;
  border-color: rgba(91,63,163,.10) !important;
  background: #fff !important;
}
.status-pill.ok { background: rgba(34,197,94,.12) !important; color: #15803d !important; }
.status-pill.warn { background: rgba(245,158,11,.14) !important; color: #b45309 !important; }
.status-pill.bad { background: rgba(239,68,68,.12) !important; color: #b91c1c !important; }
.status-pill.neutral { background: rgba(91,63,163,.10) !important; color: var(--ky-primary-deep) !important; }
/* 员工端：简洁工作台 + 同品牌视觉 */
.employee-body {
  background:
    radial-gradient(circle at 80px -120px, rgba(91,63,163,.20), transparent 32%),
    linear-gradient(180deg, #f5f7fc 0%, #eef2f8 100%) !important;
}
.employee-shell { min-height: 100vh; }
.employee-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 12px 12px 0 !important;
  border: 1px solid rgba(91,63,163,.12) !important;
  border-radius: 20px !important;
  background: rgba(255,255,255,.78) !important;
  box-shadow: var(--ky-shadow) !important;
  backdrop-filter: blur(16px);
}
.employee-topbar .brand h1 { color: #111827 !important; }
.employee-topbar .brand p { color: #7b8091 !important; }
.employee-main { padding: 14px 12px 20px !important; }
.employee-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px !important;
  padding: 22px 24px !important;
  color: #fff !important;
  background: linear-gradient(125deg, rgba(91,63,163,.96), rgba(46,49,146,.94)) !important;
}
.employee-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -170px;
  width: 520px;
  height: 620px;
  background: url('./assets/kunyuan-graphics-lite.png') no-repeat center / contain;
  opacity: .16;
  pointer-events: none;
}
.employee-hero > * { position: relative; z-index: 1; }
.employee-hero .eyebrow,
.employee-hero p { color: rgba(255,255,255,.76) !important; }
.employee-hero h2 { color: #fff !important; font-size: 30px !important; font-weight: 950 !important; }
.employee-hero-status div,
.employee-hero-status.employee-hero-status-wide > div {
  border-radius: 16px !important;
  border-color: rgba(255,255,255,.18) !important;
  background: rgba(255,255,255,.14) !important;
  color: #fff !important;
  backdrop-filter: blur(8px);
}
.employee-hero-status span,
.employee-hero-status strong { color: #fff !important; }
.employee-workspace {
  grid-template-columns: 330px minmax(760px, 1fr) !important;
  gap: 16px !important;
}
.employee-workspace .employee-column { gap: 14px !important; }
.employee-table-card,
.employee-payroll-card { border-radius: 18px !important; }
.employee-table-card .table-scroll { max-height: 46vh !important; }
.employee-payroll-scroll { max-height: 24vh !important; }
.notice-item,
.smart-item,
.status-grid div,
.payroll-summary-strip div,
.dash-health-list div {
  border-radius: 14px !important;
}
@media (max-width: 1500px) {
  .dashboard-metric-grid { grid-template-columns: repeat(3, minmax(190px, 1fr)) !important; }
  .dashboard-panel-grid,
  .dashboard-bottom-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 1220px) {
  .employee-workspace { grid-template-columns: 1fr !important; }
  .dashboard-metric-grid { grid-template-columns: repeat(2, minmax(190px, 1fr)) !important; }
}

/* =========================================================
   坤元创意 VI 精修版 2026-06-10
   目标：在不改业务逻辑的前提下，统一管理端/员工端视觉密度、卡片层级、表格可读性。
   ========================================================= */
:root {
  --ky-glass: rgba(255, 255, 255, 0.82);
  --ky-glass-strong: rgba(255, 255, 255, 0.94);
  --ky-soft-purple: rgba(209, 198, 235, 0.22);
  --ky-soft-blue: rgba(46, 49, 146, 0.08);
  --ky-focus: 0 0 0 4px rgba(91, 63, 163, 0.12);
}

body:not(.employee-body) .main {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.20), rgba(255,255,255,0)),
    transparent !important;
}

.topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 12 !important;
  min-height: 68px !important;
}

.topbar h2,
.employee-hero h2,
.dashboard-hero-main h2 {
  letter-spacing: -0.02em !important;
}

.module-card,
.payroll-section,
.platform-total-card,
.employee-commission-card,
.notice-item,
.smart-item,
.task-list div,
.feature-grid div,
.readonly-total,
.backup-summary {
  border-color: rgba(91, 63, 163, 0.12) !important;
  background: var(--ky-glass-strong) !important;
}

.module-card {
  padding: 16px !important;
}

.payroll-section {
  padding: 14px !important;
  border-radius: 18px !important;
  box-shadow: 0 12px 36px rgba(46, 49, 146, 0.065) !important;
}

.section-title {
  min-height: 34px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid rgba(91, 63, 163, 0.08) !important;
}

.section-title h3 {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-title h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ky-primary-light), var(--ky-primary), var(--ky-primary-deep));
}

.form-grid input,
.form-grid select,
.table-input,
.simple-table select,
textarea,
.search-box,
.month-switch {
  border-color: rgba(91, 63, 163, 0.16) !important;
  background: rgba(255,255,255,0.92) !important;
}

.form-grid input:focus,
.form-grid select:focus,
.table-input:focus,
.simple-table select:focus,
textarea:focus,
.search-box:focus-within {
  border-color: var(--ky-primary) !important;
  box-shadow: var(--ky-focus) !important;
}

.primary-button:hover,
.primary-link-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.ghost-button:hover,
.icon-button:hover,
.mini-button:hover {
  border-color: rgba(91, 63, 163, 0.35) !important;
  background: rgba(209, 198, 235, 0.14) !important;
}

.simple-table,
.device-table,
.commission-overview-table {
  border-spacing: 0 !important;
}

.simple-table thead th,
.device-table thead th {
  height: 40px !important;
  border-bottom: 1px solid rgba(91, 63, 163, 0.12) !important;
}

.simple-table tbody tr:nth-child(even),
.device-table tbody tr:nth-child(even) {
  background: rgba(247, 247, 252, 0.62) !important;
}

.simple-table td,
.device-table td {
  border-top-color: rgba(91, 63, 163, 0.08) !important;
}

.table-scroll,
.table-wrap,
.auto-table-scroll {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4) !important;
}

.commission-overview-table th:first-child,
.commission-overview-table td:first-child {
  min-width: 90px !important;
  width: 90px !important;
}
.commission-overview-table th:nth-child(2),
.commission-overview-table td:nth-child(2) {
  min-width: 80px !important;
  width: 80px !important;
}
.commission-overview-table td small {
  color: var(--ky-muted);
}

/* 工作填报/工资规则页：输入区和数据区更像工作台组件 */
.worklog-layout,
.employee-workspace,
.content-grid.two,
.settings-grid,
.payroll-grid {
  gap: 18px !important;
}

.compact-platform-card,
.add-platform-card {
  border-radius: 18px !important;
}

.compact-platform-card .section-title span {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(91, 63, 163, 0.09);
  color: var(--ky-primary-deep) !important;
}

.profit-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px !important;
  color: #fff !important;
  background:
    linear-gradient(125deg, rgba(91,63,163,.96), rgba(46,49,146,.96)) !important;
}
.profit-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -140px;
  width: 460px;
  height: 460px;
  background: url('./assets/kunyuan-graphics-lite.png') no-repeat center / contain;
  opacity: .14;
  pointer-events: none;
}
.profit-hero > * { position: relative; z-index: 1; }
.profit-hero p,
.profit-hero .eyebrow { color: rgba(255,255,255,.76) !important; }
.profit-hero .status-pill { background: rgba(255,255,255,.16) !important; color: #fff !important; }

/* 员工端精修：顶部更像轻量工作台，左侧录入区不抢视觉 */
.employee-status { color: #475467 !important; }
.employee-status span:not(.status-pill) { border-left-color: rgba(91,63,163,.14) !important; }
.employee-topbar .status-pill.ok { background: rgba(21,128,61,.10) !important; }

.employee-main {
  gap: 18px !important;
}
.employee-table-card,
.employee-payroll-card,
.employee-column .module-card {
  background: var(--ky-glass-strong) !important;
  border-color: rgba(91,63,163,.12) !important;
  box-shadow: 0 12px 34px rgba(46,49,146,.07) !important;
}
.employee-workspace .employee-column:first-child {
  padding-right: 4px !important;
}

/* 员工端/管理端滚动条再统一 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(91, 63, 163, .28);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.88);
}
*::-webkit-scrollbar-thumb:hover { background: rgba(91, 63, 163, .42); }
*::-webkit-scrollbar-track { background: rgba(91,63,163,.05); border-radius: 999px; }

/* 屏幕不够宽时，保持可用优先 */
@media (max-width: 1380px) {
  .app-shell { grid-template-columns: 204px minmax(900px, 1fr) !important; }
  .dashboard-metric-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)) !important; }
  .module-card { padding: 14px !important; }
}

@media (max-width: 1220px) {
  .app-shell { grid-template-columns: 76px minmax(880px, 1fr) !important; }
  .sidebar .brand div:last-child,
  .sidebar .nav-item span:last-child,
  .sidebar-footer { display: none !important; }
  .sidebar { padding: 18px 10px !important; }
  .nav-item { justify-content: center !important; }
}
