:root {
  /* Paleta del logo Hogar del Niño */
  --pink: #e91e8c;
  --pink-soft: #ffe3f2;
  --orange: #ff8a00;
  --orange-soft: #ffe8cc;
  --yellow: #ffd400;
  --yellow-soft: #fff6b8;
  --lime: #b4e015;
  --lime-soft: #f0ffc4;
  --sky: #4ec3f7;
  --sky-soft: #dff4ff;
  --ink: #141414;
  --muted: #5c5c5c;
  --surface: #ffffff;
  --bg: #fff9f2;
  --bg-2: #f3fbff;
  --line: #e6e0d8;
  --brand: var(--pink);
  --brand-dark: #c4126f;
  --accent: var(--orange);
  --danger: #d32f2f;
  --ok: #6a9e00;
  --radius: 14px;
  --font-display: "Lilita One", "Arial Black", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
  --shadow: 0 12px 32px rgba(20, 20, 20, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 12%, var(--pink-soft) 0 18%, transparent 19%),
    radial-gradient(circle at 92% 8%, var(--sky-soft) 0 16%, transparent 17%),
    radial-gradient(circle at 85% 78%, var(--yellow-soft) 0 14%, transparent 15%),
    radial-gradient(circle at 12% 88%, var(--lime-soft) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 50%, var(--orange-soft) 0 8%, transparent 9%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-2) 55%, #fff 100%);
  background-attachment: fixed;
}

a { color: var(--pink); text-decoration: none; font-weight: 700; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

.shell { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3.5rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 3px solid var(--ink);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  line-height: 1;
}

.brand:hover { text-decoration: none; color: var(--ink); }

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--yellow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand-text .line-1 { color: var(--pink); }
.brand-text .line-2 {
  font-size: 0.72em;
  display: flex;
  gap: 0.35rem;
}
.brand-text .line-2 .del { color: var(--lime); }
.brand-text .line-2 .nino { color: var(--sky); }

.login-logo {
  display: block;
  width: min(200px, 55vw);
  height: auto;
  object-fit: contain;
  margin: 0 auto 1.1rem;
  filter: drop-shadow(4px 6px 0 rgba(20, 20, 20, 0.08));
}

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav a, .nav button.linkish {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.92rem;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.nav a:hover {
  background: var(--yellow-soft);
  border-color: var(--ink);
  text-decoration: none;
}

.nav a.active {
  background: var(--sky);
  border-color: var(--ink);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--ink);
}

.nav button.linkish:hover {
  background: var(--pink-soft);
  border-color: var(--ink);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  margin: 0 0 0.4rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.page-title::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 8px;
  margin-top: 0.45rem;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow), var(--lime), var(--sky));
  border: 1.5px solid var(--ink);
}

.page-sub {
  margin: 0.85rem 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
}

.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.messages li {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 0.55rem;
  background: #fff;
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--lime);
  font-weight: 700;
}
.messages li.error { box-shadow: 3px 3px 0 var(--danger); }
.messages li.warning { box-shadow: 3px 3px 0 var(--orange); }
.messages li.success { box-shadow: 3px 3px 0 var(--sky); }

.panel {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  margin-bottom: 1.25rem;
  box-shadow: 4px 4px 0 var(--yellow);
}

.panel:nth-of-type(3n+1) { box-shadow: 4px 4px 0 var(--pink); }
.panel:nth-of-type(3n+2) { box-shadow: 4px 4px 0 var(--sky); }
.panel:nth-of-type(3n) { box-shadow: 4px 4px 0 var(--lime); }

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.95rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .brand-text { display: none; }
  .brand-logo { width: 48px; height: 48px; }
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  background: #fff;
  margin-bottom: 0.85rem;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  background: var(--sky-soft);
  box-shadow: 3px 3px 0 var(--sky);
}

.btn {
  display: inline-block;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--pink);
  color: #fff;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  background: var(--brand-dark);
  text-decoration: none;
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
}
.btn.secondary:hover { background: var(--yellow-soft); color: var(--ink); }

.btn.accent {
  background: var(--orange);
  color: #fff;
}
.btn.accent:hover { background: #e07800; color: #fff; }

.btn.sky {
  background: var(--sky);
  color: var(--ink);
}

.btn.danger {
  background: #fff;
  color: var(--danger);
  box-shadow: 3px 3px 0 var(--danger);
}
.btn.danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn.small { padding: 0.4rem 0.85rem; font-size: 0.88rem; }
.btn.xs {
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  box-shadow: 2px 2px 0 var(--ink);
}
.btn.xs.danger { box-shadow: 2px 2px 0 var(--danger); }
.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 var(--line); }

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.5rem; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.row-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.row-actions select,
.row-actions-group select {
  width: auto !important;
  min-width: 5.5rem;
  max-width: 8rem;
  margin: 0 !important;
  padding: 0.4rem 0.55rem;
  height: 2.15rem;
  font-size: 0.9rem;
}

.row-actions .btn,
.row-actions-group .btn {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.1;
}

.table-actions td {
  vertical-align: middle;
}

.table-actions .col-name {
  font-weight: 800;
  white-space: nowrap;
  width: 1%;
}

.actions-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin: 0;
}

.actions-inline select {
  width: auto;
  min-width: 6rem;
  margin: 0;
  flex: 0 0 auto;
}

.actions-inline .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th, .table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px dashed var(--line);
}

.table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--lime-soft);
  color: var(--ink);
  border: 2px solid var(--ink);
}

.badge.warn {
  background: var(--orange-soft);
}

.empty {
  color: var(--muted);
  padding: 1.75rem 0;
  text-align: center;
  font-weight: 700;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 20%, var(--pink) 0 10px, transparent 11px),
    radial-gradient(circle at 80% 18%, var(--sky) 0 12px, transparent 13px),
    radial-gradient(circle at 70% 75%, var(--yellow) 0 14px, transparent 15px),
    radial-gradient(circle at 22% 80%, var(--lime) 0 11px, transparent 12px),
    radial-gradient(circle at 50% 40%, var(--orange) 0 8px, transparent 9px),
    linear-gradient(160deg, #fff6fb 0%, #eef9ff 45%, #fff8e8 100%);
}

.login-card {
  width: min(440px, 100%);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 2.1rem 1.85rem 2rem;
  box-shadow: 8px 8px 0 var(--pink);
  text-align: center;
}

.login-card .brand {
  display: none;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-weight: 700;
  font-size: 1.02rem;
}

.login-card form { text-align: left; }
.login-card .btn { width: 100%; margin-top: 0.35rem; }

.kid-card {
  position: relative;
  overflow: hidden;
}

.kid-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow), var(--lime), var(--sky));
  border-bottom: 2.5px solid var(--ink);
}

.kid-card h3 {
  margin: 0.35rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  text-transform: uppercase;
  color: var(--ink);
}

.kid-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
}

.mov-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.mov-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 2px dashed var(--line);
  font-size: 0.92rem;
  font-weight: 700;
}

.stat {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--pink);
  margin: 0;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--yellow-soft);
}

.hint { font-size: 0.88rem; color: var(--muted); margin: 0.35rem 0 0.85rem; font-weight: 600; }

.inline-form { display: inline; }
.field-row { margin-bottom: 0.25rem; }

/* Dashboard empty state */
.panel .empty {
  padding: 2rem 1rem;
}
