/* Four Legs Good - Staff PWA Styles */
/* Red Theme - Comprehensive Visual Polish */

:root {
  /* Test Activity Primary - Blue */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #3B82F6;
  
  /* Semantic Colors */
  --success: #4CAF50;
  --success-dark: #388E3C;
  --danger: #dc3545;
  --warning: #ffc107;
  
  /* Surfaces */
  --bg: #ECEFF1;
  --card-bg: #ffffff;
  --text: #263238;
  --text-light: #546E7A;
  --border: #CFD8DC;
  
  /* Shadows - matching caregiver */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.08);
  
  /* Behavior Button Colors */
  --behavior-green: #4CAF50;
  --behavior-red: #dc3545;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HEADER - Gradient style matching Caregiver
   ============================================ */
.header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

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

.header-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  padding: 3px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header h1 {
  font-size: 1.2rem;
  font-weight: 600;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.15);
  padding: 6px 10px;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
}

.status-dot.offline {
  background: var(--danger);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  padding: 20px;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ============================================
   HOME SCREEN - Welcome & Grid
   ============================================ */
.welcome-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.greeting {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.change-name-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
}

.change-name-btn:hover {
  text-decoration: underline;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.home-btn {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
  min-height: 120px;
}

.home-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.home-btn:active {
  transform: scale(0.98);
}

.btn-emoji {
  font-size: 2.5rem;
}

.btn-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  font-family: 'DM Sans', sans-serif;
}

/* ============================================
   WELCOME CARD (Name Entry)
   ============================================ */
.welcome-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.welcome-card h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.welcome-card p {
  color: var(--text-light);
  margin-bottom: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group input {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
  font-family: 'DM Sans', sans-serif;
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ============================================
   MODULE HEADER
   ============================================ */
.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.module-header h2 {
  color: var(--primary-dark);
  font-size: 1.2rem;
  font-weight: 600;
}

.back-btn, .refresh-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 16px;
  font-family: 'DM Sans', sans-serif;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.back-btn:hover, .refresh-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.back-btn:active, .refresh-btn:active {
  transform: scale(0.98);
}

/* ============================================
   BUTTONS - Gradient style
   ============================================ */
.btn {
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
  font-family: 'DM Sans', sans-serif;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
  background: #B0BEC5;
}

.btn-text {
  background: none;
  color: var(--primary);
  padding: 8px;
  box-shadow: none;
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
  font-family: 'DM Sans', sans-serif;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   ANIMAL CARDS - Caregiver style
   ============================================ */
.animal-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

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

.animal-card:active {
  transform: scale(0.98);
}

.animal-card img {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--border);
}

.animal-card .info {
  flex: 1;
}

.animal-card .info h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.animal-card .info p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.animal-card .has-notes {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 6px;
  background: rgba(76, 175, 80, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ============================================
   SELECTED ANIMAL PANEL - Labeled info boxes
   ============================================ */
.selected-animal {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.selected-animal-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.animal-photo {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--border);
}

.animal-info {
  flex: 1;
}

.animal-info h3 {
  font-size: 1.3rem;
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.animal-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.animal-detail-item {
  background: #F5F7F8;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.animal-detail-item .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  display: block;
  margin-bottom: 2px;
}

.animal-detail-item .value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.change-animal-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
  padding: 8px;
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  background: none;
  font-weight: 500;
}

.change-animal-btn:hover {
  text-decoration: underline;
}

/* ============================================
   QUESTIONS PANEL - Numbered circles
   ============================================ */
.questions-panel {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.questions-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--primary);
  font-weight: 600;
}

.intro-text {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 8px;
  line-height: 1.5;
}

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

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 8px;
}

.questions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.questions-list li {
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 10px 12px;
  background: #F5F7F8;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.q-num {
  display: inline-block;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 50%;
  margin-right: 8px;
}

/* ============================================
   RECORDER PANEL
   ============================================ */
.recorder-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

.recording-indicator {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--danger);
  font-weight: 500;
}

.recording-indicator.active {
  display: flex;
}

.pulse {
  width: 12px;
  height: 12px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.btn-record {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.btn-record:hover {
  transform: scale(1.05);
}

.btn-record:active {
  transform: scale(0.98);
}

.btn-record.recording {
  background: linear-gradient(135deg, var(--danger) 0%, #b02a37 100%);
  animation: recordPulse 2s infinite;
}

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 6px 25px rgba(220, 53, 69, 0.4); }
  50% { box-shadow: 0 6px 40px rgba(220, 53, 69, 0.6); }
}

.record-icon {
  font-size: 2.8rem;
}

.record-text {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ============================================
   REVIEW SECTION - Transcript & Notes
   ============================================ */
.transcript-box {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.transcript-box h4 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1rem;
}

.transcript-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-light);
  white-space: pre-wrap;
  max-height: 150px;
  overflow-y: auto;
}

.parsed-notes {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.parsed-notes h4 {
  color: var(--primary);
  margin-bottom: 14px;
  font-size: 1rem;
}

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.note-item {
  background: #F5F7F8;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

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

.note-item label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.note-item p {
  font-size: 0.9rem;
  line-height: 1.4;
}

.action-buttons, .review-action-buttons {
  display: flex;
  gap: 12px;
}

.action-buttons .btn, .review-action-buttons .btn {
  flex: 1;
}

/* ============================================
   ACTIVITY CARDS - Session cards
   ============================================ */
.activity-cards-container {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

.activity-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.card-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card-photo {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
  font-family: 'Fraunces', serif;
}

.card-id {
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.85rem;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
}

.card-timer {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

/* Card Action Buttons */
.card-actions-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.card-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  background: #F5F7F8;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.card-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: white;
}

.card-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.card-btn.has-content {
  border-color: var(--success);
  background: rgba(76, 175, 80, 0.1);
}

.card-btn-small {
  flex: 1;
  height: 40px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Behavior button colors */
.behavior-btn {
  font-weight: 700;
}

.behavior-btn.behavior-green {
  background: var(--behavior-green);
  color: white;
  border-color: var(--behavior-green);
}

.behavior-btn.behavior-red {
  background: var(--behavior-red);
  color: white;
  border-color: var(--behavior-red);
}

/* ============================================
   BATHROOM SECTION
   ============================================ */
.card-bathroom-section {
  background: #F5F7F8;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.bathroom-row {
  margin-bottom: 10px;
}

.bathroom-row:last-child {
  margin-bottom: 0;
}

.bathroom-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.radio-pills {
  display: flex;
  gap: 6px;
}

.radio-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
}

.radio-pill input[type="radio"],
.radio-pill input[type="checkbox"] {
  display: none;
}

.radio-pill.selected,
.radio-pill:has(input:checked) {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.defecate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* Placeholders (Staff only) */
.placeholders-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.placeholder-item {
  flex: 1;
}

/* End Session Button */
.btn-end-session {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-end-session:hover {
  box-shadow: var(--shadow-md);
}

.btn-end-session:active {
  transform: scale(0.98);
}

/* Add Button */
.add-btn-container {
  padding: 8px 0 16px;
  display: flex;
  gap: 12px;
}

.add-btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 1rem;
}

/* ============================================
   FEEDING MODULE - Compact Cards
   Target: 5 visible while scrolling
   ============================================ */
.feeding-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

.feeding-location-group {
  margin-bottom: 16px;
}

.feeding-location-header {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 8px;
  margin-bottom: 8px;
  font-family: 'Fraunces', serif;
}

.feeding-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border-radius: 10px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--border);
}

.feeding-card.ate-yes {
  border-left-color: var(--success);
}

.feeding-card.drank-yes {
  border-right: 4px solid #3B82F6;
}

.feeding-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feeding-checks {
  display: flex;
  gap: 8px;
}

.feeding-check {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.feeding-check.checked {
  background: #D1FAE5;
  border-color: var(--success);
  color: var(--success);
}

.feeding-check.drank.checked {
  background: #DBEAFE;
  border-color: #3B82F6;
  color: #3B82F6;
}

.feeding-check input[type="checkbox"] {
  display: none;
}

.feeding-time {
  font-size: 0.65rem;
  color: var(--text-light);
  display: block;
}

.feeding-actions {
  display: flex;
  gap: 6px;
}

.feeding-action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.feeding-action-btn:hover {
  border-color: var(--primary);
}

.feeding-action-btn.has-content {
  border-color: var(--success);
  background: #ECFDF5;
}

/* Feeding toggle buttons (used in JS-rendered cards) */
.feeding-attr-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.feeding-attr-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid var(--border);
  font-family: 'DM Sans', sans-serif;
}

.feeding-attr-btn.feeding-not-done {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: var(--danger);
}

.feeding-attr-btn.feeding-not-done:hover {
  background: #FECACA;
}

.feeding-attr-btn.feeding-done {
  background: #D1FAE5;
  color: #065F46;
  border-color: var(--success);
}

.feeding-attr-btn.feeding-done:hover {
  background: #A7F3D0;
}

@media (max-width: 360px) {
  .feeding-card {
    padding: 8px 10px;
  }
}

/* ============================================
   AVAILABLE ANIMALS LIST
   ============================================ */
.available-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.available-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.available-list-header {
  display: grid;
  grid-template-columns: 1fr 1fr 50px 60px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 8px 8px 0 0;
}

.available-list {
  background: var(--card-bg);
  border-radius: 0 0 8px 8px;
  max-height: 50vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.available-list .list-row {
  display: grid;
  grid-template-columns: 1fr 1fr 50px 60px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.available-list .list-row:hover {
  background: #F5F7F8;
}

.available-list .list-row:last-child {
  border-bottom: none;
}

.col-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.col-location {
  font-size: 0.85rem;
  color: var(--text-light);
}

.col-activities {
  text-align: center;
}

.col-last {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: right;
}

.col-last.active-status {
  color: var(--success);
  font-weight: 600;
}

.activity-badge {
  display: inline-block;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.activity-badge.badge-urgent {
  background: var(--danger);
  color: white;
}

.activity-badge.badge-ok {
  background: var(--warning);
  color: #333;
}

.activity-badge.badge-good {
  background: var(--success);
  color: white;
}

.loading-list,
.empty-list,
.error-list {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
}

.error-list {
  color: var(--danger);
}

/* ============================================
   SCANNER
   ============================================ */
.scanner-container {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.scanner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.scanner-placeholder p {
  font-size: 1rem;
  margin-top: 8px;
}

.scan-hint {
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ============================================
   PROFILE CAPTURE PANEL
   ============================================ */
.profile-capture-panel {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 16px;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
}

.profile-record-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.profile-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
}

.profile-photo-btn {
  aspect-ratio: 1;
  min-height: 70px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: #F5F7F8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  overflow: hidden;
  padding: 0;
  box-shadow: var(--shadow-sm);
}

.profile-photo-btn:hover {
  border-color: var(--primary);
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.profile-photo-btn:active {
  transform: scale(0.98);
}

.profile-photo-btn .photo-label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

.profile-photo-btn.has-photo {
  border-style: solid;
  border-color: var(--primary);
  border-width: 3px;
}

.profile-photo-btn .profile-photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 1.25rem;
}

.modal-animal-name {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-buttons .btn {
  flex: 1;
}

#recordingTime {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.transcript-preview {
  margin-top: 16px;
  padding: 12px;
  background: #F5F7F8;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-light);
  min-height: 40px;
  border: 1px solid var(--border);
}

/* Photo Modal */
.photo-preview-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  margin-bottom: 16px;
}

#photoPreview, #profilePhotoPreview, .captured-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   SUCCESS SECTION
   ============================================ */
.success-message, .success-card {
  text-align: center;
  padding: 40px 20px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--success);
  border-bottom: 4px solid var(--success);
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 20px;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.success-message h2, .success-card h2 {
  color: var(--success);
  margin-bottom: 12px;
}

.success-message p, .success-card p {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

#loadingText {
  color: var(--text-light);
  font-size: 1rem;
}

/* ============================================
   OFFLINE QUEUE
   ============================================ */
.offline-queue {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning);
  color: #333;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 500;
}

.offline-queue.visible {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ============================================
   QR READER OVERRIDES
   ============================================ */
#qrReader video, #endQrReader video,
[id$="QrReader"] video {
  border-radius: 12px;
}

#qrReader__dashboard_section,
#qrReader__dashboard_section_csr,
#qrReader__dashboard_section_swaplink,
#endQrReader__dashboard_section,
[id$="QrReader__dashboard_section"] {
  display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 400px) {
  .notes-grid {
    grid-template-columns: 1fr;
  }
  
  .animal-details-grid {
    grid-template-columns: 1fr;
  }
  
  .btn-record {
    width: 130px;
    height: 130px;
  }
  
  .record-icon {
    font-size: 2.2rem;
  }
  
  .header h1 {
    font-size: 1rem;
  }
  
  .home-btn {
    padding: 20px 12px;
    min-height: 100px;
  }
  
  .btn-emoji {
    font-size: 2rem;
  }
  
  .card-photo {
    width: 60px;
    height: 60px;
  }
}

.session-card-other {
  opacity: 0.7;
  border-color: #94A3B8 !important;
  background: #F8FAFC;
}

.session-card-other .caregiver-badge {
  color: #64748B;
  font-size: 0.85em;
  margin-top: 2px;
}


/* Behavior button colors */
.behavior-btn {
  font-weight: 700;
}

.behavior-btn.behavior-green {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.behavior-btn.behavior-red {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
}
