:root {
  --ink: #181b1f;
  --paper: #f4f7f5;
  --line: #dce5e0;
  --muted: #64707d;
  --mint: #227c62;
  --ocean: #12677a;
  --coral: #c9435c;
  --lemon: #c08b16;
  --white: #ffffff;
  --surface-soft: #eef5f1;
  --shadow: 0 18px 45px rgb(24 27 31 / 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgb(34 124 98 / 0.13), transparent 360px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

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

img {
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
  padding: 24px 16px;
}

.auth-layout {
  display: grid;
  gap: 18px;
  width: min(100%, 1080px);
  margin: 0 auto;
}

@media (min-width: 860px) {
  .auth-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
    align-items: stretch;
  }
}

.brand-panel,
.auth-card,
.content-card,
.stat-card,
.side-nav {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.brand-panel {
  overflow: hidden;
}

.brand-image {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #e8f3ef;
}

@media (min-width: 860px) {
  .brand-image {
    height: 100%;
    min-height: 580px;
  }
}

.brand-copy {
  padding: 22px;
}

.site-logo {
  display: block;
  width: min(100%, 360px);
  height: auto;
}

.brand-copy-logo {
  margin-bottom: 18px;
}

.auth-logo {
  margin-bottom: 20px;
}

.brand-copy h1,
.auth-card h1,
.page-header h1 {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1.05;
}

.auth-card h1,
.page-header h1 {
  font-size: 34px;
}

@media (min-width: 760px) {
  .brand-copy h1,
  .page-header h1 {
    font-size: 44px;
  }

  .auth-card h1 {
    font-size: 38px;
  }
}

.eyebrow {
  margin: 0;
  color: var(--ocean);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead,
.hint,
.page-header p {
  color: var(--muted);
  line-height: 1.6;
}

.hint {
  margin-top: 18px;
  font-size: 13px;
}

.auth-card {
  padding: 22px;
}

@media (min-width: 680px) {
  .auth-card {
    padding: 28px;
  }
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 14px 12px;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.button:focus-visible,
.text-link:focus-visible {
  outline: 2px solid var(--ocean);
  outline-offset: 2px;
}

.actions,
.button-row {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

@media (min-width: 520px) {
  .button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
  text-align: center;
}

.button-primary {
  background: var(--ink);
  color: var(--white);
}

.button-secondary {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
}

.button-ocean {
  background: var(--ocean);
  color: var(--white);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.text-link {
  color: var(--ocean);
  font-weight: 800;
}

.feedback {
  display: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.feedback.is-visible {
  display: block;
}

.feedback.success {
  border: 1px solid rgb(31 138 112 / 0.28);
  background: rgb(31 138 112 / 0.1);
  color: #1f6f5d;
}

.feedback.error {
  border: 1px solid rgb(217 72 95 / 0.28);
  background: rgb(217 72 95 / 0.1);
  color: #b4233f;
}

.next-action {
  display: none;
  margin-top: 12px;
}

.next-action.is-visible {
  display: inline-flex;
}

.app-layout {
  display: grid;
  gap: 18px;
  width: min(100%, 1180px);
  margin: 0 auto;
}

@media (min-width: 860px) {
  .app-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
  }
}

.side-nav {
  padding: 12px;
}

.side-nav a {
  display: block;
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-weight: 800;
}

.side-nav a.active {
  background: var(--ink);
  color: var(--white);
}

.main-panel {
  min-width: 0;
}

.page-header {
  margin-bottom: 18px;
}

.stats-grid,
.summary-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 680px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

.stat-card,
.content-card {
  padding: 16px;
}

.stat-card span,
.content-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.content-card h2 {
  margin: 0;
  font-size: 18px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

.card-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 700px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.media-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 16px 40px rgb(15 23 42 / 0.08);
}

.media-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #e8f3ef;
}

.media-card-body {
  padding: 16px;
}

.media-card h2,
.record-card h2 {
  margin: 6px 0 0;
  font-size: 20px;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f2f5f7;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.badge.mint {
  border-color: rgb(31 138 112 / 0.28);
  background: rgb(31 138 112 / 0.1);
  color: var(--mint);
}

.badge.coral {
  border-color: rgb(217 72 95 / 0.28);
  background: rgb(217 72 95 / 0.1);
  color: var(--coral);
}

.record-list {
  display: grid;
  gap: 12px;
}

.record-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
  box-shadow: 0 16px 40px rgb(15 23 42 / 0.08);
}

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

@media (min-width: 640px) {
  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.detail {
  border-radius: 8px;
  background: #f2f5f7;
  padding: 10px 12px;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail strong {
  display: block;
  margin-top: 4px;
}

/* System interface polish */
.app-layout {
  width: min(100%, 1360px);
}

@media (min-width: 980px) {
  .app-layout {
    grid-template-columns: 282px minmax(0, 1fr);
  }
}

.side-nav {
  display: grid;
  gap: 16px;
  padding: 14px;
}

@media (min-width: 980px) {
  .side-nav {
    position: sticky;
    top: 24px;
  }
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 4px 4px 16px;
}

.nav-logo {
  display: block;
  flex: 0 0 auto;
  width: 116px;
  height: 48px;
  object-fit: contain;
}

.brand-lockup strong,
.nav-user strong {
  display: block;
  font-size: 15px;
}

.brand-lockup span:not(.brand-mark),
.nav-user span,
.nav-section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-mark,
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--white);
  font-weight: 900;
}

.nav-section-label {
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 6px;
}

@media (max-width: 979px) {
  .nav-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

.side-nav .nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 12px;
  color: #46525e;
  font-weight: 800;
}

.side-nav .nav-link.active {
  background: var(--ink);
  color: var(--white);
}

.nav-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.nav-user button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 900;
}

.overview-hero {
  display: grid;
  gap: 18px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 20px;
  box-shadow: var(--shadow);
}

@media (min-width: 800px) {
  .overview-hero {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: center;
    padding: 26px;
  }
}

.overview-copy h1 {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1.08;
}

@media (min-width: 760px) {
  .overview-copy h1 {
    font-size: 42px;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pet-spotlight {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.pet-spotlight img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
}

.pet-spotlight span,
.panel-heading span,
.focus-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pet-spotlight strong,
.focus-row strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.pet-spotlight p,
.focus-row p,
.stat-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.stats-grid {
  margin-bottom: 16px;
}

@media (min-width: 700px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat-card {
  overflow: hidden;
  border-left: 5px solid var(--mint);
  padding: 18px;
}

.stat-card.ocean {
  border-left-color: var(--ocean);
}

.stat-card.lemon {
  border-left-color: var(--lemon);
}

.stat-card.coral {
  border-left-color: var(--coral);
}

.stat-card span {
  font-size: 13px;
  font-weight: 900;
}

.stat-card strong {
  margin-top: 10px;
  font-size: 34px;
}

.workspace-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 960px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  }

  .panel-large {
    grid-row: span 2;
  }
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin: 4px 0 0;
  font-size: 19px;
}

.panel-heading a {
  flex: 0 0 auto;
  color: var(--ocean);
  font-size: 13px;
  font-weight: 900;
}

.focus-row {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.focus-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.focus-list {
  display: grid;
  gap: 14px;
}

.record-card {
  display: grid;
  gap: 8px;
  box-shadow: none;
}

.record-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.record-card h2 {
  margin: 0;
}

.content-card {
  padding: 18px;
}

.content-card > span {
  font-weight: 800;
}

.content-card p {
  color: var(--muted);
  line-height: 1.5;
}

.admin-workspace {
  margin-bottom: 16px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.admin-row strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.admin-inline-form,
.admin-actions {
  display: grid;
  gap: 8px;
}

.admin-inline-form select,
.admin-actions select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 10px 12px;
  color: var(--ink);
}

@media (min-width: 680px) {
  .admin-row {
    grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
    align-items: center;
  }

  .admin-inline-form,
  .admin-actions {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
    justify-content: end;
  }
}

.media-card,
.record-card {
  box-shadow: var(--shadow);
}

.media-card h2,
.record-card h2,
.content-card h2 {
  color: var(--ink);
}

.section-header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.section-header h1 {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1.08;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (min-width: 760px) {
  .section-header h1 {
    font-size: 42px;
  }
}

.card-grid {
  align-items: stretch;
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.media-card {
  overflow: hidden;
}

.pet-search-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
  box-shadow: var(--shadow);
}

.pet-search-panel .field {
  margin: 0;
}

.pet-list-card {
  color: inherit;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.pet-list-card:hover {
  border-color: var(--ocean);
  transform: translateY(-2px);
}

.pet-detail-toolbar {
  margin-bottom: 14px;
}

.pet-detail-hero {
  display: grid;
  gap: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
  box-shadow: var(--shadow);
}

.pet-detail-hero img {
  width: 100%;
  height: 220px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8f3ef;
}

.pet-detail-hero h1 {
  margin: 8px 0 0;
  font-size: 34px;
  line-height: 1.08;
}

.pet-detail-hero p {
  color: var(--muted);
  line-height: 1.5;
}

.pet-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

@media (min-width: 760px) {
  .pet-detail-hero {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: center;
  }

  .pet-detail-hero img {
    height: 220px;
  }
}

.pet-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
}

.pet-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 900;
}

.pet-tab.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.pet-tab-panel {
  display: none;
}

.pet-tab-panel.is-active {
  display: block;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.detail-list div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.detail-list div:first-child {
  border-top: 0;
  padding-top: 0;
}

.detail-list span,
.record-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-list strong {
  display: block;
  margin-top: 4px;
  line-height: 1.4;
}

.record-info {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.record-info:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.record-info p {
  margin: 0;
}

.media-card img {
  height: 210px;
}

.media-card-body {
  display: grid;
  gap: 12px;
}

.media-card-body > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.ocean {
  border-color: rgb(18 103 122 / 0.24);
  background: rgb(18 103 122 / 0.1);
  color: var(--ocean);
}

.badge.lemon {
  border-color: rgb(192 139 22 / 0.26);
  background: rgb(192 139 22 / 0.12);
  color: var(--lemon);
}
