:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef3ec;
  --ink: #17211c;
  --muted: #66746b;
  --line: #dbe2dc;
  --green: #256f42;
  --green-dark: #174f31;
  --blue: #265f8f;
  --red: #a23b35;
  --gold: #9b6b1f;
  --shadow: 0 16px 40px rgba(23, 33, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.link-button {
  display: inline-flex;
  align-items: center;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  background: #15251c;
  color: #f7fbf6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #b9d991;
  color: #15251c;
  font-weight: 800;
}

.brand small,
.sidebar-panel small,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand small,
.sidebar-panel small {
  color: #b7c7bc;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  color: #dbe7df;
  background: transparent;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  color: #132018;
  background: #d8ebc3;
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.sidebar-panel ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #e7efe9;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 32px;
}

h2 {
  margin-bottom: 14px;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.top-actions,
.actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary,
.secondary,
.small-action,
.chip-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  white-space: nowrap;
}

.primary {
  background: var(--green);
  color: white;
}

.primary:hover {
  background: var(--green-dark);
}

.secondary,
.small-action,
.chip-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-2);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.stats {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.two-col {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.stat {
  padding: 16px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.stat span {
  color: var(--muted);
}

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

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f9fbf8;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.status.warn {
  background: #fff1d7;
  color: var(--gold);
}

.status.danger {
  background: #ffe3df;
  color: var(--red);
}

.status.info {
  background: #dfeefd;
  color: var(--blue);
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.task {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.task strong {
  display: block;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
}

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

dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}

dialog::backdrop {
  background: rgba(8, 20, 13, 0.42);
}

.modal-card {
  padding: 20px;
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-card footer {
  justify-content: flex-end;
  margin-top: 18px;
}

.portal-preview {
  display: grid;
  gap: 14px;
  max-width: 430px;
  padding: 18px;
  border-radius: 8px;
  background: #18281f;
  color: white;
}

.portal-preview .card {
  padding: 14px;
  color: var(--ink);
  box-shadow: none;
}

.public-site {
  background: #f5f8f3;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 248, 243, 0.94);
  backdrop-filter: blur(16px);
}

.site-brand .brand-mark {
  background: var(--green);
  color: white;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-nav a {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 79px);
  padding: clamp(22px, 5vw, 72px);
}

.hero-copy {
  max-width: 620px;
}

.hero h1 {
  margin-bottom: 14px;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.96;
}

.hero p {
  max-width: 560px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.hero-photo {
  min-height: 520px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 49, 28, 0.2), rgba(37, 111, 66, 0.05)),
    repeating-linear-gradient(106deg, #4f8f48 0 22px, #6eaa58 22px 44px, #3f793f 44px 66px);
  box-shadow: var(--shadow);
}

.content-band {
  padding: 64px clamp(18px, 5vw, 72px);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 22px;
}

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

.quote-band {
  background: #eaf1e8;
}

.quote-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 820px;
}

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

.portal-page {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(21, 37, 28, 0.92), rgba(37, 111, 66, 0.8)),
    repeating-linear-gradient(106deg, #4f8f48 0 22px, #6eaa58 22px 44px, #3f793f 44px 66px);
}

.portal-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
}

.portal-shell > .brand {
  position: fixed;
  top: 20px;
  left: 20px;
  color: white;
}

.portal-phone {
  display: grid;
  width: min(430px, 100%);
  gap: 14px;
  padding: 22px;
  border-radius: 18px;
  background: #f9fbf8;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.24);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

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

  .grid.stats,
  .two-col,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header,
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    display: grid;
  }

  .hero,
  .service-grid,
  .quote-form {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-photo {
    width: 100%;
    min-height: 300px;
  }
}
