/* cliffbiz · costing — custom styles */

/* Hide scrollbar but keep scrolling */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Tab buttons */
.tab-btn {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #737373;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  background: none;
  cursor: pointer;
}
.tab-btn:hover { color: #171717; }
.tab-btn.active {
  color: #0a0a0a;
  border-bottom-color: #0a0a0a;
}

/* Form inputs */
.field {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #0a0a0a;
}
.field:focus {
  outline: none;
  border-color: #0a0a0a;
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}
.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #525252;
  margin-bottom: 0.375rem;
}

/* Buttons */
.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-ghost {
  background: transparent;
  color: #525252;
  border-color: #e5e5e5;
}
.btn-ghost:hover { background: #fafafa; color: #0a0a0a; }
.btn-danger {
  background: transparent;
  color: #dc2626;
  border-color: transparent;
}
.btn-danger:hover { background: #fef2f2; }

/* Card */
.card {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  overflow: hidden;
}

/* Item row in costing */
.item-row {
  display: grid;
  grid-template-columns: 1fr 1fr 90px 80px 1fr;
  gap: 0.5rem;
  align-items: end;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #fafafa;
}
@media (max-width: 700px) {
  .item-row {
    grid-template-columns: 1fr 1fr;
  }
  .item-row .item-subtotal { grid-column: 1 / -1; }
}

/* Margin stat color */
.margin-positive { color: #16a34a; }
.margin-negative { color: #dc2626; }
.margin-zero { color: #737373; }

/* Estimator: business switcher chips */
.est-chip {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  background: white;
  color: #525252;
  cursor: pointer;
  transition: all 0.15s;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.est-chip:hover { color: #0a0a0a; border-color: #a3a3a3; }
.est-chip.active { background: #0a0a0a; color: white; border-color: #0a0a0a; }

/* Estimator: cost row */
.est-row {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 0.9fr 64px 84px 1.1fr 132px;
  gap: 0.5rem;
  align-items: end;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #fafafa;
}
@media (max-width: 980px) {
  .est-row {
    grid-template-columns: 1fr 1fr;
  }
  .est-row .est-total { grid-column: 1 / -1; }
}

/* Toast */
#toast.show {
  opacity: 1 !important;
}

/* Hide hidden report from view, but keep accessible for html2canvas */
#report-area {
  position: absolute;
  left: -99999px;
  top: 0;
  width: 794px; /* A4 width at 96dpi */
  padding: 40px;
  background: white;
  color: #0a0a0a;
  font-family: 'Inter', system-ui, sans-serif;
}

/* PDF report styles */
.pdf-report { padding: 0; }
.pdf-report h1 {
  font-family: 'Anton', sans-serif;
  font-size: 36px;
  letter-spacing: 0.05em;
  margin: 0 0 4px 0;
}
.pdf-report h2 {
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  letter-spacing: 0.05em;
  margin: 28px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #0a0a0a;
}
.pdf-report h3 {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin: 16px 0 8px 0;
}
.pdf-report .meta {
  color: #737373;
  font-size: 12px;
  margin-bottom: 24px;
}
.pdf-report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 8px 0 16px;
}
.pdf-report th {
  background: #0a0a0a;
  color: white;
  padding: 8px;
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pdf-report td {
  padding: 7px 8px;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: top;
}
.pdf-report .stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.pdf-report .stat-card {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 12px;
}
.pdf-report .stat-card .label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #525252;
  font-weight: 600;
}
.pdf-report .stat-card .value {
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  margin-top: 4px;
}
.pdf-report .menu-block {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  page-break-inside: avoid;
}
.pdf-report .menu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
}
.pdf-report .menu-header h3 { margin: 0; font-size: 16px; }
.pdf-report .menu-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
}
.pdf-report .menu-summary .cell {
  background: #fafafa;
  padding: 8px 10px;
  border-radius: 6px;
}
.pdf-report .menu-summary .cell .label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #525252;
  font-weight: 600;
}
.pdf-report .menu-summary .cell .value {
  font-weight: 700;
  font-size: 13px;
  margin-top: 2px;
}
.pdf-report .pdf-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #e5e5e5;
  font-size: 10px;
  color: #737373;
  text-align: center;
}
.pdf-report .badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0a0a0a;
  color: white;
}
.pdf-report .text-right { text-align: right; }
.pdf-report .num { font-variant-numeric: tabular-nums; }
.pdf-report .text-pos { color: #16a34a; font-weight: 700; }
.pdf-report .text-neg { color: #dc2626; font-weight: 700; }
.pdf-report .empty {
  padding: 14px;
  text-align: center;
  color: #a3a3a3;
  font-style: italic;
  font-size: 11px;
}
