:root {
  --green: #145f4d;
  --green2: #0d493b;
  --mint: #dff1e8;
  --cream: #f7f3ea;
  --ink: #17312d;
  --muted: #667773;
  --orange: #e27a3f;
  --white: #fff;
  --line: #d9e2dc;
  --danger: #aa3e3e;
  --shadow: 0 12px 34px rgba(24, 61, 52, 0.12);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, #d9eee4 0, transparent 38%),
    var(--cream);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.shell {
  max-width: 1100px;
  margin: auto;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(247, 243, 234, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(20, 95, 77, 0.12);
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  font-weight: 800;
}
.paw {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: var(--green);
  color: white;
  font-size: 24px;
  box-shadow: var(--shadow);
}
.brand small {
  display: block;
  color: var(--muted);
  font-weight: 600;
}
.hero {
  padding: 34px 20px 22px;
}
.hero h1 {
  font-size: clamp(2rem, 7vw, 4.2rem);
  letter-spacing: -0.055em;
  line-height: 0.95;
  margin: 0;
  max-width: 760px;
}
.hero p {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.65;
}
.hero-card {
  background: linear-gradient(135deg, var(--green), #238266);
  color: white;
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-card p {
  color: #e7f6ef;
}
.hero-card:after {
  content: "🐾";
  position: absolute;
  right: -12px;
  bottom: -38px;
  font-size: 130px;
  opacity: 0.12;
  transform: rotate(-12deg);
}
.grid {
  display: grid;
  gap: 16px;
}
.cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding: 0 20px 24px;
}
.card,
.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(20, 95, 77, 0.1);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 7px 22px rgba(24, 61, 52, 0.07);
}
.card h3,
.panel h2 {
  margin: 0.2rem 0 0.5rem;
}
.metric {
  font-size: 2rem;
  font-weight: 850;
  color: var(--green);
}
.muted {
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  font-weight: 750;
  background: var(--green);
  color: white;
}
.btn:hover {
  background: var(--green2);
}
.btn.secondary {
  background: var(--mint);
  color: var(--green2);
}
.btn.ghost {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--line);
}
.btn.orange {
  background: var(--orange);
}
.btn.danger {
  background: var(--danger);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.govbr-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: #1351b4;
}
.govbr-btn:hover { background: #0c326f; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.auth-note { font-size: .82rem; text-align: center; margin: 8px 0 0; }
.content {
  padding: 0 20px 110px;
}
.nav {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(96%, 760px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 7px;
  box-shadow: var(--shadow);
}
.nav button {
  border: 0;
  background: transparent;
  padding: 9px 4px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.72rem;
}
.nav button span {
  display: block;
  font-size: 1.25rem;
}
.nav button.active {
  background: var(--mint);
  color: var(--green);
  font-weight: 800;
}
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(100%, 440px);
  background: white;
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  font-size: 2.1rem;
  margin: 0.3rem 0;
}
.field {
  display: grid;
  gap: 7px;
  margin: 13px 0;
}
.field label {
  font-size: 0.88rem;
  font-weight: 750;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
}
.field textarea {
  min-height: 90px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(20, 95, 77, 0.13);
  border-color: var(--green);
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.animal-list,
.campaign-list,
.notification-list {
  display: grid;
  gap: 12px;
}
.animal {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 14px;
  align-items: center;
}
.animal-photo {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--mint);
  font-size: 32px;
  object-fit: cover;
}
.animal h3 {
  margin: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green2);
  font-size: 0.75rem;
  font-weight: 800;
}
.badge.warn {
  background: #ffeadc;
  color: #8e441e;
}
.badge.gray {
  background: #edf0ee;
  color: #5e6b67;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 35, 29, 0.62);
  display: grid;
  place-items: end center;
  padding: 18px;
}
.modal-card {
  width: min(100%, 680px);
  max-height: 92vh;
  overflow: auto;
  background: var(--cream);
  border-radius: 26px 26px 18px 18px;
  padding: 22px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.icon-btn {
  border: 0;
  background: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
}
.hidden {
  display: none !important;
}
.campaign {
  border-left: 5px solid var(--orange);
}
.campaign h3 {
  margin: 0.2rem 0;
}
.capacity-grid { display: grid; gap: 6px; margin: 12px 0; padding: 12px; border-radius: 14px; background: #f3f8f5; font-size: .86rem; }
.capacity-grid span { display: block; }
.capacity-editor { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.municipal-filters { display: grid; grid-template-columns: minmax(220px,2fr) 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.cpf-lookup { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; }
.census-review .panel { border: 2px solid #f0a247; background: #fffaf1; }
.success-note ul { margin: 10px 0; padding-left: 20px; max-height: 190px; overflow: auto; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }
.success-note, .error-note { padding: 11px 12px; border-radius: 12px; }
.success-note { background: #e7f6ee; color: #145f4d; }
.error-note { background: #fff0e7; color: #8e441e; }
.full-panel { grid-column: 1 / -1; }
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notice .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 7px;
}
.admin-only {
  border: 2px solid rgba(226, 122, 63, 0.25);
}
.census-center {
  border: 2px solid rgba(20, 95, 77, 0.28);
  background: linear-gradient(135deg, #ffffff, #edf8f3);
}
.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th,
.table td {
  text-align: left;
  padding: 11px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
  pointer-events: none;
  max-width: 90%;
  background: #183b33;
  color: white;
  border-radius: 13px;
  padding: 12px 16px;
  transition: 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.id-card {
  width: 100%;
  aspect-ratio: 1.58;
  background: linear-gradient(135deg, #fffaf0, #dff1e8);
  border: 2px solid var(--green);
  border-radius: 22px;
  padding: 22px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.id-card:after {
  content: "SJA";
  position: absolute;
  right: -10px;
  bottom: -28px;
  font-size: 90px;
  font-weight: 900;
  color: rgba(20, 95, 77, 0.08);
}
.id-photo {
  width: 110px;
  height: 110px;
  border-radius: 18px;
  background: white;
  display: grid;
  place-items: center;
  font-size: 52px;
  object-fit: cover;
}
.id-card h2 {
  margin: 0;
  color: var(--green);
}
.check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--muted);
}
.check input {
  margin-top: 3px;
}
.check a,
.legal-links a {
  color: var(--green);
  font-weight: 750;
}
.legal-links {
  text-align: center;
  font-size: 0.8rem;
  margin-top: 18px;
}
.legal-page {
  max-width: 820px;
  margin: 36px auto;
  padding: 28px;
  line-height: 1.65;
}
.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}
.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.minute-list { display: grid; gap: 10px; }
.minute-row { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; color: inherit; cursor: pointer; }
.minute-row:hover { border-color: var(--green); background: #f7fbf9; }
.minute-row div { display: grid; gap: 4px; }
.minute-row span { color: var(--muted); font-size: .85rem; }
.minute-row .badge { color: var(--green); white-space: nowrap; }
.minute-sections { border-top: 1px solid var(--line); margin-top: 18px; }
.minute-sections h3, .modal-card > h3 { color: var(--green); margin-bottom: 5px; }
.minute-sections p { margin-top: 0; line-height: 1.55; }
.people-list { display: grid; gap: 8px; }
.people-list > div { display: grid; padding: 10px 12px; background: #f6faf8; border-radius: 12px; }
.people-list span, .people-list small { color: var(--muted); }
.minute-actions { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.attendance-grid { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 640px) {
  .municipal-filters, .cpf-lookup { grid-template-columns: 1fr; }
  .two {
    grid-template-columns: 1fr;
  }
  .animal {
    grid-template-columns: 56px 1fr;
  }
  .animal .actions {
    grid-column: 1/-1;
  }
  .hero {
    padding-top: 22px;
  }
  .topbar .user-name {
    display: none;
  }
  .id-card {
    grid-template-columns: 80px 1fr;
    padding: 15px;
  }
  .id-photo {
    width: 80px;
    height: 80px;
  }
  .nav {
    bottom: 6px;
  }
}
