.page-grid {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.hero-band {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 28px;
}

.hero-band.emerald { background: var(--secondary); }
.hero-band.dark { background: var(--sidebar); }
.hero-band.amber { background: var(--accent); color: var(--foreground); }

.hero-band::after {
  position: absolute;
  right: -40px;
  top: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.14);
  content: "";
}

.hero-band h2 {
  position: relative;
  z-index: 1;
  margin: 10px 0 4px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
}

.hero-band p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgb(255 255 255 / 0.78);
}

.hero-band .button {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

.hero-band .button.outline {
  background: #fff;
  color: var(--primary);
  box-shadow:
    inset 0 0 0 1px rgb(11 58 120 / 0.12),
    0 12px 24px rgb(17 24 39 / 0.16);
}

.hero-band .button.outline:hover {
  background: #eff6ff;
  transform: translateY(-1px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.stat-card span,
.stat-card small {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 700;
}

.stat-card strong {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.stat-card.blue { background: #dbeafe; }
.stat-card.emerald { background: #d1fae5; }
.stat-card.amber { background: #fef3c7; }
.stat-card.gray { background: #fff; }

.panel {
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  padding: 20px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head > .button {
  flex: 0 0 auto;
}

.panel-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.action-card {
  display: grid;
  gap: 6px;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  transition: transform 160ms ease, background-color 160ms ease;
}

.action-card:hover { transform: scale(1.02); background: #eff6ff; }
.action-card strong { font-size: 16px; }
.action-card span { color: var(--muted-foreground); font-size: 13px; }

.payroll-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.payroll-actions form {
  margin: 0;
}

.payroll-actions .button {
  min-width: 114px;
}

.payroll-page {
  max-width: 100%;
}

.payroll-stats .stat-card strong {
  font-size: clamp(22px, 3vw, 30px);
}

.payroll-week-panel {
  padding: 16px 20px;
}

.payroll-week-head {
  margin-bottom: 0;
}

.payroll-week-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.payroll-nav-button {
  min-width: 104px;
  box-shadow: inset 0 0 0 1px var(--border);
}

.payroll-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 20px;
  min-width: 0;
}

.payroll-preview-panel,
.payroll-preview-panel .panel-head,
.payroll-preview-grid,
.payroll-run-list,
.payroll-item-list {
  min-width: 0;
}

.payroll-preview-grid,
.payroll-item-list {
  display: grid;
  gap: 12px;
}

.payroll-preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payroll-member-card,
.payroll-item-row {
  display: grid;
  min-width: 0;
  gap: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.payroll-item-row {
  background: #f8fafc;
}

.payroll-card-head,
.payroll-run-summary {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.payroll-card-head > div,
.payroll-run-summary > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.payroll-card-head strong,
.payroll-run-summary h2 {
  overflow-wrap: anywhere;
}

.payroll-card-head span,
.payroll-run-summary p,
.payroll-run-link small,
.payroll-paid-note {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 800;
}

.payroll-card-head b {
  flex: 0 0 auto;
  color: var(--primary);
}

.payroll-metrics,
.payroll-run-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.payroll-run-totals {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0;
}

.payroll-metrics span,
.payroll-run-totals span {
  display: grid;
  gap: 2px;
  border-radius: 8px;
  background: var(--muted);
  padding: 10px;
  min-width: 0;
}

.payroll-metrics b,
.payroll-run-totals b {
  overflow-wrap: anywhere;
}

.payroll-metrics small,
.payroll-run-totals small {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.payroll-source-details {
  min-width: 0;
}

.payroll-source-details summary {
  cursor: var(--cursor-pointer);
  color: var(--primary);
  font-weight: 900;
}

.payroll-source-details .table-wrap {
  margin-top: 10px;
}

.payroll-source-details th,
.payroll-source-details td {
  padding: 9px 8px;
}

.payroll-run-list {
  display: grid;
  gap: 10px;
}

.payroll-run-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--foreground);
  padding: 12px;
  text-decoration: none;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.payroll-run-link:hover,
.payroll-run-link.active {
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.payroll-run-link:hover {
  transform: translateY(-1px);
}

.payroll-run-link span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.payroll-run-link strong,
.payroll-run-link small {
  overflow-wrap: anywhere;
}

.payroll-run-summary {
  flex-wrap: wrap;
}

.payroll-run-summary h2 {
  margin: 0;
  font-size: 22px;
}

.payroll-run-summary p {
  margin: 0;
}

.payroll-run-summary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.payroll-run-summary-actions form {
  margin: 0;
}

.payroll-paid-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.clock-card {
  display: grid;
  max-width: 520px;
  gap: 18px;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  padding: 24px;
}

.clock-face {
  border-radius: 8px;
  background: var(--sidebar);
  color: #fff;
  padding: 28px;
  text-align: center;
}

.clock-face strong {
  display: block;
  font-size: clamp(42px, 12vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.location-capture {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.location-status {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 800;
}

.location-status[data-state="success"] {
  color: #047857;
}

.location-status[data-state="error"] {
  color: #b91c1c;
}

.photo-capture {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.photo-capture > .button {
  flex: 0 0 auto;
}

.photo-capture [hidden] {
  display: none !important;
}

.photo-capture .photo-status {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 800;
  flex: 1 1 160px;
}

.photo-capture .photo-status[data-state="success"] {
  color: #047857;
}

.photo-capture .photo-status[data-state="error"] {
  color: #b91c1c;
}

.photo-capture .photo-preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.clock-photo-panel {
  width: min(520px, 100%);
}

.clock-photo-camera {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #020617;
  aspect-ratio: 4 / 3;
}

.clock-photo-camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.settings-block {
  display: grid;
  gap: 14px;
  padding-top: 0;
}

.settings-block legend {
  width: 100%;
  margin-bottom: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.settings-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-requirements label {
  min-width: 0;
  white-space: nowrap;
}

.settings-requirements span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-location-tool {
  justify-content: space-between;
}

@media (max-width: 720px) {
  .settings-requirements {
    grid-template-columns: 1fr;
  }
}

.clock-notice {
  display: grid;
  gap: 4px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  padding: 12px;
}

.clock-notice strong {
  color: #78350f;
}

.clock-notice span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.dot {
  margin-top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgb(11 58 120 / 0.08);
}

.timeline-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.timeline-content strong {
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.15;
}

.timeline-time {
  display: block;
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.timeline-item .badge {
  justify-self: end;
  margin-top: 0;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.error-page { background: var(--muted); }
