:root {
  --bg: #f2ead6;
  --surface: #fffaf0;
  --surface-2: #f8efd9;
  --ink: #173f38;
  --muted: #65736d;
  --line: #dcc994;
  --green: #176c43;
  --green-2: #0b5657;
  --yellow: #f1c84b;
  --danger: #a83c35;
  --shadow: 0 12px 32px rgba(44, 58, 47, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #fff8df 0, var(--bg) 48%, #d8e8d5 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
a { color: var(--green); }
button, input, select, textarea { font: inherit; }
button, .button {
  border: 0;
  border-radius: 10px;
  padding: .7rem 1rem;
  cursor: pointer;
  background: var(--green);
  color: white;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
button.secondary, .button.secondary { background: var(--green-2); }
button.warning { background: #9a7116; }
button.danger { background: var(--danger); }
button.ghost { background: transparent; color: var(--green); border: 1px solid var(--line); }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: .72rem .8rem;
  border-radius: 10px;
}
textarea { min-height: 90px; resize: vertical; }
label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 700; }
small, .muted { color: var(--muted); }
.container { width: min(1480px, calc(100% - 28px)); margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(7, 72, 68, .96);
  color: white;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.topbar .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 0;
}
.brand { font-size: 1.2rem; font-weight: 900; letter-spacing: .01em; }
.topbar nav { display: flex; gap: .45rem; flex-wrap: wrap; margin-left: auto; }
.topbar nav a {
  color: white;
  text-decoration: none;
  padding: .45rem .7rem;
  border-radius: 8px;
}
.topbar nav a:hover { background: rgba(255,255,255,.12); }
.hero { padding: 2rem 0 1rem; }
.hero h1 { margin: 0 0 .25rem; }
.notice {
  margin: 1rem 0;
  padding: .8rem 1rem;
  background: #e7f5d8;
  border: 1px solid #a7cd82;
  border-radius: 12px;
  font-weight: 700;
}
.alert {
  padding: .9rem 1rem;
  border: 1px solid #d29b8d;
  background: #fff0eb;
  border-radius: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: 1.7rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1.4rem;
}
.card h2 { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: .75rem; }
.form-grid .wide { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: .55rem; align-self: end; }
.checkbox input { width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 130px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; background: white; }
th, td { text-align: left; padding: .72rem; border-bottom: 1px solid #eadfbe; vertical-align: top; }
th { background: #e9f0df; position: sticky; top: 0; z-index: 1; }
tr:last-child td { border-bottom: 0; }
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: .22rem .55rem;
  background: #dce9da;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge.danger { background: #f4d1c9; color: #7c2924; }
.badge.warning { background: #f7e7b3; color: #765309; }
.badge.info { background: #d7ecf4; color: #185469; }
details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: .65rem;
}
details + details { margin-top: .6rem; }
summary { cursor: pointer; font-weight: 800; }
.login-shell, .legal-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card, .legal-card {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.legal-card { width: min(900px, 100%); }
.login-card form { display: grid; gap: .9rem; }
.logo-panel {
  background: var(--green-2);
  color: white;
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}
pre {
  max-width: 100%;
  overflow: auto;
  background: #153d37;
  color: #e8f5ec;
  padding: .75rem;
  border-radius: 10px;
}
footer { padding: 2rem 0; color: var(--muted); text-align: center; }

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .topbar .container { align-items: flex-start; flex-direction: column; }
  .topbar nav { margin-left: 0; }
}
@media (max-width: 560px) {
  .stats, .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: span 1; }
}

.landing-card { text-align: center; }
.landing-links { display: grid; gap: .75rem; margin: 1.5rem auto; max-width: 32rem; }
a.button { display: inline-block; text-align: center; }
a.button.secondary { background: #155e75; }
a.button.danger { background: #a33a32; }
