:root {
  color-scheme: light;
  --ink: #172124;
  --muted: #607074;
  --soft-muted: #879397;
  --line: #d9e1e3;
  --line-strong: #c5d0d3;
  --page: #f3f6f6;
  --panel: #ffffff;
  --soft: #f7f9f9;
  --teal: #08766f;
  --teal-dark: #075e59;
  --teal-pale: #e7f4f2;
  --green: #247a52;
  --green-pale: #e7f5ec;
  --amber: #a96512;
  --amber-pale: #fff1d9;
  --red: #a33a35;
  --red-pale: #fce8e6;
  --shadow: 0 18px 48px rgba(31, 48, 53, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.employee-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--teal);
}

.brand-icon.large {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
}

.quiet-button:hover {
  border-color: var(--line);
  background: var(--soft);
}

.primary-button,
.secondary-button,
.danger-button,
.table-action {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  font-weight: 750;
}

.primary-button {
  color: #fff;
  background: var(--teal);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
}

.secondary-button:hover {
  background: var(--soft);
}

.danger-button {
  color: #fff;
  background: var(--red);
}

.danger-button:hover {
  background: #872e2a;
}

.full-button {
  width: 100%;
}

.button-spinner,
.field-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.field-spinner {
  position: absolute;
  right: 14px;
  color: var(--teal);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.compact-date,
.search-field {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
}

.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 38px 10px 13px;
}

.field textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.compact-date:focus-within,
.search-field:focus-within {
  border-color: var(--teal);
  outline: 3px solid rgba(8, 118, 111, 0.13);
}

.field input[readonly] {
  color: var(--muted);
  background: var(--soft);
}

.toggle-field {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--soft);
  cursor: pointer;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.toggle-field > span {
  display: grid;
  gap: 3px;
}

.toggle-field strong {
  font-size: 14px;
}

.toggle-field small {
  color: var(--muted);
  font-size: 12px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon > svg {
  position: absolute;
  left: 13px;
  width: 19px;
  height: 19px;
  color: var(--soft-muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 42px;
}

.input-with-icon .input-invalid {
  border-color: var(--red);
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.field-help-error,
.error-text {
  color: var(--red) !important;
}

.inline-message {
  margin-top: 14px;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 650;
}

.error-message {
  color: var(--red);
  border: 1px solid #efc7c4;
  background: var(--red-pale);
}

.subtle-text {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Role entry */

.role-entry-body {
  min-height: 100vh;
  background: #f1f4f4;
}

.role-entry-layout {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.role-entry-header {
  min-height: 76px;
  padding: 14px max(24px, calc((100vw - 1020px) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  background: var(--panel);
}

.role-entry-main {
  width: min(1020px, calc(100% - 48px));
  margin: auto;
  padding: 48px 0 56px;
}

.role-entry-heading {
  margin-bottom: 26px;
}

.role-entry-heading h1 {
  font-size: 32px;
}

.role-entry-heading > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.role-entry-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.role-entry-option {
  --role-color: var(--teal);
  --role-soft: var(--teal-pale);
  min-height: 250px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--role-color);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(31, 48, 53, 0.06);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.role-entry-option:hover,
.role-entry-option:focus-visible {
  border-color: var(--role-color);
  box-shadow: 0 14px 30px rgba(31, 48, 53, 0.11);
  transform: translateY(-2px);
  outline: none;
}

.role-entry-option.leader-role {
  --role-color: #a96512;
  --role-soft: #fff1d9;
}

.role-entry-option.admin-role {
  --role-color: #315f88;
  --role-soft: #e8f0f7;
}

.role-entry-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--role-color);
  background: var(--role-soft);
}

.role-entry-icon svg {
  width: 26px;
  height: 26px;
}

.role-entry-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.role-entry-label {
  margin-bottom: 8px;
  color: var(--role-color);
  font-size: 12px;
  font-weight: 800;
}

.role-entry-copy strong {
  font-size: 23px;
  line-height: 1.2;
}

.role-entry-copy small {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.role-entry-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--role-color);
  font-size: 14px;
  font-weight: 800;
}

.role-entry-action svg {
  width: 18px;
  height: 18px;
}

.role-entry-footer {
  min-height: 56px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
}

.role-entry-footer svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 760px) {
  .role-entry-header {
    min-height: 68px;
    padding: 12px 16px;
  }

  .role-entry-header .brand strong {
    font-size: 14px;
  }

  .role-entry-header .brand small {
    display: none;
  }

  .role-entry-main {
    width: min(100% - 28px, 520px);
    padding: 34px 0 40px;
  }

  .role-entry-heading h1 {
    font-size: 27px;
  }

  .role-entry-options {
    grid-template-columns: 1fr;
  }

  .role-entry-option {
    min-height: 0;
    padding: 20px;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 14px 16px;
  }

  .role-entry-copy {
    grid-column: 2;
  }

  .role-entry-action {
    grid-column: 1 / -1;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
}

/* Employee check-in */

.employee-body {
  min-height: 100vh;
  background:
    linear-gradient(#edf5f4 0 210px, var(--page) 210px);
}

.checkin-layout {
  width: min(100%, 610px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px;
}

.employee-header {
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkin-surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.checkin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.live-clock {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.live-clock strong {
  font-size: 24px;
  line-height: 1.2;
}

.live-clock span {
  color: var(--muted);
  font-size: 12px;
}

.rule-strip {
  min-height: 44px;
  margin: 22px 0;
  border-radius: 8px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-size: 13px;
  font-weight: 650;
}

.checkin-form {
  display: grid;
  gap: 18px;
}

.identity-match {
  min-height: 62px;
  border: 1px solid #bcded8;
  border-radius: 8px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #f0faf8;
}

.match-icon {
  color: var(--green);
}

.identity-match > span:last-child {
  display: grid;
  gap: 3px;
}

.identity-match small {
  color: var(--muted);
}

.checkin-button {
  min-height: 52px;
  margin-top: 2px;
  font-size: 16px;
}

.checkin-result {
  text-align: center;
}

.result-icon {
  width: 64px;
  height: 64px;
  margin: 3px auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-icon svg {
  width: 34px;
  height: 34px;
}

.result-icon.normal {
  color: var(--green);
  background: var(--green-pale);
}

.result-icon.late {
  color: var(--amber);
  background: var(--amber-pale);
}

.checkin-result h2 {
  margin-bottom: 10px;
  font-size: 26px;
}

.status-badge {
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.normal {
  color: var(--green);
  background: var(--green-pale);
}

.status-badge.late {
  color: var(--amber);
  background: var(--amber-pale);
}

.status-badge.missing {
  color: var(--red);
  background: var(--red-pale);
}

.result-details {
  margin: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: left;
}

.result-details > div {
  min-width: 0;
  padding: 16px;
}

.result-details > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.result-details > div:not(:nth-last-child(-n + 2)) {
  border-bottom: 1px solid var(--line);
}

.result-details dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.result-details dd {
  margin: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.employee-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.employee-footer svg {
  width: 16px;
  height: 16px;
}

.punch-status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 14px;
  background: var(--soft);
}

.punch-status-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.punch-status-summary span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.punch-status-summary small,
.punch-progress time {
  color: var(--muted);
  font-size: 11px;
}

.punch-status-summary strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.punch-progress {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
}

.punch-progress li {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.punch-progress li::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--line-strong);
  transform: translateX(-13px);
  z-index: 0;
}

.punch-progress li:first-child::before {
  display: none;
}

.punch-progress li.done::before,
.punch-progress li.current::before {
  background: #8fc7bf;
}

.punch-step-icon {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--soft-muted);
  background: #fff;
}

.punch-step-icon svg {
  width: 14px;
  height: 14px;
}

.punch-progress li.done .punch-step-icon {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.punch-progress li.current .punch-step-icon {
  color: var(--teal);
  border-color: var(--teal);
  background: var(--teal-pale);
}

.punch-progress li > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.punch-progress strong {
  font-size: 11px;
  line-height: 1.3;
}

.punch-calculation {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Employee monthly hours */

.personal-hours-body {
  background:
    linear-gradient(#edf5f4 0 190px, var(--page) 190px);
}

.personal-hours-layout {
  width: min(100%, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.personal-hours-surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.personal-hours-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.hours-lookup-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px auto;
  align-items: end;
  gap: 10px;
}

.compact-field {
  gap: 5px;
}

.compact-field input {
  min-height: 42px;
}

.hours-identity {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hours-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: var(--teal-pale);
}

.hours-identity > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.hours-identity small {
  color: var(--muted);
}

.hours-period {
  margin-left: auto;
  color: var(--muted);
  font-weight: 750;
}

.hours-summary-grid {
  margin: 22px 0 30px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.hours-summary-grid article {
  min-width: 0;
  padding: 17px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 5px;
}

.hours-summary-grid article:not(:last-child) {
  border-right: 1px solid var(--line);
}

.hours-summary-grid small {
  grid-column: 1 / -1;
  margin-bottom: 7px;
  color: var(--muted);
}

.hours-summary-grid strong {
  font-size: 28px;
  line-height: 1;
}

.hours-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.calendar-legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.confirmed {
  background: var(--green);
}

.legend-dot.pending {
  background: var(--amber);
}

.legend-dot.rest {
  background: var(--soft-muted);
}

.month-calendar-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.month-calendar-weekdays,
.month-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-calendar-weekdays {
  min-height: 34px;
  align-items: center;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.calendar-cell {
  min-width: 0;
  min-height: 94px;
  border: 0;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 9px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 7px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.calendar-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-cell:not(:disabled):hover,
.calendar-cell.selected {
  box-shadow: inset 0 0 0 2px var(--teal);
  background: #f5fbfa;
}

.calendar-cell:disabled {
  opacity: 1;
  cursor: default;
}

.calendar-day {
  color: var(--muted);
  font-size: 12px;
}

.calendar-cell strong {
  font-size: 18px;
}

.calendar-cell small {
  color: var(--muted);
  font-size: 11px;
}

.calendar-cell.normal,
.calendar-cell.approved {
  border-left: 3px solid var(--green);
}

.calendar-cell.pending {
  border-left: 3px solid var(--amber);
}

.calendar-cell.abnormal {
  border-left: 3px solid var(--red);
}

.calendar-cell.rest {
  border-left: 3px solid var(--soft-muted);
  background: var(--soft);
}

.calendar-empty {
  border-left: 0;
  background: var(--soft);
}

.day-detail-section {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.day-hours-summary {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.day-hours-summary > div {
  padding: 14px;
}

.day-hours-summary > div:not(:last-child) {
  border-right: 1px solid var(--line);
}

.day-hours-summary dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.day-hours-summary dd {
  margin: 0;
  font-weight: 800;
}

.day-detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.day-detail-columns h3 {
  margin: 0 0 9px;
  font-size: 14px;
}

.detail-list {
  border-top: 1px solid var(--line);
}

.detail-list > div {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.detail-list > div span {
  color: var(--muted);
}

.empty-detail {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.day-review-note {
  margin: 18px 0 0;
  border-left: 3px solid var(--amber);
  padding: 9px 12px;
  color: var(--muted);
  background: var(--amber-pale);
  font-size: 13px;
}

.status-badge.pending {
  color: var(--amber);
  background: var(--amber-pale);
}

.status-badge.abnormal {
  color: var(--red);
  background: var(--red-pale);
}

.status-badge.rest {
  color: var(--muted);
  background: #e9edef;
}

/* Admin */

.admin-body {
  min-height: 100vh;
}

.login-layout {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  background: #edf3f3;
}

.login-panel {
  width: min(100%, 410px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-field {
  margin: 24px 0 16px;
}

.back-link {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover {
  color: var(--teal);
}

.back-link svg {
  width: 17px;
  height: 17px;
}

.admin-layout {
  min-height: 100vh;
}

.admin-header {
  height: 68px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-main {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 30px 24px 48px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-date {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-date svg {
  width: 18px;
  color: var(--muted);
}

.compact-date input {
  width: 132px;
  min-height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.metrics-grid {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-item {
  min-width: 0;
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-item > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.metric-item small {
  color: var(--muted);
  white-space: nowrap;
}

.metric-item strong {
  font-size: 27px;
  line-height: 1;
}

.metric-item.expected .metric-icon {
  color: var(--teal);
  background: var(--teal-pale);
}

.metric-item.checked .metric-icon {
  color: var(--green);
  background: var(--green-pale);
}

.metric-item.missing .metric-icon {
  color: var(--red);
  background: var(--red-pale);
}

.metric-item.late .metric-icon {
  color: var(--amber);
  background: var(--amber-pale);
}

.records-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.records-toolbar {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.search-field {
  width: min(100%, 290px);
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field svg {
  width: 18px;
  color: var(--soft-muted);
}

.search-field input {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.segmented-control {
  padding: 0 20px 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.segmented-control button:hover {
  color: var(--ink);
  background: var(--soft);
}

.segmented-control button.active {
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.segmented-control span {
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.table-container {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.attendance-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.attendance-table th,
.attendance-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e8edef;
  text-align: left;
  vertical-align: middle;
}

.attendance-table th {
  color: var(--muted);
  background: #f8fafa;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.attendance-table tbody tr:last-child td {
  border-bottom: 0;
}

.attendance-table tbody tr:hover {
  background: #fbfcfc;
}

.employee-cell,
.record-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.employee-cell strong {
  font-size: 14px;
}

.employee-cell span,
.record-cell small {
  color: var(--muted);
  font-size: 12px;
}

.record-cell {
  max-width: 220px;
}

.record-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.action-column {
  width: 112px;
  text-align: right !important;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.row-actions .icon-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

.row-actions svg {
  width: 17px;
  height: 17px;
}

.danger-icon {
  color: var(--red);
}

.table-action {
  min-height: 34px;
  padding: 0 10px;
  color: var(--teal-dark);
  border-color: #bcded8;
  background: #f0faf8;
  font-size: 12px;
}

.table-action svg {
  width: 16px;
  height: 16px;
}

.empty-cell,
.empty-state {
  padding: 34px !important;
  color: var(--muted);
  text-align: center !important;
}

.pagination {
  min-height: 60px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.pagination > div {
  display: flex;
  gap: 4px;
}

/* Dialogs */

.app-dialog {
  width: min(calc(100% - 32px), 650px);
  max-height: min(86vh, 760px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 72px rgba(23, 33, 36, 0.28);
}

.app-dialog::backdrop {
  background: rgba(23, 33, 36, 0.5);
}

.compact-dialog {
  width: min(calc(100% - 32px), 520px);
}

.audit-dialog {
  width: min(calc(100% - 32px), 720px);
}

.employee-manager-dialog {
  width: min(calc(100% - 32px), 940px);
}

.dialog-content {
  padding: 24px;
}

.dialog-header {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.dialog-grid.two-columns {
  grid-template-columns: 1fr 1fr;
}

.dialog-note {
  grid-column: 1 / -1;
}

.schedule-editor {
  margin-top: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.schedule-fields {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.batch-schedule-fields {
  margin-bottom: 18px;
}

.employee-note {
  margin-top: 18px;
}

.employee-manager-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.employee-manager-toolbar .search-field {
  width: min(100%, 390px);
}

.manager-tabs {
  padding: 14px 0 10px;
}

.manager-table-wrap {
  max-height: 50vh;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.manager-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.manager-table th,
.manager-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e8edef;
  text-align: left;
  vertical-align: middle;
}

.manager-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: var(--muted);
  background: #f8fafa;
  font-size: 12px;
}

.manager-table tbody tr:last-child td {
  border-bottom: 0;
}

.manager-table tbody tr:hover {
  background: #fbfcfc;
}

.select-column {
  width: 44px;
  text-align: center !important;
}

.select-column input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.schedule-cell {
  min-width: 170px;
  display: grid;
  gap: 3px;
}

.schedule-cell strong {
  font-size: 13px;
}

.schedule-cell small {
  color: var(--muted);
  font-size: 11px;
}

.employee-status {
  min-height: 25px;
  border-radius: 999px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: var(--green-pale);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.employee-status.inactive {
  color: var(--muted);
  background: #edf0f1;
}

.manager-footer {
  min-height: 62px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.manager-footer > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.batch-selection {
  display: flex;
  align-items: center;
  gap: 12px;
}

.batch-selection strong {
  color: var(--teal-dark);
  font-size: 13px;
}

.dialog-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-kicker {
  color: var(--red);
}

.delete-target {
  margin: -4px 0 18px;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--red);
  background: var(--red-pale);
  font-weight: 700;
}

.audit-list {
  max-height: 60vh;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.audit-item {
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(108px, auto) minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.audit-action {
  min-height: 26px;
  width: 100%;
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.audit-action.delete {
  color: var(--red);
  background: var(--red-pale);
}

.audit-item div {
  min-width: 0;
}

.audit-item strong {
  font-size: 13px;
}

.audit-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.audit-item time {
  color: var(--soft-muted);
  font-size: 11px;
  white-space: nowrap;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  max-width: min(calc(100% - 32px), 420px);
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 30px rgba(23, 33, 36, 0.22);
  font-size: 13px;
  font-weight: 700;
}

.toast.error {
  background: var(--red);
}

.app-dialog > .toast {
  position: sticky;
  z-index: 100;
  top: 12px;
  left: auto;
  bottom: auto;
  width: fit-content;
  margin: 12px auto 0;
  transform: none;
  text-align: center;
}

@media (max-width: 900px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .compact-date {
    flex: 1 1 180px;
  }

  .compact-date input {
    width: 100%;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 24px;
  }

  .employee-body {
    background: #edf5f4;
  }

  .checkin-layout {
    padding: 16px;
  }

  .employee-header {
    margin-bottom: 18px;
  }

  .checkin-surface {
    padding: 20px;
    box-shadow: 0 12px 32px rgba(31, 48, 53, 0.1);
  }

  .checkin-heading {
    gap: 16px;
  }

  .live-clock strong {
    font-size: 20px;
  }

  .live-clock span {
    max-width: 100px;
    text-align: right;
  }

  .result-details {
    grid-template-columns: 1fr;
  }

  .result-details > div {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
  }

  .result-details > div:last-child {
    border-bottom: 0;
  }

  .admin-header {
    height: auto;
    min-height: 62px;
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 4px;
  }

  .admin-header .brand {
    flex: 1 0 100%;
    overflow: visible;
  }

  .admin-header .brand-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  .admin-header .brand strong {
    max-width: none;
    font-size: 14px;
    white-space: nowrap;
  }

  .admin-header .brand small {
    display: none;
  }

  .admin-header .header-actions {
    width: 100%;
    flex: 0 0 100%;
    justify-content: flex-end;
    gap: 0;
  }

  .admin-header .icon-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .schedule-admin-body .admin-header {
    height: 62px;
    min-height: 62px;
    padding: 0 14px;
    flex-wrap: nowrap;
    gap: 0;
  }

  .schedule-admin-body .admin-header .brand {
    flex: 1 1 auto;
    overflow: hidden;
  }

  .schedule-admin-body .admin-header .brand strong {
    max-width: 132px;
    font-size: 13px;
    white-space: normal;
  }

  .schedule-admin-body .admin-header .header-actions {
    width: auto;
    flex: 0 0 auto;
  }

  .admin-main {
    padding: 22px 14px 36px;
  }

  .dashboard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-actions .compact-date {
    grid-column: 1 / -1;
  }

  .dashboard-actions button {
    width: 100%;
  }

  .metrics-grid {
    gap: 8px;
  }

  .metric-item {
    min-height: 88px;
    padding: 13px;
    gap: 10px;
  }

  .metric-icon {
    width: 36px;
    height: 36px;
  }

  .metric-item strong {
    font-size: 23px;
  }

  .records-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .dialog-content {
    padding: 20px;
  }

  .dialog-grid,
  .dialog-grid.two-columns,
  .schedule-fields {
    grid-template-columns: 1fr;
  }

  .dialog-note {
    grid-column: auto;
  }

  .dialog-actions > button {
    flex: 1 1 0;
  }

  .audit-item {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .audit-item time {
    grid-column: 2;
  }

  .employee-manager-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-manager-toolbar .search-field,
  .employee-manager-toolbar button {
    width: 100%;
  }

  .manager-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-selection {
    justify-content: space-between;
  }
}

/* Project scheduling whiteboard */

.schedule-admin-layout {
  min-height: 100vh;
}

.schedule-main,
.public-schedule-main {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px 30px 38px;
}

.schedule-heading,
.public-schedule-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.schedule-search {
  width: min(290px, 100%);
}

.schedule-clear-button {
  border-color: #e3b2ae;
  color: #9d302d;
  background: #fffafa;
}

.schedule-clear-button:hover {
  border-color: #c86661;
  color: #812522;
  background: #fff2f1;
}

.schedule-stats {
  min-height: 70px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 150px)) minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  background: var(--panel);
}

.schedule-stats > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.schedule-stats span {
  color: var(--muted);
  font-size: 13px;
}

.schedule-stats strong {
  font-size: 24px;
  line-height: 1;
}

.schedule-search-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.schedule-loading {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.schedule-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 18px;
}

.board-scroll-region {
  min-width: 0;
}

.project-board-top-scroll {
  height: 16px;
  margin-bottom: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.project-board-top-scroll > div {
  height: 1px;
}

.project-board-shell {
  min-width: 0;
  min-height: 0;
  height: clamp(360px, calc(100vh - 330px), 680px);
  overflow: auto;
  padding: 0 0 12px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
}

.project-board {
  min-height: 560px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(292px, 320px);
  align-items: start;
  gap: 14px;
}

.project-column,
.pool-column,
.public-project-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.project-column {
  border-top: 5px solid var(--project-color, var(--teal));
}

.project-column-header {
  min-height: 88px;
  padding: 14px 14px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--project-color, var(--teal)) 8%, #ffffff);
  position: sticky;
  top: 0;
  z-index: 2;
}

.project-column-title {
  min-width: 0;
}

.project-code {
  min-height: 18px;
  margin: 0 0 4px;
  color: var(--project-color, var(--teal));
  font-size: 11px;
  font-weight: 800;
}

.project-column-title h2,
.public-project-column h2 {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.project-shift {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.project-lane {
  border-bottom: 1px solid var(--line);
}

.project-lane:last-child {
  border-bottom: 0;
}

.lane-header {
  min-height: 38px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--soft);
}

.lane-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.lane-header strong {
  font-size: 12px;
}

.leader-assignment-control {
  padding: 8px 9px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 7px;
}

.leader-assignment-control select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 32px 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.person-list {
  min-height: 76px;
  padding: 9px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.person-list:empty::after {
  content: attr(data-empty-label);
  min-height: 56px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--soft-muted);
  font-size: 12px;
}

.person-card,
.public-person-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--job-accent, var(--card-accent, var(--teal)));
  border-radius: 6px;
  background: var(--job-background, #fff);
}

.person-card {
  min-height: 58px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  cursor: grab;
  user-select: none;
  touch-action: manipulation;
  box-shadow: 0 1px 2px rgba(23, 33, 36, 0.04);
}

.person-card-content {
  min-width: 0;
}

.person-card-action {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.person-card-action:hover {
  background: var(--red-pale);
  color: var(--red);
}

.person-card-action svg {
  width: 17px;
  height: 17px;
}

.person-card:active {
  cursor: grabbing;
}

.person-card strong,
.public-person-card strong {
  display: block;
  color: var(--job-text, var(--ink));
  overflow-wrap: anywhere;
}

.person-card strong {
  font-size: 14px;
}

.person-card small,
.public-person-card small {
  display: block;
  margin-top: 3px;
  color: var(--job-muted, var(--muted));
  font-size: 11px;
  overflow-wrap: anywhere;
}

.person-card:is(
    [data-job-type="工地主任"],
    [data-job-type="领班"],
    [data-job-type="跑料"],
    [data-job-type="安全员"],
    [data-job-type="文员"],
    [data-job-type="后勤"]
  ),
.public-person-card:is(
    [data-job-type="工地主任"],
    [data-job-type="领班"],
    [data-job-type="跑料"],
    [data-job-type="安全员"],
    [data-job-type="文员"],
    [data-job-type="后勤"]
  ) {
  --job-accent: #0070c0;
  --job-background: #f3f8fd;
  --job-text: #005a9c;
  --job-muted: #4a718b;
}

.person-card[data-job-type="装配工"],
.public-person-card[data-job-type="装配工"] {
  --job-accent: #00b050;
  --job-background: #f1faf5;
  --job-text: #007d39;
  --job-muted: #47745a;
}

.person-card[data-job-type="电焊工"],
.public-person-card[data-job-type="电焊工"] {
  --job-accent: #ff0000;
  --job-background: #fff3f3;
  --job-text: #b00000;
  --job-muted: #8b5454;
}

.person-card:is([data-job-type="打磨工"], [data-job-type="辅助工"]),
.public-person-card:is([data-job-type="打磨工"], [data-job-type="辅助工"]) {
  --job-accent: #c6a900;
  --job-background: #fff7a8;
  --job-text: #403900;
  --job-muted: #6f6400;
}

.person-card.leader-card {
  --card-accent: #2f6da1;
}

.person-card.worker-card {
  --card-accent: var(--project-color, var(--teal));
}

.person-card.rest-card {
  --card-accent: var(--amber);
}

.person-card.unassigned-card,
.person-card.pool-card {
  --card-accent: var(--red);
}

.person-schedule-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.person-schedule-badge {
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.person-schedule-badge.day {
  color: #1f6950;
  border-color: #b8ddcf;
  background: #eaf7f1;
}

.person-schedule-badge.night {
  color: #315f94;
  border-color: #bdd1e5;
  background: #edf4fa;
}

.sortable-ghost {
  opacity: 0.35;
  background: var(--teal-pale);
}

.sortable-chosen {
  box-shadow: 0 8px 22px rgba(23, 33, 36, 0.16);
}

.drop-active {
  background: var(--teal-pale);
}

.schedule-pools {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 14px;
}

.pool-column > header {
  min-height: 68px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.pool-column h2 {
  font-size: 16px;
}

.pool-column small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.pool-icon {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.unassigned-pool > header,
.people-pool > header {
  background: var(--red-pale);
}

.unassigned-pool .pool-icon,
.people-pool .pool-icon {
  color: var(--red);
  background: #fff;
}

.pool-filter-tabs {
  padding: 9px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.pool-filter-tabs button {
  min-width: 0;
  min-height: 34px;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.pool-filter-tabs button:hover {
  background: #fff;
  color: var(--ink);
}

.pool-filter-tabs button.active {
  border-color: #b9d8d4;
  background: #fff;
  color: var(--teal);
}

.rest-pool > header {
  background: var(--amber-pale);
}

.rest-pool .pool-icon {
  color: var(--amber);
  background: #fff;
}

.pool-list {
  max-height: 330px;
  overflow-y: auto;
}

.person-card.search-match,
.public-person-card.search-match {
  border-color: #d18a00;
  background: #fff8d8;
  box-shadow: 0 0 0 3px rgba(209, 138, 0, 0.2);
}

.schedule-searching .person-card:not(.search-match),
.public-schedule-searching .public-person-card:not(.search-match) {
  opacity: 0.3;
}

.color-field input[type="color"] {
  width: 100%;
  height: 46px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.project-dialog-actions {
  align-items: center;
}

.dialog-action-spacer {
  flex: 1;
}

.warning-message {
  color: #755018;
  background: var(--amber-pale);
}

.public-schedule-header {
  min-height: 66px;
  padding: 10px max(18px, calc((100% - 1500px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.public-schedule-main {
  max-width: 1500px;
}

.public-schedule-search {
  width: min(340px, 100%);
}

.public-stats {
  grid-template-columns: repeat(4, minmax(100px, 150px)) minmax(180px, 1fr);
}

.public-project-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 15px;
}

.public-project-column {
  border-top: 5px solid var(--project-color, var(--teal));
}

.public-project-header {
  min-height: 80px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--project-color, var(--teal)) 8%, #ffffff);
}

.public-project-header > div {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.public-project-header .project-shift {
  flex: 0 0 auto;
  margin: 1px 0 0;
}

.public-lane {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.public-lane:last-child {
  border-bottom: 0;
}

.public-lane-title {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.public-person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 8px;
}

.public-person-card {
  min-height: 58px;
  padding: 9px 10px;
}

.public-person-card.leader-card {
  --card-accent: #2f6da1;
}

.public-person-card.rest-card {
  --card-accent: var(--amber);
}

.public-person-card.unassigned-card {
  --card-accent: var(--red);
}

.public-lane-empty {
  min-height: 48px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--soft-muted);
  font-size: 12px;
}

.public-pool-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 15px;
}

.public-pool-grid .public-person-grid {
  padding: 12px;
}

.public-schedule-footer {
  padding-bottom: 22px;
}

@media (max-width: 1100px) {
  .schedule-heading,
  .public-schedule-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .schedule-stats,
  .public-stats {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }

  .schedule-search-meta {
    grid-column: 1 / -1;
    text-align: left;
  }

  .schedule-workspace {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 760px) {
  .schedule-main,
  .public-schedule-main {
    padding: 20px 14px 30px;
  }

  .schedule-heading,
  .public-schedule-heading {
    margin-bottom: 16px;
  }

  .schedule-heading h1,
  .public-schedule-heading h1 {
    font-size: 25px;
  }

  .schedule-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .schedule-toolbar .compact-date,
  .schedule-toolbar .schedule-search {
    width: 100%;
    grid-column: 1 / -1;
  }

  .schedule-toolbar .primary-button,
  .schedule-toolbar .secondary-button {
    width: 100%;
    padding-inline: 10px;
  }

  .schedule-stats,
  .public-stats {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .schedule-stats > div {
    min-height: 42px;
    justify-content: space-between;
  }

  .schedule-workspace {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .board-scroll-region {
    width: 100%;
    max-width: 100%;
  }

  .schedule-pools {
    position: static;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .pool-list {
    max-height: 270px;
  }

  .project-board-shell {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .project-board {
    min-height: 0;
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .public-schedule-search {
    width: 100%;
  }

  .public-project-board,
  .public-pool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 470px) {
  .schedule-pools {
    grid-template-columns: 1fr;
  }

  .project-column-header {
    min-height: 78px;
  }

  .public-schedule-header {
    padding-inline: 12px;
  }

  .employee-header .brand strong,
  .public-schedule-header .brand strong {
    max-width: 170px;
    font-size: 13px;
    white-space: normal;
  }

  .employee-header .brand small,
  .public-schedule-header .brand small {
    display: none;
  }

  .employee-header .brand-icon,
  .public-schedule-header .brand-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .public-person-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .project-dialog-actions .dialog-action-spacer {
    display: none;
  }

  .project-dialog-actions #deleteProjectButton {
    grid-column: 1 / -1;
  }
}

/* Borrow review, team directory, and audit log */

.borrow-review-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.count-badge {
  min-width: 48px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.borrow-review-list {
  display: grid;
  gap: 10px;
}

.borrow-review-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #8b5c2f;
  border-radius: 8px;
  background: #fff;
}

.borrow-review-heading,
.borrow-review-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.borrow-review-heading > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin-right: auto;
}

.borrow-review-heading small,
.borrow-review-footer > small {
  color: var(--muted);
  font-size: 12px;
}

.borrow-team-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #71451d;
  background: #f5eadc;
}

.borrow-review-fields {
  display: grid;
  grid-template-columns: 100px 120px minmax(180px, 1fr) minmax(220px, 1.3fr);
  gap: 8px;
  margin-top: 12px;
}

.borrow-review-fields .field {
  gap: 4px;
}

.borrow-review-fields .field > span {
  font-size: 11px;
}

.borrow-review-fields input {
  min-height: 38px;
  padding: 7px 9px;
}

.borrow-review-footer {
  justify-content: space-between;
  margin-top: 12px;
}

.borrow-review-footer > div {
  display: flex;
  gap: 8px;
}

.compact-empty-state {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
}

.settings-list-dialog {
  width: min(900px, calc(100vw - 32px));
}

.settings-record-list {
  max-height: min(58vh, 620px);
  display: grid;
  gap: 8px;
  overflow: auto;
}

.settings-record {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 96px minmax(150px, auto) auto;
  align-items: end;
  gap: 10px;
  padding: 12px 12px 26px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settings-color-mark {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--item-color);
}

.settings-record .field {
  gap: 4px;
}

.settings-record .field > span {
  font-size: 11px;
}

.settings-record-time {
  position: absolute;
  left: 16px;
  bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.compact-toggle {
  min-height: 42px;
  padding: 7px 10px;
}

.compact-toggle small {
  font-size: 10px;
}

.inline-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 96px auto;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.color-field input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
}

.audit-log-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
}

.audit-log-dialog .dialog-content {
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.audit-filter-bar {
  display: grid;
  grid-template-columns: 150px 150px 180px minmax(200px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.audit-filter-bar .field {
  gap: 4px;
}

.audit-filter-bar .field > span {
  font-size: 11px;
}

.audit-category-tabs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.audit-category-tabs button {
  min-height: 54px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}

.audit-category-tabs button:hover,
.audit-category-tabs button.active {
  color: var(--teal-dark);
  border-color: #acd5cf;
  background: var(--teal-pale);
}

.audit-category-tabs strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.audit-log-summary {
  display: flex;
  justify-content: space-between;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.audit-log-list {
  max-height: min(62vh, 680px);
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.audit-load-more {
  width: 100%;
  margin-top: 10px;
}

.audit-log-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.audit-log-item.category-employee {
  border-left: 4px solid var(--green);
}

.audit-log-item.category-leader {
  border-left: 4px solid #2f6da1;
}

.audit-log-item.category-admin {
  border-left: 4px solid var(--amber);
}

.audit-log-item.category-system {
  border-left: 4px solid var(--soft-muted);
}

.audit-log-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--teal);
  background: var(--teal-pale);
}

.audit-log-main {
  min-width: 0;
}

.audit-log-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.audit-log-heading time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.audit-log-heading > strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.audit-category-badge {
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-size: 10px;
}

.audit-log-main > p {
  margin: 4px 0 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.audit-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 11px;
}

.audit-log-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.audit-log-meta svg {
  width: 13px;
  height: 13px;
}

.audit-log-main details {
  margin-top: 9px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.audit-log-main summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.audit-change-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.audit-change-grid section {
  min-width: 0;
  padding: 9px;
  border-radius: 6px;
  background: var(--soft);
}

.audit-change-grid pre {
  max-height: 180px;
  margin: 6px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 11px;
}

@media (max-width: 980px) {
  .audit-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-category-tabs {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
  }

  .audit-search-field {
    grid-column: 1 / -1;
  }

  .borrow-review-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-record {
    grid-template-columns: minmax(160px, 1fr) 90px auto;
  }

  .settings-record .compact-toggle {
    grid-column: 1 / 3;
  }
}

@media (max-width: 680px) {
  .report-editor-dialog,
  .settings-list-dialog,
  .audit-log-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .borrow-review-heading {
    align-items: flex-start;
  }

  .borrow-review-heading .work-status {
    font-size: 10px;
  }

  .borrow-review-fields,
  .settings-record,
  .inline-create-form,
  .audit-filter-bar,
  .audit-change-grid {
    grid-template-columns: 1fr;
  }

  .borrow-review-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .borrow-review-footer > div,
  .borrow-review-footer button {
    width: 100%;
  }

  .settings-record .compact-toggle,
  .audit-search-field {
    grid-column: auto;
  }

  .audit-filter-bar button {
    width: 100%;
  }

  .audit-log-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .audit-log-icon {
    width: 30px;
    height: 30px;
  }

  .audit-log-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 760px) {
  .hours-admin-body .manual-hours-main .dashboard-heading,
  .hours-admin-body .manual-hours-main .dashboard-heading > div:first-child,
  .hours-admin-body .matrix-toolbar,
  .hours-admin-body .matrix-toolbar > div:first-child {
    min-width: 0;
    max-width: 100%;
  }

  .hours-admin-body .manual-hours-main .dashboard-heading h1,
  .hours-admin-body .matrix-toolbar h2 {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .hours-admin-body .work-view-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .hours-admin-body .work-view-tabs button {
    min-width: 0;
    min-height: 62px;
    padding: 7px 4px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }
}

/* Manual employee work reports */
.work-report-body {
  min-height: 100vh;
  background: #edf3f2;
}

.employee-work-layout {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 24px 28px;
}

.employee-work-layout .employee-header {
  min-height: 74px;
}

.employee-work-surface {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(31, 48, 53, 0.08);
}

.employee-work-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.employee-work-heading .subtle-text {
  margin: 8px 0 0;
}

.server-clock {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 126px;
}

.server-clock strong {
  font-size: 18px;
}

.server-clock span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.work-identity-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 24px 0;
}

.work-identity-form .primary-button {
  min-width: 144px;
}

.employee-report-editor {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.employee-identity-strip {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(160px, auto) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.identity-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-pale);
}

.employee-identity-strip > span:nth-child(2),
.assignment-summary {
  display: grid;
  gap: 3px;
}

.employee-identity-strip small,
.assignment-summary small {
  color: var(--muted);
  font-size: 12px;
}

.assignment-summary {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.info-message {
  color: #2f648e;
  border-color: #b8d3e5;
  background: #edf6fb;
}

.work-status {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.work-status.matched {
  color: var(--green);
  border-color: #b9ddc9;
  background: var(--green-pale);
}

.work-status.approved {
  color: #2f648e;
  border-color: #bed5e5;
  background: #eaf2f8;
}

.work-status.employee_less {
  color: var(--red);
  border-color: #ecc1bd;
  background: var(--red-pale);
}

.work-status.employee_more,
.work-status.pending_admin {
  color: var(--amber);
  border-color: #ead09e;
  background: var(--amber-pale);
}

.work-status.pending_employee {
  color: #a95b00;
  border-color: #efc982;
  background: #fff2d8;
}

.work-status.both_missing {
  color: #5d6870;
  border-color: #cfd7db;
  background: #eef2f3;
}

.work-status.pending_leader {
  color: #2f648e;
  border-color: #bed5e5;
  background: #eaf2f8;
}

.work-status.allocation_mismatch {
  color: #76529b;
  border-color: #d8c5e7;
  background: #f4edf9;
}

.work-status.unassigned {
  color: var(--muted);
  border-color: #cfd9dc;
  background: #f3f6f7;
}

.work-status.unassigned_activity {
  color: #76529b;
  border-color: #d8c5e7;
  background: #f4edf9;
}

.work-status.rest {
  color: var(--muted);
  border-color: var(--line);
  background: var(--soft);
}

.status-explanation {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.status-explanation span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-explanation strong {
  color: var(--ink);
}

.status-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.status-swatch.matched {
  background: var(--green-pale);
  border: 1px solid #86c6a4;
}

.status-swatch.approved {
  background: #eaf2f8;
  border: 1px solid #92b9d4;
}

.status-swatch.both-missing {
  background: #eef2f3;
  border: 1px solid #aebbc0;
}

.status-swatch.pending {
  background: var(--amber-pale);
  border: 1px solid #d9ac58;
}

.report-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 12px;
}

.report-section-heading .subtle-text {
  margin: 5px 0 0;
}

.entry-add-actions {
  display: flex;
  gap: 8px;
}

.employee-entry-list {
  display: grid;
  gap: 10px;
}

.employee-entry-row {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #fff;
}

.employee-entry-row.borrowed-entry {
  border-left-color: var(--amber);
}

.entry-row-heading {
  min-height: 42px;
  padding: 6px 8px 6px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.entry-type-mark {
  color: var(--teal);
  display: inline-flex;
}

.borrowed-entry .entry-type-mark {
  color: var(--amber);
}

.entry-row-heading .entry-title {
  flex: 1;
  font-size: 14px;
}

.entry-fields {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.4fr)
    minmax(180px, 1fr)
    minmax(92px, 0.55fr)
    minmax(180px, 1.2fr);
  gap: 10px;
  padding: 14px;
}

.entry-fields .field {
  gap: 5px;
}

.entry-fields .field > span {
  font-size: 12px;
}

.entry-fields .note-field {
  min-width: 0;
}

.borrowed-entry .entry-fields {
  grid-template-columns:
    minmax(180px, 1.15fr)
    minmax(180px, 1fr)
    minmax(170px, 1fr)
    minmax(92px, 0.55fr)
    minmax(170px, 1fr);
}

.work-empty-state {
  min-height: 128px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.work-empty-state svg {
  color: var(--soft-muted);
}

.work-empty-state strong {
  color: var(--ink);
}

.work-empty-state span {
  font-size: 13px;
}

.employee-report-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.report-total {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.report-total span {
  color: var(--muted);
  font-size: 12px;
}

.report-total strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.report-total small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.employee-report-result {
  padding: 44px 0 14px;
  text-align: center;
}

.employee-report-result > .work-status {
  margin: 14px 0 22px;
}

.compact-result-details {
  max-width: 760px;
  margin: 0 auto;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.result-actions a {
  text-decoration: none;
}

@media (max-width: 900px) {
  .entry-fields,
  .borrowed-entry .entry-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry-fields .note-field {
    grid-column: 1 / -1;
  }

  .employee-identity-strip {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .assignment-summary {
    grid-column: 2;
    padding: 0;
    border: 0;
  }

  .employee-identity-strip .work-status {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 680px) {
  .employee-work-layout {
    padding: 0 0 20px;
  }

  .employee-work-layout .employee-header {
    padding: 12px 14px;
  }

  .employee-work-layout .employee-header .brand strong {
    max-width: 175px;
    font-size: 13px;
  }

  .employee-work-layout .employee-header .brand small {
    display: none;
  }

  .employee-work-surface {
    padding: 20px 14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .employee-work-heading {
    gap: 12px;
  }

  .employee-work-heading h1 {
    font-size: 23px;
  }

  .employee-work-heading .subtle-text {
    font-size: 12px;
  }

  .server-clock {
    min-width: 92px;
  }

  .server-clock strong {
    font-size: 14px;
  }

  .server-clock span {
    font-size: 12px;
  }

  .work-identity-form {
    grid-template-columns: 1fr;
  }

  .work-identity-form .primary-button {
    width: 100%;
  }

  .employee-identity-strip {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .assignment-summary {
    grid-column: 2;
  }

  .employee-identity-strip .work-status {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
  }

  .report-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-add-actions {
    width: 100%;
  }

  .entry-add-actions button {
    flex: 1;
    min-width: 0;
  }

  .entry-fields,
  .borrowed-entry .entry-fields {
    grid-template-columns: 1fr;
  }

  .entry-fields .note-field {
    grid-column: auto;
  }

  .employee-report-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .report-total {
    justify-items: start;
  }

  .employee-report-footer .primary-button,
  .result-actions > * {
    width: 100%;
  }

  .result-actions {
    flex-direction: column;
  }
}

/* Admin manual reconciliation */
.manual-hours-main {
  max-width: 1560px;
}

.manual-metrics-grid {
  grid-template-columns: repeat(9, minmax(105px, 1fr));
}

.manual-records-section {
  margin-top: 16px;
}

.manual-workday-table {
  min-width: 1120px;
}

.manual-workday-table .workday-row td:first-child {
  box-shadow: inset 4px 0 0 transparent;
}

.manual-workday-table .workday-row.status-matched td:first-child {
  box-shadow: inset 4px 0 0 var(--green);
}

.manual-workday-table .workday-row.status-employee_less td:first-child {
  box-shadow: inset 4px 0 0 var(--red);
}

.manual-workday-table .workday-row.status-pending_employee td:first-child,
.manual-workday-table .workday-row.status-employee_more td:first-child,
.manual-workday-table .workday-row.status-pending_admin td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

.manual-workday-table .workday-row.status-both_missing td:first-child {
  box-shadow: inset 4px 0 0 #8b989e;
}

.manual-workday-table .workday-row.status-pending_leader td:first-child {
  box-shadow: inset 4px 0 0 #2f6da1;
}

.manual-workday-table .workday-row.status-allocation_mismatch td:first-child {
  box-shadow: inset 4px 0 0 #76529b;
}

.manual-workday-table .workday-row.status-unassigned_activity td:first-child {
  box-shadow: inset 4px 0 0 #76529b;
}

.manual-workday-table .workday-row.status-unassigned {
  background: #f7f9f9;
}

.manual-workday-table th:nth-child(1) {
  width: 190px;
}

.manual-workday-table th:nth-child(2) {
  min-width: 250px;
}

.manual-workday-table th:nth-child(3),
.manual-workday-table th:nth-child(4) {
  width: 130px;
}

.manual-workday-table th:nth-child(5) {
  width: 105px;
}

.manual-workday-table th:nth-child(6) {
  width: 125px;
}

.manual-workday-table th:nth-child(7) {
  width: 170px;
}

.manual-workday-table .worker-identity {
  display: grid;
  gap: 3px;
  padding-left: 9px;
  border-left: 4px solid var(--job-accent, var(--teal));
}

.manual-workday-table .worker-identity[data-job-type="工地主任"],
.manual-workday-table .worker-identity[data-job-type="领班"],
.manual-workday-table .worker-identity[data-job-type="跑料"],
.manual-workday-table .worker-identity[data-job-type="安全员"],
.manual-workday-table .worker-identity[data-job-type="文员"],
.manual-workday-table .worker-identity[data-job-type="后勤"] {
  --job-accent: #0070c0;
  --job-text: #005a9c;
  --job-muted: #4a718b;
}

.manual-workday-table .worker-identity[data-job-type="装配工"] {
  --job-accent: #00b050;
  --job-text: #007d39;
  --job-muted: #47745a;
}

.manual-workday-table .worker-identity[data-job-type="电焊工"] {
  --job-accent: #e12a2a;
  --job-text: #a40d0d;
  --job-muted: #8b5454;
}

.manual-workday-table
  .worker-identity:is(
    [data-job-type="打磨工"],
    [data-job-type="辅助工"]
  ) {
  --job-accent: #c6a900;
  --job-text: #403900;
  --job-muted: #6f6400;
}

.manual-workday-table .worker-identity strong {
  color: var(--job-text, var(--ink));
}

.manual-workday-table .worker-identity small {
  color: var(--job-muted, var(--muted));
  font-size: 12px;
}

.table-main-text,
.table-subtext {
  display: block;
}

.table-subtext {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.difference-value {
  color: var(--muted);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.difference-value.bad {
  color: var(--red);
}

.difference-value.warn {
  color: var(--amber);
}

.project-summary-table {
  min-width: 980px;
}

.project-summary-table th:first-child {
  min-width: 240px;
}

.report-editor-dialog {
  width: min(1480px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 24px);
}

.report-editor-dialog .dialog-content {
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.report-editor-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.report-source-section {
  min-width: 0;
}

.report-source-section + .report-source-section {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.report-source-section .section-heading-row {
  min-height: 54px;
  align-items: center;
}

.report-source-section h3,
.project-detail-section h3 {
  margin: 0;
  font-size: 16px;
}

.report-source-section .subtle-text {
  margin: 3px 0 0;
  font-size: 12px;
}

.admin-report-entry-list {
  display: grid;
  gap: 10px;
}

.admin-report-entry {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #fff;
}

#leaderReportEntries .admin-report-entry {
  border-left-color: #2f6da1;
}

.admin-entry-main {
  display: grid;
  grid-template-columns:
    minmax(100px, 0.7fr)
    minmax(150px, 1.2fr)
    minmax(140px, 1fr)
    minmax(84px, 0.55fr)
    minmax(78px, 0.5fr)
    38px;
  align-items: end;
  gap: 8px;
}

.admin-entry-extra {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(180px, 1.4fr);
  gap: 8px;
  margin-top: 8px;
}

.admin-entry-main .field,
.admin-entry-extra .field {
  gap: 4px;
}

.admin-entry-main .field > span,
.admin-entry-extra .field > span {
  font-size: 11px;
}

.admin-entry-main input,
.admin-entry-main select,
.admin-entry-extra input,
.admin-entry-extra select {
  min-height: 38px;
  padding: 7px 8px;
}

.manual-comparison-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.manual-comparison-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.manual-comparison-grid > div:last-child {
  border-right: 0;
}

.manual-comparison-grid dt {
  color: var(--muted);
  font-size: 11px;
}

.manual-comparison-grid dd {
  margin: 5px 0 0;
  font-weight: 800;
}

.final-reconciliation-section {
  margin: 22px 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.final-reconciliation-section h3 {
  margin: 0;
  font-size: 18px;
}

.final-reconciliation-section .subtle-text {
  margin: 4px 0 0;
}

.reconciliation-column-headings,
.reconciliation-item {
  display: grid;
  grid-template-columns:
    minmax(180px, 1.35fr)
    minmax(105px, 0.65fr)
    minmax(125px, 0.8fr)
    minmax(135px, 0.85fr)
    minmax(150px, 0.9fr)
    minmax(210px, 1.4fr);
  gap: 12px;
  align-items: center;
}

.reconciliation-column-headings {
  padding: 9px 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.reconciliation-item-list {
  display: grid;
  gap: 9px;
}

.reconciliation-item {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 6px;
  background: #fff;
}

.reconciliation-item.status-matched {
  border-left-color: var(--green);
  background: #fbfefc;
}

.reconciliation-item.status-employee_less,
.reconciliation-item.status-employee_more {
  border-left-color: var(--red);
  background: #fffafa;
}

.reconciliation-item.status-allocation_mismatch {
  border-left-color: #76529b;
  background: #fdfbff;
}

.final-item-identity,
.final-source-value,
.final-item-state,
.final-item-resolution,
.final-item-note-field {
  min-width: 0;
}

.final-item-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.final-item-identity > span:last-child,
.final-source-value,
.final-item-state {
  display: grid;
  gap: 4px;
}

.final-item-identity small,
.final-source-value small,
.final-item-state small,
.final-source-value span {
  color: var(--muted);
  font-size: 11px;
}

.final-source-value span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-item-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  flex: 0 0 34px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 6px;
}

.final-item-resolution {
  display: grid;
  gap: 5px;
}

.final-item-resolution input {
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-weight: 800;
}

.final-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiet-text-button {
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.quiet-text-button:hover {
  text-decoration: underline;
}

.final-item-note-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.final-item-note-field textarea {
  min-height: 58px;
  resize: vertical;
  padding: 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.final-item-note-field.required-note > span {
  color: var(--red);
  font-weight: 800;
}

.final-item-note-field.required-note textarea {
  border-color: #d9a09b;
  background: #fffafa;
}

.editor-dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: end;
}

.final-approval-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.final-approval-control > span {
  display: grid;
  min-width: 128px;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.final-approval-control strong {
  color: var(--ink);
  font-size: 16px;
}

.project-detail-dialog {
  width: min(1460px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 24px);
}

.project-detail-dialog .dialog-content {
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.project-detail-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.project-detail-metrics > div {
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.project-detail-metrics > div:last-child {
  border-right: 0;
}

.project-detail-metrics dt {
  color: var(--muted);
  font-size: 11px;
}

.project-detail-metrics dd {
  margin: 5px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.project-detail-section + .project-detail-section {
  margin-top: 24px;
}

.project-detail-section h3 {
  margin-bottom: 10px;
}

.project-person-detail-table {
  min-width: 1320px;
}

.project-daily-row.date-band-even td,
.project-person-row.date-band-even td {
  background: #f7fbfb;
}

.project-daily-row.date-band-odd td,
.project-person-row.date-band-odd td {
  background: #fff;
}

.project-person-row.project-date-start td {
  border-top: 3px solid #aacbc8;
}

.detail-date-chip {
  min-width: 76px;
  display: grid;
  gap: 2px;
  color: var(--ink);
}

.detail-date-chip strong {
  font-size: 13px;
}

.detail-date-chip small,
.detail-date-repeat {
  color: var(--muted);
  font-size: 11px;
}

.job-type-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 8px;
  border-left: 4px solid var(--job-accent);
  color: var(--job-text);
  background: var(--job-background);
  font-weight: 750;
}

.job-supervision {
  --job-accent: #2474a8;
  --job-text: #15577f;
  --job-background: #eef6fb;
}

.job-assembly {
  --job-accent: #169d52;
  --job-text: #08743a;
  --job-background: #edf9f2;
}

.job-welding {
  --job-accent: #dc3b36;
  --job-text: #a8221e;
  --job-background: #fff1f0;
}

.job-finishing {
  --job-accent: #b69b00;
  --job-text: #5b5000;
  --job-background: #fff8b8;
}

.job-other {
  --job-accent: #6e7d80;
  --job-text: #435256;
  --job-background: #f2f5f5;
}

.matrix-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.matrix-toolbar h2 {
  margin: 4px 0 0;
}

.matrix-toolbar .subtle-text {
  margin: 6px 0 0;
}

.matrix-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.matrix-search {
  width: min(270px, 100%);
}

.matrix-metrics {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.matrix-metrics > div {
  min-width: 0;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
}

.matrix-metrics > div:last-child {
  border-right: 0;
}

.matrix-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.matrix-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
}

.matrix-legend {
  margin: 14px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.matrix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.matrix-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-strong);
}

.matrix-swatch.confirmed {
  background: #e7f5ec;
}

.matrix-swatch.rest {
  background: #edf1f1;
}

.matrix-swatch.unassigned {
  background: #fff;
}

.matrix-swatch.pending {
  background: #fff1d9;
}

.matrix-swatch.pending-missing {
  background: #eef2f3;
}

.monthly-matrix-shell {
  max-height: calc(100vh - 315px);
  min-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.monthly-matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.monthly-matrix-table th,
.monthly-matrix-table td {
  min-width: 62px;
  height: 40px;
  padding: 7px 8px;
  border-right: 1px solid #e6ebec;
  border-bottom: 1px solid #e1e7e8;
  text-align: center;
  white-space: nowrap;
}

.monthly-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  color: #fff;
  background: #176c68;
}

.monthly-matrix-table .matrix-day-heading {
  min-width: 64px;
}

.monthly-matrix-table .matrix-day-heading strong,
.monthly-matrix-table .matrix-day-heading small {
  display: block;
}

.monthly-matrix-table .matrix-day-heading small {
  margin-top: 2px;
  color: #d8eeec;
  font-size: 10px;
}

.monthly-matrix-table .matrix-sticky {
  position: sticky;
  z-index: 3;
  background: #fff;
}

.monthly-matrix-table thead .matrix-sticky {
  z-index: 7;
  background: #176c68;
}

.monthly-matrix-table .matrix-sequence {
  left: 0;
  min-width: 56px;
  width: 56px;
}

.monthly-matrix-table .matrix-code {
  left: 56px;
  min-width: 88px;
  width: 88px;
}

.monthly-matrix-table .matrix-name {
  left: 144px;
  min-width: 112px;
  width: 112px;
  text-align: left;
}

.monthly-matrix-table .matrix-job {
  left: 256px;
  min-width: 106px;
  width: 106px;
  text-align: left;
  box-shadow: 4px 0 7px -6px #46585b;
}

.monthly-matrix-table .matrix-job-label {
  padding-left: 7px;
  border-left: 4px solid var(--job-accent);
  color: var(--job-text);
  font-weight: 750;
}

.monthly-matrix-table .matrix-day-cell.confirmed {
  color: #155f3a;
  background: #edf8f1;
  font-weight: 750;
}

.monthly-matrix-table .matrix-day-cell.rest {
  color: #536164;
  background: #edf1f1;
}

.monthly-matrix-table .matrix-day-cell.unassigned {
  color: #94a0a2;
  background: #fff;
}

.monthly-matrix-table .matrix-day-cell.pending {
  color: #9a5a0b;
  background: #fff1d9;
  font-weight: 800;
}

.monthly-matrix-table .matrix-day-cell.pending-missing {
  color: #5d6870;
  background: #eef2f3;
  font-weight: 800;
}

.monthly-matrix-table .matrix-total-cell {
  color: #15577f;
  background: #eef6fb;
}

.monthly-matrix-table .matrix-pending-count {
  color: #a33a35;
  background: #fce8e6;
  font-weight: 800;
}

.monthly-matrix-table .matrix-job-divider th {
  height: 34px;
  padding: 6px 12px;
  border-left: 5px solid var(--job-accent);
  color: var(--job-text);
  background: var(--job-background);
  text-align: left;
}

.monthly-matrix-table .matrix-job-divider small {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 500;
}

.monthly-matrix-table tfoot th,
.monthly-matrix-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
  color: #154f4b;
  background: #dcefed;
  font-weight: 800;
}

@media (max-width: 1400px) {
  .report-editor-columns {
    grid-template-columns: 1fr;
  }

  .report-source-section + .report-source-section {
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 1180px) {
  .manual-metrics-grid {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .report-editor-columns {
    grid-template-columns: 1fr;
  }

  .report-source-section + .report-source-section {
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .reconciliation-column-headings {
    display: none;
  }

  .reconciliation-item {
    grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(130px, 0.8fr));
    align-items: start;
  }

  .final-item-state,
  .final-item-resolution,
  .final-item-note-field {
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .manual-comparison-grid,
  .project-detail-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .manual-comparison-grid > div:nth-child(3n),
  .project-detail-metrics > div:nth-child(3n) {
    border-right: 0;
  }

  .manual-comparison-grid > div:nth-child(-n + 3),
  .project-detail-metrics > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .matrix-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .matrix-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .manual-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-entry-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-entry-main .remove-admin-entry {
    justify-self: end;
  }

  .admin-entry-extra {
    grid-template-columns: 1fr;
  }

  .reconciliation-item {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .final-item-identity,
  .final-item-state,
  .final-item-note-field {
    grid-column: 1 / -1;
  }

  .manual-comparison-grid,
  .project-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manual-comparison-grid > div:nth-child(3n),
  .project-detail-metrics > div:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .manual-comparison-grid > div:nth-child(2n),
  .project-detail-metrics > div:nth-child(2n) {
    border-right: 0;
  }

  .manual-comparison-grid > div:nth-child(-n + 4),
  .project-detail-metrics > div:nth-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .editor-dialog-actions {
    grid-template-columns: 1fr 1fr;
  }

  .final-approval-control {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog-action-spacer {
    display: none;
  }

  .matrix-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .matrix-actions > *,
  .matrix-search {
    width: 100%;
  }

  .matrix-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matrix-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .matrix-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .monthly-matrix-shell {
    max-height: calc(100vh - 280px);
  }
}

@media (max-width: 520px) {
  .admin-entry-main {
    grid-template-columns: 1fr;
  }

  .admin-entry-main .remove-admin-entry {
    justify-self: end;
  }

  .reconciliation-item {
    grid-template-columns: 1fr;
  }

  .final-item-identity,
  .final-item-state,
  .final-item-note-field {
    grid-column: auto;
  }

  .final-source-value,
  .final-item-state,
  .final-item-resolution,
  .final-item-note-field {
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .manual-comparison-grid,
  .project-detail-metrics {
    grid-template-columns: 1fr;
  }

  .manual-comparison-grid > div,
  .project-detail-metrics > div {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
  }

  .manual-comparison-grid > div:last-child,
  .project-detail-metrics > div:last-child {
    border-bottom: 0;
  }

  .final-approval-control,
  .editor-dialog-actions {
    grid-template-columns: 1fr;
  }

  .editor-dialog-actions > button {
    width: 100%;
  }
}

/* People administration */
.people-admin-main {
  max-width: 1380px;
}

.people-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.people-metrics > div {
  padding: 15px 17px;
  border-right: 1px solid var(--line);
}

.people-metrics > div:last-child {
  border-right: 0;
}

.people-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.people-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 23px;
}

.people-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.people-table {
  min-width: 880px;
}

.people-table tr {
  --job-accent: var(--teal);
  --job-text: var(--ink);
}

.people-table tr[data-job-type="工地主任"],
.people-table tr[data-job-type="领班"],
.people-table tr[data-job-type="跑料"],
.people-table tr[data-job-type="安全员"],
.people-table tr[data-job-type="文员"],
.people-table tr[data-job-type="后勤"] {
  --job-accent: #0070c0;
  --job-text: #005a9c;
}

.people-table tr[data-job-type="装配工"] {
  --job-accent: #00b050;
  --job-text: #007d39;
}

.people-table tr[data-job-type="电焊工"] {
  --job-accent: #e12a2a;
  --job-text: #a40d0d;
}

.people-table tr:is(
    [data-job-type="打磨工"],
    [data-job-type="辅助工"]
  ) {
  --job-accent: #c6a900;
  --job-text: #403900;
}

.job-type-label {
  padding-left: 8px;
  border-left: 4px solid var(--job-accent);
  color: var(--job-text);
  font-weight: 700;
}

.employee-state {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.employee-state.active {
  color: var(--green);
  background: var(--green-pale);
}

.employee-state.inactive {
  color: var(--muted);
  background: var(--soft);
}

.employee-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.employee-active-field {
  align-self: end;
  min-height: 74px;
}

.employee-schedule-fieldset {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.employee-schedule-fieldset legend {
  padding: 0 7px;
  font-weight: 800;
}

.employee-schedule-fieldset > .field {
  margin-bottom: 12px;
}

.detail-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 680px) {
  .people-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .people-metrics > div:nth-child(2) {
    border-right: 1px solid var(--line);
  }

  .people-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Leader manual report workspace */
.leader-report-main {
  max-width: 1540px;
}

.login-intro {
  margin: 8px 0 18px;
  line-height: 1.6;
}

.leader-report-actions {
  flex-wrap: wrap;
}

.leader-report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
}

.leader-report-toolbar .search-field {
  flex: 0 0 260px;
}

.leader-report-projects {
  display: grid;
  gap: 16px;
}

.leader-report-project {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.leader-project-heading {
  min-height: 70px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto minmax(240px, auto);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.project-heading-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  background: var(--teal-pale);
}

.project-heading-icon.borrowed {
  color: var(--amber);
  background: var(--amber-pale);
}

.leader-project-title,
.leader-project-total {
  display: grid;
  gap: 3px;
}

.leader-project-title strong {
  font-size: 17px;
}

.leader-project-title small,
.leader-project-total small {
  color: var(--muted);
  font-size: 12px;
}

.leader-project-total {
  min-width: 90px;
  padding-right: 14px;
  text-align: right;
}

.leader-project-total strong {
  font-variant-numeric: tabular-nums;
}

.add-worker-control {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 40px;
  align-items: center;
  gap: 6px;
}

.add-worker-control select,
.leader-report-table select,
.leader-report-table input {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.add-worker-control select:focus,
.leader-report-table select:focus,
.leader-report-table input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(8, 118, 111, 0.12);
}

.secondary-icon-button {
  border-color: var(--line-strong);
  background: #fff;
}

.leader-report-table {
  min-width: 920px;
}

.leader-report-table.borrowed-table {
  min-width: 1340px;
}

.leader-report-table th,
.leader-report-table td {
  padding: 10px 11px;
  vertical-align: middle;
}

.leader-report-table th:nth-child(1) {
  min-width: 150px;
}

.leader-report-table th:nth-child(2) {
  min-width: 130px;
}

.leader-report-table th:nth-child(3) {
  width: 128px;
}

.employee-report-context-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.employee-shift-tabs {
  min-height: 48px;
}

.employee-shift-tabs button {
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 1px;
}

.employee-shift-tabs button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.employee-shift-tabs button.active small {
  color: inherit;
}

.borrow-team-cards {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.borrow-team-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.borrow-team-heading,
.borrow-team-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  background: var(--soft);
}

.borrow-team-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.borrow-team-heading span span {
  display: grid;
  gap: 2px;
}

.borrow-team-heading small {
  color: var(--muted);
}

.external-team-color {
  width: 8px;
  height: 38px;
  border-radius: 4px;
  background: var(--team-color, var(--teal));
}

.borrow-paper-table {
  min-width: 1040px;
}

.borrow-paper-table input {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.borrow-paper-table .borrow-paper-hours {
  min-width: 92px;
}

.borrow-team-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.borrow-team-actions > span {
  margin-right: auto;
  color: var(--muted);
}

.table-action-group {
  display: inline-flex;
  gap: 6px;
}

@media (max-width: 760px) {
  .employee-report-context-controls {
    grid-template-columns: 1fr;
  }

  .borrow-team-heading,
  .borrow-team-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .borrow-team-actions > span {
    margin-right: 0;
  }

  .borrow-team-actions button {
    width: 100%;
  }
}

.leader-report-table .leader-row-hours {
  width: 118px;
  min-width: 118px;
  font-weight: 800;
  text-align: right;
}

.leader-report-table .leader-row-note {
  min-width: 150px;
}

.worker-identity {
  display: grid;
  gap: 3px;
  padding-left: 9px;
  border-left: 4px solid var(--job-accent, var(--teal));
}

.worker-identity strong {
  color: var(--job-text, var(--ink));
}

.worker-identity small {
  color: var(--job-muted, var(--muted));
  font-size: 12px;
}

.leader-worker-row[data-job-type="工地主任"],
.leader-worker-row[data-job-type="领班"],
.leader-worker-row[data-job-type="跑料"],
.leader-worker-row[data-job-type="安全员"],
.leader-worker-row[data-job-type="文员"],
.leader-worker-row[data-job-type="后勤"] {
  --job-accent: #0070c0;
  --job-text: #005a9c;
  --job-muted: #4a718b;
}

.leader-worker-row.leader-self-row td {
  background: #eef6fb;
  border-top: 2px solid #79a9cb;
  border-bottom-color: #c8dce9;
}

.leader-worker-row.leader-self-row .worker-identity {
  --job-accent: #0070c0;
  --job-text: #005a9c;
  --job-muted: #4a718b;
}

.leader-worker-row.leader-self-row .leader-row-hours {
  border-color: #79a9cb;
  background: #fff;
}

.leader-worker-row[data-job-type="装配工"] {
  --job-accent: #00b050;
  --job-text: #007d39;
  --job-muted: #47745a;
}

.leader-worker-row[data-job-type="电焊工"] {
  --job-accent: #e12a2a;
  --job-text: #a40d0d;
  --job-muted: #8b5454;
}

.leader-worker-row:is(
    [data-job-type="打磨工"],
    [data-job-type="辅助工"]
  ) {
  --job-accent: #c6a900;
  --job-text: #403900;
  --job-muted: #6f6400;
}

.employee-report-value {
  color: var(--teal-dark);
  font-weight: 800;
  white-space: nowrap;
}

.employee-report-value.missing {
  color: var(--muted);
  font-weight: 600;
}

.leader-row-difference {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leader-worker-row.search-hidden {
  display: none;
}

.leader-worker-row.search-highlight td {
  background: #fff8d5;
}

.leader-project-tabs button span {
  margin-left: 4px;
  color: inherit;
  opacity: 0.65;
}

@media (max-width: 900px) {
  .leader-report-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .leader-report-toolbar .search-field {
    flex-basis: auto;
    width: 100%;
  }

  .leader-project-heading {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .add-worker-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .leader-body .admin-header {
    flex-wrap: nowrap;
  }

  .leader-body .admin-header .brand {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .leader-body .admin-header .brand strong {
    max-width: 180px;
    white-space: normal;
  }

  .leader-body .admin-header .header-actions {
    width: auto;
    flex: 0 0 auto;
  }

  .leader-report-main {
    padding-right: 12px;
    padding-left: 12px;
  }

  .leader-report-main .dashboard-heading,
  .leader-report-main .dashboard-heading > div:first-child,
  .leader-report-main .dashboard-heading h1 {
    min-width: 0;
    max-width: 100%;
  }

  .leader-report-main .dashboard-heading h1 {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .leader-report-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .leader-report-actions > *,
  .leader-report-actions button,
  .leader-report-actions .compact-date,
  .leader-report-actions .compact-date input {
    min-width: 0;
    width: 100%;
  }

  .leader-report-actions button {
    padding-inline: 10px;
  }

  .leader-report-actions .compact-date,
  .leader-report-actions .primary-button {
    grid-column: 1 / -1;
  }

  .leader-report-toolbar,
  .leader-project-tabs {
    min-width: 0;
    max-width: 100%;
  }

  .leader-project-tabs {
    width: 100%;
    margin-block: 0;
  }

  .leader-project-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .leader-project-total {
    grid-column: 2;
    padding: 0;
    text-align: left;
  }

  .add-worker-control {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .leader-report-project .table-container {
    overflow: visible;
  }

  .leader-report-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .leader-report-table thead {
    display: none;
  }

  .leader-report-table tbody {
    display: grid;
  }

  .leader-report-table .leader-worker-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
  }

  .leader-report-table .leader-worker-row:last-child {
    border-bottom: 0;
  }

  .leader-report-table .leader-worker-row td {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .leader-report-table .leader-worker-row td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  .leader-report-table .leader-worker-row td:first-child,
  .leader-report-table .leader-worker-row td:nth-child(5) {
    grid-column: 1 / -1;
  }

  .leader-report-table .leader-worker-row td:first-child::before,
  .leader-report-table .leader-worker-row .action-column:empty {
    display: none;
  }

  .leader-report-table .leader-row-hours,
  .leader-report-table .leader-row-note {
    width: 100%;
    min-width: 0;
  }

  .leader-report-table .action-column:not(:empty) {
    align-content: end;
    justify-items: end;
  }
}

/* Work-hours administration */

.hours-admin-main,
.leader-main {
  width: min(100%, 1380px);
}

.work-view-tabs {
  margin: 22px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
}

.work-view-tabs button {
  min-height: 42px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.work-view-tabs button.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.work-view-tabs svg {
  width: 18px;
}

.hours-metrics-grid {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  overflow: hidden;
  background: #fff;
}

.hours-metrics-grid article {
  min-width: 0;
  min-height: 82px;
  padding: 15px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.hours-metrics-grid article:not(:last-child) {
  border-right: 1px solid var(--line);
}

.hours-metrics-grid small {
  color: var(--muted);
  white-space: nowrap;
}

.hours-metrics-grid strong {
  font-size: 25px;
  line-height: 1;
}

.hours-metrics-grid .good strong {
  color: var(--green);
}

.hours-metrics-grid .warn strong {
  color: var(--amber);
}

.hours-metrics-grid .bad strong {
  color: var(--red);
}

.workday-table {
  min-width: 1280px;
}

.workday-table th,
.workday-table td {
  padding-inline: 13px;
}

.workday-table .abnormal-row {
  background: #fffafa;
}

.punch-cell {
  min-width: 205px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
}

.punch-cell span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.punch-cell small,
.hours-unit,
.muted-cell {
  color: var(--muted);
  font-size: 11px;
}

.difference-cell {
  color: var(--red);
  font-weight: 800;
}

.status-badge.approved {
  color: #53626a;
  background: #e9eef1;
}

.summary-toolbar {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.summary-range-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.summary-section {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding-top: 18px;
  background: #fff;
}

.summary-section > .section-heading-row {
  padding: 0 18px 15px;
}

.summary-export-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.summary-table {
  min-width: 760px;
}

.wide-dialog {
  width: min(calc(100% - 32px), 1080px);
  max-height: 92vh;
}

.wide-dialog .dialog-content {
  max-height: 92vh;
  overflow-y: auto;
}

.workday-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 26px;
}

.workday-edit-grid h3 {
  margin: 0;
  font-size: 15px;
}

.punch-edit-list,
.allocation-edit-list {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.punch-edit-row {
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 138px 108px 36px;
  align-items: center;
  gap: 8px;
}

.punch-edit-row > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.punch-edit-row small {
  color: var(--muted);
  font-size: 11px;
}

.punch-edit-row input,
.allocation-edit-row input,
.allocation-edit-row select,
.leader-hours-input,
.leader-note-input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--ink);
  background: #fff;
}

.punch-edit-row input:focus,
.allocation-edit-row input:focus,
.allocation-edit-row select:focus,
.leader-hours-input:focus,
.leader-note-input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(8, 118, 111, 0.13);
}

.allocation-edit-row {
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 90px 36px;
  align-items: center;
  gap: 8px;
}

.allocation-total {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.allocation-total strong {
  color: var(--ink);
}

.workday-comparison {
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.workday-comparison > div {
  min-width: 0;
  padding: 12px;
}

.workday-comparison > div:not(:nth-child(4n)) {
  border-right: 1px solid var(--line);
}

.workday-comparison > div:nth-child(-n + 4) {
  border-bottom: 1px solid var(--line);
}

.workday-comparison dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.workday-comparison dd {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.comparison-rule {
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.split-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
}

.rule-settings-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.rule-fieldset,
.project-permission-fieldset {
  min-width: 0;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.rule-fieldset legend,
.project-permission-fieldset legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.rule-fieldset legend {
  display: flex;
  align-items: center;
  gap: 7px;
}

.rule-fieldset legend svg {
  width: 17px;
  color: var(--teal);
}

.rule-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.batch-rule-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
}

.employee-picker-section {
  min-width: 0;
}

.full-search {
  width: 100%;
}

.select-all-line {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.select-all-line input,
.employee-check-list input,
.project-check-list input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.select-all-line strong {
  margin-left: auto;
  color: var(--teal);
}

.employee-check-list {
  max-height: 390px;
  overflow-y: auto;
}

.employee-check-list label {
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.employee-check-list label > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.employee-check-list small {
  color: var(--muted);
  font-size: 11px;
}

.employee-check-list em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.batch-rule-fields {
  margin-top: 15px;
}

.batch-rule-fields > .field {
  margin-bottom: 12px;
}

.batch-note {
  margin-top: 16px;
}

.subtle-banner {
  border-left: 3px solid var(--teal);
  padding: 9px 12px;
  color: var(--muted);
  background: var(--teal-pale);
  font-size: 12px;
}

.project-check-list {
  max-height: 180px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.project-check-list label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
}

/* Foreman work entry */

.leader-login-button {
  margin-top: 18px;
}

.leader-project-tabs {
  margin: 22px 0 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.leader-project-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: #fff;
  font-weight: 750;
  white-space: nowrap;
}

.leader-project-tabs button.active {
  color: var(--teal-dark);
  border-color: #9bcac5;
  background: var(--teal-pale);
}

.leader-project-tabs span {
  margin-left: 4px;
  font-size: 11px;
}

.leader-project-list {
  display: grid;
  gap: 16px;
}

.leader-project-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.leader-project-section > header {
  min-height: 76px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.leader-project-section > header > div {
  min-width: 0;
}

.leader-project-section h2 {
  display: inline;
  margin-right: 7px;
}

.leader-project-section header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.project-code-label {
  margin-right: 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.project-hour-total {
  color: var(--teal-dark);
  white-space: nowrap;
}

.leader-hours-table {
  min-width: 970px;
}

.leader-hours-input {
  width: 92px;
}

.leader-note-input {
  width: 100%;
  min-width: 150px;
}

.leader-difference {
  font-weight: 750;
}

.leader-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--muted);
  text-align: center;
}

.leader-empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--soft-muted);
}

.leader-empty-state p {
  margin: 0;
  font-size: 13px;
}

.file-drop-field {
  min-height: 130px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--teal);
  background: var(--soft);
  cursor: pointer;
}

.file-drop-field > span {
  display: grid;
  gap: 4px;
}

.file-drop-field small {
  color: var(--muted);
}

.file-drop-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.import-issues {
  max-height: 210px;
  margin-top: 12px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.import-issues p {
  margin: 0;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  font-size: 12px;
}

.import-issues strong {
  color: var(--red);
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .personal-hours-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hours-lookup-form {
    width: 100%;
  }

  .hours-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hours-metrics-grid article {
    border-bottom: 1px solid var(--line);
  }

  .hours-metrics-grid article:nth-child(4n) {
    border-right: 0;
  }

  .workday-edit-grid,
  .batch-rule-layout {
    grid-template-columns: 1fr;
  }

  .employee-check-list {
    max-height: 260px;
  }
}

@media (max-width: 760px) {
  .personal-hours-layout {
    padding: 14px 10px 30px;
  }

  .personal-hours-surface {
    padding: 18px 12px;
  }

  .hours-lookup-form {
    grid-template-columns: 1fr 1fr;
  }

  .hours-lookup-form button {
    grid-column: 1 / -1;
  }

  .hours-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hours-summary-grid article:nth-child(2) {
    border-right: 0;
  }

  .hours-summary-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .calendar-cell {
    min-height: 78px;
    padding: 6px;
    gap: 5px;
  }

  .calendar-cell strong {
    font-size: 14px;
  }

  .calendar-cell small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .calendar-legend {
    display: none;
  }

  .day-hours-summary {
    grid-template-columns: 1fr 1fr;
  }

  .day-hours-summary > div:nth-child(2) {
    border-right: 0;
  }

  .day-hours-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .day-detail-columns {
    grid-template-columns: 1fr;
  }

  .hours-admin-main,
  .leader-main {
    padding-inline: 12px;
  }

  .hours-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hours-metrics-grid article:nth-child(2n) {
    border-right: 0;
  }

  .summary-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-range-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .summary-range-controls .compact-date {
    flex: 1 1 135px;
  }

  .summary-section > .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-export-actions {
    width: 100%;
    justify-content: stretch;
  }

  .summary-export-actions button {
    flex: 1 1 180px;
  }

  .wide-dialog {
    width: 100%;
    max-width: none;
    max-height: 100vh;
    margin: auto 0 0;
    border-radius: 8px 8px 0 0;
  }

  .wide-dialog .dialog-content {
    max-height: 94vh;
    padding: 18px 14px;
  }

  .punch-edit-row {
    grid-template-columns: minmax(0, 1fr) 94px 32px;
    gap: 6px;
    padding: 8px 0;
  }

  .punch-edit-row > span {
    grid-column: 1 / -1;
  }

  .workday-edit-grid .section-heading-row {
    align-items: flex-start;
    gap: 10px;
  }

  .workday-edit-grid .section-heading-row .subtle-text {
    max-width: 190px;
    font-size: 11px;
    line-height: 1.45;
    text-align: right;
    white-space: normal;
  }

  .punch-edit-row .punch-time {
    grid-column: 2;
  }

  .punch-edit-row .clear-punch,
  .allocation-edit-row .remove-allocation {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .allocation-edit-row {
    grid-template-columns: minmax(0, 1fr) 78px 32px;
    gap: 6px;
  }

  .workday-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workday-comparison > div:not(:nth-child(4n)) {
    border-right: 0;
  }

  .workday-comparison > div:not(:nth-child(2n)) {
    border-right: 1px solid var(--line);
  }

  .workday-comparison > div:nth-child(-n + 4) {
    border-bottom: 0;
  }

  .workday-comparison > div:nth-child(-n + 6) {
    border-bottom: 1px solid var(--line);
  }

  .workday-comparison > div:nth-child(2n) {
    border-right: 0;
  }

  .rule-settings-columns,
  .rule-time-grid {
    grid-template-columns: 1fr;
  }

  .split-actions {
    grid-template-columns: 1fr 1fr;
  }

  .split-actions > span {
    display: none;
  }

  .split-actions #approveDifference {
    grid-column: 1 / -1;
  }

  .project-check-list {
    grid-template-columns: 1fr;
  }

  .leader-main .dashboard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .leader-main .dashboard-actions .compact-date {
    grid-column: 1 / -1;
  }

  .leader-main .dashboard-actions .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 470px) {
  .punch-status-summary {
    grid-template-columns: 1fr 1fr;
  }

  .punch-status-summary span:last-child {
    grid-column: 1 / -1;
  }

  .punch-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 0;
  }

  .punch-progress li:nth-child(3)::before {
    display: none;
  }

  .personal-hours-body .employee-header .brand strong,
  .hours-admin-body .admin-header .brand strong,
  .leader-body .admin-header .brand strong {
    max-width: 145px;
    font-size: 12px;
  }

  .personal-hours-body .employee-header .brand small,
  .hours-admin-body .admin-header .brand small,
  .leader-body .admin-header .brand small {
    display: none;
  }

  .hours-lookup-form {
    grid-template-columns: 1fr;
  }

  .hours-lookup-form button {
    grid-column: auto;
  }

  .hours-period {
    font-size: 12px;
  }

  .hours-summary-grid strong {
    font-size: 23px;
  }

  .calendar-cell {
    min-height: 68px;
    padding: 5px 3px;
  }

  .calendar-cell small {
    display: none;
  }

  .calendar-cell strong {
    font-size: 13px;
  }

  .leader-main .dashboard-actions {
    grid-template-columns: 1fr;
  }

  .leader-main .dashboard-actions > * {
    grid-column: 1 !important;
    width: 100%;
  }
}
