/* ===== Pet Rx Refill Coordinator ===== */
:root {
  --green-900: #0f3d28;
  --green-700: #1B7A4E;
  --green-600: #21915c;
  --green-100: #e6f7ee;
  --amber-500: #F59E0B;
  --amber-100: #fef3c7;
  --red-500: #dc2626;
  --red-100: #fee2e2;
  --gray-900: #1a1a2e;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-w: 960px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--gray-100);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green-700); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

.skip-link {
  position: absolute; top: -100%;
  background: var(--green-900); color: var(--white);
  padding: 8px 16px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 999;
}
.skip-link:focus { top: 0; left: 16px; }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; color: var(--green-900); }
.logo:hover, .logo:focus-visible { text-decoration: none; }
.logo-icon { flex-shrink: 0; }
.nav-links { list-style: none; display: flex; gap: 20px; }
.nav-links a { font-size: .9rem; color: var(--gray-700); padding: 4px 0; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--green-700); font-weight: 600; text-decoration: none; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  color: var(--white);
  padding: 64px 0 56px;
}
.hero h1 { font-size: 2rem; line-height: 1.25; margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; opacity: .9; max-width: 560px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: .9rem; font-weight: 600;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover, .btn:focus-visible { text-decoration: none; }
.btn-primary { background: var(--amber-500); color: var(--gray-900); border-color: var(--amber-500); }
.btn-primary:hover, .btn-primary:focus-visible { background: #d97706; border-color: #d97706; }
.btn-secondary { background: transparent; color: var(--white); border-color: rgba(255,255,255,.5); }
.btn-secondary:hover, .btn-secondary:focus-visible { border-color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-danger { background: var(--red-100); color: var(--red-500); border-color: var(--red-100); }
.btn-danger:hover { background: var(--red-500); color: var(--white); border-color: var(--red-500); }
.btn-outline { background: transparent; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--green-700); color: var(--green-700); }

/* Dashboard */
.dashboard { padding: 40px 0; }
.section-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; color: var(--green-900); }
.dash-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.dash-actions { display: flex; gap: 8px; }

/* Summary bar */
.summary-bar {
  display: flex; gap: 16px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.summary-item { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 100px; }
.summary-count { font-size: 1.5rem; font-weight: 800; color: var(--green-700); line-height: 1.2; }
.summary-alert .summary-count { color: var(--amber-500); }
.summary-label { font-size: .8rem; color: var(--gray-500); }

/* Pet list */
.pet-list { display: flex; flex-direction: column; gap: 20px; }

/* Pet card */
.pet-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pet-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.pet-card-header h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.pet-species-badge {
  font-size: .75rem; font-weight: 600;
  background: var(--green-100); color: var(--green-700);
  padding: 2px 10px; border-radius: 999px;
}
.pet-card-body { padding: 16px 20px; }

/* Medication table */
.med-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.med-table th { text-align: left; color: var(--gray-500); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--gray-300); }
.med-table td { padding: 8px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.med-table tr:last-child td { border-bottom: none; }
.med-name { font-weight: 600; }
.med-notes { color: var(--gray-500); font-style: italic; }
.status-badge {
  display: inline-block; font-size: .75rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}
.status-ok { background: var(--green-100); color: var(--green-700); }
.status-soon { background: var(--amber-100); color: #92400e; }
.status-overdue { background: var(--red-100); color: var(--red-500); }

/* Add medication form */
.add-med-form {
  margin-top: 12px;
  padding: 16px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  display: none;
}
.add-med-form.open { display: block; }
.add-med-form h4 { font-size: .95rem; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--gray-700); }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  font-family: var(--font); font-size: .85rem;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-900);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--green-700);
  outline-offset: 0;
  border-color: var(--green-700);
}
.form-actions { display: flex; gap: 8px; margin-top: 8px; }

/* Add pet form */
.pet-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 32px;
}
.pet-form h3 { font-size: 1.1rem; margin-bottom: 16px; }

/* Empty state */
.empty-state {
  text-align: center; padding: 48px 20px;
  display: none;
}
.empty-state.visible { display: block; }
.empty-state h3 { margin: 12px 0 8px; font-size: 1.1rem; }
.empty-state p { color: var(--gray-500); max-width: 360px; margin: 0 auto; }

/* Timeline */
.timeline-section { padding: 0 0 48px; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-empty { color: var(--gray-500); font-size: .9rem; text-align: center; padding: 24px; display: none; }
.timeline-empty.visible { display: block; }
.timeline-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-size: .85rem;
}
.timeline-date { font-weight: 700; min-width: 90px; }
.timeline-pet { font-weight: 600; color: var(--green-700); min-width: 80px; }
.timeline-med { flex: 1; }
.timeline-soon { border-left: 4px solid var(--amber-500); }
.timeline-overdue { border-left: 4px solid var(--red-500); }
.timeline-ok { border-left: 4px solid var(--green-700); }

/* Guide section */
.guide-section { padding: 48px 0; background: var(--white); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.guide-card {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 20px;
}
.guide-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-700); color: var(--white);
  font-weight: 700; font-size: .85rem;
  margin-bottom: 12px;
}
.guide-card h3 { font-size: .95rem; margin-bottom: 8px; }
.guide-card p { font-size: .85rem; color: var(--gray-700); }
.guide-tips { max-width: 720px; }
.guide-tips h3 { font-size: 1rem; margin: 24px 0 8px; color: var(--green-900); }
.guide-tips h3:first-child { margin-top: 0; }
.guide-tips ul { padding-left: 20px; margin-bottom: 8px; }
.guide-tips li { font-size: .9rem; color: var(--gray-700); margin-bottom: 4px; }
.guide-tips p { font-size: .9rem; color: var(--gray-700); margin-bottom: 8px; }

/* Page templates */
.page-hero { background: var(--green-900); color: var(--white); padding: 48px 0 40px; }
.page-hero h1 { font-size: 1.8rem; margin-bottom: 8px; }
.page-content { padding: 40px 0; }
.page-content p, .page-content li { font-size: .95rem; color: var(--gray-700); margin-bottom: 12px; line-height: 1.7; }
.page-content h2 { font-size: 1.2rem; margin: 24px 0 8px; color: var(--green-900); }
.page-content ul { padding-left: 20px; }

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--green-900);
  color: rgba(255,255,255,.7);
  padding: 32px 0;
  font-size: .8rem;
}
.footer-inner { display: flex; flex-direction: column; gap: 12px; }
.footer-links { list-style: none; display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.8); }
.footer-links a:hover { color: var(--white); }

/* Print */
@media print {
  .site-header, .site-footer, .hero-actions, .dash-actions, .pet-form, .add-med-form, .btn, .guide-section { display: none !important; }
  body { background: white; color: black; }
  .pet-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .summary-bar { box-shadow: none; border: 1px solid #ccc; }
}

/* Responsive */
@media (max-width: 640px) {
  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: 1rem; }
  .summary-bar { padding: 12px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; align-items: flex-start; }
  .med-table { font-size: .78rem; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; }
  .nav-links { gap: 12px; }
  .timeline-item { flex-wrap: wrap; }
}

@media (max-width: 400px) {
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
