:root {
  --app-primary: #1677ff;
  --app-primary-soft: #e6f4ff;
  --app-success: #52c41a;
  --app-warning: #faad14;
  --app-error: #ff4d4f;
  --app-text: rgba(0, 0, 0, 0.88);
  --app-text-secondary: rgba(0, 0, 0, 0.65);
  --app-text-tertiary: rgba(0, 0, 0, 0.45);
  --app-bg: #f5f5f5;
  --app-surface: #ffffff;
  --app-surface-subtle: #fafafa;
  --app-border: #d9d9d9;
  --app-split: #f0f0f0;
  --app-sidebar: 264px;
  --app-bottom-bar: 72px;
  --app-radius: 8px;
  --app-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --app-data-font: "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;
}

* { box-sizing: border-box; }

html,
body,
#root,
.ant-app {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--app-text);
  background: var(--app-bg);
  font-family: var(--app-font);
  font-size: 14px;
  line-height: 1.5715;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--app-sidebar) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--app-bg);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  border-right: 1px solid var(--app-split);
  background: var(--app-surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-split);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: #fff;
  border-radius: 8px;
  background: var(--app-primary);
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.brand p {
  margin: 0;
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.steps {
  flex: 1;
  min-height: 0;
  padding: 24px 20px;
  overflow: auto;
}

.app-steps {
  width: 100%;
}

.sidebar-foot {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--app-split);
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.privacy-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--app-success);
  font-weight: 500;
}

.main {
  width: min(1440px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 32px 32px calc(var(--app-bottom-bar) + 32px);
}

.policy-person-name {
  color: var(--ant-color-success-text-active, #237804);
  overflow-wrap: anywhere;
}

.policy-options-hint {
  margin: 16px 0 0;
  color: var(--app-text-secondary);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--app-primary);
  font-size: 12px;
  font-weight: 600;
}

.topbar h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}

.topbar-copy {
  max-width: 800px;
  margin: 4px 0 0;
  color: var(--app-text-secondary);
}

.topbar-actions,
.bottom-actions,
.scope-actions,
.source-meta,
.person-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.status-tag {
  margin-inline-end: 0;
  white-space: nowrap;
}

.panel {
  overflow: hidden;
}

.panel .panel-body {
  padding: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-split);
}

.section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.section-head p {
  margin: 2px 0 0;
  color: var(--app-text-secondary);
  font-size: 12px;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(480px, 1.15fr);
  gap: 16px;
}

.company-panel,
.upload-panel {
  min-height: 384px;
}

.company-list {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 20px;
}

.company-card {
  width: 100%;
  cursor: pointer;
}

.company-card.selected {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  box-shadow: 0 0 0 1px var(--app-primary);
}

.company-card .company-card-body {
  padding: 0;
}

.company-card .company-selector {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  margin-inline-end: 0;
  white-space: normal;
}

.company-card .company-selector-label {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-inline-start: 0;
}

.company-icon,
.upload-icon,
.sheet-picker-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.company-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.company-copy {
  min-width: 0;
}

.company-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.company-name strong {
  font-size: 14px;
}

.company-copy > span:last-child {
  display: block;
  color: var(--app-text-secondary);
  font-size: 12px;
}

.drop-zone {
  display: block;
  padding: 20px;
}

.drop-zone .ant-upload-drag {
  min-height: 288px;
  border-color: var(--app-border);
  background: var(--app-surface-subtle);
}

.drop-zone .ant-upload-drag-hover {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
}

.upload-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 15px;
  color: #fff;
  border-radius: 6px;
  background: var(--app-primary);
  font-weight: 500;
}

.drop-inner {
  display: grid;
  justify-items: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 24px;
}

.upload-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 12px;
}

.drop-inner h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.drop-inner p {
  margin: 0 0 20px;
  color: var(--app-text-secondary);
  text-align: center;
}

.upload-error {
  margin: 0 20px 20px;
  text-align: left;
}

.sheet-picker-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sheet-picker-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.sheet-picker-title > div {
  min-width: 0;
}

.sheet-picker-title > div > strong,
.sheet-picker-title > div > span {
  display: block;
}

.sheet-picker-title > div > span {
  overflow: hidden;
  margin-top: 1px;
  color: var(--app-text-tertiary);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-sheet-picker {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.roster-sheet-picker small {
  color: var(--ant-color-text-secondary);
}

.sheet-picker-list {
  display: grid;
  gap: 8px;
  width: 100%;
  max-height: min(420px, 52vh);
  margin-top: 16px;
  padding: 1px 4px 1px 1px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-picker-option.ant-radio-wrapper {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 68px;
  margin-inline-end: 0;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  white-space: normal;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.sheet-picker-option.ant-radio-wrapper:not(.ant-radio-wrapper-disabled):hover {
  border-color: #69b1ff;
}

.sheet-picker-option.ant-radio-wrapper:focus-within {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
}

.sheet-picker-option.ant-radio-wrapper-checked {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  box-shadow: 0 0 0 1px var(--app-primary);
}

.sheet-picker-option.ant-radio-wrapper-disabled {
  border-color: var(--app-split);
  background: var(--app-surface-subtle);
}

.sheet-picker-option > .ant-radio {
  margin-top: 3px;
}

.sheet-picker-option > .ant-radio + .ant-radio-label {
  display: block;
  flex: 1;
  min-width: 0;
  padding-inline-start: 12px;
}

.sheet-picker-option-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sheet-picker-option-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.sheet-picker-option-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sheet-picker-option-content > small,
.sheet-picker-meta {
  color: var(--app-text-tertiary);
  font: 12px/1.5 var(--app-data-font);
  overflow-wrap: anywhere;
}

.source-card,
.radar-strip {
  margin-bottom: 16px;
}

.source-card .source-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.source-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.source-name > div:last-child {
  min-width: 0;
}

.source-name strong,
.source-name span {
  display: block;
}

.source-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-name span {
  margin-top: 2px;
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.file-glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 6px;
  color: #fff;
  background: var(--app-success);
  font-size: 12px;
  font-weight: 600;
}

.radar-strip .radar-body {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
}

.radar-cell {
  min-height: 88px;
  padding: 16px 20px;
  border-right: 1px solid var(--app-split);
}

.radar-cell:last-child {
  border-right: 0;
}

.radar-cell.ok .ant-statistic-content {
  color: var(--app-success);
}

.radar-cell.alert .ant-statistic-content {
  color: var(--app-warning);
}

.blocker-list {
  display: grid;
  gap: 8px;
  padding: 16px 20px 0;
}

.scope-view {
  display: grid;
  gap: 16px;
}

.paid-leave-content {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 16px 20px 20px;
}

.paid-leave-form .ant-form-item {
  margin-bottom: 0;
}

.paid-leave-content .ant-alert {
  min-width: 0;
}

.scope-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--app-split);
  background: var(--app-surface-subtle);
}

.search-box {
  width: 280px;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  max-height: 536px;
  padding: 16px 20px;
  overflow-y: auto;
}

.skip-person-card {
  cursor: pointer;
}

.skip-person-card.selected {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
}

.skip-person-card .skip-person-card-body {
  padding: 0;
}

.skip-person-selector {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  margin-inline-end: 0;
  white-space: normal;
}

.skip-person-selector .skip-person-selector-label {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-inline-start: 0;
}

.person-avatar {
  color: #0958d9;
  background: #d6e4ff;
}

.skip-person-copy,
.person-row-copy {
  min-width: 0;
}

.skip-person-copy strong,
.skip-person-copy small,
.person-row-copy strong,
.person-row-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skip-person-copy small,
.person-row-copy small {
  margin-top: 2px;
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.skip-person-status {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
}

.scope-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--app-split);
  background: var(--app-surface-subtle);
}

.scope-summary > div {
  padding: 16px 20px;
}

.scope-summary > div + div {
  border-left: 1px solid var(--app-split);
}

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

.scope-summary span {
  margin-top: 2px;
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.empty-state.compact {
  padding: 32px 16px;
}

.daily-review {
  display: grid;
  gap: 16px;
}

.rule-banner {
  align-items: flex-start;
}

.inline-warning,
.inline-error {
  margin: 16px 20px 0;
}

.person-review-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 560px;
}

.person-list {
  min-width: 0;
  border-right: 1px solid var(--app-split);
  background: var(--app-surface-subtle);
}

.person-search {
  padding: 16px;
  border-bottom: 1px solid var(--app-split);
}

.person-search .search-box {
  width: 100%;
}

.person-scroll {
  max-height: 720px;
  padding: 8px;
  overflow-y: auto;
}

.person-row {
  height: auto;
  margin-bottom: 4px;
  padding: 10px 12px;
  text-align: left;
}

.person-row.selected {
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.person-row .person-row-content {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.person-row-copy strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.person-empty {
  padding: 32px 8px;
}

.person-workspace {
  min-width: 0;
  background: var(--app-surface);
}

.person-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-split);
}

.person-workspace-head p {
  margin: 0;
  color: var(--app-primary);
  font-size: 12px;
  font-weight: 600;
}

.person-workspace-head h3 {
  display: inline;
  margin: 0 8px 0 0;
  font-size: 18px;
}

.person-workspace-head span {
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.anomaly-stack {
  display: grid;
  gap: 16px;
  max-height: 960px;
  padding: 16px 20px;
  overflow-y: auto;
  background: var(--app-bg);
}

.anomaly-card {
  border-left: 3px solid var(--app-warning);
}

.anomaly-card.conflict {
  border-left-color: var(--app-error);
}

.anomaly-card.matched {
  border-left-color: var(--app-success);
}

.anomaly-head strong,
.anomaly-head span {
  display: block;
}

.anomaly-head strong {
  font-size: 14px;
}

.anomaly-head span {
  margin-top: 2px;
  color: var(--app-text-tertiary);
  font: 12px var(--app-data-font);
}

.anomaly-card .anomaly-card-body {
  padding: 16px;
}

.comparison-reason {
  margin-bottom: 16px;
}

.comparison-reason span {
  display: block;
}

.judgment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

.judgment-option {
  min-width: 0;
  cursor: pointer;
}

.judgment-option.selected {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 1px var(--app-primary);
}

.judgment-option.selected.system {
  background: #e6f4ff;
}

.judgment-option.selected.source {
  background: #f6ffed;
}

.judgment-option.selected.manual {
  background: #fffbe6;
}

.judgment-option .judgment-option-body {
  display: flex;
  height: 100%;
  min-height: 132px;
  padding: 0;
}

.judgment-radio {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 132px;
  padding: 16px;
  margin-inline-end: 0;
  white-space: normal;
}

.company-card:focus-within,
.skip-person-card:focus-within,
.judgment-option:focus-within {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px #91caff;
}

.judgment-radio .judgment-radio-label {
  min-width: 0;
  height: 100%;
  padding-inline-start: 0;
}

.judgment-copy,
.judgment-copy small,
.judgment-copy strong,
.judgment-copy span,
.judgment-copy em {
  display: block;
}

.judgment-copy {
  min-width: 0;
}

.judgment-copy small {
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.judgment-copy strong {
  margin-top: 4px;
  font-size: 14px;
}

.judgment-copy span {
  margin-top: 6px;
  color: var(--app-text-secondary);
  line-height: 1.5;
}

.judgment-copy em {
  margin-top: 6px;
  color: var(--app-primary);
  font: normal 12px/1.5 var(--app-data-font);
  overflow-wrap: anywhere;
}

.manual-judgment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(144px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  background: #fffbe6;
}

.manual-judgment .ant-form-item {
  margin-bottom: 0;
}

.trace-details {
  margin: 0 -8px 16px;
  border-top: 1px solid var(--app-split);
  border-bottom: 1px solid var(--app-split);
}

.trace-list {
  display: grid;
}

.trace-row {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--app-split);
}

.trace-row:first-child {
  border-top: 0;
}

.trace-row strong,
.trace-row span {
  display: block;
}

.trace-row strong {
  color: var(--app-primary);
  font: 12px var(--app-data-font);
}

.trace-row span,
.trace-row p,
.muted {
  color: var(--app-text-secondary);
  font-size: 12px;
}

.trace-row p {
  margin: 0;
}

.summary-field-changes {
  background: var(--app-surface-subtle);
}

.summary-change-head strong,
.summary-change-head span {
  display: block;
}

.summary-change-head span {
  color: var(--app-text-tertiary);
  font-size: 12px;
  font-weight: 400;
}

.summary-field-changes .summary-change-body {
  padding: 12px;
}

.summary-change-table {
  overflow: hidden;
  border-radius: 6px;
}

.person-fields {
  padding: 20px;
  border-top: 1px solid var(--app-split);
}

.subsection-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.subsection-title h4 {
  margin: 0;
  font-size: 16px;
}

.subsection-title p {
  margin: 2px 0 0;
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.include-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--app-text-secondary);
  white-space: nowrap;
}

.review-field-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.review-field-group {
  min-width: 0;
  overflow: hidden;
  background: var(--app-surface-subtle);
}

.review-field-group .review-field-group-head {
  min-height: 64px;
  padding-inline: 16px;
  background: var(--app-surface);
}

.review-field-group-title-slot {
  min-width: 0;
}

.review-field-group-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.review-field-group-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  color: var(--app-primary);
  border-radius: 8px;
  background: var(--app-primary-soft);
  font-family: var(--app-data-font);
  font-size: 12px;
  font-weight: 600;
}

.review-field-group-title > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.review-field-group-title strong {
  line-height: 22px;
}

.review-field-group-title > div > span {
  color: var(--app-text-tertiary);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  white-space: normal;
}

.review-field-group-extra {
  margin-inline-start: 12px;
}

.review-field-group .review-field-group-body {
  padding: 16px;
}

.review-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.review-field.wide {
  grid-column: 1 / -1;
}

.review-field-grid > .ant-form-item {
  min-width: 0;
  margin-bottom: 0;
}

.review-field-grid :where(.ant-form-item-row, .ant-form-item-control, .ant-form-item-control-input, .ant-form-item-control-input-content) {
  min-width: 0;
}

.review-field-grid :where(.ant-input-number, .ant-picker) {
  width: 100%;
}

.review-field-grid .ant-form-item-label > label {
  max-width: 100%;
  height: auto;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.actual-attendance-reference {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  color: var(--app-text-secondary);
}

.actual-attendance-reference-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.actual-attendance-reference-values > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--app-text-primary);
  font-family: var(--app-data-font);
  font-size: 13px;
}

.actual-attendance-reference-values strong {
  color: var(--app-text-tertiary);
  font-family: var(--app-font);
  font-size: 11px;
  font-weight: 500;
}

.actual-attendance-formula,
.actual-attendance-policy,
.actual-attendance-manual {
  display: block;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.actual-attendance-formula {
  color: var(--app-text-primary);
  font-family: var(--app-data-font);
}

.actual-attendance-manual {
  color: var(--app-warning-text);
}

.review-date-picker {
  width: 100%;
}

.settlement-review {
  margin: 20px 20px 0;
  background: #fffbe6;
}

.settlement-review .settlement-review-body {
  padding: 12px;
}

.settlement-issue-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.settlement-issue {
  display: grid;
  grid-template-columns: minmax(140px, 0.5fr) minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #ffe58f;
  border-radius: 6px;
  background: var(--app-surface);
}

.settlement-issue > span {
  color: var(--app-text-secondary);
  font: 12px var(--app-data-font);
}

.person-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--app-split);
  background: var(--app-surface);
}

.person-save-bar strong,
.person-save-bar span {
  display: block;
}

.person-save-bar span {
  margin-top: 2px;
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.preview-wrap {
  padding: 16px 20px 0;
}

.attendance-marker-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.preview-table td.attendance-cell-review,
.preview-table td.attendance-cell-review.ant-table-cell-row-hover {
  background: #fff1b8 !important;
}

.preview-table td.attendance-cell-difference,
.preview-table td.attendance-cell-difference.ant-table-cell-row-hover {
  background: #ffccc7 !important;
}

.preview-table td.attendance-cell-confirmed,
.preview-table td.attendance-cell-confirmed.ant-table-cell-row-hover {
  background: #c6f6d5 !important;
}

.attendance-marker-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
}

.attendance-marker-value:focus-visible {
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.28);
}

.attendance-marker-tooltip-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.preview-table .selected > td {
  background: var(--app-primary-soft);
}

.preview-table .excluded > td {
  color: var(--app-text-tertiary);
  background: var(--app-surface-subtle);
}

.preview-table tbody tr {
  cursor: default;
}

.editor {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0 16px;
  margin-top: 16px;
  padding: 20px;
  border-top: 1px solid var(--app-split);
  background: var(--app-surface-subtle);
}

.editor .ant-form-item {
  margin-bottom: 0;
}

.form-field.wide {
  grid-column: span 3;
}

.empty-state {
  padding: 56px 20px;
}

.bottom-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: var(--app-sidebar);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--app-bottom-bar);
  padding: 12px 32px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--app-split);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(12px);
}

.bottom-copy {
  min-width: 180px;
}

.bottom-copy strong,
.bottom-copy span {
  display: block;
}

.bottom-copy span {
  color: var(--app-text-tertiary);
  font-size: 12px;
}

.drawer-title span,
.drawer-title strong {
  display: block;
}

.drawer-title span {
  color: var(--app-text-tertiary);
  font-size: 12px;
  font-weight: 400;
}

.drawer-title strong {
  font-size: 18px;
}

.rule-drawer .rule-drawer-body {
  padding: 20px 24px;
}

.rule-drawer .rule-drawer-footer {
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.rule-intro {
  margin-bottom: 24px;
}

.rule-section + .rule-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--app-split);
}

.rule-section h4 {
  margin: 0 0 16px;
  font-size: 16px;
}

.rule-section-copy {
  margin: -8px 0 16px;
  color: var(--app-text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

.rule-policy-field {
  margin-bottom: 18px;
}

.rule-policy-field .ant-select {
  min-width: 0;
}

.rule-policy-field .ant-select-selector {
  min-height: 40px;
  padding-block: 3px;
}

.rule-policy-field .ant-select-selection-overflow {
  gap: 2px 0;
}

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

.rule-field {
  margin-bottom: 16px;
}

.rule-summary p {
  margin: 0;
}

.rule-summary p + p {
  margin-top: 8px;
}

@media (max-width: 1199px) {
  .main {
    padding-inline: 24px;
  }

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

  .person-review-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .editor {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
  }
}

@media (max-width: 991px) {
  :root {
    --app-sidebar: 0px;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--app-split);
  }

  .brand {
    min-height: 64px;
  }

  .steps {
    padding: 12px 20px;
    overflow-x: auto;
  }

  .app-steps.ant-steps-vertical {
    display: grid;
    grid-template-columns: repeat(4, minmax(164px, 1fr));
    min-width: 720px;
  }

  .app-steps .ant-steps-item-description,
  .app-steps .ant-steps-item-rail {
    display: none;
  }

  .sidebar-foot {
    display: none;
  }

  .bottom-bar {
    left: 0;
    padding-inline: 24px;
  }

  .import-layout {
    grid-template-columns: 1fr;
  }

  .company-panel,
  .upload-panel {
    min-height: auto;
  }

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

@media (max-width: 767px) {
  .main {
    padding: 24px 16px calc(var(--app-bottom-bar) + 24px);
  }

  .topbar,
  .section-head,
  .person-workspace-head,
  .subsection-title,
  .person-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .company-list,
  .judgment-options {
    grid-template-columns: 1fr;
  }

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

  .radar-cell:nth-child(2) {
    border-right: 0;
  }

  .radar-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--app-split);
  }

  .scope-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .paid-leave-content {
    grid-template-columns: 1fr;
  }

  .scope-toolbar .search-box {
    width: 100%;
  }

  .person-review-layout {
    grid-template-columns: 1fr;
  }

  .person-list {
    border-right: 0;
    border-bottom: 1px solid var(--app-split);
  }

  .person-scroll {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .person-row {
    min-width: 248px;
  }

  .anomaly-stack {
    max-height: none;
  }

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

  .settlement-issue {
    grid-template-columns: 1fr;
  }

  .editor {
    grid-template-columns: repeat(2, minmax(132px, 1fr));
  }

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

  .bottom-bar {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }

  .bottom-copy {
    flex: 1;
  }

}

@media (max-width: 575px) {
  .main {
    padding-inline: 12px;
  }

  .brand {
    padding-inline: 16px;
  }

  .steps {
    padding-inline: 12px;
  }

  .source-card .source-card-body {
    grid-template-columns: 1fr;
  }

  .source-meta {
    justify-content: space-between;
  }

  .scope-grid,
  .scope-summary,
  .rule-grid,
  .review-field-grid,
  .editor {
    grid-template-columns: 1fr;
  }

  .actual-attendance-reference-values {
    grid-template-columns: 1fr;
  }

  .person-fields {
    padding-inline: 12px;
  }

  .review-field-group .review-field-group-head,
  .review-field-group .review-field-group-body {
    padding-inline: 12px;
  }

  .scope-summary > div + div {
    border-top: 1px solid var(--app-split);
    border-left: 0;
  }

  .skip-person-selector .skip-person-selector-label {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .skip-person-status {
    grid-column: 2;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .manual-judgment {
    grid-template-columns: 1fr;
  }

  .trace-row {
    grid-template-columns: 1fr auto;
  }

  .trace-row p {
    grid-column: 1 / -1;
  }

  .rule-banner .ant-alert-action {
    margin-inline-start: 0;
    margin-top: 12px;
  }

  .sheet-picker-title {
    gap: 10px;
  }

  .sheet-picker-icon {
    width: 32px;
    height: 32px;
  }

  .sheet-picker-list {
    max-height: min(360px, 46vh);
    margin-top: 12px;
  }

  .sheet-picker-option.ant-radio-wrapper {
    min-height: 64px;
    padding: 11px 12px;
  }

  .sheet-picker-option-main strong {
    flex-basis: 100%;
  }

  .bottom-copy {
    display: none;
  }

  .bottom-actions {
    width: 100%;
  }

  .bottom-actions .ant-btn {
    flex: 1;
  }

  .rule-drawer .ant-drawer-content-wrapper {
    max-width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
