:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --line: #e4eaf5;
  --text: #1f2a44;
  --muted: #7f8aa3;
  --accent: #6a8cff;
  --accent-strong: #4f73f3;
  --danger: #ef6b7b;
  --success: #3bb58f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef3ff 45%, #f8fbff 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container.shell { width: min(1120px, 92%); margin: 0 auto; }
body > .container.shell { flex: 1; display: flex; width: min(1120px, 92%); }

.iframe-main .container.shell {
  width: 100%;
  max-width: none;
  padding: 0 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar .shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.brand { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: .2px; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { color: #64748b; text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--accent-strong); }
.nav-links span { color: #334155; font-weight: 600; }

main { padding: 28px 0 48px; flex: 1; width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(80, 109, 177, .08);
}

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

.btn-primary {
  display: inline-block;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79, 115, 243, .28); }

.btn-link {
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
}
.btn-link:hover { color: var(--accent-strong); }

.form-grid { display: grid; gap: 12px; margin-top: 10px; }

input, textarea {
  width: 100%;
  margin-top: 6px;
  background: #f9fbff;
  color: var(--text);
  border: 1px solid #d8e2f3;
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
input:focus, textarea:focus { border-color: #9bb4ff; box-shadow: 0 0 0 3px rgba(106, 140, 255, .18); }

.alert {
  margin-top: 12px;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 500;
}
.alert.err { background: #fff1f3; border: 1px solid #ffd3da; color: #b4233a; }
.alert.ok { background: #edfdf6; border: 1px solid #c5f0dc; color: #177f5d; }
.field-validation {
  display: block;
  margin-top: 4px;
  color: #dc2626;
  font-size: .86rem;
  font-weight: 600;
}
.field-validation-valid { display: none; }
.validation-summary-errors,
.validation-summary-valid {
  color: #dc2626;
}

.listing-page {
  background: #f2f5fb;
  color: #1f2937;
  border: 1px solid #e0e7f2;
  border-radius: 16px;
  padding: 22px;
}

.listing-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
  align-items: start;
}

.filter-box {
  background: #ffffff;
  border: 1px solid #dfe6f2;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(89, 112, 158, .08);
}

.filter-box h3 { margin: 0 0 12px; font-size: 1.5rem; color: #1f2a44; }
.filter-title { text-transform: uppercase; color: #93a0b8; font-size: .72rem; font-weight: 700; }
.filter-box label { display: block; margin-top: 8px; color: #334155; }
.filter-option { display: flex !important; align-items: center; gap: 8px; }
.filter-option input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: #6a8cff; }

.latest-title { margin: 0 0 12px; color: #1f2a44; }
.latest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.latest-head .latest-title { margin: 0; }

.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.pet-card {
  background: #fff;
  border: 1px solid #e3eaf4;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(78, 104, 150, .10);
}

.image-wrap { position: relative; }
.status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .7rem;
  font-weight: 700;
}
.status-badge.found { background: var(--success); }

.listing-image {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: #e3e9f7;
}

.pet-content { padding: 14px; }
.pet-content h3 { margin: 0 0 4px; color: #17233d; }
.breed { margin: 0; color: #7b879f; }
.location { color: #53627d; margin: 12px 0; font-size: .95rem; }

.pet-actions { display: grid; grid-template-columns: 1fr 40px; gap: 8px; }
.seen-btn {
  border: 0;
  border-radius: 12px;
  background: #ff9359;
  color: #fff;
  font-weight: 700;
  padding: 10px;
}
.info-btn {
  border: 0;
  border-radius: 12px;
  background: #eef3fb;
  color: #60708f;
  font-weight: 700;
}

.fab-add {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 2rem;
  line-height: 1;
  background: linear-gradient(145deg, #7ea0ff, #5a80f7);
  color: #fff;
  box-shadow: 0 12px 24px rgba(90, 128, 247, .35);
}

.card-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.listing h3 { margin: 0 0 6px; }

.footer {
  border-top: 1px solid #dde5f3;
  color: #7d8aa3;
  padding: 16px 0 24px;
  margin-top: auto;
  background: rgba(255, 255, 255, .65);
}

@media (max-width: 900px) {
  .listing-layout { grid-template-columns: 1fr; }
}