:root {
  --dh-green: #2f6f4f;
  --dh-green-dark: #234f38;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

.app-header {
  background: var(--dh-green);
}
.app-header nav {
  padding: 0.5rem 1rem;
}
.app-header a, .app-header .muted {
  color: #fff !important;
}
.app-header .brand {
  font-weight: 700;
  text-decoration: none;
}

.login-container {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 360px;
}

.flash {
  background: #fde8e8;
  border: 1px solid #f5b5b5;
  color: #8a2222;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
}

.dog-selector select {
  max-width: 260px;
}

.dog-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
}
.dog-card-photo img,
.photo-placeholder {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}
.dog-card h2 {
  margin-bottom: 0.15rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.lookahead-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lookahead-form label {
  margin: 0;
  white-space: nowrap;
  font-size: 0.85rem;
}
.lookahead-form input {
  width: 5rem;
  margin: 0;
}

.alert-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.alert-item {
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.alert-item.overdue {
  background: #fbe1e1;
  color: #8a2222;
  border: 1px solid #f0b4b4;
}
.alert-item.upcoming {
  background: #fff3d6;
  color: #6b4e00;
  border: 1px solid #f0d38a;
}

.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}
.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.25rem 0.5rem;
  background: var(--pico-card-background-color, #fff);
  border: 1px solid var(--pico-muted-border-color, #ddd);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  font-weight: 600;
}
.nav-icon {
  font-size: 1.8rem;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}
.quick-links a {
  flex: 1 1 auto;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}
.record-card {
  display: block;
  border: 1px solid var(--pico-muted-border-color, #ddd);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
}
.record-card header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.record-card p {
  margin: 0.2rem 0;
}
.tag {
  background: var(--dh-green);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.muted {
  color: var(--pico-muted-color, #666);
  font-size: 0.9rem;
}

.add-entry {
  margin: 1rem 0;
  border: 1px solid var(--pico-muted-border-color, #ddd);
  border-radius: 8px;
  padding: 0.5rem 1rem;
}
.next-due-fieldset {
  border: 1px dashed var(--pico-muted-border-color, #ccc);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 0.75rem 0;
}
.interval-row {
  display: flex;
  gap: 0.75rem;
}
.interval-row label {
  flex: 1;
}

.lesion-card p {
  margin: 0.15rem 0;
}

.baseline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.baseline-grid p {
  margin: 0.1rem 0 0;
}
.baseline-photo, .update-photo {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.sparkline {
  width: 100%;
  max-width: 320px;
  height: 60px;
  color: var(--dh-green);
}

.summary-sheet table {
  width: 100%;
  margin-bottom: 1.25rem;
}

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

@media print {
  .app-header, .no-print, .quick-links, nav {
    display: none !important;
  }
  body, main {
    padding: 0;
    margin: 0;
  }
  .summary-sheet table, .summary-sheet th, .summary-sheet td {
    border: 1px solid #333;
    border-collapse: collapse;
  }
  .summary-sheet th, .summary-sheet td {
    padding: 4px 8px;
  }
}
