/* ===========================
   Kids Points App — Shared CSS
   Dark Theme · Mobile-First · RTL
   =========================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
  --bg: #0b1220;
  --card: #111b2e;
  --card2: #0f172a;
  --text: #e8edf6;
  --muted: #8b99b5;
  --line: rgba(255,255,255,.10);
  --brand: #17b57f;
  --brand2: #1c8cff;
  --danger: #ff4d4d;
  --warn: #ffb020;
  --ok: #22c55e;
  --shadow: 0 10px 25px rgba(0,0,0,.35);
  --radius: 18px;
  --radius2: 14px;
  --tap: 52px;
  --navH: 72px;
  --safeBottom: env(safe-area-inset-bottom, 0px);
  --safeTop: env(safe-area-inset-top, 0px);
  --font: "Cairo", system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(28,140,255,.20), transparent 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(23,181,127,.16), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: var(--font); }

/* ---- Login Page ---- */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 440px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,27,46,.95), rgba(15,23,42,.95));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.login-hero {
  padding: 32px 24px 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(23,181,127,.12), rgba(28,140,255,.10));
  border-bottom: 1px solid var(--line);
}
.login-hero .logo { font-size: 48px; margin-bottom: 8px; }
.login-hero h1 { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.login-hero p { font-size: 13px; color: var(--muted); }
.login-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.login-tab {
  flex: 1;
  height: 52px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  border-bottom: 3px solid transparent;
}
.login-tab.active {
  color: var(--text);
  border-bottom-color: var(--brand);
  background: rgba(23,181,127,.06);
}
.login-body { padding: 20px 24px 24px; }
.login-panel { display: none; }
.login-panel.active { display: block; }

/* ---- App Shell ---- */
.app-page { display: none; }
.app-page.active { display: block; }
.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 14px 0;
  padding-top: calc(14px + var(--safeTop));
  padding-bottom: calc(var(--navH) + var(--safeBottom) + 14px);
}
header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(11,18,32,.90), rgba(11,18,32,.65));
  border-bottom: 1px solid var(--line);
}
.headerInner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 14px 10px;
  padding-top: calc(12px + var(--safeTop));
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.title h1 { font-size: 16px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Pill ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0,0,0,.20);
  user-select: none;
  font-size: 13px;
}
.pill strong { font-weight: 800; }
.pill small { color: var(--muted); font-size: 11px; }

/* ---- Buttons ---- */
.btn {
  height: var(--tap);
  padding: 0 16px;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, rgba(23,181,127,.90), rgba(28,140,255,.50));
  border-color: rgba(23,181,127,.45);
}
.btn.danger {
  background: rgba(255,77,77,.12);
  border-color: rgba(255,77,77,.30);
  color: #ffd1d1;
}
.btn.success {
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.35);
  color: #b9ffd4;
}
.btn.ghost { background: transparent; }
.btn.small { height: 42px; border-radius: 12px; font-size: 12px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }

/* ---- Grid ---- */
.grid { display: grid; gap: 12px; }
@media(min-width: 700px) {
  .cols2 { grid-template-columns: 1fr 1fr; }
  .cols3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---- Card ---- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  overflow: hidden;
}
.card.flat { background: rgba(255,255,255,.03); box-shadow: none; }
.cardHeader { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cardTitle { display: flex; align-items: center; gap: 10px; min-width: 0; }
.badge {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  flex: 0 0 auto;
}
.cardTitle h3 { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cardTitle p { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- KPI ---- */
.kpiRow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.kpi {
  flex: 1 1 120px;
  border-radius: var(--radius2);
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.12);
  min-width: 110px;
}
.kpi .label { font-size: 11px; color: var(--muted); }
.kpi .val { font-size: 18px; font-weight: 900; margin-top: 2px; }
.kpi .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---- Form ---- */
.input, select, textarea {
  width: 100%;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  height: var(--tap);
  padding: 0 14px;
  outline: none;
  font-size: 14px;
  transition: border-color .2s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b99b5' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}
select option { background: #111b2e; color: var(--text); }
.input::placeholder { color: var(--muted); opacity: .6; }
.input:focus, select:focus, textarea:focus { border-color: rgba(23,181,127,.5); box-shadow: 0 0 0 3px rgba(23,181,127,.12); }
textarea { height: 100px; padding: 10px 14px; resize: vertical; }
.field { display: grid; gap: 6px; margin: 10px 0; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---- Chips ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.chip:active { transform: scale(.97); }
.chip.on { background: rgba(23,181,127,.16); border-color: rgba(23,181,127,.40); }
.chip.bad { background: rgba(255,77,77,.10); border-color: rgba(255,77,77,.30); }

/* ---- Tabs ---- */
.tabRow { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.tabBtn {
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.tabBtn.on { color: var(--text); background: rgba(23,181,127,.14); border-color: rgba(23,181,127,.35); }

/* ---- Bottom Navigation ---- */
.bottomNav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: rgba(8,12,22,.82);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safeBottom);
}
.bottomNavInner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 4px;
  padding: 8px 10px 10px;
}
.navBtn {
  height: 56px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font);
  font-weight: 800;
  position: relative;
  transition: all .15s;
}
.navBtn:active { transform: scale(.97); }
.navBtn .ico { font-size: 18px; }
.navBtn .txt { font-size: 11px; }
.navBtn.active {
  background: rgba(255,255,255,.06);
  border-color: rgba(23,181,127,.30);
  color: var(--text);
}
.navBtn .notif-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 8px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
  animation: pop .3s ease;
}
@keyframes pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Nav grid columns based on count */
.nav5 { grid-template-columns: repeat(5, 1fr); }
.nav4 { grid-template-columns: repeat(4, 1fr); }
.nav6 { grid-template-columns: repeat(6, 1fr); }

/* ---- Status Badges ---- */
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.status.pending { background: rgba(255,176,32,.14); color: #ffe0a3; border: 1px solid rgba(255,176,32,.30); }
.status.approved { background: rgba(34,197,94,.14); color: #b9ffd4; border: 1px solid rgba(34,197,94,.30); }
.status.rejected { background: rgba(255,77,77,.12); color: #ffd1d1; border: 1px solid rgba(255,77,77,.25); }

/* ---- Bars (Charts) ---- */
.barWrap { display: grid; gap: 8px; }
.bar {
  display: grid;
  grid-template-columns: 100px 1fr 50px;
  gap: 10px;
  align-items: center;
}
.bar .name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.bar .fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(23,181,127,.90), rgba(28,140,255,.70));
  transition: width .4s ease;
}
.bar .fill.bad { background: linear-gradient(90deg, rgba(255,77,77,.80), rgba(255,176,32,.60)); }
.bar .val { font-size: 12px; color: var(--muted); text-align: left; font-weight: 700; }

/* ---- Task Grid (Picker) ---- */
.taskGrid { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.taskBtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  background: rgba(255,255,255,.03);
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.1, 0.5, 0.1, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
}
.taskBtn:active { transform: scale(.98); }
.taskBtn.on {
  border-color: rgba(23,181,127,.5);
  background: rgba(23,181,127,0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(23,181,127,0.15);
}
.taskBtn .tName {
  font-weight: 800;
  font-size: 15px;
  flex: 1;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 12px;
}
.taskBtn .tMeta {
  font-size: 13px;
  color: var(--brand);
  font-weight: 900;
  background: rgba(255,255,255,.05);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.taskBtn.on .tMeta {
  background: var(--brand);
  color: #fff;
}
.taskBtn.disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.check-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  transition: 0.2s;
  flex-shrink: 0;
  background: rgba(0,0,0,0.1);
}
.check-circle.on {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

/* ---- Approval Card ---- */
.approve-card {
  border-radius: var(--radius);
  border: 1px solid rgba(255,176,32,.25);
  background: rgba(255,176,32,.04);
  padding: 14px;
  margin-bottom: 10px;
}
.approve-card .child-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.06);
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.approve-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---- Misc ---- */
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.mini { font-size: 12px; color: var(--muted); }
.okText { color: #b9ffd4; }
.dangerText { color: #ffb3b3; }
.warnText { color: #ffe0a3; }
.list { display: grid; gap: 8px; }
.family-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: rgba(23,181,127,.08);
  border: 2px dashed rgba(23,181,127,.30);
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  user-select: all;
  direction: ltr;
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ---- Modal ---- */
.modalBack {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 16px;
  padding-bottom: calc(16px + var(--safeBottom));
}
.modalBack.show { display: flex; }
.modal {
  width: 100%;
  max-width: 700px;
  max-height: 85dvh;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,27,46,.98), rgba(15,23,42,.98));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modalHead {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modalHead h3 { font-size: 14px; font-weight: 800; }
.modalBody { padding: 14px; overflow-y: auto; flex: 1; }
.modalFoot {
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* ---- Toast ---- */
.toastWrap {
  position: fixed;
  left: 14px; right: 14px;
  bottom: calc(var(--navH) + var(--safeBottom) + 12px);
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: 500px;
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10,16,30,.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.toast.show { display: flex; }

/* ---- Section Views ---- */
section.view { display: none; padding: 12px 0 4px; }
section.view.active { display: block; }

/* ---- Responsive ---- */
@media(min-width: 700px) {
  .title h1 { font-size: 18px; }
  .bar { grid-template-columns: 130px 1fr 60px; }
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(23,181,127,0); }
  50% { box-shadow: 0 0 20px 4px rgba(23,181,127,.25); }
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.card { animation: fadeIn .35s ease both; }
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .10s; }
.card:nth-child(4) { animation-delay: .15s; }
.modal { animation: slideUp .3s ease; }
.btn.primary:hover:not(:disabled) { box-shadow: 0 4px 20px rgba(23,181,127,.35); }
.btn.danger:hover:not(:disabled) { box-shadow: 0 4px 20px rgba(255,77,77,.25); }
.navBtn.active { animation: glow 2s ease infinite; }
.pill { transition: all .3s ease; }
.approve-card { animation: fadeIn .3s ease both; }
.taskBtn:hover { border-color: rgba(23,181,127,.25); background: rgba(255,255,255,.07); }
.chip:hover { background: rgba(255,255,255,.08); }

/* ---- Timer Cards ---- */
.timer-card {
  border: 1px solid rgba(255,176,32,.25);
  background: rgba(255,176,32,.04);
  transition: all .3s ease;
}
.timer-card:hover {
  border-color: rgba(255,176,32,.40);
}
.timer-countdown {
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: center;
}

/* ---- Streak Badge ---- */
@keyframes fireGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(255,176,32,.4); }
  50% { text-shadow: 0 0 16px rgba(255,107,53,.6), 0 0 32px rgba(255,176,32,.3); }
}
.streak-fire {
  animation: fireGlow 2s ease infinite;
  display: inline-block;
}

/* ---- Cols3 Mobile ---- */
@media(max-width: 699px) {
  .cols3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Leaderboard ---- */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  transition: all .2s ease;
}
.leaderboard-row:first-child {
  border-color: rgba(255,215,0,.30);
  background: rgba(255,215,0,.06);
}
.leaderboard-row:hover {
  background: rgba(255,255,255,.06);
}

/* ---- PLEDGE MODAL ---- */
.pledge-container {
  text-align: center;
  padding: 8px 0;
}
.pledge-icon {
  font-size: 56px;
  margin-bottom: 8px;
  animation: pledgeBounce 1s ease;
}
@keyframes pledgeBounce {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  50% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.pledge-title {
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.pledge-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  border-radius: 999px;
  margin: 12px auto;
}
.pledge-text {
  text-align: right;
  line-height: 1.8;
  font-size: 14px;
}
.pledge-text p {
  margin-bottom: 12px;
  font-size: 15px;
}
.pledge-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.pledge-point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(23,181,127,.06);
  border: 1px solid rgba(23,181,127,.15);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
  animation: pledgeSlide 0.5s ease both;
}
.pledge-point:nth-child(2) { animation-delay: 0.1s; }
.pledge-point:nth-child(3) { animation-delay: 0.2s; }
@keyframes pledgeSlide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.pledge-check {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.pledge-warning {
  margin-top: 16px;
  padding: 14px;
  background: rgba(255,77,77,.06);
  border: 1px solid rgba(255,77,77,.20);
  border-radius: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: pledgeSlide 0.5s ease 0.3s both;
}
.pledge-warning-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.pledge-warning-text {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}

/* ---- CELEBRATION OVERLAY ---- */
.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: celebFadeIn 0.4s ease;
}
@keyframes celebFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.celebration-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  border-radius: 28px;
  padding: 32px 24px 28px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17,27,46,.97), rgba(11,18,32,.97));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 60px rgba(0,0,0,.50);
  animation: celebCardPop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.1);
}
@keyframes celebCardPop {
  0% { transform: scale(0.5) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.celebration-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, var(--glow-color, #17b57f) 0%, transparent 70%);
  opacity: 0.25;
  pointer-events: none;
  animation: celebGlowPulse 2s ease infinite;
}
@keyframes celebGlowPulse {
  0%, 100% { opacity: 0.20; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.35; transform: translateX(-50%) scale(1.1); }
}
.celebration-emoji {
  font-size: 72px;
  margin-bottom: 8px;
  animation: celebEmojiFloat 2s ease infinite;
  position: relative;
  z-index: 1;
}
@keyframes celebEmojiFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}
.celebration-title {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffd700, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}
.celebration-task-name {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.celebration-points {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 24px;
  background: linear-gradient(135deg, rgba(23,181,127,.16), rgba(28,140,255,.12));
  border: 1px solid rgba(23,181,127,.30);
  border-radius: 999px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
  animation: celebPointsPulse 1.5s ease infinite;
}
@keyframes celebPointsPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(23,181,127,0); }
  50% { box-shadow: 0 0 20px 4px rgba(23,181,127,.25); }
}
.celebration-points-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--brand);
}
.celebration-points-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}
.celebration-message {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  font-weight: 600;
  padding: 0 10px;
  position: relative;
  z-index: 1;
}
.celebration-stars {
  font-size: 20px;
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.celebration-stars span {
  animation: celebStarTwinkle 1s ease infinite;
}
.celebration-stars span:nth-child(1) { animation-delay: 0s; }
.celebration-stars span:nth-child(2) { animation-delay: 0.2s; }
.celebration-stars span:nth-child(3) { animation-delay: 0.4s; }
.celebration-stars span:nth-child(4) { animation-delay: 0.6s; }
.celebration-stars span:nth-child(5) { animation-delay: 0.8s; }
@keyframes celebStarTwinkle {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* ---- LIGHT THEME OVERRIDES ---- */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(0,0,0,.06);
  --shadow: 0 5px 15px rgba(0,0,0,.03);
}
:root[data-theme="light"] body { background: var(--bg); color: var(--text); }
:root[data-theme="light"] .card, 
:root[data-theme="light"] .login-box,
:root[data-theme="light"] .modal { background: #fff; box-shadow: var(--shadow); border-color: var(--line); }
:root[data-theme="light"] header { background: rgba(255,255,255,.9); }
:root[data-theme="light"] .bottomNav { background: rgba(255,255,255,.95); }
:root[data-theme="light"] .btn, 
:root[data-theme="light"] .pill, 
:root[data-theme="light"] .tabBtn, 
:root[data-theme="light"] .taskBtn, 
:root[data-theme="light"] .chip,
:root[data-theme="light"] .card.flat,
:root[data-theme="light"] .approve-card,
:root[data-theme="light"] .kpi { background: #f1f5f9; border-color: var(--line); color: var(--text); }
:root[data-theme="light"] .input, 
:root[data-theme="light"] select, 
:root[data-theme="light"] textarea { background: #fff; color: var(--text); border-color: rgba(0,0,0,.15); }
:root[data-theme="light"] select option { background: #fff; color: var(--text); }
:root[data-theme="light"] .btn.primary { background: linear-gradient(135deg, rgba(23,181,127,.90), rgba(16,155,108,.90)); color:#fff; }
:root[data-theme="light"] .btn.danger { background: rgba(239,68,68,.1); color: #ef4444; border-color: rgba(239,68,68,.3); }
:root[data-theme="light"] .btn.success { background: rgba(34,197,94,.1); color: #16a34a; border-color: rgba(34,197,94,.3); }
:root[data-theme="light"] .navBtn.active { background: rgba(23,181,127,.08); color: #109b6c; border-color: rgba(23,181,127,.25); }
:root[data-theme="light"] .navBtn { color: var(--muted); }
:root[data-theme="light"] .login-hero { background: rgba(23,181,127,.04); border-bottom-color: var(--line); }
:root[data-theme="light"] .login-tab.active { background: #f8fafc; border-bottom-color: var(--brand); color: var(--text); }
:root[data-theme="light"] .family-code { background: #f0fdf4; border-color: #86efac; color: #166534; }
:root[data-theme="light"] .toast { background: #1e293b; color: #fff; border-color: #334155; }
:root[data-theme="light"] .taskBtn.on, 
:root[data-theme="light"] .tabBtn.on { background: rgba(23,181,127,.12); border-color: rgba(23,181,127,.4); color: #065f46; }
:root[data-theme="light"] .status.pending { background: #fef9c3; color: #854d0e; border-color: #fde047; }
:root[data-theme="light"] .status.approved { background: #dcfce7; color: #166534; border-color: #86efac; }
:root[data-theme="light"] .status.rejected { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
:root[data-theme="light"] .bar .track { background: #e2e8f0; border-color:#cbd5e1; }
:root[data-theme="light"] .bar .val { color: var(--text); }
:root[data-theme="light"] .dangerText { color: #ef4444; }
:root[data-theme="light"] .okText { color: #10b981; }
:root[data-theme="light"] .warnText { color: #f59e0b; }
:root[data-theme="light"] .taskBtn { background: #fff; }
:root[data-theme="light"] .taskBtn:hover:not(.on) { background: #f8fafc; border-color: rgba(0,0,0,.08); }
:root[data-theme="light"] .taskBtn .tMeta { background: rgba(0,0,0,.05); color: #065f46; }
:root[data-theme="light"] .taskBtn.on .tMeta { background: var(--brand); color: #fff; }
:root[data-theme="light"] .check-circle { border-color: rgba(0,0,0,.15); background: #f8fafc; }
:root[data-theme="light"] .btn.primary:hover:not(:disabled) { box-shadow: 0 4px 15px rgba(23,181,127,.25); }
:root[data-theme="light"] .celebration-card { background: linear-gradient(180deg, #fff, #f8fafc); border-color: rgba(0,0,0,.08); }
:root[data-theme="light"] .pledge-point { background: rgba(23,181,127,.06); border-color: rgba(23,181,127,.15); }
:root[data-theme="light"] .pledge-warning { background: rgba(239,68,68,.05); border-color: rgba(239,68,68,.15); }

/* ---- LEVEL BADGE ---- */
.level-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  position: relative;
  overflow: hidden;
}
.level-badge::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--level-color, #17b57f) 0%, transparent 70%);
  opacity: 0.12;
  pointer-events: none;
}
.level-badge .level-icon {
  font-size: 36px;
  flex-shrink: 0;
  animation: levelFloat 3s ease infinite;
  position: relative;
  z-index: 1;
}
@keyframes levelFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.05); }
}
.level-badge .level-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.level-badge .level-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--level-color, var(--brand));
}
.level-badge .level-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.level-badge-sm {
  padding: 8px 12px;
  border-radius: 12px;
  gap: 8px;
}
.level-badge-sm .level-icon { font-size: 20px; }
.level-badge-sm .level-title { font-size: 13px; }
.level-progress-wrap {
  width: 100%;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}
.level-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.level-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--level-color, #17b57f), var(--brand2));
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.level-progress-text {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  text-align: left;
  direction: rtl;
}

/* ---- DAILY GOAL ---- */
.daily-goal-card {
  text-align: center;
  padding: 16px;
}
.daily-goal-ring {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
}
.daily-goal-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.daily-goal-ring .ring-bg {
  fill: none;
  stroke: rgba(255,255,255,.08);
  stroke-width: 8;
}
.daily-goal-ring .ring-fill {
  fill: none;
  stroke: var(--brand);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.daily-goal-ring .ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.daily-goal-ring .ring-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--brand);
}
.daily-goal-ring .ring-label {
  font-size: 11px;
  color: var(--muted);
}
.daily-goal-complete {
  animation: goalComplete 0.6s ease;
}
@keyframes goalComplete {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.daily-goal-ring.complete .ring-fill { stroke: #ffd700; }
.daily-goal-ring.complete .ring-value { color: #ffd700; }

/* ---- WEEKLY REPORT ---- */
.report-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.report-page {
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  color: #1a1a2e;
  font-size: 14px;
  direction: rtl;
  box-shadow: 0 20px 60px rgba(0,0,0,.40);
}
.report-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2px solid #e8e8e8;
  margin-bottom: 16px;
}
.report-header h2 {
  font-size: 18px;
  font-weight: 900;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.report-header p { font-size: 12px; color: #666; }
.report-section {
  margin-bottom: 16px;
}
.report-section h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.report-kpi {
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  background: #f8f9fa;
  border: 1px solid #e8e8e8;
}
.report-kpi .rk-val {
  font-size: 22px;
  font-weight: 900;
  color: #17b57f;
}
.report-kpi .rk-label { font-size: 11px; color: #888; }
.report-kpi.red .rk-val { color: #ef4444; }
.report-mini-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.report-mini-bar .rmb-name {
  width: 100px;
  font-size: 12px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-mini-bar .rmb-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e8e8e8;
  overflow: hidden;
}
.report-mini-bar .rmb-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #17b57f, #1c8cff);
}
.report-mini-bar .rmb-val {
  font-size: 12px;
  color: #666;
  width: 30px;
  text-align: left;
}
.report-footer {
  text-align: center;
  padding-top: 12px;
  border-top: 2px solid #e8e8e8;
  font-size: 11px;
  color: #999;
}
.report-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

/* ---- SOUND TOGGLE ---- */
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  transition: all .15s;
}
.sound-toggle:hover { background: rgba(255,255,255,.08); }
.sound-toggle .sound-icon { font-size: 18px; }
.sound-toggle.off { opacity: 0.5; }

/* ---- Level-up Overlay ---- */
.levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: celebFadeIn 0.3s ease;
}
.levelup-card {
  text-align: center;
  max-width: 350px;
  width: 100%;
  padding: 32px 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(17,27,46,.97), rgba(11,18,32,.97));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 60px rgba(0,0,0,.50);
  animation: celebCardPop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.levelup-icon {
  font-size: 80px;
  margin-bottom: 12px;
  animation: celebEmojiFloat 2s ease infinite;
}
.levelup-title {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd700, #ff6b35, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.levelup-rank {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

/* Print Styles for Report */
@media print {
  body { background: white !important; }
  header, .bottomNav, .modalBack, .toastWrap, .report-actions { display: none !important; }
  .report-overlay { position: static; background: none !important; padding: 0 !important; }
  .report-page { box-shadow: none !important; border-radius: 0 !important; max-width: 100% !important; }
}

/* Light Theme additions for new components */
:root[data-theme="light"] .level-badge { background: #f8fafc; border-color: rgba(0,0,0,.06); }
:root[data-theme="light"] .level-progress-bar { background: #e2e8f0; border-color: #cbd5e1; }
:root[data-theme="light"] .daily-goal-ring .ring-bg { stroke: #e2e8f0; }
:root[data-theme="light"] .sound-toggle { background: #f1f5f9; border-color: rgba(0,0,0,.06); }
:root[data-theme="light"] .levelup-card { background: linear-gradient(180deg, #fff, #f8fafc); border-color: rgba(0,0,0,.08); }

/* ---- BEHAVIOR SECTION REDESIGN ---- */
.beh-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}
.beh-positive-label {
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.20);
  color: #22c55e;
}
.beh-negative-label {
  background: rgba(255,77,77,.08);
  border: 1px solid rgba(255,77,77,.20);
  color: #ff6b6b;
}
.beh-section-count {
  background: rgba(255,255,255,.10);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.beh-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media(min-width: 500px) {
  .beh-grid { grid-template-columns: 1fr 1fr; }
}
.beh-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  animation: fadeIn 0.3s ease both;
}
.beh-card:hover {
  background: rgba(255,255,255,.06);
}
.beh-card:active {
  transform: scale(.98);
}
.beh-card.positive {
  border-color: rgba(34,197,94,.15);
}
.beh-card.positive:hover {
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.06);
}
.beh-card.negative {
  border-color: rgba(255,77,77,.15);
}
.beh-card.negative:hover {
  border-color: rgba(255,77,77,.35);
  background: rgba(255,77,77,.06);
}
.beh-card.selected {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.20);
}
.beh-card.selected.positive {
  border-color: rgba(34,197,94,.50);
  background: rgba(34,197,94,.10);
}
.beh-card.selected.negative {
  border-color: rgba(255,77,77,.50);
  background: rgba(255,77,77,.10);
}
.beh-card .beh-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.beh-card.positive .beh-icon {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.25);
}
.beh-card.negative .beh-icon {
  background: rgba(255,77,77,.12);
  border: 1px solid rgba(255,77,77,.25);
}
.beh-card .beh-info {
  flex: 1;
  min-width: 0;
}
.beh-card .beh-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.beh-card .beh-pts {
  font-size: 12px;
  font-weight: 900;
  margin-top: 2px;
}
.beh-card.positive .beh-pts { color: #22c55e; }
.beh-card.negative .beh-pts { color: #ff6b6b; }
.beh-card .beh-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  transition: 0.2s;
  flex-shrink: 0;
}
.beh-card.selected .beh-check {
  color: white;
  font-size: 12px;
}
.beh-card.selected.positive .beh-check {
  background: #22c55e;
  border-color: #22c55e;
}
.beh-card.selected.negative .beh-check {
  background: #ff4d4d;
  border-color: #ff4d4d;
}

/* Preview Card */
.beh-preview {
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}
.beh-preview.pos {
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(34,197,94,.04));
  border: 1px solid rgba(34,197,94,.25);
}
.beh-preview.neg {
  background: linear-gradient(135deg, rgba(255,77,77,.08), rgba(255,77,77,.04));
  border: 1px solid rgba(255,77,77,.25);
}
.beh-preview .bp-icon {
  font-size: 28px;
}
.beh-preview .bp-info {
  flex: 1;
}
.beh-preview .bp-name {
  font-size: 14px;
  font-weight: 800;
}
.beh-preview .bp-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.beh-preview .bp-pts {
  font-size: 20px;
  font-weight: 900;
}
.beh-preview.pos .bp-pts { color: #22c55e; }
.beh-preview.neg .bp-pts { color: #ff4d4d; }

/* Light Theme for behaviors */
:root[data-theme="light"] .beh-card { background: #fff; }
:root[data-theme="light"] .beh-card:hover { background: #f8fafc; }
:root[data-theme="light"] .beh-card.selected.positive { background: rgba(34,197,94,.06); }
:root[data-theme="light"] .beh-card.selected.negative { background: rgba(255,77,77,.06); }
:root[data-theme="light"] .beh-positive-label { background: rgba(34,197,94,.06); color: #16a34a; }
:root[data-theme="light"] .beh-negative-label { background: rgba(255,77,77,.06); color: #ef4444; }
:root[data-theme="light"] .beh-section-count { background: rgba(0,0,0,.05); }
:root[data-theme="light"] .beh-preview.pos { background: rgba(34,197,94,.04); }
:root[data-theme="light"] .beh-preview.neg { background: rgba(255,77,77,.04); }

/* ---- Category Badge ---- */
.beh-cat-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,.08);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
  margin-right: 4px;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,.06);
}
:root[data-theme="light"] .beh-cat-badge {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.06);
  color: #64748b;
}

/* ---- FREE BEHAVIOR SECTION ---- */
.free-beh-section {
  margin: 8px 0;
  border-radius: 16px;
  border: 1px solid rgba(28,140,255,.20);
  background: linear-gradient(135deg, rgba(28,140,255,.04), rgba(139,92,246,.03));
  overflow: hidden;
  transition: all .3s ease;
}
.free-beh-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font);
  transition: all .2s;
}
.free-beh-toggle:hover {
  background: rgba(28,140,255,.06);
}
.free-beh-toggle-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.free-beh-toggle-icon {
  font-size: 22px;
}
.free-beh-toggle strong {
  font-size: 14px;
  font-weight: 800;
  display: block;
}
.free-beh-toggle .mini {
  font-size: 11px;
  margin-top: 2px;
}
.free-beh-arrow {
  font-size: 14px;
  color: var(--muted);
  transition: transform .3s ease;
}
.free-beh-form {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(28,140,255,.12);
  animation: fadeIn .3s ease;
}
.free-beh-preview {
  padding: 12px 14px;
  border-radius: 14px;
  margin: 10px 0;
  transition: all .3s ease;
  animation: fadeIn .2s ease;
}
.free-beh-preview.pos {
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(34,197,94,.03));
  border: 1px solid rgba(34,197,94,.20);
}
.free-beh-preview.neg {
  background: linear-gradient(135deg, rgba(255,77,77,.08), rgba(255,77,77,.03));
  border: 1px solid rgba(255,77,77,.20);
}

/* Light theme */
:root[data-theme="light"] .free-beh-section {
  background: linear-gradient(135deg, rgba(28,140,255,.03), rgba(139,92,246,.02));
  border-color: rgba(28,140,255,.15);
}
:root[data-theme="light"] .free-beh-toggle:hover {
  background: rgba(28,140,255,.04);
}
:root[data-theme="light"] .free-beh-form {
  border-top-color: rgba(28,140,255,.08);
}
:root[data-theme="light"] .free-beh-preview.pos {
  background: rgba(34,197,94,.04);
  border-color: rgba(34,197,94,.15);
}
:root[data-theme="light"] .free-beh-preview.neg {
  background: rgba(255,77,77,.04);
  border-color: rgba(255,77,77,.15);
}

/* ============================================================
   CHILD LEADERBOARD
   ============================================================ */

/* --- Podium --- */
.lb-podium-wrap {
  margin-bottom: 0;
}
.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 20px 10px 0;
}
.lb-podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  max-width: 140px;
  animation: podiumRise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.1) both;
}
.lb-podium-col:nth-child(1) { animation-delay: 0.2s; }
.lb-podium-col:nth-child(2) { animation-delay: 0s; }
.lb-podium-col:nth-child(3) { animation-delay: 0.3s; }
@keyframes podiumRise {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.lb-podium-col.lb-me {
  filter: drop-shadow(0 0 12px rgba(23,181,127,.30));
}
.lb-podium-medal {
  font-size: 28px;
  margin-bottom: 2px;
  animation: medalBounce 0.8s ease 0.5s both;
}
@keyframes medalBounce {
  0% { transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
.lb-podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.06);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.lb-podium-col:first-child .lb-podium-avatar,
.lb-podium-col:nth-child(2) .lb-podium-avatar {
  width: 64px;
  height: 64px;
}
.lb-podium-icon {
  font-size: 28px;
}
.lb-podium-name {
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.lb-podium-rank-badge {
  font-size: 11px;
  font-weight: 800;
}
.lb-podium-pts {
  font-size: 12px;
  font-weight: 900;
  color: var(--brand);
  margin-bottom: 4px;
}
.lb-podium-base {
  width: 100%;
  border-radius: 14px 14px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
  position: relative;
}
.lb-podium-base-rank {
  font-size: 24px;
  font-weight: 900;
  color: var(--muted);
  opacity: .3;
}

/* --- Me Tag --- */
.lb-me-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(23,181,127,.20), rgba(28,140,255,.15));
  border: 1px solid rgba(23,181,127,.30);
  color: var(--brand);
  padding: 1px 8px;
  border-radius: 999px;
  vertical-align: middle;
  margin-right: 4px;
}

/* --- Rank Card --- */
.lb-rank-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  transition: all .25s ease;
  animation: fadeIn .35s ease both;
}
.lb-rank-card.lb-me {
  border-color: rgba(23,181,127,.35);
  background: linear-gradient(135deg, rgba(23,181,127,.08), rgba(28,140,255,.05));
  box-shadow: 0 0 16px rgba(23,181,127,.12);
}
.lb-rank-pos {
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.lb-rank-num {
  font-size: 20px;
  font-weight: 900;
  color: var(--muted);
}
.lb-rank-card:nth-child(1) .lb-rank-num { color: #ffd700; }
.lb-rank-card:nth-child(2) .lb-rank-num { color: #c0c0c0; }
.lb-rank-card:nth-child(3) .lb-rank-num { color: #cd7f32; }
.lb-rank-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.lb-rank-info {
  flex: 1;
  min-width: 0;
}
.lb-rank-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-rank-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
  flex-wrap: wrap;
}
.lb-streak, .lb-today {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 800;
}
.lb-streak { color: var(--warn); }
.lb-today { color: var(--ok); }
.lb-rank-pts {
  text-align: center;
  flex-shrink: 0;
  min-width: 50px;
}
.lb-rank-pts-val {
  font-size: 18px;
  font-weight: 900;
  color: var(--brand);
}
.lb-rank-pts-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

/* --- Motivational Card --- */
.lb-motivate-card {
  overflow: hidden;
}
.lb-motivate-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
  position: relative;
}
.lb-motivate-inner::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--motive-color, var(--brand));
}
.lb-motivate-emoji {
  font-size: 40px;
  flex-shrink: 0;
  animation: pulse 2s ease infinite;
}
.lb-motivate-body {
  flex: 1;
  min-width: 0;
}
.lb-motivate-title {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 4px;
}
.lb-motivate-msg {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.lb-gap-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(23,181,127,.06);
  border: 1px solid rgba(23,181,127,.15);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

/* --- Weekly Stats --- */
.lb-week-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.lb-week-row:last-child { border-bottom: none; }
.lb-week-row.lb-me {
  background: rgba(23,181,127,.04);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 2px -10px;
}
.lb-week-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  min-width: 80px;
  flex-shrink: 0;
}
.lb-week-bar-wrap {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.05);
}
.lb-week-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: .8;
}
.lb-week-val {
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  min-width: 40px;
  text-align: left;
}

/* --- Light Theme --- */
:root[data-theme="light"] .lb-podium-base {
  background: rgba(0,0,0,.03) !important;
  border-color: rgba(0,0,0,.08);
}
:root[data-theme="light"] .lb-rank-card {
  background: #fff;
  border-color: rgba(0,0,0,.08);
}
:root[data-theme="light"] .lb-rank-card.lb-me {
  background: linear-gradient(135deg, rgba(23,181,127,.06), rgba(28,140,255,.03));
  border-color: rgba(23,181,127,.25);
  box-shadow: 0 0 12px rgba(23,181,127,.08);
}
:root[data-theme="light"] .lb-week-bar-wrap {
  background: rgba(0,0,0,.05);
  border-color: rgba(0,0,0,.04);
}
:root[data-theme="light"] .lb-week-row.lb-me {
  background: rgba(23,181,127,.04);
}
:root[data-theme="light"] .lb-gap-info {
  background: rgba(23,181,127,.04);
  border-color: rgba(23,181,127,.12);
}
:root[data-theme="light"] .lb-podium-avatar {
  background: #fff;
}
:root[data-theme="light"] .lb-me-tag {
  background: rgba(23,181,127,.10);
}

/* ============================================================
   OFFLINE INDICATOR
   ============================================================ */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font);
}
.offline-indicator.show {
  transform: translateY(0);
}
.offline-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  padding-top: calc(10px + var(--safeTop));
  background: linear-gradient(135deg, rgba(255,77,77,.12), rgba(255,176,32,.08));
  border-bottom: 1px solid rgba(255,77,77,.20);
  backdrop-filter: blur(14px);
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}
.offline-indicator:not(.offline) .offline-inner {
  background: linear-gradient(135deg, rgba(23,181,127,.10), rgba(28,140,255,.08));
  border-bottom-color: rgba(23,181,127,.20);
}
.offline-indicator.syncing .offline-inner {
  background: linear-gradient(135deg, rgba(255,176,32,.12), rgba(28,140,255,.08));
  border-bottom-color: rgba(255,176,32,.25);
}
.offline-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.offline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  animation: offlinePulse 2s ease infinite;
}
.offline-dot.red { background: var(--danger); animation: offlinePulse 2s ease infinite; }
.offline-dot.yellow { background: var(--warn); animation: offlineSpin 1s linear infinite; }
.offline-dot.green { background: var(--ok); animation: none; }
@keyframes offlinePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,77,77,.50); }
  50% { opacity: .7; box-shadow: 0 0 0 5px rgba(255,77,77,0); }
}
@keyframes offlineSpin {
  0% { box-shadow: 0 0 0 0 rgba(255,176,32,.50); }
  50% { box-shadow: 0 0 0 4px rgba(255,176,32,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,176,32,.50); }
}
.offline-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.offline-queue-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.offline-queue-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 0 5px;
}
.offline-indicator:not(.offline) .offline-queue-count {
  background: var(--warn);
}
.offline-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(23,181,127,.35);
  background: rgba(23,181,127,.14);
  color: #b9ffd4;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  transition: all .15s;
}
.offline-sync-btn:hover {
  background: rgba(23,181,127,.25);
}
.offline-sync-btn:active {
  transform: scale(.95);
}
.sync-icon {
  font-size: 14px;
  display: inline-block;
}
.offline-indicator.syncing .sync-icon {
  animation: spinSync 1s linear infinite;
}
@keyframes spinSync {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Queue list (expandable) */
.offline-queue-list {
  max-height: 0;
  overflow: hidden;
  background: rgba(11,18,32,.95);
  border-bottom: 1px solid var(--line);
  transition: max-height 0.35s ease;
}
.offline-indicator.expanded .offline-queue-list {
  max-height: 360px;
  overflow-y: auto;
}
.oq-empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.oq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  animation: fadeIn .2s ease both;
}
.oq-item:last-child { border-bottom: none; }
.oq-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.oq-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.oq-info {
  flex: 1;
  min-width: 0;
}
.oq-name {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oq-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.oq-del {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,77,77,.25);
  background: rgba(255,77,77,.08);
  color: #ffa3a3;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  flex-shrink: 0;
  transition: all .15s;
}
.oq-del:hover {
  background: rgba(255,77,77,.20);
}

/* Light theme overrides for offline */
:root[data-theme="light"] .offline-inner {
  background: linear-gradient(135deg, rgba(255,77,77,.08), rgba(255,176,32,.05));
  border-bottom-color: rgba(255,77,77,.15);
}
:root[data-theme="light"] .offline-indicator:not(.offline) .offline-inner {
  background: linear-gradient(135deg, rgba(23,181,127,.06), rgba(28,140,255,.04));
  border-bottom-color: rgba(23,181,127,.15);
}
:root[data-theme="light"] .offline-text {
  color: #333;
}
:root[data-theme="light"] .offline-queue-list {
  background: rgba(255,255,255,.97);
}
:root[data-theme="light"] .oq-name {
  color: #333;
}
:root[data-theme="light"] .oq-item {
  border-bottom-color: rgba(0,0,0,.06);
}
:root[data-theme="light"] .offline-sync-btn {
  background: rgba(23,181,127,.10);
  color: #059669;
  border-color: rgba(23,181,127,.25);
}

/* ============================================
   PHOTO ATTACHMENT & LIGHTBOX
   ============================================ */

/* ---- Attach Button ---- */
.photo-attach-section {
  margin: 10px 0;
}
.photo-attach-btn {
  height: 44px;
  width: 100%;
  border-radius: 14px;
  border: 2px dashed rgba(23,181,127,.30);
  background: rgba(23,181,127,.04);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .25s ease;
}
.photo-attach-btn:hover {
  border-color: rgba(23,181,127,.50);
  background: rgba(23,181,127,.08);
}
.photo-attach-btn:active {
  transform: scale(.98);
}
.photo-attach-btn.attached {
  border-style: solid;
  border-color: rgba(34,197,94,.40);
  background: rgba(34,197,94,.08);
  color: #22c55e;
}
.photo-attach-icon {
  font-size: 18px;
}

/* ---- Photo Preview (Child) ---- */
.photo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(23,181,127,.25);
  background: rgba(23,181,127,.04);
  position: relative;
  animation: fadeIn .3s ease;
}
.photo-preview-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.10);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.photo-remove-btn {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,77,77,.30);
  background: rgba(255,77,77,.20);
  color: #ffb3b3;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.photo-remove-btn:hover {
  background: rgba(255,77,77,.40);
  color: #fff;
}

/* ---- Photo in Approval Card (Parent) ---- */
.approve-photo-section {
  margin-top: 10px;
}
.photo-view-btn {
  width: 100%;
  border: 1px solid rgba(23,181,127,.25) !important;
  background: rgba(23,181,127,.06) !important;
  color: var(--brand) !important;
  gap: 6px;
  transition: all .2s;
}
.photo-view-btn:hover {
  background: rgba(23,181,127,.12) !important;
  border-color: rgba(23,181,127,.40) !important;
}
.approve-photo-container {
  margin-top: 8px;
  animation: fadeIn .3s ease;
}
.approve-photo-loading {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}
.approve-photo-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 16px rgba(0,0,0,.30);
}
.approve-photo-img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,.40);
}

/* ---- Photo Lightbox ---- */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: celebFadeIn .3s ease;
}
.photo-lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  animation: slideUp .3s ease;
}
.photo-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.50);
}
.photo-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.70);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all .2s;
}
.photo-lightbox-close:hover {
  background: rgba(255,77,77,.50);
  border-color: rgba(255,77,77,.50);
}

/* ---- Light Theme Photo Overrides ---- */
:root[data-theme="light"] .photo-attach-btn {
  background: rgba(23,181,127,.06);
  border-color: rgba(23,181,127,.25);
  color: #059669;
}
:root[data-theme="light"] .photo-attach-btn.attached {
  background: rgba(34,197,94,.08);
  border-color: rgba(34,197,94,.30);
  color: #16a34a;
}
:root[data-theme="light"] .photo-preview-wrap {
  background: rgba(23,181,127,.04);
  border-color: rgba(23,181,127,.20);
}
:root[data-theme="light"] .photo-preview-img {
  border-color: rgba(0,0,0,.10);
}
:root[data-theme="light"] .photo-remove-btn {
  background: rgba(255,77,77,.10);
  color: #ef4444;
  border-color: rgba(255,77,77,.25);
}
:root[data-theme="light"] .approve-photo-img {
  border-color: rgba(0,0,0,.10);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
:root[data-theme="light"] .photo-view-btn {
  background: rgba(23,181,127,.06) !important;
  color: #059669 !important;
}

/* ---- REJECTION REASON MODAL ---- */
.rejection-modal {
  padding: 4px 0;
}
.rejection-reasons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media(max-width: 500px) {
  .rejection-reasons-grid {
    grid-template-columns: 1fr;
  }
}
.rejection-reason-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  transition: all .2s ease;
  user-select: none;
}
.rejection-reason-btn:hover {
  background: rgba(255,77,77,.06);
  border-color: rgba(255,77,77,.25);
}
.rejection-reason-btn:active {
  transform: scale(.97);
}
.rejection-reason-btn.selected {
  background: rgba(255,77,77,.12);
  border-color: rgba(255,77,77,.45);
  box-shadow: 0 0 0 2px rgba(255,77,77,.15);
}
.rejection-reason-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.rejection-reason-text {
  flex: 1;
  line-height: 1.4;
}

/* ---- REJECTION REASON DISPLAY (Child Side) ---- */
.rejection-reason-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255,77,77,.08);
  border: 1px solid rgba(255,77,77,.20);
  font-size: 12px;
  font-weight: 700;
  color: #ffb3b3;
  line-height: 1.5;
  animation: fadeIn .3s ease;
}
.rejection-reason-icon-small {
  font-size: 16px;
  flex-shrink: 0;
}

/* Light Theme overrides for rejection */
:root[data-theme="light"] .rejection-reason-btn {
  background: #fff;
  border-color: #e0e0e0;
  color: #333;
}
:root[data-theme="light"] .rejection-reason-btn:hover {
  background: rgba(255,77,77,.06);
  border-color: rgba(255,77,77,.35);
}
:root[data-theme="light"] .rejection-reason-btn.selected {
  background: rgba(255,77,77,.10);
  border-color: rgba(255,77,77,.50);
  box-shadow: 0 0 0 2px rgba(255,77,77,.12);
}
:root[data-theme="light"] .rejection-reason-display {
  background: rgba(255,77,77,.06);
  border-color: rgba(255,77,77,.25);
  color: #c0392b;
}

/* ============================================================
   NOTIFICATION OVERLAYS (Rejection / Behavior / Reward)
   ============================================================ */

/* ---- Rejection Notification Card ---- */
.notif-rejection-card {
  border: 1px solid rgba(255,77,77,.25) !important;
  background: linear-gradient(170deg, rgba(255,77,77,.06), rgba(11,18,32,.98)) !important;
}
.notif-rejection-icon {
  font-size: 56px;
  margin-bottom: 8px;
  animation: pulse 2s ease infinite;
}
.notif-rejection-title {
  font-size: 22px;
  font-weight: 900;
  color: #ff6b6b;
  margin-bottom: 6px;
}
.notif-rejection-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  padding: 6px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 10px;
}
.notif-rejection-reason {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255,77,77,.10);
  border: 1px solid rgba(255,77,77,.25);
  color: #ffb3b3;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 14px;
  text-align: right;
}
.notif-rejection-reason span:first-child {
  font-size: 20px;
  flex-shrink: 0;
}
.notif-rejection-encourage {
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(23,181,127,.08), rgba(28,140,255,.06));
  border: 1px solid rgba(23,181,127,.18);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}
.notif-rejection-btn {
  background: rgba(255,77,77,.12) !important;
  border: 1px solid rgba(255,77,77,.30) !important;
  color: #ffb3b3 !important;
  transition: all .2s ease;
}
.notif-rejection-btn:hover {
  background: rgba(255,77,77,.20) !important;
}

/* ---- Behavior Negative Notification Card ---- */
.notif-beh-negative-card {
  border: 1px solid rgba(255,176,32,.25) !important;
  background: linear-gradient(170deg, rgba(255,176,32,.06), rgba(11,18,32,.98)) !important;
}

/* Behavior Note Display */
.notif-beh-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 4px;
  text-align: right;
}
.notif-beh-note span:first-child {
  font-size: 16px;
  flex-shrink: 0;
}

/* ---- Light Theme Overrides ---- */
:root[data-theme="light"] .notif-rejection-card {
  background: linear-gradient(170deg, rgba(255,77,77,.05), #fff) !important;
  border-color: rgba(255,77,77,.20) !important;
}
:root[data-theme="light"] .notif-rejection-name {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.06);
  color: #333;
}
:root[data-theme="light"] .notif-rejection-reason {
  background: rgba(255,77,77,.06);
  border-color: rgba(255,77,77,.20);
  color: #c0392b;
}
:root[data-theme="light"] .notif-rejection-encourage {
  background: linear-gradient(135deg, rgba(23,181,127,.05), rgba(28,140,255,.03));
  border-color: rgba(23,181,127,.12);
  color: #555;
}
:root[data-theme="light"] .notif-rejection-btn {
  background: rgba(255,77,77,.08) !important;
  border-color: rgba(255,77,77,.25) !important;
  color: #e74c3c !important;
}
:root[data-theme="light"] .notif-beh-negative-card {
  background: linear-gradient(170deg, rgba(255,176,32,.05), #fff) !important;
  border-color: rgba(255,176,32,.20) !important;
}
:root[data-theme="light"] .notif-beh-note {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.06);
  color: #555;
}

/* ============================================================
   ENHANCED BEHAVIOR CARDS (Child Dashboard)
   ============================================================ */

/* --- Behavior Card (List Item) --- */
.child-beh-card {
  border-radius: 16px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  animation: fadeIn .35s ease both;
  transition: all .3s ease;
}
.child-beh-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
  transition: opacity .3s;
}
.child-beh-card:hover::before {
  opacity: 0.14;
}

/* Positive Card */
.child-beh-card.positive {
  background: linear-gradient(145deg, rgba(34,197,94,.06), rgba(23,181,127,.03));
  border: 1px solid rgba(34,197,94,.20);
}
.child-beh-card.positive::before {
  background: radial-gradient(circle, #22c55e, transparent);
}
.child-beh-card.positive:hover {
  border-color: rgba(34,197,94,.40);
  box-shadow: 0 4px 20px rgba(34,197,94,.12);
}

/* Negative Card */
.child-beh-card.negative {
  background: linear-gradient(145deg, rgba(255,176,32,.06), rgba(255,77,77,.03));
  border: 1px solid rgba(255,176,32,.20);
}
.child-beh-card.negative::before {
  background: radial-gradient(circle, #ffb020, transparent);
}
.child-beh-card.negative:hover {
  border-color: rgba(255,176,32,.40);
  box-shadow: 0 4px 20px rgba(255,176,32,.10);
}

/* Card Header Row */
.child-beh-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.child-beh-emoji {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.child-beh-card.positive .child-beh-emoji {
  background: rgba(34,197,94,.14);
  border: 1px solid rgba(34,197,94,.25);
  animation: behEmojiGlow 3s ease infinite;
}
.child-beh-card.negative .child-beh-emoji {
  background: rgba(255,176,32,.14);
  border: 1px solid rgba(255,176,32,.25);
}
@keyframes behEmojiGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
  50% { box-shadow: 0 0 12px 2px rgba(34,197,94,.18); }
}
.child-beh-info {
  flex: 1;
  min-width: 0;
}
.child-beh-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.child-beh-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.child-beh-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}
.child-beh-card.positive .child-beh-points-badge {
  background: rgba(34,197,94,.14);
  border: 1px solid rgba(34,197,94,.25);
  color: #22c55e;
}
.child-beh-card.negative .child-beh-points-badge {
  background: rgba(255,77,77,.12);
  border: 1px solid rgba(255,77,77,.25);
  color: #ff6b6b;
}

/* Motivational / Advisory Message */
.child-beh-msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}
.child-beh-card.positive .child-beh-msg {
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(23,181,127,.04));
  border: 1px solid rgba(34,197,94,.15);
  color: #a7f3d0;
}
.child-beh-card.negative .child-beh-msg {
  background: linear-gradient(135deg, rgba(255,176,32,.08), rgba(255,107,53,.04));
  border: 1px solid rgba(255,176,32,.15);
  color: #fde68a;
}
.child-beh-msg-icon {
  display: inline;
  margin-left: 6px;
  font-size: 16px;
}
.child-beh-note-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.06);
}

/* Stagger animation for list */
.child-beh-card:nth-child(2) { animation-delay: .06s; }
.child-beh-card:nth-child(3) { animation-delay: .12s; }
.child-beh-card:nth-child(4) { animation-delay: .18s; }
.child-beh-card:nth-child(5) { animation-delay: .24s; }
.child-beh-card:nth-child(6) { animation-delay: .30s; }

/* Light Theme */
:root[data-theme="light"] .child-beh-card.positive {
  background: linear-gradient(145deg, rgba(34,197,94,.04), rgba(23,181,127,.02));
  border-color: rgba(34,197,94,.18);
}
:root[data-theme="light"] .child-beh-card.negative {
  background: linear-gradient(145deg, rgba(255,176,32,.04), rgba(255,77,77,.02));
  border-color: rgba(255,176,32,.18);
}
:root[data-theme="light"] .child-beh-card.positive .child-beh-msg {
  background: rgba(34,197,94,.06);
  border-color: rgba(34,197,94,.12);
  color: #166534;
}
:root[data-theme="light"] .child-beh-card.negative .child-beh-msg {
  background: rgba(255,176,32,.06);
  border-color: rgba(255,176,32,.12);
  color: #854d0e;
}
:root[data-theme="light"] .child-beh-card.positive .child-beh-points-badge {
  color: #16a34a;
}
:root[data-theme="light"] .child-beh-card.negative .child-beh-points-badge {
  color: #ef4444;
}

/* ============================================================
   ENHANCED REWARD CARDS (Child Dashboard)
   ============================================================ */
.child-reward-card {
  border-radius: 18px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all .3s ease;
  animation: fadeIn .35s ease both;
}
.child-reward-card::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 100px;
  background: radial-gradient(ellipse, rgba(255,176,32,.20), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

/* Affordable vs not */
.child-reward-card.can-afford {
  background: linear-gradient(160deg, rgba(255,215,0,.08), rgba(23,181,127,.04));
  border: 1px solid rgba(255,215,0,.25);
}
.child-reward-card.can-afford:hover {
  border-color: rgba(255,215,0,.50);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255,215,0,.15);
}
.child-reward-card.saving {
  background: linear-gradient(160deg, rgba(28,140,255,.06), rgba(139,92,246,.03));
  border: 1px solid rgba(28,140,255,.18);
}
.child-reward-card.saving:hover {
  border-color: rgba(28,140,255,.35);
}

/* Reward Emoji */
.child-reward-emoji {
  font-size: 36px;
  text-align: center;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.child-reward-card.can-afford .child-reward-emoji {
  animation: rewardBounce 2s ease infinite;
}
@keyframes rewardBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-6px) rotate(-5deg); }
  75% { transform: translateY(-3px) rotate(3deg); }
}

/* Reward Name */
.child-reward-name {
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

/* Cost Badge */
.child-reward-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.child-reward-cost span {
  color: var(--warn);
}

/* Progress Bar */
.child-reward-progress-wrap {
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.child-reward-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.child-reward-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.child-reward-card.can-afford .child-reward-progress-fill {
  background: linear-gradient(90deg, #ffd700, #ff6b35);
}
.child-reward-card.saving .child-reward-progress-fill {
  background: linear-gradient(90deg, var(--brand2), var(--brand));
}
.child-reward-progress-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 700;
}

/* Motivational Text */
.child-reward-motivation {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}
.child-reward-card.can-afford .child-reward-motivation {
  background: rgba(255,215,0,.10);
  border: 1px solid rgba(255,215,0,.18);
  color: #fde68a;
}
.child-reward-card.saving .child-reward-motivation {
  background: rgba(28,140,255,.08);
  border: 1px solid rgba(28,140,255,.15);
  color: #93c5fd;
}

/* Request Button */
.child-reward-btn {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .25s ease;
  position: relative;
  z-index: 1;
  font-family: var(--font);
}
.child-reward-btn:active { transform: scale(.97); }
.child-reward-card.can-afford .child-reward-btn {
  background: linear-gradient(135deg, #ffd700, #ff6b35);
  color: #1a1a2e;
  box-shadow: 0 4px 16px rgba(255,215,0,.25);
}
.child-reward-card.can-afford .child-reward-btn:hover {
  box-shadow: 0 6px 24px rgba(255,215,0,.40);
  transform: translateY(-1px);
}
.child-reward-card.saving .child-reward-btn {
  background: rgba(28,140,255,.12);
  border: 1px solid rgba(28,140,255,.25);
  color: #93c5fd;
  cursor: default;
}
.child-reward-card.saving .child-reward-btn:hover {
  transform: none;
}

/* Duration Badge */
.child-reward-duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255,255,255,.06);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  justify-content: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Achievement Badge for affordable */
.child-reward-achievable {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #ffd700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,215,0,.12);
  border: 1px solid rgba(255,215,0,.20);
  margin-bottom: 8px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  animation: achievablePulse 2s ease infinite;
}
@keyframes achievablePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0); }
  50% { box-shadow: 0 0 12px 2px rgba(255,215,0,.18); }
}

/* Stagger */
.child-reward-card:nth-child(2) { animation-delay: .08s; }
.child-reward-card:nth-child(3) { animation-delay: .16s; }
.child-reward-card:nth-child(4) { animation-delay: .24s; }

/* Light Theme */
:root[data-theme="light"] .child-reward-card.can-afford {
  background: linear-gradient(160deg, rgba(255,215,0,.06), rgba(23,181,127,.03));
  border-color: rgba(255,215,0,.22);
}
:root[data-theme="light"] .child-reward-card.saving {
  background: linear-gradient(160deg, rgba(28,140,255,.04), rgba(139,92,246,.02));
  border-color: rgba(28,140,255,.15);
}
:root[data-theme="light"] .child-reward-card.can-afford .child-reward-motivation {
  background: rgba(255,215,0,.08);
  border-color: rgba(255,215,0,.15);
  color: #854d0e;
}
:root[data-theme="light"] .child-reward-card.saving .child-reward-motivation {
  background: rgba(28,140,255,.05);
  border-color: rgba(28,140,255,.12);
  color: #1e40af;
}
:root[data-theme="light"] .child-reward-progress-bar {
  background: rgba(0,0,0,.06);
  border-color: rgba(0,0,0,.04);
}
:root[data-theme="light"] .child-reward-card.can-afford .child-reward-btn {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
}
:root[data-theme="light"] .child-reward-card.saving .child-reward-btn {
  background: rgba(28,140,255,.08);
  border-color: rgba(28,140,255,.18);
  color: #1d4ed8;
}
:root[data-theme="light"] .child-reward-achievable {
  background: rgba(255,215,0,.10);
  border-color: rgba(255,215,0,.18);
  color: #b45309;
}

/* ============================================================
   ENHANCED BEHAVIOR OVERLAY NOTIFICATIONS
   ============================================================ */

/* Positive Behavior Overlay */
.notif-beh-positive-card {
  border: 1px solid rgba(34,197,94,.25) !important;
  background: linear-gradient(170deg, rgba(34,197,94,.08), rgba(11,18,32,.98)) !important;
}

/* Advice section in negative behavior overlay */
.notif-beh-advice {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
  text-align: right;
}
.notif-beh-advice.positive-advice {
  background: linear-gradient(135deg, rgba(34,197,94,.10), rgba(23,181,127,.06));
  border: 1px solid rgba(34,197,94,.20);
  color: #a7f3d0;
}
.notif-beh-advice.negative-advice {
  background: linear-gradient(135deg, rgba(255,176,32,.10), rgba(255,107,53,.06));
  border: 1px solid rgba(255,176,32,.20);
  color: #fde68a;
}
.notif-beh-advice-title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-beh-advice.positive-advice .notif-beh-advice-title {
  color: #22c55e;
}
.notif-beh-advice.negative-advice .notif-beh-advice-title {
  color: #ffb020;
}

/* Enhanced Reward Approval Overlay */
.notif-reward-approved-card {
  border: 1px solid rgba(255,215,0,.30) !important;
  background: linear-gradient(170deg, rgba(255,215,0,.10), rgba(11,18,32,.98)) !important;
}
.notif-reward-deserve-msg {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,215,0,.08), rgba(23,181,127,.06));
  border: 1px solid rgba(255,215,0,.18);
  font-size: 13px;
  font-weight: 700;
  color: #fde68a;
  line-height: 1.7;
  text-align: center;
}

/* Light Theme Overlays */
:root[data-theme="light"] .notif-beh-positive-card {
  background: linear-gradient(170deg, rgba(34,197,94,.06), #fff) !important;
  border-color: rgba(34,197,94,.20) !important;
}
:root[data-theme="light"] .notif-beh-advice.positive-advice {
  background: rgba(34,197,94,.06);
  border-color: rgba(34,197,94,.15);
  color: #166534;
}
:root[data-theme="light"] .notif-beh-advice.negative-advice {
  background: rgba(255,176,32,.06);
  border-color: rgba(255,176,32,.15);
  color: #854d0e;
}
:root[data-theme="light"] .notif-reward-deserve-msg {
  background: rgba(255,215,0,.06);
  border-color: rgba(255,215,0,.15);
  color: #854d0e;
}

