:root {
  color-scheme: light;
  --bg: #ffffff;
  --alt-bg: #f2f4f7;
  --dark-bg: #0b1f3f;
  --primary: #0c387d;
  --primary-dark: #0b1f3f;
  --gold: #fdc51b;
  --gold-2: #fdb71b;
  --ink: #1c2130;
  --text: #1c2130;
  --ink-2: #30394f;
  --muted: #6f7787;
  --line: #e3e7f0;
  --line-strong: #cad2df;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-strong: #f2f4f7;
  --blue-soft: rgba(12, 56, 125, 0.1);
  --gold-soft: rgba(253, 197, 27, 0.18);
  --success: #118660;
  --danger: #b74443;
  --shadow: 0 18px 50px rgba(11, 31, 63, 0.12);
  --shadow-soft: 0 8px 26px rgba(11, 31, 63, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --font-body: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Poppins", "Noto Sans", ui-sans-serif, system-ui, sans-serif;
  --type-page-title: 28px;
  --type-page-title-mobile: 22px;
  --type-section-title: 18px;
  --type-subsection-title: 16px;
  --type-card-title: 14px;
  --type-body: 13.5px;
  --type-table: 13px;
  --type-label: 11px;
  --type-caption: 11.5px;
  --type-chip: 11px;
  --type-line-tight: 1.2;
  --type-line-body: 1.42;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;
  --type-heading-color: #12213a;
  --type-body-color: #293244;
  --type-muted-color: #778196;
  --type-label-color: #7a8496;
}

* {
  box-sizing: border-box;
}

[hidden],
.nav-tab[hidden],
.top-nav-tab[hidden],
.quick-nav-tab[hidden],
.tab-panel[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
  line-height: var(--type-line-body);
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(242, 244, 247, 0.94) 100%),
    url("assets/background-screen-transparent-25.png") top left / min(1400px, 100vw) auto no-repeat,
    var(--alt-bg);
}

body.app-booting {
  overflow: hidden;
}

body.app-booting .app-shell {
  opacity: 0;
  visibility: hidden;
}

.boot-loader {
  align-items: center;
  background:
    linear-gradient(135deg, #061a36 0%, #0c387d 52%, #081427 100%),
    url("assets/background-screen-transparent-25.png") center / min(1200px, 100vw) auto no-repeat;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 24px;
  position: fixed;
  transition: opacity 320ms ease, visibility 320ms ease;
  z-index: 20000;
}

body:not(.app-booting) .boot-loader {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.boot-loader-logo {
  animation: bootLogoPulse 1.15s ease-in-out infinite;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.28));
  height: clamp(46px, 8.125vw, 74px);
  object-fit: contain;
  transform-origin: center;
  transition: opacity 320ms ease, transform 320ms ease, filter 320ms ease;
  width: clamp(58px, 10vw, 91px);
}

body:not(.app-booting) .boot-loader-logo {
  animation: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0));
  opacity: 0;
  transform: scale(0.88) translateY(-8px);
}

@keyframes bootLogoPulse {
  0% {
    opacity: 0.82;
    transform: scale(0.98);
  }

  50% {
    opacity: 1;
    transform: scale(1.035);
  }

  100% {
    opacity: 0.82;
    transform: scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-loader,
  .boot-loader-logo {
    animation: none;
    transition: none;
  }
}

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

button {
  cursor: pointer;
}

.app-toast-region {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 12000;
  pointer-events: none;
  display: grid;
  justify-items: end;
  width: min(360px, calc(100vw - 32px));
}

.app-toast {
  align-items: center;
  animation: toastIn 180ms ease-out;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(11, 31, 63, 0.18);
  color: var(--primary-dark);
  display: flex;
  gap: 10px;
  max-width: 100%;
  min-height: 44px;
  padding: 11px 14px 11px 12px;
}

.app-toast i {
  align-items: center;
  background: rgba(17, 134, 96, 0.12);
  border-radius: 999px;
  color: var(--success);
  display: inline-flex;
  flex: 0 0 24px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.app-toast span {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.app-toast.warning {
  border-left-color: var(--gold);
}

.app-toast.warning i {
  background: var(--gold-soft);
  color: #9b6a00;
}

.app-toast.error {
  border-left-color: var(--danger);
}

.app-toast.error i {
  background: rgba(183, 68, 67, 0.12);
  color: var(--danger);
}

.app-toast.leaving {
  animation: toastOut 200ms ease-in forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) translateX(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px) translateX(8px);
  }
}

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

.sidebar {
  background:
    linear-gradient(180deg, rgba(253, 197, 27, 0.11), transparent 34%),
    var(--primary-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #eaf5ef;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  padding: 22px;
  position: sticky;
  top: 0;
}

.brand-lockup {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 78px 1fr;
}

.brand-mark {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  color: #fff;
  display: flex;
  font-weight: 900;
  height: 58px;
  justify-content: center;
  padding: 9px;
  width: 78px;
}

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

.brand-lockup h1,
.topbar h2,
.panel h3,
.quote-sheet h3,
.opening-section h3,
.command-hero h3,
.stat-card strong,
.metric-card strong,
.sidebar-panel strong {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.05;
  margin: 0;
}

.brand-lockup h1 {
  color: #fff;
  font-size: 18px;
}

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

.sidebar .eyebrow {
  color: rgba(234, 245, 239, 0.58);
}

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

.nav-tab,
.segment,
.primary-button,
.secondary-button,
.ghost-button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 780;
  min-height: 40px;
}

.nav-tab {
  background: transparent;
  color: rgba(234, 245, 239, 0.65);
  align-items: center;
  display: grid;
  gap: 3px;
  grid-template-columns: 22px 1fr;
  padding: 10px 12px;
  text-align: left;
}

.nav-tab i {
  color: rgba(253, 197, 27, 0.78);
  grid-row: span 2;
  text-align: center;
}

.nav-tab span {
  color: inherit;
  font-size: 14px;
}

.nav-tab small {
  color: rgba(234, 245, 239, 0.42);
  font-size: 11px;
}

.nav-tab.active,
.nav-tab:hover {
  background: rgba(12, 56, 125, 0.28);
  border-color: rgba(253, 197, 27, 0.42);
  color: #ffffff;
}

.nav-tab.active small,
.nav-tab:hover small {
  color: rgba(234, 245, 239, 0.7);
}

.sidebar-panel {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 8px;
  padding: 16px;
}

.sidebar-panel strong {
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

.sidebar-panel span {
  color: rgba(234, 245, 239, 0.68);
  font-size: 12px;
}

.side-meter {
  background: rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  height: 7px;
  margin-top: 4px;
  overflow: hidden;
}

.side-meter span {
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 160ms ease;
}

.mode-toggle {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.segment {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(234, 245, 239, 0.7);
}

.segment.active {
  background: var(--gold);
  color: var(--primary-dark);
}

.side-readiness {
  display: grid;
  gap: 8px;
}

.side-readiness-row {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: 10px 1fr;
}

.dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.dot.ready {
  background: var(--success);
}

.dot.blocked {
  background: var(--gold);
}

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

.topbar {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: clamp(26px, 3vw, 42px);
  max-width: 920px;
}

.header-logo {
  display: block;
  height: auto;
  margin-bottom: 12px;
  width: 110px;
}

.context-row,
.quote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.topbar-actions,
.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  padding: 0 14px;
}

.primary-button {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--primary-dark);
}

.secondary-button {
  background: var(--surface-solid);
  border-color: var(--line);
  color: var(--ink);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.64);
  border-color: var(--line);
  color: var(--ink-2);
}

.full-width {
  margin-top: 16px;
  width: 100%;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 20px;
}

#lead .lead-layout,
#consult > .consult-grid,
#consult > .opening-section,
#quote > .quote-sheet,
#quote > .review-panel,
#invoice > .ops-grid,
#order > .ops-grid,
#install > .ops-grid,
#service > .panel:not(.manager-panel) {
  display: none;
}

.panel,
.quote-sheet,
.command-hero,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel,
.quote-sheet,
.opening-section,
.command-hero {
  padding: 20px;
}

.panel-heading,
.section-title-row,
.quote-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.status-pill,
.chip,
.status-cell {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 820;
  gap: 6px;
  line-height: 1;
  min-height: 28px;
  padding: 7px 10px;
  white-space: nowrap;
}

.status-pill,
.chip {
  background: var(--blue-soft);
  color: var(--primary);
}

.status-pill.live {
  background: var(--gold-soft);
  color: var(--primary-dark);
}

.chip.dark {
  background: var(--ink);
  color: #fff;
}

.chip.warn {
  background: var(--gold-soft);
  color: var(--primary-dark);
}

.command-hero {
  display: grid;
  gap: 20px;
}

.command-hero h3 {
  font-size: 24px;
}

.lifecycle-rail {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(8, minmax(86px, 1fr));
  overflow-x: auto;
  padding-bottom: 2px;
}

.stage-node {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 86px;
  padding: 12px;
  position: relative;
}

.stage-node::before {
  background: var(--line-strong);
  border-radius: 999px;
  content: "";
  display: block;
  height: 5px;
  margin-bottom: 12px;
  width: 100%;
}

.stage-node.done::before {
  background: var(--gold);
}

.stage-node.active {
  background: #ffffff;
  border-color: rgba(12, 56, 125, 0.42);
  box-shadow: 0 12px 28px rgba(12, 56, 125, 0.13);
}

.stage-node.active::before {
  background: var(--primary);
}

.stage-node strong {
  display: block;
}

.stage-node span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.stat-grid,
.metric-strip {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.stat-card,
.metric-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 98px;
  padding: 16px;
}

.stat-card > i,
.metric-card > i {
  align-items: center;
  background: var(--blue-soft);
  border-radius: var(--radius-sm);
  color: var(--primary);
  display: flex;
  height: 34px;
  justify-content: center;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
}

.stat-card span,
.metric-card span,
.compact-stat small,
.quote-total span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong,
.metric-card strong {
  font-size: 28px;
  line-height: 1;
}

.stat-card small,
.metric-card small {
  color: var(--muted);
}

.command-grid,
.lead-layout,
.consult-grid,
.ops-grid,
.admin-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.22fr) minmax(330px, 0.78fr);
}

.work-list,
.check-stack,
.packet-list,
.logic-list {
  display: grid;
  gap: 10px;
}

.workbench-toolbar {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 1fr) 220px;
}

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

.queue-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

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

.queue-heading h3 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  margin: 0;
}

.queue-heading .eyebrow i {
  color: var(--gold-2);
  margin-right: 5px;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  display: grid;
  gap: 8px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.record-card:hover,
.record-card.active-record {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(12, 56, 125, 0.12);
}

.record-card.active-record {
  background: linear-gradient(135deg, rgba(253, 197, 27, 0.16), #fff 44%);
}

.record-topline,
.record-meta {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.record-topline strong {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.2;
}

.record-topline small,
.record-address,
.record-action,
.record-meta span {
  color: var(--muted);
  font-size: 12px;
}

.record-topline small {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
  max-width: 46%;
  padding: 4px 7px;
  text-align: right;
}

.record-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.record-meta span {
  background: var(--surface-strong);
  border-radius: 999px;
  padding: 4px 7px;
}

.record-action {
  border-top: 1px solid var(--line);
  margin-top: 3px;
  padding-top: 8px;
}

.record-assignees {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-start;
  margin-top: 2px;
  padding-top: 8px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  padding: 14px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.section-divider {
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.compact-heading {
  margin-bottom: 10px;
}

.conversion-note {
  align-items: center;
  background: var(--blue-soft);
  border: 1px solid rgba(12, 56, 125, 0.18);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  grid-template-columns: 38px 1fr;
  margin-bottom: 14px;
  padding: 12px;
}

.conversion-note i {
  align-items: center;
  background: var(--gold);
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  display: flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.conversion-note strong,
.conversion-note span {
  display: block;
}

.conversion-note span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.work-item,
.check-item,
.packet-item,
.logic-list div {
  align-items: center;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.work-item,
.check-item,
.packet-item {
  grid-template-columns: 34px 1fr auto;
}

.logic-list div {
  grid-template-columns: 1fr auto;
}

.work-item > i,
.check-item > i,
.packet-item > i {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--primary);
  display: flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.check-item > i.fa-triangle-exclamation {
  color: var(--gold-2);
}

.check-item > i.fa-circle-check {
  color: var(--success);
}

.work-item strong,
.check-item strong,
.packet-item strong,
.logic-list strong {
  display: block;
}

.work-item span,
.check-item span,
.packet-item span,
.logic-list span,
.quote-line p {
  color: var(--muted);
  font-size: 13px;
}

.telemetry {
  display: grid;
  gap: 14px;
}

.screen-stack {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  min-height: 186px;
}

.screen-bar {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.28) 0 4px, transparent 4px 8px),
    linear-gradient(180deg, rgba(12, 56, 125, 0.92), rgba(253, 197, 27, 0.9));
  border: 1px solid rgba(11, 31, 63, 0.16);
  border-radius: 6px 6px 3px 3px;
  min-height: 44px;
}

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

.telemetry-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}

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

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

.wide-field {
  grid-column: 1 / -1;
}

.section-heading-row {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.section-heading-row h4 {
  margin-bottom: 4px;
}

.section-heading-row p {
  max-width: 760px;
}

.record-edit-grid textarea {
  min-height: 108px;
}

.compact-action-row {
  justify-content: end;
  margin: 0;
}

.read-only-note-block {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 6px;
  padding: 12px;
}

.read-only-note-block span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.read-only-note-block p {
  color: var(--ink);
}

.editable-notes-section textarea {
  min-height: 132px;
}

.single-column {
  grid-template-columns: 1fr;
  margin-top: 16px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 820;
  gap: 7px;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  min-height: 42px;
  padding: 9px 10px;
  resize: vertical;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(27, 143, 182, 0.22);
  outline-offset: 2px;
}

.opening-section {
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.compact-stat {
  min-width: 96px;
  text-align: right;
}

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

.compact-stat span {
  display: block;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

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

.opening-card {
  background:
    linear-gradient(180deg, rgba(12, 56, 125, 0.05), transparent 44%),
    var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px;
  padding: 16px;
}

.opening-card header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.opening-card h4 {
  margin: 0;
}

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

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.checkbox-row input {
  min-height: auto;
  width: auto;
}

.quote-sheet {
  background:
    linear-gradient(135deg, rgba(253, 197, 27, 0.13), transparent 35%),
    var(--surface-solid);
}

.quote-total {
  text-align: right;
}

.quote-total strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.quote-items {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.quote-line {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr auto;
  padding-top: 12px;
}

.manager-panel {
  box-shadow: var(--shadow-soft);
}

.manager-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.manager-header h3 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
  margin: 0;
}

.manager-header p:not(.eyebrow) {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 820px;
}

.manager-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.manager-metric {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 13px;
  position: relative;
}

.manager-metric i {
  color: var(--primary);
  position: absolute;
  right: 13px;
  top: 13px;
}

.manager-metric span,
.manager-metric small,
.record-table td span {
  color: var(--muted);
  font-size: 12px;
}

.manager-metric strong {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 26px;
  line-height: 1;
}

.record-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.status-group > .record-table-wrap,
.status-record-table-wrap {
  border-top: 0;
}

.status-group > .record-table-wrap .record-table thead th,
.status-record-table-wrap .record-table thead th {
  border-top: 0;
}

.record-table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.process-table {
  min-width: 0;
}

.record-table tr {
  background: rgba(255, 255, 255, 0.7);
}

.record-table tr:hover,
.record-table tr.selected-row {
  background: color-mix(in srgb, var(--group-accent, var(--primary)) 5%, white);
}

.record-table td strong,
.record-table td span {
  display: block;
}

.record-table th,
.record-table td {
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.record-table th {
  height: 42px;
  vertical-align: middle;
}

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

.table-primary-link {
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  font: inherit;
  padding: 0;
  text-align: left;
  width: 100%;
}

.table-primary-link strong {
  color: var(--text);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.table-primary-link span {
  color: var(--muted);
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 2px;
}

.status-badge {
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  max-width: 100%;
  padding: 7px 10px;
}

.status-badge.active {
  background: var(--blue-soft);
  border-color: rgba(12, 56, 125, 0.22);
  color: var(--primary);
}

.status-badge.ready {
  background: color-mix(in srgb, var(--primary) 9%, white);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  color: var(--primary);
}

.status-badge.scheduled {
  background: rgba(253, 197, 27, 0.16);
  border-color: rgba(253, 183, 27, 0.38);
  color: #7a4b00;
}

.status-badge.complete {
  background: rgba(17, 134, 96, 0.1);
  border-color: rgba(17, 134, 96, 0.22);
  color: var(--success);
}

.status-badge.warn {
  background: var(--gold-soft);
  border-color: rgba(253, 183, 27, 0.4);
  color: var(--primary-dark);
}

.status-badge.closed {
  background: rgba(183, 68, 67, 0.1);
  border-color: rgba(183, 68, 67, 0.25);
  color: var(--danger);
}

.status-badge.neutral {
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--muted);
}

.table-action {
  align-items: center;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 34px;
  padding: 0 8px;
  white-space: nowrap;
  width: 100%;
}

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

.status-group-list {
  display: grid;
  gap: 18px;
}

.status-group {
  display: grid;
  gap: 10px;
}

.status-group-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.status-group-heading h4 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  margin: 0;
}

.record-detail-page {
  display: grid;
  gap: 16px;
}

.detail-page-header {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.detail-page-header h3 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 28px;
  margin: 0 0 10px;
}

.back-link {
  align-items: center;
  appearance: none;
  background: #f7faff;
  border: 1px solid #cfdced;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 820;
  gap: 7px;
  line-height: 1;
  min-height: 30px;
  padding: 7px 11px 7px 8px;
  text-decoration: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
  width: max-content;
}

.back-link i {
  align-items: center;
  background: #e8f0fb;
  border: 1px solid #d2dfef;
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-size: 10px;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.back-link:hover {
  background: #eef5ff;
  border-color: #aebfd6;
  box-shadow: 0 8px 20px rgba(12, 31, 61, 0.08);
  color: var(--primary);
}

.back-link:hover i {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.status-select {
  border-radius: 7px;
  font-size: 12px;
  font-weight: 850;
  min-height: 38px;
  padding: 7px 34px 7px 11px;
}

.status-select.active {
  background: var(--blue-soft);
  border-color: rgba(12, 56, 125, 0.22);
  color: var(--primary);
}

.status-select.ready {
  background: color-mix(in srgb, var(--primary) 9%, white);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  color: var(--primary);
}

.status-select.scheduled {
  background: rgba(253, 197, 27, 0.16);
  border-color: rgba(253, 183, 27, 0.42);
  color: #7a4b00;
}

.status-select.complete {
  background: rgba(17, 134, 96, 0.1);
  border-color: rgba(17, 134, 96, 0.24);
  color: var(--success);
}

.status-select.warn {
  background: var(--gold-soft);
  border-color: rgba(253, 183, 27, 0.4);
  color: var(--primary-dark);
}

.status-select.closed {
  background: rgba(183, 68, 67, 0.1);
  border-color: rgba(183, 68, 67, 0.25);
  color: var(--danger);
}

.compact-table {
  min-width: 0;
}

.compact-table-wrap {
  max-width: 100%;
}

.detail-section h4 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  margin: 0;
}

.icon-button {
  min-height: 38px;
  padding: 0;
  width: 38px;
}

.detail-summary,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nested-contact-editor {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.nested-contact-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.nested-contact-heading h5 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  margin: 0;
}

.nested-contact-heading p {
  color: var(--muted);
  margin: 3px 0 0;
}

.additional-contact-rows {
  display: grid;
  gap: 10px;
}

.additional-contact-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-additional-contacts .additional-contact-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.remove-contact-row {
  min-height: 42px;
  padding-inline: 12px;
}

.opening-media-capture {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 12px;
  padding: 12px;
}

.opening-media-capture strong {
  color: var(--primary-dark);
  display: block;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

.opening-media-capture span {
  color: var(--muted);
  font-size: 12px;
}

.opening-media-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  grid-column: 1 / -1;
}

.opening-media-chips span {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  gap: 6px;
  padding: 6px 9px;
}

.customer-projects-section {
  display: grid;
  gap: 14px;
}

.compact-project-metrics {
  margin-top: 0;
}

.customer-project-list {
  display: grid;
  gap: 9px;
}

.customer-project-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(190px, 1.4fr) minmax(100px, 0.62fr) minmax(130px, 0.72fr) minmax(92px, 0.52fr) minmax(190px, 1fr) 18px;
  min-height: 74px;
  padding: 12px;
  text-decoration: none;
}

.customer-project-row:hover {
  border-color: rgba(12, 56, 125, 0.25);
  box-shadow: 0 14px 30px rgba(11, 31, 63, 0.08);
  transform: translateY(-1px);
}

.project-stage-icon {
  align-items: center;
  background: var(--primary-dark);
  border-radius: 8px;
  color: var(--gold);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.project-main,
.project-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-main strong,
.project-field b {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

.project-main small,
.project-field small,
.project-field em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-field em {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-project-row > i {
  color: var(--primary);
  justify-self: end;
}

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

.nested-contact-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 5px;
  padding: 12px;
}

.nested-contact-card strong {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

.nested-contact-card span {
  color: var(--muted);
  font-size: 13px;
}

.process-record-header {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  padding: 14px;
}

.process-record-title {
  align-items: start;
  display: flex;
  gap: 14px;
}

.process-detail-toolbar {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.1fr);
}

.mini-contact-card,
.mini-status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-width: 0;
  padding: 10px 12px;
}

.mini-contact-card {
  display: grid;
  gap: 4px;
}

.mini-contact-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.mini-contact-card strong {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.2;
}

.mini-contact-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mini-status-card {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 360px);
  justify-content: end;
}

.full-width-status-card {
  grid-template-columns: 1fr;
  justify-content: stretch;
}

.status-card-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.status-card-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-card-heading strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.mini-status-card label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.status-control-label {
  margin: 0;
}

.mini-status-card input,
.mini-status-card select {
  width: 100%;
}

.action-workspace {
  background: rgba(12, 56, 125, 0.035);
}

.consult-capture {
  gap: 18px;
}

.consult-session-page .detail-page-header {
  position: sticky;
  top: 18px;
  z-index: 3;
}

.consult-capture-heading {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.consult-capture-heading h5 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  margin: 0;
}

.consult-opening-editor {
  display: grid;
  gap: 12px;
}

.consult-opening-row {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.consult-opening-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.consult-opening-title strong {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
}

.consult-opening-title span {
  color: var(--muted);
  font-size: 13px;
}

.consult-opening-title .duplicate-opening-button {
  align-items: center;
  background: linear-gradient(180deg, #fff8df, #fdeeb2);
  border: 1px solid color-mix(in srgb, var(--gold) 62%, var(--line));
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 14px rgba(11, 31, 63, 0.08);
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  min-height: 34px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
  width: 34px;
}

.consult-opening-title .duplicate-opening-button:hover {
  background: var(--gold);
  border-color: var(--gold-2);
  box-shadow: 0 9px 18px rgba(11, 31, 63, 0.12);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.consult-opening-title .duplicate-opening-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 35%, transparent);
  outline-offset: 2px;
}

.consult-opening-basics {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(190px, 0.9fr) minmax(260px, 1.25fr) minmax(100px, 0.28fr);
}

.consult-opening-basics label {
  min-width: 0;
}

.measurement-entry-panel {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.measurement-entry-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.measurement-entry-heading strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.measurement-entry-heading span {
  color: var(--muted);
  font-size: 12px;
}

.measurement-entry-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.measurement-entry-grid input[readonly] {
  background: #eef3f9;
  color: var(--primary-dark);
}

.measurement-entry-grid input.measurement-diff-warn {
  border-color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.38);
}

.measurement-warning-icons:empty {
  display: none;
}

.measurement-warning-icons {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.measurement-warning-icon {
  align-items: center;
  background: rgba(253, 197, 27, 0.18);
  border: 1px solid rgba(253, 183, 27, 0.72);
  border-radius: 999px;
  color: #7a4b00;
  display: inline-flex;
  font-size: 10px;
  height: 18px;
  justify-content: center;
  line-height: 1;
  width: 18px;
}

.quote-financials,
.customer-quote-preview {
  gap: 18px;
}

.quote-financial-header {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.quote-financial-header h4 {
  margin: 0 0 4px;
}

.quote-tool-header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.quote-tool-header h4 {
  margin: 0 0 4px;
}

.quote-line-list,
.customer-quote-lines {
  display: grid;
  gap: 12px;
}

.quote-review-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.quote-review-list {
  display: grid;
  gap: 8px;
}

.quote-review-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  overflow: hidden;
  padding: 10px 12px;
}

.quote-review-card-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, auto);
}

.quote-review-row-main {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.48fr) minmax(300px, auto);
}

.quote-review-job-main {
  grid-template-columns: minmax(260px, 1fr) minmax(300px, auto);
}

.quote-review-opening-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quote-review-kicker,
.quote-review-section-label {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-review-card h5 {
  color: var(--primary-dark);
  font-size: 15px;
  line-height: 1.15;
  margin: 0;
}

.quote-review-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.quote-review-card small {
  color: #526071;
  font-size: 11.5px;
  line-height: 1.35;
  max-width: 760px;
}

.quote-review-price-strip {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quote-review-price-strip.compact {
  gap: 6px;
}

.quote-review-price {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 2px;
  min-width: 112px;
  padding: 8px 10px;
}

.quote-review-price-strip.compact .quote-review-price {
  min-width: 92px;
  padding: 6px 8px;
}

.quote-review-price em,
.quote-review-info em,
.quote-review-trace em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-review-price strong {
  color: var(--primary-dark);
  font-size: 16px;
  line-height: 1.15;
}

.quote-review-price-strip.compact .quote-review-price strong {
  font-size: 14px;
}

.quote-review-price small {
  color: var(--muted);
  font-size: 11px;
}

.quote-review-card-body {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(230px, 0.95fr) minmax(160px, 0.48fr) minmax(320px, 1.45fr);
}

.quote-review-inline-size {
  align-items: end;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
}

.quote-review-inline-size > span {
  grid-column: 1 / -1;
}

.quote-review-inline-size label {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  font-weight: 850;
  gap: 3px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-review-inline-size input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 750;
  min-height: 32px;
  padding: 6px 8px;
  width: 100%;
}

.quote-review-section {
  align-content: start;
  background: #fbfdff;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 7px;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 9px;
}

.quote-review-section > strong {
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.quote-review-warning-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quote-review-warning-line > span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.quote-review-warning-line .measurement-warning-icons {
  display: inline-flex;
  margin: 0;
  position: static;
  vertical-align: middle;
}

.quote-review-info-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-review-info {
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 6px;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
}

.quote-review-info strong {
  color: var(--primary-dark);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.quote-review-muted {
  color: var(--muted);
  font-size: 12px;
}

.quote-review-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quote-review-alerts.compact {
  border-top: 1px solid rgba(203, 213, 225, 0.72);
  padding-top: 6px;
}

.quote-review-alert {
  align-items: center;
  background: #fff7db;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 999px;
  color: #7a4b00;
  display: inline-flex;
  font-size: 11px;
  font-weight: 780;
  gap: 5px;
  line-height: 1.2;
  padding: 5px 8px;
}

.quote-review-alert.neutral {
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--primary-dark);
}

.quote-review-trace {
  border-top: 1px solid rgba(203, 213, 225, 0.72);
  padding-top: 8px;
}

.quote-review-trace.compact {
  padding-top: 6px;
}

.quote-review-trace summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.quote-review-trace div {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.quote-review-trace span {
  color: var(--muted);
  display: grid;
  font-size: 11.5px;
  gap: 2px;
  overflow-wrap: anywhere;
}

.process-detail-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.quote-review-table {
  border-collapse: collapse;
  min-width: 1360px;
  table-layout: fixed;
  width: 100%;
}

.quote-review-table th:nth-child(1) {
  width: 15%;
}

.quote-review-table th:nth-child(2) {
  width: 19%;
}

.quote-review-table th:nth-child(3) {
  width: 9%;
}

.quote-review-table th:nth-child(4) {
  width: 22%;
}

.quote-review-table th:nth-child(5) {
  width: 12%;
}

.quote-review-table th:nth-child(6) {
  width: 9%;
}

.quote-review-table th:nth-child(7) {
  width: 8%;
}

.quote-review-table th:nth-child(8) {
  width: 6%;
}

.process-detail-table {
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.quote-review-table th,
.quote-review-table td,
.process-detail-table th,
.process-detail-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.quote-review-table th,
.process-detail-table th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.quote-review-table tr:last-child td,
.process-detail-table tr:last-child td {
  border-bottom: 0;
}

.quote-review-table strong,
.quote-review-table span,
.process-detail-table strong,
.process-detail-table span {
  display: block;
}

.quote-review-table span,
.process-detail-table span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.process-detail-table td {
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: normal;
}

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

.quote-size-inputs label {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 850;
  gap: 4px;
}

.quote-size-inputs input {
  min-height: 34px;
  padding: 6px;
  width: 100%;
}

.quote-line-card,
.customer-quote-lines article {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.quote-line-head,
.customer-quote-lines article {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.quote-line-head strong,
.customer-quote-lines strong,
.quote-preview-total {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
}

.quote-line-head span,
.customer-quote-lines span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.quote-preview-total {
  color: var(--primary-dark);
  font-size: 30px;
}

.customer-proposal-page {
  display: grid;
  gap: 16px;
}

.proposal-hero,
.proposal-card {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.proposal-hero {
  display: grid;
  gap: 18px;
}

.proposal-title-row,
.proposal-section-head,
.proposal-decision-card {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.proposal-title-row span,
.proposal-total-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.proposal-title-row h3 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  margin: 6px 0;
}

.proposal-title-row p,
.proposal-section-head p,
.proposal-decision-card p {
  color: var(--muted);
  margin: 0;
}

.proposal-total-box {
  background: var(--primary-dark);
  border-radius: var(--radius-sm);
  color: #fff;
  display: grid;
  gap: 4px;
  min-width: 260px;
  padding: 16px;
  text-align: right;
}

.proposal-total-box strong {
  color: var(--gold);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 34px;
}

.proposal-total-box small {
  color: rgba(255, 255, 255, 0.72);
}

.appointment-total-box strong {
  font-size: clamp(20px, 2.8vw, 30px);
  line-height: 1.05;
}

.customer-thank-you-card {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 28px;
}

.customer-thank-you-icon {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  color: #047857;
  display: inline-flex;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.customer-thank-you-card h4 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  margin: 0 0 6px;
}

.customer-thank-you-card p {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.proposal-meta-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.proposal-line-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.proposal-line-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

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

.proposal-line-table th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.proposal-line-table td {
  color: var(--text);
  font-size: 14px;
}

.proposal-line-table td span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.proposal-line-table tr:last-child td {
  border-bottom: 0;
}

.order-pdf-preview {
  gap: 12px;
}

.order-pdf-preview-head {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.order-pdf-preview-head h4 {
  margin: 0 0 4px;
}

.order-pdf-frame {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  height: min(720px, 72vh);
  min-height: 520px;
  overflow: hidden;
  width: 100%;
}

.order-pdf-fallback {
  align-items: center;
  background: var(--surface-strong);
  display: grid;
  gap: 12px;
  justify-items: center;
  min-height: 320px;
  padding: 24px;
  text-align: center;
}

.job-level-items {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.job-level-items h5 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  margin: 0;
}

.job-level-items article {
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.job-level-items strong,
.job-level-items span {
  display: block;
}

.job-level-items span {
  color: var(--muted);
  font-size: 13px;
}

.proposal-line-table th:last-child,
.proposal-line-table td:last-child {
  text-align: right;
}

.proposal-totals {
  display: grid;
  gap: 8px;
  justify-content: end;
  margin-top: 14px;
}

.proposal-totals div {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: 150px 150px;
}

.proposal-totals span {
  color: var(--muted);
  font-weight: 750;
}

.proposal-totals strong {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  text-align: right;
}

.proposal-grand-total {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.proposal-grand-total strong {
  color: var(--primary-dark);
  font-size: 26px;
}

.agreement-card {
  display: grid;
  gap: 12px;
}

.agreement-card h4,
.proposal-section-head h4,
.proposal-decision-card h4 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  margin: 0;
}

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

.agreement-grid p {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  margin: 0;
  padding: 12px;
}

.proposal-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.proposal-decision-notice {
  align-items: center;
  background: #fff7db;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 8px;
  color: #7c4a00;
  display: flex;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  padding: 10px 12px;
}

.proposal-decision-notice i {
  color: var(--gold);
}

.proposal-decision-confirmation {
  align-items: flex-start;
  background: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: #065f46;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.proposal-decision-confirmation.declined {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.24);
  color: #991b1b;
}

.proposal-decision-confirmation i {
  font-size: 18px;
  margin-top: 2px;
}

.proposal-decision-confirmation div {
  display: grid;
  gap: 3px;
}

.proposal-decision-confirmation strong {
  color: inherit;
  font-size: 14px;
}

.proposal-decision-confirmation span {
  color: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.proposal-decision-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.proposal-link-chip {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  max-width: min(100%, 720px);
  overflow: hidden;
  padding: 7px 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proposal-link-chip i {
  color: var(--gold);
  flex: 0 0 auto;
}

.agreement-check {
  align-items: center;
  background: color-mix(in srgb, var(--primary) 4%, white);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--line));
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 24px minmax(0, 1fr);
  margin-top: 4px;
  max-width: 680px;
  padding: 12px;
}

.agreement-check input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.agreement-check-box {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  width: 24px;
}

.agreement-check-box i {
  font-size: 12px;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 140ms ease, transform 140ms ease;
}

.agreement-check input:checked + .agreement-check-box {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.agreement-check input:checked + .agreement-check-box i {
  opacity: 1;
  transform: scale(1);
}

.agreement-check strong,
.agreement-check small {
  display: block;
}

.agreement-check strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.agreement-check small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}

.locked-record-panel {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.locked-preview-empty {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.warn-message {
  color: var(--danger);
}

.compact-nested-contacts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.opening-detail-grid {
  display: grid;
  gap: 12px;
}

.opening-detail-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.opening-detail-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.opening-detail-head strong,
.opening-detail-head span {
  display: block;
}

.opening-detail-head strong {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
}

.opening-detail-head span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

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

.opening-detail-card p {
  color: var(--muted);
  margin: 0;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  padding: 16px;
}

.detail-section p {
  color: var(--muted);
  margin: 0;
}

.detail-section .read-only-note-block p {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.workflow-guidance {
  align-items: center;
  background: #f8fbff;
  border-left: 4px solid var(--primary);
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 16px;
}

.workflow-guidance.ready,
.workflow-guidance.active {
  background: #f8fbff;
  border-left-color: var(--primary);
}

.workflow-guidance.scheduled {
  background: #fffcf0;
  border-left-color: var(--gold);
}

.workflow-guidance.complete {
  background: #f2fbf7;
  border-left-color: var(--success);
}

.workflow-guidance.warn {
  background: #fff8dd;
  border-left-color: var(--gold);
}

.workflow-guidance.closed {
  background: #fff6f6;
  border-left-color: var(--danger);
}

.workflow-guidance-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workflow-guidance-main span,
.workflow-guidance-blocker span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workflow-guidance-main strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.3;
}

.workflow-guidance-main p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.workflow-guidance-blocker {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 3px;
  min-width: 180px;
  padding: 9px 11px;
}

.workflow-guidance-blocker strong {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.25;
}

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

.detail-field {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.detail-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.detail-field strong {
  font-size: 14px;
}

.detail-field strong,
.detail-field strong a,
.detail-field .table-contact-single,
.detail-field .table-map-link {
  color: var(--ink);
  font-family: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.detail-field strong a,
.detail-field .table-contact-single,
.detail-field .table-map-link {
  display: inline;
  gap: 0;
  text-decoration: none;
}

.detail-field strong a i,
.detail-field .table-contact-single i,
.detail-field .table-map-link i {
  display: none;
}

.detail-field strong a:hover,
.detail-field .table-contact-single:hover,
.detail-field .table-map-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.quote-consult-snapshot {
  gap: 10px;
}

.quote-consult-snapshot .quote-tool-header {
  align-items: center;
}

.consult-snapshot-groups,
.consult-schedule-groups,
.record-summary-groups,
.consult-snapshot-chip-grid,
.consult-snapshot-note-grid,
.consult-schedule-field-list,
.record-summary-field-list {
  display: grid;
  gap: 10px;
}

.consult-snapshot-groups,
.consult-schedule-groups,
.record-summary-groups {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.consult-snapshot-group,
.consult-schedule-group {
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.record-summary-group {
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.consult-snapshot-group h5,
.consult-schedule-group h5,
.record-summary-group h5 {
  background: #fbfcfe;
  border-bottom: 1px solid rgba(203, 213, 225, 0.78);
  color: var(--primary-dark);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  padding: 9px 12px;
}

.consult-snapshot-field dt,
.consult-schedule-field dt,
.record-summary-field dt,
.consult-snapshot-alert span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
}

.consult-snapshot-field dd,
.consult-schedule-field dd,
.record-summary-field dd,
.consult-snapshot-alert strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

.consult-snapshot-chip-grid,
.consult-snapshot-note-grid,
.consult-schedule-field-list,
.record-summary-field-list {
  gap: 0;
  margin: 0;
}

.consult-snapshot-field,
.consult-schedule-field,
.record-summary-field {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(118px, 0.42fr) minmax(0, 1fr);
  min-width: 0;
  padding: 8px 12px;
}

.consult-snapshot-field + .consult-snapshot-field,
.consult-schedule-field + .consult-schedule-field,
.record-summary-field + .record-summary-field {
  border-top: 1px solid rgba(226, 232, 240, 0.86);
}

.consult-snapshot-note-grid .consult-snapshot-field,
.consult-schedule-note-list .consult-schedule-field,
.record-summary-group:nth-child(2) .record-summary-field {
  grid-template-columns: minmax(96px, 0.34fr) minmax(0, 1fr);
}

.record-summary-field a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.record-summary-field a:hover {
  text-decoration: underline;
}

.consult-snapshot-alert {
  background: #fff7db;
  border-color: #efd27c;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.review-panel {
  box-shadow: var(--shadow-soft);
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 9px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.status-cell {
  border-radius: var(--radius-sm);
  color: #fff;
  min-height: 26px;
}

.status-lead {
  background: var(--primary-dark);
}

.status-consult {
  background: var(--primary);
}

.status-quoted {
  background: var(--gold);
  color: var(--primary-dark);
}

.status-install {
  background: var(--primary);
}

.status-service {
  background: var(--gold-2);
  color: var(--primary-dark);
}

.good {
  color: var(--success);
}

.warn {
  color: var(--gold);
}

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

.record-table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.record-table th,
.record-table td {
  overflow-wrap: anywhere;
  white-space: normal;
}

.record-table .table-action {
  white-space: nowrap;
}

.table-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.table-contact-links a,
.table-contact-single,
.table-map-link {
  align-items: center;
  color: var(--primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  text-decoration: none;
}

.table-contact-links a {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.table-contact-single,
.table-map-link {
  overflow-wrap: anywhere;
}

.map-action {
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 7px;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  text-decoration: none;
}

.installer-closeout {
  gap: 16px;
}

.installer-closeout-grid {
  display: grid;
  gap: 12px;
}

.installer-closeout-grid label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
}

.ob-checklist {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ob-checklist h5 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  margin: 0;
}

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

.checklist-row {
  align-items: start;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
}

.checklist-row input[type="checkbox"] {
  flex: 0 0 auto;
  height: 18px;
  margin-top: 3px;
  min-height: 0;
  padding: 0;
  width: 18px;
}

.checklist-row span {
  color: var(--text);
  font-size: 13px;
  font-weight: 590;
  line-height: 1.35;
}

.installer-signoff-summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px;
}

.installer-signoff-summary.complete {
  background: rgba(17, 134, 96, 0.08);
  border-color: rgba(17, 134, 96, 0.22);
}

.installer-signoff-summary span {
  color: var(--muted);
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.installer-signoff-summary strong {
  color: var(--primary-dark);
  font-size: 13.5px;
}

.photo-capture-step {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px;
}

.photo-capture-step h5 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  margin: 0 0 4px;
}

.photo-capture-step p {
  color: var(--muted);
  margin: 0;
}

.photo-capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.photo-capture-button {
  align-items: center;
  background: var(--gold);
  border: 1px solid rgba(11, 31, 63, 0.08);
  border-radius: 8px;
  color: var(--primary-dark);
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  min-width: 164px;
  padding: 9px 14px;
  position: relative;
  text-align: center;
}

.photo-capture-button input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.gallery-action {
  background: #fff;
  border-color: var(--line);
}

.media-upload-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 12px;
  width: 100%;
}

.media-upload-preview.saved {
  border-color: rgba(17, 134, 96, 0.24);
  box-shadow: 0 8px 18px rgba(17, 134, 96, 0.08);
}

.media-upload-preview-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.media-upload-preview-head strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

.media-upload-preview-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.media-upload-preview-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}

.media-upload-preview-strip article {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  flex: 0 0 138px;
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
}

.media-upload-preview-strip article.removable {
  padding-bottom: 0;
}

.media-upload-preview-strip img,
.media-upload-preview-strip video {
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  width: 100%;
}

.media-upload-preview-strip article strong {
  color: var(--primary-dark);
  display: block;
  font-size: 11px;
  overflow: hidden;
  padding: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-upload-preview-strip article.removable strong {
  padding-right: 32px;
}

.media-upload-remove {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(11, 31, 63, 0.14);
  border-radius: 999px;
  bottom: 6px;
  box-shadow: 0 6px 16px rgba(11, 31, 63, 0.12);
  color: var(--danger);
  cursor: pointer;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  position: absolute;
  right: 6px;
  width: 24px;
}

.media-upload-remove:hover,
.media-upload-remove:focus-visible {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.opening-media-stage {
  grid-column: 1 / -1;
  width: 100%;
}

.media-upload-file-icon {
  align-items: center;
  aspect-ratio: 4 / 3;
  color: var(--primary-dark);
  display: flex;
  font-size: 22px;
  justify-content: center;
}

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

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

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

  .command-grid,
  .lead-layout,
  .consult-grid,
  .ops-grid,
  .admin-grid,
  .queue-grid,
  .manager-metrics,
  .process-detail-toolbar,
  .opening-cards {
    grid-template-columns: 1fr;
  }

  .lifecycle-rail {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .section-title-row,
  .quote-header,
  .manager-header {
    display: grid;
  }

  .field-grid,
  .additional-contact-row,
  .nested-contact-list,
  .measurement-grid,
  .workflow-guidance,
  .consult-opening-basics,
  .process-detail-toolbar,
  .mini-status-card,
  .defaults-grid,
  .mini-grid,
  .stat-grid,
  .metric-strip,
  .manager-metrics,
  .proposal-meta-grid,
  .agreement-grid,
  .installer-closeout-grid,
  .installer-signoff-summary,
  .ob-checklist-grid,
  .workbench-toolbar,
  .nav-tabs,
  .lifecycle-rail {
    grid-template-columns: 1fr;
  }

  .proposal-title-row,
  .proposal-section-head,
  .quote-tool-header,
  .section-heading-row,
  .proposal-decision-card,
  .customer-thank-you-card {
    display: grid;
  }

  .customer-thank-you-card {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .proposal-total-box,
  .proposal-decision-actions,
  .photo-capture-actions {
    text-align: left;
  }

  .photo-capture-step {
    display: grid;
  }

  .workflow-guidance-blocker {
    min-width: 0;
  }

  .proposal-line-table {
    min-width: 760px;
  }

  .process-detail-table {
    min-width: 780px;
  }

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

  .quote-total,
  .compact-stat {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .mini-contact-topline {
    align-items: flex-start;
    display: grid;
    gap: 6px;
  }

  .mini-date-time {
    justify-content: flex-start;
    max-width: 100%;
    width: 100%;
  }
}

/* Enterprise UX refinement pass */
body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(242, 244, 247, 0.98) 68%),
    url("assets/background-screen-transparent-25.png") top left / min(1400px, 100vw) auto no-repeat,
    var(--alt-bg);
}

.app-shell {
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  gap: 16px;
  padding: 18px;
}

.sidebar-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #fff;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  transition: background 160ms ease, transform 160ms ease;
  width: 42px;
}

.sidebar-toggle:hover {
  background: rgba(253, 197, 27, 0.18);
  transform: translateY(-1px);
}

.nav-tab {
  border-radius: 7px;
  min-height: 46px;
  position: relative;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-tab:hover {
  transform: translateX(2px);
}

.nav-tab.active::before {
  background: var(--gold);
  border-radius: 999px;
  content: "";
  height: 24px;
  left: -7px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
}

body.nav-collapsed .app-shell {
  grid-template-columns: 86px minmax(0, 1fr);
}

body.nav-collapsed .sidebar {
  align-items: center;
  padding: 16px 12px;
}

body.nav-collapsed .brand-lockup {
  grid-template-columns: 1fr;
}

body.nav-collapsed .brand-lockup > div:not(.brand-mark),
body.nav-collapsed .nav-tab span {
  display: none;
}

body.nav-collapsed .brand-mark {
  height: 48px;
  width: 58px;
}

body.nav-collapsed .nav-tab {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px;
  width: 52px;
}

body.nav-collapsed .nav-tab i {
  grid-row: auto;
}

.workspace {
  padding: 26px 30px 34px;
}

.topbar {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(227, 231, 240, 0.75);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(11, 31, 63, 0.06);
  margin-bottom: 18px;
  padding: 16px 18px;
}

.topbar h2 {
  font-size: clamp(24px, 2.4vw, 34px);
  letter-spacing: 0;
}

.panel,
.quote-sheet,
.command-hero,
.stat-card,
.queue-section,
.detail-section,
.process-record-header,
.proposal-card,
.proposal-hero {
  box-shadow: 0 12px 34px rgba(11, 31, 63, 0.07);
}

.manager-panel {
  padding: 18px;
}

.manager-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin: -2px 0 16px;
  padding-bottom: 14px;
}

.manager-header h3 {
  color: var(--primary-dark);
  font-size: 28px;
}

.manager-metrics {
  gap: 10px;
}

.manager-metric {
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 86px;
  padding: 12px;
}

.manager-metric strong {
  color: var(--primary-dark);
  font-size: 24px;
}

.primary-button,
.secondary-button,
.ghost-button,
.map-action,
.payment-link-button {
  border-radius: 7px;
  box-shadow: 0 1px 0 rgba(11, 31, 63, 0.04);
  min-height: 38px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.map-action:hover,
.payment-link-button:hover {
  box-shadow: 0 8px 18px rgba(11, 31, 63, 0.1);
  transform: translateY(-1px);
}

.secondary-button:hover {
  border-color: rgba(12, 56, 125, 0.28);
  color: var(--primary);
}

.status-group-list {
  gap: 16px;
}

.status-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(11, 31, 63, 0.045);
  gap: 0;
  overflow: hidden;
}

.status-group-heading {
  background: linear-gradient(180deg, color-mix(in srgb, var(--group-accent, var(--primary)) 5%, white), #fff);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  padding: 14px 16px 12px;
}

.status-group-progress {
  display: none;
}

.status-group-progress span {
  background: color-mix(in srgb, var(--group-accent, var(--primary)) 72%, white);
  display: block;
  height: 100%;
  width: var(--status-share, 0%);
}

.status-group-heading span:not(.status-pill) {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.status-group-heading h4 {
  color: var(--primary-dark);
  font-size: 17px;
}

.record-table-wrap,
.process-detail-table-wrap,
.proposal-line-table-wrap,
.quote-review-table-wrap {
  border-color: var(--line);
  border-radius: 0;
}

.record-table th,
.process-detail-table th,
.proposal-line-table th,
.quote-review-table th {
  background: #f8fafc;
  color: #647084;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding-bottom: 10px;
  padding-top: 10px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.record-table td,
.process-detail-table td,
.proposal-line-table td,
.quote-review-table td {
  font-size: 13px;
}

.record-table tr {
  transition: background 120ms ease;
}

.record-table tr:hover,
.record-table tr.selected-row {
  background: color-mix(in srgb, var(--group-accent, var(--primary)) 4%, white);
}

.table-primary-link strong {
  color: var(--primary-dark);
  font-size: 13.5px;
  font-weight: 650;
}

.table-primary-link span {
  font-size: 11.5px;
  font-weight: 500;
}

.table-contact-single,
.table-map-link {
  color: var(--primary);
  text-decoration: none;
}

.detail-field .table-map-link {
  color: inherit;
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.detail-field .table-map-link i {
  display: none;
}

.detail-field .table-map-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.process-record-header {
  position: sticky;
  top: 14px;
  z-index: 60;
}

.process-detail-toolbar {
  grid-template-columns: minmax(280px, 0.85fr) minmax(440px, 1.15fr);
}

.mini-contact-card,
.mini-status-card {
  background: #fff;
  border-radius: 7px;
}

.mini-contact-card {
  gap: 7px;
}

.mini-contact-topline {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.mini-date-time {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 1 auto;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  justify-content: flex-end;
  line-height: 1.2;
  max-width: min(260px, 48%);
  min-height: 28px;
  overflow: hidden;
  padding: 5px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-date-time i {
  color: var(--gold);
  flex: 0 0 auto;
}

.mini-contact-card strong {
  color: var(--primary-dark);
  font-size: 18px;
}

.mini-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.mini-contact-actions a {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  text-decoration: none;
}

.mini-contact-actions a:hover {
  background: var(--blue-soft);
  border-color: rgba(12, 56, 125, 0.2);
}

.mini-status-card {
  grid-template-columns: 1fr;
  justify-content: stretch;
}

.status-card-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.quick-action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-action-strip .primary-button,
.quick-action-strip .secondary-button {
  font-size: 12px;
  min-height: 34px;
  padding: 0 10px;
}

.lifecycle-progress {
  align-items: center;
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  min-height: 34px;
  overflow: hidden;
  padding: 5px 10px;
}

.workflow-summary {
  align-items: center;
  display: contents;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.workflow-current-chip {
  align-items: center;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 780;
  gap: 7px;
  grid-column: 1;
  min-width: 0;
  white-space: nowrap;
}

.workflow-current-chip i {
  align-items: center;
  background: var(--gold);
  border: 1px solid var(--gold-2);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 18px;
  font-size: 8px;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.workflow-step-count {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 720;
  grid-column: 3;
  white-space: nowrap;
}

.workflow-track {
  background: #e9eef6;
  border-radius: 999px;
  grid-column: 2;
  grid-row: 1;
  height: 5px;
  overflow: hidden;
}

.workflow-track span {
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: inherit;
  display: block;
  height: 100%;
  width: var(--workflow-progress, 0%);
}

.workflow-steps {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.workflow-step {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0;
  justify-content: center;
  min-width: 0;
}

.workflow-step i {
  align-items: center;
  background: #eef2f8;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 18px;
  font-size: 8px;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.workflow-step b {
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.workflow-step.complete,
.workflow-step.current {
  color: var(--primary-dark);
}

.workflow-step.complete i {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.workflow-step.current i {
  background: var(--gold);
  border-color: var(--gold-2);
  color: var(--primary-dark);
}

.lifecycle-progress.is-closed .workflow-track span {
  background: var(--danger);
}

.lifecycle-progress.is-closed .workflow-step i {
  background: rgba(183, 68, 67, 0.12);
  border-color: rgba(183, 68, 67, 0.22);
  color: var(--danger);
}

.lifecycle-history-section {
  display: grid;
  gap: 10px;
}

.lifecycle-history-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.lifecycle-history-item {
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px 10px;
  grid-template-columns: minmax(124px, 0.24fr) 22px minmax(0, 0.72fr) minmax(160px, 1fr);
  padding: 9px 12px;
}

.lifecycle-history-item:first-child {
  border-top: 0;
}

.lifecycle-history-item:hover {
  background: var(--surface-strong);
}

.lifecycle-history-item.current {
  --history-accent: var(--gold);
  background: color-mix(in srgb, var(--gold) 6%, white);
}

.lifecycle-history-item.archived {
  --history-accent: var(--muted);
}

.lifecycle-history-icon {
  align-items: center;
  background: color-mix(in srgb, var(--history-accent, var(--primary)) 14%, white);
  border: 1px solid color-mix(in srgb, var(--history-accent, var(--primary)) 28%, var(--line));
  border-radius: 999px;
  color: var(--history-accent, var(--primary));
  display: inline-flex;
  font-size: 9px;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.lifecycle-history-item div {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.lifecycle-history-item strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.2;
}

.lifecycle-history-item small,
.lifecycle-history-item em,
.lifecycle-history-item p {
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.3;
  margin: 0;
}

.lifecycle-history-item small {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
}

.lifecycle-history-item em {
  color: var(--primary-dark);
  font-weight: 750;
  min-width: 0;
}

.lifecycle-history-item p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-section {
  background: #fff;
  gap: 16px;
}

.detail-section h4,
.process-workbench-section h4,
.proposal-section-head h4,
.proposal-decision-card h4 {
  color: var(--primary-dark);
  font-size: 18px;
}

.section-heading-row {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.detail-field,
.read-only-note-block,
.job-level-items,
.ob-checklist,
.photo-capture-step {
  background: #f8fafc;
}

input,
select,
textarea {
  border-radius: 7px;
  font-family: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.customer-proposal-page {
  gap: 18px;
  margin: 0 auto;
  max-width: 1180px;
}

.customer-document-page {
  grid-template-columns: minmax(0, 1fr);
}

.customer-document-hero,
.customer-document-page .proposal-card {
  box-sizing: border-box;
  width: 100%;
}

.customer-document-meta {
  align-items: stretch;
}

.proposal-hero {
  background:
    linear-gradient(135deg, rgba(11, 31, 63, 0.98), rgba(12, 56, 125, 0.92)),
    var(--primary-dark);
  color: #fff;
  padding: 24px;
}

.proposal-title-row h3,
.proposal-title-row p,
.proposal-title-row span {
  color: #fff;
}

.proposal-title-row p {
  color: rgba(255, 255, 255, 0.78);
}

.proposal-total-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.proposal-card {
  padding: 20px;
}

.customer-invoice-packet,
.service-payment-section,
.partial-payment-section {
  border-top: 4px solid var(--gold);
}

@media (max-width: 980px) {
  body.nav-collapsed .app-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  body.nav-collapsed .sidebar,
  .sidebar {
    align-items: stretch;
    height: auto;
    position: static;
  }

  body.nav-collapsed .brand-lockup > div:not(.brand-mark),
  body.nav-collapsed .nav-tab span {
    display: block;
  }

  .sidebar-toggle {
    display: none;
  }

  .process-record-header {
    position: static;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .process-detail-toolbar,
  .proposal-title-row,
  .section-heading-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-action-strip .primary-button,
  .quick-action-strip .secondary-button,
  .mini-contact-actions a {
    flex: 1 1 auto;
  }
}

/* Final UI approval pass: reduce legacy noise, public links, and mobile friction */
.tab-panel > .lead-layout,
.tab-panel > .consult-grid,
.tab-panel > .opening-section,
.tab-panel > .quote-sheet,
.tab-panel > .review-panel,
.tab-panel > .ops-grid,
#service > .panel:not(.manager-panel) {
  display: none;
}

.table-primary-link .table-subline {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 2px;
  padding: 0;
  width: auto;
}

.status-empty-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 58px;
  padding: 12px;
}

.status-empty-state i {
  color: var(--success);
}

body.public-document-mode {
  background: #f7f9fc;
}

body.public-document-mode .app-shell {
  display: block;
}

body.public-document-mode .sidebar,
body.public-document-mode .topbar {
  display: none;
}

body.public-document-mode .workspace {
  min-height: 100vh;
  padding: 28px;
}

body.public-document-mode .tab-panel {
  display: none;
}

body.public-document-mode .tab-panel.active {
  display: block;
}

.public-document-brand {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.public-document-brand img {
  background: var(--primary-dark);
  border-radius: 7px;
  height: 54px;
  object-fit: contain;
  padding: 8px;
  width: 78px;
}

.public-document-brand div {
  display: grid;
  gap: 2px;
}

.public-document-brand strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
}

.public-document-brand span,
.public-document-footer span {
  color: var(--muted);
  font-size: 13px;
}

.public-document-footer {
  border-top: 1px solid var(--line);
  color: var(--text);
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding: 16px 4px 0;
}

.agreement-summary {
  color: var(--text);
  margin: 0 0 14px;
}

.agreement-check {
  align-items: flex-start;
  color: var(--text);
  display: flex;
  font-weight: 750;
  gap: 8px;
  margin-top: 12px;
}

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

@media (max-width: 980px) {
  body:not(.public-document-mode) .app-shell,
  body:not(.public-document-mode).nav-collapsed .app-shell {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
  }

  body:not(.public-document-mode) .sidebar,
  body:not(.public-document-mode).nav-collapsed .sidebar {
    align-items: center;
    height: 100vh;
    overflow-y: auto;
    padding: 12px 8px;
    position: sticky;
    top: 0;
  }

  body:not(.public-document-mode) .brand-lockup {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  body:not(.public-document-mode) .brand-lockup > div:not(.brand-mark),
  body:not(.public-document-mode) .nav-tab span {
    display: none;
  }

  body:not(.public-document-mode) .brand-mark {
    height: 42px;
    width: 50px;
  }

  body:not(.public-document-mode) .nav-tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body:not(.public-document-mode) .nav-tab {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 44px;
    padding: 9px;
    width: 100%;
  }

  body:not(.public-document-mode) .sidebar-toggle {
    display: none;
  }

  .process-record-header {
    position: sticky;
    top: 0;
  }
}

@media (max-width: 760px) {
  body.public-document-mode .workspace {
    padding: 10px;
  }

  .customer-proposal-page {
    gap: 12px;
    max-width: 100%;
  }

  .proposal-hero,
  .proposal-card {
    border-radius: 8px;
    padding: 14px;
  }

  .proposal-title-row,
  .proposal-section-head,
  .proposal-decision-card {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .proposal-title-row h3 {
    font-size: 28px;
    line-height: 1.05;
  }

  .proposal-total-box {
    min-width: 0;
    text-align: left;
  }

  .proposal-total-box strong {
    font-size: 30px;
  }

  .proposal-meta-grid,
  .agreement-grid {
    grid-template-columns: 1fr;
  }

  .proposal-line-table-wrap,
  .customer-invoice-packet .process-detail-table-wrap {
    border: 0;
    overflow: visible;
  }

  .proposal-line-table,
  .proposal-line-table tbody,
  .proposal-line-table tr,
  .proposal-line-table td,
  .customer-invoice-packet .process-detail-table,
  .customer-invoice-packet .process-detail-table tbody,
  .customer-invoice-packet .process-detail-table tr,
  .customer-invoice-packet .process-detail-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .proposal-line-table thead,
  .customer-invoice-packet .process-detail-table thead {
    display: none;
  }

  .proposal-line-table tr,
  .customer-invoice-packet .process-detail-table tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  .proposal-line-table td,
  .customer-invoice-packet .process-detail-table td {
    border: 0;
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    text-align: left;
  }

  .proposal-line-table td::before,
  .customer-invoice-packet .process-detail-table td::before {
    color: var(--muted);
    content: "";
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .proposal-line-table td:nth-child(1)::before {
    content: "Opening";
  }

  .proposal-line-table td:nth-child(2)::before {
    content: "Product";
  }

  .proposal-line-table td:nth-child(3)::before {
    content: "Series";
  }

  .proposal-line-table td:nth-child(4)::before {
    content: "Screen";
  }

  .proposal-line-table td:nth-child(5)::before {
    content: "Unit size";
  }

  .proposal-line-table td:nth-child(6)::before {
    content: "Amount";
  }

  .customer-invoice-packet .process-detail-table td:nth-child(1)::before {
    content: "Invoice line";
  }

  .customer-invoice-packet .process-detail-table td:nth-child(2)::before {
    content: "Details";
  }

  .customer-invoice-packet .process-detail-table td:nth-child(3)::before {
    content: "Amount";
  }

  .proposal-totals {
    justify-content: stretch;
  }

  .proposal-totals div {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .proposal-link-chip {
    border-radius: 8px;
    white-space: normal;
  }

  .agreement-check {
    max-width: none;
  }

  .proposal-decision-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .proposal-decision-actions .primary-button,
  .proposal-decision-actions .secondary-button,
  .proposal-decision-actions .payment-link-button {
    justify-content: center;
    width: 100%;
  }

  .quick-action-strip {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Dashboard intelligence, team, calendar, and media gallery */
.topbar {
  align-items: center;
}

.topbar-tools {
  min-width: min(460px, 40vw);
  position: relative;
}

.global-search {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(11, 31, 63, 0.06);
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
}

.global-search i {
  color: var(--primary);
}

.global-search input {
  border: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.global-search input::placeholder {
  color: #7b8495;
  font-weight: 500;
  opacity: 1;
}

.global-search-results {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  left: 0;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
}

.global-search-results.active {
  display: grid;
}

.global-search-results button {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 28px 1fr;
  padding: 12px;
  text-align: left;
}

.global-search-results button:hover {
  background: var(--surface-strong);
}

.global-search-results i {
  color: var(--primary);
  text-align: center;
}

.global-search-results span {
  display: grid;
  gap: 2px;
}

.global-search-results small,
.global-search-empty {
  color: var(--muted);
  font-size: 12px;
}

.global-search-empty {
  padding: 14px;
}

.dashboard-filter-row {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.dashboard-filter-row.compact {
  margin: 0;
}

.filter-pill {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  min-height: 34px;
  padding: 0 13px;
}

#businessQueues {
  display: block;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.dashboard-command-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  margin-bottom: 16px;
}

.dashboard-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(11, 31, 63, 0.07);
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
}

.dashboard-card.wide {
  grid-row: span 2;
  min-height: 420px;
}

.dashboard-card-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.dashboard-card-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-card-head h3 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  margin: 3px 0 0;
}

.dashboard-card-head i {
  color: var(--gold-2);
  font-size: 20px;
}

.dashboard-bar-chart {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(12, minmax(20px, 1fr));
  min-height: 280px;
  padding: 20px 0 28px;
}

.chart-bar {
  align-items: end;
  background: linear-gradient(180deg, rgba(12, 56, 125, 0.1), rgba(12, 56, 125, 0.03));
  border-radius: 999px 999px 4px 4px;
  display: flex;
  justify-content: center;
  min-height: 38px;
  position: relative;
}

.chart-bar::before {
  background: linear-gradient(180deg, var(--gold), var(--primary));
  border-radius: inherit;
  bottom: 0;
  content: "";
  height: var(--bar);
  left: 0;
  position: absolute;
  right: 0;
}

.chart-bar span {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: -22px;
  position: relative;
  z-index: 1;
}

.dashboard-status-list {
  display: grid;
  gap: 10px;
}

.dashboard-status-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.dashboard-status-row div:first-child {
  display: grid;
  gap: 2px;
}

.dashboard-status-row strong {
  color: var(--text);
  font-size: 13px;
}

.dashboard-status-row span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-status-row b {
  color: var(--primary-dark);
}

.status-progress {
  background: var(--surface-strong);
  border-radius: 999px;
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
}

.status-progress span {
  background: linear-gradient(90deg, var(--primary), var(--gold));
  display: block;
  height: 100%;
}

.ai-assistant-card {
  background:
    linear-gradient(135deg, rgba(11, 31, 63, 0.96), rgba(12, 56, 125, 0.88)),
    var(--primary-dark);
  color: #fff;
}

.ai-assistant-card .dashboard-card-head h3,
.ai-assistant-card .dashboard-card-head span,
.ai-assistant-card .dashboard-card-head i {
  color: #fff;
}

.ai-summary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.ai-summary p {
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}

.ai-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-prompt-chips button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  min-height: 30px;
  padding: 0 10px;
}

.ai-input {
  align-items: center;
  background: #fff;
  border-radius: 999px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 34px;
  padding: 6px;
}

.ai-input input {
  border: 0;
  min-width: 0;
  outline: 0;
  padding: 0 8px;
}

.ai-input button {
  align-items: center;
  background: var(--gold);
  border: 0;
  border-radius: 50%;
  color: var(--primary-dark);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.dashboard-donut {
  align-items: center;
  align-self: center;
  background: conic-gradient(var(--gold) calc(var(--score) * 1%), var(--surface-strong) 0);
  border-radius: 50%;
  display: flex;
  height: 158px;
  justify-content: center;
  justify-self: center;
  width: 158px;
}

.dashboard-donut > div {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  display: grid;
  height: 112px;
  justify-items: center;
  width: 112px;
}

.dashboard-donut strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 26px;
}

.dashboard-donut span,
.donut-legend span {
  color: var(--muted);
  font-size: 12px;
}

.donut-legend {
  display: grid;
  gap: 8px;
}

.legend-dot {
  border-radius: 999px;
  display: inline-block;
  height: 9px;
  margin-right: 7px;
  width: 9px;
}

.legend-dot.blue {
  background: var(--primary);
}

.legend-dot.green {
  background: var(--success);
}

.legend-dot.gold {
  background: var(--gold);
}

.operational-queues {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  margin-top: 2px;
}

.team-avatar {
  align-items: center;
  background: var(--team-color, var(--primary));
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.team-avatar.tiny {
  box-shadow: 0 0 0 2px #fff;
  font-size: 9px;
  height: 24px;
  letter-spacing: 0;
  line-height: 1;
  width: 24px;
}

.team-avatar.large {
  font-size: 16px;
  height: 54px;
  width: 54px;
}

.assignment-avatar-strip {
  align-items: center;
  display: inline-flex;
  isolation: isolate;
  min-height: 26px;
}

.assignment-avatar-strip .team-avatar {
  flex: 0 0 auto;
}

.assignment-avatar-strip .team-avatar + .team-avatar {
  margin-left: -6px;
}

.assignment-avatar-strip.compact {
  justify-content: flex-start;
}

.team-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
}

.team-metrics {
  margin-bottom: 16px;
}

.team-directory {
  display: grid;
  gap: 12px;
}

.team-section-title {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.team-section-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.team-section-title strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
}

.team-card {
  align-items: start;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(11, 31, 63, 0.045);
  display: grid;
  gap: 10px 14px;
  grid-template-columns: 54px 1fr;
  padding: 16px;
  position: relative;
}

.team-card h4 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  margin: 0;
}

.team-card span,
.team-card a,
.team-card strong {
  font-size: 12px;
}

.team-card a {
  color: var(--primary);
  text-decoration: none;
}

.team-contact-line {
  display: grid;
  gap: 5px;
  grid-column: 2 / -1;
}

.team-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 2 / -1;
}

.team-tabs span {
  background: var(--surface-strong);
  border-radius: 999px;
  color: var(--primary-dark);
  font-weight: 800;
  padding: 4px 8px;
}

.team-card > strong {
  align-items: center;
  background: var(--gold-soft);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-weight: 900;
  gap: 4px;
  justify-self: end;
  padding: 6px 10px;
  position: absolute;
  right: 14px;
  top: 14px;
}

.team-editor {
  align-self: start;
  border-top: 4px solid var(--primary);
  position: sticky;
  top: 14px;
}

.team-editor .field-grid {
  align-items: end;
}

.team-editor-body {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: 180px 1fr;
}

.profile-upload-card {
  align-content: center;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(12, 56, 125, 0.05), #fff);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--primary-dark);
  cursor: pointer;
  display: grid;
  justify-items: center;
  min-height: 188px;
  padding: 18px;
  text-align: center;
}

.profile-upload-card small {
  color: var(--muted);
}

.profile-upload-card input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.team-profile-fields {
  grid-template-columns: 1fr 1fr;
}

.team-editor input,
.team-editor select {
  background: #fff;
}

.permission-builder {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
}

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

.permission-toggle {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: flex;
  flex-direction: row;
  font-weight: 850;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
}

.permission-toggle input {
  accent-color: var(--primary);
  min-height: auto;
  width: auto;
}

.team-table-list {
  margin-top: 16px;
}

.team-record-table td {
  padding-bottom: 10px;
  padding-top: 10px;
  vertical-align: middle;
}

.team-record-table th:first-child,
.team-record-table td:first-child {
  padding-left: 14px;
}

.team-primary-link {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr);
  min-width: 0;
  padding: 2px 0;
}

.team-primary-link .team-avatar {
  align-items: center;
  box-shadow: 0 0 0 3px #fff, 0 8px 18px rgba(11, 31, 63, 0.12);
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.record-table td .team-avatar,
.team-avatar.small,
.team-avatar.large {
  color: #fff;
}

.team-primary-link .team-member-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.team-primary-link .team-member-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.team-permission-summary {
  color: var(--muted);
  display: block;
  font-size: 12px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-row-button {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.team-detail-page {
  display: grid;
  gap: 14px;
}

.team-editor-page {
  border-top-color: var(--gold);
  position: static;
}

.team-editor-page .profile-upload-card {
  min-height: 210px;
}

.assignment-select {
  align-items: center;
  display: flex;
  gap: 10px;
}

.assignment-select select {
  min-width: min(360px, 52vw);
}

.consult-locked-section {
  background: linear-gradient(135deg, rgba(12, 56, 125, 0.055), rgba(253, 197, 27, 0.08));
  border-style: dashed;
  display: grid;
  gap: 14px;
}

.consult-locked-section .section-heading-row {
  align-items: center;
}

.consult-locked-section p,
.consult-locked-section .section-heading-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  max-width: 820px;
}

.install-gallery-slider {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 14px;
}

.install-gallery-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(12, 56, 125, 0.34) transparent;
}

.install-gallery-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(11, 31, 63, 0.06);
  color: var(--text);
  cursor: zoom-in;
  flex: 0 0 clamp(220px, 28vw, 360px);
  overflow: hidden;
  padding: 0;
  position: relative;
  scroll-snap-align: start;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.install-gallery-card:hover,
.install-gallery-card:focus-visible {
  border-color: rgba(12, 56, 125, 0.35);
  box-shadow: 0 14px 28px rgba(11, 31, 63, 0.12);
  transform: translateY(-1px);
}

.install-gallery-card img,
.install-gallery-card video {
  aspect-ratio: 16 / 10;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.install-gallery-card span,
.install-gallery-card strong {
  display: block;
  padding-left: 12px;
  padding-right: 12px;
}

.install-gallery-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding-top: 10px;
  text-transform: uppercase;
}

.install-gallery-card strong {
  color: var(--primary-dark);
  font-size: 13px;
  padding-bottom: 12px;
  padding-top: 3px;
}

.media-gallery-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.media-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(11, 31, 63, 0.06);
  color: var(--text);
  cursor: zoom-in;
  display: grid;
  gap: 5px;
  overflow: hidden;
  padding: 0 0 10px;
  position: relative;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.media-tile:hover,
.media-tile:focus-visible {
  border-color: rgba(12, 56, 125, 0.35);
  box-shadow: 0 14px 28px rgba(11, 31, 63, 0.12);
  transform: translateY(-1px);
}

.media-tile img,
.media-tile video {
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  width: 100%;
}

.media-tile span,
.media-tile strong {
  padding: 0 10px;
}

.media-tile span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.media-tile strong {
  font-size: 13px;
}

.media-tile em {
  align-items: center;
  background: rgba(11, 31, 63, 0.82);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-style: normal;
  gap: 5px;
  left: 8px;
  padding: 5px 8px;
  position: absolute;
  top: 8px;
}

.media-lightbox-backdrop {
  align-items: stretch;
  background: #000;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 0;
  position: fixed;
  z-index: 200;
}

.media-lightbox {
  background: #000;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 12px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  max-height: none;
  max-width: none;
  overflow: hidden;
  padding: 16px;
  width: 100%;
}

.media-lightbox-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.media-lightbox .header-icon-button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.media-lightbox-header span {
  color: rgba(255, 255, 255, 0.58);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.media-lightbox-header h3 {
  color: #fff;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  line-height: 1.1;
  margin: 3px 0;
}

.media-lightbox-header p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.media-lightbox-stage {
  align-items: center;
  background: #000;
  border-radius: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.media-lightbox-stage img,
.media-lightbox-stage video {
  border-radius: 0;
  display: block;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  width: 100%;
}

.media-lightbox-nav {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
  width: 42px;
}

.media-lightbox-nav:hover {
  background: var(--gold);
  color: var(--primary-dark);
  transform: scale(1.04);
}

.media-lightbox-footer {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
}

.media-lightbox-footer > strong {
  color: #fff;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
}

.media-lightbox-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.media-lightbox-thumbs button {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 74px;
  height: 54px;
  overflow: hidden;
  padding: 0;
}

.media-lightbox-thumbs button.active {
  border-color: var(--gold);
}

.media-lightbox-thumbs img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
}

.calendar-hero,
.role-dashboard-hero {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(11, 31, 63, 0.07);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 16px;
}

.calendar-hero span,
.role-dashboard-hero span,
.calendar-agenda-panel > div:first-child span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.calendar-hero h3,
.role-dashboard-hero h3,
.calendar-agenda-panel h4 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.08;
  margin: 4px 0 0;
}

.calendar-hero h3,
.role-dashboard-hero h3 {
  font-size: clamp(20px, 2.4vw, 30px);
}

.calendar-hero p,
.role-dashboard-hero p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 760px;
}

.calendar-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.32fr);
}

.calendar-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.calendar-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px;
}

.calendar-toolbar div:first-child {
  display: grid;
  gap: 3px;
}

.calendar-toolbar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.calendar-toolbar strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  background: var(--surface-strong);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 146px;
  padding: 9px;
}

.calendar-day.today {
  background: rgba(253, 197, 27, 0.08);
}

.calendar-day > strong {
  align-items: center;
  color: var(--primary-dark);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-bottom: 7px;
}

.calendar-day > strong small {
  background: var(--surface-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  padding: 3px 6px;
}

.calendar-day.today > strong small {
  background: var(--gold-soft);
  color: var(--primary-dark);
}

.calendar-event-list {
  display: grid;
  gap: 5px;
}

.calendar-event {
  border: 0;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 1px;
  padding: 6px 7px;
  text-align: left;
  width: 100%;
}

.calendar-event-main {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.calendar-event-main span,
.calendar-event-main em {
  font-size: 10px;
}

.calendar-event-main b {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-main em {
  color: var(--muted);
  font-style: normal;
}

.calendar-device-link {
  align-items: center;
  align-self: center;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: 7px;
  color: var(--primary-dark);
  display: inline-flex;
  height: 26px;
  justify-content: center;
  text-decoration: none;
  width: 26px;
}

.calendar-device-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.event-consult {
  background: rgba(12, 56, 125, 0.08);
  border-left-color: var(--primary);
}

.event-install {
  background: rgba(17, 134, 96, 0.1);
  border-left-color: var(--success);
}

.event-service {
  background: var(--gold-soft);
  border-left-color: var(--gold);
}

.calendar-agenda-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(11, 31, 63, 0.07);
  display: grid;
  gap: 12px;
  padding: 14px;
  position: sticky;
  top: 14px;
}

.calendar-agenda-panel h4 {
  font-size: 20px;
}

.calendar-agenda-list {
  display: grid;
  gap: 9px;
}

.calendar-agenda-item {
  align-items: start;
  background: color-mix(in srgb, var(--agenda-accent, var(--primary)) 8%, white);
  border: 1px solid color-mix(in srgb, var(--agenda-accent, var(--primary)) 20%, var(--line));
  border-left: 4px solid var(--agenda-accent, var(--primary));
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr) 30px;
  padding: 10px;
  text-decoration: none;
}

.calendar-agenda-item.event-install {
  --agenda-accent: var(--success);
}

.calendar-agenda-item.event-service {
  --agenda-accent: var(--gold);
}

.calendar-agenda-item > span {
  align-items: center;
  background: #fff;
  border-radius: 8px;
  color: var(--agenda-accent, var(--primary));
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.calendar-agenda-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.calendar-agenda-item div > a {
  color: inherit;
  text-decoration: none;
}

.calendar-agenda-item strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

.calendar-agenda-item small,
.calendar-agenda-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resources-page {
  display: grid;
  gap: 14px;
}

.email-resource-page {
  display: grid;
  gap: 14px;
}

.email-resource-header {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px;
}

.email-resource-header span,
.email-token-row strong,
.email-template-top span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.email-resource-header h3 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 34px;
  line-height: 1.05;
  margin: 5px 0 7px;
}

.email-resource-header p,
.email-connect-card span,
.email-token-row span,
.email-template-preview p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.email-resource-actions {
  align-items: end;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.email-connect-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
}

.email-connect-card {
  align-items: start;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 14px;
}

.email-connect-card.connected {
  border-color: rgba(17, 134, 96, 0.28);
  box-shadow: 0 10px 24px rgba(17, 134, 96, 0.08);
}

.email-connect-card i {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  display: inline-flex;
  font-size: 20px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.email-connect-card strong,
.email-template-card h5,
.email-template-preview strong {
  color: var(--primary-dark);
  display: block;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
}

.email-connection-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.email-token-row {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 132px minmax(0, 1fr);
  padding: 12px;
}

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

.email-template-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.email-template-top {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.email-template-card h5 {
  font-size: 17px;
  margin: 4px 0 0;
}

.email-template-card label {
  color: var(--primary-dark);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 6px;
}

.email-template-card input,
.email-template-card textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  padding: 10px 11px;
}

.email-template-card textarea {
  min-height: 132px;
  resize: vertical;
}

.email-template-toggle {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex !important;
  gap: 8px;
  grid-auto-flow: column;
  padding: 8px 10px;
  white-space: nowrap;
}

.email-template-preview {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.email-template-preview strong {
  font-size: 13px;
}

.email-template-preview p {
  font-size: 12px;
}

.resource-hero {
  align-items: stretch;
  background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--primary) 5%, white));
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.32fr);
  padding: 18px;
}

.resource-hero span,
.resource-section-head span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.resource-hero h3 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.04;
  margin: 6px 0 8px;
}

.resource-hero p,
.resource-section-head p,
.resource-alert p,
.resource-step p,
.resource-mini-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.resource-remote-card {
  align-content: center;
  background: var(--primary-dark);
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.resource-remote-card i {
  color: var(--gold);
  font-size: 24px;
}

.resource-remote-card strong {
  color: #fff;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
}

.resource-remote-card p {
  color: rgba(255, 255, 255, 0.78);
}

.resource-alert,
.resource-section,
.resource-mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.resource-alert {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 14px;
}

.resource-alert i {
  align-items: center;
  background: var(--gold-soft);
  border-radius: 8px;
  color: var(--primary-dark);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.resource-alert strong,
.resource-mini-card strong {
  color: var(--primary-dark);
  display: block;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  margin-bottom: 3px;
}

.resource-section {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.resource-section-head h4 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  margin: 4px 0 5px;
}

.resource-step-list {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.resource-step-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-step {
  align-items: start;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 12px;
}

.resource-step > span {
  align-items: center;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.resource-step strong {
  color: var(--primary-dark);
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.resource-step small {
  color: var(--primary);
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  margin-top: 7px;
}

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

.resource-mini-card {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 14px;
}

.resource-mini-card > i {
  align-items: center;
  background: color-mix(in srgb, var(--success) 10%, white);
  border-radius: 8px;
  color: var(--success);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

@media (max-width: 1120px) {
  .dashboard-command-grid,
  .team-layout {
    grid-template-columns: 1fr;
  }

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

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

  .email-connect-grid,
  .email-template-list {
    grid-template-columns: 1fr;
  }

  .media-lightbox-stage {
    min-height: 360px;
  }

  .topbar {
    align-items: stretch;
    display: grid;
  }

  .topbar-tools {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .dashboard-bar-chart {
    gap: 7px;
    min-height: 190px;
  }

  .dashboard-command-grid {
    gap: 12px;
  }

  .dashboard-card.wide {
    min-height: 330px;
  }

  .operational-queues {
    grid-template-columns: 1fr;
  }

  .media-gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .media-lightbox-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .media-lightbox {
    gap: 10px;
    padding: 10px;
  }

  .media-lightbox-header {
    align-items: flex-start;
    gap: 10px;
  }

  .media-lightbox-header h3 {
    font-size: 18px;
  }

  .media-lightbox-header p {
    font-size: 12px;
  }

  .media-lightbox-stage {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    min-height: 0;
    padding: 8px;
  }

  .media-lightbox-nav {
    height: 34px;
    width: 34px;
  }

  .media-lightbox-footer {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .team-card {
    grid-template-columns: 54px 1fr;
  }

  .team-card > strong {
    justify-self: start;
    position: static;
  }

  .team-editor {
    position: static;
  }

  .team-editor-body,
  .team-profile-fields,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .calendar-shell {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 820px;
  }

  .assignment-select {
    align-items: stretch;
    display: grid;
  }
}

/* Reference-inspired app chrome */
body:not(.public-document-mode) .app-shell,
body:not(.public-document-mode).nav-collapsed .app-shell {
  grid-template-columns: 96px minmax(0, 1fr);
}

body:not(.public-document-mode) .sidebar,
body:not(.public-document-mode).nav-collapsed .sidebar {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 36%),
    var(--primary-dark);
  border-right: 1px solid rgba(11, 31, 63, 0.08);
  box-shadow: 12px 0 34px rgba(11, 31, 63, 0.13);
  gap: 16px;
  overflow: visible;
  padding: 18px 14px;
  z-index: 20;
}

body:not(.public-document-mode) .brand-lockup,
body:not(.public-document-mode).nav-collapsed .brand-lockup {
  display: flex;
  justify-content: center;
  width: 100%;
}

body:not(.public-document-mode) .brand-lockup > div:not(.brand-mark),
body:not(.public-document-mode).nav-collapsed .brand-lockup > div:not(.brand-mark) {
  display: none;
}

body:not(.public-document-mode) .brand-mark,
body:not(.public-document-mode).nav-collapsed .brand-mark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  height: 58px;
  padding: 9px;
  width: 62px;
}

body:not(.public-document-mode) .sidebar-toggle {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  height: 40px;
  width: 42px;
}

body:not(.public-document-mode) .nav-tabs {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  justify-content: flex-start;
  overflow: visible;
  padding: 6px 0;
  width: 100%;
}

body:not(.public-document-mode) .nav-tab,
body:not(.public-document-mode).nav-collapsed .nav-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  min-height: 48px;
  overflow: visible;
  padding: 0;
  position: relative;
  width: 48px;
}

body:not(.public-document-mode) .nav-tab::before {
  background: var(--gold);
  border-radius: 999px;
  content: "";
  height: 24px;
  left: -15px;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scaleY(0.5);
  transition: opacity 150ms ease, transform 150ms ease;
  width: 4px;
}

body:not(.public-document-mode) .nav-tab i,
body:not(.public-document-mode).nav-collapsed .nav-tab i {
  color: rgba(253, 197, 27, 0.88);
  font-size: 17px;
  grid-row: auto;
  line-height: 1;
  text-align: center;
}

body:not(.public-document-mode) .nav-tab span,
body:not(.public-document-mode).nav-collapsed .nav-tab span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(11, 31, 63, 0.18);
  color: var(--primary-dark);
  display: block;
  font-size: 13px;
  font-weight: 900;
  left: calc(100% + 13px);
  line-height: 1;
  opacity: 0;
  padding: 10px 12px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-4px, -50%);
  transition: opacity 150ms ease, transform 150ms ease;
  visibility: hidden;
  white-space: nowrap;
  z-index: 60;
}

body:not(.public-document-mode) .nav-tab {
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

body:not(.public-document-mode) .nav-tab span::before {
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  content: "";
  height: 8px;
  left: -5px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
}

body:not(.public-document-mode) .nav-tab:hover span,
body:not(.public-document-mode) .nav-tab:focus-visible span {
  opacity: 1;
  transform: translate(0, -50%);
  visibility: visible;
}

body:not(.public-document-mode) .nav-tab.active,
body:not(.public-document-mode) .nav-tab:hover {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 48%),
    rgba(255, 255, 255, 0.09);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

body:not(.public-document-mode) .nav-tab.active::before {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
}

body:not(.public-document-mode) .nav-tab.active i,
body:not(.public-document-mode) .nav-tab:hover i {
  color: #fff;
}

@media (min-width: 761px) {
  body:not(.public-document-mode) .sidebar,
  body:not(.public-document-mode).nav-collapsed .sidebar {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  body:not(.public-document-mode) .nav-tabs,
  body:not(.public-document-mode).nav-collapsed .nav-tabs {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 0 10px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  body:not(.public-document-mode) .nav-tabs::-webkit-scrollbar,
  body:not(.public-document-mode).nav-collapsed .nav-tabs::-webkit-scrollbar {
    width: 5px;
  }

  body:not(.public-document-mode) .nav-tabs::-webkit-scrollbar-thumb,
  body:not(.public-document-mode).nav-collapsed .nav-tabs::-webkit-scrollbar-thumb {
    background: rgba(253, 197, 27, 0.42);
    border-radius: 999px;
  }

  body:not(.public-document-mode) .nav-tab span,
  body:not(.public-document-mode).nav-collapsed .nav-tab span {
    display: none;
  }
}

body:not(.public-document-mode) .workspace {
  padding: 26px 32px 36px;
}

.topbar.app-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(227, 231, 240, 0.86);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(11, 31, 63, 0.08);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 20px;
  padding: 16px 18px;
}

.header-main {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  min-width: 0;
}

.header-title-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.header-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar.app-header h2 {
  color: var(--primary-dark);
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1;
  max-width: 100%;
}

.topbar.app-header .context-row {
  margin-top: 0;
}

.topbar.app-header .topbar-tools {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  min-width: min(680px, 42vw);
  position: relative;
}

.topbar.app-header .global-search {
  border-radius: 999px;
  box-shadow: none;
  min-height: 46px;
  min-width: min(420px, 34vw);
}

.header-quick-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.header-icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  position: relative;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
  width: 42px;
}

.header-icon-button:hover,
.header-icon-button.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.header-icon-button span {
  align-items: center;
  background: var(--gold);
  border: 2px solid #fff;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  position: absolute;
  right: -6px;
  top: -6px;
  width: 20px;
}

.tools-menu {
  position: relative;
}

.tools-menu summary {
  list-style: none;
}

.tools-menu summary::-webkit-details-marker {
  display: none;
}

.tools-menu[open] summary {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.tools-menu-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(11, 31, 63, 0.18);
  display: grid;
  gap: 4px;
  min-width: 210px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 80;
}

.tools-menu-panel::before {
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  content: "";
  height: 10px;
  position: absolute;
  right: 16px;
  top: -6px;
  transform: rotate(45deg);
  width: 10px;
}

.tools-menu-panel a {
  align-items: center;
  border-radius: 7px;
  color: var(--primary-dark);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 10px;
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 42px;
  padding: 7px 9px;
  text-decoration: none;
}

.tools-menu-panel a:hover,
.tools-menu-panel a.active {
  background: var(--surface-strong);
}

.tools-menu-panel a i {
  align-items: center;
  background: color-mix(in srgb, var(--primary) 9%, white);
  border-radius: 7px;
  color: var(--primary);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.tools-menu-panel a[hidden] {
  display: none;
}

.user-profile-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  gap: 10px;
  min-height: 46px;
  padding: 5px 10px 5px 5px;
}

.profile-avatar {
  align-items: center;
  background: var(--primary-dark);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.profile-copy {
  display: grid;
  gap: 1px;
  line-height: 1.05;
  text-align: left;
}

.profile-copy strong {
  font-size: 13px;
}

.profile-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

body:not(.public-document-mode) .global-search-results {
  right: 0;
  top: calc(100% + 8px);
}

@media (max-width: 1320px) {
  .topbar.app-header {
    grid-template-columns: 1fr;
  }

  .topbar.app-header .topbar-tools {
    justify-content: space-between;
    min-width: 0;
  }

  .topbar.app-header .global-search {
    min-width: min(520px, 50vw);
  }
}

@media (max-width: 1080px) {
  .header-main {
    grid-template-columns: 1fr;
  }
}

.dashboard-card.wide {
  min-height: 360px;
}

.dashboard-bar-chart {
  min-height: 230px;
}

.chart-bar {
  height: 220px;
}

@media (max-width: 760px) {
  body:not(.public-document-mode) .app-shell,
  body:not(.public-document-mode).nav-collapsed .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  body:not(.public-document-mode) .sidebar,
  body:not(.public-document-mode).nav-collapsed .sidebar {
    padding: 12px 8px;
  }

  body:not(.public-document-mode) .brand-mark,
  body:not(.public-document-mode).nav-collapsed .brand-mark {
    height: 48px;
    width: 52px;
  }

  body:not(.public-document-mode) .nav-tab,
  body:not(.public-document-mode).nav-collapsed .nav-tab {
    height: 44px;
    min-height: 44px;
    width: 44px;
  }

  body:not(.public-document-mode) .workspace {
    padding: 14px;
  }

  .topbar.app-header {
    padding: 14px;
  }

  .topbar.app-header .topbar-tools {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar.app-header .global-search {
    min-width: 0;
  }

  .header-quick-actions {
    justify-content: space-between;
  }

  .user-profile-button {
    justify-content: space-between;
  }
}

/* Dashboard command center rebuild */
.modern-dashboard-grid {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.42fr) minmax(360px, 0.72fr);
  margin-bottom: 14px;
}

#workbench .command-hero {
  display: none;
}

.modern-dashboard-grid .dashboard-card {
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(11, 31, 63, 0.07);
}

.pipeline-card {
  min-height: 386px;
}

.dashboard-card-link {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  min-height: 34px;
  padding: 0 12px;
  text-decoration: none;
}

.pipeline-chart {
  display: grid;
  gap: 12px;
}

.pipeline-row {
  align-items: center;
  background: linear-gradient(90deg, rgba(242, 244, 247, 0.9), #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 132px minmax(140px, 1fr) 112px 38px;
  min-height: 46px;
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
}

.pipeline-row:hover {
  border-color: rgba(12, 56, 125, 0.24);
  box-shadow: 0 12px 24px rgba(11, 31, 63, 0.08);
}

.pipeline-label {
  align-items: center;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
}

.pipeline-label i {
  color: var(--gold-2);
  width: 18px;
}

.pipeline-track {
  background: #e9edf4;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.pipeline-track span {
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: inherit;
  display: block;
  height: 100%;
}

.pipeline-row strong {
  color: var(--primary-dark);
  font-size: 14px;
  text-align: right;
}

.pipeline-row small {
  align-items: center;
  background: var(--surface-strong);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  min-height: 28px;
}

.lifecycle-card .dashboard-status-list {
  gap: 12px;
}

.lifecycle-card .dashboard-status-row {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.owner-snapshot-card {
  align-content: start;
}

.owner-score-card {
  align-items: center;
  background: linear-gradient(135deg, rgba(12, 56, 125, 0.08), rgba(253, 197, 27, 0.14));
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: 112px 1fr;
  padding: 14px;
}

.owner-score-ring {
  align-items: center;
  background: conic-gradient(var(--gold) calc(var(--score) * 1%), rgba(255, 255, 255, 0.7) 0);
  border-radius: 50%;
  display: grid;
  height: 104px;
  justify-items: center;
  position: relative;
  width: 104px;
}

.owner-score-ring::before {
  background: #fff;
  border-radius: inherit;
  content: "";
  inset: 13px;
  position: absolute;
}

.owner-score-ring strong,
.owner-score-ring span {
  position: relative;
  z-index: 1;
}

.owner-score-ring strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
}

.owner-score-ring span,
.owner-score-copy span,
.owner-snapshot-grid small {
  color: var(--muted);
  font-size: 12px;
}

.owner-score-copy {
  display: grid;
  gap: 4px;
}

.owner-score-copy strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
}

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

.owner-snapshot-grid span {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 12px;
}

.owner-snapshot-grid strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
}

.ai-assistant-card {
  align-content: start;
  background:
    linear-gradient(135deg, rgba(11, 31, 63, 0.98), rgba(12, 56, 125, 0.92)),
    var(--primary-dark);
}

.ai-summary {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  gap: 6px;
}

.ai-summary span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ai-summary strong {
  color: #fff;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.2;
}

.ai-prompt-chips button {
  min-height: 34px;
}

.priority-work-card {
  margin-top: 14px;
}

.priority-work-card .dashboard-card-head {
  align-items: center;
}

.dashboard-focus-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dashboard-focus-tabs button {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
}

.dashboard-focus-tabs button.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.dashboard-focus-tabs span {
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 11px;
  justify-content: center;
  min-width: 22px;
  padding: 2px 6px;
}

.priority-task-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.priority-task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 13px;
  text-align: left;
  text-decoration: none;
}

.priority-task-card:hover {
  border-color: rgba(12, 56, 125, 0.26);
  box-shadow: 0 14px 28px rgba(11, 31, 63, 0.08);
}

.priority-task-card span {
  display: grid;
  gap: 3px;
}

.priority-task-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
}

.priority-task-card small {
  color: var(--muted);
  font-size: 12px;
}

.priority-task-card em {
  background: var(--gold-soft);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  justify-self: start;
  padding: 4px 8px;
  text-transform: capitalize;
}

.priority-task-card b {
  color: var(--primary);
  font-size: 12px;
}

.dashboard-empty {
  color: var(--muted);
  padding: 18px;
}

@media (max-width: 1240px) {
  .modern-dashboard-grid,
  .priority-task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .modern-dashboard-grid,
  .priority-task-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-row {
    grid-template-columns: 1fr;
  }

  .pipeline-row strong {
    text-align: left;
  }

  .owner-score-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .priority-work-card .dashboard-card-head {
    align-items: stretch;
    display: grid;
  }

  .dashboard-focus-tabs {
    justify-content: flex-start;
  }
}

/* Daily workflow dashboard */
#workbench #businessStats.stat-grid {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.hq-stat-card {
  align-items: start;
  background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--hq-accent, var(--primary)) 8%, white));
  border: 1px solid color-mix(in srgb, var(--hq-accent, var(--primary)) 18%, var(--line));
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(11, 31, 63, 0.065);
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 112px;
  padding: 14px;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.hq-stat-card:hover {
  border-color: color-mix(in srgb, var(--hq-accent, var(--primary)) 34%, var(--line));
  box-shadow: 0 18px 42px rgba(11, 31, 63, 0.09);
  transform: translateY(-1px);
}

.hq-stat-card.lead {
  --hq-accent: var(--primary);
}

.hq-stat-card.money {
  --hq-accent: var(--gold);
}

.hq-stat-card.install {
  --hq-accent: var(--primary-dark);
}

.hq-stat-card.service {
  --hq-accent: var(--success);
}

.hq-stat-card.consult {
  --hq-accent: #2f80ed;
}

.hq-stat-card.quote {
  --hq-accent: #8b5cf6;
}

.hq-stat-icon {
  align-items: center;
  background: color-mix(in srgb, var(--hq-accent, var(--primary)) 13%, white);
  border: 1px solid color-mix(in srgb, var(--hq-accent, var(--primary)) 24%, var(--line));
  border-radius: 8px;
  color: var(--hq-accent, var(--primary));
  display: inline-flex;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.hq-stat-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hq-stat-copy em,
.hq-schedule-top b,
.hq-intel-card em {
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hq-stat-copy strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 28px;
  line-height: 1;
}

.hq-stat-copy small {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.hq-stat-copy b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.daily-schedule-card,
.daily-schedule-empty {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(11, 31, 63, 0.06);
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 94px;
  padding: 12px;
  text-decoration: none;
}

.daily-schedule-card:hover {
  border-color: rgba(12, 56, 125, 0.25);
  box-shadow: 0 18px 42px rgba(11, 31, 63, 0.1);
  transform: translateY(-1px);
}

.daily-schedule-card .schedule-icon {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 8px;
  color: var(--primary);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.daily-schedule-card.install .schedule-icon {
  background: rgba(253, 197, 27, 0.18);
  color: #9a6500;
}

.daily-schedule-card.service .schedule-icon {
  background: rgba(17, 134, 96, 0.11);
  color: var(--success);
}

.schedule-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.schedule-body strong,
.schedule-body b,
.workflow-queue-head h3,
.workflow-section-heading h3,
.workflow-row strong,
.workflow-file-card strong,
.workflow-action-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
}

.schedule-body strong {
  font-size: 14px;
}

.schedule-body em {
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schedule-body b {
  font-size: 15px;
}

.schedule-body small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-schedule-empty {
  color: var(--muted);
  grid-column: 1 / -1;
  justify-content: center;
  text-align: center;
}

#workbench #businessQueues.queue-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.hq-section,
.hq-intel-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(11, 31, 63, 0.07);
  min-width: 0;
}

.hq-section {
  padding: 16px;
}

.hq-schedule-slider {
  display: flex;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 3px 10px;
  scroll-snap-type: x proximity;
}

.hq-schedule-card,
.hq-empty-card {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--schedule-accent, var(--primary)) 18%, var(--line));
  border-top: 4px solid var(--schedule-accent, var(--primary));
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(11, 31, 63, 0.05);
  color: var(--text);
  display: grid;
  flex: 0 0 264px;
  gap: 6px;
  grid-template-rows: auto auto auto 1fr;
  min-height: 136px;
  min-width: 0;
  padding: 16px 42px 13px 13px;
  position: relative;
  scroll-snap-align: start;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hq-schedule-card.consult {
  --schedule-accent: var(--primary);
}

.hq-schedule-card.install {
  --schedule-accent: var(--gold);
}

.hq-schedule-card.service {
  --schedule-accent: var(--success);
}

.hq-schedule-card:hover {
  border-color: color-mix(in srgb, var(--schedule-accent, var(--primary)) 38%, var(--line));
  box-shadow: 0 16px 34px rgba(11, 31, 63, 0.1);
  transform: translateY(-1px);
}

.hq-schedule-top {
  align-items: center;
  display: block;
  position: absolute;
  right: 10px;
  top: 10px;
}

.hq-schedule-top span {
  align-items: center;
  background: color-mix(in srgb, var(--schedule-accent, var(--primary)) 10%, white);
  border: 1px solid color-mix(in srgb, var(--schedule-accent, var(--primary)) 18%, var(--line));
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  padding: 0;
  width: 28px;
}

.hq-schedule-top i {
  align-items: center;
  color: var(--schedule-accent, var(--primary));
  display: inline-flex;
  font-size: 12px;
  height: auto;
  justify-content: center;
  width: auto;
}

.hq-schedule-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.25;
}

.hq-schedule-time {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  line-height: 1.2;
}

.hq-schedule-time i {
  color: color-mix(in srgb, var(--schedule-accent, var(--primary)) 72%, var(--muted));
  font-size: 11px;
  flex: 0 0 auto;
}

.hq-schedule-account {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.hq-schedule-card small,
.hq-schedule-card em,
.hq-intel-card small,
.hq-intel-card b {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.hq-schedule-card small {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.hq-schedule-card small i {
  color: color-mix(in srgb, var(--schedule-accent, var(--primary)) 72%, var(--muted));
  flex: 0 0 auto;
}

.hq-schedule-card em {
  align-self: end;
  border-top: 1px solid color-mix(in srgb, var(--schedule-accent, var(--primary)) 12%, var(--line));
  margin-top: 4px;
  padding-top: 8px;
}

.hq-dashboard-grid {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  min-width: 0;
}

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

.role-dashboard-hero.office {
  border-left: 4px solid var(--primary);
}

.role-dashboard-hero.field {
  border-left: 4px solid var(--success);
}

.field-dashboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
}

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

.field-tool-grid a {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary-dark);
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 94px;
  padding: 12px;
  text-align: center;
  text-decoration: none;
}

.field-tool-grid i {
  align-items: center;
  background: #fff;
  border-radius: 8px;
  color: var(--success);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.field-tool-grid span {
  font-size: 13px;
  font-weight: 850;
}

.hq-task-list,
.hq-side-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.hq-task-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr) minmax(130px, auto);
  min-height: 70px;
  padding: 10px;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.hq-task-row:hover {
  border-color: rgba(12, 56, 125, 0.25);
  box-shadow: 0 12px 28px rgba(11, 31, 63, 0.075);
  transform: translateY(-1px);
}

.hq-task-rank {
  align-items: center;
  background: var(--surface-strong);
  border-radius: 8px;
  color: var(--primary);
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.hq-task-main,
.hq-task-meta,
.hq-intel-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.hq-task-main strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.25;
}

.hq-task-main small,
.hq-task-meta b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.hq-task-meta {
  justify-items: end;
  text-align: right;
}

.hq-task-meta em {
  background: var(--blue-soft);
  border-radius: 999px;
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 8px;
}

.hq-intel-card {
  align-items: start;
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 158px;
  padding: 14px;
  text-decoration: none;
}

.hq-intel-card > span {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.hq-intel-card.payment > span {
  background: var(--gold-soft);
  color: #8a5a00;
}

.hq-intel-card.delivery > span {
  background: rgba(12, 56, 125, 0.09);
  color: var(--primary);
}

.hq-intel-card.approved-quote {
  background: linear-gradient(135deg, #fff, rgba(17, 134, 96, 0.1));
}

.hq-intel-card.approved-quote > span {
  background: rgba(17, 134, 96, 0.12);
  color: var(--success);
}

.hq-intel-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.1;
}

.hq-empty-card {
  align-items: center;
  color: var(--muted);
  justify-content: center;
  min-height: 120px;
}

.workflow-dashboard,
.workflow-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(11, 31, 63, 0.08);
  padding: 16px;
}

.workflow-dashboard.two-column {
  align-items: start;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.7fr);
  padding: 0;
}

.workflow-section-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.workflow-section-heading.compact {
  margin-bottom: 12px;
}

.workflow-section-heading span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workflow-section-heading h3 {
  font-size: 22px;
  line-height: 1.1;
  margin: 4px 0 0;
}

.workflow-section-heading small {
  background: var(--gold-soft);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  white-space: nowrap;
}

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

.workflow-queue-card {
  align-content: start;
  background: linear-gradient(180deg, #fff, rgba(242, 244, 247, 0.5));
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-height: 238px;
  padding: 13px;
}

.workflow-queue-head {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr);
}

.workflow-queue-head > span {
  align-items: center;
  background: var(--primary-dark);
  border-radius: 8px;
  color: var(--gold);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.workflow-queue-head h3 {
  font-size: 16px;
  margin: 0;
}

.workflow-queue-head small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.workflow-queue-list,
.workflow-action-grid {
  align-content: start;
  display: grid;
  gap: 8px;
}

.workflow-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 10px;
  text-decoration: none;
}

.workflow-row:hover,
.workflow-file-card:hover,
.workflow-action-card:hover {
  border-color: rgba(12, 56, 125, 0.24);
  box-shadow: 0 12px 26px rgba(11, 31, 63, 0.08);
}

.workflow-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workflow-row strong {
  font-size: 13px;
}

.workflow-row small,
.workflow-row em,
.workflow-file-card small,
.workflow-action-card small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-row em {
  font-style: normal;
  text-align: right;
}

.workflow-row b {
  background: var(--surface-strong);
  border-radius: 999px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  grid-column: 1 / -1;
  justify-self: start;
  padding: 4px 8px;
}

.workflow-empty {
  align-items: center;
  background: var(--surface-strong);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: center;
  min-height: 88px;
  padding: 14px;
}

.workflow-files-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.workflow-file-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 5px;
  overflow: hidden;
  padding-bottom: 10px;
  text-decoration: none;
}

.workflow-file-card img {
  aspect-ratio: 1.38;
  display: block;
  object-fit: cover;
  width: 100%;
}

.workflow-file-card span,
.workflow-action-card span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0 10px;
  text-transform: uppercase;
}

.workflow-file-card strong,
.workflow-file-card small {
  padding: 0 10px;
}

.workflow-file-card strong {
  font-size: 13px;
  line-height: 1.2;
}

.hq-latest-uploads {
  height: 100%;
}

.sidebar-files-grid {
  grid-template-columns: 1fr;
}

.sidebar-files-grid .workflow-file-card {
  align-items: center;
  gap: 4px 10px;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 88px;
  padding: 8px;
}

.sidebar-files-grid .workflow-file-card img {
  aspect-ratio: auto;
  border-radius: 7px;
  grid-row: span 3;
  height: 66px;
  width: 72px;
}

.sidebar-files-grid .workflow-file-card span,
.sidebar-files-grid .workflow-file-card strong,
.sidebar-files-grid .workflow-file-card small {
  padding: 0;
}

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

.workflow-action-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 12px;
  text-decoration: none;
}

.workflow-action-card span {
  align-items: center;
  display: flex;
  gap: 7px;
  padding: 0;
}

.workflow-action-card strong {
  font-size: 14px;
  line-height: 1.25;
}

@media (max-width: 1320px) {
  #workbench #businessStats.stat-grid,
  .workflow-queue-grid,
  .workflow-dashboard.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 820px) {
  #workbench #businessStats.stat-grid,
  .workflow-queue-grid,
  .workflow-dashboard.two-column,
  .workflow-files-grid,
  .workflow-action-grid {
    grid-template-columns: 1fr;
  }

  .workflow-section-heading {
    align-items: flex-start;
    display: grid;
  }

  .hq-schedule-slider {
    display: flex;
  }

  .hq-schedule-card,
  .hq-empty-card {
    flex-basis: min(278px, 86vw);
  }

  .hq-task-row,
  .hq-intel-card {
    grid-template-columns: 1fr;
  }

  .hq-task-meta {
    justify-items: start;
    text-align: left;
  }

  .customer-project-row {
    align-items: start;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .customer-project-row .project-field,
  .customer-project-row > i {
    grid-column: 2;
  }

  .customer-project-row > i {
    justify-self: start;
  }

  .opening-media-capture {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .measurement-entry-heading {
    align-items: start;
    display: grid;
  }

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

body:not(.public-document-mode) .nav-tab::before,
.nav-tab.active::before {
  content: none;
  display: none;
}

.topbar.app-header .context-row:empty {
  display: none;
}

.manager-action-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 12px;
}

.manager-action-row:empty {
  display: none;
}

/* Branded form typography: lighter values, quieter labels, consistent across all workflows */
label,
.installer-closeout-grid label,
.quote-size-inputs label,
.mini-status-card label,
.team-editor label,
.field-grid label {
  color: #667085;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

input,
select,
textarea,
.team-editor input,
.team-editor select,
.quote-size-inputs input,
.mini-status-card input,
.mini-status-card select {
  color: var(--text);
  font-family: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.35;
}

.mini-status-card .status-select,
.status-select {
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 650;
  min-height: 38px;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.mini-status-card .status-select:focus,
.status-select:focus {
  border-color: color-mix(in srgb, var(--status-accent, var(--primary)) 42%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-accent, var(--primary)) 14%, transparent);
  outline: 0;
}

.status-select.active,
.status-badge.active {
  --status-accent: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, white);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  color: var(--primary);
}

.status-select.ready,
.status-badge.ready {
  --status-accent: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, white);
  border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
  color: var(--primary);
}

.status-select.scheduled,
.status-badge.scheduled {
  --status-accent: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, white);
  border-color: rgba(253, 183, 27, 0.42);
  color: #754c00;
}

.status-select.complete,
.status-badge.complete {
  --status-accent: var(--success);
  background: color-mix(in srgb, var(--success) 11%, white);
  border-color: color-mix(in srgb, var(--success) 26%, var(--line));
  color: var(--success);
}

.status-select.warn,
.status-badge.warn {
  --status-accent: #f59e0b;
  background: color-mix(in srgb, #f59e0b 13%, white);
  border-color: color-mix(in srgb, #f59e0b 34%, var(--line));
  color: #7c4a03;
}

.status-select.closed,
.status-badge.closed {
  --status-accent: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, white);
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  color: var(--danger);
}

.status-select.neutral,
.status-badge.neutral {
  --status-accent: var(--muted);
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--muted);
}

.status-select option {
  background: #fff;
  color: var(--text);
}

.team-assignment-section .section-heading-row {
  align-items: start;
}

.assignment-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.assignment-summary > span {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
  min-height: 34px;
  padding: 4px 10px 4px 5px;
}

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

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

.assignment-readonly-card {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  min-height: 58px;
  padding: 10px;
}

.assignment-readonly-card span {
  display: grid;
  gap: 1px;
}

.assignment-readonly-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 650;
}

.assignment-readonly-card small {
  color: var(--muted);
  font-size: 11px;
}

.assignment-toggle {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto auto 1fr;
  min-height: 58px;
  padding: 10px;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.assignment-toggle:hover {
  background: #f8fafc;
  border-color: rgba(12, 56, 125, 0.2);
  box-shadow: 0 8px 18px rgba(11, 31, 63, 0.055);
  transform: translateY(-1px);
}

.assignment-toggle:has(input:checked) {
  background: color-mix(in srgb, var(--primary) 7%, white);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
}

.assignment-toggle input {
  height: 16px;
  margin: 0;
  width: 16px;
}

.assignment-toggle span:not(.team-avatar) {
  display: grid;
  gap: 1px;
}

.assignment-toggle strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 650;
}

.assignment-toggle small {
  color: var(--muted);
  font-size: 11px;
}

.compact-assignment-section {
  padding: 12px 14px;
}

.compact-assignment-row {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
}

.assignment-summary.compact {
  justify-content: flex-start;
  margin-top: 8px;
}

.assignment-summary.compact > span {
  padding-right: 7px;
}

.assignment-summary.compact strong {
  font-size: 12px;
  font-weight: 700;
}

.assignment-add-control {
  display: grid;
  gap: 6px;
}

.assignment-add-control > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.assignment-remove-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  height: 22px;
  justify-content: center;
  margin-left: 2px;
  transition: background-color 140ms ease, color 140ms ease;
  width: 22px;
}

.assignment-remove-button:hover {
  background: rgba(224, 60, 60, 0.1);
  color: var(--danger);
}

.assigned-crew-strip {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 10px;
}

.assigned-crew-strip > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-right: 2px;
  text-transform: uppercase;
}

.assigned-crew-strip strong {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  min-height: 30px;
  padding: 3px 9px 3px 4px;
}

.timecard-toolbar {
  align-items: center;
  justify-content: space-between;
}

.payroll-role-summary,
.payroll-current-user {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 9px;
  min-height: 38px;
  padding: 4px 12px;
}

.payroll-role-summary i {
  align-items: center;
  background: var(--primary-dark);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.payroll-current-user {
  border-radius: 9px;
  padding: 5px 11px 5px 5px;
}

.payroll-current-user > span {
  display: grid;
  gap: 1px;
}

.payroll-current-user strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.payroll-current-user small {
  color: var(--muted);
  font-size: 11px;
}

.time-member-picker {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.time-member-picker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.time-member-picker select {
  min-width: 260px;
}

.time-dashboard-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.time-admin-panel,
.time-employee-panel,
.job-time-section {
  background: #fff;
}

.payroll-period-banner {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 14px;
}

.employee-view-banner {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.payroll-period-banner > div {
  background: linear-gradient(135deg, rgba(12, 56, 125, 0.06), rgba(253, 197, 27, 0.08));
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 3px;
  padding: 14px;
}

.employee-view-banner > div {
  background: linear-gradient(135deg, rgba(17, 134, 96, 0.07), rgba(12, 56, 125, 0.05));
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 3px;
  padding: 14px;
}

.payroll-period-banner > div > span,
.employee-view-banner > div > span,
.active-worker-card > div:not(.time-member-link) > span,
.job-time-worker-card > div:not(.time-member-link) > span,
.pay-stub-card > span,
.time-subsection h5 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payroll-period-banner strong,
.employee-view-banner strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
}

.payroll-period-banner small,
.employee-view-banner small,
.active-worker-card small,
.pay-stub-card small {
  color: var(--muted);
  font-size: 12px;
}

.time-employee-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
}

.employee-timeclock {
  --clock-accent: var(--primary);
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--clock-accent) 18%, var(--line));
  border-left: 4px solid var(--clock-accent);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(11, 31, 63, 0.07);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.employee-timeclock.active {
  --clock-accent: var(--success);
}

.employee-timeclock.off-clock {
  --clock-accent: var(--primary);
}

.employee-timeclock.payroll-surface {
  box-shadow: none;
}

.employee-timeclock-main {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(210px, 0.9fr) minmax(210px, 1fr) minmax(170px, auto);
}

.employee-clock-identity {
  align-items: center;
  background: color-mix(in srgb, var(--clock-accent) 7%, white);
  border: 1px solid color-mix(in srgb, var(--clock-accent) 18%, var(--line));
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 12px;
}

.employee-clock-identity > div,
.employee-clock-face,
.employee-clock-meta article {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.employee-clock-identity span,
.employee-clock-face span,
.employee-clock-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.employee-clock-identity h3 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.05;
  margin: 0;
}

.employee-clock-identity small,
.employee-clock-face small,
.employee-clock-meta small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.employee-clock-face {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  justify-content: center;
  padding: 12px 14px;
}

.employee-clock-face strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
}

.employee-clock-actions {
  align-content: center;
  display: grid;
  gap: 9px;
}

.employee-clock-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--clock-accent) 20%, transparent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 850;
  gap: 10px;
  justify-content: center;
  min-height: 54px;
  padding: 0 18px;
  transition: filter 140ms ease, transform 140ms ease;
  width: 100%;
}

.employee-clock-button:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.employee-clock-button.clock-in {
  background: var(--success);
}

.employee-clock-button.clock-out {
  background: var(--primary-dark);
}

.employee-clock-actions .secondary-button {
  justify-content: center;
  min-height: 42px;
  width: 100%;
}

.employee-clock-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.employee-clock-meta article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.employee-clock-meta strong {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.payroll-register-section,
.payroll-selected-panel,
.payroll-history-section,
.payroll-rate-panel {
  background: #fff;
}

.payroll-register-section {
  margin-top: 12px;
}

.payroll-rate-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.payroll-rate-panel p {
  color: var(--muted);
  margin: 2px 0 0;
}

.payroll-rate-input {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 160px;
  padding: 6px 8px;
}

.payroll-rate-input input,
.payroll-rate-input select {
  border: 0;
  color: var(--primary-dark);
  font-weight: 800;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.payroll-type-input {
  max-width: 180px;
}

.payroll-rate-input span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.payroll-selected-panel,
.payroll-history-section {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.payroll-summary-cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payroll-summary-cards article {
  background: linear-gradient(180deg, #fff, var(--surface-strong));
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.payroll-summary-cards span,
.payroll-payment-form label span,
.payroll-receipt span,
.employee-period-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payroll-summary-cards strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.1;
}

.payroll-summary-cards small,
.payroll-approval-panel p,
.payroll-receipt small {
  color: var(--muted);
  font-size: 12px;
}

.payroll-approval-panel {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.payroll-approval-panel h5 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  margin: 0 0 3px;
}

.payroll-approval-panel p {
  margin: 0;
}

.payroll-payment-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.payroll-payment-form label {
  display: grid;
  gap: 6px;
}

.payroll-payment-form label.wide {
  grid-column: 1 / -2;
}

.payroll-payment-form button {
  align-self: end;
  min-height: 42px;
}

.payroll-receipt {
  background: #fff;
  border: 1px solid rgba(17, 134, 96, 0.22);
  border-radius: 9px;
  display: grid;
  gap: 4px;
  max-width: 360px;
  padding: 12px;
}

.payroll-receipt strong {
  color: var(--success);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
}

.payroll-audit-flag {
  align-items: flex-start;
  color: var(--primary-dark);
  display: inline-flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 800;
  gap: 2px;
  line-height: 1.25;
}

.payroll-audit-flag i {
  color: var(--accent);
  margin-right: 4px;
}

.payroll-audit-flag small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  max-width: 260px;
}

.payroll-time-edit-row td {
  background: var(--surface-strong);
  padding: 0;
}

.payroll-time-edit-form {
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 10px;
  padding: 12px;
}

.payroll-time-edit-form label {
  display: grid;
  gap: 6px;
}

.payroll-time-edit-form label.wide,
.payroll-time-edit-form small,
.payroll-time-edit-actions {
  grid-column: 1 / -1;
}

.payroll-time-edit-form label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payroll-time-edit-form small {
  color: var(--muted);
  font-size: 12px;
}

.payroll-time-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.settings-hero {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(11, 31, 63, 0.07);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 16px;
}

.settings-hero span,
.settings-preview-grid article span,
.settings-metric-field span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.settings-hero h3,
.settings-preview-grid article strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  margin: 4px 0 0;
}

.settings-hero h3 {
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.08;
}

.settings-hero p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 760px;
}

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

.settings-preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.settings-preview-grid article,
.settings-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(11, 31, 63, 0.05);
}

.settings-preview-grid article {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.settings-preview-grid article small,
.settings-metric-field small,
.settings-metric-field b {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-layout {
  display: grid;
  gap: 14px;
}

.pricing-engine-layout,
.settings-lookup-section {
  display: grid;
  gap: 14px;
}

.pricing-formula-card {
  gap: 12px;
}

.pricing-formula-equation {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.pricing-formula-equation span,
.settings-subsection-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pricing-formula-equation strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(16px, 1.7vw, 21px);
  line-height: 1.25;
}

.pricing-formula-equation small,
.pricing-formula-steps small,
.settings-technical-body,
.settings-technical-body small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pricing-formula-steps {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pricing-formula-steps article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px;
}

.pricing-formula-steps article > span {
  align-items: center;
  background: rgba(12, 56, 125, 0.1);
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.pricing-formula-steps strong {
  color: var(--text);
  display: block;
  font-weight: 750;
  line-height: 1.2;
}

.pricing-formula-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pricing-formula-tags span {
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
}

.pricing-formula-tags.compact span {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--muted);
}

.settings-subsection-heading {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(11, 31, 63, 0.04);
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.settings-subsection-heading h4 {
  color: var(--primary-dark);
  font-size: 18px;
  margin: 3px 0 0;
}

.settings-subsection-heading p {
  color: var(--muted);
  margin: 5px 0 0;
  max-width: 780px;
}

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

.rs-core-source-card {
  align-content: start;
  overflow: hidden;
}

.compact-source-table {
  min-width: 560px;
}

.compact-source-table th,
.compact-source-table td {
  font-size: 12px;
  padding: 9px 10px;
}

.settings-technical-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.settings-technical-details summary {
  align-items: center;
  background: #fff;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 11px 12px;
}

.settings-technical-details summary::-webkit-details-marker {
  display: none;
}

.settings-technical-details summary::after {
  color: var(--muted);
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-size: 11px;
  font-weight: 900;
}

.settings-technical-details[open] summary::after {
  transform: rotate(180deg);
}

.settings-technical-body {
  background: #f8fafc;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.settings-technical-body p {
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  margin: 0;
}

.settings-wide {
  background: #fff;
}

.settings-technical-grid {
  background: #f8fafc;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  padding: 12px;
}

.editable-source-table td {
  vertical-align: middle;
}

.source-value-input {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  display: flex;
  gap: 6px;
  min-width: 96px;
  padding: 5px 7px;
}

.source-value-input input {
  border: 0;
  color: var(--primary-dark);
  font: 800 12px/1 "Inter", ui-sans-serif, system-ui, sans-serif;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.source-value-input em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.settings-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

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

.settings-metric-field {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.settings-input-wrap {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-input-wrap input {
  border: 0;
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  min-width: 0;
  padding: 10px 11px;
  width: 100%;
}

.settings-input-wrap em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding-right: 11px;
}

.settings-metric-field b {
  font-weight: 800;
}

.quote-defaults-editor {
  background: #fffdf5;
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.quote-markup-panel {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 0.72fr) minmax(320px, 1fr) auto;
}

.quote-markup-copy {
  display: grid;
  gap: 3px;
}

.quote-markup-copy > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-markup-copy h4 {
  color: var(--primary-dark);
  font-size: 14px;
  line-height: 1.15;
  margin: 0;
}

.quote-markup-copy p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  max-width: 620px;
}

.quote-markup-controls {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.quote-markup-actions {
  justify-self: end;
}

.quote-defaults-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quote-defaults-meta span {
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 7px;
}

.settings-metric-field.compact {
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 7px;
  gap: 4px;
  padding: 6px 8px;
}

.settings-metric-field.compact small,
.settings-metric-field.compact b {
  display: none;
}

.employee-period-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.employee-period-heading h5 {
  margin: 0;
}

.table-muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.time-summary-grid,
.job-time-grid,
.job-time-worker-grid,
.active-worker-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.time-summary-grid article,
.time-command-card,
.active-worker-card,
.job-time-worker-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 13px;
}

.active-worker-grid {
  grid-template-columns: 1fr;
}

.active-worker-card {
  align-items: center;
  column-gap: 18px;
  grid-template-columns: minmax(180px, 1fr) 110px minmax(180px, 1fr);
}

.active-worker-card strong,
.job-time-worker-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

.active-worker-empty {
  align-items: center;
  background: var(--surface-strong);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  min-height: 76px;
  padding: 14px;
}

.job-time-worker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-time-worker-card {
  align-items: center;
  column-gap: 14px;
  grid-template-columns: minmax(170px, 1fr) 90px minmax(130px, auto) auto;
}

.time-summary-grid span,
.time-command-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.time-summary-grid strong,
.time-command-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.1;
}

.time-summary-grid small,
.time-command-card small {
  color: var(--muted);
  font-size: 12px;
}

.time-action-row,
.time-action-stack {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.time-action-stack {
  align-content: center;
  justify-content: flex-end;
}

.time-state-chip {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
}

.time-state-chip.active {
  background: rgba(17, 134, 96, 0.1);
  border-color: rgba(17, 134, 96, 0.24);
  color: var(--success);
}

.time-mini-log {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
}

.time-mini-log div {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.time-mini-log strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.time-mini-log span,
.time-entry-kind,
.time-live {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.time-live {
  color: var(--success);
}

.time-member-link,
#timecardManager .time-member-link {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr);
  min-width: 0;
  text-align: left;
}

.time-member-link > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.time-member-link strong {
  display: block;
  overflow-wrap: normal;
  word-break: normal;
}

.time-member-link .team-avatar {
  box-shadow: 0 0 0 3px #fff, 0 8px 18px rgba(11, 31, 63, 0.12);
  color: #fff;
  flex: 0 0 auto;
  line-height: 1;
}

.time-member-link .table-subline {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: normal;
}

.time-subsection {
  display: grid;
  gap: 8px;
}

.time-subsection h5 {
  margin: 0;
}

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

.pay-stub-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.pay-stub-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
}

button:disabled,
button[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

#timecardManager .manager-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#timecardManager .process-detail-table {
  table-layout: auto;
}

#timecardManager .process-detail-table th:first-child,
#timecardManager .process-detail-table td:first-child {
  min-width: 170px;
  width: 25%;
}

#timecardManager .process-detail-table th,
#timecardManager .process-detail-table td {
  vertical-align: middle;
}

.route-planner-controls {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 14px 16px;
}

.route-planner-controls > div:first-child {
  display: grid;
  gap: 2px;
}

.route-planner-controls > div:first-child span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-planner-controls h4 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  margin: 0;
}

.route-filter-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.route-filter {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #566174;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.route-filter input {
  accent-color: var(--gold);
  height: 14px;
  margin: 0;
  width: 14px;
}

.route-filter.active {
  background: #fff8dd;
  border-color: #e3b018;
  box-shadow: 0 8px 18px rgba(253, 197, 27, 0.14);
  color: var(--primary-dark);
}

.route-filter.active i {
  color: var(--primary-dark);
}

.routing-shell {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}

.routing-map-card,
.routing-recommendation-card,
.route-list-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.route-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.route-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
}

.route-dot {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.route-dot.consult,
.route-pin.route-consult,
.route-job-card.route-consult > span,
.route-pair-job.route-consult {
  --route-color: #0c387d;
}

.route-dot.install,
.route-pin.route-install,
.route-job-card.route-install > span,
.route-pair-job.route-install {
  --route-color: #118660;
}

.route-dot.service,
.route-pin.route-service,
.route-job-card.route-service > span,
.route-pair-job.route-service {
  --route-color: #f59e0b;
}

.route-dot {
  background: var(--route-color);
}

.route-map {
  background:
    radial-gradient(circle at 48% 45%, rgba(12, 56, 125, 0.12), transparent 23%),
    linear-gradient(90deg, rgba(12, 56, 125, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(12, 56, 125, 0.055) 1px, transparent 1px),
    linear-gradient(135deg, #ffffff, #f6f8fb);
  background-size: auto, 42px 42px, 42px 42px, auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: clamp(620px, 68vh, 860px);
  overflow: hidden;
  position: relative;
}

.route-map-empty-state {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(11, 31, 63, 0.1);
  color: var(--muted);
  display: grid;
  gap: 6px;
  left: 50%;
  max-width: 360px;
  padding: 16px 18px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}

.route-map-empty-state strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
}

.route-map-empty-state span {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.google-route-map {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: none;
  min-height: clamp(620px, 68vh, 860px);
  overflow: hidden;
}

.routing-map-card.google-map-ready .google-route-map {
  display: block;
}

.routing-map-card.google-map-loading .google-route-map {
  display: block;
}

.routing-map-card.google-map-ready .route-map-fallback,
.routing-map-card.google-map-loading .route-map-fallback {
  display: none;
}

.route-map-info {
  color: #0b1f3f;
  display: grid;
  gap: 7px;
  max-width: 230px;
  min-width: 220px;
}

.route-map-info strong {
  font: 800 15px "Poppins", ui-sans-serif, system-ui, sans-serif;
}

.route-map-info span,
.route-map-info a {
  font: 700 12px "Noto Sans", ui-sans-serif, system-ui, sans-serif;
}

.route-map-info a {
  color: #0c387d;
  text-decoration: none;
}

.route-map-info a:hover {
  text-decoration: underline;
}

.route-popup-gallery {
  background: #eef3f8;
  border: 1px solid #dfe5ee;
  border-radius: 7px;
  cursor: pointer;
  display: block;
  height: 118px;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100%;
}

.route-popup-gallery img {
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: 0;
  display: block;
  height: 100%;
  max-height: none;
  object-fit: cover;
  width: 100%;
}

.route-popup-gallery span {
  background: rgba(11, 31, 63, 0.78);
  border-radius: 999px;
  bottom: 7px;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  padding: 4px 7px;
  position: absolute;
  right: 7px;
}

.route-popup-type {
  background: #fff8dd;
  border: 1px solid #f1d36f;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  justify-self: start;
  padding: 4px 8px;
  text-transform: uppercase;
}

.route-popup-address {
  color: #334155;
  font-weight: 650;
  line-height: 1.35;
}

.route-popup-detail {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #526172;
  display: -webkit-box;
  font: 650 12px/1.35 "Noto Sans", ui-sans-serif, system-ui, sans-serif;
  margin: 0;
  overflow: hidden;
}

.route-popup-detail span {
  color: #0b1f3f;
  display: block;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.route-popup-actions {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}

.route-popup-actions a {
  align-items: center;
  background: #eef2f7;
  border: 1px solid #d7deea;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  min-height: 30px;
  padding: 0 10px;
}

.route-popup-actions a:first-child {
  background: var(--gold);
  border-color: #e3b018;
}

.route-map::before {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(12, 56, 125, 0.12);
  border-radius: 999px;
  color: var(--primary-dark);
  content: "Nashville Metro Dispatch";
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  left: 50%;
  padding: 8px 13px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.route-map-label {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  position: absolute;
  z-index: 2;
}

.route-map-label.north {
  left: 44%;
  top: 14px;
}

.route-map-label.south {
  bottom: 14px;
  left: 43%;
}

.route-map-label.west {
  left: 14px;
  top: 48%;
}

.route-map-label.east {
  right: 14px;
  top: 48%;
}

.route-road {
  background: rgba(12, 56, 125, 0.18);
  border-radius: 999px;
  height: 8px;
  left: 8%;
  position: absolute;
  right: 8%;
  top: 48%;
  transform: rotate(-12deg);
}

.route-road-two {
  background: rgba(253, 183, 27, 0.24);
  left: 18%;
  right: 18%;
  top: 54%;
  transform: rotate(38deg);
}

.route-road-three {
  background: rgba(17, 134, 96, 0.16);
  left: 22%;
  right: 15%;
  top: 41%;
  transform: rotate(8deg);
}

.route-pair-line {
  background: linear-gradient(90deg, rgba(12, 56, 125, 0), rgba(12, 56, 125, 0.92), rgba(253, 197, 27, 0.95));
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(12, 56, 125, 0.2);
  height: 4px;
  left: var(--x1);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: var(--y1);
  transform: rotate(var(--route-angle));
  transform-origin: left center;
  transition: opacity 120ms ease;
  width: var(--route-length);
  z-index: 3;
}

.route-pair-line.active {
  opacity: 1;
}

.route-pair-line span {
  background: var(--primary-dark);
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  left: 50%;
  padding: 4px 8px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -130%) rotate(calc(-1 * var(--route-angle)));
  white-space: nowrap;
}

.route-pin {
  align-items: center;
  background: var(--route-color);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 13px 24px rgba(11, 31, 63, 0.18);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  left: var(--map-x);
  min-height: 38px;
  max-width: 180px;
  padding: 0 11px 0 5px;
  position: absolute;
  text-decoration: none;
  top: var(--map-y);
  transform: translate(-50%, -50%);
  transition: transform 140ms ease, box-shadow 140ms ease;
  z-index: 4;
}

.route-pin:hover {
  box-shadow: 0 18px 32px rgba(11, 31, 63, 0.24);
  transform: translate(-50%, -50%) scale(1.04);
}

.route-pin span {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 23px;
  justify-content: center;
  width: 23px;
}

.route-pin strong {
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routing-side-panel {
  display: grid;
  gap: 14px;
}

.routing-recommendation-card {
  background: #fff;
  border-color: #dfe5ee;
  display: grid;
  gap: 12px;
}

.routing-recommendation-card > div:first-child span {
  color: #687387;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.routing-recommendation-card h4 {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  margin: 2px 0 0;
}

.route-cluster-list,
.route-pair-list,
.route-job-grid {
  display: grid;
  gap: 10px;
}

.route-cluster-list article,
.route-pair-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.route-pair-card {
  background: #fbfcfe;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.route-pair-card:hover,
.route-pair-card.active {
  background: #fff;
  border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
  box-shadow: 0 14px 30px rgba(11, 31, 63, 0.08);
  transform: translateY(-1px);
}

.route-pair-card-head {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.route-pair-card-head strong {
  background: #eef2f7;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  padding: 5px 9px;
}

.route-pair-card > small {
  color: var(--muted);
  font-size: 11.5px;
}

.route-pair-jobs {
  display: grid;
  gap: 8px;
}

.route-pair-job {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--route-color);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.route-pair-job:hover {
  background: color-mix(in srgb, var(--route-color) 6%, #fff);
  border-color: color-mix(in srgb, var(--route-color) 24%, var(--line));
}

.route-pair-job > span {
  color: var(--route-color);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.route-pair-job strong {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.route-pair-job small {
  color: var(--muted);
  font-size: 11.5px;
}

.route-directions-link {
  align-items: center;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  margin-top: 4px;
  text-decoration: none;
}

.route-directions-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.route-cluster-list strong,
.route-pair-list strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.route-cluster-list span,
.route-pair-list span {
  color: var(--muted);
  font-size: 12px;
}

.route-list-section {
  margin-top: 14px;
}

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

.route-job-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  min-height: 76px;
  padding: 12px;
  text-align: left;
}

.route-job-card:hover {
  background: color-mix(in srgb, var(--route-color) 5%, #fff);
  border-color: color-mix(in srgb, var(--route-color) 32%, var(--line));
}

.route-job-card > span {
  align-items: center;
  background: var(--route-color);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.route-job-card strong {
  color: var(--primary-dark);
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.route-job-card small,
.route-job-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.info-heading-line {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  max-width: 100%;
  position: relative;
}

.info-heading-line h1,
.info-heading-line h2,
.info-heading-line h3,
.info-heading-line h4,
.info-heading-line h5,
.info-heading-line h6 {
  margin-bottom: 0;
}

.heading-info-button {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 10px;
  height: 20px;
  justify-content: center;
  padding: 0;
  position: relative;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
  width: 20px;
  z-index: 4;
}

.heading-info-button:hover,
.heading-info-button.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(12, 56, 125, 0.16);
  color: #fff;
}

.instruction-bubble {
  background: var(--primary-dark);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(11, 31, 63, 0.24);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  left: 50%;
  line-height: 1.45;
  max-width: min(320px, calc(100vw - 44px));
  opacity: 0;
  padding: 11px 12px;
  pointer-events: none;
  position: absolute;
  text-align: left;
  top: calc(100% + 9px);
  transform: translate(-50%, -4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  visibility: hidden;
  width: 300px;
  z-index: 45;
}

.instruction-bubble::before {
  background: var(--primary-dark);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  content: "";
  height: 10px;
  left: 50%;
  position: absolute;
  top: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
}

.heading-info-button.active .instruction-bubble {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  visibility: visible;
}

@media (max-width: 1180px) {
  .time-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .assignment-toggle-grid,
  .assignment-readonly-grid,
  .job-time-worker-grid,
  .pay-stub-grid,
  .payroll-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-payment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-time-edit-form {
    grid-template-columns: 1fr;
  }

  .settings-preview-grid,
  .pricing-formula-steps,
  .settings-metric-grid,
  .source-layout {
    grid-template-columns: 1fr;
  }

  .settings-hero {
    align-items: stretch;
    display: grid;
  }

  .settings-actions {
    justify-content: stretch;
  }

  .settings-actions .secondary-button {
    justify-content: center;
    width: 100%;
  }

  .payroll-payment-form label.wide {
    grid-column: 1 / -1;
  }

  .payroll-payment-form button {
    grid-column: 1 / -1;
  }

  .employee-timeclock-main {
    grid-template-columns: 1fr;
  }

  .job-time-worker-card {
    grid-template-columns: 1fr;
  }

  .routing-shell,
  .route-job-grid {
    grid-template-columns: 1fr;
  }

  .compact-assignment-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #timecardManager .manager-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-summary-grid,
  .job-time-grid,
  .active-worker-card,
  .payroll-period-banner,
  .employee-clock-meta,
  .employee-view-banner,
  .assignment-toggle-grid,
  .assignment-readonly-grid,
  .job-time-worker-grid,
  .pay-stub-grid,
  .payroll-summary-cards,
  .payroll-payment-form {
    grid-template-columns: 1fr;
  }

  .time-member-picker,
  .payroll-current-user,
  .time-member-picker select,
  .timecard-toolbar,
  .route-planner-controls,
  .route-filter-group,
  .time-action-stack {
    width: 100%;
  }

  .timecard-toolbar {
    align-items: stretch;
    display: grid;
    gap: 10px;
  }

  .route-planner-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .route-filter-group {
    justify-content: stretch;
  }

  .route-filter {
    flex: 1 1 110px;
    justify-content: center;
  }

  .time-action-stack {
    justify-content: stretch;
  }

  .time-action-stack button {
    flex: 1 1 100%;
  }

  .payroll-payment-form label.wide,
  .payroll-payment-form button {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  #timecardManager .manager-metrics {
    grid-template-columns: 1fr;
  }
}

input::placeholder,
textarea::placeholder {
  color: #7b8495;
  font-weight: 400;
  opacity: 1;
}

/* Button refinement pass */
.primary-button,
.secondary-button,
.ghost-button,
.map-action,
.payment-link-button,
.photo-capture-button {
  border-radius: 7px;
  font-family: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 750;
  gap: 6px;
  letter-spacing: 0;
  min-height: 34px;
  padding: 0 11px;
}

.primary-button i,
.secondary-button i,
.ghost-button i,
.map-action i,
.payment-link-button i,
.photo-capture-button i {
  font-size: 12px;
}

.primary-button {
  box-shadow: 0 1px 0 rgba(11, 31, 63, 0.04), inset 0 -1px 0 rgba(11, 31, 63, 0.08);
}

.secondary-button,
.ghost-button,
.map-action,
.payment-link-button {
  background: #fff;
  border-color: var(--line);
  color: var(--primary-dark);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.map-action:hover,
.payment-link-button:hover,
.photo-capture-button:hover {
  box-shadow: 0 6px 14px rgba(11, 31, 63, 0.08);
  transform: translateY(-1px);
}

.photo-capture-actions {
  gap: 7px;
}

.photo-capture-button {
  min-width: 0;
  padding: 0 12px;
}

.manager-action-row button,
.section-heading-row .primary-button,
.section-heading-row .secondary-button,
.section-heading-row .ghost-button,
.action-row .primary-button,
.action-row .secondary-button,
.action-row .ghost-button {
  min-height: 34px;
}

.compact-row-button {
  min-height: 30px;
  padding: 5px 9px;
}

/* Workflow usability pass */
.manager-panel {
  border-color: rgba(202, 210, 223, 0.82);
}

.manager-metric {
  min-height: 78px;
}

.manager-metric strong {
  letter-spacing: 0;
}

.status-group {
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.status-group:hover {
  border-color: color-mix(in srgb, var(--group-accent, var(--primary)) 14%, var(--line));
  box-shadow: 0 12px 28px rgba(11, 31, 63, 0.055);
}

.record-table tbody tr {
  position: relative;
}

.record-table tbody tr:hover,
.record-table tbody tr.selected-row {
  box-shadow: none;
}

.record-table td:first-child {
  font-weight: 500;
}

.table-contact-single,
.table-map-link {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  line-height: 1.25;
}

.mini-contact-actions a,
.quick-action-strip button,
.manager-action-row button,
.header-icon-button {
  touch-action: manipulation;
}

.process-record-header {
  box-shadow: 0 12px 34px rgba(11, 31, 63, 0.06);
}

.detail-section {
  border-color: rgba(202, 210, 223, 0.9);
}

.detail-section h4 {
  align-items: center;
  display: flex;
  gap: 8px;
}

.detail-section h4::before {
  background: var(--gold);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 9px;
  width: 9px;
}

@media (max-width: 980px) {
  .process-detail-toolbar {
    grid-template-columns: 1fr;
  }

  .workflow-steps {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .record-table th,
  .record-table td {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 640px) {
  .manager-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manager-metric {
    min-height: 72px;
    padding: 10px;
  }

  .status-group-heading {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }

  .workflow-steps {
    grid-template-columns: repeat(7, minmax(82px, 1fr));
  }
}

@media (min-width: 1321px) {
  .topbar.app-header {
    position: relative;
  }

  .topbar.app-header .topbar-tools {
    min-width: 0;
    position: static;
  }

  .topbar.app-header .global-search {
    left: 50%;
    min-width: 0;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 34vw);
    z-index: 4;
  }

  body:not(.public-document-mode) .global-search-results {
    left: 50%;
    right: auto;
    top: calc(50% + 34px);
    transform: translateX(-50%);
    width: min(520px, 34vw);
  }
}

.supabase-auth-shell {
  position: relative;
  z-index: 90;
}

.login-backdrop {
  align-items: center;
  background: rgba(11, 31, 63, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 120;
}

.login-panel {
  background: #fff;
  border: 1px solid rgba(202, 210, 223, 0.9);
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(11, 31, 63, 0.28);
  display: grid;
  gap: 14px;
  max-width: 420px;
  padding: 24px;
  width: min(100%, 420px);
}

.login-panel h2 {
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1.1;
  margin: 0;
}

.login-panel p,
.login-panel small {
  color: var(--muted);
  margin: 0;
}

.login-panel label {
  color: var(--ink);
  display: grid;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 6px;
}

.login-panel input {
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
}

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

.demo-login-grid button,
.live-data-banner button {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 9px 10px;
}

.demo-login-grid button.active {
  background: rgba(12, 56, 125, 0.1);
  border-color: rgba(12, 56, 125, 0.42);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(12, 56, 125, 0.12);
}

.auth-error {
  background: #fff1f2;
  border: 1px solid rgba(225, 29, 72, 0.24);
  border-radius: 6px;
  color: #9f1239;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 10px 12px;
}

.time-confirm-dialog {
  display: none;
  inset: 0;
  position: fixed;
  z-index: 140;
}

.time-confirm-dialog.active {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.time-confirm-backdrop {
  background: rgba(11, 31, 63, 0.46);
  inset: 0;
  position: absolute;
}

.time-confirm-card {
  background: #fff;
  border: 1px solid rgba(202, 210, 223, 0.9);
  border-radius: 8px;
  box-shadow: 0 28px 86px rgba(11, 31, 63, 0.32);
  display: grid;
  gap: 14px;
  max-width: 440px;
  padding: 22px;
  position: relative;
  width: min(100%, 440px);
}

.time-confirm-icon {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 8px;
  color: #08714f;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.time-confirm-card h3 {
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.1;
  margin: 0 0 8px;
}

.time-confirm-card p,
.time-confirm-card small {
  color: var(--muted);
  display: block;
  line-height: 1.45;
  margin: 0;
}

.time-confirm-card p:not(.eyebrow) {
  color: var(--ink);
  font-weight: 800;
}

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

.live-form-message {
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 800;
  margin-top: 10px;
  padding: 10px 12px;
}

.live-form-message.error {
  background: #fff1f2;
  border: 1px solid rgba(225, 29, 72, 0.24);
  color: #9f1239;
}

.live-form-message.success {
  background: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, 0.24);
  color: #065f46;
}

.primary-button.is-loading,
.secondary-button.is-loading {
  cursor: wait;
  opacity: 0.72;
}

.live-data-banner {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 8px;
  bottom: 16px;
  box-shadow: 0 12px 32px rgba(11, 31, 63, 0.14);
  color: #065f46;
  display: flex;
  gap: 10px;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 80;
}

.live-data-banner.error {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.28);
  color: #9a3412;
}

.live-data-banner span {
  font-size: 0.85rem;
  font-weight: 800;
}

.test-readiness-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.test-readiness-heading {
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  padding-bottom: 12px;
}

.test-readiness-summary {
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px;
}

.test-readiness-summary.ready {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.24);
  color: #065f46;
}

.test-readiness-summary.blocked {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.24);
  color: #9a3412;
}

.test-readiness-summary strong,
.test-readiness-summary span {
  display: block;
}

.test-readiness-summary span {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.78;
}

.test-readiness-summary button {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 7px;
  padding: 9px 10px;
}

.test-scenario-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.test-scenario-card {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 12px;
  text-decoration: none;
}

.workflow-status-report {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(11, 31, 63, 0.05);
  display: grid;
  gap: 14px;
  margin-top: 6px;
  padding: 16px;
}

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

.workflow-status-report-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.workflow-status-report-card > div:first-child {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.workflow-status-report-card > div:first-child span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workflow-status-report-card strong {
  color: var(--primary-dark);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
}

.workflow-status-report-card p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.workflow-status-table-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.workflow-status-table-strip span {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
  padding: 5px 8px;
}

.workflow-status-table-strip b {
  color: var(--primary-dark);
  font-size: 12px;
}

.test-scenario-card.ready {
  background: #f8fcfb;
  border-color: rgba(16, 185, 129, 0.28);
}

.test-scenario-card.preview {
  background: #f8fafc;
  border-color: rgba(100, 116, 139, 0.24);
}

.test-scenario-card.missing {
  background: #fffaf5;
  border-color: rgba(234, 88, 12, 0.2);
}

.test-scenario-card strong {
  font-size: 0.95rem;
}

.test-scenario-card small,
.test-scenario-card em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
}

.scenario-state {
  align-items: center;
  color: #0c6b4f;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.test-scenario-card.missing .scenario-state {
  color: #9a3412;
}

.test-scenario-card.preview .scenario-state {
  color: #475569;
}

@media (max-width: 1180px) {
  .workflow-status-report-grid,
  .test-scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .demo-login-grid {
    grid-template-columns: 1fr;
  }

  .time-confirm-actions {
    flex-direction: column-reverse;
  }

  .time-confirm-actions button {
    width: 100%;
  }

  .test-readiness-summary {
    grid-template-columns: 1fr;
  }

  .workflow-status-report-grid,
  .test-scenario-grid {
    grid-template-columns: 1fr;
  }
}

/* Wave 8 UI/UX responsive polish: tighter desktop, intentional mobile */
body:not(.public-document-mode) {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:not(.public-document-mode) .workspace {
  max-width: 1920px;
}

body:not(.public-document-mode) .panel,
body:not(.public-document-mode) .status-group,
body:not(.public-document-mode) .detail-section,
body:not(.public-document-mode) .record-detail-page > section,
body:not(.public-document-mode) .topbar.app-header {
  border-color: rgba(203, 213, 225, 0.82);
  box-shadow: 0 12px 30px rgba(11, 31, 63, 0.055);
}

body:not(.public-document-mode) .panel-heading h3,
body:not(.public-document-mode) .status-group-heading h4,
body:not(.public-document-mode) .detail-section h4 {
  color: #12213a;
  font-weight: 750;
  letter-spacing: 0;
}

body:not(.public-document-mode) .eyebrow,
body:not(.public-document-mode) .header-kicker,
body:not(.public-document-mode) .record-table th,
body:not(.public-document-mode) .process-detail-table th,
body:not(.public-document-mode) .quote-review-table th {
  color: #7a8496;
  font-weight: 760;
  letter-spacing: 0.07em;
}

body:not(.public-document-mode) .manager-metrics {
  gap: 8px;
  margin-bottom: 12px;
}

body:not(.public-document-mode) .manager-metric {
  background: linear-gradient(180deg, #fff, #f8fafc);
  gap: 4px;
  min-height: 70px;
  padding: 11px 12px;
}

body:not(.public-document-mode) .manager-metric strong {
  color: #12213a;
  font-size: 22px;
  font-weight: 760;
}

body:not(.public-document-mode) .manager-metric span,
body:not(.public-document-mode) .manager-metric small {
  font-weight: 600;
}

body:not(.public-document-mode) .status-group {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  padding: 0;
}

body:not(.public-document-mode) .status-group-heading h4 {
  font-size: 16px;
}

body:not(.public-document-mode) .status-pill {
  font-size: 11px;
  font-weight: 760;
  min-height: 27px;
  padding: 5px 9px;
}

body:not(.public-document-mode) .record-table-wrap,
body:not(.public-document-mode) .process-detail-table-wrap,
body:not(.public-document-mode) .quote-review-table-wrap,
body:not(.public-document-mode) .proposal-line-table-wrap {
  background: #fff;
  border-color: rgba(203, 213, 225, 0.86);
  border-radius: 8px;
}

body:not(.public-document-mode) .status-group > .record-table-wrap,
body:not(.public-document-mode) .status-record-table-wrap {
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
}

body:not(.public-document-mode) .record-table {
  table-layout: fixed;
}

body:not(.public-document-mode) .record-table th,
body:not(.public-document-mode) .record-table td {
  padding: 10px 9px;
}

body:not(.public-document-mode) .record-table th {
  border-top: 0;
  background: #f8fafc;
  height: 36px;
  white-space: nowrap;
}

body:not(.public-document-mode) .record-table td {
  color: #293244;
  font-size: 13px;
  font-weight: 540;
}

body:not(.public-document-mode) .record-table tbody tr {
  background: #fff;
}

body:not(.public-document-mode) .record-table tbody tr:nth-child(even) {
  background: #fbfcfe;
}

body:not(.public-document-mode) .record-table tbody tr:hover,
body:not(.public-document-mode) .record-table tbody tr.selected-row {
  background: color-mix(in srgb, var(--group-accent, var(--primary)) 7%, #fff);
}

body:not(.public-document-mode) .table-primary-link {
  gap: 1px;
}

body:not(.public-document-mode) .table-primary-link strong {
  color: #17233a;
  font-family: "Noto Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 680;
  line-height: 1.25;
}

body:not(.public-document-mode) .table-primary-link span,
body:not(.public-document-mode) .table-primary-link .table-subline,
body:not(.public-document-mode) .record-table td span {
  color: #778196;
  font-size: 11.5px;
  font-weight: 560;
}

body:not(.public-document-mode) .record-card .assignment-avatar-strip,
body:not(.public-document-mode) .record-table td .assignment-avatar-strip {
  align-items: center;
  display: inline-flex;
}

body:not(.public-document-mode) .team-avatar,
body:not(.public-document-mode) .record-table td .team-avatar,
body:not(.public-document-mode) .table-primary-link .team-avatar,
body:not(.public-document-mode) .time-member-link .team-avatar {
  align-items: center;
  background: var(--team-color, var(--primary));
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
}

body:not(.public-document-mode) .team-avatar.small,
body:not(.public-document-mode) .record-table td .team-avatar.small,
body:not(.public-document-mode) .table-primary-link .team-avatar.small {
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

body:not(.public-document-mode) .team-avatar.tiny,
body:not(.public-document-mode) .record-table td .team-avatar.tiny {
  color: #fff;
  display: inline-flex;
  font-size: 9px;
  font-weight: 900;
  height: 24px;
  width: 24px;
}

body:not(.public-document-mode) .status-badge {
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 730;
  padding: 5px 8px;
}

body:not(.public-document-mode) .table-contact-single,
body:not(.public-document-mode) .table-map-link,
body:not(.public-document-mode) .map-action {
  font-size: 11.5px;
  font-weight: 690;
}

body:not(.public-document-mode) .detail-field strong,
body:not(.public-document-mode) .detail-field strong a,
body:not(.public-document-mode) .detail-field .table-contact-single,
body:not(.public-document-mode) .detail-field .table-map-link {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

/* Data typography pass: keep labels structured, make read-only CRM values regular weight. */
body:not(.public-document-mode) .record-table td,
body:not(.public-document-mode) .process-detail-table td,
body:not(.public-document-mode) .quote-review-table td {
  font-weight: 400;
}

body:not(.public-document-mode) .record-table td strong,
body:not(.public-document-mode) .process-detail-table td strong,
body:not(.public-document-mode) .quote-review-table td strong,
body:not(.public-document-mode) .table-primary-link strong,
body:not(.public-document-mode) .table-contact-single,
body:not(.public-document-mode) .table-map-link {
  font-family: "Noto Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
}

body:not(.public-document-mode) .detail-field strong,
body:not(.public-document-mode) .detail-field strong a,
body:not(.public-document-mode) .detail-field .table-contact-single,
body:not(.public-document-mode) .detail-field .table-map-link,
body:not(.public-document-mode) .consult-snapshot-field dd,
body:not(.public-document-mode) .consult-schedule-field dd,
body:not(.public-document-mode) .consult-snapshot-alert strong,
body:not(.public-document-mode) .quote-review-section > strong,
body:not(.public-document-mode) .quote-review-info strong,
body:not(.public-document-mode) .project-field b,
body:not(.public-document-mode) .opening-detail-card strong {
  font-family: "Noto Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
}

body:not(.public-document-mode) .record-table td span,
body:not(.public-document-mode) .process-detail-table td span,
body:not(.public-document-mode) .quote-review-table td span,
body:not(.public-document-mode) .table-primary-link span,
body:not(.public-document-mode) .table-primary-link .table-subline {
  font-weight: 400;
}

body:not(.public-document-mode) .topbar.app-header h2 {
  font-weight: 780;
}

@media (max-width: 1120px) {
  body:not(.public-document-mode) .manager-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.public-document-mode) .record-table-wrap,
  body:not(.public-document-mode) .process-detail-table-wrap,
  body:not(.public-document-mode) .quote-review-table-wrap {
    overflow-x: auto;
  }

  body:not(.public-document-mode) .record-table {
    min-width: 720px;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-bottom: 104px;
  }

  body:not(.public-document-mode) {
    background:
      linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%),
      var(--alt-bg);
  }

  body:not(.public-document-mode) .app-shell,
  body:not(.public-document-mode).nav-collapsed .app-shell {
    display: block;
    min-height: 100vh;
  }

  body:not(.public-document-mode) .sidebar,
  body:not(.public-document-mode).nav-collapsed .sidebar {
    background: rgba(11, 31, 63, 0.98);
    border-radius: 18px 18px 0 0;
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    bottom: 0;
    box-shadow: 0 -16px 44px rgba(11, 31, 63, 0.26);
    height: auto;
    left: 0;
    overflow: hidden;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    top: auto;
    z-index: 110;
  }

  body:not(.public-document-mode) .brand-lockup,
  body:not(.public-document-mode).nav-collapsed .brand-lockup {
    display: none;
  }

  body:not(.public-document-mode) .nav-tabs,
  body:not(.public-document-mode).nav-collapsed .nav-tabs {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
    justify-content: flex-start;
    max-height: 64px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 2px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    width: 100%;
  }

  body:not(.public-document-mode) .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  body:not(.public-document-mode) .nav-tab,
  body:not(.public-document-mode).nav-collapsed .nav-tab {
    align-content: center;
    background: transparent;
    border: 0;
    border-radius: 14px;
    box-shadow: none;
    display: grid;
    flex: 0 0 62px;
    gap: 4px;
    height: 58px;
    justify-items: center;
    min-height: 58px;
    padding: 7px 4px 6px;
    scroll-snap-align: center;
    transform: none;
    width: 62px;
  }

  body:not(.public-document-mode) .nav-tab::before,
  body:not(.public-document-mode) .nav-tab span::before {
    display: none;
  }

  body:not(.public-document-mode) .nav-tab i,
  body:not(.public-document-mode).nav-collapsed .nav-tab i {
    color: rgba(253, 197, 27, 0.88);
    font-size: 17px;
  }

  body:not(.public-document-mode) .nav-tab span,
  body:not(.public-document-mode).nav-collapsed .nav-tab span {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: rgba(234, 245, 239, 0.74);
    display: block;
    font-size: 10px;
    font-weight: 740;
    left: auto;
    line-height: 1.05;
    max-width: 58px;
    opacity: 1;
    overflow: hidden;
    padding: 0;
    pointer-events: auto;
    position: static;
    text-align: center;
    text-overflow: ellipsis;
    top: auto;
    transform: none;
    visibility: visible;
    white-space: nowrap;
  }

  body:not(.public-document-mode) .nav-tab.active,
  body:not(.public-document-mode) .nav-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(253, 197, 27, 0.25);
    transform: none;
  }

  body:not(.public-document-mode) .nav-tab.active i,
  body:not(.public-document-mode) .nav-tab.active span {
    color: #fff;
  }

  body:not(.public-document-mode) .workspace {
    padding: 10px 10px calc(100px + env(safe-area-inset-bottom));
  }

  body:not(.public-document-mode) .topbar.app-header {
    background: #fff;
    border-radius: 0 0 8px 8px;
    gap: 10px;
    margin: -10px -10px 12px;
    padding: 12px 10px 10px;
    position: sticky;
    top: 0;
    z-index: 50;
  }

  body:not(.public-document-mode) .topbar.app-header h2 {
    font-size: 22px;
  }

  body:not(.public-document-mode) .header-title-block {
    gap: 4px;
  }

  body:not(.public-document-mode) .context-row {
    display: none;
  }

  body:not(.public-document-mode) .topbar.app-header .topbar-tools {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body:not(.public-document-mode) .header-quick-actions {
    display: none;
  }

  body:not(.public-document-mode) .user-profile-button {
    border-radius: 999px;
    gap: 0;
    justify-content: center;
    min-height: 42px;
    padding: 3px;
    width: 42px;
  }

  body:not(.public-document-mode) .profile-copy,
  body:not(.public-document-mode) .user-profile-button > i {
    display: none;
  }

  body:not(.public-document-mode) .manager-panel,
  body:not(.public-document-mode) .panel,
  body:not(.public-document-mode) .status-group,
  body:not(.public-document-mode) .detail-section,
  body:not(.public-document-mode) .record-detail-page > section {
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(11, 31, 63, 0.055);
  }

  body:not(.public-document-mode) .manager-metrics {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.public-document-mode) .manager-metric {
    min-height: 66px;
    padding: 10px;
  }

  body:not(.public-document-mode) .manager-metric i {
    display: none;
  }

  body:not(.public-document-mode) .manager-metric strong {
    font-size: 19px;
  }

  body:not(.public-document-mode) .manager-metric span,
  body:not(.public-document-mode) .manager-metric small {
    font-size: 11px;
    line-height: 1.25;
  }

  body:not(.public-document-mode) .status-group-list {
    gap: 12px;
  }

  body:not(.public-document-mode) .status-group {
    padding: 0;
  }

  body:not(.public-document-mode) .status-group-heading h4 {
    font-size: 15px;
  }

  body:not(.public-document-mode) .record-table-wrap,
  body:not(.public-document-mode) .process-detail-table-wrap,
  body:not(.public-document-mode) .quote-review-table-wrap,
  body:not(.public-document-mode) .proposal-line-table-wrap,
  body:not(.public-document-mode) .compact-table-wrap,
  body:not(.public-document-mode) .table-wrap {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  body:not(.public-document-mode) .record-table,
  body:not(.public-document-mode) .record-table tbody,
  body:not(.public-document-mode) .record-table tr,
  body:not(.public-document-mode) .record-table td,
  body:not(.public-document-mode) .process-detail-table,
  body:not(.public-document-mode) .process-detail-table tbody,
  body:not(.public-document-mode) .process-detail-table tr,
  body:not(.public-document-mode) .process-detail-table td,
  body:not(.public-document-mode) .quote-review-table,
  body:not(.public-document-mode) .quote-review-table tbody,
  body:not(.public-document-mode) .quote-review-table tr,
  body:not(.public-document-mode) .quote-review-table td,
  body:not(.public-document-mode) .compact-table,
  body:not(.public-document-mode) .compact-table tbody,
  body:not(.public-document-mode) .compact-table tr,
  body:not(.public-document-mode) .compact-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  body:not(.public-document-mode) .record-table colgroup,
  body:not(.public-document-mode) .record-table thead,
  body:not(.public-document-mode) .process-detail-table colgroup,
  body:not(.public-document-mode) .process-detail-table thead,
  body:not(.public-document-mode) .quote-review-table colgroup,
  body:not(.public-document-mode) .quote-review-table thead,
  body:not(.public-document-mode) .compact-table colgroup,
  body:not(.public-document-mode) .compact-table thead {
    display: none;
  }

  body:not(.public-document-mode) .record-table tr,
  body:not(.public-document-mode) .process-detail-table tr,
  body:not(.public-document-mode) .quote-review-table tr,
  body:not(.public-document-mode) .compact-table tr {
    background: #fff;
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(11, 31, 63, 0.045);
    display: grid;
    gap: 9px;
    margin-bottom: 10px;
    padding: 11px;
  }

  body:not(.public-document-mode) .record-table td,
  body:not(.public-document-mode) .process-detail-table td,
  body:not(.public-document-mode) .quote-review-table td,
  body:not(.public-document-mode) .compact-table td {
    border: 0;
    color: #263247;
    display: grid;
    gap: 3px;
    line-height: 1.35;
    overflow-wrap: break-word;
    padding: 0;
    white-space: normal;
    word-break: normal;
  }

  body:not(.public-document-mode) .record-table td[data-label]::before,
  body:not(.public-document-mode) .process-detail-table td[data-label]::before,
  body:not(.public-document-mode) .quote-review-table td[data-label]::before,
  body:not(.public-document-mode) .compact-table td[data-label]::before {
    color: #7a8496;
    content: attr(data-label);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
  }

  body:not(.public-document-mode) .record-table td:first-child,
  body:not(.public-document-mode) .process-detail-table td:first-child,
  body:not(.public-document-mode) .quote-review-table td:first-child,
  body:not(.public-document-mode) .compact-table td:first-child {
    border-bottom: 1px solid rgba(203, 213, 225, 0.72);
    padding-bottom: 8px;
  }

  body:not(.public-document-mode) .table-primary-link strong {
    font-size: 14px;
  }

  body:not(.public-document-mode) .table-primary-link span,
  body:not(.public-document-mode) .table-primary-link .table-subline,
  body:not(.public-document-mode) .record-table td span {
    font-size: 12px;
  }

  body:not(.public-document-mode) .status-badge {
    justify-self: start;
    max-width: 100%;
  }

  body:not(.public-document-mode) .table-contact-single,
  body:not(.public-document-mode) .table-map-link,
  body:not(.public-document-mode) .map-action {
    justify-self: start;
    max-width: 100%;
  }

  body:not(.public-document-mode) .process-record-header {
    top: 0;
  }

  body:not(.public-document-mode) .workflow-steps {
    grid-template-columns: repeat(7, minmax(78px, 1fr));
  }

  body:not(.public-document-mode) .live-data-banner {
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 10px;
    max-width: calc(100vw - 20px);
    right: 10px;
    transform: none;
  }
}

/* Wave 9 mobile usability pass: remove sticky chrome, tighten bottom nav */
@media (max-width: 760px) {
  html {
    scroll-padding-top: 0;
    scroll-padding-bottom: calc(132px + env(safe-area-inset-bottom));
  }

  body:not(.public-document-mode) {
    overflow-x: hidden;
  }

  body:not(.public-document-mode) .workspace {
    padding: 8px 8px calc(132px + env(safe-area-inset-bottom));
  }

  body:not(.public-document-mode) .topbar.app-header,
  body:not(.public-document-mode) .process-record-header {
    position: static;
    top: auto;
    z-index: auto;
  }

  body:not(.public-document-mode) .topbar.app-header {
    border-radius: 10px;
    gap: 8px;
    margin: 0 0 10px;
    padding: 10px;
  }

  body:not(.public-document-mode) .topbar.app-header h2 {
    font-size: 20px;
    line-height: 1.05;
  }

  body:not(.public-document-mode) .topbar.app-header .topbar-tools {
    gap: 7px;
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  body:not(.public-document-mode) .topbar.app-header .global-search {
    min-height: 38px;
  }

  body:not(.public-document-mode) .sidebar,
  body:not(.public-document-mode).nav-collapsed .sidebar {
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 30px rgba(11, 31, 63, 0.22);
    contain: layout paint;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }

  body:not(.public-document-mode) .nav-tabs,
  body:not(.public-document-mode).nav-collapsed .nav-tabs {
    gap: 4px;
    max-height: 54px;
    overflow-y: hidden;
    padding: 0 1px;
  }

  body:not(.public-document-mode) .nav-tab,
  body:not(.public-document-mode).nav-collapsed .nav-tab {
    border-radius: 12px;
    flex: 0 0 48px;
    gap: 2px;
    height: 50px;
    min-height: 50px;
    padding: 6px 3px;
    width: 48px;
  }

  body:not(.public-document-mode) .nav-tab i,
  body:not(.public-document-mode).nav-collapsed .nav-tab i {
    font-size: 18px;
  }

body:not(.public-document-mode) .nav-tab span,
body:not(.public-document-mode).nav-collapsed .nav-tab span,
body:not(.public-document-mode) .nav-tab.active span,
body:not(.public-document-mode).nav-collapsed .nav-tab.active span {
    display: none;
  }

  body:not(.public-document-mode) .record-detail-page,
  body:not(.public-document-mode) .manager-panel,
  body:not(.public-document-mode) .panel,
  body:not(.public-document-mode) .status-group-list,
  body:not(.public-document-mode) .detail-section,
  body:not(.public-document-mode) .record-detail-page > section {
    gap: 10px;
  }

  body:not(.public-document-mode) .manager-panel:has(> .record-detail-page) {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  body:not(.public-document-mode) .manager-panel:has(> .record-detail-page) > .record-detail-page {
    width: 100%;
  }

  body:not(.public-document-mode) .manager-panel,
  body:not(.public-document-mode) .panel,
  body:not(.public-document-mode) .status-group,
  body:not(.public-document-mode) .detail-section,
  body:not(.public-document-mode) .process-record-header,
  body:not(.public-document-mode) .record-detail-page > section {
    border-radius: 10px;
    box-shadow: 0 5px 16px rgba(11, 31, 63, 0.05);
  }

  body:not(.public-document-mode) .manager-panel:not(:has(> .record-detail-page)),
  body:not(.public-document-mode) .panel,
  body:not(.public-document-mode) .detail-section,
  body:not(.public-document-mode) .record-detail-page > section {
    padding: 12px;
  }

  body:not(.public-document-mode) .process-record-header {
    padding: 10px;
  }

  body:not(.public-document-mode) .process-detail-toolbar {
    gap: 8px;
  }

  body:not(.public-document-mode) .mini-contact-card,
  body:not(.public-document-mode) .mini-status-card {
    min-width: 0;
    padding: 10px;
  }

  body:not(.public-document-mode) .mini-contact-topline {
    align-items: flex-start;
    gap: 6px;
  }

  body:not(.public-document-mode) .mini-contact-card strong {
    font-size: 16px;
    line-height: 1.15;
  }

  body:not(.public-document-mode) .mini-contact-card small,
  body:not(.public-document-mode) .mini-status-card label,
  body:not(.public-document-mode) .record-meta,
  body:not(.public-document-mode) .detail-field p {
    font-size: 12px;
    line-height: 1.3;
  }

  body:not(.public-document-mode) .mini-date-time {
    flex: 0 1 auto;
    font-size: 11px;
    justify-content: flex-start;
    max-width: 100%;
    white-space: normal;
  }

  body:not(.public-document-mode) .mini-contact-actions,
  body:not(.public-document-mode) .quick-action-strip,
  body:not(.public-document-mode) .section-actions,
  body:not(.public-document-mode) .manager-action-row {
    flex-wrap: wrap;
  }

  body:not(.public-document-mode) .lifecycle-progress {
    gap: 7px;
    grid-template-columns: minmax(0, auto) minmax(72px, 1fr) auto;
    min-height: 30px;
    padding: 5px 8px;
  }

  body:not(.public-document-mode) .workflow-current-chip {
    font-size: 11px;
    max-width: 36vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body:not(.public-document-mode) .workflow-current-chip i {
    flex-basis: 16px;
    font-size: 7px;
    height: 16px;
    width: 16px;
  }

  body:not(.public-document-mode) .workflow-step-count {
    font-size: 10px;
  }

  body:not(.public-document-mode) .lifecycle-history-item {
    align-items: start;
    grid-template-columns: 22px minmax(0, 1fr);
  }

  body:not(.public-document-mode) .lifecycle-history-item em {
    grid-column: 2;
    grid-row: 1;
  }

  body:not(.public-document-mode) .lifecycle-history-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-top: 1px;
  }

  body:not(.public-document-mode) .lifecycle-history-item div,
  body:not(.public-document-mode) .lifecycle-history-item p {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  body:not(.public-document-mode) .lifecycle-history-item p {
    white-space: normal;
  }

  body:not(.public-document-mode) .workflow-track {
    height: 4px;
  }

  body:not(.public-document-mode) .workflow-steps {
    display: none;
  }

  body:not(.public-document-mode) .instruction-bubble {
    display: none;
  }

  body:not(.public-document-mode) .detail-grid,
  body:not(.public-document-mode) .contact-summary-grid,
  body:not(.public-document-mode) .record-edit-grid,
  body:not(.public-document-mode) .field-grid,
  body:not(.public-document-mode) .consult-session-grid,
  body:not(.public-document-mode) .opening-detail-grid {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .consult-snapshot-groups,
  body:not(.public-document-mode) .consult-schedule-groups,
  body:not(.public-document-mode) .record-summary-groups {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .consult-snapshot-field,
  body:not(.public-document-mode) .consult-schedule-field,
  body:not(.public-document-mode) .record-summary-field,
  body:not(.public-document-mode) .consult-snapshot-alert {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 9px 10px;
  }

  body:not(.public-document-mode) .manager-metrics {
    display: none;
  }

  body:not(.public-document-mode) .status-group {
    padding: 0;
  }

  body:not(.public-document-mode) .status-group-heading {
    align-items: start;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }

  body:not(.public-document-mode) .status-group-heading > :first-child {
    min-width: 0;
  }

  body:not(.public-document-mode) .status-group-heading h4 {
    line-height: 1.15;
  }

  body:not(.public-document-mode) .status-group-heading .status-pill {
    justify-self: end;
    max-width: 38vw;
    text-align: center;
    white-space: normal;
  }

  body:not(.public-document-mode) .section-heading-row {
    align-items: flex-start;
    gap: 8px;
  }

  body:not(.public-document-mode) .section-heading-row > :last-child {
    margin-left: 0;
  }

  body:not(.public-document-mode) .detail-field,
  body:not(.public-document-mode) .form-card,
  body:not(.public-document-mode) .metric-card,
  body:not(.public-document-mode) .manager-metric {
    min-width: 0;
    padding: 10px;
  }

  body:not(.public-document-mode) .record-table tr,
  body:not(.public-document-mode) .process-detail-table tr,
  body:not(.public-document-mode) .quote-review-table tr,
  body:not(.public-document-mode) .compact-table tr {
    gap: 6px;
    margin-bottom: 8px;
    padding: 10px;
  }

  body:not(.public-document-mode) .record-table td,
  body:not(.public-document-mode) .process-detail-table td,
  body:not(.public-document-mode) .quote-review-table td,
  body:not(.public-document-mode) .compact-table td {
    min-width: 0;
  }

  body:not(.public-document-mode) .record-table td:not(:first-child)[data-label],
  body:not(.public-document-mode) .process-detail-table td:not(:first-child)[data-label],
  body:not(.public-document-mode) .quote-review-table td:not(:first-child)[data-label],
  body:not(.public-document-mode) .compact-table td:not(:first-child)[data-label] {
    align-items: start;
    column-gap: 8px;
    grid-template-columns: minmax(76px, 34%) minmax(0, 1fr);
  }

  body:not(.public-document-mode) .record-table td:not(:first-child)[data-label]::before,
  body:not(.public-document-mode) .process-detail-table td:not(:first-child)[data-label]::before,
  body:not(.public-document-mode) .quote-review-table td:not(:first-child)[data-label]::before,
  body:not(.public-document-mode) .compact-table td:not(:first-child)[data-label]::before {
    padding-top: 2px;
  }

  body:not(.public-document-mode) .table-primary-link,
  body:not(.public-document-mode) .table-contact-single,
  body:not(.public-document-mode) .table-map-link,
  body:not(.public-document-mode) .map-action,
  body:not(.public-document-mode) .status-badge {
    min-width: 0;
    white-space: normal;
  }

  body:not(.public-document-mode) .record-table td > *,
  body:not(.public-document-mode) .process-detail-table td > *,
  body:not(.public-document-mode) .quote-review-table td > *,
  body:not(.public-document-mode) .compact-table td > * {
    max-width: 100%;
  }

  body:not(.public-document-mode) input,
  body:not(.public-document-mode) select,
  body:not(.public-document-mode) textarea,
  body:not(.public-document-mode) button,
  body:not(.public-document-mode) .primary-button,
  body:not(.public-document-mode) .secondary-button,
  body:not(.public-document-mode) .ghost-button {
    max-width: 100%;
  }

  body:not(.public-document-mode) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  body:not(.public-document-mode) select,
  body:not(.public-document-mode) textarea {
    width: 100%;
  }

  body:not(.public-document-mode) .field-grid label,
  body:not(.public-document-mode) .record-edit-grid label,
  body:not(.public-document-mode) .installer-closeout-grid label,
  body:not(.public-document-mode) .quote-size-inputs label,
  body:not(.public-document-mode) .payment-entry-form label {
    min-width: 0;
  }

  body:not(.public-document-mode) .quote-size-inputs,
  body:not(.public-document-mode) .time-entry-grid,
  body:not(.public-document-mode) .routing-layout,
  body:not(.public-document-mode) .routing-content,
  body:not(.public-document-mode) .install-gallery-strip,
  body:not(.public-document-mode) .install-gallery-cards {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .quote-financials,
  body:not(.public-document-mode) .customer-quote-preview,
  body:not(.public-document-mode) .quote-line-card,
  body:not(.public-document-mode) .quote-review-card,
  body:not(.public-document-mode) .customer-quote-lines article,
  body:not(.public-document-mode) .installer-closeout,
  body:not(.public-document-mode) .ob-checklist,
  body:not(.public-document-mode) .customer-invoice-packet,
  body:not(.public-document-mode) .service-payment-section,
  body:not(.public-document-mode) .partial-payment-section {
    gap: 10px;
  }

  body:not(.public-document-mode) .quote-financial-header,
  body:not(.public-document-mode) .quote-tool-header,
  body:not(.public-document-mode) .quote-line-head,
  body:not(.public-document-mode) .quote-review-card-head,
  body:not(.public-document-mode) .quote-review-row-main,
  body:not(.public-document-mode) .quote-markup-panel,
  body:not(.public-document-mode) .customer-quote-lines article,
  body:not(.public-document-mode) .proposal-title-row,
  body:not(.public-document-mode) .proposal-section-head {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .quote-review-card-body,
  body:not(.public-document-mode) .quote-review-info-grid,
  body:not(.public-document-mode) .quote-markup-controls,
  body:not(.public-document-mode) .quote-review-trace div {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .quote-review-inline-size {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.public-document-mode) .quote-markup-actions {
    justify-self: stretch;
  }

  body:not(.public-document-mode) .quote-markup-actions .secondary-button {
    width: 100%;
  }

  body:not(.public-document-mode) .order-pdf-preview-head {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .order-pdf-frame {
    height: 68vh;
    min-height: 420px;
  }

  body:not(.public-document-mode) .quote-review-price-strip {
    justify-content: stretch;
  }

  body:not(.public-document-mode) .quote-review-price {
    flex: 1 1 130px;
  }

  body:not(.public-document-mode) .quote-preview-total {
    font-size: 24px;
    text-align: left;
  }

  body:not(.public-document-mode) .installer-signoff-summary,
  body:not(.public-document-mode) .ob-checklist-grid {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .installer-signoff-summary,
  body:not(.public-document-mode) .ob-checklist,
  body:not(.public-document-mode) .checklist-row {
    padding: 10px;
  }

  body:not(.public-document-mode) .checklist-row {
    min-height: 34px;
  }

  body:not(.public-document-mode) .install-gallery-track {
    max-width: 100%;
    min-width: 0;
    padding-bottom: 6px;
    width: 100%;
  }

  body:not(.public-document-mode) .install-gallery-card {
    flex-basis: min(78vw, 300px);
  }

  body:not(.public-document-mode) .quote-review-table input,
  body:not(.public-document-mode) .quote-review-table select,
  body:not(.public-document-mode) .quote-review-table textarea {
    width: 100%;
  }

  body:not(.public-document-mode) .live-data-banner {
    align-items: center;
    bottom: calc(66px + env(safe-area-inset-bottom));
    font-size: 12px;
    gap: 6px;
    left: auto;
    max-width: min(230px, calc(100vw - 24px));
    min-height: 40px;
    padding: 7px 8px;
    right: 10px;
    transform: none;
    white-space: normal;
    width: auto;
  }

  body:not(.public-document-mode) .live-data-banner span {
    line-height: 1.25;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.public-document-mode) .live-data-banner button {
    min-height: 30px;
    padding: 0 8px;
  }
}

@media (max-width: 1120px) {
  .calendar-layout,
  .hq-dashboard-grid,
  .field-dashboard-grid,
  .role-queue-grid,
  .resource-hero,
  .resource-step-list.compact,
  .resource-card-grid,
  .email-resource-header,
  .email-connection-fields,
  .email-token-row {
    grid-template-columns: 1fr;
  }

  .email-resource-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .calendar-agenda-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .calendar-hero,
  .role-dashboard-hero,
  .calendar-toolbar {
    align-items: stretch;
    display: grid;
    gap: 12px;
  }

  .role-dashboard-hero .secondary-button {
    justify-content: center;
    width: 100%;
  }

  .calendar-layout {
    display: block;
  }

  .calendar-shell,
  .calendar-weekdays,
  .calendar-grid {
    display: none;
  }

  .calendar-agenda-panel {
    border-radius: 8px;
    box-shadow: none;
    padding: 12px;
  }

  .calendar-agenda-panel h4 {
    font-size: 22px;
  }

  .calendar-agenda-list {
    display: grid;
    gap: 8px;
  }

  .calendar-agenda-item strong {
    white-space: normal;
  }

  .calendar-agenda-item {
    align-items: center;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    min-height: 76px;
    padding: 11px;
  }

  .calendar-agenda-item small,
  .calendar-agenda-item em {
    white-space: normal;
  }

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

  .resource-hero,
  .email-resource-header,
  .resource-section,
  .resource-alert,
  .resource-mini-card {
    padding: 12px;
  }

  .email-resource-header h3,
  .resource-hero h3 {
    font-size: 27px;
  }

  .email-template-top {
    grid-template-columns: 1fr;
  }

  .resource-step {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 10px;
  }

  .resource-step > span {
    height: 30px;
    width: 30px;
  }
}

@media (max-width: 520px) {
  #workbench #businessStats.stat-grid {
    grid-template-columns: 1fr;
  }

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

  .hq-task-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .hq-task-meta {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }
}

@media (min-width: 761px) {
  body:not(.public-document-mode) .nav-tabs,
  body:not(.public-document-mode).nav-collapsed .nav-tabs {
    gap: 8px;
  }

  body:not(.public-document-mode) .nav-tab,
  body:not(.public-document-mode).nav-collapsed .nav-tab {
    align-content: center;
    display: grid;
    gap: 5px;
    grid-template-columns: 1fr;
    height: 58px;
    justify-items: center;
    min-height: 58px;
    padding: 7px 4px 6px;
    width: 62px;
  }

  body:not(.public-document-mode) .nav-tab i,
  body:not(.public-document-mode).nav-collapsed .nav-tab i {
    font-size: 17px;
    line-height: 1;
  }

  body:not(.public-document-mode) .nav-tab span,
  body:not(.public-document-mode).nav-collapsed .nav-tab span,
  body:not(.public-document-mode) .nav-tab.active span,
  body:not(.public-document-mode).nav-collapsed .nav-tab.active span {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #fff;
    display: block;
    font-size: 9px;
    font-weight: 800;
    left: auto;
    letter-spacing: 0;
    line-height: 1.05;
    max-width: 58px;
    opacity: 1;
    overflow: hidden;
    padding: 0;
    pointer-events: auto;
    position: static;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: none;
    top: auto;
    transform: none;
    visibility: visible;
    white-space: nowrap;
  }

  body:not(.public-document-mode) .nav-tab:hover span,
  body:not(.public-document-mode) .nav-tab:focus-visible span,
  body:not(.public-document-mode).nav-collapsed .nav-tab:hover span,
  body:not(.public-document-mode).nav-collapsed .nav-tab:focus-visible span {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #fff;
    opacity: 1;
    transform: none;
    visibility: visible;
  }

  body:not(.public-document-mode) .nav-tab span::before,
  body:not(.public-document-mode).nav-collapsed .nav-tab span::before {
    display: none;
  }
}

.install-scheduler-section {
  border-left: 4px solid var(--gold);
}

.install-scheduler-page .process-record-header {
  margin-bottom: 14px;
}

.install-scheduler-page .install-scheduler-section {
  display: grid;
  gap: 16px;
}

.install-scheduler-page .manager-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.install-scheduler-grid {
  align-items: start;
}

.install-scheduler-grid label {
  min-width: 0;
}

.install-scheduler-simple {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.install-approval-panel {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.install-approval-panel span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.install-approval-panel strong {
  color: var(--primary-dark);
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.install-approval-panel p {
  color: var(--muted);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.35;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.public-appointment-notes {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
}

.public-appointment-notes p {
  color: var(--text);
  margin: 0;
}

.install-scheduler-grid .confirmation-toggle {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: inline-grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  justify-self: start;
  max-width: 380px;
  min-height: 52px;
  padding: 10px 12px;
}

.install-scheduler-grid .confirmation-toggle input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.install-scheduler-grid .toggle-control {
  background: #d8dee8;
  border-radius: 999px;
  display: inline-flex;
  height: 24px;
  position: relative;
  transition: background 160ms ease;
  width: 42px;
}

.install-scheduler-grid .toggle-control::after {
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(11, 31, 63, 0.24);
  content: "";
  height: 18px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 160ms ease;
  width: 18px;
}

.install-scheduler-grid .confirmation-toggle input:checked + .toggle-control {
  background: var(--primary);
}

.install-scheduler-grid .confirmation-toggle input:checked + .toggle-control::after {
  transform: translateX(18px);
}

.install-scheduler-grid .confirmation-toggle input:focus-visible + .toggle-control {
  outline: 3px solid color-mix(in srgb, var(--primary) 25%, transparent);
  outline-offset: 2px;
}

.install-scheduler-grid .toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.install-scheduler-grid .toggle-copy strong {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.install-scheduler-grid .toggle-copy small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

@media (max-width: 900px) {
  .install-scheduler-page .manager-metrics,
  .install-scheduler-simple,
  .install-approval-panel {
    grid-template-columns: 1fr;
  }

  .install-approval-panel .action-row {
    justify-content: flex-start;
  }
}
.quote-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.quote-pricing-review-header {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(260px, 360px);
  justify-content: start;
}

.quote-pricing-review-header > div:first-child {
  min-width: 0;
}

.quote-pricing-option-control {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  min-width: 0;
}

.quote-pricing-option-control select {
  min-width: 240px;
  width: min(360px, 34vw);
}

.quote-option-card,
.public-option-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.quote-option-card.selected,
.quote-option-card.approved,
.public-option-card.selected,
.public-option-card.approved {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(12, 56, 125, 0.18);
}

.public-option-card.selected {
  background: #f7fbff;
}

.quote-option-card-head,
.public-option-head,
.public-option-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.quote-option-card-head span,
.public-option-head span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quote-option-card-head h5,
.public-option-head h5 {
  margin: 4px 0;
  font-size: 1rem;
}

.quote-option-card-head p,
.public-option-head p,
.public-option-footer span {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.quote-option-card-head strong,
.public-option-head strong {
  white-space: nowrap;
  font-size: 1.12rem;
}

.quote-option-meta {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.quote-option-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.proposal-options-public {
  display: grid;
  gap: 18px;
}

.public-option-list {
  display: grid;
  gap: 16px;
}

.public-option-card {
  display: grid;
  gap: 14px;
}

.public-option-selector {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 0;
}

.public-option-selector input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.public-option-selector strong,
.public-option-selector small {
  display: block;
}

.public-option-selector strong {
  color: var(--primary-dark);
  font-size: 0.92rem;
}

.public-option-selector small {
  color: var(--muted);
  font-size: 0.8rem;
}

.public-option-selector input:checked + .agreement-check-box {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.public-option-selector input:checked + .agreement-check-box i {
  opacity: 1;
  transform: scale(1);
}

.proposal-line-table-wrap.compact {
  margin-top: 0;
}

@media (max-width: 760px) {
  .quote-pricing-review-header {
    align-items: stretch;
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .quote-pricing-option-control {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-pricing-option-control select {
    min-width: 0;
    width: 100%;
  }

  .quote-option-card-head,
  .public-option-head,
  .public-option-footer,
  .quote-option-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-option-card-head strong,
  .public-option-head strong {
    white-space: normal;
  }
}

/* Typography system cleanup */
body:not(.public-document-mode) {
  color: var(--type-body-color);
  font-family: var(--font-body);
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
  line-height: var(--type-line-body);
}

body:not(.public-document-mode) :is(button, input, select, textarea) {
  font-family: var(--font-body);
}

body:not(.public-document-mode) :is(p, li, dd, td, input, select, textarea) {
  color: var(--type-body-color);
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
  line-height: var(--type-line-body);
}

body:not(.public-document-mode) :is(
  .topbar.app-header h2,
  .detail-page-header h3,
  .proposal-title-row h3,
  .calendar-hero h3,
  .role-dashboard-hero h3,
  .email-resource-header h3,
  .resource-hero h3
) {
  color: var(--type-heading-color);
  font-family: var(--font-heading);
  font-size: var(--type-page-title);
  font-weight: var(--weight-heavy);
  letter-spacing: 0;
  line-height: var(--type-line-tight);
}

body:not(.public-document-mode) :is(
  .panel-heading h3,
  .manager-header h3,
  .command-hero h3,
  .calendar-agenda-panel h4,
  .resource-section-head h4
) {
  color: var(--type-heading-color);
  font-family: var(--font-heading);
  font-size: var(--type-section-title);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1.25;
}

body:not(.public-document-mode) :is(
  .detail-section h4,
  .process-workbench-section h4,
  .proposal-section-head h4,
  .proposal-decision-card h4,
  .status-group-heading h4,
  .queue-heading h3
) {
  color: var(--type-heading-color);
  font-family: var(--font-heading);
  font-size: var(--type-subsection-title);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1.25;
}

body:not(.public-document-mode) :is(
  .quote-option-card-head h5,
  .public-option-head h5,
  .email-template-card h5,
  .consult-capture-heading h5,
  .consult-opening-title h5,
  .nested-contact-heading h5,
  .job-level-items h5,
  .ob-checklist h5,
  .photo-capture-step h5,
  .team-card h4,
  .quote-tool-header h4,
  .quote-financial-header h4,
  .consult-snapshot-group h5,
  .consult-schedule-group h5,
  .record-summary-group h5
) {
  color: var(--type-heading-color);
  font-family: var(--font-heading);
  font-size: var(--type-card-title);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1.25;
}

body:not(.public-document-mode) :is(
  .eyebrow,
  .header-kicker,
  .status-group-heading span:not(.status-pill),
  .field-grid label,
  label > span,
  .quote-review-kicker,
  .quote-size-inputs label,
  .resource-section-head span,
  .email-resource-header span,
  .payroll-payment-form label span,
  .payroll-time-edit-form label span,
  .manager-metric span,
  .manager-metric small,
  .consult-snapshot-field dt,
  .consult-schedule-field dt,
  .record-summary-field dt
) {
  color: var(--type-label-color);
  font-family: var(--font-body);
  font-size: var(--type-label);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

body:not(.public-document-mode) :is(
  .manager-header p:not(.eyebrow),
  .detail-section p,
  .panel-heading p,
  .resource-section-head p,
  .email-resource-header p,
  .quote-option-card-head p,
  .public-option-head p,
  .public-option-footer span,
  .public-option-selector small,
  .install-scheduler-grid .toggle-copy small
) {
  color: var(--type-muted-color);
  font-family: var(--font-body);
  font-size: var(--type-caption);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  line-height: var(--type-line-body);
}

body:not(.public-document-mode) :is(.manager-metric strong) {
  color: var(--type-heading-color);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1;
}

body:not(.public-document-mode) :is(
  .record-table th,
  .process-detail-table th,
  .proposal-line-table th,
  .quote-review-table th,
  .compact-table th
) {
  color: var(--type-label-color);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

body:not(.public-document-mode) :is(
  .record-table td,
  .process-detail-table td,
  .proposal-line-table td,
  .quote-review-table td,
  .compact-table td
) {
  color: var(--type-body-color);
  font-family: var(--font-body);
  font-size: var(--type-table);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
  line-height: 1.35;
}

body:not(.public-document-mode) :is(
  .table-primary-link strong,
  .record-table td strong,
  .public-option-selector strong,
  .install-scheduler-grid .toggle-copy strong
) {
  color: var(--type-heading-color);
  font-family: var(--font-body);
  font-size: var(--type-table);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  line-height: 1.25;
}

body:not(.public-document-mode) :is(.consult-snapshot-field dd, .consult-schedule-field dd, .record-summary-field dd) {
  color: var(--type-body-color);
  font-family: var(--font-body);
  font-size: var(--type-table);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  line-height: 1.3;
}

body:not(.public-document-mode) :is(
  .table-primary-link span,
  .table-primary-link .table-subline,
  .record-table td span,
  .team-primary-link .team-member-copy small,
  .calendar-agenda-item small,
  .calendar-agenda-item em
) {
  color: var(--type-muted-color);
  font-family: var(--font-body);
  font-size: var(--type-caption);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  line-height: 1.25;
}

body:not(.public-document-mode) :is(
  .primary-button,
  .secondary-button,
  .ghost-button,
  .payment-link-button,
  .header-icon-button,
  .map-action,
  .photo-capture-button,
  .filter-pill,
  .ai-prompt-chips button,
  .global-search-results button
) {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1.2;
}

body:not(.public-document-mode) :is(.nav-tab span) {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1.05;
}

body:not(.public-document-mode) :is(
  .status-pill,
  .status-badge,
  .status-select,
  .route-popup-type,
  .quote-option-card-head span,
  .public-option-head span
) {
  font-family: var(--font-body);
  font-size: var(--type-chip);
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

body:not(.public-document-mode) :is(input, select, textarea) {
  color: var(--type-body-color);
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
}

body:not(.public-document-mode) :is(input::placeholder, textarea::placeholder) {
  color: var(--type-muted-color);
  font-weight: var(--weight-regular);
}

@media (max-width: 760px) {
  body:not(.public-document-mode) {
    font-size: 13px;
  }

  body:not(.public-document-mode) :is(
    .topbar.app-header h2,
    .detail-page-header h3,
    .proposal-title-row h3,
    .calendar-hero h3,
    .role-dashboard-hero h3,
    .email-resource-header h3,
    .resource-hero h3
  ) {
    font-size: var(--type-page-title-mobile);
  }

  body:not(.public-document-mode) :is(
    .panel-heading h3,
    .manager-header h3,
    .command-hero h3,
    .calendar-agenda-panel h4,
    .resource-section-head h4
  ) {
    font-size: 17px;
  }
}

/* Mobile production pass: shared CRM ergonomics without changing desktop layout */
@media (max-width: 760px) {
  body:not(.public-document-mode) {
    --mobile-page-gutter: 10px;
    --mobile-bottom-nav: 70px;
    min-width: 0;
  }

  body:not(.public-document-mode) .workspace {
    padding: var(--mobile-page-gutter) var(--mobile-page-gutter) calc(var(--mobile-bottom-nav) + 22px + env(safe-area-inset-bottom));
  }

  body:not(.public-document-mode) .topbar.app-header {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    margin: 0 0 10px;
    padding: 11px;
  }

  body:not(.public-document-mode) .header-title-block {
    min-width: 0;
  }

  body:not(.public-document-mode) .topbar.app-header h2 {
    font-size: 21px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body:not(.public-document-mode) .topbar.app-header .topbar-tools {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 42px;
    width: 100%;
  }

  body:not(.public-document-mode) .global-search {
    min-width: 0;
    width: 100%;
  }

  body:not(.public-document-mode) .global-search input {
    min-width: 0;
    text-overflow: ellipsis;
  }

  body:not(.public-document-mode) .global-search-results {
    left: 0;
    max-height: min(68vh, 420px);
    overflow-y: auto;
    right: 0;
    width: auto;
  }

  body:not(.public-document-mode) .tools-menu-panel {
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(11, 31, 63, 0.24);
    max-height: min(70vh, 440px);
    min-width: min(260px, calc(100vw - 24px));
    overflow-y: auto;
    position: fixed;
    right: 12px;
    top: 78px;
    z-index: 160;
  }

  body:not(.public-document-mode) .tools-menu-panel::before {
    display: none;
  }

  body:not(.public-document-mode) .tools-menu-panel a {
    min-height: 46px;
  }

  body:not(.public-document-mode) .sidebar,
  body:not(.public-document-mode).nav-collapsed .sidebar {
    min-height: calc(var(--mobile-bottom-nav) + env(safe-area-inset-bottom));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  }

  body:not(.public-document-mode) .nav-tabs,
  body:not(.public-document-mode).nav-collapsed .nav-tabs {
    max-height: 56px;
  }

  body:not(.public-document-mode) .nav-tab,
  body:not(.public-document-mode).nav-collapsed .nav-tab {
    flex-basis: 50px;
    height: 52px;
    min-height: 52px;
    touch-action: manipulation;
    width: 50px;
  }

  body:not(.public-document-mode) .panel,
  body:not(.public-document-mode) .manager-panel,
  body:not(.public-document-mode) .detail-section,
  body:not(.public-document-mode) .record-detail-page > section,
  body:not(.public-document-mode) .status-group {
    max-width: 100%;
  }

  body:not(.public-document-mode) .record-detail-page {
    gap: 10px;
    min-width: 0;
  }

  body:not(.public-document-mode) .detail-page-header,
  body:not(.public-document-mode) .process-record-header,
  body:not(.public-document-mode) .detail-section,
  body:not(.public-document-mode) .panel,
  body:not(.public-document-mode) .manager-panel:not(:has(> .record-detail-page)),
  body:not(.public-document-mode) .record-detail-page > section {
    padding: 12px;
  }

  body:not(.public-document-mode) .detail-page-header h3,
  body:not(.public-document-mode) .settings-hero h3 {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  body:not(.public-document-mode) .process-detail-toolbar {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .mini-status-card {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  body:not(.public-document-mode) .status-card-heading,
  body:not(.public-document-mode) .mini-contact-topline,
  body:not(.public-document-mode) .section-heading-row,
  body:not(.public-document-mode) .consult-capture-heading,
  body:not(.public-document-mode) .settings-hero,
  body:not(.public-document-mode) .manager-header {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .mini-contact-actions,
  body:not(.public-document-mode) .quick-action-strip,
  body:not(.public-document-mode) .section-actions,
  body:not(.public-document-mode) .manager-action-row,
  body:not(.public-document-mode) .settings-actions,
  body:not(.public-document-mode) .photo-capture-actions,
  body:not(.public-document-mode) .payroll-time-edit-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
  }

  body:not(.public-document-mode) :is(.primary-button, .secondary-button, .ghost-button, .payment-link-button, .photo-capture-button),
  body:not(.public-document-mode) .quick-action-strip :is(button, a),
  body:not(.public-document-mode) .section-actions :is(button, a),
  body:not(.public-document-mode) .manager-action-row :is(button, a),
  body:not(.public-document-mode) .settings-actions :is(button, a) {
    justify-content: center;
    min-height: 44px;
    width: 100%;
  }

  body:not(.public-document-mode) .back-link,
  body:not(.public-document-mode) .header-icon-button,
  body:not(.public-document-mode) .icon-button {
    min-height: 42px;
  }

  body:not(.public-document-mode) input,
  body:not(.public-document-mode) select,
  body:not(.public-document-mode) textarea {
    font-size: 16px;
    min-height: 44px;
  }

  body:not(.public-document-mode) textarea {
    min-height: 96px;
  }

  body:not(.public-document-mode) label {
    min-width: 0;
  }

  body:not(.public-document-mode) .field-grid,
  body:not(.public-document-mode) .record-edit-grid,
  body:not(.public-document-mode) .detail-grid,
  body:not(.public-document-mode) .settings-preview-grid,
  body:not(.public-document-mode) .settings-card-grid,
  body:not(.public-document-mode) .payroll-grid,
  body:not(.public-document-mode) .payroll-payment-form,
  body:not(.public-document-mode) .payroll-time-edit-form,
  body:not(.public-document-mode) .team-profile-fields,
  body:not(.public-document-mode) .email-token-row,
  body:not(.public-document-mode) .email-connection-fields {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .record-table tr,
  body:not(.public-document-mode) .process-detail-table tr,
  body:not(.public-document-mode) .quote-review-table tr,
  body:not(.public-document-mode) .compact-table tr {
    border-radius: 10px;
    padding: 11px;
  }

  body:not(.public-document-mode) .record-table td:not(:first-child)[data-label],
  body:not(.public-document-mode) .process-detail-table td:not(:first-child)[data-label],
  body:not(.public-document-mode) .quote-review-table td:not(:first-child)[data-label],
  body:not(.public-document-mode) .compact-table td:not(:first-child)[data-label] {
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .table-primary-link,
  body:not(.public-document-mode) .team-primary-link {
    max-width: 100%;
    min-width: 0;
  }

  body:not(.public-document-mode) .consult-opening-row {
    gap: 10px;
    padding: 12px;
  }

  body:not(.public-document-mode) .consult-opening-title {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  body:not(.public-document-mode) .consult-opening-title .duplicate-opening-button {
    height: 42px;
    justify-self: end;
    width: 42px;
  }

  body:not(.public-document-mode) .measurement-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.public-document-mode) .measurement-grid label:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  body:not(.public-document-mode) .opening-media-capture,
  body:not(.public-document-mode) .photo-capture-step {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .media-upload-preview {
    padding: 10px;
  }

  body:not(.public-document-mode) .media-upload-preview-head {
    align-items: start;
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .media-upload-preview-strip article {
    flex-basis: min(64vw, 190px);
  }

  body:not(.public-document-mode) .media-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.public-document-mode) .media-lightbox {
    gap: 8px;
    padding: 10px;
  }

  body:not(.public-document-mode) .media-lightbox-header {
    align-items: start;
    gap: 10px;
  }

  body:not(.public-document-mode) .media-lightbox-header h3 {
    font-size: 18px;
  }

  body:not(.public-document-mode) .media-lightbox-stage {
    gap: 6px;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    padding: 0;
  }

  body:not(.public-document-mode) .media-lightbox-stage img,
  body:not(.public-document-mode) .media-lightbox-stage video {
    max-height: calc(100vh - 178px);
  }

  body:not(.public-document-mode) .media-lightbox-footer {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .quote-pricing-review-header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .quote-pricing-option-control {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body:not(.public-document-mode) .quote-pricing-option-control select {
    width: 100%;
  }

  body:not(.public-document-mode) .quote-review-price-strip,
  body:not(.public-document-mode) .quote-review-info-grid,
  body:not(.public-document-mode) .quote-markup-controls {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .quote-review-inline-size {
    grid-template-columns: 1fr 1fr;
  }

  body:not(.public-document-mode) .routing-map-card {
    padding: 10px;
  }

  body:not(.public-document-mode) .route-map,
  body:not(.public-document-mode) .google-route-map {
    min-height: min(72vh, 560px);
  }

  body:not(.public-document-mode) .route-map-info {
    max-width: min(240px, calc(100vw - 72px));
    min-width: min(210px, calc(100vw - 72px));
  }

  body:not(.public-document-mode) .route-popup-gallery {
    height: 98px;
  }

  body:not(.public-document-mode) .route-popup-actions {
    display: grid;
    gap: 7px;
    grid-template-columns: 1fr 1fr;
  }

  body:not(.public-document-mode) .route-popup-actions a {
    justify-content: center;
    padding: 0 8px;
  }

  body:not(.public-document-mode) .order-pdf-frame {
    height: 72vh;
    min-height: 360px;
  }

  body:not(.public-document-mode) .settings-hero {
    padding: 13px;
  }
}

@media (max-width: 420px) {
  body:not(.public-document-mode) {
    --mobile-page-gutter: 8px;
  }

  body:not(.public-document-mode) .topbar.app-header h2,
  body:not(.public-document-mode) .detail-page-header h3,
  body:not(.public-document-mode) .settings-hero h3 {
    font-size: 20px;
  }

  body:not(.public-document-mode) .measurement-grid,
  body:not(.public-document-mode) .quote-review-inline-size,
  body:not(.public-document-mode) .media-gallery-grid {
    grid-template-columns: 1fr;
  }

  body:not(.public-document-mode) .route-map,
  body:not(.public-document-mode) .google-route-map {
    min-height: 520px;
  }
}

/* Customer portal */
.customer-portal-page {
  display: grid;
  gap: 18px;
}

.customer-portal-hero {
  align-items: end;
  background:
    linear-gradient(135deg, #0b1f3f 0%, #0c387d 58%, #126b61 100%),
    url("assets/background-screen-transparent-25.png") center / cover no-repeat;
  border-radius: var(--radius);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  isolation: isolate;
  min-height: 178px;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

.customer-portal-hero::before {
  background:
    linear-gradient(90deg, rgba(6, 18, 38, 0.84) 0%, rgba(6, 18, 38, 0.5) 54%, rgba(6, 18, 38, 0.18) 100%),
    rgba(11, 31, 63, 0.22);
  content: "";
  inset: 0;
  position: absolute;
  z-index: -1;
}

.customer-portal-hero-copy {
  max-width: min(720px, 100%);
  min-width: 0;
}

.customer-portal-hero .eyebrow,
.customer-portal-hero p {
  color: rgba(255, 255, 255, 0.86);
}

.customer-portal-hero h3 {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: var(--type-page-title);
  line-height: 1.08;
  margin: 6px 0 8px;
  max-width: 18ch;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
}

.customer-portal-hero p {
  max-width: 64ch;
  overflow-wrap: anywhere;
}

.customer-portal-hero-status {
  align-self: start;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.customer-portal-overview {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-portal-overview article,
.customer-portal-column,
.customer-portal-projects {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.customer-portal-overview article {
  align-items: start;
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
}

.customer-portal-overview i,
.customer-portal-appointment i,
.customer-portal-action > i {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 50%;
  color: var(--primary);
  display: inline-grid;
  height: 34px;
  justify-items: center;
  width: 34px;
}

.customer-portal-overview span,
.customer-portal-appointment span,
.customer-portal-action small,
.customer-portal-project-list small,
.customer-portal-muted {
  color: var(--muted);
  font-size: var(--type-caption);
}

.customer-portal-overview strong {
  color: var(--ink);
  font-size: var(--type-card-title);
  line-height: 1.28;
}

.customer-portal-progress {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  padding: 18px;
}

.customer-portal-track {
  background: var(--line);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.customer-portal-track span {
  background: linear-gradient(90deg, var(--success), var(--gold));
  display: block;
  height: 100%;
  width: var(--portal-progress);
}

.customer-portal-steps {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.customer-portal-steps span {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 0;
  text-align: center;
}

.customer-portal-steps i {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-grid;
  height: 32px;
  justify-items: center;
  width: 32px;
}

.customer-portal-steps b {
  font-size: var(--type-caption);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

.customer-portal-steps .complete,
.customer-portal-steps .current {
  color: var(--ink);
}

.customer-portal-steps .complete i {
  background: rgba(17, 134, 96, 0.12);
  border-color: rgba(17, 134, 96, 0.28);
  color: var(--success);
}

.customer-portal-steps .current i {
  background: var(--gold-soft);
  border-color: rgba(253, 197, 27, 0.5);
  color: var(--primary-dark);
}

.customer-portal-main {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.customer-portal-column,
.customer-portal-projects {
  padding: 18px;
}

.customer-portal-action-list,
.customer-portal-appointments,
.customer-portal-project-list {
  display: grid;
  gap: 10px;
}

.customer-portal-action,
.customer-portal-project-list a {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  display: flex;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  text-decoration: none;
}

.customer-portal-action.primary {
  border-color: rgba(12, 56, 125, 0.26);
  box-shadow: inset 4px 0 0 var(--primary);
}

.customer-portal-action span,
.customer-portal-project-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.customer-portal-action strong,
.customer-portal-project-list strong {
  color: var(--ink);
  font-size: var(--type-card-title);
}

.customer-portal-appointment {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 4px 12px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 76px;
  padding: 12px;
}

.customer-portal-appointment i {
  grid-row: span 2;
}

.customer-portal-appointment strong {
  color: var(--ink);
  font-size: var(--type-card-title);
}

.customer-portal-project-list a {
  justify-content: space-between;
}

.customer-portal-project-list a.active {
  background: var(--surface-strong);
  border-color: var(--line-strong);
}

.customer-portal-project-list i {
  color: var(--muted);
}

@media (max-width: 860px) {
  .customer-portal-hero,
  .customer-portal-main {
    display: grid;
    grid-template-columns: 1fr;
  }

  .customer-portal-hero-status {
    justify-self: start;
  }

  .customer-portal-overview,
  .customer-portal-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .customer-portal-hero {
    min-height: 150px;
    padding: 18px;
  }

  .customer-portal-hero h3 {
    font-size: var(--type-page-title-mobile);
  }

  .customer-portal-overview,
  .customer-portal-steps {
    grid-template-columns: 1fr;
  }
}
