:root {
  color-scheme: light;
  --ink: #16211d;
  --muted: #66736d;
  --line: #dce4df;
  --panel: #ffffff;
  --wash: #eef3ef;
  --accent: #0f766e;
  --accent-dark: #0b504b;
  --warning: #c8752a;
  --steel: #475569;
  --shadow: 0 18px 45px rgba(22, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.11), rgba(200, 117, 42, 0.08)),
    var(--wash);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #17231f;
  color: #f7fbf8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e8c067;
  color: #17231f;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.brand p {
  color: #b8c5bf;
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-grid div {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.metric-grid strong {
  display: block;
  font-size: 24px;
}

.metric-grid span {
  color: #b8c5bf;
  font-size: 12px;
}

.job-list {
  display: grid;
  gap: 10px;
}

.job-card {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 14px;
}

.job-card.active {
  border-color: #e8c067;
  background: rgba(232, 192, 103, 0.14);
}

.job-card span,
.job-card small {
  display: block;
}

.job-card small {
  margin-top: 4px;
  color: #b8c5bf;
}

.workspace {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.topbar h2 {
  max-width: 780px;
  font-size: 28px;
  line-height: 1.15;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-pill {
  min-width: 148px;
  text-align: center;
  color: #ffffff;
  background: var(--accent-dark);
  border-radius: 8px;
  padding: 10px 12px;
  text-transform: capitalize;
}

.persistence-warning {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d59b5f;
  border-radius: 8px;
  background: rgba(200, 117, 42, 0.16);
  color: #7a3d06;
  font-size: 14px;
  line-height: 1.4;
}

.persistence-warning strong {
  white-space: nowrap;
}

.privacy-notice {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #8aa3b8;
  border-radius: 8px;
  background: rgba(90, 130, 160, 0.12);
  color: #334e63;
  font-size: 14px;
  line-height: 1.4;
}

.privacy-notice strong {
  white-space: nowrap;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.pipeline-step {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pipeline-step.complete {
  background: rgba(15, 118, 110, 0.13);
  color: var(--accent-dark);
}

.pipeline-step.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel h3 {
  font-size: 20px;
}

.capture-form {
  display: grid;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--steel);
  font-size: 13px;
  font-weight: 700;
}

label small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

label small a {
  color: var(--accent-dark);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfdfc;
}

textarea {
  resize: vertical;
  min-height: 144px;
}

.media-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.file-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  padding: 13px 16px;
  background: var(--accent);
  color: #ffffff;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary-button,
.file-button {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--accent-dark);
  background: #dbece8;
}

.secondary-button.compact {
  min-height: 36px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #efe4ca;
  color: #6e451a;
  font-size: 20px;
}

.file-button input {
  display: none;
}

.photo-strip {
  display: flex;
  gap: 8px;
  min-height: 0;
}

.photo-strip img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 8px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.empty-state strong {
  color: var(--ink);
}

.draft-layout {
  display: grid;
  gap: 14px;
}

.summary-block,
.invoice-preview,
.message-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfc;
}

.summary-block h4 {
  margin: 4px 0 8px;
  font-size: 18px;
}

.invoice-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.invoice-top strong,
.invoice-top span {
  display: block;
}

.invoice-top > span {
  font-size: 26px;
  font-weight: 900;
  color: var(--accent-dark);
}

.line-items {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.line-item {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.6fr;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.line-item strong {
  text-align: right;
}

.message-preview p:last-child {
  margin-top: 8px;
  line-height: 1.6;
}

.privacy-shell {
  padding: 40px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.privacy-panel {
  max-width: 880px;
  width: 100%;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 36px;
}

.privacy-panel h3,
.privacy-panel h4 {
  margin: 24px 0 12px;
}

.privacy-panel p,
.privacy-panel li {
  line-height: 1.75;
  color: var(--ink);
}

.privacy-panel ul {
  margin: 0;
  padding-left: 20px;
}

.effective-date {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.policy-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdfc;
}

.policy-table > div {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(0, 1.3fr);
  border-top: 1px solid var(--line);
}

.policy-table > div:first-child {
  border-top: 0;
  background: rgba(15, 118, 110, 0.08);
}

.policy-table strong,
.policy-table span {
  padding: 12px 14px;
  line-height: 1.6;
}

.policy-table strong:first-child,
.policy-table span:first-child {
  border-right: 1px solid var(--line);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.legal-links a {
  font-weight: 800;
}

.page-footer {
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}

.footer-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .app-shell,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .invoice-top {
    align-items: stretch;
    flex-direction: column;
  }

  .persistence-warning,
  .privacy-notice {
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .pipeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .field-row,
  .line-item,
  .policy-table > div {
    grid-template-columns: 1fr;
  }

  .policy-table strong:first-child,
  .policy-table span:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .line-item strong {
    text-align: left;
  }
}
