:root {
  --paper: #edf5ff;
  --surface: #ffffff;
  --surface-soft: #f6faff;
  --ink: #0c1730;
  --muted: #64748b;
  --line: #d6e3f3;
  --line-strong: #9fb7da;
  --accent: #0f5fe8;
  --accent-strong: #062b72;
  --accent-soft: #e8f2ff;
  --gold: #f59e0b;
  --gold-soft: #fff7e6;
  --teal: #0f9f98;
  --teal-soft: #e6fffb;
  --green: #1f9d55;
  --green-soft: #e8f8ef;
  --purple: #7651d1;
  --purple-soft: #f0ebff;
  --danger: #b8433d;
  --danger-soft: #fbe7e5;
  --charcoal: #071b3a;
  --shadow: 0 20px 44px rgba(21, 71, 138, 0.14);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbff 0%, var(--paper) 260px, #f4f8fd 100%);
  color: var(--ink);
  font-family:
    Aptos, "Segoe UI", Calibri, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.side-nav {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(46, 134, 255, 0.3), transparent 34%),
    linear-gradient(155deg, #07357f 0%, #071b3a 55%, #031127 100%),
    var(--charcoal);
  color: #f8f9fb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  margin-bottom: 32px;
}

.brand-icon {
  width: 66px;
  height: 66px;
  border-radius: var(--radius);
  background: #ffffff;
  object-fit: contain;
  padding: 1px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.24);
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #d1d5db;
  font-size: 13px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #e5e7eb;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(111, 178, 255, 0.52);
  background: linear-gradient(135deg, #0f6df2, #073c9c);
  box-shadow: 0 12px 24px rgba(4, 18, 37, 0.24);
  color: #ffffff;
}

.workspace {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 28px;
}

.workspace.dashboard-watermark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--dashboard-logo-watermark);
  background-position: center 260px;
  background-repeat: no-repeat;
  background-size: min(68vw, 960px) auto;
  opacity: 0.12;
  filter: grayscale(1) contrast(1.16);
  mix-blend-mode: multiply;
}

.workspace > * {
  position: relative;
  z-index: 1;
}

.workspace.dashboard-watermark .surface,
.workspace.dashboard-watermark .summary-card {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(3px);
}

.topbar,
.view-toolbar,
.builder-header,
.line-items-head,
.dialog-header,
.builder-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  align-items: flex-start;
  margin-bottom: 20px;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 220px;
}

.topbar h1,
.view-toolbar h2,
.builder-header h2,
.dialog-header h2,
.company-form h2 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.view-toolbar h2,
.builder-header h2,
.dialog-header h2 {
  font-size: 20px;
}

.line-items-head h3 {
  margin: 0;
  font-size: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.date-chip,
.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.date-chip {
  gap: 8px;
  padding: 0 12px;
  white-space: nowrap;
  font-weight: 800;
}

.user-chip {
  gap: 10px;
  padding: 5px 10px 5px 6px;
}

.user-chip .avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.user-chip strong,
.user-chip small {
  display: block;
  white-space: nowrap;
}

.user-chip small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.user-chip a {
  color: var(--accent-strong);
  text-decoration: none;
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: -6px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #e03232;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  flex: 1 1 260px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.summary-card {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.92)),
    var(--surface);
  box-shadow: 0 10px 26px rgba(21, 71, 138, 0.09);
}

.metric-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f7df1, #0b47a4);
  color: #ffffff;
  box-shadow: inset 0 -8px 18px rgba(3, 17, 38, 0.18), 0 12px 22px rgba(29, 94, 216, 0.22);
}

.metric-card.green .metric-icon {
  background: linear-gradient(135deg, #2bb673, #147a49);
}

.metric-card.purple .metric-icon {
  background: linear-gradient(135deg, #8c5cf6, #5936ad);
}

.metric-card.orange .metric-icon {
  background: linear-gradient(135deg, #ffb020, #d97706);
}

.metric-card.cyan .metric-icon {
  background: linear-gradient(135deg, #24b8c9, #0b7a9b);
}

.metric-card .trend-line {
  color: var(--green);
  font-weight: 800;
}

.summary-card .metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1;
}

.summary-card span:last-child {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.view-panel {
  display: block;
}

.view-toolbar {
  margin-bottom: 14px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 255, 0.94)),
    var(--surface);
  box-shadow: var(--shadow);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.dashboard-layout > * {
  min-width: 0;
}

.dashboard-panel,
.leaderboard-panel {
  padding: 18px;
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}

.pipeline-widget {
  grid-column: span 5;
}

.revenue-widget {
  grid-column: span 4;
}

.tasks-widget {
  grid-column: span 3;
}

.donut-panel {
  grid-column: span 3;
}

.activity-widget {
  grid-column: span 3;
}

.schedule-widget {
  grid-column: span 8;
}

.weather-widget {
  grid-column: span 4;
}

.leaderboard-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.view-toolbar.compact {
  align-items: flex-start;
  margin-bottom: 12px;
}

.dashboard-panel .view-toolbar {
  margin-bottom: 0;
}

.dashboard-panel .view-toolbar h2 {
  margin-top: 4px;
  line-height: 1.15;
}

.donut-panel .view-toolbar,
.weather-widget .view-toolbar {
  text-align: center;
}

.pipeline-overview {
  display: grid;
  gap: 16px;
  flex: 1;
  align-content: center;
}

.pipeline-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 0;
  min-height: 150px;
  align-items: stretch;
}

.pipeline-stage {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px 10px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
  color: #ffffff;
  text-align: center;
  box-shadow: inset 0 -18px 26px rgba(4, 18, 37, 0.12);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.pipeline-stage:hover {
  z-index: 2;
  filter: brightness(1.08);
  transform: translateY(-4px);
  box-shadow: inset 0 -18px 26px rgba(4, 18, 37, 0.12), 0 12px 22px rgba(20, 55, 95, 0.22);
}

.pipeline-stage:focus-visible {
  z-index: 3;
  outline: 3px solid #ffffff;
  outline-offset: -5px;
}

.pipeline-stage:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.pipeline-stage span {
  font-size: 12px;
  font-weight: 900;
}

.pipeline-stage strong {
  font-size: 24px;
  line-height: 1;
}

.pipeline-stage small {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.stage-0 {
  background: linear-gradient(135deg, #2f7df1, #1651bc);
}

.stage-1 {
  background: linear-gradient(135deg, #23a6d5, #0f789c);
}

.stage-2 {
  background: linear-gradient(135deg, #f3b341, #cf7d05);
}

.stage-3 {
  background: linear-gradient(135deg, #8b5cf6, #5a36ad);
}

.stage-4 {
  background: linear-gradient(135deg, #33b56f, #167743);
}

.stage-5 {
  background: linear-gradient(135deg, #0f9f98, #096b73);
}

.pipeline-total {
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.pipeline-total strong {
  color: var(--accent);
}

.lead-stage-filter-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
}

.lead-stage-filter-banner > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 10px;
}

.lead-stage-filter-banner small {
  grid-column: 2;
  color: var(--muted);
}

.lead-intake-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.stage-filter-control {
  display: grid;
  gap: 5px;
  min-width: 220px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage-filter-control select {
  min-height: 40px;
  padding: 8px 36px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.stage-filter-control select:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-soft);
}

.chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-legend i {
  width: 28px;
  border-top: 3px solid var(--accent);
}

.chart-legend .dash {
  border-top-style: dashed;
  border-color: var(--line-strong);
}

.revenue-chart svg {
  width: 100%;
  min-height: 230px;
  overflow: visible;
}

.chart-grid line {
  stroke: #dce7f7;
}

.this-period,
.last-period {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.this-period {
  stroke: var(--accent);
}

.last-period {
  stroke: var(--line-strong);
  stroke-dasharray: 6 6;
}

.data-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 3;
}

.chart-area {
  fill: rgba(29, 94, 216, 0.12);
}

.chart-labels {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.donut-widget {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  flex: 1;
}

.donut {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  place-items: center;
  gap: 2px;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: conic-gradient(var(--donut));
  box-shadow: 0 18px 34px rgba(21, 71, 138, 0.12);
}

.donut::after {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #f6faff);
  content: "";
}

.donut strong,
.donut span {
  position: relative;
  z-index: 1;
}

.donut strong {
  font-size: 24px;
}

.donut span {
  max-width: 70px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.donut-legend {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.donut-legend span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
}

.donut-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.donut-legend small {
  color: var(--muted);
}

.activity-list {
  display: grid;
  gap: 12px;
  flex: 1;
  align-content: start;
}

.activity-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.activity-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), #d7ecff);
  color: var(--accent);
}

.activity-item small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 12px;
}

.activity-item > span:not(.activity-icon) {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.schedule-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  flex: 1;
}

.schedule-card {
  display: grid;
  align-content: start;
  min-height: 86px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #f6faff);
  color: var(--ink);
  text-align: left;
}

.schedule-card:hover,
.schedule-card:focus-visible {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(29, 94, 216, 0.15);
}

.schedule-card span,
.schedule-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.schedule-card strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 13px;
}

.weather-card {
  display: grid;
  gap: 16px;
  height: 100%;
  min-height: 250px;
  padding: 2px;
}

.weather-card span,
.weather-card small {
  color: var(--muted);
}

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

.weather-head strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

.weather-head span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
}

.weather-refresh {
  color: var(--accent);
}

.weather-card.is-loading .weather-refresh [data-icon] {
  animation: spin 900ms linear infinite;
}

.weather-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px solid #d8e8fb;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(29, 94, 216, 0.13), rgba(15, 159, 152, 0.11)),
    #ffffff;
}

.weather-main strong {
  display: block;
  color: var(--accent-strong);
  font-size: 44px;
  line-height: 1;
}

.weather-main span:not(.weather-icon) {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-weight: 800;
}

.weather-icon {
  position: relative;
  width: 74px;
  height: 58px;
}

.weather-icon::before {
  position: absolute;
  top: 0;
  left: 6px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffc928;
  box-shadow: 0 0 0 9px rgba(255, 201, 40, 0.18);
  content: "";
}

.weather-icon::after {
  position: absolute;
  left: 16px;
  bottom: 7px;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  background: #c7dcff;
  box-shadow: -14px 3px 0 #e2eeff;
  content: "";
}

.weather-cloud::before,
.weather-fog::before {
  background: #dce7f7;
  box-shadow: 12px 4px 0 #c7d7ed;
}

.weather-rain::before,
.weather-storm::before,
.weather-snow::before {
  background: #bdd2ee;
  box-shadow: 14px 5px 0 #dce7f7;
}

.weather-rain::after,
.weather-storm::after {
  background:
    linear-gradient(90deg, transparent 0 24%, var(--accent) 24% 30%, transparent 30% 48%, var(--accent) 48% 54%, transparent 54% 72%, var(--accent) 72% 78%, transparent 78%);
  box-shadow: none;
  border-radius: 0;
  height: 26px;
  bottom: 0;
}

.weather-snow::after {
  background:
    radial-gradient(circle at 20% 50%, #69a8ff 0 4px, transparent 5px),
    radial-gradient(circle at 50% 75%, #69a8ff 0 4px, transparent 5px),
    radial-gradient(circle at 78% 45%, #69a8ff 0 4px, transparent 5px);
  box-shadow: none;
}

.weather-storm::after {
  background: linear-gradient(135deg, transparent 0 40%, #f59e0b 40% 58%, transparent 58%);
  height: 34px;
}

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

.weather-stats span {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 54px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.weather-stats strong {
  color: var(--ink);
  font-size: 13px;
}

.weather-days {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
  font-size: 12px;
}

.weather-days span {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 78px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  font-weight: 900;
}

.weather-days strong {
  color: var(--ink);
}

.weather-days small {
  font-size: 11px;
}

.weather-dot {
  display: inline-block;
  justify-self: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffc928;
  box-shadow: 8px 3px 0 #c7dcff;
}

.weather-dot.weather-cloud,
.weather-dot.weather-fog {
  background: #c7d7ed;
  box-shadow: 8px 3px 0 #e2e8f0;
}

.weather-dot.weather-rain,
.weather-dot.weather-storm {
  background: #69a8ff;
  box-shadow: 8px 3px 0 #c7d7ed;
}

.weather-dot.weather-snow {
  background: #e2eeff;
  box-shadow: 8px 3px 0 #69a8ff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.leaderboard-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.leaderboard-table {
  min-width: 680px;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

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

.lead-detail-header h2 {
  margin: 10px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.detail-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

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

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.lead-detail-surface {
  padding: 18px;
}

.detail-tabs {
  margin-bottom: 18px;
}

.lead-tab-panel {
  min-height: 260px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 18px;
}

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

.detail-grid h3,
.conversation-item h3 {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 13px;
  text-transform: uppercase;
}

.detail-grid p {
  margin: 7px 0 0;
  color: var(--ink);
}

.detail-notes {
  grid-column: 1 / -1;
}

.document-list,
.conversation-list,
/* ── Monthly calendar grid ───────────────────────────────── */

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 12px;
}

.cal-month-title {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.cal-day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.cal-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 4px 0;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  min-height: 64px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: default;
  transition: background 0.1s, border-color 0.1s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-day.cal-has-tasks {
  cursor: pointer;
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.cal-day.cal-has-tasks:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.cal-day.cal-today {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cal-day.cal-today .cal-day-num {
  background: var(--accent);
  color: #ffffff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day-empty {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.cal-task-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.cal-dot-pending { background: var(--accent); }
.cal-dot-done    { background: var(--green); }

.cal-task-count {
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
}

.cal-day-detail {
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-soft);
}

.cal-day-detail.hidden { display: none; }

.cal-day-detail-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}

/* ── Task list ───────────────────────────────────────────── */

.task-list,
.job-list {
  display: grid;
  gap: 10px;
}

.document-card,
.conversation-item,
.task-card,
.job-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.document-card strong,
.conversation-meta strong,
.job-card strong {
  display: block;
}

.document-card span,
.conversation-meta span,
.task-card span,
.job-card > div > span:not(.status-pill) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.job-card strong {
  margin-top: 8px;
  font-size: 16px;
}

.job-card p {
  margin: 8px 0 0;
}

.job-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 62%, #ffffff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}

.job-select-button,
.overview-job-link {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.job-select-button:hover strong,
.overview-job-link:hover strong,
.job-name-link:hover {
  color: var(--accent-strong);
}

.job-status-row,
.overview-job-link-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.job-select-address,
.overview-job-address,
.overview-job-open {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.overview-job-open {
  color: var(--accent-strong);
  font-weight: 800;
}

.job-name-link {
  font-weight: 800;
}

.compact-select {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.compact-select select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  text-transform: none;
}

.profit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.profit-cost-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}

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

.cost-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--surface-soft));
}

.cost-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.cost-card span:not(.status-pill),
.cost-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.cost-card p {
  margin: 8px 0 0;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding-top: 20px;
  color: var(--ink);
  font-weight: 800;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.document-category {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.project-number-pill,
.project-number-inline {
  display: inline-flex;
  width: fit-content;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.project-number-pill {
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
}

.payment-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-top: 12px;
}

.payment-progress-ring {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--payment-progress), #dce8f5 0);
  box-shadow: inset 0 0 0 1px rgba(15, 95, 232, 0.08);
}

.payment-progress-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
}

.payment-progress-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.payment-progress-copy {
  display: grid;
  gap: 2px;
}

.payment-progress-copy strong {
  font-size: 13px;
}

.payment-progress-copy span {
  color: var(--muted);
  font-size: 11px;
}

.payment-progress-compact .payment-progress-ring {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
}

.payment-progress-compact .payment-progress-ring::before {
  width: 38px;
  height: 38px;
}

.overview-project-payment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.overview-project-payment > .overview-job-link {
  min-width: 0;
  flex: 1;
}

.overview-project-payment:last-child {
  border-bottom: 0;
}

.document-upload-controls {
  display: flex;
  align-items: end;
  gap: 10px;
}

.document-upload-controls .compact-select {
  min-width: 190px;
}

.document-folder {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--category-color, var(--accent));
  border-radius: var(--radius);
  background: #ffffff;
}

.document-folder.is-inactive {
  opacity: 0.72;
}

.document-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.document-folder-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.document-folder-title h3 {
  margin: 0;
}

.document-folder-title span:not(.document-folder-icon) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.document-folder-icon,
.document-category-color {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--category-color, var(--accent)) 14%, white);
  color: var(--category-color, var(--accent));
}

.document-folder-icon svg,
.document-category-color svg {
  width: 20px;
  height: 20px;
}

.document-folder-files {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.document-folder-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.document-category-settings {
  margin-top: 18px;
  padding: 20px;
}

.section-description {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
}

.document-category-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 110px auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.document-category-create-form label,
.document-category-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.document-category-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.document-category-admin-row {
  display: grid;
  grid-template-columns: 24px 42px minmax(330px, 1fr) minmax(160px, auto) minmax(260px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.document-category-admin-row.is-inactive {
  background: var(--surface-soft);
}

.document-category-admin-row.is-dragging {
  opacity: 0.45;
}

.document-category-drag {
  color: var(--muted);
  font-size: 18px;
  cursor: grab;
  user-select: none;
}

.document-category-fields {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 120px 72px;
  gap: 8px;
}

.document-category-fields input,
.document-category-fields select,
.document-category-merge select {
  min-height: 38px;
}

.document-category-fields input[type="color"] {
  width: 100%;
  padding: 4px;
}

.document-category-meta {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
}

.document-category-meta strong {
  color: var(--ink);
  font-size: 12px;
}

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

.document-category-merge,
.category-order-buttons {
  display: flex;
  gap: 4px;
}

.document-category-merge select {
  max-width: 150px;
}

@media (max-width: 1180px) {
  .document-category-admin-row {
    grid-template-columns: 24px 42px minmax(280px, 1fr);
  }

  .document-category-meta,
  .document-category-actions {
    grid-column: 3;
  }

  .document-category-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .document-upload-controls,
  .document-category-create-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .document-category-admin-row {
    grid-template-columns: 24px 42px minmax(0, 1fr);
  }

  .document-category-fields,
  .document-category-meta,
  .document-category-actions {
    grid-column: 1 / -1;
  }

  .document-category-fields {
    grid-template-columns: 1fr 1fr 72px;
  }

  .document-card,
  .document-folder-header {
    align-items: stretch;
    flex-direction: column;
  }
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(420px, 1fr);
  gap: 18px;
  align-items: start;
}

.calendar-form-panel,
.calendar-list-panel {
  padding: 18px;
}

.task-card {
  align-items: center;
}

.task-card strong {
  display: block;
}

.task-card p {
  margin: 6px 0 0;
  color: var(--ink);
}

.task-card .row-actions {
  flex-wrap: wrap;
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}

.conversation-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.conversation-item {
  display: grid;
  grid-template-columns: 1fr auto;
}

.conversation-item p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.link-button {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.link-button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f3f8ff;
}

.segmented-control button {
  min-width: 90px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented-control button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(29, 94, 216, 0.18);
}

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

.pipeline-page-heading h2 {
  max-width: 760px;
  margin: 3px 0 6px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.pipeline-page-heading > div > p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.pipeline-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(15, 95, 232, 0.2);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pipeline-guide-badge svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
}

.pipeline-board {
  display: block;
  overflow: visible;
  padding-bottom: 8px;
}

.pipeline-command-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid rgba(83, 148, 255, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 0%, rgba(48, 170, 255, 0.34), transparent 34%),
    linear-gradient(130deg, #071b3a 0%, #07357f 58%, #0f5fe8 140%);
  color: #ffffff;
  box-shadow: 0 24px 52px rgba(6, 43, 114, 0.2);
}

.pipeline-command-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
}

.pipeline-command-copy > span:not(.pipeline-live-dot) {
  color: #a9cdfd;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pipeline-command-copy strong {
  grid-column: 2;
  font-size: 18px;
  line-height: 1.25;
}

.pipeline-live-dot {
  grid-row: 1 / 3;
  width: 12px;
  height: 12px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: #62e6ae;
  box-shadow: 0 0 0 0 rgba(98, 230, 174, 0.46);
  animation: pipelinePulse 2.2s ease-out infinite;
}

@keyframes pipelinePulse {
  70% { box-shadow: 0 0 0 10px rgba(98, 230, 174, 0); }
  100% { box-shadow: 0 0 0 0 rgba(98, 230, 174, 0); }
}

.pipeline-command-stats {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 0 0 auto;
}

.pipeline-command-stats span {
  display: grid;
  min-width: 116px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  color: #c9ddfb;
  font-size: 12px;
}

.pipeline-command-stats strong {
  color: #ffffff;
  font-size: 17px;
}

.pipeline-journey {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 1180px;
  margin: 30px auto 0;
}

.pipeline-playbook-stage {
  --stage-accent: var(--accent);
  --stage-soft: var(--accent-soft);
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

.pipeline-playbook-stage-2 { --stage-accent: var(--purple); --stage-soft: var(--purple-soft); }
.pipeline-playbook-stage-3 { --stage-accent: #d97706; --stage-soft: var(--gold-soft); }
.pipeline-playbook-stage-4 { --stage-accent: var(--teal); --stage-soft: var(--teal-soft); }
.pipeline-playbook-stage-5 { --stage-accent: var(--green); --stage-soft: var(--green-soft); }
.pipeline-playbook-stage-6 { --stage-accent: #075985; --stage-soft: #e7f7ff; }

.pipeline-stage-marker {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  width: 64px;
  height: 64px;
  margin-top: 26px;
  border: 5px solid #f4f8fd;
  border-radius: 20px;
  background: var(--stage-accent);
  color: #ffffff;
  box-shadow: 0 11px 24px color-mix(in srgb, var(--stage-accent) 30%, transparent);
  transform: rotate(-3deg);
}

.pipeline-playbook-stage:nth-child(even) .pipeline-stage-marker {
  transform: rotate(3deg);
}

.pipeline-stage-marker span {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--ink);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.pipeline-stage-marker i {
  display: flex;
  font-style: normal;
}

.pipeline-stage-marker svg {
  width: 27px;
  height: 27px;
  stroke: currentColor;
}

.pipeline-stage-card {
  position: relative;
  margin-bottom: 26px;
  padding: 22px 24px 24px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 23%, var(--line));
  border-left: 5px solid var(--stage-accent);
  border-radius: 16px;
  background:
    linear-gradient(105deg, var(--stage-soft) 0, rgba(255, 255, 255, 0.96) 34%, #ffffff 100%);
  box-shadow: 0 16px 36px rgba(36, 82, 137, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.pipeline-playbook-stage:nth-child(even) .pipeline-stage-card {
  transform: translateX(22px);
}

.pipeline-stage-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 21px 46px rgba(36, 82, 137, 0.16);
}

.pipeline-playbook-stage:nth-child(even) .pipeline-stage-card:hover {
  transform: translate(22px, -3px);
}

.pipeline-stage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.pipeline-stage-heading p {
  margin: 0 0 3px;
  color: var(--stage-accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.pipeline-stage-heading h3 {
  margin: 0;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pipeline-stage-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 25%, transparent);
  border-radius: 999px;
  background: #ffffff;
  color: var(--stage-accent);
  font-size: 12px;
  font-weight: 900;
}

.pipeline-stage-mission {
  max-width: 850px;
  margin: 10px 0 18px;
  color: #42526b;
  font-size: 15px;
}

.pipeline-stage-body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.8fr);
  gap: 22px;
  align-items: stretch;
}

.pipeline-stage-body h4 {
  margin: 0 0 9px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pipeline-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline-action-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: #26364f;
  font-size: 13px;
}

.pipeline-action-list li > span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: var(--stage-soft);
  color: var(--stage-accent);
}

.pipeline-action-list svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

.pipeline-stage-gate {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 15px 17px;
  border: 1px dashed color-mix(in srgb, var(--stage-accent) 38%, var(--line));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.pipeline-stage-gate > span:first-child {
  color: var(--stage-accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.pipeline-stage-gate strong {
  font-size: 13px;
  line-height: 1.35;
}

.pipeline-workspace-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin-top: 5px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: var(--stage-accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.pipeline-workspace-link:hover {
  filter: brightness(0.94);
}

.pipeline-workspace-link span {
  font-size: 18px;
  line-height: 1;
}

.pipeline-connector {
  position: absolute;
  z-index: 1;
  top: 83px;
  bottom: -4px;
  left: 31px;
  width: 3px;
  overflow: hidden;
  background: color-mix(in srgb, var(--stage-accent) 28%, var(--line));
}

.pipeline-connector span {
  display: block;
  width: 100%;
  height: 34%;
  background: linear-gradient(180deg, transparent, var(--stage-accent), transparent);
  animation: pipelineFlow 2.8s linear infinite;
}

@keyframes pipelineFlow {
  from { transform: translateY(-100%); }
  to { transform: translateY(310%); }
}

.pipeline-recovery-lane {
  display: grid;
  grid-template-columns: 58px minmax(240px, 1fr) minmax(420px, 1.4fr);
  align-items: center;
  gap: 18px;
  max-width: 1180px;
  margin: 2px auto 0;
  padding: 20px 22px;
  border: 1px solid #f1cf8e;
  border-radius: 16px;
  background: linear-gradient(105deg, #fff7e6, #ffffff 62%);
}

.pipeline-recovery-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fff0c7;
  color: #b45e06;
}

.pipeline-recovery-icon svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
}

.pipeline-recovery-lane h3 {
  margin: 1px 0 3px;
  font-size: 18px;
}

.pipeline-recovery-lane p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pipeline-recovery-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.pipeline-recovery-steps span {
  display: grid;
  align-content: center;
  min-height: 62px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #ffffff;
  color: #5b4630;
  font-size: 11px;
  font-weight: 700;
}

.pipeline-recovery-steps b {
  color: #b45e06;
  font-size: 16px;
}

.pipeline-recovery-steps .pipeline-lost-count {
  background: #fff1ef;
  color: var(--danger);
}

.pipeline-recovery-steps .pipeline-lost-count b {
  color: var(--danger);
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 10px;
}

.column-head h3 {
  margin: 0;
  font-size: 14px;
}

.count-pill,
.status-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

/* Colored status pills */
.pill-won   { background: var(--green-soft);  color: var(--green); }
.pill-lost  { background: #fef2f2;             color: var(--danger); }
.pill-sent  { background: var(--teal-soft);   color: var(--teal); }
.pill-inspection { background: var(--gold-soft); color: #92580a; }
.pill-contacted  { background: var(--purple-soft); color: var(--purple); }
.pill-new        { background: var(--accent-soft); color: var(--accent-strong); }
.pill-default    { background: var(--surface-soft); color: var(--muted); }

/* Avatar initials */
.lead-card-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.avatar-blue   { background: var(--accent-soft);  color: var(--accent-strong); }
.avatar-teal   { background: var(--teal-soft);    color: var(--teal); }
.avatar-purple { background: var(--purple-soft);  color: var(--purple); }
.avatar-amber  { background: var(--gold-soft);    color: #92580a; }
.avatar-coral  { background: #fef2f2;             color: var(--danger); }

/* Tappable phone/email links */
.tel-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.tel-link:hover { text-decoration: underline; }

/* Stale lead indicators */
.stale-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.stale-amber { background: var(--gold-soft);  color: #92580a; }
.stale-red   { background: #fef2f2;           color: var(--danger); }
.lead-card.stale-red   { border-color: #fca5a5; }
.lead-card.stale-amber { border-color: #fcd34d; }
.record-card.stale-red   { border-color: #fca5a5; }
.record-card.stale-amber { border-color: #fcd34d; }

/* Lead card avatar layout */
.lead-card header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.lead-card-header-text { flex: 1; min-width: 0; }
.lead-card-header-text h4 { margin: 0 0 2px; }
.lead-card-header-text p  { margin: 0; }

/* Record card top row */
.record-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

/* Lead detail overview redesign */
.overview-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.overview-hero-text { flex: 1; min-width: 0; }
.overview-stale-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.overview-stale-banner.stale-amber { background: var(--gold-soft); color: #92580a; }
.overview-stale-banner.stale-red   { background: #fef2f2; color: var(--danger); }
.overview-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.overview-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.overview-info-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.overview-info-label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.overview-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
}
.overview-info-row span:first-child { color: var(--muted); white-space: nowrap; }
.overview-notes {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

/* Estimate line item templates */
.template-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 4px;
}
.template-picker.hidden { display: none; }
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.template-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* Field hints */
.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* Review warning banner */
/* ── Square invoice styles ───────────────────────────────── */

.invoice-summary-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.invoice-summary-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invoice-summary-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.invoice-summary-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.invoice-poll-indicator {
  margin-left: auto;
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.invoice-paid {
  border-color: var(--green);
  background: var(--green-soft);
}

.invoice-delivery-note {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a5f;
  font-size: 12px;
  line-height: 1.4;
}

.invoice-delivery-note strong {
  color: #124b82;
}

/* ── Review warning banner ───────────────────────────────── */
.review-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--gold-soft);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  font-size: 13px;
  color: #92580a;
}

.lead-card {
  display: grid;
  gap: 10px;
  min-height: 166px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}

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

.lead-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.lead-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.record-grid,
.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.record-card,
.report-card {
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.record-card strong,
.report-card strong {
  display: block;
  font-size: 18px;
}

.record-card span:not(.status-pill):not(.type-pill),
.record-card p,
.report-card span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.record-card .row-actions {
  align-self: end;
}

.report-card.wide {
  grid-column: 1 / -1;
}

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

.contacts-surface {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

.person-cell strong {
  display: block;
}

.person-cell span,
.contact-lines span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.estimate-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 20px;
  align-items: start;
  margin-top: 16px;
}

.estimate-builder {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.estimate-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
}

.estimate-workspace-toolbar h2,
.estimate-workspace-toolbar p,
.estimate-create-panel h3,
.estimate-panel-heading h3 {
  margin: 0;
}

.estimate-workspace-toolbar > div:first-child > p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.estimate-workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.estimate-history-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 3px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 11px;
}

.estimate-create-panel,
.estimate-history-panel {
  margin-top: 12px;
  padding: 16px 18px;
}

.estimate-create-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  gap: 22px;
  align-items: end;
}

.estimate-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.estimate-panel-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.estimate-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 242px;
  margin-top: 12px;
  overflow: auto;
}

.estimate-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.estimate-list button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.estimate-create-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.estimate-create-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.estimate-list small {
  color: var(--muted);
}

.estimate-history-main,
.estimate-history-side {
  display: grid;
  gap: 4px;
}

.estimate-history-main {
  min-width: 0;
}

.estimate-history-main strong,
.estimate-history-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-history-side {
  justify-items: end;
  flex: 0 0 auto;
}

.estimate-active-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface-soft), #ffffff);
}

.estimate-active-summary h3,
.estimate-active-summary p {
  margin: 0;
}

.estimate-active-summary > div:first-child > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.estimate-active-meta {
  display: grid;
  justify-items: end;
  gap: 7px;
  flex: 0 0 auto;
}

.estimate-active-meta strong {
  font-size: 18px;
}

.estimate-form {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.estimate-form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.estimate-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.estimate-section-heading > span:first-child {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.estimate-section-heading strong,
.estimate-section-heading small {
  display: block;
}

.estimate-section-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.estimate-details {
  padding: 0;
}

.estimate-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.estimate-details summary::-webkit-details-marker {
  display: none;
}

.estimate-details-hint {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.estimate-details[open] .estimate-details-hint::after {
  content: "Less";
}

.estimate-details[open] .estimate-details-hint {
  font-size: 0;
}

.estimate-details[open] .estimate-details-hint::after {
  font-size: 11px;
}

.estimate-details-content {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.line-item-actions {
  display: flex;
  gap: 6px;
}

.estimate-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.estimate-action-bar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

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

.email-form {
  max-width: 820px;
}

.company-form h3 {
  margin: 8px 0 0;
  color: var(--accent-strong);
  font-size: 15px;
  text-transform: uppercase;
}

.logo-settings {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.logo-preview-frame {
  display: grid;
  place-items: center;
  width: 112px;
  height: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.logo-preview-frame img {
  max-width: 94px;
  max-height: 70px;
  object-fit: contain;
}

.logo-preview-frame img.logo-placeholder {
  opacity: 0.72;
}

.logo-settings-actions {
  display: grid;
  gap: 8px;
}

.logo-settings-actions span {
  color: var(--muted);
  font-size: 13px;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(17, 17, 17, 0.16);
}

.line-items {
  display: grid;
  gap: 8px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 72px 88px 36px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.line-item label {
  min-width: 0;
}

.line-item input {
  min-width: 0;
}

.line-item textarea {
  min-width: 0;
  min-height: 64px;
}

.line-item-title,
.line-item-description {
  grid-column: 1 / -1;
}

.builder-actions,
.dialog-actions {
  align-items: center;
  padding-top: 4px;
}

.builder-actions > div,
.dialog-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.builder-actions.end {
  justify-content: flex-end;
}

.estimate-stage {
  position: sticky;
  top: 24px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e9edf5;
}

.estimate-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.estimate-preview-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.estimate-preview-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.estimate-paper {
  width: min(100%, 880px);
  min-height: 1040px;
  margin: 0 auto;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  color: var(--ink);
}

/* ── Estimate preview ─────────────────────────────────────── */

.est-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}

.est-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  background: var(--ink);
  color: #ffffff;
  padding: 22px 24px 20px;
}

.est-header-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.est-logo {
  width: 52px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.doc-mark,
.est-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
}

.est-company-name {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.est-company-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
}

.est-header-meta {
  text-align: right;
  flex-shrink: 0;
}

.est-doc-label {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  line-height: 1;
}

.est-doc-num {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.est-doc-date {
  margin: 3px 0 0;
  font-size: 11px;
  color: #94a3b8;
}

.est-status-chip {
  display: inline-block;
  margin-top: 9px;
  padding: 3px 11px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.est-status-draft  { background: #334155; color: #cbd5e1; }
.est-status-sent   { background: #1d9e75; color: #e1f5ee; }
.est-status-approved { background: #1f9d55; color: #e8f8ef; }
.est-status-rejected { background: #b8433d; color: #fef2f2; }
.est-status-invoiced { background: #0f5fe8; color: #e8f2ff; }

.est-accent-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 100%);
}

.est-body {
  padding: 20px 24px;
  background: var(--surface);
}

.est-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.est-info-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.est-info-label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.est-info-name {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.est-info-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.est-info-rep {
  margin: 10px 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.est-scope-block {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.est-scope-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

.est-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}

.est-table th {
  padding: 8px 10px;
  border-bottom: 2px solid var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  text-align: left;
}

.est-th-r { text-align: right; }

.est-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.est-td-r   { text-align: right; white-space: nowrap; }
.est-td-muted { color: var(--muted); }
.est-td-amt { text-align: right; white-space: nowrap; font-weight: 700; color: var(--ink); }

.est-item-title {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.est-item-desc {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.est-totals-block {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.est-totals-inner {
  min-width: 280px;
}

.est-total-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.est-total-grand {
  border-top: 2px solid var(--ink);
  border-bottom: none;
  padding-top: 10px;
  margin-top: 3px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.est-total-balance {
  border-bottom: none;
  padding-top: 5px;
  font-size: 12px;
}

.est-notes-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--surface-soft);
}

.est-notes-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

.est-sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 8px;
}

.est-sig-line {
  padding-top: 28px;
  border-top: 1px solid var(--ink);
  font-size: 11px;
  color: var(--muted);
}

.est-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 24px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

/* ── Legacy doc-* kept for PDF helpers only ───────────────── */

.doc-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
}

.doc-logo {
  width: 52px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

.estimate-footer {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 0 14px;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(29, 94, 216, 0.16);
}

.primary-button:hover {
  background: linear-gradient(135deg, #2f7df1, var(--accent-strong));
}

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

.secondary-button:hover {
  background: var(--accent-soft);
}

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

.ghost-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.ghost-button.danger {
  border-color: #efc7c3;
  color: var(--danger);
}

.ghost-button.danger:hover {
  background: var(--danger-soft);
}

.icon-button,
.mini-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-strong);
}

.mini-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

[data-icon] svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.contact-dialog {
  width: min(760px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.contact-dialog::backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.contact-dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.company-form {
  display: grid;
  gap: 14px;
  max-width: 860px;
  padding: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 86px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--charcoal);
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

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

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(246, 250, 255, 0.7);
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.vault-unlock {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  align-content: center;
  gap: 28px;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 42%, rgba(54, 135, 255, 0.2), transparent 30%),
    radial-gradient(circle at 50% 115%, rgba(41, 211, 145, 0.1), transparent 35%),
    #070a0f;
  color: #f7fbff;
  text-align: center;
}

.vault-entry-pending body {
  overflow: hidden;
  background: #070a0f;
}

.vault-entry-pending .vault-unlock {
  display: grid;
}

.vault-entry-pending .app-shell {
  visibility: hidden;
}

.vault-entry-pending.vault-entry-revealing .app-shell {
  visibility: visible;
  animation: dashboard-unlock-enter 450ms ease-out both;
}

.vault-glow {
  position: absolute;
  width: min(720px, 92vw);
  aspect-ratio: 1;
  border: 1px solid rgba(117, 177, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 110px rgba(47, 124, 255, 0.16),
    inset 0 0 110px rgba(47, 124, 255, 0.08);
  opacity: 0.75;
}

.vault-glow::before,
.vault-glow::after {
  position: absolute;
  inset: 11%;
  border: 1px solid rgba(117, 177, 255, 0.09);
  border-radius: inherit;
  content: "";
}

.vault-glow::after {
  inset: 22%;
}

.vault-scene {
  position: relative;
  width: min(310px, 72vw);
  aspect-ratio: 1;
  perspective: 1200px;
}

.vault-frame {
  position: absolute;
  inset: 0;
  border: 14px solid #222a35;
  border-radius: 50%;
  background: #080b10;
  box-shadow:
    0 0 0 2px #536070,
    0 0 0 8px #121821,
    0 30px 70px rgba(0, 0, 0, 0.65),
    inset 0 0 45px rgba(0, 0, 0, 0.9);
  transform-style: preserve-3d;
}

.vault-interior {
  position: absolute;
  inset: 9%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px solid rgba(56, 237, 166, 0.38);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(41, 211, 145, 0.2), transparent 56%),
    #060d0d;
  box-shadow: inset 0 0 55px rgba(41, 211, 145, 0.16);
  color: #80f0c4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.vault-interior img {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 22px rgba(41, 211, 145, 0.44));
}

.vault-door {
  position: absolute;
  inset: 2%;
  border: 3px solid #707c8d;
  border-radius: 50%;
  background: #303946;
  box-shadow:
    inset 0 0 0 6px #171d25,
    inset 0 0 0 8px #566273,
    0 10px 26px rgba(0, 0, 0, 0.55);
  transform-origin: 4% 50%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.vault-door-face {
  position: absolute;
  inset: 10%;
  border: 2px solid #758294;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    linear-gradient(145deg, #4b5665, #202832 58%, #3a4553);
  box-shadow:
    inset 8px 8px 22px rgba(255, 255, 255, 0.07),
    inset -12px -14px 24px rgba(0, 0, 0, 0.32);
}

.vault-door-face::before {
  position: absolute;
  inset: 7%;
  border: 1px dashed rgba(216, 228, 244, 0.22);
  border-radius: inherit;
  content: "";
}

.vault-dial {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  border: 7px solid #9eabb9;
  border-radius: 50%;
  background: radial-gradient(circle, #18202a 0 32%, #566170 34% 40%, #252e39 42% 100%);
  box-shadow:
    0 7px 14px rgba(0, 0, 0, 0.5),
    inset 2px 3px 5px rgba(255, 255, 255, 0.18);
}

.vault-spoke {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 142px;
  margin: -71px 0 0 -5px;
  border-radius: 8px;
  background: linear-gradient(90deg, #697686, #d4dde6 48%, #657181);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.4);
}

.vault-spoke-two {
  transform: rotate(60deg);
}

.vault-spoke-three {
  transform: rotate(120deg);
}

.vault-dial-hub {
  position: absolute;
  inset: 32%;
  z-index: 2;
  border: 3px solid #c0cbd5;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #aebac6, #414c59 68%);
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.55);
}

.vault-bolt {
  position: absolute;
  z-index: 3;
  border: 2px solid #b1bdc9;
  border-radius: 7px;
  background: linear-gradient(90deg, #5c6877, #d1dae2 52%, #667282);
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.45);
}

.vault-bolt-top,
.vault-bolt-bottom {
  left: calc(50% - 8px);
  width: 16px;
  height: 42px;
}

.vault-bolt-left,
.vault-bolt-right {
  top: calc(50% - 8px);
  width: 42px;
  height: 16px;
}

.vault-bolt-top {
  top: -15px;
  --bolt-x: 0;
  --bolt-y: 26px;
}

.vault-bolt-right {
  right: -15px;
  --bolt-x: -26px;
  --bolt-y: 0;
}

.vault-bolt-bottom {
  bottom: -15px;
  --bolt-x: 0;
  --bolt-y: -26px;
}

.vault-bolt-left {
  left: -15px;
  --bolt-x: 26px;
  --bolt-y: 0;
}

.vault-security-mark {
  position: absolute;
  bottom: 19%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(224, 234, 244, 0.2);
  border-radius: 999px;
  background: rgba(8, 12, 17, 0.44);
  color: #d9e2eb;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.vault-security-mark span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f4b942;
  box-shadow: 0 0 9px rgba(244, 185, 66, 0.65);
}

.vault-unlock-copy {
  position: relative;
  width: min(340px, 80vw);
}

.vault-unlock-copy p {
  margin: 0 0 7px;
  color: #70e1b5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.vault-unlock-copy h1 {
  margin: 0;
  color: #f7fbff;
  font-size: clamp(22px, 4vw, 32px);
  letter-spacing: -0.025em;
}

.vault-progress {
  height: 3px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.vault-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3687ff, #58ddb0);
  box-shadow: 0 0 12px rgba(88, 221, 176, 0.5);
}

.vault-unlock.is-active .vault-dial {
  animation: vault-dial-turn 1.35s cubic-bezier(0.36, 0.1, 0.18, 1) forwards;
}

.vault-unlock.is-active .vault-bolt {
  animation: vault-bolt-retract 360ms ease-in 1.25s forwards;
}

.vault-unlock.is-active .vault-security-mark span {
  animation: vault-status-secure 200ms ease-out 1.48s forwards;
}

.vault-unlock.is-active .vault-door {
  animation: vault-door-open 1.05s cubic-bezier(0.4, 0, 0.14, 1) 1.65s forwards;
}

.vault-unlock.is-active .vault-interior img,
.vault-unlock.is-active .vault-interior span {
  animation: vault-access-reveal 400ms ease-out 1.82s both;
}

.vault-unlock.is-active .vault-progress span {
  animation: vault-progress-fill 2.75s cubic-bezier(0.2, 0.65, 0.3, 1) forwards;
}

.vault-unlock.is-complete {
  animation: vault-overlay-exit 450ms ease-in forwards;
}

@keyframes vault-dial-turn {
  0% { transform: rotate(0); }
  48% { transform: rotate(440deg); }
  72% { transform: rotate(330deg); }
  100% { transform: rotate(360deg); }
}

@keyframes vault-bolt-retract {
  to {
    opacity: 0.45;
    transform: translate(var(--bolt-x), var(--bolt-y));
  }
}

@keyframes vault-status-secure {
  to {
    background: #58ddb0;
    box-shadow: 0 0 12px rgba(88, 221, 176, 0.9);
  }
}

@keyframes vault-door-open {
  0% { transform: rotateY(0) translateX(0); }
  100% { transform: rotateY(-105deg) translateX(-7%); }
}

@keyframes vault-access-reveal {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes vault-progress-fill {
  0% { width: 0; }
  58% { width: 68%; }
  100% { width: 100%; }
}

@keyframes vault-overlay-exit {
  to { opacity: 0; transform: scale(1.025); }
}

@keyframes dashboard-unlock-enter {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .vault-unlock.is-active .vault-dial,
  .vault-unlock.is-active .vault-bolt,
  .vault-unlock.is-active .vault-security-mark span,
  .vault-unlock.is-active .vault-door,
  .vault-unlock.is-active .vault-interior img,
  .vault-unlock.is-active .vault-interior span,
  .vault-unlock.is-active .vault-progress span {
    animation-duration: 300ms;
    animation-delay: 0ms;
  }

  .vault-unlock.is-active .vault-door {
    animation-name: vault-access-reveal;
  }

  .vault-unlock.is-complete,
  .vault-entry-pending.vault-entry-revealing .app-shell {
    animation-duration: 120ms;
  }
}

.auth-body {
  display: grid;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.12), transparent 42%),
    var(--paper);
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(440px, 100%);
  padding: 28px;
}

.auth-brand {
  margin: 0;
  color: var(--ink);
}

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

.auth-card h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.1;
}

.auth-copy,
.auth-status {
  margin: 8px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-status[data-tone="error"] {
  color: var(--danger);
  font-weight: 800;
}

.auth-status[data-tone="success"] {
  color: var(--ink);
  font-weight: 800;
}

.save-state-message {
  min-height: 18px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.save-state-message[data-tone="saving"] {
  color: var(--accent);
}

.save-state-message[data-tone="success"] {
  color: #087a55;
}

.save-state-message[data-tone="error"] {
  color: var(--danger);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand div,
  .nav-item span:last-child {
    display: none;
  }

  .side-nav {
    padding: 20px 14px;
  }

  .brand {
    justify-content: center;
  }

  .brand-icon {
    width: 56px;
    height: 56px;
  }

  .nav-item {
    justify-content: center;
  }

  .estimate-layout {
    grid-template-columns: 1fr;
  }

  .estimate-stage {
    position: static;
  }

  .estimate-create-controls {
    grid-template-columns: 1fr;
  }

  .estimate-create-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .conversation-layout {
    grid-template-columns: 1fr;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

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

  .dashboard-layout {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .pipeline-widget,
  .revenue-widget,
  .tasks-widget,
  .donut-panel,
  .activity-widget,
  .schedule-widget,
  .weather-widget {
    grid-column: 1 / -1;
  }

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

  .pipeline-command-center {
    align-items: stretch;
    flex-direction: column;
  }

  .pipeline-command-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline-command-stats span {
    min-width: 0;
  }

  .pipeline-recovery-lane {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .pipeline-recovery-steps {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .side-nav {
    position: static;
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .brand {
    margin: 0 12px 0 0;
  }

  .brand-icon {
    width: 44px;
    height: 44px;
  }

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

  .nav-item {
    width: 44px;
    flex: 0 0 44px;
  }

  .workspace {
    padding: 18px;
  }

  .workspace.dashboard-watermark::before {
    background-position: center 340px;
    background-size: 88vw auto;
    opacity: 0.07;
  }

  .topbar,
  .top-actions,
  .view-toolbar,
  .builder-actions,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-workspace-toolbar,
  .estimate-active-summary,
  .estimate-panel-heading,
  .estimate-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-workspace-actions,
  .estimate-action-bar > div {
    justify-content: flex-start;
  }

  .estimate-active-meta {
    justify-items: start;
  }

  .top-actions {
    min-width: 0;
  }

  .search-field {
    width: 100%;
    min-width: 0;
    flex: 0 0 42px;
  }

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

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

  .pipeline-widget,
  .revenue-widget,
  .tasks-widget,
  .donut-panel,
  .activity-widget,
  .schedule-widget,
  .weather-widget,
  .leaderboard-panel {
    grid-column: 1 / -1;
  }

  .pipeline-ribbon {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pipeline-stage,
  .pipeline-stage:first-child {
    clip-path: none;
    border-radius: var(--radius);
  }

  .lead-intake-actions,
  .lead-stage-filter-banner {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .stage-filter-control {
    min-width: 0;
  }

  .donut-widget,
  .schedule-strip,
  .record-grid,
  .reports-grid,
  .profit-summary,
  .profit-cost-layout {
    grid-template-columns: 1fr;
  }

  .donut-widget {
    justify-items: center;
    text-align: center;
  }

  .weather-main {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

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

  .lead-detail-header {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .form-grid.two,
  .form-grid.three,
  .doc-grid,
  .detail-grid,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  .logo-settings {
    grid-template-columns: 1fr;
  }

  .detail-notes {
    grid-column: auto;
  }

  .line-item {
    grid-template-columns: 1fr 1fr;
  }

  .line-item .remove-cell {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .estimate-paper {
    min-height: 0;
    padding: 24px;
  }

  .doc-topline {
    grid-template-columns: 1fr;
  }

  .doc-meta {
    text-align: left;
  }

  .pipeline-page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .pipeline-playbook-stage {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .pipeline-stage-marker {
    width: 50px;
    height: 50px;
    margin-top: 22px;
    border-width: 4px;
    border-radius: 15px;
  }

  .pipeline-stage-marker svg {
    width: 22px;
    height: 22px;
  }

  .pipeline-connector {
    top: 67px;
    left: 24px;
  }

  .pipeline-playbook-stage:nth-child(even) .pipeline-stage-card,
  .pipeline-playbook-stage:nth-child(even) .pipeline-stage-card:hover {
    transform: none;
  }

  .pipeline-stage-card {
    padding: 19px;
  }

  .pipeline-stage-body,
  .pipeline-action-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .detail-stats {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    width: 100%;
    grid-auto-flow: row;
  }

  .segmented-control button {
    min-height: 36px;
  }

  .line-item {
    grid-template-columns: 1fr;
  }

  .estimate-paper {
    padding: 18px;
  }

  .doc-table {
    font-size: 12px;
  }

  .pipeline-command-center {
    padding: 18px;
  }

  .pipeline-command-stats,
  .pipeline-recovery-steps {
    grid-template-columns: 1fr;
  }

  .pipeline-command-stats span {
    display: flex;
    align-items: baseline;
    gap: 7px;
  }

  .pipeline-stage-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .pipeline-stage-count {
    order: -1;
  }

  .pipeline-recovery-lane {
    grid-template-columns: 1fr;
  }

  .pipeline-recovery-steps {
    grid-column: auto;
  }

}

@media (prefers-reduced-motion: reduce) {
  .pipeline-live-dot,
  .pipeline-connector span {
    animation: none;
  }

  .pipeline-stage-card {
    transition: none;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .side-nav,
  .topbar,
  .summary-strip,
  .estimate-builder,
  .toast,
  .view-toolbar,
  .contact-dialog {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .view-panel,
  .estimate-layout,
  .estimate-stage {
    display: block !important;
    min-height: 0;
    padding: 0;
    margin: 0;
  }

  .estimate-paper {
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  @page {
    size: letter;
    margin: 0.45in;
  }
}
