/* ============================================================
   CONTROL ANIMAL SELWO v2 - Design System & Styles
   ============================================================ */

/* ── Variables / Design Tokens ─────────────────────────────── */
:root {
  /* Primary - Ocean Blue */
  --primary-900: #041c2c;
  --primary-800: #0a2647;
  --primary-700: #0f3460;
  --primary-600: #144272;
  --primary-500: #1a5276;
  --primary-400: #2471a3;
  --primary-300: #5499c7;
  --primary-200: #85c1e9;
  --primary-100: #d4e6f1;
  --primary-50: #eaf2f8;

  /* Accent - Aqua */
  --accent-600: #0077b6;
  --accent-500: #0096c7;
  --accent-400: #00b4d8;
  --accent-300: #48cae4;
  --accent-200: #90e0ef;
  --accent-100: #caf0f8;

  /* Semantic */
  --success-600: #1a9f3f;
  --success-500: #2dc653;
  --success-100: #d4edda;
  --warning-500: #ffb703;
  --warning-100: #fff3cd;
  --danger-600: #c0392b;
  --danger-500: #e63946;
  --danger-100: #f8d7da;

  /* Neutral */
  --gray-900: #1a1a2e;
  --gray-800: #2d2d44;
  --gray-700: #4a4a68;
  --gray-600: #6c757d;
  --gray-500: #8e99a4;
  --gray-400: #adb5bd;
  --gray-300: #ced4da;
  --gray-200: #dee2e6;
  --gray-100: #f1f3f5;
  --gray-50: #f8f9fa;
  --white: #ffffff;

  /* Surface */
  --surface-bg: #f0f4f8;
  --surface-card: var(--white);
  --surface-overlay: rgba(10, 38, 71, 0.55);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;
  --fs-4xl: 2.5rem;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Spacing */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem;
  --sp-12: 3rem; --sp-16: 4rem; --sp-20: 5rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(0,180,216,0.25);
  --shadow-glow-lg: 0 0 40px rgba(0,180,216,0.35);

  /* Transitions */
  --ease-fast: 150ms ease;
  --ease-base: 250ms ease;
  --ease-slow: 350ms ease;
  --ease-spring: 500ms cubic-bezier(0.34,1.56,0.64,1);

  /* Z-index */
  --z-base: 1;
  --z-sticky: 200;
  --z-dropdown: 500;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--surface-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-500); text-decoration: none; }
a:hover { color: var(--accent-600); }
ul, ol { list-style: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

::selection { background: var(--accent-200); color: var(--primary-800); }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ── Typography ────────────────────────────────────────────── */
.content-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-8);
}
@media (max-width: 768px) {
  .content-wrapper {
    padding: var(--sp-4) var(--sp-4);
  }
}

h1, h2, h3, h4, h5, h6 { font-weight: var(--fw-bold); line-height: 1.2; color: var(--gray-900); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
.text-muted { color: var(--gray-600); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--ease-base);
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-400));
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-600), var(--accent-500)); box-shadow: var(--shadow-glow); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, var(--success-600), var(--success-500));
  color: var(--white);
}
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger-600), var(--danger-500));
  color: var(--white);
}
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-outline:hover { border-color: var(--accent-400); color: var(--accent-500); background: var(--accent-100); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  padding: var(--sp-2) var(--sp-3);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: var(--fs-lg);
}

.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); }
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: var(--fs-base); }

.btn-group { display: flex; gap: var(--sp-2); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--ease-base);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.card-header h3 { font-size: var(--fs-lg); }
.card-body { padding: var(--sp-6); }
.card-body--compact { padding: var(--sp-4); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.form-label, .form-group label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--gray-700);
}
.form-input, .form-select, .form-textarea {
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-900);
  transition: all var(--ease-fast);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgba(0,180,216,0.15);
}
.form-input::placeholder { color: var(--gray-400); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-error { color: var(--danger-500); font-size: var(--fs-xs); margin-top: var(--sp-1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

/* ── Tables ────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.table th {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: var(--fw-semibold);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--primary-100);
  position: sticky;
  top: 0;
}
.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--ease-fast); }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions-cell {
  display: flex;
  gap: var(--sp-1);
  justify-content: flex-end;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-item {
  padding: var(--sp-3) var(--sp-5);
  border: none;
  background: none;
  color: var(--gray-600);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--ease-fast);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.tab-item:hover { color: var(--accent-500); }
.tab-item.active {
  color: var(--accent-500);
  border-bottom-color: var(--accent-500);
  font-weight: var(--fw-semibold);
}
.tab-content { padding: var(--sp-6) 0; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-3);
  border-radius: var(--radius-2xl);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.6;
  white-space: nowrap;
}
.badge-male { background: #dbeafe; color: #1e40af; }
.badge-female { background: #fce7f3; color: #9d174d; }
.badge-active { background: var(--success-100); color: var(--success-600); }
.badge-transferred { background: var(--warning-100); color: #b45309; }
.badge-deceased { background: var(--gray-200); color: var(--gray-700); }
.badge-high { background: var(--danger-100); color: var(--danger-600); }
.badge-medium { background: var(--warning-100); color: #b45309; }
.badge-low { background: #dbeafe; color: #1e40af; }
.badge-routine { background: var(--gray-100); color: var(--gray-600); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--surface-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--white);
}
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger-600), var(--danger-500));
  color: var(--white);
}
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-outline:hover { border-color: var(--accent-400); color: var(--accent-500); background: var(--accent-100); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  padding: var(--sp-2) var(--sp-3);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: var(--fs-lg);
}

.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); }
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: var(--fs-base); }

.btn-group { display: flex; gap: var(--sp-2); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--ease-base);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.card-header h3 { font-size: var(--fs-lg); }
.card-body { padding: var(--sp-6); }
.card-body--compact { padding: var(--sp-4); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.form-label, .form-group label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--gray-700);
}
.form-input, .form-select, .form-textarea {
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-900);
  transition: all var(--ease-fast);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgba(0,180,216,0.15);
}
.form-input::placeholder { color: var(--gray-400); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-error { color: var(--danger-500); font-size: var(--fs-xs); margin-top: var(--sp-1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

/* ── Tables ────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.table th {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: var(--fw-semibold);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--primary-100);
  position: sticky;
  top: 0;
}
.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--ease-fast); }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions-cell {
  display: flex;
  gap: var(--sp-1);
  justify-content: flex-end;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-item {
  padding: var(--sp-3) var(--sp-5);
  border: none;
  background: none;
  color: var(--gray-600);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--ease-fast);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.tab-item:hover { color: var(--accent-500); }
.tab-item.active {
  color: var(--accent-500);
  border-bottom-color: var(--accent-500);
  font-weight: var(--fw-semibold);
}
.tab-content { padding: var(--sp-6) 0; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-3);
  border-radius: var(--radius-2xl);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.6;
  white-space: nowrap;
}
.badge-male { background: #dbeafe; color: #1e40af; }
.badge-female { background: #fce7f3; color: #9d174d; }
.badge-active { background: var(--success-100); color: var(--success-600); }
.badge-transferred { background: var(--warning-100); color: #b45309; }
.badge-deceased { background: var(--gray-200); color: var(--gray-700); }
.badge-high { background: var(--danger-100); color: var(--danger-600); }
.badge-medium { background: var(--warning-100); color: #b45309; }
.badge-low { background: #dbeafe; color: #1e40af; }
.badge-routine { background: var(--gray-100); color: var(--gray-600); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--surface-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn 200ms ease;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column;
  animation: slideUp 300ms var(--ease-spring);
}
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--gray-100); }
.modal-header h3 { font-size: var(--fs-lg); color: var(--gray-900); margin: 0; }
.modal-close {
  width: 32px; height: 32px; border: none;
  background: var(--gray-100); border-radius: var(--radius-md);
  cursor: pointer; font-size: var(--fs-lg); color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease-fast);
}
.modal-close:hover { background: var(--danger-100); color: var(--danger-500); }
.modal-body { padding: var(--sp-6); overflow-y: auto; flex: 1; }
.modal-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--gray-100);
  display: flex; gap: var(--sp-3); justify-content: flex-end;
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: var(--sp-6); right: var(--sp-6);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--sp-3);
  pointer-events: none;
}
.toast {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  display: flex; align-items: center; gap: var(--sp-3);
  animation: slideInRight 350ms var(--ease-spring);
  pointer-events: auto; max-width: 380px;
  position: relative; overflow: hidden;
}
.toast-success { background: #065f46; color: var(--white); }
.toast-error { background: var(--danger-600); color: var(--white); }
.toast-info { background: var(--primary-700); color: var(--white); }
.toast-exit { animation: slideOutRight 250ms ease forwards; }
.toast-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,0.2);
}
.toast-progress-bar {
  height: 100%; background: rgba(255,255,255,0.6);
  animation: toastProgress linear forwards;
  border-radius: 0 3px 3px 0;
}
@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ── Confirm Dialog ────────────────────────────────────────── */
.confirm-body { text-align: center; padding: var(--sp-4) 0; }
.confirm-body p { color: var(--gray-700); margin-bottom: var(--sp-2); }
.confirm-body .confirm-icon { font-size: 3rem; margin-bottom: var(--sp-4); }

/* ── Layout ────────────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--primary-800), var(--primary-700));
  color: var(--white);
  padding: var(--sp-3) var(--sp-6);
  display: flex; align-items: center; gap: var(--sp-4);
  position: sticky; top: 0; z-index: var(--z-sticky);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}
.header-back {
  height: 36px; border: none;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-2xl);
  color: var(--white); cursor: pointer;
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 var(--sp-4);
  transition: all var(--ease-fast);
  flex-shrink: 0; white-space: nowrap;
}
.header-back:hover { background: rgba(255,255,255,0.22); transform: translateX(-2px); }
.header-back:active { transform: scale(0.96); }
.header-back-text { font-size: var(--fs-sm); }
.header-title {
  font-size: var(--fs-lg); font-weight: var(--fw-semibold);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-actions {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-shrink: 0;
}
.header-btn {
  width: 36px; height: 36px;
  border: none; background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  color: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease-fast);
  position: relative;
}
.header-btn:hover { background: rgba(255,255,255,0.2); }
.header-logo {
  height: 28px; width: auto; opacity: 0.9;
}

/* ── Global Search ─────────────────────────────────────────── */
.global-search-container { position: relative; }
.global-search-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--ease-base);
  z-index: var(--z-dropdown);
}
.global-search-panel.open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.global-search-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: none; border-bottom: 1px solid var(--gray-100);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: var(--fs-sm);
  outline: none;
}
.global-search-results {
  max-height: 320px; overflow-y: auto; display: none;
}
.search-result-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer; transition: background var(--ease-fast);
}
.search-result-item:hover { background: var(--gray-50); }
.search-result-emoji { font-size: 1.5rem; }
.search-result-name { font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--gray-900); }
.search-result-meta { font-size: var(--fs-xs); color: var(--gray-500); }
.search-no-results {
  padding: var(--sp-6); text-align: center;
  color: var(--gray-500); font-size: var(--fs-sm);
}

/* ── Alerts ────────────────────────────────────────────────── */
.alerts-container { position: relative; }
.alerts-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: var(--danger-500); color: var(--white);
  border-radius: 10px; font-size: 10px; font-weight: var(--fw-bold);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.alerts-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--ease-base);
  z-index: var(--z-dropdown);
  max-height: 400px; overflow-y: auto;
}
.alerts-dropdown.open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.alerts-dropdown-header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--gray-100);
}
.alerts-dropdown-header h4 { font-size: var(--fs-sm); color: var(--gray-700); }
.alerts-dropdown-empty {
  padding: var(--sp-6); text-align: center;
  color: var(--gray-500); font-size: var(--fs-sm);
}
.alert-dropdown-item {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer; transition: background var(--ease-fast);
  border-bottom: 1px solid var(--gray-50);
}
.alert-dropdown-item:hover { background: var(--gray-50); }
.alert-dropdown-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.alert-dropdown-content { flex: 1; }
.alert-dropdown-content strong { font-size: var(--fs-sm); display: block; color: var(--gray-900); }
.alert-dropdown-content small { font-size: var(--fs-xs); color: var(--gray-500); }
.alerts-dropdown-footer {
  padding: var(--sp-2) var(--sp-4);
  text-align: center; font-size: var(--fs-xs); color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
}

/* Alerts Panel (Menu) */
.alerts-panel {
  width: 100%; max-width: 600px;
  margin-top: var(--sp-6);
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  border: 1px solid rgba(255,255,255,0.1);
}
.alerts-panel-title {
  color: var(--white); font-size: var(--fs-base); margin-bottom: var(--sp-4);
  font-weight: var(--fw-semibold);
}
.alerts-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.alert-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--ease-fast);
  border-left: 3px solid transparent;
}
.alert-item:hover { background: rgba(255,255,255,0.14); }
.alert-item--high { border-left-color: var(--danger-500); }
.alert-item--medium { border-left-color: var(--warning-500); }
.alert-item-icon { font-size: 1.2rem; }
.alert-item-content { flex: 1; }
.alert-item-animal { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--white); }
.alert-item-message { font-size: var(--fs-xs); color: rgba(255,255,255,0.6); }
.alert-dismiss {
  width: 24px; height: 24px; border: none;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  cursor: pointer; font-size: var(--fs-xs);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease-fast);
}
.alert-dismiss:hover { background: rgba(255,255,255,0.2); color: var(--white); }
.alerts-summary.alerts-empty {
  width: 100%; max-width: 600px;
  margin-top: var(--sp-6);
  display: flex; align-items: center; gap: var(--sp-3);
  justify-content: center;
  color: rgba(255,255,255,0.6); font-size: var(--fs-sm);
}
.alerts-more {
  text-align: center; font-size: var(--fs-xs);
  color: rgba(255,255,255,0.5); margin-top: var(--sp-3);
}

.breadcrumbs {
  padding: var(--sp-3) var(--sp-6);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm);
  overflow-x: auto; white-space: nowrap;
}
.breadcrumb-item { color: var(--gray-500); cursor: pointer; transition: color var(--ease-fast); }
.breadcrumb-item:hover { color: var(--accent-500); }
.breadcrumb-item.active { color: var(--gray-800); font-weight: var(--fw-medium); cursor: default; }
.breadcrumb-sep { color: var(--gray-400); font-size: var(--fs-xs); }

.main-content {
  flex: 1; padding: var(--sp-6);
  max-width: 1200px; width: 100%; margin: 0 auto;
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap: wrap;
}
.page-header h2 { display: flex; align-items: center; gap: var(--sp-3); }

/* ── Search & Filters ──────────────────────────────────────── */
.search-bar {
  display: flex; gap: var(--sp-3);
  margin-bottom: var(--sp-6); flex-wrap: wrap;
}
.search-wrapper {
  flex: 1; min-width: 200px; position: relative;
}
.search-wrapper .search-icon {
  position: absolute; left: var(--sp-4); top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400); font-size: var(--fs-sm);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 2.5rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--white);
  transition: all var(--ease-fast);
}
.search-input:focus { outline: none; border-color: var(--accent-400); box-shadow: 0 0 0 3px rgba(0,180,216,0.12); }
.filter-select {
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--white); color: var(--gray-700);
  min-width: 180px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.filter-select:focus { outline: none; border-color: var(--accent-400); }

/* ── Auth Page (replaces old Splash Screen) ───────────────── */
.auth-page {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, #041c2c 0%, #0a2647 30%, #144272 60%, #0f3460 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999; overflow: hidden;
  padding: var(--sp-4);
}
.auth-page-waves {
  position: absolute; bottom: 0; left: 0; width: 100%; z-index: 1;
}
.auth-page-waves svg { display: block; width: 100%; height: auto; }

/* Particles (reused from old splash) */
.splash-particles { position: absolute; inset: 0; overflow: hidden; }
.splash-particle {
  position: absolute; width: 4px; height: 4px;
  background: rgba(0,180,216,0.3); border-radius: 50%;
  animation: floatParticle 8s ease-in-out infinite;
}
.splash-wave-1 { animation: waveMove 7s ease-in-out infinite; }
.splash-wave-2 { animation: waveMove 5s ease-in-out infinite reverse; }
.splash-wave-3 { animation: waveMove 9s ease-in-out infinite; }

/* ── Auth Card ────────────────────────────────────────────── */
.auth-card {
  position: relative; z-index: 2;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 80px rgba(0, 180, 216, 0.08);
  width: 100%; max-width: 440px;
  animation: slideUp 500ms var(--ease-spring);
  overflow: hidden;
}

.auth-card-header {
  text-align: center;
  padding: var(--sp-8) var(--sp-6) var(--sp-4);
  background: linear-gradient(160deg, var(--primary-800), var(--primary-700));
  color: var(--white);
}
.auth-card-logo {
  width: 120px; height: auto;
  margin: 0 auto var(--sp-4);
  filter: drop-shadow(0 6px 20px rgba(0,180,216,0.25));
  animation: floatLogo 4s ease-in-out infinite;
}
.auth-card-title {
  font-size: var(--fs-2xl); font-weight: var(--fw-bold);
  margin: 0 0 var(--sp-1); letter-spacing: -0.3px;
}
.auth-card-subtitle {
  font-size: var(--fs-sm); color: var(--accent-300);
  font-weight: var(--fw-medium); margin: 0;
}

/* ── Auth Tabs ────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-100);
}
.auth-tab {
  flex: 1; padding: var(--sp-3) var(--sp-4);
  border: none; background: none;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--gray-500); cursor: pointer;
  transition: all var(--ease-fast);
  position: relative;
}
.auth-tab::after {
  content: ''; position: absolute;
  bottom: -2px; left: 0; right: 0; height: 2px;
  background: transparent; transition: background var(--ease-fast);
}
.auth-tab:hover { color: var(--gray-700); }
.auth-tab--active {
  color: var(--accent-600);
}
.auth-tab--active::after {
  background: var(--accent-500);
}

/* ── Auth Form ────────────────────────────────────────────── */
.auth-form {
  padding: var(--sp-5) var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.auth-field {
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.auth-field label {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--gray-700);
}
.auth-field input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-family: var(--font-family);
  color: var(--gray-900);
  background: var(--gray-50);
  transition: all var(--ease-fast);
  outline: none;
  box-sizing: border-box;
}
.auth-field input:focus {
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
  background: var(--white);
}
.auth-field input::placeholder { color: var(--gray-400); }

.auth-password-wrapper { position: relative; }
.auth-password-wrapper input { padding-right: 44px; }
.auth-toggle-pw {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border: none; background: none;
  cursor: pointer; font-size: var(--fs-lg);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  opacity: 0.6; transition: opacity var(--ease-fast);
}
.auth-toggle-pw:hover { opacity: 1; }

.auth-error {
  padding: var(--sp-3) var(--sp-4);
  background: var(--danger-100);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: var(--radius-md);
  color: var(--danger-600);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  animation: shakeX 300ms ease;
}

.auth-submit {
  width: 100%;
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  border-radius: var(--radius-md);
  transition: all var(--ease-fast);
  margin-top: var(--sp-1);
}
.auth-submit:disabled { opacity: 0.7; cursor: not-allowed; }

.auth-submit-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.auth-card-footer {
  text-align: center;
  padding: var(--sp-2) var(--sp-6) var(--sp-5);
  font-size: var(--fs-xs); color: var(--gray-500);
  margin: 0;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── Auth page responsive ─────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { max-width: 100%; border-radius: var(--radius-lg); }
  .auth-card-header { padding: var(--sp-6) var(--sp-4) var(--sp-3); }
  .auth-card-logo { width: 90px; }
  .auth-card-title { font-size: var(--fs-xl); }
  .auth-form { padding: var(--sp-4); }
}

/* ── Menu Page ─────────────────────────────────────────────── */
.menu-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #041c2c 0%, #0a2647 40%, #0f3460 100%);
  display: flex; flex-direction: column; align-items: center;
  padding: var(--sp-8) var(--sp-4);
}
.menu-header { width: 100%; text-align: center; margin-bottom: var(--sp-10); position: relative; }
.menu-logo {
  width: 100px; height: auto;
  margin: 0 auto var(--sp-4);
  filter: drop-shadow(0 4px 12px rgba(0,180,216,0.3));
}
.menu-title {
  font-size: var(--fs-2xl); color: var(--white);
  font-weight: var(--fw-bold); margin-bottom: var(--sp-2);
}
.menu-subtitle { color: var(--accent-300); font-size: var(--fs-base); }
.menu-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5); width: 100%; max-width: 600px;
}
.dept-card {
  border-radius: var(--radius-2xl);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: var(--sp-6);
  text-align: center; cursor: pointer;
  transition: all var(--ease-base);
  border: 1px solid rgba(255,255,255,0.1);
  position: relative; overflow: hidden;
}
.dept-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--radius-2xl); padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  z-index: 4;
}
.dept-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-glow-lg);
}
.dept-card:active { transform: scale(0.98); }
.dept-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.dept-card:hover .dept-card-bg {
  transform: scale(1.1);
}
.dept-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.8) 100%);
  z-index: 2;
  transition: background 0.4s ease;
}
.dept-card:hover .dept-card-overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 40%, rgba(0, 0, 0, 0.95) 100%);
}
.dept-card-content {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dept-card-name {
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  color: var(--white); margin-bottom: var(--sp-1); display: block;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.dept-card-count {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--white);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.dept-card:nth-child(1) { animation: scaleIn 500ms ease 100ms both; }
.dept-card:nth-child(2) { animation: scaleIn 500ms ease 200ms both; }
.dept-card:nth-child(3) { animation: scaleIn 500ms ease 300ms both; }
.dept-card:nth-child(4) { animation: scaleIn 500ms ease 400ms both; }

/* Menu Extras (Favorites button) */
.menu-extras {
  margin-top: var(--sp-6);
  width: 100%; max-width: 600px;
  display: flex; justify-content: center;
}
.menu-extra-btn {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-8);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-2xl);
  color: var(--white); cursor: pointer;
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  transition: all var(--ease-base);
  font-family: inherit;
  animation: scaleIn 500ms ease 500ms both;
}
.menu-extra-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.menu-extra-icon { font-size: 1.3rem; }
.menu-extra-count {
  background: var(--accent-400);
  padding: 1px 8px; border-radius: 10px;
  font-size: var(--fs-xs);
}

/* ── Department Page ───────────────────────────────────────── */
.dept-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-4);
}
.section-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--sp-6) var(--sp-4);
  text-align: center; cursor: pointer;
  border: 1.5px solid var(--gray-200);
  transition: all var(--ease-spring);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.section-card:hover {
  border-color: var(--accent-400);
  box-shadow: var(--shadow-glow);
  transform: translateY(-5px);
}
.section-card-icon { 
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
  height: 48px;
}
.section-card-svg {
  width: 36px;
  height: 36px;
  color: var(--accent-500);
  stroke-width: 1.75;
  transition: all var(--ease-spring);
}
.section-card:hover .section-card-svg {
  color: var(--accent-600);
  transform: scale(1.12);
}
.section-card-name {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--gray-800);
  transition: color var(--ease-fast);
}
.section-card:hover .section-card-name {
  color: var(--primary-900);
}

/* ── Animal List ───────────────────────────────────────────── */
.animal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-5);
}
.animal-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  padding: var(--sp-5);
  cursor: pointer;
  transition: all var(--ease-base);
  display: flex; align-items: center; gap: var(--sp-4);
}
.animal-card:hover {
  border-color: var(--accent-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.animal-avatar {
  width: 60px; height: 60px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-100), var(--accent-100));
  overflow: hidden;
}
.animal-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: var(--radius-full);
}
.animal-info { flex: 1; min-width: 0; }
.animal-name {
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  color: var(--gray-900); margin-bottom: var(--sp-1);
  display: flex; align-items: center; gap: var(--sp-2);
}
.animal-species {
  font-size: var(--fs-sm); color: var(--gray-600);
  margin-bottom: var(--sp-2); font-style: italic;
}
.animal-meta {
  display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap;
}
.animal-zims {
  font-size: var(--fs-xs); color: var(--gray-500); font-family: monospace;
}

/* Favorite Star */
.fav-star { color: var(--gray-400); font-size: var(--fs-sm); }
.fav-star.active { color: #f59e0b; }
.fav-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: var(--gray-400);
  transition: all var(--ease-base); padding: 0;
  line-height: 1;
}
.fav-btn:hover { transform: scale(1.2); }
.fav-btn.active { color: #f59e0b; }

/* ── Animal Profile ────────────────────────────────────────── */
.animal-profile {
  display: flex; gap: var(--sp-6);
  margin-bottom: var(--sp-6); align-items: center;
}
.animal-profile-avatar {
  width: 100px; height: 100px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-100), var(--accent-100));
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  cursor: pointer; position: relative;
  overflow: hidden;
  transition: all var(--ease-base);
}
.animal-profile-avatar:hover { box-shadow: var(--shadow-glow); }
.animal-profile-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: var(--radius-full);
}
.photo-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; opacity: 0;
  transition: opacity var(--ease-fast);
  border-radius: var(--radius-full);
}
.animal-profile-avatar:hover .photo-overlay { opacity: 1; }
.animal-profile-info { flex: 1; }
.animal-profile-name {
  font-size: var(--fs-2xl); font-weight: var(--fw-bold);
  color: var(--gray-900); margin-bottom: var(--sp-1);
  display: flex; align-items: center; gap: var(--sp-3);
}
.animal-profile-species {
  font-size: var(--fs-base); color: var(--gray-600);
  font-style: italic; margin-bottom: var(--sp-3);
}
.animal-profile-badges { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
}
.info-item {
  background: var(--gray-50); padding: var(--sp-4);
  border-radius: var(--radius-lg); border: 1px solid var(--gray-100);
}
.info-label {
  font-size: var(--fs-xs); color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: var(--sp-1); font-weight: var(--fw-semibold);
}
.info-value {
  font-size: var(--fs-base); color: var(--gray-900); font-weight: var(--fw-medium);
}

/* ── Photo Manager ─────────────────────────────────────────── */
.photo-manager { text-align: center; }
.photo-preview-container {
  width: 200px; height: 200px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--radius-full);
  overflow: hidden; border: 3px solid var(--gray-200);
  background: var(--gray-50);
}
.photo-preview {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-actions-zone {
  display: flex; gap: var(--sp-3);
  justify-content: center; margin-bottom: var(--sp-3);
}
.btn-upload { cursor: pointer; }
.photo-hint {
  font-size: var(--fs-xs); color: var(--gray-500);
}

/* ── Weight Stats ──────────────────────────────────────────── */
.weight-unit-toggle {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.weight-unit-label {
  font-size: var(--fs-sm); color: var(--gray-600);
  font-weight: var(--fw-medium);
}
.weight-unit-btn {
  padding: var(--sp-2) var(--sp-4);
  border: 1.5px solid var(--gray-300);
  background: var(--white); border-radius: var(--radius-md);
  cursor: pointer; font-size: var(--fs-sm);
  font-weight: var(--fw-semibold); color: var(--gray-600);
  transition: all var(--ease-fast);
  font-family: inherit;
}
.weight-unit-btn.active {
  background: var(--accent-400); color: var(--white);
  border-color: var(--accent-400);
}
.weight-unit-btn:hover:not(.active) {
  border-color: var(--accent-300); color: var(--accent-500);
}

.weight-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-6);
}
.weight-stat-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  text-align: center;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--ease-base);
}
.weight-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.weight-stat-icon { font-size: 1.5rem; margin-bottom: var(--sp-2); }
.weight-stat-value {
  font-size: var(--fs-xl); font-weight: var(--fw-bold);
  margin-bottom: var(--sp-1);
}
.weight-stat-label {
  font-size: var(--fs-xs); color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.weight-stat--last .weight-stat-value { color: var(--accent-500); }
.weight-stat--max .weight-stat-value { color: var(--success-600); }
.weight-stat--min .weight-stat-value { color: var(--warning-500); }
.weight-stat--avg .weight-stat-value { color: var(--primary-500); }

/* ── Weight Chart ──────────────────────────────────────────── */
.chart-container {
  position: relative; height: 300px;
  background: var(--white); border-radius: var(--radius-lg);
  padding: var(--sp-4); border: 1px solid var(--gray-200);
  margin-bottom: var(--sp-6);
}

/* ── Attachments ───────────────────────────────────────────── */
.attachments-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.attachment-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  transition: all var(--ease-fast);
}
.attachment-item:hover { border-color: var(--accent-300); }
.attachment-icon { font-size: 1.5rem; }
.attachment-info { flex: 1; }
.attachment-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--gray-900); }
.attachment-meta { font-size: var(--fs-xs); color: var(--gray-500); }
.attachment-actions { display: flex; gap: var(--sp-1); }

.attachment-uploader { text-align: center; }
.attachment-drop-zone {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-6);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  cursor: pointer; transition: all var(--ease-base);
  color: var(--gray-500);
}
.attachment-drop-zone:hover {
  border-color: var(--accent-400);
  background: var(--accent-100);
  color: var(--accent-600);
}
.attachment-drop-icon { font-size: 2.5rem; }
.attachment-upload-preview { margin-top: var(--sp-4); }
.attachment-file-preview {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  justify-content: center;
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: var(--sp-16) var(--sp-8);
  color: var(--gray-500);
}
.empty-state-icon { font-size: 3rem; margin-bottom: var(--sp-4); opacity: 0.5; }
.empty-state-text { font-size: var(--fs-base); margin-bottom: var(--sp-6); }

/* ── Loading ───────────────────────────────────────────────── */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-16);
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes pulseCta {
  0%, 100% { opacity: 0.5; } 50% { opacity: 1; }
}
@keyframes waveMove {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-20px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes floatParticle {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; } 90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(30px); opacity: 0; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --fs-3xl: 1.75rem; --fs-2xl: 1.35rem; }

  .main-content { padding: var(--sp-4); }
  .app-header { padding: var(--sp-3) var(--sp-4); }

  .menu-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .dept-card { padding: var(--sp-6) var(--sp-4); }
  .dept-card-icon { width: 50px; height: 50px; }
  .dept-card-name { font-size: var(--fs-base); }

  .dept-sections-grid { grid-template-columns: repeat(2, 1fr); }

  .animal-grid { grid-template-columns: 1fr; }

  .animal-profile { flex-direction: column; text-align: center; }
  .animal-profile-badges { justify-content: center; }
  .animal-profile-avatar { width: 80px; height: 80px; }
  .animal-profile-name { justify-content: center; }

  .info-grid { grid-template-columns: 1fr; }

  .tabs { gap: 0; }
  .tab-item { padding: var(--sp-3) var(--sp-3); font-size: var(--fs-xs); }

  .form-row { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .search-bar { flex-direction: column; }
  .filter-select { min-width: 100%; }

  .toast-container { top: var(--sp-3); right: var(--sp-3); left: var(--sp-3); }
  .toast { max-width: 100%; }

  .modal { margin: var(--sp-4); max-height: 85vh; }

  .chart-container { height: 220px; }

  .table { font-size: var(--fs-xs); }
  .table th, .table td { padding: var(--sp-2) var(--sp-3); }

  .global-search-panel { width: 280px; right: -40px; }

  .weight-stats-grid { grid-template-columns: repeat(2, 1fr); }

  .header-back-text { display: none; }
}

@media (max-width: 400px) {
  .menu-grid { grid-template-columns: 1fr; }
  .splash-logo { width: 160px; }
  .splash-title { font-size: var(--fs-2xl); }
  .weight-stats-grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
  .dept-sections-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1200px) {
  .menu-grid { max-width: 700px; gap: var(--sp-6); }
  .dept-card { padding: var(--sp-10) var(--sp-8); }
}

/* ── Diet Fish Breakdown Module ────────────────────────────── */
.diet-breakdown-card {
  border-top: 3px solid var(--accent-500);
}

.diet-fish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.diet-fish-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  transition: all 0.2s ease;
}

.diet-fish-item:hover {
  border-color: var(--accent-400);
  box-shadow: 0 2px 8px rgba(0, 180, 216, 0.1);
  transform: translateY(-1px);
}

.diet-fish-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  font-weight: 600;
  color: var(--gray-800);
}

.diet-fish-emoji {
  font-size: var(--fs-xl);
}

.diet-fish-name {
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
}

.diet-fish-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.diet-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  background: white;
  font-size: var(--fs-lg);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: var(--gray-600);
  user-select: none;
  flex-shrink: 0;
}

.diet-qty-minus:hover {
  background: var(--danger-50, #fef2f2);
  border-color: var(--danger-400);
  color: var(--danger-500);
}

.diet-qty-plus:hover {
  background: var(--success-50, #f0fdf4);
  border-color: var(--success-400, #4ade80);
  color: var(--success-500, #22c55e);
}

.diet-qty-btn:active {
  transform: scale(0.92);
}

.diet-qty-input {
  width: 70px;
  height: 36px;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background: white;
  -moz-appearance: textfield;
  appearance: textfield;
}

.diet-qty-input::-webkit-outer-spin-button,
.diet-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.diet-qty-input:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.diet-qty-unit {
  font-size: var(--fs-sm);
  color: var(--gray-500);
  font-weight: 500;
  min-width: 14px;
}

.diet-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-800), var(--primary-700));
  color: white;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-5);
}

.diet-total-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  opacity: 0.85;
}

.diet-total-value {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--accent-400);
}

.diet-chart-container {
  position: relative;
  height: 320px;
  max-width: 420px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .diet-fish-grid {
    grid-template-columns: 1fr;
  }
  .diet-chart-container {
    height: 280px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   LEONES MARINOS — Módulo de Dietas Estilo Excel
   ═══════════════════════════════════════════════════════════════ */

/* ── Tarjeta Resumen ───────────────────────────────────────── */
.leo-diet-summary {
  border-top: 3px solid var(--accent-500);
}

.leo-diet-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--gray-200);
}

.leo-diet-summary-header h3 {
  margin: 0;
  font-size: var(--fs-lg);
}

.leo-diet-summary-date {
  font-size: var(--fs-sm);
  color: var(--gray-500);
}

.leo-diet-summary-grid {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  flex-wrap: wrap;
}

.leo-diet-summary-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-3) var(--sp-5);
  background: linear-gradient(135deg, var(--primary-800), var(--primary-700));
  border-radius: var(--radius-lg);
  margin-right: var(--sp-4);
}

.leo-diet-summary-total-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--accent-400);
}

.leo-diet-summary-total-label {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leo-diet-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  min-width: 54px;
}

.leo-diet-summary-item-value {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--gray-800);
}

.leo-diet-summary-item-label {
  font-size: var(--fs-xs);
  color: var(--gray-500);
  font-weight: 500;
}

/* ── Botones de Acción ─────────────────────────────────────── */
.leo-diet-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}

/* ── Tabla Estilo Excel ────────────────────────────────────── */
.leo-diet-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.leo-diet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-family: 'Inter', monospace;
  white-space: nowrap;
}

.leo-diet-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.leo-diet-table th {
  background: var(--primary-800);
  color: white;
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.1);
}

.leo-diet-table th:last-child {
  border-right: none;
}

.leo-diet-table th.leo-dt-fecha,
.leo-diet-table th.leo-dt-obs {
  text-align: left;
}

.leo-diet-table td {
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
  border-bottom: 1px solid var(--gray-100);
  border-right: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.leo-diet-table td:last-child {
  border-right: none;
}

.leo-diet-table td.leo-dt-fecha {
  text-align: left;
  font-weight: 500;
  color: var(--gray-800);
}

.leo-diet-table td.leo-dt-total {
  color: var(--primary-700);
  font-weight: 600;
}

.leo-diet-table td.leo-dt-obs {
  text-align: left;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gray-500);
  font-style: italic;
}

/* Zebra striping */
.leo-diet-table tbody tr:nth-child(even) {
  background: var(--gray-50);
}

.leo-diet-table tbody tr:hover {
  background: var(--accent-100);
}

/* Today row highlight */
.leo-diet-table tbody tr.leo-dt-today {
  background: rgba(0, 180, 216, 0.08);
  border-left: 3px solid var(--accent-500);
}

.leo-diet-table tbody tr.leo-dt-today td {
  font-weight: 500;
  color: var(--gray-900);
}

/* ── Gráfico Filtros ───────────────────────────────────────── */
.leo-diet-chart-filters {
  display: flex;
  gap: var(--sp-1);
}

.leo-dcf-btn {
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Inter', sans-serif;
}

.leo-dcf-btn:hover {
  border-color: var(--accent-400);
  color: var(--accent-500);
}

.leo-dcf-btn.active {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: white;
}

.leo-diet-chart-container {
  position: relative;
  height: 300px;
}

/* ── Form Grid (Modal) ─────────────────────────────────────── */
.leo-diet-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.leo-diet-form-total {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  text-align: center;
  font-size: var(--fs-lg);
  color: var(--primary-700);
  margin-bottom: var(--sp-4);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .leo-diet-summary-grid {
    gap: var(--sp-2);
  }
  .leo-diet-summary-total {
    width: 100%;
    margin-right: 0;
    margin-bottom: var(--sp-3);
    flex-direction: row;
    justify-content: center;
    gap: var(--sp-3);
  }
  .leo-diet-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .leo-diet-chart-container {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .leo-diet-form-grid {
    grid-template-columns: 1fr;
  }
  .leo-diet-actions {
    flex-direction: column;
  }
  .leo-diet-actions .btn {
    width: 100%;
  }
}


/* ── Módulo de Sesiones de Dieta ────────────────────────────── */
.leo-diet-sessions-form {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
}
.leo-diet-sessions-form th {
  text-align: center;
  background: var(--gray-50);
  padding: var(--sp-2);
  border-bottom: 2px solid var(--gray-200);
  font-weight: var(--fw-semibold);
  color: var(--gray-700);
}
.leo-diet-sessions-form td {
  padding: var(--sp-1);
  border-bottom: 1px solid var(--gray-100);
  text-align: center;
  vertical-align: middle;
}
.leo-diet-sessions-form .form-input {
  padding: var(--sp-2);
  text-align: center;
  width: 100%;
  min-width: 60px;
}
.leo-diet-sessions-form .row-total {
  font-weight: var(--fw-bold);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: var(--sp-1);
}
.leo-dt-session-breakdown {
  background: #f8fafc;
}
.leo-dt-session-breakdown td {
  padding: 0 !important;
  border-bottom: 1px solid var(--gray-200) !important;
}
.leo-dt-session-breakdown-inner {
  padding: var(--sp-3) var(--sp-6);
  border-left: 3px solid var(--accent-400);
}
.leo-dt-session-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.leo-dt-session-table th {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: var(--sp-2);
  text-align: center;
  font-weight: var(--fw-medium);
  border-bottom: 1px solid var(--gray-200);
}
.leo-dt-session-table td {
  padding: var(--sp-2);
  text-align: center;
  border-bottom: 1px solid var(--gray-100);
}
.session-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-500);
  font-size: 1.1rem;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--ease-fast);
}
.session-toggle-btn.expanded {
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════════
   TRAINING MODERN VIEW — Estilo SaaS / Cards
   ═══════════════════════════════════════════════════════════════ */

/* ── Contenedores Generales ─────────────────────────────────── */
.modern-training-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
  margin-top: var(--sp-4);
  border: 1px solid var(--gray-200);
}

.modern-training-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--gray-100);
}

.modern-training-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

/* ── Listado de Sesiones Moderno (Vista General) ─────────────── */
.modern-session-list {
  display: flex;
  flex-direction: column;
}

.modern-session-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--ease-fast);
}

.modern-session-list-item:last-child {
  border-bottom: none;
}

.modern-session-list-item:hover {
  background: var(--gray-50);
}

.msl-animal {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
}

.msl-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
}

.msl-info {
  display: flex;
  flex-direction: column;
}

.msl-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.95rem;
}

.msl-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.msl-attitude {
  min-width: 120px;
  text-align: right;
}

/* ── Tarjetas de Sesión (Vista Individual) ───────────────────── */
.modern-session-card-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.modern-session-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: box-shadow var(--ease-fast), border-color var(--ease-fast);
}

.modern-session-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-300);
}

.modern-session-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-3);
}

.msc-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msc-date {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.msc-trainer {
  font-size: 0.85rem;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 6px;
}

.msc-actions {
  display: flex;
  gap: var(--sp-1);
}

.modern-session-card-body {
  background: var(--gray-50);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.5;
  margin-bottom: var(--sp-3);
}

.modern-session-card-footer {
  display: flex;
  justify-content: flex-start;
}

/* ── Badges de Actitud ───────────────────────────────────────── */
.attitude-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.attitude-badge--excelente {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #C8E6C9;
}

.attitude-badge--regular {
  background: #FFF8E1;
  color: #F57F17;
  border: 1px solid #FFECB3;
}

.attitude-badge--mal {
  background: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFE0B2;
}

.attitude-badge--muy-mal {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
}

/* ── Dropdown visual (indicador) ─────────────────────────────── */
.attitude-dropdown-indicator {
  color: inherit;
  opacity: 0.6;
  font-size: 0.7rem;
  margin-left: 4px;
}

/* ── Pestañas Inferiores tipo Excel/SaaS ─────────────────────── */
.training-tabs-bar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 var(--sp-2);
  margin-top: var(--sp-4);
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.training-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--gray-200);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: all var(--ease-fast);
  white-space: nowrap;
  position: relative;
  bottom: -2px;
  background: var(--gray-50);
  color: var(--gray-600);
}

.training-tab--animal {
  background: #F3E5F5;
  color: #6A1B9A;
  border-color: #E1BEE7;
}

.training-tab--animal:hover {
  background: #E1BEE7;
}

.training-tab--training {
  background: #E8F5E9;
  color: #2E7D32;
  border-color: #C8E6C9;
}

.training-tab--active {
  background: var(--white) !important;
  color: var(--primary-700) !important;
  border-color: var(--gray-200) !important;
  font-weight: 700;
  z-index: 1;
}

/* ── Gráficos de resumen ─────────────────────────────────────── */
.training-charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.training-chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
  border: 1px solid var(--gray-200);
}

.training-chart-card h4 {
  margin: 0 0 var(--sp-3) 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.training-chart-container {
  position: relative;
  height: 280px;
}

/* ── Resumen de Actitud (tarjetas superiores) ────────────────── */
.training-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.training-summary-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  border-top: 4px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.training-summary-item--total { border-top-color: var(--primary-500); }
.training-summary-item--excelente { border-top-color: #4CAF50; }
.training-summary-item--regular   { border-top-color: #FFC107; }
.training-summary-item--mal       { border-top-color: #FF9800; }
.training-summary-item--muy-mal   { border-top-color: #F44336; }

.training-summary-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}

.training-summary-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .training-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .training-tabs-bar {
    padding: 0;
  }
  .training-tab {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .training-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .modern-session-card-header {
    flex-direction: column;
    gap: var(--sp-2);
  }
  .msc-actions {
    align-self: flex-end;
    margin-top: -30px;
  }
}


/* ── Tabla Excel ─────────────────────────────────────────────── */
.training-excel-wrap {
  overflow-x: auto;
  border: 1px solid #c0c0c0;
  border-radius: var(--radius-sm);
}

.training-excel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
}

.training-excel-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.training-excel-table th {
  background: #616161;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 12px;
  border: 1px solid #555;
  text-align: left;
  white-space: nowrap;
}

.training-excel-table td {
  padding: 9px 12px;
  border: 1px solid #D0D0D0;
  vertical-align: middle;
}

/* Columnas con fondo verde claro */
.training-excel-table .col-green {
  background: #E8F5E9;
}

/* Columna de observaciones — rosa pastel */
.training-excel-table .col-pink {
  background: #FCE4EC;
}

/* Columna de observaciones — más ancha */
.training-excel-table .col-obs {
  min-width: 320px;
  width: 40%;
}

/* Columna de fecha */
.training-excel-table .col-fecha {
  min-width: 150px;
  white-space: nowrap;
}

/* Columna de acciones */
.training-excel-table .col-actions {
  width: 80px;
  text-align: center;
  background: #fff;
}

/* Filas vacías */
.training-excel-table tr.empty-row td {
  height: 42px;
}

/* Hover sutil estilo Excel */
.training-excel-table tbody tr:hover td {
  background-color: rgba(0, 119, 182, 0.06) !important;
}

/* Fila de hoy */
.training-excel-table tbody tr.training-today td {
  border-left: 3px solid var(--accent-500);
}

/* ── Badges de Actitud ───────────────────────────────────────── */
.attitude-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.attitude-badge--excelente {
  background: #C8E6C9;
  color: #2E7D32;
}

.attitude-badge--regular {
  background: #FFF9C4;
  color: #F57F17;
}

.attitude-badge--mal {
  background: #FFE0B2;
  color: #E65100;
}

.attitude-badge--muy-mal {
  background: #FFCDD2;
  color: #C62828;
}

/* ── Dropdown visual (indicador) ─────────────────────────────── */
.attitude-dropdown-indicator {
  color: #999;
  font-size: 0.7rem;
  margin-left: 4px;
}

/* ── Icono editar en observaciones ────────────────────────────── */
.obs-edit-icon {
  float: right;
  color: #999;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--ease-fast);
}

.obs-edit-icon:hover {
  opacity: 1;
}

/* ── Pestañas Inferiores tipo Excel ──────────────────────────── */
.training-tabs-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 0 var(--sp-2);
  margin-top: var(--sp-4);
  border-bottom: 2px solid #c0c0c0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.training-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid #c0c0c0;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all var(--ease-fast);
  white-space: nowrap;
  position: relative;
  bottom: -2px;
}

.training-tab--animal {
  background: #7B1FA2;
  color: #ffffff;
  border-color: #6A1B9A;
}

.training-tab--animal:hover {
  background: #9C27B0;
}

.training-tab--training {
  background: #388E3C;
  color: #ffffff;
  border-color: #2E7D32;
}

.training-tab--active {
  background: #ffffff !important;
  color: #333 !important;
  border-color: #c0c0c0 !important;
  font-weight: 700;
  z-index: 1;
}

/* ── Gráficos de resumen ─────────────────────────────────────── */
.training-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.training-chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
}

.training-chart-card h4 {
  margin: 0 0 var(--sp-3) 0;
  font-size: 0.95rem;
  color: var(--gray-700);
}

.training-chart-container {
  position: relative;
  height: 260px;
}

/* ── Resumen de Actitud (tarjetas) ───────────────────────────── */
.training-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.training-summary-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid transparent;
}

.training-summary-item--excelente { border-left-color: #4CAF50; }
.training-summary-item--regular   { border-left-color: #FFC107; }
.training-summary-item--mal       { border-left-color: #FF9800; }
.training-summary-item--muy-mal   { border-left-color: #F44336; }

.training-summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
}

.training-summary-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: var(--sp-1);
}

/* ── Acciones de entrenamiento ───────────────────────────────── */
.training-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  margin-bottom: var(--sp-4);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .training-charts-row {
    grid-template-columns: 1fr;
  }
  .training-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .training-tabs-bar {
    padding: 0;
  }
  .training-tab {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .training-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .training-excel-table .col-obs {
    min-width: 200px;
  }
}

/* ============================================================
   FISH MANAGEMENT & DEFROST CALCULATOR STYLES
   ============================================================ */

.fish-management-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6, 1.5rem);
}

.fish-header-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.fish-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.fish-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-900, #0a2647);
  margin: 0 0 0.25rem 0;
}

.fish-subtitle {
  font-size: 0.9rem;
  color: var(--gray-600, #475569);
  margin: 0;
}

.fish-actions {
  display: flex;
  gap: 0.75rem;
}

.fish-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200, #e2e8f0);
}

.fish-dept-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fish-filter-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700, #334155);
}

.fish-metrics-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.fish-metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--gray-100, #f1f5f9);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--gray-700, #334155);
  border: 1px solid var(--gray-200, #e2e8f0);
}

.fish-metric-badge.highlight {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
  font-weight: 600;
}

.fish-panel {
  padding: 1.5rem;
}

.fish-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--gray-200, #e2e8f0);
}

.panel-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary-600, #0077b6);
  background: #e0f2fe;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.fish-panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900, #0f172a);
  margin: 0 0 0.25rem 0;
}

.fish-panel-sub {
  font-size: 0.85rem;
  color: var(--gray-500, #64748b);
  margin: 0;
}

.defrost-traceability-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.defrost-btn-action {
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.defrost-status-done {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.defrost-badge-done {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
}

.defrost-timestamp {
  font-size: 0.75rem;
  color: var(--gray-500, #64748b);
  margin-top: 2px;
}

.defrost-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.defrost-card {
  background: #ffffff;
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.defrost-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.defrost-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.defrost-fish-icon {
  font-size: 2rem;
}

.defrost-fish-title h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900, #0f172a);
}

.defrost-animal-count {
  font-size: 0.75rem;
  color: var(--gray-500, #64748b);
}

.defrost-card-qty {
  margin-bottom: 0.75rem;
}

.defrost-kg {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-700, #0284c7);
  letter-spacing: -0.02em;
}

.defrost-kg small {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-500, #64748b);
}

.defrost-card-boxes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gray-50, #f8fafc);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--gray-100, #f1f5f9);
}

.boxes-count-badge {
  font-size: 0.85rem;
  color: var(--gray-700, #334155);
}

.box-weight-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--gray-500, #64748b);
}

.box-weight-input {
  width: 55px;
  padding: 2px 4px;
  font-size: 0.8rem;
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: 4px;
  text-align: center;
}

.defrost-card-footer {
  font-size: 0.75rem;
  color: var(--gray-600, #475569);
  padding-top: 0.5rem;
  border-top: 1px dashed var(--gray-200, #e2e8f0);
}

.defrost-animals-preview {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fish-projections-table th {
  background: var(--gray-50, #f8fafc);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600, #475569);
}

.fish-projections-table .highlight-qty {
  color: var(--primary-700, #0284c7);
  font-size: 1.05rem;
}

.fish-projections-table .grand-total-row {
  background: #f0f9ff;
  border-top: 2px solid var(--primary-300, #7dd3fc);
  font-size: 1rem;
}

.fish-projections-table .grand-total-row td {
  padding: 1rem 0.75rem;
  color: var(--primary-900, #0c4a6e);
}

/* Reglas de impresión limpias para proveedores */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header, .breadcrumbs, .fish-actions, .fish-dept-selector, .defrost-traceability-box button {
    display: none !important;
  }
  .main-content {
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    margin-bottom: 2rem !important;
    break-inside: avoid;
  }
  .fish-projections-table {
    border-collapse: collapse !important;
    width: 100% !important;
  }
  .fish-projections-table th, .fish-projections-table td {
    border: 1px solid #ddd !important;
    padding: 8px !important;
  }
}


/* ============================================================
   ESTILOS - REHABILITACIÓN Y CUIDADOS CEGMA (TORTUGAS MARINAS)
   ============================================================ */

.cegma-page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.cegma-header-card {
  background: linear-gradient(135deg, rgba(4, 28, 44, 0.88), rgba(10, 38, 71, 0.92)), url('../assets/tortuga_boba.jpg') center/cover no-repeat;
  color: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.cegma-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.checklist-group {
  background: var(--gray-50);
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  margin-top: 0.5rem;
  color: var(--gray-900, #1e293b);
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  cursor: pointer;
  user-select: none;
  color: var(--gray-900, #1e293b) !important;
}

.checklist-item span,
.checklist-item strong {
  color: var(--gray-900, #1e293b) !important;
}

.checklist-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--success-600);
  cursor: pointer;
}

.cegma-header-card .cegma-badge {
  background: rgba(0, 212, 255, 0.25);
  color: #7dd3fc !important;
  border: 1px solid rgba(0, 212, 255, 0.45);
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cegma-header-card .cegma-title,
.cegma-header-card h2 {
  color: #ffffff !important;
  font-size: var(--fs-2xl);
  font-weight: 800;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

.cegma-header-card .cegma-subtitle,
.cegma-header-card p {
  color: #f1f5f9 !important;
  font-size: var(--fs-sm);
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.cegma-turtle-selector-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}

.cegma-header-card .cegma-filter-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #ffffff !important;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.cegma-select {
  background-color: var(--white);
  color: var(--gray-900);
  border: 1px solid var(--gray-300);
  font-weight: var(--fw-semibold);
}

.cegma-card-section {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
}

/* Patient Header Info */
.cegma-patient-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1.25rem;
}

.patient-main-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.patient-avatar {
  font-size: 2.75rem;
  background: var(--accent-100);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(0,180,216,0.3);
}

.patient-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.patient-name {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--primary-900);
  margin: 0;
}

.patient-subtitle {
  font-size: var(--fs-sm);
  color: var(--gray-600);
  margin: 0.35rem 0 0.25rem;
}

.patient-diagnosis {
  font-size: var(--fs-sm);
  color: var(--gray-800);
  background: var(--gray-50);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
  border-left: 3px solid var(--accent-500);
}

/* Biometrics Grid Cards */
.cegma-biometrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.bio-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--ease-fast), box-shadow var(--ease-fast);
}

.bio-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.bio-card--weight {
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  border-color: #bae6fd;
}

.bio-card-icon {
  font-size: 2rem;
}

.bio-card-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: var(--fw-bold);
  color: var(--gray-600);
}

.bio-card-value {
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  color: var(--primary-900);
  margin: 0.15rem 0;
}

.bio-card-value small {
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
  color: var(--gray-600);
}

.bio-card-sub {
  font-size: var(--fs-xs);
  color: var(--gray-500);
}

/* Formulario Diario & Hoja de Cálculo */
.daily-form-top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.spreadsheet-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  background: var(--white);
  box-shadow: inset 0 0 4px rgba(0,0,0,0.03);
}

.spreadsheet-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

.spreadsheet-table th {
  background: var(--primary-50);
  color: var(--primary-900);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid var(--gray-300);
}

.spreadsheet-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}

.spreadsheet-row:nth-child(even) {
  background: var(--gray-50);
}

.spreadsheet-row .form-input, .spreadsheet-row .form-select {
  margin: 0;
  padding: 0.4rem 0.6rem;
  font-size: var(--fs-sm);
}

.spreadsheet-total-row {
  background: #f0fdf4;
  border-top: 2px solid var(--success-500);
}

.spreadsheet-total-row td {
  padding: 0.75rem 0.5rem;
  font-size: var(--fs-sm);
  color: var(--gray-900);
}

.spreadsheet-actions {
  margin-bottom: 1.5rem;
}

.water-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  background: var(--gray-50);
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

/* Pool Maintenance */
.pool-maint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--gray-50);
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  margin-top: 0.5rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  cursor: pointer;
  user-select: none;
}

.checklist-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--success-600);
  cursor: pointer;
}

.pool-history-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.pool-history-card h4 {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  margin: 0 0 0.75rem;
  color: var(--primary-900);
}

.pool-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.pool-history-item {
  background: var(--white);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.pool-history-top {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--gray-800);
}

.pool-history-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin: 0.4rem 0;
}

.pool-history-tech {
  font-size: var(--fs-xs);
  color: var(--gray-600);
}

/* Analytics Charts */
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.chart-card h4 {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--primary-900);
  margin: 0 0 1rem;
}

.chart-wrapper {
  position: relative;
  height: 240px;
  width: 100%;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.form-input-static {
  background: var(--gray-100);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  font-size: var(--fs-sm);
  color: var(--primary-900);
}

/* Media Queries Responsivas */
@media (max-width: 840px) {
  .pool-maint-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .cegma-header-top {
    flex-direction: column;
    align-items: stretch;
  }
  .cegma-turtle-selector-container {
    flex-direction: column;
    align-items: stretch;
  }
  .cegma-patient-header {
    flex-direction: column;
  }
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ── Clone Sessions Modal ──────────────────────────────────── */
.clone-modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.clone-preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--gray-50, #f8f9fa);
  border-radius: 10px;
  border: 1px solid var(--gray-200, #e9ecef);
}

.clone-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid var(--primary-300, #5499c7);
  background: white;
  color: var(--primary-700, #0f3460);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.clone-preset-btn:hover {
  background: var(--primary-50, #eaf2f8);
  border-color: var(--primary-500, #1a5276);
}

.clone-preset-btn.active {
  background: var(--primary-600, #144272);
  border-color: var(--primary-600, #144272);
  color: white;
}

.clone-preset-btn[data-group="Lagoon"] {
  border-color: #0077b6;
  color: #0077b6;
}
.clone-preset-btn[data-group="Lagoon"].active {
  background: #0077b6;
  border-color: #0077b6;
  color: white;
}

.clone-preset-btn[data-group="Show"] {
  border-color: #ea580c;
  color: #ea580c;
}
.clone-preset-btn[data-group="Show"].active {
  background: #ea580c;
  border-color: #ea580c;
  color: white;
}

.clone-preset-btn[data-group="Bahía"] {
  border-color: #0d9488;
  color: #0d9488;
}
.clone-preset-btn[data-group="Bahía"].active {
  background: #0d9488;
  border-color: #0d9488;
  color: white;
}

.clone-preset-btn[data-group="A"] {
  border-color: #7c3aed;
  color: #7c3aed;
}
.clone-preset-btn[data-group="A"].active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: white;
}

.clone-preset-all {
  border-color: var(--success-500, #16a34a);
  color: var(--success-500, #16a34a);
}
.clone-preset-none {
  border-color: var(--gray-400, #94a3b8);
  color: var(--gray-500, #64748b);
}

.clone-animal-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--gray-200, #e9ecef);
  border-radius: 10px;
  padding: 4px;
  background: white;
}

.clone-animal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}
.clone-animal-item:hover {
  background: var(--primary-50, #eaf2f8);
}

.clone-animal-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-600, #144272);
  flex-shrink: 0;
  cursor: pointer;
}

.clone-animal-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-900, #1e293b);
}

.clone-animal-species {
  font-size: 0.78rem;
  color: var(--gray-500, #64748b);
  margin-left: auto;
}

.clone-group-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clone-group-lagoon {
  background: #e0f2fe;
  color: #0369a1;
}

.clone-group-show {
  background: #fff7ed;
  color: #c2410c;
}

.clone-group-bahía {
  background: #ccfbf1;
  color: #0f766e;
}

.clone-group-a {
  background: #ede9fe;
  color: #6d28d9;
}

.clone-footer-info {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: var(--primary-50, #eaf2f8);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-700, #0f3460);
}

/* ============================================================
   AUTH - Login Modal, Profile Widget & Dropdown
   ============================================================ */

/* ── Auth Widget (in header) ──────────────────────────────── */
.auth-widget {
  position: relative;
  flex-shrink: 0;
}
.auth-widget--menu {
  position: absolute;
  top: var(--sp-4); right: var(--sp-4);
  z-index: 10;
}

.auth-login-btn {
  display: flex; align-items: center; gap: var(--sp-2);
  height: 36px; padding: 0 var(--sp-4);
  background: linear-gradient(135deg, var(--accent-500), var(--accent-400));
  border: none; border-radius: var(--radius-2xl);
  color: var(--white); cursor: pointer;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  transition: all var(--ease-fast);
  white-space: nowrap;
}
.auth-login-btn:hover {
  background: linear-gradient(135deg, var(--accent-600), var(--accent-500));
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}
.auth-login-btn:active { transform: scale(0.96); }

.auth-widget-btn {
  display: flex; align-items: center; gap: var(--sp-2);
  height: 36px; padding: 0 var(--sp-3) 0 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-2xl);
  color: var(--white); cursor: pointer;
  transition: all var(--ease-fast);
}
.auth-widget-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.25);
}

.auth-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-500), var(--accent-300));
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold); font-size: var(--fs-sm);
  color: var(--white);
  flex-shrink: 0;
}
.auth-avatar-img {
  object-fit: cover;
  background: none;
}
.auth-avatar--lg {
  width: 42px; height: 42px;
  font-size: var(--fs-lg);
}

.auth-info {
  display: flex; flex-direction: column;
  line-height: 1.2; text-align: left;
}
.auth-name {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  max-width: 120px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.auth-role {
  font-size: var(--fs-xs); opacity: 0.7;
}

/* ── Auth Dropdown ────────────────────────────────────────── */
.auth-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 260px; background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--ease-base);
  z-index: var(--z-dropdown);
  overflow: hidden;
}
.auth-dropdown.open {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}

.auth-dropdown-header {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4);
  background: linear-gradient(135deg, var(--primary-50), var(--accent-100));
  border-bottom: 1px solid var(--gray-100);
}
.auth-dropdown-name {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--gray-900);
}
.auth-dropdown-email {
  font-size: var(--fs-xs); color: var(--gray-600);
  word-break: break-all;
}
.auth-dropdown-role {
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  color: var(--accent-600);
  margin-top: 2px;
}

.auth-dropdown-item {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; padding: var(--sp-3) var(--sp-4);
  border: none; background: none;
  font-size: var(--fs-sm); color: var(--gray-700);
  cursor: pointer;
  transition: all var(--ease-fast);
  text-align: left;
}
.auth-dropdown-item:hover {
  background: var(--gray-50);
  color: var(--danger-600);
}
.auth-logout-btn svg { opacity: 0.6; }
.auth-logout-btn:hover svg { opacity: 1; }

/* ── Login Modal Overlay ──────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 28, 44, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn 200ms ease;
}

.login-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), var(--shadow-glow);
  width: 100%; max-width: 420px;
  animation: slideUp 350ms var(--ease-spring);
  overflow: hidden;
}

.login-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-6);
  background: linear-gradient(135deg, var(--primary-800), var(--primary-700));
  color: var(--white);
}
.login-modal-brand {
  display: flex; align-items: center; gap: var(--sp-3);
}
.login-logo {
  height: 32px; width: auto; opacity: 0.95;
}
.login-modal-header h2 {
  font-size: var(--fs-xl); font-weight: var(--fw-bold);
  margin: 0;
}

/* ── Login Form ───────────────────────────────────────────── */
.login-form {
  padding: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-5);
}

.login-field {
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.login-field label {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--gray-700);
}
.login-field input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-family: var(--font-family);
  color: var(--gray-900);
  background: var(--gray-50);
  transition: all var(--ease-fast);
  outline: none;
}
.login-field input:focus {
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
  background: var(--white);
}
.login-field input::placeholder {
  color: var(--gray-400);
}

.login-password-wrapper {
  position: relative;
}
.login-password-wrapper input {
  padding-right: 44px;
}
.login-toggle-pw {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border: none; background: none;
  cursor: pointer; font-size: var(--fs-lg);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  opacity: 0.6;
  transition: opacity var(--ease-fast);
}
.login-toggle-pw:hover { opacity: 1; }

.login-error {
  padding: var(--sp-3) var(--sp-4);
  background: var(--danger-100);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: var(--radius-md);
  color: var(--danger-600);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  animation: shakeX 300ms ease;
}

.login-submit {
  width: 100%;
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  border-radius: var(--radius-md);
  transition: all var(--ease-fast);
}
.login-submit:disabled {
  opacity: 0.7; cursor: not-allowed;
}

.login-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.login-footer {
  text-align: center;
  padding: var(--sp-3) var(--sp-6) var(--sp-5);
  font-size: var(--fs-xs); color: var(--gray-500);
  margin: 0;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── Responsive: Auth widget ──────────────────────────────── */
@media (max-width: 600px) {
  .auth-info { display: none; }
  .auth-login-btn span { display: none; }
  .auth-login-btn { padding: 0; width: 36px; height: 36px; justify-content: center; border-radius: var(--radius-md); }
  .auth-widget-btn { padding: 0; }
  .login-modal { max-width: 100%; margin: var(--sp-3); }
}

/* %% Enrichment Catalog %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
.enrichment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.enrichment-card { background: var(--surface-card); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.enrichment-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.enrichment-card-image { height: 180px; background: var(--surface-bg); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--gray-100); }
.enrichment-card-content { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.enrichment-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-badge { background: var(--white); border: 1px solid var(--gray-300); color: var(--gray-700); padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.filter-badge:hover { border-color: var(--primary-400); color: var(--primary-600); }
.filter-badge.active { background: var(--primary-600); color: var(--white); border-color: var(--primary-600); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 38, 71, 0.55); backdrop-filter: blur(4px); z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; animation: fadeIn 200ms ease; }
.modal-content { background: var(--white); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); padding: 2rem; width: 90%; max-width: 500px; animation: slideUp 300ms var(--ease-spring); }

/* -- Enrichment Dashboard ---------------------------------- */
.tab-btn { padding: 10px 20px; border: none; background: transparent; cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; color: var(--gray-600); }
.tab-btn:hover { color: var(--primary-500); }
.tab-btn.active { border-bottom-color: var(--primary-500); color: var(--primary-600); font-weight: 600; }
.enr-matrix th { white-space: nowrap; text-align: center; }
.enr-matrix td { text-align: center; }
.sticky-col { position: sticky; left: 0; background: white; z-index: 10; border-right: 1px solid var(--gray-200); }
.matrix-badge { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.8rem; font-weight: bold; }
.matrix-danger { background: var(--danger-100); color: var(--danger-600); }
.matrix-warning { background: var(--warning-100); color: var(--warning-600); }
.matrix-success { background: var(--success-100); color: var(--success-600); }
.badge-cog { background: #e0e7ff; color: #3730a3; }
.badge-ali { background: #fef3c7; color: #92400e; }
.badge-sen { background: #fce7f3; color: #9d174d; }
.badge-ocu { background: #dbeafe; color: #1e40af; }
.badge-soc { background: #d1fae5; color: #065f46; }
.badge-gray { background: #f3f4f6; color: #374151; }

/* ── Pagination Bar ────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 12px 12px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--primary-300);
  border-radius: 8px;
  background: white;
  color: var(--primary-700);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-50);
  border-color: var(--primary-400);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--gray-200);
  color: var(--gray-400);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
  user-select: none;
}

.pagination-info strong {
  color: var(--primary-700);
}

.pagination-count {
  color: var(--gray-400);
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .pagination-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .pagination-count {
    display: none;
  }
}

/* ============================================================
   VETERINARY — Photo Dropzone, Evolution Gallery & Lightbox
   ============================================================ */

/* ── Photo Dropzone ────────────────────────────────────────── */
.vet-photo-dropzone {
  position: relative;
  border: 2px dashed var(--gray-300, #cbd5e1);
  border-radius: var(--radius-xl, 16px);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(to bottom right, var(--gray-50, #f8fafc), var(--gray-100, #f1f5f9));
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

.vet-photo-dropzone:hover {
  border-color: var(--primary-400, #38bdf8);
  background: linear-gradient(to bottom right, #f0f9ff, #e0f2fe);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.1);
}

.vet-photo-dropzone.drag-active {
  border-color: var(--primary-500, #0ab4d8);
  background: #e0f2fe;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
  transform: scale(1.02);
}

.vet-photo-placeholder {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.vet-photo-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--primary-500, #0ea5e9);
  margin-bottom: 4px;
  transition: transform 0.3s ease;
}

.vet-photo-dropzone:hover .vet-photo-placeholder svg {
  transform: translateY(-4px);
}

.vet-photo-placeholder p {
  font-weight: 600;
  color: var(--gray-700, #334155);
  font-size: 1.05rem;
  margin: 0;
}

.vet-photo-preview {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius-md, 8px);
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.vet-photo-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

.vet-photo-clear:hover {
  background: rgba(220, 38, 38, 0.85);
}

/* ── Evolution Gallery ─────────────────────────────────────── */
.vet-evolution-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.vet-evolution-card {
  position: relative;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  background: var(--gray-50, #f8fafc);
  border: 1px solid var(--gray-200, #e2e8f0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vet-evolution-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.vet-evolution-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--gray-100, #f1f5f9);
}

.vet-evolution-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vet-evolution-card:hover .vet-evolution-thumb img {
  transform: scale(1.05);
}

.vet-evolution-info {
  padding: 0.75rem;
}

.vet-evolution-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700, #334155);
}

.vet-evolution-time {
  font-weight: 400;
  color: var(--gray-500);
  margin-left: 4px;
}

.vet-evolution-treatment {
  font-size: 0.8rem;
  color: var(--primary-700, #0369a1);
  margin-top: 2px;
}

.vet-evolution-notes {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 4px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.vet-evolution-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s;
  z-index: 2;
}

.vet-evolution-card:hover .vet-evolution-delete {
  opacity: 1;
}

.vet-evolution-delete:hover {
  background: rgba(220, 38, 38, 0.85);
}

/* ── Lightbox Overlay ──────────────────────────────────────── */
.vet-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.vet-lightbox-overlay.active {
  opacity: 1;
}

.vet-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.vet-lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 85vw;
  max-height: 75vh;
}

.vet-lightbox-img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease;
}

.vet-lightbox-close {
  position: absolute;
  top: -40px;
  right: -10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 3;
}

.vet-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.vet-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 3;
}

.vet-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.vet-lightbox-prev {
  left: -60px;
}

.vet-lightbox-next {
  right: -60px;
}

.vet-lightbox-caption {
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  text-align: center;
  max-width: 500px;
  line-height: 1.4;
}

.vet-lightbox-counter {
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  text-align: center;
}

/* ── Responsive adjustments ──────────────────────────────── */
@media (max-width: 768px) {
  .vet-evolution-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .vet-lightbox-prev { left: 10px; }
  .vet-lightbox-next { right: 10px; }
  .vet-lightbox-close { top: 10px; right: 10px; }
  .vet-lightbox-nav { width: 36px; height: 36px; font-size: 16px; }
}

@media (max-width: 480px) {
  .vet-evolution-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .vet-photo-dropzone {
    padding: 1rem;
    min-height: 100px;
  }
}

/* ============================================================
   MODERN FORM CONTROLS (Overriding defaults for better aesthetics)
   ============================================================ */
.standard-form .form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--gray-800, #1e293b);
  background-color: var(--gray-50, #f8fafc);
  background-clip: padding-box;
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: var(--radius-md, 8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.standard-form .form-control:focus {
  color: var(--gray-900, #0f172a);
  background-color: #fff;
  border-color: var(--primary-400, #38bdf8);
  outline: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02), 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.standard-form .form-control::placeholder {
  color: var(--gray-400, #94a3b8);
  opacity: 1;
}

.standard-form .form-group {
  margin-bottom: 1.5rem;
}

.standard-form label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--gray-700, #334155);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}
