/* =======================================================
   PATIO 2 • MONITOR DE COMIDA DE PERROS
   MODERN MOBILE-FIRST DESIGN SYSTEM (iOS / Linear inspired)
   ======================================================= */

/* --- 1. DESIGN TOKENS & SYSTEM VARIABLES --- */
:root {
  /* Surface colors */
  --bg-main: #0a0e17;
  --bg-surface: #0f172a;
  --bg-card: #131d31;
  --bg-card-hover: #1a2742;
  --bg-card-glass: rgba(19, 29, 49, 0.82);
  --bg-glass-dock: rgba(10, 14, 23, 0.92);
  --bg-input: #0b1120;
  --bg-pill: rgba(255, 255, 255, 0.06);

  /* Borders & Dividers */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-active: rgba(59, 130, 246, 0.4);
  --border-glow: rgba(59, 130, 246, 0.2);

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Accent & Status Colors */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.35);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --success-light: #34d399;

  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.35);

  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.35);

  --purple: #a855f7;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 30px -4px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

  /* Safe Area Variables */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* --- 2. RESET & MOBILE ESSENTIALS --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Touch targets and physical press tactility */
button, .btn, .nav-tab, select, input, .timeline-thumb, .animal-chip {
  touch-action: manipulation;
}

button:not(:disabled):active,
.btn:not(:disabled):active,
.btn-mode-toggle:active {
  transform: scale(0.96);
  transition: transform 0.08s ease-out;
}

/* Universal utilities */
.hidden {
  display: none !important;
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- 3. APP CONTAINER --- */
.app-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 12px calc(80px + var(--sab)) 12px;
}

@media (min-width: 769px) {
  .app-container {
    padding: 16px 24px 60px 24px;
  }
}

/* --- 4. TOP APP HEADER --- */
.top-header {
  background: var(--bg-card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 768px) {
  .top-header {
    position: sticky;
    top: 0;
    z-index: 950;
    margin-left: -12px;
    margin-right: -12px;
    padding: calc(8px + var(--sat)) 14px 10px 14px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: none;
    border-left: none;
    border-right: none;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }
}

@media (min-width: 769px) {
  .top-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin-bottom: 18px;
  }
}

/* Header left: logo & title */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  font-size: 26px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* Header center: state badge */
.header-center {
  display: flex;
  align-items: center;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.01em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
  flex-shrink: 0;
}

.state-idle {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.state-mode1 {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.state-mode1 .status-dot {
  animation: pulse-amber 1.8s infinite;
}

.state-mode2 {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.state-mode2 .status-dot {
  animation: pulse-green 1.2s infinite;
}

.state-completed {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
}

.state-stopped {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

@keyframes pulse-amber {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

@keyframes pulse-green {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Header right: model selector, clock & actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.model-selector-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.quick-model-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
  max-width: 220px;
}

.quick-model-select:focus {
  border-color: var(--primary);
}

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

.live-clock {
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2e8f0;
}

.clock-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mobile responsive layout for header contents */
@media (max-width: 768px) {
  .header-left {
    justify-content: space-between;
    width: 100%;
  }

  .header-center {
    display: none; /* Handled smoothly */
  }

  .clock-box {
    display: none; /* Phone already shows status bar time */
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .model-selector-box {
    flex: 1;
    min-width: 0;
  }

  .model-label {
    display: none;
  }

  .quick-model-select {
    width: 100%;
    max-width: none;
    font-size: 0.78rem;
    padding: 7px 8px;
  }

  .header-buttons {
    flex-shrink: 0;
    gap: 6px;
  }

  .header-buttons .btn {
    padding: 7px 12px;
    font-size: 0.78rem;
    min-height: 38px;
  }
}

/* --- 5. NAVIGATION TABS (DESKTOP TOP BAR & MOBILE BOTTOM DOCK) --- */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 5px;
  width: fit-content;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  white-space: nowrap;
}

.nav-tab-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.nav-tab-label {
  line-height: 1;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.tab-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* MOBILE FIXED BOTTOM APP DOCK */
@media (max-width: 768px) {
  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(62px + var(--sab));
    padding: 6px 8px calc(6px + var(--sab)) 8px;
    margin: 0;
    background: var(--bg-glass-dock);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-left: none;
    border-right: none;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    z-index: 1000;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
  }

  .nav-tab {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4px 2px;
    font-size: 0.68rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    min-height: 48px;
    gap: 2px;
    color: var(--text-muted);
  }

  .nav-tab-icon {
    font-size: 1.25rem;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-tab.active {
    background: rgba(59, 130, 246, 0.14);
    color: var(--primary-light);
    box-shadow: none;
  }

  .nav-tab.active .nav-tab-icon {
    transform: scale(1.12);
  }

  .nav-tab:active {
    transform: scale(0.90);
  }

  .tab-badge {
    position: absolute;
    top: 3px;
    right: calc(50% - 18px);
    padding: 1px 5px;
    min-width: 16px;
    height: 16px;
    font-size: 0.6rem;
  }
}

/* --- 6. BUTTONS & CONTROLS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
}

.btn-secondary:hover, .btn-secondary.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 0.76rem;
  border-radius: var(--radius-xs);
}

.btn-icon {
  font-size: 1rem;
  line-height: 1;
}

/* --- 7. TAB CONTENT SHELL --- */
.tab-content {
  display: none;
  animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
  display: block;
}

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

/* --- 8. QUICK STATS KPI BAR --- */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .quick-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.stat-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- 9. LIVE LAYOUT & HERO CAMERA CARD --- */
.live-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1024px) {
  .live-layout {
    grid-template-columns: 1.35fr 1fr;
    gap: 20px;
  }
}

.hero-card, .timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 8px;
}

.card-header h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
}

/* iOS-style Segmented Control Mode Switcher */
.header-mode-switch {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-mode-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-mode-toggle.active {
  background: var(--bg-card-hover);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Camera Snapshot Viewport */
.hero-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.hero-time-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.74rem;
  font-family: monospace;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.scanning-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Video / Timelapse Player Controls */
.player-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 75%, transparent 100%);
  padding: 12px 14px 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

.btn-player-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.scrubber-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}

.scrubber-wrapper input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  accent-color: var(--primary);
}

.player-time-tag {
  font-family: monospace;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
}

.speed-buttons {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px;
  border-radius: var(--radius-pill);
  gap: 2px;
}

.btn-speed {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.btn-speed.active {
  background: var(--primary);
  color: #fff;
}

/* --- 10. AI VERDICT BOX & FOOD SUPERVISION --- */
.ai-verdict-box {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.verdict-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-model-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* High-impact Food Presence Verdict Pills */
.verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pill-food-yes {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.pill-food-no {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.hero-summary-text {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.45;
}

/* Animal Chips Container & Classes */
.animals-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.animal-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.1s ease;
}

.chip-dog {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.chip-dog-unknown {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.chip-chicken {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.chip-bird {
  background: rgba(139, 92, 246, 0.16);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.chip-duck {
  background: rgba(20, 184, 166, 0.16);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.4);
}

.chip-lizard {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.chip-rodent {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.chip-cat {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.chip-wild {
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.chip-none {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Manual Food Supervision Bar */
.food-supervision-bar {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 600px) {
  .food-supervision-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.supervision-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.supervision-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-food-yes {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  min-height: 44px;
}

.btn-food-yes:hover {
  background: rgba(16, 185, 129, 0.28);
}

.btn-food-no {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  min-height: 44px;
}

.btn-food-no:hover {
  background: rgba(239, 68, 68, 0.24);
}

.verdict-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.bowls-desc-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

/* --- 11. TIMELINE FEED (TODAY'S LIST) --- */
.timeline-list {
  max-height: 540px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.timeline-item {
  display: flex;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  align-items: center;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.timeline-item:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.timeline-thumb {
  width: 74px;
  height: 50px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.timeline-thumb:hover {
  transform: scale(1.04);
}

.timeline-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.timeline-time {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.timeline-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.timeline-action-text {
  font-size: 0.74rem;
  color: #94a3b8;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.btn-tag-timeline {
  padding: 2px 7px;
  font-size: 0.72rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
}

.model-tag-badge {
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 4px;
}

/* --- 12. DOGS GALLERY & INBOX TAB --- */
.section-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-hero h2 {
  font-size: 1.22rem;
  font-weight: 700;
  color: #fff;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 680px;
  margin-top: 3px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 28px 0;
}

.dog-inbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.inbox-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.inbox-image-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

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

.inbox-time-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  font-family: monospace;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  color: #fff;
}

.inbox-status-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(245, 158, 11, 0.85);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  color: #000;
}

.inbox-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inbox-inputs-row select,
.inbox-inputs-row input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.inbox-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inbox-actions-row .btn {
  flex: 1 1 calc(50% - 6px);
  min-width: 100px;
}

.inbox-subpanel {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inbox-subpanel.hidden {
  display: none !important;
}

.inbox-subpanel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.multidog-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
}

.multidog-checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #e2e8f0;
}

/* Registered Dogs Grid */
.dogs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.dog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.dog-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
  cursor: pointer;
}

.dog-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.dog-photos-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px 0;
  -webkit-overflow-scrolling: touch;
}

.dog-thumb-mini {
  width: 58px;
  height: 42px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.dog-thumb-mini.active {
  border-color: var(--primary);
}

/* --- 13. ANALYTICS TAB (TIEMPOS & COMENSALES) --- */
.analytics-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-title-group h2 {
  font-size: 1.22rem;
  font-weight: 700;
  color: #fff;
}

.analytics-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

@media (min-width: 600px) {
  .analytics-controls {
    width: auto;
  }
}

.analytics-day-select {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
  }
}

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

.kpi-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-main-val {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
}

.kpi-badge.ongoing {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.kpi-badge.completed {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* Feeding Analytics Chart Card */
.chart-analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
}

.chart-controls-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ctrl-sublabel {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.chart-scale-selector, .chart-days-filter {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  background: transparent;
  color: var(--text-secondary);
}

.btn-xs:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.btn-xs.active {
  background: #3b82f6;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.chart-container-wrapper {
  padding: 12px 16px 8px;
  position: relative;
  height: 350px;
  width: 100%;
}

@media (max-width: 600px) {
  .chart-container-wrapper {
    height: 300px;
    padding: 8px 8px 4px;
  }
}

.chart-footer-hint {
  padding: 8px 18px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.chart-hint-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.chart-stat-chip strong {
  color: #fff;
}

/* Interactive Session Visual Bar */
.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend-eating { background: #10b981; }
.legend-waiting { background: #f59e0b; }
.legend-guest { background: #8b5cf6; }
.legend-empty { background: #334155; }

.timeline-bar-wrapper {
  padding: 14px 16px 12px 16px;
}

.session-visual-bar {
  display: flex;
  height: 38px;
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
  gap: 2px;
  border: 1px solid var(--border-color);
  padding: 2px;
}

.visual-bar-segment {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.visual-bar-segment:hover, .visual-bar-segment.active {
  transform: scaleY(1.15);
  z-index: 2;
  filter: brightness(1.25);
}

.visual-bar-segment.seg-eating { background: #10b981; }
.visual-bar-segment.seg-waiting { background: #f59e0b; }
.visual-bar-segment.seg-guest { background: #8b5cf6; }
.visual-bar-segment.seg-empty { background: #334155; }

.timeline-time-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.timeline-frame-preview {
  margin: 10px 14px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.preview-photo-wrap {
  width: 110px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xs);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}

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

.preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-time {
  font-family: monospace;
  font-weight: 700;
  color: #fff;
  font-size: 0.88rem;
}

.preview-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.analytics-split-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 769px) {
  .analytics-split-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.dogs-analytics-list, .guests-analytics-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guest-empty-state {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* History Comparison Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.analytics-table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.analytics-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.analytics-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* --- 14. HISTORY TAB --- */
.history-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.history-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  cursor: pointer;
}

.history-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* --- 15. SETTINGS FORM --- */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  max-width: 800px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

/* Important: 16px font-size prevents iOS auto-zoom */
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
}

.form-group small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* --- 16. MODALS & NATIVE BOTTOM SHEETS --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  z-index: 10;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-drag-handle {
  display: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* Native iOS Bottom Sheet style on mobile screens */
@media (max-width: 640px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding: 14px 18px calc(18px + var(--sab)) 18px;
    animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-drag-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 auto 12px auto;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-actions .btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* --- 17. LIGHTBOX ZOOM MODAL --- */
.modal.lightbox {
  padding: 0;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lightbox-wrapper {
  position: relative;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.lightbox-wrapper img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-caption {
  margin-top: 10px;
  color: #e2e8f0;
  font-size: 0.85rem;
  text-align: center;
  max-width: 700px;
  padding: 0 12px;
}

/* --- 18. FALLBACK BANNER & BADGES --- */
.fallback-alert-banner {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.08);
}

.fallback-alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fallback-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.fallback-text {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  color: #fde68a;
  line-height: 1.4;
}

.btn-close-alert {
  background: transparent;
  border: none;
  color: #fde68a;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
}

.badge-fallback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-fallback-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  margin-left: 4px;
}

/* --- 19. ANIMAL IDENTIFICATION CAROUSEL MODAL --- */
.carousel-modal {
  padding: 0;
  background: rgba(4, 7, 14, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-modal.hidden {
  display: none !important;
}

.carousel-container {
  position: relative;
  width: 96vw;
  max-width: 1060px;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  z-index: 10;
}

.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.carousel-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.carousel-badge-counter {
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.carousel-time-tag {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.carousel-model-tag {
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.carousel-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-keyhint {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.carousel-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.carousel-close-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  transform: scale(1.08);
}

.carousel-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 240px;
  flex: 1;
  overflow: hidden;
  user-select: none;
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.15s ease;
  backdrop-filter: blur(6px);
}

.carousel-nav-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn.prev {
  left: 14px;
}

.carousel-nav-btn.next {
  right: 14px;
}

.carousel-image-box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px;
}

.carousel-main-img {
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.carousel-ai-banner {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.78rem;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.carousel-controls-bar {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 44vh;
  overflow-y: auto;
}

.carousel-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.carousel-group-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.carousel-dog-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-dog-quick {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-dog-quick:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.btn-dog-suggested {
  background: rgba(16, 185, 129, 0.2);
  border: 2px solid #10b981;
  color: #a7f3d0;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-dog-suggested:hover {
  background: #10b981;
  color: #000;
  transform: translateY(-1px);
}

.suggested-star {
  color: #fbbf24;
  font-size: 0.95rem;
}

.carousel-animal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.carousel-btn-nodog {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-weight: 600;
}

.carousel-btn-nodog:hover {
  background: #ef4444;
  color: #fff;
}

.carousel-inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.carousel-input {
  flex: 1;
  min-width: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.carousel-multidog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.carousel-multidog-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.inbox-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.inbox-card:hover .inbox-zoom-hint {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

@media (max-width: 768px) {
  .carousel-container {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .carousel-main-img {
    max-height: 36vh;
  }
  .carousel-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
  .carousel-ai-banner {
    bottom: 8px;
    font-size: 0.7rem;
  }
  .carousel-controls-bar {
    padding: 10px;
    max-height: 48vh;
  }
  .btn-dog-quick, .btn-dog-suggested {
    font-size: 0.82rem;
    padding: 6px 12px;
  }
  .carousel-keyhint {
    display: none;
  }
}

