:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-ring: rgba(5, 150, 105, 0.25);
  --secondary: #3b82f6;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.logo-icon {
  font-size: 1.8rem;
  background: var(--primary-light);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: #065f46;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

/* Layout */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-ring);
}

.btn-secondary {
  background: #334155;
  color: #ffffff;
}

.btn-secondary:hover {
  background: #1e293b;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-outline-primary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-outline-primary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-outline-danger {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

/* Alerts */
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-icon {
  font-weight: 700;
  font-size: 1.1rem;
}

.alert-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

.alert-dismiss:hover {
  opacity: 1;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.bg-emerald { background: #d1fae5; color: #047857; }
.bg-blue { background: #dbeafe; color: #1d4ed8; }
.bg-indigo { background: #e0e7ff; color: #4338ca; }
.bg-amber { background: #fef3c7; color: #b45309; }

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Filters */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.filter-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.flex-2 {
  flex: 2;
  min-width: 250px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 180px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.form-group label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control {
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-actions-inline {
  display: flex;
  gap: 0.5rem;
}

/* Data Table */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.table-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.table-header-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: #475569;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tr:hover {
  background-color: #f8fafc;
}

.text-right {
  text-align: right;
}

/* Table Specific Badges */
.tag-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  background: #ecfdf5;
  color: #065f46;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #a7f3d0;
  display: inline-block;
  white-space: nowrap;
}

.tag-badge-lg {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  background: #ecfdf5;
  color: #065f46;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #a7f3d0;
}

.gender-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
  display: inline-block;
}

.gender-female {
  background: #fce7f3;
  color: #9d174d;
}

.gender-male {
  background: #e0e7ff;
  color: #3730a3;
}

.species-tag {
  background: #f1f5f9;
  color: #334155;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}

.pedigree-box {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
}

.pedigree-lbl {
  color: var(--text-muted);
  font-weight: 500;
}

.yield-badge {
  font-family: var(--font-mono);
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
  font-size: 0.82rem;
}

.yield-sire {
  background: #eff6ff;
  color: #1e40af;
}

/* 4 Image Thumbnails Gallery */
.image-gallery-thumbs {
  display: flex;
  gap: 0.45rem;
}

.thumb-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.thumb-lbl {
  font-size: 0.65rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
}

.thumb-img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.thumb-img:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 5;
}

.thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--text-light);
  font-family: var(--font-mono);
}

.actions-group {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* API Reference Card */
.api-card {
  background: #0f172a;
  color: #f8fafc;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.api-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.api-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

.badge-success { background: #065f46; color: #a7f3d0; }
.badge-indigo { background: #312e81; color: #c7d2fe; }
.badge-outline { border: 1px solid #475569; color: #94a3b8; }

.api-endpoints {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.api-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  background: #1e293b;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  flex-wrap: wrap;
}

.http-method {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.method-post { background: #059669; color: #ffffff; }
.method-put { background: #d97706; color: #ffffff; }
.method-get { background: #2563eb; color: #ffffff; }

.api-row code {
  font-family: var(--font-mono);
  color: #38bdf8;
}

.api-desc {
  color: #94a3b8;
  font-size: 0.8rem;
}

/* Forms (Add / Edit) */
.form-container {
  max-width: 960px;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 2rem;
}

.breadcrumb {
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.88rem;
}

.form-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.edit-title-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.record-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-num {
  background: var(--primary-light);
  color: var(--primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.section-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Image Upload Cards Grid */
.images-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.image-upload-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s;
}

.image-upload-card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.card-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upload-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.img-status-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: var(--text-muted);
}

.status-active {
  background: #d1fae5;
  color: #065f46;
  font-weight: 700;
}

.upload-dropzone {
  min-height: 140px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: all 0.2s;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  gap: 0.25rem;
}

.drop-icon {
  font-size: 1.6rem;
}

.drop-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.drop-formats {
  font-size: 0.7rem;
  color: var(--text-light);
}

.preview-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.file-input-hidden {
  display: none;
}

.btn-clear-img {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 0.4rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-clear-img:hover {
  background: #fca5a5;
}

.hidden {
  display: none !important;
}

.form-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 0;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-content {
  max-width: 85%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  border: 2px solid #ffffff;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.lightbox-close:hover {
  color: #cbd5e1;
}

.lightbox-caption {
  margin-top: 15px;
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Footer */
.footer {
  margin-top: auto;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.api-badges {
  display: flex;
  gap: 0.5rem;
}

/* Embedding Badges & Inputs */
.emb-pill {
  font-size: 0.62rem;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 700;
  display: inline-block;
  margin-top: 0.15rem;
}

.embedding-details {
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 0.5rem;
}

.embedding-summary {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

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

.embedding-summary:hover {
  color: var(--primary);
}

.embedding-input {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  width: 100%;
  resize: vertical;
}

.form-control-sm {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
  }
  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  .actions-group {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   🐾 ANIMAL PROFILE / SHOW PAGE STYLES (RESPONSIVE & PRINT READY)
   ========================================================================== */

.profile-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 0 3rem;
}

.profile-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.breadcrumb-back:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.profile-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Profile Hero Banner */
.profile-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hero-avatar {
  width: 68px;
  height: 68px;
  background: var(--primary-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.15);
  flex-shrink: 0;
}

.hero-identity {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hero-tag-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hero-tag-id {
  font-size: 1.95rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #065f46;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-badge.active-badge {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.hero-meta-pills {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.age-pill {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.hero-right {
  display: flex;
  align-items: center;
}

.qr-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.qr-code-img {
  width: 85px;
  height: 85px;
  border-radius: 6px;
}

.qr-caption {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.35rem;
  letter-spacing: 0.04em;
}

/* Toast Notification */
.toast-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.25s ease-out;
}

.toast-popup.show {
  opacity: 1;
  transform: translateY(0);
}

/* Profile 2-Column Content Grid */
.profile-content-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Gallery Showcase (Left) */
.profile-gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 5.5rem;
}

.card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.section-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.heading-icon {
  font-size: 1.2rem;
}

.record-id-lbl {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
}

/* Main Featured Photo Box */
.featured-photo-wrapper {
  margin-bottom: 1rem;
}

.featured-photo-box {
  width: 100%;
  height: 380px;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.featured-photo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.featured-photo-img:hover {
  transform: scale(1.015);
}

.featured-zoom-hint {
  position: absolute;
  bottom: 0.85rem;
  right: 0.85rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.featured-zoom-hint:hover {
  background: rgba(5, 150, 105, 0.85);
}

.featured-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-light);
  text-align: center;
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

.featured-caption {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.6rem;
}

/* 4 Thumbnails Grid */
.gallery-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.gallery-thumb-card {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 0.35rem;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.gallery-thumb-card:hover {
  border-color: #94a3b8;
  transform: translateY(-2px);
}

.gallery-thumb-card.active-thumb {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-ring);
}

.thumb-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.thumb-angle-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
}

.thumb-angle-name {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-preview-box {
  width: 100%;
  height: 62px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  margin: 0.3rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-empty-state {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-light);
}

.emb-status-pill {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emb-status-pill.emb-active {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.emb-status-pill.emb-none {
  background: #f1f5f9;
  color: #94a3b8;
}

.gallery-note {
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border-radius: 8px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Right Details Column */
.profile-data-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* Specs Grid */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spec-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.spec-value {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
}

.spec-value.tag-highlight {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: #065f46;
}

.text-muted-sm {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.text-success {
  color: var(--primary);
}

.font-semibold {
  font-weight: 600;
}

/* Pedigree Cards */
.pedigree-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.lineage-box {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.lineage-box:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.lineage-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  flex-shrink: 0;
}

.lineage-icon-box.dam-bg {
  background: #fce7f3;
  color: #db2777;
}

.lineage-icon-box.sire-bg {
  background: #e0e7ff;
  color: #4f46e5;
}

.lineage-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.lineage-role {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.lineage-tag-link {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lineage-tag-link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.arrow-jump {
  font-size: 0.85rem;
}

.lineage-tag-empty {
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: italic;
}

/* Yield Metrics Grid */
.yield-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.yield-metric-card {
  padding: 1.25rem;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  display: flex;
  flex-direction: column;
}

.yield-metric-card.sire-yield-card {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.yield-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.yield-metric-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.yield-metric-unit {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
}

.yield-metric-number {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #065f46;
  margin: 0.3rem 0;
  line-height: 1.1;
}

.yield-metric-number.sire-color {
  color: #1e40af;
}

.yield-progress-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.4rem 0;
}

.yield-progress-fill {
  height: 100%;
  background: #10b981;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.yield-progress-fill.sire-fill {
  background: #3b82f6;
}

.yield-metric-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* AI Embeddings List */
.embeddings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.emb-row {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f8fafc;
}

.emb-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.emb-row-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.emb-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.emb-details-dropdown {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
}

.emb-dropdown-summary {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.emb-dropdown-body {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.emb-pre {
  background: #0f172a;
  color: #a7f3d0;
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  overflow-x: auto;
  max-height: 120px;
}

/* API integration box */
.profile-api-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.api-box-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.api-box-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.api-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.api-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.api-code-snippet {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: #e2e8f0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #0f172a;
  width: fit-content;
  margin-top: 0.25rem;
}

/* Bottom Actions Toolbar */
.profile-bottom-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

/* Responsive Breakpoints for Profile View */
@media (max-width: 1024px) {
  .profile-content-grid {
    grid-template-columns: 1fr;
  }
  .profile-gallery-card {
    position: relative;
    top: 0;
  }
}

@media (max-width: 680px) {
  .profile-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-right {
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
  }
  .pedigree-cards-grid {
    grid-template-columns: 1fr;
  }
  .yield-metrics-grid {
    grid-template-columns: 1fr;
  }
  .gallery-thumbs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .featured-photo-box {
    height: 280px;
  }
  .spec-grid {
    grid-template-columns: 1fr;
  }
  .profile-bottom-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-bottom-actions .btn {
    width: 100%;
  }
}

/* Print Optimization */
@media print {
  .navbar,
  .footer,
  .profile-nav-bar,
  .profile-bottom-actions,
  .profile-api-box,
  .featured-zoom-hint,
  .gallery-note,
  .emb-details-dropdown,
  .btn {
    display: none !important;
  }
  body, .main-content {
    background: #ffffff !important;
    padding: 0 !important;
  }
  .profile-container {
    max-width: 100% !important;
  }
  .profile-hero-card,
  .profile-card,
  .profile-gallery-card {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .featured-photo-box {
    height: 240px !important;
    background: transparent !important;
  }
  .featured-photo-img {
    object-fit: contain !important;
  }
}
