@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700;9..144,900&family=Sora:wght@400;500;600;700&display=swap");

:root {
  --bg: #f5efe3;
  --paper: #fffaf2;
  --ink: #1d1f22;
  --muted: #666d73;
  --brand: #005e52;
  --brand-2: #d4542d;
  --line: #d9d2c2;
  --ok: #1f7a45;
  --warn: #a35a00;
  --err: #b42318;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 16px 42px rgba(30, 30, 30, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 5% -5%, #f7caa6 0%, transparent 55%),
    radial-gradient(900px 500px at 95% 0%, #b9ebdf 0%, transparent 48%),
    var(--bg);
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, serif;
  margin: 0;
  letter-spacing: 0.01em;
}

a { color: inherit; text-decoration: none; }

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(6px);
  background: color-mix(in srgb, #fffaf2 88%, transparent);
  border-bottom: 1px solid #ebe3d4;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--brand);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nav-link {
  padding: 0.5rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
}

.nav-link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.nav-button {
  font: inherit;
  cursor: pointer;
}

main.shell {
  padding: 1.25rem 0 3rem;
}

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

.page-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

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

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

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.metric {
  font-size: 2rem;
  line-height: 1;
  color: var(--brand);
  margin-top: 0.5rem;
}

.muted { color: var(--muted); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

input[type="text"],
input[type="email"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.66rem 0.75rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

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

label {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}

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

.form-grid .full { grid-column: 1 / -1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.55rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(115deg, var(--brand), #027462);
  border-color: #01594d;
  color: #fff;
}

.btn-danger {
  border-color: #f2d0cc;
  background: #fff5f4;
  color: var(--err);
}

.btn:hover { filter: brightness(0.98); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.table th,
.table td {
  text-align: left;
  padding: 0.7rem;
  border-bottom: 1px solid #ece4d5;
  font-size: 0.93rem;
  vertical-align: top;
}

.table th {
  color: #50555b;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-pending { background: #ffefcc; color: #8b5200; }
.badge-processing { background: #dbecff; color: #004b8f; }
.badge-complete { background: #d6f6e4; color: #0d6a36; }
.badge-failed { background: #ffe0dc; color: #9f1d1d; }

.flash {
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  background: #fff;
}

.flash-notice { border-color: #bfe8cd; background: #f4fff8; }
.flash-alert { border-color: #f6c8c1; background: #fff7f6; }

.error-box {
  border: 1px solid #f4c3bc;
  background: #fff6f5;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.8rem;
}

@media (max-width: 900px) {
  .grid-3,
  .grid-4,
  .grid-2,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: start;
  }
}
