:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --text: #25211c;
  --muted: #6c6257;
  --line: #e6ded3;
  --brand: #d66a3d;
  --brand-dark: #a94925;
  --ok: #207f55;
  --warn: #a15c00;
  --danger: #ad3434;
  --shadow: 0 20px 45px rgba(72, 53, 34, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(214, 106, 61, 0.13), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid rgba(230, 222, 211, 0.85);
  background: rgba(247, 244, 239, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--brand);
  color: white;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-pill,
.notification-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.45rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.notification-pill.has-unread {
  border-color: rgba(214, 106, 61, 0.4);
  background: #fff3ed;
  color: var(--brand-dark);
  font-weight: 700;
}

.button {
  border: 0;
  border-radius: 0.8rem;
  padding: 0.72rem 1rem;
  font-weight: 750;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 10px 20px rgba(214, 106, 61, 0.22);
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
}

.button.danger {
  background: #fff1f1;
  color: var(--danger);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(20rem, 0.75fr);
  gap: 1.25rem;
  align-items: stretch;
}

.hero,
.card {
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.card {
  padding: 1.15rem;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.16;
}

h1 {
  max-width: 52rem;
  font-size: clamp(2rem, 5vw, 4.15rem);
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0.65rem 0 0;
  color: var(--muted);
}

.hero-copy {
  max-width: 46rem;
  margin-top: 1rem;
  font-size: 1.08rem;
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface-soft);
  padding: 0.9rem;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

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

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

.auth-actions,
.row-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.notice {
  border: 1px solid #f0d6b4;
  border-radius: 1rem;
  background: #fff7ea;
  padding: 0.85rem;
  color: #6e4100;
}

.notice.ok {
  border-color: #bfe4cf;
  background: #f0fff7;
  color: #185c3d;
}

.notice.error {
  border-color: #f0c7c7;
  background: #fff4f4;
  color: var(--danger);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(19rem, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.section-list,
.submission-list,
.notification-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.section-card,
.submission-card,
.notification-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface-soft);
  padding: 1rem;
}

.section-card ul,
.checklist {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.section-card li + li,
.checklist li + li {
  margin-top: 0.35rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
}

.form-field label {
  font-weight: 750;
}

textarea {
  min-height: 9rem;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  padding: 0.85rem;
  color: var(--text);
}

textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(214, 106, 61, 0.28);
  outline-offset: 2px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  border-radius: 999px;
  padding: 0.28rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.status.submitted {
  background: #fff3dc;
  color: var(--warn);
}

.status.approved {
  background: #e9f8f0;
  color: var(--ok);
}

.status.needs_changes {
  background: #fff1f1;
  color: var(--danger);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.evidence {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 0.75rem;
  border-left: 3px solid var(--line);
  padding-left: 0.8rem;
  color: var(--text);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 1rem;
  padding: 1rem;
  color: var(--muted);
}

.loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
}

@media (max-width: 860px) {
  .login-layout,
  .dashboard-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    min-width: 10rem;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .hero,
  .card {
    border-radius: 1rem;
  }

  .topbar-actions,
  .auth-actions,
  .row-actions {
    width: 100%;
  }

  .button {
    width: 100%;
  }
}
