:root {
  color-scheme: light;
  --ink: #17313b;
  --muted: #60747d;
  --line: #d7e0e3;
  --surface: #ffffff;
  --soft: #f5f7f3;
  --brand: #124e66;
  --brand-2: #2f7d64;
  --warn: #b66d18;
  --danger: #b13f3b;
  --focus: #f2b84b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--soft);
  color: var(--ink);
  line-height: 1.5;
}
a { color: inherit; }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
.sidebar {
  background: #fbfcfa;
  border-right: 1px solid var(--line);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { font-size: 1.1rem; font-weight: 800; margin-bottom: 28px; }
.nav { display: grid; gap: 6px; }
.nav a, .logout-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  width: 100%;
  cursor: pointer;
}
.nav a:hover, .nav a.active, .logout-button:hover { background: #e9f1ee; }
.content { padding: 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; }
.eyebrow { color: var(--muted); font-size: .9rem; margin: 0; }
h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin: 0; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 1.15rem; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(23, 49, 59, .05);
}
.metric { font-size: 1.85rem; font-weight: 800; margin-top: 4px; }
.muted { color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.button.secondary { background: #fff; color: var(--brand); }
.button.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: .9rem;
}
.button.danger {
  background: var(--danger);
  border-color: var(--danger);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .86rem; font-weight: 700; }
.table-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}
.table-link:hover { text-decoration: underline; }
.table-link.strong { color: var(--ink); }
.clickable-row:hover td { background: #f7fbf9; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form select { width: auto; min-width: 180px; }
.danger-zone {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
label { font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); }
.alert { padding: 12px 14px; border-radius: 8px; background: #fff4df; border: 1px solid #f0c879; margin-bottom: 16px; }
.quote-builder { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.sticky-summary { position: sticky; top: 22px; }
.service-list { display: grid; gap: 10px; }
.service-empty {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.service-option {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.service-option::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: transparent;
  transition: background-color .15s ease;
}
.service-option:hover {
  border-color: #a8c8ba;
  background: #fbfdfb;
}
.service-option:has(.service-checkbox:checked) {
  border-color: #6eb68e;
  background: #eff8f2;
  box-shadow: 0 10px 24px rgba(47, 125, 100, .13);
}
.service-option:has(.service-checkbox:checked)::before { background: #2f9f62; }
.service-option:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.service-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.service-checkmark {
  width: 24px;
  height: 24px;
  border: 2px solid #b9c8cd;
  border-radius: 7px;
  background: #fff;
  display: grid;
  place-items: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.service-checkmark::after {
  content: "";
  width: 7px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(.6);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}
.service-checkbox:checked + .service-checkmark {
  border-color: #2f9f62;
  background: #2f9f62;
}
.service-checkbox:checked + .service-checkmark::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}
.service-copy { min-width: 0; }
.service-price {
  align-self: center;
  white-space: nowrap;
  font-weight: 800;
}
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #e9f1ee; color: var(--brand); font-weight: 700; font-size: .78rem; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-4, .grid.cols-2, .form-grid, .quote-builder { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .inline-form, .inline-form select, .actions .button { width: 100%; }
  .service-option { grid-template-columns: 28px minmax(0, 1fr); }
  .service-price { grid-column: 2; justify-self: start; }
}
