:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --ink: #242633;
  --muted: #727584;
  --line: #e3e6ee;
  --brand: #f47a20;
  --brand-dark: #2c1248;
  --accent: #0f7490;
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a:hover {
  color: var(--brand-dark);
}

.app-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(22, 28, 45, 0.04);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  color: var(--ink);
}

.brand-lockup img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: #111;
  border-radius: 8px;
}

.navbar .nav-link {
  color: var(--muted);
  font-weight: 650;
}

.navbar .nav-link:hover {
  color: var(--ink);
}

main {
  padding-top: 2rem;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.lead {
  max-width: 780px;
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card,
.panel,
.quote-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(28, 35, 60, 0.06);
}

.metric-card {
  padding: 1.1rem;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.55rem;
  line-height: 1.1;
}

.panel,
.quote-preview {
  padding: 1.25rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-header h2,
.form-panel h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.panel-header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.app-table {
  margin-bottom: 0;
}

.app-table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.app-table td,
.app-table th {
  padding: 0.9rem 0.8rem;
}

.status-pill {
  display: inline-flex;
  min-width: 86px;
  justify-content: center;
  border: 1px solid #bdece5;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: #ecfffb;
  color: #087466;
  font-size: 0.82rem;
  font-weight: 800;
}

.form-panel h2 {
  margin: 1rem 0 0.9rem;
}

.form-panel h2:first-of-type {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0.9rem;
}

.section-header h2 {
  margin: 0;
}

.quote-line-list {
  display: grid;
  gap: 0.85rem;
}

.quote-line-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(220px, 1.35fr) 90px 105px 135px 140px 70px;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.quote-line-row .form-label {
  min-height: 1.2rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
}

.line-total {
  display: block;
  min-height: 43px;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: right;
  font-weight: 800;
}

.line-remove {
  display: flex;
  align-items: end;
  min-height: 74px;
}

.quote-total-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
  margin: 1rem 0 1.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quote-total-bar span {
  color: var(--muted);
  font-weight: 800;
}

.quote-total-bar strong {
  font-size: 1.35rem;
}

.span-2 {
  grid-column: span 2;
}

.form-control {
  border-color: var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(15, 116, 144, 0.14);
}

.form-label {
  color: var(--muted);
  font-weight: 700;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.btn {
  border-radius: 8px;
  font-weight: 750;
}

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

.btn-primary:hover {
  background: #1f0b35;
  border-color: #1f0b35;
}

.quote-preview {
  max-width: 980px;
  margin: 0 auto;
}

.quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.quote-header img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  background: #111;
  border-radius: 8px;
}

.quote-header div {
  text-align: right;
}

.quote-header strong {
  display: block;
  font-size: 1.6rem;
  text-transform: uppercase;
}

.quote-header span,
.quote-meta span {
  color: var(--muted);
}

.quote-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.quote-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
}

.quote-meta strong {
  display: block;
  margin-top: 0.2rem;
}

.quote-greeting {
  margin-top: 1rem;
  font-weight: 750;
}

.footer {
  margin-top: 3rem;
  padding: 1rem 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .metric-grid,
  .quote-meta,
  .form-grid,
  .quote-line-row {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .page-heading,
  .panel-header,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .line-remove {
    min-height: auto;
  }

  .quote-total-bar {
    justify-content: space-between;
  }
}
