:root {
  --bg: #f8faf9;
  --card: #ffffff;
  --primary: #7fb432;
  --primary-dark: #4e7a1f;
  --muted: #5d6673;
  --text: #17202b;
  --border: #e1e6ea;
  --danger: #d94a4a;
  --shadow: 0 18px 45px rgba(15, 29, 44, 0.08);
  --page-max: 1200px;
}

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

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.brand-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logotype {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 26px;
  letter-spacing: 0.08em;
  color: #373b3f;
}

.logotype .hub {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.intent-card {
  max-width: var(--page-max);
  margin: 32px auto;
  padding: 28px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#workspace {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 24px;
}

.wizard-chrome {
  margin: 24px 0 8px;
}

.intent-banner {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-weight: 600;
  color: var(--primary-dark);
  text-decoration: underline;
  cursor: pointer;
  box-shadow: none;
}

.link-btn:hover {
  transform: none;
  color: var(--primary);
}

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.progress-dot {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: #eef2ea;
  color: var(--muted);
  border: 2px solid var(--border);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-step.active .progress-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.progress-step.active .progress-label {
  color: var(--text);
}

.progress-step.complete .progress-dot {
  background: rgba(127, 180, 50, 0.15);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.progress-step.complete .progress-label {
  color: var(--primary-dark);
}

.progress-connector {
  display: none;
}

.wizard-step {
  display: none;
}

.wizard-step-active {
  display: block;
}

.wizard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.wizard-nav .secondary {
  margin-right: auto;
}

button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.secondary:hover:not([disabled]) {
  background: #f5f7f4;
  transform: none;
}

.review-block {
  margin-top: 20px;
}

.review-block h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--primary-dark);
}

.review-grid {
  margin-bottom: 8px;
}

.review-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #f8fbf4;
  border-radius: 10px;
  border: 1px solid #ecf0ea;
}

.review-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.review-value {
  font-size: 15px;
  font-weight: 500;
}

.catalog-error {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(217, 74, 74, 0.08);
  border: 1px solid rgba(217, 74, 74, 0.25);
  color: #a11f1f;
  font-size: 14px;
  margin-bottom: 16px;
}

.toast.error {
  background: #a11f1f;
}

.intent-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.intent-pill {
  flex: 1 1 260px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.intent-pill strong {
  display: block;
  font-size: 16px;
  color: var(--text);
}

.intent-pill span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.intent-pill:not(:has(span)) {
  padding: 16px 18px;
}

.intent-pill:not(:has(span)) strong {
  font-size: 15px;
}

.intent-pill.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px rgba(127, 180, 50, 0.25);
}

.container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 24px 32px;
}

.card {
  background: var(--card);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 28px;
}

.grid-card {
  padding: 32px;
}

.grid-head {
  margin-bottom: 16px;
}

.summary-block + .summary-block {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.summary-block h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.job-details-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.review-grid.job-details-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Floating label fields */
.float-field {
  position: relative;
  width: 100%;
}

.float-field__input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 18px 12px 8px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.float-field__input:focus,
.float-field__input.is-filled {
  padding-top: 22px;
  padding-bottom: 6px;
}

select.float-field__input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235d6673' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

input[type="date"].float-field__input {
  min-height: 48px;
}

input[type="date"].float-field__input::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
}

.float-field__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(127, 180, 50, 0.25);
  outline: none;
}

.float-field__label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
  transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease, color 0.15s ease;
  transform-origin: left center;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.float-field__input:focus + .float-field__label,
.float-field__input:not(:placeholder-shown) + .float-field__label,
.float-field__input.is-filled + .float-field__label {
  top: 6px;
  transform: translateY(0);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Label-above fields (selects, dates) */
.field-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.field-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(127, 180, 50, 0.25);
  outline: none;
}

.summary-card {
  max-width: var(--page-max);
  margin: 32px auto;
}

.summary-table {
  font-size: 15px;
}

.summary-table th,
.summary-table td {
  padding: 12px 10px;
}

.summary-table tbody tr:nth-child(even) {
  background: #f8fbf4;
}

.summary-card .review-value {
  font-size: 15px;
  color: var(--text);
  text-transform: none;
}

.summary-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-field > span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-field input,
.summary-field select {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px;
  font-size: 15px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.summary-field input:focus,
.summary-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(127, 180, 50, 0.25);
  outline: none;
}

.field-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.field-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.field-panels.two-up {
  grid-template-columns: 1fr 1fr;
}

.field-panels .field-panel {
  margin-top: 0;
}

@media (max-width: 900px) {
  .field-panels.two-up {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .job-details-grid,
  .review-grid.job-details-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .grid-card,
  .intent-card {
    padding: 16px 18px;
  }

  .progress-label {
    display: none;
  }
}

.field-panel__title {
  background: #f1f5ee;
  padding: 12px 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border);
}

.field-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
}

.field-row span {
  font-weight: 600;
  color: #2a2f34;
  flex: none;
}

.field-row input,
.field-row select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px;
  font-size: 16px;
  background: #fff;
}

.field-row input:focus,
.field-row select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(127, 180, 50, 0.2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover:not([disabled]) {
  transform: translateY(-2px);
}

button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

button.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
  box-shadow: none;
}

button.danger:hover:not([disabled]) {
  background: rgba(217, 74, 74, 0.08);
  transform: none;
}

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

.order-actions #submit-order {
  min-width: 10.5rem;
}

.submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 29, 44, 0.45);
}

.submit-overlay.hidden {
  display: none;
}

.submit-overlay__panel {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 36px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: min(90vw, 360px);
  text-align: center;
}

.submit-overlay__text {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cabinet-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cabinet-card {
  border: 1px solid #e3ead9;
  border-radius: 14px;
  padding: 16px;
  background: #f8fbf4;
}

.cabinet-card--blank {
  border-style: dashed;
  border-color: rgba(127, 180, 50, 0.35);
  background: rgba(127, 180, 50, 0.06);
}

.cabinet-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -16px -16px 12px;
  padding: 10px 16px;
  background: rgba(127, 180, 50, 0.1);
  border-radius: 14px 14px 0 0;
  font-weight: 600;
  color: var(--primary-dark);
}

.cabinet-card__grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.cabinet-card__grid > * {
  min-width: 0;
}

.cabinet-card__grid:last-of-type {
  margin-bottom: 0;
}

.cabinet-card__grid--2 {
  grid-template-columns: 1fr 1fr;
}

.cabinet-card__grid--dims {
  grid-template-columns: minmax(52px, 64px) repeat(3, 1fr);
}

.cabinet-card__field--qty .float-field__input {
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.cabinet-card__grid--material {
  grid-template-columns: 1fr;
}

.cabinet-card__grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

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

.cabinet-card__field {
  min-width: 0;
}

.cabinet-card__field .float-field,
.cabinet-card__field .field-stack {
  width: 100%;
}

.float-field--placeholder {
  position: relative;
}

.float-field--placeholder .float-field__label.is-static {
  position: absolute;
  left: 12px;
  top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-dark);
  pointer-events: none;
}

.float-field__placeholder-body {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 22px 12px 6px;
  min-height: 48px;
  display: flex;
  align-items: center;
  background: #fff;
}

.float-field__placeholder-body .inline-placeholder {
  padding: 0;
}

.cabinet-card__notes-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-end;
}

.cabinet-card__notes-row .float-field {
  flex: 1;
}

@media (max-width: 480px) {
  .cabinet-card__notes-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.cabinet-card__remove {
  flex-shrink: 0;
  background: transparent;
  color: var(--danger);
  border: none;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  box-shadow: none;
}

.cabinet-card__remove:hover {
  transform: none;
}

.inline-placeholder {
  color: var(--muted);
  font-style: italic;
  padding: 10px 0;
  font-size: 14px;
}

@media (max-width: 360px) {
  .cabinet-card__grid--dims {
    grid-template-columns: minmax(52px, 64px) repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .cabinet-card__grid--4,
  .cabinet-card__grid--extra {
    grid-template-columns: 1fr 1fr;
  }
}

th,
td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

thead th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}

.ghost {
  background: transparent;
  color: var(--danger);
  border: none;
  padding: 0;
  text-decoration: underline;
}

.empty-state {
  padding: 14px;
  border-radius: 12px;
  background: rgba(127, 180, 50, 0.08);
  border: 1px dashed rgba(127, 180, 50, 0.35);
  color: var(--primary-dark);
  font-weight: 500;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--primary-dark);
  margin: 0 0 6px;
}

.muted {
  color: var(--muted);
}

.footer-help-block {
  max-width: 60rem;
  padding-bottom: 0;
  margin-bottom: 16px;
}

.footer-help {
  margin: 16px 0 0;
  font-size: 15px;
  font-weight: 400;
  text-align: center;
}

.footer-help-note {
  margin: 8px 0 0;
  font-weight: 700;
  text-align: center;
}

.footer-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.footer-terms {
  margin: 0 0 16px;
  font-size: 14px;
  text-align: center;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  background: var(--primary-dark);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.15);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

@media (max-width: 768px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
  }
  .intent-options {
    flex-direction: column;
  }
  .wizard-progress {
    padding: 12px 14px;
  }
  .progress-label {
    font-size: 12px;
  }
  .wizard-nav {
    position: sticky;
    bottom: 0;
    background: var(--card);
    margin-left: -18px;
    margin-right: -18px;
    margin-bottom: -18px;
    padding: 16px 18px;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    z-index: 10;
  }
  table {
    min-width: 800px;
  }
}

