:root {
  --primary: #E07A5F;
  --primary-light: #F4A261;
  --secondary: #81B29A;
  --secondary-dark: #5F8B71;
  --accent: #F2CC8F;
  --bg: #FEFAE0;
  --bg-card: #FFFFFF;
  --text: #3D405B;
  --text-light: #6C757D;
  --border: #E9ECEF;
  --shadow: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Nunito', system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 10% 20%, rgba(242,204,143,0.15) 0%, transparent 50%),
                    radial-gradient(circle at 90% 80%, rgba(129,178,154,0.1) 0%, transparent 50%);
}

#app { max-width: 1000px; margin: 0 auto; padding: 1rem 1rem 5rem; }

/* Login */
.auth-container {
  display: flex; justify-content: center; align-items: center; min-height: 100vh;
  position: relative; overflow: hidden;
}
.auth-container::before,
.auth-container::after {
  content: ''; position: absolute; border-radius: 50%; opacity: 0.4;
}
.auth-container::before {
  width: 500px; height: 500px; background: radial-gradient(circle, rgba(224,122,95,0.2) 0%, transparent 70%);
  top: -150px; right: -150px;
}
.auth-container::after {
  width: 400px; height: 400px; background: radial-gradient(circle, rgba(129,178,154,0.2) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}
.auth-card {
  width: 100%; max-width: 420px; background: white;
  border-radius: 32px; padding: 2.5rem 2rem; box-shadow: var(--shadow-lg);
  text-align: center; position: relative; z-index: 1;
}
.auth-card h1 { font-size: 2rem; font-weight: 800; color: var(--primary); margin-bottom: 0.25rem; }
.auth-subtitle { color: var(--text-light); margin-bottom: 1.8rem; }

/* Header */
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 0; margin-bottom: 1.5rem;
}
header h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap:0.4rem;
  padding: 0.65rem 1.4rem; border-radius: 50px; font-weight: 700; font-size:0.85rem;
  border: none; cursor: pointer; transition: 0.2s; font-family: var(--font);
  background: transparent;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(224,122,95,0.3); }
.btn-primary:hover { background: #cf6a4e; }
.btn-outline { color: var(--text); border: 2px solid var(--border); }
.btn-outline:hover { background: #f5f5f5; }
.btn-small {
  padding: 0.3rem 0.8rem; font-size:0.75rem; border-radius: 20px;
  background: white; border: 1px solid var(--border); cursor: pointer;
}
.btn-small:hover { background: #f0f0f0; }
.btn-block { width:100%; }

.input-field {
  width:100%; padding: 0.85rem 1.2rem; border: 2px solid var(--border); border-radius: 50px;
  font-size:0.95rem; font-family: var(--font); background: white; margin-bottom:0.8rem;
}
.input-field:focus { outline:none; border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(129,178,154,0.1); }

/* Barra de navegación inferior */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white; box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
  display: flex; justify-content: space-around; padding: 0.5rem 0.5rem env(safe-area-inset-bottom);
  z-index: 100; border-top: 1px solid var(--border);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap:0.2rem;
  padding: 0.4rem 0.8rem; border-radius: 12px; color: var(--text-light);
  font-size: 0.7rem; font-weight: 700; cursor: pointer; transition: 0.2s;
  background: transparent; border: none;
}
.nav-item.active { color: var(--primary); background: rgba(224,122,95,0.08); }
.nav-item .nav-icon { font-size: 1.4rem; }

/* Tarjetas */
.card {
  background: var(--bg-card); border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}

/* Dashboard directora */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap:1rem; }
.dash-card {
  background: white; border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow); text-align: center; cursor: pointer; transition: 0.2s;
  border: 1px solid var(--border);
}
.dash-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.dash-icon { font-size: 2.5rem; }

/* Tracking */
.tracking-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap:1rem; }
.child-card {
  background: white; border-radius: var(--radius); padding: 1.2rem;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.child-card h4 { font-size: 1rem; font-weight: 800; margin-bottom: 0.8rem; }
.tracking-row { display: flex; align-items: center; gap:0.5rem; margin-bottom:0.5rem; flex-wrap: wrap; }
.tracking-row label { font-weight: 700; font-size:0.8rem; width: 55px; color: var(--text-light); }
.option-selector { display: flex; gap:0.2rem; flex-wrap: wrap; }
.option-pill {
  padding:0.3rem 0.7rem; border-radius: 20px; border:2px solid var(--border); background:white;
  font-size:0.75rem; font-weight:600; cursor:pointer;
}
.option-pill.selected { background: var(--secondary); color:white; border-color: var(--secondary); }
.diaper-squares { display:flex; gap:0.4rem; }
.diaper-sq {
  width:28px; height:28px; border-radius:6px; border:2px solid var(--border); background:white; cursor:pointer;
}
.diaper-sq.filled { background: var(--accent); border-color: var(--accent); }
.timer-text { font-weight:700; color: var(--secondary); }

/* Galería */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap:0.8rem; }
.gallery-grid img { width:100%; border-radius: var(--radius-sm); aspect-ratio: 1; object-fit:cover; }

/* Revisión fotos */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap:1rem; }
.review-card { border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); background: white; }
.review-card img { width:100%; height:150px; object-fit:cover; display:block; }
.review-actions { display:flex; justify-content:space-around; padding:0.5rem; }

/* Chat */
.chat-panel { display:flex; flex-direction:column; height:60vh; background:white; border-radius:var(--radius); box-shadow:var(--shadow-lg); overflow:hidden; }
.chat-header { padding:1rem; background: var(--secondary); color:white; font-weight:700; }
.chat-messages { flex:1; padding:1rem; overflow-y:auto; background:#fafafa; display:flex; flex-direction:column; gap:0.5rem; }
.chat-msg { max-width:80%; padding:0.7rem 1rem; border-radius:18px; font-size:0.9rem; }
.chat-msg.sent { align-self:flex-end; background:var(--primary); color:white; border-bottom-right-radius:4px; }
.chat-msg.received { align-self:flex-start; background:white; border-bottom-left-radius:4px; border:1px solid #eee; }
.chat-input-area { display:flex; gap:0.5rem; padding:1rem; border-top:1px solid var(--border); }

/* Calendario */
.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:0.4rem; }
.calendar-day {
  padding:0.5rem; text-align:center; background:white; border-radius:12px;
  min-height:65px; font-weight:600; box-shadow:var(--shadow); font-size:0.9rem;
}
.calendar-day.today { background:var(--secondary); color:white; }
.event-dot { width:6px; height:6px; background:var(--primary); border-radius:50%; margin:0.2rem auto 0; }

@media (max-width: 600px) {
  header { flex-direction: column; align-items: flex-start; }
  .dash-grid { grid-template-columns: repeat(2,1fr); }
}