.attendance-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.employee-insights-modal {
  --insight-surface: var(--paper);
  --insight-soft: color-mix(in srgb, var(--paper) 75%, var(--theme-card));
  --insight-accent: #2455b0;
  width: min(1140px, 100%);
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

html[data-theme="dark"] .employee-insights-modal {
  --insight-accent: #b7cdff;
}

.employee-insights-modal > h2 {
  margin-right: 34px;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.3;
}

.employee-insights-modal > p { font-size: 13px; }

.employee-insights-modal .employee-insights-head {
  justify-content: space-between;
  border-color: var(--theme-border);
  background: var(--insight-soft);
}

.employee-insights-person > span { flex: none; }
.employee-insights-person h3 { font-size: 19px; }
.employee-insights-person small { font-size: 12px; }

.employee-insights-actions,
.insights-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.employee-insights-modal .employee-insights-controls {
  grid-template-columns: minmax(120px, 165px) minmax(180px, 260px) 130px;
  justify-content: start;
  align-items: stretch;
  gap: 8px;
}

.employee-insights-controls > :is(select, button) { min-height: 48px; }
.employee-insights-modal .employee-insights-controls .primary { box-shadow: none; }

.employee-insights-modal .employee-insights-kpis > :is(span, .employee-ot-trigger) {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 78px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--insight-surface);
  font-size: 12px;
  line-height: 1.4;
}

.employee-insights-modal .employee-insights-kpis b {
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  font-variant-numeric: tabular-nums;
}

.employee-insights-modal .employee-insights-kpis > .employee-ot-trigger {
  padding-right: 34px;
  color: var(--insight-accent);
  background: var(--theme-card);
  border-color: var(--theme-border);
}

.employee-insights-modal .employee-ot-trigger:hover { border-color: var(--blue); }
.employee-ot-arrow { position: absolute; top: 50%; right: 14px; translate: 0 -50%; font-size: 22px; }

.employee-insights-modal .insights-section {
  background: var(--insight-surface);
}
.employee-insights-modal .insights-section > summary {
  padding: 13px 16px;
  background: var(--insight-soft);
  color: var(--ink);
  font-size: 15px;
}
.employee-insights-modal .insights-section .table-wrap { padding: 0; }
.employee-insights-modal .insights-section table { min-width: 700px; }
.employee-insights-modal .insights-section :is(th, td) { padding: 12px 14px; }
.employee-insights-modal .insights-section th { color: var(--muted); }
.employee-insights-modal .insights-section td {
  color: var(--ink);
  border-color: var(--line);
  vertical-align: middle;
}
.employee-insights-modal .insights-section tr:hover td { background: var(--insight-soft); }
.employee-insights-modal .insights-section td:first-child { white-space: nowrap; }
.employee-insights-modal .insights-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.insights-time span + span { margin-inline-start: 5px; }
.employee-insights-modal .insights-actions-cell { border-inline-start: 1px solid var(--line); }
.insights-row-actions { min-width: 155px; }

.employee-insights-modal :is(.employee-edit-button, .workforce-time-edit, .attendance-reset-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  box-shadow: none;
  color: var(--insight-accent);
  background: var(--theme-card);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.employee-insights-modal .attendance-reset-button { color: var(--red); }
.employee-insights-modal :is(.employee-edit-button, .workforce-time-edit, .attendance-reset-button):hover {
  border-color: var(--blue);
  box-shadow: none;
  transform: none;
}
.employee-insights-modal .workforce-time-edit svg { width: 16px; height: 16px; }
.employee-insights-modal .employee-insights-lists .panel { background: var(--insight-surface); }
.employee-insights-modal .employee-insights-lists .panel-head { flex-wrap: wrap; gap: 4px 12px; }
.employee-insights-modal .employee-insights-lists h3 { font-size: 16px; }

@media (max-width: 760px) {
  .employee-insights-modal .employee-insights-controls {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }
  .employee-insights-controls .primary { grid-column: 1 / -1; }
  .employee-insights-modal .employee-insights-head { gap: 12px; }
  .employee-insights-actions > button { flex: 1 1 auto; }
  .employee-insights-modal :is(.employee-edit-button, .workforce-time-edit, .attendance-reset-button) {
    min-height: 44px;
  }
}
