@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --terracotta: #B5541C;
  --terracotta-deep: #8F4116;
  --ink: #211C18;
  --paper: #FBF7F2;
  --card: #FFFFFF;
  --line: #EAE1D6;
  --muted: #8C8074;
  --green: #4C7A5B;
  --amber: #B5841C;
  --shadow: 0 1px 2px rgba(33, 28, 24, 0.04), 0 12px 32px -16px rgba(33, 28, 24, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background:
    radial-gradient(1200px 480px at 50% -180px, rgba(181, 84, 28, 0.07), transparent 70%),
    var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 100px;
}

.masthead {
  text-align: center;
  margin-bottom: 40px;
}

.masthead .tagline {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 10px;
  font-weight: 600;
}

.masthead .studio {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.masthead .rule {
  width: 40px;
  height: 2px;
  background: var(--terracotta);
  margin: 18px auto 0;
  border-radius: 2px;
}

.header-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.header-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--terracotta), var(--terracotta-deep));
}

.header-card h1 {
  margin: 10px 0 6px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.header-card .meta {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  background: rgba(181, 84, 28, 0.1);
  color: var(--terracotta-deep);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 16px;
  border-radius: 999px;
}

.progress-track {
  height: 5px;
  background: var(--line);
  border-radius: 999px;
  margin-top: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--terracotta-deep), var(--terracotta));
  border-radius: 999px;
  transition: width 0.5s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.03em;
}

section.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 36px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

section.panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terracotta-deep);
  font-weight: 700;
  margin: 0 0 22px;
}

.empty-note {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* Timeline */
.stage-row {
  display: flex;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.stage-row:first-of-type { border-top: none; padding-top: 0; }

.stage-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 12px;
  flex-shrink: 0;
}

.stage-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--card);
  margin-top: 4px;
  flex-shrink: 0;
}

.stage-dot.complete { background: var(--green); border-color: var(--green); }
.stage-dot.in-progress { background: var(--terracotta); border-color: var(--terracotta); box-shadow: 0 0 0 4px rgba(181, 84, 28, 0.14); }

.stage-connector {
  flex: 1;
  width: 2px;
  background: var(--line);
  margin-top: 4px;
}

.stage-row:last-of-type .stage-connector { display: none; }

.stage-body { flex: 1; padding-bottom: 4px; }

.stage-name {
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.005em;
}

.stage-status {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
  display: inline-block;
}

.stage-status.complete { color: var(--green); }
.stage-status.in-progress { color: var(--terracotta-deep); }
.stage-status.pending { color: var(--muted); }

.stage-summary {
  color: #5B5248;
  font-size: 14.5px;
  margin-top: 6px;
}

/* Invoice */
.invoice-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
}

.invoice-card .amount {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.invoice-pill {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: 999px;
}

.invoice-pill.paid { background: rgba(76, 122, 91, 0.12); color: var(--green); }
.invoice-pill.due, .invoice-pill.sent { background: rgba(181, 132, 28, 0.14); color: var(--amber); }
.invoice-pill.overdue { background: rgba(181, 28, 28, 0.12); color: #B51C1C; }
.invoice-pill.awaiting-signature { background: rgba(181, 132, 28, 0.14); color: var(--amber); }
.invoice-pill.signed, .invoice-pill.shared { background: rgba(76, 122, 91, 0.12); color: var(--green); }
.invoice-pill.not-yet-issued, .invoice-pill.ordered { background: rgba(140, 128, 116, 0.14); color: var(--muted); }
.invoice-pill.in-production { background: rgba(140, 128, 116, 0.14); color: #5B5248; }
.invoice-pill.delivered, .invoice-pill.installed { background: rgba(76, 122, 91, 0.12); color: var(--green); }

/* Procurement */
.procurement-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.procurement-row:first-of-type { border-top: none; padding-top: 0; }

.procurement-info .item-name { font-weight: 700; font-size: 15px; }
.procurement-info .item-meta { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

/* Site log */
.visit-block {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.visit-block:first-of-type { border-top: none; padding-top: 0; }

.visit-title { font-weight: 700; font-size: 15.5px; }
.visit-date { color: var(--terracotta-deep); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.visit-notes { color: #5B5248; font-size: 14.5px; margin-top: 8px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.photo-grid img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* Documents */
.document-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.document-row:first-of-type { border-top: none; padding-top: 0; }

.document-info .doc-name { font-weight: 700; font-size: 15px; }
.document-info .doc-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }

.doc-link {
  color: var(--terracotta-deep);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.doc-link:hover { text-decoration: underline; }

.contact-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 44px;
}

.footer .rule {
  width: 40px;
  height: 1px;
  background: var(--line);
  margin: 0 auto 20px;
}

.state-message {
  text-align: center;
  padding: 100px 24px;
  color: var(--muted);
  font-size: 15px;
}
