/* =========================
   AnimalCoach Master CSS
   KOMPLETT - Mobile Optimiert
   Version: Final mit Fixed Background
   ========================= */

:root {
  /* Farben aus Logo */
  --bg-1: #e56a2f;
  --bg-2: #f2b25f;
  
  /* UI Farben */
  --paper: #ffffff;
  --card: #ffffff;
  --card-border: rgba(0,0,0,.07);
  --shadow: 0 18px 40px rgba(0,0,0,.10);
  
  --text: #1f2937;
  --muted: #6b7280;
  
  --teal: #2f8f97;
  --teal-d: #287b82;
  
  /* Radius */
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  
  /* Spacing */
  --gap: 18px;
  --max: 1200px;
}

/* ===== Reset & Base ===== */
* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

html, body { 
  height: 100%; 
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: 
    radial-gradient(1200px 700px at 20% 40%, rgba(255,255,255,.25), rgba(255,255,255,0) 60%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  line-height: 1.6;
}

a { 
  color: inherit; 
  text-decoration: none; 
}

img { 
  max-width: 100%; 
  display: block; 
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* ===== APP CONTAINER ===== */
.app {
  min-height: 100vh;
  padding: 14px;
  padding-bottom: 100px;
}

@media (min-width: 981px) {
  .app {
    max-width: calc(var(--max) + 360px);
    margin: 28px auto;
    padding: 0 18px 28px 18px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--gap);
    align-items: start;
  }
}

/* ===== SIDEBAR (Desktop only) ===== */
.sidebar {
  display: none;
}

@media (min-width: 981px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: var(--shadow);
    border-radius: var(--radius-xl);
    padding: 16px;
    position: sticky;
    top: 18px;
    height: fit-content;
  }
}

.brand {
  display: flex;
  justify-content: center;
  padding: 6px 0 10px;
}

.brand__logo {
  max-height: 54px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.10));
}

/* Navigation (Sidebar) */
.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.20);
  transition: transform .05s ease, background .15s ease;
  color: inherit;
}

.nav__item:hover {
  background: rgba(255,255,255,.26);
}

.nav__item:active {
  transform: translateY(1px);
}

.nav__icon {
  width: 20px;
  display: grid;
  place-items: center;
  opacity: .9;
}

.nav__icon svg {
  width: 20px;
  height: 20px;
}

.nav__item.is-active {
  background: rgba(255,255,255,.32);
  border-color: rgba(255,255,255,.35);
  font-weight: 700;
}

/* ===== MOBILE TOPBAR (Mobile only) ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

@media (min-width: 981px) {
  .topbar {
    display: none;
  }
}

.topbar__title {
  font-weight: 900;
}

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-nav {
  display: block;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  z-index: 999;
  backdrop-filter: blur(10px);
}

@media (min-width: 981px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav__items {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(31,41,55,.78);
  min-height: 60px;
  transition: all 0.2s ease;
}

.mobile-nav__item:active {
  transform: scale(0.95);
}

.mobile-nav__item.is-active {
  background: rgba(47,143,151,.14);
  color: rgba(31,41,55,.95);
}

.mobile-nav__icon {
  font-size: 22px;
}

/* Alternative mobile nav (mnav) */
.mnav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  z-index: 999;
  backdrop-filter: blur(10px);
}

@media (min-width: 981px) {
  .mnav {
    display: none;
  }
}

.mnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(31,41,55,.78);
  min-height: 56px;
  transition: all 0.2s ease;
}

.mnav__item:active {
  transform: scale(0.95);
}

.mnav__item.is-active {
  background: rgba(47,143,151,.14);
  color: rgba(31,41,55,.95);
}

.mnav__ico {
  font-size: 20px;
}

/* ===== MAIN CONTENT ===== */
.main {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  padding: 16px;
  min-height: 520px;
  backdrop-filter: blur(10px);
}

@media (min-width: 640px) {
  .main {
    padding: 20px;
  }
}

.main > * {
  max-width: 100%;
}

/* ===== HEADER ===== */
.header h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 44px);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.sub {
  margin: 6px 0 0;
  color: rgba(31,41,55,.75);
  font-size: 14px;
}

.header__actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .header__actions {
    flex-direction: column;
  }
  
  .header__actions .btn {
    width: 100%;
  }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: transform .05s ease, background .15s ease, opacity .15s ease;
  user-select: none;
  text-decoration: none;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--teal);
  color: white;
  border-color: rgba(0,0,0,.06);
  box-shadow: 0 4px 12px rgba(47,143,151,.25);
}

.btn--primary:hover {
  background: var(--teal-d);
}

.btn--ghost {
  background: rgba(255,255,255,.55);
  color: inherit;
}

.btn--ghost:hover {
  background: rgba(255,255,255,.75);
}

.btn--light {
  background: rgba(255,255,255,.35);
  color: inherit;
}

.btn--light:hover {
  background: rgba(255,255,255,.55);
}

.btn--secondary {
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(0,0,0,.10);
  color: rgba(0,0,0,.65);
}

.btn--small {
  padding: 8px 12px;
  font-size: 13px;
  min-height: 36px;
}

.iconbtn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: all 0.2s ease;
}

.iconbtn:hover {
  background: rgba(255,255,255,1);
}

.iconbtn input {
  display: none;
}

/* ===== CARDS ===== */
.card {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
  padding: 16px;
}

@media (min-width: 640px) {
  .card {
    padding: 18px;
  }
}

.card--sidebar {
  padding: 16px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card__title {
  margin: 0;
  font-size: clamp(18px, 3vw, 22px);
  letter-spacing: -0.01em;
  font-weight: 700;
}

.card__foot {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* ===== GRID ===== */
.grid {
  margin-top: 16px;
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid--customers {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid--customers {
    grid-template-columns: 1fr 1.2fr;
  }
}

.details-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .details-grid {
    grid-template-columns: 1fr 1.15fr;
  }
}

.tier-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .tier-grid {
    grid-template-columns: 1fr 1.15fr;
  }
}

.ka-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .ka-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* ===== PILLS (Status-Tags) ===== */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.85);
}

.pill--ok {
  background: rgba(46,204,113,.18);
  color: #16a34a;
}

.pill--amber {
  background: rgba(245,158,11,.20);
  color: #d97706;
}

.pill--phase {
  background: rgba(59,130,246,.16);
  color: #2563eb;
}

.pill--green {
  background: rgba(16,185,129,.18);
  color: #059669;
}

.pill--red {
  background: rgba(239,68,68,.18);
  color: #dc2626;
}

.pillbtn {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(0,0,0,.08);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.pillbtn:hover {
  background: rgba(255,255,255,.85);
}

.pillbtn.is-active {
  background: var(--teal);
  color: white;
  border-color: var(--teal-d);
}

/* ===== LISTS ===== */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.55);
}

@media (max-width: 640px) {
  .list__item {
    padding: 14px;
    gap: 14px;
  }
}

.list__item--click {
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 72px;
  align-items: center;
}

.list__item--click:hover,
.list__item--click:active {
  background: rgba(255,255,255,.75);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.list__item.is-selected {
  border-color: var(--teal);
  background: rgba(47,143,151,.08);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(47,143,151,.15);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  color: var(--teal);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .avatar {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }
}

.list__meta {
  flex: 1;
  min-width: 0;
}

.list__name {
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 2px;
}

.list__desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
  line-height: 1.4;
}

/* ===== FORMS ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form__row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 13px;
  color: rgba(31,41,55,.75);
  font-weight: 700;
}

.field__input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.86);
  outline: none;
  font-size: 15px;
  transition: all 0.2s ease;
  min-height: 48px;
}

.field__input:focus,
select:focus {
  border-color: rgba(47,143,151,.55);
  box-shadow: 0 0 0 4px rgba(47,143,151,.16);
}

textarea.field__input {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.form__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

@media (max-width: 640px) {
  .form__actions {
    flex-direction: column;
  }
  
  .form__actions .btn {
    width: 100%;
  }
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

/* ===== SEARCH & TOOLS ===== */
.tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.08);
}

.search input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 15px;
  min-height: 32px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== PREVIEW (Kunden-Details) ===== */
.preview {
  min-height: 300px;
}

.preview__empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.preview__grid {
  display: grid;
  gap: 20px;
}

.preview__panel {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(249,250,251,.85);
  border: 1px solid rgba(0,0,0,.05);
}

.preview__panelHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.preview__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.preview__sub {
  font-size: 13px;
  color: var(--muted);
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kv__row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.kv__k {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  min-width: 120px;
  flex-shrink: 0;
}

.kv__v {
  font-weight: 600;
  flex: 1;
}

.noteBox {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.05);
}

.noteBox__head {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.noteBox__text {
  font-size: 14px;
  line-height: 1.5;
}

.actionsRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 640px) {
  .actionsRow {
    flex-direction: column;
  }
  
  .actionsRow .btn {
    width: 100%;
  }
}

.petGrid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.petCard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.65);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 72px;
}

.petCard:hover {
  background: rgba(255,255,255,.85);
}

.petCard.is-active {
  border-color: var(--teal);
  background: rgba(47,143,151,.08);
}

.petCard__img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(47,143,151,.15);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}

.petCard__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.petCard__img--fallback {
  background: rgba(47,143,151,.15);
}

.petCard__meta {
  flex: 1;
  min-width: 0;
}

.petCard__name {
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 2px;
}

.petCard__sub {
  font-size: 13px;
  color: var(--muted);
}

.petDetail {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.05);
}

.petDetail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.petDetail__name {
  font-size: 18px;
  font-weight: 700;
}

/* ===== DETAILS COMPONENTS ===== */
.details-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(249,250,251,.80);
  border: 1px solid rgba(0,0,0,.05);
  margin-bottom: 14px;
}

.details-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(47,143,151,.15);
  color: var(--teal);
  font-size: 22px;
}

.details-head__meta {
  flex: 1;
}

.details-head__name {
  font-weight: 900;
  font-size: 16px;
}

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

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

.animals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.animal-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(249,250,251,.80);
  border: 1px solid rgba(0,0,0,.05);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  min-height: 72px;
}

.animal-row:hover {
  background: rgba(249,250,251,.95);
}

.animal-row.is-active {
  outline: 4px solid rgba(47,143,151,.18);
  border-color: rgba(47,143,151,.35);
}

.animal-thumb {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(47,143,151,.15);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  flex-shrink: 0;
}

.animal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.animal-thumb--fallback {
  background: rgba(47,143,151,.15);
}

.animal-meta {
  flex: 1;
  min-width: 0;
}

.animal-name {
  font-weight: 900;
  font-size: 16px;
}

.animal-details {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 12px 28px rgba(0,0,0,.06);
}

.animal-details__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.animal-details__img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(47,143,151,.15);
  display: grid;
  place-items: center;
  font-size: 28px;
  flex-shrink: 0;
}

.animal-details__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.animal-details__img--fallback {
  background: rgba(47,143,151,.15);
}

.animal-details__name {
  font-weight: 900;
  font-size: 18px;
}

.mini-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(249,250,251,.85);
  border: 1px solid rgba(0,0,0,.05);
}

.mini-label {
  font-size: 12px;
  font-weight: 900;
  color: rgba(31,41,55,.72);
  margin-bottom: 6px;
}

.mini-value {
  font-weight: 900;
  font-size: 15px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(249,250,251,.80);
  border: 1px solid rgba(0,0,0,.05);
  margin-bottom: 14px;
}

.profile__img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(47,143,151,.15);
  display: grid;
  place-items: center;
  font-size: 28px;
  flex-shrink: 0;
}

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

.profile__img--fallback {
  background: rgba(47,143,151,.15);
}

.profile__meta {
  flex: 1;
}

.profile__name {
  font-weight: 900;
  font-size: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.block {
  padding: 14px;
  border-radius: 18px;
  background: rgba(249,250,251,.85);
  border: 1px solid rgba(0,0,0,.05);
}

.block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.block__head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

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

@media (max-width: 640px) {
  .actionbar {
    flex-direction: column;
  }
  
  .actionbar .btn {
    width: 100%;
  }
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

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

/* ===== PET TABS ===== */
.pet-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pet-tab {
  appearance: none;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 40px;
}

.pet-tab.is-active {
  background: rgba(255,255,255,1);
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
}

.pet-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(249,250,251,.85);
  border: 1px solid rgba(0,0,0,.05);
}

.mini-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .mini-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.mini {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.06);
}

.mini .lbl {
  font-size: 12px;
  font-weight: 900;
  color: rgba(31,41,55,.72);
  margin-bottom: 6px;
}

.mini .val {
  font-weight: 900;
}

/* ===== FILES ===== */
.files {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.55);
}

.file__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(47,143,151,.12);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.file__meta {
  flex: 1;
  min-width: 0;
}

.file__name {
  font-weight: 900;
  font-size: 14px;
}

.file__sub {
  color: var(--muted);
  font-size: 12px;
}

.file__size {
  color: rgba(31,41,55,.75);
  font-weight: 800;
  font-size: 12px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.06);
  padding: 6px 10px;
  border-radius: 999px;
}

.drop {
  border-radius: 18px;
  background: rgba(248,250,252,.92);
  border: 1px dashed rgba(0,0,0,.16);
  padding: 14px;
}

.drop__title {
  font-weight: 900;
  margin-bottom: 4px;
}

.drop__sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.drop__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drop__spacer {
  flex: 1;
}

/* ===== CALENDAR ===== */
.calendar {
  margin-top: 12px;
}

.calendar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .calendar__row {
    flex-direction: column;
  }
  
  .calendar__row .btn {
    width: 100%;
  }
}

.calendar__next {
  margin-top: 4px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(249,250,251,.85);
  border: 1px solid rgba(0,0,0,.05);
}

.calendar__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2px;
  margin-bottom: 6px;
}

.calendar__when {
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 4px;
}

.calendar__what {
  font-weight: 900;
  font-size: 14px;
}

.calendar__where {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.calendar__actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

@media (max-width: 640px) {
  .calendar__actions {
    flex-direction: column;
  }
  
  .calendar__actions .btn {
    width: 100%;
  }
}

.calendar__hint {
  margin: 10px 2px 0 2px;
  font-size: 12px;
  color: var(--muted);
}

/* ===== INFO CALLOUT ===== */
.info {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 242, 204, .65);
  border: 1px solid rgba(234,179,8,.25);
}

.info__badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(234,179,8,.15);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.info__text {
  font-size: 13px;
  color: rgba(31,41,55,.9);
  line-height: 1.35;
  flex: 1;
}

.note .muted {
  margin: 10px 0 0 0;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 50;
}

.modal.is-open {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  width: min(560px, calc(100% - 28px));
  margin: 8vh auto 0 auto;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  overflow: hidden;
  max-height: calc(100vh - 16vh);
  overflow-y: auto;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(249,250,251,.85);
  border-bottom: 1px solid rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

/* ===== UTILITY CLASSES ===== */
.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hidden-mobile {
    display: none !important;
  }
}

@media (min-width: 981px) {
  .hidden-desktop {
    display: none !important;
  }
}

.linkBtn {
  background: none;
  border: none;
  color: var(--teal);
  font-weight: 600;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
}

.linkBtn:hover {
  color: var(--teal-d);
}

.linkBtn--danger {
  color: #dc2626;
}

/* ===== RESPONSIVE HELPERS ===== */
*:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

button,
.btn {
  -webkit-tap-highlight-color: transparent;
}

@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-nav,
  .mnav {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  
  .app {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: no-preference) {
  * {
    transition-duration: 0.2s;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}