:root {
  color-scheme: light;
  --ink: #15211d;
  --muted: #66736d;
  --panel: #ffffff;
  --paper: #f3f6f4;
  --line: #d9e1dd;
  --brand: #173f35;
  --brand-2: #0f6f61;
  --gold: #d6a440;
  --steel: #52616c;
  --danger: #b64231;
  --warning: #bf7b20;
  --success: #2f7d4f;
  --shadow: 0 14px 34px rgba(17, 34, 28, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(23, 63, 53, 0.12), rgba(243, 246, 244, 0) 280px),
    var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 0 92px;
  background: var(--paper);
  position: relative;
  overflow-x: hidden;
}

.hero {
  min-height: 210px;
  position: relative;
  overflow: hidden;
  background: var(--brand);
}

.hero__image {
  width: 100%;
  height: 238px;
  object-fit: cover;
  display: block;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 31, 27, 0.08), rgba(14, 31, 27, 0.68)),
    linear-gradient(90deg, rgba(14, 31, 27, 0.7), rgba(14, 31, 27, 0.14));
}

.hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 18px 20px;
  color: #fff;
}

.eyebrow {
  margin: 0 0 4px;
  color: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  opacity: 0.72;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.28rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.02rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 12px 8px;
  background: var(--paper);
}

.metric {
  min-height: 68px;
  padding: 11px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.metric.is-active {
  border-color: rgba(15, 111, 97, 0.56);
  box-shadow: 0 0 0 2px rgba(15, 111, 97, 0.12);
  transform: translateY(-1px);
}

.metric__value {
  display: block;
  color: var(--brand);
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1;
}

.metric__label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.1;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  padding: 8px 12px 14px;
}

.search-field {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.primary-action,
.save-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  padding: 0 13px;
}

.primary-action--gold {
  background: var(--gold);
  color: #241b0c;
}

.primary-action--steel {
  background: var(--steel);
}

.save-button {
  width: 100%;
  margin-top: 18px;
  padding: 0 16px;
}

.view {
  display: none;
  padding: 0 12px 10px;
}

.view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
}

.section-heading .eyebrow {
  color: var(--brand-2);
}

.date-pill,
.status-chip,
.priority-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 100%;
  border-radius: 999px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.date-pill {
  border: 1px solid #c9d4cf;
  background: #fff;
  color: var(--steel);
}

.compact-select {
  max-width: 172px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
  font-weight: 700;
}

.alert-band {
  margin: 0 0 12px;
  padding: 12px;
  border-left: 4px solid var(--warning);
  border-radius: 8px;
  background: #fff8ec;
  color: #5b3b13;
  font-size: 0.9rem;
  font-weight: 700;
}

.project-list,
.materials-list,
.crew-list,
.payroll-worker-list,
.attendance-day-list {
  display: grid;
  gap: 10px;
}

.project-card,
.material-card,
.crew-card,
.empty-state {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(21, 33, 29, 0.04);
}

.project-card {
  display: grid;
  gap: 11px;
  padding: 13px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.project-card:focus-visible,
.icon-button:focus-visible,
.metric:focus-visible,
.owner-card:focus-visible,
.owner-filter__button:focus-visible,
.primary-action:focus-visible,
.save-button:focus-visible,
.nav-button:focus-visible {
  outline: 3px solid rgba(214, 164, 64, 0.55);
  outline-offset: 2px;
}

.project-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.project-card__title {
  min-width: 0;
}

.project-card__title p,
.project-meta,
.mini-label {
  color: var(--muted);
}

.project-card__title p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-chip[data-status="Planning"] {
  background: #edf5ff;
  color: #245f93;
}

.status-chip[data-status="In progress"] {
  background: #e9f7f1;
  color: var(--success);
}

.status-chip[data-status="Cash risk"] {
  background: #fff4e2;
  color: var(--warning);
}

.status-chip[data-status="Needs slip"],
.status-chip[data-status="Suggested match"],
.status-chip[data-status="Owner review"],
.status-chip[data-status="Office approval"] {
  background: #fff4e2;
  color: var(--warning);
}

.status-chip[data-status="Over budget"],
.status-chip[data-status="Needs approval"] {
  background: #f8e8e4;
  color: var(--danger);
}

.status-chip[data-status="Ready for invoice"] {
  background: #f2ecff;
  color: #6551a6;
}

.status-chip[data-status="Complete"] {
  background: #edf0ee;
  color: var(--steel);
}

.status-chip[data-status="Matched"] {
  background: #e9f7f1;
  color: var(--success);
}

.status-chip[data-status="Ignored"] {
  background: #edf0ee;
  color: var(--steel);
}

.priority-chip {
  background: #f8e8e4;
  color: var(--danger);
}

.type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.type-chip[data-type="S0"] {
  background: #e8f1ed;
  color: var(--brand);
}

.type-chip[data-type="CE"] {
  background: #eef2f5;
  color: var(--steel);
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece9;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-2), var(--gold));
}

.progress-fill.is-danger {
  background: linear-gradient(90deg, var(--warning), var(--danger));
}

.progress-percent {
  min-width: 44px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: right;
}

.mini-label {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.finance-mini-grid,
.cash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.finance-mini-grid span,
.cash-grid span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.finance-mini-grid strong,
.cash-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.86rem;
  white-space: nowrap;
}

.text-danger {
  color: var(--danger) !important;
}

.bottom-nav {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(21, 33, 29, 0.12);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.nav-button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
}

.nav-button.is-active {
  background: #e8f1ed;
  color: var(--brand);
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.icon-button--light {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(10px);
}

.material-card,
.crew-card,
.empty-state {
  padding: 13px;
}

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

.bank-panel,
.bank-section,
.bank-lane {
  display: grid;
  gap: 10px;
}

.bank-panel,
.bank-import-panel,
.bank-close-panel,
.sync-panel,
.payroll-panel,
.payroll-card,
.attendance-day-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bank-close-panel {
  display: grid;
  gap: 10px;
}

.bank-close-panel.needs-action {
  border-color: rgba(191, 123, 32, 0.4);
  background: #fff8ec;
}

.bank-close-panel.is-closed {
  border-color: #c7e2d3;
  background: #f0faf4;
}

.bank-import-panel {
  display: grid;
  gap: 10px;
}

.sync-panel {
  display: grid;
  gap: 10px;
}

.sync-field {
  display: grid;
  gap: 6px;
}

.sync-field span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.sync-field input {
  min-width: 0;
  min-height: 42px;
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.bank-panel__top,
.section-mini-heading,
.bank-transaction__top,
.payroll-card__top,
.attendance-day-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bank-kpi-grid,
.owner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bank-kpi-grid span,
.owner-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.bank-kpi-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.bank-kpi-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.05rem;
}

.payroll-panel,
.payroll-card,
.attendance-day-card {
  display: grid;
  gap: 10px;
}

.payroll-card.needs-review,
.attendance-day-card.needs-review {
  border-color: rgba(191, 123, 32, 0.36);
  background: #fffaf1;
}

.payroll-card__top h3,
.attendance-day-card__top h3 {
  margin-bottom: 3px;
}

.payroll-card__top > strong,
.attendance-day-card__top > strong {
  color: var(--brand);
  font-size: 1rem;
  white-space: nowrap;
}

.payroll-card__grid,
.attendance-day-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.attendance-day-card__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payroll-card__grid span,
.attendance-day-card__grid span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.payroll-card__grid strong,
.attendance-day-card__grid strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.82rem;
  white-space: nowrap;
}

.sync-safety,
.sync-meta {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(191, 123, 32, 0.36);
  border-radius: 8px;
  background: #fff8ec;
}

.sync-safety strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
}

.sync-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.sync-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand-2);
}

.sync-meta {
  background: var(--paper);
  border-color: var(--line);
}

.sync-meta span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.sync-meta code {
  min-width: 0;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.payroll-week-button {
  margin-top: 2px;
}

.bank-rule,
.bank-reference,
.bank-import-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.file-drop,
.pending-paste {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.file-drop input,
.pending-paste textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--ink);
  padding: 9px;
}

.pending-paste textarea {
  resize: vertical;
  line-height: 1.35;
}

.bank-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.owner-filter__button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.owner-filter__button.is-active {
  border-color: rgba(15, 111, 97, 0.52);
  background: #e8f1ed;
  color: var(--brand);
}

.bank-close-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bank-close-numbers span {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(21, 33, 29, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-align: center;
}

.section-mini-heading {
  align-items: center;
}

.section-mini-heading h3 {
  margin: 0;
}

.section-mini-heading span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.owner-card {
  display: grid;
  gap: 8px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.owner-card.needs-action {
  border-color: rgba(191, 123, 32, 0.4);
  background: #fff8ec;
}

.owner-card.is-active {
  border-color: rgba(15, 111, 97, 0.52);
  box-shadow: 0 0 0 2px rgba(15, 111, 97, 0.1);
}

.owner-card strong,
.owner-card span {
  display: block;
}

.owner-card strong {
  font-size: 0.9rem;
}

.owner-card span,
.owner-card__numbers {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.owner-card__numbers {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.bank-feed {
  display: grid;
  gap: 9px;
}

.bank-batches {
  display: grid;
  gap: 9px;
}

.import-batch {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.import-batch.needs-review {
  border-color: rgba(191, 123, 32, 0.4);
  background: #fff8ec;
}

.import-batch__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.import-batch__numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.import-batch__numbers span {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(21, 33, 29, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.import-batch__numbers strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.98rem;
}

.bank-lanes {
  display: grid;
  gap: 12px;
}

.bank-lane {
  padding-top: 2px;
}

.bank-transaction {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bank-transaction[data-bank-status="Needs slip"],
.bank-transaction[data-bank-status="Suggested match"],
.bank-transaction[data-bank-status="Owner review"],
.bank-transaction[data-bank-status="Office approval"] {
  border-color: rgba(191, 123, 32, 0.36);
}

.bank-transaction__top h3 {
  margin-bottom: 2px;
}

.bank-transaction__top strong {
  white-space: nowrap;
  color: var(--brand);
}

.bank-meta,
.bank-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bank-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.match-box {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid #ead8aa;
  border-radius: 8px;
  background: #fff8ec;
  font-size: 0.82rem;
}

.match-box.is-matched {
  border-color: #c7e2d3;
  background: #f0faf4;
}

.match-box span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.match-box small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.material-card {
  display: grid;
  gap: 12px;
}

.finance-card {
  gap: 13px;
}

.finance-rows {
  display: grid;
  gap: 7px;
}

.finance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.finance-row:first-child {
  border-top: 0;
}

.finance-row.is-over {
  color: var(--danger);
}

.finance-row strong {
  white-space: nowrap;
}

.form-purpose {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.capture-rule {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #ead8aa;
  border-radius: 8px;
  background: #fff8ec;
  color: #5b3b13;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.material-card__top,
.crew-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.material-row strong {
  font-weight: 800;
}

.material-row span:last-child {
  color: var(--muted);
  font-weight: 750;
}

.detail-block .material-row span:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.material-row input[type="number"] {
  width: 66px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
  text-align: right;
}

.budget-edit {
  display: grid;
  gap: 10px;
}

.budget-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.budget-edit-row.is-over {
  border-color: rgba(182, 66, 49, 0.38);
  background: #fff7f5;
}

.budget-edit-row > strong {
  color: var(--brand);
  font-size: 0.92rem;
}

.budget-edit-row label {
  display: grid;
  gap: 5px;
}

.budget-edit-row label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.budget-edit-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  text-align: right;
}

.bucket-remaining {
  justify-self: start;
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 900;
}

.submission-list {
  display: grid;
  gap: 7px;
}

.submission-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 6px 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.submission-row:first-child {
  border-top: 0;
}

.submission-row span:nth-child(3),
.submission-row span:nth-child(4) {
  color: var(--muted);
  font-weight: 750;
}

.submission-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-action--small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.secondary-action--danger {
  border-color: rgba(182, 66, 49, 0.36);
  color: var(--danger);
}

.detail-action {
  width: 100%;
  margin-top: 10px;
}

.crew-card {
  display: grid;
  gap: 10px;
}

.crew-card__projects {
  display: grid;
  gap: 8px;
}

.crew-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.sheet {
  width: min(100%, 520px);
  max-width: 520px;
  max-height: 91dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.sheet::backdrop {
  background: rgba(18, 27, 24, 0.42);
}

.sheet__panel {
  max-height: 91dvh;
  overflow: auto;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  border-radius: 8px 8px 0 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sheet__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.sheet__top .eyebrow {
  color: var(--brand-2);
}

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

.detail-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.detail-block h3 {
  margin-bottom: 10px;
}

.finance-training {
  margin: 10px 0 0;
  padding: 10px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fff8ec;
  color: #5b3b13;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.payroll-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.payroll-strip span {
  display: grid;
  gap: 4px;
  min-height: 52px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.payroll-strip strong {
  color: var(--brand);
  font-size: 0.9rem;
  line-height: 1.1;
}

.detail-action-grid {
  display: grid;
  gap: 8px;
}

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

.detail-grid label,
.form-grid label {
  display: grid;
  gap: 6px;
}

.labour-picker {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.labour-picker legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.labour-picker__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.labour-picker__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 220px;
  overflow: auto;
}

.labour-option {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.labour-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand-2);
}

.labour-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.labour-option strong,
.labour-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.labour-option strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.15;
}

.labour-option small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.attendance-batch {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.attendance-batch__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.attendance-batch__top span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.attendance-batch__rows {
  display: grid;
  gap: 9px;
}

.attendance-batch-row {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.attendance-batch-row__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.attendance-batch-row__top strong,
.attendance-batch-row__top small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-batch-row__top small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.attendance-batch-row__totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  text-align: right;
}

.attendance-batch-row__totals span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.attendance-batch-row__totals strong {
  color: var(--brand);
  font-size: 0.84rem;
}

.attendance-batch-row__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.attendance-batch-row__grid label {
  display: grid;
  gap: 5px;
}

.attendance-batch-row__grid label span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.attendance-batch-row__grid input {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
}

.detail-grid span,
.form-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.detail-grid input,
.detail-grid select,
.detail-grid textarea,
.form-grid input,
.form-grid select,
.form-grid textarea,
.note-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  outline: 0;
}

.detail-grid textarea,
.form-grid textarea,
.note-form textarea {
  resize: vertical;
  min-height: 78px;
}

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

.checklist {
  display: grid;
  gap: 8px;
}

.check-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 750;
}

.check-item:last-child {
  border-bottom: 0;
}

.check-item input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand-2);
}

.notes {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
}

.note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.note:last-child {
  border-bottom: 0;
}

.note p {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.note time {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.note-form {
  display: grid;
  gap: 8px;
}

.secondary-action {
  min-height: 40px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 850;
}

.secondary-action:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.62;
}

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

@media (max-width: 360px) {
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .primary-action {
    width: 100%;
  }

  .detail-grid,
  .form-grid,
  .payroll-strip,
  .labour-picker__list,
  .attendance-batch-row__top,
  .attendance-batch-row__grid,
  .payroll-card__grid,
  .attendance-day-card__grid {
    grid-template-columns: 1fr;
  }

  .attendance-batch-row__totals {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (min-width: 760px) {
  body {
    padding: 18px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 36px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
}
