:root{
  --bg:#f3f6fb;
  --card:#ffffff;
  --ink:#162033;
  --muted:#687386;
  --line:#dfe6f1;
  --blue:#2f6bff;
  --blue-dark:#184ed8;
  --orange:#ff9f1c;
  --danger:#e63946;
  --ok:#13a76b;
  --shadow:0 16px 42px rgba(24,38,69,.10);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--ink);
}

button,input,select,textarea{
  font:inherit;
}

button{
  cursor:pointer;
}

.app-shell{
  min-height:100vh;
  max-width:520px;
  margin:0 auto;
  background:var(--bg);
  position:relative;
}

.splash{
  min-height:100vh;
  display:grid;
  place-content:center;
  gap:18px;
  text-align:center;
  color:var(--muted);
}

.splash img{
  width:170px;
  margin:auto;
}

.screen{
  min-height:100vh;
  padding:22px 18px 96px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 0 18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.brand img{
  width:112px;
  height:auto;
}

.avatar{
  width:42px;
  height:42px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #fff;
  box-shadow:0 8px 20px rgba(0,0,0,.16);
}

.title{
  margin:0;
  font-size:28px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:0;
}

.subtitle{
  color:var(--muted);
  margin:8px 0 0;
  line-height:1.45;
}

.card{
  background:var(--card);
  border:1px solid rgba(223,230,241,.9);
  border-radius:22px;
  padding:18px;
  box-shadow:var(--shadow);
}

.stack{
  display:grid;
  gap:14px;
}

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

.field{
  display:grid;
  gap:7px;
}

.field span{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.field input,
.field select,
.field textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:15px;
  padding:13px 14px;
  background:#fff;
  color:var(--ink);
  outline:none;
}

.field textarea{
  min-height:88px;
  resize:vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(47,107,255,.10);
}

.btn{
  border:0;
  border-radius:16px;
  padding:13px 16px;
  font-weight:900;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  min-height:48px;
  text-decoration:none;
}

.btn.primary{
  background:var(--blue);
  color:#fff;
  box-shadow:0 12px 24px rgba(47,107,255,.25);
}

.btn.primary:active{
  background:var(--blue-dark);
}

.btn.light{
  background:#eef3ff;
  color:var(--blue);
}

.btn.dark{
  background:#162033;
  color:#fff;
}

.btn.danger{
  background:#fff0f2;
  color:var(--danger);
}

.btn.full{
  width:100%;
}

.link-btn{
  border:0;
  background:transparent;
  color:var(--blue);
  font-weight:800;
  padding:8px 0;
}

.tabs{
  position:fixed;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  width:min(520px,100%);
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:4px;
  padding:9px 10px calc(9px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.94);
  border-top:1px solid var(--line);
  backdrop-filter:blur(18px);
  z-index:20;
}

.tab{
  border:0;
  background:transparent;
  border-radius:14px;
  padding:8px 4px;
  color:var(--muted);
  font-size:11px;
  font-weight:850;
  display:grid;
  gap:3px;
  justify-items:center;
}

.tab b{
  font-size:18px;
  line-height:1;
}

.tab.active{
  background:#edf3ff;
  color:var(--blue);
}

.metric-row{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}

.metric{
  border-radius:17px;
  background:#f7f9fd;
  padding:12px;
  min-height:76px;
}

.metric strong{
  display:block;
  font-size:20px;
}

.metric span{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.pet-card,
.cita-card,
.social-card{
  display:flex;
  gap:13px;
  align-items:flex-start;
}

.pet-card img,
.cita-card img,
.social-card img{
  width:64px;
  height:64px;
  border-radius:18px;
  object-fit:cover;
  flex:none;
  background:#eef2f7;
}

.item-title{
  font-weight:900;
  margin:0 0 3px;
}

.item-meta{
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.badge{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:850;
  background:#eef3ff;
  color:var(--blue);
}

.status-pendiente{background:#fff6db;color:#9a6500}
.status-confirmada{background:#e9fbf2;color:#08784c}
.status-cancelada{background:#fff0f2;color:#b42332}

.empty{
  text-align:center;
  padding:32px 20px;
  color:var(--muted);
}

.empty b{
  display:block;
  color:var(--ink);
  margin-bottom:6px;
}

.auth-hero{
  min-height:100vh;
  padding:34px 18px;
  display:grid;
  align-content:center;
  gap:24px;
}

.auth-logo{
  width:166px;
}

.form-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.toast{
  position:fixed;
  left:50%;
  bottom:92px;
  transform:translateX(-50%);
  width:min(488px,calc(100% - 32px));
  border-radius:16px;
  padding:13px 15px;
  background:#162033;
  color:#fff;
  box-shadow:0 14px 32px rgba(0,0,0,.24);
  z-index:40;
  font-weight:800;
}

.toast.error{
  background:var(--danger);
}

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

.section-title{
  margin:22px 0 12px;
  font-size:18px;
  font-weight:950;
}

.hidden{
  display:none !important;
}

@media(max-width:370px){
  .screen{padding-left:14px;padding-right:14px}
  .grid2{grid-template-columns:1fr}
  .title{font-size:25px}
  .tabs{gap:2px;padding-left:6px;padding-right:6px}
  .tab{font-size:10px}
}
