: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);
}

/* 数据看板 --------------------------------------------------------------- */
.analytics-body {
  --analytics-blue: #2d6da3;
  --analytics-blue-pale: #eaf2f9;
  --analytics-violet: #7059a6;
  --analytics-violet-pale: #f1edfa;
  --analytics-cyan: #3aa5ad;
  --analytics-grid: #e9efef;
  background:
    radial-gradient(circle at 10% 10%, rgba(8, 118, 111, 0.06), transparent 28rem),
    var(--page);
}

.analytics-header {
  position: relative;
  z-index: 5;
  box-shadow: 0 1px 0 rgba(23, 33, 36, 0.02);
}

.analytics-current-page {
  color: var(--teal);
  background: var(--teal-pale);
}

.analytics-main {
  width: min(100%, 1380px);
  padding-bottom: 72px;
}

.analytics-hero {
  position: relative;
  min-height: 216px;
  border-radius: 22px;
  padding: 35px 40px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background:
    linear-gradient(118deg, rgba(7, 78, 75, 0.08), rgba(66, 156, 165, 0.22)),
    linear-gradient(135deg, #075f5a 0%, #08766f 48%, #248e91 100%);
  box-shadow: 0 20px 50px rgba(8, 88, 83, 0.18);
}

.analytics-hero::before,
.analytics-hero::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  pointer-events: none;
}

.analytics-hero::before {
  width: 390px;
  height: 390px;
  right: -110px;
  top: -210px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  box-shadow: 0 0 0 52px rgba(255, 255, 255, 0.025), 0 0 0 105px rgba(255, 255, 255, 0.02);
}

.analytics-hero::after {
  width: 220px;
  height: 220px;
  left: 45%;
  bottom: -190px;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(1px);
}

.analytics-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.analytics-live-chip {
  width: fit-content;
  margin-bottom: 19px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 650;
}

.analytics-live-chip > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #79edc4;
  box-shadow: 0 0 0 5px rgba(121, 237, 196, 0.13);
}

.analytics-hero .section-kicker {
  margin: 0 0 7px;
  color: rgba(218, 255, 248, 0.8);
}

.analytics-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.analytics-hero-copy > p:last-child {
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.7;
}

.analytics-hero-art {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  margin-right: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 22px 50px rgba(0, 42, 41, 0.18);
  transform: rotate(4deg);
}

.analytics-hero-art > svg {
  width: 56px;
  height: 56px;
  stroke-width: 1.35;
  transform: rotate(-4deg);
}

.analytics-art-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.analytics-art-orbit-one {
  width: 168px;
  height: 74px;
  transform: rotate(35deg);
}

.analytics-art-orbit-two {
  width: 76px;
  height: 168px;
  transform: rotate(35deg);
}

.analytics-filter-panel {
  position: relative;
  z-index: 2;
  margin: -20px 22px 24px;
  border: 1px solid rgba(211, 225, 224, 0.9);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 15px 38px rgba(34, 61, 61, 0.11);
  backdrop-filter: blur(14px);
}

.analytics-filter-main,
.analytics-filter-side {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.analytics-filter-main {
  min-width: 0;
}

.analytics-filter-label {
  margin: 0 0 7px 2px;
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.analytics-range-tabs {
  min-height: 42px;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  gap: 3px;
  background: #edf3f2;
}

.analytics-range-tabs button {
  min-width: 72px;
  border: 0;
  border-radius: 7px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.analytics-range-tabs button:hover {
  color: var(--teal);
}

.analytics-range-tabs button.active {
  color: var(--teal-dark);
  background: #fff;
  box-shadow: 0 3px 10px rgba(36, 63, 64, 0.09);
}

.analytics-date-range {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--soft-muted);
}

.analytics-date-range label {
  position: relative;
  min-width: 144px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  align-items: center;
  background: #fff;
}

.analytics-date-range label > span {
  position: absolute;
  top: -7px;
  left: 10px;
  padding: 0 4px;
  color: var(--soft-muted);
  background: #fff;
  font-size: 9px;
  font-weight: 700;
}

.analytics-date-range input {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  padding: 5px 10px 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}

.analytics-employee-filter {
  width: 230px;
}

.analytics-select-shell {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.analytics-select-shell:focus-within {
  border-color: #67aaa5;
  box-shadow: 0 0 0 3px rgba(8, 118, 111, 0.09);
}

.analytics-select-shell > svg {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

.analytics-select-shell > svg:last-child {
  width: 14px;
  color: var(--soft-muted);
  pointer-events: none;
}

.analytics-select-shell select {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  appearance: none;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.analytics-refresh-button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 8px 18px rgba(8, 118, 111, 0.18);
  font-size: 13px;
  font-weight: 750;
  transition: transform 150ms ease, background 150ms ease;
}

.analytics-refresh-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.analytics-refresh-button svg {
  width: 16px;
  height: 16px;
}

.analytics-refresh-button.loading svg {
  animation: analytics-spin 850ms linear infinite;
}

@keyframes analytics-spin {
  to { transform: rotate(360deg); }
}

.analytics-error,
.analytics-loading {
  min-height: 128px;
  border-radius: 14px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #fff;
}

.analytics-loading {
  border: 1px solid var(--line);
  color: var(--muted);
}

.analytics-loading-orb,
.analytics-error > span {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
}

.analytics-loading-orb {
  position: relative;
  color: var(--teal);
  background: var(--teal-pale);
}

.analytics-loading-orb::after {
  position: absolute;
  inset: -5px;
  border: 2px solid transparent;
  border-top-color: var(--teal);
  border-radius: 17px;
  content: "";
  animation: analytics-spin 1s linear infinite;
}

.analytics-loading div,
.analytics-error div {
  display: grid;
  gap: 5px;
}

.analytics-loading small,
.analytics-error p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.analytics-error {
  margin-bottom: 22px;
  border: 1px solid #f1cac6;
  justify-content: flex-start;
  background: #fff9f8;
}

.analytics-error > span {
  color: var(--red);
  background: var(--red-pale);
}

.analytics-error button {
  margin-left: auto;
}

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

.analytics-kpi {
  position: relative;
  min-width: 0;
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 63, 64, 0.045);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.analytics-kpi:hover {
  border-color: #c8d8d7;
  box-shadow: 0 14px 32px rgba(35, 63, 64, 0.09);
  transform: translateY(-2px);
}

.analytics-kpi::after {
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  content: "";
  background: var(--kpi-pale, var(--teal-pale));
  opacity: 0.75;
}

.analytics-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analytics-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--kpi-color, var(--teal));
  background: var(--kpi-pale, var(--teal-pale));
}

.analytics-kpi-icon svg {
  width: 17px;
  height: 17px;
}

.analytics-kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analytics-kpi-value {
  position: relative;
  z-index: 1;
  margin-top: 15px;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.analytics-kpi-value strong {
  color: var(--ink);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.analytics-kpi-value small {
  color: var(--soft-muted);
  font-size: 11px;
  font-weight: 650;
}

.analytics-dashboard-grid {
  display: grid;
  gap: 14px;
}

.analytics-dashboard-grid-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.analytics-dashboard-grid-secondary {
  grid-template-columns: 0.9fr 1fr 1.1fr;
}

.analytics-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 63, 64, 0.045);
}

.analytics-card-header {
  min-height: 46px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.analytics-card-header > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.analytics-card-header h2,
.analytics-card-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.analytics-card-header p {
  margin: 3px 0 0;
  color: var(--soft-muted);
  font-size: 11px;
  line-height: 1.45;
}

.analytics-card-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
}

.analytics-card-icon svg {
  width: 17px;
  height: 17px;
}

.analytics-card-icon.teal { color: var(--teal); background: var(--teal-pale); }
.analytics-card-icon.blue { color: var(--analytics-blue); background: var(--analytics-blue-pale); }
.analytics-card-icon.amber { color: var(--amber); background: var(--amber-pale); }
.analytics-card-icon.violet { color: var(--analytics-violet); background: var(--analytics-violet-pale); }
.analytics-card-icon.red { color: var(--red); background: var(--red-pale); }

.analytics-header-number {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-chart {
  position: relative;
  width: 100%;
  min-height: 258px;
}

.analytics-chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
  display: block;
}

.analytics-chart-grid {
  stroke: var(--analytics-grid);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.analytics-chart-axis-label {
  fill: var(--soft-muted);
  font-size: 10px;
  font-family: inherit;
}

.analytics-chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.analytics-chart-area {
  opacity: 0.09;
}

.analytics-chart-point,
.analytics-donut-segment,
.analytics-chart-bar {
  cursor: help;
  transition: opacity 130ms ease, filter 130ms ease;
}

.analytics-chart-point:focus,
.analytics-chart-bar:focus,
.analytics-donut-segment:focus {
  outline: none;
  filter: drop-shadow(0 0 3px rgba(8, 118, 111, 0.5));
}

.analytics-chart-point:hover,
.analytics-chart-bar:hover,
.analytics-donut-segment:hover {
  opacity: 0.78;
}

.analytics-chart-empty,
.analytics-ranking-empty {
  min-height: 228px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--soft-muted);
  background: var(--soft);
  text-align: center;
  font-size: 12px;
}

.analytics-chart-empty svg,
.analytics-ranking-empty svg {
  width: 26px;
  height: 26px;
  opacity: 0.65;
}

.analytics-chart-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.analytics-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.analytics-chart-legend i {
  width: 14px;
  height: 3px;
  border-radius: 99px;
  background: var(--legend-color);
}

.analytics-chart-legend i.dashed {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--legend-color) 0 5px, transparent 5px 8px);
}

.analytics-donut-layout {
  min-height: 228px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.analytics-donut-figure {
  position: relative;
  width: 148px;
  height: 148px;
}

.analytics-donut-figure svg {
  width: 100%;
  height: 100%;
}

.analytics-donut-track {
  fill: none;
  stroke: #edf2f2;
  stroke-width: 14;
}

.analytics-donut-segment {
  fill: none;
  stroke-width: 14;
  stroke-linecap: butt;
}

.analytics-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.analytics-donut-center strong {
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.analytics-donut-center small {
  margin-top: 5px;
  color: var(--soft-muted);
  font-size: 10px;
}

.analytics-donut-legend {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.analytics-donut-legend-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-donut-legend-row > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legend-color);
}

.analytics-donut-legend-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-donut-legend-row strong {
  color: var(--ink);
  font-size: 11px;
}

.analytics-ranking-chart {
  min-height: 228px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.analytics-rank-row {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.analytics-rank-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.analytics-rank-meta > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-rank-meta strong {
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}

.analytics-rank-track {
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: #edf2f2;
}

.analytics-rank-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: var(--rank-color);
  background: linear-gradient(90deg, var(--rank-color), color-mix(in srgb, var(--rank-color) 70%, white));
  transform-origin: left;
  animation: analytics-bar-grow 440ms ease both;
}

@keyframes analytics-bar-grow {
  from { transform: scaleX(0); }
}

.analytics-rank-note {
  color: var(--soft-muted);
  font-size: 9px;
}

.analytics-employee-empty {
  margin-top: 20px;
  border: 1px dashed #bfcfcd;
  border-radius: 15px;
  padding: 27px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.66);
  text-align: left;
}

.analytics-employee-empty > span {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: var(--teal-pale);
}

.analytics-employee-empty strong {
  display: block;
  font-size: 14px;
}

.analytics-employee-empty p {
  max-width: 640px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.analytics-employee-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.analytics-employee-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.analytics-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #08766f, #3a9ca0);
  box-shadow: 0 10px 24px rgba(8, 118, 111, 0.2);
  font-size: 18px;
  font-weight: 850;
}

.analytics-employee-heading .section-kicker {
  margin: 0 0 3px;
}

.analytics-employee-heading h2 {
  margin: 0;
  font-size: 22px;
}

.analytics-employee-heading p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.analytics-range-pill {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.analytics-employee-kpis {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.analytics-employee-kpi {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.analytics-employee-kpi small {
  display: block;
  overflow: hidden;
  color: var(--soft-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-employee-kpi strong {
  margin-top: 8px;
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.analytics-employee-charts {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
}

.analytics-card-full {
  grid-column: 1 / -1;
}

.analytics-time-chart {
  min-height: 310px;
}

.analytics-abnormal-card {
  margin-top: 14px;
}

.analytics-count-badge {
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--red);
  background: var(--red-pale);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.analytics-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.analytics-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}

.analytics-table th,
.analytics-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.analytics-table th {
  color: var(--muted);
  background: var(--soft);
  font-size: 10px;
  font-weight: 750;
}

.analytics-table tbody tr:last-child td {
  border-bottom: 0;
}

.analytics-table tbody tr:hover td {
  background: #fbfdfd;
}

.analytics-status-chip {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--chip-color, var(--muted));
  background: var(--chip-bg, #edf2f2);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.analytics-status-chip::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  content: "";
  background: currentColor;
}

.analytics-table-empty {
  height: 98px;
  color: var(--soft-muted);
  text-align: center !important;
}

.analytics-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 230px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 9px 11px;
  pointer-events: none;
  color: #fff;
  background: rgba(19, 35, 38, 0.95);
  box-shadow: 0 10px 28px rgba(16, 32, 35, 0.24);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-line;
  transform: translate(-50%, calc(-100% - 12px));
}

.analytics-tooltip::after {
  position: absolute;
  left: calc(50% - 5px);
  bottom: -5px;
  width: 10px;
  height: 10px;
  content: "";
  background: inherit;
  transform: rotate(45deg);
}

.analytics-tooltip[data-placement="bottom"]::after {
  top: -5px;
  bottom: auto;
}

@media (max-width: 1180px) {
  .analytics-filter-panel,
  .analytics-filter-main,
  .analytics-filter-side {
    align-items: stretch;
  }

  .analytics-filter-panel {
    flex-direction: column;
  }

  .analytics-filter-side {
    justify-content: flex-end;
  }

  .analytics-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .analytics-dashboard-grid-secondary {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-card-status {
    grid-column: 1 / -1;
  }

  .analytics-card-status .analytics-donut-layout {
    grid-template-columns: 175px minmax(0, 430px);
    justify-content: center;
  }

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

@media (max-width: 900px) {
  .analytics-main {
    padding-inline: 16px;
  }

  .analytics-hero {
    min-height: 198px;
    padding: 30px;
  }

  .analytics-hero-art {
    margin-right: 18px;
    transform: scale(0.85) rotate(4deg);
  }

  .analytics-filter-main {
    flex-wrap: wrap;
  }

  .analytics-date-range {
    width: 100%;
  }

  .analytics-dashboard-grid-primary,
  .analytics-employee-charts {
    grid-template-columns: 1fr;
  }

  .analytics-card-full {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .analytics-body .site-compliance-footer {
    padding-inline: 16px;
  }

  .analytics-main {
    padding-top: 14px;
    padding-inline: 12px;
  }

  .analytics-header .brand {
    flex: 1 1 auto;
  }

  .analytics-hero {
    min-height: 184px;
    border-radius: 17px;
    padding: 25px 22px;
  }

  .analytics-live-chip {
    margin-bottom: 15px;
    padding: 6px 10px;
  }

  .analytics-hero h1 {
    font-size: 30px;
  }

  .analytics-hero-copy > p:last-child {
    margin-top: 11px;
    font-size: 12px;
  }

  .analytics-hero-art {
    position: absolute;
    right: -20px;
    bottom: -28px;
    margin: 0;
    opacity: 0.35;
    transform: scale(0.78) rotate(8deg);
  }

  .analytics-filter-panel {
    margin: -13px 9px 18px;
    border-radius: 13px;
    padding: 14px;
  }

  .analytics-filter-main,
  .analytics-filter-side {
    width: 100%;
    flex-direction: column;
    gap: 13px;
  }

  .analytics-filter-main > div:first-child {
    width: 100%;
  }

  .analytics-range-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .analytics-range-tabs button {
    min-width: 0;
    flex: 1 0 68px;
    padding-inline: 8px;
  }

  .analytics-date-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .analytics-date-range label {
    min-width: 0;
  }

  .analytics-employee-filter,
  .analytics-refresh-button {
    width: 100%;
  }

  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .analytics-kpi {
    min-height: 112px;
    border-radius: 13px;
    padding: 14px;
  }

  .analytics-kpi-icon {
    width: 31px;
    height: 31px;
  }

  .analytics-kpi-value {
    margin-top: 11px;
  }

  .analytics-kpi-value strong {
    font-size: 26px;
  }

  .analytics-dashboard-grid-secondary {
    grid-template-columns: 1fr;
  }

  .analytics-card-status {
    grid-column: auto;
  }

  .analytics-card {
    border-radius: 13px;
    padding: 15px;
  }

  .analytics-card-header {
    margin-bottom: 13px;
    flex-wrap: wrap;
  }

  .analytics-chart {
    min-height: 226px;
    overflow-x: auto;
  }

  .analytics-chart svg {
    min-width: 520px;
  }

  .analytics-donut-layout,
  .analytics-card-status .analytics-donut-layout {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .analytics-donut-figure {
    width: 128px;
    height: 128px;
  }

  .analytics-employee-empty {
    padding: 21px 17px;
    align-items: flex-start;
  }

  .analytics-employee-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .analytics-range-pill {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

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

  .analytics-time-chart {
    min-height: 250px;
  }

  .analytics-error {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .analytics-error button {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .analytics-header .brand strong {
    max-width: 215px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .analytics-header .header-actions {
    justify-content: space-between;
  }

  .analytics-kpi-label {
    font-size: 11px;
  }

  .analytics-donut-layout,
  .analytics-card-status .analytics-donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .analytics-donut-legend {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-refresh-button,
  .analytics-kpi,
  .analytics-rank-fill {
    transition: none;
    animation: none;
  }
}

* {
  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-color: #dbe9ee;
  background-image: url("/assets/login-ship-background.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.role-entry-layout {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.role-entry-layout::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background: rgba(237, 245, 246, 0.42);
}

.role-entry-layout > * {
  position: relative;
  z-index: 1;
}

.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: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.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: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  font-size: 12px;
}

.role-entry-footer svg {
  width: 16px;
  height: 16px;
}

.role-entry-footer a,
.site-compliance-footer a {
  color: inherit;
  text-decoration: none;
}

.role-entry-footer a:hover,
.role-entry-footer a:focus-visible,
.site-compliance-footer a:hover,
.site-compliance-footer a:focus-visible {
  color: var(--teal);
  text-decoration: underline;
}

.site-compliance-footer {
  width: 100%;
  min-height: 52px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.compliance-separator {
  color: var(--soft-muted);
}

@media (max-width: 760px) {
  .role-entry-body {
    background-position: 68% center;
  }

  .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-footer {
    flex-wrap: wrap;
    padding-inline: 16px;
    text-align: center;
  }

  .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 {
  position: relative;
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background-color: #dbe9ee;
  background-image: url("/assets/login-ship-background.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.login-layout::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(237, 245, 246, 0.38);
}

.login-panel {
  position: relative;
  width: min(100%, 410px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 48px rgba(20, 48, 58, 0.2);
  backdrop-filter: blur(8px);
}

@media (max-width: 760px) {
  .login-layout {
    background-position: 68% center;
  }
}

.login-field {
  margin: 24px 0 16px;
}

.login-panel > .field + .field {
  margin-top: 16px;
}

.login-panel > .primary-button {
  margin-top: 18px;
}

#leaderLoginForm > .primary-button {
  margin-top: 28px;
}

.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);
}

.schedule-shift-day .schedule-shift-switch button[data-schedule-shift="day"].active,
.schedule-shift-day .schedule-shift-switch button[data-public-shift="day"].active {
  color: #075f59;
  background: #d7f2ef;
  box-shadow: inset 0 0 0 1px #84cec7;
}

.schedule-shift-night .schedule-shift-switch button[data-schedule-shift="night"].active,
.schedule-shift-night .schedule-shift-switch button[data-public-shift="night"].active {
  color: #fff;
  background: #394b8f;
  box-shadow: inset 0 0 0 1px #26366f;
}

.schedule-shift-night .schedule-heading .section-kicker,
.schedule-shift-night .public-schedule-heading .section-kicker {
  color: #394b8f;
}

.schedule-shift-night .schedule-timeline-panel,
.schedule-shift-night .public-timeline-panel {
  border-color: #aab4dc;
  background: #f5f6fc;
}

.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;
}

.employee-status.borrowed {
  color: #8a570b;
  background: #fff1d6;
}

.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-timeline-panel,
.public-timeline-panel {
  margin: 0 0 18px;
  padding: 13px 15px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.schedule-timeline-heading {
  min-height: 38px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.schedule-timeline-heading > div {
  min-width: 0;
}

.schedule-timeline-heading h2,
.schedule-timeline-heading p {
  margin: 0;
}

.schedule-timeline-heading h2 {
  font-size: 16px;
}

.schedule-timeline-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.schedule-timeline {
  min-height: 54px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(34px, 1fr);
  overflow-x: auto;
  padding: 0 2px 7px;
  scrollbar-color: var(--line-strong) transparent;
  touch-action: pan-y;
  user-select: none;
}

.schedule-time-slot {
  position: relative;
  min-width: 34px;
  height: 46px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid #74878b;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.schedule-time-slot::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 12px;
  background: #74878b;
}

.schedule-time-slot.minor::before {
  height: 7px;
  background: #a8b5b7;
}

.schedule-time-slot span {
  position: absolute;
  left: 4px;
  bottom: 17px;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.schedule-time-slot.minor span {
  bottom: 12px;
  color: var(--soft-muted);
  font-size: 9px;
}

.schedule-time-slot:hover {
  background: #eff7f6;
}

.schedule-time-slot.changed-project {
  background: #e8f4fb;
  box-shadow: inset 0 4px 0 #397cac;
}

.schedule-time-slot.changed-rest {
  background: #fff5df;
  box-shadow: inset 0 4px 0 #d09120;
}

.schedule-time-slot.changed-unassigned {
  background: #fff0ef;
  box-shadow: inset 0 4px 0 #be514b;
}

.schedule-time-slot.selected {
  z-index: 1;
  color: #fff;
  background: var(--teal);
  box-shadow: inset 0 4px 0 var(--teal-dark);
}

.schedule-time-slot.selected span,
.schedule-time-slot.selected.minor span {
  color: #fff;
}

.public-timeline .schedule-time-slot.selected {
  background: #245d8e;
  box-shadow: inset 0 4px 0 #17466f;
}

.person-time-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.person-time-badge {
  min-height: 19px;
  padding: 2px 5px;
  border: 1px solid #bdd4d1;
  border-radius: 4px;
  color: #31645f;
  background: #f1f8f7;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
}

.person-time-badge.adjusted {
  border-color: #e0b66d;
  color: #86570e;
  background: #fff7e8;
}

.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: flex;
  align-items: start;
  gap: 20px;
}

.project-zone {
  flex: 0 0 auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.project-zone.borrowed-zone {
  padding-left: 20px;
  border-left: 2px dashed #c9a568;
}

.project-zone-header {
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f3f8f7;
}

.project-zone.borrowed-zone .project-zone-header {
  border-color: #e1c99d;
  background: #fff8ec;
}

.project-zone-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  background: #fff;
}

.project-zone.borrowed-zone .project-zone-icon {
  color: #9b6411;
}

.project-zone-icon svg {
  width: 18px;
  height: 18px;
}

.project-zone-header h2 {
  font-size: 14px;
}

.project-zone-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.project-zone-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: start;
  gap: 12px;
}

.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 {
  position: relative;
  width: var(--project-column-width, 276px);
  min-width: 184px;
  max-width: 520px;
  border-top: 5px solid var(--project-color, var(--teal));
}

.project-column-header {
  min-height: 80px;
  padding: 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-column-title h2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.25;
}

.project-column-resizer {
  position: absolute;
  z-index: 8;
  top: 0;
  right: 0;
  bottom: 0;
  width: 12px;
  border: 0;
  outline: 0;
  cursor: col-resize;
  touch-action: none;
}

.project-column-resizer::before {
  position: absolute;
  top: 18px;
  right: 3px;
  bottom: 18px;
  width: 3px;
  border-radius: 99px;
  content: "";
  background: var(--project-color, var(--teal));
  opacity: 0;
  transform: scaleY(0.7);
  transition: opacity 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.project-column:hover .project-column-resizer::before,
.project-column-resizer:hover::before,
.project-column-resizer:focus-visible::before,
.project-column-resizer.active::before {
  opacity: 0.72;
  transform: scaleY(1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--project-color, var(--teal)) 12%, transparent);
}

.project-column-resizer:focus-visible {
  box-shadow: inset -3px 0 0 var(--project-color, var(--teal));
}

body.project-column-resizing,
body.project-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.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="后勤"],
    [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="后勤"],
    [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[data-job-type="铜工"],
.public-person-card[data-job-type="铜工"] {
  --job-accent: #c66a13;
  --job-background: #fff6ed;
  --job-text: #884000;
  --job-muted: #855f3e;
}

.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);
}

.person-card.search-located {
  animation: personnel-pool-locate 900ms ease-out;
}

@keyframes personnel-pool-locate {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-5px);
  }
  70% {
    transform: translateX(3px);
  }
}

.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 clamp(18px, 2vw, 34px);
  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: none;
  padding-inline: clamp(18px, 2vw, 34px);
}

.public-schedule-search {
  width: min(340px, 100%);
}

.public-schedule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.public-screenshot-button {
  min-height: 44px;
  white-space: nowrap;
}

.public-screenshot-button svg {
  width: 18px;
  height: 18px;
}

.schedule-capture-heading {
  display: none;
}

.schedule-capture-render {
  position: fixed;
  z-index: -1000;
  top: 0;
  left: 0;
  width: 1500px;
  padding: 28px;
  pointer-events: none;
  background: #f3f7f7;
}

.schedule-capture-render .schedule-capture-heading {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 24px;
}

.schedule-capture-render .schedule-capture-heading p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
}

.schedule-capture-render .schedule-capture-heading h2 {
  margin: 0;
  font-size: 30px;
}

.schedule-capture-render .schedule-capture-heading span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.schedule-capture-render .public-stats {
  grid-template-columns: repeat(4, minmax(100px, 150px)) minmax(180px, 1fr);
}

.schedule-capture-render .public-project-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.schedule-capture-render .schedule-timeline-heading button {
  display: none;
}

.schedule-capture-render .schedule-timeline {
  overflow: hidden;
}

.schedule-capture-render .public-board-section {
  margin-top: 14px;
}

.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(280px, 1fr));
  align-items: start;
  gap: 12px;
}

.public-schedule-date {
  min-width: 176px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
}

.public-schedule-date svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--muted);
}

.public-schedule-date input {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
}

.person-card.borrowed-in-card,
.public-person-card.borrowed-in-card {
  border-color: #b9a5dc;
  box-shadow: inset 4px 0 0 #7650a7;
  background: #f7f3fc;
}

.borrowed-in-badge {
  width: fit-content;
  margin-top: 5px;
  padding: 2px 6px;
  border: 1px solid #c7b5e2;
  border-radius: 4px;
  color: #5f3b91;
  background: #eee6f8;
  font-size: 10px;
  font-weight: 800;
}

.people-type-tabs {
  width: fit-content;
  margin: 0 24px 12px;
}

.table-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.public-board-section {
  margin-top: 16px;
}

.public-board-section:first-child {
  margin-top: 0;
}

.public-board-section-heading {
  min-height: 54px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid #b9d8d4;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  background: #edf8f6;
}

.public-board-section-heading h2,
.public-board-section-heading p {
  margin: 0;
}

.public-board-section-heading h2 {
  font-size: 16px;
}

.public-board-section-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.public-board-section-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.public-board-section-icon svg {
  width: 18px;
  height: 18px;
}

.borrowed-board-section {
  padding-top: 16px;
  border-top: 2px dashed #d7b97e;
}

.borrowed-board-section .public-board-section-heading {
  border-color: #e1c99d;
  color: #9b6411;
  background: #fff8ec;
}

.public-board-empty {
  grid-column: 1 / -1;
  min-height: 110px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
}

.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: var(--project-tint, rgba(8, 118, 111, 0.08));
}

.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-rest-section {
  margin-top: 16px;
}

.public-rest-section .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;
  }

  .public-schedule-heading h1 {
    overflow-wrap: anywhere;
  }

  .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-timeline-panel,
  .public-timeline-panel {
    padding-inline: 11px;
  }

  .schedule-timeline-heading {
    align-items: flex-start;
  }

  .schedule-timeline-heading p {
    max-width: 230px;
    line-height: 1.45;
  }

  .schedule-timeline {
    grid-auto-columns: 42px;
  }

  .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%;
  }

  .project-board-top-scroll {
    display: none;
  }

  .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;
  }

  .project-zone,
  .project-zone-columns {
    width: 100%;
  }

  .project-zone.borrowed-zone {
    padding-top: 14px;
    padding-left: 0;
    border-top: 2px dashed #c9a568;
    border-left: 0;
  }

  .project-zone-columns {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }

  .project-column {
    width: 100%;
    max-width: none;
  }

  .project-column-resizer {
    display: none;
  }

  .public-schedule-search {
    width: 100%;
  }

  .public-schedule-actions {
    width: 100%;
    justify-content: stretch;
  }

  .public-schedule-actions .schedule-shift-switch {
    flex: 1 1 auto;
  }

  .public-screenshot-button {
    width: 100%;
  }

  .public-project-board {
    grid-template-columns: 1fr;
  }
}

.rate-manage-button {
  display: inline-grid;
  gap: 2px;
  min-width: 110px;
  padding: 8px 10px;
  border: 1px solid #b8dcd7;
  border-radius: 7px;
  color: var(--teal-dark);
  background: #f1fbf9;
  text-align: left;
  cursor: pointer;
}

.rate-manage-button strong {
  font-size: 14px;
}

.rate-manage-button small {
  color: var(--muted);
  font-size: 11px;
}

.rate-manage-button:hover,
.rate-manage-button:focus-visible {
  border-color: var(--teal);
  background: #e5f7f4;
}

.rate-history-dialog .dialog-content {
  width: min(680px, calc(100vw - 28px));
}

.rate-history-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.rate-history-form .primary-button {
  min-height: 48px;
}

.rate-history-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.rate-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 7px;
  background: #fff;
}

.rate-history-item > div:first-child {
  display: grid;
  gap: 3px;
}

.rate-history-item small {
  color: var(--muted);
}

.rate-history-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

@media (max-width: 700px) {
  .rate-history-form {
    grid-template-columns: 1fr 1fr;
  }

  .rate-history-form .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 470px) {
  .rate-history-form {
    grid-template-columns: 1fr;
  }

  .rate-history-form .primary-button {
    grid-column: auto;
  }

  .rate-history-item {
    align-items: flex-start;
  }

  .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;
}

.leader-employee-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid #b8d9d3;
  border-left: 4px solid var(--primary);
  background: #f3faf8;
}

.leader-employee-notice-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--primary);
  background: #dff2ee;
  border-radius: 8px;
}

.leader-employee-notice-icon svg {
  width: 25px;
  height: 25px;
}

.leader-employee-notice strong {
  font-size: 18px;
}

.leader-employee-notice p {
  margin: 5px 0 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .leader-employee-notice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .leader-employee-notice .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.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: var(--green);
  border-color: #b9ddc9;
  background: var(--green-pale);
}

.work-status.employee_less {
  color: var(--red);
  border-color: #ecc1bd;
  background: var(--red-pale);
}

.work-status.employee_more,
.work-status.pending_admin,
.work-status.leader_duplicate_suspected {
  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);
}

.site-login-field {
  margin-top: 22px;
}

.site-login-field .input-with-icon {
  min-height: 54px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.site-login-field .input-with-icon:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 118, 111, 0.13);
}

.site-login-field .input-with-icon > svg {
  left: 16px;
  z-index: 1;
  flex: 0 0 auto;
}

.site-login-field select {
  width: 100%;
  min-height: 52px;
  border: 0;
  padding: 0 44px 0 48px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  outline: 0;
}

.site-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
  padding: 8px 12px;
  border: 1px solid #b9ded9;
  border-radius: 6px;
  background: #eff9f7;
  color: #086c66;
  font-size: 14px;
  font-weight: 700;
}

.site-login-badge svg {
  width: 17px;
  height: 17px;
}

.site-entry-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(1020px, 100%);
  margin: 30px auto 0;
}

.site-entry-option {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  min-height: 124px;
  padding: 20px;
  border: 1px solid #cad8da;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(20, 53, 59, 0.06);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.site-entry-option:hover,
.site-entry-option:focus-visible {
  border-color: #0c8279;
  box-shadow: 0 14px 34px rgba(12, 103, 98, 0.12);
  transform: translateY(-2px);
  outline: 0;
}

.site-entry-option > svg {
  width: 22px;
  height: 22px;
  color: #6a7c80;
}

.site-entry-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #e7f4f2;
  color: #087d75;
}

.site-entry-icon svg {
  width: 24px;
  height: 24px;
}

.site-entry-option strong,
.site-entry-option small,
.site-entry-option em {
  display: block;
  letter-spacing: 0;
}

.site-entry-option strong {
  margin-bottom: 4px;
  font-size: 21px;
}

.site-entry-option small {
  color: #52696e;
  font-weight: 700;
}

.site-entry-option em {
  margin-top: 9px;
  color: #76898d;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
}

.role-entry-step {
  width: min(1120px, 100%);
  margin: 28px auto 0;
}

.role-entry-step-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d7e0e2;
}

.role-entry-step-heading h2 {
  margin: 3px 0 0;
  font-size: 26px;
  letter-spacing: 0;
}

.role-entry-step-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.backend-entry-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: #6e8084;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 6px;
}

.backend-entry-link:hover,
.backend-entry-link:focus-visible {
  color: var(--teal);
  background: #f5f9f9;
  border-color: #d5e4e3;
}

.backend-entry-link svg {
  width: 15px;
  height: 15px;
}

.person-absence-badge {
  width: fit-content;
  min-height: 21px;
  margin-top: 7px;
  padding: 3px 7px;
  border: 1px solid #efaca8;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #aa2923;
  background: #fff0ef;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.backend-entry-global {
  width: min(460px, 100%);
  justify-content: flex-start;
  gap: 13px;
  margin-top: 20px;
  padding: 15px 17px;
  color: #fff;
  background: linear-gradient(135deg, #087b71, #23658f);
  border-color: transparent;
  border-radius: 9px;
  box-shadow: 0 10px 28px rgb(10 98 92 / 18%);
}

.backend-entry-global:hover,
.backend-entry-global:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #076c64, #1d587e);
  border-color: transparent;
  transform: translateY(-1px);
}

.backend-entry-global > span {
  display: grid;
  flex: 1;
  gap: 2px;
}

.backend-entry-global strong,
.backend-entry-global small {
  display: block;
}

.backend-entry-global strong {
  font-size: 16px;
}

.backend-entry-global small {
  color: rgb(255 255 255 / 78%);
  font-weight: 600;
}

.backend-entry-global svg {
  width: 20px;
  height: 20px;
}

.entry-loading {
  grid-column: 1 / -1;
  padding: 36px;
  color: #647b80;
  text-align: center;
}

@media (max-width: 720px) {
  .site-entry-options {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .site-entry-option {
    min-height: 116px;
    padding: 18px;
  }

  .role-entry-step-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-entry-step-heading .secondary-button {
    width: 100%;
  }

  .role-entry-step-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .backend-entry-link {
    align-self: flex-end;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .site-entry-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.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;
}

/* Backend account and audit center */
.backend-body {
  min-height: 100vh;
  background: #f3f6f6;
  color: #11272b;
}

.backend-layout {
  min-height: 100vh;
}

.backend-header {
  position: sticky;
  top: 0;
  z-index: 40;
}

.backend-main {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.backend-hero,
.backend-view-heading,
.backend-audit-filters,
.backend-tabs,
.admin-profile-summary,
.admin-profile-meta {
  display: flex;
  align-items: center;
}

.backend-hero {
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
}

.backend-hero h1 {
  margin: 5px 0 8px;
  font-size: 34px;
  letter-spacing: 0;
}

.backend-hero p {
  margin: 0;
  color: #60777c;
}

.backend-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  color: #17675f;
  font-weight: 800;
  background: #e8f5f2;
  border: 1px solid #b9ddd5;
  border-radius: 6px;
}

.backend-tabs {
  gap: 4px;
  margin-bottom: 22px;
  padding: 5px;
  background: #e7eded;
  border: 1px solid #d6e0e1;
  border-radius: 8px;
}

.backend-tabs button,
.backend-tabs > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  color: #536a6f;
  font-weight: 800;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.backend-site-hub-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
  padding: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 15%, rgb(255 255 255 / 18%), transparent 24%),
    linear-gradient(135deg, #075e58, #176f83 58%, #335e8e);
  border-radius: 12px;
  box-shadow: 0 15px 38px rgb(31 70 76 / 16%);
}

.backend-site-hub-hero h1,
.backend-site-hub-hero p {
  margin: 0;
}

.backend-site-hub-hero h1 {
  margin: 5px 0 9px;
  font-size: 36px;
}

.backend-site-hub-hero p:not(.section-kicker) {
  max-width: 760px;
  color: rgb(255 255 255 / 78%);
}

.backend-site-hub-hero .section-kicker {
  color: #aee2da;
}

.backend-create-site {
  flex: 0 0 auto;
  color: #075f57;
  background: #fff;
  box-shadow: 0 8px 20px rgb(0 0 0 / 12%);
}

.backend-create-site:hover {
  color: #064e49;
  background: #edf9f7;
}

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

.backend-site-card {
  display: flex;
  min-width: 0;
  min-height: 315px;
  padding: 21px;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d7e1e2;
  border-top: 5px solid #799094;
  border-radius: 10px;
  box-shadow: 0 7px 20px rgb(24 62 68 / 6%);
}

.backend-site-card.configurable {
  border-top-color: #14877d;
}

.backend-site-card > header,
.backend-site-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.backend-site-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #086d65;
  background: #e6f4f2;
  border-radius: 9px;
}

.backend-site-card-icon svg {
  width: 25px;
  height: 25px;
}

.backend-site-card-copy {
  margin: 18px 0;
}

.backend-site-card-copy h2,
.backend-site-card-copy p {
  margin: 0;
}

.backend-site-card-copy h2 {
  font-size: 24px;
}

.backend-site-card-copy strong {
  display: block;
  margin-top: 5px;
  color: #356169;
}

.backend-site-card-copy p {
  min-height: 44px;
  margin-top: 8px;
  color: #6a7e82;
  line-height: 1.55;
}

.backend-site-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 18px;
  padding: 13px 0;
  background: #f5f8f8;
  border-radius: 7px;
}

.backend-site-card dl div {
  text-align: center;
  border-right: 1px solid #dce5e5;
}

.backend-site-card dl div:last-child {
  border-right: 0;
}

.backend-site-card dt {
  color: #718489;
  font-size: 12px;
}

.backend-site-card dd {
  margin: 4px 0 0;
  font-size: 21px;
  font-weight: 900;
}

.backend-site-card > footer {
  margin-top: auto;
}

.backend-site-card > footer > span {
  color: #7a8c90;
  font-size: 12px;
}

.backend-site-card .primary-button {
  min-height: 42px;
  padding: 0 14px;
}

.backend-back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  padding: 0;
  color: #176d65;
  font: inherit;
  font-weight: 800;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.backend-back-button svg {
  width: 17px;
}

.backend-workspace-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.backend-workspace-controls label {
  display: grid;
  gap: 5px;
  color: #667c80;
  font-size: 12px;
  font-weight: 800;
}

.backend-workspace-controls select {
  min-width: 260px;
  min-height: 43px;
  padding: 0 36px 0 12px;
  background: #fff;
  border: 1px solid #cad8da;
  border-radius: 7px;
}

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

.backend-settings-wide {
  grid-column: 1 / -1;
}

.backend-site-settings-form {
  padding: 22px;
  background: #f7fafa;
  border: 1px solid #d9e3e4;
  border-radius: 8px;
}

.backend-settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.backend-create-site-dialog .dialog-panel {
  width: min(920px, calc(100vw - 28px));
}

.backend-create-site-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px 15px;
  color: #17665f;
  background: #eaf6f4;
  border: 1px solid #bfdfd9;
  border-radius: 7px;
}

.backend-create-site-note svg {
  flex: 0 0 auto;
  width: 19px;
}

.backend-tabs > a {
  text-decoration: none;
}

.backend-tabs button.active {
  color: #075f57;
  background: #fff;
  box-shadow: 0 1px 4px rgb(29 61 66 / 10%);
}

.backend-tabs .backend-analytics-tab {
  gap: 10px;
  margin-left: auto;
  padding: 6px 14px;
  color: #fff;
  background: linear-gradient(135deg, #08766f, #2d6da3);
  box-shadow: 0 6px 16px rgb(8 118 111 / 18%);
}

.backend-analytics-tab > span {
  display: grid;
  gap: 1px;
  text-align: left;
}

.backend-analytics-tab strong {
  font-size: 13px;
}

.backend-analytics-tab small {
  color: rgb(255 255 255 / 78%);
  font-size: 10px;
  font-weight: 600;
}

.backend-analytics-tab > svg:last-child {
  width: 15px;
  height: 15px;
  opacity: 0.8;
}

.backend-tabs .backend-analytics-tab:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgb(8 118 111 / 24%);
}

.backend-view {
  padding: 28px;
  background: #fff;
  border: 1px solid #d7e1e2;
  border-radius: 8px;
}

.backend-view-heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.backend-view-heading h2 {
  margin: 4px 0 7px;
  font-size: 27px;
  letter-spacing: 0;
}

.backend-view-heading p {
  margin: 0;
  color: #657a7f;
}

.backend-search {
  width: min(390px, 100%);
}

.backend-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 22px;
  border: 1px solid #d8e2e3;
  border-radius: 7px;
  overflow: hidden;
}

.backend-metrics article {
  min-height: 98px;
  padding: 18px 20px;
  border-right: 1px solid #d8e2e3;
}

.backend-metrics article:last-child {
  border-right: 0;
}

.backend-metrics small,
.backend-metrics span {
  display: block;
  color: #637a7f;
}

.backend-metrics strong {
  display: block;
  margin: 7px 0 3px;
  font-size: 28px;
}

.backend-metrics span {
  font-size: 13px;
}

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

.backend-account-card {
  padding: 19px;
  background: #fcfdfd;
  border: 1px solid #d8e2e3;
  border-left: 4px solid #13857b;
  border-radius: 7px;
}

.backend-account-card.inactive {
  border-left-color: #98a7aa;
  opacity: 0.76;
}

.backend-account-card > header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.backend-account-avatar,
.admin-profile-avatar,
.admin-activity-avatar,
.backend-audit-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #075f57;
  font-weight: 900;
  background: #e3f3f0;
  border-radius: 6px;
}

.backend-account-avatar {
  width: 44px;
  height: 44px;
  font-size: 19px;
}

.backend-account-card header div span,
.backend-account-card header div strong {
  display: block;
}

.backend-account-card header div span {
  margin-top: 3px;
  color: #708388;
  font-size: 13px;
}

.backend-account-card dl {
  margin: 18px 0;
}

.backend-account-card dl div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e6ecec;
}

.backend-account-card dt {
  color: #718489;
}

.backend-account-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.backend-account-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.password-reveal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #176d65;
  font: inherit;
  font-weight: 750;
  background: none;
  border: 0;
  cursor: pointer;
}

.password-reveal svg {
  width: 17px;
}

.password-plain {
  color: #152f34;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.status-pill.muted {
  color: #66777a;
  background: #edf1f1;
  border-color: #d5dddd;
}

.danger-button {
  color: #a33e38;
  border-color: #e9c8c5;
  background: #fff7f6;
}

.danger-button:hover {
  color: #fff;
  background: #872e2a;
}

.backend-table-shell {
  width: 100%;
  overflow: auto;
  border: 1px solid #d8e2e3;
  border-radius: 7px;
}

.backend-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.backend-table th,
.backend-table td {
  padding: 15px 17px;
  text-align: left;
  border-bottom: 1px solid #e0e7e8;
}

.backend-table th {
  color: #526a6f;
  font-size: 13px;
  background: #f5f8f8;
}

.backend-table td small,
.backend-table td span {
  display: block;
}

.backend-table td small {
  margin-top: 3px;
  color: #74868a;
}

.backend-table tr:last-child td {
  border-bottom: 0;
}

.backend-dialog .compact-dialog-panel,
.admin-profile-dialog .compact-dialog-panel {
  width: min(590px, calc(100vw - 28px));
}

.admin-profile-summary {
  gap: 13px;
  padding: 14px;
  background: #f4f8f8;
  border: 1px solid #d9e4e4;
  border-radius: 7px;
}

.admin-profile-avatar {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

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

.admin-profile-summary span {
  margin-top: 3px;
  color: #6a7f83;
}

.admin-profile-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.admin-profile-meta span {
  padding: 12px;
  background: #fbfcfc;
  border: 1px solid #e0e7e8;
  border-radius: 6px;
}

.admin-profile-meta small,
.admin-profile-meta strong {
  display: block;
}

.admin-profile-meta small {
  margin-bottom: 5px;
  color: #718489;
}

.dialog-divider {
  height: 1px;
  margin: 20px 0;
  background: #dce5e6;
}

.backend-audit-filters {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.backend-audit-filters .search-field {
  flex: 1 1 280px;
}

.admin-activity-overview {
  margin-bottom: 22px;
  padding: 20px;
  background: #f7fafa;
  border: 1px solid #d8e3e3;
  border-radius: 7px;
}

.admin-activity-overview > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.admin-activity-overview h3,
.admin-activity-overview p {
  margin: 0;
}

.admin-activity-overview p {
  margin-top: 4px;
  color: #667c80;
  font-size: 14px;
}

.admin-activity-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px 0;
  border-top: 1px solid #dfe8e8;
}

.admin-activity-avatar {
  width: 40px;
  height: 40px;
}

.admin-activity-copy > div:first-child {
  display: flex;
  gap: 8px;
}

.admin-activity-copy span,
.admin-activity-copy small,
.admin-activity-count span,
.admin-activity-count small {
  color: #6c8084;
}

.admin-activity-bar {
  height: 6px;
  margin-top: 8px;
  background: #e1e8e8;
  border-radius: 3px;
  overflow: hidden;
}

.admin-activity-bar i {
  display: block;
  height: 100%;
  background: #16877d;
}

.admin-activity-count {
  min-width: 82px;
  text-align: right;
}

.admin-activity-count strong,
.admin-activity-count span,
.admin-activity-count small {
  display: block;
}

.admin-activity-count strong {
  font-size: 22px;
}

.backend-audit-timeline {
  position: relative;
}

.backend-audit-timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 194px;
  width: 2px;
  background: #d7e3e3;
  content: "";
}

.backend-audit-card {
  position: relative;
  display: grid;
  grid-template-columns: 170px 48px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}

.backend-audit-time {
  padding-top: 13px;
  text-align: right;
}

.backend-audit-time strong,
.backend-audit-time span {
  display: block;
}

.backend-audit-time strong {
  font-size: 13px;
}

.backend-audit-time span {
  margin-top: 4px;
  color: #71868a;
  font-size: 12px;
}

.backend-audit-avatar {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  margin-top: 7px;
  border: 4px solid #fff;
  box-sizing: content-box;
}

.backend-audit-avatar.leader {
  color: #19649b;
  background: #e3eff8;
}

.backend-audit-avatar.employee {
  color: #8c6112;
  background: #fff1ca;
}

.backend-audit-content {
  padding: 15px 17px;
  background: #fff;
  border: 1px solid #d9e3e4;
  border-left: 4px solid #18877d;
  border-radius: 7px;
}

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

.backend-audit-content h3 {
  display: inline;
  margin: 0 0 0 8px;
  font-size: 17px;
}

.audit-kind {
  color: #147168;
  font-size: 12px;
  font-weight: 800;
}

.backend-audit-content > p {
  margin: 9px 0;
  color: #40595e;
}

.backend-audit-target {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.backend-audit-target span {
  padding: 3px 7px;
  color: #60777c;
  font-size: 12px;
  background: #eff4f4;
  border-radius: 4px;
}

.backend-audit-content details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e9e9;
}

.backend-audit-content summary {
  color: #116c64;
  font-weight: 800;
  cursor: pointer;
}

.backend-audit-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.backend-audit-diff section {
  padding: 11px;
  background: #f5f8f8;
  border-radius: 5px;
}

.backend-audit-diff small {
  color: #6c8185;
  font-weight: 800;
}

.backend-audit-diff p {
  margin: 5px 0 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.backend-empty {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 28px;
  color: #6d8286;
  text-align: center;
  border: 1px dashed #cfdada;
  border-radius: 7px;
}

.backend-empty.compact {
  min-height: 90px;
}

.backend-empty svg {
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
}

.backend-empty strong,
.backend-empty span {
  display: block;
}

.backend-empty span {
  margin-top: 5px;
}

.backend-load-more {
  display: block;
  margin: 20px auto 0;
}

@media (max-width: 1050px) {
  .backend-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .backend-main {
    width: min(100% - 24px, 1500px);
    padding-top: 20px;
  }

  .backend-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .backend-hero h1 {
    font-size: 28px;
  }

  .backend-hero-badge {
    padding: 8px;
    font-size: 0;
  }

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

  .backend-site-hub-hero {
    align-items: stretch;
    padding: 22px;
    flex-direction: column;
  }

  .backend-site-hub-hero h1 {
    font-size: 29px;
  }

  .backend-create-site {
    width: 100%;
  }

  .backend-site-grid,
  .backend-settings-grid {
    grid-template-columns: 1fr;
  }

  .backend-settings-wide {
    grid-column: auto;
  }

  .backend-site-card {
    min-height: 0;
  }

  .backend-site-card > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .backend-site-card .primary-button,
  .backend-workspace-controls,
  .backend-workspace-controls label,
  .backend-workspace-controls select {
    width: 100%;
  }

  .backend-workspace-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .backend-tabs button,
  .backend-tabs > a {
    padding: 0 8px;
    font-size: 13px;
  }

  .backend-tabs .backend-analytics-tab {
    min-height: 52px;
    margin-left: 0;
  }

  .backend-view {
    padding: 18px 14px;
  }

  .backend-view-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .backend-account-grid {
    grid-template-columns: 1fr;
  }

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

  .backend-metrics article {
    min-height: 88px;
    padding: 14px;
    border-bottom: 1px solid #d8e2e3;
  }

  .backend-metrics strong {
    font-size: 23px;
  }

  .backend-audit-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .backend-audit-filters > * {
    width: 100%;
  }

  .backend-audit-timeline::before {
    left: 20px;
  }

  .backend-audit-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
  }

  .backend-audit-time {
    grid-column: 2;
    grid-row: 1;
    padding: 0 0 3px;
    text-align: left;
  }

  .backend-audit-avatar {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    margin: 0;
  }

  .backend-audit-content {
    grid-column: 2;
    grid-row: 2;
  }

  .backend-audit-content header,
  .backend-audit-diff {
    grid-template-columns: 1fr;
  }

  .backend-audit-diff {
    display: grid;
  }

  .admin-profile-meta {
    grid-template-columns: 1fr;
  }
}

.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 {
  --workday-action-width: 72px;
  --workday-status-width: 180px;
  min-width: 1180px;
  table-layout: fixed;
}

.manual-workday-table th,
.manual-workday-table td {
  padding-right: 12px;
  padding-left: 12px;
}

/* The reconciliation table can grow as summary columns are added. Keep the
   status and the one control clerks must always reach pinned to the right. */
.manual-workday-table .status-column,
.manual-workday-table .action-column {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.manual-workday-table .status-column {
  right: var(--workday-action-width);
  width: var(--workday-status-width);
  min-width: var(--workday-status-width);
  border-left: 1px solid #e2e9eb;
  box-shadow: -8px 0 16px -16px rgba(25, 52, 58, 0.48);
}

.manual-workday-table .action-column {
  right: 0;
  width: var(--workday-action-width);
  min-width: var(--workday-action-width);
  text-align: center !important;
}

.manual-workday-table thead .status-column,
.manual-workday-table thead .action-column {
  z-index: 3;
  background: #f8fafa;
}

.manual-workday-table tbody tr:hover .status-column,
.manual-workday-table tbody tr:hover .action-column {
  background: #fbfcfc;
}

.workday-status-summary {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.manual-workday-table .work-status {
  max-width: 100%;
  min-height: 30px;
  justify-content: flex-start;
  padding: 6px 9px;
  text-align: left;
  white-space: normal;
  line-height: 1.3;
}

.workday-status-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

.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,
.manual-workday-table .workday-row.status-leader_duplicate_suspected 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: 150px;
}

.manual-workday-table th:nth-child(2) {
  width: 205px;
}

.manual-workday-table th:nth-child(3) {
  width: 120px;
}

.manual-workday-table th:nth-child(4),
.manual-workday-table th:nth-child(5) {
  width: 96px;
}

.manual-workday-table th:nth-child(6) {
  width: 86px;
}

.manual-workday-table th:nth-child(7) {
  width: 70px;
}

.manual-workday-table th:nth-child(8) {
  width: 105px;
}

.manual-workday-table th:nth-child(9) {
  width: var(--workday-status-width);
}

.manual-workday-table th:nth-child(10) {
  width: var(--workday-action-width);
}

.manual-workday-table td:nth-child(4) strong,
.manual-workday-table td:nth-child(5) strong,
.manual-workday-table td:nth-child(6) strong,
.manual-workday-table td:nth-child(8) strong {
  white-space: nowrap;
}

.workday-project-list {
  display: grid;
  gap: 3px;
  max-width: 100%;
}

.workday-project-line {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.responsible-leader-stack,
.responsible-leader {
  display: grid;
  gap: 2px;
}

.responsible-leader-stack {
  gap: 7px;
}

.responsible-leader strong {
  color: var(--ink);
  white-space: nowrap;
}

.responsible-leader small {
  color: var(--muted);
  font-size: 11px;
}

.responsible-leader.missing {
  color: #aa5700;
  font-weight: 700;
}

.table-action.edit-workday {
  position: relative;
  overflow: visible;
}

.row-reminder-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d8342a;
  color: #fff;
  box-shadow: 0 2px 7px rgba(153, 35, 29, 0.28);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.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="后勤"],
.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: 1180px;
}

.project-summary-table th:first-child {
  min-width: 235px;
}

.project-summary-table .action-column {
  min-width: 184px;
  white-space: nowrap;
}

.table-heading-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.project-summary-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.project-summary-heading-actions p {
  margin: 0;
}

.project-summary-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.project-summary-identity > i {
  width: 19px;
  flex: 0 0 19px;
  color: var(--teal);
}

.project-summary-identity > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.project-summary-identity .table-subtext {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-summary-name {
  max-width: 360px;
  overflow-wrap: anywhere;
}

.project-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.project-status-filter select {
  min-width: 104px;
  border: 0;
  padding: 3px 20px 3px 0;
  background-color: transparent;
  color: var(--ink);
  font: inherit;
}

.project-status-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}

.project-status-badge.is-active {
  color: #14755d;
  background: #e8f7ef;
  border: 1px solid #bae1ce;
}

.project-status-badge.is-inactive {
  color: #895800;
  background: #fff5df;
  border: 1px solid #efd297;
}

.project-lifecycle-actions {
  gap: 5px;
}

.table-action.is-disable {
  color: #a56800;
  border-color: #efd19a;
  background: #fffaf0;
}

.table-action.is-restore {
  color: #16745c;
  border-color: #b8ddcf;
  background: #f2fbf7;
}

.table-action.danger {
  color: #b23d35;
  border-color: #efc3bf;
  background: #fff8f7;
}

.table-action.is-disable:hover,
.table-action.is-restore:hover,
.table-action.danger:hover {
  filter: brightness(0.96);
}

.project-group-summary-row td {
  background: #edf8f7;
  font-weight: 650;
}

.project-group-summary-row td:first-child {
  border-left: 5px solid var(--teal);
}

.project-group-summary-row .project-summary-identity > i {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
}

.project-group-summary-section {
  border: 1px solid #b9dcd8;
  background: linear-gradient(180deg, #f7fcfb 0, #fff 150px);
  box-shadow: 0 10px 28px rgba(10, 92, 85, 0.07);
}

.project-group-summary-section .section-kicker {
  margin: 0 0 4px;
}

.project-group-summary-table .project-group-summary-row td {
  border-top: 1px solid #c5e1de;
  background: #f3fbfa;
}

.project-group-summary-table .project-group-summary-row:hover td {
  background: #eaf7f5;
}

.project-group-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--muted);
}

.project-group-empty > i {
  width: 28px;
  height: 28px;
  color: var(--teal);
}

.project-group-empty > span {
  display: grid;
  gap: 3px;
  text-align: left;
}

.project-group-empty strong {
  color: var(--ink);
}

.project-group-empty small {
  font-weight: 500;
}

.project-group-member-row td {
  background: #fbfdfd;
}

.project-group-member-row td:first-child {
  padding-left: 30px;
}

.project-group-member-row .project-summary-identity > i {
  color: #7fa3a0;
}

.project-groups-dialog {
  width: min(1380px, calc(100vw - 32px));
  max-width: none;
  overflow: hidden;
}

.project-groups-dialog .dialog-content {
  max-height: calc(100vh - 32px);
  overflow: auto;
  overflow-x: hidden;
  padding-bottom: 0;
}

.project-group-create-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.35fr);
  align-items: end;
  min-width: 0;
  gap: 22px;
  padding: 18px;
  border: 1px solid #b9dcd8;
  border-radius: 10px;
  background: linear-gradient(135deg, #f1fbfa, #f7fbff);
}

.project-group-create-panel > div {
  display: grid;
  gap: 5px;
}

.project-group-create-panel small,
.project-group-name-card small,
.project-group-assignment-row small {
  color: var(--muted);
}

.project-group-create-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.project-group-manager-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfb;
}

.project-group-manager-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(500px, 1.35fr);
  gap: 16px;
  margin-top: 18px;
}

.project-group-names-panel,
.project-group-assignments-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(54vh, 650px);
  overflow: hidden;
}

.project-group-manager-heading h3 {
  margin: 0;
}

.project-group-manager-heading p {
  margin: 4px 0 10px;
}

.project-group-assignment-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.project-group-search {
  position: relative;
  display: block;
  flex: 0 1 250px;
}

.project-group-search > i {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.project-group-search input {
  width: 100%;
  min-height: 40px;
  padding-left: 38px;
}

.project-group-name-list,
.project-group-assignment-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.project-group-name-card {
  display: grid;
  grid-template-columns: 40px minmax(160px, 1fr) auto auto;
  align-items: end;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.project-group-name-card .field {
  grid-column: 2 / -1;
}

.project-group-card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  align-self: end;
  color: var(--teal);
  border-radius: 8px;
  background: var(--teal-soft);
}

.project-group-member-count {
  align-self: center;
  grid-column: 2;
  color: var(--muted);
  white-space: nowrap;
}

.danger-text-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  color: var(--red);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.project-group-assignment-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.7fr);
  align-items: center;
  min-width: 0;
  gap: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.project-group-assignment-row.has-unsaved-change {
  border-color: #d79634;
  background: #fff9ef;
  box-shadow: inset 4px 0 0 #d79634;
}

.project-group-assignment-row.has-unsaved-change strong::after {
  content: "未保存";
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #8a5100;
  background: #ffebc8;
  font-size: 11px;
  font-weight: 750;
  vertical-align: middle;
}

.project-group-assignment-row > span {
  display: grid;
  gap: 3px;
}

.project-group-assignment-row select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

.project-group-create-form input,
.project-group-name-card input {
  width: 100%;
  min-width: 0;
}

.project-group-save-assignments {
  min-width: 190px;
}

.project-group-save-assignments:disabled {
  color: #5d7572;
  border-color: #c9dcda;
  background: #e9f1f0;
  opacity: 1;
}

.project-group-sticky-actions {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px -22px 0;
  padding: 14px 22px 16px;
  border-top: 1px solid #bcd8d5;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -10px 24px rgba(20, 67, 63, 0.08);
  backdrop-filter: blur(10px);
}

.project-group-save-feedback {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.project-group-save-feedback .inline-message {
  margin: 0;
  padding: 7px 10px;
}

.success-message {
  color: #08685f;
  border: 1px solid #aad7d1;
  background: #eaf8f6;
}

.report-editor-dialog {
  width: min(1480px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.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 {
  display: none;
}

.reconciliation-item-list {
  display: grid;
  gap: 9px;
}

.duplicate-leader-warning {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #e5c078;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8a5500;
  background: var(--amber-pale);
}

.duplicate-leader-warning svg {
  width: 20px;
  flex: 0 0 auto;
}

.duplicate-leader-warning span {
  display: grid;
  gap: 2px;
}

.duplicate-leader-warning small {
  color: #795d2f;
}

.reconciliation-item {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
  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;
}

.reconciliation-item.needs-explanation {
  border-color: #e2b25e;
  border-left-color: #c77800;
  background: #fffaf0;
}

.final-item-identity,
.final-source-comparison,
.final-source-value,
.final-item-state,
.final-item-resolution,
.final-item-note-field {
  min-width: 0;
}

.final-item-identity {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.final-source-comparison {
  grid-column: span 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.final-source-value {
  min-height: 66px;
  align-content: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.74);
}

.final-item-state {
  grid-column: span 3;
}

.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-item-state .work-status {
  min-width: 0;
  justify-content: flex-start;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}

.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 {
  grid-column: span 3;
  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;
}

.final-explanation-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a55d00;
  font-size: 11px;
  font-weight: 800;
}

.final-explanation-hint svg {
  width: 14px;
  height: 14px;
}

.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 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.final-item-note-field textarea {
  min-height: 48px;
  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;
}

/* Workday verification: keep source corrections separate from final approval. */
.workday-workflow-step {
  margin: 18px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.workflow-step-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.workflow-step-heading.compact {
  margin-bottom: 0;
}

.workflow-step-number {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}

.workflow-step-heading h3 {
  margin: 0;
  font-size: 20px;
}

.workflow-step-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.source-workflow-step {
  background: #fbfdfd;
}

.comparison-workflow-step {
  background: #f8fafb;
}

.text-icon-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #afd9d4;
  border-radius: 7px;
  color: var(--teal);
  background: #eff9f7;
  font-weight: 800;
  cursor: pointer;
}

.text-icon-button:hover {
  background: #e4f5f2;
}

.report-source-empty {
  min-height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  border: 1px dashed #afcac7;
  border-radius: 9px;
  color: #46625f;
  background: #f5fbfa;
}

.report-source-empty.leader-empty {
  border-color: #b5c8db;
  color: #385c7a;
  background: #f5f8fc;
}

.report-source-empty > svg {
  width: 26px;
  height: 26px;
}

.report-source-empty > span {
  display: grid;
  gap: 4px;
}

.report-source-empty small {
  color: var(--muted);
}

.source-edit-action-panel {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(320px, 1.6fr) auto;
  align-items: end;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d9e3e2;
  border-radius: 10px;
  background: #f5f7f7;
}

.source-edit-action-panel.has-unsaved-changes {
  border-color: #e1b45f;
  background: #fff9ed;
  box-shadow: inset 4px 0 #d39219;
}

.source-edit-instructions {
  display: grid;
  gap: 5px;
  align-self: center;
}

.source-edit-instructions strong {
  font-size: 15px;
}

.source-edit-instructions span {
  color: var(--muted);
  font-size: 12px;
}

.source-edit-action-panel.has-unsaved-changes .source-edit-instructions span {
  color: #9b5f00;
  font-weight: 800;
}

.source-edit-note-field textarea {
  min-height: 62px;
  resize: vertical;
}

.source-edit-action-panel > button {
  min-height: 44px;
  white-space: nowrap;
}

.borrow-review-section {
  margin: 18px 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.comparison-workflow-step .manual-comparison-grid {
  margin: 18px 0 0;
}

.final-reconciliation-section {
  margin: 18px 0;
  padding: 20px;
  border: 1px solid #b9dcd7;
  background: #f7fcfb;
}

.final-hours-field {
  display: grid;
  gap: 5px;
}

.final-hours-field > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.compact-source-button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #acd6d1;
  border-radius: 6px;
  color: var(--teal);
  background: #edf8f6;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.compact-source-button:hover {
  border-color: var(--teal);
  background: #e0f3f0;
}

.final-note-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 10px;
}

.final-note-controls select,
.final-note-controls textarea {
  width: 100%;
  min-height: 44px;
}

.final-confirmation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px 20px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #9fcfc9;
  border-radius: 10px;
  background: #eaf8f6;
}

.final-approval-note-field textarea {
  min-height: 66px;
  resize: vertical;
}

.final-approval-note-field > small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.final-approval-note-field.required-note > span,
.final-approval-note-field.required-note > small {
  color: #a84438;
  font-weight: 800;
}

.final-approval-note-field.required-note textarea {
  border-color: #d78d82;
  background: #fffafa;
}

.final-confirmation-panel .inline-message {
  grid-column: 1 / -1;
}

.final-confirmation-panel .final-approval-control {
  min-width: 330px;
  justify-content: space-between;
}

.final-confirm-button {
  min-height: 48px;
  padding-inline: 20px;
  font-size: 15px;
}

.editor-dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.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(auto-fit, minmax(135px, 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;
}

.manual-workday-table .worker-identity[data-job-type="铜工"] {
  --job-accent: #c66a13;
  --job-text: #884000;
  --job-muted: #855f3e;
}

.job-copper {
  --job-accent: #c66a13;
  --job-text: #884000;
  --job-background: #fff6ed;
}

.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(auto-fit, 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: repeat(6, minmax(0, 1fr));
    align-items: start;
  }

  .final-item-identity {
    grid-column: span 2;
  }

  .final-source-comparison {
    grid-column: span 4;
  }

  .final-item-state {
    grid-column: span 2;
  }

  .final-item-resolution {
    grid-column: span 4;
  }

  .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-source-comparison,
  .final-item-note-field {
    grid-column: 1 / -1;
  }

  .final-item-state,
  .final-item-resolution {
    grid-column: span 1;
  }

  .project-group-create-panel,
  .project-group-assignment-row {
    grid-template-columns: 1fr;
  }

  .project-group-manager-grid {
    grid-template-columns: 1fr;
  }

  .project-group-names-panel,
  .project-group-assignments-panel {
    max-height: none;
  }

  .project-group-name-list,
  .project-group-assignment-list {
    max-height: 42vh;
  }

  .project-group-assignment-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .project-group-search {
    flex-basis: auto;
    width: 100%;
  }

  .project-group-sticky-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .project-group-save-assignments {
    width: 100%;
  }

  .project-group-name-card {
    grid-template-columns: 40px 1fr auto;
  }

  .project-group-name-card .field {
    grid-column: 2 / -1;
  }

  .project-group-member-count {
    grid-column: 2 / -1;
  }

  .project-summary-heading-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .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-source-comparison,
  .final-item-state,
  .final-item-resolution,
  .final-item-note-field {
    grid-column: auto;
  }

  .final-source-comparison,
  .final-item-note-field,
  .project-group-create-form,
  .project-group-name-card {
    grid-template-columns: 1fr;
  }

  .final-source-value,
  .final-item-state,
  .final-item-resolution,
  .final-item-note-field {
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .project-group-card-icon,
  .project-group-name-card .field,
  .project-group-member-count {
    grid-column: auto;
  }

  .project-group-name-card > button,
  .project-group-save-assignments {
    width: 100%;
  }

  .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%;
  }
}

@media (max-width: 1180px) {
  .source-edit-action-panel,
  .final-confirmation-panel {
    grid-template-columns: 1fr;
  }

  .source-edit-action-panel > button {
    justify-self: start;
  }

  .final-confirmation-panel .final-approval-control {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .workday-workflow-step {
    padding: 15px;
    border-radius: 9px;
  }

  .workflow-step-heading {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .workflow-step-heading .count-badge {
    grid-column: 2;
    justify-self: start;
  }

  .workflow-step-number {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .workflow-step-heading h3 {
    font-size: 18px;
  }

  .final-note-controls {
    grid-template-columns: 1fr;
  }

  .source-edit-action-panel > button,
  .final-confirm-button {
    width: 100%;
  }

  .final-confirmation-panel .final-approval-control {
    display: grid;
    grid-template-columns: 1fr;
  }

  .editor-dialog-actions {
    display: flex;
  }
}

@media (max-width: 520px) {
  .report-editor-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .report-editor-dialog .dialog-content {
    max-height: calc(100vh - 12px);
  }

  .source-edit-action-panel,
  .final-confirmation-panel {
    padding: 13px;
  }

  .source-add-button {
    padding-inline: 9px;
  }
}

/* People administration */
.people-admin-main {
  max-width: 1380px;
}

.people-metrics {
  display: grid;
  grid-template-columns: repeat(4, 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 > div:nth-child(4n) {
  border-right: 0;
}

.people-metrics > div:nth-child(n + 5) {
  border-top: 1px solid var(--line);
}

.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: 1190px;
}

.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="后勤"],
.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;
}

.metric-warning {
  color: #9b341f;
  background: #fff2e9;
}

.monthly-matrix-table .matrix-rate-history {
  min-width: 180px;
  max-width: 260px;
  overflow: hidden;
  color: #526467;
  font-size: 11px;
  text-overflow: ellipsis;
}

.people-table tr[data-job-type="铜工"] {
  --job-accent: #c66a13;
  --job-text: #884000;
}

.employee-password-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.password-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.password-input-row .icon-button {
  width: 44px;
  height: 44px;
  align-self: end;
  border: 1px solid var(--line);
}

.employee-clear-password-field {
  grid-column: 1 / -1;
}

.employee-password-cell {
  min-width: 142px;
}

.password-view-button {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #b9dcd8;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  background: var(--teal-pale);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.password-view-button svg {
  width: 16px;
  height: 16px;
}

.password-view-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.password-plain {
  min-width: 38px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.password-unset-badge {
  color: var(--amber);
  font-size: 12px;
  font-weight: 750;
}

.employee-wechat-cell {
  min-width: 164px;
}

.employee-wechat-cell .table-secondary {
  display: block;
  margin-top: 5px;
}

.wechat-binding-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.wechat-binding-badge svg {
  width: 14px;
  height: 14px;
}

.wechat-binding-badge.bound {
  color: #057a55;
  background: #e7f8f1;
}

.wechat-binding-badge.unbound {
  color: #8a5a0a;
  background: #fff4d8;
}

.employee-wechat-binding {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #ecd7aa;
  border-radius: 9px;
  background: #fffaf0;
}

.employee-wechat-binding.bound {
  border-color: #b8e1d5;
  background: #f1fbf7;
}

.employee-wechat-icon {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #8a5a0a;
  background: #fff0c7;
}

.employee-wechat-binding.bound .employee-wechat-icon {
  color: #057a55;
  background: #dff5ec;
}

.employee-wechat-icon svg {
  width: 21px;
  height: 21px;
}

.employee-wechat-binding strong,
.employee-wechat-binding small {
  display: block;
}

.employee-wechat-binding small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.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(2, minmax(0, 1fr));
  }

  .people-metrics > div:nth-child(2n) {
    border-right: 0;
  }

  .people-metrics > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .people-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .employee-wechat-binding {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .employee-wechat-binding .danger-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* 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: grid;
  gap: 12px;
  margin: 22px 0 18px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.leader-worker-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.leader-worker-search-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.leader-worker-search-copy > svg {
  width: 20px;
  height: 20px;
  color: var(--teal);
}

.leader-worker-search-copy span {
  display: grid;
  gap: 2px;
}

.leader-worker-search-copy strong {
  font-size: 14px;
}

.leader-worker-search-copy small {
  color: var(--muted);
  font-size: 12px;
}

.leader-report-toolbar .leader-worker-search-field {
  width: min(100%, 390px);
  min-height: 44px;
  flex: 0 1 390px;
  background: #fff;
}

.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-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.borrow-team-overview p {
  margin: 0;
}

.borrow-team-overview strong {
  color: var(--ink);
}

.borrow-empty-team-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.borrow-empty-team-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.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-employee-report {
  min-width: 190px;
}

.borrow-employee-report > strong,
.borrow-employee-report > small {
  display: block;
}

.borrow-report-ok {
  color: var(--teal);
}

.borrow-report-mismatch,
.borrow-report-warning {
  color: var(--warning-dark, #9a5b00);
}

.borrow-report-warning {
  max-width: 260px;
  white-space: normal;
}

.borrow-report-missing {
  color: var(--muted);
}

.borrow-team-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.borrow-team-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 76px;
  padding: 16px;
  color: var(--muted);
  background: color-mix(in srgb, var(--soft) 56%, transparent);
  font-weight: 650;
}

.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%;
  }

  .borrow-team-overview {
    align-items: flex-start;
    flex-direction: column;
  }
}

.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="后勤"],
.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.temporary-worker-row td {
  background: #fff8e8;
}

.leader-worker-row.temporary-worker-row td:first-child {
  box-shadow: inset 4px 0 #c46b16;
}

.temporary-worker-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 7px;
  border: 1px solid #e3a145;
  border-radius: 6px;
  background: #fff1cf;
  color: #8b4d08;
  font-size: 12px;
  font-weight: 700;
}

.leader-worker-row[data-job-type="铜工"] {
  --job-accent: #c66a13;
  --job-text: #884000;
  --job-muted: #855f3e;
}

.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-worker-search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .leader-report-toolbar .leader-worker-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 {
  position: relative;
  overflow: visible;
  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;
}

.employee-situation-controls,
.employee-situation-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.employee-situation-filters {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-situation-filters .search-field {
  flex: 1 1 320px;
}

.employee-situation-metrics {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  background: #fff;
}

.employee-situation-metrics article {
  min-height: 82px;
  padding: 15px 18px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.employee-situation-metrics article + article {
  border-left: 1px solid var(--line);
}

.employee-situation-metrics small,
.employee-situation-stat small {
  color: var(--muted);
}

.employee-situation-metrics strong {
  font-size: 24px;
}

.employee-situation-metrics .warn strong,
.employee-situation-stat.warn strong { color: var(--amber); }
.employee-situation-metrics .bad strong,
.employee-situation-stat.bad strong { color: var(--red); }

.employee-situation-cards {
  display: grid;
  gap: 9px;
}

.employee-situation-card {
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(110px, 0.8fr)) auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  color: var(--ink);
  background: #fff;
}

.employee-situation-card:hover { background: #f8fbfb; }
.employee-situation-card.has-absence {
  border-left-color: var(--red);
  background: #fffafa;
}

.employee-situation-identity,
.employee-situation-stat { display: grid; gap: 4px; min-width: 0; }
.employee-situation-identity strong { font-size: 17px; }
.employee-situation-identity small { color: var(--muted); }
.employee-situation-stat strong { font-size: 15px; }
.employee-situation-open { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); font-weight: 800; white-space: nowrap; }
.employee-situation-open svg { width: 17px; }

.employee-situation-dialog { width: min(calc(100% - 32px), 1500px); }
.employee-situation-detail-table { min-width: 1240px; }
.employee-detail-projects { display: block; max-width: 300px; white-space: normal; line-height: 1.55; }
.attendance-outcome { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.attendance-outcome.absent { color: #a8241f; background: #ffe9e7; }
.attendance-outcome.exempt { color: #76550d; background: #fff3cf; }
.attendance-outcome.present { color: #16704f; background: #e6f5ed; }
.attendance-outcome.rest { color: #53636a; background: #eef2f3; }

.attendance-exempt-field {
  grid-column: 1 / -1;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid #efc46b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fff9e9;
}

.attendance-exempt-field input { width: 20px; height: 20px; accent-color: var(--teal); }
.attendance-exempt-field span { display: grid; gap: 3px; }
.attendance-exempt-field small { color: var(--muted); }

@media (max-width: 900px) {
  .employee-situation-toolbar { align-items: stretch; flex-direction: column; }
  .employee-situation-controls,
  .employee-situation-filters {
    width: 100%;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .employee-situation-controls .compact-date { flex: 1 1 210px; }
  .employee-situation-filters .search-field { flex: 1 1 280px; }
  .employee-situation-filters .compact-select { flex: 1 1 150px; }
  .employee-situation-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-situation-metrics article + article { border-left: 0; border-top: 1px solid var(--line); }
  .employee-situation-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-situation-identity,
  .employee-situation-open { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .employee-situation-controls,
  .employee-situation-filters { align-items: stretch; flex-direction: column; }
  .employee-situation-controls .compact-date,
  .employee-situation-controls .secondary-button,
  .employee-situation-filters .search-field,
  .employee-situation-filters .compact-select {
    width: 100%;
    flex: none;
  }
  .employee-situation-metrics { grid-template-columns: 1fr 1fr; }
  .employee-situation-card { grid-template-columns: 1fr 1fr; gap: 12px; }
}

.wide-dialog {
  width: min(calc(100% - 32px), 1080px);
  max-height: 92vh;
}

.site-settings-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-color, #d7e0e2);
  border-radius: 8px;
  background: #fff;
}

.site-settings-section + .site-settings-section {
  margin-top: 14px;
}

.site-settings-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #087b73;
}

.site-settings-heading > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.site-settings-heading span {
  display: grid;
  gap: 2px;
}

.site-settings-heading small,
.readonly-setting p {
  color: #64767b;
  line-height: 1.55;
}

.readonly-setting {
  background: #f4f9f8;
}

.readonly-setting p {
  margin: 0;
}

.reconciliation-dimensions {
  display: grid;
  gap: 6px;
}

.reconciliation-dimension {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.reconciliation-dimension > small:first-child {
  padding-top: 4px;
  color: #6d7d81;
}

@media (max-width: 640px) {
  .site-settings-section {
    padding: 14px;
  }
}

.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;
  padding: 8px 8px 4px 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.leader-project-tabs button {
  position: relative;
  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;
}

#leaderShiftTabs button {
  position: relative;
  overflow: visible;
}

#leaderShiftTabs {
  padding-top: 8px;
  padding-right: 8px;
  overflow: visible;
}

.leader-reminder-badge {
  position: absolute;
  z-index: 2;
  top: -7px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #d7352f;
  box-shadow: 0 1px 3px rgb(117 24 20 / 24%);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  opacity: 1;
  pointer-events: none;
}

.leader-project-tabs button .leader-reminder-badge,
#leaderShiftTabs button .leader-reminder-badge {
  margin: 0;
  color: #fff;
  opacity: 1;
}

.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%;
  }
}
.danger-text {
  color: #b52d25;
}

.project-delete-impact {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e6c7c2;
  border-radius: 12px;
  background: #fff9f8;
}

.project-delete-impact-summary,
.project-delete-impact-grid {
  display: grid;
  gap: 10px;
}

.project-delete-impact-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.project-delete-impact span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 9px;
  background: #fff;
}

.project-delete-impact small {
  color: var(--muted);
}

@media (max-width: 680px) {
  .project-delete-impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
