/* ==========================================================================
   DesenvolviKids - Design System & Custom Styling (Multi-Perfil + Níveis)
   ========================================================================== */

:root {
  /* Pastel Color Palette */
  --primary: #7B2CBF;
  --primary-light: #CDB4DB;
  --primary-dark: #5A189A;
  --secondary: #FF85A1;
  --accent: #FEE440;
  --accent-green: #B9FBC0;
  --accent-blue: #A0C4FF;
  --accent-pink: #FFC6FF;
  --accent-coral: #FFADAD;
  --bg-gradient: linear-gradient(135deg, #F8F9FA 0%, #F0F4FF 100%);
  
  --surface: #FFFFFF;
  --surface-secondary: #F8F9FE;
  --text-main: #2B2D42;
  --text-muted: #6C757D;
  --text-light: #ADB5BD;
  
  --border-radius-sm: 14px;
  --border-radius-md: 22px;
  --border-radius-lg: 30px;
  
  --shadow-sm: 0 4px 15px rgba(123, 44, 191, 0.06);
  --shadow-md: 0 8px 25px rgba(123, 44, 191, 0.12);
  --shadow-lg: 0 16px 36px rgba(123, 44, 191, 0.18);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Nunito', 'Plus Jakarta Sans', -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Fredoka', cursive;
}

body {
  background: #1E1E2E;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Smartphone Device Wrapper */
.app-viewport-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 440px;
}

.device-frame {
  width: 100%;
  height: 850px;
  max-height: 92vh;
  background: #000;
  border-radius: 48px;
  padding: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 4px #2D2D3F;
  position: relative;
  overflow: hidden;
}

.device-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 26px;
  background: #000;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.device-notch .camera {
  width: 10px;
  height: 10px;
  background: #111;
  border-radius: 50%;
  border: 1px solid #222;
}

.device-notch .speaker {
  width: 40px;
  height: 4px;
  background: #1A1A1A;
  border-radius: 4px;
}

/* Inner Application Container */
.app-container {
  width: 100%;
  height: 100%;
  background: var(--bg-gradient);
  border-radius: 38px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Screen Navigation Transitions */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* Onboarding Screen */
#onboarding-screen {
  justify-content: flex-start;
  padding: 40px 20px 24px 20px;
  background: linear-gradient(160deg, #6C5CE7 0%, #a29bfe 100%);
  color: #FFF;
  overflow-y: auto;
}

.app-logo {
  text-align: center;
  margin-bottom: 20px;
}

.app-logo .logo-icon {
  font-size: 56px;
  display: inline-block;
  animation: bounce 2s infinite;
}

.app-logo h1 {
  font-family: 'Fredoka', cursive;
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
}

.app-logo p {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 2px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 2px solid #EFEBFD;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.card-form {
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
}

/* Onboarding em etapas (wizard) */
.onboarding-steps-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.onboarding-steps-dots .step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.25s ease;
}

.onboarding-steps-dots .step-dot.active {
  background: #FFF;
  width: 22px;
  border-radius: 5px;
}

.onboard-step {
  display: none;
}

.onboard-step.active {
  display: block;
  animation: popIn 0.3s var(--transition-bounce);
}

#onboard-step-0.onboard-step.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.onboard-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.onboard-nav-row .btn-primary {
  flex: 1;
}

.age-choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.age-choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius-md);
  background: var(--surface-secondary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s var(--transition-bounce);
}

.age-choice-btn .age-choice-icon {
  font-size: 26px;
}

.age-choice-btn .age-choice-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  flex: 1;
}

.age-choice-btn small {
  font-size: 10px;
  color: var(--text-muted);
}

.age-choice-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.interest-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.interest-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 2px solid #E2E8F0;
  background: var(--surface-secondary);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--transition-bounce);
}

.interest-chip.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #FFF;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #F8FAFC;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  background: #FFF;
}

.avatar-selector {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.avatar-option {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #E2E8F0;
  background: var(--surface-secondary);
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.avatar-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.15);
}

/* Main App Shell Header */
.app-header {
  padding: 44px 16px 14px 16px;
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  font-size: 28px;
  width: 44px;
  height: 44px;
  background: #F0EDFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.15);
}

.name-age-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-info h2 {
  font-family: 'Fredoka', cursive;
  font-size: 16px;
  color: var(--text-main);
}

.age-badge {
  font-size: 10px;
  font-weight: 800;
  background: #E2E8F0;
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 8px;
}

.level-xp-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-level {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
}

.xp-mini-bar {
  width: 90px;
  height: 5px;
  background: #EFEBFD;
  border-radius: 6px;
  overflow: hidden;
}

.xp-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #6C5CE7 0%, #00B894 100%);
  transition: width 0.3s ease;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coins-badge {
  background: linear-gradient(135deg, #FFF9E6 0%, #FFEAA7 100%);
  border: 2px solid #FDCB6E;
  border-radius: 20px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(253, 203, 110, 0.25);
  font-family: 'Fredoka', cursive;
  font-weight: 700;
  font-size: 14px;
  color: #D63031;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--surface-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.btn-icon:hover {
  transform: scale(1.08);
}

/* Tabs Content Container */
.tab-content {
  display: none;
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  padding-bottom: 90px;
}

.tab-content.active {
  display: block;
}

/* Progress Card */
.progress-card {
  background: var(--surface);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #EFEBFD;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00B894 0%, #55E6C1 100%);
  border-radius: 10px;
  transition: width 0.4s ease-out;
}

/* Shift Filter Tabs */
.shift-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.shift-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: var(--border-radius-sm);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.shift-tab.active {
  background: var(--primary);
  color: #FFF;
}

/* Tasks / Habits List */
.tasks-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  background: var(--surface);
  border-radius: var(--border-radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 6px solid var(--primary);
}

.task-card.completed {
  border-left-color: var(--accent-green);
  opacity: 0.75;
  background: #F8FAF8;
}

.task-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-icon {
  font-size: 26px;
  width: 42px;
  height: 42px;
  background: #F4F3F9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-details h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.task-card.completed .task-details h4 {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-reward-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #D63031;
  background: #FFF9E6;
  padding: 2px 6px;
  border-radius: 8px;
}

.btn-check {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #DFE6E9;
  background: #FFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: transparent;
  transition: all 0.3s var(--transition-bounce);
}

.task-card.completed .btn-check {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #FFF;
  transform: scale(1.08);
}

/* Store / Rewards Screen */
.store-banner {
  background: linear-gradient(135deg, #FDCB6E 0%, #E17055 100%);
  border-radius: var(--border-radius-md);
  padding: 16px;
  color: #FFF;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.store-banner h3 {
  font-family: 'Fredoka', cursive;
  font-size: 18px;
  margin-bottom: 4px;
}

.rewards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reward-card {
  background: var(--surface);
  border-radius: var(--border-radius-md);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.reward-icon {
  font-size: 36px;
  margin-bottom: 6px;
}

.reward-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.reward-cost {
  font-family: 'Fredoka', cursive;
  font-size: 14px;
  color: #D63031;
  margin-bottom: 10px;
}

/* Level & Badges Screen */
.level-banner {
  background: linear-gradient(135deg, #6C5CE7 0%, #0984E3 100%);
  border-radius: var(--border-radius-md);
  padding: 20px;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.level-badge-large {
  font-size: 48px;
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.level-details h3 {
  font-family: 'Fredoka', cursive;
  font-size: 18px;
  margin-bottom: 2px;
}

.level-details p {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.xp-bar-large {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  overflow: hidden;
}

.xp-fill-large {
  height: 100%;
  background: #FDCB6E;
  border-radius: 10px;
  transition: width 0.4s ease;
}

.section-title {
  font-family: 'Fredoka', cursive;
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 12px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.badge-item {
  background: var(--surface);
  border-radius: var(--border-radius-md);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  opacity: 0.5;
  filter: grayscale(1);
  transition: all 0.3s;
}

.badge-item.unlocked {
  opacity: 1;
  filter: none;
  border: 2px solid #FDCB6E;
}

.badge-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.badge-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

/* Child Switcher Box */
.child-switcher-box {
  background: #FFF9E6;
  border: 2px solid #FDCB6E;
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
}

.child-switcher-box label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #D63031;
  display: block;
  margin-bottom: 6px;
}

.switcher-row {
  display: flex;
  gap: 8px;
}

.switcher-row select {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #FDCB6E;
  font-weight: 700;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background: var(--surface);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #EFEBFD;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 10px;
  font-weight: 700;
  transition: color 0.2s;
}

.nav-icon {
  font-size: 20px;
}

.nav-item.active {
  color: var(--primary);
}

/* Buttons System */
.btn {
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: #FFF;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.3);
}

.btn-secondary {
  background: var(--surface-secondary);
  color: var(--text-main);
}

.btn-accent {
  background: var(--accent-green);
  color: #FFF;
}

.btn-danger {
  background: var(--secondary);
  color: #FFF;
}

.btn-outline {
  background: transparent;
  border: 2px solid #E2E8F0;
  color: var(--text-main);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 20px;
  font-size: 15px;
  border-radius: var(--border-radius-md);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 8px;
}

/* Modals System */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  width: 100%;
  max-width: 360px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s var(--transition-bounce);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--text-light);
  cursor: pointer;
}

/* PIN Keyboard Modal */
.pin-card {
  text-align: center;
}

.pin-header .pin-icon {
  font-size: 36px;
}

.pin-header h3 {
  font-family: 'Fredoka', cursive;
  margin-top: 6px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.pin-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--primary-light);
  background: transparent;
  transition: background 0.2s;
}

.pin-dots .dot.filled {
  background: var(--primary);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 220px;
  margin: 0 auto;
}

.key-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--surface-secondary);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.2s;
  justify-self: center;
}

.key-btn:active {
  background: var(--primary-light);
  color: #FFF;
}

.pin-error-msg {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  margin-top: 10px;
  min-height: 16px;
}

/* Dashboard dos Pais (Full Modal) */
.full-screen-modal {
  padding: 0;
  background: var(--surface);
  flex-direction: column;
}

.dashboard-header {
  padding: 40px 16px 14px 16px;
  background: var(--surface-secondary);
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-title h2 {
  font-family: 'Fredoka', cursive;
  font-size: 17px;
}

.dash-title p {
  font-size: 11px;
  color: var(--text-muted);
}

.dashboard-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.dash-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 2px solid #EFEBFD;
  padding-bottom: 6px;
}

.dash-tab {
  flex: 1;
  padding: 6px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.dash-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.dash-tab-content {
  display: none;
}

.dash-tab-content.active {
  display: block;
}

.dash-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-item {
  background: var(--surface-secondary);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Redeem Ticket Card */
.redeem-ticket-card {
  text-align: center;
  background: linear-gradient(135deg, #FFF9E6 0%, #FFF 100%);
  border: 3px dashed #FDCB6E;
}

.ticket-badge {
  background: #FDCB6E;
  color: #D63031;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}

.ticket-header h2 {
  font-family: 'Fredoka', cursive;
  margin-top: 8px;
  font-size: 20px;
}

.ticket-icon {
  font-size: 48px;
  margin: 14px 0;
}

/* Dia Completo (celebração ao fim de todas as tarefas do dia) */
.day-complete-card {
  text-align: center;
  background: linear-gradient(160deg, #6C5CE7 0%, #00B894 100%);
  color: #FFF;
}

.day-complete-icon {
  font-size: 44px;
  display: block;
  margin-bottom: 6px;
}

.day-complete-header h2 {
  font-family: 'Fredoka', cursive;
  font-size: 22px;
  margin-bottom: 4px;
}

.day-complete-header p {
  font-size: 13px;
  opacity: 0.9;
}

.day-complete-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 18px 0 10px 0;
}

.day-complete-stat {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--border-radius-md);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.day-complete-stat .stat-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.day-complete-stat .stat-val {
  font-family: 'Poppins', cursive;
  font-size: 18px;
  font-weight: 800;
}

.day-complete-stat .stat-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.85;
}

.day-complete-achievements {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.day-complete-achievements .badge-tag {
  background: rgba(255, 255, 255, 0.22);
  color: #FFF;
}

.day-complete-card .btn-outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: #FFF;
}

/* Keyframe Animations */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; }

/* Category & Age Filter Tabs */
.category-tabs, .age-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-tabs::-webkit-scrollbar, .age-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab, .age-tab, .lib-cat-tab {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--surface-secondary);
  border: 1px solid #E2E8F0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--transition-bounce);
}

.category-tab.active, .age-tab.active, .lib-cat-tab.active {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* Reward Category Tags */
.reward-category-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.reward-category-tag.virtual {
  background: #E0F2FE;
  color: #0284C7;
}

.reward-category-tag.physical {
  background: #FEF3C7;
  color: #D97706;
}

/* Library & Activities Section */
.library-banner {
  background: linear-gradient(135deg, #00B894 0%, #0984E3 100%);
  border-radius: var(--border-radius-md);
  padding: 16px;
  color: #FFF;
  box-shadow: var(--shadow-sm);
}

.library-banner h3 {
  font-family: 'Fredoka', cursive;
  font-size: 18px;
  margin-bottom: 4px;
}

.library-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-card {
  background: var(--surface);
  border-radius: var(--border-radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
  border: 1px solid #F1F5F9;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.library-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.library-card.completed-card {
  border-left: 4px solid var(--accent-green);
  background: #F0FDF4;
}

.lib-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #F7FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.lib-card-info {
  flex: 1;
}

.lib-card-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.lib-card-info p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.lib-meta {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}

.badge-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
}

.story-badge { background: #E0E7FF; color: #4338CA; }
.activity-badge { background: #DCFCE7; color: #15803D; }
.challenge-badge { background: #FEF3C7; color: #B45309; }

.lib-reward-tag {
  font-size: 10px;
  font-weight: 700;
  color: #D63031;
  background: #FFF5F5;
  padding: 2px 6px;
  border-radius: 6px;
}

/* Livros Recomendados (vitrine externa, sem interação de leitura no app) */
.section-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 4px;
}

.recommended-books-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recommended-book-card {
  background: #FFFBEB;
  border: 1px dashed #FBBF24;
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rec-book-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  background: #FFF;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rec-book-info h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.rec-book-author {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #B45309;
  margin-bottom: 3px;
}

.rec-book-info p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 6px;
}

/* Reader & Activity Modals */
.reader-header {
  padding: 40px 16px 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-secondary);
  border-bottom: 1px solid #E2E8F0;
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #EDF2F7;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-body {
  flex: 1;
  padding: 20px 16px 40px 16px;
  overflow-y: auto;
}

.story-cover {
  font-size: 60px;
  text-align: center;
  margin-bottom: 10px;
}

.story-title {
  font-family: 'Fredoka', cursive;
  font-size: 22px;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 14px;
}

.activity-desc {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 14px;
}

.story-content {
  font-size: 14px;
  line-height: 1.6;
  color: #2D3748;
  background: #F8FAFC;
  padding: 16px;
  border-radius: 12px;
  border-left: 4px solid var(--primary);
}

.reflection-box {
  background: #F0F4FF;
  border: 1px solid #C7D2FE;
  border-radius: 12px;
  padding: 14px;
}

.reflection-box h4 {
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 4px;
}

.reflection-box p {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.reflection-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reflection-option {
  padding: 8px 12px;
  background: #FFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.reflection-option.selected {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
}

/* Activity Step-by-Step */
.materials-card {
  background: #FEF9C3;
  border: 1px solid #FDE047;
  border-radius: 12px;
  padding: 12px 14px;
}

.materials-card h4 {
  font-size: 12px;
  color: #854D0E;
  margin-bottom: 6px;
}

.materials-list {
  padding-left: 18px;
  font-size: 12px;
  color: #713F12;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-card {
  background: #FFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFF;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text h5 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.step-text p {
  font-size: 12px;
  color: var(--text-muted);
}

/* History Modal */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.history-item {
  background: var(--surface-secondary);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-info h5 {
  font-size: 13px;
  font-weight: 700;
}

.history-info span {
  font-size: 10px;
  color: var(--text-muted);
}

.status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.status-pending { background: #FEF3C7; color: #D97706; }
.status-delivered { background: #DCFCE7; color: #15803D; }

/* Notification Bell & Badge in Header */
.notif-bell-btn {
  position: relative;
  font-size: 18px;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--secondary);
  color: #FFF;
  font-size: 10px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFF;
}

/* Motivational Banner */
.motivational-banner {
  background: linear-gradient(135deg, #FFC6FF 0%, #CDB4DB 100%);
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.motivational-icon {
  font-size: 26px;
  background: rgba(255,255,255,0.4);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.motivational-body h5 {
  font-size: 13px;
  font-weight: 800;
  color: #4A154B;
  margin-bottom: 2px;
}

.motivational-body p {
  font-size: 11px;
  color: #5C2D91;
  line-height: 1.2;
}

/* Floating Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-notification {
  pointer-events: auto;
  background: #FFF;
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-left: 5px solid var(--primary);
  min-width: 280px;
  max-width: 340px;
  animation: slideInToast 0.4s var(--transition-bounce), fadeOutToast 0.4s ease 3.6s forwards;
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutToast {
  to { opacity: 0; transform: translateY(-10px); }
}

.toast-icon {
  font-size: 24px;
}

.toast-body h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.toast-body p {
  font-size: 11px;
  color: var(--text-muted);
}

/* Notifications List Modal */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  background: var(--surface-secondary);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
}

.notif-item.notif-unread {
  background: #F0F4FF;
  border-left: 4px solid var(--primary);
}

.notif-item-icon {
  font-size: 20px;
}

.notif-item-content h5 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.notif-item-content p {
  font-size: 11px;
  color: var(--text-muted);
}

.notif-item-time {
  font-size: 9px;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
}

/* Reports & Performance Tab (Parent Dashboard) */
.reports-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.stat-mini-card {
  background: var(--surface-secondary);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.stat-mini-card .stat-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 4px;
}

.stat-mini-card .stat-val {
  font-family: 'Poppins', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.stat-mini-card .stat-lbl {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.report-chart-card {
  background: var(--surface);
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 14px;
}

.report-chart-card h4 {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* Weekly Bar Chart */
.weekly-chart {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 110px;
  padding-top: 15px;
  gap: 8px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-bg {
  width: 100%;
  max-width: 24px;
  height: 80px;
  background: #EDF2F7;
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-blue) 0%, var(--primary) 100%);
  border-radius: 12px;
  transition: height 0.5s var(--transition-bounce);
}

.chart-day-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Suggestions List */
.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestion-card {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.suggestion-info h5 {
  font-size: 12px;
  font-weight: 700;
}

.suggestion-info p {
  font-size: 10px;
  color: var(--text-muted);
}

/* Roadmap Button in Header */
.roadmap-btn {
  font-size: 16px;
  background: var(--surface-secondary);
}

/* Ranking Familiar Leaderboard */
.ranking-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-card {
  background: var(--surface);
  border: 1px solid #E2E8F0;
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.ranking-card.rank-pos-1 {
  border: 2px solid #FDE047;
  background: linear-gradient(135deg, #FEFCE8 0%, #FFF 100%);
}

.ranking-card.rank-pos-2 {
  border: 2px solid #CBD5E1;
  background: linear-gradient(135deg, #F8FAFC 0%, #FFF 100%);
}

.ranking-card.rank-pos-3 {
  border: 2px solid #FDBA74;
  background: linear-gradient(135deg, #FFF7ED 0%, #FFF 100%);
}

.rank-badge {
  font-size: 22px;
  font-weight: 800;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.rank-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #F1F5F9;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-details {
  flex: 1;
}

.rank-details h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.rank-details p {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
}

.rank-xp {
  font-family: 'Poppins', cursive;
  font-size: 14px;
  font-weight: 700;
  color: #D63031;
  background: #FFF5F5;
  padding: 4px 10px;
  border-radius: 12px;
  flex-shrink: 0;
}

/* Sprint Timeline Modal */
.sprint-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sprint-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  border-left: 5px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.sprint-card.completed {
  border-left-color: var(--accent-green);
  background: #F0FDF4;
}

.sprint-card.active-sprint {
  border-left-color: var(--primary);
  background: #F4F0FF;
}

.sprint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sprint-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.sprint-status-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
}

.status-completed-tag { background: #DCFCE7; color: #15803D; }
.status-active-tag { background: #E0E7FF; color: #4338CA; }

.sprint-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Responsivo Nativo para Telas Móveis / WebView Capacitor */
@media (max-width: 600px) {
  body {
    padding: 0;
    background: var(--surface);
  }

  .device-frame {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .device-notch {
    display: none;
  }

  .app-container {
    border-radius: 0;
    height: 100dvh;
  }
}

/* --- MODO ESCURO (DARK THEME) --- */
body.dark-theme {
  --bg-primary: #0F172A;
  --surface: #1E293B;
  --surface-secondary: #334155;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --card-border: #475569;
  background-color: #020617;
}

body.dark-theme .app-container {
  background: var(--surface);
  color: var(--text-main);
}

body.dark-theme .app-header {
  background: var(--surface-secondary);
  border-bottom-color: #475569;
}

body.dark-theme .task-card,
body.dark-theme .reward-card,
body.dark-theme .library-card,
body.dark-theme .modal-card,
body.dark-theme .stats-card,
body.dark-theme .ranking-card,
body.dark-theme .sprint-card {
  background: var(--surface-secondary);
  border-color: #475569;
  color: var(--text-main);
}

body.dark-theme .motivational-banner {
  background: linear-gradient(135deg, #312E81 0%, #1E1B4B 100%);
}

body.dark-theme .progress-card {
  background: var(--surface-secondary);
}

body.dark-theme .bottom-nav {
  background: var(--surface-secondary);
  border-top-color: #475569;
}

body.dark-theme input[type="text"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme select {
  background: #0F172A;
  color: #F8FAFC;
  border-color: #475569;
}

/* --- BARRAS DE BUSCA RÁPIDA --- */
.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--border-radius-md);
  border: 1px solid #E2E8F0;
  font-size: 13px;
  background: var(--surface-secondary);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123, 44, 191, 0.15);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
}

/* --- CRONÔMETRO / TEMPORIZADOR DE TAREFAS --- */
.timer-card {
  text-align: center;
  max-width: 340px;
}

.timer-task-icon {
  font-size: 40px;
  display: inline-block;
  margin-bottom: 4px;
}

.timer-display-box {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-svg .ring-bg {
  fill: none;
  stroke: #E2E8F0;
  stroke-width: 8;
}

body.dark-theme .timer-ring-svg .ring-bg {
  stroke: #334155;
}

.timer-ring-svg .ring-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s linear;
}

.timer-time-text {
  position: absolute;
  font-family: 'Poppins', monospace;
  font-size: 36px;
  font-weight: 800;
  color: var(--text-main);
}

.timer-presets {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #E2E8F0;
  background: var(--surface-secondary);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.preset-chip.active,
.preset-chip:hover {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
}

.timer-controls-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

/* --- BOTÕES DE BACKUP E BOTÃO DE TEMA --- */
.backup-btns-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-toggle-btn {
  font-size: 16px;
  background: var(--surface-secondary);
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.15) rotate(15deg);
}

/* --- CARD DO COFRE DA MESADA EM R$ --- */
.allowance-vault-card {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #FFFFFF;
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.vault-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vault-icon {
  font-size: 32px;
}

.vault-info h4 {
  font-family: 'Poppins', cursive;
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  color: #FFFFFF;
}

.vault-info p {
  font-size: 10px;
  margin: 2px 0 0 0;
  opacity: 0.9;
}

.reward-category-tag.allowance {
  background: #D1FAE5;
  color: #047857;
}






