:root {
  --forest-950: #071d16;
  --forest-900: #0c2f23;
  --forest-800: #154533;
  --forest-700: #1f5a43;
  --gold-500: #dfa91c;
  --gold-400: #edbd3b;
  --cream-100: #fbf7ee;
  --cream-200: #f6edda;
  --sand: #f3dcb1;
  --olive: #788a4b;
  --ink: #18221d;
  --muted: #66736c;
  --line: #dce3de;
  --line-dark: rgba(255, 255, 255, .13);
  --white: #ffffff;
  --success: #2d7a52;
  --warning: #9a6a05;
  --blue: #2e6083;
  --shadow-sm: 0 8px 24px rgba(17, 38, 29, .07);
  --shadow-lg: 0 26px 70px rgba(7, 29, 22, .18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-width: 264px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #f3f5f2;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; }

[hidden] { display: none !important; }

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

.prototype-banner {
  align-items: center;
  background: var(--gold-500);
  color: var(--forest-950);
  display: flex;
  font-size: 12px;
  gap: 10px;
  justify-content: center;
  min-height: 30px;
  padding: 6px 14px;
  position: relative;
  z-index: 100;
}

.prototype-banner strong { letter-spacing: .08em; text-transform: uppercase; }

.eyebrow {
  color: var(--olive);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  font-weight: 750;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary { background: var(--forest-900); color: var(--white); }
.button-primary:hover { background: var(--forest-800); }
.button-secondary { background: var(--white); border-color: var(--line); color: var(--ink); }
.button-secondary:hover { border-color: #b8c5bc; }
.button-danger { background: #fff7f5; border-color: #e7b9b0; color: #8b3427; }
.button-danger:hover { background: #ffe9e4; border-color: #cf8174; }
.button-large { min-height: 50px; width: 100%; }
.button.compact { min-height: 36px; padding: 7px 12px; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.login-screen {
  align-items: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(223, 169, 28, .13), transparent 32%),
    linear-gradient(145deg, var(--forest-950), var(--forest-900));
  display: flex;
  min-height: calc(100vh - 30px);
  padding: 34px;
}

.login-shell {
  background: var(--cream-100);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
  margin: auto;
  max-width: 1080px;
  min-height: 650px;
  overflow: hidden;
  width: 100%;
}

.login-brand-panel {
  background:
    linear-gradient(135deg, rgba(255,255,255,.14), transparent 46%),
    linear-gradient(160deg, #f5dfb7, #e5c27d);
  min-height: 650px;
  overflow: hidden;
  padding: 42px 46px;
  position: relative;
}

.login-logo {
  display: block;
  height: 126px;
  object-fit: contain;
  width: 126px;
}

.login-brand-copy { max-width: 570px; position: relative; z-index: 2; }
.login-brand-copy .eyebrow { color: #6d5414; margin-top: 28px; }
.login-brand-copy h1 { color: var(--forest-900); font-size: clamp(2.5rem, 5vw, 4.8rem); letter-spacing: -.055em; line-height: .95; margin: 0 0 22px; max-width: 630px; }
.login-brand-copy p:last-child { color: #3f4d45; font-size: 18px; line-height: 1.6; margin: 0; max-width: 580px; }

.login-mascot {
  bottom: -82px;
  filter: drop-shadow(0 22px 24px rgba(12, 47, 35, .18));
  height: 580px;
  object-fit: contain;
  object-position: bottom right;
  opacity: .88;
  position: absolute;
  right: -18px;
  width: 465px;
}

.login-card {
  align-content: center;
  background: var(--white);
  display: grid;
  gap: 28px;
  padding: 52px;
}

.login-card h2 { color: var(--forest-900); font-size: 30px; letter-spacing: -.03em; margin: 20px 0 10px; }
.login-card p { color: var(--muted); line-height: 1.6; margin: 0; }

.auth-form { display: grid; gap: 16px; }
.auth-links { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; }
.auth-links .text-button { font-size: 12px; }
.auth-name-field[hidden] { display: none; }

.form-message {
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  min-height: 0;
}

.form-message:not(:empty) { background: var(--cream-100); border: 1px solid var(--line); padding: 10px 11px; }
.form-message.is-error:not(:empty) { background: #fff0ee; border-color: #e8b8b0; color: #8b3427; }
.form-message.is-success:not(:empty) { background: #e8f4ed; border-color: #b8dbc7; color: var(--success); }
.duplicate-warning { background: #fff8e6; border: 1px solid #e7c66e; border-radius: 10px; color: #664d0d; font-size: 12px; line-height: 1.5; margin-top: 14px; padding: 11px 13px; }
.duplicate-warning strong { color: #4e3900; display: block; margin-bottom: 3px; }
.duplicate-warning button { background: transparent; border: 0; color: var(--forest-800); cursor: pointer; font: inherit; font-weight: 800; padding: 0; text-decoration: underline; }
.record-archive-note { align-items: center; background: #eef1ef; border-radius: 9px; color: #56625b; display: inline-flex; font-size: 11px; font-weight: 750; padding: 8px 10px; }

.status-pill,
.status-badge {
  align-items: center;
  background: #e8f4ed;
  border-radius: 999px;
  color: var(--success);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
  padding: 7px 10px;
  width: fit-content;
}

.status-badge.neutral { background: #eef1ef; color: #56625b; }
.status-badge.warning { background: #fff0c9; color: #7a5100; }
.status-dot { background: var(--success); border-radius: 50%; height: 7px; width: 7px; }

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

.preview-user { background: var(--cream-100); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.preview-user span:nth-child(2) { display: grid; gap: 3px; }
.preview-user small { color: var(--muted); font-size: 12px; }
.privacy-note { font-size: 12px; text-align: center; }

.avatar,
.avatar-button {
  align-items: center;
  background: var(--forest-900);
  border: 0;
  border-radius: 50%;
  color: var(--white);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 850;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.avatar.small { background: var(--gold-500); color: var(--forest-950); height: 36px; width: 36px; }
.avatar-button { height: 36px; width: 36px; }

.app-shell { min-height: calc(100vh - 30px); }

.sidebar {
  background: var(--forest-950);
  bottom: 0;
  color: var(--white);
  display: flex;
  flex-direction: column;
  left: 0;
  padding: 22px 15px 16px;
  position: fixed;
  top: 30px;
  width: var(--sidebar-width);
  z-index: 80;
}

.sidebar-brand { align-items: center; display: flex; gap: 12px; padding: 0 8px 24px; }
.sidebar-brand > div:last-child { display: grid; line-height: 1; }
.sidebar-brand strong { font-size: 21px; letter-spacing: .09em; }
.sidebar-brand span { color: var(--gold-400); font-size: 10px; font-weight: 800; letter-spacing: .22em; margin-top: 5px; }

.sidebar-logo-wrap {
  background: var(--sand);
  border-radius: 11px;
  flex: 0 0 auto;
  height: 48px;
  overflow: hidden;
  width: 48px;
}

.sidebar-logo-wrap img { height: 100%; object-fit: cover; width: 100%; }

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

.nav-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, .7);
  display: grid;
  font-weight: 690;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 9px 11px;
  text-align: left;
  transition: background .15s ease, color .15s ease;
  width: 100%;
}

.nav-item:hover { background: rgba(255, 255, 255, .07); color: var(--white); }
.nav-item.is-active { background: var(--gold-500); color: var(--forest-950); }
.nav-icon { font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.nav-count { background: rgba(255, 255, 255, .1); border-radius: 999px; font-size: 10px; padding: 4px 7px; }
.nav-item.is-active .nav-count { background: rgba(7, 29, 22, .13); }
.sidebar-spacer { flex: 1; }

.demo-label { background: rgba(255, 255, 255, .06); border: 1px solid var(--line-dark); border-radius: 12px; margin: 18px 0; padding: 13px; }
.demo-label span { background: var(--gold-500); border-radius: 4px; color: var(--forest-950); font-size: 9px; font-weight: 900; letter-spacing: .16em; padding: 4px 6px; }
.demo-label p { color: rgba(255, 255, 255, .62); font-size: 11px; line-height: 1.5; margin: 10px 0 0; }

.app-content { margin-left: var(--sidebar-width); min-height: calc(100vh - 30px); }

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 68px;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 30px;
  z-index: 40;
}

.topbar h2 { color: var(--forest-900); font-size: 17px; margin: 0; }
.topbar-actions { align-items: center; display: flex; gap: 11px; }
.global-search-wrap { min-width: 320px; position: relative; }
.global-search-wrap input { background: var(--cream-100); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 12px; padding: 10px 13px; width: 100%; }
.global-search-results { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; padding: 6px; position: absolute; right: 0; top: 44px; width: min(480px, 80vw); z-index: 140; }
.global-search-results button { background: transparent; border: 0; border-radius: 8px; cursor: pointer; display: grid; gap: 3px; padding: 10px; text-align: left; width: 100%; }
.global-search-results button:hover { background: var(--cream-100); }
.global-search-results strong { color: var(--forest-950); font-size: 12px; }
.global-search-results small, .global-search-results p { color: var(--muted); font-size: 10px; margin: 0; }
.connection-banner { align-items: center; background: #8a351d; color: #fff; display: flex; gap: 12px; margin-left: var(--sidebar-width); padding: 9px 34px; }
.connection-banner strong { color: #fff; text-transform: uppercase; }
.connection-banner span { font-size: 12px; }
.account-menu-wrap { position: relative; }
.avatar-button { cursor: pointer; outline-offset: 3px; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.avatar-button:hover, .avatar-button:focus-visible { background: var(--forest-700); box-shadow: 0 0 0 4px rgba(223, 169, 28, .2); transform: translateY(-1px); }
.account-menu { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 230px; overflow: hidden; position: absolute; right: 0; top: 45px; z-index: 120; }
.account-menu-head { border-bottom: 1px solid var(--line); display: grid; gap: 3px; padding: 14px; }
.account-menu-head strong { color: var(--forest-950); font-size: 13px; }
.account-menu-head small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.account-menu-head span { color: var(--forest-700); font-size: 10px; font-weight: 800; letter-spacing: .08em; margin-top: 4px; text-transform: uppercase; }
.account-menu button { background: #fff; border: 0; color: var(--ink); cursor: pointer; display: block; font: inherit; font-size: 12px; padding: 11px 14px; text-align: left; width: 100%; }
.account-menu button:hover { background: var(--cream-100); color: var(--forest-900); }
.menu-button { background: transparent; border: 0; display: none; font-size: 24px; padding: 7px; }
.mobile-wordmark { color: var(--gold-500); display: none; font-size: 9px; font-weight: 850; letter-spacing: .15em; }

.main-content { margin: 0 auto; max-width: 1580px; padding: 31px 34px 60px; }
.app-view { display: none; }
.app-view.is-visible { display: block; }
.field-command { background: linear-gradient(140deg, var(--forest-950), var(--forest-700)); border-radius: var(--radius); color: #fff; margin-bottom: 24px; padding: 24px; }
.field-command h2, .field-command p { color: #fff; }
.field-command .eyebrow { color: var(--gold-400); }
.draft-status { background: rgba(255,255,255,.1); border-radius: 999px; font-size: 11px; padding: 8px 11px; }
.draft-status.has-draft { background: var(--gold-500); color: var(--forest-950); font-weight: 800; }
.field-job-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.field-job-card { background: #fff; border-radius: 14px; color: var(--ink); cursor: pointer; display: grid; gap: 13px; padding: 17px; }
.field-job-card > div:first-child { display: grid; gap: 5px; }
.field-job-card strong { color: var(--forest-950); font-size: 16px; }
.field-job-card p { color: var(--muted); font-size: 12px; margin: 0; }
.field-progress { display: flex; gap: 8px; }
.field-progress span { background: var(--cream-100); border-radius: 8px; font-size: 11px; padding: 8px; }
.field-job-actions { display: flex; gap: 8px; justify-content: flex-end; }
.field-next-step { background: var(--cream-100); border: 1px solid #ead9ad; border-radius: 11px; display: grid; gap: 6px; padding: 11px 12px; }
.field-next-step span { color: #6d5414; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.field-next-step strong { font-size: 13px; }
.field-step-track { display: grid; gap: 6px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.field-step-track span { background: #e4e9e5; border-radius: 999px; height: 5px; overflow: hidden; text-indent: -999px; }
.field-step-track span.is-done { background: var(--success); }
.field-step-track span.is-current { background: var(--gold-500); }
.dispatch-panel { margin-top: 22px; }
.dispatch-grid { display: grid; gap: 10px; grid-template-columns: repeat(7, minmax(140px, 1fr)); overflow-x: auto; }
.dispatch-day { background: var(--cream-100); border-radius: 11px; min-height: 180px; padding: 10px; }
.dispatch-day header { border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; margin-bottom: 8px; padding-bottom: 7px; }
.dispatch-day header span { color: var(--muted); font-size: 10px; }
.dispatch-day button { background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; display: grid; gap: 3px; margin-bottom: 7px; padding: 8px; text-align: left; width: 100%; }
.dispatch-day button strong { color: var(--forest-900); font-size: 11px; }
.dispatch-day button small, .dispatch-day p { color: var(--muted); font-size: 9px; }
.dispatch-day button span { color: #a13e21; font-size: 9px; font-weight: 800; text-transform: uppercase; }

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

.page-heading h1 { color: var(--forest-900); font-size: clamp(2rem, 3.4vw, 3.1rem); letter-spacing: -.045em; line-height: 1; margin: 0 0 9px; }
.page-heading p:last-child { color: var(--muted); margin: 0; }
.page-actions { display: flex; gap: 10px; }

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 20px;
}

.metric-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { color: var(--forest-900); font-size: 32px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-size: 11px; margin-top: auto; }
.metric-card.emphasis { background: var(--forest-900); border-color: var(--forest-900); }
.metric-card.emphasis span, .metric-card.emphasis small { color: rgba(255, 255, 255, .66); }
.metric-card.emphasis strong { color: var(--gold-400); }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  padding: 22px;
}

.panel-heading { align-items: flex-start; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 17px; }
.panel-heading h2 { color: var(--forest-900); font-size: 21px; letter-spacing: -.025em; margin: 0; }
.text-button { background: transparent; border: 0; color: var(--forest-700); font-size: 12px; font-weight: 800; padding: 4px; }

.dashboard-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .7fr); margin-bottom: 16px; }
.lower-grid { display: grid; gap: 16px; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); }

.table-wrap { overflow-x: auto; width: 100%; }
table { border-collapse: collapse; min-width: 680px; width: 100%; }
th { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; padding: 10px 12px; text-align: left; text-transform: uppercase; }
td { border-top: 1px solid #edf0ed; color: #3f4b44; font-size: 13px; padding: 13px 12px; vertical-align: middle; }
td strong { color: var(--ink); display: block; }
td small { color: var(--muted); display: block; margin-top: 3px; }

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 10px;
  font-weight: 850;
  padding: 6px 9px;
  white-space: nowrap;
}

.badge.new-request { background: #e8f1f7; color: var(--blue); }
.badge.estimate-needed { background: #fff4d8; color: var(--warning); }
.badge.proposal-sent { background: #ebe8f6; color: #5d4f8d; }
.badge.follow-up { background: #e7f2ea; color: var(--success); }
.badge.planning { background: #e8f1f7; color: var(--blue); }
.badge.scheduled { background: #fff4d8; color: var(--warning); }
.badge.active { background: #e7f2ea; color: var(--success); }
.badge.on-hold { background: #f4e8e5; color: #8b4a3f; }
.badge.won { background: #e7f2ea; color: var(--success); }
.badge.lost { background: #f4e8e5; color: #8b4a3f; }
.badge.completed, .badge.closed { background: #e9ecea; color: #526057; }

.squatchy-panel {
  background:
    radial-gradient(circle at 75% 25%, rgba(223,169,28,.2), transparent 34%),
    linear-gradient(145deg, #f9f3e7, #e8ede6);
  display: grid;
  min-height: 320px;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.squatchy-copy { max-width: 58%; padding: 25px 22px; position: relative; z-index: 2; }
.squatchy-copy h2 { color: var(--forest-900); font-size: 24px; letter-spacing: -.04em; line-height: 1.05; margin: 0 0 12px; }
.squatchy-copy p:last-child { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0; }
.squatchy-panel img { bottom: -62px; filter: drop-shadow(0 16px 18px rgba(12, 47, 35, .18)); height: 380px; mix-blend-mode: multiply; object-fit: contain; position: absolute; right: -34px; width: 305px; }

.task-list { display: grid; }
.task-row { align-items: flex-start; border-top: 1px solid #edf0ed; display: grid; gap: 11px; grid-template-columns: 36px minmax(0, 1fr); padding: 13px 0; }
.task-row:first-child { border-top: 0; padding-top: 0; }
.task-date { align-items: center; background: var(--cream-200); border-radius: 8px; color: var(--forest-800); display: flex; flex-direction: column; font-size: 9px; font-weight: 850; height: 36px; justify-content: center; text-transform: uppercase; }
.task-date strong { font-size: 15px; line-height: 1; }
.task-row p { color: var(--ink); font-size: 13px; font-weight: 750; margin: 0 0 3px; }
.task-row small { color: var(--muted); font-size: 11px; }

.quick-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-grid button { background: var(--cream-100); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); display: grid; gap: 5px; min-height: 92px; padding: 15px; text-align: left; }
.quick-grid button:hover { border-color: var(--gold-500); }
.quick-grid strong { color: var(--forest-900); }
.quick-grid span { color: var(--muted); font-size: 11px; line-height: 1.45; }

.filter-row { display: flex; gap: 12px; justify-content: space-between; margin-bottom: 14px; }
.search-field { flex: 1; }
.filter-row input, .filter-row select { background: var(--cream-100); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); min-height: 42px; padding: 9px 12px; width: 100%; }
.filter-row select { max-width: 220px; }

.customer-directory { display: grid; gap: 11px; }
.customer-directory-item { background: var(--white); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.customer-directory-item[open] { border-color: #ccd7ce; box-shadow: 0 8px 24px rgba(17, 38, 29, .07); }
.customer-directory-item > summary { align-items: center; cursor: pointer; display: grid; gap: 16px; grid-template-columns: minmax(220px, 1fr) 76px 76px auto 22px; list-style: none; min-height: 76px; padding: 15px 17px; }
.customer-directory-item > summary::-webkit-details-marker { display: none; }
.customer-directory-item > summary::after { color: var(--forest-700); content: "+"; font-size: 23px; font-weight: 500; grid-column: 5; line-height: 1; }
.customer-directory-item[open] > summary::after { content: "−"; }
.customer-directory-item > summary:hover, .customer-directory-item > summary:focus-visible { background: #fbf6e8; outline: none; }
.customer-directory-name { display: grid; gap: 4px; min-width: 0; }
.customer-directory-name strong { color: var(--forest-900); font-size: 16px; overflow-wrap: anywhere; }
.customer-directory-name small, .customer-directory-count small { color: var(--muted); font-size: 10px; }
.customer-directory-count { display: grid; gap: 2px; text-align: center; }
.customer-directory-count strong { color: var(--forest-900); font-size: 18px; }
.customer-directory-body { background: #f7f8f5; border-top: 1px solid var(--line); padding: 15px 17px 17px; }
.customer-directory-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-bottom: 13px; }
.customer-site-list { display: grid; gap: 10px; }
.customer-site-card, .customer-site-empty { background: var(--white); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.customer-site-card.unassigned { border-color: #e1c77e; }
.customer-site-card > header { align-items: center; display: flex; gap: 15px; justify-content: space-between; padding: 13px 14px; }
.customer-site-card > header .eyebrow { font-size: 8px; margin-bottom: 3px; }
.customer-site-card > header h3 { color: var(--forest-900); font-size: 14px; margin: 0 0 3px; }
.customer-site-card > header span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.customer-site-jobs { border-top: 1px solid #edf0ed; display: grid; padding: 0 14px; }
.customer-site-jobs > .muted-empty { padding: 13px 0; }
.customer-job-row { align-items: center; background: transparent; border: 0; border-top: 1px solid #edf0ed; color: var(--ink); cursor: pointer; display: grid; gap: 14px; grid-template-columns: minmax(190px, 1.15fr) minmax(160px, 1fr) auto; padding: 11px 0; text-align: left; width: 100%; }
.customer-job-row:first-child { border-top: 0; }
.customer-job-row:hover, .customer-job-row:focus-visible { background: #fbf6e8; outline: 5px solid #fbf6e8; }
.customer-job-row strong { color: var(--ink); display: block; font-size: 12px; }
.customer-job-row small { color: var(--muted); display: block; font-size: 9px; margin-top: 3px; }
.customer-site-empty { padding: 18px; text-align: center; }
.customer-site-empty strong { color: var(--forest-900); font-size: 13px; }
.customer-site-empty p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
.customer-directory-empty { color: var(--muted); padding: 28px 12px; text-align: center; }

.pipeline-board { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(220px, 1fr)); overflow-x: auto; padding-bottom: 8px; }
.pipeline-column { background: #eaeeea; border-radius: var(--radius); min-height: 470px; padding: 13px; }
.pipeline-column-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 12px; padding: 3px; }
.pipeline-column-head strong { color: var(--forest-900); font-size: 13px; }
.pipeline-column-head span { background: var(--white); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; padding: 4px 7px; }
.lead-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 15px rgba(17, 38, 29, .05); margin-bottom: 10px; padding: 14px; }
.lead-card h3 { color: var(--forest-900); font-size: 15px; margin: 0 0 5px; }
.lead-card > p { color: var(--muted); font-size: 12px; margin: 0 0 15px; }
.lead-card.empty-card { background: rgba(255,255,255,.55); box-shadow: none; }
.lead-card footer { border-top: 1px solid #edf0ed; color: var(--muted); display: grid; font-size: 10px; gap: 3px; padding-top: 10px; }
.lead-card footer strong { color: var(--ink); font-size: 11px; }

.estimate-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr); }
.estimate-form { align-self: start; }
.estimate-form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.draft-control { align-items: flex-end; display: flex; flex-direction: column; gap: 7px; margin-left: auto; }
.draft-control .text-button { font-size: 10px; }
.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 19px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field > span { color: #48534d; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea { background: var(--cream-100); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); min-height: 43px; padding: 10px 11px; width: 100%; }
.inline-field-action { align-items: stretch; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; }
.inline-field-action .button { min-height: 43px; }
.field textarea { line-height: 1.5; resize: vertical; }
.field small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.field.section-label { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 17px; }
.field.section-label > span { color: var(--forest-900); font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-row input:focus, .filter-row select:focus { border-color: var(--gold-500); outline: 3px solid rgba(223, 169, 28, .13); }
.is-saving .field { opacity: .82; }

.pricebook-detail {
  background: linear-gradient(135deg, #f9f5e9, #eef3ed);
  border: 1px solid #d8dfd8;
  border-left: 4px solid var(--gold-500);
  border-radius: 11px;
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px;
}
.pricebook-detail span { color: var(--forest-800); display: block; font-size: 10px; font-weight: 850; letter-spacing: .08em; margin-bottom: 4px; text-transform: uppercase; }
.pricebook-detail p { color: #56625b; font-size: 11px; line-height: 1.5; margin: 0; }

.estimate-summary { display: grid; gap: 16px; height: fit-content; }
.summary-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.summary-card.dark { background: var(--forest-900); border-color: var(--forest-900); color: var(--white); }
.summary-card.dark .eyebrow { color: var(--gold-400); }
.summary-line { align-items: center; border-top: 1px solid rgba(255,255,255,.12); display: flex; font-size: 12px; justify-content: space-between; padding: 12px 0; }
.summary-line:first-of-type { border-top: 0; }
.summary-line span { color: rgba(255,255,255,.65); }
.summary-total { border-top: 1px solid rgba(255,255,255,.25); display: grid; gap: 5px; margin-top: 5px; padding: 17px 0; }
.summary-total span { color: rgba(255,255,255,.72); font-size: 12px; }
.summary-total strong { color: var(--gold-400); font-size: 31px; letter-spacing: -.04em; }
.summary-card.dark small { color: rgba(255,255,255,.55); display: block; font-size: 10px; line-height: 1.5; }
.summary-card h3 { color: var(--forest-900); margin: 0 0 12px; }
.check-list { color: var(--muted); display: grid; font-size: 12px; gap: 9px; list-style: none; margin: 0; padding: 0; }
.check-list li::before { color: var(--gold-500); content: "✓"; font-weight: 900; margin-right: 8px; }
.saved-panel { margin-top: 16px; }
.record-warning { color: #8b4a3f; font-weight: 750; }
.jobs-panel { padding: 6px 16px 16px; }
.muted-empty { color: var(--muted); font-size: 13px; margin: 0; }

.empty-state { padding: 42px; text-align: center; }
.empty-icon { align-items: center; background: var(--sand); border-radius: 18px; color: var(--forest-900); display: inline-flex; font-size: 32px; font-weight: 900; height: 70px; justify-content: center; margin-bottom: 18px; width: 70px; }
.empty-state h2 { color: var(--forest-900); font-size: 27px; letter-spacing: -.035em; margin: 0 0 11px; }
.empty-state > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; margin: 0 auto 32px; max-width: 700px; }
.future-job-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 auto; max-width: 920px; text-align: left; }
.future-job-grid div { background: var(--cream-100); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 5px; padding: 15px; }
.future-job-grid strong { color: var(--forest-900); }
.future-job-grid small { color: var(--muted); line-height: 1.4; }

.dialog {
  background: var(--white);
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  max-width: 690px;
  padding: 0;
  width: calc(100% - 32px);
}

.dialog::backdrop { background: rgba(7, 29, 22, .64); backdrop-filter: blur(3px); }
.dialog form { padding: 25px; }
.dialog-heading { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 20px; }
.dialog-heading h2 { color: var(--forest-900); font-size: 28px; margin: 0; }
.dialog-close { background: var(--cream-100); border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 22px; height: 36px; width: 36px; }
.dialog-actions { display: flex; gap: 9px; justify-content: flex-end; }
.small-dialog { max-width: 480px; }

.toast {
  background: var(--forest-950);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  bottom: 20px;
  box-shadow: var(--shadow-lg);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  left: 50%;
  max-width: calc(100% - 30px);
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 200;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.mobile-overlay { display: none; }

.calendar-panel { overflow: hidden; }
.calendar-toolbar { align-items: center; display: flex; justify-content: space-between; margin-bottom: 18px; }
.calendar-toolbar > div { text-align: center; }
.calendar-toolbar h2 { margin: 0 0 3px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.calendar-weekdays span { padding: 10px 4px; }
.calendar-day { background: #fff; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 118px; padding: 9px; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-outside { background: #f6f7f5; color: #9ca59f; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--gold); }
.calendar-date { display: block; font-size: 12px; font-weight: 800; margin-bottom: 7px; }
.calendar-job { background: #e7f1eb; border: 0; border-left: 3px solid var(--forest-700); border-radius: 5px; color: var(--forest-900); cursor: pointer; display: block; font-family: inherit; font-size: 10px; font-weight: 700; margin: 4px 0; overflow: hidden; padding: 5px 6px; text-align: left; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.calendar-job.active { background: #e3f1e9; border-color: #2f8058; }
.calendar-job.on-hold { background: #fff4d8; border-color: #b77a10; }

.clickable-row, .clickable-card, .metric-link { cursor: pointer; }
.clickable-row { transition: background .15s ease; }
.clickable-row:hover, .clickable-row:focus { background: #fbf6e8; outline: none; }
.clickable-card { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.clickable-card:hover, .clickable-card:focus, .metric-link:hover, .metric-link:focus { border-color: rgba(186, 132, 14, .6); box-shadow: 0 8px 22px rgba(19, 49, 37, .1); outline: 3px solid rgba(223, 169, 28, .13); transform: translateY(-1px); }
.record-dialog { max-width: 790px; }
.record-dialog .dialog-heading p:last-child { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.record-summary { background: var(--cream-100); border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 1px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; overflow: hidden; }
.record-summary span { background: rgba(255,255,255,.55); color: var(--muted); display: grid; font-size: 11px; gap: 3px; min-width: 0; padding: 12px; overflow-wrap: anywhere; }
.record-summary strong { color: var(--forest-900); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.record-quick-actions { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; padding-top: 16px; }
.job-workflow-guide { background: linear-gradient(135deg, #f9f4e6, #fff); border: 1px solid #e9d6a4; border-radius: 13px; display: grid; gap: 12px; margin: 0 0 16px; padding: 15px; }
.job-workflow-guide h3 { color: var(--forest-900); font-size: 17px; margin: 0; }
.job-workflow-guide p { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
.job-workflow-actions, .customer-quick-actions, .camera-quick-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.customer-quick-actions { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.customer-quick-actions a { text-decoration: none; }
.workflow-steps { display: grid; gap: 7px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.workflow-step { background: #eef1ef; border-radius: 9px; color: var(--muted); display: grid; font-size: 9px; font-weight: 850; gap: 5px; min-height: 54px; padding: 8px; text-align: center; }
.workflow-step::before { align-items: center; background: #dce3de; border-radius: 50%; color: var(--muted); content: attr(data-step); display: flex; height: 20px; justify-content: center; margin: auto; width: 20px; }
.workflow-step.is-done { background: #e8f4ed; color: var(--success); }
.workflow-step.is-done::before { background: var(--success); color: #fff; content: "✓"; }
.workflow-step.is-current { background: #fff2c9; color: #6f4c00; outline: 2px solid var(--gold-500); }
.workflow-step.is-current::before { background: var(--gold-500); color: var(--forest-950); }
.delivery-panel, .payment-history { background: #f8faf7; border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 8px; grid-column: 1 / -1; padding: 12px; }
.delivery-panel strong, .payment-history strong { color: var(--forest-900); font-size: 12px; }
.delivery-panel small, .payment-history small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.payment-row { align-items: center; border-top: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: 1fr auto; padding-top: 8px; }
.billing-metrics { margin-bottom: 18px; }
.leaderboard-heading { align-items: flex-end; }
.dashboard-leaderboard { background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(246,237,218,.62)); border: 1px solid #d9dfda; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 22px; padding: 22px; }
.dashboard-leaderboard > .leaderboard-heading { margin-bottom: 18px; }
.dashboard-leaderboard > .leaderboard-heading h2 { color: var(--forest-900); font-size: 27px; letter-spacing: -.035em; margin: 0 0 6px; }
.dashboard-leaderboard > .leaderboard-heading p:last-child { color: var(--muted); font-size: 12px; margin: 0; }
.leaderboard-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.leaderboard-filters label { color: var(--muted); display: grid; font-size: 10px; font-weight: 850; gap: 5px; letter-spacing: .07em; text-transform: uppercase; }
.leaderboard-filters select { background: var(--white); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); min-height: 40px; min-width: 160px; padding: 8px 11px; text-transform: none; }
.leaderboard-metrics { margin-bottom: 18px; }
.leaderboard-podium { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.podium-card { background: linear-gradient(145deg, var(--white), #f4f6f2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--ink); display: grid; gap: 10px; min-height: 178px; overflow: hidden; padding: 20px; position: relative; text-align: left; width: 100%; }
.podium-card.team-review-trigger { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.podium-card.team-review-trigger:hover, .podium-card.team-review-trigger:focus-visible { box-shadow: 0 12px 30px rgba(12, 47, 35, .16); outline: 3px solid rgba(223, 169, 28, .2); transform: translateY(-2px); }
.podium-card::after { background: var(--forest-900); border-radius: 0 0 0 36px; color: var(--gold-400); content: attr(data-rank); font-size: 20px; font-weight: 900; padding: 9px 14px 12px 18px; position: absolute; right: 0; top: 0; }
.podium-card.first { background: linear-gradient(145deg, #fff9e6, #f0d891); border-color: #dfbd5b; }
.podium-card.second { background: linear-gradient(145deg, #ffffff, #e6ebe7); }
.podium-card.third { background: linear-gradient(145deg, #fff8f0, #ead1b5); }
.podium-person { align-items: center; display: flex; gap: 11px; padding-right: 34px; }
.podium-avatar { align-items: center; background: var(--forest-900); border: 3px solid rgba(223,169,28,.45); border-radius: 50%; color: var(--white); display: flex; flex: 0 0 auto; font-size: 14px; font-weight: 900; height: 46px; justify-content: center; width: 46px; }
.podium-person strong { color: var(--forest-900); display: block; font-size: 16px; }
.podium-person small { color: var(--muted); display: block; font-size: 10px; margin-top: 3px; }
.podium-score { border-top: 1px solid rgba(12,47,35,.12); display: grid; gap: 3px; margin-top: auto; padding-top: 12px; }
.podium-score span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.podium-score strong { color: var(--forest-900); font-size: 25px; letter-spacing: -.04em; }
.leaderboard-table-panel td:first-child { color: var(--warning); font-size: 16px; font-weight: 900; }
.leaderboard-person { align-items: center; display: flex; gap: 9px; }
.leaderboard-person .avatar { flex: 0 0 auto; }
.leaderboard-person-button { align-items: center; background: transparent; border: 0; color: inherit; display: inline-flex; gap: 9px; padding: 3px 5px 3px 0; text-align: left; }
.leaderboard-person-button:hover strong, .leaderboard-person-button:focus-visible strong { color: var(--forest-700); text-decoration: underline; text-underline-offset: 3px; }
.leaderboard-person-button:focus-visible { border-radius: 8px; outline: 3px solid rgba(223, 169, 28, .2); }
.performance-dialog { max-width: 1120px; width: min(1120px, calc(100% - 28px)); }
.performance-dialog form { max-height: min(86vh, 900px); overflow-y: auto; }
.performance-metrics { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.performance-metric { background: var(--cream-100); border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 3px; padding: 13px; }
.performance-metric span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.performance-metric strong { color: var(--forest-900); font-size: 21px; }
.performance-section { border: 1px solid var(--line); border-radius: 13px; margin-bottom: 14px; overflow: hidden; }
.performance-section .panel-heading { background: var(--cream-100); margin: 0; padding: 13px 15px; }
.performance-section .panel-heading h3 { color: var(--forest-900); font-size: 17px; margin: 0; }
.performance-section .table-wrap { max-height: 245px; overflow: auto; }
.performance-section table { margin: 0; }
.performance-section tbody tr { cursor: pointer; }
.performance-section tbody tr:hover { background: #fbf6e8; }
.settings-layout { display: grid; gap: 16px; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); }
.settings-layout .panel { align-self: start; }
.service-settings { border-top: 4px solid var(--gold-500); }
.service-settings > .field { margin-bottom: 18px; }
.compact-form-grid { margin-bottom: 14px; }
.invite-result { background: var(--cream-100); border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 10px; margin-top: 16px; padding: 14px; }
.invite-result .button { justify-self: start; }
.table-select { background: var(--cream-100); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); min-height: 38px; min-width: 175px; padding: 7px 9px; }
.access-level-grid { display: grid; gap: 11px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.access-level-card { background: var(--cream-100); border: 1px solid var(--line); border-radius: 12px; min-height: 140px; padding: 15px; }
.access-level-card.is-current { background: linear-gradient(145deg, #fff8df, #f3e4ae); border-color: #d9b54f; }
.access-level-card > div { align-items: center; display: flex; gap: 8px; justify-content: space-between; }
.access-level-card strong { color: var(--forest-900); font-size: 14px; }
.access-level-card span { background: var(--forest-900); border-radius: 999px; color: var(--gold-400); font-size: 9px; font-weight: 850; padding: 4px 7px; text-transform: uppercase; }
.access-level-card p { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 10px 0 0; }
.invoice-total-preview { align-items: center; background: var(--forest-950); border-radius: 12px; color: var(--white); display: grid; gap: 2px; grid-template-columns: 1fr auto; margin: 2px 0 18px; padding: 15px 17px; }
.invoice-total-preview span { color: rgba(255,255,255,.68); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.invoice-total-preview strong { color: var(--gold-400); font-size: 24px; grid-row: span 2; }
.invoice-total-preview small { color: rgba(255,255,255,.75); font-size: 11px; }
.invoice-dialog { width: min(980px, calc(100vw - 28px)); }
.invoice-dialog form { max-height: min(92vh, 980px); overflow-y: auto; }
.invoice-service-picker, .invoice-lines, .invoice-billing-details, .invoice-terms-preview { border: 1px solid var(--line); border-radius: 13px; margin-bottom: 16px; padding: 16px; }
.invoice-section-heading { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; margin-bottom: 13px; }
.invoice-section-heading h3 { color: var(--forest-950); font-size: 17px; margin: 2px 0 4px; }
.invoice-section-heading p { color: var(--muted); font-size: 12px; margin: 0; }
.invoice-category-tabs { display: flex; gap: 8px; margin: 0 -2px 13px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.invoice-favorites { background: #fbf6e8; border: 1px solid #ead9a8; border-radius: 11px; display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 13px; padding: 10px; }
.invoice-favorites::before { color: var(--forest-800); content: "Quick favorites"; font-size: 9px; font-weight: 900; grid-column: 1 / -1; letter-spacing: .08em; text-transform: uppercase; }
.invoice-favorites[hidden] { display: none; }
.invoice-favorites .invoice-service-button { min-height: 58px; }
.invoice-category-tab { background: var(--cream-100); border: 1px solid var(--line); border-radius: 999px; color: var(--forest-900); cursor: pointer; flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 9px 12px; }
.invoice-category-tab[aria-selected="true"] { background: var(--forest-900); border-color: var(--forest-900); color: #fff; }
.invoice-service-grid { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.invoice-service-button { align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); cursor: pointer; display: grid; gap: 4px; min-height: 66px; padding: 11px 12px; text-align: left; }
.invoice-service-button:hover { border-color: var(--gold-500); box-shadow: 0 3px 12px rgba(21, 48, 37, .07); }
.invoice-service-button strong { color: var(--forest-950); font-size: 12px; }
.invoice-service-button small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.invoice-line-card { background: var(--cream-100); border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) 90px 110px auto; margin-top: 10px; padding: 12px; }
.invoice-line-card:first-child { margin-top: 0; }
.invoice-line-card label { display: grid; gap: 5px; }
.invoice-line-card label > span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.invoice-line-card input, .invoice-line-card textarea { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 39px; padding: 8px 9px; width: 100%; }
.invoice-line-card textarea { line-height: 1.4; min-height: 64px; resize: vertical; }
.invoice-line-card .invoice-line-description { grid-column: 1; }
.invoice-line-card .invoice-line-remove { align-self: end; min-height: 39px; }
.invoice-lines-empty { color: var(--muted); font-size: 12px; padding: 10px 2px 3px; text-align: center; }
.invoice-billing-details { background: #fff; }
.invoice-billing-details summary { color: var(--forest-950); cursor: pointer; font-size: 13px; font-weight: 850; list-style-position: inside; }
.invoice-billing-details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 15px; padding-bottom: 12px; }
.invoice-terms-preview { background: var(--cream-100); margin-top: -4px; }
.invoice-terms-preview summary { color: var(--forest-900); cursor: pointer; font-size: 12px; font-weight: 850; list-style-position: inside; }
.invoice-terms-preview p { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 12px 0 0; }
.inline-filter { align-items: center; color: var(--muted); display: flex; font-size: 11px; font-weight: 800; gap: 8px; }
.inline-filter select { background: var(--cream-100); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); min-width: 210px; padding: 8px 10px; }
.form-template-grid { display: grid; gap: 11px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-template-card { border: 1px solid var(--line); border-radius: 11px; display: flex; flex-direction: column; min-height: 170px; padding: 15px; }
.form-template-card > span { color: var(--gold-600); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.form-template-card h3 { color: var(--forest-900); font-size: 15px; line-height: 1.35; margin: 8px 0; }
.form-template-card p { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 0 0 14px; }
.form-template-card .button { margin-top: auto; width: fit-content; }
.form-template-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.form-template-actions .button { margin-top: 0; }
.form-document-fields { border-top: 1px solid var(--line); margin: 2px 0 0; padding-top: 16px; }

.public-document-screen {
  background: linear-gradient(145deg, var(--forest-950), var(--forest-900));
  min-height: calc(100vh - 30px);
  padding: 42px 20px;
}
.public-document-scope p { white-space: pre-line; }
.public-document-shell { margin: 0 auto; max-width: 820px; }
.public-document-brand { align-items: center; color: var(--white); display: flex; gap: 22px; margin-bottom: 22px; }
.public-document-brand img { filter: drop-shadow(0 10px 20px rgba(0,0,0,.2)); height: 112px; object-fit: contain; width: 112px; }
.public-document-brand h1 { font-size: clamp(28px, 5vw, 48px); letter-spacing: -.045em; margin: 0 0 8px; }
.public-document-brand p:last-child { color: rgba(255,255,255,.72); margin: 0; }
.public-document-card, .public-document-error { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(22px, 5vw, 42px); }
.public-document-meta { background: var(--cream-100); border: 1px solid var(--line); border-radius: 13px; display: grid; gap: 1px; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; }
.public-document-meta span { background: rgba(255,255,255,.6); color: var(--muted); display: grid; font-size: 12px; gap: 4px; padding: 14px; }
.public-document-meta strong { color: var(--forest-900); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.public-document-scope { border-bottom: 1px solid var(--line); padding: 24px 0; }
.public-document-scope h2 { color: var(--forest-900); font-size: 20px; margin: 0 0 10px; }
.public-document-scope p { color: var(--muted); line-height: 1.7; margin: 0; white-space: pre-wrap; }
.public-document-total { align-items: center; background: var(--forest-950); border-radius: 13px; color: var(--white); display: flex; justify-content: space-between; margin: 22px 0; padding: 18px 20px; }
.public-document-total span { color: var(--gold-400); font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.public-document-total strong { font-size: 30px; }
.public-document-terms { background: var(--cream-100); border: 1px solid var(--line); border-radius: 13px; margin: 0 0 22px; padding: 18px 20px; }
.public-document-terms h2 { color: var(--forest-900); font-size: 15px; margin: 0 0 8px; }
.public-document-terms p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
#publicSignatureForm { display: grid; gap: 14px; }
.approval-checkbox { align-items: flex-start; color: var(--ink); display: flex; font-size: 12px; gap: 10px; line-height: 1.45; }
.approval-checkbox input { flex: 0 0 auto; height: 18px; margin-top: 1px; width: 18px; }
.public-signed-confirmation { background: #e8f4ed; border: 1px solid #b8dbc7; border-radius: 12px; color: var(--success); font-weight: 750; line-height: 1.55; padding: 18px; }

.action-center { background: linear-gradient(145deg, var(--forest-950), var(--forest-900)); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); color: var(--white); margin-bottom: 22px; padding: 22px; }
.action-center > .panel-heading h2 { color: var(--white); font-size: 25px; margin: 0 0 5px; }
.action-center > .panel-heading p:last-child { color: rgba(255,255,255,.64); font-size: 12px; margin: 0; }
.action-center-metrics { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.action-metric { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; color: var(--white); display: grid; gap: 2px; min-height: 92px; padding: 13px; text-align: left; width: 100%; }
button.action-metric { cursor: pointer; }
button.action-metric:hover, button.action-metric:focus-visible { background: rgba(255,255,255,.14); outline: 2px solid var(--gold-400); }
.action-metric span { color: rgba(255,255,255,.62); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.action-metric strong { color: var(--gold-400); font-size: 25px; }
.action-metric small { color: rgba(255,255,255,.72); font-size: 9px; }
.action-center-list { background: var(--white); margin: 0; padding: 0; }
.action-center-list table { margin: 0; }
.priority-chip { border-radius: 999px; display: inline-flex; font-size: 9px; font-weight: 900; padding: 5px 7px; text-transform: uppercase; }
.priority-chip.high { background: #ffe2dd; color: #8b3427; }
.priority-chip.medium { background: #fff0c9; color: #7a5100; }
.priority-chip.normal { background: #e8f4ed; color: var(--success); }

.crew-picker, .required-form-picker { border: 1px solid var(--line); border-radius: 11px; margin: 0; padding: 13px; }
.crew-picker legend, .required-form-picker legend { color: var(--forest-900); font-size: 11px; font-weight: 850; padding: 0 6px; }
.crew-picker > div, .required-form-picker > div { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crew-picker label, .required-form-picker label { align-items: center; background: var(--cream-100); border: 1px solid var(--line); border-radius: 9px; display: flex; font-size: 11px; gap: 8px; padding: 9px; }
.crew-picker small { color: var(--muted); display: block; font-size: 10px; margin-top: 9px; }
.assigned-crew { display: flex; flex-wrap: wrap; gap: 4px; }
.crew-chip { background: #e8f1eb; border-radius: 999px; color: var(--forest-800); display: inline-flex; font-size: 9px; font-weight: 800; padding: 4px 7px; }

.record-timeline { border-top: 1px solid var(--line); margin: 2px 0 18px; padding-top: 16px; }
.record-timeline .panel-heading { margin-bottom: 10px; }
.record-timeline h3 { color: var(--forest-900); font-size: 17px; margin: 0; }
.timeline-entry { display: grid; gap: 2px; grid-template-columns: 10px minmax(0, 1fr) auto; padding: 9px 0; position: relative; }
.timeline-entry::before { background: var(--gold-500); border-radius: 50%; content: ""; height: 8px; margin-top: 5px; width: 8px; }
.timeline-entry:not(:last-child)::after { background: var(--line); content: ""; height: calc(100% - 12px); left: 3px; position: absolute; top: 19px; width: 2px; }
.timeline-entry strong { color: var(--ink); font-size: 12px; }
.timeline-entry small { color: var(--muted); display: block; font-size: 10px; }
.timeline-entry time { color: var(--muted); font-size: 9px; white-space: nowrap; }

.setup-notice { align-items: center; background: #fff8e6; border-color: #e7c66e; display: flex; margin-bottom: 18px; }
.setup-notice h2 { color: var(--forest-900); margin: 0 0 6px; }
.setup-notice p:last-child { color: #755710; margin: 0; }

.file-upload-form { align-self: start; display: grid; gap: 14px; }
.camera-upload-note { background: #edf5ef; border: 1px solid #c8dfcf; border-radius: 9px; color: var(--forest-800); font-size: 11px; line-height: 1.5; padding: 10px 11px; }
.form-note, .empty-copy { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 0; }
.file-list { display: grid; gap: 10px; }
.file-card { align-items: center; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 12px; grid-template-columns: 42px minmax(0, 1fr) auto; padding: 12px; }
.file-type { align-items: center; background: var(--cream); border-radius: 8px; color: var(--forest-900); display: flex; font-size: 10px; font-weight: 900; height: 42px; justify-content: center; text-transform: uppercase; width: 42px; }
.file-card strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.file-card small { color: var(--muted); display: block; font-size: 10px; margin-top: 3px; }
.file-actions { display: flex; gap: 5px; }
.file-actions button { background: transparent; border: 1px solid var(--line); border-radius: 6px; color: var(--forest-900); cursor: pointer; font-size: 11px; padding: 6px 8px; }
.record-file-cabinet { border-top: 1px solid var(--line); margin: 2px 0 18px; padding-top: 16px; }
.record-file-cabinet .panel-heading { align-items: end; margin-bottom: 10px; }
.record-file-cabinet h3 { color: var(--forest-900); font-size: 17px; margin: 0; }
.record-file-cabinet .panel-heading p:last-child { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 4px 0 0; max-width: 520px; }
.file-cabinet-search { display: block; margin-bottom: 10px; }
.file-cabinet-search input { background: #f9faf8; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font: inherit; font-size: 12px; padding: 10px 12px; width: 100%; }
.file-cabinet-tree { display: grid; gap: 9px; }
.file-folder { background: #f8faf7; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.file-folder > summary { align-items: center; cursor: pointer; display: grid; gap: 10px; grid-template-columns: 32px minmax(0, 1fr) auto; list-style: none; padding: 11px 12px; }
.file-folder > summary::-webkit-details-marker { display: none; }
.file-folder > summary:hover, .file-folder > summary:focus-visible { background: #fbf6e8; outline: none; }
.file-folder-icon { align-items: center; background: var(--gold-100); border-radius: 7px; color: var(--gold-700); display: flex; font-size: 14px; height: 30px; justify-content: center; width: 30px; }
.file-folder summary strong { color: var(--forest-900); display: block; font-size: 12px; }
.file-folder summary small { color: var(--muted); display: block; font-size: 9px; margin-top: 2px; }
.file-folder-count { align-items: center; background: #e7efe9; border-radius: 999px; color: var(--forest-800); display: flex; font-size: 9px; font-weight: 800; height: 24px; justify-content: center; min-width: 24px; padding: 0 7px; }
.file-folder-body { background: var(--white); border-top: 1px solid var(--line); padding: 10px; }
.file-folder-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }

.mobile-bottom-nav { display: none; }
.mobile-action-grid { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mobile-action-grid button { align-items: flex-start; background: var(--cream-100); border: 1px solid var(--line); border-radius: 11px; color: var(--forest-900); display: grid; gap: 3px; min-height: 78px; padding: 13px; text-align: left; }
.mobile-action-grid button strong { font-size: 13px; }
.mobile-action-grid button small { color: var(--muted); font-size: 10px; line-height: 1.35; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 230px; }
  .main-content { padding-left: 24px; padding-right: 24px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .leaderboard-podium { grid-template-columns: 1fr; }
  .action-center-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .squatchy-panel { min-height: 270px; }
  .squatchy-copy { max-width: 60%; padding-bottom: 28px; }
  .squatchy-panel img { bottom: -62px; }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; max-width: 620px; }
  .login-brand-panel { min-height: 430px; }
  .login-mascot { bottom: -105px; opacity: .66; }
  .login-card { padding: 38px; }
  .leaderboard-heading { align-items: flex-start; }
  .leaderboard-filters { justify-content: flex-start; width: 100%; }
  .sidebar { box-shadow: var(--shadow-lg); transform: translateX(-102%); transition: transform .2s ease; width: 264px; }
  .sidebar.is-open { transform: translateX(0); }
  .app-content { margin-left: 0; }
  .menu-button, .mobile-wordmark { display: block; }
  .topbar-title { display: grid; gap: 2px; }
  .mobile-overlay { background: rgba(7, 29, 22, .52); bottom: 0; left: 0; position: fixed; right: 0; top: 30px; z-index: 70; }
  .mobile-overlay.is-visible { display: block; }
  .lower-grid, .estimate-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .performance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .future-job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .prototype-banner { align-items: flex-start; flex-direction: column; gap: 1px; }
  .login-screen { min-height: calc(100vh - 45px); padding: 12px; }
  .login-shell { border-radius: 18px; min-height: 0; }
  .login-brand-panel { min-height: 340px; padding: 27px; }
  .login-logo { height: 86px; width: 86px; }
  .login-brand-copy .eyebrow { margin-top: 18px; }
  .login-brand-copy h1 { font-size: 2.65rem; }
  .login-brand-copy p:last-child { font-size: 14px; }
  .login-mascot { bottom: -105px; height: 390px; opacity: .6; right: -86px; }
  .login-card { gap: 20px; padding: 27px; }
  .topbar { padding: 0 15px; top: 45px; }
  .global-search-wrap { display: none; }
  .connection-banner { margin-left: 0; padding: 9px 15px; }
  .main-content { padding: 23px 15px 112px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 120px; padding: 16px; }
  .metric-card strong { font-size: 27px; }
  .panel { padding: 17px; }
  .dashboard-leaderboard { border-radius: var(--radius); padding: 17px; }
  .action-center { border-radius: var(--radius); padding: 17px; }
  .action-center-metrics { grid-template-columns: 1fr 1fr; }
  .public-document-screen { padding: 22px 12px; }
  .public-document-brand { align-items: flex-start; flex-direction: column; }
  .public-document-brand img { height: 86px; width: 86px; }
  .public-document-meta { grid-template-columns: 1fr; }
  .crew-picker > div, .required-form-picker > div { grid-template-columns: 1fr; }
  .squatchy-copy { max-width: 100%; padding-bottom: 180px; }
  .quick-grid, .form-grid { grid-template-columns: 1fr; }
  .pricebook-detail { grid-template-columns: 1fr; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .filter-row select { max-width: none; }
  .customer-directory-item > summary { gap: 9px; grid-template-columns: minmax(0, 1fr) 50px 50px; padding: 13px; }
  .customer-directory-item > summary .status-badge { display: none; }
  .customer-directory-item > summary::after { grid-column: 4; }
  .customer-directory-actions { justify-content: stretch; }
  .customer-directory-actions .button { flex: 1; }
  .customer-site-card > header { align-items: stretch; flex-direction: column; }
  .customer-job-row { align-items: start; grid-template-columns: 1fr auto; }
  .customer-job-row > span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .record-summary { grid-template-columns: 1fr; }
  .record-file-cabinet .panel-heading { align-items: stretch; }
  .record-file-cabinet .panel-heading .button { width: 100%; }
  .file-card { align-items: start; grid-template-columns: 38px minmax(0, 1fr); }
  .file-card .file-type { height: 38px; width: 38px; }
  .file-card .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .form-template-grid { grid-template-columns: 1fr; }
  .access-level-grid { grid-template-columns: 1fr; }
  .inline-filter { align-items: stretch; flex-direction: column; width: 100%; }
  .inline-filter select { min-width: 0; width: 100%; }
  .field.full { grid-column: auto; }
  .mobile-bottom-nav { align-items: stretch; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); bottom: 0; box-shadow: 0 -8px 24px rgba(7,29,22,.11); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); left: 0; padding: 6px max(5px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-right)); position: fixed; right: 0; z-index: 62; }
  .mobile-bottom-nav button { align-items: center; background: transparent; border: 0; color: var(--muted); display: grid; font-size: 15px; gap: 1px; justify-items: center; min-height: 48px; padding: 4px 2px; }
  .mobile-bottom-nav button strong { font-size: 9px; }
  .mobile-bottom-nav button.is-active { color: var(--forest-900); }
  .mobile-bottom-nav .mobile-add-button span { align-items: center; background: var(--gold-500); border-radius: 50%; color: var(--forest-950); display: flex; font-size: 22px; font-weight: 800; height: 32px; justify-content: center; margin-top: -13px; width: 32px; }
  .workflow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .job-workflow-actions .button, .customer-quick-actions .button, .camera-quick-actions .button { flex: 1 1 calc(50% - 8px); }
  .field-job-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .field-job-actions .button { width: 100%; }
  .invoice-dialog { width: calc(100vw - 16px); }
  .invoice-service-picker, .invoice-lines, .invoice-billing-details, .invoice-terms-preview { padding: 13px; }
  .invoice-section-heading { display: grid; }
  .invoice-section-heading .button { width: 100%; }
  .invoice-favorites { grid-template-columns: 1fr; }
  .invoice-service-grid { grid-template-columns: 1fr; }
  .dialog-heading .draft-control { align-items: flex-start; grid-column: 1 / -1; margin-left: 0; }
  .invoice-line-card { grid-template-columns: 1fr 82px 100px; }
  .invoice-line-card .invoice-line-description { grid-column: 1 / -1; }
  .invoice-line-card .invoice-line-remove { grid-column: 1 / -1; width: 100%; }
  .filter-row { flex-direction: column; }
  .filter-row select { max-width: none; }
  .future-job-grid { grid-template-columns: 1fr; }
  .calendar-day { min-height: 80px; padding: 5px; }
  .calendar-job { font-size: 0; min-height: 8px; padding: 0; }
  .calendar-toolbar .button { padding-left: 9px; padding-right: 9px; }
  .empty-state { padding: 27px 17px; }
  .dialog form { padding: 19px; }
  .dialog-actions .button { flex: 1; }
  .hide-small { display: none; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .page-actions { grid-template-columns: 1fr; }
  .topbar h2 { font-size: 15px; }
  .mobile-action-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
