:root {
  --ink: #082745;
  --blue: #063d73;
  --bright: #0797d8;
  --soft: #eef8fc;
  --line: #c8e4f1;
  --white: #ffffff;
  --muted: #5c6f7f;
  --good: #14805e;
  --warn: #b85600;
  --bad: #a82028;
  --shadow: 0 18px 48px rgba(8, 39, 69, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #f7fbfd;
  line-height: 1.5;
}

a {
  color: var(--blue);
  font-weight: 800;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

nav a {
  min-height: 42px;
  padding: 10px 12px;
  text-decoration: none;
}

.portal-link,
.button.primary {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 46px) 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(24px, 5vw, 54px);
  align-items: center;
  min-height: 560px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--bright);
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  color: var(--blue);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.lead {
  color: #213c53;
  font-size: 20px;
}

.panel,
.portal-card {
  padding: clamp(20px, 4vw, 34px);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel.narrow {
  max-width: 780px;
  margin: 0 auto;
}

.portal-card {
  background: linear-gradient(180deg, var(--blue), #0a4b84);
  color: var(--white);
}

.portal-card h2 {
  color: var(--white);
}

.portal-card li {
  margin: 10px 0;
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 2px solid var(--blue);
  color: var(--blue);
  background: var(--white);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  color: var(--blue);
  background: var(--white);
}

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

.form-grid.compact {
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-weight: 800;
}

label span {
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #b9d8e8;
  font: inherit;
}

textarea {
  min-height: 116px;
  resize: vertical;
}

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

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.check input {
  width: 22px;
  min-height: 22px;
  margin-top: 2px;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--soft);
  border-left: 5px solid var(--bright);
  font-weight: 800;
}

.flash.success {
  border-color: var(--good);
}

.flash.error {
  border-color: var(--bad);
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.mini-card,
.ledger-row {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 14px;
  color: var(--ink);
  background: #f8fbfd;
  border: 1px solid var(--line);
  text-decoration: none;
}

.mini-card strong,
.ledger-row strong {
  color: var(--blue);
}

.mini-card span,
.ledger-row span,
.muted {
  color: var(--muted);
}

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

.ledger-row:nth-child(even) {
  background: #eef8fc;
}

.ledger-row details {
  margin-top: 8px;
}

.ledger-row summary {
  min-height: 44px;
  padding: 10px 12px;
  color: var(--white);
  background: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

.status-new_quote {
  border-left: 6px solid var(--bright);
}

.status-quoted {
  border-left: 6px solid var(--warn);
}

.status-accepted,
.status-scheduled,
.status-in_progress {
  border-left: 6px solid var(--blue);
}

.status-completed {
  border-left: 6px solid var(--good);
}

.status-declined,
.status-cancelled {
  border-left: 6px solid var(--bad);
}

.warning {
  color: var(--bad);
  font-weight: 900;
}

.today-panel {
  padding: clamp(14px, 3vw, 28px);
}

.today-job {
  min-height: calc(100vh - 190px);
  margin: 20px 0 34px;
  padding: clamp(18px, 4vw, 34px);
  background: var(--white);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.today-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-weight: 900;
}

.today-job-top,
.today-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.today-job h2 {
  margin: 12px 0 18px;
  font-size: clamp(34px, 5vw, 58px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--white);
  background: var(--blue);
  font-weight: 900;
}

.map-address {
  display: block;
  flex: 1;
  padding: 16px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.2;
  text-decoration: none;
}

.today-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.today-info-grid section,
.today-manage,
.today-photos {
  padding: 16px;
  background: #f8fbfd;
  border: 1px solid var(--line);
}

.today-info-grid h3,
.today-photos h3 {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 22px;
}

.today-info-grid p {
  margin-bottom: 9px;
  color: #173a56;
  font-size: 18px;
}

.today-manage summary {
  min-height: 48px;
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.complete-form {
  margin-top: 18px;
}

.complete-button {
  width: 100%;
  min-height: 72px;
  color: var(--white);
  background: var(--good);
  border-color: var(--good);
  font-size: clamp(24px, 5vw, 38px);
}

.photo-upload {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.photo-card {
  margin: 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--soft);
}

.photo-card figcaption {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.photo-card figcaption span {
  color: var(--muted);
}

.consent-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.consent-form .check {
  padding: 8px;
  font-size: 14px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 56px);
  color: var(--white);
  background: var(--blue);
}

@media (max-width: 860px) {
  .site-header,
  .today-job-top,
  .today-primary,
  .today-nav,
  .dashboard-head,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
  }

  .hero,
  .grid.two,
  .photo-grid,
  .today-info-grid,
  .status-columns,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .hero-actions {
    width: 100%;
  }

  .button {
    width: 100%;
  }

  .map-address {
    width: 100%;
  }

  .today-info-grid p {
    font-size: 19px;
  }
}
