:root {
  --color-paper: #fbfbfb;
  --color-white: #fdfdfd;
  --color-forest: #04281b;
  --color-evergreen: #1c3d2b;
  --color-muted: #b0b0a3;
  --color-border: #e5e7e3;
  --color-surface: #f4f3f2;
  --color-gold: #d79500;
  --color-green-soft: #e8f4ea;
  --color-blue-soft: #e8f3fc;
  --color-gold-soft: #fff5df;
  --font-heading: "DM Serif Display", Georgia, serif;
  --font-body: "Lato", Arial, sans-serif;
  --shadow: 0 2px 12px rgba(4, 40, 27, 0.06);
}

* { box-sizing: border-box; }

html { background: var(--color-paper); scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  color: #17251f;
  background: var(--color-paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

body, button, input { font-family: var(--font-body); }

img { display: block; max-width: 100%; height: auto; }

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

button, input { font-size: inherit; }

button { color: inherit; cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(215, 149, 0, 0.55);
  outline-offset: 2px;
}

svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

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

.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;
}

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 244px;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px 22px;
  color: #fff;
  background: radial-gradient(circle at 80% 55%, #0c563c 0, transparent 35%), linear-gradient(160deg, #003727, var(--color-forest) 60%, #003326);
}

.brand { display: block; margin: 0 3px 30px; }

.brand img { width: 200px; }

.primary-nav { display: grid; gap: 5px; }

.primary-nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
}

.primary-nav a:hover, .primary-nav a.active { background: rgba(117, 160, 55, 0.24); }

.primary-nav a.active { color: #fff; box-shadow: inset 3px 0 #d4ad23; }

.primary-nav svg { flex: 0 0 auto; color: #fff; }

.primary-nav a.active svg { color: #e1ba20; }

.insight-card {
  margin: 32px 3px 20px;
  padding: 17px;
  border: 1px solid rgba(225, 186, 32, 0.55);
  border-radius: 9px;
  background: rgba(0, 35, 25, 0.48);
}

.insight-card h2, .weather-card h2 { margin-bottom: 8px; font: 700 15px/1.3 var(--font-body); }

.insight-card p { margin-bottom: 14px; font-size: 13px; line-height: 1.45; }

.insight-card a { display: inline-block; padding: 8px 11px; border-radius: 6px; background: rgba(24, 94, 62, 0.75); font-size: 13px; font-weight: 700; }

.sidebar-photo {
  margin: 0 3px 20px;
  height: 150px;
  border-radius: 12px;
  background: url(assets/sidebar-house.png) center/cover no-repeat;
}

.weather-card {
  margin: 0 3px;
  padding: 17px;
  border-radius: 9px;
  background: rgba(0, 29, 21, 0.6);
}

.weather-main { display: flex; align-items: center; gap: 8px; }

.weather-main img { width: 35px; aspect-ratio: 1; object-fit: contain; }

.weather-main strong { font-size: 20px; }

.weather-main span, .weather-card p { font-size: 12px; }

.weather-card p { margin: 4px 0 0 43px; }

.page-shell { min-width: 0; flex: 1; display: flex; flex-direction: column; }

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 26px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(253, 253, 253, 0.96);
}

.search {
  width: min(370px, 36vw);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
}

.search input { width: 100%; height: 40px; border: 0; outline: 0; color: #283b32; background: transparent; font-size: 14px; }

.search svg { flex: 0 0 auto; }

.topbar-actions { display: flex; align-items: center; gap: 18px; }

.date-control {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.date-control span { color: #8c948f; font-size: 21px; }

.notification { position: relative; padding: 7px; border: 0; background: transparent; }

.notification span { position: absolute; top: -3px; right: -3px; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #fff; background: var(--color-gold); font-size: 11px; font-weight: 900; }

.user-menu { display: flex; align-items: center; gap: 10px; }

.user-menu img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }

.user-menu div { display: grid; }

.user-menu strong { font-size: 14px; }

.user-menu small { color: #66716b; font-size: 12px; }

.user-menu button { padding: 5px; border: 0; background: transparent; }

main { flex: 1; padding: 22px 24px 28px; }

.dashboard-layout { width: 100%; max-width: 1380px; margin: 0 auto; display: grid; grid-template-columns: minmax(690px, 1fr) 340px; gap: 24px; align-items: start; }

.dashboard-main { min-width: 0; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }

.page-heading h1 { margin-bottom: 2px; font: 500 34px/1.1 var(--font-heading); color: var(--color-forest); }

.page-heading p { margin-bottom: 0; color: #55635c; font-size: 15px; }

.heading-actions { display: flex; gap: 10px; }

.secondary-button, .primary-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
}

.secondary-button { border: 1px solid var(--color-border); background: #fff; }

.primary-button { border: 1px solid var(--color-forest); color: #fff; background: var(--color-forest); box-shadow: var(--shadow); }

.schedule-card, .list-card, .route-card, .job-detail {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.week-strip { display: grid; grid-template-columns: 36px repeat(7, 1fr) 36px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--color-border); }

.week-strip > div { display: grid; justify-items: center; gap: 1px; min-width: 64px; }

.week-strip small { font-size: 10px; font-weight: 700; }

.week-strip strong { font-size: 20px; line-height: 1.2; }

.week-strip span { color: #657069; font-size: 10px; }

.week-strip .selected strong { display: grid; width: 48px; height: 48px; margin: -2px 0; place-items: center; border-radius: 50%; color: #f3c54d; background: var(--color-forest); }

.week-strip button { border: 0; background: transparent; font-size: 24px; }

.schedule-scroll { min-width: 810px; }

.schedule-card { overflow-x: auto; }

.time-header { display: grid; grid-template-columns: 130px repeat(11, minmax(53px, 1fr)); min-height: 38px; border-bottom: 1px solid var(--color-border); }

.time-header span { display: grid; place-items: center; border-right: 1px solid #eef0ed; font-size: 10px; }

.crew-row { display: grid; grid-template-columns: 130px 1fr; min-height: 78px; border-bottom: 1px solid #edf0ed; }

.crew-row:last-child { border-bottom: 0; }

.crew-label { position: relative; padding: 9px 10px; border-right: 1px solid #edf0ed; }

.crew-label::after { content: ""; position: absolute; top: 15px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: #2f9e56; }

.crew-row:nth-child(4) .crew-label::after { background: #e0a92b; }

.crew-label strong, .crew-label small { display: block; font-size: 11px; }

.crew-label small { color: #7a837e; }

.avatar-stack { display: flex; margin-top: 5px; }

.avatar-stack img { width: 23px; height: 23px; margin-right: -3px; border: 2px solid #fff; border-radius: 50%; object-fit: cover; }

.timeline { display: grid; grid-template-columns: repeat(11, minmax(53px, 1fr)); align-items: center; background-image: linear-gradient(to right, transparent calc(100% - 1px), #edf0ed 1px); background-size: calc(100% / 11) 100%; }

.job-block { align-self: center; min-height: 55px; display: grid; align-content: center; padding: 5px 9px; border: 1px solid; border-radius: 6px; overflow: hidden; }

.job-block strong, .job-block span, .job-block small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.job-block strong { font-size: 10px; }

.job-block span, .job-block small { font-size: 9px; }

.job-block.install { border-color: #a9d2ae; background: linear-gradient(100deg, #e8f4ea, #f5faf5); }

.job-block.service { border-color: #edc978; background: linear-gradient(100deg, #fff5df, #fffaf0); }

.job-block.takedown { border-color: #a9cee9; background: linear-gradient(100deg, #e8f3fc, #f4f9fd); }

.alpha-job { grid-column: 2 / 6; }
.anderson-job { grid-column: 7 / 11; }
.williams-job { grid-column: 3 / 6; }
.thompson-job { grid-column: 7 / 11; }
.pinecrest-job { grid-column: 2 / 6; }
.oakwood-job { grid-column: 7 / 11; }
.maple-job { grid-column: 3 / 7; }
.spruce-job { grid-column: 8 / 11; }

.summary-grid { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(280px, 1.08fr) minmax(220px, .9fr); gap: 12px; margin-top: 16px; }

.list-card, .route-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.list-card h2, .route-card h2 { margin: 0; padding: 15px 16px 8px; font: 500 18px/1.2 var(--font-heading); }

.job-list { margin: 0; padding: 0 16px; list-style: none; }

.job-list li { min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; border-bottom: 1px solid #eceeeb; }

.job-list div { min-width: 0; display: grid; }

.job-list strong { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }

.job-list small, .job-list time { color: #536159; font-size: 10px; }

.tag { display: inline-flex; align-items: center; width: max-content; padding: 3px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; }

.install-tag { color: #17602f; background: #dcefe0; }

.takedown-tag { color: #1762a2; background: #e1effc; }

.service-tag { color: #9a6100; background: #fff0d2; }

.card-link { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--color-border); color: #0b5136; font-size: 13px; font-weight: 700; }

.route-map { width: calc(100% - 20px); height: 225px; margin: 0 10px; border-radius: 7px; object-fit: cover; object-position: center; }

.route-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 15px 10px; text-align: center; }

.route-stats div { display: grid; justify-items: center; }

.route-stats img { width: 30px; height: 30px; margin-bottom: 4px; object-fit: contain; }

.route-stats svg { width: 30px; height: 30px; margin-bottom: 4px; color: #3d4a3f; }

.route-stats small { font-size: 9px; }

.route-stats strong { font-size: 14px; }

.upcoming-list li { grid-template-columns: minmax(0, 1fr) auto; }

.upcoming-list time { display: block; color: #26372f; }

.job-detail { overflow: hidden; }

.detail-topline { display: flex; align-items: center; gap: 8px; padding: 15px 15px 8px; }

.detail-topline small { margin-right: auto; color: #55625b; }

.detail-topline button { padding: 4px; border: 0; background: transparent; font-size: 21px; }

.detail-intro { display: grid; grid-template-columns: 1fr 112px; gap: 12px; padding: 0 15px 10px; }

.detail-intro h2 { margin: 5px 0 6px; font: 500 20px/1.15 var(--font-heading); white-space: nowrap; }

.detail-intro p { margin: 0; font-size: 13px; }

.detail-intro img { width: 112px; height: 78px; border-radius: 6px; object-fit: cover; object-position: center; }

.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 15px 12px; }

.detail-facts > div { min-height: 55px; display: flex; align-items: center; gap: 7px; padding: 8px; border: 1px solid var(--color-border); border-radius: 7px; }

.detail-facts svg { flex: 0 0 18px; }

.detail-facts span { min-width: 0; display: grid; }

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

.detail-facts strong { font-size: 10px; }

.detail-facts small { font-size: 9px; }

.detail-section { margin: 0 15px; padding: 13px 0; border-top: 1px solid var(--color-border); }

.detail-section h3 { margin-bottom: 9px; font: 700 13px/1.3 var(--font-body); }

.homeowner-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.homeowner-row p { margin: 0; font-size: 12px; line-height: 1.5; }

.homeowner-row > div { display: flex; gap: 7px; }

.homeowner-row a { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: var(--color-forest); background: #edf3ef; }

.homeowner-row svg { width: 15px; height: 15px; }

.job-details { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }

.job-details dt { color: #69746e; font-size: 9px; }

.job-details dd { margin: 2px 0 0; font-size: 11px; font-weight: 700; }

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

.section-title h3 { margin-bottom: 8px; }

.section-title a, .section-title span { color: #385547; font-size: 10px; font-weight: 700; }

.section-title button { padding: 3px; border: 0; background: transparent; }

.assigned-members { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.assigned-members > div { display: flex; align-items: center; gap: 6px; min-width: 0; }

.assigned-members img { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }

.assigned-members span { min-width: 0; display: grid; }

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

.assigned-members strong { font-size: 10px; }

.assigned-members small { color: #68736d; font-size: 9px; }

.checklist progress { width: 43%; height: 6px; display: block; margin: -2px 0 9px auto; accent-color: #14633c; }

.checklist ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }

.checklist li { display: flex; align-items: center; gap: 8px; font-size: 11px; }

.checklist li > span { width: 13px; height: 13px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid #7f8a84; border-radius: 50%; color: transparent; font-size: 8px; }

.checklist li.complete > span { border-color: #0e6c3b; color: #fff; background: #0e6c3b; }

.notes-section p { margin: 0; font-size: 12px; }

.start-button { width: calc(100% - 30px); min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 15px; border: 0; border-radius: 7px; color: #fff; background: var(--color-forest); font-size: 13px; font-weight: 700; }

footer { display: none; }

@media (max-width: 1270px) {
  .sidebar { flex-basis: 210px; }
  .brand img { width: 175px; }
  .dashboard-layout { grid-template-columns: minmax(650px, 1fr) 320px; gap: 16px; }
  main { padding-inline: 16px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .route-card { grid-row: span 2; }
}

@media (max-width: 1050px) {
  body { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 16px 20px; }
  .brand { width: 190px; margin-bottom: 16px; }
  .primary-nav { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .primary-nav a { flex: 0 0 auto; }
  .insight-card, .weather-card { display: inline-block; width: calc(50% - 8px); margin: 14px 4px 0; vertical-align: top; }
  .sidebar-photo { margin: 14px 4px 0; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .job-detail { width: 100%; }
}

@media (max-width: 760px) {
  .topbar { align-items: stretch; flex-direction: column; padding: 12px 16px; }
  .search { width: 100%; }
  .topbar-actions { justify-content: space-between; gap: 8px; }
  .date-control { flex: 1; }
  .user-menu div { display: none; }
  main { padding: 20px 12px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { flex-wrap: wrap; }
  .heading-actions button { flex: 1; }
  .summary-grid { grid-template-columns: 1fr; }
  .route-card { grid-row: auto; }
  .route-map { height: auto; aspect-ratio: 1.35; }
  .week-strip { min-width: 650px; }
  .detail-intro { grid-template-columns: 1fr 110px; }
  .detail-facts, .job-details { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .sidebar { padding-inline: 12px; }
  .insight-card, .weather-card { width: 100%; margin-inline: 0; }
  .date-control span { display: none; }
  .notification { margin-left: auto; }
  .user-menu img { width: 36px; height: 36px; }
  .page-heading h1 { font-size: 30px; }
  .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .primary-button { grid-column: 1 / -1; }
  .detail-intro { grid-template-columns: 1fr; }
  .detail-intro img { width: 100%; height: 145px; }
  .assigned-members { grid-template-columns: 1fr; }
  .assigned-members img { width: 38px; height: 38px; }
}

/* ===== app consistency: pinned palette (leads ref) ===== */
:root{--color-evergreen:#04281b;--color-gold:#c99216;--color-muted:#677069;--color-background:#fbfbfb;--font-heading:"DM Serif Display",Georgia,serif;}
.sidebar {position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 0;
  background: linear-gradient(160deg, #043426 0%, var(--color-evergreen) 65%, #003326 100%);
  color: #fff;}
.brand {display: block;
  width: 100%;
  max-width: 205px;
  margin-bottom: 28px;}
.brand img {display: block;
  width: 100%;
  object-fit: contain;}
.primary-nav {display: grid;
  gap: 5px;
  position: relative;
  z-index: 1;}
.primary-nav a {min-height: 43px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background-color 160ms ease, color 160ms ease;}
.primary-nav a:hover {background: rgba(255, 255, 255, 0.08);}
.primary-nav a.active {background: rgba(88, 135, 61, 0.36);
  color: #f4c32c;}
.primary-nav img {width: 22px;
  height: 22px;
  flex: 0 0 22px;
  object-fit: contain;}
.insights-card {position: relative;
  z-index: 1;
  margin: 28px 4px 22px;
  padding: 16px;
  border: 1px solid rgba(213, 167, 54, 0.7);
  border-radius: var(--radius-md);
  background: rgba(0, 44, 31, 0.72);
  box-shadow: var(--shadow-sm);}
.insights-card h2 {margin: 0 0 7px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.3;}
.insights-card p {margin: 0 0 13px;
  font-size: 14px;
  line-height: 1.45;}
.insights-card a {width: fit-content;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 6px;
  background: rgba(19, 81, 57, 0.75);
  font-size: 14px;
  font-weight: 600;}
.insights-card svg {width: 16px;
  height: 16px;}
.sidebar-photo {width: calc(100% + 32px);
  max-width: none;
  min-height: 260px;
  margin: auto -16px 0;
  display: block;
  object-fit: cover;
  object-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 18%);}
/* ===== app consistency overrides (leads ref) ===== */
.sidebar{width:236px !important;flex:0 0 236px !important;flex-direction:column !important;box-sizing:border-box !important;padding:22px 16px 0 !important;gap:0 !important;height:100vh !important;max-height:100vh !important;min-height:100vh !important;position:sticky !important;top:0 !important;align-self:start !important;overflow-y:auto !important;overflow-x:hidden !important;scrollbar-width:none !important;}
.sidebar::-webkit-scrollbar{display:none !important;}
.sidebar .primary-nav{margin-top:0 !important;padding-top:0 !important;flex:0 0 auto !important;}
.sidebar .brand{margin:0 0 28px !important;padding:0 !important;display:block !important;flex:0 0 auto !important;}
.sidebar .brand img{width:204px !important;height:auto !important;max-width:204px !important;}
.sidebar .insights-card{flex:0 0 auto !important;}
.sidebar-photo{position:static !important;width:236px !important;max-width:none !important;min-width:236px !important;margin:auto -16px 0 -16px !important;height:260px !important;min-height:260px !important;flex:0 0 260px !important;object-fit:cover !important;object-position:center !important;display:block !important;background:none !important;background-image:none !important;}
.sidebar .primary-nav{flex-direction:column !important;}
.sidebar .primary-nav>a{justify-content:flex-start !important;}
.sidebar .primary-nav>a>span{position:static !important;width:auto !important;height:auto !important;margin:0 !important;overflow:visible !important;clip:auto !important;clip-path:none !important;}
.page-heading h1,.main-content>h1,main h1,.workspace>h1{font-size:39px !important;line-height:1.08 !important;font-weight:400 !important;font-family:var(--font-heading) !important;}
.page-heading p,.page-subtitle{font-size:16px !important;}
.topbar{min-height:72px !important;padding-top:14px !important;padding-bottom:14px !important;align-items:center !important;}
footer,.site-footer,.app-footer{background:var(--color-evergreen) !important;}
[class*="card"],.panel{border-radius:10px;}
