@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap");

:root {
  --bg: #09090b;
  --paper: rgba(24, 24, 27, 0.65);
  --paper-strong: rgba(39, 39, 42, 0.95);
  --line: rgba(39, 39, 42, 0.1);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #8b5cf6;
  --accent-dark: #7c3aed;
  --forest: #6d28d9;
  --warning: #fbbf24;
  --danger: #ef4444;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 15px 35px -5px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --radius-ui: 7px;
  --sidebar-width: 252px;
  --text-base: 0.95rem;
  --text-small: 0.86rem;
  --accordion-title: 1.08rem;
  --accordion-subtitle: 0.84rem;
  --surface-0: #09090b;
  --surface-1: rgba(24, 24, 27, 0.82);
  --surface-2: rgba(31, 31, 35, 0.9);
  --surface-3: rgba(39, 39, 42, 0.95);
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-border-strong: rgba(139, 92, 246, 0.24);
  --text-strong: #fafafa;
  --text-soft: #d4d4d8;
  --text-dim: #a1a1aa;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
}

/* Premium Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(139, 92, 246, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.6);
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 0% 0%, rgba(139, 92, 246, 0.15), transparent 60%),
    radial-gradient(1000px 600px at 100% 100%, rgba(124, 58, 237, 0.1), transparent 60%),
    linear-gradient(135deg, #09090b 0%, #18181b 100%);
  background-attachment: fixed;
  animation: pageFadeIn 420ms ease-out;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardRiseIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Stagger Animations for Cards */
.stagger-1 { animation-delay: 50ms !important; }
.stagger-2 { animation-delay: 100ms !important; }
.stagger-3 { animation-delay: 150ms !important; }
.stagger-4 { animation-delay: 200ms !important; }
.stagger-5 { animation-delay: 250ms !important; }

/* Skeleton Loading Shimmer */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.skeleton-box {
  position: relative;
  overflow: hidden;
  background-color: rgba(139, 92, 246, 0.08);
  border-radius: 8px;
}
.skeleton-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(39, 39, 42, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.main-content-inner {
  width: min(100%, 1460px);
  display: grid;
  gap: 14px;
}

.brand-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
  transform: translateZ(0);
}

.brand-logo-login {
  width: 110px;
  height: 110px;
}

.logo-upload-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(56, 162, 118, 0.18);
  background: rgba(39, 39, 42, 0.48);
}

.logo-upload-preview {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-upload-preview .brand-logo {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
}

.brand-text {
  margin-top: 12px;
  display: grid;
  gap: 2px;
}

.brand-text strong {
  font-size: 1.2rem;
  line-height: 1.15;
}

.brand-text span,
.small-label {
  color: rgba(229, 255, 243, 0.78);
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  width: min(100%, 1460px);
}

.app-footer {
  margin: 0 24px 24px calc(var(--sidebar-width) + 24px);
  padding-top: 8px;
  color: var(--muted);
}

.app-footer a {
  color: var(--muted);
}

.page-header h1,
.hero-card h2 {
  margin: 0;
  font-family: "Outfit", "Inter", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}


.page-header h1 {
  font-size: clamp(2rem, 1.8rem + 1.5vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}


.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
}

.required-mark {
  color: var(--danger);
  font-weight: 700;
}

.icon-button {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.icon-button span[aria-hidden="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.animals-detail-pane {
  display: grid;
  gap: 14px;
}

.animals-detail-pane > .hero-card,
.animals-detail-pane > .animal-record-accordion,
.animals-empty-detail {
  margin: 0;
}

.animal-record-accordion {
  display: grid;
  gap: 0.75rem;
}

.animal-subaccordion {
  display: grid;
  gap: 0.5rem;
}

.animals-detail-pane {
  min-width: 0;
}

.animals-detail-pane.loading {
  opacity: 0.78;
  transition: opacity 0.18s ease;
}

.animals-detail-pane .animal-record-accordion {
  gap: 10px;
}

.dashboard-search-form {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.dashboard-search-form input[type="search"] {
  height: 54px;
  border-radius: 999px;
  font-size: 1.15rem;
  padding: 0 22px;
}

.search-autocomplete-field {
  position: relative;
}

.global-search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  display: none;
  max-height: 320px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.global-search-suggest.visible {
  display: block;
}

.global-search-suggest-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.global-search-suggest-item:last-child {
  border-bottom: 0;
}

.global-search-suggest-item:hover {
  background: var(--paper);
}

.global-search-suggest-item strong {
  font-size: 0.96rem;
}

.global-search-suggest-item span {
  font-size: 0.82rem;
  color: var(--muted);
}

.dashboard-search-form .btn {
  height: 54px;
  border-radius: 999px;
  padding: 0 24px;
}

.panel,
.hero-card {
  background: var(--paper);
  border: 1px solid rgba(39, 39, 42, 0.4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel,
.hero-card {
  animation: cardRiseIn 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.no-page-anim .panel,
.no-page-anim .hero-card {
  animation: none !important;
}

.panel:hover, .hero-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.panel,
.hero-card {
  padding: 16px;
  font-size: var(--text-base);
}

.empty-state,
.help-copy {
  color: var(--muted);
  line-height: 1.6;
  font-size: var(--text-small);
}

.prose-block {
  line-height: 1.7;
  color: var(--text);
}

.static-card {
  align-items: flex-start;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.edit-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-1);
}

.compact-card {
  padding: 10px 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  background: var(--surface-1);
}

.gallery-image,
.document-preview-image {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  object-fit: cover;
}

.gallery-image {
  aspect-ratio: 4 / 3;
}

.gallery-meta {
  display: grid;
  gap: 4px;
}

.pagination-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(220, 207, 191, 0.8);
  background: rgba(255, 253, 250, 0.96);
}

.pagination-link.active {
  background: linear-gradient(180deg, #2a8d66 0%, #1f7a57 100%);
  border-color: #1c6e4e;
  color: var(--paper-strong);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

th,
td {
  text-align: left;
  padding: 16px;
}

th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding-bottom: 8px;
}

tbody tr {
  background: var(--paper-strong);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

tbody tr td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}
tbody tr td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.table-row-link {
  cursor: pointer;
}

.table-row-link:hover,
.table-row-link:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(139, 92, 246, 0.1);
  background: var(--paper-strong);
}

.table-row-link:focus {
  outline: none;
}

.table-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.animal-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex: 0 0 auto;
}

.animal-thumb-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent-dark);
}

.pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.22);
}

.hidden-form {
  display: none;
}

.drawer-panel {
  --bs-offcanvas-width: min(55vw, 980px);
  width: var(--bs-offcanvas-width);
  max-width: var(--bs-offcanvas-width);
  padding: 20px;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(139, 92, 246, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(252, 255, 253, 0.98), rgba(244, 252, 247, 0.96));
  border-left: 1px solid rgba(39, 39, 42, 0.36);
  box-shadow: -18px 0 44px rgba(5, 40, 26, 0.18);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  overflow: hidden;
}

@media (max-width: 1199px) {
  .drawer-panel {
    --bs-offcanvas-width: min(920px, 92vw);
    width: var(--bs-offcanvas-width);
    max-width: var(--bs-offcanvas-width);
  }
}

@media (max-width: 767px) {
  .drawer-panel {
    --bs-offcanvas-width: 100vw;
    width: var(--bs-offcanvas-width);
    max-width: var(--bs-offcanvas-width);
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid rgba(109, 40, 217, 0.08);
}

.drawer-header strong {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.drawer-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(109, 40, 217, 0.12);
  background: rgba(39, 39, 42, 0.88);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.drawer-close:hover {
  background: rgba(39, 39, 42, 1);
  transform: translateY(-1px);
}

.drawer-body {
  overflow-y: auto;
  padding: 6px 4px 2px 0;
}

.drawer-body .drawer-fragment {
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.drawer-body form.vstack,
.drawer-body .vstack {
  gap: 10px;
}

.drawer-body .checkbox-line {
  min-height: 38px;
}

.drawer-body small {
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6cb598;
  box-shadow: 0 0 0 3px rgba(64, 153, 116, 0.14);
  background: var(--paper-strong);
}

textarea {
  resize: vertical;
}

.form-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  background:
    radial-gradient(500px 230px at 0% 0%, rgba(193, 246, 219, 0.38), transparent 62%),
    linear-gradient(135deg, rgba(239, 251, 245, 0.98), rgba(251, 255, 253, 0.98));
}

.animal-hero-card {
  padding: 16px;
  gap: 12px;
}

.animal-hero-content {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.animal-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.animal-hero-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.animal-hero-profile {
  flex: 0 0 auto;
}

.animal-hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hero-actions {
  align-items: flex-start;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.hero-pdf-button {
  font-size: 1.02rem;
}

.animal-hero-meta-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(197, 222, 209, 0.9);
  background: rgba(39, 39, 42, 0.72);
}

.animal-hero-meta-card.has-action {
  padding: 0;
  overflow: hidden;
}

.animal-hero-meta-card span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.animal-hero-meta-card strong {
  font-size: 0.98rem;
}

.animal-vet-trigger {
  display: grid;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.animal-vet-trigger small {
  color: var(--muted);
  font-size: 0.76rem;
}

.animal-vet-trigger:hover strong,
.animal-vet-trigger:focus-visible strong {
  text-decoration: underline;
}

.vet-contact-popover {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.vet-contact-popover[hidden] {
  display: none !important;
}

.vet-contact-card {
  width: min(460px, 100%);
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, 0.55);
  background:
    radial-gradient(340px 180px at 0% 0%, rgba(193, 246, 219, 0.26), transparent 70%),
    rgba(39, 39, 42, 0.96);
  box-shadow: 0 30px 55px rgba(0, 0, 0, 0.22);
}

.vet-contact-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.vet-contact-head h3 {
  margin: 0;
}

.vet-contact-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(139, 92, 246, 0.55);
  border-radius: 999px;
  background: rgba(39, 39, 42, 0.88);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.vet-contact-list {
  margin: 0;
}

.vet-contact-list a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.inline-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.subtle-pill {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.18);
  color: var(--muted);
}

.animal-hero-address span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-image-panel {
  display: grid;
  gap: 10px;
  width: 152px;
}

.profile-image-frame {
  width: 152px;
  height: 152px;
}

.profile-upload-surface {
  cursor: pointer;
}

.profile-upload-surface:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.65);
  outline-offset: 3px;
  border-radius: 18px;
}

.animal-profile-image {
  width: 152px;
  height: 152px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.animal-profile-fallback {
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.profile-upload-trigger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 32px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(40, 118, 82, 0.08);
  color: var(--forest);
  font-weight: 600;
  text-align: center;
  font-size: 0.82rem;
  border: 1px solid rgba(35, 115, 81, 0.2);
  cursor: pointer;
}

.profile-upload-trigger.icon-only {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.05rem;
}

.profile-upload-trigger:hover {
  background: rgba(35, 115, 81, 0.14);
}

.profile-delete-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(193, 72, 56, 0.16);
  border-radius: 6px;
  background: rgba(193, 72, 56, 0.08);
  color: #b13a2c;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.profile-delete-button:hover {
  background: rgba(193, 72, 56, 0.14);
}

.profile-image-inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-copy {
  color: var(--muted);
  line-height: 1.6;
}

.accordion-item {
  background: rgba(251, 255, 253, 0.93);
  border: 1px solid rgba(197, 222, 209, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.accordion-item summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 10px 12px;
  font-size: var(--accordion-title);
  font-weight: 700;
  line-height: 1.3;
  background: linear-gradient(180deg, #f2fbf6 0%, #eaf7f0 100%);
  border-bottom: 1px solid rgba(197, 222, 209, 0.75);
}

.accordion-summary-main,
.accordion-summary-meta {
  display: block;
  padding-right: 26px;
}

.accordion-summary-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--accordion-subtitle);
  font-weight: 500;
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item summary::after {
  content: "+";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-dark);
}

.accordion-item[open] summary::after {
  content: "−";
}

.telegram-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.telegram-main,
.telegram-side {
  min-width: 0;
}

.telegram-main {
  display: grid;
  gap: 12px;
}

.telegram-main .form-actions {
  margin-top: auto;
}

.telegram-side {
  display: grid;
  gap: 14px;
}

.compact-ordered-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}
