html,
body {
  min-height: 100%;
}

body {
  font-size: 15px;
  color: #0f172a;
  background:
    radial-gradient(circle at 0% 0%, #dbeafe 0, transparent 38%),
    radial-gradient(circle at 100% 20%, #f5d0fe 0, transparent 35%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.app-shell {
  max-width: 980px;
  margin: 0 auto;
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(140deg, #4f46e5 0%, #9333ea 45%, #0ea5e9 100%);
  border-radius: 24px;
  padding: 20px;
  color: #fff;
  box-shadow: 0 20px 34px rgba(79, 70, 229, 0.28);
}

.hero-kicker {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  opacity: 0.85;
}

.btn-ghost {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
}

.mobile-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.64);
  border-radius: 14px;
  padding: 6px;
  backdrop-filter: blur(8px);
}

.tab-button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 8px;
  font-weight: 700;
  color: #475569;
}

.tab-button.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.1);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.app-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.08);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.pie-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
}

.pie-chart {
  width: min(260px, 72vw);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(
    #9333ea 0 calc(var(--julia-percent) * 1%),
    #0891b2 calc(var(--julia-percent) * 1%) 100%
  );
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.88), 0 14px 26px rgba(15, 23, 42, 0.12);
}

.pie-legend {
  display: grid;
  gap: 10px;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.72);
}

.pie-legend-item h4 {
  margin: 0;
  font-size: 0.98rem;
}

.pie-legend-item p {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
}

.pie-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-julia {
  background: #9333ea;
}

.dot-lucia {
  background: #0891b2;
}

.pie-total {
  font-weight: 700;
  color: #0f172a;
}

.summary-card {
  border-radius: 18px;
  padding: 18px;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.summary-card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.summary-card p {
  margin: 8px 0 0;
  font-size: 1.45rem;
  font-weight: 800;
}

.summary-julia {
  background: linear-gradient(140deg, #7c3aed 0%, #c026d3 100%);
}

.summary-lucia {
  background: linear-gradient(140deg, #0284c7 0%, #14b8a6 100%);
}

.child-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.child-button {
  min-height: 76px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
}

.child-julia {
  background: linear-gradient(140deg, #9333ea 0%, #d946ef 100%);
}

.child-lucia {
  background: linear-gradient(140deg, #0891b2 0%, #22c55e 100%);
}

.active-child-pill {
  background: rgba(99, 102, 241, 0.12);
  color: #3730a3;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.92rem;
}

.app-input {
  border-radius: 12px;
  border: 1px solid #cbd5e1;
}

.app-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.16);
}

.btn-save {
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(140deg, #4f46e5 0%, #a21caf 100%);
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(124, 58, 237, 0.24);
}

.app-table thead th {
  border-top: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
}

.app-table tbody tr {
  border-color: rgba(148, 163, 184, 0.2);
}

.history-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.history-import-form {
  display: grid;
  gap: 8px;
}

.history-action-form {
  flex: 1 1 180px;
}

.history-bottom-actions .btn {
  min-height: 38px;
}

.row-delete-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #dc2626;
  text-decoration: none;
}

.row-delete-btn:hover,
.row-delete-btn:focus {
  color: #991b1b;
  background: transparent;
  box-shadow: none;
}

.row-delete-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.import-modal {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.login-card {
  max-width: 420px;
  margin: 14vh auto 0;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
  body {
    font-size: 16px;
  }

  .child-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .mobile-tabs {
    max-width: 560px;
  }

  .pie-dashboard {
    grid-template-columns: auto 1fr;
  }
}
