:root {
  color-scheme: light;
  --bg: #f5f9f8;
  --header: #1769aa;
  --surface: #ffffff;
  --surface-soft: #f0f8fb;
  --surface-muted: #eef5f2;
  --ink: #15211f;
  --muted: #687772;
  --line: #dfe9e5;
  --green: #2eb872;
  --green-deep: #1d8a5a;
  --green-soft: #e6f7ef;
  --yellow: #f3b516;
  --yellow-soft: #fff5d6;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --blue: #31a8df;
  --blue-soft: #e8f7fd;
  --shadow: 0 12px 28px rgba(31, 58, 49, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eaf4ff;
  color: #155b8c;
  font-size: 13px;
}

.notice-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 24px;
  border-radius: 10px 10px 0 0;
  background: var(--header);
  color: #ffffff;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.3;
}

h2 span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.sub-title {
  margin-bottom: 6px;
  color: #d7e7df;
  font-size: 14px;
}

.scope-line {
  margin-bottom: 0;
  color: #d1e7df;
  font-size: 13px;
  line-height: 1.5;
}

.header-right {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.language-tabs,
.status-panel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  white-space: nowrap;
}

.language-tabs {
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.language-button {
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  font: inherit;
  font-weight: 650;
}

.language-button.active {
  background: var(--green);
  color: #ffffff;
}

.language-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

.status-panel {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ecf7f2;
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.error {
  background: var(--red);
}

.filter-panel,
.panel,
.kpi-card,
.page-footer {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filter-panel {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 0 0 10px 10px;
  border-top: 0;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.filter-field span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-field select,
.filter-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  padding: 10px 13px;
  font-size: 16px;
  line-height: 1.35;
}

.filter-field select {
  appearance: none;
  background:
    #ffffff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2315211f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 14px center / 18px 18px;
  padding-right: 48px;
  text-overflow: ellipsis;
}

.filter-field select::-ms-expand {
  display: none;
}

.filter-field option {
  min-height: 34px;
  font-size: 16px;
  line-height: 1.8;
  padding: 10px 14px;
}

.filter-field select:focus,
.filter-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 184, 114, 0.16);
}

.filter-field input.pending-search {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(243, 181, 22, 0.18);
}

.reset-button {
  min-height: 46px;
  border: 1px solid var(--header);
  border-radius: 7px;
  background: var(--header);
  color: #ffffff;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
  width: 100%;
}

.reset-button:hover {
  background: #12598e;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.back-button:hover,
.back-button:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.filter-result {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.kpi-card {
  display: flex;
  gap: 12px;
  min-width: 0;
  min-height: 104px;
  padding: 15px 12px;
  border-radius: 8px;
}

.kpi-card.primary {
  border-color: rgba(46, 184, 114, 0.65);
  box-shadow: inset 0 -3px 0 var(--green), var(--shadow);
}

.kpi-card.danger {
  border-color: rgba(239, 68, 68, 0.32);
}

.kpi-icon {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
}

.kpi-icon svg,
.exception-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.kpi-card.primary .kpi-icon {
  background: var(--green-soft);
  color: var(--green-deep);
}

.kpi-card.danger .kpi-icon {
  background: var(--red-soft);
  color: var(--red);
}

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

.kpi-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.kpi-value {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 820;
  line-height: 1;
}

.kpi-sub {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.panel {
  min-width: 0;
  padding: 18px;
  border-radius: 9px;
}

.chart-panel,
.behavior-grid,
.exception-grid,
.table-grid,
.bottom-grid,
.employee-match-panel,
.attendance-detail-panel {
  margin-top: 12px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.panel-subtitle,
.metric-note,
.page-footer,
.no-data-panel p {
  color: var(--muted);
}

.panel-subtitle {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.metric-note {
  flex: 0 0 auto;
  font-size: 12px;
}

.status-legend,
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.status-legend span,
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.good,
.hbar-fill.good,
.mini-progress-track i.good {
  background-color: var(--green);
}

.dot.warn,
.hbar-fill.warn,
.mini-progress-track i.warn {
  background-color: var(--yellow);
}

.dot.danger,
.hbar-fill.danger,
.mini-progress-track i.danger {
  background-color: var(--red);
}

.column-chart {
  display: flex;
  gap: 22px;
  min-height: 245px;
  align-items: end;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 4px 12px;
  scrollbar-color: #b7cac2 #edf4f1;
  scrollbar-width: thin;
}

.column-item {
  display: grid;
  flex: 0 0 98px;
  grid-template-rows: auto 160px auto auto;
  gap: 7px;
  min-width: 98px;
  text-align: center;
}

.drillable {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.drillable:hover,
.drillable:focus-visible {
  border-color: rgba(46, 184, 114, 0.52);
  box-shadow: 0 14px 30px rgba(31, 58, 49, 0.12);
  outline: none;
  transform: translateY(-3px);
}

.column-item.drillable {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 5px 8px;
}

.column-item.drillable:hover .column-track,
.column-item.drillable:focus-visible .column-track {
  box-shadow: 0 0 0 4px rgba(46, 184, 114, 0.12);
}

.column-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.column-value.good {
  color: var(--green-deep);
  background: transparent;
}

.column-value.warn {
  color: #9b6d00;
  background: transparent;
}

.column-value.danger {
  color: var(--red);
  background: transparent;
}

.column-track {
  display: flex;
  width: 42px;
  height: 160px;
  justify-self: center;
  align-items: flex-end;
  border-radius: 8px;
  background: #edf4f1;
}

.column-fill {
  width: 100%;
  height: min(100%, var(--column-height));
  min-height: 4px;
  border-radius: 8px 8px 5px 5px;
  background: var(--green);
}

.column-fill.warn {
  background: var(--yellow);
}

.column-fill.danger {
  background: var(--red);
}

.column-name,
.column-sub {
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-name {
  color: var(--ink);
  display: -webkit-box;
  font-size: 12px;
  font-weight: 700;
  min-height: 49px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.column-sub {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.horizontal-bars {
  display: grid;
  gap: 11px;
}

.hbar-row {
  display: grid;
  grid-template-columns: minmax(130px, 260px) 1fr minmax(40px, auto);
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.hbar-row.drillable {
  margin: -4px -8px;
  padding: 4px 8px;
  border-radius: 8px;
}

.hbar-row.drillable:hover,
.hbar-row.drillable:focus-visible {
  background: var(--surface-muted);
  box-shadow: none;
}

.hbar-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hbar-track,
.mini-progress-track {
  overflow: hidden;
  border-radius: 999px;
  background: #edf4f1;
}

.hbar-track {
  height: 11px;
}

.hbar-fill,
.mini-progress-track i {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
}

.hbar-value {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.combo-chart-wrap {
  width: 100%;
  height: 300px;
}

.combo-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.axis-line {
  stroke: #cad8d3;
  stroke-width: 1;
}

.grid-line {
  stroke: #e7efec;
  stroke-width: 1;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.trend-bar {
  fill: var(--green);
}

.drillable-svg {
  cursor: pointer;
  outline: none;
  transition: opacity 140ms ease, filter 140ms ease;
}

.drillable-svg:hover,
.drillable-svg:focus-visible {
  filter: drop-shadow(0 4px 5px rgba(31, 58, 49, 0.28));
  opacity: 0.82;
}

.trend-bar.warn {
  fill: var(--yellow);
}

.trend-bar.danger {
  fill: var(--red);
}

.trend-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line.abnormal {
  stroke: #f09b18;
}

.trend-dot.abnormal {
  fill: #f09b18;
  stroke: #ffffff;
  stroke-width: 2;
}

.legend {
  margin-top: 10px;
}

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

.daily-snapshot-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 14px;
}

.daily-snapshot-card.good {
  border-color: rgba(46, 184, 114, 0.26);
  background: var(--green-soft);
}

.daily-snapshot-card.warn {
  border-color: rgba(243, 181, 22, 0.32);
  background: var(--yellow-soft);
}

.daily-snapshot-card.danger {
  border-color: rgba(239, 68, 68, 0.26);
  background: var(--red-soft);
}

.daily-snapshot-label,
.daily-snapshot-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.daily-snapshot-card strong {
  display: block;
  margin: 7px 0 6px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.daily-snapshot-card em {
  font-style: normal;
}

.legend-chip {
  width: 20px;
  height: 4px;
  border-radius: 999px;
}

.legend-chip.attendance {
  background: var(--green);
}

.legend-chip.abnormal {
  background: #f09b18;
}

.behavior-grid,
.table-grid,
.bottom-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.behavior-card {
  display: grid;
  gap: 14px;
}

.donut-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.donut {
  display: grid;
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--donut-value, 0%), #eaf2ef 0);
  color: var(--ink);
  font-weight: 820;
  position: relative;
}

.donut::after {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.donut span {
  position: relative;
  z-index: 1;
}

.donut.warn {
  background: conic-gradient(var(--yellow) var(--donut-value, 0%), #eaf2ef 0);
}

.donut.danger {
  background: conic-gradient(var(--red) var(--donut-value, 0%), #eaf2ef 0);
}

.donut.muted {
  background: conic-gradient(#b8c5c1 0%, #eaf2ef 0);
}

.mini-metrics {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mini-metrics div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.mini-metrics strong,
.mini-metrics span {
  display: block;
}

.mini-metrics strong {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1;
}

.mini-metrics span {
  color: var(--muted);
  font-size: 12px;
}

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

.exception-card {
  display: grid;
  gap: 14px;
}

.exception-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.exception-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
}

.exception-icon svg {
  width: 20px;
  height: 20px;
}

.exception-icon.late {
  background: var(--yellow-soft);
  color: #9b6d00;
}

.exception-icon.missing,
.exception-icon.absence {
  background: var(--red-soft);
  color: var(--red);
}

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

.exception-head strong {
  font-size: 27px;
  line-height: 1;
}

.exception-head span {
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.exception-head em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.exception-lines {
  display: grid;
  gap: 8px;
}

.mini-progress {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(70px, 1fr) minmax(26px, auto);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-progress-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-progress-track {
  height: 7px;
}

.mini-progress b {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.employee-table {
  min-width: 1020px;
}

.employee-detail-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.employee-detail-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: 0 1px 0 var(--line);
}

.daily-attendance-table {
  min-width: 1180px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

td {
  color: var(--ink);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.employee-match-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.employee-match-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  padding: 11px 12px;
  text-align: left;
}

.employee-match-card:hover,
.employee-match-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 184, 114, 0.12);
}

.employee-match-card strong,
.employee-match-card span,
.employee-match-card em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-match-card strong {
  font-size: 14px;
}

.employee-match-card span {
  color: var(--muted);
  font-size: 12px;
}

.employee-match-card em {
  color: var(--green-deep);
  font-size: 12px;
  font-style: normal;
}

.badge-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.badge-normal {
  background: var(--green-soft);
  color: var(--green-deep);
}

.badge-late {
  background: var(--yellow-soft);
  color: #946600;
}

.badge-missing,
.badge-abnormal {
  background: var(--red-soft);
  color: var(--red);
}

.badge-leave {
  background: #efe7ff;
  color: #6b3bb5;
}

.badge-overtime {
  background: var(--blue-soft);
  color: #147aa7;
}

.badge-rest,
.badge-pending,
.badge-empty {
  background: #eef1f2;
  color: var(--muted);
}

.no-data-panel strong {
  font-size: 32px;
  line-height: 1;
}

.no-data-panel p {
  margin-bottom: 0;
  line-height: 1.55;
}

.brief-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

.brief-list li {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.page-footer {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.detail-shell .report-header {
  border-radius: 10px;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
}

.detail-type {
  display: inline-flex;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.detail-hero h2 {
  font-size: 22px;
}

.detail-meta {
  display: grid;
  gap: 7px;
  min-width: 220px;
}

.detail-meta span {
  display: block;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.detail-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.detail-kpis .kpi-card {
  min-height: 92px;
}

.detail-filter-panel {
  margin-top: 12px;
  border-radius: 9px;
  border-top: 1px solid var(--line);
}

.detail-filter-grid {
  grid-template-columns: minmax(150px, 0.8fr) minmax(240px, 1.3fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

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

.abnormal-insight-card {
  min-width: 0;
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 11px 12px;
}

.abnormal-insight-card strong,
.abnormal-insight-card span,
.abnormal-insight-card em {
  display: block;
}

.abnormal-insight-card strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.abnormal-insight-card span {
  margin-top: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.abnormal-insight-card em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.detail-alert-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.detail-alert-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.detail-alert-row strong,
.detail-alert-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-alert-row strong {
  font-size: 13px;
}

.detail-alert-row span {
  color: var(--muted);
  font-size: 12px;
}

.detail-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-table-wrap table {
  table-layout: fixed;
}

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

.detail-table-wrap td {
  min-height: 44px;
  word-break: break-word;
}

.detail-table-wrap .employee-table {
  min-width: 1320px;
}

.detail-table-wrap .daily-attendance-table {
  min-width: 1540px;
}

.detail-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: 0 1px 0 var(--line);
}

.detail-table-wrap th:first-child,
.detail-table-wrap td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  box-shadow: 1px 0 0 var(--line);
}

.detail-table-wrap thead th:first-child {
  z-index: 3;
}

#employeeDetailHeader th:nth-child(1),
#employeeDetailRows td:nth-child(1) {
  width: 250px;
}

#employeeDetailHeader th:nth-child(2),
#employeeDetailRows td:nth-child(2) {
  width: 90px;
}

#employeeDetailHeader th:nth-child(3),
#employeeDetailRows td:nth-child(3) {
  width: 190px;
}

#employeeDetailHeader th:nth-child(4),
#employeeDetailRows td:nth-child(4),
#employeeDetailHeader th:nth-child(5),
#employeeDetailRows td:nth-child(5) {
  width: 110px;
}

#employeeDetailHeader th:nth-child(n+6),
#employeeDetailRows td:nth-child(n+6) {
  width: 112px;
}

#recordDetailHeader th:nth-child(1),
#recordDetailRows td:nth-child(1) {
  width: 112px;
}

#recordDetailHeader th:nth-child(2),
#recordDetailRows td:nth-child(2) {
  width: 90px;
}

#recordDetailHeader th:nth-child(3),
#recordDetailRows td:nth-child(3) {
  width: 230px;
}

#recordDetailHeader th:nth-child(4),
#recordDetailRows td:nth-child(4) {
  width: 190px;
}

#recordDetailHeader th:nth-child(5),
#recordDetailRows td:nth-child(5) {
  width: 130px;
}

#recordDetailHeader th:nth-child(6),
#recordDetailRows td:nth-child(6) {
  width: 330px;
}

#recordDetailHeader th:nth-child(n+7),
#recordDetailRows td:nth-child(n+7) {
  width: 112px;
}

.empty {
  width: 100%;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--muted);
  font-size: 13px;
}

.empty.compact {
  padding: 10px;
  font-size: 12px;
}

.kpi-grid,
.chart-panel,
.behavior-grid,
.exception-grid,
.table-grid,
.employee-match-panel,
.attendance-detail-panel,
.bottom-grid,
.filter-result {
  transition: opacity 160ms ease, transform 160ms ease;
}

.shell.is-updating .kpi-grid,
.shell.is-updating .chart-panel,
.shell.is-updating .behavior-grid,
.shell.is-updating .exception-grid,
.shell.is-updating .table-grid,
.shell.is-updating .employee-match-panel,
.shell.is-updating .attendance-detail-panel,
.shell.is-updating .bottom-grid,
.shell.is-updating .filter-result {
  opacity: 0.35;
  transform: translateY(6px);
}

.shell.has-updated .kpi-grid,
.shell.has-updated .chart-panel,
.shell.has-updated .behavior-grid,
.shell.has-updated .exception-grid,
.shell.has-updated .table-grid,
.shell.has-updated .employee-match-panel,
.shell.has-updated .attendance-detail-panel,
.shell.has-updated .bottom-grid,
.shell.has-updated .filter-result {
  animation: content-enter 260ms ease both;
}

@keyframes content-enter {
  from {
    opacity: 0.45;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kpi-grid,
  .chart-panel,
  .behavior-grid,
  .exception-grid,
  .table-grid,
  .employee-match-panel,
  .attendance-detail-panel,
  .bottom-grid,
  .filter-result {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1180px) {
  .kpi-grid,
  .detail-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .reset-button {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .report-header,
  .panel-heading,
  .donut-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-right {
    justify-items: start;
  }

  .behavior-grid,
  .table-grid,
  .bottom-grid,
  .detail-hero,
  .exception-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    display: grid;
  }

  .detail-meta {
    min-width: 0;
    width: 100%;
  }

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

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

  .mini-metrics {
    width: 100%;
  }

  .column-chart {
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1200px);
    padding-top: 10px;
  }

  .report-header,
  .filter-panel,
  .panel,
  .page-footer {
    padding: 14px;
  }

  h1 {
    font-size: 24px;
  }

  h2 span {
    display: block;
    margin: 3px 0 0;
  }

  .language-tabs,
  .status-panel {
    white-space: normal;
  }

  .filter-grid,
  .detail-filter-grid,
  .kpi-grid,
  .detail-kpis {
    grid-template-columns: 1fr;
  }

  .abnormal-insights {
    grid-template-columns: 1fr;
  }

  .daily-snapshot-grid {
    grid-template-columns: 1fr;
  }

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

  .column-track {
    height: 120px;
  }

  .column-item {
    grid-template-rows: auto 120px auto auto;
  }

  .hbar-row,
  .mini-progress {
    grid-template-columns: 1fr minmax(42px, auto);
  }

  .hbar-name,
  .mini-progress-name {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .combo-chart-wrap {
    height: 250px;
  }

  .mini-metrics {
    grid-template-columns: 1fr;
  }

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

  table {
    min-width: 720px;
  }
}
