/* ==========================================================================
   ScopeSnap - Anti-Scope-Creep Proposal Builder Styles
   100% Client-Side CSS
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-dark: #cbd5e1;
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;
  
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-light: #eff6ff;
  --brand-accent: #059669;
  --brand-warning: #d97706;
  --brand-danger: #dc2626;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-sheet: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   App Header & Navigation
   ========================================================================== */

.app-navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text-main);
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tier-badge.free {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.tier-badge.pro {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Button Component Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--color-border-dark);
  color: var(--color-text-main);
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.btn-pro-unlock {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.btn-pro-unlock:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   Landing Hero / Banner Section
   ========================================================================== */

.landing-banner {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 1.75rem 1.5rem;
}

.banner-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.banner-text h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text-main);
  margin-bottom: 0.35rem;
}

.banner-text p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 720px;
}

.banner-features {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: #334155;
  font-weight: 500;
}

.feat-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.feat-item span.icon {
  color: var(--brand-accent);
  font-weight: bold;
}

.banner-cta-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
}

.price-pill {
  display: flex;
  flex-direction: column;
}

.price-big {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1;
}

.price-term {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* ==========================================================================
   Main Application Workspace Layout
   ========================================================================== */

.app-workspace {
  max-width: 1720px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1400px) {
  .app-workspace {
    grid-template-columns: 560px 1fr;
  }
}

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

/* View Mode Toggles for smaller screens */
.view-mode-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 1080px) {
  .view-mode-tabs {
    display: grid;
  }
  .app-workspace.mode-editor .preview-column {
    display: none;
  }
  .app-workspace.mode-preview .editor-column {
    display: none;
  }
}

.view-tab {
  padding: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--color-border);
  cursor: pointer;
  text-align: center;
}

.view-tab.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* ==========================================================================
   Editor Column & Form Sections
   ========================================================================== */

.editor-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor-header-bar {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.autosave-status {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.autosave-status.saving {
  color: var(--brand-warning);
}

.autosave-status.saved {
  color: var(--brand-accent);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-accent);
}

.form-section-accordion {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.accordion-header {
  padding: 0.85rem 1.15rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease;
}

.accordion-header:hover {
  background: #f8fafc;
}

.form-section-accordion.is-open .accordion-header {
  border-bottom-color: var(--color-border);
}

.accordion-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.accordion-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.accordion-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.accordion-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.accordion-chevron {
  font-size: 0.85rem;
  color: var(--color-text-subtle);
  transition: transform 0.2s ease;
}

.form-section-accordion.is-open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 1.15rem;
  display: none;
}

.form-section-accordion.is-open .accordion-body {
  display: block;
}

/* Form Controls & Grids */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

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

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group.col-span-3 {
  grid-column: span 3;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label .optional {
  font-size: 0.7rem;
  color: var(--color-text-subtle);
  font-weight: 400;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--color-text-main);
  background-color: #ffffff;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

.field-help {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* Repeatable Items (Deliverables, Exclusions, Milestones) */
.item-card {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
}

.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: #e2e8f0;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  color: #334155;
}

.btn-delete-item {
  background: none;
  border: none;
  color: var(--brand-danger);
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
}

.btn-delete-item:hover {
  background: #fee2e2;
}

.btn-add-item {
  width: 100%;
  padding: 0.6rem;
  border: 1px dashed var(--brand-primary);
  background: var(--brand-light);
  color: var(--brand-primary);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-add-item:hover {
  background: #dbeafe;
}

/* Exclusion Checklist Styles */
.exclusions-quick-presets {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: var(--radius-md);
}

.quick-preset-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 0.4rem;
}

.preset-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset-chip {
  font-size: 0.72rem;
  background: #ffffff;
  border: 1px solid #fde68a;
  color: #78350f;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.preset-chip:hover {
  background: #fef3c7;
}

/* ==========================================================================
   Preview Column & A4 Document Viewer
   ========================================================================== */

.preview-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preview-toolbar {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 4.5rem;
  z-index: 40;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.toolbar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.color-picker-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.color-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--color-border-dark);
  transition: transform 0.15s ease;
}

.color-circle:hover, .color-circle.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--color-text-main);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Proposal A4 Paper Presentation */
.preview-document-container {
  background: #64748b;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  display: flex;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.proposal-document {
  background: #ffffff;
  width: 100%;
  max-width: 860px;
  min-height: 1100px;
  padding: 3rem;
  box-shadow: var(--shadow-sheet);
  border-radius: var(--radius-sm);
  color: #1e293b;
  position: relative;
  display: flex;
  flex-direction: column;
}

.doc-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}

/* Document Inner Header */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 2rem;
  border-bottom: 2px solid #f1f5f9;
  gap: 1.5rem;
}

.header-left {
  display: flex;
  gap: 1rem;
}

.provider-brand-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.provider-custom-logo {
  max-width: 140px;
  max-height: 56px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.provider-company {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.provider-sub {
  font-size: 0.88rem;
  color: #475569;
  font-weight: 600;
  margin-top: 0.15rem;
}

.provider-meta, .provider-address {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.header-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.doc-badge-type {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #475569;
  background: #f1f5f9;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.35rem;
}

.doc-id-tag {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.doc-dates-grid {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.78rem;
}

.date-label {
  color: #64748b;
  margin-right: 0.35rem;
}

.date-value {
  font-weight: 600;
  color: #1e293b;
}

/* Document Title Block */
.doc-title-block {
  padding: 1.75rem 0 1.25rem 0;
}

.proposal-main-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

/* Parties Grid (Client + Summary) */
.doc-parties-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.party-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.party-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.party-title {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.party-contact {
  font-size: 0.78rem;
  color: #64748b;
}

.meta-big-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.currency-code {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

.timeline-row-summary {
  font-size: 0.82rem;
  color: #334155;
  margin-bottom: 0.2rem;
}

.timeline-sub-dates {
  font-size: 0.74rem;
  color: #64748b;
}

/* Document Sections */
.doc-section {
  margin-bottom: 2.25rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

.section-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
}

.sec-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #334155;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.summary-paragraph {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 0.85rem;
}

.objectives-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.objective-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #334155;
}

.check-icon {
  color: #059669;
  font-weight: 800;
  flex-shrink: 0;
}

/* Proposal Tables (Deliverables & Milestones) */
.proposal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.proposal-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.proposal-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.deliverable-row:nth-child(even) {
  background: #fafafa;
}

.del-col-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #94a3b8;
}

.del-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.86rem;
  margin-bottom: 0.2rem;
}

.del-desc {
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.45;
}

.spec-tag {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-block;
}

.del-col-time {
  font-weight: 600;
  color: #475569;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* Anti-Scope Creep Exclusions Box */
.anti-scope-section {
  break-inside: avoid;
  page-break-inside: avoid;
}

.exclusion-banner {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.exclusion-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.shield-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: #f59e0b;
  color: #ffffff;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.section-heading-inner {
  font-size: 0.98rem;
  font-weight: 800;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exclusion-intro {
  font-size: 0.8rem;
  color: #78350f;
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.exclusions-grid {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.exclusion-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #78350f;
  line-height: 1.4;
}

.exclusion-icon {
  color: #dc2626;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.exclusion-text {
  font-weight: 500;
}

/* Revision Guardrails Card */
.revision-guardrail-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.guardrail-metrics {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.metric-pill {
  flex: 1;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.metric-value {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.guardrail-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #334155;
}

/* Milestones Table */
.phase-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  margin-right: 0.4rem;
}

.ms-title {
  font-weight: 700;
  color: #0f172a;
}

.ms-col-trigger {
  color: #475569;
  font-size: 0.78rem;
}

.ms-col-pct {
  font-weight: 600;
  color: #64748b;
}

.ms-col-amt {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
}

.total-row {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  font-size: 0.9rem;
}

.total-label {
  text-align: right;
  font-weight: 800;
  color: #0f172a;
  padding: 0.75rem;
}

.total-pct {
  font-weight: 800;
  color: #475569;
  padding: 0.75rem;
}

.total-val {
  text-align: right;
  font-weight: 900;
  color: #0f172a;
  padding: 0.75rem;
  font-size: 1.05rem;
}

/* Legal Terms Grid */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.term-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #334155;
}

.term-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.term-card.highlight-ip {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.term-card.change-order-card {
  background: #faf5ff;
  border-color: #e9d5ff;
}

/* Signature Acceptance Block */
.sign-off-section {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-top: 1rem;
}

.sign-notice {
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.signatures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.signature-block {
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.15rem;
  background: #ffffff;
}

.sig-role {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 1.75rem;
}

.sig-line {
  border-bottom: 1.5px solid #0f172a;
  margin-bottom: 0.5rem;
  height: 24px;
}

.sig-name {
  font-size: 0.88rem;
  color: #0f172a;
}

.sig-title, .sig-company {
  font-size: 0.75rem;
  color: #64748b;
}

.sig-date-line {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #64748b;
  font-family: var(--font-mono);
}

/* Footer & Watermarks */
.proposal-watermark-banner {
  margin-top: auto;
  padding-top: 1.75rem;
  border-top: 1px dashed #cbd5e1;
}

.watermark-content {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}

.watermark-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: #475569;
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.watermark-text {
  font-size: 0.72rem;
  color: #475569;
  font-weight: 600;
}

.proposal-footer-clean {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #94a3b8;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--color-text-subtle);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--color-text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 80vh;
}

/* Pricing Upgrade Modal Content */
.pricing-modal-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.pricing-modal-badge {
  display: inline-block;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}

.pricing-modal-price {
  font-size: 2.25rem;
  font-weight: 900;
  color: #0f172a;
}

.pricing-modal-period {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.pro-features-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pro-feature-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: #334155;
}

.pro-feature-row span.icon {
  color: #059669;
  font-weight: 800;
}

.payment-placeholder-box {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.payment-btn-placeholder {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.25);
  margin-bottom: 0.65rem;
}

.payment-disclaimer {
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

.license-entry-box {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.license-entry-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.license-input-row {
  display: flex;
  gap: 0.5rem;
}

.license-help-text {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}

/* Saved Proposals Modal List */
.saved-proposals-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.saved-proposal-card {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.15s ease;
}

.saved-proposal-card:hover {
  border-color: var(--brand-primary);
}

.saved-prop-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.saved-prop-meta {
  font-size: 0.76rem;
  color: var(--color-text-muted);
}

.saved-prop-actions {
  display: flex;
  gap: 0.4rem;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #1e293b;
  color: #ffffff;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideInToast 0.2s ease-out;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   PRINT STYLESHEET (@media print)
   Critical for pristine PDF export / window.print()
   ========================================================================== */

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm 16mm;
  }

  /* Hide everything except the proposal document */
  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .app-navbar,
  .landing-banner,
  .editor-column,
  .preview-toolbar,
  .view-mode-tabs,
  .modal-backdrop,
  .toast-container,
  .btn,
  button {
    display: none !important;
  }

  .app-workspace {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .preview-column {
    display: block !important;
    width: 100% !important;
  }

  .preview-document-container {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .proposal-document {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
  }

  /* Prevent awkward page-break splits */
  .doc-section,
  .doc-header,
  .doc-parties-grid,
  .deliverables-table tr,
  .milestones-table tr,
  .anti-scope-section,
  .exclusion-banner,
  .revision-guardrail-card,
  .terms-grid,
  .term-card,
  .sign-off-section,
  .signatures-grid {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Force background colors to print accurately */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .proposal-watermark-banner {
    display: block !important;
  }
}


/* ==========================================================================
   UPGRADE: DARK THEME ENGINE
   Full support for dark mode with contrast ratios meeting WCAG AA
   ========================================================================== */

[data-theme="dark"] {
  --color-bg: #090d16;
  --color-surface: #111827;
  --color-surface-subtle: #1a2234;
  --color-border: #1f293d;
  --color-border-dark: #374151;
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-text-subtle: #64748b;
  --input-bg: #0d1321;
  --input-border: #2a3854;
  --card-bg: #131c2e;
}

[data-theme="dark"] body {
  background-color: var(--color-bg);
  color: var(--color-text-main);
}

[data-theme="dark"] .app-navbar {
  background: var(--color-surface);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .landing-banner {
  background: linear-gradient(180deg, #111827 0%, #0d1321 100%);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .step-card-mini,
[data-theme="dark"] .faq-card {
  background: #172133 !important;
  border-color: #243049 !important;
  color: #e2e8f0;
}

[data-theme="dark"] .landing-faq-summary {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .landing-faq-wrapper {
  border-top-color: #243049;
}

[data-theme="dark"] .editor-header-bar {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .form-section-accordion {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .accordion-header {
  background: var(--color-surface);
}

[data-theme="dark"] .accordion-header:hover {
  background: var(--color-surface-subtle);
}

[data-theme="dark"] .accordion-title {
  color: #f8fafc;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: #f8fafc;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
  border-color: var(--brand-primary);
  background-color: #0f172a;
}

[data-theme="dark"] .preview-toolbar {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .preview-column {
  background: #080c14;
}

[data-theme="dark"] .modal-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .modal-header {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .btn-secondary {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #334155;
}

[data-theme="dark"] .saved-proposal-card {
  background: #172133;
  border-color: var(--color-border);
}

[data-theme="dark"] .saved-prop-title {
  color: #f8fafc;
}

[data-theme="dark"] .license-entry-box {
  background: #172133;
  border-color: var(--color-border);
}

[data-theme="dark"] .license-entry-title {
  color: #f8fafc;
}

[data-theme="dark"] .payment-placeholder-box {
  background: #172133;
  border-color: #334155;
}

[data-theme="dark"] .pricing-modal-price {
  color: #f8fafc;
}

[data-theme="dark"] .pro-feature-row {
  color: #cbd5e1;
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   UPGRADE: 5 AGENCY-GRADE VISUAL PROPOSAL TEMPLATES
   ========================================================================== */

/* 1. Modern Minimalist (Base defaults, clean & elevated) */
.proposal-document.theme-layout-modern {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid #e2e8f0;
}

/* 2. Executive Corporate (Formal serif headers, navy/gold dignity) */
.proposal-document.theme-layout-executive {
  font-family: "Georgia", "Times New Roman", serif;
  border: 2px solid #334155;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.12);
}
.proposal-document.theme-layout-executive .proposal-main-title,
.proposal-document.theme-layout-executive .section-heading,
.proposal-document.theme-layout-executive .cover-title {
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: -0.01em;
  color: #0f172a;
}
.proposal-document.theme-layout-executive .doc-header {
  border-bottom: 3px double #334155;
}
.proposal-document.theme-layout-executive .deliverables-table th,
.proposal-document.theme-layout-executive .milestones-table th {
  background: #0f172a !important;
  color: #f8fafc !important;
  font-family: -apple-system, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.proposal-document.theme-layout-executive .sec-number {
  background: #0f172a !important;
  color: #ffffff !important;
  border-radius: 2px !important;
}

/* 3. Creative Studio (Bold asymmetric display typography) */
.proposal-document.theme-layout-creative {
  border-top: 8px solid var(--brand-primary);
  border-radius: 16px;
}
.proposal-document.theme-layout-creative .proposal-main-title {
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #0f172a;
}
.proposal-document.theme-layout-creative .doc-parties-grid {
  background: #faf5ff;
  border-color: #e9d5ff;
}
.proposal-document.theme-layout-creative .sec-number {
  border-radius: 50% !important;
  transform: rotate(-5deg);
}

/* 4. Editorial Swiss (Timeless Swiss grid & heavy monochrome rules) */
.proposal-document.theme-layout-editorial {
  border: 3px solid #000000;
  border-radius: 0;
}
.proposal-document.theme-layout-editorial .doc-accent-bar {
  height: 6px;
  background-color: #000000 !important;
}
.proposal-document.theme-layout-editorial .proposal-main-title {
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 2.1rem;
}
.proposal-document.theme-layout-editorial .section-heading {
  border-bottom: 2px solid #000000;
  padding-bottom: 0.5rem;
}
.proposal-document.theme-layout-editorial .sec-number {
  background: #000000 !important;
  color: #ffffff !important;
  border-radius: 0 !important;
}

/* 5. Compact Technical SOW (Dense high-information architecture) */
.proposal-document.theme-layout-compact {
  padding: 1.5rem 1.75rem;
  font-size: 0.88rem;
}
.proposal-document.theme-layout-compact .doc-title-block {
  padding: 1rem 0 0.75rem 0;
}
.proposal-document.theme-layout-compact .proposal-main-title {
  font-size: 1.5rem;
}
.proposal-document.theme-layout-compact .proposal-table td,
.proposal-document.theme-layout-compact .proposal-table th {
  padding: 0.45rem 0.6rem;
}
.proposal-document.theme-layout-compact .spec-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

/* ==========================================================================
   UPGRADE: AGENCY COVER PAGE STYLES
   ========================================================================== */

.proposal-cover-page {
  background: #ffffff;
  padding: 3rem 2.5rem;
  border-bottom: 2px dashed #e2e8f0;
  margin-bottom: 2rem;
  position: relative;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cover-top-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
}

.cover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.cover-brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cover-agency-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.cover-badge-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #f1f5f9;
  color: #475569;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
}

.cover-hero {
  margin: auto 0;
  padding: 1.5rem 0;
}

.cover-meta-code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 0.75rem;
}

.cover-version-pill {
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.cover-title {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.15;
  color: #0f172a;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cover-subtitle {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.5;
  max-width: 650px;
}

.cover-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
}

.cover-party-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cover-party-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
}

.cover-party-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.cover-party-sub {
  font-size: 0.82rem;
  color: #475569;
}

.cover-party-company {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
}

.cover-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 1rem;
}

.cover-meta-item {
  display: flex;
  flex-direction: column;
}

.cover-meta-item .lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.cover-meta-item .val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
}

.cover-page-screen-divider {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

/* ==========================================================================
   UPGRADE: CLIENT PRESENTATION MODE BANNER
   ========================================================================== */

.client-presentation-banner {
  background: #0f172a;
  color: #ffffff;
  border-bottom: 2px solid var(--brand-primary);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.client-banner-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.client-banner-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.client-banner-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #2563eb;
  color: #ffffff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.client-banner-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Digital Acceptance Seal */
.digital-acceptance-stamp {
  background: #ecfdf5;
  border: 2px solid #059669;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.stamp-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #047857;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stamp-signer {
  font-size: 0.92rem;
  font-weight: 800;
  color: #065f46;
}

.stamp-date, .stamp-ip {
  font-size: 0.68rem;
  color: #047857;
}

/* ==========================================================================
   UPGRADE: SMART CLAUSES MODAL & ONBOARDING STYLES
   ========================================================================== */

.clause-card {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: all 0.15s ease;
}

.clause-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .clause-card {
  background: #172133;
  border-color: #243049;
}

.clause-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.clause-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

[data-theme="dark"] .clause-tag {
  background: #243049;
  color: #94a3b8;
}

.clause-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .clause-title {
  color: #f8fafc;
}

.clause-text-preview {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  margin: 0.5rem 0;
  font-style: italic;
}

[data-theme="dark"] .clause-text-preview {
  background: #0d1321;
  border-color: #243049;
  color: #cbd5e1;
}

.clause-filter-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.clause-filter-pills .btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* Onboarding Carousel & Steps */
.onboarding-step-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}

.onboarding-step-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.65rem;
}

[data-theme="dark"] .onboarding-step-heading {
  color: #f8fafc;
}

.onboarding-step-desc {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1rem;
}

[data-theme="dark"] .onboarding-step-desc {
  color: #94a3b8;
}

.onboarding-visual-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: #1e40af;
}

[data-theme="dark"] .onboarding-visual-tip {
  background: #172554;
  border-color: #1e3a8a;
  color: #93c5fd;
}

.onboarding-dots {
  display: flex;
  gap: 0.4rem;
}

.onboarding-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: all 0.2s ease;
}

.onboarding-dots .dot.active {
  background: var(--brand-primary);
  width: 20px;
  border-radius: 4px;
}

/* Milestone Split Presets */
.milestone-split-presets {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  margin-right: 0.2rem;
}

.split-status-indicator {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.split-status-indicator.unbalanced {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.checkbox-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #334155;
  cursor: pointer;
}

[data-theme="dark"] .checkbox-toggle-label {
  color: #cbd5e1;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
}

.version-tag {
  font-size: 0.7rem;
  background: #e2e8f0;
  color: #475569;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.35rem;
  font-family: var(--font-sans);
}

/* Change Order Addendum Card */
.change-order-record-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-top: 0.75rem;
}

.co-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.co-pill {
  font-size: 0.72rem;
  font-weight: 800;
  background: #d97706;
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.co-investment {
  font-weight: 800;
  color: #b45309;
  font-size: 0.95rem;
}

.co-card-desc, .co-card-impact, .co-card-terms {
  font-size: 0.8rem;
  color: #78350f;
  margin-bottom: 0.2rem;
}

/* Print Overrides for Cover Page */
@media print {
  .proposal-cover-page {
    break-after: page !important;
    page-break-after: always !important;
    height: 100vh !important;
    min-height: 270mm !important;
    border-bottom: none !important;
    padding: 20mm 15mm !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .cover-page-screen-divider {
    display: none !important;
  }
}
