:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  color: #1f2933;
  background: #f5f7fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #d9e2ec;
}

.nav {
  width: min(1000px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 64px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: #102a43;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  display: inline-block;
  border: 1px solid #334e68;
  border-radius: 6px;
  background: #334e68;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 12px;
}

.nav-links a:hover {
  background: #243b53;
  border-color: #243b53;
}

.link-button {
  color: #1d4ed8;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.link-button:hover {
  text-decoration: underline;
}

.nav-user {
  color: #52606d;
  font-size: 14px;
}

.inline-form {
  margin: 0;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.page-shell {
  width: min(1000px, calc(100% - 32px));
  margin: 40px auto;
}

h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

h2 {
  margin: 0;
  font-size: 20px;
}

p {
  margin: 0;
}

.page-title {
  margin-bottom: 24px;
}

.page-title p {
  color: #52606d;
}

.card {
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 24px;
}

.form {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.employee-form {
  max-width: 720px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.batch-form {
  display: block;
}

.batch-meta {
  max-width: none;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 16px;
}

.batch-lines {
  display: grid;
  gap: 12px;
}

.batch-line {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px 18px;
}

.batch-line-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.batch-line-head strong {
  font-size: 15px;
}

.batch-line-head span {
  color: #52606d;
  font-size: 13px;
}

.batch-line-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
}

.batch-line-wide {
  grid-column: span 2;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  min-height: 44px;
  font-weight: 400;
}

.check-inline input {
  width: auto;
}

@media (max-width: 820px) {
  .batch-line-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.full-width {
  grid-column: 1 / -1;
}

.form-help {
  color: #52606d;
  font-size: 14px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  background: #ffffff;
  padding: 10px 12px;
  font: inherit;
}

input[type="checkbox"] {
  width: auto;
}

textarea {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

button {
  width: fit-content;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  background: #1d4ed8;
  color: #ffffff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #1e40af;
}

button:disabled {
  border-color: #9aa5b1;
  background: #cbd2d9;
  color: #52606d;
  cursor: not-allowed;
}

button:disabled:hover {
  background: #cbd2d9;
}

.button-link {
  display: inline-block;
  width: fit-content;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  background: #1d4ed8;
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  background: #1e40af;
}

.danger-button {
  border-color: #b91c1c;
  background: #b91c1c;
}

.danger-button:hover {
  background: #991b1b;
}

.toolbar,
.actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.form-actions {
  grid-column: 1 / -1;
}

.hours-form {
  max-width: 760px;
}

.hours-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(2, minmax(120px, 160px));
  gap: 10px;
  align-items: center;
}

.hours-grid label {
  margin-bottom: 0;
}

.hours-header {
  color: #52606d;
  font-size: 14px;
  font-weight: 700;
}

.total-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.total-box {
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px 12px;
}

.section-gap {
  margin-top: 20px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #d9e2ec;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #52606d;
  font-size: 14px;
}

.spreadsheet-table {
  min-width: 1040px;
}

.spreadsheet-table th,
.spreadsheet-table td {
  padding: 8px;
}

.spreadsheet-table input {
  min-width: 88px;
  padding: 8px 10px;
}

.spreadsheet-table .employee-cell {
  min-width: 180px;
}

.employee-cell strong,
.employee-cell span {
  display: block;
}

.employee-cell span {
  color: #52606d;
  font-size: 13px;
}

.checkbox-cell {
  text-align: center;
}

.checkbox-cell input {
  min-width: 0;
}

.pay-table {
  min-width: 1120px;
}

.alert {
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.alert ul {
  margin: 0;
  padding-left: 20px;
}

.alert-error {
  border: 1px solid #f5c2c7;
  background: #f8d7da;
  color: #842029;
}

.alert-warning {
  border: 1px solid #facc15;
  background: #fef9c3;
  color: #713f12;
}

.info-box {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}

.info-box h2 {
  margin-bottom: 8px;
}

.info-box button {
  margin-top: 14px;
}

.correction-form {
  max-width: 640px;
}

.preserve-lines {
  white-space: pre-wrap;
}

.stack {
  display: grid;
  gap: 12px;
}

.badge {
  width: fit-content;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}

/* Owner dashboard: payrolls awaiting approval */
.approval-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.approval-list {
  display: grid;
  gap: 12px;
}

.approval-card {
  display: grid;
  gap: 16px;
  border-left: 4px solid #1d4ed8;
}

.approval-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.approval-period {
  margin: 8px 0 4px;
  font-size: 18px;
}

.approval-sub {
  color: #52606d;
  font-size: 14px;
}

.approval-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.approval-stats .total-box {
  display: grid;
  gap: 2px;
}

.stat-label {
  color: #52606d;
  font-size: 13px;
}

.approval-stats strong {
  font-size: 16px;
}

.needs-approval-pill {
  display: inline-block;
  border-radius: 999px;
  background: #fef9c3;
  color: #713f12;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 0 7px;
}

.empty-state {
  color: #52606d;
}

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .nav-links {
    justify-content: flex-start;
  }

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

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

  .hours-grid {
    grid-template-columns: 1fr;
  }

  .hours-header {
    display: none;
  }

  .batch-line-grid {
    grid-template-columns: 1fr;
  }

  .batch-line-wide {
    grid-column: auto;
  }
}
