/* ====== ActiviKids - Panel de Padres ====== */
:root {
  --primary: #6C5CE7;
  --primary-dark: #5547d4;
  --accent: #FF6B9D;
  --success: #38C172;
  --warning: #FFD93D;
  --danger: #E63946;
  --ink: #1A1B2E;
  --ink-soft: #4A4B63;
  --muted: #8E8EA9;
  --border: #E8E8F0;
  --bg: #F5F5FA;
  --card: #FFFFFF;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== Layout ====== */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 900;
  padding: 8px 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}

.nav-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); padding: 14px 12px 6px; font-weight: 700;
}

.nav-item {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}
.nav-item:hover { background: #F0F0F8; text-decoration: none; }
.nav-item.active { background: var(--ink); color: white; }
.nav-item .icon { font-size: 1.1rem; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.main { padding: 24px 32px; min-width: 0; }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px; gap: 20px; flex-wrap: wrap;
}
.page-title {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 4px;
}
.page-sub { color: var(--muted); font-weight: 500; }

/* ====== Cards ====== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 16px;
}
.card-title { font-size: 1.1rem; font-weight: 800; }

/* ====== KPI Cards ====== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-color, var(--primary));
}
.kpi .icon { font-size: 1.6rem; margin-bottom: 10px; }
.kpi .val { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 900; line-height: 1; }
.kpi .label { color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-top: 4px; }

/* ====== Buttons ====== */
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* ====== Tables ====== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
table th, table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
  background: #FAFAFD;
}
table tbody tr:hover { background: #FAFAFD; }

/* ====== Badges ====== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-pending { background: #FFF3BF; color: #8A6D00; }
.badge-approved { background: #D3F9D8; color: #2B8A3E; }
.badge-rejected { background: #FFE3E3; color: #C92A2A; }
.badge-delivered { background: #D0EBFF; color: #1864AB; }
.badge-cancelled { background: #E9ECEF; color: #495057; }
.badge-neutral { background: #F1F3F5; color: var(--ink-soft); }

/* ====== Forms ====== */
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group label {
  display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 5px; color: var(--ink-soft);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ====== Alerts ====== */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 0.9rem;
  border-left: 4px solid;
}
.alert-success { background: #EBFBEE; color: #2B8A3E; border-color: #2B8A3E; }
.alert-error { background: #FFF5F5; color: #C92A2A; border-color: #C92A2A; }
.alert-info { background: #E7F5FF; color: #1864AB; border-color: #1864AB; }

/* ====== Kid info card ====== */
.kid-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.kid-avatar-m {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  background: var(--avatar-bg, var(--accent));
  color: white;
  flex-shrink: 0;
}

/* ====== Activity/Reward cards (admin edit) ====== */
.list-items { display: grid; gap: 10px; }
.list-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.list-item .list-icon {
  width: 40px; height: 40px;
  background: #F0F0F8;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.list-item .list-title { font-weight: 700; }
.list-item .list-desc { font-size: 0.8rem; color: var(--muted); }

/* ====== Login page ====== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #F5F5FA 0%, #E8E8F8 100%);
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 38px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(26,27,46,0.1);
}

/* ====== Responsive ====== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    gap: 6px;
  }
  .brand { display: none; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; font-size: 0.82rem; padding: 8px 12px; }
  .main { padding: 18px; }
  .form-row { grid-template-columns: 1fr; }
  .page-title { font-size: 1.5rem; }
}

/* ====== Helpers ====== */
.flex { display: flex; gap: 10px; align-items: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.ml-auto { margin-left: auto; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.85rem; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state .big { font-size: 3rem; margin-bottom: 10px; }
