@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
  --ice: #eaf6fb;
  --ice-2: #dbeffa;
  --sky: #8fd3f4;
  --sky-deep: #4fa9dd;
  --navy: #2c3e63;
  --ink: #34405a;
  --white: #ffffff;
  --orange: #ffb648;
  --orange-deep: #ff9d2f;
  --pink: #ffd1dc;
  --green: #7fd9a8;
  --red: #ff8b8b;
  --shadow: 0 8px 24px rgba(79, 169, 221, 0.18);
  --radius: 22px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Quicksand', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, #ffffff 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, #ffffff 0%, transparent 35%),
    linear-gradient(180deg, var(--ice) 0%, var(--ice-2) 100%);
  background-attachment: fixed;
  padding-bottom: 60px;
}

h1, h2, h3, .brand { font-family: 'Baloo 2', cursive; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sky-deep);
}
.brand .mascot-mini { width: 40px; height: 40px; }

.header-right { display: flex; align-items: center; gap: 14px; }

.points-pill {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: white;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(255, 157, 47, 0.4);
}

nav.tabs {
  display: flex;
  gap: 8px;
}
nav.tabs button {
  border: none;
  background: transparent;
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s ease;
}
nav.tabs button.active {
  background: var(--sky);
  color: white;
  box-shadow: var(--shadow);
}
nav.tabs button:hover:not(.active) { background: var(--ice-2); }

main {
  max-width: 880px;
  margin: 28px auto;
  padding: 0 20px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.card h2 {
  margin-top: 0;
  color: var(--sky-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hidden { display: none !important; }

/* ---------- Auth screen ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card .mascot { width: 110px; margin-bottom: 6px; }
.auth-card h1 { color: var(--sky-deep); margin: 4px 0 2px; }
.auth-card p.subtitle { color: #7d8aa6; margin-top: 0; margin-bottom: 18px; }

.auth-toggle {
  display: flex;
  background: var(--ice);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 999px;
  font-family: 'Baloo 2', cursive;
  cursor: pointer;
  color: var(--ink);
}
.auth-toggle button.active { background: var(--sky-deep); color: white; }

label {
  display: block;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: #6f7d9a;
  margin: 10px 0 4px;
}
input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 2px solid var(--ice-2);
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  background: #fbfeff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sky);
}

button.btn {
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  border: none;
  border-radius: 14px;
  padding: 11px 20px;
  cursor: pointer;
  background: var(--sky-deep);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 169, 221, 0.35);
  transition: transform 0.1s ease;
}
button.btn:hover { transform: translateY(-1px); }
button.btn:active { transform: translateY(0); }
button.btn.full { width: 100%; margin-top: 14px; }
button.btn.orange { background: linear-gradient(135deg, var(--orange), var(--orange-deep)); }
button.btn.ghost { background: var(--ice-2); color: var(--navy); box-shadow: none; }
button.btn.danger { background: var(--red); }
button.btn.small { padding: 7px 14px; font-size: 0.9rem; }

.error-msg {
  background: #ffe4e4;
  color: #b3413f;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-top: 10px;
}
.success-msg {
  background: #e2f8ec;
  color: #2c7a52;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-top: 10px;
}

/* ---------- Dashboard ---------- */
.month-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.month-picker input { max-width: 180px; }

.progress-track {
  background: var(--ice-2);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
  margin: 10px 0 4px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #5fc98a);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-label { font-size: 0.85rem; color: #6f7d9a; }

.expense-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.expense-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ice);
  border-radius: 16px;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.expense-row.paid { background: #eafaf0; }
.expense-info { display: flex; flex-direction: column; gap: 2px; }
.expense-name { font-weight: 700; font-family: 'Baloo 2', cursive; color: var(--navy); }
.expense-meta { font-size: 0.82rem; color: #7d8aa6; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge.unpaid { background: #ffe9d1; color: #b56a12; }
.badge.paid { background: #d7f5e3; color: #278a53; }
.expense-actions { display: flex; align-items: center; gap: 8px; }
.receipt-link { font-size: 0.8rem; color: var(--sky-deep); text-decoration: none; }

form.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; }
form.inline-form .full-span { grid-column: 1 / -1; }

/* ---------- Prizes ---------- */
.prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 14px; }
.prize-card {
  background: var(--ice);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prize-emoji { font-size: 2.4rem; }
.prize-cost {
  font-family: 'Baloo 2', cursive;
  color: var(--orange-deep);
  font-weight: 700;
}
.claim-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.claim-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ice); border-radius: 14px; padding: 12px 16px;
}
.status-pill { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.status-pill.pending { background: #fff2cc; color: #9a7c14; }
.status-pill.approved { background: #d7ecff; color: #2266a3; }
.status-pill.fulfilled { background: #d7f5e3; color: #278a53; }
.status-pill.rejected { background: #ffdada; color: #b3413f; }

/* ---------- Admin ---------- */
.admin-section { margin-bottom: 26px; }
table.admin-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.admin-table th, table.admin-table td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--ice-2); font-size: 0.9rem;
}
table.admin-table th { color: #6f7d9a; font-weight: 600; }

.empty-state { text-align: center; color: #9aa7c2; padding: 24px 10px; }
.empty-state .mascot-mini { width: 60px; opacity: 0.6; }

footer.app-footer {
  text-align: center;
  color: #9aa7c2;
  font-size: 0.8rem;
  margin-top: 30px;
}

@media (max-width: 640px) {
  .app-header { flex-direction: column; gap: 12px; padding: 16px; }
  nav.tabs { flex-wrap: wrap; justify-content: center; }
}
