:root {
  --bg: #eef1ee;
  --panel: #ffffff;
  --panel-soft: #f7f8f5;
  --ink: #17241c;
  --muted: #647169;
  --line: rgba(23, 36, 28, 0.12);
  --green: #14763b;
  --green-deep: #0d4d2b;
  --amber: #c47d1a;
  --red: #b84636;
  --blue: #2d628b;
  --charcoal: #26312b;
  --radius: 8px;
  --shadow: 0 18px 42px rgba(21, 33, 25, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(20, 118, 59, 0.08), rgba(45, 98, 139, 0.06)),
    var(--bg);
}

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

button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  border-color: rgba(20, 118, 59, 0.42);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: #eef1ee;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(14, 45, 27, 0.2)),
    url("assets/branding/logo-primary.png");
  background-position: center, center 48%;
  background-repeat: no-repeat;
  background-size: cover, min(1180px, calc(100vw - 48px)) auto;
}

.login-screen.hidden {
  display: none;
}

.login-panel.hidden {
  display: none;
}

.login-panel {
  width: min(380px, 100%);
  padding: 26px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 34px rgba(14, 45, 27, 0.14);
}

.login-panel h1,
.top-panel h2,
.panel h3 {
  font-family: "Archivo", Arial, sans-serif;
  letter-spacing: 0;
}

.login-panel h1 {
  margin: 0 0 20px;
  font-size: 1.55rem;
  line-height: 1.15;
}

.login-panel label,
.stacked-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.login-panel input,
.stacked-form input,
.stacked-form select,
.stacked-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.login-panel button,
.stacked-form button,
.top-actions button:first-child {
  margin-top: 16px;
  border-color: transparent;
  background: var(--green);
  color: #fff;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.login-actions button {
  margin-top: 16px;
}

.login-actions button[type="button"] {
  border-color: var(--line);
  background: #fff;
  color: var(--green-deep);
}

.login-panel p:last-child {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.app-shell[aria-hidden="true"] {
  filter: blur(1px);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: #13251b;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.66);
}

.workspace-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.1);
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: #fff;
  color: var(--green-deep);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-footer p {
  color: rgba(255, 255, 255, 0.68);
}

.main-panel {
  min-width: 0;
  padding: 24px;
}

.top-panel,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.top-panel > div,
.panel-heading > div {
  min-width: 0;
}

.top-panel {
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.top-panel h2,
.panel h3 {
  margin: 0;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

.metric {
  padding: 18px;
}

.metric span,
.record-list span,
.statement-list span,
.budget-list span {
  color: var(--muted);
  font-size: 0.88rem;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 1.45rem;
}

.metric.danger strong,
.transaction-amount.expense,
.statement-amount.liability,
.budget-total.over {
  color: var(--red);
}

.budget-total.within {
  color: var(--green);
}

.panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.recurring-revenue-panel {
  grid-column: 1 / -1;
}

.recurring-automation-status {
  min-height: 1.3em;
  margin-top: 12px;
}

.invoice-panel {
  grid-column: 1 / -1;
}

.invoice-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border-block: 1px solid var(--line);
}

.invoice-kpi {
  min-width: 0;
  padding: 16px;
}

.invoice-kpi + .invoice-kpi {
  border-left: 1px solid var(--line);
}

.invoice-kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-kpi strong {
  display: block;
  margin-top: 6px;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 1.2rem;
}

.invoice-setup-note {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(184, 70, 54, 0.28);
  border-radius: var(--radius);
  background: #fff7f5;
}

.invoice-setup-note p,
.invoice-safety-copy,
.invoice-empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.invoice-table-wrap {
  margin-top: 16px;
}

.payment-reconciliation {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(196, 125, 26, 0.28);
  border-radius: var(--radius);
  background: #fffaf2;
}

.payment-reconciliation .section-heading {
  align-items: flex-start;
}

.payment-reconciliation .section-heading > span {
  color: var(--amber);
  font-weight: 800;
}

.payment-reconciliation-table-wrap {
  margin-top: 12px;
}

.payment-reconciliation-table td {
  vertical-align: middle;
}

.invoice-table td {
  vertical-align: middle;
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.invoice-actions button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.invoice-actions .invoice-void {
  border-color: rgba(184, 70, 54, 0.3);
  color: var(--red);
}

.invoice-editor-card {
  max-width: 660px;
}

.invoice-safety-copy {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.invoice-empty-state {
  padding: 18px 0 4px;
}

.invoice-empty-state button {
  margin-top: 16px;
}

.recurring-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border-block: 1px solid var(--line);
}

.recurring-kpi {
  min-width: 0;
  padding: 18px 16px;
}

.recurring-kpi + .recurring-kpi {
  border-left: 1px solid var(--line);
}

.recurring-kpi span,
.recurring-kpi small,
.section-heading span,
.recurring-plan-row span,
.recurring-attention-row span,
.table-secondary {
  color: var(--muted);
}

.recurring-kpi span,
.recurring-kpi small {
  display: block;
}

.recurring-kpi span {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.recurring-kpi strong {
  display: block;
  margin: 7px 0 4px;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 1.55rem;
}

.recurring-kpi small {
  font-size: 0.78rem;
  line-height: 1.35;
}

.recurring-kpi.danger strong {
  color: var(--red);
}

.recurring-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.recurring-dashboard-section {
  min-width: 0;
  padding: 20px 16px;
}

.recurring-dashboard-section + .recurring-dashboard-section {
  border-left: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h4 {
  margin: 0;
  font-size: 1rem;
}

.section-heading span {
  font-size: 0.8rem;
  text-align: right;
}

.recurring-plan-mix,
.recurring-attention-list {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.recurring-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.recurring-plan-row:last-child,
.recurring-attention-row:last-child {
  border-bottom: 0;
}

.recurring-plan-row > div:first-child,
.recurring-attention-row > div {
  min-width: 0;
}

.recurring-plan-row strong,
.recurring-attention-row strong {
  display: block;
}

.recurring-plan-row span,
.recurring-attention-row span {
  font-size: 0.8rem;
}

.recurring-plan-row .bar-track {
  grid-column: 1 / -1;
}

.recurring-attention-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.recurring-empty {
  padding: 18px 0 8px;
}

.recurring-empty.compact {
  padding-top: 14px;
}

.recurring-empty strong,
.recurring-empty p {
  margin: 0;
}

.recurring-empty p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.recurring-account-heading {
  margin-top: 20px;
}

.recurring-table-wrap {
  margin-top: 0;
}

.recurring-revenue-table {
  min-width: 780px;
  margin-top: 8px;
}

.recurring-revenue-table td {
  font-size: 0.88rem;
}

.table-secondary {
  font-size: 0.78rem;
}

.recurring-table-empty {
  padding-block: 24px;
  color: var(--muted);
  text-align: center;
}


.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.dashboard-grid > *,
.overview-grid > *,
.metric-grid > * {
  min-width: 0;
}

.overview-grid {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 220px);
}

.priority-panel {
  padding: 14px;
}

.priority-panel .panel-heading {
  margin-bottom: 4px;
}

.priority-panel .task-list {
  gap: 8px;
}

.priority-panel .task-item {
  padding: 10px;
}

.priority-panel .task-item p {
  font-size: 0.82rem;
  line-height: 1.35;
}

.panel {
  padding: 18px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.panel.wide {
  grid-column: span 1;
}

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

.daily-toolbar h3 {
  margin: 0;
  font-family: "Archivo", Arial, sans-serif;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.week-capacity-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.week-capacity-summary.near {
  border-left-color: #a16207;
}

.week-capacity-summary.over {
  border-left-color: #b42318;
}

.week-capacity-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
}

.week-capacity-summary > div:first-child {
  border-left: 0;
}

.week-capacity-summary span,
.day-capacity span,
.job-capacity-hint span {
  color: var(--muted);
  font-size: 0.76rem;
}

.week-capacity-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.calendar-day {
  min-width: 0;
  min-height: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  overflow: hidden;
}

.calendar-day.today {
  border-color: rgba(20, 118, 59, 0.42);
  background: #f1f8f1;
}

.calendar-day header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.calendar-day.capacity-near {
  border-color: rgba(161, 98, 7, 0.45);
}

.calendar-day.capacity-over {
  border-color: rgba(180, 35, 24, 0.55);
  background: #fff6f5;
}

.day-capacity {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
}

.day-capacity > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.day-capacity b {
  color: var(--green);
  font-size: 0.7rem;
}

.capacity-near .day-capacity b {
  color: #8a5105;
}

.capacity-over .day-capacity b {
  color: #b42318;
}

.capacity-track {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: #dce3dd;
  overflow: hidden;
}

.capacity-track i {
  display: block;
  height: 100%;
  background: var(--green);
}

.capacity-near .capacity-track i {
  background: #b86f0a;
}

.capacity-over .capacity-track i {
  background: #c43227;
}

.calendar-day strong,
.calendar-day small {
  display: block;
}

.calendar-day small,
.schedule-card small {
  color: var(--muted);
}

.schedule-card {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 10px;
  min-width: 0;
  border: 1px solid rgba(23, 36, 28, 0.1);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.schedule-card strong,
.schedule-card small,
.schedule-card span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.schedule-card.recurring {
  border-left: 4px solid var(--green);
}

.schedule-card.job {
  border-left: 4px solid var(--blue);
}

.schedule-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.schedule-actions .inline-edit,
.schedule-actions .inline-delete {
  margin-left: 0;
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.76rem;
}

.schedule-payment-state {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(20, 118, 59, 0.22);
  border-radius: var(--radius);
  background: rgba(20, 118, 59, 0.08);
  color: var(--green-deep);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.schedule-payment-state.attention {
  border-color: rgba(184, 111, 10, 0.28);
  background: rgba(184, 111, 10, 0.09);
  color: #7a4805;
}

.capacity-editor-form h4 {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.job-capacity-hint {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(20, 118, 59, 0.25);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: #f4f9f4;
}

.job-capacity-hint.near {
  border-color: rgba(161, 98, 7, 0.3);
  border-left-color: #a16207;
  background: #fffbeb;
}

.job-capacity-hint.over {
  border-color: rgba(180, 35, 24, 0.3);
  border-left-color: #b42318;
  background: #fff6f5;
}

.job-capacity-hint > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.capacity-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.capacity-suggestions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.daily-route-board,
.daily-checklist,
.daily-summary {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.daily-job-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: var(--panel-soft);
  min-width: 0;
}

.daily-job-card.recurring {
  border-left-color: var(--green);
}

.daily-job-card.complete {
  border-left-color: var(--green);
  background: #f5faf4;
}

.daily-job-card.complete .daily-job-main h4 {
  color: var(--green-deep);
}

.daily-job-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.daily-job-main h4 {
  margin: 8px 0 4px;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 1.05rem;
}

.daily-job-main p,
.daily-contact-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.daily-photo-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.daily-photo-row span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(20, 118, 59, 0.35);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.58);
}

.daily-service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 14px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.daily-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.daily-card-actions button {
  margin: 0;
}

.daily-card-actions .complete-job-button {
  border-color: transparent;
  background: var(--green);
  color: #fff;
}

.daily-card-actions .complete-job-button:hover {
  background: var(--green-deep);
}

.daily-closeout-state {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.daily-closeout-state span {
  padding: 6px 8px;
  border: 1px solid rgba(20, 118, 59, 0.2);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.daily-check-item,
.daily-notes-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.daily-check-item {
  grid-template-columns: auto 1fr;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.daily-check-item input {
  margin-top: 3px;
}

.daily-notes-label {
  margin-top: 14px;
}

.daily-notes-label textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  resize: vertical;
  color: var(--ink);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  min-width: min(720px, calc(100vw - 64px));
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green-deep);
  font-weight: 800;
  font-size: 0.78rem;
}

.pill.warn {
  background: #fff4df;
  color: #925c10;
}

.pill.danger {
  background: #fbe7e3;
  color: var(--red);
}

.pill.info {
  background: #e8f1f7;
  color: var(--blue);
}

.task-list,
.record-list,
.statement-list,
.budget-list,
.expense-bars,
.catalog-grid,
.kanban,
.plan-tier-grid,
.acquisition-grid {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

.task-item,
.record-item,
.statement-item,
.budget-item,
.service-item,
.lead-column,
.plan-tier-card,
.acquisition-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  min-width: 0;
  max-width: 100%;
}

.task-item strong,
.record-item strong,
.statement-item strong,
.budget-item strong,
.service-item strong,
.plan-tier-card strong {
  display: block;
  margin-bottom: 5px;
}

.statement-item,
.budget-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe6df;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.expense-bars .bar-fill,
.bar-fill.over {
  background: linear-gradient(90deg, var(--red), #d98678);
}

.bar-fill.within {
  background: linear-gradient(90deg, var(--green), #72b86f);
}

.catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.plan-tier-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
}

.plan-tier-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.plan-tier-card h4,
.acquisition-card h4 {
  margin: 8px 0 4px;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 1rem;
}

.plan-tier-card ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.service-item p,
.lead-card p,
.task-item p,
.record-item p,
.plan-tier-card p,
.acquisition-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.acquisition-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.commission-item {
  border-color: rgba(20, 118, 59, 0.22);
}

.kanban {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.lead-pipeline-summary {
  margin-bottom: 14px;
}

.lead-column h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}

.lead-column h4 span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.lead-card {
  padding: 11px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  min-width: 0;
}

.lead-customer {
  font-weight: 700;
  color: var(--ink) !important;
}

.lead-due {
  font-size: 0.78rem;
  font-weight: 800;
}

.lead-due-0,
.lead-due-1 {
  color: var(--red) !important;
}

.lead-actions,
.lead-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.lead-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.lead-action-primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.lead-action-close {
  border-color: rgba(184, 70, 54, 0.28);
  color: var(--red);
}

.lead-record-actions .inline-edit,
.lead-record-actions .inline-delete {
  margin-left: 0;
}

.lead-card + .lead-card {
  margin-top: 9px;
}

.inline-edit,
.inline-delete {
  min-height: 30px;
  margin-left: 10px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.inline-delete {
  border-color: rgba(184, 70, 54, 0.28);
  color: var(--red);
}

.inline-delete:hover {
  border-color: rgba(184, 70, 54, 0.6);
}

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

.quote-template-actions button {
  margin-top: 0;
  background: var(--panel-soft);
  color: var(--ink);
  border-color: var(--line);
  min-width: 0;
  white-space: normal;
}

#communications .panel-actions button,
#communications .stacked-form button {
  white-space: normal;
}

#communications .record-item,
#communications .form-status {
  overflow-wrap: anywhere;
}

.quote-record {
  border-left: 4px solid rgba(47, 89, 61, 0.28);
}

.approved-quote-record {
  border-left-color: var(--green);
  background: #f8fbf4;
}

.quote-approval-summary {
  color: var(--green) !important;
  font-weight: 800;
}

.quote-approval-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid #dbe6d6;
  border-radius: var(--radius);
  background: #f7fbf5;
}

.quote-approval-tools[hidden] {
  display: none;
}

.quote-approval-tools span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-approval-tools strong {
  display: block;
  color: var(--ink);
}

.quote-approval-tools p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.quote-approval-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quote-approval-tool-actions a,
.quote-approval-tool-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(20, 118, 59, 0.26);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-deep);
  font-weight: 800;
  text-decoration: none;
}

.quote-approval-tool-actions a {
  background: var(--green);
  color: #fff;
}

.quote-approval-request {
  background: #f4f8f0;
  border: 1px solid #dbe6d6;
  border-radius: 8px;
  margin: 18px 0;
  padding: 18px;
  text-align: center;
}

.quote-approval-request span {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.quote-approval-request p {
  margin: 0 0 14px;
}

.quote-approval-preview {
  align-items: center;
  background: var(--green);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  margin-top: 4px;
  max-width: 100%;
  padding: 12px 16px;
  text-decoration: none;
  white-space: normal;
}

.quote-approval-preview.pending {
  background: #dfe7db;
  color: #566358;
  cursor: not-allowed;
}

.phone-alert-panel {
  gap: 14px;
}

.phone-alert-panel p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.phone-alert-panel .phone-alert-diagnostics {
  color: #546158;
  font-size: 0.86rem;
}

.phone-alert-latest {
  border: 1px solid #dbe6d6;
  border-radius: var(--radius);
  background: #f7fbf5;
  color: var(--ink);
  padding: 12px;
}

.phone-alert-latest strong {
  display: block;
  margin-bottom: 4px;
}

.phone-alert-latest small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.phone-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.phone-alert-actions button {
  background: var(--green);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 13px;
}

.assistant-command {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.assistant-command label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.assistant-command textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  resize: vertical;
  color: var(--ink);
}

.assistant-command button,
.assistant-action-controls button:first-child {
  width: fit-content;
  border-color: transparent;
  background: var(--green);
  color: #fff;
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 10px;
  margin-top: 14px;
}

.automation-grid button {
  min-height: 48px;
  background: var(--panel-soft);
}

.assistant-examples {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.assistant-examples button {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 0.85rem;
  text-align: left;
  white-space: normal;
}

.assistant-action {
  display: grid;
  gap: 10px;
}

.assistant-action.needs-review {
  border-color: rgba(184, 70, 54, 0.38);
  background: #fff7f5;
}

.assistant-action-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.assistant-preview {
  min-height: auto;
  max-height: 190px;
  margin: 0;
  font-size: 0.86rem;
}

.assistant-steps {
  display: grid;
  gap: 8px;
}

.assistant-steps p {
  margin: 0;
}

.assistant-error {
  color: var(--red);
  font-weight: 700;
}

.assistant-action-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-action-controls button {
  margin: 0;
}

.assistant-log-item.success {
  border-color: rgba(20, 118, 59, 0.24);
}

.assistant-log-item.danger {
  border-color: rgba(184, 70, 54, 0.32);
}

.stacked-form {
  display: grid;
  gap: 13px;
  margin-top: 14px;
}

.quote-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

#communications .quote-price-row button {
  min-height: 42px;
  margin: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--green-deep);
}

.quote-advanced-field {
  display: none !important;
}

.assessment-panel {
  display: grid;
  gap: 14px;
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid rgba(20, 118, 59, 0.16);
  border-radius: var(--radius);
  background: #f7fbf5;
}

.assessment-panel h4 {
  margin: 0;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 1.02rem;
}

.assessment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.assessment-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.assessment-panel select,
.assessment-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.assessment-result {
  padding: 13px 14px;
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: #fff;
}

.assessment-result span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assessment-result strong {
  display: block;
  font-family: "Archivo", Arial, sans-serif;
}

.assessment-result p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

pre {
  min-height: 220px;
  margin: 14px 0 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: var(--radius);
  background: #17241c;
  color: #f4f8f1;
  line-height: 1.6;
}

.quote-letter {
  min-height: 220px;
  margin: 14px 0 0;
  padding: 18px;
  width: 100%;
  overflow-x: hidden;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f4ed;
}

.quote-letter-page {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(34, 52, 40, 0.14);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(22, 39, 29, 0.08);
  overflow-wrap: anywhere;
}

.quote-letter-page * {
  max-width: 100%;
}

.quote-letter-header,
.quote-letter-footer,
.quote-letter-box div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.quote-letter-header {
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.quote-letter-header span,
.quote-letter-box span,
.quote-logo-stamp span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quote-letter-header strong {
  display: block;
  margin-top: 3px;
  font-family: var(--display);
  font-size: 1.4rem;
}

.quote-letter-page p {
  color: var(--text);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.quote-letter-box,
.quote-letter-reference {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(45, 91, 62, 0.16);
  border-radius: 8px;
  background: #f7fbf5;
}

.quote-letter-box strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.quote-letter-reference p {
  margin: 0;
}

.quote-letter-footer {
  align-items: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.quote-logo-stamp {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.quote-logo-stamp img {
  width: 120px;
  max-width: 35vw;
  opacity: 0.88;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: var(--radius);
  background: var(--charcoal);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 36, 28, 0.42);
}

.editor-modal.hidden {
  display: none;
}

.editor-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 54px rgba(21, 33, 25, 0.24);
}

.document-viewer-card {
  width: min(900px, 100%);
}

.document-viewer-body {
  display: grid;
  gap: 8px;
  color: var(--text);
}

.document-viewer-body h2,
.document-viewer-body h3,
.document-viewer-body h4,
.document-viewer-body p {
  margin: 0;
}

.document-viewer-body h2 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: "Archivo", Arial, sans-serif;
  font-size: 1.45rem;
}

.document-viewer-body h3 {
  margin-top: 16px;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 1.05rem;
}

.document-viewer-body h4 {
  margin-top: 10px;
  font-size: 0.95rem;
}

.document-viewer-body p {
  line-height: 1.55;
}

.document-bullet {
  padding-left: 14px;
  border-left: 3px solid rgba(20, 118, 59, 0.18);
}

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

.editor-heading h3 {
  margin: 0;
  font-family: "Archivo", Arial, sans-serif;
}

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

.editor-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.editor-form input,
.editor-form select,
.editor-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.editor-wide,
.editor-actions {
  grid-column: 1 / -1;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.editor-actions button[type="submit"] {
  border-color: transparent;
  background: var(--green);
  color: #fff;
}

.field-closeout-card {
  width: min(680px, 100%);
}

.field-closeout-card .eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.closeout-intro {
  margin: -4px 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.closeout-checks {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.closeout-checks legend {
  padding: 0 5px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.field-closeout-form .closeout-checks label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--ink);
  font-weight: 650;
}

.field-closeout-form .closeout-checks input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

.automation-checks {
  border-left: 4px solid var(--green);
  background: #f5faf4;
}

.payment-choice-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: #f7faf6;
}

.payment-choice-group legend {
  padding: 0 5px;
  font-size: 0.88rem;
  font-weight: 800;
}

.field-closeout-form .payment-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.field-closeout-form .payment-choice:has(input:checked) {
  border-color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}

.field-closeout-form .payment-choice input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.payment-choice span,
.payment-choice strong,
.payment-choice small {
  display: block;
  min-width: 0;
}

.payment-choice small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.external-payment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.external-payment-fields.hidden {
  display: none;
}

.closeout-resources {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.closeout-resources legend {
  padding: 0 5px;
  font-size: 0.88rem;
  font-weight: 800;
}

.resource-help,
.closeout-resources > p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.resource-closeout-list {
  display: grid;
  gap: 8px;
}

.resource-closeout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.45fr);
  align-items: end;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.field-closeout-form .resource-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.resource-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.resource-choice span,
.resource-choice small {
  display: block;
}

.resource-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 600;
}

.closeout-resources.setup-needed,
.system-setup-note {
  border-left: 4px solid #b7791f;
  background: #fffaf0;
}

.transfer-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e2e8df;
}

.transfer-progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.system-setup-note {
  padding: 12px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius);
}

.system-setup-note p {
  margin: 4px 0 0;
  color: var(--muted);
}

.handoff-item.ready {
  border-left: 4px solid var(--green);
}

.handoff-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.handoff-owners {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.handoff-owners span,
.maintenance-item p,
.usage-item p {
  overflow-wrap: anywhere;
}

.asset-identity {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.closeout-status:empty {
  display: none;
}

.closeout-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  line-height: 1.45;
}

.closeout-status.working {
  border-left: 4px solid var(--blue);
}

.closeout-status.complete {
  border-left: 4px solid var(--green);
}

.closeout-status.error {
  border-left: 4px solid #b42318;
  background: #fff6f5;
  color: #8f1f16;
}

.closeout-result-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) minmax(0, 1fr);
  gap: 12px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.closeout-result-row strong {
  overflow-wrap: anywhere;
}

.closeout-result-row.success strong {
  color: var(--green-deep);
}

.closeout-result-row.attention strong {
  color: #9b2c20;
}

@media (max-width: 640px) {
  .editor-modal {
    align-items: end;
    padding: 0;
  }

  .field-closeout-card {
    width: 100%;
    max-height: 94vh;
    padding: 18px 15px calc(18px + env(safe-area-inset-bottom));
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .field-closeout-form {
    grid-template-columns: 1fr;
  }

  .field-closeout-form > * {
    grid-column: 1;
  }

  .external-payment-fields {
    grid-template-columns: 1fr;
  }

  .closeout-result-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .resource-closeout-row,
  .handoff-owners {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  .recurring-metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .recurring-kpi:nth-child(3) {
    border-left: 0;
  }

  .recurring-kpi:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .daily-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .workspace-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid,
  .overview-grid,
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-grid,
  .plan-tier-grid,
  .acquisition-grid,
  .automation-grid,
  .kanban,
  .weekly-calendar {
    grid-template-columns: 1fr 1fr;
  }

  .daily-contact-grid,
  .daily-service-list {
    grid-template-columns: 1fr;
  }

  #communications .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .week-capacity-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-capacity-summary > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .week-capacity-summary > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .job-capacity-hint > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

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

  .invoice-kpi:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .invoice-kpi:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .invoice-actions {
    justify-content: flex-start;
  }

  .main-panel {
    padding: 14px;
  }

  .top-panel,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-job-main,
  .daily-photo-row {
    grid-template-columns: 1fr;
  }

  .daily-job-main {
    display: grid;
  }

  .workspace-nav,
  .dashboard-grid,
  .overview-grid,
  .metric-grid,
  .catalog-grid,
  .plan-tier-grid,
  .acquisition-grid,
  .automation-grid,
  .assessment-grid,
  .kanban,
  .weekly-calendar,
  .quote-template-actions,
  .quote-price-row,
  .editor-form {
    grid-template-columns: 1fr;
  }

  .recurring-metric-grid,
  .recurring-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .recurring-kpi + .recurring-kpi,
  .recurring-kpi:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .recurring-dashboard-section {
    padding-inline: 0;
  }

  .recurring-dashboard-section + .recurring-dashboard-section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .section-heading span {
    text-align: left;
  }

  .recurring-account-heading {
    margin-bottom: 12px;
  }

  .recurring-table-wrap {
    overflow: visible;
  }

  .recurring-revenue-table {
    min-width: 0;
    margin: 0;
  }

  .recurring-revenue-table thead {
    display: none;
  }

  .recurring-revenue-table tbody {
    display: grid;
    gap: 12px;
  }

  .recurring-revenue-table tr:not(.recurring-empty-row) {
    display: grid;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
  }

  .recurring-revenue-table tr:not(.recurring-empty-row) td {
    display: grid;
    grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
  }

  .recurring-revenue-table tr:not(.recurring-empty-row) td:last-child {
    border-bottom: 0;
  }

  .recurring-revenue-table tr:not(.recurring-empty-row) td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .recurring-empty-row,
  .recurring-empty-row td {
    display: block;
  }

  #communications .panel {
    padding: 14px;
  }

  #communications .panel-actions,
  #communications .quote-template-actions,
  .quote-approval-tool-actions {
    width: 100%;
  }

  #communications .panel-actions button,
  #communications .quote-template-actions button,
  #communications .stacked-form button,
  .quote-approval-tool-actions a,
  .quote-approval-tool-actions button {
    width: 100%;
    margin-left: 0;
  }

  .quote-approval-tools {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .quote-approval-tool-actions {
    justify-content: stretch;
  }

  .quote-letter {
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    width: 100%;
    border: 0;
    background: transparent;
  }

  .quote-letter-page {
    border-radius: 8px;
    max-width: 100%;
    padding: 12px;
    box-shadow: none;
  }

  .quote-letter-header,
  .quote-letter-footer,
  .quote-letter-box div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .quote-letter-box strong {
    text-align: left;
  }

  .quote-letter-header strong {
    font-size: clamp(1.05rem, 5.5vw, 1.25rem);
  }

  .quote-letter-box,
  .quote-letter-reference {
    margin: 14px 0;
    padding: 12px;
  }

  .quote-approval-request {
    margin: 14px 0;
    padding: 14px;
  }

  .quote-approval-preview {
    display: flex;
    width: 100%;
    min-height: 46px;
    text-align: center;
  }

  .quote-logo-stamp {
    justify-items: center;
    text-align: center;
    width: 100%;
  }

  .quote-logo-stamp img {
    width: min(150px, 70vw);
    max-width: 100%;
  }
}
