/* ESTIND UI Pro Max alignment layer
   Source of truth: design-system/estind/MASTER.md */
:root {
  color-scheme: light;
  --color-primary: #315b78;
  --color-primary-strong: #17364a;
  --color-on-primary: #fff;
  --color-accent: #c2410c;
  --color-accent-strong: #9a3412;
  --color-on-accent: #fff;
  --color-background: #f1f3f5;
  --color-surface: #fff;
  --color-surface-muted: #e9eef2;
  --color-foreground: #17232b;
  --color-muted-foreground: #4b5963;
  --color-border: #8494a0;
  --color-divider: #c7d0d7;
  --color-success: #2f6b4f;
  --color-warning: #8a5a12;
  --color-destructive: #a33232;
  --color-ring: #2563eb;
  --motion-state: 150ms ease-out;
  --page: var(--color-background);
  --surface: var(--color-surface);
  --surface-2: #f7f9fa;
  --surface-3: var(--color-surface-muted);
  --border: var(--color-divider);
  --border-strong: #8f9da8;
  --text: var(--color-foreground);
  --muted: var(--color-muted-foreground);
  --blue: var(--color-accent);
  --cyan: #d45a1d;
  --navy: var(--color-primary-strong);
  --navy2: #24475d;
  --green: var(--color-success);
  --danger: var(--color-destructive);
  --amber: var(--color-warning);
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: auto;
  scroll-padding-top: 64px;
}

body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.pricing-taxability {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-divider);
}

.pricing-taxability .pricing-adjustment-label { grid-column: 1 / -1; }

/* A long summary must remain reachable on a laptop or at increased zoom. */
.estimate-summary-rail {
  position: static;
  min-width: 0;
}

.estimate-summary-rail .pricing-adjustment {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-block: 10px;
}

.estimate-summary-rail .pricing-adjustment-label {
  grid-column: 1 / -1;
}

.estimate-summary-rail .pricing-adjustment > *,
.estimate-summary-rail .pricing-sales-tax-row > * {
  min-width: 0;
}

.estimate-summary-rail .pricing-sales-tax-row {
  grid-template-columns: minmax(0, 1fr) minmax(80px, 1fr);
}

.estimate-summary-rail .pricing-sales-tax-row > label {
  grid-column: 1 / -1;
}

.estimate-summary-rail .pricing-taxable {
  white-space: normal;
}

.estimate-summary-rail .pricing-tax-warning {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.revision-reason-dialog { width: min(520px, 100%); margin-top: 12vh; }
.revision-reason-dialog form { display: grid; gap: 10px; padding: 18px; }
.revision-reason-dialog form > label { color: var(--color-muted-foreground); font-size: 11px; font-weight: 800; }
.revision-reason-dialog form > input { width: 100%; padding: 11px 12px; border: 1px solid var(--color-border); background: #fff; color: var(--color-foreground); font: inherit; }

#estimatesPage { padding-bottom: 24px; }
#saveEstimateProject {
  position: static;
  width: 100%;
  box-shadow: 0 5px 14px rgba(23, 35, 43, .14);
}

@media (max-width: 760px) {
  .pricing-taxability { grid-template-columns: 1fr 1fr; }
  .pricing-taxability .pricing-adjustment-label { grid-column: 1 / -1; }
  .revision-reason-dialog { margin-top: 0; }
  #saveEstimateProject { width: 100%; }
}

h1,
h2,
h3,
h4,
strong {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: -0.01em;
}

.interface-icon,
.inline-action-icon,
.empty-state-icon,
.travel-icon svg {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inline-action-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}

.empty-state-icon {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
}

.catalog-locked-field .interface-icon,
.locked-price .interface-icon {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: #607480;
}

.plan-icon .interface-icon,
.travel-icon svg,
.labor-empty .interface-icon {
  width: 20px;
  height: 20px;
}

.amount,
.catalog-selling-price,
.compact-total strong,
.summary dd,
.pricing-profitability dd,
.dashboard-metrics strong,
.reports-metrics strong,
.project-metrics strong,
output {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.internal-cost {
  color: var(--color-text-muted);
}

.catalog-profit {
  color: #087a57;
  font-weight: 800;
}

.catalog-import {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.catalog-import input {
  display: none;
}

.settings-master-data {
  grid-column: 1 / -1;
}

.master-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0 20px 16px;
}

.master-list-grid h4 {
  margin: 0 0 10px;
  color: var(--color-foreground);
  font-size: 14px;
}

.master-list-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.master-list-add input,
.master-list-add button {
  min-height: 38px;
}

.master-list-add button {
  border: 1px solid var(--color-accent-strong);
  border-radius: 6px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.managed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.managed-list > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid var(--color-divider);
  border-radius: 999px;
  background: var(--color-surface-muted);
  padding: 5px 7px 5px 11px;
  color: var(--color-foreground);
  font-size: 12px;
}

.managed-list button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #dbe4e9;
  color: #425766;
  cursor: pointer;
}

.managed-list-note {
  margin: 0 20px 20px;
  color: var(--color-muted-foreground);
  font-size: 12px;
}

#pfStatusHelp {
  display: block;
  margin-top: 6px;
  color: #6b4b15;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .master-list-grid {
    grid-template-columns: 1fr;
  }
}

button,
a,
select,
label[for],
[role="button"] {
  transition: color var(--motion-state), background-color var(--motion-state), border-color var(--motion-state), opacity var(--motion-state);
}

button:not(:disabled),
a[href],
select:not(:disabled),
label[for],
[role="button"] {
  cursor: pointer;
}

button:hover,
button:active,
a:hover,
[role="button"]:hover {
  transform: none !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-ring) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

.mobile-more-toggle {
  display: none !important;
}

.mobile-more-panel {
  display: contents;
}

.sidebar {
  background: #172a34;
  border-right-color: #0d1d25;
}

.side-brand,
.workspace > .app-topbar {
  border-color: var(--color-divider);
}

.workspace > .app-topbar {
  background: #fff;
}

.sidebar button {
  color: #c8d2d8;
  font-size: 13px;
}

.sidebar button:hover {
  background: #223c4b;
  border-left-color: #7892a3;
}

.sidebar button.active {
  background: #29495d;
  border-left-color: var(--color-accent);
}

.sidebar button.active i {
  color: #f08043;
}

.topbar-wordmark strong {
  color: #17324d;
  font-family: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
  font-size: 21px;
  font-weight: 850;
  font-variation-settings: "wght" 850;
  line-height: 1;
  letter-spacing: .075em;
}

.topbar-wordmark small,
.topbar-version {
  color: var(--color-muted-foreground);
  font-size: 10px;
}

.content {
  padding-inline: clamp(16px, 2vw, 32px);
}

.app-page-hero,
.projects-hero,
.catalog-head,
.labor-hero,
.settings-hero {
  border-bottom-color: var(--color-primary);
}

.app-page-hero small,
.projects-hero small,
.catalog-head small,
.labor-hero small,
.settings-hero small,
.dashboard-toolbar small,
.report-card-head small,
.settings-card-head small,
.labor-builder-title small,
.labor-section-head small {
  color: var(--color-accent-strong) !important;
  font-size: 10px !important;
}

.app-page-hero h2,
.projects-hero h2,
.catalog-head h2,
.labor-hero h2,
.settings-hero h2 {
  color: var(--color-foreground) !important;
  font-size: clamp(22px, 2vw, 28px) !important;
  font-weight: 700;
}

.app-page-hero p,
.projects-hero p,
.catalog-head p,
.labor-hero p,
.settings-hero p,
.dashboard-note,
.pricing-helper {
  color: var(--color-muted-foreground) !important;
  font-size: 13px;
}

.panel,
.project-card,
.settings-card,
.project-metrics article,
.dashboard-metrics article,
.reports-metrics article {
  border-color: var(--color-divider);
  background: var(--color-surface);
}

.panel-title,
.report-card-head,
.settings-card-head,
.estimate-table-head,
th,
.dashboard-table th,
.monthly-report-table th,
.catalog-table th {
  background: var(--color-surface-muted);
  color: #263743;
  border-color: var(--color-divider);
}

table {
  font-size: 12px;
}

th {
  font-size: 11px;
}

td {
  color: #273640;
  border-color: #d7dde2;
}

tbody tr:nth-child(even),
.estimate-wide-panel .rental-row:nth-child(even),
.estimate-wide-panel .labor-estimate-row:nth-child(even) {
  background: #f7f9fa;
}

tbody tr:hover,
.dashboard-table tr:hover td {
  background: #eaf0f4;
}

label {
  color: #394a55;
  font-size: 12px;
}

input,
select,
textarea {
  border-color: var(--color-border) !important;
  background: #fff !important;
  color: var(--color-foreground) !important;
}

.primary,
.save-project,
.settings-apply,
.rate-add-actions button,
.hero-action-btn,
.new-project-btn,
.settings-save-button,
.save-to-project,
.reprice-line,
#addLaborEstimate,
#addTravelEstimate {
  border-color: var(--color-accent-strong) !important;
  background: var(--color-accent) !important;
  color: var(--color-on-accent) !important;
}

.primary:hover,
.save-project:hover,
.settings-apply:hover,
.rate-add-actions button:hover,
.hero-action-btn:hover,
.new-project-btn:hover,
.settings-save-button:hover,
.save-to-project:hover,
.reprice-line:hover,
#addLaborEstimate:hover,
#addTravelEstimate:hover {
  background: var(--color-accent-strong) !important;
}

.secondary {
  border-color: #8f9da8;
  background: #fff;
  color: #2e4350;
}

.secondary:hover {
  border-color: var(--color-primary);
  background: #edf3f6;
}

.export {
  border-color: var(--color-primary-strong);
  background: var(--color-primary);
}

.export:hover {
  background: var(--color-primary-strong);
}

.export > span,
.save-to-project > span {
  display: grid;
  place-items: center;
}

.export > span svg,
.save-to-project > span svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-metrics,
.reports-metrics,
.project-metrics {
  border-color: var(--color-divider);
  background: var(--color-surface);
}

.dashboard-metrics small,
.reports-metrics small,
.project-metrics span {
  color: var(--color-muted-foreground);
  font-size: 10px;
}

.dashboard-metrics strong,
.reports-metrics strong,
.project-metrics strong {
  color: var(--color-primary-strong);
}

.catalog-stat,
.labor-builder,
.pricing-tax-warning,
.price-change-review {
  border-left-color: var(--color-accent);
}

.catalog-stat {
  background: #e8eef2;
}

.pricing-tax-warning {
  border-color: #f3b4b4;
  border-left-color: #c9362b;
  background: #fff1f0;
  color: #9f241c;
}

.editable-qty,
.items-panel .qty-editable,
.pricing-rate-control input {
  border-left-color: var(--color-accent) !important;
}

.pricing-profitability {
  border-top-color: #102b3a;
  background: var(--color-primary-strong);
}

.catalog-item-modal-head,
.project-dialog-head {
  background: var(--color-primary-strong);
}

.catalog-item-dialog,
.project-dialog {
  border-color: #536a78;
  border-radius: 4px;
}

.toast {
  background: var(--color-success);
}

.skip-link {
  border-color: var(--color-ring);
}

@media (min-width: 701px) and (max-width: 1100px) {
  .sidebar nav > button,
  .mobile-more-panel button,
  .sidebar .help {
    justify-content: center;
    padding-inline: 0;
    font-size: 0;
  }

  .sidebar button i,
  .sidebar button svg {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .sidebar .help span {
    display: none;
  }
}

@media (max-width: 700px) {
  html {
    scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    font-size: 15px;
  }

  .content {
    padding: 12px 12px 20px;
  }

  .sidebar {
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    overflow: visible;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    padding: 4px 6px;
    overflow: visible;
  }

  .sidebar nav > button,
  .mobile-more-toggle {
    width: 100% !important;
    min-width: 0 !important;
    height: 56px;
    min-height: 56px;
    padding: 4px 2px;
    font-size: 10px;
  }

  .mobile-more-toggle {
    display: flex !important;
  }

  .mobile-more-panel {
    position: fixed;
    right: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 4600;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid #617582;
    border-radius: 4px;
    background: #172a34;
    box-shadow: 0 14px 34px rgba(8, 20, 27, 0.28);
  }

  .sidebar.mobile-more-open .mobile-more-panel {
    display: grid;
  }

  .mobile-more-panel button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 9px;
    border: 1px solid #425b68;
    border-left: 3px solid transparent;
    font-size: 12px;
  }

  .mobile-more-panel button.active {
    border-left-color: var(--color-accent);
  }

  .sidebar:has(.mobile-more-panel button.active) .mobile-more-toggle {
    background: #29495d;
    border-bottom-color: var(--color-accent);
    color: #fff;
  }

  .app-page-hero p,
  .projects-hero p,
  .catalog-head p,
  .labor-hero p,
  .settings-hero p {
    font-size: 13px;
    line-height: 1.45;
  }

  button,
  .primary,
  .secondary,
  .hero-action-btn,
  .new-project-btn,
  .settings-save-button,
  .export,
  .save-to-project,
  .catalog-row-actions button,
  .project-card-v101 .compact-actions button,
  .project-card-actions button,
  .modal-close,
  .project-dialog-head > button {
    min-height: 44px !important;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .pricing-taxable,
  .image-uploader,
  .upload {
    min-height: 44px;
  }

  .panel-title small,
  .dashboard-metrics small,
  .reports-metrics small,
  .project-metrics span,
  .pricing-adjustment-label small,
  .pricing-sales-tax label small,
  .pricing-helper {
    font-size: 11px !important;
  }

  table,
  .estimate-table-body {
    font-size: 12px;
  }

  .toast {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Partner demo context — compact, explicit, and intentionally unlike a marketing banner. */
.demo-workspace-banner{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:16px 28px 0;padding:11px 14px;border:1px solid #c9d9e5;border-radius:9px;background:#f5f9fc;color:#193850}.demo-workspace-banner>div{display:flex;align-items:center;gap:9px;min-width:0}.demo-workspace-banner strong{font-size:11px;letter-spacing:.08em}.demo-workspace-banner small{color:#607789;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.demo-workspace-banner button{border:0;background:transparent;color:#1c5f8d;font-size:12px;font-weight:700;text-decoration:underline;text-underline-offset:3px;white-space:nowrap;cursor:pointer}.estimate-source{display:inline-flex;align-items:center;max-width:190px;padding:4px 7px;border:1px solid #c9ddeb;border-radius:999px;background:#eef6fb;color:#22658f;font-size:9px;font-weight:800;letter-spacing:.05em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:760px){.demo-workspace-banner{margin:10px 12px 0;align-items:flex-start}.demo-workspace-banner>div{align-items:flex-start;flex-wrap:wrap}.demo-workspace-banner small{flex-basis:100%;white-space:normal}.estimate-source{max-width:140px}}

.project-form-footer{align-items:center;flex-wrap:wrap}.project-form-error{flex:1;min-width:260px;margin:0;padding:9px 11px;border:1px solid #e3a8a8;border-radius:6px;background:#fff1f1;color:#9b2f2f;font-size:12px;font-weight:700;line-height:1.35}.project-form-error.hidden{display:none}
