:root {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: #1f2322;
  background:
    radial-gradient(circle at top, rgba(232, 123, 35, 0.2), transparent 24%),
    linear-gradient(180deg, #f7f1e6 0%, #ebe4d7 100%);
  line-height: 1.4;
  font-weight: 400;
  color-scheme: light;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --ink: #1f2322;
  --muted: #6b6b66;
  --panel: rgba(255, 252, 245, 0.9);
  --panel-strong: #fffdf8;
  --line: rgba(31, 35, 34, 0.1);
  --accent: #c6591b;
  --accent-dark: #8b3910;
  --olive: #4f5a3a;
  --shadow: 0 18px 40px rgba(63, 46, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

#root {
  min-height: 100vh;
}

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1rem;
}

.topbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topbar h1,
.section-header h2,
.section-header h3,
.hero-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent-dark);
}

.subtitle,
.topbar-card p,
.project-card p,
.project-card small,
.detail-block p,
.task-card p,
.task-card small,
.contact-card p,
.contact-card small {
  color: var(--muted);
}

.topbar-card,
.panel,
.hero-card,
.mini-card,
.contact-card,
.task-card,
.detail-block,
.report-detail,
.history-item,
.project-card,
.photo-slot,
.delivery-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar-card {
  padding: 1rem;
}

.pill,
.count-chip,
.status,
.percent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.78rem;
}

.pill,
.count-chip {
  padding: 0.32rem 0.7rem;
  background: rgba(198, 89, 27, 0.12);
  color: var(--accent-dark);
}

.layout {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1rem;
}

.section-header,
.project-card-row,
.subsection-header,
.report-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.project-list,
.stacked-form,
.section-block,
.cards-grid,
.history-list,
.report-detail,
.mini-list,
.subsection {
  display: grid;
  gap: 0.75rem;
}

.project-card,
.history-item {
  text-align: left;
  width: 100%;
  padding: 0.9rem;
}

.project-card.active,
.history-item.active {
  border-color: rgba(198, 89, 27, 0.5);
  background: var(--panel-strong);
}

.status {
  padding: 0.25rem 0.6rem;
  border: 1px solid transparent;
}

.status-active {
  background: rgba(79, 90, 58, 0.14);
  color: var(--olive);
}

.status-planning {
  background: rgba(198, 89, 27, 0.12);
  color: var(--accent-dark);
}

.status-closed {
  background: rgba(31, 35, 34, 0.08);
  color: var(--ink);
}

.stacked-form label,
.signature-box {
  display: grid;
  gap: 0.35rem;
  color: var(--ink);
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(31, 35, 34, 0.15);
  background: rgba(255, 255, 255, 0.8);
}

textarea {
  resize: vertical;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
  padding: 0.8rem 1rem;
  border: none;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, #b24a0e 100%);
  color: white;
}

.secondary-button {
  background: var(--olive);
  color: white;
}

.ghost-button {
  background: rgba(31, 35, 34, 0.06);
  color: var(--ink);
}

.hero-card {
  padding: 1rem;
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero-stats,
.checkbox-row,
.report-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-stats div,
.report-metadata span {
  min-width: 92px;
  padding: 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
}

.hero-stats strong,
.mini-card strong {
  display: block;
  font-size: 1.1rem;
}

.info-grid,
.cards-grid,
.report-detail-grid {
  display: grid;
  gap: 0.75rem;
}

.mini-card,
.contact-card,
.task-card,
.detail-block,
.photo-slot,
.delivery-card {
  padding: 0.9rem;
}

.mini-card span,
.contact-card span,
.contact-card a,
.task-card span,
.mini-list span {
  display: block;
}

.inset {
  margin-top: 0.5rem;
  padding: 0.9rem;
  border: 1px dashed rgba(31, 35, 34, 0.14);
  border-radius: 18px;
}

.grid {
  display: grid;
  gap: 0.75rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox input {
  width: auto;
}

.incident-box {
  padding: 0.8rem;
  border-radius: 14px;
  background: rgba(198, 89, 27, 0.08);
}

.photo-box,
.signature-placeholder {
  min-height: 112px;
  border-radius: 16px;
  border: 1px dashed rgba(31, 35, 34, 0.2);
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(45deg, rgba(31, 35, 34, 0.02) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(31, 35, 34, 0.02) 25%, transparent 25%),
    rgba(255, 255, 255, 0.7);
  background-size: 22px 22px;
}

.history-layout {
  display: grid;
  gap: 0.75rem;
}

.history-item strong,
.history-item span,
.history-item small {
  display: block;
}

.report-detail {
  padding: 1rem;
}

.notice-letter {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(198, 89, 27, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 241, 232, 0.96));
}

.notice-letter-header,
.notice-meta-row,
.notice-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.notice-logo {
  min-width: 120px;
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #b24a0e 100%);
  color: white;
}

.notice-logo strong,
.notice-logo small,
.notice-recipient-list span {
  display: block;
}

.notice-body-grid {
  display: grid;
  gap: 0.75rem;
}

.notice-section {
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 35, 34, 0.08);
}

.notice-section p:last-child,
.notice-recipient-list p:last-child {
  margin-bottom: 0;
}

.notice-recipient-list {
  padding-top: 0.25rem;
  border-top: 1px dashed rgba(31, 35, 34, 0.12);
}

.notice-recipient-list div {
  display: grid;
  gap: 0.35rem;
}

.risk-engine-card {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.1rem;
  margin: 0.35rem 0 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(31, 35, 34, 0.1);
  background: linear-gradient(135deg, rgba(210, 168, 97, 0.14), rgba(255, 255, 255, 0.96));
  box-shadow: var(--shadow);
}

.risk-engine-card h4 {
  margin: 0.15rem 0 0;
}

.risk-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-pill.muted {
  background: rgba(90, 83, 74, 0.08);
  color: var(--muted);
  border-color: rgba(90, 83, 74, 0.12);
}

.status-pill.success {
  background: rgba(79, 124, 96, 0.15);
  color: #2d614b;
  border-color: rgba(79, 124, 96, 0.24);
}

.status-pill.warning {
  background: rgba(210, 168, 97, 0.18);
  color: #7b5312;
  border-color: rgba(210, 168, 97, 0.28);
}

.status-pill.danger {
  background: rgba(171, 74, 60, 0.15);
  color: #8f2f22;
  border-color: rgba(171, 74, 60, 0.25);
}

.impact-grid {
  display: grid;
  gap: 0.8rem;
}

.impact-grid article {
  padding: 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(31, 35, 34, 0.08);
}

.impact-grid strong {
  display: block;
  margin-bottom: 0.35rem;
}

.impact-grid p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.percent-badge {
  min-width: 92px;
  padding: 0.5rem 0.85rem;
  background: rgba(79, 90, 58, 0.12);
  color: var(--olive);
}

.detail-block h5,
.mini-list h5 {
  margin: 0 0 0.45rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 40vh;
  text-align: center;
}

@media (min-width: 780px) {
  .app-shell {
    padding: 1.5rem;
  }

  .topbar {
    grid-template-columns: 1.5fr 1fr;
    align-items: start;
  }

  .layout {
    grid-template-columns: minmax(320px, 390px) 1fr;
    align-items: start;
  }

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

  .three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .info-grid,
  .cards-grid,
  .report-detail-grid,
  .notice-body-grid,
  .impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-layout {
    grid-template-columns: minmax(250px, 320px) 1fr;
  }

  .hero-card {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
  }
}
