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

:root {
  --teal:       #2A9D8F;
  --teal-light: #A8DADC;
  --teal-pale:  #E8F6F5;
  --coral:      #E76F51;
  --gold:       #E9C46A;
  --navy:       #264653;
  --cream:      #FAF8F4;
  --light-gray: #F0EDE8;
  --border:     #E2DDD8;
  --text:       #2D2D2D;
  --text-mid:   #666;
  --text-light: #999;
  --white:      #FFFFFF;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --radius:     10px;
  --radius-sm:  6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.nav-brand {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.nav-brand:hover { text-decoration: none; opacity: .88; }
.navbar-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s;
  text-decoration: none;
}
.nav-links a:hover { background: rgba(255,255,255,.1); color: white; text-decoration: none; }
.btn-nav {
  background: var(--teal) !important;
  color: white !important;
  font-weight: 600;
}
.btn-nav:hover { background: #23877A !important; }
.btn-nav-logout {
  color: rgba(255,255,255,.5) !important;
  font-size: .82rem !important;
  padding: 6px 10px !important;
}
.btn-nav-logout:hover { color: white !important; background: rgba(255,255,255,.1) !important; }

/* ── Container ────────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  flex: 1;
}

/* ── Dashboard Hero ───────────────────────────────────────────── */
.dashboard-hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
  margin-bottom: 1.75rem;
}
.dashboard-hero-logo {
  height: 180px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto .75rem;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.10));
}
.dashboard-hero .page-subtitle {
  color: var(--text-mid);
  font-size: 1rem;
}

/* ── Page Header ──────────────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.8rem; color: var(--navy); margin-top: 6px; }
.page-subtitle { color: var(--text-mid); margin-top: 4px; }
.back-link {
  color: var(--teal);
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .95rem;
}
.alert-success { background: #E8F8F0; color: #1A6B3C; border-left: 4px solid #2DC653; }
.alert-error   { background: #FEE8E8; color: #8B1C1C; border-left: 4px solid #F44336; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary  { background: var(--teal); color: white; }
.btn-primary:hover { background: #23877A; color: white; }
.btn-outline  { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-pdf      { background: var(--coral); color: white; }
.btn-pdf:hover { background: #D05A3E; color: white; }
.btn-danger   { background: transparent; color: #D32F2F; border: 1.5px solid #FFCDD2; }
.btn-danger:hover { background: #FFEBEE; }
.btn-teal     { background: var(--teal); color: white; border: none; }
.btn-teal:hover { background: #23877A; color: white; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }

/* ── Quick Actions ────────────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}
.action-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.action-primary { background: var(--teal); color: white; }
.action-secondary { background: var(--white); color: var(--navy); border: 1.5px solid var(--border); }
.action-icon { font-size: 1.5rem; }

/* ── Section ──────────────────────────────────────────────────── */
.section { margin-bottom: 2.5rem; }
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title-row h2 { font-size: 1.2rem; color: var(--navy); }

/* ── Pet Grid ─────────────────────────────────────────────────── */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.pet-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  transition: box-shadow .15s, transform .15s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.pet-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.pet-card-avatar {
  height: 130px;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pet-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-placeholder { font-size: 3rem; }
.pet-card-info { padding: 12px; }
.pet-card-info h3 { font-size: 1rem; color: var(--navy); margin-bottom: 2px; }
.pet-card-info p { font-size: .82rem; color: var(--text-mid); }
.pet-card-info .owner { color: var(--text-light); font-size: .78rem; margin-top: 2px; }

/* ── Entry List ───────────────────────────────────────────────── */
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry-row {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.entry-pet { display: flex; align-items: center; gap: 10px; flex: 1; }
.entry-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.entry-avatar-placeholder { font-size: 1.5rem; }
.entry-date { font-size: .82rem; color: var(--text-light); display: block; }
.entry-grades { display: flex; gap: 6px; }
.entry-actions { display: flex; gap: 6px; }

/* ── Grade Badges ─────────────────────────────────────────────── */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
}
.grade-A  { background: #4CAF50; }
.grade-B  { background: #8BC34A; }
.grade-C  { background: #FFC107; color: #333; }
.grade-D  { background: #FF9800; }
.grade-F  { background: #F44336; }

/* ── Pet Profile Card ─────────────────────────────────────────── */
.pet-profile-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.pet-profile-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--light-gray);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 3px solid var(--teal-light);
}
.pet-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-placeholder-lg { font-size: 2.5rem; }
.pet-profile-info { flex: 1; }
.pet-profile-info h1 { font-size: 1.6rem; color: var(--navy); }
.pet-meta { color: var(--text-mid); font-size: .95rem; margin-top: 2px; }
.owner-info { font-size: .88rem; color: var(--text-light); margin-top: 6px; }
.pet-profile-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Timeline ─────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 1rem; }
.timeline-card {
  display: flex;
  gap: 1rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.timeline-date {
  background: var(--navy);
  color: white;
  min-width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem .5rem;
  flex-shrink: 0;
}
.date-month { font-size: .75rem; text-transform: uppercase; opacity: .7; letter-spacing: 1px; }
.date-day   { font-size: 2rem; font-weight: 800; line-height: 1; }
.date-year  { font-size: .72rem; opacity: .6; }
.timeline-content { flex: 1; padding: 1rem 1.25rem; }
.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .75rem;
  gap: 1rem;
}
.timeline-actions { display: flex; gap: 6px; flex-shrink: 0; }
.sitter-tag {
  font-size: .82rem;
  color: var(--text-light);
  margin-left: 8px;
}
.grade-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: .75rem; }
.grade-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--light-gray);
  padding: 3px 10px 3px 8px;
  border-radius: 20px;
}
.grade-pill-label { font-size: .78rem; color: var(--text-mid); }
.quick-list {
  font-size: .88rem;
  color: var(--text-mid);
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.quick-list-icon.star  { color: var(--gold); font-size: 1rem; }
.quick-list-icon.arrow { color: var(--coral); }
.entry-count { font-size: .85rem; color: var(--text-light); }

/* ── Photo Thumbs ─────────────────────────────────────────────── */
.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.thumb {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}
.more-photos {
  width: 64px; height: 64px;
  background: var(--light-gray);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; color: var(--text-mid);
}
.thumb-label { position: relative; cursor: pointer; }
.thumb-label input[type=checkbox] { position: absolute; top: 4px; left: 4px; }
.thumb-label .remove-x {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,.5); color: white;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: .65rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.thumb-label:hover .remove-x { opacity: 1; }

/* ── Form Cards ───────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.form-section { margin-bottom: 1.5rem; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--teal-pale);
}
.form-hint { font-size: .85rem; color: var(--text-light); margin-bottom: .75rem; margin-top: -.25rem; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.full-width { grid-column: 1 / -1; }
.two-col-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

label { font-size: .88rem; font-weight: 600; color: var(--text-mid); }
.required { color: var(--coral); }
input[type=text], input[type=email], input[type=date], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .93rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s;
  appearance: auto;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, .12);
}
textarea { resize: vertical; line-height: 1.55; }
.readonly-field {
  padding: 9px 12px;
  background: var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: .93rem;
  color: var(--text);
  border: 1.5px solid var(--border);
}

/* ── Grade Selector ───────────────────────────────────────────── */
.grades-grid { display: flex; flex-direction: column; gap: 1rem; }
.grade-selector {}
.grade-label-text { font-size: .92rem; font-weight: 600; color: var(--text-mid); display: block; margin-bottom: 6px; }
.grade-options { display: flex; gap: 6px; flex-wrap: wrap; }
.grade-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-mid);
  transition: all .15s;
  background: var(--white);
}
.grade-option input[type=radio] { display: none; }
.grade-option:hover { border-color: var(--teal); color: var(--teal); }
.grade-option.selected { color: white; border-color: transparent; }
.grade-opt-A.selected { background: #4CAF50; }
.grade-opt-B.selected { background: #8BC34A; }
.grade-opt-C.selected { background: #FFC107; color: #333; }
.grade-opt-D.selected { background: #FF9800; }
.grade-opt-F.selected { background: #F44336; }

/* ── Activity Checkboxes ──────────────────────────────────────── */
.activity-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.activity-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--light-gray);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .88rem;
  color: var(--text);
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: all .15s;
}
.activity-check:hover { background: var(--teal-pale); border-color: var(--teal-light); }
.activity-check input { accent-color: var(--teal); width: 15px; height: 15px; }
.activity-check:has(input:checked) {
  background: var(--teal-pale);
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 600;
}

/* ── File Upload ──────────────────────────────────────────────── */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  padding: 2rem;
  background: var(--cream);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.file-upload-area:hover { border-color: var(--teal); background: var(--teal-pale); }
.file-input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-label {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; font-size: .9rem; color: var(--text-mid);
}
.upload-icon { font-size: 2rem; }
.file-hint { font-size: .78rem; color: var(--text-light); }
.photo-preview {
  display: block; max-width: 120px; max-height: 120px;
  border-radius: var(--radius-sm); margin: 12px auto 0;
  object-fit: cover; border: 1.5px solid var(--border);
}
.photo-preview.hidden { display: none; }
.current-photo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 1rem;
}
.current-photo img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
}
.current-photo p { font-size: .85rem; color: var(--text-light); }

/* ── Form Actions ─────────────────────────────────────────────── */
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 1.25rem 0 .5rem;
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-mid);
}
.empty-icon { font-size: 3rem; display: block; margin-bottom: .75rem; opacity: .5; }
.empty-state p { font-size: 1rem; }

/* ── Site Footer ──────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.25rem;
  font-size: .82rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* ── Hamburger Button (hidden on desktop) ─────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: transform .22s ease, opacity .22s ease;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Admin navbar — smaller on mobile, hamburger replaces links */
  .navbar { padding: 0 1rem; height: 72px; }
  .navbar-logo { height: 58px; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: .5rem .75rem 1rem;
    gap: 4px;
    z-index: 200;
    box-shadow: 0 6px 20px rgba(0,0,0,.4);
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 14px; border-radius: var(--radius-sm); font-size: .97rem; }

  /* Impersonation banner — adjust for admin navbar height change */
  .impersonation-banner { top: 72px; }

  /* Client navbar — even shorter since logo is only 40px, no hamburger needed (only 2 items) */
  .client-navbar { height: 60px !important; padding: 0 1rem; }
  .client-navbar .nav-links {
    display: flex !important;
    position: static;
    flex-direction: row;
    background: none;
    box-shadow: none;
    border: none;
    padding: 0;
    gap: 8px;
  }
  .client-navbar ~ .impersonation-banner { top: 60px; }
  .nav-greeting { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }

  /* Forms */
  .form-grid, .two-col-form { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* Pet profile */
  .pet-profile-card { flex-direction: column; text-align: center; }
  .pet-profile-actions { justify-content: center; flex-wrap: wrap; }

  /* Timeline */
  .timeline-card { flex-direction: column; }
  .timeline-date { flex-direction: row; min-width: unset; padding: .75rem 1rem; gap: 8px; justify-content: center; }
  .timeline-header { flex-direction: column; gap: .5rem; }
  .timeline-actions { flex-wrap: wrap; }

  /* Entry rows (dashboard recent entries) */
  .entry-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .entry-pet { width: 100%; }
  .entry-actions { align-self: flex-start; }

  /* Activities */
  .activity-checkboxes { grid-template-columns: 1fr 1fr; }
  .grade-options { gap: 4px; }

  /* Quick action cards */
  .quick-actions { flex-direction: column; }

  /* Client dashboard stats */
  .client-stat { padding: .85rem .5rem; }
  .client-stat-num { font-size: 1.6rem; }

  /* Feeding schedule form */
  .feed-schedule-grid { grid-template-columns: 1fr; }

  /* Dashboard hero logo — smaller on mobile */
  .dashboard-hero-logo { height: 130px; }

  /* Container — less horizontal padding on mobile */
  .container { padding: 1.25rem .875rem; }

  /* Tap targets — Apple HIG recommends 44px min */
  .btn, .action-card, .pet-card, .activity-check { min-height: 44px; }
  .btn-sm { min-height: 36px; }

  /* Page header */
  .page-header h1 { font-size: 1.45rem; }
}

/* ── Grade Tooltip ────────────────────────────────────────────── */
.grade-tooltip-wrap {
  position: relative;
  display: inline-block;
  cursor: default;
}
.grade-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  min-width: 190px;
  pointer-events: none;
}
.grade-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}
/* Hover only on real pointer devices — touch devices use JS .active class only */
@media (hover: hover) and (pointer: fine) {
  .grade-tooltip-wrap:hover .grade-tooltip { display: block; }
}
.grade-tooltip-wrap.active .grade-tooltip { display: block; }

/* Left-panel tooltips open to the right so they don't clip */
.grade-tooltip-left {
  left: 0;
  transform: none;
}
.grade-tooltip-left::after {
  left: 18px;
  transform: none;
}
.tooltip-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}
.tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}
.tooltip-label { font-size: .82rem; color: var(--text-mid); }
.grade-badge-sm { width: 26px; height: 26px; font-size: .72rem; }

/* ── Custom Activity Tag ──────────────────────────────────────── */
.activity-check-custom { border-style: dashed; border-color: var(--teal-light); }
.custom-tag {
  font-size: .65rem;
  background: var(--teal-pale);
  color: var(--teal);
  border: 1px solid var(--teal-light);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: auto;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ── Client Auth Pages ────────────────────────────────────────── */
.client-body { background: var(--cream); }
.client-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.client-auth-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  border: 1.5px solid var(--border);
}
.client-auth-logo { text-align: center; margin-bottom: 1rem; }
.auth-logo-img { height: 160px; width: auto; object-fit: contain; }
.client-auth-title { font-size: 1.5rem; color: var(--navy); text-align: center; margin-bottom: 4px; }
.client-auth-sub { font-size: .88rem; color: var(--text-light); text-align: center; margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: 1rem; }
.auth-switch { text-align: center; font-size: .85rem; color: var(--text-mid); margin-top: 1.25rem; }

/* ── Client Navbar ────────────────────────────────────────────── */
.client-navbar { background: var(--navy); }
.nav-logo-img { height: 40px; width: auto; object-fit: contain; }
.btn-nav-client {
  background: rgba(255,255,255,.15) !important;
  color: rgba(255,255,255,.9) !important;
  border: 1px solid rgba(255,255,255,.25) !important;
  font-weight: 500;
}
.btn-nav-client:hover { background: rgba(255,255,255,.25) !important; }
.nav-greeting { color: rgba(255,255,255,.75); font-size: .88rem; padding: 6px 8px; }
.nav-back-link { color: rgba(255,255,255,.8) !important; font-size: .88rem; }

/* ── Client Dashboard ─────────────────────────────────────────── */
.client-stats-bar {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}
.client-stat {
  flex: 1;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
}
.client-stat-num { font-size: 2rem; font-weight: 800; color: var(--teal); line-height: 1; }
.client-stat-label { font-size: .8rem; color: var(--text-light); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.section-h2 { font-size: 1.2rem; color: var(--navy); margin-bottom: 1rem; }
.client-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 2rem; }
.client-panel {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.client-panel-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 1rem; }
.client-grade-list { display: flex; flex-direction: column; gap: 10px; }
.client-grade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--light-gray);
}
.client-grade-row:last-child { border-bottom: none; }
.client-grade-label { font-size: .9rem; color: var(--text-mid); }
.activity-bar-list { display: flex; flex-direction: column; gap: 8px; }
.activity-bar-row { display: flex; align-items: center; gap: 8px; }
.activity-bar-label { font-size: .82rem; color: var(--text-mid); width: 130px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-bar-track { flex: 1; height: 8px; background: var(--light-gray); border-radius: 4px; overflow: hidden; }
.activity-bar-fill { height: 100%; background: var(--teal); border-radius: 4px; transition: width .3s; }
.activity-bar-count { font-size: .78rem; color: var(--text-light); width: 24px; text-align: right; }
.empty-text { font-size: .88rem; color: var(--text-light); font-style: italic; }

/* ── Client Photo Gallery ─────────────────────────────────────── */
.client-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.gallery-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; }
.gallery-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.gallery-item:hover .gallery-img { transform: scale(1.04); }
.gallery-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: white;
  font-size: .72rem;
  padding: 16px 8px 6px;
  opacity: 0;
  transition: opacity .2s;
}
.gallery-item:hover .gallery-caption { opacity: 1; }
.entry-notes { font-size: .85rem; color: var(--text-mid); font-style: italic; margin-top: 6px; }

/* ── Impersonation Banner ─────────────────────────────────────── */
.impersonation-banner {
  background: #F59E0B;
  color: white;
  padding: 10px 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .9rem;
  font-weight: 500;
  position: sticky;
  top: 96px;
  z-index: 90;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.impersonate-exit-btn {
  background: rgba(0,0,0,.2);
  color: white;
  padding: 5px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.impersonate-exit-btn:hover { background: rgba(0,0,0,.35); color: white; text-decoration: none; }

/* ── View as Client Button ────────────────────────────────────── */
.btn-impersonate {
  background: #F59E0B;
  color: white;
  border: none;
}
.btn-impersonate:hover { background: #D97706; color: white; text-decoration: none; }
.btn-impersonate-preview {
  background: transparent;
  color: #F59E0B;
  border: 1.5px dashed #F59E0B;
}
.btn-impersonate-preview:hover { background: #FEF3C7; color: #D97706; }

/* ── Feeding Schedule Form ────────────────────────────────────── */
.form-section-hint {
  font-size: .83rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  margin-top: -.25rem;
}
.feed-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.feed-slot {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feed-slot-snack { opacity: .9; }
.feed-slot-header {
  background: var(--navy);
  color: white;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
}
.feed-icon { font-size: 1rem; }
.feed-slot-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.feed-time-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: white;
}
.feed-notes-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  background: white;
  color: var(--text);
}

/* ── Feeding Schedule Display ─────────────────────────────────── */
.feed-display-list { display: flex; flex-direction: column; gap: 10px; }
.feed-display-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.feed-display-icon { font-size: 1.1rem; flex-shrink: 0; }
.feed-display-label { font-weight: 600; font-size: .88rem; min-width: 72px; color: var(--navy); }
.feed-display-time { font-size: .88rem; color: var(--teal); font-weight: 600; min-width: 60px; }
.feed-display-notes { font-size: .83rem; color: var(--text-mid); }

/* ── Pet Detail Two-panel layout ──────────────────────────────── */
.pet-detail-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .pet-detail-panels { grid-template-columns: 1fr; } }

/* ── Requests Panel ───────────────────────────────────────────── */
.requests-panel { border-left: 3px solid var(--coral); }
.requests-badge {
  background: var(--coral);
  color: white;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: .78rem;
  font-weight: 700;
  margin-left: 6px;
}
.request-list { display: flex; flex-direction: column; gap: 10px; }
.request-list-sm { margin-top: 12px; }
.request-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: white;
}
.request-pending { border-left: 3px solid var(--coral); }
.request-delivered { border-left: 3px solid var(--teal); opacity: .8; }
.request-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.request-type-badge {
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.request-type-treat  { background: #FEF3C7; color: #92400E; }
.request-type-message { background: #EDE9FE; color: #4C1D95; }
.request-meta { font-size: .78rem; color: var(--text-light); }
.delivered-tag { font-size: .75rem; color: var(--teal); font-weight: 600; margin-left: auto; }
.pending-tag   { font-size: .75rem; color: var(--coral); font-weight: 600; margin-left: auto; }
.request-message { font-size: .88rem; color: var(--text); margin: 4px 0 8px; }
.section-compact { margin-top: 0; }

/* Delivered requests collapsible */
.delivered-requests-details summary { cursor: pointer; }
.delivered-requests-summary {
  font-size: .88rem;
  color: var(--text-mid);
  font-weight: 600;
  padding: 8px 0;
  list-style: none;
}
.delivered-requests-summary::-webkit-details-marker { display: none; }
.delivered-requests-summary::before { content: '▶ '; font-size: .7rem; }
details[open] .delivered-requests-summary::before { content: '▼ '; }

/* ── Client Request Form ──────────────────────────────────────── */
.client-panel-sub { font-size: .83rem; color: var(--text-light); margin-bottom: 12px; }
.request-form { display: flex; flex-direction: column; gap: 12px; }
.request-type-toggle { display: flex; gap: 8px; }
.request-type-opt input[type="radio"] { display: none; }
.request-type-pill {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  font-size: .88rem;
  cursor: pointer;
  transition: all .15s;
  background: white;
}
.request-type-opt input[type="radio"]:checked + .request-type-pill {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}
.request-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  resize: vertical;
  font-family: inherit;
}
.request-textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-pale); }

/* ── Client Stats: Pending requests ──────────────────────────── */
.client-stat-requests .client-stat-num { color: var(--coral); }
.requests-reminder {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .88rem;
  color: #92400E;
  margin-bottom: 16px;
}

/* ── Touch-device: gallery captions always visible ────────────── */
@media (hover: none) {
  .gallery-caption { opacity: 1; }
}

/* ── Outlook Status Bar ───────────────────────────────────────── */
.outlook-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .88rem;
  flex-wrap: wrap;
}
.outlook-connected {
  background: #E8F8F0;
  border: 1px solid #A7F3D0;
  color: #065F46;
}
.outlook-disconnected {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  color: #92400E;
}
.outlook-status-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.outlook-status-icon { font-size: 1.1rem; flex-shrink: 0; }
.btn-outlook-connect {
  background: #0078D4;
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn-outlook-connect:hover { background: #006CBF; color: white; text-decoration: none; }
.btn-outlook-disconnect {
  background: transparent;
  border: 1px solid #065F46;
  color: #065F46;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-outlook-disconnect:hover { background: #D1FAE5; }

.outlook-test-input {
  border: 1px solid #BBD6CA;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: .82rem;
  width: 200px;
  outline: none;
  background: #fff;
  color: #1a1a1a;
}
.outlook-test-input:focus { border-color: #0078D4; }
.btn-outlook-test {
  background: #0078D4;
  border: none;
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-outlook-test:hover { background: #005FA3; }

/* ── Tooltip viewport clamping ────────────────────────────────── */
.grade-tooltip {
  max-width: min(220px, calc(100vw - 2rem));
}

/* ── Responsive client ────────────────────────────────────────── */
@media (max-width: 640px) {
  .client-two-col { grid-template-columns: 1fr; }
  .client-photo-gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  /* Tooltip clamping is handled by JavaScript — no CSS override needed here */
}

.action-requests {
  background: #FFF7ED;
  border: 2px solid #F97316;
  cursor: default;
}
.action-requests .action-icon { font-size: 1.6rem; }
.action-sub {
  font-size: .72rem;
  color: #92400E;
  margin-top: 2px;
}

.impersonate-note {
  background: #FFF7ED;
  border: 1px solid #FDE8C8;
  border-radius: 8px;
  padding: 10px 14px;
  color: #92400E;
  font-size: .85rem;
}

/* ── Client pet card CTA ─────────────────────────────────────── */
.pet-card-cta {
  font-size: .75rem;
  color: #2A9D8F;
  font-weight: 600;
  margin: 5px 0 0;
  letter-spacing: .01em;
}
.section-sub {
  font-size: .88rem;
  color: #888;
  margin: -8px 0 14px;
}

/* ── Activity tracking: read badges ──────────────────────────── */
.read-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: .02em;
}
.read-badge-seen {
  background: #E8F8F0;
  color: #1A7A4A;
}
.read-badge-new {
  background: #EEF4FF;
  color: #3B5BDB;
}

/* Owner last-seen label on pet detail page */
.owner-last-seen {
  font-size: .82rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.owner-seen  { background: #E8F8F0; color: #1A7A4A; }
.owner-never { background: #FFF4E5; color: #B45309; }

/* Owner last-seen on pet cards */
.owner-last-seen-card {
  font-size: .75rem;
  font-weight: 600;
  margin: 3px 0 0;
  padding: 2px 7px;
  border-radius: 20px;
  display: inline-block;
}

/* ── Activity feed ────────────────────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid #EDE9E3;
  border-radius: 10px;
  overflow: hidden;
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: #fff;
  border-bottom: 1px solid #F5F2EE;
  font-size: .86rem;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:nth-child(even) { background: #FAFAF8; }
.activity-icon { font-size: 1rem; flex-shrink: 0; }
.activity-detail { flex: 1; min-width: 0; }
.activity-email {
  font-weight: 600;
  color: #264653;
  margin-right: 5px;
}
.activity-desc { color: #666; }
.activity-time {
  font-size: .78rem;
  color: #AAA;
  white-space: nowrap;
  flex-shrink: 0;
}
