/* ============================================================
   Quotation Builder — quotation.css
   ============================================================ */

/* ---- Service Template Cards ------------------------------- */
.quot-tpl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  min-width: 130px;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}
.quot-tpl-card:hover {
  border-color: #ff7f00;
  background: #fff5eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,127,0,0.15);
}
.quot-tpl-card.selected {
  border-color: #ff7f00;
  background: linear-gradient(135deg, #fff5eb 0%, #fff 100%);
  box-shadow: 0 4px 20px rgba(255,127,0,0.2);
}
.quot-tpl-icon {
  font-size: 24px;
  line-height: 1;
}
.quot-tpl-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.quot-tpl-check {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #ff7f00;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

/* ---- List page stats cards -------------------------------- */
.quot-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.quot-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.quot-stat-card .stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}
.quot-stat-card .stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.quot-stat-card.accent .stat-val { color: #ff7f00; }

/* ---- Quotation list table --------------------------------- */
.quot-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.quot-list-table th {
  background: var(--surface2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.quot-list-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.quot-list-table tr:hover td {
  background: var(--surface2);
}
.quot-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.quot-badge.draft  { background: #f3f4f6; color: #6b7280; }
.quot-badge.sent   { background: #d1fae5; color: #065f46; }

/* ---- Editor layout --------------------------------------- */
.quot-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .quot-editor-grid { grid-template-columns: 1fr; }
}
.quot-editor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.quot-editor-card.full-width {
  grid-column: 1 / -1;
}
.quot-card-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ff7f00;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- Section builder ------------------------------------- */
.quot-section-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}
/* Platform separator when combining multiple services */
.quot-section-item.separator {
  background: linear-gradient(90deg, rgba(255,127,0,0.06) 0%, transparent 100%);
  border: 1.5px dashed rgba(255,127,0,0.35);
  padding: 10px 14px;
}
.quot-section-item.separator .quot-section-label-input {
  font-size: 12px;
  color: #ff7f00;
  background: transparent;
  border-color: transparent;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.quot-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.quot-section-label-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  outline: none;
}
.quot-section-label-input:focus { border-color: #ff7f00; }
.quot-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quot-bullet-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.quot-bullet-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}
.quot-bullet-input:focus { border-color: #ff7f00; }
.quot-icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.2s;
  flex-shrink: 0;
}
.quot-icon-btn:hover { border-color: #ff7f00; color: #ff7f00; background: #fff5eb; }
.quot-icon-btn.danger:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.quot-add-bullet-btn {
  font-size: 11px;
  color: #ff7f00;
  background: none;
  border: 1px dashed #ff7f00;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.quot-add-bullet-btn:hover { background: #fff5eb; }
.quot-add-section-btn {
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  margin-top: 4px;
}
.quot-add-section-btn:hover { border-color: #ff7f00; color: #ff7f00; background: #fff5eb; }

/* ---- Package table builder ------------------------------- */
.quot-pkg-table-wrap {
  overflow-x: auto;
}
.quot-pkg-builder-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 400px;
}
.quot-pkg-builder-table th,
.quot-pkg-builder-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: center;
}
.quot-pkg-builder-table th {
  background: var(--surface2);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}
.quot-pkg-col-header-input {
  background: none;
  border: none;
  outline: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  width: 100%;
}
.quot-pkg-col-header-input:focus {
  border-bottom: 1.5px solid #ff7f00;
}
.quot-pkg-cell-input {
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  text-align: center;
  width: 100%;
}
.quot-pkg-cell-input:focus {
  border-bottom: 1.5px solid #ff7f00;
}
.quot-pkg-row-label {
  text-align: left !important;
}
.quot-pkg-row-label input {
  font-weight: 600;
}
.quot-add-pkg-row-btn {
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 8px;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  margin-top: 8px;
}
.quot-add-pkg-row-btn:hover { border-color: #ff7f00; color: #ff7f00; background: #fff5eb; }

/* ---- A4 Preview wrapper ---------------------------------- */
.quot-a4-wrap {
  display: flex;
  justify-content: center;
  background: var(--surface2);
  padding: 30px 0;
  min-height: 90vh;
}

/* ---- A4 Paper -------------------------------------------- */
#quot-a4-sheet {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  padding: 12mm 14mm;
  box-shadow: 0 10px 40px rgba(0,0,0,0.10);
  border: 1px solid #ddd;
  color: #1a1a1a;
  font-family: 'Inter', 'Arial', sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  box-sizing: border-box;
  position: relative;
}

/* Header */
.qa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 3px solid #ff7f00;
}
.qa-logo { max-height: 52px; display: block; }
.qa-company-details {
  text-align: right;
  font-size: 11px;
  color: #444;
  line-height: 1.6;
}
.qa-company-details strong { font-size: 13px; color: #1a1a1a; }

/* Title block */
.qa-title-block {
  margin-bottom: 18px;
}
.qa-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #1a1a1a;
  margin: 0 0 4px 0;
}
.qa-title-underline {
  width: 90px;
  height: 3px;
  background: #ff7f00;
  border-radius: 2px;
}

/* Client info block */
.qa-client-block {
  margin-bottom: 18px;
  font-size: 12px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.qa-client-block strong { font-size: 13px; }

/* Divider */
.qa-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 14px 0;
}

/* Overview */
.qa-section-num {
  font-weight: 700;
  font-size: 12.5px;
  margin: 0 0 6px 0;
  color: #1a1a1a;
  page-break-inside: avoid;
  break-inside: avoid;
}
.qa-overview-text {
  font-size: 12px;
  color: #444;
  line-height: 1.65;
  margin-bottom: 16px;
  page-break-inside: avoid;
  break-inside: avoid;
}


/* Scope */
.qa-scope-title {
  font-weight: 700;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.qa-section-block {
  margin-bottom: 10px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.qa-section-heading {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 4px;
  color: #1a1a1a;
}
.qa-section-heading span { color: #ff7f00; }
.qa-bullet-list {
  margin: 0 0 0 18px;
  padding: 0;
  list-style: disc;
}
.qa-bullet-list li {
  font-size: 11.5px;
  color: #444;
  margin-bottom: 2px;
  page-break-inside: avoid;
  break-inside: avoid;
}

/* Pricing table */
.qa-pricing-section {
  margin-top: 18px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.qa-pkg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 8px;
}
.qa-pkg-table th {
  background: #ff7f00;
  color: #ffffff;
  padding: 9px 14px;
  text-align: center;
  font-weight: 700;
  border: 1px solid #e07000;
}
.qa-pkg-table th:first-child { text-align: left; }
.qa-pkg-table td {
  border: 1px solid #e5e7eb;
  padding: 10px 14px;
  text-align: center;
  color: #333;
}
.qa-pkg-table td:first-child { text-align: left; font-weight: 600; }
.qa-pkg-table tr:nth-child(even) td { background: #fff8f0; }
.qa-pkg-table tr {
  page-break-inside: avoid;
  break-inside: avoid;
}

/* GST note */
.qa-gst-note {
  font-size: 10.5px;
  color: #666;
  font-style: italic;
  margin-top: 6px;
  margin-bottom: 14px;
  page-break-inside: avoid;
  break-inside: avoid;
}
}

/* Footer bar */
.qa-footer-bar {
  background: #ff7f00;
  color: #ffffff;
  font-size: 11px;
  font-style: italic;
  text-align: center;
  padding: 10px 16px;
  border-radius: 4px;
  margin-top: auto;
  line-height: 1.5;
}

/* Valid until line */
.qa-validity {
  font-size: 11px;
  color: #888;
  margin-top: 10px;
}

/* ---- Print styles ---------------------------------------- */
@media print {
  body * { visibility: hidden; }
  #quot-a4-sheet, #quot-a4-sheet * { visibility: visible; }
  #quot-a4-sheet {
    position: absolute;
    left: 0; top: 0;
    width: 210mm;
    margin: 0;
    padding: 0 !important;
    box-shadow: none;
    border: none;
    background: transparent;
  }
  .qa-page-block {
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    padding: 12mm 14mm !important;
    background: #fff !important;
    min-height: auto !important;
    height: auto !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
}

/* ---- Mobile scaling of A4 -------------------------------- */
@media (max-width: 900px) {
  #quot-a4-sheet {
    width: 100%;
    min-height: auto;
    padding: 6mm 4mm;
    font-size: 11px;
  }
  .quot-a4-wrap { padding: 10px 4px; }
  .qa-title { font-size: 22px; }
}

.qa-page-break-indicator {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed rgba(255, 127, 0, 0.45);
  height: 0;
  z-index: 100;
  pointer-events: none;
}
.qa-page-break-indicator span {
  position: absolute;
  right: 20px;
  transform: translateY(-50%);
  background: #ff7f00;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* PDF Export Specific Styling (removes borders, margins and forces exact A4 sizes during capture) */
#quot-a4-sheet.qa-pdf-mode {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
#quot-a4-sheet.qa-pdf-mode .qa-page-block {
  margin: 0 !important;
  box-shadow: none !important;
  border: none !important;
  padding: 12mm 14mm !important;
  background: #fff !important;
  min-height: 296.2mm !important;
  height: 296.2mm !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
}


